diff --git a/.cargo/config b/.cargo/config index ad6720209..70c85ceee 100644 --- a/.cargo/config +++ b/.cargo/config @@ -59,3 +59,4 @@ proxmox-openid = { git = "git://git.proxmox.com/git/proxmox.git" } pxar = { git = "git://git.proxmox.com/git/pxar.git" } pathpatterns = { git = "git://git.proxmox.com/git/pathpatterns.git" } proxmox-apt = { git = "git://git.proxmox.com/git/proxmox.git" } +proxmox-rrd = { git = "git://git.proxmox.com/git/proxmox.git" } diff --git a/Cargo.lock b/Cargo.lock index 7f88acf09..42809f9aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,19 +43,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -93,9 +93,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bindgen" @@ -103,18 +103,18 @@ version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", "lazycell", "peeking_take_while", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2 1.0.78", + "quote 1.0.35", "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", "which", ] @@ -126,9 +126,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -178,9 +178,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -188,7 +188,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -199,9 +199,9 @@ checksum = "8d18b093eba54c9aaa1e3784d4361eb2ba944cf7d0a932a830132238f483e8d8" [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -237,9 +237,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -255,22 +255,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -300,8 +296,8 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2 1.0.78", + "quote 1.0.35", "strsim", "syn 1.0.109", ] @@ -313,15 +309,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", - "quote 1.0.33", + "quote 1.0.35", "syn 1.0.109", ] [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -390,9 +386,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -455,14 +451,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall", + "windows-sys 0.52.0", ] [[package]] @@ -513,9 +509,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -528,9 +524,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -538,15 +534,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -555,38 +551,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -612,9 +608,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -637,9 +633,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -682,9 +678,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -697,11 +693,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -728,9 +724,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -757,9 +753,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -772,7 +768,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -781,9 +777,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -820,9 +816,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -830,13 +826,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -850,9 +846,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -865,9 +861,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -920,18 +916,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -940,9 +936,9 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", - "redox_syscall 0.4.1", + "redox_syscall", ] [[package]] @@ -957,9 +953,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -985,9 +981,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -1024,9 +1020,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1107,6 +1103,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -1166,18 +1168,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openidconnect" @@ -1208,11 +1210,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -1227,9 +1229,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -1240,9 +1242,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1286,7 +1288,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -1322,7 +1324,7 @@ dependencies = [ [[package]] name = "pbs-buildcfg" -version = "3.1.2" +version = "3.1.4" [[package]] name = "pbs-client" @@ -1495,6 +1497,7 @@ dependencies = [ "libc", "log", "nix 0.26.4", + "openssl", "pbs-api-types", "pbs-config", "proxmox-io", @@ -1560,9 +1563,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -1571,9 +1574,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -1581,22 +1584,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -1617,9 +1620,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "powerfmt" @@ -1644,9 +1647,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1654,7 +1657,7 @@ dependencies = [ [[package]] name = "proxmox-acme" version = "0.5.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "base64 0.13.1", "openssl", @@ -1664,19 +1667,19 @@ dependencies = [ [[package]] name = "proxmox-api-macro" -version = "1.0.6" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "1.0.8" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "proxmox-apt" -version = "0.10.6" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.10.8" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "hex", @@ -1691,7 +1694,7 @@ dependencies = [ [[package]] name = "proxmox-async" version = "0.4.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "futures", @@ -1704,8 +1707,8 @@ dependencies = [ [[package]] name = "proxmox-auth-api" -version = "0.3.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.3.3" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base64 0.13.1", @@ -1728,7 +1731,7 @@ dependencies = [ [[package]] name = "proxmox-backup" -version = "3.1.2" +version = "3.1.4" dependencies = [ "anyhow", "async-trait", @@ -1861,12 +1864,12 @@ dependencies = [ [[package]] name = "proxmox-borrow" version = "1.0.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" [[package]] name = "proxmox-compression" version = "0.2.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "bytes", @@ -1931,7 +1934,7 @@ dependencies = [ [[package]] name = "proxmox-http" version = "0.9.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base64 0.13.1", @@ -1952,7 +1955,7 @@ dependencies = [ [[package]] name = "proxmox-http-error" version = "0.1.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "http", @@ -1961,8 +1964,8 @@ dependencies = [ [[package]] name = "proxmox-human-byte" -version = "0.1.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.1.3" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "proxmox-schema", @@ -1973,7 +1976,7 @@ dependencies = [ [[package]] name = "proxmox-io" version = "1.0.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "endian_trait", "tokio", @@ -1982,12 +1985,12 @@ dependencies = [ [[package]] name = "proxmox-lang" version = "1.1.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" [[package]] name = "proxmox-ldap" version = "0.2.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "ldap3", @@ -1998,7 +2001,7 @@ dependencies = [ [[package]] name = "proxmox-metrics" version = "0.3.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "futures", @@ -2015,7 +2018,7 @@ dependencies = [ [[package]] name = "proxmox-openid" version = "0.10.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "http", @@ -2033,8 +2036,8 @@ dependencies = [ [[package]] name = "proxmox-rest-server" -version = "0.5.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.5.2" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "futures", @@ -2105,8 +2108,8 @@ dependencies = [ [[package]] name = "proxmox-router" -version = "2.1.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "2.1.3" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "env_logger", @@ -2128,7 +2131,8 @@ dependencies = [ [[package]] name = "proxmox-rrd" -version = "0.1.0" +version = "0.1.1" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -2136,7 +2140,6 @@ dependencies = [ "libc", "log", "nix 0.26.4", - "proxmox-router", "proxmox-schema", "proxmox-sys", "proxmox-time", @@ -2147,8 +2150,8 @@ dependencies = [ [[package]] name = "proxmox-schema" -version = "2.0.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "3.0.0" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "lazy_static", @@ -2163,8 +2166,8 @@ dependencies = [ [[package]] name = "proxmox-section-config" -version = "2.0.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "2.0.1" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "hex", @@ -2177,7 +2180,7 @@ dependencies = [ [[package]] name = "proxmox-serde" version = "0.1.1" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base64 0.13.1", @@ -2189,7 +2192,7 @@ dependencies = [ [[package]] name = "proxmox-shared-memory" version = "0.3.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "libc", @@ -2200,17 +2203,17 @@ dependencies = [ [[package]] name = "proxmox-sortable-macro" version = "0.1.3" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "proxmox-subscription" -version = "0.4.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.4.3" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base64 0.13.1", @@ -2229,8 +2232,8 @@ dependencies = [ [[package]] name = "proxmox-sys" -version = "0.5.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "0.5.3" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base64 0.13.1", @@ -2249,8 +2252,8 @@ dependencies = [ [[package]] name = "proxmox-tfa" -version = "4.1.0" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "4.1.2" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "base32", @@ -2272,8 +2275,8 @@ dependencies = [ [[package]] name = "proxmox-time" -version = "1.1.5" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +version = "1.1.6" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -2286,7 +2289,7 @@ dependencies = [ [[package]] name = "proxmox-uuid" version = "1.0.2" -source = "git+git://git.proxmox.com/git/proxmox.git#bd3013690f242c4dba2b42b2189b74d6842a6a75" +source = "git+git://git.proxmox.com/git/proxmox.git#7126249102cfbe3f26d74ff6d6179c08b9513025" dependencies = [ "js-sys", "libc", @@ -2343,11 +2346,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.70", + "proc-macro2 1.0.78", ] [[package]] @@ -2390,15 +2393,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2421,9 +2415,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -2433,9 +2427,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -2489,11 +2483,11 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -2526,9 +2520,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2541,11 +2535,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2579,9 +2573,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -2608,20 +2602,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2630,9 +2624,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" dependencies = [ "itoa", "serde", @@ -2664,8 +2658,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] @@ -2682,9 +2676,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -2712,9 +2706,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smawk" @@ -2722,16 +2716,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -2783,19 +2767,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2 1.0.78", + "quote 1.0.35", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2 1.0.78", + "quote 1.0.35", "unicode-ident", ] @@ -2825,22 +2809,22 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", + "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -2858,33 +2842,34 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" dependencies = [ "deranged", "itoa", "libc", + "num-conv", "num_threads", "powerfmt", "serde", @@ -2900,10 +2885,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -2924,9 +2910,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2936,7 +2922,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -2947,9 +2933,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -2964,9 +2950,9 @@ dependencies = [ [[package]] name = "tokio-openssl" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a" +checksum = "6ffab79df67727f6acf57f1ff743091873c24c579b1e2ce4d8f53e47ded4d63d" dependencies = [ "futures-util", "openssl", @@ -3022,9 +3008,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3038,9 +3024,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -3066,9 +3052,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3121,7 +3107,7 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "flate2", "log", "native-tls", @@ -3186,9 +3172,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3196,53 +3182,53 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ - "quote 1.0.33", + "quote 1.0.35", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 2.0.39", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -3312,11 +3298,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -3453,11 +3439,13 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "xattr" -version = "1.0.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b5c2da880..8aa0721cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,7 +71,7 @@ proxmox-rest-server = { version = "0.5.1", features = [ "templates" ] } proxmox-router = { version = "2.0.0", default_features = false } proxmox-rrd = { version = "0.1" } # everything but pbs-config and pbs-client use "api-macro" -proxmox-schema = "2.0.0" +proxmox-schema = "3" proxmox-section-config = "2" proxmox-serde = "0.1.1" proxmox-shared-memory = "0.3.0" diff --git a/vendor/anyhow/.cargo-checksum.json b/vendor/anyhow/.cargo-checksum.json index 61baa0da2..367a669cd 100644 --- a/vendor/anyhow/.cargo-checksum.json +++ b/vendor/anyhow/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ad4ba159037235f4b84b0e5cde145868821e2b796a43b0da91b371864fb375ca","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"62fc2a591c37e781f76fe4d89bcd964eca4fbde246bc43cd4e2fe9db2d30ee70","build.rs":"dd4a590f26ffb846c2b9c6c441e090277750278679a2fad4bd08cf9dc33783d6","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"c63d72e7fb139e986bba63ec43e3f4754e520a88225afbd379110fdee40f3cc6","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"22e9d2f53d69e74987f22f37140ce2118cb251d415407408b6e3f6a7de2a2a85","src/ensure.rs":"d4c2588608e529275bfee1c1afc8860d7def868ab01e95a692a995ee06b2936e","src/error.rs":"f1877655eb07f01aa208293e6b39902fa54bbcb3e5248a3dfad74702fa10a120","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"89883cd3287921355ee99c988fb7687beb77644c3dec6fb3bb1308db5d6dc51a","src/lib.rs":"50cbebfd1844cd63f4ad13da0f77c2a013d9bc80adf701ebda19f94cc3d11896","src/macros.rs":"dd35f2ec2a0a25e4504fb04bcd42f6d0963bc0035aaaefc412f5ee1d78945fe1","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"3211e4dfe6fe3c5433041443a685fe283770b7962b39e565171ccf853585367c","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"ecccf9202a33611f64b76598806aa82abec2560ae058e32f63fb2fb3ef225be9","tests/test_backtrace.rs":"ed144f90bf62cc441de067f6cee09ece94bca9da8f9b492d11d3dc652ba83e26","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"3a8a8d7569913bd98c0e27c69d0bda35101e7fde7c056ed57cdd8ed018e4cbcb","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"797e69a72d125758c4c4897e5dc776d549d52cc9a6a633e0a33193f588a62b88","tests/test_ensure.rs":"89bb15f2a6288037bcf6ad976705038d9bea714da4244dee8314c720f88393c8","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"11f05010bc9b16319884c1286444100e30cddc2ecd1ffe5e0fd3fee5ffb32683","tests/test_repr.rs":"b3fa96b52a98b2111e845b59974910acb107a6526514c80fc5d9db7eed402682","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"315782f5f4246290fe190e3767b22c3dcaffaabc19c5ace0373537d53e765278","tests/ui/must-use.rs":"fb59860b43f673bf4a430a6036ba463e95028844d8dd4243cfe5ebc7f2be582f","tests/ui/must-use.stderr":"c2848c5f254b4c061eea6714d9baf709924aba06619eaf2a8b3aee1266b75f9e","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"04415aeaa14995f47f06f35fb1f6971d332d2110aabca920c30ab0803d6a0a5e","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"171f6c1c962503855480696e5d39e68946ec2a027b61a6f36ca1ad1b40265c5d","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"} \ No newline at end of file +{"files":{"Cargo.toml":"1696b9f34686556027ae9ba768e09f5e4a2362291158399fed2a1891a13d02ed","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"0999fd320cdb3300dd22ff03b97cd41945cc9833a02a5b7c53ed36ab6d6f66e7","build.rs":"a5ac61a8922f6b9bf319e2f8c0c20bdafb362b9c1f7805fc6d878660708e5ac2","build/probe.rs":"b8b792036f13c9c1fbc6b1244198ea2305e61ddfcda3856563b581dcb1e1fe6e","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"652ab0ff85c57cb6d34b97e15a705494f50aef77fc3916333d2b25ee05e6406c","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"04e4b80b9f6d8163edc53455b98ab0c40cb9ad104bcf0c74f8075f22024471ab","src/ensure.rs":"d4c2588608e529275bfee1c1afc8860d7def868ab01e95a692a995ee06b2936e","src/error.rs":"a274234af662770340b237c9016beea2f94e7906f3fe69d0d78057929889f25b","src/fmt.rs":"b27311c860a9bd7c2b16367a30fc5131b3eea56751e69208d196dfc656a2ba91","src/kind.rs":"89883cd3287921355ee99c988fb7687beb77644c3dec6fb3bb1308db5d6dc51a","src/lib.rs":"bbe72815f1ab2fdba675990e4083b77f62a96e76031a55ce5ad27ef98a230f2b","src/macros.rs":"dd35f2ec2a0a25e4504fb04bcd42f6d0963bc0035aaaefc412f5ee1d78945fe1","src/ptr.rs":"4cb31d2f815b178daf951bfb94a1930383e056c0ca68d494603f45d8eea35d50","src/wrapper.rs":"8800848623b464eb19e77550201e446ff6913c8c39537fe6f70df9e2b43a9b21","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"ecccf9202a33611f64b76598806aa82abec2560ae058e32f63fb2fb3ef225be9","tests/test_backtrace.rs":"ed144f90bf62cc441de067f6cee09ece94bca9da8f9b492d11d3dc652ba83e26","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"3a8a8d7569913bd98c0e27c69d0bda35101e7fde7c056ed57cdd8ed018e4cbcb","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"797e69a72d125758c4c4897e5dc776d549d52cc9a6a633e0a33193f588a62b88","tests/test_ensure.rs":"89bb15f2a6288037bcf6ad976705038d9bea714da4244dee8314c720f88393c8","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"81b14dd207ba5fbf02aaed031646810906c9c9c2fc5cabffc8e88f82462be499","tests/test_macros.rs":"11f05010bc9b16319884c1286444100e30cddc2ecd1ffe5e0fd3fee5ffb32683","tests/test_repr.rs":"b3fa96b52a98b2111e845b59974910acb107a6526514c80fc5d9db7eed402682","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"315782f5f4246290fe190e3767b22c3dcaffaabc19c5ace0373537d53e765278","tests/ui/must-use.rs":"fb59860b43f673bf4a430a6036ba463e95028844d8dd4243cfe5ebc7f2be582f","tests/ui/must-use.stderr":"c2848c5f254b4c061eea6714d9baf709924aba06619eaf2a8b3aee1266b75f9e","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"04415aeaa14995f47f06f35fb1f6971d332d2110aabca920c30ab0803d6a0a5e","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"171f6c1c962503855480696e5d39e68946ec2a027b61a6f36ca1ad1b40265c5d","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"} \ No newline at end of file diff --git a/vendor/anyhow/Cargo.toml b/vendor/anyhow/Cargo.toml index b6d042b4b..b92e7a329 100644 --- a/vendor/anyhow/Cargo.toml +++ b/vendor/anyhow/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.39" name = "anyhow" -version = "1.0.75" +version = "1.0.79" authors = ["David Tolnay "] description = "Flexible concrete Error type built on std::error::Error" documentation = "https://docs.rs/anyhow" diff --git a/vendor/anyhow/README.md b/vendor/anyhow/README.md index 6380c1c04..ccf3097c2 100644 --- a/vendor/anyhow/README.md +++ b/vendor/anyhow/README.md @@ -75,10 +75,10 @@ anyhow = "1.0" } ``` -- If using the nightly channel, or stable with `features = ["backtrace"]`, a - backtrace is captured and printed with the error if the underlying error type - does not already provide its own. In order to see backtraces, they must be - enabled through the environment variables described in [`std::backtrace`]: +- If using Rust ≥ 1.65, a backtrace is captured and printed with the error if + the underlying error type does not already provide its own. In order to see + backtraces, they must be enabled through the environment variables described + in [`std::backtrace`]: - If you want panics and errors to both have backtraces, set `RUST_BACKTRACE=1`; @@ -86,10 +86,7 @@ anyhow = "1.0" - If you want only panics to have backtraces, set `RUST_BACKTRACE=1` and `RUST_LIB_BACKTRACE=0`. - The tracking issue for this feature is [rust-lang/rust#53487]. - [`std::backtrace`]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables - [rust-lang/rust#53487]: https://github.com/rust-lang/rust/issues/53487 - Anyhow works with any error type that has an impl of `std::error::Error`, including ones defined in your crate. We do not bundle a `derive(Error)` macro diff --git a/vendor/anyhow/build.rs b/vendor/anyhow/build.rs index fc585cf64..7e95e6b55 100644 --- a/vendor/anyhow/build.rs +++ b/vendor/anyhow/build.rs @@ -1,9 +1,7 @@ -#![allow(clippy::option_if_let_else)] - use std::env; -use std::fs; +use std::ffi::OsString; use std::path::Path; -use std::process::{Command, ExitStatus, Stdio}; +use std::process::{self, Command, Stdio}; use std::str; #[cfg(all(feature = "backtrace", not(feature = "std")))] @@ -11,45 +9,53 @@ compile_error! { "`backtrace` feature without `std` feature is not supported" } -// This code exercises the surface area that we expect of the Error generic -// member access API. If the current toolchain is able to compile it, then -// anyhow is able to provide backtrace support. -const PROBE: &str = r#" - #![feature(error_generic_member_access)] - - use std::backtrace::Backtrace; - use std::error::{self, Error, Request}; - use std::fmt::{self, Debug, Display}; - - struct MyError(Thing); - struct Thing; - - impl Debug for MyError { - fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { - unimplemented!() - } - } - - impl Display for MyError { - fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { - unimplemented!() - } - } - - impl Error for MyError { - fn provide<'a>(&'a self, request: &mut Request<'a>) { - request.provide_ref(&self.0); - } - } - - const _: fn(&dyn Error) -> Option<&Backtrace> = |err| error::request_ref::(err); -"#; - fn main() { + let mut error_generic_member_access = false; if cfg!(feature = "std") { - match compile_probe() { - Some(status) if status.success() => println!("cargo:rustc-cfg=backtrace"), - _ => {} + println!("cargo:rerun-if-changed=build/probe.rs"); + + let consider_rustc_bootstrap; + if compile_probe(false) { + // This is a nightly or dev compiler, so it supports unstable + // features regardless of RUSTC_BOOTSTRAP. No need to rerun build + // script if RUSTC_BOOTSTRAP is changed. + error_generic_member_access = true; + consider_rustc_bootstrap = false; + } else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") { + if compile_probe(true) { + // This is a stable or beta compiler for which the user has set + // RUSTC_BOOTSTRAP to turn on unstable features. Rerun build + // script if they change it. + error_generic_member_access = true; + consider_rustc_bootstrap = true; + } else if rustc_bootstrap == "1" { + // This compiler does not support the generic member access API + // in the form that anyhow expects. No need to pay attention to + // RUSTC_BOOTSTRAP. + error_generic_member_access = false; + consider_rustc_bootstrap = false; + } else { + // This is a stable or beta compiler for which RUSTC_BOOTSTRAP + // is set to restrict the use of unstable features by this + // crate. + error_generic_member_access = false; + consider_rustc_bootstrap = true; + } + } else { + // Without RUSTC_BOOTSTRAP, this compiler does not support the + // generic member access API in the form that anyhow expects, but + // try again if the user turns on unstable features. + error_generic_member_access = false; + consider_rustc_bootstrap = true; + } + + if error_generic_member_access { + println!("cargo:rustc-cfg=std_backtrace"); + println!("cargo:rustc-cfg=error_generic_member_access"); + } + + if consider_rustc_bootstrap { + println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP"); } } @@ -59,15 +65,29 @@ fn main() { }; if rustc < 51 { + // core::ptr::addr_of + // https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis println!("cargo:rustc-cfg=anyhow_no_ptr_addr_of"); } if rustc < 52 { + // core::fmt::Arguments::as_str + // https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html#stabilized-apis println!("cargo:rustc-cfg=anyhow_no_fmt_arguments_as_str"); + + // #![deny(unsafe_op_in_unsafe_fn)] + // https://github.com/rust-lang/rust/issues/71668 + println!("cargo:rustc-cfg=anyhow_no_unsafe_op_in_unsafe_fn_lint"); + } + + if !error_generic_member_access && cfg!(feature = "std") && rustc >= 65 { + // std::backtrace::Backtrace + // https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#stabilized-apis + println!("cargo:rustc-cfg=std_backtrace"); } } -fn compile_probe() -> Option { +fn compile_probe(rustc_bootstrap: bool) -> bool { if env::var_os("RUSTC_STAGE").is_some() { // We are running inside rustc bootstrap. This is a highly non-standard // environment with issues such as: @@ -76,13 +96,12 @@ fn compile_probe() -> Option { // https://github.com/rust-lang/rust/issues/114839 // // Let's just not use nightly features here. - return None; + return false; } - let rustc = env::var_os("RUSTC")?; - let out_dir = env::var_os("OUT_DIR")?; - let probefile = Path::new(&out_dir).join("probe.rs"); - fs::write(&probefile, PROBE).ok()?; + let rustc = cargo_env_var("RUSTC"); + let out_dir = cargo_env_var("OUT_DIR"); + let probefile = Path::new("build").join("probe.rs"); // Make sure to pick up Cargo rustc configuration. let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") { @@ -94,11 +113,15 @@ fn compile_probe() -> Option { Command::new(rustc) }; + if !rustc_bootstrap { + cmd.env_remove("RUSTC_BOOTSTRAP"); + } + cmd.stderr(Stdio::null()) .arg("--edition=2018") - .arg("--crate-name=anyhow_build") + .arg("--crate-name=anyhow") .arg("--crate-type=lib") - .arg("--emit=metadata") + .arg("--emit=dep-info,metadata") .arg("--out-dir") .arg(out_dir) .arg(probefile); @@ -116,11 +139,14 @@ fn compile_probe() -> Option { } } - cmd.status().ok() + match cmd.status() { + Ok(status) => status.success(), + Err(_) => false, + } } fn rustc_minor_version() -> Option { - let rustc = env::var_os("RUSTC")?; + let rustc = cargo_env_var("RUSTC"); let output = Command::new(rustc).arg("--version").output().ok()?; let version = str::from_utf8(&output.stdout).ok()?; let mut pieces = version.split('.'); @@ -129,3 +155,13 @@ fn rustc_minor_version() -> Option { } pieces.next()?.parse().ok() } + +fn cargo_env_var(key: &str) -> OsString { + env::var_os(key).unwrap_or_else(|| { + eprintln!( + "Environment variable ${} is not set during execution of build script", + key, + ); + process::exit(1); + }) +} diff --git a/vendor/anyhow/build/probe.rs b/vendor/anyhow/build/probe.rs new file mode 100644 index 000000000..21e776daf --- /dev/null +++ b/vendor/anyhow/build/probe.rs @@ -0,0 +1,35 @@ +// This code exercises the surface area that we expect of the Error generic +// member access API. If the current toolchain is able to compile it, then +// anyhow is able to provide backtrace support. + +#![feature(error_generic_member_access)] + +use std::backtrace::Backtrace; +use std::error::{self, Error, Request}; +use std::fmt::{self, Debug, Display}; + +struct MyError(Thing); +struct Thing; + +impl Debug for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +impl Display for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +impl Error for MyError { + fn provide<'a>(&'a self, request: &mut Request<'a>) { + request.provide_ref(&self.0); + } +} + +const _: fn(&dyn Error) -> Option<&Backtrace> = |err| error::request_ref::(err); + +// Include in sccache cache key. +const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP"); diff --git a/vendor/anyhow/src/backtrace.rs b/vendor/anyhow/src/backtrace.rs index 7c1906b09..65ad1cceb 100644 --- a/vendor/anyhow/src/backtrace.rs +++ b/vendor/anyhow/src/backtrace.rs @@ -1,41 +1,41 @@ -#[cfg(backtrace)] +#[cfg(std_backtrace)] pub(crate) use std::backtrace::{Backtrace, BacktraceStatus}; -#[cfg(all(not(backtrace), feature = "backtrace"))] +#[cfg(all(not(std_backtrace), feature = "backtrace"))] pub(crate) use self::capture::{Backtrace, BacktraceStatus}; -#[cfg(not(any(backtrace, feature = "backtrace")))] +#[cfg(not(any(std_backtrace, feature = "backtrace")))] pub(crate) enum Backtrace {} -#[cfg(backtrace)] +#[cfg(std_backtrace)] macro_rules! impl_backtrace { () => { std::backtrace::Backtrace }; } -#[cfg(all(not(backtrace), feature = "backtrace"))] +#[cfg(all(not(std_backtrace), feature = "backtrace"))] macro_rules! impl_backtrace { () => { impl core::fmt::Debug + core::fmt::Display }; } -#[cfg(any(backtrace, feature = "backtrace"))] +#[cfg(any(std_backtrace, feature = "backtrace"))] macro_rules! backtrace { () => { Some(crate::backtrace::Backtrace::capture()) }; } -#[cfg(not(any(backtrace, feature = "backtrace")))] +#[cfg(not(any(std_backtrace, feature = "backtrace")))] macro_rules! backtrace { () => { None }; } -#[cfg(backtrace)] +#[cfg(error_generic_member_access)] macro_rules! backtrace_if_absent { ($err:expr) => { match std::error::request_ref::($err as &dyn std::error::Error) { @@ -45,21 +45,25 @@ macro_rules! backtrace_if_absent { }; } -#[cfg(all(feature = "std", not(backtrace), feature = "backtrace"))] +#[cfg(all( + feature = "std", + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") +))] macro_rules! backtrace_if_absent { ($err:expr) => { backtrace!() }; } -#[cfg(all(feature = "std", not(backtrace), not(feature = "backtrace")))] +#[cfg(all(feature = "std", not(std_backtrace), not(feature = "backtrace")))] macro_rules! backtrace_if_absent { ($err:expr) => { None }; } -#[cfg(all(not(backtrace), feature = "backtrace"))] +#[cfg(all(not(std_backtrace), feature = "backtrace"))] mod capture { use backtrace::{BacktraceFmt, BytesOrWideString, Frame, PrintFmt, SymbolName}; use core::cell::UnsafeCell; diff --git a/vendor/anyhow/src/context.rs b/vendor/anyhow/src/context.rs index d81b9a769..11b31ba9c 100644 --- a/vendor/anyhow/src/context.rs +++ b/vendor/anyhow/src/context.rs @@ -3,7 +3,7 @@ use crate::{Context, Error, StdError}; use core::convert::Infallible; use core::fmt::{self, Debug, Display, Write}; -#[cfg(backtrace)] +#[cfg(error_generic_member_access)] use std::error::Request; mod ext { @@ -143,7 +143,7 @@ where Some(&self.error) } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] fn provide<'a>(&'a self, request: &mut Request<'a>) { StdError::provide(&self.error, request); } @@ -157,7 +157,7 @@ where Some(unsafe { crate::ErrorImpl::error(self.error.inner.by_ref()) }) } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] fn provide<'a>(&'a self, request: &mut Request<'a>) { Error::provide(&self.error, request); } diff --git a/vendor/anyhow/src/error.rs b/vendor/anyhow/src/error.rs index 01402d44c..f24c4a65d 100644 --- a/vendor/anyhow/src/error.rs +++ b/vendor/anyhow/src/error.rs @@ -11,7 +11,7 @@ use core::mem::ManuallyDrop; #[cfg(not(anyhow_no_ptr_addr_of))] use core::ptr; use core::ptr::NonNull; -#[cfg(backtrace)] +#[cfg(error_generic_member_access)] use std::error::{self, Request}; #[cfg(feature = "std")] @@ -99,7 +99,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: object_downcast_mut::, object_drop_rest: object_drop_front::, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: no_backtrace, }; @@ -124,7 +127,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: object_downcast_mut::, object_drop_rest: object_drop_front::, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: no_backtrace, }; @@ -150,7 +156,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: object_downcast_mut::, object_drop_rest: object_drop_front::, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: no_backtrace, }; @@ -178,7 +187,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: context_downcast_mut::, object_drop_rest: context_drop_rest::, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: no_backtrace, }; @@ -204,7 +216,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: object_downcast_mut::>, object_drop_rest: object_drop_front::>, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: no_backtrace, }; @@ -317,7 +332,10 @@ impl Error { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: context_chain_downcast_mut::, object_drop_rest: context_chain_drop_rest::, - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: context_backtrace::, }; @@ -345,21 +363,17 @@ impl Error { /// /// # Stability /// - /// Standard library backtraces are only available on the nightly channel. - /// Tracking issue: [rust-lang/rust#53487][tracking]. - /// - /// On stable compilers, this function is only available if the crate's + /// Standard library backtraces are only available when using Rust ≥ + /// 1.65. On older compilers, this function is only available if the crate's /// "backtrace" feature is enabled, and will use the `backtrace` crate as - /// the underlying backtrace implementation. + /// the underlying backtrace implementation. The return type of this + /// function on old compilers is `&(impl Debug + Display)`. /// /// ```toml /// [dependencies] /// anyhow = { version = "1.0", features = ["backtrace"] } /// ``` - /// - /// [tracking]: https://github.com/rust-lang/rust/issues/53487 - #[cfg(any(backtrace, feature = "backtrace"))] - #[cfg_attr(doc_cfg, doc(cfg(any(nightly, feature = "backtrace"))))] + #[cfg(any(std_backtrace, feature = "backtrace"))] pub fn backtrace(&self) -> &impl_backtrace!() { unsafe { ErrorImpl::backtrace(self.inner.by_ref()) } } @@ -523,7 +537,7 @@ impl Error { } } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] pub(crate) fn provide<'a>(&'a self, request: &mut Request<'a>) { unsafe { ErrorImpl::provide(self.inner.by_ref(), request) } } @@ -533,7 +547,7 @@ impl Error { // deref'ing to dyn Error where the provide implementation would include // only the original error's Backtrace from before it got wrapped into an // anyhow::Error. - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] #[doc(hidden)] pub fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>) { Self::provide(self, request); @@ -602,7 +616,10 @@ struct ErrorVTable { #[cfg(anyhow_no_ptr_addr_of)] object_downcast_mut: unsafe fn(Mut, TypeId) -> Option>, object_drop_rest: unsafe fn(Own, TypeId), - #[cfg(all(not(backtrace), feature = "backtrace"))] + #[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") + ))] object_backtrace: unsafe fn(Ref) -> Option<&Backtrace>, } @@ -610,8 +627,8 @@ struct ErrorVTable { unsafe fn object_drop(e: Own) { // Cast back to ErrorImpl so that the allocator receives the correct // Layout to deallocate the Box's memory. - let unerased = e.cast::>().boxed(); - drop(unerased); + let unerased_own = e.cast::>(); + drop(unsafe { unerased_own.boxed() }); } // Safety: requires layout of *e to match ErrorImpl. @@ -620,8 +637,8 @@ unsafe fn object_drop_front(e: Own, target: TypeId) { // without dropping E itself. This is used by downcast after doing a // ptr::read to take ownership of the E. let _ = target; - let unerased = e.cast::>>().boxed(); - drop(unerased); + let unerased_own = e.cast::>>(); + drop(unsafe { unerased_own.boxed() }); } // Safety: requires layout of *e to match ErrorImpl. @@ -631,15 +648,15 @@ where { // Attach E's native StdError vtable onto a pointer to self._object. - let unerased = e.cast::>(); + let unerased_ref = e.cast::>(); #[cfg(not(anyhow_no_ptr_addr_of))] - return Ref::from_raw(NonNull::new_unchecked( - ptr::addr_of!((*unerased.as_ptr())._object) as *mut E, - )); + return Ref::from_raw(unsafe { + NonNull::new_unchecked(ptr::addr_of!((*unerased_ref.as_ptr())._object) as *mut E) + }); #[cfg(anyhow_no_ptr_addr_of)] - return Ref::new(&unerased.deref()._object); + return Ref::new(unsafe { &unerased_ref.deref()._object }); } // Safety: requires layout of *e to match ErrorImpl, and for `e` to be derived @@ -650,7 +667,8 @@ where E: StdError + Send + Sync + 'static, { // Attach E's native StdError vtable onto a pointer to self._object. - &mut e.cast::>().deref_mut()._object + let unerased_mut = e.cast::>(); + unsafe { &mut unerased_mut.deref_mut()._object } } // Safety: requires layout of *e to match ErrorImpl. @@ -659,7 +677,8 @@ where E: StdError + Send + Sync + 'static, { // Attach ErrorImpl's native StdError vtable. The StdError impl is below. - e.cast::>().boxed() + let unerased_own = e.cast::>(); + unsafe { unerased_own.boxed() } } // Safety: requires layout of *e to match ErrorImpl. @@ -671,18 +690,18 @@ where // Caller is looking for an E pointer and e is ErrorImpl, take a // pointer to its E field. - let unerased = e.cast::>(); + let unerased_ref = e.cast::>(); #[cfg(not(anyhow_no_ptr_addr_of))] return Some( - Ref::from_raw(NonNull::new_unchecked( - ptr::addr_of!((*unerased.as_ptr())._object) as *mut E, - )) + Ref::from_raw(unsafe { + NonNull::new_unchecked(ptr::addr_of!((*unerased_ref.as_ptr())._object) as *mut E) + }) .cast::<()>(), ); #[cfg(anyhow_no_ptr_addr_of)] - return Some(Ref::new(&unerased.deref()._object).cast::<()>()); + return Some(Ref::new(unsafe { &unerased_ref.deref()._object }).cast::<()>()); } else { None } @@ -697,14 +716,18 @@ where if TypeId::of::() == target { // Caller is looking for an E pointer and e is ErrorImpl, take a // pointer to its E field. - let unerased = e.cast::>().deref_mut(); + let unerased_mut = e.cast::>(); + let unerased = unsafe { unerased_mut.deref_mut() }; Some(Mut::new(&mut unerased._object).cast::<()>()) } else { None } } -#[cfg(all(not(backtrace), feature = "backtrace"))] +#[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") +))] fn no_backtrace(e: Ref) -> Option<&Backtrace> { let _ = e; None @@ -718,10 +741,12 @@ where E: 'static, { if TypeId::of::() == target { - let unerased = e.cast::>>().deref(); + let unerased_ref = e.cast::>>(); + let unerased = unsafe { unerased_ref.deref() }; Some(Ref::new(&unerased._object.context).cast::<()>()) } else if TypeId::of::() == target { - let unerased = e.cast::>>().deref(); + let unerased_ref = e.cast::>>(); + let unerased = unsafe { unerased_ref.deref() }; Some(Ref::new(&unerased._object.error).cast::<()>()) } else { None @@ -736,10 +761,12 @@ where E: 'static, { if TypeId::of::() == target { - let unerased = e.cast::>>().deref_mut(); + let unerased_mut = e.cast::>>(); + let unerased = unsafe { unerased_mut.deref_mut() }; Some(Mut::new(&mut unerased._object.context).cast::<()>()) } else if TypeId::of::() == target { - let unerased = e.cast::>>().deref_mut(); + let unerased_mut = e.cast::>>(); + let unerased = unsafe { unerased_mut.deref_mut() }; Some(Mut::new(&mut unerased._object.error).cast::<()>()) } else { None @@ -756,15 +783,11 @@ where // Called after downcasting by value to either the C or the E and doing a // ptr::read to take ownership of that value. if TypeId::of::() == target { - let unerased = e - .cast::, E>>>() - .boxed(); - drop(unerased); + let unerased_own = e.cast::, E>>>(); + drop(unsafe { unerased_own.boxed() }); } else { - let unerased = e - .cast::>>>() - .boxed(); - drop(unerased); + let unerased_own = e.cast::>>>(); + drop(unsafe { unerased_own.boxed() }); } } @@ -773,13 +796,14 @@ unsafe fn context_chain_downcast(e: Ref, target: TypeId) -> Option where C: 'static, { - let unerased = e.cast::>>().deref(); + let unerased_ref = e.cast::>>(); + let unerased = unsafe { unerased_ref.deref() }; if TypeId::of::() == target { Some(Ref::new(&unerased._object.context).cast::<()>()) } else { // Recurse down the context chain per the inner error's vtable. let source = &unerased._object.error; - (vtable(source.inner.ptr).object_downcast)(source.inner.by_ref(), target) + unsafe { (vtable(source.inner.ptr).object_downcast)(source.inner.by_ref(), target) } } } @@ -789,13 +813,14 @@ unsafe fn context_chain_downcast_mut(e: Mut, target: TypeId) -> Op where C: 'static, { - let unerased = e.cast::>>().deref_mut(); + let unerased_mut = e.cast::>>(); + let unerased = unsafe { unerased_mut.deref_mut() }; if TypeId::of::() == target { Some(Mut::new(&mut unerased._object.context).cast::<()>()) } else { // Recurse down the context chain per the inner error's vtable. let source = &mut unerased._object.error; - (vtable(source.inner.ptr).object_downcast_mut)(source.inner.by_mut(), target) + unsafe { (vtable(source.inner.ptr).object_downcast_mut)(source.inner.by_mut(), target) } } } @@ -807,33 +832,34 @@ where // Called after downcasting by value to either the C or one of the causes // and doing a ptr::read to take ownership of that value. if TypeId::of::() == target { - let unerased = e - .cast::, Error>>>() - .boxed(); + let unerased_own = e.cast::, Error>>>(); // Drop the entire rest of the data structure rooted in the next Error. - drop(unerased); + drop(unsafe { unerased_own.boxed() }); } else { - let unerased = e - .cast::>>>() - .boxed(); + let unerased_own = e.cast::>>>(); + let unerased = unsafe { unerased_own.boxed() }; // Read the Own from the next error. let inner = unerased._object.error.inner; drop(unerased); - let vtable = vtable(inner.ptr); + let vtable = unsafe { vtable(inner.ptr) }; // Recursively drop the next error using the same target typeid. - (vtable.object_drop_rest)(inner, target); + unsafe { (vtable.object_drop_rest)(inner, target) }; } } // Safety: requires layout of *e to match ErrorImpl>. -#[cfg(all(not(backtrace), feature = "backtrace"))] +#[cfg(all( + not(error_generic_member_access), + any(std_backtrace, feature = "backtrace") +))] #[allow(clippy::unnecessary_wraps)] unsafe fn context_backtrace(e: Ref) -> Option<&Backtrace> where C: 'static, { - let unerased = e.cast::>>().deref(); - let backtrace = ErrorImpl::backtrace(unerased._object.error.inner.by_ref()); + let unerased_ref = e.cast::>>(); + let unerased = unsafe { unerased_ref.deref() }; + let backtrace = unsafe { ErrorImpl::backtrace(unerased._object.error.inner.by_ref()) }; Some(backtrace) } @@ -853,7 +879,7 @@ pub(crate) struct ErrorImpl { // avoids converting `p` into a reference. unsafe fn vtable(p: NonNull) -> &'static ErrorVTable { // NOTE: This assumes that `ErrorVTable` is the first field of ErrorImpl. - *(p.as_ptr() as *const &'static ErrorVTable) + unsafe { *(p.as_ptr() as *const &'static ErrorVTable) } } // repr C to ensure that ContextError has the same layout as @@ -877,7 +903,7 @@ impl ErrorImpl { pub(crate) unsafe fn error(this: Ref) -> &(dyn StdError + Send + Sync + 'static) { // Use vtable to attach E's native StdError vtable for the right // original type E. - (vtable(this.ptr).object_ref)(this).deref() + unsafe { (vtable(this.ptr).object_ref)(this).deref() } } #[cfg(feature = "std")] @@ -886,42 +912,44 @@ impl ErrorImpl { // original type E. #[cfg(not(anyhow_no_ptr_addr_of))] - return (vtable(this.ptr).object_ref)(this.by_ref()) - .by_mut() - .deref_mut(); + return unsafe { + (vtable(this.ptr).object_ref)(this.by_ref()) + .by_mut() + .deref_mut() + }; #[cfg(anyhow_no_ptr_addr_of)] - return (vtable(this.ptr).object_mut)(this); + return unsafe { (vtable(this.ptr).object_mut)(this) }; } - #[cfg(any(backtrace, feature = "backtrace"))] + #[cfg(any(std_backtrace, feature = "backtrace"))] pub(crate) unsafe fn backtrace(this: Ref) -> &Backtrace { // This unwrap can only panic if the underlying error's backtrace method // is nondeterministic, which would only happen in maliciously // constructed code. - this.deref() + unsafe { this.deref() } .backtrace .as_ref() .or_else(|| { - #[cfg(backtrace)] - return error::request_ref::(Self::error(this)); - #[cfg(not(backtrace))] - return (vtable(this.ptr).object_backtrace)(this); + #[cfg(error_generic_member_access)] + return error::request_ref::(unsafe { Self::error(this) }); + #[cfg(not(error_generic_member_access))] + return unsafe { (vtable(this.ptr).object_backtrace)(this) }; }) .expect("backtrace capture failed") } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] unsafe fn provide<'a>(this: Ref<'a, Self>, request: &mut Request<'a>) { - if let Some(backtrace) = &this.deref().backtrace { + if let Some(backtrace) = unsafe { &this.deref().backtrace } { request.provide_ref(backtrace); } - Self::error(this).provide(request); + unsafe { Self::error(this) }.provide(request); } #[cold] pub(crate) unsafe fn chain(this: Ref) -> Chain { - Chain::new(Self::error(this)) + Chain::new(unsafe { Self::error(this) }) } } @@ -933,7 +961,7 @@ where unsafe { ErrorImpl::error(self.erase()).source() } } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] fn provide<'a>(&'a self, request: &mut Request<'a>) { unsafe { ErrorImpl::provide(self.erase(), request) } } diff --git a/vendor/anyhow/src/fmt.rs b/vendor/anyhow/src/fmt.rs index 03d8fd394..a99649b25 100644 --- a/vendor/anyhow/src/fmt.rs +++ b/vendor/anyhow/src/fmt.rs @@ -5,10 +5,11 @@ use core::fmt::{self, Debug, Write}; impl ErrorImpl { pub(crate) unsafe fn display(this: Ref, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", Self::error(this))?; + write!(f, "{}", unsafe { Self::error(this) })?; if f.alternate() { - for cause in Self::chain(this).skip(1) { + let chain = unsafe { Self::chain(this) }; + for cause in chain.skip(1) { write!(f, ": {}", cause)?; } } @@ -17,7 +18,7 @@ impl ErrorImpl { } pub(crate) unsafe fn debug(this: Ref, f: &mut fmt::Formatter) -> fmt::Result { - let error = Self::error(this); + let error = unsafe { Self::error(this) }; if f.alternate() { return Debug::fmt(error, f); @@ -39,11 +40,11 @@ impl ErrorImpl { } } - #[cfg(any(backtrace, feature = "backtrace"))] + #[cfg(any(std_backtrace, feature = "backtrace"))] { use crate::backtrace::BacktraceStatus; - let backtrace = Self::backtrace(this); + let backtrace = unsafe { Self::backtrace(this) }; if let BacktraceStatus::Captured = backtrace.status() { let mut backtrace = backtrace.to_string(); write!(f, "\n\n")?; diff --git a/vendor/anyhow/src/lib.rs b/vendor/anyhow/src/lib.rs index 5ec17ada9..490a07593 100644 --- a/vendor/anyhow/src/lib.rs +++ b/vendor/anyhow/src/lib.rs @@ -128,11 +128,10 @@ //! # ; //! ``` //! -//! - If using the nightly channel, or stable with `features = ["backtrace"]`, a -//! backtrace is captured and printed with the error if the underlying error -//! type does not already provide its own. In order to see backtraces, they -//! must be enabled through the environment variables described in -//! [`std::backtrace`]: +//! - If using Rust ≥ 1.65, a backtrace is captured and printed with the +//! error if the underlying error type does not already provide its own. In +//! order to see backtraces, they must be enabled through the environment +//! variables described in [`std::backtrace`]: //! //! - If you want panics and errors to both have backtraces, set //! `RUST_BACKTRACE=1`; @@ -140,10 +139,7 @@ //! - If you want only panics to have backtraces, set `RUST_BACKTRACE=1` and //! `RUST_LIB_BACKTRACE=0`. //! -//! The tracking issue for this feature is [rust-lang/rust#53487]. -//! //! [`std::backtrace`]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables -//! [rust-lang/rust#53487]: https://github.com/rust-lang/rust/issues/53487 //! //! - Anyhow works with any error type that has an impl of `std::error::Error`, //! including ones defined in your crate. We do not bundle a `derive(Error)` @@ -210,11 +206,16 @@ //! will require an explicit `.map_err(Error::msg)` when working with a //! non-Anyhow error type inside a function that returns Anyhow's error type. -#![doc(html_root_url = "https://docs.rs/anyhow/1.0.75")] -#![cfg_attr(backtrace, feature(error_generic_member_access))] +#![doc(html_root_url = "https://docs.rs/anyhow/1.0.79")] +#![cfg_attr(error_generic_member_access, feature(error_generic_member_access))] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![cfg_attr(not(feature = "std"), no_std)] #![deny(dead_code, unused_imports, unused_mut)] +#![cfg_attr( + not(anyhow_no_unsafe_op_in_unsafe_fn_lint), + deny(unsafe_op_in_unsafe_fn) +)] +#![cfg_attr(anyhow_no_unsafe_op_in_unsafe_fn_lint, allow(unused_unsafe))] #![allow( clippy::doc_markdown, clippy::enum_glob_use, @@ -229,12 +230,20 @@ clippy::new_ret_no_self, clippy::redundant_else, clippy::return_self_not_must_use, + clippy::struct_field_names, clippy::unused_self, clippy::used_underscore_binding, clippy::wildcard_imports, clippy::wrong_self_convention )] +#[cfg(all( + anyhow_nightly_testing, + feature = "std", + not(error_generic_member_access) +))] +compile_error!("Build script probe failed to compile."); + extern crate alloc; #[macro_use] diff --git a/vendor/anyhow/src/ptr.rs b/vendor/anyhow/src/ptr.rs index c7fe488b6..a1b71260d 100644 --- a/vendor/anyhow/src/ptr.rs +++ b/vendor/anyhow/src/ptr.rs @@ -42,7 +42,7 @@ where } pub unsafe fn boxed(self) -> Box { - Box::from_raw(self.ptr.as_ptr()) + unsafe { Box::from_raw(self.ptr.as_ptr()) } } pub fn by_ref(&self) -> Ref { @@ -120,7 +120,7 @@ where } pub unsafe fn deref(self) -> &'a T { - &*self.ptr.as_ptr() + unsafe { &*self.ptr.as_ptr() } } } @@ -179,13 +179,13 @@ where } pub unsafe fn deref_mut(self) -> &'a mut T { - &mut *self.ptr.as_ptr() + unsafe { &mut *self.ptr.as_ptr() } } } impl<'a, T> Mut<'a, T> { pub unsafe fn read(self) -> T { - self.ptr.as_ptr().read() + unsafe { self.ptr.as_ptr().read() } } } diff --git a/vendor/anyhow/src/wrapper.rs b/vendor/anyhow/src/wrapper.rs index 8a6d686f6..0eb5478ad 100644 --- a/vendor/anyhow/src/wrapper.rs +++ b/vendor/anyhow/src/wrapper.rs @@ -1,7 +1,7 @@ use crate::StdError; use core::fmt::{self, Debug, Display}; -#[cfg(backtrace)] +#[cfg(error_generic_member_access)] use std::error::Request; #[repr(transparent)] @@ -74,7 +74,7 @@ impl StdError for BoxedError { self.0.source() } - #[cfg(backtrace)] + #[cfg(error_generic_member_access)] fn provide<'a>(&'a self, request: &mut Request<'a>) { self.0.provide(request); } diff --git a/vendor/anyhow/tests/test_fmt.rs b/vendor/anyhow/tests/test_fmt.rs index cc4929197..9766d366e 100644 --- a/vendor/anyhow/tests/test_fmt.rs +++ b/vendor/anyhow/tests/test_fmt.rs @@ -79,7 +79,7 @@ fn test_altdisplay() { } #[test] -#[cfg_attr(not(backtrace), ignore)] +#[cfg_attr(not(std_backtrace), ignore)] fn test_debug() { assert_eq!(EXPECTED_DEBUG_F, format!("{:?}", f().unwrap_err())); assert_eq!(EXPECTED_DEBUG_G, format!("{:?}", g().unwrap_err())); diff --git a/vendor/async-trait/.cargo-checksum.json b/vendor/async-trait/.cargo-checksum.json index 94d79ae94..463a28363 100644 --- a/vendor/async-trait/.cargo-checksum.json +++ b/vendor/async-trait/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"d2e4c5dc8ec7e68d2efdedf30334f48cd31a6e4c7b7acd4c6fbb8da28588ae4c","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5b94948e52c1410eae55fb8e4084e8837d0f8eb0c000698dc13fac591c70dc1b","build.rs":"ad9da6073db9c5c1e1128aed696590ab10f1ad6a46dee4499d20c7ed60127093","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/bound.rs":"ea6a8d0c1a33521163e5546463f68f6dbda0d35a59e75597be6bf04e0b7b23ad","src/expand.rs":"2d0b0f122c3ec393ce67db6fa177626d8fca0c4f5558b42f4fee219f31b97f9e","src/lib.rs":"3b381b9c34d6d7134e499bbb491c4fb64f0a6b871367fe72c3046a7d40bfc848","src/lifetime.rs":"e5ccfba2fa7ecb226cba247286c661f20a84e9a0ad2d789bdfee166cd5250160","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"356b4ac3e45607d041927799b12c1390c28e6333079343a38799d31ff5dfbe33","src/verbatim.rs":"45d0b691fab21f20d3414733f00d82845442d23b6f2547f8d6880a709d0d3b2a","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"203646366ce6959bf7e727372eaaf16c8f6e7b7c6c7cc5e12c259244d7254550","tests/ui/arg-implementation-detail.rs":"7199aba887dd0a8a14c86ec16542a73a70244930f8202940f43e40a62f72d200","tests/ui/arg-implementation-detail.stderr":"c3ff1a2a9a9ca4368cb8719e2a035a6d2d45b367212bec2b1fe2712fcfbbbe5d","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"0e1d5902f1ed99a60c6126416806b7c40f4ac9bdd78f26d8e6d866738cc332df","tests/ui/consider-restricting.rs":"bff794222d9324241155568d541e7beac0238b66ce14039b242d4392f4e531b6","tests/ui/consider-restricting.stderr":"a8f7f45aa196febb5d7550597f47b72ba0176d05599260e56a438148b42de840","tests/ui/delimiter-span.rs":"f4fd804223ce3be0d4eecdfd222afdd835c5393e2473ff4932116163943c0bc9","tests/ui/delimiter-span.stderr":"7b5bbe4be3be533d31d1302649b317465bc28cc7f042b98ec78e8b9a82828155","tests/ui/lifetime-defined-here.rs":"3139a3d92cf787c43afd93da2d967ee80d114ee3a0b9c924da9601b5c6614ef5","tests/ui/lifetime-defined-here.stderr":"0d4236821e0f43e5ae38a99319a64020576e78a49a71d8c94eb8a486d384308c","tests/ui/lifetime-span.rs":"bbcaa92c2bc08e18cf0c7e9ca1f0bd8080772ebde8b067d819eb2fd662e47b3b","tests/ui/lifetime-span.stderr":"db67c5078ab66725227b8f4c612ff97b39cb45d5d6b7a4191766a34a6c711547","tests/ui/missing-async-in-impl.rs":"5a5538d08d11c145211a92af0d8973eee8b21f33b90adda85430805bd3dbbc83","tests/ui/missing-async-in-impl.stderr":"2916bc8a51e25f4dd18eaf433b916d533943eac2c1afbee64e9a89e7b928040d","tests/ui/missing-async-in-trait.rs":"dc67241593f270233ba885df92e59164126416e68d49d8d62edc251666b5db6e","tests/ui/missing-async-in-trait.stderr":"67e66e7b19358830deff3ba01f5d701a9ae05c4e6fa9c081c49c1c75efbb7ade","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"e5ee994398bf8294324d61df02467a4229f68f4113bf5acc004851c03d66ec6a","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"e9989ec6ae4e87f117cd9ffd73e774b5477eb28c9df5b508dbd3654b783e5bf4","tests/ui/no-attribute-macro.rs":"99aaad298a8ef366029e53b6d320b14f18e04057a117ff58a0aebad65f01e22f","tests/ui/no-attribute-macro.stderr":"48dc13503b181f36271f5632ca835ea9e8d977d9dfcbe786f64a6633f3bb9b6b","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"016ef4f29156250f073f4f6cd3096d2889325709bd693938e0d368077b752551","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"b2cd38ce3cadda8f9e641b98e37db51afba47eab21d29cbfc47a90c8a444aa27","tests/ui/unreachable.rs":"be0aa7cc129fe42a1fbd85e36b3f08c6a2bd16c90ed2e33fc4c50e40ce085bcd","tests/ui/unreachable.stderr":"73beb71cb74076f2cb45485271de31658cf59f4143e62daa34b9f2a8980ddfcd","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"64fc5d45cb51330f0a1e85e69a28b69ddda12a109aa6a8ba3eaee1ac58d93b5f"},"package":"a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"} \ No newline at end of file +{"files":{"Cargo.toml":"c3fa0686c2633fa0aee8044fb543af437d2180c3d56875934ae824603ec18d13","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"caa22edc176059d74c0ad5b7266fd8e8d4164f67b597164c9aa41244a9f08df3","build.rs":"9f9975151b7e9cae692471ff00059392207d8bd66ed51a4d1de61f85693e8e3c","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/bound.rs":"ea6a8d0c1a33521163e5546463f68f6dbda0d35a59e75597be6bf04e0b7b23ad","src/expand.rs":"2d0b0f122c3ec393ce67db6fa177626d8fca0c4f5558b42f4fee219f31b97f9e","src/lib.rs":"1153f494f064422f63d1fe625b0e8029c47b4ce8b3c5f64f0d94ef62798f999a","src/lifetime.rs":"e5ccfba2fa7ecb226cba247286c661f20a84e9a0ad2d789bdfee166cd5250160","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"356b4ac3e45607d041927799b12c1390c28e6333079343a38799d31ff5dfbe33","src/verbatim.rs":"45d0b691fab21f20d3414733f00d82845442d23b6f2547f8d6880a709d0d3b2a","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"2eba31217eeff7f67e786f4c279d1168385204c07c4b28b607a29ce9ede9d86a","tests/ui/arg-implementation-detail.rs":"7199aba887dd0a8a14c86ec16542a73a70244930f8202940f43e40a62f72d200","tests/ui/arg-implementation-detail.stderr":"c3ff1a2a9a9ca4368cb8719e2a035a6d2d45b367212bec2b1fe2712fcfbbbe5d","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"0e1d5902f1ed99a60c6126416806b7c40f4ac9bdd78f26d8e6d866738cc332df","tests/ui/consider-restricting.rs":"bff794222d9324241155568d541e7beac0238b66ce14039b242d4392f4e531b6","tests/ui/consider-restricting.stderr":"a8f7f45aa196febb5d7550597f47b72ba0176d05599260e56a438148b42de840","tests/ui/delimiter-span.rs":"f4fd804223ce3be0d4eecdfd222afdd835c5393e2473ff4932116163943c0bc9","tests/ui/delimiter-span.stderr":"7b5bbe4be3be533d31d1302649b317465bc28cc7f042b98ec78e8b9a82828155","tests/ui/lifetime-defined-here.rs":"3139a3d92cf787c43afd93da2d967ee80d114ee3a0b9c924da9601b5c6614ef5","tests/ui/lifetime-defined-here.stderr":"0d4236821e0f43e5ae38a99319a64020576e78a49a71d8c94eb8a486d384308c","tests/ui/lifetime-span.rs":"bbcaa92c2bc08e18cf0c7e9ca1f0bd8080772ebde8b067d819eb2fd662e47b3b","tests/ui/lifetime-span.stderr":"db67c5078ab66725227b8f4c612ff97b39cb45d5d6b7a4191766a34a6c711547","tests/ui/missing-async-in-impl.rs":"5a5538d08d11c145211a92af0d8973eee8b21f33b90adda85430805bd3dbbc83","tests/ui/missing-async-in-impl.stderr":"2916bc8a51e25f4dd18eaf433b916d533943eac2c1afbee64e9a89e7b928040d","tests/ui/missing-async-in-trait.rs":"dc67241593f270233ba885df92e59164126416e68d49d8d62edc251666b5db6e","tests/ui/missing-async-in-trait.stderr":"67e66e7b19358830deff3ba01f5d701a9ae05c4e6fa9c081c49c1c75efbb7ade","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"e5ee994398bf8294324d61df02467a4229f68f4113bf5acc004851c03d66ec6a","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"3f4c30eb0234da366b6dc360b0ff85ef5f621003055fb64a0e1fc18d4a0e244f","tests/ui/no-attribute-macro.rs":"99aaad298a8ef366029e53b6d320b14f18e04057a117ff58a0aebad65f01e22f","tests/ui/no-attribute-macro.stderr":"a6ae9bb5914777c780021e223877bc21f38e7716d351ab98aef668dc349bd3ab","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"016ef4f29156250f073f4f6cd3096d2889325709bd693938e0d368077b752551","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"b2cd38ce3cadda8f9e641b98e37db51afba47eab21d29cbfc47a90c8a444aa27","tests/ui/unreachable.rs":"be0aa7cc129fe42a1fbd85e36b3f08c6a2bd16c90ed2e33fc4c50e40ce085bcd","tests/ui/unreachable.stderr":"73beb71cb74076f2cb45485271de31658cf59f4143e62daa34b9f2a8980ddfcd","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"64fc5d45cb51330f0a1e85e69a28b69ddda12a109aa6a8ba3eaee1ac58d93b5f"},"package":"c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"} \ No newline at end of file diff --git a/vendor/async-trait/Cargo.toml b/vendor/async-trait/Cargo.toml index 0bb776443..ad75a205b 100644 --- a/vendor/async-trait/Cargo.toml +++ b/vendor/async-trait/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "async-trait" -version = "0.1.74" +version = "0.1.77" authors = ["David Tolnay "] description = "Type erasure for async trait methods" documentation = "https://docs.rs/async-trait" @@ -34,29 +34,29 @@ targets = ["x86_64-unknown-linux-gnu"] proc-macro = true [dependencies.proc-macro2] -version = "1.0.63" +version = "1.0.74" [dependencies.quote] -version = "1.0.29" +version = "1.0.35" [dependencies.syn] -version = "2.0.23" +version = "2.0.46" features = [ "full", "visit-mut", ] [dev-dependencies.futures] -version = "0.3.28" +version = "0.3.30" [dev-dependencies.rustversion] version = "1.0.13" [dev-dependencies.tracing] -version = "0.1.37" +version = "0.1.40" [dev-dependencies.tracing-attributes] -version = "0.1.26" +version = "0.1.27" [dev-dependencies.trybuild] version = "1.0.81" diff --git a/vendor/async-trait/README.md b/vendor/async-trait/README.md index 39e368bad..97dbac950 100644 --- a/vendor/async-trait/README.md +++ b/vendor/async-trait/README.md @@ -6,29 +6,43 @@ Async trait methods [docs.rs](https://docs.rs/async-trait) [build status](https://github.com/dtolnay/async-trait/actions?query=branch%3Amaster) -The initial round of stabilizations for the async/await language feature in Rust -1.39 did not include support for async fn in traits. Trying to include an async -fn in a trait produces the following error: +The stabilization of async functions in traits in Rust 1.75 did not include +support for using traits containing async functions as `dyn Trait`. Trying to +use dyn with an async trait produces the following error: ```rust -trait MyTrait { - async fn f() {} +pub trait Trait { + async fn f(&self); +} + +pub fn make() -> Box { + unimplemented!() } ``` ```console -error[E0706]: trait fns cannot be declared `async` - --> src/main.rs:4:5 +error[E0038]: the trait `Trait` cannot be made into an object + --> src/main.rs:5:22 | -4 | async fn f() {} - | ^^^^^^^^^^^^^^^ +5 | pub fn make() -> Box { + | ^^^^^^^^^ `Trait` cannot be made into an object + | +note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit + --> src/main.rs:2:14 + | +1 | pub trait Trait { + | ----- this trait cannot be made into an object... +2 | async fn f(&self); + | ^ ...because method `f` is `async` + = help: consider moving `f` to another trait ``` -This crate provides an attribute macro to make async fn in traits work. +This crate provides an attribute macro to make async fn in traits work with dyn +traits. Please refer to [*why async fn in traits are hard*][hard] for a deeper analysis -of how this implementation differs from what the compiler and language hope to -deliver in the future. +of how this implementation differs from what the compiler and language deliver +natively. [hard]: https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/ @@ -40,7 +54,9 @@ This example implements the core of a highly effective advertising platform using async fn in a trait. The only thing to notice here is that we write an `#[async_trait]` macro on top -of traits and trait impls that contain async fn, and then they work. +of traits and trait impls that contain async fn, and then they work. We get to +have `Vec>` or `&[&dyn Advertisement]`, for +example. ```rust use async_trait::async_trait; @@ -95,15 +111,14 @@ can't be that badly broken. - 👍 Associated types; - 👍 Having async and non-async functions in the same trait; - 👍 Default implementations provided by the trait; -- 👍 Elided lifetimes; -- 👍 Dyn-capable traits. +- 👍 Elided lifetimes.
## Explanation Async fns get transformed into methods that return `Pin>` and delegate to a private async freestanding function. +'async_trait>>` and delegate to an async block. For example the `impl Advertisement for AutoplayingVideo` above would be expanded as: @@ -116,11 +131,9 @@ impl Advertisement for AutoplayingVideo { where Self: Sync + 'async_trait, { - async fn run(_self: &AutoplayingVideo) { + Box::pin(async move { /* the original method body */ - } - - Box::pin(run(self)) + }) } } ``` diff --git a/vendor/async-trait/build.rs b/vendor/async-trait/build.rs index f25fb0a86..db7c5f0eb 100644 --- a/vendor/async-trait/build.rs +++ b/vendor/async-trait/build.rs @@ -17,10 +17,6 @@ fn main() { if compiler < 47 { println!("cargo:rustc-cfg=self_span_hack"); } - - if compiler >= 75 && env::var_os("DOCS_RS").is_none() { - println!("cargo:rustc-cfg=native_async_fn_in_trait"); - } } fn rustc_minor_version() -> Option { diff --git a/vendor/async-trait/src/lib.rs b/vendor/async-trait/src/lib.rs index 435d508b1..7a4857462 100644 --- a/vendor/async-trait/src/lib.rs +++ b/vendor/async-trait/src/lib.rs @@ -6,32 +6,45 @@ //! //!
//! -//!
Type erasure for async trait methods
+//!

Type erasure for async trait methods

//! -//! The initial round of stabilizations for the async/await language feature in -//! Rust 1.39 did not include support for async fn in traits. Trying to include -//! an async fn in a trait produces the following error: +//! The stabilization of async functions in traits in Rust 1.75 did not include +//! support for using traits containing async functions as `dyn Trait`. Trying +//! to use dyn with an async trait produces the following error: //! -#![cfg_attr(not(native_async_fn_in_trait), doc = "```compile_fail")] -#![cfg_attr(native_async_fn_in_trait, doc = "```")] -//! trait MyTrait { -//! async fn f() {} +//! ```compile_fail +//! pub trait Trait { +//! async fn f(&self); //! } -#![doc = "```"] //! -//! ```text -//! error[E0706]: trait fns cannot be declared `async` -//! --> src/main.rs:4:5 -//! | -//! 4 | async fn f() {} -//! | ^^^^^^^^^^^^^^^ +//! pub fn make() -> Box { +//! unimplemented!() +//! } //! ``` //! -//! This crate provides an attribute macro to make async fn in traits work. +//! ```text +//! error[E0038]: the trait `Trait` cannot be made into an object +//! --> src/main.rs:5:22 +//! | +//! 5 | pub fn make() -> Box { +//! | ^^^^^^^^^ `Trait` cannot be made into an object +//! | +//! note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit +//! --> src/main.rs:2:14 +//! | +//! 1 | pub trait Trait { +//! | ----- this trait cannot be made into an object... +//! 2 | async fn f(&self); +//! | ^ ...because method `f` is `async` +//! = help: consider moving `f` to another trait +//! ``` +//! +//! This crate provides an attribute macro to make async fn in traits work with +//! dyn traits. //! //! Please refer to [*why async fn in traits are hard*][hard] for a deeper //! analysis of how this implementation differs from what the compiler and -//! language hope to deliver in the future. +//! language deliver natively. //! //! [hard]: https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/ //! @@ -43,7 +56,9 @@ //! using async fn in a trait. //! //! The only thing to notice here is that we write an `#[async_trait]` macro on -//! top of traits and trait impls that contain async fn, and then they work. +//! top of traits and trait impls that contain async fn, and then they work. We +//! get to have `Vec>` or `&[&dyn Advertisement]`, +//! for example. //! //! ``` //! use async_trait::async_trait; @@ -111,15 +126,14 @@ //! > ☑ Associated types;
//! > ☑ Having async and non-async functions in the same trait;
//! > ☑ Default implementations provided by the trait;
-//! > ☑ Elided lifetimes;
-//! > ☑ Dyn-capable traits.
+//! > ☑ Elided lifetimes.
//! //!
//! //! # Explanation //! //! Async fns get transformed into methods that return `Pin>` and delegate to a private async freestanding function. +//! Send + 'async_trait>>` and delegate to an async block. //! //! For example the `impl Advertisement for AutoplayingVideo` above would be //! expanded as: @@ -133,11 +147,9 @@ //! where //! Self: Sync + 'async_trait, //! { -//! async fn run(_self: &AutoplayingVideo) { +//! Box::pin(async move { //! /* the original method body */ -//! } -//! -//! Box::pin(run(self)) +//! }) //! } //! } //! # }; @@ -304,7 +316,7 @@ //! let object = &value as &dyn ObjectSafe; //! ``` -#![doc(html_root_url = "https://docs.rs/async-trait/0.1.74")] +#![doc(html_root_url = "https://docs.rs/async-trait/0.1.77")] #![allow( clippy::default_trait_access, clippy::doc_markdown, diff --git a/vendor/async-trait/tests/test.rs b/vendor/async-trait/tests/test.rs index 650959cc1..b78c9ffe4 100644 --- a/vendor/async-trait/tests/test.rs +++ b/vendor/async-trait/tests/test.rs @@ -620,7 +620,6 @@ pub mod issue45 { } #[test] - #[cfg_attr(miri, ignore)] // https://github.com/matklad/once_cell/pull/185 fn tracing() { // Create the future outside of the subscriber, as no call to tracing // should be made until the future is polled. diff --git a/vendor/async-trait/tests/ui/must-use.stderr b/vendor/async-trait/tests/ui/must-use.stderr index 9b71d109f..79e0a7a2c 100644 --- a/vendor/async-trait/tests/ui/must-use.stderr +++ b/vendor/async-trait/tests/ui/must-use.stderr @@ -1,14 +1,22 @@ +error: unused pinned boxed `Future` trait object that must be used + --> tests/ui/must-use.rs:18:5 + | +18 | Thing.f(); + | ^^^^^^^^^ + | + = note: futures do nothing unless you `.await` or poll them +note: the lint level is defined here + --> tests/ui/must-use.rs:1:9 + | +1 | #![deny(unused_must_use)] + | ^^^^^^^^^^^^^^^ + error: unused return value of `Interface::f` that must be used --> tests/ui/must-use.rs:18:5 | 18 | Thing.f(); | ^^^^^^^^^ | -note: the lint level is defined here - --> tests/ui/must-use.rs:1:9 - | -1 | #![deny(unused_must_use)] - | ^^^^^^^^^^^^^^^ help: use `let _ = ...` to ignore the resulting value | 18 | let _ = Thing.f(); diff --git a/vendor/async-trait/tests/ui/no-attribute-macro.stderr b/vendor/async-trait/tests/ui/no-attribute-macro.stderr index 35d8d5a54..cb15522bc 100644 --- a/vendor/async-trait/tests/ui/no-attribute-macro.stderr +++ b/vendor/async-trait/tests/ui/no-attribute-macro.stderr @@ -12,3 +12,5 @@ note: for a trait to be "object safe" it needs to allow building a vtable to all 2 | async fn method(&self); | ^^^^^^ ...because method `method` is `async` = help: consider moving `method` to another trait + = help: only type `Struct` is seen to implement the trait in this crate, consider using it directly instead + = note: `Trait` can be implemented in other crates; if you want to support your users passing their own types here, you can't refer to a specific type diff --git a/vendor/base64/.cargo-checksum.json b/vendor/base64/.cargo-checksum.json index 7aab19cee..27744e0ba 100644 --- a/vendor/base64/.cargo-checksum.json +++ b/vendor/base64/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"3fcb2ea14aeaf0ebde20e464f0a735b2f58b0fecc99a20c11421ce47788911b8","Cargo.toml":"8a94eedc97a8458e7becfa780a67dfa2ea959bb5660c77dc8236fb7c6a9a64e6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7","README.md":"df01f5b4317d601e7de86743f9818aec9196abf9e298f5e47679b7a966ecd945","RELEASE-NOTES.md":"fa36233aeddb2e63dc0580ffc69a5a1cdbf24f962146ab2d6b817381e2f38cdd","benches/benchmarks.rs":"da4a49294a7fcaf718f2b062a52ed669ca096abce6c57b4025efdd24825048c2","clippy.toml":"b26be4d15ed059985ce6994f11817fd7562046f46e460a0dc64dbb71cfc246d1","examples/base64.rs":"8c48673029aeeb1e06a2ecfd237acf8ef24349990e97f6d2c4d0fa2af36c94b3","icon_CLion.svg":"cffa044ba75cb998ee3306991dc4a3755ec2f39ab95ddd4b74bc21988389020f","src/alphabet.rs":"f0cba9462692db0bc9572e3d03c01ac77ff705fa9e664db4162da1a279a871e1","src/chunked_encoder.rs":"edfdbb9a4329b80fb2c769ada81e234e00839e0fa85faaa70bacf40ce12e951c","src/decode.rs":"666ca75ccd975f0548d37312d2843ca4703b83697a044839bbefeba8f4f7874a","src/display.rs":"31bf3e19274a0b80dd8948a81ea535944f756ef5b88736124c940f5fe1e8c71c","src/encode.rs":"0c827067fced8a20723be2586ebbad94e4749e2cdad463091c4fd6899bd1d0e7","src/engine/general_purpose/decode.rs":"ba8a76d333ab96dd07b3f84bd6d405d690d2d17e84bd0878f05245a82dc16853","src/engine/general_purpose/decode_suffix.rs":"71ceb066b73e8cc833916e2cedbf0a01b07c2f16e30b2b2f63aff1c823874b51","src/engine/general_purpose/mod.rs":"9f49375fc03166a491acf464daa7a9e6540fdc2cca407da9a248e15640952c20","src/engine/mod.rs":"15210115e5f99e0d252a1240922deb1516778e318564f92a9d880a82fd82a55e","src/engine/naive.rs":"dc166010633e8de0fbff31e2f05d128506f3e0f34a6358c1a825b59a8ea1af0d","src/engine/tests.rs":"37bee2de07343bf5d37720f29cda291e8562f2363704e0ad91862d5991568d22","src/lib.rs":"c1eb62ba9f461dfa00b5297c9bc3d9f6c6702295806d43bb82e46ffb54ea61ed","src/prelude.rs":"c1587138e5301ac797c5c362cb3638649b33f79c20c16db6f38ad44330540752","src/read/decoder.rs":"cc87daa4c52a23d1275352bccf07468baf2b60e90b2ac14f89a94254697cb83c","src/read/decoder_tests.rs":"edeee377e70095532be1625d0148de2273b739e9069a05e616d3e67877d92f1d","src/read/mod.rs":"e0b714eda02d16b1ffa6f78fd09b2f963e01c881b1f7c17b39db4e904be5e746","src/tests.rs":"90cb9f8a1ccb7c4ddc4f8618208e0031fc97e0df0e5aa466d6a5cf45d25967d8","src/write/encoder.rs":"c889c853249220fe2ddaeb77ee6e2ee2945f7db88cd6658ef89ff71b81255ea8","src/write/encoder_string_writer.rs":"0326c9d120369b9bbc35697b5b9b141bed24283374c93d5af1052eb042e47799","src/write/encoder_tests.rs":"28695a485b17cf5db73656aae5d90127f726e02c6d70efd83e5ab53a4cc17b38","src/write/mod.rs":"73cd98dadc9d712b3fefd9449d97e825e097397441b90588e0051e4d3b0911b9","tests/encode.rs":"5309f4538b1df611436f7bfba7409c725161b6f841b1bbf8d9890ae185de7d88","tests/tests.rs":"78efcf0dc4bb6ae52f7a91fcad89e44e4dce578224c36b4e6c1c306459be8500"},"package":"35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"} \ No newline at end of file +{"files":{"Cargo.lock":"36372e08a5cf4b713529f222928466b4d9bdc4116896bb9f121022c3b66502f1","Cargo.toml":"a261c28ccafada2884a75cab0e4e67326bafe720d58c937dc235521105982165","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7","README.md":"df01f5b4317d601e7de86743f9818aec9196abf9e298f5e47679b7a966ecd945","RELEASE-NOTES.md":"208162655e96cdf04949b6c0a53f24985095c8b188d7ea2c1017a23ce45e25eb","benches/benchmarks.rs":"da4a49294a7fcaf718f2b062a52ed669ca096abce6c57b4025efdd24825048c2","clippy.toml":"b26be4d15ed059985ce6994f11817fd7562046f46e460a0dc64dbb71cfc246d1","examples/base64.rs":"b75ead2199a9b4389c69fe6f1ae988176a263b8fc84e7a4fea1d7e5a41592078","icon_CLion.svg":"cffa044ba75cb998ee3306991dc4a3755ec2f39ab95ddd4b74bc21988389020f","src/alphabet.rs":"3461a34bd63c10cfe232deb5dd42e2ec2dfb5decd508caf31ec2a1826ad68131","src/chunked_encoder.rs":"edfdbb9a4329b80fb2c769ada81e234e00839e0fa85faaa70bacf40ce12e951c","src/decode.rs":"666ca75ccd975f0548d37312d2843ca4703b83697a044839bbefeba8f4f7874a","src/display.rs":"31bf3e19274a0b80dd8948a81ea535944f756ef5b88736124c940f5fe1e8c71c","src/encode.rs":"44ddcc162f3fe9817b6e857dda0a3b9197b90a657e5f71c44aacabf5431ccf7d","src/engine/general_purpose/decode.rs":"ba8a76d333ab96dd07b3f84bd6d405d690d2d17e84bd0878f05245a82dc16853","src/engine/general_purpose/decode_suffix.rs":"71ceb066b73e8cc833916e2cedbf0a01b07c2f16e30b2b2f63aff1c823874b51","src/engine/general_purpose/mod.rs":"9f49375fc03166a491acf464daa7a9e6540fdc2cca407da9a248e15640952c20","src/engine/mod.rs":"15210115e5f99e0d252a1240922deb1516778e318564f92a9d880a82fd82a55e","src/engine/naive.rs":"dc166010633e8de0fbff31e2f05d128506f3e0f34a6358c1a825b59a8ea1af0d","src/engine/tests.rs":"37bee2de07343bf5d37720f29cda291e8562f2363704e0ad91862d5991568d22","src/lib.rs":"3f964521aea13dbe49438ffed630a55471401da4c55c40506969697b649237f0","src/prelude.rs":"c1587138e5301ac797c5c362cb3638649b33f79c20c16db6f38ad44330540752","src/read/decoder.rs":"cc87daa4c52a23d1275352bccf07468baf2b60e90b2ac14f89a94254697cb83c","src/read/decoder_tests.rs":"edeee377e70095532be1625d0148de2273b739e9069a05e616d3e67877d92f1d","src/read/mod.rs":"e0b714eda02d16b1ffa6f78fd09b2f963e01c881b1f7c17b39db4e904be5e746","src/tests.rs":"90cb9f8a1ccb7c4ddc4f8618208e0031fc97e0df0e5aa466d6a5cf45d25967d8","src/write/encoder.rs":"c889c853249220fe2ddaeb77ee6e2ee2945f7db88cd6658ef89ff71b81255ea8","src/write/encoder_string_writer.rs":"0326c9d120369b9bbc35697b5b9b141bed24283374c93d5af1052eb042e47799","src/write/encoder_tests.rs":"28695a485b17cf5db73656aae5d90127f726e02c6d70efd83e5ab53a4cc17b38","src/write/mod.rs":"73cd98dadc9d712b3fefd9449d97e825e097397441b90588e0051e4d3b0911b9","tests/encode.rs":"5309f4538b1df611436f7bfba7409c725161b6f841b1bbf8d9890ae185de7d88","tests/tests.rs":"78efcf0dc4bb6ae52f7a91fcad89e44e4dce578224c36b4e6c1c306459be8500"},"package":"9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"} \ No newline at end of file diff --git a/vendor/base64/Cargo.lock b/vendor/base64/Cargo.lock index da628ba3f..8721331c4 100644 --- a/vendor/base64/Cargo.lock +++ b/vendor/base64/Cargo.lock @@ -18,21 +18,173 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] -name = "ansi_term" -version = "0.12.1" +name = "async-attributes" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "winapi", + "quote", + "syn 1.0.109", ] +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.2.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.1.1", + "async-executor", + "async-io 2.2.2", + "async-lock 3.3.0", + "blocking", + "futures-lite 2.2.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.3.1", + "rustix 0.38.28", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-attributes", + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -45,14 +197,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" dependencies = [ + "clap", "criterion", - "lazy_static", + "once_cell", "rand", "rstest", "rstest_reuse", - "structopt", + "strum", ] [[package]] @@ -61,6 +214,28 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.1.1", + "async-lock 3.3.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", +] + [[package]] name = "bumpalo" version = "3.14.0" @@ -106,31 +281,34 @@ dependencies = [ "half", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - [[package]] name = "clap" version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "bitflags", + "atty", + "bitflags 1.3.2", + "clap_derive", "clap_lex", "indexmap", - "textwrap 0.16.0", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -142,6 +320,15 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "criterion" version = "0.4.0" @@ -152,7 +339,7 @@ dependencies = [ "atty", "cast", "ciborium", - "clap 3.2.25", + "clap", "criterion-plot", "itertools", "lazy_static", @@ -180,36 +367,28 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "either" @@ -218,16 +397,203 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] -name = "getrandom" -version = "0.2.10" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "half" version = "1.8.2" @@ -242,12 +608,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -258,6 +621,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + [[package]] name = "indexmap" version = "1.9.3" @@ -268,6 +637,26 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.3", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -279,19 +668,28 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -300,30 +698,36 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "num-traits" @@ -336,9 +740,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -352,6 +756,35 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "plotters" version = "0.3.5" @@ -380,6 +813,36 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.28", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -412,18 +875,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -509,9 +972,22 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rstest" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d912f35156a3f99a66ee3e11ac2e0b3f34ac85a07e05263d05a7e2c8810d616f" +checksum = "b939295f93cb1d12bc1a83cf9ee963199b133fb8a79832dd51b68bb9f59a04dc" +dependencies = [ + "async-std", + "futures", + "futures-timer", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78aba848123782ba59340928ec7d876ebe745aa0365d6af8a630f19a5c16116" dependencies = [ "cfg-if", "proc-macro2", @@ -522,13 +998,14 @@ dependencies = [ [[package]] name = "rstest_reuse" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29d3117bce27ea307d1fb7ce12c64ba11b3fd04311a42d32bc5f0072e6e3d4d" +checksum = "88530b681abe67924d42cca181d070e3ac20e0740569441a9e35a7cedd2b34a4" dependencies = [ "quote", + "rand", "rustc_version", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -541,10 +1018,43 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.15" +name = "rustix" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -555,43 +1065,37 @@ dependencies = [ "winapi-util", ] -[[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.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -599,33 +1103,50 @@ dependencies = [ ] [[package]] -name = "strsim" -version = "0.8.0" +name = "slab" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "structopt" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "clap 2.34.0", - "lazy_static", - "structopt-derive", + "autocfg", ] [[package]] -name = "structopt-derive" -version = "0.4.18" +name = "socket2" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "rustversion", + "syn 2.0.48", ] [[package]] @@ -641,9 +1162,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -651,12 +1172,12 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "unicode-width", + "winapi-util", ] [[package]] @@ -675,6 +1196,22 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -682,22 +1219,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-segmentation" -version = "1.10.1" +name = "value-bag" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +checksum = "7cdbaf5e132e593e9fc1de6a15bbec912395b11fb9719e061cf64f804524c503" [[package]] name = "version_check" @@ -705,6 +1230,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + [[package]] name = "walkdir" version = "2.4.0" @@ -723,9 +1254,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -733,24 +1264,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" +name = "wasm-bindgen-futures" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -758,28 +1301,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -815,3 +1358,135 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/vendor/base64/Cargo.toml b/vendor/base64/Cargo.toml index 2de75ab22..e50829752 100644 --- a/vendor/base64/Cargo.toml +++ b/vendor/base64/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.48.0" name = "base64" -version = "0.21.5" +version = "0.21.7" authors = [ "Alice Maz ", "Marshall Pierce ", @@ -58,24 +58,29 @@ name = "benchmarks" harness = false required-features = ["std"] +[dev-dependencies.clap] +version = "3.2.25" +features = ["derive"] + [dev-dependencies.criterion] version = "0.4.0" -[dev-dependencies.lazy_static] -version = "1.4.0" +[dev-dependencies.once_cell] +version = "1" [dev-dependencies.rand] version = "0.8.5" features = ["small_rng"] [dev-dependencies.rstest] -version = "0.12.0" +version = "0.13.0" [dev-dependencies.rstest_reuse] -version = "0.3.0" +version = "0.6.0" -[dev-dependencies.structopt] -version = "0.3.26" +[dev-dependencies.strum] +version = "0.25" +features = ["derive"] [features] alloc = [] diff --git a/vendor/base64/RELEASE-NOTES.md b/vendor/base64/RELEASE-NOTES.md index d6d94c5a8..003121554 100644 --- a/vendor/base64/RELEASE-NOTES.md +++ b/vendor/base64/RELEASE-NOTES.md @@ -1,3 +1,11 @@ +# 0.21.7 + +- Support getting an alphabet's contents as a str via `Alphabet::as_str()` + +# 0.21.6 + +- Improved introductory documentation and example + # 0.21.5 - Add `Debug` and `Clone` impls for the general purpose Engine diff --git a/vendor/base64/examples/base64.rs b/vendor/base64/examples/base64.rs index 0a214d282..0c8aa3fe7 100644 --- a/vendor/base64/examples/base64.rs +++ b/vendor/base64/examples/base64.rs @@ -2,51 +2,40 @@ use std::fs::File; use std::io::{self, Read}; use std::path::PathBuf; use std::process; -use std::str::FromStr; use base64::{alphabet, engine, read, write}; -use structopt::StructOpt; +use clap::Parser; -#[derive(Debug, StructOpt)] +#[derive(Clone, Debug, Parser, strum::EnumString, Default)] +#[strum(serialize_all = "kebab-case")] enum Alphabet { + #[default] Standard, UrlSafe, } -impl Default for Alphabet { - fn default() -> Self { - Self::Standard - } -} - -impl FromStr for Alphabet { - type Err = String; - fn from_str(s: &str) -> Result { - match s { - "standard" => Ok(Self::Standard), - "urlsafe" => Ok(Self::UrlSafe), - _ => Err(format!("alphabet '{}' unrecognized", s)), - } - } -} - /// Base64 encode or decode FILE (or standard input), to standard output. -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] struct Opt { - /// decode data - #[structopt(short = "d", long = "decode")] + /// Decode the base64-encoded input (default: encode the input as base64). + #[structopt(short = 'd', long = "decode")] decode: bool, - /// The alphabet to choose. Defaults to the standard base64 alphabet. - /// Supported alphabets include "standard" and "urlsafe". + + /// The encoding alphabet: "standard" (default) or "url-safe". #[structopt(long = "alphabet")] alphabet: Option, - /// The file to encode/decode. - #[structopt(parse(from_os_str))] + + /// Omit padding characters while encoding, and reject them while decoding. + #[structopt(short = 'p', long = "no-padding")] + no_padding: bool, + + /// The file to encode or decode. + #[structopt(name = "FILE", parse(from_os_str))] file: Option, } fn main() { - let opt = Opt::from_args(); + let opt = Opt::parse(); let stdin; let mut input: Box = match opt.file { None => { @@ -66,7 +55,10 @@ fn main() { Alphabet::Standard => alphabet::STANDARD, Alphabet::UrlSafe => alphabet::URL_SAFE, }, - engine::general_purpose::PAD, + match opt.no_padding { + true => engine::general_purpose::NO_PAD, + false => engine::general_purpose::PAD, + }, ); let stdout = io::stdout(); diff --git a/vendor/base64/src/alphabet.rs b/vendor/base64/src/alphabet.rs index f7cd81911..7895914fe 100644 --- a/vendor/base64/src/alphabet.rs +++ b/vendor/base64/src/alphabet.rs @@ -38,17 +38,18 @@ const ALPHABET_SIZE: usize = 64; /// }; /// ``` /// -/// Building a lazy_static: +/// Building lazily: /// /// ``` /// use base64::{ /// alphabet::Alphabet, /// engine::{general_purpose::GeneralPurpose, GeneralPurposeConfig}, /// }; +/// use once_cell::sync::Lazy; /// -/// lazy_static::lazy_static! { -/// static ref CUSTOM: Alphabet = Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").unwrap(); -/// } +/// static CUSTOM: Lazy = Lazy::new(|| +/// Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").unwrap() +/// ); /// ``` #[derive(Clone, Debug, Eq, PartialEq)] pub struct Alphabet { @@ -122,6 +123,11 @@ impl Alphabet { Ok(Self::from_str_unchecked(alphabet)) } + + /// Create a `&str` from the symbols in the `Alphabet` + pub fn as_str(&self) -> &str { + core::str::from_utf8(&self.symbols).unwrap() + } } impl convert::TryFrom<&str> for Alphabet { @@ -159,21 +165,21 @@ impl fmt::Display for ParseAlphabetError { #[cfg(any(feature = "std", test))] impl error::Error for ParseAlphabetError {} -/// The standard alphabet (uses `+` and `/`). +/// The standard alphabet (with `+` and `/`) specified in [RFC 4648][]. /// -/// See [RFC 3548](https://tools.ietf.org/html/rfc3548#section-3). +/// [RFC 4648]: https://datatracker.ietf.org/doc/html/rfc4648#section-4 pub const STANDARD: Alphabet = Alphabet::from_str_unchecked( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ); -/// The URL safe alphabet (uses `-` and `_`). +/// The URL-safe alphabet (with `-` and `_`) specified in [RFC 4648][]. /// -/// See [RFC 3548](https://tools.ietf.org/html/rfc3548#section-4). +/// [RFC 4648]: https://datatracker.ietf.org/doc/html/rfc4648#section-5 pub const URL_SAFE: Alphabet = Alphabet::from_str_unchecked( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", ); -/// The `crypt(3)` alphabet (uses `.` and `/` as the first two values). +/// The `crypt(3)` alphabet (with `.` and `/` as the _first_ two characters). /// /// Not standardized, but folk wisdom on the net asserts that this alphabet is what crypt uses. pub const CRYPT: Alphabet = Alphabet::from_str_unchecked( @@ -185,7 +191,7 @@ pub const BCRYPT: Alphabet = Alphabet::from_str_unchecked( "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ); -/// The alphabet used in IMAP-modified UTF-7 (uses `+` and `,`). +/// The alphabet used in IMAP-modified UTF-7 (with `+` and `,`). /// /// See [RFC 3501](https://tools.ietf.org/html/rfc3501#section-5.1.3) pub const IMAP_MUTF7: Alphabet = Alphabet::from_str_unchecked( @@ -269,4 +275,11 @@ mod tests { .unwrap() ); } + + #[test] + fn str_same_as_input() { + let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + let a = Alphabet::try_from(alphabet).unwrap(); + assert_eq!(alphabet, a.as_str()) + } } diff --git a/vendor/base64/src/encode.rs b/vendor/base64/src/encode.rs index 88e649924..ae6d79074 100644 --- a/vendor/base64/src/encode.rs +++ b/vendor/base64/src/encode.rs @@ -98,7 +98,8 @@ pub const fn encoded_len(bytes_len: usize, padding: bool) -> Option { let rem = bytes_len % 3; let complete_input_chunks = bytes_len / 3; - // `let Some(_) = _ else` requires 1.65.0, whereas this messier one works on 1.48 + // `?` is disallowed in const, and `let Some(_) = _ else` requires 1.65.0, whereas this + // messier syntax works on 1.48 let complete_chunk_output = if let Some(complete_chunk_output) = complete_input_chunks.checked_mul(4) { complete_chunk_output diff --git a/vendor/base64/src/lib.rs b/vendor/base64/src/lib.rs index 6b11fa66b..6ec3c12a7 100644 --- a/vendor/base64/src/lib.rs +++ b/vendor/base64/src/lib.rs @@ -1,100 +1,124 @@ -//! # Getting started +//! Correct, fast, and configurable [base64][] decoding and encoding. Base64 +//! transports binary data efficiently in contexts where only plain text is +//! allowed. //! -//! 1. Perhaps one of the preconfigured engines in [engine::general_purpose] will suit, e.g. -//! [engine::general_purpose::STANDARD_NO_PAD]. -//! - These are re-exported in [prelude] with a `BASE64_` prefix for those who prefer to -//! `use base64::prelude::*` or equivalent, e.g. [prelude::BASE64_STANDARD_NO_PAD] -//! 1. If not, choose which alphabet you want. Most usage will want [alphabet::STANDARD] or [alphabet::URL_SAFE]. -//! 1. Choose which [Engine] implementation you want. For the moment there is only one: [engine::GeneralPurpose]. -//! 1. Configure the engine appropriately using the engine's `Config` type. -//! - This is where you'll select whether to add padding (when encoding) or expect it (when -//! decoding). If given the choice, prefer no padding. -//! 1. Build the engine using the selected alphabet and config. +//! [base64]: https://developer.mozilla.org/en-US/docs/Glossary/Base64 //! -//! For more detail, see below. +//! # Usage //! -//! ## Alphabets +//! Use an [`Engine`] to decode or encode base64, configured with the base64 +//! alphabet and padding behavior best suited to your application. //! -//! An [alphabet::Alphabet] defines what ASCII symbols are used to encode to or decode from. +//! ## Engine setup //! -//! Constants in [alphabet] like [alphabet::STANDARD] or [alphabet::URL_SAFE] provide commonly used -//! alphabets, but you can also build your own custom [alphabet::Alphabet] if needed. +//! There is more than one way to encode a stream of bytes as “base64”. +//! Different applications use different encoding +//! [alphabets][alphabet::Alphabet] and +//! [padding behaviors][engine::general_purpose::GeneralPurposeConfig]. //! -//! ## Engines +//! ### Encoding alphabet //! -//! Once you have an `Alphabet`, you can pick which `Engine` you want. A few parts of the public -//! API provide a default, but otherwise the user must provide an `Engine` to use. +//! Almost all base64 [alphabets][alphabet::Alphabet] use `A-Z`, `a-z`, and +//! `0-9`, which gives nearly 64 characters (26 + 26 + 10 = 62), but they differ +//! in their choice of their final 2. //! -//! See [Engine] for more. -//! -//! ## Config -//! -//! In addition to an `Alphabet`, constructing an `Engine` also requires an [engine::Config]. Each -//! `Engine` has a corresponding `Config` implementation since different `Engine`s may offer different -//! levels of configurability. -//! -//! # Encoding -//! -//! Several different encoding methods on [Engine] are available to you depending on your desire for -//! convenience vs performance. -//! -//! | Method | Output | Allocates | -//! | ------------------------ | ---------------------------- | ------------------------------ | -//! | [Engine::encode] | Returns a new `String` | Always | -//! | [Engine::encode_string] | Appends to provided `String` | Only if `String` needs to grow | -//! | [Engine::encode_slice] | Writes to provided `&[u8]` | Never - fastest | -//! -//! All of the encoding methods will pad as per the engine's config. -//! -//! # Decoding -//! -//! Just as for encoding, there are different decoding methods available. -//! -//! | Method | Output | Allocates | -//! | ------------------------ | ----------------------------- | ------------------------------ | -//! | [Engine::decode] | Returns a new `Vec` | Always | -//! | [Engine::decode_vec] | Appends to provided `Vec` | Only if `Vec` needs to grow | -//! | [Engine::decode_slice] | Writes to provided `&[u8]` | Never - fastest | -//! -//! Unlike encoding, where all possible input is valid, decoding can fail (see [DecodeError]). -//! -//! Input can be invalid because it has invalid characters or invalid padding. The nature of how -//! padding is checked depends on the engine's config. -//! Whitespace in the input is invalid, just like any other non-base64 byte. -//! -//! # `Read` and `Write` -//! -//! To decode a [std::io::Read] of b64 bytes, wrap a reader (file, network socket, etc) with -//! [read::DecoderReader]. -//! -//! To write raw bytes and have them b64 encoded on the fly, wrap a [std::io::Write] with -//! [write::EncoderWriter]. -//! -//! There is some performance overhead (15% or so) because of the necessary buffer shuffling -- -//! still fast enough that almost nobody cares. Also, these implementations do not heap allocate. -//! -//! # `Display` -//! -//! See [display] for how to transparently base64 data via a `Display` implementation. -//! -//! # Examples -//! -//! ## Using predefined engines +//! Most applications use the [standard][alphabet::STANDARD] alphabet specified +//! in [RFC 4648][rfc-alphabet]. If that’s all you need, you can get started +//! quickly by using the pre-configured +//! [`STANDARD`][engine::general_purpose::STANDARD] engine, which is also available +//! in the [`prelude`] module as shown here, if you prefer a minimal `use` +//! footprint. //! #![cfg_attr(feature = "alloc", doc = "```")] #![cfg_attr(not(feature = "alloc"), doc = "```ignore")] -//! use base64::{Engine as _, engine::general_purpose}; +//! use base64::prelude::*; //! -//! let orig = b"data"; -//! let encoded: String = general_purpose::STANDARD_NO_PAD.encode(orig); -//! assert_eq!("ZGF0YQ", encoded); -//! assert_eq!(orig.as_slice(), &general_purpose::STANDARD_NO_PAD.decode(encoded).unwrap()); -//! -//! // or, URL-safe -//! let encoded_url = general_purpose::URL_SAFE_NO_PAD.encode(orig); +//! # fn main() -> Result<(), base64::DecodeError> { +//! assert_eq!(BASE64_STANDARD.decode(b"+uwgVQA=")?, b"\xFA\xEC\x20\x55\0"); +//! assert_eq!(BASE64_STANDARD.encode(b"\xFF\xEC\x20\x55\0"), "/+wgVQA="); +//! # Ok(()) +//! # } //! ``` //! -//! ## Custom alphabet, config, and engine +//! [rfc-alphabet]: https://datatracker.ietf.org/doc/html/rfc4648#section-4 +//! +//! Other common alphabets are available in the [`alphabet`] module. +//! +//! #### URL-safe alphabet +//! +//! The standard alphabet uses `+` and `/` as its two non-alphanumeric tokens, +//! which cannot be safely used in URL’s without encoding them as `%2B` and +//! `%2F`. +//! +//! To avoid that, some applications use a [“URL-safe” alphabet][alphabet::URL_SAFE], +//! which uses `-` and `_` instead. To use that alternative alphabet, use the +//! [`URL_SAFE`][engine::general_purpose::URL_SAFE] engine. This example doesn't +//! use [`prelude`] to show what a more explicit `use` would look like. +//! +#![cfg_attr(feature = "alloc", doc = "```")] +#![cfg_attr(not(feature = "alloc"), doc = "```ignore")] +//! use base64::{engine::general_purpose::URL_SAFE, Engine as _}; +//! +//! # fn main() -> Result<(), base64::DecodeError> { +//! assert_eq!(URL_SAFE.decode(b"-uwgVQA=")?, b"\xFA\xEC\x20\x55\0"); +//! assert_eq!(URL_SAFE.encode(b"\xFF\xEC\x20\x55\0"), "_-wgVQA="); +//! # Ok(()) +//! # } +//! ``` +//! +//! ### Padding characters +//! +//! Each base64 character represents 6 bits (2⁶ = 64) of the original binary +//! data, and every 3 bytes of input binary data will encode to 4 base64 +//! characters (8 bits × 3 = 6 bits × 4 = 24 bits). +//! +//! When the input is not an even multiple of 3 bytes in length, [canonical][] +//! base64 encoders insert padding characters at the end, so that the output +//! length is always a multiple of 4: +//! +//! [canonical]: https://datatracker.ietf.org/doc/html/rfc4648#section-3.5 +//! +#![cfg_attr(feature = "alloc", doc = "```")] +#![cfg_attr(not(feature = "alloc"), doc = "```ignore")] +//! use base64::{engine::general_purpose::STANDARD, Engine as _}; +//! +//! assert_eq!(STANDARD.encode(b""), ""); +//! assert_eq!(STANDARD.encode(b"f"), "Zg=="); +//! assert_eq!(STANDARD.encode(b"fo"), "Zm8="); +//! assert_eq!(STANDARD.encode(b"foo"), "Zm9v"); +//! ``` +//! +//! Canonical encoding ensures that base64 encodings will be exactly the same, +//! byte-for-byte, regardless of input length. But the `=` padding characters +//! aren’t necessary for decoding, and they may be omitted by using a +//! [`NO_PAD`][engine::general_purpose::NO_PAD] configuration: +//! +#![cfg_attr(feature = "alloc", doc = "```")] +#![cfg_attr(not(feature = "alloc"), doc = "```ignore")] +//! use base64::{engine::general_purpose::STANDARD_NO_PAD, Engine as _}; +//! +//! assert_eq!(STANDARD_NO_PAD.encode(b""), ""); +//! assert_eq!(STANDARD_NO_PAD.encode(b"f"), "Zg"); +//! assert_eq!(STANDARD_NO_PAD.encode(b"fo"), "Zm8"); +//! assert_eq!(STANDARD_NO_PAD.encode(b"foo"), "Zm9v"); +//! ``` +//! +//! The pre-configured `NO_PAD` engines will reject inputs containing padding +//! `=` characters. To encode without padding and still accept padding while +//! decoding, create an [engine][engine::general_purpose::GeneralPurpose] with +//! that [padding mode][engine::DecodePaddingMode]. +//! +#![cfg_attr(feature = "alloc", doc = "```")] +#![cfg_attr(not(feature = "alloc"), doc = "```ignore")] +//! # use base64::{engine::general_purpose::STANDARD_NO_PAD, Engine as _}; +//! assert_eq!(STANDARD_NO_PAD.decode(b"Zm8="), Err(base64::DecodeError::InvalidPadding)); +//! ``` +//! +//! ### Further customization +//! +//! Decoding and encoding behavior can be customized by creating an +//! [engine][engine::GeneralPurpose] with an [alphabet][alphabet::Alphabet] and +//! [padding configuration][engine::GeneralPurposeConfig]: //! #![cfg_attr(feature = "alloc", doc = "```")] #![cfg_attr(not(feature = "alloc"), doc = "```ignore")] @@ -117,6 +141,81 @@ //! //! ``` //! +//! ## Memory allocation +//! +//! The [decode][Engine::decode()] and [encode][Engine::encode()] engine methods +//! allocate memory for their results – `decode` returns a `Vec` and +//! `encode` returns a `String`. To instead decode or encode into a buffer that +//! you allocated, use one of the alternative methods: +//! +//! #### Decoding +//! +//! | Method | Output | Allocates memory | +//! | -------------------------- | ----------------------------- | ----------------------------- | +//! | [`Engine::decode`] | returns a new `Vec` | always | +//! | [`Engine::decode_vec`] | appends to provided `Vec` | if `Vec` lacks capacity | +//! | [`Engine::decode_slice`] | writes to provided `&[u8]` | never +//! +//! #### Encoding +//! +//! | Method | Output | Allocates memory | +//! | -------------------------- | ---------------------------- | ------------------------------ | +//! | [`Engine::encode`] | returns a new `String` | always | +//! | [`Engine::encode_string`] | appends to provided `String` | if `String` lacks capacity | +//! | [`Engine::encode_slice`] | writes to provided `&[u8]` | never | +//! +//! ## Input and output +//! +//! The `base64` crate can [decode][Engine::decode()] and +//! [encode][Engine::encode()] values in memory, or +//! [`DecoderReader`][read::DecoderReader] and +//! [`EncoderWriter`][write::EncoderWriter] provide streaming decoding and +//! encoding for any [readable][std::io::Read] or [writable][std::io::Write] +//! byte stream. +//! +//! #### Decoding +//! +#![cfg_attr(feature = "std", doc = "```")] +#![cfg_attr(not(feature = "std"), doc = "```ignore")] +//! # use std::io; +//! use base64::{engine::general_purpose::STANDARD, read::DecoderReader}; +//! +//! # fn main() -> Result<(), Box> { +//! let mut input = io::stdin(); +//! let mut decoder = DecoderReader::new(&mut input, &STANDARD); +//! io::copy(&mut decoder, &mut io::stdout())?; +//! # Ok(()) +//! # } +//! ``` +//! +//! #### Encoding +//! +#![cfg_attr(feature = "std", doc = "```")] +#![cfg_attr(not(feature = "std"), doc = "```ignore")] +//! # use std::io; +//! use base64::{engine::general_purpose::STANDARD, write::EncoderWriter}; +//! +//! # fn main() -> Result<(), Box> { +//! let mut output = io::stdout(); +//! let mut encoder = EncoderWriter::new(&mut output, &STANDARD); +//! io::copy(&mut io::stdin(), &mut encoder)?; +//! # Ok(()) +//! # } +//! ``` +//! +//! #### Display +//! +//! If you only need a base64 representation for implementing the +//! [`Display`][std::fmt::Display] trait, use +//! [`Base64Display`][display::Base64Display]: +//! +//! ``` +//! use base64::{display::Base64Display, engine::general_purpose::STANDARD}; +//! +//! let value = Base64Display::new(b"\0\x01\x02\x03", &STANDARD); +//! assert_eq!("base64: AAECAw==", format!("base64: {}", value)); +//! ``` +//! //! # Panics //! //! If length calculations result in overflowing `usize`, a panic will result. diff --git a/vendor/bitflags/.cargo-checksum.json b/vendor/bitflags/.cargo-checksum.json index 99936c770..a3e7d3f59 100644 --- a/vendor/bitflags/.cargo-checksum.json +++ b/vendor/bitflags/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"0905d91abfd8162750daeb51b69e1a4add85cd0e8e2b136a4fd20ea28df4da42","CODE_OF_CONDUCT.md":"42634d0f6d922f49857175af991802822f7f920487aefa2ee250a50d12251a66","CONTRIBUTING.md":"6c9f96eacb20af877ae2d16f024904f3038b93448a8488e9dbcac0df7f6439a5","Cargo.lock":"fb581ed64bd34dbdbcc2386c394394d5f46db3186edc7b129f1669cef66a0b57","Cargo.toml":"418f0ef5e370bf88b0d7bd8c3b2f25b533ae2b671036d30f7c524dc39133045c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"a403792a6099aeda15dc7bf3da529409652039b5dd2227dfc5549bd2f3fad7db","SECURITY.md":"68704c8128fa2e776ed7cbda741fbf61ad52f998a96350ee7ee4dbf64c6573bc","benches/parse.rs":"f1390d62322c6880d65bd931e183d49b313f287879a6bfaa36b1cb1921090b51","examples/custom_bits_type.rs":"e53b32051adc5d97860e0b48c8f3a301a041d73b4939c0d7caa5f0cfcc0b9739","examples/custom_derive.rs":"29dd7b845345a103ca31e91b579aeb01fb74935b8223c29184eb42223edadb65","examples/fmt.rs":"87ba37a1fb8528570c74ea26d8e8948e1179c3d867b928bea1080880258e0a99","examples/macro_free.rs":"69e7f284b53b5214d51228a686e87f127b52a3b74711e45537ebfa5583a180e5","examples/serde.rs":"08b21b35d5c10fdca132fe0f36c8067bb44f559e96617a9257ab6316a20cbc75","spec.md":"fcdd939df30c59b0643be09027df664b71cbea9b9989185441482c5576160fed","src/example_generated.rs":"d018caf059f6ffc4c2403b771a6d76679fa5af03c329a91bd9252957df695e7f","src/external.rs":"11599248db17d395c6b45bf2400266f221d3eb1523908e5f17715964bf8d99ed","src/external/arbitrary.rs":"fa8c9187028b9bc54856977b0914676f62101010e7a9450abd577fd78c89552f","src/external/bytemuck.rs":"3afcef382122867040fddd5e4153d633d1ed5596fe5d7dfac66a8e61c2513df5","src/external/serde.rs":"4a09db12534a20fe554a08dc5f1c8124b379292d41fa75628abcd2ca21587573","src/internal.rs":"fd939154cbebf43bfc329a4a3cd08618ca30a6a5f6e6abea07d23f75bf5b3b2d","src/iter.rs":"dbaa6437c1c044f689185ce3fafe43df8796bed19bbdd2c20334a52de5eeee73","src/lib.rs":"e45c07f43b0e142c41e99de8d20ceb909148762c876d765c11ac8b8ceaca0af5","src/parser.rs":"52f6352620ce3d5973bc38b42d56a760307294162c9d5668eb774eb92a6ef941","src/public.rs":"72b41639711bab95e8e75f37401a487088e7be1a427715cea40563fb3f64ed60","src/tests.rs":"b120c27ff0c67a819527de9d8171f1f4c5d37ba4009c54abeb869c70e6035f14","src/traits.rs":"0a8764c3e2378043e2724cf1bfc514d4ff1985026db33509f6451a7897e2675d"},"package":"327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"} \ No newline at end of file +{"files":{"CHANGELOG.md":"326deeb7eb3ae12b03b09223076fce85ab7776cf84efa2210421dc43c5aa7d26","CODE_OF_CONDUCT.md":"42634d0f6d922f49857175af991802822f7f920487aefa2ee250a50d12251a66","CONTRIBUTING.md":"6c9f96eacb20af877ae2d16f024904f3038b93448a8488e9dbcac0df7f6439a5","Cargo.lock":"8bc439f84c6c8f3ead3e55a838cc2240b67286450affaefb2d7bf9909892a084","Cargo.toml":"7e4762a4f26f8e948016e518a034a44324b308355f976420b87c898d59214fad","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"1319a2e116738d00c39fa9044ebb20921f270535e97d7648c5414d3fe90af7f0","SECURITY.md":"68704c8128fa2e776ed7cbda741fbf61ad52f998a96350ee7ee4dbf64c6573bc","benches/parse.rs":"f1390d62322c6880d65bd931e183d49b313f287879a6bfaa36b1cb1921090b51","examples/custom_bits_type.rs":"e53b32051adc5d97860e0b48c8f3a301a041d73b4939c0d7caa5f0cfcc0b9739","examples/custom_derive.rs":"29dd7b845345a103ca31e91b579aeb01fb74935b8223c29184eb42223edadb65","examples/fmt.rs":"87ba37a1fb8528570c74ea26d8e8948e1179c3d867b928bea1080880258e0a99","examples/macro_free.rs":"69e7f284b53b5214d51228a686e87f127b52a3b74711e45537ebfa5583a180e5","examples/serde.rs":"08b21b35d5c10fdca132fe0f36c8067bb44f559e96617a9257ab6316a20cbc75","spec.md":"fcdd939df30c59b0643be09027df664b71cbea9b9989185441482c5576160fed","src/example_generated.rs":"d018caf059f6ffc4c2403b771a6d76679fa5af03c329a91bd9252957df695e7f","src/external.rs":"734d3f470e6a669297d2df421ce3976fe613d8aa9c071d5ce6fe3ca890e5b815","src/external/arbitrary.rs":"fa8c9187028b9bc54856977b0914676f62101010e7a9450abd577fd78c89552f","src/external/bytemuck.rs":"3afcef382122867040fddd5e4153d633d1ed5596fe5d7dfac66a8e61c2513df5","src/external/serde.rs":"4a09db12534a20fe554a08dc5f1c8124b379292d41fa75628abcd2ca21587573","src/internal.rs":"645b13af0c7302258df61239073a4b8203d09f27b6c17f8a6f1f8c3e427f5334","src/iter.rs":"dbaa6437c1c044f689185ce3fafe43df8796bed19bbdd2c20334a52de5eeee73","src/lib.rs":"054e839f46b021976c74c3edb6c1fca49f4208dd0d9c9c0b7b95d69285aee69a","src/parser.rs":"52f6352620ce3d5973bc38b42d56a760307294162c9d5668eb774eb92a6ef941","src/public.rs":"d151f7db62fefdb6cd2cad1038a785f02d1ce32eaab4c4cc84376283699182cc","src/tests.rs":"b120c27ff0c67a819527de9d8171f1f4c5d37ba4009c54abeb869c70e6035f14","src/tests/all.rs":"e99a865cd4271a524c2fe95503e96d851b35990570aed6fb2e9dac7a14da31b6","src/tests/bits.rs":"3840c34b2ea5d1802404b9ce5bcc1d3fa6ccd8dfba2e29e6d07c605f817d90df","src/tests/complement.rs":"d0e6d4c3daf49e0a7438c9f1c1ac91fad1b37f258c03593f6cd6a695ee626f5e","src/tests/contains.rs":"58bb3cb8c86550e775d11134da1d4aca85c83f943ea454e3a5f222772c674a24","src/tests/difference.rs":"d0d2b96bb52658b8ac019210da74ca75a53e76622f668855142ea6e97c28cb0e","src/tests/empty.rs":"817d6e93ced7cb7576ff0e334aa1a44703f3f96871ff2c6bdcb8f207e6551f67","src/tests/eq.rs":"b816767680a029e9c163e37af074dd4e604c4a3e4936f829f0ca3774fd5f0e37","src/tests/extend.rs":"5fabb9fd0254c64da019149c24063fceff72da3eb4ad73b57c1cc4c04b008364","src/tests/flags.rs":"2f48d3a25db1cf66fe98c9959abc70875deb9f7b38b2c278dc70c46e0d4ec277","src/tests/fmt.rs":"a2d4148491f3202f030f63633eee941b741e3be29a68cf376f008dbe5cb11e5c","src/tests/from_bits.rs":"d94c65b88bf89961d0cfc1b3152a7f1acc285bae160a1628438effda11b8e2c1","src/tests/from_bits_retain.rs":"980591dfaf91e940f42d9a1ce890f237514dd59d458fc264abcf9ceabbc40677","src/tests/from_bits_truncate.rs":"d3406b5e107ebb6449b98a59eee6cc5d84f947d4aaee1ee7e80dc7202de179f0","src/tests/from_name.rs":"f4a055d1f3c86decef70ef8f3020cef5c4e229718c20b3d59d5a3abc3a8b1298","src/tests/insert.rs":"3fab5da800a6fc0654dfb5f859f95da65a507eb9fda8695083c2712266dff0b9","src/tests/intersection.rs":"baf1454c9e4eba552264870a556ee0032d9f2bb8cac361833d571235e0b52221","src/tests/intersects.rs":"c55e36179fd8bc636f04ea9bbce346dcaafe57915d13f1df28c5b83117dbd08e","src/tests/is_all.rs":"b2f11faa7c954bd85c8fb39999e0c37d983cf7895152bc13c7ddde106aa33b6d","src/tests/is_empty.rs":"11f21323cdca7ff92dd89e09de667dba69e8dce88e2d3e27ea68ace91d15d070","src/tests/iter.rs":"4ba121932b527e787b82745405c7c65c1084c242e2dda3290d475ec160d265e4","src/tests/parser.rs":"237c0b34f7e52c60b18111cde8c72d554565aa9899edece360ae2677f98675c9","src/tests/remove.rs":"6e75f8508d2dc1a2cba89ef691f4387a665a4fd13853bb1dd0fd80c783b89947","src/tests/symmetric_difference.rs":"0a89f084f9de1dd5b1932fe72c3b10a3c93cbaa16832b3a31b6a85e3bbd3ba6e","src/tests/union.rs":"88f398ee4600bb1e59bf6d02d1f6ff33f5f853eab5a6c700bd8a683c6ee4651a","src/traits.rs":"0a8764c3e2378043e2724cf1bfc514d4ff1985026db33509f6451a7897e2675d"},"package":"ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"} \ No newline at end of file diff --git a/vendor/bitflags/CHANGELOG.md b/vendor/bitflags/CHANGELOG.md index 5081ed576..fd435d29f 100644 --- a/vendor/bitflags/CHANGELOG.md +++ b/vendor/bitflags/CHANGELOG.md @@ -1,3 +1,18 @@ +# 2.4.2 + +## What's Changed +* Cargo.toml: Anchor excludes to root of the package by @jamessan in https://github.com/bitflags/bitflags/pull/387 +* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/390 +* Add support for impl mode structs to be repr(packed) by @GnomedDev in https://github.com/bitflags/bitflags/pull/388 +* Remove old `unused_tuple_struct_fields` lint by @dtolnay in https://github.com/bitflags/bitflags/pull/393 +* Delete use of `local_inner_macros` by @dtolnay in https://github.com/bitflags/bitflags/pull/392 + +## New Contributors +* @jamessan made their first contribution in https://github.com/bitflags/bitflags/pull/387 +* @GnomedDev made their first contribution in https://github.com/bitflags/bitflags/pull/388 + +**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.1...2.4.2 + # 2.4.1 ## What's Changed diff --git a/vendor/bitflags/Cargo.lock b/vendor/bitflags/Cargo.lock index 53d2d7a68..275cc0929 100644 --- a/vendor/bitflags/Cargo.lock +++ b/vendor/bitflags/Cargo.lock @@ -4,25 +4,25 @@ version = 3 [[package]] name = "arbitrary" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e1373abdaa212b704512ec2bd8b26bd0b7d5c3f70117411a5d9a451383c859" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" dependencies = [ "derive_arbitrary", ] [[package]] name = "basic-toml" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" dependencies = [ "serde", ] [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" dependencies = [ "arbitrary", "bytemuck", @@ -65,15 +65,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "compiler_builtins" -version = "0.1.101" +version = "0.1.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a6d58e9c3408138099a396a98fd0d0e6cfb25d723594d2ae48b5004513fd5b" +checksum = "3686cc48897ce1950aa70fd595bd2dc9f767a3c4cca4cd17b2cb52a2d37e6eb4" [[package]] name = "derive_arbitrary" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", @@ -88,30 +88,30 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -130,24 +130,24 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -187,18 +187,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "trybuild" -version = "1.0.85" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196a58260a906cedb9bf6d8034b6379d0c11f552416960452f267402ceeddff1" +checksum = "9a9d3ba662913483d6722303f619e75ea10b7855b0f8e0d72799cf8621bb488f" dependencies = [ "basic-toml", "glob", @@ -248,9 +248,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "zerocopy" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20707b61725734c595e840fb3704378a0cd2b9c74cc9e6e20724838fc6a1e2f9" +checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" dependencies = [ "byteorder", "zerocopy-derive", @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56097d5b91d711293a42be9289403896b68654625021732067eac7a4ca388a1f" +checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", diff --git a/vendor/bitflags/Cargo.toml b/vendor/bitflags/Cargo.toml index 5fd2c7dc1..43595a590 100644 --- a/vendor/bitflags/Cargo.toml +++ b/vendor/bitflags/Cargo.toml @@ -13,11 +13,11 @@ edition = "2021" rust-version = "1.56.0" name = "bitflags" -version = "2.4.1" +version = "2.4.2" authors = ["The Rust Project Developers"] exclude = [ - "tests", - ".github", + "/tests", + "/.github", ] description = """ A macro to generate structures which behave like bitflags. diff --git a/vendor/bitflags/README.md b/vendor/bitflags/README.md index ecad515e1..a560bc850 100644 --- a/vendor/bitflags/README.md +++ b/vendor/bitflags/README.md @@ -28,7 +28,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -bitflags = "2.4.1" +bitflags = "2.4.2" ``` and this to your source code: diff --git a/vendor/bitflags/src/external.rs b/vendor/bitflags/src/external.rs index efeaa8279..716af83c0 100644 --- a/vendor/bitflags/src/external.rs +++ b/vendor/bitflags/src/external.rs @@ -14,7 +14,7 @@ Next, re-export the library from the `__private` module here. Next, define a macro like so: ```rust -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(feature = "serde")] macro_rules! __impl_external_bitflags_my_library { @@ -30,7 +30,7 @@ macro_rules! __impl_external_bitflags_my_library { }; } -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(not(feature = "my_library"))] macro_rules! __impl_external_bitflags_my_library { @@ -77,7 +77,7 @@ pub(crate) mod __private { } /// Implements traits from external libraries for the internal bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_external_bitflags { ( @@ -92,7 +92,7 @@ macro_rules! __impl_external_bitflags { // Use `serde` as an example: generate code when the feature is available, // and a no-op when it isn't - __impl_external_bitflags_serde! { + $crate::__impl_external_bitflags_serde! { $InternalBitFlags: $T, $PublicBitFlags { $( $(#[$inner $($args)*])* @@ -101,7 +101,7 @@ macro_rules! __impl_external_bitflags { } } - __impl_external_bitflags_arbitrary! { + $crate::__impl_external_bitflags_arbitrary! { $InternalBitFlags: $T, $PublicBitFlags { $( $(#[$inner $($args)*])* @@ -110,7 +110,7 @@ macro_rules! __impl_external_bitflags { } } - __impl_external_bitflags_bytemuck! { + $crate::__impl_external_bitflags_bytemuck! { $InternalBitFlags: $T, $PublicBitFlags { $( $(#[$inner $($args)*])* @@ -125,7 +125,7 @@ macro_rules! __impl_external_bitflags { pub mod serde; /// Implement `Serialize` and `Deserialize` for the internal bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(feature = "serde")] macro_rules! __impl_external_bitflags_serde { @@ -161,7 +161,7 @@ macro_rules! __impl_external_bitflags_serde { }; } -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(not(feature = "serde"))] macro_rules! __impl_external_bitflags_serde { @@ -182,7 +182,7 @@ pub mod arbitrary; mod bytemuck; /// Implement `Arbitrary` for the internal bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(feature = "arbitrary")] macro_rules! __impl_external_bitflags_arbitrary { @@ -204,7 +204,7 @@ macro_rules! __impl_external_bitflags_arbitrary { }; } -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(not(feature = "arbitrary"))] macro_rules! __impl_external_bitflags_arbitrary { @@ -219,7 +219,7 @@ macro_rules! __impl_external_bitflags_arbitrary { } /// Implement `Pod` and `Zeroable` for the internal bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(feature = "bytemuck")] macro_rules! __impl_external_bitflags_bytemuck { @@ -247,7 +247,7 @@ macro_rules! __impl_external_bitflags_bytemuck { }; } -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] #[cfg(not(feature = "bytemuck"))] macro_rules! __impl_external_bitflags_bytemuck { diff --git a/vendor/bitflags/src/internal.rs b/vendor/bitflags/src/internal.rs index aca1ac4db..87d01cc0c 100644 --- a/vendor/bitflags/src/internal.rs +++ b/vendor/bitflags/src/internal.rs @@ -6,7 +6,7 @@ /// Declare the `bitflags`-facing bitflags struct. /// /// This type is part of the `bitflags` crate's public API, but not part of the user's. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __declare_internal_bitflags { ( @@ -25,7 +25,7 @@ macro_rules! __declare_internal_bitflags { /// /// Methods and trait implementations can be freely added here without breaking end-users. /// If we want to expose new functionality to `#[derive]`, this is the place to do it. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_internal_bitflags { ( @@ -97,7 +97,7 @@ macro_rules! __impl_internal_bitflags { // The internal flags type offers a similar API to the public one - __impl_public_bitflags! { + $crate::__impl_public_bitflags! { $InternalBitFlags: $T, $PublicBitFlags { $( $(#[$inner $($args)*])* @@ -106,11 +106,11 @@ macro_rules! __impl_internal_bitflags { } } - __impl_public_bitflags_ops! { + $crate::__impl_public_bitflags_ops! { $InternalBitFlags } - __impl_public_bitflags_iter! { + $crate::__impl_public_bitflags_iter! { $InternalBitFlags: $T, $PublicBitFlags } diff --git a/vendor/bitflags/src/lib.rs b/vendor/bitflags/src/lib.rs index c8aff6873..d7faaef78 100644 --- a/vendor/bitflags/src/lib.rs +++ b/vendor/bitflags/src/lib.rs @@ -17,7 +17,7 @@ Add `bitflags` to your `Cargo.toml`: ```toml [dependencies.bitflags] -version = "2.4.1" +version = "2.4.2" ``` ## Generating flags types @@ -252,6 +252,7 @@ mod traits; #[doc(hidden)] pub mod __private { + #[allow(unused_imports)] // Easier than conditionally checking any optional external dependencies pub use crate::{external::__private::*, traits::__private::*}; pub use core; @@ -441,7 +442,7 @@ bitflags! { } ``` */ -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! bitflags { ( $(#[$outer:meta])* @@ -456,13 +457,13 @@ macro_rules! bitflags { ) => { // Declared in the scope of the `bitflags!` call // This type appears in the end-user's API - __declare_public_bitflags! { + $crate::__declare_public_bitflags! { $(#[$outer])* $vis struct $BitFlags } // Workaround for: https://github.com/bitflags/bitflags/issues/320 - __impl_public_bitflags_consts! { + $crate::__impl_public_bitflags_consts! { $BitFlags: $T { $( $(#[$inner $($args)*])* @@ -487,11 +488,11 @@ macro_rules! bitflags { const _: () = { // Declared in a "hidden" scope that can't be reached directly // These types don't appear in the end-user's API - __declare_internal_bitflags! { + $crate::__declare_internal_bitflags! { $vis struct InternalBitFlags: $T } - __impl_internal_bitflags! { + $crate::__impl_internal_bitflags! { InternalBitFlags: $T, $BitFlags { $( $(#[$inner $($args)*])* @@ -501,7 +502,7 @@ macro_rules! bitflags { } // This is where new library trait implementations can be added - __impl_external_bitflags! { + $crate::__impl_external_bitflags! { InternalBitFlags: $T, $BitFlags { $( $(#[$inner $($args)*])* @@ -510,20 +511,20 @@ macro_rules! bitflags { } } - __impl_public_bitflags_forward! { + $crate::__impl_public_bitflags_forward! { $BitFlags: $T, InternalBitFlags } - __impl_public_bitflags_ops! { + $crate::__impl_public_bitflags_ops! { $BitFlags } - __impl_public_bitflags_iter! { + $crate::__impl_public_bitflags_iter! { $BitFlags: $T, $BitFlags } }; - bitflags! { + $crate::bitflags! { $($t)* } }; @@ -537,7 +538,7 @@ macro_rules! bitflags { $($t:tt)* ) => { - __impl_public_bitflags_consts! { + $crate::__impl_public_bitflags_consts! { $BitFlags: $T { $( $(#[$inner $($args)*])* @@ -558,7 +559,7 @@ macro_rules! bitflags { clippy::iter_without_into_iter, )] const _: () = { - __impl_public_bitflags! { + $crate::__impl_public_bitflags! { $BitFlags: $T, $BitFlags { $( $(#[$inner $($args)*])* @@ -567,16 +568,16 @@ macro_rules! bitflags { } } - __impl_public_bitflags_ops! { + $crate::__impl_public_bitflags_ops! { $BitFlags } - __impl_public_bitflags_iter! { + $crate::__impl_public_bitflags_iter! { $BitFlags: $T, $BitFlags } }; - bitflags! { + $crate::bitflags! { $($t)* } }; @@ -587,7 +588,7 @@ macro_rules! bitflags { /// /// We need to be careful about adding new methods and trait implementations here because they /// could conflict with items added by the end-user. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_bitflags { ( @@ -796,7 +797,7 @@ macro_rules! __impl_bitflags { /// /// If you find yourself with an attribute that should be considered expression-safe /// and isn't, it can be added here. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __bitflags_expr_safe_attrs { // Entrypoint: Move all flags and all attributes into `unprocessed` lists @@ -805,7 +806,7 @@ macro_rules! __bitflags_expr_safe_attrs { $(#[$inner:ident $($args:tt)*])* { $e:expr } ) => { - __bitflags_expr_safe_attrs! { + $crate::__bitflags_expr_safe_attrs! { expr: { $e }, attrs: { // All attributes start here @@ -830,7 +831,7 @@ macro_rules! __bitflags_expr_safe_attrs { processed: [$($expr:tt)*], }, ) => { - __bitflags_expr_safe_attrs! { + $crate::__bitflags_expr_safe_attrs! { expr: { $e }, attrs: { unprocessed: [ @@ -857,7 +858,7 @@ macro_rules! __bitflags_expr_safe_attrs { processed: [$($expr:tt)*], }, ) => { - __bitflags_expr_safe_attrs! { + $crate::__bitflags_expr_safe_attrs! { expr: { $e }, attrs: { unprocessed: [ @@ -884,7 +885,7 @@ macro_rules! __bitflags_expr_safe_attrs { } /// Implement a flag, which may be a wildcard `_`. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __bitflags_flag { ( diff --git a/vendor/bitflags/src/public.rs b/vendor/bitflags/src/public.rs index 967e0dacb..dc2d72678 100644 --- a/vendor/bitflags/src/public.rs +++ b/vendor/bitflags/src/public.rs @@ -6,7 +6,7 @@ /// Declare the user-facing bitflags struct. /// /// This type is guaranteed to be a newtype with a `bitflags`-facing type as its single field. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __declare_public_bitflags { ( @@ -22,13 +22,13 @@ macro_rules! __declare_public_bitflags { /// /// We need to be careful about adding new methods and trait implementations here because they /// could conflict with items added by the end-user. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_public_bitflags_forward { ( $PublicBitFlags:ident: $T:ty, $InternalBitFlags:ident ) => { - __impl_bitflags! { + $crate::__impl_bitflags! { $PublicBitFlags: $T { fn empty() { Self($InternalBitFlags::empty()) @@ -124,7 +124,7 @@ macro_rules! __impl_public_bitflags_forward { /// /// We need to be careful about adding new methods and trait implementations here because they /// could conflict with items added by the end-user. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_public_bitflags { ( @@ -135,7 +135,7 @@ macro_rules! __impl_public_bitflags { )* } ) => { - __impl_bitflags! { + $crate::__impl_bitflags! { $BitFlags: $T { fn empty() { Self(<$T as $crate::Bits>::EMPTY) @@ -146,7 +146,7 @@ macro_rules! __impl_public_bitflags { let mut i = 0; $( - __bitflags_expr_safe_attrs!( + $crate::__bitflags_expr_safe_attrs!( $(#[$inner $($args)*])* {{ let flag = <$PublicBitFlags as $crate::Flags>::FLAGS[i].value().bits(); @@ -185,10 +185,10 @@ macro_rules! __impl_public_bitflags { fn from_name(name) { $( - __bitflags_flag!({ + $crate::__bitflags_flag!({ name: $Flag, named: { - __bitflags_expr_safe_attrs!( + $crate::__bitflags_expr_safe_attrs!( $(#[$inner $($args)*])* { if name == $crate::__private::core::stringify!($Flag) { @@ -268,7 +268,7 @@ macro_rules! __impl_public_bitflags { } /// Implement iterators on the public (user-facing) bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_public_bitflags_iter { ($BitFlags:ident: $T:ty, $PublicBitFlags:ident) => { @@ -312,7 +312,7 @@ macro_rules! __impl_public_bitflags_iter { } /// Implement traits on the public (user-facing) bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_public_bitflags_ops { ($PublicBitFlags:ident) => { @@ -321,7 +321,8 @@ macro_rules! __impl_public_bitflags_ops { &self, f: &mut $crate::__private::core::fmt::Formatter, ) -> $crate::__private::core::fmt::Result { - $crate::__private::core::fmt::Binary::fmt(&self.0, f) + let inner = self.0; + $crate::__private::core::fmt::Binary::fmt(&inner, f) } } @@ -330,7 +331,8 @@ macro_rules! __impl_public_bitflags_ops { &self, f: &mut $crate::__private::core::fmt::Formatter, ) -> $crate::__private::core::fmt::Result { - $crate::__private::core::fmt::Octal::fmt(&self.0, f) + let inner = self.0; + $crate::__private::core::fmt::Octal::fmt(&inner, f) } } @@ -339,7 +341,8 @@ macro_rules! __impl_public_bitflags_ops { &self, f: &mut $crate::__private::core::fmt::Formatter, ) -> $crate::__private::core::fmt::Result { - $crate::__private::core::fmt::LowerHex::fmt(&self.0, f) + let inner = self.0; + $crate::__private::core::fmt::LowerHex::fmt(&inner, f) } } @@ -348,7 +351,8 @@ macro_rules! __impl_public_bitflags_ops { &self, f: &mut $crate::__private::core::fmt::Formatter, ) -> $crate::__private::core::fmt::Result { - $crate::__private::core::fmt::UpperHex::fmt(&self.0, f) + let inner = self.0; + $crate::__private::core::fmt::UpperHex::fmt(&inner, f) } } @@ -468,7 +472,7 @@ macro_rules! __impl_public_bitflags_ops { } /// Implement constants on the public (user-facing) bitflags type. -#[macro_export(local_inner_macros)] +#[macro_export] #[doc(hidden)] macro_rules! __impl_public_bitflags_consts { ( @@ -481,7 +485,7 @@ macro_rules! __impl_public_bitflags_consts { ) => { impl $PublicBitFlags { $( - __bitflags_flag!({ + $crate::__bitflags_flag!({ name: $Flag, named: { $(#[$inner $($args)*])* @@ -499,10 +503,10 @@ macro_rules! __impl_public_bitflags_consts { impl $crate::Flags for $PublicBitFlags { const FLAGS: &'static [$crate::Flag<$PublicBitFlags>] = &[ $( - __bitflags_flag!({ + $crate::__bitflags_flag!({ name: $Flag, named: { - __bitflags_expr_safe_attrs!( + $crate::__bitflags_expr_safe_attrs!( $(#[$inner $($args)*])* { #[allow( @@ -514,7 +518,7 @@ macro_rules! __impl_public_bitflags_consts { ) }, unnamed: { - __bitflags_expr_safe_attrs!( + $crate::__bitflags_expr_safe_attrs!( $(#[$inner $($args)*])* { #[allow( diff --git a/vendor/bitflags/src/tests/all.rs b/vendor/bitflags/src/tests/all.rs new file mode 100644 index 000000000..cceb93a46 --- /dev/null +++ b/vendor/bitflags/src/tests/all.rs @@ -0,0 +1,23 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(1 | 1 << 1 | 1 << 2, TestFlags::all); + + case(0, TestZero::all); + + case(0, TestEmpty::all); + + case(!0, TestExternal::all); +} + +#[track_caller] +fn case(expected: T::Bits, inherent: impl FnOnce() -> T) +where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!(expected, inherent().bits(), "T::all()"); + assert_eq!(expected, T::all().bits(), "Flags::all()"); +} diff --git a/vendor/bitflags/src/tests/bits.rs b/vendor/bitflags/src/tests/bits.rs new file mode 100644 index 000000000..678f153e3 --- /dev/null +++ b/vendor/bitflags/src/tests/bits.rs @@ -0,0 +1,36 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(0, TestFlags::empty(), TestFlags::bits); + + case(1, TestFlags::A, TestFlags::bits); + case(1 | 1 << 1 | 1 << 2, TestFlags::ABC, TestFlags::bits); + + case(!0, TestFlags::from_bits_retain(u8::MAX), TestFlags::bits); + case(1 << 3, TestFlags::from_bits_retain(1 << 3), TestFlags::bits); + + case(1 << 3, TestZero::from_bits_retain(1 << 3), TestZero::bits); + + case(1 << 3, TestEmpty::from_bits_retain(1 << 3), TestEmpty::bits); + + case( + 1 << 4 | 1 << 6, + TestExternal::from_bits_retain(1 << 4 | 1 << 6), + TestExternal::bits, + ); +} + +#[track_caller] +fn case( + expected: T::Bits, + value: T, + inherent: impl FnOnce(&T) -> T::Bits, +) where + T::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!(expected, inherent(&value), "{:?}.bits()", value); + assert_eq!(expected, Flags::bits(&value), "Flags::bits({:?})", value); +} diff --git a/vendor/bitflags/src/tests/complement.rs b/vendor/bitflags/src/tests/complement.rs new file mode 100644 index 000000000..ac7a421af --- /dev/null +++ b/vendor/bitflags/src/tests/complement.rs @@ -0,0 +1,53 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(0, TestFlags::all(), TestFlags::complement); + case(0, TestFlags::from_bits_retain(!0), TestFlags::complement); + + case(1 | 1 << 1, TestFlags::C, TestFlags::complement); + case( + 1 | 1 << 1, + TestFlags::C | TestFlags::from_bits_retain(1 << 3), + TestFlags::complement, + ); + + case( + 1 | 1 << 1 | 1 << 2, + TestFlags::empty(), + TestFlags::complement, + ); + case( + 1 | 1 << 1 | 1 << 2, + TestFlags::from_bits_retain(1 << 3), + TestFlags::complement, + ); + + case(0, TestZero::empty(), TestZero::complement); + + case(0, TestEmpty::empty(), TestEmpty::complement); + + case(1 << 2, TestOverlapping::AB, TestOverlapping::complement); + + case(!0, TestExternal::empty(), TestExternal::complement); +} + +#[track_caller] +fn case + Copy>( + expected: T::Bits, + value: T, + inherent: impl FnOnce(T) -> T, +) where + T::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!(expected, inherent(value).bits(), "{:?}.complement()", value); + assert_eq!( + expected, + Flags::complement(value).bits(), + "Flags::complement({:?})", + value + ); + assert_eq!(expected, (!value).bits(), "!{:?}", value); +} diff --git a/vendor/bitflags/src/tests/contains.rs b/vendor/bitflags/src/tests/contains.rs new file mode 100644 index 000000000..12428ddcb --- /dev/null +++ b/vendor/bitflags/src/tests/contains.rs @@ -0,0 +1,108 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::empty(), true), + (TestFlags::A, false), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::from_bits_retain(1 << 3), false), + ], + TestFlags::contains, + ); + + case( + TestFlags::A, + &[ + (TestFlags::empty(), true), + (TestFlags::A, true), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::ABC, false), + (TestFlags::from_bits_retain(1 << 3), false), + (TestFlags::from_bits_retain(1 | (1 << 3)), false), + ], + TestFlags::contains, + ); + + case( + TestFlags::ABC, + &[ + (TestFlags::empty(), true), + (TestFlags::A, true), + (TestFlags::B, true), + (TestFlags::C, true), + (TestFlags::ABC, true), + (TestFlags::from_bits_retain(1 << 3), false), + ], + TestFlags::contains, + ); + + case( + TestFlags::from_bits_retain(1 << 3), + &[ + (TestFlags::empty(), true), + (TestFlags::A, false), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::from_bits_retain(1 << 3), true), + ], + TestFlags::contains, + ); + + case( + TestZero::ZERO, + &[(TestZero::ZERO, true)], + TestZero::contains, + ); + + case( + TestOverlapping::AB, + &[ + (TestOverlapping::AB, true), + (TestOverlapping::BC, false), + (TestOverlapping::from_bits_retain(1 << 1), true), + ], + TestOverlapping::contains, + ); + + case( + TestExternal::all(), + &[ + (TestExternal::A, true), + (TestExternal::B, true), + (TestExternal::C, true), + (TestExternal::from_bits_retain(1 << 5 | 1 << 7), true), + ], + TestExternal::contains, + ); +} + +#[track_caller] +fn case( + value: T, + inputs: &[(T, bool)], + mut inherent: impl FnMut(&T, T) -> bool, +) { + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent(&value, *input), + "{:?}.contains({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::contains(&value, *input), + "Flags::contains({:?}, {:?})", + value, + input + ); + } +} diff --git a/vendor/bitflags/src/tests/difference.rs b/vendor/bitflags/src/tests/difference.rs new file mode 100644 index 000000000..6ce9c0bf1 --- /dev/null +++ b/vendor/bitflags/src/tests/difference.rs @@ -0,0 +1,92 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::A | TestFlags::B, + &[ + (TestFlags::A, 1 << 1), + (TestFlags::B, 1), + (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1), + ], + TestFlags::difference, + ); + + case( + TestFlags::from_bits_retain(1 | 1 << 3), + &[ + (TestFlags::A, 1 << 3), + (TestFlags::from_bits_retain(1 << 3), 1), + ], + TestFlags::difference, + ); + + case( + TestExternal::from_bits_retain(!0), + &[(TestExternal::A, 0b1111_1110)], + TestExternal::difference, + ); + + assert_eq!( + 0b1111_1110, + (TestExternal::from_bits_retain(!0) & !TestExternal::A).bits() + ); + + assert_eq!( + 0b1111_1110, + (TestFlags::from_bits_retain(!0).difference(TestFlags::A)).bits() + ); + + // The `!` operator unsets bits that don't correspond to known flags + assert_eq!( + 1 << 1 | 1 << 2, + (TestFlags::from_bits_retain(!0) & !TestFlags::A).bits() + ); +} + +#[track_caller] +fn case + std::ops::SubAssign + Copy>( + value: T, + inputs: &[(T, T::Bits)], + mut inherent: impl FnMut(T, T) -> T, +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent(value, *input).bits(), + "{:?}.difference({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::difference(value, *input).bits(), + "Flags::difference({:?}, {:?})", + value, + input + ); + assert_eq!( + *expected, + (value - *input).bits(), + "{:?} - {:?}", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + value -= *input; + value + } + .bits(), + "{:?} -= {:?}", + value, + input, + ); + } +} diff --git a/vendor/bitflags/src/tests/empty.rs b/vendor/bitflags/src/tests/empty.rs new file mode 100644 index 000000000..57fb1c7cf --- /dev/null +++ b/vendor/bitflags/src/tests/empty.rs @@ -0,0 +1,23 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(0, TestFlags::empty); + + case(0, TestZero::empty); + + case(0, TestEmpty::empty); + + case(0, TestExternal::empty); +} + +#[track_caller] +fn case(expected: T::Bits, inherent: impl FnOnce() -> T) +where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!(expected, inherent().bits(), "T::empty()"); + assert_eq!(expected, T::empty().bits(), "Flags::empty()"); +} diff --git a/vendor/bitflags/src/tests/eq.rs b/vendor/bitflags/src/tests/eq.rs new file mode 100644 index 000000000..9779af762 --- /dev/null +++ b/vendor/bitflags/src/tests/eq.rs @@ -0,0 +1,10 @@ +use super::*; + +#[test] +fn cases() { + assert_eq!(TestFlags::empty(), TestFlags::empty()); + assert_eq!(TestFlags::all(), TestFlags::all()); + + assert!(TestFlags::from_bits_retain(1) < TestFlags::from_bits_retain(2)); + assert!(TestFlags::from_bits_retain(2) > TestFlags::from_bits_retain(1)); +} diff --git a/vendor/bitflags/src/tests/extend.rs b/vendor/bitflags/src/tests/extend.rs new file mode 100644 index 000000000..869dc17fc --- /dev/null +++ b/vendor/bitflags/src/tests/extend.rs @@ -0,0 +1,42 @@ +use super::*; + +#[test] +fn cases() { + let mut flags = TestFlags::empty(); + + flags.extend(TestFlags::A); + + assert_eq!(TestFlags::A, flags); + + flags.extend(TestFlags::A | TestFlags::B | TestFlags::C); + + assert_eq!(TestFlags::ABC, flags); + + flags.extend(TestFlags::from_bits_retain(1 << 5)); + + assert_eq!(TestFlags::ABC | TestFlags::from_bits_retain(1 << 5), flags); +} + +mod external { + use super::*; + + #[test] + fn cases() { + let mut flags = TestExternal::empty(); + + flags.extend(TestExternal::A); + + assert_eq!(TestExternal::A, flags); + + flags.extend(TestExternal::A | TestExternal::B | TestExternal::C); + + assert_eq!(TestExternal::ABC, flags); + + flags.extend(TestExternal::from_bits_retain(1 << 5)); + + assert_eq!( + TestExternal::ABC | TestExternal::from_bits_retain(1 << 5), + flags + ); + } +} diff --git a/vendor/bitflags/src/tests/flags.rs b/vendor/bitflags/src/tests/flags.rs new file mode 100644 index 000000000..7a625b312 --- /dev/null +++ b/vendor/bitflags/src/tests/flags.rs @@ -0,0 +1,46 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + let flags = TestFlags::FLAGS + .iter() + .map(|flag| (flag.name(), flag.value().bits())) + .collect::>(); + + assert_eq!( + vec![ + ("A", 1u8), + ("B", 1 << 1), + ("C", 1 << 2), + ("ABC", 1 | 1 << 1 | 1 << 2), + ], + flags, + ); + + assert_eq!(0, TestEmpty::FLAGS.iter().count()); +} + +mod external { + use super::*; + + #[test] + fn cases() { + let flags = TestExternal::FLAGS + .iter() + .map(|flag| (flag.name(), flag.value().bits())) + .collect::>(); + + assert_eq!( + vec![ + ("A", 1u8), + ("B", 1 << 1), + ("C", 1 << 2), + ("ABC", 1 | 1 << 1 | 1 << 2), + ("", !0), + ], + flags, + ); + } +} diff --git a/vendor/bitflags/src/tests/fmt.rs b/vendor/bitflags/src/tests/fmt.rs new file mode 100644 index 000000000..ed4571877 --- /dev/null +++ b/vendor/bitflags/src/tests/fmt.rs @@ -0,0 +1,97 @@ +use super::*; + +#[test] +fn cases() { + case(TestFlags::empty(), "TestFlags(0x0)", "0", "0", "0", "0"); + case(TestFlags::A, "TestFlags(A)", "1", "1", "1", "1"); + case( + TestFlags::all(), + "TestFlags(A | B | C)", + "7", + "7", + "7", + "111", + ); + case( + TestFlags::from_bits_retain(1 << 3), + "TestFlags(0x8)", + "8", + "8", + "10", + "1000", + ); + case( + TestFlags::A | TestFlags::from_bits_retain(1 << 3), + "TestFlags(A | 0x8)", + "9", + "9", + "11", + "1001", + ); + + case(TestZero::ZERO, "TestZero(0x0)", "0", "0", "0", "0"); + case( + TestZero::ZERO | TestZero::from_bits_retain(1), + "TestZero(0x1)", + "1", + "1", + "1", + "1", + ); + + case(TestZeroOne::ONE, "TestZeroOne(ONE)", "1", "1", "1", "1"); + + case( + TestOverlapping::from_bits_retain(1 << 1), + "TestOverlapping(0x2)", + "2", + "2", + "2", + "10", + ); + + case( + TestExternal::from_bits_retain(1 | 1 << 1 | 1 << 3), + "TestExternal(A | B | 0x8)", + "B", + "b", + "13", + "1011", + ); + + case( + TestExternal::all(), + "TestExternal(A | B | C | 0xf8)", + "FF", + "ff", + "377", + "11111111", + ); + + case( + TestExternalFull::all(), + "TestExternalFull(0xff)", + "FF", + "ff", + "377", + "11111111", + ); +} + +#[track_caller] +fn case< + T: std::fmt::Debug + std::fmt::UpperHex + std::fmt::LowerHex + std::fmt::Octal + std::fmt::Binary, +>( + value: T, + debug: &str, + uhex: &str, + lhex: &str, + oct: &str, + bin: &str, +) { + assert_eq!(debug, format!("{:?}", value)); + assert_eq!(uhex, format!("{:X}", value)); + assert_eq!(lhex, format!("{:x}", value)); + assert_eq!(oct, format!("{:o}", value)); + assert_eq!(bin, format!("{:b}", value)); +} diff --git a/vendor/bitflags/src/tests/from_bits.rs b/vendor/bitflags/src/tests/from_bits.rs new file mode 100644 index 000000000..dada9aff8 --- /dev/null +++ b/vendor/bitflags/src/tests/from_bits.rs @@ -0,0 +1,45 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(Some(0), 0, TestFlags::from_bits); + case(Some(1), 1, TestFlags::from_bits); + case( + Some(1 | 1 << 1 | 1 << 2), + 1 | 1 << 1 | 1 << 2, + TestFlags::from_bits, + ); + + case(None, 1 << 3, TestFlags::from_bits); + case(None, 1 | 1 << 3, TestFlags::from_bits); + + case(Some(1 | 1 << 1), 1 | 1 << 1, TestOverlapping::from_bits); + + case(Some(1 << 1), 1 << 1, TestOverlapping::from_bits); + + case(Some(1 << 5), 1 << 5, TestExternal::from_bits); +} + +#[track_caller] +fn case( + expected: Option, + input: T::Bits, + inherent: impl FnOnce(T::Bits) -> Option, +) where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!( + expected, + inherent(input).map(|f| f.bits()), + "T::from_bits({:?})", + input + ); + assert_eq!( + expected, + T::from_bits(input).map(|f| f.bits()), + "Flags::from_bits({:?})", + input + ); +} diff --git a/vendor/bitflags/src/tests/from_bits_retain.rs b/vendor/bitflags/src/tests/from_bits_retain.rs new file mode 100644 index 000000000..1ae28a663 --- /dev/null +++ b/vendor/bitflags/src/tests/from_bits_retain.rs @@ -0,0 +1,38 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(0, TestFlags::from_bits_retain); + case(1, TestFlags::from_bits_retain); + case(1 | 1 << 1 | 1 << 2, TestFlags::from_bits_retain); + + case(1 << 3, TestFlags::from_bits_retain); + case(1 | 1 << 3, TestFlags::from_bits_retain); + + case(1 | 1 << 1, TestOverlapping::from_bits_retain); + + case(1 << 1, TestOverlapping::from_bits_retain); + + case(1 << 5, TestExternal::from_bits_retain); +} + +#[track_caller] +fn case(input: T::Bits, inherent: impl FnOnce(T::Bits) -> T) +where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!( + input, + inherent(input).bits(), + "T::from_bits_retain({:?})", + input + ); + assert_eq!( + input, + T::from_bits_retain(input).bits(), + "Flags::from_bits_retain({:?})", + input + ); +} diff --git a/vendor/bitflags/src/tests/from_bits_truncate.rs b/vendor/bitflags/src/tests/from_bits_truncate.rs new file mode 100644 index 000000000..e4f3e537c --- /dev/null +++ b/vendor/bitflags/src/tests/from_bits_truncate.rs @@ -0,0 +1,42 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(0, 0, TestFlags::from_bits_truncate); + case(1, 1, TestFlags::from_bits_truncate); + case( + 1 | 1 << 1 | 1 << 2, + 1 | 1 << 1 | 1 << 2, + TestFlags::from_bits_truncate, + ); + + case(0, 1 << 3, TestFlags::from_bits_truncate); + case(1, 1 | 1 << 3, TestFlags::from_bits_truncate); + + case(1 | 1 << 1, 1 | 1 << 1, TestOverlapping::from_bits_truncate); + + case(1 << 1, 1 << 1, TestOverlapping::from_bits_truncate); + + case(1 << 5, 1 << 5, TestExternal::from_bits_truncate); +} + +#[track_caller] +fn case(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T) +where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!( + expected, + inherent(input).bits(), + "T::from_bits_truncate({:?})", + input + ); + assert_eq!( + expected, + T::from_bits_truncate(input).bits(), + "Flags::from_bits_truncate({:?})", + input + ); +} diff --git a/vendor/bitflags/src/tests/from_name.rs b/vendor/bitflags/src/tests/from_name.rs new file mode 100644 index 000000000..1d9a4e48b --- /dev/null +++ b/vendor/bitflags/src/tests/from_name.rs @@ -0,0 +1,42 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(Some(1), "A", TestFlags::from_name); + case(Some(1 << 1), "B", TestFlags::from_name); + case(Some(1 | 1 << 1 | 1 << 2), "ABC", TestFlags::from_name); + + case(None, "", TestFlags::from_name); + case(None, "a", TestFlags::from_name); + case(None, "0x1", TestFlags::from_name); + case(None, "A | B", TestFlags::from_name); + + case(Some(0), "ZERO", TestZero::from_name); + + case(Some(2), "二", TestUnicode::from_name); + + case(None, "_", TestExternal::from_name); + + case(None, "", TestExternal::from_name); +} + +#[track_caller] +fn case(expected: Option, input: &str, inherent: impl FnOnce(&str) -> Option) +where + ::Bits: std::fmt::Debug + PartialEq, +{ + assert_eq!( + expected, + inherent(input).map(|f| f.bits()), + "T::from_name({:?})", + input + ); + assert_eq!( + expected, + T::from_name(input).map(|f| f.bits()), + "Flags::from_name({:?})", + input + ); +} diff --git a/vendor/bitflags/src/tests/insert.rs b/vendor/bitflags/src/tests/insert.rs new file mode 100644 index 000000000..b18cd1723 --- /dev/null +++ b/vendor/bitflags/src/tests/insert.rs @@ -0,0 +1,91 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::A, 1), + (TestFlags::A | TestFlags::B, 1 | 1 << 1), + (TestFlags::empty(), 0), + (TestFlags::from_bits_retain(1 << 3), 1 << 3), + ], + TestFlags::insert, + TestFlags::set, + ); + + case( + TestFlags::A, + &[ + (TestFlags::A, 1), + (TestFlags::empty(), 1), + (TestFlags::B, 1 | 1 << 1), + ], + TestFlags::insert, + TestFlags::set, + ); +} + +#[track_caller] +fn case( + value: T, + inputs: &[(T, T::Bits)], + mut inherent_insert: impl FnMut(&mut T, T), + mut inherent_set: impl FnMut(&mut T, T, bool), +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + { + let mut value = value; + inherent_insert(&mut value, *input); + value + } + .bits(), + "{:?}.insert({:?})", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + Flags::insert(&mut value, *input); + value + } + .bits(), + "Flags::insert({:?}, {:?})", + value, + input + ); + + assert_eq!( + *expected, + { + let mut value = value; + inherent_set(&mut value, *input, true); + value + } + .bits(), + "{:?}.set({:?}, true)", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + Flags::set(&mut value, *input, true); + value + } + .bits(), + "Flags::set({:?}, {:?}, true)", + value, + input + ); + } +} diff --git a/vendor/bitflags/src/tests/intersection.rs b/vendor/bitflags/src/tests/intersection.rs new file mode 100644 index 000000000..10a8ae9fb --- /dev/null +++ b/vendor/bitflags/src/tests/intersection.rs @@ -0,0 +1,79 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[(TestFlags::empty(), 0), (TestFlags::all(), 0)], + TestFlags::intersection, + ); + + case( + TestFlags::all(), + &[ + (TestFlags::all(), 1 | 1 << 1 | 1 << 2), + (TestFlags::A, 1), + (TestFlags::from_bits_retain(1 << 3), 0), + ], + TestFlags::intersection, + ); + + case( + TestFlags::from_bits_retain(1 << 3), + &[(TestFlags::from_bits_retain(1 << 3), 1 << 3)], + TestFlags::intersection, + ); + + case( + TestOverlapping::AB, + &[(TestOverlapping::BC, 1 << 1)], + TestOverlapping::intersection, + ); +} + +#[track_caller] +fn case + std::ops::BitAndAssign + Copy>( + value: T, + inputs: &[(T, T::Bits)], + mut inherent: impl FnMut(T, T) -> T, +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent(value, *input).bits(), + "{:?}.intersection({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::intersection(value, *input).bits(), + "Flags::intersection({:?}, {:?})", + value, + input + ); + assert_eq!( + *expected, + (value & *input).bits(), + "{:?} & {:?}", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + value &= *input; + value + } + .bits(), + "{:?} &= {:?}", + value, + input, + ); + } +} diff --git a/vendor/bitflags/src/tests/intersects.rs b/vendor/bitflags/src/tests/intersects.rs new file mode 100644 index 000000000..fe907981a --- /dev/null +++ b/vendor/bitflags/src/tests/intersects.rs @@ -0,0 +1,91 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::empty(), false), + (TestFlags::A, false), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::from_bits_retain(1 << 3), false), + ], + TestFlags::intersects, + ); + + case( + TestFlags::A, + &[ + (TestFlags::empty(), false), + (TestFlags::A, true), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::ABC, true), + (TestFlags::from_bits_retain(1 << 3), false), + (TestFlags::from_bits_retain(1 | (1 << 3)), true), + ], + TestFlags::intersects, + ); + + case( + TestFlags::ABC, + &[ + (TestFlags::empty(), false), + (TestFlags::A, true), + (TestFlags::B, true), + (TestFlags::C, true), + (TestFlags::ABC, true), + (TestFlags::from_bits_retain(1 << 3), false), + ], + TestFlags::intersects, + ); + + case( + TestFlags::from_bits_retain(1 << 3), + &[ + (TestFlags::empty(), false), + (TestFlags::A, false), + (TestFlags::B, false), + (TestFlags::C, false), + (TestFlags::from_bits_retain(1 << 3), true), + ], + TestFlags::intersects, + ); + + case( + TestOverlapping::AB, + &[ + (TestOverlapping::AB, true), + (TestOverlapping::BC, true), + (TestOverlapping::from_bits_retain(1 << 1), true), + ], + TestOverlapping::intersects, + ); +} + +#[track_caller] +fn case( + value: T, + inputs: &[(T, bool)], + mut inherent: impl FnMut(&T, T) -> bool, +) { + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent(&value, *input), + "{:?}.intersects({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::intersects(&value, *input), + "Flags::intersects({:?}, {:?})", + value, + input + ); + } +} diff --git a/vendor/bitflags/src/tests/is_all.rs b/vendor/bitflags/src/tests/is_all.rs new file mode 100644 index 000000000..382a458f6 --- /dev/null +++ b/vendor/bitflags/src/tests/is_all.rs @@ -0,0 +1,32 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(false, TestFlags::empty(), TestFlags::is_all); + case(false, TestFlags::A, TestFlags::is_all); + + case(true, TestFlags::ABC, TestFlags::is_all); + + case( + true, + TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), + TestFlags::is_all, + ); + + case(true, TestZero::empty(), TestZero::is_all); + + case(true, TestEmpty::empty(), TestEmpty::is_all); +} + +#[track_caller] +fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { + assert_eq!(expected, inherent(&value), "{:?}.is_all()", value); + assert_eq!( + expected, + Flags::is_all(&value), + "Flags::is_all({:?})", + value + ); +} diff --git a/vendor/bitflags/src/tests/is_empty.rs b/vendor/bitflags/src/tests/is_empty.rs new file mode 100644 index 000000000..92165f18e --- /dev/null +++ b/vendor/bitflags/src/tests/is_empty.rs @@ -0,0 +1,31 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case(true, TestFlags::empty(), TestFlags::is_empty); + + case(false, TestFlags::A, TestFlags::is_empty); + case(false, TestFlags::ABC, TestFlags::is_empty); + case( + false, + TestFlags::from_bits_retain(1 << 3), + TestFlags::is_empty, + ); + + case(true, TestZero::empty(), TestZero::is_empty); + + case(true, TestEmpty::empty(), TestEmpty::is_empty); +} + +#[track_caller] +fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { + assert_eq!(expected, inherent(&value), "{:?}.is_empty()", value); + assert_eq!( + expected, + Flags::is_empty(&value), + "Flags::is_empty({:?})", + value + ); +} diff --git a/vendor/bitflags/src/tests/iter.rs b/vendor/bitflags/src/tests/iter.rs new file mode 100644 index 000000000..54b1d27d4 --- /dev/null +++ b/vendor/bitflags/src/tests/iter.rs @@ -0,0 +1,209 @@ +use super::*; + +use crate::Flags; + +#[test] +#[cfg(not(miri))] // Very slow in miri +fn roundtrip() { + for a in 0u8..=255 { + for b in 0u8..=255 { + let f = TestFlags::from_bits_retain(a | b); + + assert_eq!(f, f.iter().collect::()); + assert_eq!( + TestFlags::from_bits_truncate(f.bits()), + f.iter_names().map(|(_, f)| f).collect::() + ); + + let f = TestExternal::from_bits_retain(a | b); + + assert_eq!(f, f.iter().collect::()); + } + } +} + +mod collect { + use super::*; + + #[test] + fn cases() { + assert_eq!(0, [].into_iter().collect::().bits()); + + assert_eq!(1, [TestFlags::A,].into_iter().collect::().bits()); + + assert_eq!( + 1 | 1 << 1 | 1 << 2, + [TestFlags::A, TestFlags::B | TestFlags::C,] + .into_iter() + .collect::() + .bits() + ); + + assert_eq!( + 1 | 1 << 3, + [ + TestFlags::from_bits_retain(1 << 3), + TestFlags::empty(), + TestFlags::A, + ] + .into_iter() + .collect::() + .bits() + ); + + assert_eq!( + 1 << 5 | 1 << 7, + [ + TestExternal::empty(), + TestExternal::from_bits_retain(1 << 5), + TestExternal::from_bits_retain(1 << 7), + ] + .into_iter() + .collect::() + .bits() + ); + } +} + +mod iter { + use super::*; + + #[test] + fn cases() { + case(&[], TestFlags::empty(), TestFlags::iter); + + case(&[1], TestFlags::A, TestFlags::iter); + case(&[1, 1 << 1], TestFlags::A | TestFlags::B, TestFlags::iter); + case( + &[1, 1 << 1, 1 << 3], + TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), + TestFlags::iter, + ); + + case(&[1, 1 << 1, 1 << 2], TestFlags::ABC, TestFlags::iter); + case( + &[1, 1 << 1, 1 << 2, 1 << 3], + TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), + TestFlags::iter, + ); + + case( + &[1 | 1 << 1 | 1 << 2], + TestFlagsInvert::ABC, + TestFlagsInvert::iter, + ); + + case(&[], TestZero::ZERO, TestZero::iter); + + case( + &[1, 1 << 1, 1 << 2, 0b1111_1000], + TestExternal::all(), + TestExternal::iter, + ); + } + + #[track_caller] + fn case + Copy>( + expected: &[T::Bits], + value: T, + inherent: impl FnOnce(&T) -> crate::iter::Iter, + ) where + T::Bits: std::fmt::Debug + PartialEq, + { + assert_eq!( + expected, + inherent(&value).map(|f| f.bits()).collect::>(), + "{:?}.iter()", + value + ); + assert_eq!( + expected, + Flags::iter(&value).map(|f| f.bits()).collect::>(), + "Flags::iter({:?})", + value + ); + assert_eq!( + expected, + value.into_iter().map(|f| f.bits()).collect::>(), + "{:?}.into_iter()", + value + ); + } +} + +mod iter_names { + use super::*; + + #[test] + fn cases() { + case(&[], TestFlags::empty(), TestFlags::iter_names); + + case(&[("A", 1)], TestFlags::A, TestFlags::iter_names); + case( + &[("A", 1), ("B", 1 << 1)], + TestFlags::A | TestFlags::B, + TestFlags::iter_names, + ); + case( + &[("A", 1), ("B", 1 << 1)], + TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), + TestFlags::iter_names, + ); + + case( + &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)], + TestFlags::ABC, + TestFlags::iter_names, + ); + case( + &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)], + TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), + TestFlags::iter_names, + ); + + case( + &[("ABC", 1 | 1 << 1 | 1 << 2)], + TestFlagsInvert::ABC, + TestFlagsInvert::iter_names, + ); + + case(&[], TestZero::ZERO, TestZero::iter_names); + + case( + &[("A", 1)], + TestOverlappingFull::A, + TestOverlappingFull::iter_names, + ); + case( + &[("A", 1), ("D", 1 << 1)], + TestOverlappingFull::A | TestOverlappingFull::D, + TestOverlappingFull::iter_names, + ); + } + + #[track_caller] + fn case( + expected: &[(&'static str, T::Bits)], + value: T, + inherent: impl FnOnce(&T) -> crate::iter::IterNames, + ) where + T::Bits: std::fmt::Debug + PartialEq, + { + assert_eq!( + expected, + inherent(&value) + .map(|(n, f)| (n, f.bits())) + .collect::>(), + "{:?}.iter_names()", + value + ); + assert_eq!( + expected, + Flags::iter_names(&value) + .map(|(n, f)| (n, f.bits())) + .collect::>(), + "Flags::iter_names({:?})", + value + ); + } +} diff --git a/vendor/bitflags/src/tests/parser.rs b/vendor/bitflags/src/tests/parser.rs new file mode 100644 index 000000000..b370785cf --- /dev/null +++ b/vendor/bitflags/src/tests/parser.rs @@ -0,0 +1,116 @@ +use super::*; + +use crate::{ + parser::{from_str, to_writer}, + Flags, +}; + +#[test] +#[cfg(not(miri))] // Very slow in miri +fn roundtrip() { + let mut s = String::new(); + + for a in 0u8..=255 { + for b in 0u8..=255 { + let f = TestFlags::from_bits_retain(a | b); + + s.clear(); + to_writer(&f, &mut s).unwrap(); + + assert_eq!(f, from_str::(&s).unwrap()); + } + } +} + +mod from_str { + use super::*; + + #[test] + fn valid() { + assert_eq!(0, from_str::("").unwrap().bits()); + + assert_eq!(1, from_str::("A").unwrap().bits()); + assert_eq!(1, from_str::(" A ").unwrap().bits()); + assert_eq!( + 1 | 1 << 1 | 1 << 2, + from_str::("A | B | C").unwrap().bits() + ); + assert_eq!( + 1 | 1 << 1 | 1 << 2, + from_str::("A\n|\tB\r\n| C ").unwrap().bits() + ); + assert_eq!( + 1 | 1 << 1 | 1 << 2, + from_str::("A|B|C").unwrap().bits() + ); + + assert_eq!(1 << 3, from_str::("0x8").unwrap().bits()); + assert_eq!(1 | 1 << 3, from_str::("A | 0x8").unwrap().bits()); + assert_eq!( + 1 | 1 << 1 | 1 << 3, + from_str::("0x1 | 0x8 | B").unwrap().bits() + ); + + assert_eq!( + 1 | 1 << 1, + from_str::("一 | 二").unwrap().bits() + ); + } + + #[test] + fn invalid() { + assert!(from_str::("a") + .unwrap_err() + .to_string() + .starts_with("unrecognized named flag")); + assert!(from_str::("A & B") + .unwrap_err() + .to_string() + .starts_with("unrecognized named flag")); + + assert!(from_str::("0xg") + .unwrap_err() + .to_string() + .starts_with("invalid hex flag")); + assert!(from_str::("0xffffffffffff") + .unwrap_err() + .to_string() + .starts_with("invalid hex flag")); + } +} + +mod to_writer { + use super::*; + + #[test] + fn cases() { + assert_eq!("", write(TestFlags::empty())); + assert_eq!("A", write(TestFlags::A)); + assert_eq!("A | B | C", write(TestFlags::all())); + assert_eq!("0x8", write(TestFlags::from_bits_retain(1 << 3))); + assert_eq!( + "A | 0x8", + write(TestFlags::A | TestFlags::from_bits_retain(1 << 3)) + ); + + assert_eq!("", write(TestZero::ZERO)); + + assert_eq!("ABC", write(TestFlagsInvert::all())); + + assert_eq!("A", write(TestOverlappingFull::C)); + assert_eq!( + "A | D", + write(TestOverlappingFull::C | TestOverlappingFull::D) + ); + } + + fn write(value: F) -> String + where + F::Bits: crate::parser::WriteHex, + { + let mut s = String::new(); + + to_writer(&value, &mut s).unwrap(); + s + } +} diff --git a/vendor/bitflags/src/tests/remove.rs b/vendor/bitflags/src/tests/remove.rs new file mode 100644 index 000000000..574b1edbf --- /dev/null +++ b/vendor/bitflags/src/tests/remove.rs @@ -0,0 +1,100 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::A, 0), + (TestFlags::empty(), 0), + (TestFlags::from_bits_retain(1 << 3), 0), + ], + TestFlags::remove, + TestFlags::set, + ); + + case( + TestFlags::A, + &[ + (TestFlags::A, 0), + (TestFlags::empty(), 1), + (TestFlags::B, 1), + ], + TestFlags::remove, + TestFlags::set, + ); + + case( + TestFlags::ABC, + &[ + (TestFlags::A, 1 << 1 | 1 << 2), + (TestFlags::A | TestFlags::C, 1 << 1), + ], + TestFlags::remove, + TestFlags::set, + ); +} + +#[track_caller] +fn case( + value: T, + inputs: &[(T, T::Bits)], + mut inherent_remove: impl FnMut(&mut T, T), + mut inherent_set: impl FnMut(&mut T, T, bool), +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + { + let mut value = value; + inherent_remove(&mut value, *input); + value + } + .bits(), + "{:?}.remove({:?})", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + Flags::remove(&mut value, *input); + value + } + .bits(), + "Flags::remove({:?}, {:?})", + value, + input + ); + + assert_eq!( + *expected, + { + let mut value = value; + inherent_set(&mut value, *input, false); + value + } + .bits(), + "{:?}.set({:?}, false)", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + Flags::set(&mut value, *input, false); + value + } + .bits(), + "Flags::set({:?}, {:?}, false)", + value, + input + ); + } +} diff --git a/vendor/bitflags/src/tests/symmetric_difference.rs b/vendor/bitflags/src/tests/symmetric_difference.rs new file mode 100644 index 000000000..75e9123ac --- /dev/null +++ b/vendor/bitflags/src/tests/symmetric_difference.rs @@ -0,0 +1,110 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::empty(), 0), + (TestFlags::all(), 1 | 1 << 1 | 1 << 2), + (TestFlags::from_bits_retain(1 << 3), 1 << 3), + ], + TestFlags::symmetric_difference, + TestFlags::toggle, + ); + + case( + TestFlags::A, + &[ + (TestFlags::empty(), 1), + (TestFlags::A, 0), + (TestFlags::all(), 1 << 1 | 1 << 2), + ], + TestFlags::symmetric_difference, + TestFlags::toggle, + ); + + case( + TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), + &[ + (TestFlags::ABC, 1 << 2 | 1 << 3), + (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1), + ], + TestFlags::symmetric_difference, + TestFlags::toggle, + ); +} + +#[track_caller] +fn case + std::ops::BitXorAssign + Copy>( + value: T, + inputs: &[(T, T::Bits)], + mut inherent_sym_diff: impl FnMut(T, T) -> T, + mut inherent_toggle: impl FnMut(&mut T, T), +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent_sym_diff(value, *input).bits(), + "{:?}.symmetric_difference({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::symmetric_difference(value, *input).bits(), + "Flags::symmetric_difference({:?}, {:?})", + value, + input + ); + assert_eq!( + *expected, + (value ^ *input).bits(), + "{:?} ^ {:?}", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + value ^= *input; + value + } + .bits(), + "{:?} ^= {:?}", + value, + input, + ); + + assert_eq!( + *expected, + { + let mut value = value; + inherent_toggle(&mut value, *input); + value + } + .bits(), + "{:?}.toggle({:?})", + value, + input, + ); + + assert_eq!( + *expected, + { + let mut value = value; + Flags::toggle(&mut value, *input); + value + } + .bits(), + "{:?}.toggle({:?})", + value, + input, + ); + } +} diff --git a/vendor/bitflags/src/tests/union.rs b/vendor/bitflags/src/tests/union.rs new file mode 100644 index 000000000..619068193 --- /dev/null +++ b/vendor/bitflags/src/tests/union.rs @@ -0,0 +1,71 @@ +use super::*; + +use crate::Flags; + +#[test] +fn cases() { + case( + TestFlags::empty(), + &[ + (TestFlags::A, 1), + (TestFlags::all(), 1 | 1 << 1 | 1 << 2), + (TestFlags::empty(), 0), + (TestFlags::from_bits_retain(1 << 3), 1 << 3), + ], + TestFlags::union, + ); + + case( + TestFlags::A | TestFlags::C, + &[ + (TestFlags::A | TestFlags::B, 1 | 1 << 1 | 1 << 2), + (TestFlags::A, 1 | 1 << 2), + ], + TestFlags::union, + ); +} + +#[track_caller] +fn case + std::ops::BitOrAssign + Copy>( + value: T, + inputs: &[(T, T::Bits)], + mut inherent: impl FnMut(T, T) -> T, +) where + T::Bits: std::fmt::Debug + PartialEq + Copy, +{ + for (input, expected) in inputs { + assert_eq!( + *expected, + inherent(value, *input).bits(), + "{:?}.union({:?})", + value, + input + ); + assert_eq!( + *expected, + Flags::union(value, *input).bits(), + "Flags::union({:?}, {:?})", + value, + input + ); + assert_eq!( + *expected, + (value | *input).bits(), + "{:?} | {:?}", + value, + input + ); + assert_eq!( + *expected, + { + let mut value = value; + value |= *input; + value + } + .bits(), + "{:?} |= {:?}", + value, + input, + ); + } +} diff --git a/vendor/chrono/.cargo-checksum.json b/vendor/chrono/.cargo-checksum.json index fc1ef4947..88af556f2 100644 --- a/vendor/chrono/.cargo-checksum.json +++ b/vendor/chrono/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"1cc518c80946bc676a8c691428abe1cdf5a2e4e210b3cacc264b2efc5489d566","CITATION.cff":"fcefd4153bd1d2bcbddb15a1d71f0ad861585bba93dab277fdbe054760ed99c6","Cargo.toml":"32aa9671d6b7b8c1f648f026aeb5a75bff5dd7d44b03179c2f9376f77d702081","LICENSE.txt":"46610329ff0b38effb9cb05979ff1ef761e465fed96b2eaca39e439d00129fd7","README.md":"1d2c96f8a518720657df2e8ca3e2efb34c8a8a39a119e2e89c194c7a0a3cf186","appveyor.yml":"bcfcff73097a37be373e91934294cfea31fbdfe7a4b01a83bcbc64a8a56c3971","deny.toml":"21f7b311b1140b79840e4fe305aaff8fe88db694207e194cf741f5c4665ee99f","rustfmt.toml":"f74204a6f92aa7422a16ecb2ffe2d5bae0f123b778d08b5db1a398a3c9ca4306","src/date.rs":"f7950660aa67aa120f42a81908e87edbd4de7a8e51e58bb2d4e0f57385c34366","src/datetime/mod.rs":"b968b0eabb66294e5a71abe9af65211e4a3749889ce0c89a69cb8530da45373c","src/datetime/rustc_serialize.rs":"99fd592e7ad610c2d1e53f3b8b92cef58bee9f6e70940aad43482c21d2095d69","src/datetime/serde.rs":"558d5779c048aedbe4c29826e900027b22b7897587ad8face698a5fa8fb24e19","src/datetime/tests.rs":"719a2c5d5392353877ab6bce53b4a267466831df60bc30d7cb9c780699b3a7e7","src/duration.rs":"ebcf1bfbacc25a0538c399d82266c11535a1f7a60b027ed3212f4273702ee5b5","src/format/formatting.rs":"731446315ee35311f2ed406784b520134cdd4328e7ad9cbdaae1198f470a43d6","src/format/locales.rs":"c35aef701aa077e1b056c9eb7a561241a178207d2f6f748e1b00ee2afcfd8740","src/format/mod.rs":"b16009fa89447352c035eeb549a0369785977d2605e8f8df254b5566101f0c83","src/format/parse.rs":"27c1a5ba032c507be122d216d3b81e0c59ffbaee3dc4b1e4ad9b2f6edec19bab","src/format/parsed.rs":"fc24b6c7a2e8daaadcb380064c1991199bebf8aec2b7bd0c1b8a00606d42c6b4","src/format/scan.rs":"8128de9055035970c29ef5259bd5a39b6630c1e9111a6ca1649ff1db612e70d8","src/format/strftime.rs":"167d43e0cc6b0bc09c412d905a6e3e493c09680f72f6ddd5a33e32e7308064a0","src/lib.rs":"0361e041a692d06627500158fbe30304d721968f2f4d6318a1d5b06d0947bf84","src/month.rs":"5c1ccdba79aa00048fa2f1b02432fcba12699d92b68d72c55cfb0fedfec30907","src/naive/date.rs":"72b829b457105d96375b6ff598f7c9f19734533fd7b7abe43660f4d6af391df9","src/naive/datetime/mod.rs":"f4fbca2f8c731b0131eb087bdbbb544aa499d41239c6b754f771c98999154733","src/naive/datetime/rustc_serialize.rs":"9d1d7713a3f16a8b58b528a6dc049a1c55d5b64d3f6bcfc398dd49914f95fe3b","src/naive/datetime/serde.rs":"77ded6c3b62151efaff4e07bba139084f6e5f02e3a9414b7031b57f227b1341c","src/naive/datetime/tests.rs":"2c1d1b824d0919f729a634fd04ca1b0acabc84527c19bcefd01bd78e6d1db6ae","src/naive/internals.rs":"01b6546b6e227f78a2019cb900433fe5d6cbb44946061fbf78f1d7841e11e732","src/naive/isoweek.rs":"6be60339127c5d7ad36b1137a71d23ca7002ce026261d9c88b7ad4c43954b04d","src/naive/mod.rs":"d49f7f51e82258b1cfd61179ce551d5789af6586984b2f8aa84820c4bb73174c","src/naive/time/mod.rs":"99112cd5c0cec374156a2f36876acc69ad76ee928bc925bf0cfd1bde1f4c15c7","src/naive/time/rustc_serialize.rs":"20f7213eb25c15c5936472475a49065e31ac821c6a2a095aeeaeac2177817513","src/naive/time/serde.rs":"024dea739ff0bcd39d4a242a650f14a8d24892e9b67e5638cc56337283fa99f4","src/naive/time/tests.rs":"dac776ad3955d4f23958ff6b2925c12e064206565d082bb28ec3cba5add2175c","src/offset/fixed.rs":"6a9bcdeebb0859f2b8367049de1d34f1bf146655e934dc2f227d278f7dd20631","src/offset/local/mod.rs":"c4c1bc039881163ac12ea827fb24190802709753f98ea2cfa9ee3b698562bc1a","src/offset/local/tz_info/mod.rs":"c8096637c04687ea396e444c25fdf0008e2b9975ab3c173a41dd63ac213c7877","src/offset/local/tz_info/parser.rs":"4e2f34a6e760833392bc7da038721fb5e266eebb8e4b327a8140e2d8504de4ec","src/offset/local/tz_info/rule.rs":"54df6b45c4517e5442c04654a87c3082dc789b48761237449389802b829acab9","src/offset/local/tz_info/timezone.rs":"12d134c8dff6d37fb1388ab6c49086113d25eae20336693ff752d70ccd181668","src/offset/local/unix.rs":"5a03f58cf5e8efb8046308a88f2fcf36dbd295077071398300e7d7c5da1bfdbf","src/offset/local/win_bindings.rs":"d06a26a9cb37f3cacc1bc8d41d085d38291dac190d59add2b5d1428da8e46fda","src/offset/local/win_bindings.txt":"6ff598625e3ea85396b19757c0412b5eda884bd3ac95e77376a601564d89201f","src/offset/local/windows.rs":"fe06eca5670f4d87f690dc01b8444d7b7c43762df83959af394195a91837f46a","src/offset/mod.rs":"5b22fb30bc0c37226137ddd6e37425108749266d110ec750fca543010f893eff","src/offset/utc.rs":"18c9853f960a9702a34d14e19f04c6f3b3d097f28bec9a81a5b575a33a4d29b6","src/round.rs":"86c8c630b662fd3957820e129a9aaade1df47f2ff3d4879ccb8bdf446a089303","src/traits.rs":"c769137f9daf8639c5f7195650fa256837381d224a454564deada2a65434d871","src/weekday.rs":"ac5d0847b75977a1e7e98f5eff4e37109ace9b9dc75cc4bfe4b08ff85ca1d6af","taplo.toml":"31cedc3123ed92e506be1f265c2c08cbf8c0b8394aa678fd413ea9dd740f6408","tests/dateutils.rs":"356222da0f523c22bf4c7763b6df103d8b954f13692411aa00cfda5715cf1dc0","tests/wasm.rs":"a3e5cf1cf10d106a90072dd9b1583ecc48ea05163a6ec65d0e3bb38871ab941b","tests/win_bindings.rs":"b23c8d95c724ecf55879229cb20db6bf85d8f76a87221d1e67cb07bb71d29836"},"package":"7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"} \ No newline at end of file +{"files":{"CHANGELOG.md":"1cc518c80946bc676a8c691428abe1cdf5a2e4e210b3cacc264b2efc5489d566","CITATION.cff":"cfc091a5e33802f7efaec42be93d90cc60e6e5ff52ebe1dc139802033fe1f39d","Cargo.toml":"c0ee27e8a240d4ced2c4d61b3f6e171b78c1d1d4223cd72515f241a25c55fe4e","LICENSE.txt":"46610329ff0b38effb9cb05979ff1ef761e465fed96b2eaca39e439d00129fd7","README.md":"cf766f179e46c8d29b571af6783eaf54d85366bff940fd6186cd70aa0982037d","appveyor.yml":"bcfcff73097a37be373e91934294cfea31fbdfe7a4b01a83bcbc64a8a56c3971","deny.toml":"64e6f7348638d13ea2f87d8fff7654aae7caaff428d4e50671de55ccd989283c","rustfmt.toml":"f74204a6f92aa7422a16ecb2ffe2d5bae0f123b778d08b5db1a398a3c9ca4306","src/date.rs":"b3983516778daf7a1f18475af454e6db5d4248f522196ed806d58e2ea9d51461","src/datetime/mod.rs":"c0efcfd2bcd34f0a7f47b6900bd6f94fc075991945da2ca03a07e2a1317f42ee","src/datetime/rustc_serialize.rs":"1244cb03b64f6f70949feff694bad987ac562b913fcb146e72d93c97f8c5ff3e","src/datetime/serde.rs":"40423f8d4dfd62d4ec532f1f29dc7cb43d233c4dfaa566330f75399bd12d56ef","src/datetime/tests.rs":"ac1c55c696fa6444c0b4a683a09c0a410fb9da812fa7bda928c6fe2dfb800003","src/duration.rs":"143b0044c9f5de8321ac2fa1d757832e0ee0bf2e9140ed4848315cce726d4265","src/format/formatting.rs":"6f094677df61b795610596355866504f6b7efa2c7745bbe0a985593349203116","src/format/locales.rs":"c35aef701aa077e1b056c9eb7a561241a178207d2f6f748e1b00ee2afcfd8740","src/format/mod.rs":"e92855403513443e26877295576eed1877f33dc6c58aa26cdf7815de3c849433","src/format/parse.rs":"4c1b4351f85fb68799f0b49f2a85ef5c2e56a8d1179a9c0750393d5e6c0f628b","src/format/parsed.rs":"992f2103a6a65fbe266fa6db64a33755d72039694c7c09cd273c8ef03ed18550","src/format/scan.rs":"9fb2de4308b27dfda0f3e67f6a7c2cfd87a1cd35af8faa1c65e8eaacafd97a08","src/format/strftime.rs":"817f33851639315778872886e8c9e362021fcd4206985cce063fa36e6d9dd2c5","src/lib.rs":"ba9d491ccad0f805a3a947e30700bb6a8076306d22c890f8f2f0a22b5c1f9ece","src/month.rs":"76c9214788350a86aea9a245414f66d8b75496c0e290f1410c2d372e464ddb5b","src/naive/date.rs":"9c39df6b5b5cd9cfa9b7953b7ec2e96a16d87528a6ead6341a503ba4ce633d16","src/naive/datetime/mod.rs":"d0c2b791de7b298c380df00990a5ce053ee352e85222efe9306d0243eceb9579","src/naive/datetime/rustc_serialize.rs":"35e13e1a5ecd84730e0f8c091464ad068cdbc3c54852c0d1dca57ccd9f3b65ee","src/naive/datetime/serde.rs":"b6e65411f38102d0bda3dc5ec67db095732296e6567010e5274d836496cf26a1","src/naive/datetime/tests.rs":"2a464c899d84c8a7c2a697dc75f8cb8c0989b2cd41007c72180a889988d9e04e","src/naive/internals.rs":"4abb372a9124500746f73bdb99f3b034912984f12b05bc4cd467f88729f16060","src/naive/isoweek.rs":"9b023be1d1e7440508a02168c4fbf7efd694fa7f2f4658fc3b792cbf6239ac27","src/naive/mod.rs":"022e7e9c1e3005d6735daa46b0088836ebbc85044144b8f9cdf049cadd8557c2","src/naive/time/mod.rs":"8e550d9b90b89773945636a5967b260c4626b8bff7b5f0196d1e2565e10a7900","src/naive/time/rustc_serialize.rs":"8ef7a5b4eac14662f394b23a3910c104bbb1bc7bcd97baede2ca1bb799c7dc9d","src/naive/time/serde.rs":"1fce0915feec4ddc898847d6b1846b4c2de9b6a789c07f01efacdfccdfd6d9a4","src/naive/time/tests.rs":"735a24addc796381286d06ae1c135d3003433850eaf1533bebb35cdae7641356","src/offset/fixed.rs":"101a5da6c58e0d9f2bd3f9d8b3e04f7c09786a099aa28d43ebad1c211647b9f9","src/offset/local/mod.rs":"5ce3116782fd910c1989e67bc87e384104b39dcdc8ca26d11abc021ecbf299af","src/offset/local/tz_info/mod.rs":"c8096637c04687ea396e444c25fdf0008e2b9975ab3c173a41dd63ac213c7877","src/offset/local/tz_info/parser.rs":"4e2f34a6e760833392bc7da038721fb5e266eebb8e4b327a8140e2d8504de4ec","src/offset/local/tz_info/rule.rs":"54df6b45c4517e5442c04654a87c3082dc789b48761237449389802b829acab9","src/offset/local/tz_info/timezone.rs":"12d134c8dff6d37fb1388ab6c49086113d25eae20336693ff752d70ccd181668","src/offset/local/unix.rs":"5a03f58cf5e8efb8046308a88f2fcf36dbd295077071398300e7d7c5da1bfdbf","src/offset/local/win_bindings.rs":"770dfaf634a2f0e3256c93f2e3e545962c76f664ed4bf689df07fc24bd436088","src/offset/local/win_bindings.txt":"6ff598625e3ea85396b19757c0412b5eda884bd3ac95e77376a601564d89201f","src/offset/local/windows.rs":"fe06eca5670f4d87f690dc01b8444d7b7c43762df83959af394195a91837f46a","src/offset/mod.rs":"49fd6ef0c55fc0d2db01b64b37f60224d48fdee50dd4f08c4f84281cf08d0b27","src/offset/utc.rs":"66bf542fdf915cecf4c87dd1639e23cdd5aa9da2a5265fac24cf0f599503a5c6","src/round.rs":"06e73859731e449b6c8ffcfb585c3711720b851a38dc8463bbbb3d82855e73dc","src/traits.rs":"c769137f9daf8639c5f7195650fa256837381d224a454564deada2a65434d871","src/weekday.rs":"27b1726575f78982ac30a3f91ea0f9407c31ca5dc68ac450558b55ddd5d2c0b2","taplo.toml":"31cedc3123ed92e506be1f265c2c08cbf8c0b8394aa678fd413ea9dd740f6408","tests/dateutils.rs":"70516eaa5b88177f4b1b83e1b34e9f1c280399427839fde4a22532a63e60106b","tests/wasm.rs":"a3e5cf1cf10d106a90072dd9b1583ecc48ea05163a6ec65d0e3bb38871ab941b","tests/win_bindings.rs":"b23c8d95c724ecf55879229cb20db6bf85d8f76a87221d1e67cb07bb71d29836"},"package":"9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb"} \ No newline at end of file diff --git a/vendor/chrono/CITATION.cff b/vendor/chrono/CITATION.cff index 877b1b48b..8ee34c214 100644 --- a/vendor/chrono/CITATION.cff +++ b/vendor/chrono/CITATION.cff @@ -3,8 +3,8 @@ cff-version: 1.2.0 message: Please cite this crate using these information. # Version information. -date-released: 2023-09-15 -version: 0.4.31 +date-released: 2024-01-25 +version: 0.4.33 # Project information. abstract: Date and time library for Rust diff --git a/vendor/chrono/Cargo.toml b/vendor/chrono/Cargo.toml index db2bd8fe8..cb6bbd5af 100644 --- a/vendor/chrono/Cargo.toml +++ b/vendor/chrono/Cargo.toml @@ -11,9 +11,9 @@ [package] edition = "2021" -rust-version = "1.57.0" +rust-version = "1.61.0" name = "chrono" -version = "0.4.31" +version = "0.4.33" exclude = ["/ci/*"] description = "Date and time library for Rust" homepage = "https://github.com/chronotope/chrono" @@ -29,7 +29,12 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/chronotope/chrono" [package.metadata.docs.rs] -features = ["serde"] +features = [ + "arbitrary", + "rkyv", + "serde", + "unstable-locales", +] rustdoc-args = [ "--cfg", "docsrs", @@ -55,8 +60,9 @@ version = "0.7" optional = true [dependencies.rkyv] -version = "0.7" +version = "0.7.43" optional = true +default-features = false [dependencies.rustc-serialize] version = "0.3.20" @@ -81,10 +87,10 @@ version = "1" __internal_bench = [] alloc = [] clock = [ - "std", "winapi", "iana-time-zone", "android-tzdata", + "now", ] default = [ "clock", @@ -93,12 +99,27 @@ default = [ "wasmbind", ] libc = [] +now = ["std"] oldtime = [] -std = [] -unstable-locales = [ - "pure-rust-locales", - "alloc", +rkyv = [ + "dep:rkyv", + "rkyv/size_32", ] +rkyv-16 = [ + "dep:rkyv", + "rkyv?/size_16", +] +rkyv-32 = [ + "dep:rkyv", + "rkyv?/size_32", +] +rkyv-64 = [ + "dep:rkyv", + "rkyv?/size_64", +] +rkyv-validation = ["rkyv?/validation"] +std = ["alloc"] +unstable-locales = ["pure-rust-locales"] wasmbind = [ "wasm-bindgen", "js-sys", @@ -126,8 +147,8 @@ features = ["fallback"] optional = true [target."cfg(windows)".dependencies.windows-targets] -version = "0.48" +version = "0.52" optional = true [target."cfg(windows)".dev-dependencies.windows-bindgen] -version = "0.51" +version = "0.52" diff --git a/vendor/chrono/README.md b/vendor/chrono/README.md index c3222ddaa..c75a50096 100644 --- a/vendor/chrono/README.md +++ b/vendor/chrono/README.md @@ -53,7 +53,8 @@ Default features: * `alloc`: Enable features that depend on allocation (primarily string formatting) * `std`: Enables functionality that depends on the standard library. This is a superset of `alloc` and adds interoperation with standard library types and traits. -* `clock`: Enables reading the system time (`now`) and local timezone (`Local`). +* `clock`: Enables reading the local timezone (`Local`). This is a superset of `now`. +* `now`: Enables reading the system time (`now`) * `wasmbind`: Interface with the JS Date API for the `wasm32` target. Optional features: @@ -67,7 +68,7 @@ Optional features: ## Rust version requirements -The Minimum Supported Rust Version (MSRV) is currently **Rust 1.57.0**. +The Minimum Supported Rust Version (MSRV) is currently **Rust 1.61.0**. The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done lightly. diff --git a/vendor/chrono/deny.toml b/vendor/chrono/deny.toml index 0e486c847..186290e03 100644 --- a/vendor/chrono/deny.toml +++ b/vendor/chrono/deny.toml @@ -4,8 +4,6 @@ copyleft = "deny" [advisories] ignore = [ - "RUSTSEC-2020-0071", # time 0.1, doesn't affect the API we use - "RUSTSEC-2021-0145", # atty (dev-deps only, dependency of criterion) "RUSTSEC-2022-0004", # rustc_serialize, cannot remove due to compatibility ] unmaintained = "deny" diff --git a/vendor/chrono/src/date.rs b/vendor/chrono/src/date.rs index 5e8469237..8a8511b52 100644 --- a/vendor/chrono/src/date.rs +++ b/vendor/chrono/src/date.rs @@ -4,7 +4,7 @@ //! ISO 8601 calendar date with time zone. #![allow(deprecated)] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use core::borrow::Borrow; use core::cmp::Ordering; use core::ops::{Add, AddAssign, Sub, SubAssign}; @@ -14,9 +14,9 @@ use core::{fmt, hash}; use rkyv::{Archive, Deserialize, Serialize}; use crate::duration::Duration as OldDuration; -#[cfg(feature = "unstable-locales")] +#[cfg(all(feature = "unstable-locales", feature = "alloc"))] use crate::format::Locale; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use crate::format::{DelayedFormat, Item, StrftimeItems}; use crate::naive::{IsoWeek, NaiveDate, NaiveTime}; use crate::offset::{TimeZone, Utc}; @@ -333,8 +333,7 @@ where Tz::Offset: fmt::Display, { /// Formats the date with the specified formatting items. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -348,8 +347,7 @@ where /// Formats the date with the specified format string. /// See the [`crate::format::strftime`] module /// on the supported escape sequences. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -357,8 +355,7 @@ where } /// Formats the date with the specified formatting items and locale. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -382,8 +379,7 @@ where /// Formats the date with the specified format string and locale. /// See the [`crate::format::strftime`] module /// on the supported escape sequences. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized<'a>( @@ -483,7 +479,7 @@ impl Eq for Date {} impl PartialOrd for Date { fn partial_cmp(&self, other: &Date) -> Option { - self.date.partial_cmp(&other.date) + Some(self.cmp(other)) } } diff --git a/vendor/chrono/src/datetime/mod.rs b/vendor/chrono/src/datetime/mod.rs index 0df12bc36..e12b2db76 100644 --- a/vendor/chrono/src/datetime/mod.rs +++ b/vendor/chrono/src/datetime/mod.rs @@ -15,14 +15,14 @@ use core::{fmt, hash, str}; use std::time::{SystemTime, UNIX_EPOCH}; use crate::duration::Duration as OldDuration; -#[cfg(feature = "unstable-locales")] +#[cfg(all(feature = "unstable-locales", feature = "alloc"))] use crate::format::Locale; use crate::format::{ parse, parse_and_remainder, parse_rfc3339, Fixed, Item, ParseError, ParseResult, Parsed, StrftimeItems, TOO_LONG, }; -#[cfg(any(feature = "alloc", feature = "std"))] -use crate::format::{write_rfc3339, DelayedFormat}; +#[cfg(feature = "alloc")] +use crate::format::{write_rfc2822, write_rfc3339, DelayedFormat, SecondsFormat}; use crate::naive::{Days, IsoWeek, NaiveDate, NaiveDateTime, NaiveTime}; #[cfg(feature = "clock")] use crate::offset::Local; @@ -31,7 +31,7 @@ use crate::offset::{FixedOffset, Offset, TimeZone, Utc}; use crate::Date; use crate::{Datelike, Months, Timelike, Weekday}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; #[cfg(feature = "rustc-serialize")] @@ -44,45 +44,18 @@ pub(super) mod serde; #[cfg(test)] mod tests; -/// Specific formatting options for seconds. This may be extended in the -/// future, so exhaustive matching in external code is not recommended. -/// -/// See the `TimeZone::to_rfc3339_opts` function for usage. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] -#[allow(clippy::manual_non_exhaustive)] -pub enum SecondsFormat { - /// Format whole seconds only, with no decimal point nor subseconds. - Secs, - - /// Use fixed 3 subsecond digits. This corresponds to - /// [Fixed::Nanosecond3](format/enum.Fixed.html#variant.Nanosecond3). - Millis, - - /// Use fixed 6 subsecond digits. This corresponds to - /// [Fixed::Nanosecond6](format/enum.Fixed.html#variant.Nanosecond6). - Micros, - - /// Use fixed 9 subsecond digits. This corresponds to - /// [Fixed::Nanosecond9](format/enum.Fixed.html#variant.Nanosecond9). - Nanos, - - /// Automatically select one of `Secs`, `Millis`, `Micros`, or `Nanos` to - /// display all available non-zero sub-second digits. This corresponds to - /// [Fixed::Nanosecond](format/enum.Fixed.html#variant.Nanosecond). - AutoSi, - - // Do not match against this. - #[doc(hidden)] - __NonExhaustive, -} - /// ISO 8601 combined date and time with time zone. /// /// There are some constructors implemented here (the `from_*` methods), but /// the general-purpose constructors are all via the methods on the /// [`TimeZone`](./offset/trait.TimeZone.html) implementations. #[derive(Clone)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct DateTime { datetime: NaiveDateTime, offset: Tz::Offset, @@ -272,8 +245,8 @@ impl DateTime { /// An `i64` with nanosecond precision can span a range of ~584 years. This function panics on /// an out of range `DateTime`. /// - /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:44.0 and - /// 2262-04-11T23:47:16.854775804. + /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:43.145224192 + /// and 2262-04-11T23:47:16.854775807. #[deprecated(since = "0.4.31", note = "use `timestamp_nanos_opt()` instead")] #[inline] #[must_use] @@ -284,13 +257,13 @@ impl DateTime { /// Returns the number of non-leap-nanoseconds since January 1, 1970 UTC. /// - /// # Panics + /// # Errors /// - /// An `i64` with nanosecond precision can span a range of ~584 years. This function panics on - /// an out of range `DateTime`. + /// An `i64` with nanosecond precision can span a range of ~584 years. This function returns + /// `None` on an out of range `DateTime`. /// - /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:44.0 and - /// 2262-04-11T23:47:16.854775804. + /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:43.145224192 + /// and 2262-04-11T23:47:16.854775807. /// /// # Example /// @@ -302,6 +275,18 @@ impl DateTime { /// /// let dt = NaiveDate::from_ymd_opt(2001, 9, 9).unwrap().and_hms_nano_opt(1, 46, 40, 555).unwrap().and_local_timezone(Utc).unwrap(); /// assert_eq!(dt.timestamp_nanos_opt(), Some(1_000_000_000_000_000_555)); + /// + /// let dt = NaiveDate::from_ymd_opt(1677, 9, 21).unwrap().and_hms_nano_opt(0, 12, 43, 145_224_192).unwrap().and_local_timezone(Utc).unwrap(); + /// assert_eq!(dt.timestamp_nanos_opt(), Some(-9_223_372_036_854_775_808)); + /// + /// let dt = NaiveDate::from_ymd_opt(2262, 4, 11).unwrap().and_hms_nano_opt(23, 47, 16, 854_775_807).unwrap().and_local_timezone(Utc).unwrap(); + /// assert_eq!(dt.timestamp_nanos_opt(), Some(9_223_372_036_854_775_807)); + /// + /// let dt = NaiveDate::from_ymd_opt(1677, 9, 21).unwrap().and_hms_nano_opt(0, 12, 43, 145_224_191).unwrap().and_local_timezone(Utc).unwrap(); + /// assert_eq!(dt.timestamp_nanos_opt(), None); + /// + /// let dt = NaiveDate::from_ymd_opt(2262, 4, 11).unwrap().and_hms_nano_opt(23, 47, 16, 854_775_808).unwrap().and_local_timezone(Utc).unwrap(); + /// assert_eq!(dt.timestamp_nanos_opt(), None); /// ``` #[inline] #[must_use] @@ -367,6 +352,14 @@ impl DateTime { self.with_timezone(&self.offset().fix()) } + /// Turn this `DateTime` into a `DateTime`, dropping the offset and associated timezone + /// information. + #[inline] + #[must_use] + pub fn to_utc(&self) -> DateTime { + DateTime { datetime: self.datetime, offset: Utc } + } + /// Adds given `Duration` to the current date and time. /// /// # Errors @@ -493,7 +486,20 @@ impl DateTime { #[inline] #[must_use] pub fn naive_local(&self) -> NaiveDateTime { - self.datetime + self.offset.fix() + self.datetime + .checked_add_offset(self.offset.fix()) + .expect("Local time out of range for `NaiveDateTime`") + } + + /// Returns the naive local datetime. + /// + /// This makes use of the buffer space outside of the representable range of values of + /// `NaiveDateTime`. The result can be used as intermediate value, but should never be exposed + /// outside chrono. + #[inline] + #[must_use] + pub(crate) fn overflowing_naive_local(&self) -> NaiveDateTime { + self.datetime.overflowing_add_offset(self.offset.fix()) } /// Retrieve the elapsed years from now to the given [`DateTime`]. @@ -524,24 +530,22 @@ impl DateTime { /// /// Panics if the date can not be represented in this format: the year may not be negative and /// can not have more than 4 digits. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[must_use] pub fn to_rfc2822(&self) -> String { let mut result = String::with_capacity(32); - crate::format::write_rfc2822(&mut result, self.naive_local(), self.offset.fix()) + write_rfc2822(&mut result, self.overflowing_naive_local(), self.offset.fix()) .expect("writing rfc2822 datetime to string should never fail"); result } /// Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[must_use] pub fn to_rfc3339(&self) -> String { // For some reason a string with a capacity less than 32 is ca 20% slower when benchmarking. let mut result = String::with_capacity(32); - let naive = self.naive_local(); + let naive = self.overflowing_naive_local(); let offset = self.offset.fix(); write_rfc3339(&mut result, naive, offset, SecondsFormat::AutoSi, false) .expect("writing rfc3339 datetime to string should never fail"); @@ -572,8 +576,7 @@ impl DateTime { /// assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true), /// "2018-01-26T10:30:09+08:00"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[must_use] pub fn to_rfc3339_opts(&self, secform: SecondsFormat, use_z: bool) -> String { let mut result = String::with_capacity(38); @@ -624,6 +627,42 @@ impl DateTime { NaiveDateTime::from_timestamp_opt(secs, nsecs).as_ref().map(NaiveDateTime::and_utc) } + /// Makes a new [`DateTime`] from the number of non-leap milliseconds + /// since January 1, 1970 0:00:00.000 UTC (aka "UNIX timestamp"). + /// + /// This is guaranteed to round-trip with regard to [`timestamp_millis`](DateTime::timestamp_millis). + /// + /// If you need to create a `DateTime` with a [`TimeZone`] different from [`Utc`], use + /// [`TimeZone::timestamp_millis_opt`] or [`DateTime::with_timezone`]. + /// + /// # Errors + /// + /// Returns `None` on out-of-range number of milliseconds, otherwise returns `Some(DateTime {...})`. + /// + /// # Example + /// + /// ``` + /// use chrono::{DateTime, Utc}; + /// + /// let dt: DateTime = DateTime::::from_timestamp_millis(947638923004).expect("invalid timestamp"); + /// + /// assert_eq!(dt.to_string(), "2000-01-12 01:02:03.004 UTC"); + /// assert_eq!(DateTime::from_timestamp_millis(dt.timestamp_millis()).unwrap(), dt); + /// ``` + #[inline] + #[must_use] + pub fn from_timestamp_millis(millis: i64) -> Option { + NaiveDateTime::from_timestamp_millis(millis).as_ref().map(NaiveDateTime::and_utc) + } + + // FIXME: remove when our MSRV is 1.61+ + // This method is used by `NaiveDateTime::and_utc` because `DateTime::from_naive_utc_and_offset` + // can't be made const yet. + // Trait bounds in const function / implementation blocks were not supported until 1.61. + pub(crate) const fn from_naive_utc(datetime: NaiveDateTime) -> Self { + DateTime { datetime, offset: Utc } + } + /// The Unix Epoch, 1970-01-01 00:00:00 UTC. pub const UNIX_EPOCH: Self = Self { datetime: NaiveDateTime::UNIX_EPOCH, offset: Utc }; } @@ -635,7 +674,6 @@ impl Default for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl Default for DateTime { fn default() -> Self { Local.from_utc_datetime(&NaiveDateTime::default()) @@ -661,7 +699,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -684,7 +721,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -697,7 +733,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -710,7 +745,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -725,7 +759,9 @@ fn map_local(dt: &DateTime, mut f: F) -> Option Option, { - f(dt.naive_local()).and_then(|datetime| dt.timezone().from_local_datetime(&datetime).single()) + f(dt.overflowing_naive_local()) + .and_then(|datetime| dt.timezone().from_local_datetime(&datetime).single()) + .filter(|dt| dt >= &DateTime::::MIN_UTC && dt <= &DateTime::::MAX_UTC) } impl DateTime { @@ -855,8 +891,7 @@ where Tz::Offset: fmt::Display, { /// Formats the combined date and time with the specified formatting items. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -864,7 +899,7 @@ where I: Iterator + Clone, B: Borrow>, { - let local = self.naive_local(); + let local = self.overflowing_naive_local(); DelayedFormat::new_with_offset(Some(local.date()), Some(local.time()), &self.offset, items) } @@ -880,8 +915,7 @@ where /// let formatted = format!("{}", date_time.format("%d/%m/%Y %H:%M")); /// assert_eq!(formatted, "02/04/2017 12:50"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -889,8 +923,7 @@ where } /// Formats the combined date and time with the specified formatting items and locale. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -902,7 +935,7 @@ where I: Iterator + Clone, B: Borrow>, { - let local = self.naive_local(); + let local = self.overflowing_naive_local(); DelayedFormat::new_with_offset_and_locale( Some(local.date()), Some(local.time()), @@ -917,8 +950,7 @@ where /// /// See the [`crate::format::strftime`] module on the supported escape /// sequences. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized<'a>( @@ -933,39 +965,39 @@ where impl Datelike for DateTime { #[inline] fn year(&self) -> i32 { - self.naive_local().year() + self.overflowing_naive_local().year() } #[inline] fn month(&self) -> u32 { - self.naive_local().month() + self.overflowing_naive_local().month() } #[inline] fn month0(&self) -> u32 { - self.naive_local().month0() + self.overflowing_naive_local().month0() } #[inline] fn day(&self) -> u32 { - self.naive_local().day() + self.overflowing_naive_local().day() } #[inline] fn day0(&self) -> u32 { - self.naive_local().day0() + self.overflowing_naive_local().day0() } #[inline] fn ordinal(&self) -> u32 { - self.naive_local().ordinal() + self.overflowing_naive_local().ordinal() } #[inline] fn ordinal0(&self) -> u32 { - self.naive_local().ordinal0() + self.overflowing_naive_local().ordinal0() } #[inline] fn weekday(&self) -> Weekday { - self.naive_local().weekday() + self.overflowing_naive_local().weekday() } #[inline] fn iso_week(&self) -> IsoWeek { - self.naive_local().iso_week() + self.overflowing_naive_local().iso_week() } #[inline] @@ -1016,7 +1048,7 @@ impl Datelike for DateTime { map_local(self, |datetime| datetime.with_month0(month0)) } - /// Makes a new `DateTime` with the month number (starting from 0) changed. + /// Makes a new `DateTime` with the day of month (starting from 1) changed. /// /// See also the [`NaiveDate::with_day`] method. /// @@ -1032,7 +1064,7 @@ impl Datelike for DateTime { map_local(self, |datetime| datetime.with_day(day)) } - /// Makes a new `DateTime` with the month number (starting from 0) changed. + /// Makes a new `DateTime` with the day of month (starting from 0) changed. /// /// See also the [`NaiveDate::with_day0`] method. /// @@ -1048,7 +1080,7 @@ impl Datelike for DateTime { map_local(self, |datetime| datetime.with_day0(day0)) } - /// Makes a new `DateTime` with the month number (starting from 0) changed. + /// Makes a new `DateTime` with the day of year (starting from 1) changed. /// /// See also the [`NaiveDate::with_ordinal`] method. /// @@ -1064,7 +1096,7 @@ impl Datelike for DateTime { map_local(self, |datetime| datetime.with_ordinal(ordinal)) } - /// Makes a new `DateTime` with the month number (starting from 0) changed. + /// Makes a new `DateTime` with the day of year (starting from 0) changed. /// /// See also the [`NaiveDate::with_ordinal0`] method. /// @@ -1084,19 +1116,19 @@ impl Datelike for DateTime { impl Timelike for DateTime { #[inline] fn hour(&self) -> u32 { - self.naive_local().hour() + self.overflowing_naive_local().hour() } #[inline] fn minute(&self) -> u32 { - self.naive_local().minute() + self.overflowing_naive_local().minute() } #[inline] fn second(&self) -> u32 { - self.naive_local().second() + self.overflowing_naive_local().second() } #[inline] fn nanosecond(&self) -> u32 { - self.naive_local().nanosecond() + self.overflowing_naive_local().nanosecond() } /// Makes a new `DateTime` with the hour number changed. @@ -1208,6 +1240,16 @@ impl hash::Hash for DateTime { } } +/// Add `chrono::Duration` to `DateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_add_signed`] to get an `Option` instead. impl Add for DateTime { type Output = DateTime; @@ -1217,6 +1259,16 @@ impl Add for DateTime { } } +/// Add `std::time::Duration` to `DateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_add_signed`] to get an `Option` instead. impl Add for DateTime { type Output = DateTime; @@ -1228,6 +1280,16 @@ impl Add for DateTime { } } +/// Add-assign `chrono::Duration` to `DateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_add_signed`] to get an `Option` instead. impl AddAssign for DateTime { #[inline] fn add_assign(&mut self, rhs: OldDuration) { @@ -1238,6 +1300,16 @@ impl AddAssign for DateTime { } } +/// Add-assign `std::time::Duration` to `DateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_add_signed`] to get an `Option` instead. impl AddAssign for DateTime { #[inline] fn add_assign(&mut self, rhs: Duration) { @@ -1247,14 +1319,55 @@ impl AddAssign for DateTime { } } +/// Add `FixedOffset` to the datetime value of `DateTime` (offset remains unchanged). +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +impl Add for DateTime { + type Output = DateTime; + + #[inline] + fn add(mut self, rhs: FixedOffset) -> DateTime { + self.datetime = + self.naive_utc().checked_add_offset(rhs).expect("`DateTime + FixedOffset` overflowed"); + self + } +} + +/// Add `Months` to `DateTime`. +/// +/// The result will be clamped to valid days in the resulting month, see `checked_add_months` for +/// details. +/// +/// # Panics +/// +/// Panics if: +/// - The resulting date would be out of range. +/// - The local time at the resulting date does not exist or is ambiguous, for example during a +/// daylight saving time transition. +/// +/// Strongly consider using [`DateTime::checked_add_months`] to get an `Option` instead. impl Add for DateTime { type Output = DateTime; fn add(self, rhs: Months) -> Self::Output { - self.checked_add_months(rhs).unwrap() + self.checked_add_months(rhs).expect("`DateTime + Months` out of range") } } +/// Subtract `chrono::Duration` from `DateTime`. +/// +/// This is the same as the addition with a negated `Duration`. +/// +/// As a part of Chrono's [leap second handling] the subtraction assumes that **there is no leap +/// second ever**, except when the `DateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_sub_signed`] to get an `Option` instead. impl Sub for DateTime { type Output = DateTime; @@ -1264,6 +1377,16 @@ impl Sub for DateTime { } } +/// Subtract `std::time::Duration` from `DateTime`. +/// +/// As a part of Chrono's [leap second handling] the subtraction assumes that **there is no leap +/// second ever**, except when the `DateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_sub_signed`] to get an `Option` instead. impl Sub for DateTime { type Output = DateTime; @@ -1275,6 +1398,18 @@ impl Sub for DateTime { } } +/// Subtract-assign `chrono::Duration` from `DateTime`. +/// +/// This is the same as the addition with a negated `Duration`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `DateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_sub_signed`] to get an `Option` instead. impl SubAssign for DateTime { #[inline] fn sub_assign(&mut self, rhs: OldDuration) { @@ -1285,6 +1420,16 @@ impl SubAssign for DateTime { } } +/// Subtract-assign `std::time::Duration` from `DateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `DateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`DateTime::checked_sub_signed`] to get an `Option` instead. impl SubAssign for DateTime { #[inline] fn sub_assign(&mut self, rhs: Duration) { @@ -1294,11 +1439,40 @@ impl SubAssign for DateTime { } } +/// Subtract `FixedOffset` from the datetime value of `DateTime` (offset remains unchanged). +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +impl Sub for DateTime { + type Output = DateTime; + + #[inline] + fn sub(mut self, rhs: FixedOffset) -> DateTime { + self.datetime = + self.naive_utc().checked_sub_offset(rhs).expect("`DateTime - FixedOffset` overflowed"); + self + } +} + +/// Subtract `Months` from `DateTime`. +/// +/// The result will be clamped to valid days in the resulting month, see +/// [`DateTime::checked_sub_months`] for details. +/// +/// # Panics +/// +/// Panics if: +/// - The resulting date would be out of range. +/// - The local time at the resulting date does not exist or is ambiguous, for example during a +/// daylight saving time transition. +/// +/// Strongly consider using [`DateTime::checked_sub_months`] to get an `Option` instead. impl Sub for DateTime { type Output = DateTime; fn sub(self, rhs: Months) -> Self::Output { - self.checked_sub_months(rhs).unwrap() + self.checked_sub_months(rhs).expect("`DateTime - Months` out of range") } } @@ -1320,35 +1494,80 @@ impl Sub<&DateTime> for DateTime { } } +/// Add `Days` to `NaiveDateTime`. +/// +/// # Panics +/// +/// Panics if: +/// - The resulting date would be out of range. +/// - The local time at the resulting date does not exist or is ambiguous, for example during a +/// daylight saving time transition. +/// +/// Strongly consider using `DateTime::checked_sub_days` to get an `Option` instead. impl Add for DateTime { type Output = DateTime; fn add(self, days: Days) -> Self::Output { - self.checked_add_days(days).unwrap() + self.checked_add_days(days).expect("`DateTime + Days` out of range") } } +/// Subtract `Days` from `DateTime`. +/// +/// # Panics +/// +/// Panics if: +/// - The resulting date would be out of range. +/// - The local time at the resulting date does not exist or is ambiguous, for example during a +/// daylight saving time transition. +/// +/// Strongly consider using `DateTime::checked_sub_days` to get an `Option` instead. impl Sub for DateTime { type Output = DateTime; fn sub(self, days: Days) -> Self::Output { - self.checked_sub_days(days).unwrap() + self.checked_sub_days(days).expect("`DateTime - Days` out of range") } } impl fmt::Debug for DateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.naive_local().fmt(f)?; + self.overflowing_naive_local().fmt(f)?; self.offset.fmt(f) } } +// `fmt::Debug` is hand implemented for the `rkyv::Archive` variant of `DateTime` because +// deriving a trait recursively does not propagate trait defined associated types with their own +// constraints: +// In our case `<::Offset as Archive>::Archived` +// cannot be formatted using `{:?}` because it doesn't implement `Debug`. +// See below for further discussion: +// * https://github.com/rust-lang/rust/issues/26925 +// * https://github.com/rkyv/rkyv/issues/333 +// * https://github.com/dtolnay/syn/issues/370 +#[cfg(feature = "rkyv-validation")] +impl fmt::Debug for ArchivedDateTime +where + Tz: Archive, + ::Archived: fmt::Debug, + <::Offset as Archive>::Archived: fmt::Debug, + ::Offset: fmt::Debug + Archive, +{ + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("ArchivedDateTime") + .field("datetime", &self.datetime) + .field("offset", &self.offset) + .finish() + } +} + impl fmt::Display for DateTime where Tz::Offset: fmt::Display, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.naive_local().fmt(f)?; + self.overflowing_naive_local().fmt(f)?; f.write_char(' ')?; self.offset.fmt(f) } @@ -1389,7 +1608,6 @@ impl str::FromStr for DateTime { /// # Ok::<(), chrono::ParseError>(()) /// ``` #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl str::FromStr for DateTime { type Err = ParseError; @@ -1399,7 +1617,6 @@ impl str::FromStr for DateTime { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl From for DateTime { fn from(t: SystemTime) -> DateTime { let (sec, nsec) = match t.duration_since(UNIX_EPOCH) { @@ -1420,7 +1637,6 @@ impl From for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From for DateTime { fn from(t: SystemTime) -> DateTime { DateTime::::from(t).with_timezone(&Local) @@ -1428,7 +1644,6 @@ impl From for DateTime { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl From> for SystemTime { fn from(dt: DateTime) -> SystemTime { let sec = dt.timestamp(); @@ -1447,14 +1662,6 @@ impl From> for SystemTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From for DateTime { fn from(date: js_sys::Date) -> DateTime { DateTime::::from(&date) @@ -1466,14 +1673,6 @@ impl From for DateTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From<&js_sys::Date> for DateTime { fn from(date: &js_sys::Date) -> DateTime { Utc.timestamp_millis_opt(date.get_time() as i64).unwrap() @@ -1485,14 +1684,6 @@ impl From<&js_sys::Date> for DateTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From> for js_sys::Date { /// Converts a `DateTime` to a JS `Date`. The resulting value may be lossy, /// any values that have a millisecond timestamp value greater/less than ±8,640,000,000,000,000 diff --git a/vendor/chrono/src/datetime/rustc_serialize.rs b/vendor/chrono/src/datetime/rustc_serialize.rs index 115ec9eb3..f704b2f97 100644 --- a/vendor/chrono/src/datetime/rustc_serialize.rs +++ b/vendor/chrono/src/datetime/rustc_serialize.rs @@ -1,6 +1,5 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - -use super::{DateTime, SecondsFormat}; +use super::DateTime; +use crate::format::SecondsFormat; #[cfg(feature = "clock")] use crate::offset::Local; use crate::offset::{FixedOffset, LocalResult, TimeZone, Utc}; @@ -82,7 +81,6 @@ impl Decodable for TsSeconds { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl Decodable for DateTime { fn decode(d: &mut D) -> Result, D::Error> { match d.read_str()?.parse::>() { @@ -93,7 +91,6 @@ impl Decodable for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] #[allow(deprecated)] impl Decodable for TsSeconds { #[allow(deprecated)] diff --git a/vendor/chrono/src/datetime/serde.rs b/vendor/chrono/src/datetime/serde.rs index 4044eb586..dcdb36dd0 100644 --- a/vendor/chrono/src/datetime/serde.rs +++ b/vendor/chrono/src/datetime/serde.rs @@ -1,10 +1,8 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use core::fmt; use serde::{de, ser}; -use super::{DateTime, SecondsFormat}; -use crate::format::write_rfc3339; +use super::DateTime; +use crate::format::{write_rfc3339, SecondsFormat}; use crate::naive::datetime::serde::serde_from; #[cfg(feature = "clock")] use crate::offset::Local; @@ -107,7 +105,6 @@ impl<'de> de::Deserialize<'de> for DateTime { /// See [the `serde` module](./serde/index.html) for alternate /// serialization formats. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl<'de> de::Deserialize<'de> for DateTime { fn deserialize(deserializer: D) -> Result where diff --git a/vendor/chrono/src/datetime/tests.rs b/vendor/chrono/src/datetime/tests.rs index 63dfe59b4..3e96e227f 100644 --- a/vendor/chrono/src/datetime/tests.rs +++ b/vendor/chrono/src/datetime/tests.rs @@ -4,7 +4,7 @@ use crate::naive::{NaiveDate, NaiveTime}; use crate::offset::{FixedOffset, TimeZone, Utc}; #[cfg(feature = "clock")] use crate::offset::{Local, Offset}; -use crate::{Datelike, Days, LocalResult, Months, NaiveDateTime, Timelike}; +use crate::{Datelike, Days, LocalResult, Months, NaiveDateTime, Timelike, Weekday}; #[derive(Clone)] struct DstTester; @@ -273,7 +273,7 @@ fn ymdhms_milli( // local helper function to easily create a DateTime #[allow(clippy::too_many_arguments)] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn ymdhms_micro( fixedoffset: &FixedOffset, year: i32, @@ -293,7 +293,7 @@ fn ymdhms_micro( // local helper function to easily create a DateTime #[allow(clippy::too_many_arguments)] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn ymdhms_nano( fixedoffset: &FixedOffset, year: i32, @@ -312,7 +312,7 @@ fn ymdhms_nano( } // local helper function to easily create a DateTime -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn ymdhms_utc(year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32) -> DateTime { Utc.with_ymd_and_hms(year, month, day, hour, min, sec).unwrap() } @@ -412,6 +412,7 @@ fn signed_duration_since_autoref() { let dt1 = Utc.with_ymd_and_hms(2014, 5, 6, 7, 8, 9).unwrap(); let dt2 = Utc.with_ymd_and_hms(2014, 3, 4, 5, 6, 7).unwrap(); let diff1 = dt1.signed_duration_since(dt2); // Copy/consume + #[allow(clippy::needless_borrows_for_generic_args)] let diff2 = dt2.signed_duration_since(&dt1); // Take by reference assert_eq!(diff1, -diff2); @@ -451,7 +452,7 @@ fn test_datetime_with_timezone() { } #[test] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn test_datetime_rfc2822() { let edt = FixedOffset::east_opt(5 * 60 * 60).unwrap(); @@ -577,7 +578,7 @@ fn test_datetime_rfc2822() { } #[test] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn test_datetime_rfc3339() { let edt5 = FixedOffset::east_opt(5 * 60 * 60).unwrap(); let edt0 = FixedOffset::east_opt(0).unwrap(); @@ -663,7 +664,7 @@ fn test_datetime_rfc3339() { } #[test] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn test_rfc3339_opts() { use crate::SecondsFormat::*; let pst = FixedOffset::east_opt(8 * 60 * 60).unwrap(); @@ -694,7 +695,7 @@ fn test_rfc3339_opts() { #[test] #[should_panic] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn test_rfc3339_opts_nonexhaustive() { use crate::SecondsFormat; let dt = Utc.with_ymd_and_hms(1999, 10, 9, 1, 2, 3).unwrap(); @@ -1252,6 +1253,18 @@ fn test_datetime_from_local() { assert_eq!(datetime_west, datetime_utc.with_timezone(&timezone_west)); } +#[test] +fn test_datetime_from_timestamp_millis() { + // 2000-01-12T01:02:03:004Z + let naive_dt = + NaiveDate::from_ymd_opt(2000, 1, 12).unwrap().and_hms_milli_opt(1, 2, 3, 4).unwrap(); + let datetime_utc = DateTime::::from_naive_utc_and_offset(naive_dt, Utc); + assert_eq!( + datetime_utc, + DateTime::::from_timestamp_millis(datetime_utc.timestamp_millis()).unwrap() + ); +} + #[test] #[cfg(feature = "clock")] fn test_years_elapsed() { @@ -1331,6 +1344,126 @@ fn test_datetime_sub_assign() { assert_eq!(datetime_sub, datetime - OldDuration::minutes(90)); } +#[test] +fn test_min_max_getters() { + let offset_min = FixedOffset::west_opt(2 * 60 * 60).unwrap(); + let beyond_min = offset_min.from_utc_datetime(&NaiveDateTime::MIN); + let offset_max = FixedOffset::east_opt(2 * 60 * 60).unwrap(); + let beyond_max = offset_max.from_utc_datetime(&NaiveDateTime::MAX); + + assert_eq!(format!("{:?}", beyond_min), "-262144-12-31T22:00:00-02:00"); + // RFC 2822 doesn't support years with more than 4 digits. + // assert_eq!(beyond_min.to_rfc2822(), ""); + #[cfg(feature = "alloc")] + assert_eq!(beyond_min.to_rfc3339(), "-262144-12-31T22:00:00-02:00"); + #[cfg(feature = "alloc")] + assert_eq!( + beyond_min.format("%Y-%m-%dT%H:%M:%S%:z").to_string(), + "-262144-12-31T22:00:00-02:00" + ); + assert_eq!(beyond_min.year(), -262144); + assert_eq!(beyond_min.month(), 12); + assert_eq!(beyond_min.month0(), 11); + assert_eq!(beyond_min.day(), 31); + assert_eq!(beyond_min.day0(), 30); + assert_eq!(beyond_min.ordinal(), 366); + assert_eq!(beyond_min.ordinal0(), 365); + assert_eq!(beyond_min.weekday(), Weekday::Wed); + assert_eq!(beyond_min.iso_week().year(), -262143); + assert_eq!(beyond_min.iso_week().week(), 1); + assert_eq!(beyond_min.hour(), 22); + assert_eq!(beyond_min.minute(), 0); + assert_eq!(beyond_min.second(), 0); + assert_eq!(beyond_min.nanosecond(), 0); + + assert_eq!(format!("{:?}", beyond_max), "+262143-01-01T01:59:59.999999999+02:00"); + // RFC 2822 doesn't support years with more than 4 digits. + // assert_eq!(beyond_max.to_rfc2822(), ""); + #[cfg(feature = "alloc")] + assert_eq!(beyond_max.to_rfc3339(), "+262143-01-01T01:59:59.999999999+02:00"); + #[cfg(feature = "alloc")] + assert_eq!( + beyond_max.format("%Y-%m-%dT%H:%M:%S%.9f%:z").to_string(), + "+262143-01-01T01:59:59.999999999+02:00" + ); + assert_eq!(beyond_max.year(), 262143); + assert_eq!(beyond_max.month(), 1); + assert_eq!(beyond_max.month0(), 0); + assert_eq!(beyond_max.day(), 1); + assert_eq!(beyond_max.day0(), 0); + assert_eq!(beyond_max.ordinal(), 1); + assert_eq!(beyond_max.ordinal0(), 0); + assert_eq!(beyond_max.weekday(), Weekday::Tue); + assert_eq!(beyond_max.iso_week().year(), 262143); + assert_eq!(beyond_max.iso_week().week(), 1); + assert_eq!(beyond_max.hour(), 1); + assert_eq!(beyond_max.minute(), 59); + assert_eq!(beyond_max.second(), 59); + assert_eq!(beyond_max.nanosecond(), 999_999_999); +} + +#[test] +fn test_min_max_setters() { + let offset_min = FixedOffset::west_opt(2 * 60 * 60).unwrap(); + let beyond_min = offset_min.from_utc_datetime(&NaiveDateTime::MIN); + let offset_max = FixedOffset::east_opt(2 * 60 * 60).unwrap(); + let beyond_max = offset_max.from_utc_datetime(&NaiveDateTime::MAX); + + assert_eq!(beyond_min.with_year(2020).unwrap().year(), 2020); + assert_eq!(beyond_min.with_month(beyond_min.month()), Some(beyond_min)); + assert_eq!(beyond_min.with_month(3), None); + assert_eq!(beyond_min.with_month0(beyond_min.month0()), Some(beyond_min)); + assert_eq!(beyond_min.with_month0(3), None); + assert_eq!(beyond_min.with_day(beyond_min.day()), Some(beyond_min)); + assert_eq!(beyond_min.with_day(15), None); + assert_eq!(beyond_min.with_day0(beyond_min.day0()), Some(beyond_min)); + assert_eq!(beyond_min.with_day0(15), None); + assert_eq!(beyond_min.with_ordinal(beyond_min.ordinal()), Some(beyond_min)); + assert_eq!(beyond_min.with_ordinal(200), None); + assert_eq!(beyond_min.with_ordinal0(beyond_min.ordinal0()), Some(beyond_min)); + assert_eq!(beyond_min.with_ordinal0(200), None); + assert_eq!(beyond_min.with_hour(beyond_min.hour()), Some(beyond_min)); + assert_eq!(beyond_min.with_hour(23), beyond_min.checked_add_signed(OldDuration::hours(1))); + assert_eq!(beyond_min.with_hour(5), None); + assert_eq!(beyond_min.with_minute(0), Some(beyond_min)); + assert_eq!(beyond_min.with_second(0), Some(beyond_min)); + assert_eq!(beyond_min.with_nanosecond(0), Some(beyond_min)); + + assert_eq!(beyond_max.with_year(2020).unwrap().year(), 2020); + assert_eq!(beyond_max.with_month(beyond_max.month()), Some(beyond_max)); + assert_eq!(beyond_max.with_month(3), None); + assert_eq!(beyond_max.with_month0(beyond_max.month0()), Some(beyond_max)); + assert_eq!(beyond_max.with_month0(3), None); + assert_eq!(beyond_max.with_day(beyond_max.day()), Some(beyond_max)); + assert_eq!(beyond_max.with_day(15), None); + assert_eq!(beyond_max.with_day0(beyond_max.day0()), Some(beyond_max)); + assert_eq!(beyond_max.with_day0(15), None); + assert_eq!(beyond_max.with_ordinal(beyond_max.ordinal()), Some(beyond_max)); + assert_eq!(beyond_max.with_ordinal(200), None); + assert_eq!(beyond_max.with_ordinal0(beyond_max.ordinal0()), Some(beyond_max)); + assert_eq!(beyond_max.with_ordinal0(200), None); + assert_eq!(beyond_max.with_hour(beyond_max.hour()), Some(beyond_max)); + assert_eq!(beyond_max.with_hour(0), beyond_max.checked_sub_signed(OldDuration::hours(1))); + assert_eq!(beyond_max.with_hour(5), None); + assert_eq!(beyond_max.with_minute(beyond_max.minute()), Some(beyond_max)); + assert_eq!(beyond_max.with_second(beyond_max.second()), Some(beyond_max)); + assert_eq!(beyond_max.with_nanosecond(beyond_max.nanosecond()), Some(beyond_max)); +} + +#[test] +#[should_panic] +fn test_local_beyond_min_datetime() { + let min = FixedOffset::west_opt(2 * 60 * 60).unwrap().from_utc_datetime(&NaiveDateTime::MIN); + let _ = min.naive_local(); +} + +#[test] +#[should_panic] +fn test_local_beyond_max_datetime() { + let max = FixedOffset::east_opt(2 * 60 * 60).unwrap().from_utc_datetime(&NaiveDateTime::MAX); + let _ = max.naive_local(); +} + #[test] #[cfg(feature = "clock")] fn test_datetime_sub_assign_local() { @@ -1428,6 +1561,14 @@ fn test_datetime_fixed_offset() { assert_eq!(datetime_fixed.fixed_offset(), datetime_fixed); } +#[test] +fn test_datetime_to_utc() { + let dt = + FixedOffset::east_opt(3600).unwrap().with_ymd_and_hms(2020, 2, 22, 23, 24, 25).unwrap(); + let dt_utc: DateTime = dt.to_utc(); + assert_eq!(dt, dt_utc); +} + #[test] fn test_add_sub_months() { let utc_dt = Utc.with_ymd_and_hms(2018, 9, 5, 23, 58, 0).unwrap(); @@ -1470,7 +1611,7 @@ fn test_test_deprecated_from_offset() { } #[test] -#[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] +#[cfg(all(feature = "unstable-locales", feature = "alloc"))] fn locale_decimal_point() { use crate::Locale::{ar_SY, nl_NL}; let dt = diff --git a/vendor/chrono/src/duration.rs b/vendor/chrono/src/duration.rs index 296c07109..e4498b9f7 100644 --- a/vendor/chrono/src/duration.rs +++ b/vendor/chrono/src/duration.rs @@ -10,13 +10,13 @@ //! Temporal quantification -use core::ops::{Add, Div, Mul, Neg, Sub}; +use core::ops::{Add, AddAssign, Div, Mul, Neg, Sub, SubAssign}; use core::time::Duration as StdDuration; use core::{fmt, i64}; #[cfg(feature = "std")] use std::error::Error; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; /// The number of nanoseconds in a microsecond. @@ -24,7 +24,7 @@ const NANOS_PER_MICRO: i32 = 1000; /// The number of nanoseconds in a millisecond. const NANOS_PER_MILLI: i32 = 1_000_000; /// The number of nanoseconds in seconds. -const NANOS_PER_SEC: i32 = 1_000_000_000; +pub(crate) const NANOS_PER_SEC: i32 = 1_000_000_000; /// The number of microseconds per second. const MICROS_PER_SEC: i64 = 1_000_000; /// The number of milliseconds per second. @@ -50,17 +50,23 @@ macro_rules! try_opt { /// ISO 8601 time duration with nanosecond precision. /// /// This also allows for the negative duration; see individual methods for details. -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct Duration { secs: i64, nanos: i32, // Always 0 <= nanos < NANOS_PER_SEC } -/// The minimum possible `Duration`: `i64::MIN` milliseconds. +/// The minimum possible `Duration`: `-i64::MAX` milliseconds. pub(crate) const MIN: Duration = Duration { - secs: i64::MIN / MILLIS_PER_SEC - 1, - nanos: NANOS_PER_SEC + (i64::MIN % MILLIS_PER_SEC) as i32 * NANOS_PER_MILLI, + secs: -i64::MAX / MILLIS_PER_SEC - 1, + nanos: NANOS_PER_SEC + (-i64::MAX % MILLIS_PER_SEC) as i32 * NANOS_PER_MILLI, }; /// The maximum possible `Duration`: `i64::MAX` milliseconds. @@ -76,8 +82,15 @@ impl Duration { #[inline] #[must_use] pub fn weeks(weeks: i64) -> Duration { - let secs = weeks.checked_mul(SECS_PER_WEEK).expect("Duration::weeks out of bounds"); - Duration::seconds(secs) + Duration::try_weeks(weeks).expect("Duration::weeks out of bounds") + } + + /// Makes a new `Duration` with given number of weeks. + /// Equivalent to `Duration::seconds(weeks * 7 * 24 * 60 * 60)` with overflow checks. + /// Returns `None` when the duration is out of bounds. + #[inline] + pub fn try_weeks(weeks: i64) -> Option { + weeks.checked_mul(SECS_PER_WEEK).and_then(Duration::try_seconds) } /// Makes a new `Duration` with given number of days. @@ -86,8 +99,15 @@ impl Duration { #[inline] #[must_use] pub fn days(days: i64) -> Duration { - let secs = days.checked_mul(SECS_PER_DAY).expect("Duration::days out of bounds"); - Duration::seconds(secs) + Duration::try_days(days).expect("Duration::days out of bounds") + } + + /// Makes a new `Duration` with given number of days. + /// Equivalent to `Duration::seconds(days * 24 * 60 * 60)` with overflow checks. + /// Returns `None` when the duration is out of bounds. + #[inline] + pub fn try_days(days: i64) -> Option { + days.checked_mul(SECS_PER_DAY).and_then(Duration::try_seconds) } /// Makes a new `Duration` with given number of hours. @@ -96,8 +116,15 @@ impl Duration { #[inline] #[must_use] pub fn hours(hours: i64) -> Duration { - let secs = hours.checked_mul(SECS_PER_HOUR).expect("Duration::hours ouf of bounds"); - Duration::seconds(secs) + Duration::try_hours(hours).expect("Duration::hours out of bounds") + } + + /// Makes a new `Duration` with given number of hours. + /// Equivalent to `Duration::seconds(hours * 60 * 60)` with overflow checks. + /// Returns `None` when the duration is out of bounds. + #[inline] + pub fn try_hours(hours: i64) -> Option { + hours.checked_mul(SECS_PER_HOUR).and_then(Duration::try_seconds) } /// Makes a new `Duration` with given number of minutes. @@ -106,21 +133,36 @@ impl Duration { #[inline] #[must_use] pub fn minutes(minutes: i64) -> Duration { - let secs = minutes.checked_mul(SECS_PER_MINUTE).expect("Duration::minutes out of bounds"); - Duration::seconds(secs) + Duration::try_minutes(minutes).expect("Duration::minutes out of bounds") + } + + /// Makes a new `Duration` with given number of minutes. + /// Equivalent to `Duration::seconds(minutes * 60)` with overflow checks. + /// Returns `None` when the duration is out of bounds. + #[inline] + pub fn try_minutes(minutes: i64) -> Option { + minutes.checked_mul(SECS_PER_MINUTE).and_then(Duration::try_seconds) } /// Makes a new `Duration` with given number of seconds. /// Panics when the duration is more than `i64::MAX` milliseconds - /// or less than `i64::MIN` milliseconds. + /// or less than `-i64::MAX` milliseconds. #[inline] #[must_use] pub fn seconds(seconds: i64) -> Duration { + Duration::try_seconds(seconds).expect("Duration::seconds out of bounds") + } + + /// Makes a new `Duration` with given number of seconds. + /// Returns `None` when the duration is more than `i64::MAX` milliseconds + /// or less than `-i64::MAX` milliseconds. + #[inline] + pub fn try_seconds(seconds: i64) -> Option { let d = Duration { secs: seconds, nanos: 0 }; if d < MIN || d > MAX { - panic!("Duration::seconds out of bounds"); + return None; } - d + Some(d) } /// Makes a new `Duration` with given number of milliseconds. @@ -180,9 +222,9 @@ impl Duration { } /// Returns the number of nanoseconds such that - /// `nanos_mod_sec() + num_seconds() * NANOS_PER_SEC` is the total number of + /// `subsec_nanos() + num_seconds() * NANOS_PER_SEC` is the total number of /// nanoseconds in the duration. - const fn nanos_mod_sec(&self) -> i32 { + pub const fn subsec_nanos(&self) -> i32 { if self.secs < 0 && self.nanos > 0 { self.nanos - NANOS_PER_SEC } else { @@ -195,7 +237,7 @@ impl Duration { // A proper Duration will not overflow, because MIN and MAX are defined // such that the range is exactly i64 milliseconds. let secs_part = self.num_seconds() * MILLIS_PER_SEC; - let nanos_part = self.nanos_mod_sec() / NANOS_PER_MILLI; + let nanos_part = self.subsec_nanos() / NANOS_PER_MILLI; secs_part + nanos_part as i64 } @@ -203,7 +245,7 @@ impl Duration { /// or `None` on overflow (exceeding 2^63 microseconds in either direction). pub const fn num_microseconds(&self) -> Option { let secs_part = try_opt!(self.num_seconds().checked_mul(MICROS_PER_SEC)); - let nanos_part = self.nanos_mod_sec() / NANOS_PER_MICRO; + let nanos_part = self.subsec_nanos() / NANOS_PER_MICRO; secs_part.checked_add(nanos_part as i64) } @@ -211,7 +253,7 @@ impl Duration { /// or `None` on overflow (exceeding 2^63 nanoseconds in either direction). pub const fn num_nanoseconds(&self) -> Option { let secs_part = try_opt!(self.num_seconds().checked_mul(NANOS_PER_SEC as i64)); - let nanos_part = self.nanos_mod_sec(); + let nanos_part = self.subsec_nanos(); secs_part.checked_add(nanos_part as i64) } @@ -263,7 +305,7 @@ impl Duration { } } - /// The minimum possible `Duration`: `i64::MIN` milliseconds. + /// The minimum possible `Duration`: `-i64::MAX` milliseconds. #[inline] pub const fn min_value() -> Duration { MIN @@ -332,13 +374,7 @@ impl Add for Duration { type Output = Duration; fn add(self, rhs: Duration) -> Duration { - let mut secs = self.secs + rhs.secs; - let mut nanos = self.nanos + rhs.nanos; - if nanos >= NANOS_PER_SEC { - nanos -= NANOS_PER_SEC; - secs += 1; - } - Duration { secs, nanos } + self.checked_add(&rhs).expect("`Duration + Duration` overflowed") } } @@ -346,13 +382,21 @@ impl Sub for Duration { type Output = Duration; fn sub(self, rhs: Duration) -> Duration { - let mut secs = self.secs - rhs.secs; - let mut nanos = self.nanos - rhs.nanos; - if nanos < 0 { - nanos += NANOS_PER_SEC; - secs -= 1; - } - Duration { secs, nanos } + self.checked_sub(&rhs).expect("`Duration - Duration` overflowed") + } +} + +impl AddAssign for Duration { + fn add_assign(&mut self, rhs: Duration) { + let new = self.checked_add(&rhs).expect("`Duration + Duration` overflowed"); + *self = new; + } +} + +impl SubAssign for Duration { + fn sub_assign(&mut self, rhs: Duration) { + let new = self.checked_sub(&rhs).expect("`Duration - Duration` overflowed"); + *self = new; } } @@ -465,7 +509,7 @@ const fn div_mod_floor_64(this: i64, other: i64) -> (i64, i64) { #[cfg(feature = "arbitrary")] impl arbitrary::Arbitrary<'_> for Duration { fn arbitrary(u: &mut arbitrary::Unstructured) -> arbitrary::Result { - const MIN_SECS: i64 = i64::MIN / MILLIS_PER_SEC - 1; + const MIN_SECS: i64 = -i64::MAX / MILLIS_PER_SEC - 1; const MAX_SECS: i64 = i64::MAX / MILLIS_PER_SEC; let secs: i64 = u.int_in_range(MIN_SECS..=MAX_SECS)?; @@ -505,6 +549,11 @@ mod tests { -(Duration::days(3) + Duration::seconds(70)), Duration::days(-4) + Duration::seconds(86_400 - 70) ); + + let mut d = Duration::default(); + d += Duration::minutes(1); + d -= Duration::seconds(30); + assert_eq!(d, Duration::seconds(30)); } #[test] @@ -541,9 +590,9 @@ mod tests { assert_eq!(Duration::microseconds(-999).num_milliseconds(), 0); assert_eq!(Duration::microseconds(-1001).num_milliseconds(), -1); assert_eq!(Duration::milliseconds(i64::MAX).num_milliseconds(), i64::MAX); - assert_eq!(Duration::milliseconds(i64::MIN).num_milliseconds(), i64::MIN); + assert_eq!(Duration::milliseconds(-i64::MAX).num_milliseconds(), -i64::MAX); assert_eq!(MAX.num_milliseconds(), i64::MAX); - assert_eq!(MIN.num_milliseconds(), i64::MIN); + assert_eq!(MIN.num_milliseconds(), -i64::MAX); } #[test] @@ -556,7 +605,7 @@ mod tests { assert_eq!(Duration::nanoseconds(-999).num_microseconds(), Some(0)); assert_eq!(Duration::nanoseconds(-1001).num_microseconds(), Some(-1)); assert_eq!(Duration::microseconds(i64::MAX).num_microseconds(), Some(i64::MAX)); - assert_eq!(Duration::microseconds(i64::MIN).num_microseconds(), Some(i64::MIN)); + assert_eq!(Duration::microseconds(-i64::MAX).num_microseconds(), Some(-i64::MAX)); assert_eq!(MAX.num_microseconds(), None); assert_eq!(MIN.num_microseconds(), None); @@ -567,11 +616,11 @@ mod tests { Some(i64::MAX / MICROS_PER_DAY * MICROS_PER_DAY) ); assert_eq!( - Duration::days(i64::MIN / MICROS_PER_DAY).num_microseconds(), - Some(i64::MIN / MICROS_PER_DAY * MICROS_PER_DAY) + Duration::days(-i64::MAX / MICROS_PER_DAY).num_microseconds(), + Some(-i64::MAX / MICROS_PER_DAY * MICROS_PER_DAY) ); assert_eq!(Duration::days(i64::MAX / MICROS_PER_DAY + 1).num_microseconds(), None); - assert_eq!(Duration::days(i64::MIN / MICROS_PER_DAY - 1).num_microseconds(), None); + assert_eq!(Duration::days(-i64::MAX / MICROS_PER_DAY - 1).num_microseconds(), None); } #[test] @@ -580,7 +629,7 @@ mod tests { assert_eq!(Duration::nanoseconds(1).num_nanoseconds(), Some(1)); assert_eq!(Duration::nanoseconds(-1).num_nanoseconds(), Some(-1)); assert_eq!(Duration::nanoseconds(i64::MAX).num_nanoseconds(), Some(i64::MAX)); - assert_eq!(Duration::nanoseconds(i64::MIN).num_nanoseconds(), Some(i64::MIN)); + assert_eq!(Duration::nanoseconds(-i64::MAX).num_nanoseconds(), Some(-i64::MAX)); assert_eq!(MAX.num_nanoseconds(), None); assert_eq!(MIN.num_nanoseconds(), None); @@ -591,11 +640,11 @@ mod tests { Some(i64::MAX / NANOS_PER_DAY * NANOS_PER_DAY) ); assert_eq!( - Duration::days(i64::MIN / NANOS_PER_DAY).num_nanoseconds(), - Some(i64::MIN / NANOS_PER_DAY * NANOS_PER_DAY) + Duration::days(-i64::MAX / NANOS_PER_DAY).num_nanoseconds(), + Some(-i64::MAX / NANOS_PER_DAY * NANOS_PER_DAY) ); assert_eq!(Duration::days(i64::MAX / NANOS_PER_DAY + 1).num_nanoseconds(), None); - assert_eq!(Duration::days(i64::MIN / NANOS_PER_DAY - 1).num_nanoseconds(), None); + assert_eq!(Duration::days(-i64::MAX / NANOS_PER_DAY - 1).num_nanoseconds(), None); } #[test] @@ -609,10 +658,12 @@ mod tests { .is_none()); assert_eq!( - Duration::milliseconds(i64::MIN).checked_sub(&Duration::milliseconds(0)), - Some(Duration::milliseconds(i64::MIN)) + Duration::milliseconds(-i64::MAX).checked_sub(&Duration::milliseconds(0)), + Some(Duration::milliseconds(-i64::MAX)) ); - assert!(Duration::milliseconds(i64::MIN).checked_sub(&Duration::milliseconds(1)).is_none()); + assert!(Duration::milliseconds(-i64::MAX) + .checked_sub(&Duration::milliseconds(1)) + .is_none()); } #[test] @@ -626,6 +677,7 @@ mod tests { assert_eq!(Duration::milliseconds(-1000).abs(), Duration::milliseconds(1000)); assert_eq!(Duration::milliseconds(-1300).abs(), Duration::milliseconds(1300)); assert_eq!(Duration::milliseconds(-1700).abs(), Duration::milliseconds(1700)); + assert_eq!(Duration::milliseconds(-i64::MAX).abs(), Duration::milliseconds(i64::MAX)); } #[test] @@ -745,4 +797,12 @@ mod tests { Err(OutOfRangeError(())) ); } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let duration = Duration::seconds(1); + let bytes = rkyv::to_bytes::<_, 16>(&duration).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), duration); + } } diff --git a/vendor/chrono/src/format/formatting.rs b/vendor/chrono/src/format/formatting.rs index bf37ba51d..9b055289c 100644 --- a/vendor/chrono/src/format/formatting.rs +++ b/vendor/chrono/src/format/formatting.rs @@ -3,50 +3,35 @@ //! Date and time formatting routines. -#[cfg(feature = "alloc")] +#[cfg(all(not(feature = "std"), feature = "alloc"))] use alloc::string::{String, ToString}; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use core::borrow::Borrow; -use core::fmt; -use core::fmt::Write; +#[cfg(feature = "alloc")] +use core::fmt::Display; +use core::fmt::{self, Write}; -#[cfg(any( - feature = "alloc", - feature = "std", - feature = "serde", - feature = "rustc-serialize" -))] -use crate::datetime::SecondsFormat; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use crate::offset::Offset; -#[cfg(any( - feature = "alloc", - feature = "std", - feature = "serde", - feature = "rustc-serialize" -))] +#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))] use crate::{Datelike, FixedOffset, NaiveDateTime, Timelike}; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use crate::{NaiveDate, NaiveTime, Weekday}; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use super::locales; -#[cfg(any( - feature = "alloc", - feature = "std", - feature = "serde", - feature = "rustc-serialize" -))] +#[cfg(all(feature = "unstable-locales", feature = "alloc"))] +use super::Locale; +#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))] use super::{Colons, OffsetFormat, OffsetPrecision, Pad}; -#[cfg(any(feature = "alloc", feature = "std"))] -use super::{Fixed, InternalFixed, InternalInternal, Item, Locale, Numeric}; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] +use super::{Fixed, InternalFixed, InternalInternal, Item, Numeric}; +#[cfg(feature = "alloc")] use locales::*; /// A *temporary* object which can be used as an argument to `format!` or others. /// This is normally constructed via `format` methods of each date and time type. -#[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] +#[cfg(feature = "alloc")] #[derive(Debug)] pub struct DelayedFormat { /// The date view, if any. @@ -64,7 +49,7 @@ pub struct DelayedFormat { locale: Option, } -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { /// Makes a new `DelayedFormat` value out of local date and time. #[must_use] @@ -88,7 +73,7 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { items: I, ) -> DelayedFormat where - Off: Offset + fmt::Display, + Off: Offset + Display, { let name_and_diff = (offset.to_string(), offset.fix()); DelayedFormat { @@ -103,7 +88,6 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { /// Makes a new `DelayedFormat` value out of local date and time and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub fn new_with_locale( date: Option, @@ -116,7 +100,6 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { /// Makes a new `DelayedFormat` value out of local date and time, UTC offset and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub fn new_with_offset_and_locale( date: Option, @@ -126,38 +109,40 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { locale: Locale, ) -> DelayedFormat where - Off: Offset + fmt::Display, + Off: Offset + Display, { let name_and_diff = (offset.to_string(), offset.fix()); DelayedFormat { date, time, off: Some(name_and_diff), items, locale: Some(locale) } } } -#[cfg(any(feature = "alloc", feature = "std"))] -impl<'a, I: Iterator + Clone, B: Borrow>> fmt::Display for DelayedFormat { +#[cfg(feature = "alloc")] +impl<'a, I: Iterator + Clone, B: Borrow>> Display for DelayedFormat { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { #[cfg(feature = "unstable-locales")] - { - if let Some(locale) = self.locale { - return format_localized( - f, - self.date.as_ref(), - self.time.as_ref(), - self.off.as_ref(), - self.items.clone(), - locale, - ); - } - } + let locale = self.locale; + #[cfg(not(feature = "unstable-locales"))] + let locale = None; - format(f, self.date.as_ref(), self.time.as_ref(), self.off.as_ref(), self.items.clone()) + let mut result = String::new(); + for item in self.items.clone() { + format_inner( + &mut result, + self.date.as_ref(), + self.time.as_ref(), + self.off.as_ref(), + item.borrow(), + locale, + )?; + } + f.pad(&result) } } /// Tries to format given arguments with given formatting items. /// Internally used by `DelayedFormat`. -#[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] +#[cfg(feature = "alloc")] +#[deprecated(since = "0.4.32", note = "Use DelayedFormat::fmt instead")] pub fn format<'a, I, B>( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -169,15 +154,20 @@ where I: Iterator + Clone, B: Borrow>, { - let mut result = String::new(); - for item in items { - format_inner(&mut result, date, time, off, item.borrow(), None)?; + DelayedFormat { + date: date.copied(), + time: time.copied(), + off: off.cloned(), + items, + #[cfg(feature = "unstable-locales")] + locale: None, } - w.pad(&result) + .fmt(w) } + /// Formats single formatting item -#[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] +#[cfg(feature = "alloc")] +#[deprecated(since = "0.4.32", note = "Use DelayedFormat::fmt instead")] pub fn format_item( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -185,51 +175,18 @@ pub fn format_item( off: Option<&(String, FixedOffset)>, item: &Item<'_>, ) -> fmt::Result { - let mut result = String::new(); - format_inner(&mut result, date, time, off, item, None)?; - w.pad(&result) -} - -/// Tries to format given arguments with given formatting items. -/// Internally used by `DelayedFormat`. -#[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] -pub fn format_localized<'a, I, B>( - w: &mut fmt::Formatter, - date: Option<&NaiveDate>, - time: Option<&NaiveTime>, - off: Option<&(String, FixedOffset)>, - items: I, - locale: Locale, -) -> fmt::Result -where - I: Iterator + Clone, - B: Borrow>, -{ - let mut result = String::new(); - for item in items { - format_inner(&mut result, date, time, off, item.borrow(), Some(locale))?; + DelayedFormat { + date: date.copied(), + time: time.copied(), + off: off.cloned(), + items: [item].into_iter(), + #[cfg(feature = "unstable-locales")] + locale: None, } - w.pad(&result) + .fmt(w) } -/// Formats single formatting item -#[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] -pub fn format_item_localized( - w: &mut fmt::Formatter, - date: Option<&NaiveDate>, - time: Option<&NaiveTime>, - off: Option<&(String, FixedOffset)>, - item: &Item<'_>, - locale: Locale, -) -> fmt::Result { - let mut result = String::new(); - format_inner(&mut result, date, time, off, item, Some(locale))?; - w.pad(&result) -} - -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] fn format_inner( w: &mut impl Write, date: Option<&NaiveDate>, @@ -242,7 +199,7 @@ fn format_inner( match *item { Item::Literal(s) | Item::Space(s) => w.write_str(s), - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] Item::OwnedLiteral(ref s) | Item::OwnedSpace(ref s) => w.write_str(s), Item::Numeric(ref spec, ref pad) => { @@ -436,7 +393,7 @@ fn format_inner( // same as `%a, %d %b %Y %H:%M:%S %z` { if let (Some(d), Some(t), Some(&(_, off))) = (date, time, off) { - Some(write_rfc2822_inner(w, *d, *t, off, locale)) + Some(write_rfc2822(w, crate::NaiveDateTime::new(*d, *t), off)) } else { None } @@ -465,7 +422,7 @@ fn format_inner( } } -#[cfg(any(feature = "alloc", feature = "std", feature = "serde", feature = "rustc-serialize"))] +#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))] impl OffsetFormat { /// Writes an offset from UTC with the format defined by `self`. fn format(&self, w: &mut impl Write, off: FixedOffset) -> fmt::Result { @@ -545,9 +502,37 @@ impl OffsetFormat { } } +/// Specific formatting options for seconds. This may be extended in the +/// future, so exhaustive matching in external code is not recommended. +/// +/// See the `TimeZone::to_rfc3339_opts` function for usage. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[allow(clippy::manual_non_exhaustive)] +pub enum SecondsFormat { + /// Format whole seconds only, with no decimal point nor subseconds. + Secs, + + /// Use fixed 3 subsecond digits. This corresponds to [Fixed::Nanosecond3]. + Millis, + + /// Use fixed 6 subsecond digits. This corresponds to [Fixed::Nanosecond6]. + Micros, + + /// Use fixed 9 subsecond digits. This corresponds to [Fixed::Nanosecond9]. + Nanos, + + /// Automatically select one of `Secs`, `Millis`, `Micros`, or `Nanos` to display all available + /// non-zero sub-second digits. This corresponds to [Fixed::Nanosecond]. + AutoSi, + + // Do not match against this. + #[doc(hidden)] + __NonExhaustive, +} + /// Writes the date, time and offset to the string. same as `%Y-%m-%dT%H:%M:%S%.f%:z` #[inline] -#[cfg(any(feature = "alloc", feature = "std", feature = "serde", feature = "rustc-serialize"))] +#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))] pub(crate) fn write_rfc3339( w: &mut impl Write, dt: NaiveDateTime, @@ -610,52 +595,42 @@ pub(crate) fn write_rfc3339( .format(w, off) } -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] /// write datetimes like `Tue, 1 Jul 2003 10:52:37 +0200`, same as `%a, %d %b %Y %H:%M:%S %z` pub(crate) fn write_rfc2822( w: &mut impl Write, dt: NaiveDateTime, off: FixedOffset, ) -> fmt::Result { - write_rfc2822_inner(w, dt.date(), dt.time(), off, default_locale()) -} - -#[cfg(any(feature = "alloc", feature = "std"))] -/// write datetimes like `Tue, 1 Jul 2003 10:52:37 +0200`, same as `%a, %d %b %Y %H:%M:%S %z` -fn write_rfc2822_inner( - w: &mut impl Write, - d: NaiveDate, - t: NaiveTime, - off: FixedOffset, - locale: Locale, -) -> fmt::Result { - let year = d.year(); + let year = dt.year(); // RFC2822 is only defined on years 0 through 9999 if !(0..=9999).contains(&year) { return Err(fmt::Error); } - w.write_str(short_weekdays(locale)[d.weekday().num_days_from_sunday() as usize])?; + let english = default_locale(); + + w.write_str(short_weekdays(english)[dt.weekday().num_days_from_sunday() as usize])?; w.write_str(", ")?; - let day = d.day(); + let day = dt.day(); if day < 10 { w.write_char((b'0' + day as u8) as char)?; } else { write_hundreds(w, day as u8)?; } w.write_char(' ')?; - w.write_str(short_months(locale)[d.month0() as usize])?; + w.write_str(short_months(english)[dt.month0() as usize])?; w.write_char(' ')?; write_hundreds(w, (year / 100) as u8)?; write_hundreds(w, (year % 100) as u8)?; w.write_char(' ')?; - let (hour, min, sec) = t.hms(); + let (hour, min, sec) = dt.time().hms(); write_hundreds(w, hour as u8)?; w.write_char(':')?; write_hundreds(w, min as u8)?; w.write_char(':')?; - let sec = sec + t.nanosecond() / 1_000_000_000; + let sec = sec + dt.nanosecond() / 1_000_000_000; write_hundreds(w, sec as u8)?; w.write_char(' ')?; OffsetFormat { @@ -680,15 +655,15 @@ pub(crate) fn write_hundreds(w: &mut impl Write, n: u8) -> fmt::Result { } #[cfg(test)] -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] mod tests { use super::{Colons, OffsetFormat, OffsetPrecision, Pad}; use crate::FixedOffset; - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] use crate::{NaiveDate, NaiveTime, TimeZone, Timelike, Utc}; #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_date_format() { let d = NaiveDate::from_ymd_opt(2012, 3, 4).unwrap(); assert_eq!(d.format("%Y,%C,%y,%G,%g").to_string(), "2012,20,12,2012,12"); @@ -733,7 +708,7 @@ mod tests { } #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_time_format() { let t = NaiveTime::from_hms_nano_opt(3, 5, 7, 98765432).unwrap(); assert_eq!(t.format("%H,%k,%I,%l,%P,%p").to_string(), "03, 3,03, 3,am,AM"); @@ -769,7 +744,7 @@ mod tests { } #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_datetime_format() { let dt = NaiveDate::from_ymd_opt(2010, 9, 8).unwrap().and_hms_milli_opt(7, 6, 54, 321).unwrap(); @@ -787,7 +762,7 @@ mod tests { } #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_datetime_format_alignment() { let datetime = Utc .with_ymd_and_hms(2007, 1, 2, 12, 34, 56) diff --git a/vendor/chrono/src/format/mod.rs b/vendor/chrono/src/format/mod.rs index d22cdf071..fda4d425b 100644 --- a/vendor/chrono/src/format/mod.rs +++ b/vendor/chrono/src/format/mod.rs @@ -30,7 +30,7 @@ //! # Ok::<(), chrono::ParseError>(()) //! ``` -#[cfg(feature = "alloc")] +#[cfg(all(not(feature = "std"), feature = "alloc"))] use alloc::boxed::Box; use core::fmt; use core::str::FromStr; @@ -48,27 +48,22 @@ pub(crate) mod scan; pub mod strftime; -#[cfg(any(feature = "alloc", feature = "std"))] +#[allow(unused)] +// TODO: remove '#[allow(unused)]' once we use this module for parsing or something else that does +// not require `alloc`. pub(crate) mod locales; pub(crate) use formatting::write_hundreds; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] pub(crate) use formatting::write_rfc2822; -#[cfg(any( - feature = "alloc", - feature = "std", - feature = "serde", - feature = "rustc-serialize" -))] +#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))] pub(crate) use formatting::write_rfc3339; -#[cfg(any(feature = "alloc", feature = "std"))] +pub use formatting::SecondsFormat; +#[cfg(feature = "alloc")] +#[allow(deprecated)] pub use formatting::{format, format_item, DelayedFormat}; #[cfg(feature = "unstable-locales")] -pub use formatting::{format_item_localized, format_localized}; -#[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] pub use locales::Locale; -#[cfg(all(not(feature = "unstable-locales"), any(feature = "alloc", feature = "std")))] -pub(crate) use locales::Locale; pub(crate) use parse::parse_rfc3339; pub use parse::{parse, parse_and_remainder}; pub use parsed::Parsed; @@ -332,14 +327,12 @@ pub enum Item<'a> { /// A literally printed and parsed text. Literal(&'a str), /// Same as `Literal` but with the string owned by the item. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] OwnedLiteral(Box), /// Whitespace. Prints literally but reads zero or more whitespace. Space(&'a str), /// Same as `Space` but with the string owned by the item. - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] OwnedSpace(Box), /// Numeric item. Can be optionally padded to the maximal length (if any) when formatting; /// the parser simply ignores any padded whitespace and zeroes. @@ -437,7 +430,6 @@ impl fmt::Display for ParseError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl Error for ParseError { #[allow(deprecated)] fn description(&self) -> &str { diff --git a/vendor/chrono/src/format/parse.rs b/vendor/chrono/src/format/parse.rs index 418fa424e..04628ac86 100644 --- a/vendor/chrono/src/format/parse.rs +++ b/vendor/chrono/src/format/parse.rs @@ -311,7 +311,7 @@ where s = &s[prefix.len()..]; } - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] Item::OwnedLiteral(ref prefix) => { if s.len() < prefix.len() { return Err((s, TOO_SHORT)); @@ -326,7 +326,7 @@ where s = s.trim_start(); } - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] Item::OwnedSpace(_) => { s = s.trim_start(); } @@ -1700,7 +1700,7 @@ mod tests { let dt = Utc.with_ymd_and_hms(1994, 11, 6, 8, 49, 37).unwrap(); // Check that the format is what we expect - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] assert_eq!(dt.format(RFC850_FMT).to_string(), "Sunday, 06-Nov-94 08:49:37 GMT"); // Check that it parses correctly diff --git a/vendor/chrono/src/format/parsed.rs b/vendor/chrono/src/format/parsed.rs index ad0d0013a..fb9d11344 100644 --- a/vendor/chrono/src/format/parsed.rs +++ b/vendor/chrono/src/format/parsed.rs @@ -634,11 +634,6 @@ impl Parsed { let datetime = self.to_naive_datetime_with_offset(offset)?; let offset = FixedOffset::east_opt(offset).ok_or(OUT_OF_RANGE)?; - // this is used to prevent an overflow when calling FixedOffset::from_local_datetime - datetime - .checked_sub_signed(OldDuration::seconds(i64::from(offset.local_minus_utc()))) - .ok_or(OUT_OF_RANGE)?; - match offset.from_local_datetime(&datetime) { LocalResult::None => Err(IMPOSSIBLE), LocalResult::Single(t) => Ok(t), diff --git a/vendor/chrono/src/format/scan.rs b/vendor/chrono/src/format/scan.rs index 98f3673ff..45b5bcbec 100644 --- a/vendor/chrono/src/format/scan.rs +++ b/vendor/chrono/src/format/scan.rs @@ -274,7 +274,7 @@ where }; s = match s.len() { len if len >= 2 => &s[2..], - len if len == 0 => s, + 0 => s, _ => return Err(TOO_SHORT), }; diff --git a/vendor/chrono/src/format/strftime.rs b/vendor/chrono/src/format/strftime.rs index d7551457f..557034d15 100644 --- a/vendor/chrono/src/format/strftime.rs +++ b/vendor/chrono/src/format/strftime.rs @@ -191,7 +191,6 @@ impl<'a> StrftimeItems<'a> { /// Creates a new parsing iterator from the `strftime`-like format string. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub const fn new_with_locale(s: &'a str, locale: Locale) -> StrftimeItems<'a> { StrftimeItems { remainder: s, queue: &[], locale_str: "", locale: Some(locale) } @@ -501,7 +500,7 @@ mod tests { use crate::format::Locale; use crate::format::{fixed, internal_fixed, num, num0, nums}; use crate::format::{Fixed, InternalInternal, Numeric::*}; - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] use crate::{DateTime, FixedOffset, NaiveDate, TimeZone, Timelike, Utc}; #[test] @@ -663,7 +662,7 @@ mod tests { } #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_strftime_docs() { let dt = FixedOffset::east_opt(34200) .unwrap() @@ -774,7 +773,7 @@ mod tests { } #[test] - #[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] fn test_strftime_docs_localized() { let dt = FixedOffset::east_opt(34200) .unwrap() @@ -827,7 +826,7 @@ mod tests { /// /// See . #[test] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] fn test_parse_only_timezone_offset_permissive_no_panic() { use crate::NaiveDate; use crate::{FixedOffset, TimeZone}; @@ -848,7 +847,7 @@ mod tests { } #[test] - #[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] fn test_strftime_localized_korean() { let dt = FixedOffset::east_opt(34200) .unwrap() @@ -877,7 +876,7 @@ mod tests { } #[test] - #[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] fn test_strftime_localized_japanese() { let dt = FixedOffset::east_opt(34200) .unwrap() diff --git a/vendor/chrono/src/lib.rs b/vendor/chrono/src/lib.rs index e4d4479ef..e532d7479 100644 --- a/vendor/chrono/src/lib.rs +++ b/vendor/chrono/src/lib.rs @@ -108,21 +108,28 @@ //! or in the local time zone //! ([`Local::now()`](./offset/struct.Local.html#method.now)). //! +#![cfg_attr(not(feature = "now"), doc = "```ignore")] +#![cfg_attr(feature = "now", doc = "```rust")] +//! use chrono::prelude::*; +//! +//! let utc: DateTime = Utc::now(); // e.g. `2014-11-28T12:45:59.324310806Z` +//! # let _ = utc; +//! ``` +//! #![cfg_attr(not(feature = "clock"), doc = "```ignore")] #![cfg_attr(feature = "clock", doc = "```rust")] //! use chrono::prelude::*; //! -//! let utc: DateTime = Utc::now(); // e.g. `2014-11-28T12:45:59.324310806Z` //! let local: DateTime = Local::now(); // e.g. `2014-11-28T21:45:59.324310806+09:00` -//! # let _ = utc; let _ = local; +//! # let _ = local; //! ``` //! //! Alternatively, you can create your own date and time. //! This is a bit verbose due to Rust's lack of function and method overloading, //! but in turn we get a rich combination of initialization methods. //! -#![cfg_attr(not(feature = "std"), doc = "```ignore")] -#![cfg_attr(feature = "std", doc = "```rust")] +#![cfg_attr(not(feature = "now"), doc = "```ignore")] +#![cfg_attr(feature = "now", doc = "```rust")] //! use chrono::prelude::*; //! use chrono::offset::LocalResult; //! @@ -146,12 +153,14 @@ //! assert_eq!(Utc.with_ymd_and_hms(2014, 7, 8, 80, 15, 33), LocalResult::None); //! assert_eq!(Utc.with_ymd_and_hms(2014, 7, 38, 21, 15, 33), LocalResult::None); //! +//! # #[cfg(feature = "clock")] { //! // other time zone objects can be used to construct a local datetime. //! // obviously, `local_dt` is normally different from `dt`, but `fixed_dt` should be identical. //! let local_dt = Local.from_local_datetime(&NaiveDate::from_ymd_opt(2014, 7, 8).unwrap().and_hms_milli_opt(9, 10, 11, 12).unwrap()).unwrap(); //! let fixed_dt = FixedOffset::east_opt(9 * 3600).unwrap().from_local_datetime(&NaiveDate::from_ymd_opt(2014, 7, 8).unwrap().and_hms_milli_opt(18, 10, 11, 12).unwrap()).unwrap(); //! assert_eq!(dt, fixed_dt); //! # let _ = local_dt; +//! # } //! # Some(()) //! # } //! # doctest().unwrap(); @@ -227,7 +236,7 @@ //! # #[allow(unused_imports)] //! use chrono::prelude::*; //! -//! # #[cfg(feature = "unstable-locales")] +//! # #[cfg(all(feature = "unstable-locales", feature = "alloc"))] //! # fn test() { //! let dt = Utc.with_ymd_and_hms(2014, 11, 28, 12, 0, 9).unwrap(); //! assert_eq!(dt.format("%Y-%m-%d %H:%M:%S").to_string(), "2014-11-28 12:00:09"); @@ -244,9 +253,9 @@ //! let dt_nano = NaiveDate::from_ymd_opt(2014, 11, 28).unwrap().and_hms_nano_opt(12, 0, 9, 1).unwrap().and_local_timezone(Utc).unwrap(); //! assert_eq!(format!("{:?}", dt_nano), "2014-11-28T12:00:09.000000001Z"); //! # } -//! # #[cfg(not(feature = "unstable-locales"))] +//! # #[cfg(not(all(feature = "unstable-locales", feature = "alloc")))] //! # fn test() {} -//! # if cfg!(feature = "unstable-locales") { +//! # if cfg!(all(feature = "unstable-locales", feature = "alloc")) { //! # test(); //! # } //! ``` @@ -359,7 +368,7 @@ //! //! ## Rust version requirements //! -//! The Minimum Supported Rust Version (MSRV) is currently **Rust 1.57.0**. +//! The Minimum Supported Rust Version (MSRV) is currently **Rust 1.61.0**. //! //! The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done //! lightly. @@ -469,7 +478,7 @@ // can remove this if/when rustc-serialize support is removed // keeps clippy happy in the meantime #![cfg_attr(feature = "rustc-serialize", allow(deprecated))] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(feature = "alloc")] extern crate alloc; @@ -477,75 +486,73 @@ extern crate alloc; mod duration; pub use duration::Duration; #[cfg(feature = "std")] +#[doc(no_inline)] pub use duration::OutOfRangeError; use core::fmt; /// A convenience module appropriate for glob imports (`use chrono::prelude::*;`). pub mod prelude { - #[doc(no_inline)] #[allow(deprecated)] pub use crate::Date; #[cfg(feature = "clock")] - #[cfg_attr(docsrs, doc(cfg(feature = "clock")))] - #[doc(no_inline)] pub use crate::Local; - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] - #[doc(no_inline)] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] pub use crate::Locale; - #[doc(no_inline)] pub use crate::SubsecRound; - #[doc(no_inline)] pub use crate::{DateTime, SecondsFormat}; - #[doc(no_inline)] pub use crate::{Datelike, Month, Timelike, Weekday}; - #[doc(no_inline)] pub use crate::{FixedOffset, Utc}; - #[doc(no_inline)] pub use crate::{NaiveDate, NaiveDateTime, NaiveTime}; - #[doc(no_inline)] pub use crate::{Offset, TimeZone}; } mod date; #[allow(deprecated)] -pub use date::{Date, MAX_DATE, MIN_DATE}; +pub use date::Date; +#[doc(no_inline)] +#[allow(deprecated)] +pub use date::{MAX_DATE, MIN_DATE}; mod datetime; #[cfg(feature = "rustc-serialize")] -#[cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] pub use datetime::rustc_serialize::TsSeconds; +pub use datetime::DateTime; #[allow(deprecated)] -pub use datetime::{DateTime, SecondsFormat, MAX_DATETIME, MIN_DATETIME}; +#[doc(no_inline)] +pub use datetime::{MAX_DATETIME, MIN_DATETIME}; pub mod format; /// L10n locales. #[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] pub use format::Locale; -pub use format::{ParseError, ParseResult}; +pub use format::{ParseError, ParseResult, SecondsFormat}; pub mod naive; -#[doc(no_inline)] -pub use naive::{Days, IsoWeek, NaiveDate, NaiveDateTime, NaiveTime, NaiveWeek}; +#[doc(inline)] +pub use naive::{Days, NaiveDate, NaiveDateTime, NaiveTime}; +pub use naive::{IsoWeek, NaiveWeek}; pub mod offset; #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] -#[doc(no_inline)] +#[doc(inline)] pub use offset::Local; -#[doc(no_inline)] -pub use offset::{FixedOffset, LocalResult, Offset, TimeZone, Utc}; +pub use offset::LocalResult; +#[doc(inline)] +pub use offset::{FixedOffset, Offset, TimeZone, Utc}; -mod round; +pub mod round; pub use round::{DurationRound, RoundingError, SubsecRound}; mod weekday; -pub use weekday::{ParseWeekdayError, Weekday}; +#[doc(no_inline)] +pub use weekday::ParseWeekdayError; +pub use weekday::Weekday; mod month; -pub use month::{Month, Months, ParseMonthError}; +#[doc(no_inline)] +pub use month::ParseMonthError; +pub use month::{Month, Months}; mod traits; pub use traits::{Datelike, Timelike}; @@ -564,11 +571,29 @@ pub use naive::__BenchYearFlags; /// [1]: https://tools.ietf.org/html/rfc3339 /// [2]: https://serde.rs/field-attrs.html#with #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] pub mod serde { pub use super::datetime::serde::*; } +/// Zero-copy serialization/deserialization with rkyv. +/// +/// This module re-exports the `Archived*` versions of chrono's types. +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] +pub mod rkyv { + pub use crate::datetime::ArchivedDateTime; + pub use crate::duration::ArchivedDuration; + pub use crate::month::ArchivedMonth; + pub use crate::naive::date::ArchivedNaiveDate; + pub use crate::naive::datetime::ArchivedNaiveDateTime; + pub use crate::naive::isoweek::ArchivedIsoWeek; + pub use crate::naive::time::ArchivedNaiveTime; + pub use crate::offset::fixed::ArchivedFixedOffset; + #[cfg(feature = "clock")] + pub use crate::offset::local::ArchivedLocal; + pub use crate::offset::utc::ArchivedUtc; + pub use crate::weekday::ArchivedWeekday; +} + /// Out of range error type used in various converting APIs #[derive(Clone, Copy, Hash, PartialEq, Eq)] pub struct OutOfRange { @@ -598,6 +623,7 @@ impl std::error::Error for OutOfRange {} /// Workaround because `?` is not (yet) available in const context. #[macro_export] +#[doc(hidden)] macro_rules! try_opt { ($e:expr) => { match $e { @@ -609,6 +635,7 @@ macro_rules! try_opt { /// Workaround because `.expect()` is not (yet) available in const context. #[macro_export] +#[doc(hidden)] macro_rules! expect { ($e:expr, $m:literal) => { match $e { diff --git a/vendor/chrono/src/month.rs b/vendor/chrono/src/month.rs index 146a98ebe..c3c3579d2 100644 --- a/vendor/chrono/src/month.rs +++ b/vendor/chrono/src/month.rs @@ -1,6 +1,6 @@ use core::fmt; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use crate::OutOfRange; @@ -30,7 +30,13 @@ use crate::OutOfRange; // Actual implementation is zero-indexed, API intended as 1-indexed for more intuitive behavior. #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash, PartialOrd, Ord)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum Month { /// January @@ -227,6 +233,12 @@ impl Months { pub const fn new(num: u32) -> Self { Self(num) } + + /// Returns the total number of months in the `Months` instance. + #[inline] + pub const fn as_u32(&self) -> u32 { + self.0 + } } /// An error resulting from reading `` value with `FromStr`. @@ -236,7 +248,6 @@ pub struct ParseMonthError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for ParseMonthError {} impl fmt::Display for ParseMonthError { @@ -252,7 +263,6 @@ impl fmt::Debug for ParseMonthError { } #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod month_serde { use super::Month; use serde::{de, ser}; @@ -298,7 +308,7 @@ mod month_serde { #[cfg(test)] mod tests { use super::Month; - use crate::{Datelike, OutOfRange, TimeZone, Utc}; + use crate::{Datelike, Months, OutOfRange, TimeZone, Utc}; #[test] fn test_month_enum_try_from() { @@ -353,6 +363,13 @@ mod tests { assert!(Month::September > Month::March); } + #[test] + fn test_months_as_u32() { + assert_eq!(Months::new(0).as_u32(), 0); + assert_eq!(Months::new(1).as_u32(), 1); + assert_eq!(Months::new(u32::MAX).as_u32(), u32::MAX); + } + #[test] #[cfg(feature = "serde")] fn test_serde_serialize() { @@ -415,4 +432,12 @@ mod tests { from_str::(string).unwrap_err(); } } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let month = Month::January; + let bytes = rkyv::to_bytes::<_, 1>(&month).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), month); + } } diff --git a/vendor/chrono/src/naive/date.rs b/vendor/chrono/src/naive/date.rs index 677c5fa6f..c8acb9efc 100644 --- a/vendor/chrono/src/naive/date.rs +++ b/vendor/chrono/src/naive/date.rs @@ -3,21 +3,21 @@ //! ISO 8601 calendar date without timezone. -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use core::borrow::Borrow; use core::iter::FusedIterator; use core::ops::{Add, AddAssign, RangeInclusive, Sub, SubAssign}; use core::{fmt, str}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; /// L10n locales. -#[cfg(feature = "unstable-locales")] +#[cfg(all(feature = "unstable-locales", feature = "alloc"))] use pure_rust_locales::Locale; use crate::duration::Duration as OldDuration; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use crate::format::DelayedFormat; use crate::format::{ parse, parse_and_remainder, write_hundreds, Item, Numeric, Pad, ParseError, ParseResult, @@ -100,8 +100,7 @@ impl NaiveWeek { } /// Returns a [`RangeInclusive`] representing the whole week bounded by - /// [first_day](./struct.NaiveWeek.html#method.first_day) and - /// [last_day](./struct.NaiveWeek.html#method.last_day) functions. + /// [first_day](NaiveWeek::first_day) and [last_day](NaiveWeek::last_day) functions. /// /// # Panics /// @@ -160,12 +159,12 @@ impl Days { /// /// * ISO 8601 calendars has the year 0, which is 1 BCE (a year before 1 CE). /// If you need a typical BCE/BC and CE/AD notation for year numbers, -/// use the [`Datelike::year_ce`](../trait.Datelike.html#method.year_ce) method. +/// use the [`Datelike::year_ce`] method. /// /// # Week Date /// /// The ISO 8601 **week date** is a triple of year number, week number -/// and [day of the week](../enum.Weekday.html) with the following rules: +/// and [day of the week](Weekday) with the following rules: /// /// * A week consists of Monday through Sunday, and is always numbered within some year. /// The week number ranges from 1 to 52 or 53 depending on the year. @@ -176,10 +175,9 @@ impl Days { /// * The year number in the week date may *not* correspond to the actual Gregorian year. /// For example, January 3, 2016 (Sunday) was on the last (53rd) week of 2015. /// -/// Chrono's date types default to the ISO 8601 [calendar date](#calendar-date), -/// but [`Datelike::iso_week`](../trait.Datelike.html#tymethod.iso_week) and -/// [`Datelike::weekday`](../trait.Datelike.html#tymethod.weekday) methods -/// can be used to get the corresponding week date. +/// Chrono's date types default to the ISO 8601 [calendar date](#calendar-date), but +/// [`Datelike::iso_week`] and [`Datelike::weekday`] methods can be used to get the corresponding +/// week date. /// /// # Ordinal Date /// @@ -191,7 +189,13 @@ impl Days { /// /// [proleptic Gregorian date]: crate::NaiveDate#calendar-date #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct NaiveDate { ymdf: DateImpl, // (year << 13) | of } @@ -538,7 +542,7 @@ impl NaiveDate { } /// Parses a string with the specified format string and returns a new `NaiveDate`. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// # Example @@ -587,7 +591,7 @@ impl NaiveDate { /// Parses a string from a user-specified format into a new `NaiveDate` value, and a slice with /// the remaining portion of the string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// Similar to [`parse_from_str`](#method.parse_from_str). @@ -1264,8 +1268,7 @@ impl NaiveDate { /// # let d = NaiveDate::from_ymd_opt(2015, 9, 5).unwrap(); /// assert_eq!(format!("{}", d.format_with_items(fmt)), "2015-09-05"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -1277,7 +1280,7 @@ impl NaiveDate { } /// Formats the date with the specified format string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// This returns a `DelayedFormat`, @@ -1308,8 +1311,7 @@ impl NaiveDate { /// assert_eq!(format!("{}", d.format("%Y-%m-%d")), "2015-09-05"); /// assert_eq!(format!("{}", d.format("%A, %-d %B, %C%y")), "Saturday, 5 September, 2015"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -1317,8 +1319,7 @@ impl NaiveDate { } /// Formats the date with the specified formatting items and locale. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -1337,8 +1338,7 @@ impl NaiveDate { /// /// See the [`crate::format::strftime`] module on the supported escape /// sequences. - #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] + #[cfg(all(feature = "unstable-locales", feature = "alloc"))] #[inline] #[must_use] pub fn format_localized<'a>( @@ -1439,6 +1439,13 @@ impl NaiveDate { self.ymdf >> 13 } + /// Returns the day of year starting from 1. + // This duplicates `Datelike::ordinal()`, because trait methods can't be const yet. + #[inline] + const fn ordinal(&self) -> u32 { + self.of().ordinal() + } + // This duplicates `Datelike::month()`, because trait methods can't be const yet. #[inline] const fn month(&self) -> u32 { @@ -1457,10 +1464,33 @@ impl NaiveDate { self.of().weekday() } - /// The minimum possible `NaiveDate` (January 1, 262145 BCE). - pub const MIN: NaiveDate = NaiveDate { ymdf: (MIN_YEAR << 13) | (1 << 4) | 0o07 /*FE*/ }; - /// The maximum possible `NaiveDate` (December 31, 262143 CE). - pub const MAX: NaiveDate = NaiveDate { ymdf: (MAX_YEAR << 13) | (365 << 4) | 0o17 /*F*/ }; + /// Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1. + // This duplicates `Datelike::num_days_from_ce()`, because trait methods can't be const yet. + pub(crate) const fn num_days_from_ce(&self) -> i32 { + // we know this wouldn't overflow since year is limited to 1/2^13 of i32's full range. + let mut year = self.year() - 1; + let mut ndays = 0; + if year < 0 { + let excess = 1 + (-year) / 400; + year += excess * 400; + ndays -= excess * 146_097; + } + let div_100 = year / 100; + ndays += ((year * 1461) >> 2) - div_100 + (div_100 >> 2); + ndays + self.ordinal() as i32 + } + + /// The minimum possible `NaiveDate` (January 1, 262144 BCE). + pub const MIN: NaiveDate = NaiveDate { ymdf: (MIN_YEAR << 13) | (1 << 4) | 0o12 /*D*/ }; + /// The maximum possible `NaiveDate` (December 31, 262142 CE). + pub const MAX: NaiveDate = NaiveDate { ymdf: (MAX_YEAR << 13) | (365 << 4) | 0o16 /*G*/ }; + + /// One day before the minimum possible `NaiveDate` (December 31, 262145 BCE). + pub(crate) const BEFORE_MIN: NaiveDate = + NaiveDate { ymdf: ((MIN_YEAR - 1) << 13) | (366 << 4) | 0o07 /*FE*/ }; + /// One day after the maximum possible `NaiveDate` (January 1, 262143 CE). + pub(crate) const AFTER_MAX: NaiveDate = + NaiveDate { ymdf: ((MAX_YEAR + 1) << 13) | (1 << 4) | 0o17 /*F*/ }; } impl Datelike for NaiveDate { @@ -1826,10 +1856,15 @@ impl Datelike for NaiveDate { } } -/// An addition of `Duration` to `NaiveDate` discards the fractional days, -/// rounding to the closest integral number of days towards `Duration::zero()`. +/// Add `chrono::Duration` to `NaiveDate`. /// -/// Panics on underflow or overflow. Use [`NaiveDate::checked_add_signed`] to detect that. +/// This discards the fractional days in `Duration`, rounding to the closest integral number of days +/// towards `Duration::zero()`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDate::checked_add_signed`] to get an `Option` instead. /// /// # Example /// @@ -1858,6 +1893,15 @@ impl Add for NaiveDate { } } +/// Add-assign of `chrono::Duration` to `NaiveDate`. +/// +/// This discards the fractional days in `Duration`, rounding to the closest integral number of days +/// towards `Duration::zero()`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDate::checked_add_signed`] to get an `Option` instead. impl AddAssign for NaiveDate { #[inline] fn add_assign(&mut self, rhs: OldDuration) { @@ -1865,80 +1909,105 @@ impl AddAssign for NaiveDate { } } +/// Add `Months` to `NaiveDate`. +/// +/// The result will be clamped to valid days in the resulting month, see `checked_add_months` for +/// details. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `NaiveDate::checked_add_months` to get an `Option` instead. +/// +/// # Example +/// +/// ``` +/// use chrono::{NaiveDate, Months}; +/// +/// let from_ymd = |y, m, d| NaiveDate::from_ymd_opt(y, m, d).unwrap(); +/// +/// assert_eq!(from_ymd(2014, 1, 1) + Months::new(1), from_ymd(2014, 2, 1)); +/// assert_eq!(from_ymd(2014, 1, 1) + Months::new(11), from_ymd(2014, 12, 1)); +/// assert_eq!(from_ymd(2014, 1, 1) + Months::new(12), from_ymd(2015, 1, 1)); +/// assert_eq!(from_ymd(2014, 1, 1) + Months::new(13), from_ymd(2015, 2, 1)); +/// assert_eq!(from_ymd(2014, 1, 31) + Months::new(1), from_ymd(2014, 2, 28)); +/// assert_eq!(from_ymd(2020, 1, 31) + Months::new(1), from_ymd(2020, 2, 29)); +/// ``` impl Add for NaiveDate { type Output = NaiveDate; - /// An addition of months to `NaiveDate` clamped to valid days in resulting month. - /// - /// # Panics - /// - /// Panics if the resulting date would be out of range. - /// - /// # Example - /// - /// ``` - /// use chrono::{NaiveDate, Months}; - /// - /// let from_ymd = |y, m, d| NaiveDate::from_ymd_opt(y, m, d).unwrap(); - /// - /// assert_eq!(from_ymd(2014, 1, 1) + Months::new(1), from_ymd(2014, 2, 1)); - /// assert_eq!(from_ymd(2014, 1, 1) + Months::new(11), from_ymd(2014, 12, 1)); - /// assert_eq!(from_ymd(2014, 1, 1) + Months::new(12), from_ymd(2015, 1, 1)); - /// assert_eq!(from_ymd(2014, 1, 1) + Months::new(13), from_ymd(2015, 2, 1)); - /// assert_eq!(from_ymd(2014, 1, 31) + Months::new(1), from_ymd(2014, 2, 28)); - /// assert_eq!(from_ymd(2020, 1, 31) + Months::new(1), from_ymd(2020, 2, 29)); - /// ``` fn add(self, months: Months) -> Self::Output { - self.checked_add_months(months).unwrap() + self.checked_add_months(months).expect("`NaiveDate + Months` out of range") } } +/// Subtract `Months` from `NaiveDate`. +/// +/// The result will be clamped to valid days in the resulting month, see `checked_sub_months` for +/// details. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `NaiveDate::checked_sub_months` to get an `Option` instead. +/// +/// # Example +/// +/// ``` +/// use chrono::{NaiveDate, Months}; +/// +/// let from_ymd = |y, m, d| NaiveDate::from_ymd_opt(y, m, d).unwrap(); +/// +/// assert_eq!(from_ymd(2014, 1, 1) - Months::new(11), from_ymd(2013, 2, 1)); +/// assert_eq!(from_ymd(2014, 1, 1) - Months::new(12), from_ymd(2013, 1, 1)); +/// assert_eq!(from_ymd(2014, 1, 1) - Months::new(13), from_ymd(2012, 12, 1)); +/// ``` impl Sub for NaiveDate { type Output = NaiveDate; - /// A subtraction of Months from `NaiveDate` clamped to valid days in resulting month. - /// - /// # Panics - /// - /// Panics if the resulting date would be out of range. - /// - /// # Example - /// - /// ``` - /// use chrono::{NaiveDate, Months}; - /// - /// let from_ymd = |y, m, d| NaiveDate::from_ymd_opt(y, m, d).unwrap(); - /// - /// assert_eq!(from_ymd(2014, 1, 1) - Months::new(11), from_ymd(2013, 2, 1)); - /// assert_eq!(from_ymd(2014, 1, 1) - Months::new(12), from_ymd(2013, 1, 1)); - /// assert_eq!(from_ymd(2014, 1, 1) - Months::new(13), from_ymd(2012, 12, 1)); - /// ``` fn sub(self, months: Months) -> Self::Output { - self.checked_sub_months(months).unwrap() + self.checked_sub_months(months).expect("`NaiveDate - Months` out of range") } } +/// Add `Days` to `NaiveDate`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `NaiveDate::checked_add_days` to get an `Option` instead. impl Add for NaiveDate { type Output = NaiveDate; fn add(self, days: Days) -> Self::Output { - self.checked_add_days(days).unwrap() + self.checked_add_days(days).expect("`NaiveDate + Days` out of range") } } +/// Subtract `Days` from `NaiveDate`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `NaiveDate::checked_sub_days` to get an `Option` instead. impl Sub for NaiveDate { type Output = NaiveDate; fn sub(self, days: Days) -> Self::Output { - self.checked_sub_days(days).unwrap() + self.checked_sub_days(days).expect("`NaiveDate - Days` out of range") } } -/// A subtraction of `Duration` from `NaiveDate` discards the fractional days, -/// rounding to the closest integral number of days towards `Duration::zero()`. +/// Subtract `chrono::Duration` from `NaiveDate`. +/// +/// This discards the fractional days in `Duration`, rounding to the closest integral number of days +/// towards `Duration::zero()`. /// It is the same as the addition with a negated `Duration`. /// -/// Panics on underflow or overflow. Use [`NaiveDate::checked_sub_signed`] to detect that. +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDate::checked_sub_signed`] to get an `Option` instead. /// /// # Example /// @@ -1967,6 +2036,16 @@ impl Sub for NaiveDate { } } +/// Subtract-assign `chrono::Duration` from `NaiveDate`. +/// +/// This discards the fractional days in `Duration`, rounding to the closest integral number of days +/// towards `Duration::zero()`. +/// It is the same as the addition with a negated `Duration`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDate::checked_sub_signed`] to get an `Option` instead. impl SubAssign for NaiveDate { #[inline] fn sub_assign(&mut self, rhs: OldDuration) { @@ -2083,7 +2162,7 @@ impl DoubleEndedIterator for NaiveDateWeeksIterator { impl FusedIterator for NaiveDateWeeksIterator {} /// The `Debug` output of the naive date `d` is the same as -/// [`d.format("%Y-%m-%d")`](../format/strftime/index.html). +/// [`d.format("%Y-%m-%d")`](crate::format::strftime). /// /// The string printed can be readily parsed via the `parse` method on `str`. /// @@ -2126,7 +2205,7 @@ impl fmt::Debug for NaiveDate { } /// The `Display` output of the naive date `d` is the same as -/// [`d.format("%Y-%m-%d")`](../format/strftime/index.html). +/// [`d.format("%Y-%m-%d")`](crate::format::strftime). /// /// The string printed can be readily parsed via the `parse` method on `str`. /// @@ -2154,7 +2233,7 @@ impl fmt::Display for NaiveDate { } /// Parsing a `str` into a `NaiveDate` uses the same format, -/// [`%Y-%m-%d`](../format/strftime/index.html), as in `Debug` and `Display`. +/// [`%Y-%m-%d`](crate::format::strftime), as in `Debug` and `Display`. /// /// # Example /// @@ -2228,8 +2307,8 @@ where to_string(&NaiveDate::from_ymd_opt(-1, 12, 31).unwrap()).ok(), Some(r#""-0001-12-31""#.into()) ); - assert_eq!(to_string(&NaiveDate::MIN).ok(), Some(r#""-262144-01-01""#.into())); - assert_eq!(to_string(&NaiveDate::MAX).ok(), Some(r#""+262143-12-31""#.into())); + assert_eq!(to_string(&NaiveDate::MIN).ok(), Some(r#""-262143-01-01""#.into())); + assert_eq!(to_string(&NaiveDate::MAX).ok(), Some(r#""+262142-12-31""#.into())); } #[cfg(all(test, any(feature = "rustc-serialize", feature = "serde")))] @@ -2252,8 +2331,8 @@ where from_str(r#""-0001-12-31""#).ok(), Some(NaiveDate::from_ymd_opt(-1, 12, 31).unwrap()) ); - assert_eq!(from_str(r#""-262144-01-01""#).ok(), Some(NaiveDate::MIN)); - assert_eq!(from_str(r#""+262143-12-31""#).ok(), Some(NaiveDate::MAX)); + assert_eq!(from_str(r#""-262143-01-01""#).ok(), Some(NaiveDate::MIN)); + assert_eq!(from_str(r#""+262142-12-31""#).ok(), Some(NaiveDate::MAX)); // bad formats assert!(from_str(r#""""#).is_err()); @@ -2276,7 +2355,6 @@ where } #[cfg(feature = "rustc-serialize")] -#[cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] mod rustc_serialize { use super::NaiveDate; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; @@ -2311,7 +2389,6 @@ mod rustc_serialize { } #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod serde { use super::NaiveDate; use core::fmt; @@ -2397,6 +2474,7 @@ mod serde { mod tests { use super::{Days, Months, NaiveDate, MAX_YEAR, MIN_YEAR}; use crate::duration::Duration; + use crate::naive::internals::YearFlags; use crate::{Datelike, Weekday}; // as it is hard to verify year flags in `NaiveDate::MIN` and `NaiveDate::MAX`, @@ -2407,13 +2485,14 @@ mod tests { let calculated_max = NaiveDate::from_ymd_opt(MAX_YEAR, 12, 31).unwrap(); assert!( NaiveDate::MIN == calculated_min, - "`NaiveDate::MIN` should have a year flag {:?}", + "`NaiveDate::MIN` should have year flag {:?}", calculated_min.of().flags() ); assert!( NaiveDate::MAX == calculated_max, - "`NaiveDate::MAX` should have a year flag {:?}", - calculated_max.of().flags() + "`NaiveDate::MAX` should have year flag {:?} and ordinal {}", + calculated_max.of().flags(), + calculated_max.of().ordinal() ); // let's also check that the entire range do not exceed 2^44 seconds @@ -2425,6 +2504,14 @@ mod tests { "The entire `NaiveDate` range somehow exceeds 2^{} seconds", MAX_BITS ); + + const BEFORE_MIN: NaiveDate = NaiveDate::BEFORE_MIN; + assert_eq!(BEFORE_MIN.of().flags(), YearFlags::from_year(BEFORE_MIN.year())); + assert_eq!((BEFORE_MIN.month(), BEFORE_MIN.day()), (12, 31)); + + const AFTER_MAX: NaiveDate = NaiveDate::AFTER_MAX; + assert_eq!(AFTER_MAX.of().flags(), YearFlags::from_year(AFTER_MAX.year())); + assert_eq!((AFTER_MAX.month(), AFTER_MAX.day()), (1, 1)); } #[test] @@ -3107,9 +3194,12 @@ mod tests { #[test] fn test_day_iterator_limit() { - assert_eq!(NaiveDate::from_ymd_opt(262143, 12, 29).unwrap().iter_days().take(4).count(), 2); assert_eq!( - NaiveDate::from_ymd_opt(-262144, 1, 3).unwrap().iter_days().rev().take(4).count(), + NaiveDate::from_ymd_opt(MAX_YEAR, 12, 29).unwrap().iter_days().take(4).count(), + 2 + ); + assert_eq!( + NaiveDate::from_ymd_opt(MIN_YEAR, 1, 3).unwrap().iter_days().rev().take(4).count(), 2 ); } @@ -3117,11 +3207,11 @@ mod tests { #[test] fn test_week_iterator_limit() { assert_eq!( - NaiveDate::from_ymd_opt(262143, 12, 12).unwrap().iter_weeks().take(4).count(), + NaiveDate::from_ymd_opt(MAX_YEAR, 12, 12).unwrap().iter_weeks().take(4).count(), 2 ); assert_eq!( - NaiveDate::from_ymd_opt(-262144, 1, 15).unwrap().iter_weeks().rev().take(4).count(), + NaiveDate::from_ymd_opt(MIN_YEAR, 1, 15).unwrap().iter_weeks().rev().take(4).count(), 2 ); } @@ -3236,23 +3326,29 @@ mod tests { } } + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let date_min = NaiveDate::MIN; + let bytes = rkyv::to_bytes::<_, 4>(&date_min).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), date_min); + + let date_max = NaiveDate::MAX; + let bytes = rkyv::to_bytes::<_, 4>(&date_max).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), date_max); + } + // MAX_YEAR-12-31 minus 0000-01-01 - // = ((MAX_YEAR+1)-01-01 minus 0001-01-01) + (0001-01-01 minus 0000-01-01) - 1 day - // = ((MAX_YEAR+1)-01-01 minus 0001-01-01) + 365 days - // = MAX_YEAR * 365 + (# of leap years from 0001 to MAX_YEAR) + 365 days + // = (MAX_YEAR-12-31 minus 0000-12-31) + (0000-12-31 - 0000-01-01) + // = MAX_YEAR * 365 + (# of leap years from 0001 to MAX_YEAR) + 365 + // = (MAX_YEAR + 1) * 365 + (# of leap years from 0001 to MAX_YEAR) const MAX_DAYS_FROM_YEAR_0: i32 = - MAX_YEAR * 365 + MAX_YEAR / 4 - MAX_YEAR / 100 + MAX_YEAR / 400 + 365; + (MAX_YEAR + 1) * 365 + MAX_YEAR / 4 - MAX_YEAR / 100 + MAX_YEAR / 400; // MIN_YEAR-01-01 minus 0000-01-01 - // = (MIN_YEAR+400n+1)-01-01 minus (400n+1)-01-01 - // = ((MIN_YEAR+400n+1)-01-01 minus 0001-01-01) - ((400n+1)-01-01 minus 0001-01-01) - // = ((MIN_YEAR+400n+1)-01-01 minus 0001-01-01) - 146097n days - // - // n is set to 1000 for convenience. - const MIN_DAYS_FROM_YEAR_0: i32 = (MIN_YEAR + 400_000) * 365 + (MIN_YEAR + 400_000) / 4 - - (MIN_YEAR + 400_000) / 100 - + (MIN_YEAR + 400_000) / 400 - - 146_097_000; + // = MIN_YEAR * 365 + (# of leap years from MIN_YEAR to 0000) + const MIN_DAYS_FROM_YEAR_0: i32 = + MIN_YEAR * 365 + MIN_YEAR / 4 - MIN_YEAR / 100 + MIN_YEAR / 400; // only used for testing, but duplicated in naive::datetime const MAX_BITS: usize = 44; diff --git a/vendor/chrono/src/naive/datetime/mod.rs b/vendor/chrono/src/naive/datetime/mod.rs index cd41207ce..ece1c8009 100644 --- a/vendor/chrono/src/naive/datetime/mod.rs +++ b/vendor/chrono/src/naive/datetime/mod.rs @@ -3,25 +3,27 @@ //! ISO 8601 date and time without timezone. -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use core::borrow::Borrow; use core::fmt::Write; use core::ops::{Add, AddAssign, Sub, SubAssign}; use core::time::Duration; use core::{fmt, str}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; -use crate::duration::Duration as OldDuration; -#[cfg(any(feature = "alloc", feature = "std"))] +use crate::duration::{Duration as OldDuration, NANOS_PER_SEC}; +#[cfg(feature = "alloc")] use crate::format::DelayedFormat; use crate::format::{parse, parse_and_remainder, ParseError, ParseResult, Parsed, StrftimeItems}; use crate::format::{Fixed, Item, Numeric, Pad}; use crate::naive::{Days, IsoWeek, NaiveDate, NaiveTime}; use crate::offset::Utc; -use crate::{expect, DateTime, Datelike, LocalResult, Months, TimeZone, Timelike, Weekday}; - +use crate::{ + expect, try_opt, DateTime, Datelike, FixedOffset, LocalResult, Months, TimeZone, Timelike, + Weekday, +}; #[cfg(feature = "rustc-serialize")] pub(super) mod rustc_serialize; @@ -51,7 +53,7 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX; /// /// # Example /// -/// `NaiveDateTime` is commonly created from [`NaiveDate`](./struct.NaiveDate.html). +/// `NaiveDateTime` is commonly created from [`NaiveDate`]. /// /// ``` /// use chrono::{NaiveDate, NaiveDateTime}; @@ -60,8 +62,7 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX; /// # let _ = dt; /// ``` /// -/// You can use typical [date-like](../trait.Datelike.html) and -/// [time-like](../trait.Timelike.html) methods, +/// You can use typical [date-like](Datelike) and [time-like](Timelike) methods, /// provided that relevant traits are in the scope. /// /// ``` @@ -73,7 +74,13 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX; /// assert_eq!(dt.num_seconds_from_midnight(), 33011); /// ``` #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct NaiveDateTime { date: NaiveDate, @@ -107,8 +114,7 @@ impl NaiveDateTime { /// since the midnight UTC on January 1, 1970 (aka "UNIX timestamp") /// and the number of nanoseconds since the last whole non-leap second. /// - /// For a non-naive version of this function see - /// [`TimeZone::timestamp`](../offset/trait.TimeZone.html#method.timestamp). + /// For a non-naive version of this function see [`TimeZone::timestamp`]. /// /// The nanosecond part can exceed 1,000,000,000 in order to represent a /// [leap second](NaiveTime#leap-second-handling), but only when `secs % 60 == 59`. @@ -122,9 +128,9 @@ impl NaiveDateTime { #[deprecated(since = "0.4.23", note = "use `from_timestamp_opt()` instead")] #[inline] #[must_use] - pub fn from_timestamp(secs: i64, nsecs: u32) -> NaiveDateTime { + pub const fn from_timestamp(secs: i64, nsecs: u32) -> NaiveDateTime { let datetime = NaiveDateTime::from_timestamp_opt(secs, nsecs); - datetime.expect("invalid or out-of-range datetime") + expect!(datetime, "invalid or out-of-range datetime") } /// Creates a new [NaiveDateTime] from milliseconds since the UNIX epoch. @@ -153,7 +159,7 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn from_timestamp_millis(millis: i64) -> Option { + pub const fn from_timestamp_millis(millis: i64) -> Option { let secs = millis.div_euclid(1000); let nsecs = millis.rem_euclid(1000) as u32 * 1_000_000; NaiveDateTime::from_timestamp_opt(secs, nsecs) @@ -185,12 +191,45 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn from_timestamp_micros(micros: i64) -> Option { + pub const fn from_timestamp_micros(micros: i64) -> Option { let secs = micros.div_euclid(1_000_000); let nsecs = micros.rem_euclid(1_000_000) as u32 * 1000; NaiveDateTime::from_timestamp_opt(secs, nsecs) } + /// Creates a new [NaiveDateTime] from nanoseconds since the UNIX epoch. + /// + /// The UNIX epoch starts on midnight, January 1, 1970, UTC. + /// + /// # Errors + /// + /// Returns `None` if the number of nanoseconds would be out of range for a `NaiveDateTime` + /// (more than ca. 262,000 years away from common era) + /// + /// # Example + /// + /// ``` + /// use chrono::NaiveDateTime; + /// let timestamp_nanos: i64 = 1662921288_000_000_000; //Sunday, September 11, 2022 6:34:48 PM + /// let naive_datetime = NaiveDateTime::from_timestamp_nanos(timestamp_nanos); + /// assert!(naive_datetime.is_some()); + /// assert_eq!(timestamp_nanos, naive_datetime.unwrap().timestamp_nanos_opt().unwrap()); + /// + /// // Negative timestamps (before the UNIX epoch) are supported as well. + /// let timestamp_nanos: i64 = -2208936075_000_000_000; //Mon Jan 01 1900 14:38:45 GMT+0000 + /// let naive_datetime = NaiveDateTime::from_timestamp_nanos(timestamp_nanos); + /// assert!(naive_datetime.is_some()); + /// assert_eq!(timestamp_nanos, naive_datetime.unwrap().timestamp_nanos_opt().unwrap()); + /// ``` + #[inline] + #[must_use] + pub const fn from_timestamp_nanos(nanos: i64) -> Option { + let secs = nanos.div_euclid(NANOS_PER_SEC as i64); + let nsecs = nanos.rem_euclid(NANOS_PER_SEC as i64) as u32; + + NaiveDateTime::from_timestamp_opt(secs, nsecs) + } + /// Makes a new `NaiveDateTime` corresponding to a UTC date and time, /// from the number of non-leap seconds /// since the midnight UTC on January 1, 1970 (aka "UNIX timestamp") @@ -223,13 +262,14 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option { + pub const fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option { let days = secs.div_euclid(86_400); let secs = secs.rem_euclid(86_400); - let date = i32::try_from(days) - .ok() - .and_then(|days| days.checked_add(719_163)) - .and_then(NaiveDate::from_num_days_from_ce_opt); + if days < i32::MIN as i64 || days > i32::MAX as i64 { + return None; + } + let date = + NaiveDate::from_num_days_from_ce_opt(try_opt!((days as i32).checked_add(719_163))); let time = NaiveTime::from_num_seconds_from_midnight_opt(secs as u32, nsecs); match (date, time) { (Some(date), Some(time)) => Some(NaiveDateTime { date, time }), @@ -238,7 +278,7 @@ impl NaiveDateTime { } /// Parses a string with the specified format string and returns a new `NaiveDateTime`. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// # Example @@ -316,7 +356,7 @@ impl NaiveDateTime { /// Parses a string with the specified format string and returns a new `NaiveDateTime`, and a /// slice with the remaining portion of the string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// Similar to [`parse_from_str`](#method.parse_from_str). @@ -393,10 +433,10 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp(&self) -> i64 { + pub const fn timestamp(&self) -> i64 { const UNIX_EPOCH_DAY: i64 = 719_163; - let gregorian_day = i64::from(self.date.num_days_from_ce()); - let seconds_from_midnight = i64::from(self.time.num_seconds_from_midnight()); + let gregorian_day = self.date.num_days_from_ce() as i64; + let seconds_from_midnight = self.time.num_seconds_from_midnight() as i64; (gregorian_day - UNIX_EPOCH_DAY) * 86_400 + seconds_from_midnight } @@ -421,9 +461,9 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp_millis(&self) -> i64 { + pub const fn timestamp_millis(&self) -> i64 { let as_ms = self.timestamp() * 1000; - as_ms + i64::from(self.timestamp_subsec_millis()) + as_ms + self.timestamp_subsec_millis() as i64 } /// Returns the number of non-leap *microseconds* since midnight on January 1, 1970. @@ -444,9 +484,9 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp_micros(&self) -> i64 { + pub const fn timestamp_micros(&self) -> i64 { let as_us = self.timestamp() * 1_000_000; - as_us + i64::from(self.timestamp_subsec_micros()) + as_us + self.timestamp_subsec_micros() as i64 } /// Returns the number of non-leap *nanoseconds* since midnight on January 1, 1970. @@ -459,8 +499,8 @@ impl NaiveDateTime { /// An `i64` with nanosecond precision can span a range of ~584 years. This function panics on /// an out of range `NaiveDateTime`. /// - /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:44.0 and - /// 2262-04-11T23:47:16.854775804. + /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:43.145224192 + /// and 2262-04-11T23:47:16.854775807. #[deprecated(since = "0.4.31", note = "use `timestamp_nanos_opt()` instead")] #[inline] #[must_use] @@ -479,8 +519,8 @@ impl NaiveDateTime { /// An `i64` with nanosecond precision can span a range of ~584 years. This function returns /// `None` on an out of range `NaiveDateTime`. /// - /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:44.0 and - /// 2262-04-11T23:47:16.854775804. + /// The dates that can be represented as nanoseconds are between 1677-09-21T00:12:43.145224192 + /// and 2262-04-11T23:47:16.854775807. /// /// # Example /// @@ -543,7 +583,7 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp_subsec_millis(&self) -> u32 { + pub const fn timestamp_subsec_millis(&self) -> u32 { self.timestamp_subsec_nanos() / 1_000_000 } @@ -565,7 +605,7 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp_subsec_micros(&self) -> u32 { + pub const fn timestamp_subsec_micros(&self) -> u32 { self.timestamp_subsec_nanos() / 1_000 } @@ -587,7 +627,7 @@ impl NaiveDateTime { /// ``` #[inline] #[must_use] - pub fn timestamp_subsec_nanos(&self) -> u32 { + pub const fn timestamp_subsec_nanos(&self) -> u32 { self.time.nanosecond() } @@ -667,7 +707,7 @@ impl NaiveDateTime { return None; } - let date = self.date.checked_add_signed(OldDuration::seconds(rhs))?; + let date = try_opt!(self.date.checked_add_signed(OldDuration::seconds(rhs))); Some(NaiveDateTime { date, time }) } @@ -697,8 +737,55 @@ impl NaiveDateTime { /// ); /// ``` #[must_use] - pub fn checked_add_months(self, rhs: Months) -> Option { - Some(Self { date: self.date.checked_add_months(rhs)?, time: self.time }) + pub const fn checked_add_months(self, rhs: Months) -> Option { + Some(Self { date: try_opt!(self.date.checked_add_months(rhs)), time: self.time }) + } + + /// Adds given `FixedOffset` to the current datetime. + /// Returns `None` if the result would be outside the valid range for [`NaiveDateTime`]. + /// + /// This method is similar to [`checked_add_signed`](#method.checked_add_offset), but preserves + /// leap seconds. + #[must_use] + pub const fn checked_add_offset(self, rhs: FixedOffset) -> Option { + let (time, days) = self.time.overflowing_add_offset(rhs); + let date = match days { + -1 => try_opt!(self.date.pred_opt()), + 1 => try_opt!(self.date.succ_opt()), + _ => self.date, + }; + Some(NaiveDateTime { date, time }) + } + + /// Subtracts given `FixedOffset` from the current datetime. + /// Returns `None` if the result would be outside the valid range for [`NaiveDateTime`]. + /// + /// This method is similar to [`checked_sub_signed`](#method.checked_sub_signed), but preserves + /// leap seconds. + pub const fn checked_sub_offset(self, rhs: FixedOffset) -> Option { + let (time, days) = self.time.overflowing_sub_offset(rhs); + let date = match days { + -1 => try_opt!(self.date.pred_opt()), + 1 => try_opt!(self.date.succ_opt()), + _ => self.date, + }; + Some(NaiveDateTime { date, time }) + } + + /// Adds given `FixedOffset` to the current datetime. + /// The resulting value may be outside the valid range of [`NaiveDateTime`]. + /// + /// This can be useful for intermediate values, but the resulting out-of-range `NaiveDate` + /// should not be exposed to library users. + #[must_use] + pub(crate) fn overflowing_add_offset(self, rhs: FixedOffset) -> NaiveDateTime { + let (time, days) = self.time.overflowing_add_offset(rhs); + let date = match days { + -1 => self.date.pred_opt().unwrap_or(NaiveDate::BEFORE_MIN), + 1 => self.date.succ_opt().unwrap_or(NaiveDate::AFTER_MAX), + _ => self.date, + }; + NaiveDateTime { date, time } } /// Subtracts given `Duration` from the current date and time. @@ -803,24 +890,24 @@ impl NaiveDateTime { /// ); /// ``` #[must_use] - pub fn checked_sub_months(self, rhs: Months) -> Option { - Some(Self { date: self.date.checked_sub_months(rhs)?, time: self.time }) + pub const fn checked_sub_months(self, rhs: Months) -> Option { + Some(Self { date: try_opt!(self.date.checked_sub_months(rhs)), time: self.time }) } /// Add a duration in [`Days`] to the date part of the `NaiveDateTime` /// /// Returns `None` if the resulting date would be out of range. #[must_use] - pub fn checked_add_days(self, days: Days) -> Option { - Some(Self { date: self.date.checked_add_days(days)?, ..self }) + pub const fn checked_add_days(self, days: Days) -> Option { + Some(Self { date: try_opt!(self.date.checked_add_days(days)), ..self }) } /// Subtract a duration in [`Days`] from the date part of the `NaiveDateTime` /// /// Returns `None` if the resulting date would be out of range. #[must_use] - pub fn checked_sub_days(self, days: Days) -> Option { - Some(Self { date: self.date.checked_sub_days(days)?, ..self }) + pub const fn checked_sub_days(self, days: Days) -> Option { + Some(Self { date: try_opt!(self.date.checked_sub_days(days)), ..self }) } /// Subtracts another `NaiveDateTime` from the current date and time. @@ -893,8 +980,7 @@ impl NaiveDateTime { /// # let dt = NaiveDate::from_ymd_opt(2015, 9, 5).unwrap().and_hms_opt(23, 56, 4).unwrap(); /// assert_eq!(format!("{}", dt.format_with_items(fmt)), "2015-09-05 23:56:04"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -906,7 +992,7 @@ impl NaiveDateTime { } /// Formats the combined date and time with the specified format string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// This returns a `DelayedFormat`, @@ -937,8 +1023,7 @@ impl NaiveDateTime { /// assert_eq!(format!("{}", dt.format("%Y-%m-%d %H:%M:%S")), "2015-09-05 23:56:04"); /// assert_eq!(format!("{}", dt.format("around %l %p on %b %-d")), "around 11 PM on Sep 5"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -980,8 +1065,9 @@ impl NaiveDateTime { /// assert_eq!(dt.timezone(), Utc); /// ``` #[must_use] - pub fn and_utc(&self) -> DateTime { - Utc.from_utc_datetime(self) + pub const fn and_utc(&self) -> DateTime { + // FIXME: use `DateTime::from_naive_utc_and_offset` when our MSRV is 1.61+. + DateTime::from_naive_utc(*self) } /// The minimum possible `NaiveDateTime`. @@ -995,6 +1081,22 @@ impl NaiveDateTime { expect!(NaiveDate::from_ymd_opt(1970, 1, 1), "").and_time(NaiveTime::MIN); } +impl From for NaiveDateTime { + /// Converts a `NaiveDate` to a `NaiveDateTime` of the same date but at midnight. + /// + /// # Example + /// + /// ``` + /// use chrono::{NaiveDate, NaiveDateTime}; + /// + /// let nd = NaiveDate::from_ymd_opt(2016, 5, 28).unwrap(); + /// let ndt = NaiveDate::from_ymd_opt(2016, 5, 28).unwrap().and_hms_opt(0, 0, 0).unwrap(); + /// assert_eq!(ndt, NaiveDateTime::from(nd)); + fn from(date: NaiveDate) -> Self { + date.and_hms_opt(0, 0, 0).unwrap() + } +} + impl Datelike for NaiveDateTime { /// Returns the year number in the [calendar date](./struct.NaiveDate.html#calendar-date). /// @@ -1036,7 +1138,7 @@ impl Datelike for NaiveDateTime { /// /// The return value ranges from 0 to 11. /// - /// See also the [`NaiveDate::month0`](./struct.NaiveDate.html#method.month0) method. + /// See also the [`NaiveDate::month0`] method. /// /// # Example /// @@ -1074,7 +1176,7 @@ impl Datelike for NaiveDateTime { /// /// The return value ranges from 0 to 30. (The last day of month differs by months.) /// - /// See also the [`NaiveDate::day0`](./struct.NaiveDate.html#method.day0) method. + /// See also the [`NaiveDate::day0`] method. /// /// # Example /// @@ -1112,7 +1214,7 @@ impl Datelike for NaiveDateTime { /// /// The return value ranges from 0 to 365. (The last day of year differs by years.) /// - /// See also the [`NaiveDate::ordinal0`](./struct.NaiveDate.html#method.ordinal0) method. + /// See also the [`NaiveDate::ordinal0`] method. /// /// # Example /// @@ -1381,7 +1483,7 @@ impl Timelike for NaiveDateTime { /// The range from 1,000,000,000 to 1,999,999,999 represents /// the [leap second](./struct.NaiveTime.html#leap-second-handling). /// - /// See also the [`NaiveTime::nanosecond`] method. + /// See also the [`NaiveTime#method.nanosecond`] method. /// /// # Example /// @@ -1498,7 +1600,7 @@ impl Timelike for NaiveDateTime { } } -/// An addition of `Duration` to `NaiveDateTime` yields another `NaiveDateTime`. +/// Add `chrono::Duration` to `NaiveDateTime`. /// /// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap /// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case @@ -1506,8 +1608,8 @@ impl Timelike for NaiveDateTime { /// /// # Panics /// -/// Panics if the resulting date would be out of range. Use [`NaiveDateTime::checked_add_signed`] -/// to detect that. +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_add_signed`] to get an `Option` instead. /// /// # Example /// @@ -1559,6 +1661,16 @@ impl Add for NaiveDateTime { } } +/// Add `std::time::Duration` to `NaiveDateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_add_signed`] to get an `Option` instead. impl Add for NaiveDateTime { type Output = NaiveDateTime; @@ -1570,6 +1682,16 @@ impl Add for NaiveDateTime { } } +/// Add-assign `chrono::Duration` to `NaiveDateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_add_signed`] to get an `Option` instead. impl AddAssign for NaiveDateTime { #[inline] fn add_assign(&mut self, rhs: OldDuration) { @@ -1577,6 +1699,16 @@ impl AddAssign for NaiveDateTime { } } +/// Add-assign `std::time::Duration` to `NaiveDateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_add_signed`] to get an `Option` instead. impl AddAssign for NaiveDateTime { #[inline] fn add_assign(&mut self, rhs: Duration) { @@ -1584,59 +1716,81 @@ impl AddAssign for NaiveDateTime { } } -impl Add for NaiveDateTime { +/// Add `FixedOffset` to `NaiveDateTime`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `checked_add_offset` to get an `Option` instead. +impl Add for NaiveDateTime { type Output = NaiveDateTime; - /// An addition of months to `NaiveDateTime` clamped to valid days in resulting month. - /// - /// # Panics - /// - /// Panics if the resulting date would be out of range. - /// - /// # Example - /// - /// ``` - /// use chrono::{Months, NaiveDate}; - /// - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(1, 0, 0).unwrap() + Months::new(1), - /// NaiveDate::from_ymd_opt(2014, 2, 1).unwrap().and_hms_opt(1, 0, 0).unwrap() - /// ); - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 2, 0).unwrap() + Months::new(11), - /// NaiveDate::from_ymd_opt(2014, 12, 1).unwrap().and_hms_opt(0, 2, 0).unwrap() - /// ); - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 0, 3).unwrap() + Months::new(12), - /// NaiveDate::from_ymd_opt(2015, 1, 1).unwrap().and_hms_opt(0, 0, 3).unwrap() - /// ); - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 0, 4).unwrap() + Months::new(13), - /// NaiveDate::from_ymd_opt(2015, 2, 1).unwrap().and_hms_opt(0, 0, 4).unwrap() - /// ); - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2014, 1, 31).unwrap().and_hms_opt(0, 5, 0).unwrap() + Months::new(1), - /// NaiveDate::from_ymd_opt(2014, 2, 28).unwrap().and_hms_opt(0, 5, 0).unwrap() - /// ); - /// assert_eq!( - /// NaiveDate::from_ymd_opt(2020, 1, 31).unwrap().and_hms_opt(6, 0, 0).unwrap() + Months::new(1), - /// NaiveDate::from_ymd_opt(2020, 2, 29).unwrap().and_hms_opt(6, 0, 0).unwrap() - /// ); - /// ``` - fn add(self, rhs: Months) -> Self::Output { - Self { date: self.date.checked_add_months(rhs).unwrap(), time: self.time } + #[inline] + fn add(self, rhs: FixedOffset) -> NaiveDateTime { + self.checked_add_offset(rhs).expect("`NaiveDateTime + FixedOffset` out of range") } } -/// A subtraction of `Duration` from `NaiveDateTime` yields another `NaiveDateTime`. -/// It is the same as the addition with a negated `Duration`. +/// Add `Months` to `NaiveDateTime`. +/// +/// The result will be clamped to valid days in the resulting month, see `checked_add_months` for +/// details. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `checked_add_months` to get an `Option` instead. +/// +/// # Example +/// +/// ``` +/// use chrono::{Months, NaiveDate}; +/// +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(1, 0, 0).unwrap() + Months::new(1), +/// NaiveDate::from_ymd_opt(2014, 2, 1).unwrap().and_hms_opt(1, 0, 0).unwrap() +/// ); +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 2, 0).unwrap() + Months::new(11), +/// NaiveDate::from_ymd_opt(2014, 12, 1).unwrap().and_hms_opt(0, 2, 0).unwrap() +/// ); +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 0, 3).unwrap() + Months::new(12), +/// NaiveDate::from_ymd_opt(2015, 1, 1).unwrap().and_hms_opt(0, 0, 3).unwrap() +/// ); +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2014, 1, 1).unwrap().and_hms_opt(0, 0, 4).unwrap() + Months::new(13), +/// NaiveDate::from_ymd_opt(2015, 2, 1).unwrap().and_hms_opt(0, 0, 4).unwrap() +/// ); +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2014, 1, 31).unwrap().and_hms_opt(0, 5, 0).unwrap() + Months::new(1), +/// NaiveDate::from_ymd_opt(2014, 2, 28).unwrap().and_hms_opt(0, 5, 0).unwrap() +/// ); +/// assert_eq!( +/// NaiveDate::from_ymd_opt(2020, 1, 31).unwrap().and_hms_opt(6, 0, 0).unwrap() + Months::new(1), +/// NaiveDate::from_ymd_opt(2020, 2, 29).unwrap().and_hms_opt(6, 0, 0).unwrap() +/// ); +/// ``` +impl Add for NaiveDateTime { + type Output = NaiveDateTime; + + fn add(self, rhs: Months) -> Self::Output { + self.checked_add_months(rhs).expect("`NaiveDateTime + Months` out of range") + } +} + +/// Subtract `chrono::Duration` from `NaiveDateTime`. +/// +/// This is the same as the addition with a negated `Duration`. /// /// As a part of Chrono's [leap second handling] the subtraction assumes that **there is no leap /// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case /// the assumption becomes that **there is exactly a single leap second ever**. /// -/// Panics on underflow or overflow. Use [`NaiveDateTime::checked_sub_signed`] -/// to detect that. +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_sub_signed`] to get an `Option` instead. /// /// # Example /// @@ -1686,6 +1840,16 @@ impl Sub for NaiveDateTime { } } +/// Subtract `std::time::Duration` from `NaiveDateTime`. +/// +/// As a part of Chrono's [leap second handling] the subtraction assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_sub_signed`] to get an `Option` instead. impl Sub for NaiveDateTime { type Output = NaiveDateTime; @@ -1697,6 +1861,18 @@ impl Sub for NaiveDateTime { } } +/// Subtract-assign `chrono::Duration` from `NaiveDateTime`. +/// +/// This is the same as the addition with a negated `Duration`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_sub_signed`] to get an `Option` instead. impl SubAssign for NaiveDateTime { #[inline] fn sub_assign(&mut self, rhs: OldDuration) { @@ -1704,6 +1880,16 @@ impl SubAssign for NaiveDateTime { } } +/// Subtract-assign `std::time::Duration` from `NaiveDateTime`. +/// +/// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap +/// second ever**, except when the `NaiveDateTime` itself represents a leap second in which case +/// the assumption becomes that **there is exactly a single leap second ever**. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_sub_signed`] to get an `Option` instead. impl SubAssign for NaiveDateTime { #[inline] fn sub_assign(&mut self, rhs: Duration) { @@ -1711,11 +1897,30 @@ impl SubAssign for NaiveDateTime { } } -/// A subtraction of Months from `NaiveDateTime` clamped to valid days in resulting month. +/// Subtract `FixedOffset` from `NaiveDateTime`. /// /// # Panics /// /// Panics if the resulting date would be out of range. +/// Consider using `checked_sub_offset` to get an `Option` instead. +impl Sub for NaiveDateTime { + type Output = NaiveDateTime; + + #[inline] + fn sub(self, rhs: FixedOffset) -> NaiveDateTime { + self.checked_sub_offset(rhs).expect("`NaiveDateTime - FixedOffset` out of range") + } +} + +/// Subtract `Months` from `NaiveDateTime`. +/// +/// The result will be clamped to valid days in the resulting month, see +/// [`NaiveDateTime::checked_sub_months`] for details. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using [`NaiveDateTime::checked_sub_months`] to get an `Option` instead. /// /// # Example /// @@ -1739,7 +1944,7 @@ impl Sub for NaiveDateTime { type Output = NaiveDateTime; fn sub(self, rhs: Months) -> Self::Output { - Self { date: self.date.checked_sub_months(rhs).unwrap(), time: self.time } + self.checked_sub_months(rhs).expect("`NaiveDateTime - Months` out of range") } } @@ -1791,19 +1996,31 @@ impl Sub for NaiveDateTime { } } +/// Add `Days` to `NaiveDateTime`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `checked_add_days` to get an `Option` instead. impl Add for NaiveDateTime { type Output = NaiveDateTime; fn add(self, days: Days) -> Self::Output { - self.checked_add_days(days).unwrap() + self.checked_add_days(days).expect("`NaiveDateTime + Days` out of range") } } +/// Subtract `Days` from `NaiveDateTime`. +/// +/// # Panics +/// +/// Panics if the resulting date would be out of range. +/// Consider using `checked_sub_days` to get an `Option` instead. impl Sub for NaiveDateTime { type Output = NaiveDateTime; fn sub(self, days: Days) -> Self::Output { - self.checked_sub_days(days).unwrap() + self.checked_sub_days(days).expect("`NaiveDateTime - Days` out of range") } } @@ -1973,11 +2190,11 @@ where ); assert_eq!( to_string(&NaiveDate::MIN.and_hms_opt(0, 0, 0).unwrap()).ok(), - Some(r#""-262144-01-01T00:00:00""#.into()) + Some(r#""-262143-01-01T00:00:00""#.into()) ); assert_eq!( to_string(&NaiveDate::MAX.and_hms_nano_opt(23, 59, 59, 1_999_999_999).unwrap()).ok(), - Some(r#""+262143-12-31T23:59:60.999999999""#.into()) + Some(r#""+262142-12-31T23:59:60.999999999""#.into()) ); } @@ -2016,15 +2233,15 @@ where Some(NaiveDate::from_ymd_opt(-1, 12, 31).unwrap().and_hms_nano_opt(23, 59, 59, 7).unwrap()) ); assert_eq!( - from_str(r#""-262144-01-01T00:00:00""#).ok(), + from_str(r#""-262143-01-01T00:00:00""#).ok(), Some(NaiveDate::MIN.and_hms_opt(0, 0, 0).unwrap()) ); assert_eq!( - from_str(r#""+262143-12-31T23:59:60.999999999""#).ok(), + from_str(r#""+262142-12-31T23:59:60.999999999""#).ok(), Some(NaiveDate::MAX.and_hms_nano_opt(23, 59, 59, 1_999_999_999).unwrap()) ); assert_eq!( - from_str(r#""+262143-12-31T23:59:60.9999999999997""#).ok(), // excess digits are ignored + from_str(r#""+262142-12-31T23:59:60.9999999999997""#).ok(), // excess digits are ignored Some(NaiveDate::MAX.and_hms_nano_opt(23, 59, 59, 1_999_999_999).unwrap()) ); diff --git a/vendor/chrono/src/naive/datetime/rustc_serialize.rs b/vendor/chrono/src/naive/datetime/rustc_serialize.rs index 201fe7aa2..d2b8a8711 100644 --- a/vendor/chrono/src/naive/datetime/rustc_serialize.rs +++ b/vendor/chrono/src/naive/datetime/rustc_serialize.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - use super::NaiveDateTime; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use std::ops::Deref; diff --git a/vendor/chrono/src/naive/datetime/serde.rs b/vendor/chrono/src/naive/datetime/serde.rs index 86d8b20f4..0a6cfd915 100644 --- a/vendor/chrono/src/naive/datetime/serde.rs +++ b/vendor/chrono/src/naive/datetime/serde.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use core::fmt; use serde::{de, ser}; diff --git a/vendor/chrono/src/naive/datetime/tests.rs b/vendor/chrono/src/naive/datetime/tests.rs index 39187de67..6375a9d35 100644 --- a/vendor/chrono/src/naive/datetime/tests.rs +++ b/vendor/chrono/src/naive/datetime/tests.rs @@ -1,7 +1,6 @@ use super::NaiveDateTime; use crate::duration::Duration as OldDuration; -use crate::NaiveDate; -use crate::{Datelike, FixedOffset, Utc}; +use crate::{Datelike, FixedOffset, LocalResult, NaiveDate, Utc}; #[test] fn test_datetime_from_timestamp_millis() { @@ -19,7 +18,7 @@ fn test_datetime_from_timestamp_millis() { for (timestamp_millis, _formatted) in valid_map.iter().copied() { let naive_datetime = NaiveDateTime::from_timestamp_millis(timestamp_millis); assert_eq!(timestamp_millis, naive_datetime.unwrap().timestamp_millis()); - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").to_string(), _formatted); } @@ -57,7 +56,7 @@ fn test_datetime_from_timestamp_micros() { for (timestamp_micros, _formatted) in valid_map.iter().copied() { let naive_datetime = NaiveDateTime::from_timestamp_micros(timestamp_micros); assert_eq!(timestamp_micros, naive_datetime.unwrap().timestamp_micros()); - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] assert_eq!(naive_datetime.unwrap().format("%F %T%.9f").to_string(), _formatted); } @@ -79,6 +78,57 @@ fn test_datetime_from_timestamp_micros() { } } +#[test] +fn test_datetime_from_timestamp_nanos() { + let valid_map = [ + (1662921288000000000, "2022-09-11 18:34:48.000000000"), + (1662921288123456000, "2022-09-11 18:34:48.123456000"), + (1662921288123456789, "2022-09-11 18:34:48.123456789"), + (1662921287890000000, "2022-09-11 18:34:47.890000000"), + (-2208936075000000000, "1900-01-01 14:38:45.000000000"), + (-5337182663000000000, "1800-11-15 01:15:37.000000000"), + (0, "1970-01-01 00:00:00.000000000"), + (119731017000000000, "1973-10-17 18:36:57.000000000"), + (1234567890000000000, "2009-02-13 23:31:30.000000000"), + (2034061609000000000, "2034-06-16 09:06:49.000000000"), + ]; + + for (timestamp_nanos, _formatted) in valid_map.iter().copied() { + let naive_datetime = NaiveDateTime::from_timestamp_nanos(timestamp_nanos).unwrap(); + assert_eq!(timestamp_nanos, naive_datetime.timestamp_nanos_opt().unwrap()); + #[cfg(feature = "alloc")] + assert_eq!(naive_datetime.format("%F %T%.9f").to_string(), _formatted); + } + + const A_BILLION: i64 = 1_000_000_000; + // Maximum datetime in nanoseconds + let maximum = "2262-04-11T23:47:16.854775804"; + let parsed: NaiveDateTime = maximum.parse().unwrap(); + let nanos = parsed.timestamp_nanos_opt().unwrap(); + assert_eq!( + NaiveDateTime::from_timestamp_nanos(nanos).unwrap(), + NaiveDateTime::from_timestamp_opt(nanos / A_BILLION, (nanos % A_BILLION) as u32).unwrap() + ); + // Minimum datetime in nanoseconds + let minimum = "1677-09-21T00:12:44.000000000"; + let parsed: NaiveDateTime = minimum.parse().unwrap(); + let nanos = parsed.timestamp_nanos_opt().unwrap(); + assert_eq!( + NaiveDateTime::from_timestamp_nanos(nanos).unwrap(), + NaiveDateTime::from_timestamp_opt(nanos / A_BILLION, (nanos % A_BILLION) as u32).unwrap() + ); + + // Test that the result of `from_timestamp_nanos` compares equal to + // that of `from_timestamp_opt`. + let secs_test = [0, 1, 2, 1000, 1234, 12345678, -1, -2, -1000, -12345678]; + for secs in secs_test.iter().copied() { + assert_eq!( + NaiveDateTime::from_timestamp_nanos(secs * 1_000_000_000), + NaiveDateTime::from_timestamp_opt(secs, 0) + ); + } +} + #[test] fn test_datetime_from_timestamp() { let from_timestamp = |secs| NaiveDateTime::from_timestamp_opt(secs, 0); @@ -433,3 +483,119 @@ fn test_and_utc() { assert_eq!(dt_utc.naive_local(), ndt); assert_eq!(dt_utc.timezone(), Utc); } + +#[test] +fn test_checked_add_offset() { + let ymdhmsm = |y, m, d, h, mn, s, mi| { + NaiveDate::from_ymd_opt(y, m, d).unwrap().and_hms_milli_opt(h, mn, s, mi) + }; + + let positive_offset = FixedOffset::east_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0).unwrap(); + assert_eq!(dt.checked_add_offset(positive_offset), ymdhmsm(2023, 5, 5, 22, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000).unwrap(); + assert_eq!(dt.checked_add_offset(positive_offset), ymdhmsm(2023, 7, 1, 1, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MAX.checked_add_offset(positive_offset).is_none()); + + let negative_offset = FixedOffset::west_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0).unwrap(); + assert_eq!(dt.checked_add_offset(negative_offset), ymdhmsm(2023, 5, 5, 18, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000).unwrap(); + assert_eq!(dt.checked_add_offset(negative_offset), ymdhmsm(2023, 6, 30, 21, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MIN.checked_add_offset(negative_offset).is_none()); +} + +#[test] +fn test_checked_sub_offset() { + let ymdhmsm = |y, m, d, h, mn, s, mi| { + NaiveDate::from_ymd_opt(y, m, d).unwrap().and_hms_milli_opt(h, mn, s, mi) + }; + + let positive_offset = FixedOffset::east_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0).unwrap(); + assert_eq!(dt.checked_sub_offset(positive_offset), ymdhmsm(2023, 5, 5, 18, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000).unwrap(); + assert_eq!(dt.checked_sub_offset(positive_offset), ymdhmsm(2023, 6, 30, 21, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MIN.checked_sub_offset(positive_offset).is_none()); + + let negative_offset = FixedOffset::west_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0).unwrap(); + assert_eq!(dt.checked_sub_offset(negative_offset), ymdhmsm(2023, 5, 5, 22, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000).unwrap(); + assert_eq!(dt.checked_sub_offset(negative_offset), ymdhmsm(2023, 7, 1, 1, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MAX.checked_sub_offset(negative_offset).is_none()); + + assert_eq!(dt.checked_add_offset(positive_offset), Some(dt + positive_offset)); + assert_eq!(dt.checked_sub_offset(positive_offset), Some(dt - positive_offset)); +} + +#[test] +fn test_overflowing_add_offset() { + let ymdhmsm = |y, m, d, h, mn, s, mi| { + NaiveDate::from_ymd_opt(y, m, d).unwrap().and_hms_milli_opt(h, mn, s, mi).unwrap() + }; + let positive_offset = FixedOffset::east_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0); + assert_eq!(dt.overflowing_add_offset(positive_offset), ymdhmsm(2023, 5, 5, 22, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000); + assert_eq!(dt.overflowing_add_offset(positive_offset), ymdhmsm(2023, 7, 1, 1, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MAX.overflowing_add_offset(positive_offset) > NaiveDateTime::MAX); + + let negative_offset = FixedOffset::west_opt(2 * 60 * 60).unwrap(); + // regular date + let dt = ymdhmsm(2023, 5, 5, 20, 10, 0, 0); + assert_eq!(dt.overflowing_add_offset(negative_offset), ymdhmsm(2023, 5, 5, 18, 10, 0, 0)); + // leap second is preserved + let dt = ymdhmsm(2023, 6, 30, 23, 59, 59, 1_000); + assert_eq!(dt.overflowing_add_offset(negative_offset), ymdhmsm(2023, 6, 30, 21, 59, 59, 1_000)); + // out of range + assert!(NaiveDateTime::MIN.overflowing_add_offset(negative_offset) < NaiveDateTime::MIN); +} + +#[test] +fn test_and_timezone_min_max_dates() { + for offset_hour in -23..=23 { + dbg!(offset_hour); + let offset = FixedOffset::east_opt(offset_hour * 60 * 60).unwrap(); + + let local_max = NaiveDateTime::MAX.and_local_timezone(offset); + if offset_hour >= 0 { + assert_eq!(local_max.unwrap().naive_local(), NaiveDateTime::MAX); + } else { + assert_eq!(local_max, LocalResult::None); + } + let local_min = NaiveDateTime::MIN.and_local_timezone(offset); + if offset_hour <= 0 { + assert_eq!(local_min.unwrap().naive_local(), NaiveDateTime::MIN); + } else { + assert_eq!(local_min, LocalResult::None); + } + } +} + +#[test] +#[cfg(feature = "rkyv-validation")] +fn test_rkyv_validation() { + let dt_min = NaiveDateTime::MIN; + let bytes = rkyv::to_bytes::<_, 12>(&dt_min).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), dt_min); + + let dt_max = NaiveDateTime::MAX; + let bytes = rkyv::to_bytes::<_, 12>(&dt_max).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), dt_max); +} diff --git a/vendor/chrono/src/naive/internals.rs b/vendor/chrono/src/naive/internals.rs index 910419f38..c6d7536a0 100644 --- a/vendor/chrono/src/naive/internals.rs +++ b/vendor/chrono/src/naive/internals.rs @@ -21,8 +21,15 @@ use core::fmt; /// The internal date representation: `year << 13 | Of` pub(super) type DateImpl = i32; -pub(super) const MAX_YEAR: DateImpl = i32::MAX >> 13; -pub(super) const MIN_YEAR: DateImpl = i32::MIN >> 13; +/// MAX_YEAR is one year less than the type is capable of representing. Internally we may sometimes +/// use the headroom, notably to handle cases where the offset of a `DateTime` constructed with +/// `NaiveDate::MAX` pushes it beyond the valid, representable range. +pub(super) const MAX_YEAR: DateImpl = (i32::MAX >> 13) - 1; + +/// MIN_YEAR is one year more than the type is capable of representing. Internally we may sometimes +/// use the headroom, notably to handle cases where the offset of a `DateTime` constructed with +/// `NaiveDate::MIN` pushes it beyond the valid, representable range. +pub(super) const MIN_YEAR: DateImpl = (i32::MIN >> 13) + 1; /// The year flags (aka the dominical letter). /// diff --git a/vendor/chrono/src/naive/isoweek.rs b/vendor/chrono/src/naive/isoweek.rs index 8edf738ba..4b3d8d9d8 100644 --- a/vendor/chrono/src/naive/isoweek.rs +++ b/vendor/chrono/src/naive/isoweek.rs @@ -7,7 +7,7 @@ use core::fmt; use super::internals::{DateImpl, Of, YearFlags}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; /// ISO 8601 week. @@ -17,7 +17,13 @@ use rkyv::{Archive, Deserialize, Serialize}; /// One can retrieve this type from the existing [`Datelike`](../trait.Datelike.html) types /// via the [`Datelike::iso_week`](../trait.Datelike.html#tymethod.iso_week) method. #[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct IsoWeek { // note that this allows for larger year range than `NaiveDate`. // this is crucial because we have an edge case for the first and last week supported, @@ -147,6 +153,8 @@ impl fmt::Debug for IsoWeek { #[cfg(test)] mod tests { + #[cfg(feature = "rkyv-validation")] + use super::IsoWeek; use crate::naive::{internals, NaiveDate}; use crate::Datelike; @@ -158,13 +166,13 @@ mod tests { assert_eq!(minweek.year(), internals::MIN_YEAR); assert_eq!(minweek.week(), 1); assert_eq!(minweek.week0(), 0); - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] assert_eq!(format!("{:?}", minweek), NaiveDate::MIN.format("%G-W%V").to_string()); assert_eq!(maxweek.year(), internals::MAX_YEAR + 1); assert_eq!(maxweek.week(), 1); assert_eq!(maxweek.week0(), 0); - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] assert_eq!(format!("{:?}", maxweek), NaiveDate::MAX.format("%G-W%V").to_string()); } @@ -201,4 +209,16 @@ mod tests { assert!(monday.iso_week() >= friday.iso_week()); assert!(monday.iso_week() <= friday.iso_week()); } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let minweek = NaiveDate::MIN.iso_week(); + let bytes = rkyv::to_bytes::<_, 4>(&minweek).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), minweek); + + let maxweek = NaiveDate::MAX.iso_week(); + let bytes = rkyv::to_bytes::<_, 4>(&maxweek).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), maxweek); + } } diff --git a/vendor/chrono/src/naive/mod.rs b/vendor/chrono/src/naive/mod.rs index d3d69196f..c8c281b00 100644 --- a/vendor/chrono/src/naive/mod.rs +++ b/vendor/chrono/src/naive/mod.rs @@ -4,11 +4,11 @@ //! (e.g. [`TimeZone`](../offset/trait.TimeZone.html)), //! but can be also used for the simpler date and time handling. -mod date; +pub(crate) mod date; pub(crate) mod datetime; mod internals; -mod isoweek; -mod time; +pub(crate) mod isoweek; +pub(crate) mod time; pub use self::date::{Days, NaiveDate, NaiveDateDaysIterator, NaiveDateWeeksIterator, NaiveWeek}; #[allow(deprecated)] @@ -34,7 +34,6 @@ pub use self::internals::YearFlags as __BenchYearFlags; /// [1]: https://serde.rs/attributes.html#field-attributes /// [2]: https://tools.ietf.org/html/rfc3339 #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] pub mod serde { pub use super::datetime::serde::*; } diff --git a/vendor/chrono/src/naive/time/mod.rs b/vendor/chrono/src/naive/time/mod.rs index da35a4964..94aee9916 100644 --- a/vendor/chrono/src/naive/time/mod.rs +++ b/vendor/chrono/src/naive/time/mod.rs @@ -3,24 +3,24 @@ //! ISO 8601 time without timezone. -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use core::borrow::Borrow; use core::ops::{Add, AddAssign, Sub, SubAssign}; use core::time::Duration; use core::{fmt, str}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use crate::duration::Duration as OldDuration; -#[cfg(any(feature = "alloc", feature = "std"))] +#[cfg(feature = "alloc")] use crate::format::DelayedFormat; use crate::format::{ parse, parse_and_remainder, write_hundreds, Fixed, Item, Numeric, Pad, ParseError, ParseResult, Parsed, StrftimeItems, }; -use crate::Timelike; use crate::{expect, try_opt}; +use crate::{FixedOffset, Timelike}; #[cfg(feature = "rustc-serialize")] mod rustc_serialize; @@ -203,7 +203,13 @@ mod tests; /// Since Chrono alone cannot determine any existence of leap seconds, /// **there is absolutely no guarantee that the leap second read has actually happened**. #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq, PartialOrd)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct NaiveTime { secs: u32, frac: u32, @@ -470,7 +476,7 @@ impl NaiveTime { } /// Parses a string with the specified format string and returns a new `NaiveTime`. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// # Example @@ -538,7 +544,7 @@ impl NaiveTime { /// Parses a string from a user-specified format into a new `NaiveTime` value, and a slice with /// the remaining portion of the string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// Similar to [`parse_from_str`](#method.parse_from_str). @@ -586,11 +592,11 @@ impl NaiveTime { if frac >= 1_000_000_000 { let rfrac = 2_000_000_000 - frac; if rhs >= OldDuration::nanoseconds(i64::from(rfrac)) { - rhs = rhs - OldDuration::nanoseconds(i64::from(rfrac)); + rhs -= OldDuration::nanoseconds(i64::from(rfrac)); secs += 1; frac = 0; } else if rhs < OldDuration::nanoseconds(-i64::from(frac)) { - rhs = rhs + OldDuration::nanoseconds(i64::from(frac)); + rhs += OldDuration::nanoseconds(i64::from(frac)); frac = 0; } else { frac = (i64::from(frac) + rhs.num_nanoseconds().unwrap()) as u32; @@ -750,6 +756,32 @@ impl NaiveTime { OldDuration::seconds(secs + adjust) + OldDuration::nanoseconds(frac) } + /// Adds given `FixedOffset` to the current time, and returns the number of days that should be + /// added to a date as a result of the offset (either `-1`, `0`, or `1` because the offset is + /// always less than 24h). + /// + /// This method is similar to [`overflowing_add_signed`](#method.overflowing_add_signed), but + /// preserves leap seconds. + pub(super) const fn overflowing_add_offset(&self, offset: FixedOffset) -> (NaiveTime, i32) { + let secs = self.secs as i32 + offset.local_minus_utc(); + let days = secs.div_euclid(86_400); + let secs = secs.rem_euclid(86_400); + (NaiveTime { secs: secs as u32, frac: self.frac }, days) + } + + /// Subtracts given `FixedOffset` from the current time, and returns the number of days that + /// should be added to a date as a result of the offset (either `-1`, `0`, or `1` because the + /// offset is always less than 24h). + /// + /// This method is similar to [`overflowing_sub_signed`](#method.overflowing_sub_signed), but + /// preserves leap seconds. + pub(super) const fn overflowing_sub_offset(&self, offset: FixedOffset) -> (NaiveTime, i32) { + let secs = self.secs as i32 - offset.local_minus_utc(); + let days = secs.div_euclid(86_400); + let secs = secs.rem_euclid(86_400); + (NaiveTime { secs: secs as u32, frac: self.frac }, days) + } + /// Formats the time with the specified formatting items. /// Otherwise it is the same as the ordinary [`format`](#method.format) method. /// @@ -777,8 +809,7 @@ impl NaiveTime { /// # let t = NaiveTime::from_hms_opt(23, 56, 4).unwrap(); /// assert_eq!(format!("{}", t.format_with_items(fmt)), "23:56:04"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -790,7 +821,7 @@ impl NaiveTime { } /// Formats the time with the specified format string. - /// See the [`format::strftime` module](../format/strftime/index.html) + /// See the [`format::strftime` module](crate::format::strftime) /// on the supported escape sequences. /// /// This returns a `DelayedFormat`, @@ -823,8 +854,7 @@ impl NaiveTime { /// assert_eq!(format!("{}", t.format("%H:%M:%S%.6f")), "23:56:04.012345"); /// assert_eq!(format!("{}", t.format("%-I:%M %p")), "11:56 PM"); /// ``` - #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] + #[cfg(feature = "alloc")] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -840,6 +870,21 @@ impl NaiveTime { (hour, min, sec) } + /// Returns the number of non-leap seconds past the last midnight. + // This duplicates `Timelike::num_seconds_from_midnight()`, because trait methods can't be const + // yet. + #[inline] + pub(crate) const fn num_seconds_from_midnight(&self) -> u32 { + self.secs + } + + /// Returns the number of nanoseconds since the whole non-leap second. + // This duplicates `Timelike::nanosecond()`, because trait methods can't be const yet. + #[inline] + pub(crate) const fn nanosecond(&self) -> u32 { + self.frac + } + /// The earliest possible `NaiveTime` pub const MIN: Self = Self { secs: 0, frac: 0 }; pub(super) const MAX: Self = Self { secs: 23 * 3600 + 59 * 60 + 59, frac: 999_999_999 }; @@ -1066,7 +1111,9 @@ impl Timelike for NaiveTime { } } -/// An addition of `Duration` to `NaiveTime` wraps around and never overflows or underflows. +/// Add `chrono::Duration` to `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. /// In particular the addition ignores integral number of days. /// /// As a part of Chrono's [leap second handling], the addition assumes that **there is no leap @@ -1125,6 +1172,10 @@ impl Add for NaiveTime { } } +/// Add-assign `chrono::Duration` to `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the addition ignores integral number of days. impl AddAssign for NaiveTime { #[inline] fn add_assign(&mut self, rhs: OldDuration) { @@ -1132,29 +1183,53 @@ impl AddAssign for NaiveTime { } } +/// Add `std::time::Duration` to `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the addition ignores integral number of days. impl Add for NaiveTime { type Output = NaiveTime; #[inline] fn add(self, rhs: Duration) -> NaiveTime { - let rhs = OldDuration::from_std(rhs) - .expect("overflow converting from core::time::Duration to chrono::Duration"); - self.overflowing_add_signed(rhs).0 + // We don't care about values beyond `24 * 60 * 60`, so we can take a modulus and avoid + // overflow during the conversion to `chrono::Duration`. + // But we limit to double that just in case `self` is a leap-second. + let secs = rhs.as_secs() % (2 * 24 * 60 * 60); + let d = OldDuration::from_std(Duration::new(secs, rhs.subsec_nanos())).unwrap(); + self.overflowing_add_signed(d).0 } } +/// Add-assign `std::time::Duration` to `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the addition ignores integral number of days. impl AddAssign for NaiveTime { #[inline] fn add_assign(&mut self, rhs: Duration) { - let rhs = OldDuration::from_std(rhs) - .expect("overflow converting from core::time::Duration to chrono::Duration"); - *self += rhs; + *self = *self + rhs; } } -/// A subtraction of `Duration` from `NaiveTime` wraps around and never overflows or underflows. +/// Add `FixedOffset` to `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. /// In particular the addition ignores integral number of days. -/// It is the same as the addition with a negated `Duration`. +impl Add for NaiveTime { + type Output = NaiveTime; + + #[inline] + fn add(self, rhs: FixedOffset) -> NaiveTime { + self.overflowing_add_offset(rhs).0 + } +} + +/// Subtract `chrono::Duration` from `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the subtraction ignores integral number of days. +/// This is the same as addition with a negated `Duration`. /// /// As a part of Chrono's [leap second handling], the subtraction assumes that **there is no leap /// second ever**, except when the `NaiveTime` itself represents a leap second in which case the @@ -1207,6 +1282,10 @@ impl Sub for NaiveTime { } } +/// Subtract-assign `chrono::Duration` from `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the subtraction ignores integral number of days. impl SubAssign for NaiveTime { #[inline] fn sub_assign(&mut self, rhs: OldDuration) { @@ -1214,23 +1293,45 @@ impl SubAssign for NaiveTime { } } +/// Subtract `std::time::Duration` from `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the subtraction ignores integral number of days. impl Sub for NaiveTime { type Output = NaiveTime; #[inline] fn sub(self, rhs: Duration) -> NaiveTime { - let rhs = OldDuration::from_std(rhs) - .expect("overflow converting from core::time::Duration to chrono::Duration"); - self.overflowing_sub_signed(rhs).0 + // We don't care about values beyond `24 * 60 * 60`, so we can take a modulus and avoid + // overflow during the conversion to `chrono::Duration`. + // But we limit to double that just in case `self` is a leap-second. + let secs = rhs.as_secs() % (2 * 24 * 60 * 60); + let d = OldDuration::from_std(Duration::new(secs, rhs.subsec_nanos())).unwrap(); + self.overflowing_sub_signed(d).0 } } +/// Subtract-assign `std::time::Duration` from `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the subtraction ignores integral number of days. impl SubAssign for NaiveTime { #[inline] fn sub_assign(&mut self, rhs: Duration) { - let rhs = OldDuration::from_std(rhs) - .expect("overflow converting from core::time::Duration to chrono::Duration"); - *self -= rhs; + *self = *self - rhs; + } +} + +/// Subtract `FixedOffset` from `NaiveTime`. +/// +/// This wraps around and never overflows or underflows. +/// In particular the subtraction ignores integral number of days. +impl Sub for NaiveTime { + type Output = NaiveTime; + + #[inline] + fn sub(self, rhs: FixedOffset) -> NaiveTime { + self.overflowing_sub_offset(rhs).0 } } @@ -1289,7 +1390,7 @@ impl Sub for NaiveTime { } /// The `Debug` output of the naive time `t` is the same as -/// [`t.format("%H:%M:%S%.f")`](../format/strftime/index.html). +/// [`t.format("%H:%M:%S%.f")`](crate::format::strftime). /// /// The string printed can be readily parsed via the `parse` method on `str`. /// @@ -1345,7 +1446,7 @@ impl fmt::Debug for NaiveTime { } /// The `Display` output of the naive time `t` is the same as -/// [`t.format("%H:%M:%S%.f")`](../format/strftime/index.html). +/// [`t.format("%H:%M:%S%.f")`](crate::format::strftime). /// /// The string printed can be readily parsed via the `parse` method on `str`. /// @@ -1379,7 +1480,7 @@ impl fmt::Display for NaiveTime { } /// Parsing a `str` into a `NaiveTime` uses the same format, -/// [`%H:%M:%S%.f`](../format/strftime/index.html), as in `Debug` and `Display`. +/// [`%H:%M:%S%.f`](crate::format::strftime), as in `Debug` and `Display`. /// /// # Example /// diff --git a/vendor/chrono/src/naive/time/rustc_serialize.rs b/vendor/chrono/src/naive/time/rustc_serialize.rs index 128fcec8a..3c5c47a18 100644 --- a/vendor/chrono/src/naive/time/rustc_serialize.rs +++ b/vendor/chrono/src/naive/time/rustc_serialize.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - use super::NaiveTime; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; diff --git a/vendor/chrono/src/naive/time/serde.rs b/vendor/chrono/src/naive/time/serde.rs index cf3c4e3d5..0992fb59f 100644 --- a/vendor/chrono/src/naive/time/serde.rs +++ b/vendor/chrono/src/naive/time/serde.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use super::NaiveTime; use core::fmt; use serde::{de, ser}; diff --git a/vendor/chrono/src/naive/time/tests.rs b/vendor/chrono/src/naive/time/tests.rs index f7a6ef5f9..784a8390b 100644 --- a/vendor/chrono/src/naive/time/tests.rs +++ b/vendor/chrono/src/naive/time/tests.rs @@ -1,6 +1,6 @@ use super::NaiveTime; use crate::duration::Duration as OldDuration; -use crate::Timelike; +use crate::{FixedOffset, Timelike}; #[test] fn test_time_from_hms_milli() { @@ -350,3 +350,41 @@ fn test_time_parse_from_str() { assert!(NaiveTime::parse_from_str("12:59 PM", "%H:%M %P").is_ok()); assert!(NaiveTime::parse_from_str("12:3456", "%H:%M:%S").is_err()); } + +#[test] +fn test_overflowing_offset() { + let hmsm = |h, m, s, n| NaiveTime::from_hms_milli_opt(h, m, s, n).unwrap(); + + let positive_offset = FixedOffset::east_opt(4 * 60 * 60).unwrap(); + // regular time + let t = hmsm(5, 6, 7, 890); + assert_eq!(t.overflowing_add_offset(positive_offset), (hmsm(9, 6, 7, 890), 0)); + assert_eq!(t.overflowing_sub_offset(positive_offset), (hmsm(1, 6, 7, 890), 0)); + // leap second is preserved, and wrap to next day + let t = hmsm(23, 59, 59, 1_000); + assert_eq!(t.overflowing_add_offset(positive_offset), (hmsm(3, 59, 59, 1_000), 1)); + assert_eq!(t.overflowing_sub_offset(positive_offset), (hmsm(19, 59, 59, 1_000), 0)); + // wrap to previous day + let t = hmsm(1, 2, 3, 456); + assert_eq!(t.overflowing_sub_offset(positive_offset), (hmsm(21, 2, 3, 456), -1)); + // an odd offset + let negative_offset = FixedOffset::west_opt(((2 * 60) + 3) * 60 + 4).unwrap(); + let t = hmsm(5, 6, 7, 890); + assert_eq!(t.overflowing_add_offset(negative_offset), (hmsm(3, 3, 3, 890), 0)); + assert_eq!(t.overflowing_sub_offset(negative_offset), (hmsm(7, 9, 11, 890), 0)); + + assert_eq!(t.overflowing_add_offset(positive_offset).0, t + positive_offset); + assert_eq!(t.overflowing_sub_offset(positive_offset).0, t - positive_offset); +} + +#[test] +#[cfg(feature = "rkyv-validation")] +fn test_rkyv_validation() { + let t_min = NaiveTime::MIN; + let bytes = rkyv::to_bytes::<_, 8>(&t_min).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), t_min); + + let t_max = NaiveTime::MAX; + let bytes = rkyv::to_bytes::<_, 8>(&t_max).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), t_max); +} diff --git a/vendor/chrono/src/offset/fixed.rs b/vendor/chrono/src/offset/fixed.rs index 53e734cc1..387a5cc0a 100644 --- a/vendor/chrono/src/offset/fixed.rs +++ b/vendor/chrono/src/offset/fixed.rs @@ -4,17 +4,14 @@ //! The time zone which has a fixed offset from UTC. use core::fmt; -use core::ops::{Add, Sub}; use core::str::FromStr; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use super::{LocalResult, Offset, TimeZone}; -use crate::duration::Duration as OldDuration; -use crate::format::{scan, OUT_OF_RANGE}; -use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime}; -use crate::{DateTime, ParseError, Timelike}; +use crate::format::{scan, ParseError, OUT_OF_RANGE}; +use crate::naive::{NaiveDate, NaiveDateTime}; /// The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59. /// @@ -23,7 +20,13 @@ use crate::{DateTime, ParseError, Timelike}; /// `DateTime` instances. See the [`east_opt`](#method.east_opt) and /// [`west_opt`](#method.west_opt) methods for examples. #[derive(PartialEq, Eq, Hash, Copy, Clone)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, Hash, Debug)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] pub struct FixedOffset { local_minus_utc: i32, } @@ -183,75 +186,6 @@ impl arbitrary::Arbitrary<'_> for FixedOffset { } } -// addition or subtraction of FixedOffset to/from Timelike values is the same as -// adding or subtracting the offset's local_minus_utc value -// but keep keeps the leap second information. -// this should be implemented more efficiently, but for the time being, this is generic right now. - -fn add_with_leapsecond(lhs: &T, rhs: i32) -> T -where - T: Timelike + Add, -{ - // extract and temporarily remove the fractional part and later recover it - let nanos = lhs.nanosecond(); - let lhs = lhs.with_nanosecond(0).unwrap(); - (lhs + OldDuration::seconds(i64::from(rhs))).with_nanosecond(nanos).unwrap() -} - -impl Add for NaiveTime { - type Output = NaiveTime; - - #[inline] - fn add(self, rhs: FixedOffset) -> NaiveTime { - add_with_leapsecond(&self, rhs.local_minus_utc) - } -} - -impl Sub for NaiveTime { - type Output = NaiveTime; - - #[inline] - fn sub(self, rhs: FixedOffset) -> NaiveTime { - add_with_leapsecond(&self, -rhs.local_minus_utc) - } -} - -impl Add for NaiveDateTime { - type Output = NaiveDateTime; - - #[inline] - fn add(self, rhs: FixedOffset) -> NaiveDateTime { - add_with_leapsecond(&self, rhs.local_minus_utc) - } -} - -impl Sub for NaiveDateTime { - type Output = NaiveDateTime; - - #[inline] - fn sub(self, rhs: FixedOffset) -> NaiveDateTime { - add_with_leapsecond(&self, -rhs.local_minus_utc) - } -} - -impl Add for DateTime { - type Output = DateTime; - - #[inline] - fn add(self, rhs: FixedOffset) -> DateTime { - add_with_leapsecond(&self, rhs.local_minus_utc) - } -} - -impl Sub for DateTime { - type Output = DateTime; - - #[inline] - fn sub(self, rhs: FixedOffset) -> DateTime { - add_with_leapsecond(&self, -rhs.local_minus_utc) - } -} - #[cfg(test)] mod tests { use super::FixedOffset; @@ -293,4 +227,12 @@ mod tests { let offset = FixedOffset::from_str("+06:30").unwrap(); assert_eq!(offset.local_minus_utc, (6 * 3600) + 1800); } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let offset = FixedOffset::from_str("-0500").unwrap(); + let bytes = rkyv::to_bytes::<_, 4>(&offset).unwrap(); + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), offset); + } } diff --git a/vendor/chrono/src/offset/local/mod.rs b/vendor/chrono/src/offset/local/mod.rs index 557f8db03..176776373 100644 --- a/vendor/chrono/src/offset/local/mod.rs +++ b/vendor/chrono/src/offset/local/mod.rs @@ -3,7 +3,7 @@ //! The local (system) time zone. -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use super::fixed::FixedOffset; @@ -88,7 +88,7 @@ mod inner { #[cfg(unix)] mod tz_info; -/// The local timescale. This is implemented via the standard `time` crate. +/// The local timescale. /// /// Using the [`TimeZone`](./trait.TimeZone.html) methods /// on the Local struct is the preferred way to construct `DateTime` @@ -104,7 +104,13 @@ mod tz_info; /// assert!(dt1 >= dt2); /// ``` #[derive(Copy, Clone, Debug)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq)), + archive_attr(derive(Clone, Copy, Debug)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Local; @@ -257,4 +263,17 @@ mod tests { ); } } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let local = Local; + // Local is a ZST and serializes to 0 bytes + let bytes = rkyv::to_bytes::<_, 0>(&local).unwrap(); + assert_eq!(bytes.len(), 0); + + // but is deserialized to an archived variant without a + // wrapping object + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), super::ArchivedLocal); + } } diff --git a/vendor/chrono/src/offset/local/win_bindings.rs b/vendor/chrono/src/offset/local/win_bindings.rs index 292c95141..592726c73 100644 --- a/vendor/chrono/src/offset/local/win_bindings.rs +++ b/vendor/chrono/src/offset/local/win_bindings.rs @@ -1,4 +1,4 @@ -// Bindings generated by `windows-bindgen` 0.51.1 +// Bindings generated by `windows-bindgen` 0.52.0 #![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)] ::windows_targets::link!("kernel32.dll" "system" fn SystemTimeToFileTime(lpsystemtime : *const SYSTEMTIME, lpfiletime : *mut FILETIME) -> BOOL); diff --git a/vendor/chrono/src/offset/mod.rs b/vendor/chrono/src/offset/mod.rs index 7c96f72a2..ae3634e54 100644 --- a/vendor/chrono/src/offset/mod.rs +++ b/vendor/chrono/src/offset/mod.rs @@ -26,15 +26,15 @@ use crate::Weekday; #[allow(deprecated)] use crate::{Date, DateTime}; -mod fixed; +pub(crate) mod fixed; pub use self::fixed::FixedOffset; #[cfg(feature = "clock")] -mod local; +pub(crate) mod local; #[cfg(feature = "clock")] pub use self::local::Local; -mod utc; +pub(crate) mod utc; pub use self::utc::Utc; /// The conversion result from the local time to the timezone-aware datetime types. @@ -211,8 +211,7 @@ pub trait Offset: Sized + Clone + fmt::Debug { /// The time zone. /// -/// The methods here are the primarily constructors for [`Date`](../struct.Date.html) and -/// [`DateTime`](../struct.DateTime.html) types. +/// The methods here are the primary constructors for [`Date`] and [`DateTime`] types. pub trait TimeZone: Sized + Clone { /// An associated offset type. /// This type is used to store the actual offset in date and time types. @@ -470,7 +469,14 @@ pub trait TimeZone: Sized + Clone { /// /// See also [`DateTime::parse_from_str`] which gives a [`DateTime`] with /// parsed [`FixedOffset`]. - #[deprecated(since = "0.4.29", note = "use `DateTime::parse_from_str` instead")] + /// + /// See also [`NaiveDateTime::parse_from_str`] which gives a [`NaiveDateTime`] without + /// an offset, but can be converted to a [`DateTime`] with [`NaiveDateTime::and_utc`] or + /// [`NaiveDateTime::and_local_timezone`]. + #[deprecated( + since = "0.4.29", + note = "use `DateTime::parse_from_str` or `NaiveDateTime::parse_from_str` with `and_utc()` or `and_local_timezone()` instead" + )] fn datetime_from_str(&self, s: &str, fmt: &str) -> ParseResult> { let mut parsed = Parsed::new(); parse(&mut parsed, s, StrftimeItems::new(fmt))?; @@ -500,8 +506,24 @@ pub trait TimeZone: Sized + Clone { /// Converts the local `NaiveDateTime` to the timezone-aware `DateTime` if possible. #[allow(clippy::wrong_self_convention)] fn from_local_datetime(&self, local: &NaiveDateTime) -> LocalResult> { - self.offset_from_local_datetime(local) - .map(|offset| DateTime::from_naive_utc_and_offset(*local - offset.fix(), offset)) + // Return `LocalResult::None` when the offset pushes a value out of range, instead of + // panicking. + match self.offset_from_local_datetime(local) { + LocalResult::None => LocalResult::None, + LocalResult::Single(offset) => match local.checked_sub_offset(offset.fix()) { + Some(dt) => LocalResult::Single(DateTime::from_naive_utc_and_offset(dt, offset)), + None => LocalResult::None, + }, + LocalResult::Ambiguous(o1, o2) => { + match (local.checked_sub_offset(o1.fix()), local.checked_sub_offset(o2.fix())) { + (Some(d1), Some(d2)) => LocalResult::Ambiguous( + DateTime::from_naive_utc_and_offset(d1, o1), + DateTime::from_naive_utc_and_offset(d2, o2), + ), + _ => LocalResult::None, + } + } + } } /// Creates the offset for given UTC `NaiveDate`. This cannot fail. @@ -531,6 +553,32 @@ pub trait TimeZone: Sized + Clone { mod tests { use super::*; + #[test] + fn test_fixed_offset_min_max_dates() { + for offset_hour in -23..=23 { + dbg!(offset_hour); + let offset = FixedOffset::east_opt(offset_hour * 60 * 60).unwrap(); + + let local_max = offset.from_utc_datetime(&NaiveDateTime::MAX); + assert_eq!(local_max.naive_utc(), NaiveDateTime::MAX); + let local_min = offset.from_utc_datetime(&NaiveDateTime::MIN); + assert_eq!(local_min.naive_utc(), NaiveDateTime::MIN); + + let local_max = offset.from_local_datetime(&NaiveDateTime::MAX); + if offset_hour >= 0 { + assert_eq!(local_max.unwrap().naive_local(), NaiveDateTime::MAX); + } else { + assert_eq!(local_max, LocalResult::None); + } + let local_min = offset.from_local_datetime(&NaiveDateTime::MIN); + if offset_hour <= 0 { + assert_eq!(local_min.unwrap().naive_local(), NaiveDateTime::MIN); + } else { + assert_eq!(local_min, LocalResult::None); + } + } + } + #[test] fn test_negative_millis() { let dt = Utc.timestamp_millis_opt(-1000).unwrap(); diff --git a/vendor/chrono/src/offset/utc.rs b/vendor/chrono/src/offset/utc.rs index d27f7877e..e68dc227f 100644 --- a/vendor/chrono/src/offset/utc.rs +++ b/vendor/chrono/src/offset/utc.rs @@ -5,7 +5,7 @@ use core::fmt; #[cfg(all( - feature = "clock", + feature = "now", not(all( target_arch = "wasm32", feature = "wasmbind", @@ -14,12 +14,12 @@ use core::fmt; ))] use std::time::{SystemTime, UNIX_EPOCH}; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use super::{FixedOffset, LocalResult, Offset, TimeZone}; use crate::naive::{NaiveDate, NaiveDateTime}; -#[cfg(feature = "clock")] +#[cfg(feature = "now")] #[allow(deprecated)] use crate::{Date, DateTime}; @@ -41,12 +41,17 @@ use crate::{Date, DateTime}; /// assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 1, 1).unwrap(), dt); /// ``` #[derive(Copy, Clone, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Utc; -#[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] +#[cfg(feature = "now")] impl Utc { /// Returns a `Date` which corresponds to the current date. #[deprecated( diff --git a/vendor/chrono/src/round.rs b/vendor/chrono/src/round.rs index 9c0e76a0f..4de1de60c 100644 --- a/vendor/chrono/src/round.rs +++ b/vendor/chrono/src/round.rs @@ -1,6 +1,8 @@ // This is a part of Chrono. // See README.md and LICENSE.txt for details. +//! Functionality for rounding or truncating a `DateTime` by a `Duration`. + use crate::datetime::DateTime; use crate::duration::Duration; use crate::NaiveDateTime; @@ -291,7 +293,6 @@ impl fmt::Display for RoundingError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for RoundingError { #[allow(deprecated)] fn description(&self) -> &str { diff --git a/vendor/chrono/src/weekday.rs b/vendor/chrono/src/weekday.rs index a7abd9415..03a4b5a7f 100644 --- a/vendor/chrono/src/weekday.rs +++ b/vendor/chrono/src/weekday.rs @@ -1,6 +1,6 @@ use core::fmt; -#[cfg(feature = "rkyv")] +#[cfg(any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"))] use rkyv::{Archive, Deserialize, Serialize}; use crate::OutOfRange; @@ -31,7 +31,13 @@ use crate::OutOfRange; /// ``` #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] -#[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + any(feature = "rkyv", feature = "rkyv-16", feature = "rkyv-32", feature = "rkyv-64"), + derive(Archive, Deserialize, Serialize), + archive(compare(PartialEq)), + archive_attr(derive(Clone, Copy, PartialEq, Eq, Debug, Hash)) +)] +#[cfg_attr(feature = "rkyv-validation", archive(check_bytes))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum Weekday { /// Monday. @@ -227,7 +233,6 @@ pub struct ParseWeekdayError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for ParseWeekdayError {} impl fmt::Display for ParseWeekdayError { @@ -245,7 +250,6 @@ impl fmt::Debug for ParseWeekdayError { // the actual `FromStr` implementation is in the `format` module to leverage the existing code #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod weekday_serde { use super::Weekday; use core::fmt; @@ -382,4 +386,13 @@ mod tests { from_str::(str).unwrap_err(); } } + + #[test] + #[cfg(feature = "rkyv-validation")] + fn test_rkyv_validation() { + let mon = Weekday::Mon; + let bytes = rkyv::to_bytes::<_, 1>(&mon).unwrap(); + + assert_eq!(rkyv::from_bytes::(&bytes).unwrap(), mon); + } } diff --git a/vendor/chrono/tests/dateutils.rs b/vendor/chrono/tests/dateutils.rs index 52181e831..8d3ce9c10 100644 --- a/vendor/chrono/tests/dateutils.rs +++ b/vendor/chrono/tests/dateutils.rs @@ -121,6 +121,7 @@ fn verify_against_date_command_format_local(path: &'static str, dt: NaiveDateTim let output = process::Command::new(path) .env("LANG", "c") + .env("LC_ALL", "c") .arg("-d") .arg(format!( "{}-{:02}-{:02} {:02}:{:02}:{:02}", diff --git a/vendor/clang-sys/.cargo-checksum.json b/vendor/clang-sys/.cargo-checksum.json index 606db1578..c5e0a49f2 100644 --- a/vendor/clang-sys/.cargo-checksum.json +++ b/vendor/clang-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"711f895a9f65fef1d0398862d7a4c654acee5d534588c85d18a62f13889f337a","Cargo.toml":"ff078b25b2605e7bdd6a8138718e86759fbe3134d0c9e3e43365fd56f3fbba87","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"d75bc7b6e957818c2c9c78107eade13c48bd1e9f6a5eca3b04644b21938b0157","build.rs":"f344874bf25f8ec6f852c55edaf262789fc6b883489afb47fa3d7da83f95ad1c","build/common.rs":"0b23893c737a9b60d8d400b5101bf3bcc632e0833d948590c42d189a1f69aeb0","build/dynamic.rs":"79014d1f9c7a197affb018d60218458e8878ccc80e61fc2e5d61b2f291ebbb4b","build/macros.rs":"eac7bffaac5f70728764065145eb1541b0a133c900356a0bcf55f0d89966c84e","build/static.rs":"b3000f872b139b3f3230f49e98a183d05ac18be661192bb5cada896eca853aca","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"be716a052818573aa17a5571dfedfec9f1ca9701823bd632c8435425ae9ed6af","src/link.rs":"fd8e4a60869815041a9eb8901e0d39f45ccd532efee0eeac1e79ed00f9beadb4","src/support.rs":"5398f8c35cceae64ca941b9a26ed28f29d34a1301958399d636e599dcfd0d64f","tests/build.rs":"66ed85f6e1baf9fac5c50e486fa43413e40c3f16ce9f503c9bba53e300682a9a","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"a39e48b2ab3347692f461609e296456850cff870514fa3df8232341318015568"},"package":"c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"} \ No newline at end of file +{"files":{"CHANGELOG.md":"7a177945b551a62c30b9183f8edaac38216fbeb3fb7f8760e5f2a69916140086","Cargo.toml":"9d896747d0d657eeb8913dc254439b06f77025399c654026db5d58bf655837f6","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"d75bc7b6e957818c2c9c78107eade13c48bd1e9f6a5eca3b04644b21938b0157","build.rs":"f344874bf25f8ec6f852c55edaf262789fc6b883489afb47fa3d7da83f95ad1c","build/common.rs":"0b23893c737a9b60d8d400b5101bf3bcc632e0833d948590c42d189a1f69aeb0","build/dynamic.rs":"79014d1f9c7a197affb018d60218458e8878ccc80e61fc2e5d61b2f291ebbb4b","build/macros.rs":"eac7bffaac5f70728764065145eb1541b0a133c900356a0bcf55f0d89966c84e","build/static.rs":"b3000f872b139b3f3230f49e98a183d05ac18be661192bb5cada896eca853aca","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"3c0fc0c0e3cabc3b81732b5ac784b36f69dfb72abcecc3bf4e5a08c72d9c8ad0","src/link.rs":"13b236714d68483fbcec9df2ee1ae63db21e87176881c2d53a9157a2b38240eb","src/support.rs":"5398f8c35cceae64ca941b9a26ed28f29d34a1301958399d636e599dcfd0d64f","tests/build.rs":"66ed85f6e1baf9fac5c50e486fa43413e40c3f16ce9f503c9bba53e300682a9a","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"a39e48b2ab3347692f461609e296456850cff870514fa3df8232341318015568"},"package":"67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"} \ No newline at end of file diff --git a/vendor/clang-sys/CHANGELOG.md b/vendor/clang-sys/CHANGELOG.md index 9380fe0b9..d08b4bcff 100644 --- a/vendor/clang-sys/CHANGELOG.md +++ b/vendor/clang-sys/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.7.0] - 2023-12-31 + +### Added +- Added support for `clang` 17.0.x + ## [1.6.1] - 2023-03-29 ### Fixed diff --git a/vendor/clang-sys/Cargo.toml b/vendor/clang-sys/Cargo.toml index fa1892f73..49e15cef2 100644 --- a/vendor/clang-sys/Cargo.toml +++ b/vendor/clang-sys/Cargo.toml @@ -11,7 +11,7 @@ [package] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" authors = ["Kyle Mayes "] build = "build.rs" links = "clang" @@ -23,7 +23,7 @@ repository = "https://github.com/KyleMayes/clang-sys" [package.metadata.docs.rs] features = [ - "clang_16_0", + "clang_17_0", "runtime", ] @@ -35,7 +35,7 @@ version = "0.2.39" default-features = false [dependencies.libloading] -version = "0.7" +version = "0.8" optional = true [dev-dependencies.glob] @@ -58,6 +58,7 @@ clang_13_0 = ["clang_12_0"] clang_14_0 = ["clang_13_0"] clang_15_0 = ["clang_14_0"] clang_16_0 = ["clang_15_0"] +clang_17_0 = ["clang_16_0"] clang_3_5 = [] clang_3_6 = ["clang_3_5"] clang_3_7 = ["clang_3_6"] diff --git a/vendor/clang-sys/src/lib.rs b/vendor/clang-sys/src/lib.rs index edaf2d37a..31e2e9603 100644 --- a/vendor/clang-sys/src/lib.rs +++ b/vendor/clang-sys/src/lib.rs @@ -48,6 +48,20 @@ pub type CXInclusionVisitor = extern "C" fn(CXFile, *mut CXSourceLocation, c_uin /// Defines a C enum as a series of constants. macro_rules! cenum { + (#[repr($ty:ty)] $(#[$meta:meta])* enum $name:ident { + $($(#[$vmeta:meta])* const $variant:ident = $value:expr), +, + }) => ( + pub type $name = $ty; + + $($(#[$vmeta])* pub const $variant: $name = $value;)+ + ); + (#[repr($ty:ty)] $(#[$meta:meta])* enum $name:ident { + $($(#[$vmeta:meta])* const $variant:ident = $value:expr); +; + }) => ( + pub type $name = $ty; + + $($(#[$vmeta])* pub const $variant: $name = $value;)+ + ); ($(#[$meta:meta])* enum $name:ident { $($(#[$vmeta:meta])* const $variant:ident = $value:expr), +, }) => ( @@ -97,6 +111,47 @@ cenum! { } } +cenum! { + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + enum CXBinaryOperatorKind { + const CXBinaryOperator_Invalid = 0, + const CXBinaryOperator_PtrMemD = 1, + const CXBinaryOperator_PtrMemI = 2, + const CXBinaryOperator_Mul = 3, + const CXBinaryOperator_Div = 4, + const CXBinaryOperator_Rem = 5, + const CXBinaryOperator_Add = 6, + const CXBinaryOperator_Sub = 7, + const CXBinaryOperator_Shl = 8, + const CXBinaryOperator_Shr = 9, + const CXBinaryOperator_Cmp = 10, + const CXBinaryOperator_LT = 11, + const CXBinaryOperator_GT = 12, + const CXBinaryOperator_LE = 13, + const CXBinaryOperator_GE = 14, + const CXBinaryOperator_EQ = 15, + const CXBinaryOperator_NE = 16, + const CXBinaryOperator_And = 17, + const CXBinaryOperator_Xor = 18, + const CXBinaryOperator_Or = 19, + const CXBinaryOperator_LAnd = 20, + const CXBinaryOperator_LOr = 21, + const CXBinaryOperator_Assign = 22, + const CXBinaryOperator_MulAssign = 23, + const CXBinaryOperator_DivAssign = 24, + const CXBinaryOperator_RemAssign = 25, + const CXBinaryOperator_AddAssign = 26, + const CXBinaryOperator_SubAssign = 27, + const CXBinaryOperator_ShlAssign = 28, + const CXBinaryOperator_ShrAssign = 29, + const CXBinaryOperator_AndAssign = 30, + const CXBinaryOperator_XorAssign = 31, + const CXBinaryOperator_OrAssign = 32, + const CXBinaryOperator_Comma = 33, + } +} + cenum! { enum CXCallingConv { const CXCallingConv_Default = 0, @@ -140,6 +195,17 @@ cenum! { } } +cenum! { + #[repr(c_uchar)] + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + enum CXChoice { + const CXChoice_Default = 0, + const CXChoice_Enabled = 1, + const CXChoice_Disabled = 2, + } +} + cenum! { enum CXCommentInlineCommandRenderKind { const CXCommentInlineCommandRenderKind_Normal = 0, @@ -1049,7 +1115,7 @@ cenum! { /// Only produced by `libclang` 11.0 and later. const CXType_Atomic = 177, /// Only produced by `libclang` 15.0 and later. - const CXType_BTFTagAttributed = 178, + const CXType_BTFTagAttributed = 178, } } @@ -1089,6 +1155,28 @@ cenum! { } } +cenum! { + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + enum CXUnaryOperatorKind { + const CXUnaryOperator_Invalid = 0, + const CXUnaryOperator_PostInc = 1, + const CXUnaryOperator_PostDec = 2, + const CXUnaryOperator_PreInc = 3, + const CXUnaryOperator_PreDec = 4, + const CXUnaryOperator_AddrOf = 5, + const CXUnaryOperator_Deref = 6, + const CXUnaryOperator_Plus = 7, + const CXUnaryOperator_Minus = 8, + const CXUnaryOperator_Not = 9, + const CXUnaryOperator_LNot = 10, + const CXUnaryOperator_Real = 11, + const CXUnaryOperator_Imag = 12, + const CXUnaryOperator_Extension = 13, + const CXUnaryOperator_Coawait = 14, + } +} + cenum! { enum CXVisitorResult { const CXVisit_Break = 0, @@ -1201,6 +1289,28 @@ cenum! { } } +/// Only available on `libclang` 17.0 and later. +#[cfg(feature = "clang_17_0")] +#[cfg(not(target_os = "windows"))] +pub type CXIndexOptions_Flags = c_ushort; + +/// Only available on `libclang` 17.0 and later. +#[cfg(feature = "clang_17_0")] +#[cfg(target_os = "windows")] +pub type CXIndexOptions_Flags = c_uint; + +/// Only available on `libclang` 17.0 and later. +#[cfg(feature = "clang_17_0")] +pub const CXIndexOptions_ExcludeDeclarationsFromPCH: CXIndexOptions_Flags = 1; + +/// Only available on `libclang` 17.0 and later. +#[cfg(feature = "clang_17_0")] +pub const CXIndexOptions_DisplayDiagnostics: CXIndexOptions_Flags = 2; + +/// Only available on `libclang` 17.0 and later. +#[cfg(feature = "clang_17_0")] +pub const CXIndexOptions_StorePreamblesInMemory: CXIndexOptions_Flags = 4; + cenum! { enum CXNameRefFlags { const CXNameRange_WantQualifier = 1; @@ -1594,6 +1704,21 @@ pub struct CXIdxObjCProtocolRefListInfo { default!(CXIdxObjCProtocolRefListInfo); +#[cfg(feature = "clang_17_0")] +#[derive(Copy, Clone, Debug)] +#[repr(C)] +pub struct CXIndexOptions { + pub Size: c_uint, + pub ThreadBackgroundPriorityForIndexing: CXChoice, + pub ThreadBackgroundPriorityForEditing: CXChoice, + pub flags: CXIndexOptions_Flags, + pub PreambleStoragePath: *const c_char, + pub InvocationEmissionPath: *const c_char, +} + +#[cfg(feature = "clang_17_0")] +default!(CXIndexOptions); + #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct CXPlatformAvailability { @@ -1771,6 +1896,9 @@ link! { pub fn clang_CXXMethod_isPureVirtual(cursor: CXCursor) -> c_uint; pub fn clang_CXXMethod_isStatic(cursor: CXCursor) -> c_uint; pub fn clang_CXXMethod_isVirtual(cursor: CXCursor) -> c_uint; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_CXXMethod_isExplicit(cursor: CXCursor) -> c_uint; /// Only available on `libclang` 6.0 and later. #[cfg(feature = "clang_6_0")] pub fn clang_CXXRecord_isAbstract(cursor: CXCursor) -> c_uint; @@ -2005,6 +2133,9 @@ link! { pub fn clang_constructUSR_ObjCProtocol(protocol: *const c_char) -> CXString; pub fn clang_createCXCursorSet() -> CXCursorSet; pub fn clang_createIndex(exclude: c_int, display: c_int) -> CXIndex; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_createIndexWithOptions(options: CXIndexOptions) -> CXIndex; pub fn clang_createTranslationUnit(index: CXIndex, file: *const c_char) -> CXTranslationUnit; pub fn clang_createTranslationUnit2(index: CXIndex, file: *const c_char, tu: *mut CXTranslationUnit) -> CXErrorCode; pub fn clang_createTranslationUnitFromSourceFile(index: CXIndex, file: *const c_char, n_arguments: c_int, arguments: *const *const c_char, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile) -> CXTranslationUnit; @@ -2049,6 +2180,9 @@ link! { pub fn clang_getArgType(type_: CXType, index: c_uint) -> CXType; pub fn clang_getArrayElementType(type_: CXType) -> CXType; pub fn clang_getArraySize(type_: CXType) -> c_longlong; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_getBinaryOperatorKindSpelling(kind: CXBinaryOperatorKind) -> CXString; pub fn clang_getCString(string: CXString) -> *const c_char; pub fn clang_getCXTUResourceUsage(tu: CXTranslationUnit) -> CXTUResourceUsage; pub fn clang_getCXXAccessSpecifier(cursor: CXCursor) -> CX_CXXAccessSpecifier; @@ -2073,6 +2207,9 @@ link! { pub fn clang_getCompletionPriority(string: CXCompletionString) -> c_uint; pub fn clang_getCursor(tu: CXTranslationUnit, location: CXSourceLocation) -> CXCursor; pub fn clang_getCursorAvailability(cursor: CXCursor) -> CXAvailabilityKind; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_getCursorBinaryOperatorKind(cursor: CXCursor) -> CXBinaryOperatorKind; pub fn clang_getCursorCompletionString(cursor: CXCursor) -> CXCompletionString; pub fn clang_getCursorDefinition(cursor: CXCursor) -> CXCursor; pub fn clang_getCursorDisplayName(cursor: CXCursor) -> CXString; @@ -2102,6 +2239,9 @@ link! { #[cfg(feature = "clang_6_0")] pub fn clang_getCursorTLSKind(cursor: CXCursor) -> CXTLSKind; pub fn clang_getCursorType(cursor: CXCursor) -> CXType; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_getCursorUnaryOperatorKind(cursor: CXCursor) -> CXUnaryOperatorKind; pub fn clang_getCursorUSR(cursor: CXCursor) -> CXString; /// Only available on `libclang` 3.8 and later. #[cfg(feature = "clang_3_8")] @@ -2184,6 +2324,9 @@ link! { /// Only available on `libclang` 5.0 and later. #[cfg(feature = "clang_5_0")] pub fn clang_getTranslationUnitTargetInfo(tu: CXTranslationUnit) -> CXTargetInfo; + /// Only available on `libclang` 17.0 and later. + #[cfg(feature = "clang_17_0")] + pub fn clang_getUnaryOperatorKindSpelling(kind: CXUnaryOperatorKind) -> CXString; /// Only available on `libclang` 16.0 and later. #[cfg(feature = "clang_16_0")] pub fn clang_getUnqualifiedType(type_: CXType) -> CXType; diff --git a/vendor/clang-sys/src/link.rs b/vendor/clang-sys/src/link.rs index 07c4be3b3..79b3d49a3 100644 --- a/vendor/clang-sys/src/link.rs +++ b/vendor/clang-sys/src/link.rs @@ -62,6 +62,7 @@ macro_rules! link { V11_0 = 110, V12_0 = 120, V16_0 = 160, + V17_0 = 170, } impl fmt::Display for Version { @@ -81,7 +82,8 @@ macro_rules! link { V9_0 => write!(f, "9.0.x - 10.0.x"), V11_0 => write!(f, "11.0.x"), V12_0 => write!(f, "12.0.x - 15.0.x"), - V16_0 => write!(f, "16.0.x or later"), + V16_0 => write!(f, "16.0.x"), + V17_0 => write!(f, "17.0.x or later"), } } } @@ -130,6 +132,7 @@ macro_rules! link { } unsafe { + check!(b"clang_CXXMethod_isExplicit", V17_0); check!(b"clang_CXXMethod_isCopyAssignmentOperator", V16_0); check!(b"clang_Cursor_getVarDeclInitializer", V12_0); check!(b"clang_Type_getValueType", V11_0); diff --git a/vendor/cpufeatures/.cargo-checksum.json b/vendor/cpufeatures/.cargo-checksum.json index 3ba9f97cb..c4705f18d 100644 --- a/vendor/cpufeatures/.cargo-checksum.json +++ b/vendor/cpufeatures/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"716d1f451171228b69bdfd44e7da2a5cf55e6837ad49ab88ad45ff5cf51446ac","Cargo.toml":"32336c5ea5f8efbfaf6aab2cb40861a5cd85de14e32902d49ff1bf3bc3a9f932","LICENSE-APACHE":"a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5","LICENSE-MIT":"904801faf3f1850328af8e1aa1047b9190cc22ed40df5c87f2d93d17f847ef67","README.md":"bc4339a8bfc78dc28ab4782cc539629bc6af72e724543f3e15d173c705e2977a","src/aarch64.rs":"ca05d0dca4bb1aad54c275934bf2761fecc92525aa045f333d55d74f23583af4","src/lib.rs":"1a192980dfc9a2658bea08a98d46f6819a0ffaca6544cabfa6870af09ae7d310","src/loongarch64.rs":"489db8bc4c3ffc3b89ae8ecf94181c5d456d139d66bb74403a597ee4cb58ca2c","src/miri.rs":"acf1a7e7ae31a1de07941084c6b589a2d4c6ea5f87012c811592c865d04c02cb","src/x86.rs":"48454ddb42ada703a7c2401b3e373c0beff1ab662c335ebf8b9a2799a1fedf5c","tests/aarch64.rs":"f6f0f55d821dbcac61e54cec8d35bf944cd09f90f3422eee2b6d55a1e9899635","tests/loongarch64.rs":"1b95140c68f673721699dcb40176540818641785f7863a99214bcad2014aa181","tests/x86.rs":"fcf476ca6ebd0845ab547cea4fe40c2ba2a2324c024264d9a86f666586f3a480"},"package":"ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"} \ No newline at end of file +{"files":{"CHANGELOG.md":"9016ecbd27290a1a62d928537c9ee912901c21e3505644eb51da432112e8c27d","Cargo.toml":"12903d32a56e22fc63a9810a1184f5e70c71a7f58fe9d3c3abd3ed5b5f66ffe8","LICENSE-APACHE":"a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5","LICENSE-MIT":"904801faf3f1850328af8e1aa1047b9190cc22ed40df5c87f2d93d17f847ef67","README.md":"bc4339a8bfc78dc28ab4782cc539629bc6af72e724543f3e15d173c705e2977a","src/aarch64.rs":"ca05d0dca4bb1aad54c275934bf2761fecc92525aa045f333d55d74f23583af4","src/lib.rs":"1a192980dfc9a2658bea08a98d46f6819a0ffaca6544cabfa6870af09ae7d310","src/loongarch64.rs":"489db8bc4c3ffc3b89ae8ecf94181c5d456d139d66bb74403a597ee4cb58ca2c","src/miri.rs":"acf1a7e7ae31a1de07941084c6b589a2d4c6ea5f87012c811592c865d04c02cb","src/x86.rs":"b7627384419d2db09bc76df76d957e4c6a63d1d6b6c5f2b46456d09a20db6186","tests/aarch64.rs":"f6f0f55d821dbcac61e54cec8d35bf944cd09f90f3422eee2b6d55a1e9899635","tests/loongarch64.rs":"1b95140c68f673721699dcb40176540818641785f7863a99214bcad2014aa181","tests/x86.rs":"fcf476ca6ebd0845ab547cea4fe40c2ba2a2324c024264d9a86f666586f3a480"},"package":"53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"} \ No newline at end of file diff --git a/vendor/cpufeatures/CHANGELOG.md b/vendor/cpufeatures/CHANGELOG.md index 062155da4..8d5dc474c 100644 --- a/vendor/cpufeatures/CHANGELOG.md +++ b/vendor/cpufeatures/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.2.12 (2024-01-04) +### Added +- Support for x86-64 AVX-512 target features: `gfni`, `vaes`, `vpclmulqdq`, `avx512bitalg`, `avx512vpopcntdq` ([#1035]) + +[#1035]: https://github.com/RustCrypto/utils/pull/1035 + ## 0.2.11 (2023-10-26) ### Added - Support for AArch64's `sm4` target feature ([#972]) diff --git a/vendor/cpufeatures/Cargo.toml b/vendor/cpufeatures/Cargo.toml index 2d8cbf673..de6d181a0 100644 --- a/vendor/cpufeatures/Cargo.toml +++ b/vendor/cpufeatures/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" authors = ["RustCrypto Developers"] description = """ Lightweight runtime CPU feature detection for aarch64, loongarch64, and x86/x86_64 targets, @@ -30,6 +30,7 @@ categories = [ ] license = "MIT OR Apache-2.0" repository = "https://github.com/RustCrypto/utils" +resolver = "2" [target.aarch64-linux-android.dependencies.libc] version = "0.2.149" diff --git a/vendor/cpufeatures/src/x86.rs b/vendor/cpufeatures/src/x86.rs index 958eff3ee..07e3a9ce4 100644 --- a/vendor/cpufeatures/src/x86.rs +++ b/vendor/cpufeatures/src/x86.rs @@ -144,4 +144,9 @@ __expand_check_macro! { ("avx512vl", "zmm", 1, ebx, 31), ("avx512vbmi", "zmm", 1, ecx, 1), ("avx512vbmi2", "zmm", 1, ecx, 6), + ("gfni", "zmm", 1, ecx, 8), + ("vaes", "zmm", 1, ecx, 9), + ("vpclmulqdq", "zmm", 1, ecx, 10), + ("avx512bitalg", "zmm", 1, ecx, 12), + ("avx512vpopcntdq", "zmm", 1, ecx, 14), } diff --git a/vendor/crossbeam-channel/.cargo-checksum.json b/vendor/crossbeam-channel/.cargo-checksum.json index 378146617..a9bfaf1a3 100644 --- a/vendor/crossbeam-channel/.cargo-checksum.json +++ b/vendor/crossbeam-channel/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"bcaef3a8c2edc691ca40e81865a3a176610706f159d34cf8b45ee4337ebd6369","Cargo.lock":"6695f914942ea8ef6862f7d84731ddbefb0f821cb5964059d4f952729d91c8ec","Cargo.toml":"fe61d89e41142b9b83de137dfbc0e21f3c4249aedefe535241dc85d36cc6e024","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"4e16587d8f6a15f2016f256535aa6c9429424672ebdcd03c1a7d964746e46127","benches/crossbeam.rs":"96cb1abd23cac3ef8a7174a802e94609926b555bb02c9658c78723d433f1dd92","examples/fibonacci.rs":"4e88fa40048cdc31e9c7bb60347d46f92543d7ddf39cab3b52bfe44affdb6a02","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"d02121258f08d56f1eb7997e19bcb9bacb6836cfa0abbba90a9e59d8a50ae5cf","src/channel.rs":"13fbbe12d4ec361855af1c3587fc80aea5f537db8dc44dd4f66c9e2b4ae9f5c1","src/context.rs":"ff4d39639ddf16aaab582d4a5f3d10ef2c71afe1abbf4e60f3d9d2ddbd72c230","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"44cb2024ee6b0cd6fd24996430e53720769f64b4ac35016bc3e05cb9db48681d","src/flavors/array.rs":"508e54587fc8d9e8dfacd16446a601e33838d7bb1dfd9d7ccc3e65315b66b35a","src/flavors/at.rs":"04e07861534f2f7d5b5f884f2f5bc9c008427e6d0afa1c8ad401e1d7e54b57eb","src/flavors/list.rs":"b3820f2d5c063cbccd658317af991885f68dfbbece483807d4ea36070ff5efba","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"747da857aa1a7601641f23f4930e6ad00ebaf50456d9be5c7aa270e2ecc24dcb","src/flavors/tick.rs":"0916ca3faef30b8cc591137701c456d5fc5b5b49cb1edad1e3a80d35bae222bb","src/flavors/zero.rs":"7458eb0ece475dc5093b4f2cde13f6de57e4f70291258850de4fa3c951c8f594","src/lib.rs":"3a65706d4124844ffc4c8cb1f8cc779631ec94f449f85cbb68364ad3619404f1","src/select.rs":"966fb1abb05f900b84a00ff2bd99b4934aafc793d9083ad4f31c551cc9f6aa5f","src/select_macro.rs":"283acd04870356b0c4d3d4046c5070638b562c9ffb8fa29c1a5b90a2509bf3af","src/utils.rs":"d99c66d668c2e232b488f0121826ceac07a875c9ad48bc053e138320d2b20cf4","src/waker.rs":"6839108d1c9357b3c0c1c162c8b4633ff5ac4f756e95e677ac1293e7df942635","tests/after.rs":"0154a8e152880db17a20514ecdd49dabc361d3629858d119b9746b5e932c780c","tests/array.rs":"a57ae6264e676f573d7adb5c4b024994e98bc6811352516adb3444f880f7125e","tests/golang.rs":"7b2ef219ba8a21841c133512f3a540f8279a2458304e9bbed7da81d6091ecd82","tests/iter.rs":"25dc02135bbae9d47a30f9047661648e66bdc134e40ba78bc2fbacbb8b3819bc","tests/list.rs":"3d1a4ae23bb6b4767242b8109a8efda26f1d3b28c0f90da3368f8eb9ca0eee37","tests/mpsc.rs":"d1e185c6290240132a34aa91221271225959f8652d7fc4ceb546ee9712361176","tests/never.rs":"ee40c4fc4dd5af4983fae8de6927f52b81174d222c162f745b26c4a6c7108e4f","tests/ready.rs":"3b4c42d01b01f27e994f6a147e6f56187c23679408f216e180211fdc4f9805cc","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"ce12a8e0284fb9ccf6c1543bec309d9054193e6d942663aed19aa8499ef69c43","tests/select_macro.rs":"597d526fbd021ce70619d9172c931439f778ee3034ec1479aea461b65971a81a","tests/thread_locals.rs":"25ab70a8dcd8a0da9173e5476e17dcc8916caa5b68207d9c403655deaa8e8f4a","tests/tick.rs":"5f697bd14c48505d932e82065b5302ef668e1cc19cac18e8ac22e0c83c221c1d","tests/zero.rs":"9c5af802d5efb2c711f8242b8905ed29cc2601e48dbd95e41c7e6fbfe2918398"},"package":"a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"} \ No newline at end of file +{"files":{"CHANGELOG.md":"2817250fc57879a0bef77761f50ec7a6a6b77888c6159bc4a1207f23a1a1980d","Cargo.lock":"7f969ed9666d57717d774f3b9d8147d4532e2a020d25876c42657f1bace44a1a","Cargo.toml":"482924c4a945cbb5e3f47cf30405f5baecededde7018cd1423f20b3159e48a26","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"5dfb91ebb498dec49948a440a53977109ec532388170e567c3c2a0339589aa4c","benches/crossbeam.rs":"96cb1abd23cac3ef8a7174a802e94609926b555bb02c9658c78723d433f1dd92","examples/fibonacci.rs":"4e88fa40048cdc31e9c7bb60347d46f92543d7ddf39cab3b52bfe44affdb6a02","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"d02121258f08d56f1eb7997e19bcb9bacb6836cfa0abbba90a9e59d8a50ae5cf","src/channel.rs":"13fbbe12d4ec361855af1c3587fc80aea5f537db8dc44dd4f66c9e2b4ae9f5c1","src/context.rs":"ff4d39639ddf16aaab582d4a5f3d10ef2c71afe1abbf4e60f3d9d2ddbd72c230","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"44cb2024ee6b0cd6fd24996430e53720769f64b4ac35016bc3e05cb9db48681d","src/flavors/array.rs":"04839c29b0adcc50c0af6882b9bd68b42ffa7fdaa435ce01bc636c694f33c613","src/flavors/at.rs":"04e07861534f2f7d5b5f884f2f5bc9c008427e6d0afa1c8ad401e1d7e54b57eb","src/flavors/list.rs":"9c32d8da8e232eee0f2c62df57d379dd95a17dbe69f7eada01a657d21743090f","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"747da857aa1a7601641f23f4930e6ad00ebaf50456d9be5c7aa270e2ecc24dcb","src/flavors/tick.rs":"0916ca3faef30b8cc591137701c456d5fc5b5b49cb1edad1e3a80d35bae222bb","src/flavors/zero.rs":"7458eb0ece475dc5093b4f2cde13f6de57e4f70291258850de4fa3c951c8f594","src/lib.rs":"06b3ce0105b1260ae218ed1865b09f20a8235d63c73c0e613f08806bc868eac3","src/select.rs":"966fb1abb05f900b84a00ff2bd99b4934aafc793d9083ad4f31c551cc9f6aa5f","src/select_macro.rs":"8e77a560081dc2cddfc9523889e0d2bfa6ef34edf85c145792c2287d80b4bb7c","src/utils.rs":"639015cb52a2e5990e830d7be8bff899fad81b30f4b2089ad9c3fd920bec7b31","src/waker.rs":"6839108d1c9357b3c0c1c162c8b4633ff5ac4f756e95e677ac1293e7df942635","tests/after.rs":"0154a8e152880db17a20514ecdd49dabc361d3629858d119b9746b5e932c780c","tests/array.rs":"a57ae6264e676f573d7adb5c4b024994e98bc6811352516adb3444f880f7125e","tests/golang.rs":"7b2ef219ba8a21841c133512f3a540f8279a2458304e9bbed7da81d6091ecd82","tests/iter.rs":"25dc02135bbae9d47a30f9047661648e66bdc134e40ba78bc2fbacbb8b3819bc","tests/list.rs":"3d1a4ae23bb6b4767242b8109a8efda26f1d3b28c0f90da3368f8eb9ca0eee37","tests/mpsc.rs":"b982bcae005e8ecc4fac7477d41c83f998ad21793a2fc2097370dbe48dc26889","tests/never.rs":"ee40c4fc4dd5af4983fae8de6927f52b81174d222c162f745b26c4a6c7108e4f","tests/ready.rs":"4361352fa94254041e6c73e97b13be032c2d51c741f2a50519efe3000cf4dc28","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"101ea8afd9a40d24c2d2aec29e5f2fdc4faac51aa1d7c9fe077b364f12edd206","tests/select_macro.rs":"25c43b7705f45f882b0d939b149119dbf2f833abecdc21c13df2e9bf8eeae114","tests/thread_locals.rs":"f42fcddca959b3b44cd545b92949d65e33a54332b27f490ec92f9f29b7f8290c","tests/tick.rs":"5f697bd14c48505d932e82065b5302ef668e1cc19cac18e8ac22e0c83c221c1d","tests/zero.rs":"9c5af802d5efb2c711f8242b8905ed29cc2601e48dbd95e41c7e6fbfe2918398"},"package":"176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b"} \ No newline at end of file diff --git a/vendor/crossbeam-channel/CHANGELOG.md b/vendor/crossbeam-channel/CHANGELOG.md index 6a405ee73..2f172fb67 100644 --- a/vendor/crossbeam-channel/CHANGELOG.md +++ b/vendor/crossbeam-channel/CHANGELOG.md @@ -1,3 +1,16 @@ +# Version 0.5.11 + +- Remove dependency on `cfg-if`. (#1072) + +# Version 0.5.10 + +- Relax the minimum supported Rust version to 1.60. (#1056) +- Optimize `Drop` implementation of bounded channel. (#1057) + +# Version 0.5.9 + +- Bump the minimum supported Rust version to 1.61. (#1037) + # Version 0.5.8 - Fix race condition in unbounded channel. (#972) diff --git a/vendor/crossbeam-channel/Cargo.lock b/vendor/crossbeam-channel/Cargo.lock index 27caf373f..051ab4741 100644 --- a/vendor/crossbeam-channel/Cargo.lock +++ b/vendor/crossbeam-channel/Cargo.lock @@ -10,9 +10,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" dependencies = [ - "cfg-if", "crossbeam-utils", "num_cpus", "rand", @@ -21,18 +20,18 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -41,24 +40,21 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "libc" -version = "0.2.141" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -102,9 +98,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", diff --git a/vendor/crossbeam-channel/Cargo.toml b/vendor/crossbeam-channel/Cargo.toml index 6441fa4b8..8b648679c 100644 --- a/vendor/crossbeam-channel/Cargo.toml +++ b/vendor/crossbeam-channel/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" -rust-version = "1.38" +edition = "2021" +rust-version = "1.60" name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" description = "Multi-producer multi-consumer channels for message passing" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel" readme = "README.md" @@ -32,12 +32,8 @@ categories = [ license = "MIT OR Apache-2.0" repository = "https://github.com/crossbeam-rs/crossbeam" -[dependencies.cfg-if] -version = "1" - [dependencies.crossbeam-utils] -version = "0.8" -optional = true +version = "0.8.18" default-features = false [dev-dependencies.num_cpus] diff --git a/vendor/crossbeam-channel/README.md b/vendor/crossbeam-channel/README.md index 4c42d863c..a8a1a7831 100644 --- a/vendor/crossbeam-channel/README.md +++ b/vendor/crossbeam-channel/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel#license) https://crates.io/crates/crossbeam-channel) [![Documentation](https://docs.rs/crossbeam-channel/badge.svg)]( https://docs.rs/crossbeam-channel) -[![Rust 1.38+](https://img.shields.io/badge/rust-1.38+-lightgray.svg)]( +[![Rust 1.60+](https://img.shields.io/badge/rust-1.60+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.com/invite/JXYwgWZ) @@ -48,7 +48,7 @@ crossbeam-channel = "0.5" Crossbeam Channel supports stable Rust releases going back at least six months, and every time the minimum supported Rust version is increased, a new minor -version is released. Currently, the minimum supported Rust version is 1.38. +version is released. Currently, the minimum supported Rust version is 1.60. ## License diff --git a/vendor/crossbeam-channel/src/flavors/array.rs b/vendor/crossbeam-channel/src/flavors/array.rs index 63b82eb85..ccc47b527 100644 --- a/vendor/crossbeam-channel/src/flavors/array.rs +++ b/vendor/crossbeam-channel/src/flavors/array.rs @@ -9,7 +9,7 @@ //! - use std::cell::UnsafeCell; -use std::mem::MaybeUninit; +use std::mem::{self, MaybeUninit}; use std::ptr; use std::sync::atomic::{self, AtomicUsize, Ordering}; use std::time::Instant; @@ -520,37 +520,38 @@ impl Channel { impl Drop for Channel { fn drop(&mut self) { - // Get the index of the head. - let head = *self.head.get_mut(); - let tail = *self.tail.get_mut(); + if mem::needs_drop::() { + // Get the index of the head. + let head = *self.head.get_mut(); + let tail = *self.tail.get_mut(); - let hix = head & (self.mark_bit - 1); - let tix = tail & (self.mark_bit - 1); + let hix = head & (self.mark_bit - 1); + let tix = tail & (self.mark_bit - 1); - let len = if hix < tix { - tix - hix - } else if hix > tix { - self.cap - hix + tix - } else if (tail & !self.mark_bit) == head { - 0 - } else { - self.cap - }; - - // Loop over all slots that hold a message and drop them. - for i in 0..len { - // Compute the index of the next slot holding a message. - let index = if hix + i < self.cap { - hix + i + let len = if hix < tix { + tix - hix + } else if hix > tix { + self.cap - hix + tix + } else if (tail & !self.mark_bit) == head { + 0 } else { - hix + i - self.cap + self.cap }; - unsafe { - debug_assert!(index < self.buffer.len()); - let slot = self.buffer.get_unchecked_mut(index); - let msg = &mut *slot.msg.get(); - msg.as_mut_ptr().drop_in_place(); + // Loop over all slots that hold a message and drop them. + for i in 0..len { + // Compute the index of the next slot holding a message. + let index = if hix + i < self.cap { + hix + i + } else { + hix + i - self.cap + }; + + unsafe { + debug_assert!(index < self.buffer.len()); + let slot = self.buffer.get_unchecked_mut(index); + (*slot.msg.get()).assume_init_drop(); + } } } } diff --git a/vendor/crossbeam-channel/src/flavors/list.rs b/vendor/crossbeam-channel/src/flavors/list.rs index 230edd8d2..638d6c2ba 100644 --- a/vendor/crossbeam-channel/src/flavors/list.rs +++ b/vendor/crossbeam-channel/src/flavors/list.rs @@ -604,8 +604,7 @@ impl Channel { // Drop the message in the slot. let slot = (*block).slots.get_unchecked(offset); slot.wait_write(); - let p = &mut *slot.msg.get(); - p.as_mut_ptr().drop_in_place(); + (*slot.msg.get()).assume_init_drop(); } else { (*block).wait_next(); // Deallocate the block and move to the next one. @@ -663,8 +662,7 @@ impl Drop for Channel { if offset < BLOCK_CAP { // Drop the message in the slot. let slot = (*block).slots.get_unchecked(offset); - let p = &mut *slot.msg.get(); - p.as_mut_ptr().drop_in_place(); + (*slot.msg.get()).assume_init_drop(); } else { // Deallocate the block and move to the next one. let next = *(*block).next.get_mut(); diff --git a/vendor/crossbeam-channel/src/lib.rs b/vendor/crossbeam-channel/src/lib.rs index cc1ef112f..0bb98a282 100644 --- a/vendor/crossbeam-channel/src/lib.rs +++ b/vendor/crossbeam-channel/src/lib.rs @@ -336,36 +336,40 @@ )] #![cfg_attr(not(feature = "std"), no_std)] -use cfg_if::cfg_if; +#[cfg(feature = "std")] +mod channel; +#[cfg(feature = "std")] +mod context; +#[cfg(feature = "std")] +mod counter; +#[cfg(feature = "std")] +mod err; +#[cfg(feature = "std")] +mod flavors; +#[cfg(feature = "std")] +mod select; +#[cfg(feature = "std")] +mod select_macro; +#[cfg(feature = "std")] +mod utils; +#[cfg(feature = "std")] +mod waker; -cfg_if! { - if #[cfg(feature = "std")] { - mod channel; - mod context; - mod counter; - mod err; - mod flavors; - mod select; - mod select_macro; - mod utils; - mod waker; - - /// Crate internals used by the `select!` macro. - #[doc(hidden)] - pub mod internal { - pub use crate::select::SelectHandle; - pub use crate::select::{select, select_timeout, try_select}; - } - - pub use crate::channel::{after, at, never, tick}; - pub use crate::channel::{bounded, unbounded}; - pub use crate::channel::{IntoIter, Iter, TryIter}; - pub use crate::channel::{Receiver, Sender}; - - pub use crate::select::{Select, SelectedOperation}; - - pub use crate::err::{ReadyTimeoutError, SelectTimeoutError, TryReadyError, TrySelectError}; - pub use crate::err::{RecvError, RecvTimeoutError, TryRecvError}; - pub use crate::err::{SendError, SendTimeoutError, TrySendError}; - } +/// Crate internals used by the `select!` macro. +#[doc(hidden)] +#[cfg(feature = "std")] +pub mod internal { + pub use crate::select::{select, select_timeout, try_select, SelectHandle}; } + +#[cfg(feature = "std")] +pub use crate::{ + channel::{ + after, at, bounded, never, tick, unbounded, IntoIter, Iter, Receiver, Sender, TryIter, + }, + err::{ + ReadyTimeoutError, RecvError, RecvTimeoutError, SelectTimeoutError, SendError, + SendTimeoutError, TryReadyError, TryRecvError, TrySelectError, TrySendError, + }, + select::{Select, SelectedOperation}, +}; diff --git a/vendor/crossbeam-channel/src/select_macro.rs b/vendor/crossbeam-channel/src/select_macro.rs index efe0ae406..43932a668 100644 --- a/vendor/crossbeam-channel/src/select_macro.rs +++ b/vendor/crossbeam-channel/src/select_macro.rs @@ -685,7 +685,7 @@ macro_rules! crossbeam_channel_internal { $default:tt ) => {{ const _LEN: usize = $crate::crossbeam_channel_internal!(@count ($($cases)*)); - let _handle: &$crate::internal::SelectHandle = &$crate::never::<()>(); + let _handle: &dyn $crate::internal::SelectHandle = &$crate::never::<()>(); #[allow(unused_mut)] let mut _sel = [(_handle, 0, ::std::ptr::null()); _LEN]; diff --git a/vendor/crossbeam-channel/src/utils.rs b/vendor/crossbeam-channel/src/utils.rs index f623f2708..705ca1a2d 100644 --- a/vendor/crossbeam-channel/src/utils.rs +++ b/vendor/crossbeam-channel/src/utils.rs @@ -13,7 +13,7 @@ pub(crate) fn shuffle(v: &mut [T]) { } thread_local! { - static RNG: Cell> = Cell::new(Wrapping(1_406_868_647)); + static RNG: Cell> = const { Cell::new(Wrapping(1_406_868_647)) }; } let _ = RNG.try_with(|rng| { diff --git a/vendor/crossbeam-channel/tests/mpsc.rs b/vendor/crossbeam-channel/tests/mpsc.rs index d7cc8e25f..0cea23393 100644 --- a/vendor/crossbeam-channel/tests/mpsc.rs +++ b/vendor/crossbeam-channel/tests/mpsc.rs @@ -20,11 +20,7 @@ //! - https://github.com/rust-lang/rust/blob/master/COPYRIGHT //! - https://www.rust-lang.org/en-US/legal.html -#![allow( - clippy::drop_copy, - clippy::match_single_binding, - clippy::redundant_clone -)] +#![allow(clippy::match_single_binding, clippy::redundant_clone)] use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError}; use std::sync::mpsc::{SendError, TrySendError}; diff --git a/vendor/crossbeam-channel/tests/ready.rs b/vendor/crossbeam-channel/tests/ready.rs index 6e3fb2b64..ca84f869c 100644 --- a/vendor/crossbeam-channel/tests/ready.rs +++ b/vendor/crossbeam-channel/tests/ready.rs @@ -1,7 +1,5 @@ //! Tests for channel readiness using the `Select` struct. -#![allow(clippy::drop_copy)] - use std::any::Any; use std::cell::Cell; use std::thread; diff --git a/vendor/crossbeam-channel/tests/select.rs b/vendor/crossbeam-channel/tests/select.rs index bc5824dab..38178404d 100644 --- a/vendor/crossbeam-channel/tests/select.rs +++ b/vendor/crossbeam-channel/tests/select.rs @@ -1,7 +1,5 @@ //! Tests for channel selection using the `Select` struct. -#![allow(clippy::drop_copy)] - use std::any::Any; use std::cell::Cell; use std::thread; diff --git a/vendor/crossbeam-channel/tests/select_macro.rs b/vendor/crossbeam-channel/tests/select_macro.rs index 119454cd6..c48080975 100644 --- a/vendor/crossbeam-channel/tests/select_macro.rs +++ b/vendor/crossbeam-channel/tests/select_macro.rs @@ -1,7 +1,7 @@ //! Tests for the `select!` macro. #![forbid(unsafe_code)] // select! is safe. -#![allow(clippy::drop_copy, clippy::match_single_binding)] +#![allow(clippy::match_single_binding)] use std::any::Any; use std::cell::Cell; @@ -1212,32 +1212,32 @@ fn result_types() { let (_, r) = bounded::(0); select! { - recv(r) -> res => drop::>(res), + recv(r) -> res => { let _: Result = res; }, } select! { - recv(r) -> res => drop::>(res), + recv(r) -> res => { let _: Result = res; }, default => {} } select! { - recv(r) -> res => drop::>(res), + recv(r) -> res => { let _: Result = res; }, default(ms(0)) => {} } select! { - send(s, 0) -> res => drop::>>(res), + send(s, 0) -> res => { let _: Result<(), SendError> = res; }, } select! { - send(s, 0) -> res => drop::>>(res), + send(s, 0) -> res => { let _: Result<(), SendError> = res; }, default => {} } select! { - send(s, 0) -> res => drop::>>(res), + send(s, 0) -> res => { let _: Result<(), SendError> = res; }, default(ms(0)) => {} } select! { - send(s, 0) -> res => drop::>>(res), - recv(r) -> res => drop::>(res), + send(s, 0) -> res => { let _: Result<(), SendError> = res; }, + recv(r) -> res => { let _: Result = res; }, } } diff --git a/vendor/crossbeam-channel/tests/thread_locals.rs b/vendor/crossbeam-channel/tests/thread_locals.rs index fb4e577f2..4639833aa 100644 --- a/vendor/crossbeam-channel/tests/thread_locals.rs +++ b/vendor/crossbeam-channel/tests/thread_locals.rs @@ -30,7 +30,7 @@ fn use_while_exiting() { } thread_local! { - static FOO: Foo = Foo; + static FOO: Foo = const { Foo }; } let (s, r) = unbounded::<()>(); diff --git a/vendor/crossbeam-utils/.cargo-checksum.json b/vendor/crossbeam-utils/.cargo-checksum.json index 4f56aae93..f6317cba2 100644 --- a/vendor/crossbeam-utils/.cargo-checksum.json +++ b/vendor/crossbeam-utils/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"cb1ed07b5828eaa1f8b8ef68ab4332c479000dd8585d4f62f34c5fd97c96981a","Cargo.toml":"802d99b09fef821afec338d876fe2285cd16cae3e971526251adaf5e34a9c275","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"2a19af38a52dd965c2d66bb39f90a85b430b51ee9ccb29e9e1978ee7091e5087","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build-common.rs":"502cb7494549bed6fa10ac7bea36e880eeb60290dc69b679ac5c92b376469562","build.rs":"ec1d47ec36b3670a6e67955a104851ee7125616888e78bd03b93304e12cd1c50","no_atomic.rs":"5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94","src/atomic/atomic_cell.rs":"0fc99463e633144c5d59d39c35b5477da1f1b90f5448cadc37454b7f4b97707e","src/atomic/consume.rs":"7a7736fcd64f6473dfea7653559ffc5e1a2a234df43835f8aa8734862145ac15","src/atomic/mod.rs":"94193895fa03cece415e8d7be700b73a9a8a7015774ca821253438607f9b0736","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"8fd5e3dcccc05860680e49c8498de8096bee9140bcfee8723d97117106a020d0","src/cache_padded.rs":"24dc95e68c5cd83744b10b0e41072dd39f49f1573c6ceac826837a662a11916e","src/lib.rs":"6f1bcf157abe06ad8458a53e865bf8efab9fad4a9424790147cee8fefb3795d8","src/sync/mod.rs":"eca73c04f821859b8434d2b93db87d160dc6a3f65498ca201cd40d732ca4c134","src/sync/once_lock.rs":"c03dc9c05a817e087dccf8b682f7307501542805533551da3c2bab442bc40743","src/sync/parker.rs":"be78811af56277fcd983f7f3303cfc8686c7b1b676a4a39f22d7fc2d96b53e6b","src/sync/sharded_lock.rs":"f27cff33fd00cb6cee51cdb2d429df99ae4b81a1fefb99655ae7e3506f534fd1","src/sync/wait_group.rs":"3e339aab014f50e214fea535c841755113ea058153378ed54e50a4acb403c937","src/thread.rs":"1c8273582381a2e1daedf59685d8c0798306d2cd2dde0945035455b03788169f","tests/atomic_cell.rs":"9dacf69273288b4689b88957e2920580d27dcb1a1fb9f34e2029a28cf6b9121c","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"314adeb8a651a28935f7a49c9a261b8fa1fd82bf6a16c865a5aced6216d7e40b","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"02661c2a820a5abe8b0c8fe15a6650aead707b57cdda0610d1b09a2680ed6969"},"package":"5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"} \ No newline at end of file +{"files":{"CHANGELOG.md":"d7909ae4ead8b43562d21228996e55da832b4a07afaa2c1f0cb99d6434f70bc3","Cargo.toml":"13f1b9770df2e39284906c62f32ac71bdeff4b9da966c1d3583572de20ee8faa","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"3c82bbb994f54ab76a9ed30a42dfd095c6e636258d379b9be3fbf66324310e71","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build-common.rs":"502cb7494549bed6fa10ac7bea36e880eeb60290dc69b679ac5c92b376469562","build.rs":"34da4dc8f582959d727db84557cce37e1d2d54e8db78d355135774e70e0a7864","no_atomic.rs":"31a8276afd38e39987a169eeb02e9bed32670de5ca36d7eb74aab7e506cf9dc4","src/atomic/atomic_cell.rs":"cc7078265c6df82f544eb1adf0962ee9fffbb650b8f793d57047afbf205022ac","src/atomic/consume.rs":"381c2a8b13312ca0525d53ca1b7d0d4f525ddb154951fa3e216b061ad22012ff","src/atomic/mod.rs":"6e729c1829e958a7382870e082afe79109a58c6f6bf98590b68f8d1106c52b13","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"8715f0303ec91d1847c8ac3fc24bcc002a22a7284ade610e5eff4181f85827c7","src/cache_padded.rs":"e5a4cb14c343f161a01692dddc91efa441724dff980e0a74690faf32ef21e076","src/lib.rs":"c8c994e21ac6e2de2699a225c7ca580a6f6a0faae8da68a46f5ff69aad2eca9d","src/sync/mod.rs":"eca73c04f821859b8434d2b93db87d160dc6a3f65498ca201cd40d732ca4c134","src/sync/once_lock.rs":"aa8f957604d1119c4fc7038a18c14a6281230e81005f31201c099acff284ad4b","src/sync/parker.rs":"698996e7530da1f3815df11c89df7d916155229cbfd022cccbd555f1d1d31985","src/sync/sharded_lock.rs":"f27cff33fd00cb6cee51cdb2d429df99ae4b81a1fefb99655ae7e3506f534fd1","src/sync/wait_group.rs":"3e339aab014f50e214fea535c841755113ea058153378ed54e50a4acb403c937","src/thread.rs":"0b7577bbbac46fab2d15d1f2756a13dbdedafdb06ad535aa8d9c34c268747e4e","tests/atomic_cell.rs":"716c864d4e103039dc5cd8bf6110da4cbabafc7e4e03819aa197828e8fb0a9c7","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"314adeb8a651a28935f7a49c9a261b8fa1fd82bf6a16c865a5aced6216d7e40b","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"2a41533a5f7f113d19cd2bdafcc2abf86509109652274156efdd74abd00896b6"},"package":"248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"} \ No newline at end of file diff --git a/vendor/crossbeam-utils/CHANGELOG.md b/vendor/crossbeam-utils/CHANGELOG.md index 4dea4cc33..f6f346381 100644 --- a/vendor/crossbeam-utils/CHANGELOG.md +++ b/vendor/crossbeam-utils/CHANGELOG.md @@ -1,3 +1,22 @@ +# Version 0.8.19 + +- Remove dependency on `cfg-if`. (#1072) + +# Version 0.8.18 + +- Relax the minimum supported Rust version to 1.60. (#1056) +- Improve scalability of `AtomicCell` fallback. (#1055) + +# Version 0.8.17 + +- Bump the minimum supported Rust version to 1.61. (#1037) +- Improve support for targets without atomic CAS or 64-bit atomic. (#1037) +- Always implement `UnwindSafe` and `RefUnwindSafe` for `AtomicCell`. (#1045) +- Improve compatibility with Miri, TSan, and loom. (#995, #1003) +- Improve compatibility with unstable `oom=panic`. (#1045) +- Improve implementation of `CachePadded`. (#1014, #1025) +- Update `loom` dependency to 0.7. + # Version 0.8.16 - Improve implementation of `CachePadded`. (#967) diff --git a/vendor/crossbeam-utils/Cargo.toml b/vendor/crossbeam-utils/Cargo.toml index a2861fc56..180f72130 100644 --- a/vendor/crossbeam-utils/Cargo.toml +++ b/vendor/crossbeam-utils/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" -rust-version = "1.38" +edition = "2021" +rust-version = "1.60" name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" description = "Utilities for concurrent programming" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" readme = "README.md" @@ -32,20 +32,16 @@ categories = [ license = "MIT OR Apache-2.0" repository = "https://github.com/crossbeam-rs/crossbeam" -[dependencies.cfg-if] -version = "1" +[dependencies] [dev-dependencies.rand] version = "0.8" -[dev-dependencies.rustversion] -version = "1" - [features] default = ["std"] nightly = [] std = [] [target."cfg(crossbeam_loom)".dependencies.loom] -version = "0.5" +version = "0.7.1" optional = true diff --git a/vendor/crossbeam-utils/README.md b/vendor/crossbeam-utils/README.md index c06ea601a..7d6a67948 100644 --- a/vendor/crossbeam-utils/README.md +++ b/vendor/crossbeam-utils/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils#license) https://crates.io/crates/crossbeam-utils) [![Documentation](https://docs.rs/crossbeam-utils/badge.svg)]( https://docs.rs/crossbeam-utils) -[![Rust 1.38+](https://img.shields.io/badge/rust-1.38+-lightgray.svg)]( +[![Rust 1.60+](https://img.shields.io/badge/rust-1.60+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.com/invite/JXYwgWZ) @@ -55,7 +55,7 @@ crossbeam-utils = "0.8" Crossbeam Utils supports stable Rust releases going back at least six months, and every time the minimum supported Rust version is increased, a new minor -version is released. Currently, the minimum supported Rust version is 1.38. +version is released. Currently, the minimum supported Rust version is 1.60. ## License diff --git a/vendor/crossbeam-utils/build.rs b/vendor/crossbeam-utils/build.rs index 617162fb5..c71c23136 100644 --- a/vendor/crossbeam-utils/build.rs +++ b/vendor/crossbeam-utils/build.rs @@ -1,24 +1,12 @@ // The rustc-cfg listed below are considered public API, but it is *unstable* // and outside of the normal semver guarantees: // -// - `crossbeam_no_atomic_cas` -// Assume the target does *not* support atomic CAS operations. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// // - `crossbeam_no_atomic` // Assume the target does *not* support any atomic operations. // This is usually detected automatically by the build script, but you may // need to enable it manually when building for custom targets or using // non-cargo build systems that don't run the build script. // -// - `crossbeam_no_atomic_64` -// Assume the target does *not* support AtomicU64/AtomicI64. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// // With the exceptions mentioned above, the rustc-cfg emitted by the build // script are *not* public API. @@ -30,6 +18,8 @@ include!("no_atomic.rs"); include!("build-common.rs"); fn main() { + println!("cargo:rerun-if-changed=no_atomic.rs"); + let target = match env::var("TARGET") { Ok(target) => convert_custom_linux_target(target), Err(e) => { @@ -45,17 +35,13 @@ fn main() { // Note that this is `no_`*, not `has_*`. This allows treating as the latest // stable rustc is used when the build script doesn't run. This is useful // for non-cargo build systems that don't run the build script. - if NO_ATOMIC_CAS.contains(&&*target) { - println!("cargo:rustc-cfg=crossbeam_no_atomic_cas"); - } if NO_ATOMIC.contains(&&*target) { println!("cargo:rustc-cfg=crossbeam_no_atomic"); - println!("cargo:rustc-cfg=crossbeam_no_atomic_64"); - } else if NO_ATOMIC_64.contains(&&*target) { - println!("cargo:rustc-cfg=crossbeam_no_atomic_64"); - } else { - // Otherwise, assuming `"max-atomic-width" == 64` or `"max-atomic-width" == 128`. } - println!("cargo:rerun-if-changed=no_atomic.rs"); + // `cfg(sanitize = "..")` is not stabilized. + let sanitize = env::var("CARGO_CFG_SANITIZE").unwrap_or_default(); + if sanitize.contains("thread") { + println!("cargo:rustc-cfg=crossbeam_sanitize_thread"); + } } diff --git a/vendor/crossbeam-utils/no_atomic.rs b/vendor/crossbeam-utils/no_atomic.rs index 3e19722fc..b97f39706 100644 --- a/vendor/crossbeam-utils/no_atomic.rs +++ b/vendor/crossbeam-utils/no_atomic.rs @@ -1,75 +1,7 @@ // This file is @generated by no_atomic.sh. // It is not intended for manual editing. -const NO_ATOMIC_CAS: &[&str] = &[ - "armv4t-none-eabi", - "armv5te-none-eabi", - "avr-unknown-gnu-atmega328", - "bpfeb-unknown-none", - "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", -]; - -#[allow(dead_code)] // Only crossbeam-utils uses this. -const NO_ATOMIC_64: &[&str] = &[ - "arm-linux-androideabi", - "armv4t-none-eabi", - "armv4t-unknown-linux-gnueabi", - "armv5te-none-eabi", - "armv5te-unknown-linux-gnueabi", - "armv5te-unknown-linux-musleabi", - "armv5te-unknown-linux-uclibceabi", - "armv6k-nintendo-3ds", - "avr-unknown-gnu-atmega328", - "hexagon-unknown-linux-musl", - "m68k-unknown-linux-gnu", - "mips-unknown-linux-gnu", - "mips-unknown-linux-musl", - "mips-unknown-linux-uclibc", - "mipsel-sony-psp", - "mipsel-sony-psx", - "mipsel-unknown-linux-gnu", - "mipsel-unknown-linux-musl", - "mipsel-unknown-linux-uclibc", - "mipsel-unknown-none", - "mipsisa32r6-unknown-linux-gnu", - "mipsisa32r6el-unknown-linux-gnu", - "msp430-none-elf", - "powerpc-unknown-freebsd", - "powerpc-unknown-linux-gnu", - "powerpc-unknown-linux-gnuspe", - "powerpc-unknown-linux-musl", - "powerpc-unknown-netbsd", - "powerpc-unknown-openbsd", - "powerpc-wrs-vxworks", - "powerpc-wrs-vxworks-spe", - "riscv32gc-unknown-linux-gnu", - "riscv32gc-unknown-linux-musl", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imac-unknown-none-elf", - "riscv32imac-unknown-xous-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", - "thumbv7em-none-eabi", - "thumbv7em-none-eabihf", - "thumbv7m-none-eabi", - "thumbv8m.base-none-eabi", - "thumbv8m.main-none-eabi", - "thumbv8m.main-none-eabihf", -]; - -#[allow(dead_code)] // Only crossbeam-utils uses this. const NO_ATOMIC: &[&str] = &[ - "avr-unknown-gnu-atmega328", "bpfeb-unknown-none", "bpfel-unknown-none", "mipsel-sony-psx", diff --git a/vendor/crossbeam-utils/src/atomic/atomic_cell.rs b/vendor/crossbeam-utils/src/atomic/atomic_cell.rs index 7941c5c87..06ccf2eb5 100644 --- a/vendor/crossbeam-utils/src/atomic/atomic_cell.rs +++ b/vendor/crossbeam-utils/src/atomic/atomic_cell.rs @@ -1,18 +1,15 @@ // Necessary for implementing atomic methods for `AtomicUnit` #![allow(clippy::unit_arg)] -use crate::primitive::sync::atomic::{self, AtomicBool}; +use crate::primitive::sync::atomic::{self, Ordering}; +use crate::CachePadded; use core::cell::UnsafeCell; use core::cmp; use core::fmt; use core::mem::{self, ManuallyDrop, MaybeUninit}; -use core::sync::atomic::Ordering; - +use core::panic::{RefUnwindSafe, UnwindSafe}; use core::ptr; -#[cfg(feature = "std")] -use std::panic::{RefUnwindSafe, UnwindSafe}; - use super::seq_lock::SeqLock; /// A thread-safe mutable memory location. @@ -49,9 +46,7 @@ pub struct AtomicCell { unsafe impl Send for AtomicCell {} unsafe impl Sync for AtomicCell {} -#[cfg(feature = "std")] impl UnwindSafe for AtomicCell {} -#[cfg(feature = "std")] impl RefUnwindSafe for AtomicCell {} impl AtomicCell { @@ -322,6 +317,36 @@ impl Drop for AtomicCell { } } +macro_rules! atomic { + // If values of type `$t` can be transmuted into values of the primitive atomic type `$atomic`, + // declares variable `$a` of type `$atomic` and executes `$atomic_op`, breaking out of the loop. + (@check, $t:ty, $atomic:ty, $a:ident, $atomic_op:expr) => { + if can_transmute::<$t, $atomic>() { + let $a: &$atomic; + break $atomic_op; + } + }; + + // If values of type `$t` can be transmuted into values of a primitive atomic type, declares + // variable `$a` of that type and executes `$atomic_op`. Otherwise, just executes + // `$fallback_op`. + ($t:ty, $a:ident, $atomic_op:expr, $fallback_op:expr) => { + loop { + atomic!(@check, $t, AtomicUnit, $a, $atomic_op); + + atomic!(@check, $t, atomic::AtomicU8, $a, $atomic_op); + atomic!(@check, $t, atomic::AtomicU16, $a, $atomic_op); + atomic!(@check, $t, atomic::AtomicU32, $a, $atomic_op); + #[cfg(target_has_atomic = "64")] + atomic!(@check, $t, atomic::AtomicU64, $a, $atomic_op); + // TODO: AtomicU128 is unstable + // atomic!(@check, $t, atomic::AtomicU128, $a, $atomic_op); + + break $fallback_op; + } + }; +} + macro_rules! impl_arithmetic { ($t:ty, fallback, $example:tt) => { impl AtomicCell<$t> { @@ -500,7 +525,7 @@ macro_rules! impl_arithmetic { } } }; - ($t:ty, $atomic:ty, $example:tt) => { + ($t:ty, $atomic:ident, $example:tt) => { impl AtomicCell<$t> { /// Increments the current value by `val` and returns the previous value. /// @@ -518,15 +543,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_add(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_add(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value = value.wrapping_add(val); - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_add(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = value.wrapping_add(val); + old + } } } @@ -546,15 +575,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_sub(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_sub(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value = value.wrapping_sub(val); - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_sub(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = value.wrapping_sub(val); + old + } } } @@ -572,15 +605,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_and(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_and(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value &= val; - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_and(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value &= val; + old + } } } @@ -598,15 +635,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_nand(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_nand(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value = !(old & val); - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_nand(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = !(old & val); + old + } } } @@ -624,15 +665,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_or(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_or(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value |= val; - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_or(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value |= val; + old + } } } @@ -650,15 +695,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_xor(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - let a = unsafe { &*(self.as_ptr() as *const $atomic) }; - a.fetch_xor(val, Ordering::AcqRel) - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value ^= val; - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_xor(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value ^= val; + old + } } } @@ -677,15 +726,19 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_max(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - // TODO: Atomic*::fetch_max requires Rust 1.45. - self.fetch_update(|old| Some(cmp::max(old, val))).unwrap() - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value = cmp::max(old, val); - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_max(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = cmp::max(old, val); + old + } } } @@ -704,51 +757,50 @@ macro_rules! impl_arithmetic { /// ``` #[inline] pub fn fetch_min(&self, val: $t) -> $t { - if can_transmute::<$t, $atomic>() { - // TODO: Atomic*::fetch_min requires Rust 1.45. - self.fetch_update(|old| Some(cmp::min(old, val))).unwrap() - } else { - let _guard = lock(self.as_ptr() as usize).write(); - let value = unsafe { &mut *(self.as_ptr()) }; - let old = *value; - *value = cmp::min(old, val); - old + atomic! { + $t, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::$atomic) }; + a.fetch_min(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = cmp::min(old, val); + old + } } } } }; } -impl_arithmetic!(u8, atomic::AtomicU8, "let a = AtomicCell::new(7u8);"); -impl_arithmetic!(i8, atomic::AtomicI8, "let a = AtomicCell::new(7i8);"); -impl_arithmetic!(u16, atomic::AtomicU16, "let a = AtomicCell::new(7u16);"); -impl_arithmetic!(i16, atomic::AtomicI16, "let a = AtomicCell::new(7i16);"); -impl_arithmetic!(u32, atomic::AtomicU32, "let a = AtomicCell::new(7u32);"); -impl_arithmetic!(i32, atomic::AtomicI32, "let a = AtomicCell::new(7i32);"); -#[cfg(not(crossbeam_no_atomic_64))] -impl_arithmetic!(u64, atomic::AtomicU64, "let a = AtomicCell::new(7u64);"); -#[cfg(not(crossbeam_no_atomic_64))] -impl_arithmetic!(i64, atomic::AtomicI64, "let a = AtomicCell::new(7i64);"); -#[cfg(crossbeam_no_atomic_64)] +impl_arithmetic!(u8, AtomicU8, "let a = AtomicCell::new(7u8);"); +impl_arithmetic!(i8, AtomicI8, "let a = AtomicCell::new(7i8);"); +impl_arithmetic!(u16, AtomicU16, "let a = AtomicCell::new(7u16);"); +impl_arithmetic!(i16, AtomicI16, "let a = AtomicCell::new(7i16);"); + +impl_arithmetic!(u32, AtomicU32, "let a = AtomicCell::new(7u32);"); +impl_arithmetic!(i32, AtomicI32, "let a = AtomicCell::new(7i32);"); + +#[cfg(target_has_atomic = "64")] +impl_arithmetic!(u64, AtomicU64, "let a = AtomicCell::new(7u64);"); +#[cfg(target_has_atomic = "64")] +impl_arithmetic!(i64, AtomicI64, "let a = AtomicCell::new(7i64);"); +#[cfg(not(target_has_atomic = "64"))] impl_arithmetic!(u64, fallback, "let a = AtomicCell::new(7u64);"); -#[cfg(crossbeam_no_atomic_64)] +#[cfg(not(target_has_atomic = "64"))] impl_arithmetic!(i64, fallback, "let a = AtomicCell::new(7i64);"); + // TODO: AtomicU128 is unstable -// impl_arithmetic!(u128, atomic::AtomicU128, "let a = AtomicCell::new(7u128);"); -// impl_arithmetic!(i128, atomic::AtomicI128, "let a = AtomicCell::new(7i128);"); +// impl_arithmetic!(u128, AtomicU128, "let a = AtomicCell::new(7u128);"); +// impl_arithmetic!(i128, AtomicI128, "let a = AtomicCell::new(7i128);"); impl_arithmetic!(u128, fallback, "let a = AtomicCell::new(7u128);"); impl_arithmetic!(i128, fallback, "let a = AtomicCell::new(7i128);"); -impl_arithmetic!( - usize, - atomic::AtomicUsize, - "let a = AtomicCell::new(7usize);" -); -impl_arithmetic!( - isize, - atomic::AtomicIsize, - "let a = AtomicCell::new(7isize);" -); +impl_arithmetic!(usize, AtomicUsize, "let a = AtomicCell::new(7usize);"); +impl_arithmetic!(isize, AtomicIsize, "let a = AtomicCell::new(7isize);"); impl AtomicCell { /// Applies logical "and" to the current value and returns the previous value. @@ -768,8 +820,20 @@ impl AtomicCell { /// ``` #[inline] pub fn fetch_and(&self, val: bool) -> bool { - let a = unsafe { &*(self.as_ptr() as *const AtomicBool) }; - a.fetch_and(val, Ordering::AcqRel) + atomic! { + bool, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::AtomicBool) }; + a.fetch_and(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value &= val; + old + } + } } /// Applies logical "nand" to the current value and returns the previous value. @@ -792,8 +856,20 @@ impl AtomicCell { /// ``` #[inline] pub fn fetch_nand(&self, val: bool) -> bool { - let a = unsafe { &*(self.as_ptr() as *const AtomicBool) }; - a.fetch_nand(val, Ordering::AcqRel) + atomic! { + bool, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::AtomicBool) }; + a.fetch_nand(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value = !(old & val); + old + } + } } /// Applies logical "or" to the current value and returns the previous value. @@ -813,8 +889,20 @@ impl AtomicCell { /// ``` #[inline] pub fn fetch_or(&self, val: bool) -> bool { - let a = unsafe { &*(self.as_ptr() as *const AtomicBool) }; - a.fetch_or(val, Ordering::AcqRel) + atomic! { + bool, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::AtomicBool) }; + a.fetch_or(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value |= val; + old + } + } } /// Applies logical "xor" to the current value and returns the previous value. @@ -834,8 +922,20 @@ impl AtomicCell { /// ``` #[inline] pub fn fetch_xor(&self, val: bool) -> bool { - let a = unsafe { &*(self.as_ptr() as *const AtomicBool) }; - a.fetch_xor(val, Ordering::AcqRel) + atomic! { + bool, _a, + { + let a = unsafe { &*(self.as_ptr() as *const atomic::AtomicBool) }; + a.fetch_xor(val, Ordering::AcqRel) + }, + { + let _guard = lock(self.as_ptr() as usize).write(); + let value = unsafe { &mut *(self.as_ptr()) }; + let old = *value; + *value ^= val; + old + } + } } } @@ -899,10 +999,10 @@ fn lock(addr: usize) -> &'static SeqLock { // Now, if we have a slice of type `&[Foo]`, it is possible that field `a` in all items gets // stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3. // In order to protect from such cases, we simply choose a large prime number for `LEN`. - const LEN: usize = 97; + const LEN: usize = 67; #[allow(clippy::declare_interior_mutable_const)] - const L: SeqLock = SeqLock::new(); - static LOCKS: [SeqLock; LEN] = [L; LEN]; + const L: CachePadded = CachePadded::new(SeqLock::new()); + static LOCKS: [CachePadded; LEN] = [L; LEN]; // If the modulus is a constant number, the compiler will use crazy math to transform this into // a sequence of cheap arithmetic operations rather than using the slow modulo instruction. @@ -936,48 +1036,9 @@ impl AtomicUnit { } } -macro_rules! atomic { - // If values of type `$t` can be transmuted into values of the primitive atomic type `$atomic`, - // declares variable `$a` of type `$atomic` and executes `$atomic_op`, breaking out of the loop. - (@check, $t:ty, $atomic:ty, $a:ident, $atomic_op:expr) => { - if can_transmute::<$t, $atomic>() { - let $a: &$atomic; - break $atomic_op; - } - }; - - // If values of type `$t` can be transmuted into values of a primitive atomic type, declares - // variable `$a` of that type and executes `$atomic_op`. Otherwise, just executes - // `$fallback_op`. - ($t:ty, $a:ident, $atomic_op:expr, $fallback_op:expr) => { - loop { - atomic!(@check, $t, AtomicUnit, $a, $atomic_op); - - atomic!(@check, $t, atomic::AtomicU8, $a, $atomic_op); - atomic!(@check, $t, atomic::AtomicU16, $a, $atomic_op); - atomic!(@check, $t, atomic::AtomicU32, $a, $atomic_op); - #[cfg(not(crossbeam_no_atomic_64))] - atomic!(@check, $t, atomic::AtomicU64, $a, $atomic_op); - // TODO: AtomicU128 is unstable - // atomic!(@check, $t, atomic::AtomicU128, $a, $atomic_op); - - break $fallback_op; - } - }; -} - /// Returns `true` if operations on `AtomicCell` are lock-free. const fn atomic_is_lock_free() -> bool { - // HACK(taiki-e): This is equivalent to `atomic! { T, _a, true, false }`, but can be used in const fn even in our MSRV (Rust 1.38). - let is_lock_free = can_transmute::() - | can_transmute::() - | can_transmute::() - | can_transmute::(); - #[cfg(not(crossbeam_no_atomic_64))] - let is_lock_free = is_lock_free | can_transmute::(); - // TODO: AtomicU128 is unstable - // let is_lock_free = is_lock_free | can_transmute::(); - is_lock_free + atomic! { T, _a, true, false } } /// Atomically reads data from `src`. diff --git a/vendor/crossbeam-utils/src/atomic/consume.rs b/vendor/crossbeam-utils/src/atomic/consume.rs index 277b370a5..ff8e316b2 100644 --- a/vendor/crossbeam-utils/src/atomic/consume.rs +++ b/vendor/crossbeam-utils/src/atomic/consume.rs @@ -1,5 +1,3 @@ -#[cfg(any(target_arch = "arm", target_arch = "aarch64"))] -use crate::primitive::sync::atomic::compiler_fence; #[cfg(not(crossbeam_no_atomic))] use core::sync::atomic::Ordering; @@ -27,11 +25,21 @@ pub trait AtomicConsume { } #[cfg(not(crossbeam_no_atomic))] -#[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +// Miri and Loom don't support "consume" ordering and ThreadSanitizer doesn't treat +// load(Relaxed) + compiler_fence(Acquire) as "consume" load. +// LLVM generates machine code equivalent to fence(Acquire) in compiler_fence(Acquire) +// on PowerPC, MIPS, etc. (https://godbolt.org/z/hffvjvW7h), so for now the fence +// can be actually avoided here only on ARM and AArch64. See also +// https://github.com/rust-lang/rust/issues/62256. +#[cfg(all( + any(target_arch = "arm", target_arch = "aarch64"), + not(any(miri, crossbeam_loom, crossbeam_sanitize_thread)), +))] macro_rules! impl_consume { () => { #[inline] fn load_consume(&self) -> Self::Val { + use crate::primitive::sync::atomic::compiler_fence; let result = self.load(Ordering::Relaxed); compiler_fence(Ordering::Acquire); result @@ -40,7 +48,10 @@ macro_rules! impl_consume { } #[cfg(not(crossbeam_no_atomic))] -#[cfg(not(any(target_arch = "arm", target_arch = "aarch64")))] +#[cfg(not(all( + any(target_arch = "arm", target_arch = "aarch64"), + not(any(miri, crossbeam_loom, crossbeam_sanitize_thread)), +)))] macro_rules! impl_consume { () => { #[inline] @@ -72,11 +83,19 @@ impl_atomic!(AtomicU8, u8); impl_atomic!(AtomicI8, i8); impl_atomic!(AtomicU16, u16); impl_atomic!(AtomicI16, i16); +#[cfg(any(target_has_atomic = "32", not(target_pointer_width = "16")))] impl_atomic!(AtomicU32, u32); +#[cfg(any(target_has_atomic = "32", not(target_pointer_width = "16")))] impl_atomic!(AtomicI32, i32); -#[cfg(not(crossbeam_no_atomic_64))] +#[cfg(any( + target_has_atomic = "64", + not(any(target_pointer_width = "16", target_pointer_width = "32")), +))] impl_atomic!(AtomicU64, u64); -#[cfg(not(crossbeam_no_atomic_64))] +#[cfg(any( + target_has_atomic = "64", + not(any(target_pointer_width = "16", target_pointer_width = "32")), +))] impl_atomic!(AtomicI64, i64); #[cfg(not(crossbeam_no_atomic))] diff --git a/vendor/crossbeam-utils/src/atomic/mod.rs b/vendor/crossbeam-utils/src/atomic/mod.rs index 38967859f..7b39fe474 100644 --- a/vendor/crossbeam-utils/src/atomic/mod.rs +++ b/vendor/crossbeam-utils/src/atomic/mod.rs @@ -3,35 +3,30 @@ //! * [`AtomicCell`], a thread-safe mutable memory location. //! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering. -#[cfg(not(crossbeam_no_atomic_cas))] +#[cfg(target_has_atomic = "ptr")] #[cfg(not(crossbeam_loom))] -cfg_if::cfg_if! { - // Use "wide" sequence lock if the pointer width <= 32 for preventing its counter against wrap - // around. - // - // We are ignoring too wide architectures (pointer width >= 256), since such a system will not - // appear in a conceivable future. - // - // In narrow architectures (pointer width <= 16), the counter is still <= 32-bit and may be - // vulnerable to wrap around. But it's mostly okay, since in such a primitive hardware, the - // counter will not be increased that fast. - if #[cfg(any(target_pointer_width = "64", target_pointer_width = "128"))] { - mod seq_lock; - } else { - #[path = "seq_lock_wide.rs"] - mod seq_lock; - } -} +// Use "wide" sequence lock if the pointer width <= 32 for preventing its counter against wrap +// around. +// +// In narrow architectures (pointer width <= 16), the counter is still <= 32-bit and may be +// vulnerable to wrap around. But it's mostly okay, since in such a primitive hardware, the +// counter will not be increased that fast. +// Note that Rust (and C99) pointers must be at least 16-bits: https://github.com/rust-lang/rust/pull/49305 +#[cfg_attr( + any(target_pointer_width = "16", target_pointer_width = "32"), + path = "seq_lock_wide.rs" +)] +mod seq_lock; -#[cfg(not(crossbeam_no_atomic_cas))] +#[cfg(target_has_atomic = "ptr")] // We cannot provide AtomicCell under cfg(crossbeam_loom) because loom's atomic // types have a different in-memory representation than the underlying type. // TODO: The latest loom supports fences, so fallback using seqlock may be available. #[cfg(not(crossbeam_loom))] mod atomic_cell; -mod consume; - -#[cfg(not(crossbeam_no_atomic_cas))] +#[cfg(target_has_atomic = "ptr")] #[cfg(not(crossbeam_loom))] -pub use self::atomic_cell::AtomicCell; -pub use self::consume::AtomicConsume; +pub use atomic_cell::AtomicCell; + +mod consume; +pub use consume::AtomicConsume; diff --git a/vendor/crossbeam-utils/src/backoff.rs b/vendor/crossbeam-utils/src/backoff.rs index 9e256aaf2..7a505ed61 100644 --- a/vendor/crossbeam-utils/src/backoff.rs +++ b/vendor/crossbeam-utils/src/backoff.rs @@ -1,4 +1,4 @@ -use crate::primitive::sync::atomic; +use crate::primitive::hint; use core::cell::Cell; use core::fmt; @@ -145,10 +145,7 @@ impl Backoff { #[inline] pub fn spin(&self) { for _ in 0..1 << self.step.get().min(SPIN_LIMIT) { - // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, - // use [`core::hint::spin_loop`] instead. - #[allow(deprecated)] - atomic::spin_loop_hint(); + hint::spin_loop(); } if self.step.get() <= SPIN_LIMIT { @@ -209,18 +206,12 @@ impl Backoff { pub fn snooze(&self) { if self.step.get() <= SPIN_LIMIT { for _ in 0..1 << self.step.get() { - // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, - // use [`core::hint::spin_loop`] instead. - #[allow(deprecated)] - atomic::spin_loop_hint(); + hint::spin_loop(); } } else { #[cfg(not(feature = "std"))] for _ in 0..1 << self.step.get() { - // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, - // use [`core::hint::spin_loop`] instead. - #[allow(deprecated)] - atomic::spin_loop_hint(); + hint::spin_loop(); } #[cfg(feature = "std")] diff --git a/vendor/crossbeam-utils/src/cache_padded.rs b/vendor/crossbeam-utils/src/cache_padded.rs index 7fce7cc1b..f44f2d7b4 100644 --- a/vendor/crossbeam-utils/src/cache_padded.rs +++ b/vendor/crossbeam-utils/src/cache_padded.rs @@ -14,7 +14,7 @@ use core::ops::{Deref, DerefMut}; /// Cache lines are assumed to be N bytes long, depending on the architecture: /// /// * On x86-64, aarch64, and powerpc64, N = 128. -/// * On arm, mips, mips64, riscv32, riscv64, sparc, and hexagon, N = 32. +/// * On arm, mips, mips64, sparc, and hexagon, N = 32. /// * On m68k, N = 16. /// * On s390x, N = 256. /// * On all others, N = 64. @@ -76,6 +76,7 @@ use core::ops::{Deref, DerefMut}; // // Sources: // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 +// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/powerpc/include/asm/cache.h#L26 #[cfg_attr( any( target_arch = "x86_64", @@ -84,25 +85,22 @@ use core::ops::{Deref, DerefMut}; ), repr(align(128)) )] -// arm, mips, mips64, riscv64, sparc, and hexagon have 32-byte cache line size. +// arm, mips, mips64, sparc, and hexagon have 32-byte cache line size. // // Sources: // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9 -// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 // - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/sparc/include/asm/cache.h#L17 // - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/hexagon/include/asm/cache.h#L12 -// -// riscv32 is assumed not to exceed the cache line size of riscv64. #[cfg_attr( any( target_arch = "arm", target_arch = "mips", + target_arch = "mips32r6", target_arch = "mips64", - target_arch = "riscv32", - target_arch = "riscv64", + target_arch = "mips64r6", target_arch = "sparc", target_arch = "hexagon", ), @@ -119,11 +117,12 @@ use core::ops::{Deref, DerefMut}; // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 // - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/s390/include/asm/cache.h#L13 #[cfg_attr(target_arch = "s390x", repr(align(256)))] -// x86, wasm, and sparc64 have 64-byte cache line size. +// x86, wasm, riscv, and sparc64 have 64-byte cache line size. // // Sources: // - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7 +// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/riscv/include/asm/cache.h#L10 // - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/sparc/include/asm/cache.h#L19 // // All others are assumed to have 64-byte cache line size. @@ -134,9 +133,9 @@ use core::ops::{Deref, DerefMut}; target_arch = "powerpc64", target_arch = "arm", target_arch = "mips", + target_arch = "mips32r6", target_arch = "mips64", - target_arch = "riscv32", - target_arch = "riscv64", + target_arch = "mips64r6", target_arch = "sparc", target_arch = "hexagon", target_arch = "m68k", diff --git a/vendor/crossbeam-utils/src/lib.rs b/vendor/crossbeam-utils/src/lib.rs index 191c5a17d..7206c1ee2 100644 --- a/vendor/crossbeam-utils/src/lib.rs +++ b/vendor/crossbeam-utils/src/lib.rs @@ -42,12 +42,14 @@ #[cfg(crossbeam_loom)] #[allow(unused_imports)] mod primitive { + pub(crate) mod hint { + pub(crate) use loom::hint::spin_loop; + } pub(crate) mod sync { pub(crate) mod atomic { - pub(crate) use loom::sync::atomic::spin_loop_hint; pub(crate) use loom::sync::atomic::{ AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicU16, - AtomicU32, AtomicU64, AtomicU8, AtomicUsize, + AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering, }; // FIXME: loom does not support compiler_fence at the moment. @@ -63,19 +65,24 @@ mod primitive { #[cfg(not(crossbeam_loom))] #[allow(unused_imports)] mod primitive { + pub(crate) mod hint { + pub(crate) use core::hint::spin_loop; + } pub(crate) mod sync { pub(crate) mod atomic { - pub(crate) use core::sync::atomic::compiler_fence; - // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, - // use [`core::hint::spin_loop`] instead. - #[allow(deprecated)] - pub(crate) use core::sync::atomic::spin_loop_hint; + pub(crate) use core::sync::atomic::{compiler_fence, Ordering}; #[cfg(not(crossbeam_no_atomic))] pub(crate) use core::sync::atomic::{ - AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, - AtomicU8, AtomicUsize, + AtomicBool, AtomicI16, AtomicI8, AtomicIsize, AtomicU16, AtomicU8, AtomicUsize, }; - #[cfg(not(crossbeam_no_atomic_64))] + #[cfg(not(crossbeam_no_atomic))] + #[cfg(any(target_has_atomic = "32", not(target_pointer_width = "16")))] + pub(crate) use core::sync::atomic::{AtomicI32, AtomicU32}; + #[cfg(not(crossbeam_no_atomic))] + #[cfg(any( + target_has_atomic = "64", + not(any(target_pointer_width = "16", target_pointer_width = "32")), + ))] pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64}; } @@ -92,13 +99,9 @@ pub use crate::cache_padded::CachePadded; mod backoff; pub use crate::backoff::Backoff; -use cfg_if::cfg_if; +#[cfg(feature = "std")] +pub mod sync; -cfg_if! { - if #[cfg(feature = "std")] { - pub mod sync; - - #[cfg(not(crossbeam_loom))] - pub mod thread; - } -} +#[cfg(feature = "std")] +#[cfg(not(crossbeam_loom))] +pub mod thread; diff --git a/vendor/crossbeam-utils/src/sync/once_lock.rs b/vendor/crossbeam-utils/src/sync/once_lock.rs index c1fefc96c..e057aca7d 100644 --- a/vendor/crossbeam-utils/src/sync/once_lock.rs +++ b/vendor/crossbeam-utils/src/sync/once_lock.rs @@ -4,13 +4,10 @@ use core::cell::UnsafeCell; use core::mem::MaybeUninit; -use core::sync::atomic::{AtomicBool, Ordering}; use std::sync::Once; pub(crate) struct OnceLock { once: Once, - // Once::is_completed requires Rust 1.43, so use this to track of whether they have been initialized. - is_initialized: AtomicBool, value: UnsafeCell>, // Unlike std::sync::OnceLock, we don't need PhantomData here because // we don't use #[may_dangle]. @@ -25,7 +22,6 @@ impl OnceLock { pub(crate) const fn new() -> Self { Self { once: Once::new(), - is_initialized: AtomicBool::new(false), value: UnsafeCell::new(MaybeUninit::uninit()), } } @@ -50,37 +46,26 @@ impl OnceLock { F: FnOnce() -> T, { // Fast path check - if self.is_initialized() { + if self.once.is_completed() { // SAFETY: The inner value has been initialized return unsafe { self.get_unchecked() }; } self.initialize(f); - debug_assert!(self.is_initialized()); - // SAFETY: The inner value has been initialized unsafe { self.get_unchecked() } } - #[inline] - fn is_initialized(&self) -> bool { - self.is_initialized.load(Ordering::Acquire) - } - #[cold] fn initialize(&self, f: F) where F: FnOnce() -> T, { - let slot = self.value.get().cast::(); - let is_initialized = &self.is_initialized; + let slot = self.value.get(); self.once.call_once(|| { let value = f(); - unsafe { - slot.write(value); - } - is_initialized.store(true, Ordering::Release); + unsafe { slot.write(MaybeUninit::new(value)) } }); } @@ -88,16 +73,16 @@ impl OnceLock { /// /// The value must be initialized unsafe fn get_unchecked(&self) -> &T { - debug_assert!(self.is_initialized()); + debug_assert!(self.once.is_completed()); &*self.value.get().cast::() } } impl Drop for OnceLock { fn drop(&mut self) { - if self.is_initialized() { + if self.once.is_completed() { // SAFETY: The inner value has been initialized - unsafe { self.value.get().cast::().drop_in_place() }; + unsafe { (*self.value.get()).assume_init_drop() }; } } } diff --git a/vendor/crossbeam-utils/src/sync/parker.rs b/vendor/crossbeam-utils/src/sync/parker.rs index 9cb3a2601..971981d2b 100644 --- a/vendor/crossbeam-utils/src/sync/parker.rs +++ b/vendor/crossbeam-utils/src/sync/parker.rs @@ -1,6 +1,5 @@ -use crate::primitive::sync::atomic::AtomicUsize; +use crate::primitive::sync::atomic::{AtomicUsize, Ordering::SeqCst}; use crate::primitive::sync::{Arc, Condvar, Mutex}; -use core::sync::atomic::Ordering::SeqCst; use std::fmt; use std::marker::PhantomData; use std::time::{Duration, Instant}; diff --git a/vendor/crossbeam-utils/src/thread.rs b/vendor/crossbeam-utils/src/thread.rs index 74464544a..b2e063ae6 100644 --- a/vendor/crossbeam-utils/src/thread.rs +++ b/vendor/crossbeam-utils/src/thread.rs @@ -84,7 +84,7 @@ //! tricky because argument `s` lives *inside* the invocation of `thread::scope()` and as such //! cannot be borrowed by scoped threads: //! -//! ```compile_fail,E0373,E0521 +//! ```compile_fail,E0521 //! use crossbeam_utils::thread; //! //! thread::scope(|s| { @@ -120,7 +120,6 @@ use std::sync::{Arc, Mutex}; use std::thread; use crate::sync::WaitGroup; -use cfg_if::cfg_if; type SharedVec = Arc>>; type SharedOption = Arc>>; @@ -152,6 +151,15 @@ pub fn scope<'env, F, R>(f: F) -> thread::Result where F: FnOnce(&Scope<'env>) -> R, { + struct AbortOnPanic; + impl Drop for AbortOnPanic { + fn drop(&mut self) { + if thread::panicking() { + std::process::abort(); + } + } + } + let wg = WaitGroup::new(); let scope = Scope::<'env> { handles: SharedVec::default(), @@ -162,6 +170,10 @@ where // Execute the scoped function, but catch any panics. let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); + // If an unwinding panic occurs before all threads are joined + // promote it to an aborting panic to prevent any threads from escaping the scope. + let guard = AbortOnPanic; + // Wait until all nested scopes are dropped. drop(scope.wait_group); wg.wait(); @@ -177,6 +189,8 @@ where .filter_map(|handle| handle.join().err()) .collect(); + mem::forget(guard); + // If `f` has panicked, resume unwinding. // If any of the child threads have panicked, return the panic errors. // Otherwise, everything is OK and return the result of `f`. @@ -547,37 +561,42 @@ impl ScopedJoinHandle<'_, T> { } } -cfg_if! { - if #[cfg(unix)] { - use std::os::unix::thread::{JoinHandleExt, RawPthread}; +/// Unix-specific extensions. +#[cfg(unix)] +mod unix { + use super::ScopedJoinHandle; + use std::os::unix::thread::{JoinHandleExt, RawPthread}; - impl JoinHandleExt for ScopedJoinHandle<'_, T> { - fn as_pthread_t(&self) -> RawPthread { - // Borrow the handle. The handle will surely be available because the root scope waits - // for nested scopes before joining remaining threads. - let handle = self.handle.lock().unwrap(); - handle.as_ref().unwrap().as_pthread_t() - } - fn into_pthread_t(self) -> RawPthread { - self.as_pthread_t() - } + impl JoinHandleExt for ScopedJoinHandle<'_, T> { + fn as_pthread_t(&self) -> RawPthread { + // Borrow the handle. The handle will surely be available because the root scope waits + // for nested scopes before joining remaining threads. + let handle = self.handle.lock().unwrap(); + handle.as_ref().unwrap().as_pthread_t() } - } else if #[cfg(windows)] { - use std::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle}; - - impl AsRawHandle for ScopedJoinHandle<'_, T> { - fn as_raw_handle(&self) -> RawHandle { - // Borrow the handle. The handle will surely be available because the root scope waits - // for nested scopes before joining remaining threads. - let handle = self.handle.lock().unwrap(); - handle.as_ref().unwrap().as_raw_handle() - } + fn into_pthread_t(self) -> RawPthread { + self.as_pthread_t() } + } +} +/// Windows-specific extensions. +#[cfg(windows)] +mod windows { + use super::ScopedJoinHandle; + use std::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle}; - impl IntoRawHandle for ScopedJoinHandle<'_, T> { - fn into_raw_handle(self) -> RawHandle { - self.as_raw_handle() - } + impl AsRawHandle for ScopedJoinHandle<'_, T> { + fn as_raw_handle(&self) -> RawHandle { + // Borrow the handle. The handle will surely be available because the root scope waits + // for nested scopes before joining remaining threads. + let handle = self.handle.lock().unwrap(); + handle.as_ref().unwrap().as_raw_handle() + } + } + + impl IntoRawHandle for ScopedJoinHandle<'_, T> { + fn into_raw_handle(self) -> RawHandle { + self.as_raw_handle() } } } diff --git a/vendor/crossbeam-utils/tests/atomic_cell.rs b/vendor/crossbeam-utils/tests/atomic_cell.rs index edb7a4bc0..9fe69328d 100644 --- a/vendor/crossbeam-utils/tests/atomic_cell.rs +++ b/vendor/crossbeam-utils/tests/atomic_cell.rs @@ -6,11 +6,11 @@ use crossbeam_utils::atomic::AtomicCell; #[test] fn is_lock_free() { - struct UsizeWrap(usize); - struct U8Wrap(bool); - struct I16Wrap(i16); + struct UsizeWrap(#[allow(dead_code)] usize); + struct U8Wrap(#[allow(dead_code)] bool); + struct I16Wrap(#[allow(dead_code)] i16); #[repr(align(8))] - struct U64Align8(u64); + struct U64Align8(#[allow(dead_code)] u64); assert!(AtomicCell::::is_lock_free()); assert!(AtomicCell::::is_lock_free()); @@ -35,13 +35,13 @@ fn is_lock_free() { // of `AtomicU64` is `8`, so `AtomicCell` is not lock-free. assert_eq!( AtomicCell::::is_lock_free(), - cfg!(not(crossbeam_no_atomic_64)) && std::mem::align_of::() == 8 + cfg!(target_has_atomic = "64") && std::mem::align_of::() == 8 ); assert_eq!(mem::size_of::(), 8); assert_eq!(mem::align_of::(), 8); assert_eq!( AtomicCell::::is_lock_free(), - cfg!(not(crossbeam_no_atomic_64)) + cfg!(target_has_atomic = "64") ); // AtomicU128 is unstable @@ -307,7 +307,6 @@ test_arithmetic!(arithmetic_i128, i128); // https://github.com/crossbeam-rs/crossbeam/issues/748 #[cfg_attr(miri, ignore)] // TODO -#[rustversion::since(1.37)] // #[repr(align(N))] requires Rust 1.37 #[test] fn issue_748() { #[allow(dead_code)] @@ -321,14 +320,13 @@ fn issue_748() { assert_eq!(mem::size_of::(), 8); assert_eq!( AtomicCell::::is_lock_free(), - cfg!(not(crossbeam_no_atomic_64)) + cfg!(target_has_atomic = "64") ); let x = AtomicCell::new(Test::FieldLess); assert_eq!(x.load(), Test::FieldLess); } // https://github.com/crossbeam-rs/crossbeam/issues/833 -#[rustversion::since(1.40)] // const_constructor requires Rust 1.40 #[test] fn issue_833() { use std::num::NonZeroU128; diff --git a/vendor/crossbeam-utils/tests/wait_group.rs b/vendor/crossbeam-utils/tests/wait_group.rs index 0ec4a729c..5b549b849 100644 --- a/vendor/crossbeam-utils/tests/wait_group.rs +++ b/vendor/crossbeam-utils/tests/wait_group.rs @@ -36,25 +36,27 @@ fn wait() { } #[test] -#[cfg_attr(miri, ignore)] // this test makes timing assumptions, but Miri is so slow it violates them fn wait_and_drop() { let wg = WaitGroup::new(); + let wg2 = WaitGroup::new(); let (tx, rx) = mpsc::channel(); for _ in 0..THREADS { let wg = wg.clone(); + let wg2 = wg2.clone(); let tx = tx.clone(); thread::spawn(move || { - thread::sleep(Duration::from_millis(100)); + wg2.wait(); tx.send(()).unwrap(); drop(wg); }); } - // At this point, all spawned threads should be in `thread::sleep`, so we shouldn't get anything - // from the channel. + // At this point, no thread has gotten past `wg2.wait()`, so we shouldn't get anything from the + // channel. assert!(rx.try_recv().is_err()); + drop(wg2); wg.wait(); diff --git a/vendor/deranged/.cargo-checksum.json b/vendor/deranged/.cargo-checksum.json index 5bdd98f32..f29abcd86 100644 --- a/vendor/deranged/.cargo-checksum.json +++ b/vendor/deranged/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"a7f564ac5235d62252f67aa33cd105486d350caadd28f298f5acab1ded4be213","LICENSE-Apache":"b8929fea28678da67251fb2daf9438f67503814211051861612441806d8edb05","LICENSE-MIT":"04620bf27e4a643dd47bf27652320c205acdb776c1f9f24bb8c3bfaba10804c5","README.md":"fc4c9482d9e5225630da44e5371d6fa3f37220e2f4da2dac076cf4cd4f9592e7","src/lib.rs":"030c6406db978004e83b38da0cf06f7de2dc1982a3141970f485d284ebb463c4","src/tests.rs":"b64413d261ee7403cc1bf9e3bb04b0bd4a8242ad70e957b7a6160fdd055189e1","src/traits.rs":"e3984e763afaa23dcf8ea686b473336472953b05abebc433acb26ab5f2237257","src/unsafe_wrapper.rs":"6e57697c2cd484cd60c1a50c4f4d32cb17526447c0f387d8ea3d89a2a89db688"},"package":"8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"} \ No newline at end of file +{"files":{"Cargo.toml":"d1ee03b7033e382279ff580d89a70a9aaf163f977400f0899ad9624e24744e6f","LICENSE-Apache":"b8929fea28678da67251fb2daf9438f67503814211051861612441806d8edb05","LICENSE-MIT":"04620bf27e4a643dd47bf27652320c205acdb776c1f9f24bb8c3bfaba10804c5","README.md":"fc4c9482d9e5225630da44e5371d6fa3f37220e2f4da2dac076cf4cd4f9592e7","src/lib.rs":"bc4b045c160d6f28726831d83f8389d9231410ae289a99950f63436219488dbb","src/tests.rs":"235e4f158084d12b0bfe85745c444d38bb134ebe584396d0a43154260f6576a7","src/traits.rs":"e3984e763afaa23dcf8ea686b473336472953b05abebc433acb26ab5f2237257","src/unsafe_wrapper.rs":"6e57697c2cd484cd60c1a50c4f4d32cb17526447c0f387d8ea3d89a2a89db688"},"package":"b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"} \ No newline at end of file diff --git a/vendor/deranged/Cargo.toml b/vendor/deranged/Cargo.toml index c71d87f1e..ff660b538 100644 --- a/vendor/deranged/Cargo.toml +++ b/vendor/deranged/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.67.0" name = "deranged" -version = "0.3.10" +version = "0.3.11" authors = ["Jacob Pratt "] include = [ "src/**/*", diff --git a/vendor/deranged/src/lib.rs b/vendor/deranged/src/lib.rs index 1347e93e9..aee3ea99f 100644 --- a/vendor/deranged/src/lib.rs +++ b/vendor/deranged/src/lib.rs @@ -120,6 +120,11 @@ macro_rules! if_signed { (false $($x:tt)*) => {}; } +macro_rules! if_unsigned { + (true $($x:tt)*) => {}; + (false $($x:tt)*) => { $($x)* }; +} + macro_rules! article { (true) => { "An" @@ -205,6 +210,14 @@ macro_rules! impl_ranged { $internal, ); + impl $type<0, 0> { + #[inline(always)] + pub const fn exact() -> $type { + // Safety: The value is the only one in range. + unsafe { $type::new_unchecked(VALUE) } + } + } + impl $type { /// The smallest value that can be represented by this type. // Safety: `MIN` is in range by definition. @@ -485,6 +498,21 @@ macro_rules! impl_ranged { } } + if_unsigned!($is_signed + /// Remainder. Computes `self % rhs`, statically guaranteeing that the returned value + /// is in range. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn rem( + self, + rhs: $type, + ) -> $type<0, RHS_VALUE> { + ::ASSERT; + // Safety: The result is guaranteed to be in range due to the nature of remainder on + // unsigned integers. + unsafe { $type::new_unchecked(self.get() % rhs.get()) } + }); + /// Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or /// if the resulting value is out of range. #[must_use = "this returns the result of the operation, without modifying the original"] @@ -563,7 +591,7 @@ macro_rules! impl_ranged { unsafe { Self::new_unchecked(unsafe_unwrap_unchecked!(self.get().checked_neg())) } } - /// Absolute value. Computes `self.neg()`, **failing to compile** if the result is not + /// Negation. Computes `self.neg()`, **failing to compile** if the result is not /// guaranteed to be in range. #[must_use = "this returns the result of the operation, without modifying the original"] #[inline(always)] diff --git a/vendor/deranged/src/tests.rs b/vendor/deranged/src/tests.rs index 5bdbd9bb4..e9a6ff782 100644 --- a/vendor/deranged/src/tests.rs +++ b/vendor/deranged/src/tests.rs @@ -9,10 +9,15 @@ use crate::{ }; macro_rules! if_signed { - (signed $($x:tt)*) => { $($x)*}; + (signed $($x:tt)*) => { $($x)* }; (unsigned $($x:tt)*) => {}; } +macro_rules! if_unsigned { + (signed $($x:tt)*) => {}; + (unsigned $($x:tt)*) => { $($x)* }; +} + #[test] fn errors() { assert_eq!( @@ -264,6 +269,12 @@ macro_rules! tests { } )*} + #[test] + fn rem() {$(if_unsigned! { $signed + assert_eq!($t::<5, 10>::MAX.rem($t::exact::<3>()), $t::<0, 3>::new_static::<1>()); + assert_eq!($t::<5, 10>::MAX.rem($t::exact::<5>()), $t::<0, 5>::MIN); + })*} + #[test] fn checked_rem() {$( assert_eq!($t::<5, 10>::MAX.checked_rem(11), Some($t::<5, 10>::MAX)); diff --git a/vendor/env_logger/.cargo-checksum.json b/vendor/env_logger/.cargo-checksum.json index e7f153db9..48fcaf342 100644 --- a/vendor/env_logger/.cargo-checksum.json +++ b/vendor/env_logger/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"b4de4940496a51647152665b2611de3135453f958f85ee0e1fb283ef250f807a","Cargo.toml":"53d598b16fecb5ad7fd675cf88e85d6fb671772dce27c1cddd8741e46ca178ec","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6","README.md":"b218c2181d8373dabc42f12527f85cdbd7a2d789905c67d3a969adb75096e981","examples/custom_default_format.rs":"321df9186b781ab377a9fc8ce69108c2649d2943fe26eff86cf899d4d3dd69f5","examples/custom_format.rs":"dbdf157c45a071e491cbe1038ad83d50a0154ea0691ee07dc4bd15fc1ca9205f","examples/custom_logger.rs":"1a84203df4d424acba8cba50b5eb6d44bd5e41daa0ed2226494bbfd45ee9f4e9","examples/default.rs":"1e1d9f5b7744861e7f84f95f607d1ae709d93261096387323a4039df31cbf1c1","examples/direct_logger.rs":"5ae565fab0583c06de4cc3554fb4c8dc64cee8e2e1337b9aafff44e1bfb94e43","examples/filters_from_code.rs":"a2e8dbcb949a19de9228654907019e876a0689750d1c86e04fea606585a79938","examples/in_tests.rs":"b31884a7eeb8d316b55a829a7bacc45da248733ae17a263dc1af68394fb309ab","examples/syslog_friendly_format.rs":"4269a86f549253bad54c7e8aae03d5ab09959a5c9d798d3fc6c4745cd5d96cd9","src/filter/mod.rs":"39d1847c1a839d4c73ddbae62a4d6376eeb5aa2d2d39f720e1b3be440bd4e4db","src/filter/regex.rs":"bdf875bac25e089e1e462f5dd01a88678067c24118ecd6268561c6a6af39747d","src/filter/string.rs":"fac54d51189fc0b5d2bff334b7a7e465177b431e3428299e345e1f90062d832e","src/fmt/humantime/extern_impl.rs":"97e0a128275c086b02760a33c22db8524f005994ebb1318a6ac582fd51cf444a","src/fmt/humantime/mod.rs":"f4111c26cf2ffb85c1d639bd7674d55af7e1736e7e98c52f7be3070046a3253f","src/fmt/humantime/shim_impl.rs":"cce9a252abd5952fa109a72b1dfb85a593d237e22606b2b608a32c69184560e9","src/fmt/mod.rs":"b4e23397f7b33df0c353339c4573901f259cfc222975c9f7bec1da0cfa50f159","src/fmt/writer/atty.rs":"098f4c358177d34b0d5a8202ac308f23b08a694b053557c6213f73ab29f8d96e","src/fmt/writer/mod.rs":"ba0723bfdbc5d5210dc59fe74de95affd038a7e15a9d9ca7a71b0413d77ff5bd","src/fmt/writer/termcolor/extern_impl.rs":"d3c0f1f8152b455cb7ac99cf29835ad1c8653d75b2873f1705517c0a45b3b549","src/fmt/writer/termcolor/mod.rs":"9c4e0ffea8ccffa87224af1dbf620483131bf346f86bd81233e4b69d872d1df6","src/fmt/writer/termcolor/shim_impl.rs":"8e6e7d40782b14e33c6b75b81899a612549c2c7937ce28b48cdc60e1e3f8b855","src/lib.rs":"01990df194a0682ae68317accc6dc72b2b5e27095e4f6ecf02719d3a1bb1c662","tests/init-twice-retains-filter.rs":"be5cd2132342d89ede1f5c4266173bb3c4d51cc22a1847f133d299a1c5430ccb","tests/log-in-log.rs":"29fecc65c1e0d1c22d79c97e7ca843ad44a91f27934148d7a05c48899a3f39d8","tests/log_tls_dtors.rs":"7320667d774a9b05037f7bf273fb2574dec0705707692a9cd2f46f4cd5bc68dd","tests/regexp_filter.rs":"a84263c995b534b6479a1d0abadf63f4f0264958ff86d9173d6b2139b82c4dc5"},"package":"95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece"} \ No newline at end of file +{"files":{"Cargo.lock":"170dbbf90750a0bfa1779871d573233559bfddd8e5b25340b50e76b95277da35","Cargo.toml":"255124834d355853645a6a9b42a6a6789b30bcd1eb1b7cebd1c5b5967f6f0aa5","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6","README.md":"b218c2181d8373dabc42f12527f85cdbd7a2d789905c67d3a969adb75096e981","examples/custom_default_format.rs":"321df9186b781ab377a9fc8ce69108c2649d2943fe26eff86cf899d4d3dd69f5","examples/custom_format.rs":"dbdf157c45a071e491cbe1038ad83d50a0154ea0691ee07dc4bd15fc1ca9205f","examples/custom_logger.rs":"1a84203df4d424acba8cba50b5eb6d44bd5e41daa0ed2226494bbfd45ee9f4e9","examples/default.rs":"1e1d9f5b7744861e7f84f95f607d1ae709d93261096387323a4039df31cbf1c1","examples/direct_logger.rs":"5ae565fab0583c06de4cc3554fb4c8dc64cee8e2e1337b9aafff44e1bfb94e43","examples/filters_from_code.rs":"a2e8dbcb949a19de9228654907019e876a0689750d1c86e04fea606585a79938","examples/in_tests.rs":"b31884a7eeb8d316b55a829a7bacc45da248733ae17a263dc1af68394fb309ab","examples/syslog_friendly_format.rs":"4269a86f549253bad54c7e8aae03d5ab09959a5c9d798d3fc6c4745cd5d96cd9","src/filter/mod.rs":"dccde51e29d7f2b2151da9b6447f30215cdd6e7e0fecf3de8f231d919563cb76","src/filter/regex.rs":"bdf875bac25e089e1e462f5dd01a88678067c24118ecd6268561c6a6af39747d","src/filter/string.rs":"fac54d51189fc0b5d2bff334b7a7e465177b431e3428299e345e1f90062d832e","src/fmt/humantime.rs":"515ebf2c201e0fdb79d36a4c542349e70163fd86af8a6448286ee3d826e58a81","src/fmt/mod.rs":"ea13c4dbfdceb82b5dba9b9a998c20b124d86555b180875a8c151355f1a798d7","src/fmt/style.rs":"a173552c819d892fde779520456a9173a755e109cbc73845504ce1c5bf77ad89","src/fmt/writer/atty.rs":"098f4c358177d34b0d5a8202ac308f23b08a694b053557c6213f73ab29f8d96e","src/fmt/writer/buffer/mod.rs":"48572ff8f0bf4a60939fbb5b3a82f3bf82cf7c50170eb15165cd3c19d997c901","src/fmt/writer/buffer/plain.rs":"dd408702340d99b456a21a10c979d1f18d71aaa6a9b0c03dbc77c7ea46b2bdfa","src/fmt/writer/buffer/termcolor.rs":"694201b3bea6f4f788bc5023e5084684b42fd63e58a99c0334d9304469e0b91b","src/fmt/writer/mod.rs":"528bc3a8fba29193c1365af0afa04099f8fb4d01f4d1f1701bc7ad356ee8cf92","src/lib.rs":"6cad01c0d1f140c1b2597eec363c4a4958929a1d9f57c954279121a8abd84e0a","src/logger.rs":"3f1b7723eba17b320ae7e5517f17ffc1f32a943f8cf3c2a2d76497f0fdc3798f","tests/init-twice-retains-filter.rs":"be5cd2132342d89ede1f5c4266173bb3c4d51cc22a1847f133d299a1c5430ccb","tests/log-in-log.rs":"29fecc65c1e0d1c22d79c97e7ca843ad44a91f27934148d7a05c48899a3f39d8","tests/log_tls_dtors.rs":"7320667d774a9b05037f7bf273fb2574dec0705707692a9cd2f46f4cd5bc68dd","tests/regexp_filter.rs":"a84263c995b534b6479a1d0abadf63f4f0264958ff86d9173d6b2139b82c4dc5"},"package":"4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"} \ No newline at end of file diff --git a/vendor/env_logger/Cargo.lock b/vendor/env_logger/Cargo.lock index 2bb97a6a6..3b0e00864 100644 --- a/vendor/env_logger/Cargo.lock +++ b/vendor/env_logger/Cargo.lock @@ -31,7 +31,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" dependencies = [ "humantime", "is-terminal", diff --git a/vendor/env_logger/Cargo.toml b/vendor/env_logger/Cargo.toml index 4e0792a3e..d1e8d4103 100644 --- a/vendor/env_logger/Cargo.toml +++ b/vendor/env_logger/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.60.0" name = "env_logger" -version = "0.10.1" +version = "0.10.2" include = [ "build.rs", "src/**/*", diff --git a/vendor/env_logger/src/filter/mod.rs b/vendor/env_logger/src/filter/mod.rs index 81bb017a4..d4acf632d 100644 --- a/vendor/env_logger/src/filter/mod.rs +++ b/vendor/env_logger/src/filter/mod.rs @@ -71,18 +71,6 @@ mod inner; #[path = "string.rs"] mod inner; -/// A log filter. -/// -/// This struct can be used to determine whether or not a log record -/// should be written to the output. -/// Use the [`Builder`] type to parse and construct a `Filter`. -/// -/// [`Builder`]: struct.Builder.html -pub struct Filter { - directives: Vec, - filter: Option, -} - /// A builder for a log filter. /// /// It can be used to parse a set of directives from a string before building @@ -112,61 +100,6 @@ pub struct Builder { built: bool, } -#[derive(Debug)] -struct Directive { - name: Option, - level: LevelFilter, -} - -impl Filter { - /// Returns the maximum `LevelFilter` that this filter instance is - /// configured to output. - /// - /// # Example - /// - /// ```rust - /// use log::LevelFilter; - /// use env_logger::filter::Builder; - /// - /// let mut builder = Builder::new(); - /// builder.filter(Some("module1"), LevelFilter::Info); - /// builder.filter(Some("module2"), LevelFilter::Error); - /// - /// let filter = builder.build(); - /// assert_eq!(filter.filter(), LevelFilter::Info); - /// ``` - pub fn filter(&self) -> LevelFilter { - self.directives - .iter() - .map(|d| d.level) - .max() - .unwrap_or(LevelFilter::Off) - } - - /// Checks if this record matches the configured filter. - pub fn matches(&self, record: &Record) -> bool { - if !self.enabled(record.metadata()) { - return false; - } - - if let Some(filter) = self.filter.as_ref() { - if !filter.is_match(&record.args().to_string()) { - return false; - } - } - - true - } - - /// Determines if a log message with the specified metadata would be logged. - pub fn enabled(&self, metadata: &Metadata) -> bool { - let level = metadata.level(); - let target = metadata.target(); - - enabled(&self.directives, level, target) - } -} - impl Builder { /// Initializes the filter builder with defaults. pub fn new() -> Builder { @@ -265,7 +198,7 @@ impl Builder { Filter { directives: mem::take(&mut directives), - filter: mem::replace(&mut self.filter, None), + filter: mem::take(&mut self.filter), } } } @@ -276,15 +209,6 @@ impl Default for Builder { } } -impl fmt::Debug for Filter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Filter") - .field("filter", &self.filter) - .field("directives", &self.directives) - .finish() - } -} - impl fmt::Debug for Builder { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.built { @@ -298,6 +222,82 @@ impl fmt::Debug for Builder { } } +#[derive(Debug)] +struct Directive { + name: Option, + level: LevelFilter, +} + +/// A log filter. +/// +/// This struct can be used to determine whether or not a log record +/// should be written to the output. +/// Use the [`Builder`] type to parse and construct a `Filter`. +/// +/// [`Builder`]: struct.Builder.html +pub struct Filter { + directives: Vec, + filter: Option, +} + +impl Filter { + /// Returns the maximum `LevelFilter` that this filter instance is + /// configured to output. + /// + /// # Example + /// + /// ```rust + /// use log::LevelFilter; + /// use env_logger::filter::Builder; + /// + /// let mut builder = Builder::new(); + /// builder.filter(Some("module1"), LevelFilter::Info); + /// builder.filter(Some("module2"), LevelFilter::Error); + /// + /// let filter = builder.build(); + /// assert_eq!(filter.filter(), LevelFilter::Info); + /// ``` + pub fn filter(&self) -> LevelFilter { + self.directives + .iter() + .map(|d| d.level) + .max() + .unwrap_or(LevelFilter::Off) + } + + /// Checks if this record matches the configured filter. + pub fn matches(&self, record: &Record) -> bool { + if !self.enabled(record.metadata()) { + return false; + } + + if let Some(filter) = self.filter.as_ref() { + if !filter.is_match(&record.args().to_string()) { + return false; + } + } + + true + } + + /// Determines if a log message with the specified metadata would be logged. + pub fn enabled(&self, metadata: &Metadata) -> bool { + let level = metadata.level(); + let target = metadata.target(); + + enabled(&self.directives, level, target) + } +} + +impl fmt::Debug for Filter { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Filter") + .field("filter", &self.filter) + .field("directives", &self.directives) + .finish() + } +} + /// Parse a logging specification string (e.g: "crate1,crate2::mod3,crate3::x=error/foo") /// and return a vector with log directives. fn parse_spec(spec: &str) -> (Vec, Option) { diff --git a/vendor/env_logger/src/fmt/humantime/extern_impl.rs b/vendor/env_logger/src/fmt/humantime.rs similarity index 98% rename from vendor/env_logger/src/fmt/humantime/extern_impl.rs rename to vendor/env_logger/src/fmt/humantime.rs index bdf165c4e..582a6318c 100644 --- a/vendor/env_logger/src/fmt/humantime/extern_impl.rs +++ b/vendor/env_logger/src/fmt/humantime.rs @@ -7,10 +7,6 @@ use humantime::{ use crate::fmt::{Formatter, TimestampPrecision}; -pub(in crate::fmt) mod glob { - pub use super::*; -} - impl Formatter { /// Get a [`Timestamp`] for the current date and time in UTC. /// diff --git a/vendor/env_logger/src/fmt/humantime/mod.rs b/vendor/env_logger/src/fmt/humantime/mod.rs deleted file mode 100644 index ac23ae249..000000000 --- a/vendor/env_logger/src/fmt/humantime/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* -This internal module contains the timestamp implementation. - -Its public API is available when the `humantime` crate is available. -*/ - -#[cfg_attr(feature = "humantime", path = "extern_impl.rs")] -#[cfg_attr(not(feature = "humantime"), path = "shim_impl.rs")] -mod imp; - -pub(in crate::fmt) use self::imp::*; diff --git a/vendor/env_logger/src/fmt/humantime/shim_impl.rs b/vendor/env_logger/src/fmt/humantime/shim_impl.rs deleted file mode 100644 index 906bf9e4c..000000000 --- a/vendor/env_logger/src/fmt/humantime/shim_impl.rs +++ /dev/null @@ -1,5 +0,0 @@ -/* -Timestamps aren't available when we don't have a `humantime` dependency. -*/ - -pub(in crate::fmt) mod glob {} diff --git a/vendor/env_logger/src/fmt/mod.rs b/vendor/env_logger/src/fmt/mod.rs index 86c093f0e..5f1d5c8f6 100644 --- a/vendor/env_logger/src/fmt/mod.rs +++ b/vendor/env_logger/src/fmt/mod.rs @@ -35,12 +35,21 @@ use std::io::prelude::*; use std::rc::Rc; use std::{fmt, io, mem}; +#[cfg(feature = "color")] +use log::Level; use log::Record; +#[cfg(feature = "humantime")] mod humantime; pub(crate) mod writer; -pub use self::humantime::glob::*; +#[cfg(feature = "color")] +mod style; +#[cfg(feature = "color")] +pub use style::{Color, Style, StyledValue}; + +#[cfg(feature = "humantime")] +pub use self::humantime::Timestamp; pub use self::writer::glob::*; use self::writer::{Buffer, Writer}; @@ -120,6 +129,62 @@ impl Formatter { } } +#[cfg(feature = "color")] +impl Formatter { + /// Begin a new [`Style`]. + /// + /// # Examples + /// + /// Create a bold, red colored style and use it to print the log level: + /// + /// ``` + /// use std::io::Write; + /// use env_logger::fmt::Color; + /// + /// let mut builder = env_logger::Builder::new(); + /// + /// builder.format(|buf, record| { + /// let mut level_style = buf.style(); + /// + /// level_style.set_color(Color::Red).set_bold(true); + /// + /// writeln!(buf, "{}: {}", + /// level_style.value(record.level()), + /// record.args()) + /// }); + /// ``` + /// + /// [`Style`]: struct.Style.html + pub fn style(&self) -> Style { + Style { + buf: self.buf.clone(), + spec: termcolor::ColorSpec::new(), + } + } + + /// Get the default [`Style`] for the given level. + /// + /// The style can be used to print other values besides the level. + pub fn default_level_style(&self, level: Level) -> Style { + let mut level_style = self.style(); + match level { + Level::Trace => level_style.set_color(Color::Cyan), + Level::Debug => level_style.set_color(Color::Blue), + Level::Info => level_style.set_color(Color::Green), + Level::Warn => level_style.set_color(Color::Yellow), + Level::Error => level_style.set_color(Color::Red).set_bold(true), + }; + level_style + } + + /// Get a printable [`Style`] for the given level. + /// + /// The style can only be used to print the level. + pub fn default_styled_level(&self, level: Level) -> StyledValue<'static, Level> { + self.default_level_style(level).into_value(level) + } +} + impl Write for Formatter { fn write(&mut self, buf: &[u8]) -> io::Result { self.buf.borrow_mut().write(buf) @@ -149,21 +214,6 @@ pub(crate) struct Builder { built: bool, } -impl Default for Builder { - fn default() -> Self { - Builder { - format_timestamp: Some(Default::default()), - format_module_path: false, - format_target: true, - format_level: true, - format_indent: Some(4), - custom_format: None, - format_suffix: "\n", - built: false, - } - } -} - impl Builder { /// Convert the format into a callable function. /// @@ -202,6 +252,21 @@ impl Builder { } } +impl Default for Builder { + fn default() -> Self { + Builder { + format_timestamp: Some(Default::default()), + format_module_path: false, + format_target: true, + format_level: true, + format_indent: Some(4), + custom_format: None, + format_suffix: "\n", + built: false, + } + } +} + #[cfg(feature = "color")] type SubtleStyle = StyledValue<'static, &'static str>; #[cfg(not(feature = "color"))] @@ -403,7 +468,7 @@ mod tests { fmt.write(&record).expect("failed to write record"); let buf = buf.borrow(); - String::from_utf8(buf.bytes().to_vec()).expect("failed to read record") + String::from_utf8(buf.as_bytes().to_vec()).expect("failed to read record") } fn write_target(target: &str, fmt: DefaultFormat) -> String { diff --git a/vendor/env_logger/src/fmt/writer/termcolor/extern_impl.rs b/vendor/env_logger/src/fmt/style.rs similarity index 62% rename from vendor/env_logger/src/fmt/writer/termcolor/extern_impl.rs rename to vendor/env_logger/src/fmt/style.rs index 89c382239..dd4463ac9 100644 --- a/vendor/env_logger/src/fmt/writer/termcolor/extern_impl.rs +++ b/vendor/env_logger/src/fmt/style.rs @@ -1,190 +1,9 @@ use std::borrow::Cow; use std::cell::RefCell; use std::fmt; -use std::io::{self, Write}; use std::rc::Rc; -use std::sync::Mutex; -use log::Level; -use termcolor::{self, ColorChoice, ColorSpec, WriteColor}; - -use crate::fmt::{Formatter, WritableTarget, WriteStyle}; - -pub(in crate::fmt::writer) mod glob { - pub use super::*; -} - -impl Formatter { - /// Begin a new [`Style`]. - /// - /// # Examples - /// - /// Create a bold, red colored style and use it to print the log level: - /// - /// ``` - /// use std::io::Write; - /// use env_logger::fmt::Color; - /// - /// let mut builder = env_logger::Builder::new(); - /// - /// builder.format(|buf, record| { - /// let mut level_style = buf.style(); - /// - /// level_style.set_color(Color::Red).set_bold(true); - /// - /// writeln!(buf, "{}: {}", - /// level_style.value(record.level()), - /// record.args()) - /// }); - /// ``` - /// - /// [`Style`]: struct.Style.html - pub fn style(&self) -> Style { - Style { - buf: self.buf.clone(), - spec: ColorSpec::new(), - } - } - - /// Get the default [`Style`] for the given level. - /// - /// The style can be used to print other values besides the level. - pub fn default_level_style(&self, level: Level) -> Style { - let mut level_style = self.style(); - match level { - Level::Trace => level_style.set_color(Color::Cyan), - Level::Debug => level_style.set_color(Color::Blue), - Level::Info => level_style.set_color(Color::Green), - Level::Warn => level_style.set_color(Color::Yellow), - Level::Error => level_style.set_color(Color::Red).set_bold(true), - }; - level_style - } - - /// Get a printable [`Style`] for the given level. - /// - /// The style can only be used to print the level. - pub fn default_styled_level(&self, level: Level) -> StyledValue<'static, Level> { - self.default_level_style(level).into_value(level) - } -} - -pub(in crate::fmt::writer) struct BufferWriter { - inner: termcolor::BufferWriter, - uncolored_target: Option, -} - -pub(in crate::fmt) struct Buffer { - inner: termcolor::Buffer, - has_uncolored_target: bool, -} - -impl BufferWriter { - pub(in crate::fmt::writer) fn stderr(is_test: bool, write_style: WriteStyle) -> Self { - BufferWriter { - inner: termcolor::BufferWriter::stderr(write_style.into_color_choice()), - uncolored_target: if is_test { - Some(WritableTarget::Stderr) - } else { - None - }, - } - } - - pub(in crate::fmt::writer) fn stdout(is_test: bool, write_style: WriteStyle) -> Self { - BufferWriter { - inner: termcolor::BufferWriter::stdout(write_style.into_color_choice()), - uncolored_target: if is_test { - Some(WritableTarget::Stdout) - } else { - None - }, - } - } - - pub(in crate::fmt::writer) fn pipe( - write_style: WriteStyle, - pipe: Box>, - ) -> Self { - BufferWriter { - // The inner Buffer is never printed from, but it is still needed to handle coloring and other formatting - inner: termcolor::BufferWriter::stderr(write_style.into_color_choice()), - uncolored_target: Some(WritableTarget::Pipe(pipe)), - } - } - - pub(in crate::fmt::writer) fn buffer(&self) -> Buffer { - Buffer { - inner: self.inner.buffer(), - has_uncolored_target: self.uncolored_target.is_some(), - } - } - - pub(in crate::fmt::writer) fn print(&self, buf: &Buffer) -> io::Result<()> { - if let Some(target) = &self.uncolored_target { - // This impl uses the `eprint` and `print` macros - // instead of `termcolor`'s buffer. - // This is so their output can be captured by `cargo test` - let log = String::from_utf8_lossy(buf.bytes()); - - match target { - WritableTarget::Stderr => eprint!("{}", log), - WritableTarget::Stdout => print!("{}", log), - WritableTarget::Pipe(pipe) => write!(pipe.lock().unwrap(), "{}", log)?, - } - - Ok(()) - } else { - self.inner.print(&buf.inner) - } - } -} - -impl Buffer { - pub(in crate::fmt) fn clear(&mut self) { - self.inner.clear() - } - - pub(in crate::fmt) fn write(&mut self, buf: &[u8]) -> io::Result { - self.inner.write(buf) - } - - pub(in crate::fmt) fn flush(&mut self) -> io::Result<()> { - self.inner.flush() - } - - pub(in crate::fmt) fn bytes(&self) -> &[u8] { - self.inner.as_slice() - } - - fn set_color(&mut self, spec: &ColorSpec) -> io::Result<()> { - // Ignore styles for test captured logs because they can't be printed - if !self.has_uncolored_target { - self.inner.set_color(spec) - } else { - Ok(()) - } - } - - fn reset(&mut self) -> io::Result<()> { - // Ignore styles for test captured logs because they can't be printed - if !self.has_uncolored_target { - self.inner.reset() - } else { - Ok(()) - } - } -} - -impl WriteStyle { - fn into_color_choice(self) -> ColorChoice { - match self { - WriteStyle::Always => ColorChoice::Always, - WriteStyle::Auto => ColorChoice::Auto, - WriteStyle::Never => ColorChoice::Never, - } - } -} +use super::Buffer; /// A set of styles to apply to the terminal output. /// @@ -240,18 +59,8 @@ impl WriteStyle { /// [`value`]: #method.value #[derive(Clone)] pub struct Style { - buf: Rc>, - spec: ColorSpec, -} - -/// A value that can be printed using the given styles. -/// -/// It is the result of calling [`Style::value`]. -/// -/// [`Style::value`]: struct.Style.html#method.value -pub struct StyledValue<'a, T> { - style: Cow<'a, Style>, - value: T, + pub(in crate::fmt) buf: Rc>, + pub(in crate::fmt) spec: termcolor::ColorSpec, } impl Style { @@ -426,6 +235,22 @@ impl Style { } } +impl fmt::Debug for Style { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Style").field("spec", &self.spec).finish() + } +} + +/// A value that can be printed using the given styles. +/// +/// It is the result of calling [`Style::value`]. +/// +/// [`Style::value`]: struct.Style.html#method.value +pub struct StyledValue<'a, T> { + style: Cow<'a, Style>, + value: T, +} + impl<'a, T> StyledValue<'a, T> { fn write_fmt(&self, f: F) -> fmt::Result where @@ -445,12 +270,6 @@ impl<'a, T> StyledValue<'a, T> { } } -impl fmt::Debug for Style { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Style").field("spec", &self.spec).finish() - } -} - macro_rules! impl_styled_value_fmt { ($($fmt_trait:path),*) => { $( diff --git a/vendor/env_logger/src/fmt/writer/termcolor/mod.rs b/vendor/env_logger/src/fmt/writer/buffer/mod.rs similarity index 51% rename from vendor/env_logger/src/fmt/writer/termcolor/mod.rs rename to vendor/env_logger/src/fmt/writer/buffer/mod.rs index 20f01979e..4e678b2d2 100644 --- a/vendor/env_logger/src/fmt/writer/termcolor/mod.rs +++ b/vendor/env_logger/src/fmt/writer/buffer/mod.rs @@ -5,8 +5,11 @@ Its public API is available when the `termcolor` crate is available. The terminal printing is shimmed when the `termcolor` crate is not available. */ -#[cfg_attr(feature = "color", path = "extern_impl.rs")] -#[cfg_attr(not(feature = "color"), path = "shim_impl.rs")] -mod imp; - -pub(in crate::fmt) use self::imp::*; +#[cfg(feature = "color")] +mod termcolor; +#[cfg(feature = "color")] +pub(in crate::fmt) use self::termcolor::*; +#[cfg(not(feature = "color"))] +mod plain; +#[cfg(not(feature = "color"))] +pub(in crate::fmt) use plain::*; diff --git a/vendor/env_logger/src/fmt/writer/buffer/plain.rs b/vendor/env_logger/src/fmt/writer/buffer/plain.rs new file mode 100644 index 000000000..e6809b06f --- /dev/null +++ b/vendor/env_logger/src/fmt/writer/buffer/plain.rs @@ -0,0 +1,68 @@ +use std::{io, sync::Mutex}; + +use crate::fmt::{WritableTarget, WriteStyle}; + +pub(in crate::fmt::writer) struct BufferWriter { + target: WritableTarget, +} + +impl BufferWriter { + pub(in crate::fmt::writer) fn stderr(is_test: bool, _write_style: WriteStyle) -> Self { + BufferWriter { + target: if is_test { + WritableTarget::PrintStderr + } else { + WritableTarget::WriteStderr + }, + } + } + + pub(in crate::fmt::writer) fn stdout(is_test: bool, _write_style: WriteStyle) -> Self { + BufferWriter { + target: if is_test { + WritableTarget::PrintStdout + } else { + WritableTarget::WriteStdout + }, + } + } + + pub(in crate::fmt::writer) fn pipe(pipe: Box>) -> Self { + BufferWriter { + target: WritableTarget::Pipe(pipe), + } + } + + pub(in crate::fmt::writer) fn write_style(&self) -> WriteStyle { + WriteStyle::Never + } + + pub(in crate::fmt::writer) fn buffer(&self) -> Buffer { + Buffer(Vec::new()) + } + + pub(in crate::fmt::writer) fn print(&self, buf: &Buffer) -> io::Result<()> { + self.target.print(buf) + } +} + +pub(in crate::fmt) struct Buffer(Vec); + +impl Buffer { + pub(in crate::fmt) fn clear(&mut self) { + self.0.clear(); + } + + pub(in crate::fmt) fn write(&mut self, buf: &[u8]) -> io::Result { + self.0.extend(buf); + Ok(buf.len()) + } + + pub(in crate::fmt) fn flush(&mut self) -> io::Result<()> { + Ok(()) + } + + pub(in crate::fmt) fn as_bytes(&self) -> &[u8] { + &self.0 + } +} diff --git a/vendor/env_logger/src/fmt/writer/buffer/termcolor.rs b/vendor/env_logger/src/fmt/writer/buffer/termcolor.rs new file mode 100644 index 000000000..d3090a17f --- /dev/null +++ b/vendor/env_logger/src/fmt/writer/buffer/termcolor.rs @@ -0,0 +1,108 @@ +use std::io::{self, Write}; +use std::sync::Mutex; + +use termcolor::{self, ColorSpec, WriteColor}; + +use crate::fmt::{WritableTarget, WriteStyle}; + +pub(in crate::fmt::writer) struct BufferWriter { + inner: termcolor::BufferWriter, + uncolored_target: Option, + write_style: WriteStyle, +} + +impl BufferWriter { + pub(in crate::fmt::writer) fn stderr(is_test: bool, write_style: WriteStyle) -> Self { + BufferWriter { + inner: termcolor::BufferWriter::stderr(write_style.into_color_choice()), + uncolored_target: if is_test { + Some(WritableTarget::PrintStderr) + } else { + None + }, + write_style, + } + } + + pub(in crate::fmt::writer) fn stdout(is_test: bool, write_style: WriteStyle) -> Self { + BufferWriter { + inner: termcolor::BufferWriter::stdout(write_style.into_color_choice()), + uncolored_target: if is_test { + Some(WritableTarget::PrintStdout) + } else { + None + }, + write_style, + } + } + + pub(in crate::fmt::writer) fn pipe(pipe: Box>) -> Self { + let write_style = WriteStyle::Never; + BufferWriter { + // The inner Buffer is never printed from, but it is still needed to handle coloring and other formatting + inner: termcolor::BufferWriter::stderr(write_style.into_color_choice()), + uncolored_target: Some(WritableTarget::Pipe(pipe)), + write_style, + } + } + + pub(in crate::fmt::writer) fn write_style(&self) -> WriteStyle { + self.write_style + } + + pub(in crate::fmt::writer) fn buffer(&self) -> Buffer { + Buffer { + inner: self.inner.buffer(), + has_uncolored_target: self.uncolored_target.is_some(), + } + } + + pub(in crate::fmt::writer) fn print(&self, buf: &Buffer) -> io::Result<()> { + if let Some(target) = &self.uncolored_target { + target.print(buf) + } else { + self.inner.print(&buf.inner) + } + } +} + +pub(in crate::fmt) struct Buffer { + inner: termcolor::Buffer, + has_uncolored_target: bool, +} + +impl Buffer { + pub(in crate::fmt) fn clear(&mut self) { + self.inner.clear() + } + + pub(in crate::fmt) fn write(&mut self, buf: &[u8]) -> io::Result { + self.inner.write(buf) + } + + pub(in crate::fmt) fn flush(&mut self) -> io::Result<()> { + self.inner.flush() + } + + pub(in crate::fmt) fn as_bytes(&self) -> &[u8] { + self.inner.as_slice() + } + + pub(in crate::fmt) fn set_color(&mut self, spec: &ColorSpec) -> io::Result<()> { + // Ignore styles for test captured logs because they can't be printed + if !self.has_uncolored_target { + self.inner.set_color(spec) + } else { + Ok(()) + } + } + + pub(in crate::fmt) fn reset(&mut self) -> io::Result<()> { + // Ignore styles for test captured logs because they can't be printed + if !self.has_uncolored_target { + self.inner.reset() + } else { + Ok(()) + } + } +} diff --git a/vendor/env_logger/src/fmt/writer/mod.rs b/vendor/env_logger/src/fmt/writer/mod.rs index 7f4b6f949..41466b924 100644 --- a/vendor/env_logger/src/fmt/writer/mod.rs +++ b/vendor/env_logger/src/fmt/writer/mod.rs @@ -1,16 +1,15 @@ mod atty; -mod termcolor; +mod buffer; use self::atty::{is_stderr, is_stdout}; -use self::termcolor::BufferWriter; +use self::buffer::BufferWriter; use std::{fmt, io, mem, sync::Mutex}; pub(super) mod glob { - pub use super::termcolor::glob::*; pub use super::*; } -pub(super) use self::termcolor::Buffer; +pub(super) use self::buffer::Buffer; /// Log target, either `stdout`, `stderr` or a custom pipe. #[non_exhaustive] @@ -47,27 +46,49 @@ impl fmt::Debug for Target { /// /// Same as `Target`, except the pipe is wrapped in a mutex for interior mutability. pub(super) enum WritableTarget { - /// Logs will be sent to standard output. - Stdout, - /// Logs will be sent to standard error. - Stderr, + /// Logs will be written to standard output. + #[allow(dead_code)] + WriteStdout, + /// Logs will be printed to standard output. + PrintStdout, + /// Logs will be written to standard error. + #[allow(dead_code)] + WriteStderr, + /// Logs will be printed to standard error. + PrintStderr, /// Logs will be sent to a custom pipe. Pipe(Box>), } -impl From for WritableTarget { - fn from(target: Target) -> Self { - match target { - Target::Stdout => Self::Stdout, - Target::Stderr => Self::Stderr, - Target::Pipe(pipe) => Self::Pipe(Box::new(Mutex::new(pipe))), - } - } -} +impl WritableTarget { + fn print(&self, buf: &Buffer) -> io::Result<()> { + use std::io::Write as _; -impl Default for WritableTarget { - fn default() -> Self { - Self::from(Target::default()) + let buf = buf.as_bytes(); + match self { + WritableTarget::WriteStdout => { + let stream = std::io::stdout(); + let mut stream = stream.lock(); + stream.write_all(buf)?; + stream.flush()?; + } + WritableTarget::PrintStdout => print!("{}", String::from_utf8_lossy(buf)), + WritableTarget::WriteStderr => { + let stream = std::io::stderr(); + let mut stream = stream.lock(); + stream.write_all(buf)?; + stream.flush()?; + } + WritableTarget::PrintStderr => eprint!("{}", String::from_utf8_lossy(buf)), + // Safety: If the target type is `Pipe`, `target_pipe` will always be non-empty. + WritableTarget::Pipe(pipe) => { + let mut stream = pipe.lock().unwrap(); + stream.write_all(buf)?; + stream.flush()?; + } + } + + Ok(()) } } @@ -77,8 +98,10 @@ impl fmt::Debug for WritableTarget { f, "{}", match self { - Self::Stdout => "stdout", - Self::Stderr => "stderr", + Self::WriteStdout => "stdout", + Self::PrintStdout => "stdout", + Self::WriteStderr => "stderr", + Self::PrintStderr => "stderr", Self::Pipe(_) => "pipe", } ) @@ -101,15 +124,25 @@ impl Default for WriteStyle { } } +#[cfg(feature = "color")] +impl WriteStyle { + fn into_color_choice(self) -> ::termcolor::ColorChoice { + match self { + WriteStyle::Always => ::termcolor::ColorChoice::Always, + WriteStyle::Auto => ::termcolor::ColorChoice::Auto, + WriteStyle::Never => ::termcolor::ColorChoice::Never, + } + } +} + /// A terminal target with color awareness. pub(crate) struct Writer { inner: BufferWriter, - write_style: WriteStyle, } impl Writer { pub fn write_style(&self) -> WriteStyle { - self.write_style + self.inner.write_style() } pub(super) fn buffer(&self) -> Buffer { @@ -121,12 +154,18 @@ impl Writer { } } +impl fmt::Debug for Writer { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Writer").finish() + } +} + /// A builder for a terminal writer. /// /// The target and style choice can be configured before building. #[derive(Debug)] pub(crate) struct Builder { - target: WritableTarget, + target: Target, write_style: WriteStyle, is_test: bool, built: bool, @@ -145,7 +184,7 @@ impl Builder { /// Set the target to write to. pub(crate) fn target(&mut self, target: Target) -> &mut Self { - self.target = target.into(); + self.target = target; self } @@ -179,9 +218,9 @@ impl Builder { let color_choice = match self.write_style { WriteStyle::Auto => { if match &self.target { - WritableTarget::Stderr => is_stderr(), - WritableTarget::Stdout => is_stdout(), - WritableTarget::Pipe(_) => false, + Target::Stderr => is_stderr(), + Target::Stdout => is_stdout(), + Target::Pipe(_) => false, } { WriteStyle::Auto } else { @@ -190,17 +229,19 @@ impl Builder { } color_choice => color_choice, }; - - let writer = match mem::take(&mut self.target) { - WritableTarget::Stderr => BufferWriter::stderr(self.is_test, color_choice), - WritableTarget::Stdout => BufferWriter::stdout(self.is_test, color_choice), - WritableTarget::Pipe(pipe) => BufferWriter::pipe(color_choice, pipe), + let color_choice = if self.is_test { + WriteStyle::Never + } else { + color_choice }; - Writer { - inner: writer, - write_style: self.write_style, - } + let writer = match mem::take(&mut self.target) { + Target::Stderr => BufferWriter::stderr(self.is_test, color_choice), + Target::Stdout => BufferWriter::stdout(self.is_test, color_choice), + Target::Pipe(pipe) => BufferWriter::pipe(Box::new(Mutex::new(pipe))), + }; + + Writer { inner: writer } } } @@ -210,12 +251,6 @@ impl Default for Builder { } } -impl fmt::Debug for Writer { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Writer").finish() - } -} - fn parse_write_style(spec: &str) -> WriteStyle { match spec { "auto" => WriteStyle::Auto, diff --git a/vendor/env_logger/src/fmt/writer/termcolor/shim_impl.rs b/vendor/env_logger/src/fmt/writer/termcolor/shim_impl.rs deleted file mode 100644 index 0705770c9..000000000 --- a/vendor/env_logger/src/fmt/writer/termcolor/shim_impl.rs +++ /dev/null @@ -1,72 +0,0 @@ -use std::{io, sync::Mutex}; - -use crate::fmt::{WritableTarget, WriteStyle}; - -pub(in crate::fmt::writer) mod glob {} - -pub(in crate::fmt::writer) struct BufferWriter { - target: WritableTarget, -} - -pub(in crate::fmt) struct Buffer(Vec); - -impl BufferWriter { - pub(in crate::fmt::writer) fn stderr(_is_test: bool, _write_style: WriteStyle) -> Self { - BufferWriter { - target: WritableTarget::Stderr, - } - } - - pub(in crate::fmt::writer) fn stdout(_is_test: bool, _write_style: WriteStyle) -> Self { - BufferWriter { - target: WritableTarget::Stdout, - } - } - - pub(in crate::fmt::writer) fn pipe( - _write_style: WriteStyle, - pipe: Box>, - ) -> Self { - BufferWriter { - target: WritableTarget::Pipe(pipe), - } - } - - pub(in crate::fmt::writer) fn buffer(&self) -> Buffer { - Buffer(Vec::new()) - } - - pub(in crate::fmt::writer) fn print(&self, buf: &Buffer) -> io::Result<()> { - // This impl uses the `eprint` and `print` macros - // instead of using the streams directly. - // This is so their output can be captured by `cargo test`. - match &self.target { - // Safety: If the target type is `Pipe`, `target_pipe` will always be non-empty. - WritableTarget::Pipe(pipe) => pipe.lock().unwrap().write_all(&buf.0)?, - WritableTarget::Stdout => print!("{}", String::from_utf8_lossy(&buf.0)), - WritableTarget::Stderr => eprint!("{}", String::from_utf8_lossy(&buf.0)), - } - - Ok(()) - } -} - -impl Buffer { - pub(in crate::fmt) fn clear(&mut self) { - self.0.clear(); - } - - pub(in crate::fmt) fn write(&mut self, buf: &[u8]) -> io::Result { - self.0.extend(buf); - Ok(buf.len()) - } - - pub(in crate::fmt) fn flush(&mut self) -> io::Result<()> { - Ok(()) - } - - #[cfg(test)] - pub(in crate::fmt) fn bytes(&self) -> &[u8] { - &self.0 - } -} diff --git a/vendor/env_logger/src/lib.rs b/vendor/env_logger/src/lib.rs index 4e5d54281..cdc2badca 100644 --- a/vendor/env_logger/src/lib.rs +++ b/vendor/env_logger/src/lib.rs @@ -229,7 +229,7 @@ //! ### Using a custom format //! //! Custom formats can be provided as closures to the [`Builder`]. -//! These closures take a [`Formatter`] and `log::Record` as arguments: +//! These closures take a [`Formatter`][crate::fmt::Formatter] and `log::Record` as arguments: //! //! ``` //! use std::io::Write; @@ -275,1027 +275,10 @@ #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] #![deny(missing_debug_implementations, missing_docs)] -use std::{borrow::Cow, cell::RefCell, env, io}; - -use log::{LevelFilter, Log, Metadata, Record, SetLoggerError}; +mod logger; pub mod filter; pub mod fmt; pub use self::fmt::glob::*; - -use self::filter::Filter; -use self::fmt::writer::{self, Writer}; -use self::fmt::{FormatFn, Formatter}; - -/// The default name for the environment variable to read filters from. -pub const DEFAULT_FILTER_ENV: &str = "RUST_LOG"; - -/// The default name for the environment variable to read style preferences from. -pub const DEFAULT_WRITE_STYLE_ENV: &str = "RUST_LOG_STYLE"; - -/// Set of environment variables to configure from. -/// -/// # Default environment variables -/// -/// By default, the `Env` will read the following environment variables: -/// -/// - `RUST_LOG`: the level filter -/// - `RUST_LOG_STYLE`: whether or not to print styles with records. -/// -/// These sources can be configured using the builder methods on `Env`. -#[derive(Debug)] -pub struct Env<'a> { - filter: Var<'a>, - write_style: Var<'a>, -} - -#[derive(Debug)] -struct Var<'a> { - name: Cow<'a, str>, - default: Option>, -} - -/// The env logger. -/// -/// This struct implements the `Log` trait from the [`log` crate][log-crate-url], -/// which allows it to act as a logger. -/// -/// The [`init()`], [`try_init()`], [`Builder::init()`] and [`Builder::try_init()`] -/// methods will each construct a `Logger` and immediately initialize it as the -/// default global logger. -/// -/// If you'd instead need access to the constructed `Logger`, you can use -/// the associated [`Builder`] and install it with the -/// [`log` crate][log-crate-url] directly. -/// -/// [log-crate-url]: https://docs.rs/log -/// [`init()`]: fn.init.html -/// [`try_init()`]: fn.try_init.html -/// [`Builder::init()`]: struct.Builder.html#method.init -/// [`Builder::try_init()`]: struct.Builder.html#method.try_init -/// [`Builder`]: struct.Builder.html -pub struct Logger { - writer: Writer, - filter: Filter, - format: FormatFn, -} - -/// `Builder` acts as builder for initializing a `Logger`. -/// -/// It can be used to customize the log format, change the environment variable used -/// to provide the logging directives and also set the default log level filter. -/// -/// # Examples -/// -/// ``` -/// # use std::io::Write; -/// use env_logger::Builder; -/// use log::{LevelFilter, error, info}; -/// -/// let mut builder = Builder::from_default_env(); -/// -/// builder -/// .format(|buf, record| writeln!(buf, "{} - {}", record.level(), record.args())) -/// .filter(None, LevelFilter::Info) -/// .init(); -/// -/// error!("error message"); -/// info!("info message"); -/// ``` -#[derive(Default)] -pub struct Builder { - filter: filter::Builder, - writer: writer::Builder, - format: fmt::Builder, - built: bool, -} - -impl Builder { - /// Initializes the log builder with defaults. - /// - /// **NOTE:** This method won't read from any environment variables. - /// Use the [`filter`] and [`write_style`] methods to configure the builder - /// or use [`from_env`] or [`from_default_env`] instead. - /// - /// # Examples - /// - /// Create a new builder and configure filters and style: - /// - /// ``` - /// use log::LevelFilter; - /// use env_logger::{Builder, WriteStyle}; - /// - /// let mut builder = Builder::new(); - /// - /// builder - /// .filter(None, LevelFilter::Info) - /// .write_style(WriteStyle::Always) - /// .init(); - /// ``` - /// - /// [`filter`]: #method.filter - /// [`write_style`]: #method.write_style - /// [`from_env`]: #method.from_env - /// [`from_default_env`]: #method.from_default_env - pub fn new() -> Builder { - Default::default() - } - - /// Initializes the log builder from the environment. - /// - /// The variables used to read configuration from can be tweaked before - /// passing in. - /// - /// # Examples - /// - /// Initialise a logger reading the log filter from an environment variable - /// called `MY_LOG`: - /// - /// ``` - /// use env_logger::Builder; - /// - /// let mut builder = Builder::from_env("MY_LOG"); - /// builder.init(); - /// ``` - /// - /// Initialise a logger using the `MY_LOG` variable for filtering and - /// `MY_LOG_STYLE` for whether or not to write styles: - /// - /// ``` - /// use env_logger::{Builder, Env}; - /// - /// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); - /// - /// let mut builder = Builder::from_env(env); - /// builder.init(); - /// ``` - pub fn from_env<'a, E>(env: E) -> Self - where - E: Into>, - { - let mut builder = Builder::new(); - builder.parse_env(env); - builder - } - - /// Applies the configuration from the environment. - /// - /// This function allows a builder to be configured with default parameters, - /// to be then overridden by the environment. - /// - /// # Examples - /// - /// Initialise a logger with filter level `Off`, then override the log - /// filter from an environment variable called `MY_LOG`: - /// - /// ``` - /// use log::LevelFilter; - /// use env_logger::Builder; - /// - /// let mut builder = Builder::new(); - /// - /// builder.filter_level(LevelFilter::Off); - /// builder.parse_env("MY_LOG"); - /// builder.init(); - /// ``` - /// - /// Initialise a logger with filter level `Off`, then use the `MY_LOG` - /// variable to override filtering and `MY_LOG_STYLE` to override whether - /// or not to write styles: - /// - /// ``` - /// use log::LevelFilter; - /// use env_logger::{Builder, Env}; - /// - /// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); - /// - /// let mut builder = Builder::new(); - /// builder.filter_level(LevelFilter::Off); - /// builder.parse_env(env); - /// builder.init(); - /// ``` - pub fn parse_env<'a, E>(&mut self, env: E) -> &mut Self - where - E: Into>, - { - let env = env.into(); - - if let Some(s) = env.get_filter() { - self.parse_filters(&s); - } - - if let Some(s) = env.get_write_style() { - self.parse_write_style(&s); - } - - self - } - - /// Initializes the log builder from the environment using default variable names. - /// - /// This method is a convenient way to call `from_env(Env::default())` without - /// having to use the `Env` type explicitly. The builder will use the - /// [default environment variables]. - /// - /// # Examples - /// - /// Initialise a logger using the default environment variables: - /// - /// ``` - /// use env_logger::Builder; - /// - /// let mut builder = Builder::from_default_env(); - /// builder.init(); - /// ``` - /// - /// [default environment variables]: struct.Env.html#default-environment-variables - pub fn from_default_env() -> Self { - Self::from_env(Env::default()) - } - - /// Applies the configuration from the environment using default variable names. - /// - /// This method is a convenient way to call `parse_env(Env::default())` without - /// having to use the `Env` type explicitly. The builder will use the - /// [default environment variables]. - /// - /// # Examples - /// - /// Initialise a logger with filter level `Off`, then configure it using the - /// default environment variables: - /// - /// ``` - /// use log::LevelFilter; - /// use env_logger::Builder; - /// - /// let mut builder = Builder::new(); - /// builder.filter_level(LevelFilter::Off); - /// builder.parse_default_env(); - /// builder.init(); - /// ``` - /// - /// [default environment variables]: struct.Env.html#default-environment-variables - pub fn parse_default_env(&mut self) -> &mut Self { - self.parse_env(Env::default()) - } - - /// Sets the format function for formatting the log output. - /// - /// This function is called on each record logged and should format the - /// log record and output it to the given [`Formatter`]. - /// - /// The format function is expected to output the string directly to the - /// `Formatter` so that implementations can use the [`std::fmt`] macros - /// to format and output without intermediate heap allocations. The default - /// `env_logger` formatter takes advantage of this. - /// - /// # Examples - /// - /// Use a custom format to write only the log message: - /// - /// ``` - /// use std::io::Write; - /// use env_logger::Builder; - /// - /// let mut builder = Builder::new(); - /// - /// builder.format(|buf, record| writeln!(buf, "{}", record.args())); - /// ``` - /// - /// [`Formatter`]: fmt/struct.Formatter.html - /// [`String`]: https://doc.rust-lang.org/stable/std/string/struct.String.html - /// [`std::fmt`]: https://doc.rust-lang.org/std/fmt/index.html - pub fn format(&mut self, format: F) -> &mut Self - where - F: Fn(&mut Formatter, &Record) -> io::Result<()> + Sync + Send, - { - self.format.custom_format = Some(Box::new(format)); - self - } - - /// Use the default format. - /// - /// This method will clear any custom format set on the builder. - pub fn default_format(&mut self) -> &mut Self { - self.format = Default::default(); - self - } - - /// Whether or not to write the level in the default format. - pub fn format_level(&mut self, write: bool) -> &mut Self { - self.format.format_level = write; - self - } - - /// Whether or not to write the module path in the default format. - pub fn format_module_path(&mut self, write: bool) -> &mut Self { - self.format.format_module_path = write; - self - } - - /// Whether or not to write the target in the default format. - pub fn format_target(&mut self, write: bool) -> &mut Self { - self.format.format_target = write; - self - } - - /// Configures the amount of spaces to use to indent multiline log records. - /// A value of `None` disables any kind of indentation. - pub fn format_indent(&mut self, indent: Option) -> &mut Self { - self.format.format_indent = indent; - self - } - - /// Configures if timestamp should be included and in what precision. - pub fn format_timestamp(&mut self, timestamp: Option) -> &mut Self { - self.format.format_timestamp = timestamp; - self - } - - /// Configures the timestamp to use second precision. - pub fn format_timestamp_secs(&mut self) -> &mut Self { - self.format_timestamp(Some(fmt::TimestampPrecision::Seconds)) - } - - /// Configures the timestamp to use millisecond precision. - pub fn format_timestamp_millis(&mut self) -> &mut Self { - self.format_timestamp(Some(fmt::TimestampPrecision::Millis)) - } - - /// Configures the timestamp to use microsecond precision. - pub fn format_timestamp_micros(&mut self) -> &mut Self { - self.format_timestamp(Some(fmt::TimestampPrecision::Micros)) - } - - /// Configures the timestamp to use nanosecond precision. - pub fn format_timestamp_nanos(&mut self) -> &mut Self { - self.format_timestamp(Some(fmt::TimestampPrecision::Nanos)) - } - - /// Configures the end of line suffix. - pub fn format_suffix(&mut self, suffix: &'static str) -> &mut Self { - self.format.format_suffix = suffix; - self - } - - /// Adds a directive to the filter for a specific module. - /// - /// # Examples - /// - /// Only include messages for info and above for logs in `path::to::module`: - /// - /// ``` - /// use env_logger::Builder; - /// use log::LevelFilter; - /// - /// let mut builder = Builder::new(); - /// - /// builder.filter_module("path::to::module", LevelFilter::Info); - /// ``` - pub fn filter_module(&mut self, module: &str, level: LevelFilter) -> &mut Self { - self.filter.filter_module(module, level); - self - } - - /// Adds a directive to the filter for all modules. - /// - /// # Examples - /// - /// Only include messages for info and above for logs globally: - /// - /// ``` - /// use env_logger::Builder; - /// use log::LevelFilter; - /// - /// let mut builder = Builder::new(); - /// - /// builder.filter_level(LevelFilter::Info); - /// ``` - pub fn filter_level(&mut self, level: LevelFilter) -> &mut Self { - self.filter.filter_level(level); - self - } - - /// Adds filters to the logger. - /// - /// The given module (if any) will log at most the specified level provided. - /// If no module is provided then the filter will apply to all log messages. - /// - /// # Examples - /// - /// Only include messages for info and above for logs in `path::to::module`: - /// - /// ``` - /// use env_logger::Builder; - /// use log::LevelFilter; - /// - /// let mut builder = Builder::new(); - /// - /// builder.filter(Some("path::to::module"), LevelFilter::Info); - /// ``` - pub fn filter(&mut self, module: Option<&str>, level: LevelFilter) -> &mut Self { - self.filter.filter(module, level); - self - } - - /// Parses the directives string in the same form as the `RUST_LOG` - /// environment variable. - /// - /// See the module documentation for more details. - pub fn parse_filters(&mut self, filters: &str) -> &mut Self { - self.filter.parse(filters); - self - } - - /// Sets the target for the log output. - /// - /// Env logger can log to either stdout, stderr or a custom pipe. The default is stderr. - /// - /// The custom pipe can be used to send the log messages to a custom sink (for example a file). - /// Do note that direct writes to a file can become a bottleneck due to IO operation times. - /// - /// # Examples - /// - /// Write log message to `stdout`: - /// - /// ``` - /// use env_logger::{Builder, Target}; - /// - /// let mut builder = Builder::new(); - /// - /// builder.target(Target::Stdout); - /// ``` - pub fn target(&mut self, target: fmt::Target) -> &mut Self { - self.writer.target(target); - self - } - - /// Sets whether or not styles will be written. - /// - /// This can be useful in environments that don't support control characters - /// for setting colors. - /// - /// # Examples - /// - /// Never attempt to write styles: - /// - /// ``` - /// use env_logger::{Builder, WriteStyle}; - /// - /// let mut builder = Builder::new(); - /// - /// builder.write_style(WriteStyle::Never); - /// ``` - pub fn write_style(&mut self, write_style: fmt::WriteStyle) -> &mut Self { - self.writer.write_style(write_style); - self - } - - /// Parses whether or not to write styles in the same form as the `RUST_LOG_STYLE` - /// environment variable. - /// - /// See the module documentation for more details. - pub fn parse_write_style(&mut self, write_style: &str) -> &mut Self { - self.writer.parse_write_style(write_style); - self - } - - /// Sets whether or not the logger will be used in unit tests. - /// - /// If `is_test` is `true` then the logger will allow the testing framework to - /// capture log records rather than printing them to the terminal directly. - pub fn is_test(&mut self, is_test: bool) -> &mut Self { - self.writer.is_test(is_test); - self - } - - /// Initializes the global logger with the built env logger. - /// - /// This should be called early in the execution of a Rust program. Any log - /// events that occur before initialization will be ignored. - /// - /// # Errors - /// - /// This function will fail if it is called more than once, or if another - /// library has already initialized a global logger. - pub fn try_init(&mut self) -> Result<(), SetLoggerError> { - let logger = self.build(); - - let max_level = logger.filter(); - let r = log::set_boxed_logger(Box::new(logger)); - - if r.is_ok() { - log::set_max_level(max_level); - } - - r - } - - /// Initializes the global logger with the built env logger. - /// - /// This should be called early in the execution of a Rust program. Any log - /// events that occur before initialization will be ignored. - /// - /// # Panics - /// - /// This function will panic if it is called more than once, or if another - /// library has already initialized a global logger. - pub fn init(&mut self) { - self.try_init() - .expect("Builder::init should not be called after logger initialized"); - } - - /// Build an env logger. - /// - /// The returned logger implements the `Log` trait and can be installed manually - /// or nested within another logger. - pub fn build(&mut self) -> Logger { - assert!(!self.built, "attempt to re-use consumed builder"); - self.built = true; - - Logger { - writer: self.writer.build(), - filter: self.filter.build(), - format: self.format.build(), - } - } -} - -impl Logger { - /// Creates the logger from the environment. - /// - /// The variables used to read configuration from can be tweaked before - /// passing in. - /// - /// # Examples - /// - /// Create a logger reading the log filter from an environment variable - /// called `MY_LOG`: - /// - /// ``` - /// use env_logger::Logger; - /// - /// let logger = Logger::from_env("MY_LOG"); - /// ``` - /// - /// Create a logger using the `MY_LOG` variable for filtering and - /// `MY_LOG_STYLE` for whether or not to write styles: - /// - /// ``` - /// use env_logger::{Logger, Env}; - /// - /// let env = Env::new().filter_or("MY_LOG", "info").write_style_or("MY_LOG_STYLE", "always"); - /// - /// let logger = Logger::from_env(env); - /// ``` - pub fn from_env<'a, E>(env: E) -> Self - where - E: Into>, - { - Builder::from_env(env).build() - } - - /// Creates the logger from the environment using default variable names. - /// - /// This method is a convenient way to call `from_env(Env::default())` without - /// having to use the `Env` type explicitly. The logger will use the - /// [default environment variables]. - /// - /// # Examples - /// - /// Creates a logger using the default environment variables: - /// - /// ``` - /// use env_logger::Logger; - /// - /// let logger = Logger::from_default_env(); - /// ``` - /// - /// [default environment variables]: struct.Env.html#default-environment-variables - pub fn from_default_env() -> Self { - Builder::from_default_env().build() - } - - /// Returns the maximum `LevelFilter` that this env logger instance is - /// configured to output. - pub fn filter(&self) -> LevelFilter { - self.filter.filter() - } - - /// Checks if this record matches the configured filter. - pub fn matches(&self, record: &Record) -> bool { - self.filter.matches(record) - } -} - -impl Log for Logger { - fn enabled(&self, metadata: &Metadata) -> bool { - self.filter.enabled(metadata) - } - - fn log(&self, record: &Record) { - if self.matches(record) { - // Log records are written to a thread-local buffer before being printed - // to the terminal. We clear these buffers afterwards, but they aren't shrunk - // so will always at least have capacity for the largest log record formatted - // on that thread. - // - // If multiple `Logger`s are used by the same threads then the thread-local - // formatter might have different color support. If this is the case the - // formatter and its buffer are discarded and recreated. - - thread_local! { - static FORMATTER: RefCell> = RefCell::new(None); - } - - let print = |formatter: &mut Formatter, record: &Record| { - let _ = - (self.format)(formatter, record).and_then(|_| formatter.print(&self.writer)); - - // Always clear the buffer afterwards - formatter.clear(); - }; - - let printed = FORMATTER - .try_with(|tl_buf| { - match tl_buf.try_borrow_mut() { - // There are no active borrows of the buffer - Ok(mut tl_buf) => match *tl_buf { - // We have a previously set formatter - Some(ref mut formatter) => { - // Check the buffer style. If it's different from the logger's - // style then drop the buffer and recreate it. - if formatter.write_style() != self.writer.write_style() { - *formatter = Formatter::new(&self.writer); - } - - print(formatter, record); - } - // We don't have a previously set formatter - None => { - let mut formatter = Formatter::new(&self.writer); - print(&mut formatter, record); - - *tl_buf = Some(formatter); - } - }, - // There's already an active borrow of the buffer (due to re-entrancy) - Err(_) => { - print(&mut Formatter::new(&self.writer), record); - } - } - }) - .is_ok(); - - if !printed { - // The thread-local storage was not available (because its - // destructor has already run). Create a new single-use - // Formatter on the stack for this call. - print(&mut Formatter::new(&self.writer), record); - } - } - } - - fn flush(&self) {} -} - -impl<'a> Env<'a> { - /// Get a default set of environment variables. - pub fn new() -> Self { - Self::default() - } - - /// Specify an environment variable to read the filter from. - pub fn filter(mut self, filter_env: E) -> Self - where - E: Into>, - { - self.filter = Var::new(filter_env); - - self - } - - /// Specify an environment variable to read the filter from. - /// - /// If the variable is not set, the default value will be used. - pub fn filter_or(mut self, filter_env: E, default: V) -> Self - where - E: Into>, - V: Into>, - { - self.filter = Var::new_with_default(filter_env, default); - - self - } - - /// Use the default environment variable to read the filter from. - /// - /// If the variable is not set, the default value will be used. - pub fn default_filter_or(mut self, default: V) -> Self - where - V: Into>, - { - self.filter = Var::new_with_default(DEFAULT_FILTER_ENV, default); - - self - } - - fn get_filter(&self) -> Option { - self.filter.get() - } - - /// Specify an environment variable to read the style from. - pub fn write_style(mut self, write_style_env: E) -> Self - where - E: Into>, - { - self.write_style = Var::new(write_style_env); - - self - } - - /// Specify an environment variable to read the style from. - /// - /// If the variable is not set, the default value will be used. - pub fn write_style_or(mut self, write_style_env: E, default: V) -> Self - where - E: Into>, - V: Into>, - { - self.write_style = Var::new_with_default(write_style_env, default); - - self - } - - /// Use the default environment variable to read the style from. - /// - /// If the variable is not set, the default value will be used. - pub fn default_write_style_or(mut self, default: V) -> Self - where - V: Into>, - { - self.write_style = Var::new_with_default(DEFAULT_WRITE_STYLE_ENV, default); - - self - } - - fn get_write_style(&self) -> Option { - self.write_style.get() - } -} - -impl<'a> Var<'a> { - fn new(name: E) -> Self - where - E: Into>, - { - Var { - name: name.into(), - default: None, - } - } - - fn new_with_default(name: E, default: V) -> Self - where - E: Into>, - V: Into>, - { - Var { - name: name.into(), - default: Some(default.into()), - } - } - - fn get(&self) -> Option { - env::var(&*self.name) - .ok() - .or_else(|| self.default.to_owned().map(|v| v.into_owned())) - } -} - -impl<'a, T> From for Env<'a> -where - T: Into>, -{ - fn from(filter_env: T) -> Self { - Env::default().filter(filter_env.into()) - } -} - -impl<'a> Default for Env<'a> { - fn default() -> Self { - Env { - filter: Var::new(DEFAULT_FILTER_ENV), - write_style: Var::new(DEFAULT_WRITE_STYLE_ENV), - } - } -} - -mod std_fmt_impls { - use super::*; - use std::fmt; - - impl fmt::Debug for Logger { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Logger") - .field("filter", &self.filter) - .finish() - } - } - - impl fmt::Debug for Builder { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if self.built { - f.debug_struct("Logger").field("built", &true).finish() - } else { - f.debug_struct("Logger") - .field("filter", &self.filter) - .field("writer", &self.writer) - .finish() - } - } - } -} - -/// Attempts to initialize the global logger with an env logger. -/// -/// This should be called early in the execution of a Rust program. Any log -/// events that occur before initialization will be ignored. -/// -/// # Errors -/// -/// This function will fail if it is called more than once, or if another -/// library has already initialized a global logger. -pub fn try_init() -> Result<(), SetLoggerError> { - try_init_from_env(Env::default()) -} - -/// Initializes the global logger with an env logger. -/// -/// This should be called early in the execution of a Rust program. Any log -/// events that occur before initialization will be ignored. -/// -/// # Panics -/// -/// This function will panic if it is called more than once, or if another -/// library has already initialized a global logger. -pub fn init() { - try_init().expect("env_logger::init should not be called after logger initialized"); -} - -/// Attempts to initialize the global logger with an env logger from the given -/// environment variables. -/// -/// This should be called early in the execution of a Rust program. Any log -/// events that occur before initialization will be ignored. -/// -/// # Examples -/// -/// Initialise a logger using the `MY_LOG` environment variable for filters -/// and `MY_LOG_STYLE` for writing colors: -/// -/// ``` -/// use env_logger::{Builder, Env}; -/// -/// # fn run() -> Result<(), Box> { -/// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); -/// -/// env_logger::try_init_from_env(env)?; -/// -/// Ok(()) -/// # } -/// # run().unwrap(); -/// ``` -/// -/// # Errors -/// -/// This function will fail if it is called more than once, or if another -/// library has already initialized a global logger. -pub fn try_init_from_env<'a, E>(env: E) -> Result<(), SetLoggerError> -where - E: Into>, -{ - let mut builder = Builder::from_env(env); - - builder.try_init() -} - -/// Initializes the global logger with an env logger from the given environment -/// variables. -/// -/// This should be called early in the execution of a Rust program. Any log -/// events that occur before initialization will be ignored. -/// -/// # Examples -/// -/// Initialise a logger using the `MY_LOG` environment variable for filters -/// and `MY_LOG_STYLE` for writing colors: -/// -/// ``` -/// use env_logger::{Builder, Env}; -/// -/// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); -/// -/// env_logger::init_from_env(env); -/// ``` -/// -/// # Panics -/// -/// This function will panic if it is called more than once, or if another -/// library has already initialized a global logger. -pub fn init_from_env<'a, E>(env: E) -where - E: Into>, -{ - try_init_from_env(env) - .expect("env_logger::init_from_env should not be called after logger initialized"); -} - -/// Create a new builder with the default environment variables. -/// -/// The builder can be configured before being initialized. -/// This is a convenient way of calling [`Builder::from_default_env`]. -/// -/// [`Builder::from_default_env`]: struct.Builder.html#method.from_default_env -pub fn builder() -> Builder { - Builder::from_default_env() -} - -/// Create a builder from the given environment variables. -/// -/// The builder can be configured before being initialized. -#[deprecated( - since = "0.8.0", - note = "Prefer `env_logger::Builder::from_env()` instead." -)] -pub fn from_env<'a, E>(env: E) -> Builder -where - E: Into>, -{ - Builder::from_env(env) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn env_get_filter_reads_from_var_if_set() { - env::set_var("env_get_filter_reads_from_var_if_set", "from var"); - - let env = Env::new().filter_or("env_get_filter_reads_from_var_if_set", "from default"); - - assert_eq!(Some("from var".to_owned()), env.get_filter()); - } - - #[test] - fn env_get_filter_reads_from_default_if_var_not_set() { - env::remove_var("env_get_filter_reads_from_default_if_var_not_set"); - - let env = Env::new().filter_or( - "env_get_filter_reads_from_default_if_var_not_set", - "from default", - ); - - assert_eq!(Some("from default".to_owned()), env.get_filter()); - } - - #[test] - fn env_get_write_style_reads_from_var_if_set() { - env::set_var("env_get_write_style_reads_from_var_if_set", "from var"); - - let env = - Env::new().write_style_or("env_get_write_style_reads_from_var_if_set", "from default"); - - assert_eq!(Some("from var".to_owned()), env.get_write_style()); - } - - #[test] - fn env_get_write_style_reads_from_default_if_var_not_set() { - env::remove_var("env_get_write_style_reads_from_default_if_var_not_set"); - - let env = Env::new().write_style_or( - "env_get_write_style_reads_from_default_if_var_not_set", - "from default", - ); - - assert_eq!(Some("from default".to_owned()), env.get_write_style()); - } - - #[test] - fn builder_parse_env_overrides_existing_filters() { - env::set_var( - "builder_parse_default_env_overrides_existing_filters", - "debug", - ); - let env = Env::new().filter("builder_parse_default_env_overrides_existing_filters"); - - let mut builder = Builder::new(); - builder.filter_level(LevelFilter::Trace); - // Overrides global level to debug - builder.parse_env(env); - - assert_eq!(builder.filter.build().filter(), LevelFilter::Debug); - } -} +pub use self::logger::*; diff --git a/vendor/env_logger/src/logger.rs b/vendor/env_logger/src/logger.rs new file mode 100644 index 000000000..6c8a00d43 --- /dev/null +++ b/vendor/env_logger/src/logger.rs @@ -0,0 +1,1016 @@ +use std::{borrow::Cow, cell::RefCell, env, io}; + +use log::{LevelFilter, Log, Metadata, Record, SetLoggerError}; + +use crate::filter; +use crate::filter::Filter; +use crate::fmt; +use crate::fmt::writer::{self, Writer}; +use crate::fmt::{FormatFn, Formatter}; + +/// The default name for the environment variable to read filters from. +pub const DEFAULT_FILTER_ENV: &str = "RUST_LOG"; + +/// The default name for the environment variable to read style preferences from. +pub const DEFAULT_WRITE_STYLE_ENV: &str = "RUST_LOG_STYLE"; + +/// `Builder` acts as builder for initializing a `Logger`. +/// +/// It can be used to customize the log format, change the environment variable used +/// to provide the logging directives and also set the default log level filter. +/// +/// # Examples +/// +/// ``` +/// # use std::io::Write; +/// use env_logger::Builder; +/// use log::{LevelFilter, error, info}; +/// +/// let mut builder = Builder::from_default_env(); +/// +/// builder +/// .format(|buf, record| writeln!(buf, "{} - {}", record.level(), record.args())) +/// .filter(None, LevelFilter::Info) +/// .init(); +/// +/// error!("error message"); +/// info!("info message"); +/// ``` +#[derive(Default)] +pub struct Builder { + filter: filter::Builder, + writer: writer::Builder, + format: fmt::Builder, + built: bool, +} + +impl Builder { + /// Initializes the log builder with defaults. + /// + /// **NOTE:** This method won't read from any environment variables. + /// Use the [`filter`] and [`write_style`] methods to configure the builder + /// or use [`from_env`] or [`from_default_env`] instead. + /// + /// # Examples + /// + /// Create a new builder and configure filters and style: + /// + /// ``` + /// use log::LevelFilter; + /// use env_logger::{Builder, WriteStyle}; + /// + /// let mut builder = Builder::new(); + /// + /// builder + /// .filter(None, LevelFilter::Info) + /// .write_style(WriteStyle::Always) + /// .init(); + /// ``` + /// + /// [`filter`]: #method.filter + /// [`write_style`]: #method.write_style + /// [`from_env`]: #method.from_env + /// [`from_default_env`]: #method.from_default_env + pub fn new() -> Builder { + Default::default() + } + + /// Initializes the log builder from the environment. + /// + /// The variables used to read configuration from can be tweaked before + /// passing in. + /// + /// # Examples + /// + /// Initialise a logger reading the log filter from an environment variable + /// called `MY_LOG`: + /// + /// ``` + /// use env_logger::Builder; + /// + /// let mut builder = Builder::from_env("MY_LOG"); + /// builder.init(); + /// ``` + /// + /// Initialise a logger using the `MY_LOG` variable for filtering and + /// `MY_LOG_STYLE` for whether or not to write styles: + /// + /// ``` + /// use env_logger::{Builder, Env}; + /// + /// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); + /// + /// let mut builder = Builder::from_env(env); + /// builder.init(); + /// ``` + pub fn from_env<'a, E>(env: E) -> Self + where + E: Into>, + { + let mut builder = Builder::new(); + builder.parse_env(env); + builder + } + + /// Applies the configuration from the environment. + /// + /// This function allows a builder to be configured with default parameters, + /// to be then overridden by the environment. + /// + /// # Examples + /// + /// Initialise a logger with filter level `Off`, then override the log + /// filter from an environment variable called `MY_LOG`: + /// + /// ``` + /// use log::LevelFilter; + /// use env_logger::Builder; + /// + /// let mut builder = Builder::new(); + /// + /// builder.filter_level(LevelFilter::Off); + /// builder.parse_env("MY_LOG"); + /// builder.init(); + /// ``` + /// + /// Initialise a logger with filter level `Off`, then use the `MY_LOG` + /// variable to override filtering and `MY_LOG_STYLE` to override whether + /// or not to write styles: + /// + /// ``` + /// use log::LevelFilter; + /// use env_logger::{Builder, Env}; + /// + /// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); + /// + /// let mut builder = Builder::new(); + /// builder.filter_level(LevelFilter::Off); + /// builder.parse_env(env); + /// builder.init(); + /// ``` + pub fn parse_env<'a, E>(&mut self, env: E) -> &mut Self + where + E: Into>, + { + let env = env.into(); + + if let Some(s) = env.get_filter() { + self.parse_filters(&s); + } + + if let Some(s) = env.get_write_style() { + self.parse_write_style(&s); + } + + self + } + + /// Initializes the log builder from the environment using default variable names. + /// + /// This method is a convenient way to call `from_env(Env::default())` without + /// having to use the `Env` type explicitly. The builder will use the + /// [default environment variables]. + /// + /// # Examples + /// + /// Initialise a logger using the default environment variables: + /// + /// ``` + /// use env_logger::Builder; + /// + /// let mut builder = Builder::from_default_env(); + /// builder.init(); + /// ``` + /// + /// [default environment variables]: struct.Env.html#default-environment-variables + pub fn from_default_env() -> Self { + Self::from_env(Env::default()) + } + + /// Applies the configuration from the environment using default variable names. + /// + /// This method is a convenient way to call `parse_env(Env::default())` without + /// having to use the `Env` type explicitly. The builder will use the + /// [default environment variables]. + /// + /// # Examples + /// + /// Initialise a logger with filter level `Off`, then configure it using the + /// default environment variables: + /// + /// ``` + /// use log::LevelFilter; + /// use env_logger::Builder; + /// + /// let mut builder = Builder::new(); + /// builder.filter_level(LevelFilter::Off); + /// builder.parse_default_env(); + /// builder.init(); + /// ``` + /// + /// [default environment variables]: struct.Env.html#default-environment-variables + pub fn parse_default_env(&mut self) -> &mut Self { + self.parse_env(Env::default()) + } + + /// Sets the format function for formatting the log output. + /// + /// This function is called on each record logged and should format the + /// log record and output it to the given [`Formatter`]. + /// + /// The format function is expected to output the string directly to the + /// `Formatter` so that implementations can use the [`std::fmt`] macros + /// to format and output without intermediate heap allocations. The default + /// `env_logger` formatter takes advantage of this. + /// + /// # Examples + /// + /// Use a custom format to write only the log message: + /// + /// ``` + /// use std::io::Write; + /// use env_logger::Builder; + /// + /// let mut builder = Builder::new(); + /// + /// builder.format(|buf, record| writeln!(buf, "{}", record.args())); + /// ``` + /// + /// [`Formatter`]: fmt/struct.Formatter.html + /// [`String`]: https://doc.rust-lang.org/stable/std/string/struct.String.html + /// [`std::fmt`]: https://doc.rust-lang.org/std/fmt/index.html + pub fn format(&mut self, format: F) -> &mut Self + where + F: Fn(&mut Formatter, &Record) -> io::Result<()> + Sync + Send, + { + self.format.custom_format = Some(Box::new(format)); + self + } + + /// Use the default format. + /// + /// This method will clear any custom format set on the builder. + pub fn default_format(&mut self) -> &mut Self { + self.format = Default::default(); + self + } + + /// Whether or not to write the level in the default format. + pub fn format_level(&mut self, write: bool) -> &mut Self { + self.format.format_level = write; + self + } + + /// Whether or not to write the module path in the default format. + pub fn format_module_path(&mut self, write: bool) -> &mut Self { + self.format.format_module_path = write; + self + } + + /// Whether or not to write the target in the default format. + pub fn format_target(&mut self, write: bool) -> &mut Self { + self.format.format_target = write; + self + } + + /// Configures the amount of spaces to use to indent multiline log records. + /// A value of `None` disables any kind of indentation. + pub fn format_indent(&mut self, indent: Option) -> &mut Self { + self.format.format_indent = indent; + self + } + + /// Configures if timestamp should be included and in what precision. + pub fn format_timestamp(&mut self, timestamp: Option) -> &mut Self { + self.format.format_timestamp = timestamp; + self + } + + /// Configures the timestamp to use second precision. + pub fn format_timestamp_secs(&mut self) -> &mut Self { + self.format_timestamp(Some(fmt::TimestampPrecision::Seconds)) + } + + /// Configures the timestamp to use millisecond precision. + pub fn format_timestamp_millis(&mut self) -> &mut Self { + self.format_timestamp(Some(fmt::TimestampPrecision::Millis)) + } + + /// Configures the timestamp to use microsecond precision. + pub fn format_timestamp_micros(&mut self) -> &mut Self { + self.format_timestamp(Some(fmt::TimestampPrecision::Micros)) + } + + /// Configures the timestamp to use nanosecond precision. + pub fn format_timestamp_nanos(&mut self) -> &mut Self { + self.format_timestamp(Some(fmt::TimestampPrecision::Nanos)) + } + + /// Configures the end of line suffix. + pub fn format_suffix(&mut self, suffix: &'static str) -> &mut Self { + self.format.format_suffix = suffix; + self + } + + /// Adds a directive to the filter for a specific module. + /// + /// # Examples + /// + /// Only include messages for info and above for logs in `path::to::module`: + /// + /// ``` + /// use env_logger::Builder; + /// use log::LevelFilter; + /// + /// let mut builder = Builder::new(); + /// + /// builder.filter_module("path::to::module", LevelFilter::Info); + /// ``` + pub fn filter_module(&mut self, module: &str, level: LevelFilter) -> &mut Self { + self.filter.filter_module(module, level); + self + } + + /// Adds a directive to the filter for all modules. + /// + /// # Examples + /// + /// Only include messages for info and above for logs globally: + /// + /// ``` + /// use env_logger::Builder; + /// use log::LevelFilter; + /// + /// let mut builder = Builder::new(); + /// + /// builder.filter_level(LevelFilter::Info); + /// ``` + pub fn filter_level(&mut self, level: LevelFilter) -> &mut Self { + self.filter.filter_level(level); + self + } + + /// Adds filters to the logger. + /// + /// The given module (if any) will log at most the specified level provided. + /// If no module is provided then the filter will apply to all log messages. + /// + /// # Examples + /// + /// Only include messages for info and above for logs in `path::to::module`: + /// + /// ``` + /// use env_logger::Builder; + /// use log::LevelFilter; + /// + /// let mut builder = Builder::new(); + /// + /// builder.filter(Some("path::to::module"), LevelFilter::Info); + /// ``` + pub fn filter(&mut self, module: Option<&str>, level: LevelFilter) -> &mut Self { + self.filter.filter(module, level); + self + } + + /// Parses the directives string in the same form as the `RUST_LOG` + /// environment variable. + /// + /// See the module documentation for more details. + pub fn parse_filters(&mut self, filters: &str) -> &mut Self { + self.filter.parse(filters); + self + } + + /// Sets the target for the log output. + /// + /// Env logger can log to either stdout, stderr or a custom pipe. The default is stderr. + /// + /// The custom pipe can be used to send the log messages to a custom sink (for example a file). + /// Do note that direct writes to a file can become a bottleneck due to IO operation times. + /// + /// # Examples + /// + /// Write log message to `stdout`: + /// + /// ``` + /// use env_logger::{Builder, Target}; + /// + /// let mut builder = Builder::new(); + /// + /// builder.target(Target::Stdout); + /// ``` + pub fn target(&mut self, target: fmt::Target) -> &mut Self { + self.writer.target(target); + self + } + + /// Sets whether or not styles will be written. + /// + /// This can be useful in environments that don't support control characters + /// for setting colors. + /// + /// # Examples + /// + /// Never attempt to write styles: + /// + /// ``` + /// use env_logger::{Builder, WriteStyle}; + /// + /// let mut builder = Builder::new(); + /// + /// builder.write_style(WriteStyle::Never); + /// ``` + pub fn write_style(&mut self, write_style: fmt::WriteStyle) -> &mut Self { + self.writer.write_style(write_style); + self + } + + /// Parses whether or not to write styles in the same form as the `RUST_LOG_STYLE` + /// environment variable. + /// + /// See the module documentation for more details. + pub fn parse_write_style(&mut self, write_style: &str) -> &mut Self { + self.writer.parse_write_style(write_style); + self + } + + /// Sets whether or not the logger will be used in unit tests. + /// + /// If `is_test` is `true` then the logger will allow the testing framework to + /// capture log records rather than printing them to the terminal directly. + pub fn is_test(&mut self, is_test: bool) -> &mut Self { + self.writer.is_test(is_test); + self + } + + /// Initializes the global logger with the built env logger. + /// + /// This should be called early in the execution of a Rust program. Any log + /// events that occur before initialization will be ignored. + /// + /// # Errors + /// + /// This function will fail if it is called more than once, or if another + /// library has already initialized a global logger. + pub fn try_init(&mut self) -> Result<(), SetLoggerError> { + let logger = self.build(); + + let max_level = logger.filter(); + let r = log::set_boxed_logger(Box::new(logger)); + + if r.is_ok() { + log::set_max_level(max_level); + } + + r + } + + /// Initializes the global logger with the built env logger. + /// + /// This should be called early in the execution of a Rust program. Any log + /// events that occur before initialization will be ignored. + /// + /// # Panics + /// + /// This function will panic if it is called more than once, or if another + /// library has already initialized a global logger. + pub fn init(&mut self) { + self.try_init() + .expect("Builder::init should not be called after logger initialized"); + } + + /// Build an env logger. + /// + /// The returned logger implements the `Log` trait and can be installed manually + /// or nested within another logger. + pub fn build(&mut self) -> Logger { + assert!(!self.built, "attempt to re-use consumed builder"); + self.built = true; + + Logger { + writer: self.writer.build(), + filter: self.filter.build(), + format: self.format.build(), + } + } +} + +impl std::fmt::Debug for Builder { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + if self.built { + f.debug_struct("Logger").field("built", &true).finish() + } else { + f.debug_struct("Logger") + .field("filter", &self.filter) + .field("writer", &self.writer) + .finish() + } + } +} + +/// The env logger. +/// +/// This struct implements the `Log` trait from the [`log` crate][log-crate-url], +/// which allows it to act as a logger. +/// +/// The [`init()`], [`try_init()`], [`Builder::init()`] and [`Builder::try_init()`] +/// methods will each construct a `Logger` and immediately initialize it as the +/// default global logger. +/// +/// If you'd instead need access to the constructed `Logger`, you can use +/// the associated [`Builder`] and install it with the +/// [`log` crate][log-crate-url] directly. +/// +/// [log-crate-url]: https://docs.rs/log +/// [`init()`]: fn.init.html +/// [`try_init()`]: fn.try_init.html +/// [`Builder::init()`]: struct.Builder.html#method.init +/// [`Builder::try_init()`]: struct.Builder.html#method.try_init +/// [`Builder`]: struct.Builder.html +pub struct Logger { + writer: Writer, + filter: Filter, + format: FormatFn, +} + +impl Logger { + /// Creates the logger from the environment. + /// + /// The variables used to read configuration from can be tweaked before + /// passing in. + /// + /// # Examples + /// + /// Create a logger reading the log filter from an environment variable + /// called `MY_LOG`: + /// + /// ``` + /// use env_logger::Logger; + /// + /// let logger = Logger::from_env("MY_LOG"); + /// ``` + /// + /// Create a logger using the `MY_LOG` variable for filtering and + /// `MY_LOG_STYLE` for whether or not to write styles: + /// + /// ``` + /// use env_logger::{Logger, Env}; + /// + /// let env = Env::new().filter_or("MY_LOG", "info").write_style_or("MY_LOG_STYLE", "always"); + /// + /// let logger = Logger::from_env(env); + /// ``` + pub fn from_env<'a, E>(env: E) -> Self + where + E: Into>, + { + Builder::from_env(env).build() + } + + /// Creates the logger from the environment using default variable names. + /// + /// This method is a convenient way to call `from_env(Env::default())` without + /// having to use the `Env` type explicitly. The logger will use the + /// [default environment variables]. + /// + /// # Examples + /// + /// Creates a logger using the default environment variables: + /// + /// ``` + /// use env_logger::Logger; + /// + /// let logger = Logger::from_default_env(); + /// ``` + /// + /// [default environment variables]: struct.Env.html#default-environment-variables + pub fn from_default_env() -> Self { + Builder::from_default_env().build() + } + + /// Returns the maximum `LevelFilter` that this env logger instance is + /// configured to output. + pub fn filter(&self) -> LevelFilter { + self.filter.filter() + } + + /// Checks if this record matches the configured filter. + pub fn matches(&self, record: &Record) -> bool { + self.filter.matches(record) + } +} + +impl Log for Logger { + fn enabled(&self, metadata: &Metadata) -> bool { + self.filter.enabled(metadata) + } + + fn log(&self, record: &Record) { + if self.matches(record) { + // Log records are written to a thread-local buffer before being printed + // to the terminal. We clear these buffers afterwards, but they aren't shrunk + // so will always at least have capacity for the largest log record formatted + // on that thread. + // + // If multiple `Logger`s are used by the same threads then the thread-local + // formatter might have different color support. If this is the case the + // formatter and its buffer are discarded and recreated. + + thread_local! { + static FORMATTER: RefCell> = RefCell::new(None); + } + + let print = |formatter: &mut Formatter, record: &Record| { + let _ = + (self.format)(formatter, record).and_then(|_| formatter.print(&self.writer)); + + // Always clear the buffer afterwards + formatter.clear(); + }; + + let printed = FORMATTER + .try_with(|tl_buf| { + match tl_buf.try_borrow_mut() { + // There are no active borrows of the buffer + Ok(mut tl_buf) => match *tl_buf { + // We have a previously set formatter + Some(ref mut formatter) => { + // Check the buffer style. If it's different from the logger's + // style then drop the buffer and recreate it. + if formatter.write_style() != self.writer.write_style() { + *formatter = Formatter::new(&self.writer); + } + + print(formatter, record); + } + // We don't have a previously set formatter + None => { + let mut formatter = Formatter::new(&self.writer); + print(&mut formatter, record); + + *tl_buf = Some(formatter); + } + }, + // There's already an active borrow of the buffer (due to re-entrancy) + Err(_) => { + print(&mut Formatter::new(&self.writer), record); + } + } + }) + .is_ok(); + + if !printed { + // The thread-local storage was not available (because its + // destructor has already run). Create a new single-use + // Formatter on the stack for this call. + print(&mut Formatter::new(&self.writer), record); + } + } + } + + fn flush(&self) {} +} + +impl std::fmt::Debug for Logger { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.debug_struct("Logger") + .field("filter", &self.filter) + .finish() + } +} + +/// Set of environment variables to configure from. +/// +/// # Default environment variables +/// +/// By default, the `Env` will read the following environment variables: +/// +/// - `RUST_LOG`: the level filter +/// - `RUST_LOG_STYLE`: whether or not to print styles with records. +/// +/// These sources can be configured using the builder methods on `Env`. +#[derive(Debug)] +pub struct Env<'a> { + filter: Var<'a>, + write_style: Var<'a>, +} + +impl<'a> Env<'a> { + /// Get a default set of environment variables. + pub fn new() -> Self { + Self::default() + } + + /// Specify an environment variable to read the filter from. + pub fn filter(mut self, filter_env: E) -> Self + where + E: Into>, + { + self.filter = Var::new(filter_env); + + self + } + + /// Specify an environment variable to read the filter from. + /// + /// If the variable is not set, the default value will be used. + pub fn filter_or(mut self, filter_env: E, default: V) -> Self + where + E: Into>, + V: Into>, + { + self.filter = Var::new_with_default(filter_env, default); + + self + } + + /// Use the default environment variable to read the filter from. + /// + /// If the variable is not set, the default value will be used. + pub fn default_filter_or(mut self, default: V) -> Self + where + V: Into>, + { + self.filter = Var::new_with_default(DEFAULT_FILTER_ENV, default); + + self + } + + fn get_filter(&self) -> Option { + self.filter.get() + } + + /// Specify an environment variable to read the style from. + pub fn write_style(mut self, write_style_env: E) -> Self + where + E: Into>, + { + self.write_style = Var::new(write_style_env); + + self + } + + /// Specify an environment variable to read the style from. + /// + /// If the variable is not set, the default value will be used. + pub fn write_style_or(mut self, write_style_env: E, default: V) -> Self + where + E: Into>, + V: Into>, + { + self.write_style = Var::new_with_default(write_style_env, default); + + self + } + + /// Use the default environment variable to read the style from. + /// + /// If the variable is not set, the default value will be used. + pub fn default_write_style_or(mut self, default: V) -> Self + where + V: Into>, + { + self.write_style = Var::new_with_default(DEFAULT_WRITE_STYLE_ENV, default); + + self + } + + fn get_write_style(&self) -> Option { + self.write_style.get() + } +} + +impl<'a, T> From for Env<'a> +where + T: Into>, +{ + fn from(filter_env: T) -> Self { + Env::default().filter(filter_env.into()) + } +} + +impl<'a> Default for Env<'a> { + fn default() -> Self { + Env { + filter: Var::new(DEFAULT_FILTER_ENV), + write_style: Var::new(DEFAULT_WRITE_STYLE_ENV), + } + } +} + +#[derive(Debug)] +struct Var<'a> { + name: Cow<'a, str>, + default: Option>, +} + +impl<'a> Var<'a> { + fn new(name: E) -> Self + where + E: Into>, + { + Var { + name: name.into(), + default: None, + } + } + + fn new_with_default(name: E, default: V) -> Self + where + E: Into>, + V: Into>, + { + Var { + name: name.into(), + default: Some(default.into()), + } + } + + fn get(&self) -> Option { + env::var(&*self.name) + .ok() + .or_else(|| self.default.to_owned().map(|v| v.into_owned())) + } +} + +/// Attempts to initialize the global logger with an env logger. +/// +/// This should be called early in the execution of a Rust program. Any log +/// events that occur before initialization will be ignored. +/// +/// # Errors +/// +/// This function will fail if it is called more than once, or if another +/// library has already initialized a global logger. +pub fn try_init() -> Result<(), SetLoggerError> { + try_init_from_env(Env::default()) +} + +/// Initializes the global logger with an env logger. +/// +/// This should be called early in the execution of a Rust program. Any log +/// events that occur before initialization will be ignored. +/// +/// # Panics +/// +/// This function will panic if it is called more than once, or if another +/// library has already initialized a global logger. +pub fn init() { + try_init().expect("env_logger::init should not be called after logger initialized"); +} + +/// Attempts to initialize the global logger with an env logger from the given +/// environment variables. +/// +/// This should be called early in the execution of a Rust program. Any log +/// events that occur before initialization will be ignored. +/// +/// # Examples +/// +/// Initialise a logger using the `MY_LOG` environment variable for filters +/// and `MY_LOG_STYLE` for writing colors: +/// +/// ``` +/// use env_logger::{Builder, Env}; +/// +/// # fn run() -> Result<(), Box> { +/// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); +/// +/// env_logger::try_init_from_env(env)?; +/// +/// Ok(()) +/// # } +/// # run().unwrap(); +/// ``` +/// +/// # Errors +/// +/// This function will fail if it is called more than once, or if another +/// library has already initialized a global logger. +pub fn try_init_from_env<'a, E>(env: E) -> Result<(), SetLoggerError> +where + E: Into>, +{ + let mut builder = Builder::from_env(env); + + builder.try_init() +} + +/// Initializes the global logger with an env logger from the given environment +/// variables. +/// +/// This should be called early in the execution of a Rust program. Any log +/// events that occur before initialization will be ignored. +/// +/// # Examples +/// +/// Initialise a logger using the `MY_LOG` environment variable for filters +/// and `MY_LOG_STYLE` for writing colors: +/// +/// ``` +/// use env_logger::{Builder, Env}; +/// +/// let env = Env::new().filter("MY_LOG").write_style("MY_LOG_STYLE"); +/// +/// env_logger::init_from_env(env); +/// ``` +/// +/// # Panics +/// +/// This function will panic if it is called more than once, or if another +/// library has already initialized a global logger. +pub fn init_from_env<'a, E>(env: E) +where + E: Into>, +{ + try_init_from_env(env) + .expect("env_logger::init_from_env should not be called after logger initialized"); +} + +/// Create a new builder with the default environment variables. +/// +/// The builder can be configured before being initialized. +/// This is a convenient way of calling [`Builder::from_default_env`]. +/// +/// [`Builder::from_default_env`]: struct.Builder.html#method.from_default_env +pub fn builder() -> Builder { + Builder::from_default_env() +} + +/// Create a builder from the given environment variables. +/// +/// The builder can be configured before being initialized. +#[deprecated( + since = "0.8.0", + note = "Prefer `env_logger::Builder::from_env()` instead." +)] +pub fn from_env<'a, E>(env: E) -> Builder +where + E: Into>, +{ + Builder::from_env(env) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn env_get_filter_reads_from_var_if_set() { + env::set_var("env_get_filter_reads_from_var_if_set", "from var"); + + let env = Env::new().filter_or("env_get_filter_reads_from_var_if_set", "from default"); + + assert_eq!(Some("from var".to_owned()), env.get_filter()); + } + + #[test] + fn env_get_filter_reads_from_default_if_var_not_set() { + env::remove_var("env_get_filter_reads_from_default_if_var_not_set"); + + let env = Env::new().filter_or( + "env_get_filter_reads_from_default_if_var_not_set", + "from default", + ); + + assert_eq!(Some("from default".to_owned()), env.get_filter()); + } + + #[test] + fn env_get_write_style_reads_from_var_if_set() { + env::set_var("env_get_write_style_reads_from_var_if_set", "from var"); + + let env = + Env::new().write_style_or("env_get_write_style_reads_from_var_if_set", "from default"); + + assert_eq!(Some("from var".to_owned()), env.get_write_style()); + } + + #[test] + fn env_get_write_style_reads_from_default_if_var_not_set() { + env::remove_var("env_get_write_style_reads_from_default_if_var_not_set"); + + let env = Env::new().write_style_or( + "env_get_write_style_reads_from_default_if_var_not_set", + "from default", + ); + + assert_eq!(Some("from default".to_owned()), env.get_write_style()); + } + + #[test] + fn builder_parse_env_overrides_existing_filters() { + env::set_var( + "builder_parse_default_env_overrides_existing_filters", + "debug", + ); + let env = Env::new().filter("builder_parse_default_env_overrides_existing_filters"); + + let mut builder = Builder::new(); + builder.filter_level(LevelFilter::Trace); + // Overrides global level to debug + builder.parse_env(env); + + assert_eq!(builder.filter.build().filter(), LevelFilter::Debug); + } +} diff --git a/vendor/filetime/.cargo-checksum.json b/vendor/filetime/.cargo-checksum.json index e53066aba..0e5e3c63a 100644 --- a/vendor/filetime/.cargo-checksum.json +++ b/vendor/filetime/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ca0c0554a36d5523989bc1a47d85d71724bc4f2c881fdb3ad285b7e46bad234e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"6cd295d9f4efe412971b1855ecaf7b19ef3956006a652ea205c456a5d33550c1","src/lib.rs":"eec6b5e3be2c1d5e068a9724b503e729a1e11dae4cd1bc816110c94a0bc14fa0","src/redox.rs":"898997b73c20818cf4601a1f4bcdf1b7dbf3b5d9d071cdc9fce5d1652f6bfc43","src/unix/android.rs":"d929826a9a92003b7aaa6435adc220efbb70c15308f9eed5ee517d88451fcaf6","src/unix/linux.rs":"648498bdf715766eeffdc2dff6a58db51cf6b244c431a6d53c33cbc73f1998d4","src/unix/macos.rs":"1b19a24bee240aba8d564405991bb0ee36ba72217461c8ac6829144d28f7e046","src/unix/mod.rs":"52512c922e1dbb47a6c7f0354c6198ca1ac61ea4d540bc0d73d3a3fd08908ba1","src/unix/utimensat.rs":"0876aa32393689fcb5eec913c5d34954956a715913d611749b04243a2dbcf897","src/unix/utimes.rs":"d2d8ca5daed3d1ec0a0aed1fc03450deb4b7f1fcdb96ed40b8d2cfefd0e827ee","src/wasm.rs":"a82734259846a3349d42da011c1065d21f3981bd20d6eb43495e34808b83af9a","src/windows.rs":"3314a0def8028d8f2a4bc01377d5874ab9ddf8684aad13573c89b427bf2d9911"},"package":"d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"} \ No newline at end of file +{"files":{"Cargo.toml":"8d85b719c7034a8267e62b0d9c49995a52a25e3fcc13265dcde8229b3f3a1764","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"6cd295d9f4efe412971b1855ecaf7b19ef3956006a652ea205c456a5d33550c1","src/lib.rs":"eec6b5e3be2c1d5e068a9724b503e729a1e11dae4cd1bc816110c94a0bc14fa0","src/redox.rs":"898997b73c20818cf4601a1f4bcdf1b7dbf3b5d9d071cdc9fce5d1652f6bfc43","src/unix/android.rs":"d929826a9a92003b7aaa6435adc220efbb70c15308f9eed5ee517d88451fcaf6","src/unix/linux.rs":"648498bdf715766eeffdc2dff6a58db51cf6b244c431a6d53c33cbc73f1998d4","src/unix/macos.rs":"1b19a24bee240aba8d564405991bb0ee36ba72217461c8ac6829144d28f7e046","src/unix/mod.rs":"a34faf9cfb0bd0f18d3d99f5e5b2733fb3c8cb4ef0d948084b62a98186b3595e","src/unix/utimensat.rs":"0876aa32393689fcb5eec913c5d34954956a715913d611749b04243a2dbcf897","src/unix/utimes.rs":"d2d8ca5daed3d1ec0a0aed1fc03450deb4b7f1fcdb96ed40b8d2cfefd0e827ee","src/wasm.rs":"a82734259846a3349d42da011c1065d21f3981bd20d6eb43495e34808b83af9a","src/windows.rs":"3314a0def8028d8f2a4bc01377d5874ab9ddf8684aad13573c89b427bf2d9911"},"package":"1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"} \ No newline at end of file diff --git a/vendor/filetime/Cargo.toml b/vendor/filetime/Cargo.toml index 5c28c6cdd..0540ffb89 100644 --- a/vendor/filetime/Cargo.toml +++ b/vendor/filetime/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "filetime" -version = "0.2.22" +version = "0.2.23" authors = ["Alex Crichton "] description = """ Platform-agnostic accessors of timestamps in File metadata @@ -34,13 +34,13 @@ version = "1.0.0" version = "3" [target."cfg(target_os = \"redox\")".dependencies.redox_syscall] -version = "0.3.5" +version = "0.4.1" [target."cfg(unix)".dependencies.libc] version = "0.2.27" [target."cfg(windows)".dependencies.windows-sys] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", diff --git a/vendor/filetime/src/unix/mod.rs b/vendor/filetime/src/unix/mod.rs index df62de429..f5a48b29d 100644 --- a/vendor/filetime/src/unix/mod.rs +++ b/vendor/filetime/src/unix/mod.rs @@ -85,34 +85,17 @@ pub fn from_last_access_time(meta: &fs::Metadata) -> FileTime { } pub fn from_creation_time(meta: &fs::Metadata) -> Option { - macro_rules! birthtim { - ($(($e:expr, $i:ident)),*) => { - #[cfg(any($(target_os = $e),*))] - fn imp(meta: &fs::Metadata) -> Option { - $( - #[cfg(target_os = $e)] - use std::os::$i::fs::MetadataExt; - )* - Some(FileTime { - seconds: meta.st_birthtime(), - nanos: meta.st_birthtime_nsec() as u32, - }) - } - - #[cfg(all($(not(target_os = $e)),*))] - fn imp(_meta: &fs::Metadata) -> Option { - None - } - } + #[cfg(target_os = "bitrig")] + { + use std::os::bitrig::fs::MetadataExt; + Some(FileTime { + seconds: meta.st_birthtime(), + nanos: meta.st_birthtime_nsec() as u32, + }) } - birthtim! { - ("bitrig", bitrig), - ("freebsd", freebsd), - ("ios", ios), - ("macos", macos), - ("openbsd", openbsd) + #[cfg(not(target_os = "bitrig"))] + { + meta.created().map(|i| i.into()).ok() } - - imp(meta) } diff --git a/vendor/futures-channel/.cargo-checksum.json b/vendor/futures-channel/.cargo-checksum.json index 371bb582f..831098efc 100644 --- a/vendor/futures-channel/.cargo-checksum.json +++ b/vendor/futures-channel/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"d285eda4d96587b0256112206d1d1d313cd64216c32b0812c097bfe5b0d5c81d","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"faccd17503a06e7df67feb53da22dba6a8ea80ee88736ed37fae038d0d0906dd","benches/sync_mpsc.rs":"1019dd027f104f58883f396ff70efc3dd69b3a7d62df17af090e07b2b05eaf66","build.rs":"5b263bd2bd587511a9c8daef580b05e0613c15a6c5f800b1e5bc145fa013d99e","no_atomic_cas.rs":"7ae747b83b08dd926c1696faf4ecab9399c652ae77d5179221258c73b8eecb6f","src/lib.rs":"2955e70d292208747fbb29810ef88f390f0f1b22b112fa59d60f95480d470e75","src/lock.rs":"38655a797456ea4f67d132c42055cf74f18195e875c3b337fc81a12901f79292","src/mpsc/mod.rs":"ecb48325aad15406ed79bf7271440bfbab5af19d5e7c7d8018e8b19613ae1558","src/mpsc/queue.rs":"0856f8b744c537c291d60cc7879ddb2d8cd686a6ac0e4a79c6877f8c3f8f6dbc","src/mpsc/sink_impl.rs":"c9977b530187e82c912fcd46e08316e48ed246e77bb2419d53020e69e403d086","src/oneshot.rs":"1e4e33c75d72b5d11cc23710e2a08099e04b72bf2368b68e7c1eb0beb6fc03fa","tests/channel.rs":"88f4a41d82b5c1b01e153d071a2bf48e0697355908c55ca42342ed45e63fdec8","tests/mpsc-close.rs":"cb3a427403051a731701de5d2a489f8a7b7a5eaceb5edfafef4a539e63588d3c","tests/mpsc-size_hint.rs":"50fba3495bdf4e91a84ad105b148b6cd72f73f64a85703414eeb2d07732c66b9","tests/mpsc.rs":"5e09a49bea7b7ee30c9845bc5e80565d720c6e2355bcac4a0c745b3c7e6cc212","tests/oneshot.rs":"0f97d28852a1fd1327211772f43322c93916a639be3f2581e49ad37c9f8a2f88"},"package":"ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"} \ No newline at end of file +{"files":{"Cargo.toml":"042bcef7e6361cc21e948695a1ac1afabb447a8336cb135567fe8355ff2b468d","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"faccd17503a06e7df67feb53da22dba6a8ea80ee88736ed37fae038d0d0906dd","benches/sync_mpsc.rs":"1019dd027f104f58883f396ff70efc3dd69b3a7d62df17af090e07b2b05eaf66","src/lib.rs":"322f624b2cbad1ed7e2845811035c2a91b0fa6ed98a456f57b5d3d481fb7fbd9","src/lock.rs":"38655a797456ea4f67d132c42055cf74f18195e875c3b337fc81a12901f79292","src/mpsc/mod.rs":"ecb48325aad15406ed79bf7271440bfbab5af19d5e7c7d8018e8b19613ae1558","src/mpsc/queue.rs":"0856f8b744c537c291d60cc7879ddb2d8cd686a6ac0e4a79c6877f8c3f8f6dbc","src/mpsc/sink_impl.rs":"c9977b530187e82c912fcd46e08316e48ed246e77bb2419d53020e69e403d086","src/oneshot.rs":"1e4e33c75d72b5d11cc23710e2a08099e04b72bf2368b68e7c1eb0beb6fc03fa","tests/channel.rs":"88f4a41d82b5c1b01e153d071a2bf48e0697355908c55ca42342ed45e63fdec8","tests/mpsc-close.rs":"cb3a427403051a731701de5d2a489f8a7b7a5eaceb5edfafef4a539e63588d3c","tests/mpsc-size_hint.rs":"50fba3495bdf4e91a84ad105b148b6cd72f73f64a85703414eeb2d07732c66b9","tests/mpsc.rs":"5e09a49bea7b7ee30c9845bc5e80565d720c6e2355bcac4a0c745b3c7e6cc212","tests/oneshot.rs":"0f97d28852a1fd1327211772f43322c93916a639be3f2581e49ad37c9f8a2f88"},"package":"eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"} \ No newline at end of file diff --git a/vendor/futures-channel/Cargo.toml b/vendor/futures-channel/Cargo.toml index 389625c4c..8142bdaec 100644 --- a/vendor/futures-channel/Cargo.toml +++ b/vendor/futures-channel/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures-channel" -version = "0.3.29" +version = "0.3.30" description = """ Channels for asynchronous communication using futures-rs. """ @@ -30,11 +30,11 @@ rustdoc-args = [ ] [dependencies.futures-core] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-sink] -version = "0.3.29" +version = "0.3.30" optional = true default-features = false diff --git a/vendor/futures-channel/build.rs b/vendor/futures-channel/build.rs deleted file mode 100644 index 05e0496d9..000000000 --- a/vendor/futures-channel/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// The rustc-cfg listed below are considered public API, but it is *unstable* -// and outside of the normal semver guarantees: -// -// - `futures_no_atomic_cas` -// Assume the target does *not* support atomic CAS operations. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// -// With the exceptions mentioned above, the rustc-cfg emitted by the build -// script are *not* public API. - -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::env; - -include!("no_atomic_cas.rs"); - -fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, - Err(e) => { - println!( - "cargo:warning={}: unable to get TARGET environment variable: {}", - env!("CARGO_PKG_NAME"), - e - ); - return; - } - }; - - // Note that this is `no_*`, not `has_*`. This allows treating - // `cfg(target_has_atomic = "ptr")` as true when the build script doesn't - // run. This is needed for compatibility with non-cargo build systems that - // don't run the build script. - if NO_ATOMIC_CAS.contains(&&*target) { - println!("cargo:rustc-cfg=futures_no_atomic_cas"); - } - - println!("cargo:rerun-if-changed=no_atomic_cas.rs"); -} diff --git a/vendor/futures-channel/no_atomic_cas.rs b/vendor/futures-channel/no_atomic_cas.rs deleted file mode 100644 index 16ec628cd..000000000 --- a/vendor/futures-channel/no_atomic_cas.rs +++ /dev/null @@ -1,17 +0,0 @@ -// This file is @generated by no_atomic_cas.sh. -// It is not intended for manual editing. - -const NO_ATOMIC_CAS: &[&str] = &[ - "armv4t-none-eabi", - "armv5te-none-eabi", - "avr-unknown-gnu-atmega328", - "bpfeb-unknown-none", - "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", -]; diff --git a/vendor/futures-channel/src/lib.rs b/vendor/futures-channel/src/lib.rs index 4cd936d55..f611e6b9f 100644 --- a/vendor/futures-channel/src/lib.rs +++ b/vendor/futures-channel/src/lib.rs @@ -27,16 +27,16 @@ ) ))] -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] extern crate alloc; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod lock; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "std")] pub mod mpsc; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub mod oneshot; diff --git a/vendor/futures-core/.cargo-checksum.json b/vendor/futures-core/.cargo-checksum.json index c8ceffc62..b43772f84 100644 --- a/vendor/futures-core/.cargo-checksum.json +++ b/vendor/futures-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"a42f5d0345ecafd60c3686aa3212cc9ef2d5a72da5f26783519bf1fcae729c49","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"e8258273fed6f1796485777655118f2369fd3f000191e9d8cdbd10bf052946a9","build.rs":"5b263bd2bd587511a9c8daef580b05e0613c15a6c5f800b1e5bc145fa013d99e","no_atomic_cas.rs":"7ae747b83b08dd926c1696faf4ecab9399c652ae77d5179221258c73b8eecb6f","src/future.rs":"0cb559fad0d43566dab959e929c4631c25cf749e2e29a5444fbcad464c9262ae","src/lib.rs":"eacd5816fbb914ca061d49ff6203723ebbe639eb7c45ebfa8a0613069d174111","src/stream.rs":"f1c7ab84161c5d5b424655b257fc3183eb6f2ed5324ba4006a70f9a4b0dc8872","src/task/__internal/atomic_waker.rs":"e5184bcc772c1472a2f0f9899bd3e388b74b771d327d801a5ea7e4aca6e57715","src/task/__internal/mod.rs":"6a343eb05b81352bf4b70e1f769d0c16b79e430d86500b084bd19b5ff2f129f5","src/task/mod.rs":"e213602a2fe5ae78ad5f1ca20e6d32dcbab17aba5b6b072fb927a72da99b4a11","src/task/poll.rs":"74c2717c1f9a37587a367da1b690d1cd2312e95dbaffca42be4755f1cd164bb8"},"package":"eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"} \ No newline at end of file +{"files":{"Cargo.toml":"21a7215adbf49919270abecb9deb8d81a32383f4d2163d82869139cbffe6648e","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"e8258273fed6f1796485777655118f2369fd3f000191e9d8cdbd10bf052946a9","src/future.rs":"0cb559fad0d43566dab959e929c4631c25cf749e2e29a5444fbcad464c9262ae","src/lib.rs":"eacd5816fbb914ca061d49ff6203723ebbe639eb7c45ebfa8a0613069d174111","src/stream.rs":"f1c7ab84161c5d5b424655b257fc3183eb6f2ed5324ba4006a70f9a4b0dc8872","src/task/__internal/atomic_waker.rs":"e5184bcc772c1472a2f0f9899bd3e388b74b771d327d801a5ea7e4aca6e57715","src/task/__internal/mod.rs":"1cc15fd61942a29ea558c5f4d5782e46adcfd914cab82be084a6882fa9afc122","src/task/mod.rs":"e213602a2fe5ae78ad5f1ca20e6d32dcbab17aba5b6b072fb927a72da99b4a11","src/task/poll.rs":"74c2717c1f9a37587a367da1b690d1cd2312e95dbaffca42be4755f1cd164bb8"},"package":"dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"} \ No newline at end of file diff --git a/vendor/futures-core/Cargo.toml b/vendor/futures-core/Cargo.toml index ff95f873c..a97c11a51 100644 --- a/vendor/futures-core/Cargo.toml +++ b/vendor/futures-core/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.36" name = "futures-core" -version = "0.3.29" +version = "0.3.30" description = """ The core traits and types in for the `futures` library. """ diff --git a/vendor/futures-core/build.rs b/vendor/futures-core/build.rs deleted file mode 100644 index 05e0496d9..000000000 --- a/vendor/futures-core/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// The rustc-cfg listed below are considered public API, but it is *unstable* -// and outside of the normal semver guarantees: -// -// - `futures_no_atomic_cas` -// Assume the target does *not* support atomic CAS operations. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// -// With the exceptions mentioned above, the rustc-cfg emitted by the build -// script are *not* public API. - -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::env; - -include!("no_atomic_cas.rs"); - -fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, - Err(e) => { - println!( - "cargo:warning={}: unable to get TARGET environment variable: {}", - env!("CARGO_PKG_NAME"), - e - ); - return; - } - }; - - // Note that this is `no_*`, not `has_*`. This allows treating - // `cfg(target_has_atomic = "ptr")` as true when the build script doesn't - // run. This is needed for compatibility with non-cargo build systems that - // don't run the build script. - if NO_ATOMIC_CAS.contains(&&*target) { - println!("cargo:rustc-cfg=futures_no_atomic_cas"); - } - - println!("cargo:rerun-if-changed=no_atomic_cas.rs"); -} diff --git a/vendor/futures-core/no_atomic_cas.rs b/vendor/futures-core/no_atomic_cas.rs deleted file mode 100644 index 16ec628cd..000000000 --- a/vendor/futures-core/no_atomic_cas.rs +++ /dev/null @@ -1,17 +0,0 @@ -// This file is @generated by no_atomic_cas.sh. -// It is not intended for manual editing. - -const NO_ATOMIC_CAS: &[&str] = &[ - "armv4t-none-eabi", - "armv5te-none-eabi", - "avr-unknown-gnu-atmega328", - "bpfeb-unknown-none", - "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", -]; diff --git a/vendor/futures-core/src/task/__internal/mod.rs b/vendor/futures-core/src/task/__internal/mod.rs index 377f3e286..c24874228 100644 --- a/vendor/futures-core/src/task/__internal/mod.rs +++ b/vendor/futures-core/src/task/__internal/mod.rs @@ -1,4 +1,7 @@ -#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] +#[cfg_attr(target_os = "none", cfg(any(target_has_atomic = "ptr", feature = "portable-atomic")))] mod atomic_waker; -#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] +#[cfg_attr( + target_os = "none", + cfg(any(target_has_atomic = "ptr", feature = "portable-atomic")) +)] pub use self::atomic_waker::AtomicWaker; diff --git a/vendor/futures-executor/.cargo-checksum.json b/vendor/futures-executor/.cargo-checksum.json index f51431189..58426bb19 100644 --- a/vendor/futures-executor/.cargo-checksum.json +++ b/vendor/futures-executor/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b2af1091a3cf05b9a19d7177c17fee6b3e50b205b2423690df9a40e518c089bb","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"05ba6a5490962c4df45b78e9ad928a29dd5c3fad749284d5b812ca7e765feb6d","benches/thread_notify.rs":"e601968527bee85766f32d2d11de5ed8f6b4bd5a29989b5c369a52bd3cd3d024","src/enter.rs":"e3e890a8fa649e76cd2ce915abb11b67d15f3c5ae5e8e374142e0363917b2406","src/lib.rs":"08a25594c789cb4ce1c8929a9ddd745e67fee1db373e011a7ebe135933522614","src/local_pool.rs":"78177af55564fdfcfdc9f3974afe7d9d0682a7e4654761d83a8fc02abb34a7dc","src/thread_pool.rs":"e52f8527bc37c511513d77d183b44e3991a7b324aaed5d17bee0d092cf448a5b","src/unpark_mutex.rs":"e186464d9bdec22a6d1e1d900ed03a1154e6b0d422ede9bd3b768657cdbb6113","tests/local_pool.rs":"9639c9a290e23faab3913c6fec190853f890defaed6ffe67de177eca5d88932a"},"package":"0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"} \ No newline at end of file +{"files":{"Cargo.toml":"e4d8d4332a374f631c050d2c0315f0c90f8b1bc32bde8e5ec94671428f3e6ecd","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"05ba6a5490962c4df45b78e9ad928a29dd5c3fad749284d5b812ca7e765feb6d","benches/thread_notify.rs":"e601968527bee85766f32d2d11de5ed8f6b4bd5a29989b5c369a52bd3cd3d024","src/enter.rs":"e3e890a8fa649e76cd2ce915abb11b67d15f3c5ae5e8e374142e0363917b2406","src/lib.rs":"08a25594c789cb4ce1c8929a9ddd745e67fee1db373e011a7ebe135933522614","src/local_pool.rs":"78177af55564fdfcfdc9f3974afe7d9d0682a7e4654761d83a8fc02abb34a7dc","src/thread_pool.rs":"e52f8527bc37c511513d77d183b44e3991a7b324aaed5d17bee0d092cf448a5b","src/unpark_mutex.rs":"e186464d9bdec22a6d1e1d900ed03a1154e6b0d422ede9bd3b768657cdbb6113","tests/local_pool.rs":"9639c9a290e23faab3913c6fec190853f890defaed6ffe67de177eca5d88932a"},"package":"a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"} \ No newline at end of file diff --git a/vendor/futures-executor/Cargo.toml b/vendor/futures-executor/Cargo.toml index f11f5783e..1f5472d0c 100644 --- a/vendor/futures-executor/Cargo.toml +++ b/vendor/futures-executor/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures-executor" -version = "0.3.29" +version = "0.3.30" description = """ Executors for asynchronous tasks based on the futures-rs library. """ @@ -30,15 +30,15 @@ rustdoc-args = [ ] [dependencies.futures-core] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-task] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-util] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.num_cpus] diff --git a/vendor/futures-io/.cargo-checksum.json b/vendor/futures-io/.cargo-checksum.json index 1c60f9cb6..e6b4865cf 100644 --- a/vendor/futures-io/.cargo-checksum.json +++ b/vendor/futures-io/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"4ecb5121321e37cb6138769827977acf349ca970a404a00758119bbe8d266b13","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"575430be5c47352d85f36b44dcc2c2851a6a19e2384593415c4af22c6654cee7","src/lib.rs":"526e9700c28250b7512f122952257d57adc38eb001af92ef25bdb48a8c453175"},"package":"8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"} \ No newline at end of file +{"files":{"Cargo.toml":"a2f46c222bebd5fae127414ffb34535af67be92b58bafcc39a16523ffc33ee83","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"575430be5c47352d85f36b44dcc2c2851a6a19e2384593415c4af22c6654cee7","src/lib.rs":"526e9700c28250b7512f122952257d57adc38eb001af92ef25bdb48a8c453175"},"package":"a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"} \ No newline at end of file diff --git a/vendor/futures-io/Cargo.toml b/vendor/futures-io/Cargo.toml index 7db7184b7..d08683c66 100644 --- a/vendor/futures-io/Cargo.toml +++ b/vendor/futures-io/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.36" name = "futures-io" -version = "0.3.29" +version = "0.3.30" description = """ The `AsyncRead`, `AsyncWrite`, `AsyncSeek`, and `AsyncBufRead` traits for the futures-rs library. """ diff --git a/vendor/futures-macro/.cargo-checksum.json b/vendor/futures-macro/.cargo-checksum.json index 542379481..ef7abfe96 100644 --- a/vendor/futures-macro/.cargo-checksum.json +++ b/vendor/futures-macro/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"9338dfd6dfea00833912aa366d82bd7d4555e99620bf319e74712855dad169c4","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","src/executor.rs":"d2c8545c3438262484da3cddb6d998928bfef8d6d191480c13c0c390f15fe0f1","src/join.rs":"eb1b7beb09e877a88fb76ba195b87b657681234002386ab3519f33b0a6670098","src/lib.rs":"8324c4d5cc4e9e377b2f95afde751168d7e94196c1f2cb35802193c900ca0026","src/select.rs":"6c8193b36ecd06d91036a0502d76ea35b4393537b5fc0432df67aa49f831ad18","src/stream_select.rs":"5fb84834a40876ab1fd975c3af67594d0c5a4f8d724cb164db9bee71e70d14b1"},"package":"53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"} \ No newline at end of file +{"files":{"Cargo.toml":"a6394fbbe6143c8954364368159714b49ab1db61e19b73f0d50caa8cb3df1fc6","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","src/executor.rs":"d2c8545c3438262484da3cddb6d998928bfef8d6d191480c13c0c390f15fe0f1","src/join.rs":"eb1b7beb09e877a88fb76ba195b87b657681234002386ab3519f33b0a6670098","src/lib.rs":"8324c4d5cc4e9e377b2f95afde751168d7e94196c1f2cb35802193c900ca0026","src/select.rs":"6c8193b36ecd06d91036a0502d76ea35b4393537b5fc0432df67aa49f831ad18","src/stream_select.rs":"5fb84834a40876ab1fd975c3af67594d0c5a4f8d724cb164db9bee71e70d14b1"},"package":"87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"} \ No newline at end of file diff --git a/vendor/futures-macro/Cargo.toml b/vendor/futures-macro/Cargo.toml index d9652b213..00891d057 100644 --- a/vendor/futures-macro/Cargo.toml +++ b/vendor/futures-macro/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures-macro" -version = "0.3.29" +version = "0.3.30" description = """ The futures-rs procedural macro implementations. """ diff --git a/vendor/futures-sink/.cargo-checksum.json b/vendor/futures-sink/.cargo-checksum.json index c1168e845..28c765026 100644 --- a/vendor/futures-sink/.cargo-checksum.json +++ b/vendor/futures-sink/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"99eec39e35c7daf6a96234a343a21e6a6388bb6586805bf65811b19cf1ac7e0a","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"a509e1ce84f285190130def6d2b9e3861988f9be725f7697f09fba347601d86f","src/lib.rs":"90c41f91e4b6764a218d4f337a9a46fba1e256f59f67b0afa5352ba92bf641c0"},"package":"e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"} \ No newline at end of file +{"files":{"Cargo.toml":"b5b85ca76f61d54448baa14cd1366f2eceb185385cd495112e0f88b76609bff6","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"a509e1ce84f285190130def6d2b9e3861988f9be725f7697f09fba347601d86f","src/lib.rs":"90c41f91e4b6764a218d4f337a9a46fba1e256f59f67b0afa5352ba92bf641c0"},"package":"9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"} \ No newline at end of file diff --git a/vendor/futures-sink/Cargo.toml b/vendor/futures-sink/Cargo.toml index 74d089d23..73725b043 100644 --- a/vendor/futures-sink/Cargo.toml +++ b/vendor/futures-sink/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.36" name = "futures-sink" -version = "0.3.29" +version = "0.3.30" description = """ The asynchronous `Sink` trait for the futures-rs library. """ diff --git a/vendor/futures-task/.cargo-checksum.json b/vendor/futures-task/.cargo-checksum.json index bd6d2a9aa..dba3b240e 100644 --- a/vendor/futures-task/.cargo-checksum.json +++ b/vendor/futures-task/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"5d2ffe0a6b7e323ee8b9705c7c7e0333fd0db27015123165bb568abfe3682c03","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"6762ad0401a70d3b3e1faf6967b310de688da34c16174fd079ebc88fcff2cc4c","build.rs":"5b263bd2bd587511a9c8daef580b05e0613c15a6c5f800b1e5bc145fa013d99e","no_atomic_cas.rs":"7ae747b83b08dd926c1696faf4ecab9399c652ae77d5179221258c73b8eecb6f","src/arc_wake.rs":"0e3f7d7883b75337b0b92ff55e477f0bf96f6eb08def7d953676a289fd9696ec","src/future_obj.rs":"20f210f33c6e61b3889d971fee2d9c23c1661da0e715d51c74f8c6d049c56135","src/lib.rs":"c55281988768d44d3305b2352c7ebb66e6449797239c07b14257a2d8e612e06b","src/noop_waker.rs":"41246601dab77f69bf09257afc3321031a5a31a7eda51787029870eda9922356","src/spawn.rs":"afcf46b98d62e78d2c974f91df32590bd78fe8c79031e4ae7accf9270e1f6224","src/waker.rs":"ed3e4e5f83016e253fe5faf4ded28d4f6ad64e01d015e4eb421004a1dd7b7639","src/waker_ref.rs":"3b65daca6d9236f653ff3be2599e5e30696416a6bab4902cdab2850a17942dd8"},"package":"efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"} \ No newline at end of file +{"files":{"Cargo.toml":"5a775281eaadf4834ea23834fb053b72a9c8a301d3c99cc5255a4f147f5f0d56","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"6762ad0401a70d3b3e1faf6967b310de688da34c16174fd079ebc88fcff2cc4c","src/arc_wake.rs":"0e3f7d7883b75337b0b92ff55e477f0bf96f6eb08def7d953676a289fd9696ec","src/future_obj.rs":"20f210f33c6e61b3889d971fee2d9c23c1661da0e715d51c74f8c6d049c56135","src/lib.rs":"872e38468fd65eacbdd4ede61096eeeb296b41daad42f51a37172c250190315a","src/noop_waker.rs":"41246601dab77f69bf09257afc3321031a5a31a7eda51787029870eda9922356","src/spawn.rs":"cd0dafb52700e087a2793bb42d70da84e9e10181d5407ea74843d935f40cea02","src/waker.rs":"ed3e4e5f83016e253fe5faf4ded28d4f6ad64e01d015e4eb421004a1dd7b7639","src/waker_ref.rs":"3b65daca6d9236f653ff3be2599e5e30696416a6bab4902cdab2850a17942dd8"},"package":"38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"} \ No newline at end of file diff --git a/vendor/futures-task/Cargo.toml b/vendor/futures-task/Cargo.toml index 7c080f865..52085847d 100644 --- a/vendor/futures-task/Cargo.toml +++ b/vendor/futures-task/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures-task" -version = "0.3.29" +version = "0.3.30" description = """ Tools for working with tasks. """ diff --git a/vendor/futures-task/build.rs b/vendor/futures-task/build.rs deleted file mode 100644 index 05e0496d9..000000000 --- a/vendor/futures-task/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// The rustc-cfg listed below are considered public API, but it is *unstable* -// and outside of the normal semver guarantees: -// -// - `futures_no_atomic_cas` -// Assume the target does *not* support atomic CAS operations. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// -// With the exceptions mentioned above, the rustc-cfg emitted by the build -// script are *not* public API. - -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::env; - -include!("no_atomic_cas.rs"); - -fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, - Err(e) => { - println!( - "cargo:warning={}: unable to get TARGET environment variable: {}", - env!("CARGO_PKG_NAME"), - e - ); - return; - } - }; - - // Note that this is `no_*`, not `has_*`. This allows treating - // `cfg(target_has_atomic = "ptr")` as true when the build script doesn't - // run. This is needed for compatibility with non-cargo build systems that - // don't run the build script. - if NO_ATOMIC_CAS.contains(&&*target) { - println!("cargo:rustc-cfg=futures_no_atomic_cas"); - } - - println!("cargo:rerun-if-changed=no_atomic_cas.rs"); -} diff --git a/vendor/futures-task/no_atomic_cas.rs b/vendor/futures-task/no_atomic_cas.rs deleted file mode 100644 index 16ec628cd..000000000 --- a/vendor/futures-task/no_atomic_cas.rs +++ /dev/null @@ -1,17 +0,0 @@ -// This file is @generated by no_atomic_cas.sh. -// It is not intended for manual editing. - -const NO_ATOMIC_CAS: &[&str] = &[ - "armv4t-none-eabi", - "armv5te-none-eabi", - "avr-unknown-gnu-atmega328", - "bpfeb-unknown-none", - "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", -]; diff --git a/vendor/futures-task/src/lib.rs b/vendor/futures-task/src/lib.rs index c72460744..33896d8b1 100644 --- a/vendor/futures-task/src/lib.rs +++ b/vendor/futures-task/src/lib.rs @@ -18,24 +18,24 @@ extern crate alloc; mod spawn; pub use crate::spawn::{LocalSpawn, Spawn, SpawnError}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod arc_wake; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use crate::arc_wake::ArcWake; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod waker; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use crate::waker::waker; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod waker_ref; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use crate::waker_ref::{waker_ref, WakerRef}; diff --git a/vendor/futures-task/src/spawn.rs b/vendor/futures-task/src/spawn.rs index f4e63397b..4a9a45a44 100644 --- a/vendor/futures-task/src/spawn.rs +++ b/vendor/futures-task/src/spawn.rs @@ -168,7 +168,7 @@ mod if_alloc { } } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] impl Spawn for alloc::sync::Arc { fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> { (**self).spawn_obj(future) @@ -179,7 +179,7 @@ mod if_alloc { } } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] impl LocalSpawn for alloc::sync::Arc { fn spawn_local_obj(&self, future: LocalFutureObj<'static, ()>) -> Result<(), SpawnError> { (**self).spawn_local_obj(future) diff --git a/vendor/futures-util/.cargo-checksum.json b/vendor/futures-util/.cargo-checksum.json index a51b50c22..cb289ae2f 100644 --- a/vendor/futures-util/.cargo-checksum.json +++ b/vendor/futures-util/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"e4ef2ba6c838bc052a3b5fa70d18deb3e65781e4869f6d99b7f78888c6b002f6","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"4094b953bfd2bb2687df0c3c3deb05c307c14ac084e6a79878342b8ee56aa710","benches/bilock.rs":"6f59b71f9b9ca5751018a985eff0ea8d63d4cb6d18a17e672e17bc786b972c20","benches/flatten_unordered.rs":"79330465a5d8f2d6e450861e7ca2ed8ae7fe78a5fb221b6ab7121227810c1bcf","benches/futures_unordered.rs":"5eb8280be8d8fb7bd5fb103ce20db10f618f47e180a402105e0d5e9f8c9fe35a","benches/select.rs":"ca0a79bc3434f0fc025e0b0e37941ba1d592b40f36ce6544cdfede9f23e70581","build.rs":"5b263bd2bd587511a9c8daef580b05e0613c15a6c5f800b1e5bc145fa013d99e","no_atomic_cas.rs":"7ae747b83b08dd926c1696faf4ecab9399c652ae77d5179221258c73b8eecb6f","src/abortable.rs":"38bcb3d48361e4cfa89cc2e225c5f1dc97129837da834d28b69cff3bbf5200a6","src/async_await/join_mod.rs":"8f83c0001df867f5eb47a4174bf4a0c0b548f8ff3be3b532e0c759ad981b87da","src/async_await/mod.rs":"9a81d2eb3c89a31e1241c50438ff92d08d5c1fa879f0f8d52bfbcc261aa88272","src/async_await/pending.rs":"7971ec1d5d89ad80390e2a0c51e396257b2e78f1436cce79ea2b55ac2f13b328","src/async_await/poll.rs":"440c19a89fd42b12da09ff48a69523b5a8a5baea0bcd2f860589a0ab996ed781","src/async_await/random.rs":"daf229cd01595d38ef0f6284865fe2f60ed3b8134f7a15c82564b97ff3a5be98","src/async_await/select_mod.rs":"414c7fb7923cfe21116d558bf3cd1a6ae5bef4ed01f9877f0e7cb3e42ee6c79d","src/async_await/stream_select_mod.rs":"83da70ea9ab215ba9c799539fdcc78de237881dffa8be312934422d88b21dacb","src/compat/compat01as03.rs":"6728ffd4f0a92d4e6aff8b7ff7916ad7ae20a317633d2739813a3b6ffc814204","src/compat/compat03as01.rs":"7cf29e57f8ee14b64123b3d2c16dceced25af5491a5ef81b655b2de2e9587fbe","src/compat/executor.rs":"3e40b4ccd905a99eab42c47fefc5502b530eef869158ce9ceaa28f8f1638436f","src/compat/mod.rs":"6cf3412f6a3f9ee8406118ea75de65468a83febc6ba61bdbad69261f0cfea02e","src/fns.rs":"f8e396128791169098a38a82c3c28aaa6dd5d40718635f7cc30b59b32f7110b8","src/future/abortable.rs":"373ce61c0c7c31718ff572113503bb88f55e3b49ed5d028a3dfafd69070f44c1","src/future/either.rs":"fb00002e68b5c46c8ded09e91efe0be7362c168a1ea00dc5906e1c8c7e38aaa4","src/future/future/catch_unwind.rs":"08b0ac049cdee28325d378209aa5bb4d91b14a29ddd9c2b0e5c661b61f9cfcfe","src/future/future/flatten.rs":"5bf9846cef8dec5dcc38b992653e11146bc149a0d3efc09b1f8268bd29de0b2b","src/future/future/fuse.rs":"65b80a1ba7556e2ef35ce8d23e47489a2a6eb6d1c3ef9ac4e080c63e69eaa07d","src/future/future/map.rs":"de607c2a4d80d2bddb590781c37328ddd294bb9d5064a9ecb99455244239b597","src/future/future/mod.rs":"d1cfcf1e45207705dd858bf4087b611792ac266d098ee7ed103d6a2b0d7bdd0f","src/future/future/remote_handle.rs":"2ae17a409569b32c78e20026a8ecdf667352c2597a4a0a8deefa4761fafcb223","src/future/future/shared.rs":"d1973063327851931c75969ec627657e5e34e8cfa97f295d65a4be288377c446","src/future/join.rs":"38b55fc7cdbbdaaa525e51f8ce09783dbbcb65eabfd7de9f46610593e0bbef17","src/future/join_all.rs":"c77326f420eb0f9240eb2147d1c2cff6fbb123f7c13d11ab8f53694d8ca022d2","src/future/lazy.rs":"d161fc4108a97348c1becbbd5ba8fccb7225dcf1d81c097666f5c8b40718251d","src/future/maybe_done.rs":"559e41cb170f9fe7246d2a5b112527a9f9cbca63b8a5a872b3aa9c861f70f307","src/future/mod.rs":"51e018100362f20b071225268f1d81f25c8e9664e94730af199069c2692bf26a","src/future/option.rs":"73daca814800b91b707753dcfe074265372b0077fae2504ea6efddc713453579","src/future/pending.rs":"3967984d2061e6b201c407f28ba8392a21fc9ef7c0b9201e2e244110af0782c5","src/future/poll_fn.rs":"8e54bf57d60e01d496ae31df35e0b96868f4bda504c024a14f51ab723d67885f","src/future/poll_immediate.rs":"7e199fc102894c9095de17af602a7c8f05d427269aefce5d71cd5136d54659c0","src/future/ready.rs":"c9860ccd8ac529f44f66dee73ca9b9d7f1b1b3e5e9e4dc70c59640c752553d58","src/future/select.rs":"0c358a5ae079858f31c61cf6ea835205fdb9092d07536778440b975995d2626c","src/future/select_all.rs":"5b304210c34cc2bd84f7b1819baa30a68eea2ee578b10b243f5dd884ee9a4791","src/future/select_ok.rs":"dc35027db70c0111399c6ab6f7c977e6e7362f069a3891e4a62006c52643528e","src/future/try_future/into_future.rs":"d966bde7b06a88443f0efd877e95f91541778c4e713f3f4b66e00ca5d3f352b6","src/future/try_future/mod.rs":"991edb3b52903ceb3bcb6599d04d898509023cd038c5974f4872eaafa9748f08","src/future/try_future/try_flatten.rs":"16c02e1780bd312b8b386e41c1d9dd4bcc4e8ef10f26007364f857b3adcc6e99","src/future/try_future/try_flatten_err.rs":"130f3fc3fd95a19f4e4a50e69301106fab02f77d0faf3aac9c473a92b826c2ca","src/future/try_join.rs":"1836931f8ba32da41c6810e6acc0ea2fee75b74b3153e760c4542cb12b220540","src/future/try_join_all.rs":"4d01395c74c7b82c581a578f2cb34087824b091f70075ebcd76a8d12b8476c1f","src/future/try_maybe_done.rs":"1cce46b2ee43ad51b7c5f9c02bc90a890af32bc549ce99098a2c8813508051e1","src/future/try_select.rs":"5d6187ace76b5f26e60c713a1fe9fcb9cbb0d161c5881c532ce9472a230b595d","src/io/allow_std.rs":"a125959c255fd344399fb0be19218a8ee7d613ce2485d6df9cdbc2ed5d3987df","src/io/buf_reader.rs":"46a1e24046c5bc2ab8f266e3d904281bec3ab4ba6c13d4213a52599b57b8de66","src/io/buf_writer.rs":"d6666b8dde60eefbb7fa69da4a2eea2b34ea0e4a85e21e5ac6e83cc680ea9140","src/io/chain.rs":"12f508fc39c3234a71a0f886505245c5d659aed09c7d874b1bd8ca0a0d456cf3","src/io/close.rs":"9832210a870637198fa58642cdf2779afab71f2e31a9953e663fa6854bd73ac7","src/io/copy.rs":"cb2466dcd7ea8bb1f07d00c03e66ed55abf71fe4be6937adc9f533ef9d99fb2d","src/io/copy_buf.rs":"e9a5f6aac8375e298bddb332f23d8b626d056ce452b58f772a05df7e2cd326cf","src/io/copy_buf_abortable.rs":"28ef452bc49423e0a6e8323b5956b37c57335941f99797867e5c5932f9366136","src/io/cursor.rs":"c12e9b82c6eff2108a5524b026d73fbb2c250072e8e3f673cc04d4da02a553b8","src/io/empty.rs":"6ae40b4bc8fc41572abad2d013285d78d8df445868d41fac77bde508ec9bc1a5","src/io/fill_buf.rs":"4f217fed8eb3f66dbde2371c3fbcfa9420d38ba20da544a0658584e5778aa47d","src/io/flush.rs":"0c9b588dfd9da039dc123ba9448ac31ca21ee3da0a164a21f6c2c182183d43e2","src/io/into_sink.rs":"ab5bdb12bff62672175b69b8c9f5a4bbbea716b9cf89169ed6a723ab43da9df8","src/io/line_writer.rs":"16c151c68d89b7c2ab929c4a782539b1ad512b723eed9b544f50f1ff06f0b661","src/io/lines.rs":"137279b6b899ce438fb1b0ee9e6a412976f9f9db54fb7b961d2bad8787a26b1e","src/io/mod.rs":"eefa437d5ac91efb1328d9f50f10572206c7323be1c9919ca10e5ce1973f5c46","src/io/read.rs":"4ea675a83cec98a22c9c4731ff980209f0cf67f63c71871cd1deed53c1266345","src/io/read_exact.rs":"ddebd58db9f6766efa3f50543fb51b138538533921e1ee1da4621fff9c64efe2","src/io/read_line.rs":"e2829eb128f441c10dfc48f089a9dda7b6540753c9700f24cc9585e94affc11c","src/io/read_to_end.rs":"5e9e38dc087623dac5a3ae3ad329ed44ffe4f6205a78e546adadc3ffb76703fc","src/io/read_to_string.rs":"bef4cc292dd95fa9c850d0438ad0cf49a8cc4caf40a0384f763f8c9512ad9e79","src/io/read_until.rs":"354507ce95242a735940f0aaa6ef11cc7d6d0505ae148f05277ce6e7537f168a","src/io/read_vectored.rs":"bd7f442c92f2cb320075d0983b0d08d51c23078898d72e6c2857cf6c7ad4cec7","src/io/repeat.rs":"53bc472e4bd7d286bf90765ce574f13b7aabc871c4f04f712da7cea160491390","src/io/seek.rs":"9863e9fb6495eb6e1f8c45c283c8a6993b9bdb1462f75a3e525e135c6840dec7","src/io/sink.rs":"30a503631d196e5da92c386d0afc1af9656a5f7682456cfa2489a2c30a05cac5","src/io/split.rs":"2aa567452b713497d5b85813980b69e888aee32be14492c92404d261fd50eb09","src/io/take.rs":"c53fec5b5e8c3742b7e60e6ebfa625cf2e566fbea193fb1eee2f0a8e561d63d5","src/io/window.rs":"ec6a9d20a7b252a5b272a74afa32e2279d372b806840ab985eae17bc06a25d27","src/io/write.rs":"60670eb00f999f2e2c43b099759a7fb030325b323744d88c9d20f75926ec30df","src/io/write_all.rs":"8fcd4ff233650b5abd20f7b987000cac095d8de23445572de588dccf710623c6","src/io/write_all_vectored.rs":"53becf89c031bf4c3073f0903ce809eee7606b1b4fbeb518605875badba216d3","src/io/write_vectored.rs":"bc98ff4a709cb75cd9ffedefa8ef251089a49906b98e142d76447ddf4ac098bb","src/lib.rs":"384447fb9bfcd3b110656979cca71b53c3abe72690e970c30563c1baba27fd74","src/lock/bilock.rs":"a294b016cfb39fb54406a6190438546a5fd7c8ef21667ab38a6cea9cb2d3ef7b","src/lock/mod.rs":"ed0f4ef97af382f6038730bd5932b449f32dc3a634e73e7ebb48a24bb7782d6f","src/lock/mutex.rs":"745c68e571f84a7456681cd683b2b8eed28ea8b6d3f9a38337efad105a65e0b6","src/never.rs":"2066481ab04921269cfa768cb8b778a035ab6aa49ec404d9ac0aeb07a4bf6094","src/sink/buffer.rs":"33a7380f8232225a8e9ac5ee138fd095979efa3a64f9fecf5fcaf2e78fcbc355","src/sink/close.rs":"f2f31c884f048163abebd4f5a877b7b4306f7d02beae428325636fd00ed42ca9","src/sink/drain.rs":"60262bf3ef48c09b4d52e52953f9437d536e20f63690b73e975388751405d239","src/sink/err_into.rs":"ced2998b2b0b792d80f7543523c9e07e8f5d20a4336cae93084b995e46671b15","src/sink/fanout.rs":"66dcde056e0bbee4e0074d331838ed2743dc872ea1597f05d61970523dc34926","src/sink/feed.rs":"64b9d296d37aedde37e1421c459ebcd9a7e8814db905996996167850124f3b3f","src/sink/flush.rs":"fbba344f428ca7636541ba013f7db2ece480b404a9e0b421c5537552d61e2492","src/sink/map_err.rs":"0f68f444ef13fe7115164be855c3b7b1d269e1119e69fcdad1706988255641f1","src/sink/mod.rs":"37cf379170f3099992eb59f3181be4c4e4a5c2d3581dbe424d22ab360840d321","src/sink/send.rs":"56aaba9aa4a562e0af39473a5779206d91b0acb1fced4fc06cd8b959d1897524","src/sink/send_all.rs":"a8e4956604fe73e321b0a3896c2018bc5c27149f2862f8406112db140b3aa2dd","src/sink/unfold.rs":"5febcfb9295a79fe1187284d0d45055c787e399b00d73c0e85a0446ae2246d18","src/sink/with.rs":"850cd3b96304df1f38360a0bc60b02d485535e399ef7642acdd9add7876867d8","src/sink/with_flat_map.rs":"5e0f527b33ee8f1cc6a6a46d45b6d74dad5c735d88b2cb24e1cb34fdc6ef501b","src/stream/abortable.rs":"935d79aa44d793f4abe87ca27a9e4a20891500488cf942693cd2756d65b3aab2","src/stream/empty.rs":"5000c856186408a17f68bbef432d4a1a3edb7fb5a07ed8699342fef04b10a181","src/stream/futures_ordered.rs":"6d3a753d7cdc2ada5487682fef4c9c56d8ece61292b125c3eafdee484484511c","src/stream/futures_unordered/abort.rs":"bdfece9f91accafd5122be36d628c37c5b219ac0eecec181267840fbb1e95a45","src/stream/futures_unordered/iter.rs":"01f8aaa2ac7ea493bf727a945424cc6ae695c9a0c289ac57cbb26697abb05827","src/stream/futures_unordered/mod.rs":"9f2a0aa75e2ff154e20f89adbc3b4b28ed69866f99dde8c18e0054bfe572a0c2","src/stream/futures_unordered/ready_to_run_queue.rs":"3a9c08cb5df28e57f2bfe613b8174d0dfb420b8664dd7c46a053e2980a6d3482","src/stream/futures_unordered/task.rs":"2b780bcc97844bc0bdeced7bb4318066e86ba082c08c8628c9b2e92bfe36fb61","src/stream/iter.rs":"609fa821a460e901a54ae51f8da58220881157cef02b8b7b8c9e4321c2d05a23","src/stream/mod.rs":"293a39d4dda306d34d30c657cbed2047cf062a2e6b3ee069af42657ee194a1bc","src/stream/once.rs":"d7b70adabad1f10af711ac3dcef33fd4c287e9852fdb678406e7ff350ba8fd47","src/stream/pending.rs":"84aaa15c8bbb17a250da5b1b5f0c7f6717410915d63340a3fcbf098bebe19d6f","src/stream/poll_fn.rs":"35952ea514b8aade14a3934d7777006475f50bbf0c5b50141710e31637f980be","src/stream/poll_immediate.rs":"e7a53ff8275ebe89dab8f9b984cce2ee0fde0a828e540b77c5500ca017d5bb98","src/stream/repeat.rs":"e4e4a9b6f2fca72bcbf098c3ac0c4a41323a840741d4dce9d9416464b7e8bd0d","src/stream/repeat_with.rs":"525780d24f3f99152b879765ca6eab99bcc0c757dc6654b6635c099b93ea654d","src/stream/select.rs":"28eb422c0eca9fd02778a6003004471b3489db09746a70e617a506303ea8b81d","src/stream/select_all.rs":"19ef94abcf63fa9e46a73b6ab783642d2d069a015c7fa57fea36eeac7b6f2a20","src/stream/select_with_strategy.rs":"caa0f5d1fd02824b48a1cd2be13a6f96b532039eb88cf47ea5d2becf58595073","src/stream/stream/all.rs":"267a2cc251775fa0c60c6e41ae1e4a9611fc493be0fd1c3494ca75f24d60de51","src/stream/stream/any.rs":"a3eb3eecce02142b8eb95d0b8a62178f177c8152d63f52da5effbe3a4be45580","src/stream/stream/buffer_unordered.rs":"b0f7a1c72cee178e7bfd8990e6e426c1258eeba6d952b82c6be8e4cac0a054ea","src/stream/stream/buffered.rs":"e37d08d6a18090ba37079937575920cc8c7569f4183dba710d3f4b94c11da01b","src/stream/stream/catch_unwind.rs":"b2e801ff744d5d9e17177ec1156b0ab67bdd56b94c618ed8590344ec8a0f35e7","src/stream/stream/chain.rs":"809b6b5c8372f65341dc9810d39f60ae3bcf74a78f133b4ab8d289fb5f2a7cbb","src/stream/stream/chunks.rs":"9f872b473de14d2251584050f04d56eada9c3b1d8dc3e746bdd57c1f757bfc6f","src/stream/stream/collect.rs":"6e4d2d580189f7d3b6b294b6b17437e8e2570502f08c11786a71caac207f0309","src/stream/stream/concat.rs":"171ea941b45c0295ed978c3f318a449ea295e33cb4ea82c764f4e9e7c48ad5de","src/stream/stream/count.rs":"ff218aea3d2d2456c8163926ea0c357b2752e92578e5fd4bec6b789fe1246556","src/stream/stream/cycle.rs":"ed7e3d15e7b1adec5ad5789b0d3186b5995a3353cc974fb7f41a72f6d8ad4cbb","src/stream/stream/enumerate.rs":"fc7565d21d39565790859eeac9ae8dd74123a9d15b88258d3abe894f1876cc39","src/stream/stream/filter.rs":"5d871f416d41baff3733121f564229fe31bdf7dfaaeb78ab940fafba6ab4b7c6","src/stream/stream/filter_map.rs":"179045a5ab1295e77ab5cfea1964be69dc50984ef8ac9ee04034adf0a043514f","src/stream/stream/flatten.rs":"69493fc106a1447abe109fd54375bb30363f7bc419463a8f835e4c80d97f2186","src/stream/stream/flatten_unordered.rs":"dd5216fc0e34d09cc69ae6b3c4690efe8ff01404853756bf5aa6b92eb2e6750b","src/stream/stream/fold.rs":"75d61d4321db1bcbbdd1a0102d9ad60206275777167c008fc8953e50cd978a09","src/stream/stream/for_each.rs":"07bca889821bad18ff083e54abe679fbeb8cd19c086581c2f2722cba6b42263f","src/stream/stream/for_each_concurrent.rs":"4e1e7eb3d4ccfae0e8000651b75834e2960a7f9c62ab92dba35a0bdbbf5bbb21","src/stream/stream/forward.rs":"cd024ba1a3d5098d3ff2d5178a12e068916cc4307284b00c18dbc54b554a5560","src/stream/stream/fuse.rs":"061c5385f12f80c7906cb15ddb8f455ced6ce21d1de9a97de9db2616407c0cac","src/stream/stream/into_future.rs":"b46ad45cc03ddd778a9ffaa0d603c8ee0b411f49333100160959942cde9588bd","src/stream/stream/map.rs":"b91bdd5b33821a50c9b5034261a14f89ff1a9d541ab99b9d9a6921b12a5d434e","src/stream/stream/mod.rs":"f6561a11ae60ed0abcbada98506812df50fa52633f68b93a3330668afe444f82","src/stream/stream/next.rs":"7b4d5a22b5e00aa191ea82346bb1f392121cc68692864a8230e462d59e622928","src/stream/stream/peek.rs":"2e08e6990c31186c97edb21737f83fe8640a19561062879af83090935aef99cf","src/stream/stream/ready_chunks.rs":"7e17c49ff29c106c13a2ec13fb05f32ff048e482b47a157d3965bd03c38c01c2","src/stream/stream/scan.rs":"54489c8efef60dbf3c35ee803afee5c5ea7c364fb9b68939a04956e46febb856","src/stream/stream/select_next_some.rs":"0094eccc96cfe78d9b6d0a9bdb82cada8fb7929770a3ac00ffcb5441d7dc4f51","src/stream/stream/skip.rs":"61f7ec7fe25663d2c87cffaad19ed27eda032842edb8af731b521025b244f120","src/stream/stream/skip_while.rs":"6f114a3fa538bd479e4fa24d8aa0e0e0454613643a97c44242c5683ae7293b82","src/stream/stream/split.rs":"0552ddf8f7f3a9980dbc692d0c34b72503107c714f81e853445fb6c81fe328ff","src/stream/stream/take.rs":"57d381b482c3d584c4c26b0e15941bc2ea58e3f39a2e5c74391a2ee7b825cc8c","src/stream/stream/take_until.rs":"0f1fa7d158192a5dee32392dfdd062c15dab6d246b0ca267e91aae490d7d7fdb","src/stream/stream/take_while.rs":"2f57a6e5b903c045da642e9a40eb19dabbc612a80a6ce8098df1a1973555f108","src/stream/stream/then.rs":"c995c6b0d9151927b26b10fba70e135dfc41224b969d1367dc8c11697218c1e9","src/stream/stream/unzip.rs":"e7beedc2192604e0091ac3d0265b487127a37c780198838f6419c21ef1b38df0","src/stream/stream/zip.rs":"3890b40daea00341fac6ac977de0b534d1ec7cdaabece44af5df2ca56026fe62","src/stream/try_stream/and_then.rs":"6f92b333955f5ec30fddf8e087e3f60ebf53a054769fc72c80bbccdf13a9431e","src/stream/try_stream/into_async_read.rs":"5b200c76ccb95460d94286ca8e63f5454940eb62b5f15aae998da48aa06fbffd","src/stream/try_stream/into_stream.rs":"4fee94e89956a42871fc4a0cdba7ae1b7d4265e884528799cd227c9dd851acce","src/stream/try_stream/mod.rs":"76b15ee9e9c5d4d0440998567c7441096f5fe2deb2cfad2296c9f577b5bc9b64","src/stream/try_stream/or_else.rs":"473ca77e0e81a1a0834d2d882076b8823a5a3027b2d7d78f887be2d5edfd0de3","src/stream/try_stream/try_all.rs":"58a4c9abe3b2d6ad2debcfc09701bb828732c9d7edf2a42f12a74beff5ae2db0","src/stream/try_stream/try_any.rs":"baf6a8e440d018597de0a1ee9e9827a27616bc7e65b804b3e0d8f1343d9191c6","src/stream/try_stream/try_buffer_unordered.rs":"64e698ea6aefbe7e32d48e737553b20b9cde5c258963bb20486b48b7d6899660","src/stream/try_stream/try_buffered.rs":"38f60d7290f44471a02084c6b394b754c224a84ee8d2ba01c08568168b48a21f","src/stream/try_stream/try_chunks.rs":"69c4d85a256250d73c6372d8047e6055da7eac918cb5d7ef4f3697898f4dcb4c","src/stream/try_stream/try_collect.rs":"979920e3034dad6c75961e3f6b4c0234691db7063eca1a05562cc5d41f2943c1","src/stream/try_stream/try_concat.rs":"f2330ebeeab30273e9ac0e8600bfe2f405ce671f6386e688b3afb1d2fdd7c2c6","src/stream/try_stream/try_filter.rs":"1344e9aea05e2d0078f30caff176a99e1ccb8fcdf0a287817abc82fbaf09c48b","src/stream/try_stream/try_filter_map.rs":"285e7ea875a3ea3e16942c1b1acae5a1cb26b9bac476dce3903547cb99306602","src/stream/try_stream/try_flatten.rs":"e05614d86a27ab8386476eea35fd424c07e5f7f99cf0401d63a6655eb7ca1247","src/stream/try_stream/try_flatten_unordered.rs":"1cc4c4a5ea0a8db3010958f34fb1886dcfbd2e1584082d2004030eb70b13cd6c","src/stream/try_stream/try_fold.rs":"b96aa2fe1a16f625d5045028a86ff8684dcf5198ef8c7c072f52f39aeaa8b619","src/stream/try_stream/try_for_each.rs":"3f3901d618333b740d470eb02fcbb645df92483493872298bb7bd0382646028a","src/stream/try_stream/try_for_each_concurrent.rs":"78a94a77f329862c2a245ec3add97e49c534985f0d9da98f205b7fa3c7c08df3","src/stream/try_stream/try_next.rs":"6e29473153db1435906e79f7eaa13ce9da842d4528ba9eb1c0034665feacc565","src/stream/try_stream/try_ready_chunks.rs":"e8a658f5e48bb5c12b59998adbc5534f7eb830d0a60b53c0a3acd945752166fd","src/stream/try_stream/try_skip_while.rs":"7c2fa31fe8b0b4e59c5d7f2972c8d9f83e8f01a687b08f5cd631f92a14b402f1","src/stream/try_stream/try_take_while.rs":"2783664637aff0442f0c9204d35600139c941332310f70495cbc4dc345cae99d","src/stream/try_stream/try_unfold.rs":"aaf0f4857a4ec8233ac842ae509f29e5a210827a0bb40cfc0dc3e858f153d2b4","src/stream/unfold.rs":"8b2feb00f979562b43064eb078d53a160cdb3c65deed17ec25a05938df2d370f","src/task/mod.rs":"bc4f1d4a08110adbe3a203246af903bcf6d60bd45b7514c8145947a84a50f6aa","src/task/spawn.rs":"8ff3a3652d8d2cb45717324b6ead9c3f111629e7eb0c0b33d3639a0e7c5bbf3e","src/unfold_state.rs":"ffe848071a99d6afcdbe8281a8a77a559a7dde434fc41f734c90e6b9b5d8a5af"},"package":"a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"} \ No newline at end of file +{"files":{"Cargo.toml":"33994b66c2e81f51a0d212b6d1fa87039b97578e2ce9ee270f0c31e31bc21174","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"4094b953bfd2bb2687df0c3c3deb05c307c14ac084e6a79878342b8ee56aa710","benches/bilock.rs":"6f59b71f9b9ca5751018a985eff0ea8d63d4cb6d18a17e672e17bc786b972c20","benches/flatten_unordered.rs":"79330465a5d8f2d6e450861e7ca2ed8ae7fe78a5fb221b6ab7121227810c1bcf","benches/futures_unordered.rs":"5eb8280be8d8fb7bd5fb103ce20db10f618f47e180a402105e0d5e9f8c9fe35a","benches/select.rs":"ca0a79bc3434f0fc025e0b0e37941ba1d592b40f36ce6544cdfede9f23e70581","src/abortable.rs":"38bcb3d48361e4cfa89cc2e225c5f1dc97129837da834d28b69cff3bbf5200a6","src/async_await/join_mod.rs":"8f83c0001df867f5eb47a4174bf4a0c0b548f8ff3be3b532e0c759ad981b87da","src/async_await/mod.rs":"9a81d2eb3c89a31e1241c50438ff92d08d5c1fa879f0f8d52bfbcc261aa88272","src/async_await/pending.rs":"7971ec1d5d89ad80390e2a0c51e396257b2e78f1436cce79ea2b55ac2f13b328","src/async_await/poll.rs":"440c19a89fd42b12da09ff48a69523b5a8a5baea0bcd2f860589a0ab996ed781","src/async_await/random.rs":"daf229cd01595d38ef0f6284865fe2f60ed3b8134f7a15c82564b97ff3a5be98","src/async_await/select_mod.rs":"414c7fb7923cfe21116d558bf3cd1a6ae5bef4ed01f9877f0e7cb3e42ee6c79d","src/async_await/stream_select_mod.rs":"83da70ea9ab215ba9c799539fdcc78de237881dffa8be312934422d88b21dacb","src/compat/compat01as03.rs":"6728ffd4f0a92d4e6aff8b7ff7916ad7ae20a317633d2739813a3b6ffc814204","src/compat/compat03as01.rs":"7cf29e57f8ee14b64123b3d2c16dceced25af5491a5ef81b655b2de2e9587fbe","src/compat/executor.rs":"3e40b4ccd905a99eab42c47fefc5502b530eef869158ce9ceaa28f8f1638436f","src/compat/mod.rs":"6cf3412f6a3f9ee8406118ea75de65468a83febc6ba61bdbad69261f0cfea02e","src/fns.rs":"f8e396128791169098a38a82c3c28aaa6dd5d40718635f7cc30b59b32f7110b8","src/future/abortable.rs":"373ce61c0c7c31718ff572113503bb88f55e3b49ed5d028a3dfafd69070f44c1","src/future/either.rs":"fb00002e68b5c46c8ded09e91efe0be7362c168a1ea00dc5906e1c8c7e38aaa4","src/future/future/catch_unwind.rs":"08b0ac049cdee28325d378209aa5bb4d91b14a29ddd9c2b0e5c661b61f9cfcfe","src/future/future/flatten.rs":"5bf9846cef8dec5dcc38b992653e11146bc149a0d3efc09b1f8268bd29de0b2b","src/future/future/fuse.rs":"65b80a1ba7556e2ef35ce8d23e47489a2a6eb6d1c3ef9ac4e080c63e69eaa07d","src/future/future/map.rs":"de607c2a4d80d2bddb590781c37328ddd294bb9d5064a9ecb99455244239b597","src/future/future/mod.rs":"d1cfcf1e45207705dd858bf4087b611792ac266d098ee7ed103d6a2b0d7bdd0f","src/future/future/remote_handle.rs":"2ae17a409569b32c78e20026a8ecdf667352c2597a4a0a8deefa4761fafcb223","src/future/future/shared.rs":"55b4b14859ce0dc3ea7555de24f286015f9f6e6028b6daa647926a0c2d4eade3","src/future/join.rs":"38b55fc7cdbbdaaa525e51f8ce09783dbbcb65eabfd7de9f46610593e0bbef17","src/future/join_all.rs":"4893629a9e5342f92fe58165dbb2ec80107c2ae4a0dbf97c9bba6847dbab0743","src/future/lazy.rs":"d161fc4108a97348c1becbbd5ba8fccb7225dcf1d81c097666f5c8b40718251d","src/future/maybe_done.rs":"559e41cb170f9fe7246d2a5b112527a9f9cbca63b8a5a872b3aa9c861f70f307","src/future/mod.rs":"22e7253ad13bce4f2aa4ee4f4023dc81a9131b01d4605cce33c0d8640b3b0113","src/future/option.rs":"73daca814800b91b707753dcfe074265372b0077fae2504ea6efddc713453579","src/future/pending.rs":"3967984d2061e6b201c407f28ba8392a21fc9ef7c0b9201e2e244110af0782c5","src/future/poll_fn.rs":"8e54bf57d60e01d496ae31df35e0b96868f4bda504c024a14f51ab723d67885f","src/future/poll_immediate.rs":"7e199fc102894c9095de17af602a7c8f05d427269aefce5d71cd5136d54659c0","src/future/ready.rs":"c9860ccd8ac529f44f66dee73ca9b9d7f1b1b3e5e9e4dc70c59640c752553d58","src/future/select.rs":"0c358a5ae079858f31c61cf6ea835205fdb9092d07536778440b975995d2626c","src/future/select_all.rs":"5b304210c34cc2bd84f7b1819baa30a68eea2ee578b10b243f5dd884ee9a4791","src/future/select_ok.rs":"dc35027db70c0111399c6ab6f7c977e6e7362f069a3891e4a62006c52643528e","src/future/try_future/into_future.rs":"d966bde7b06a88443f0efd877e95f91541778c4e713f3f4b66e00ca5d3f352b6","src/future/try_future/mod.rs":"991edb3b52903ceb3bcb6599d04d898509023cd038c5974f4872eaafa9748f08","src/future/try_future/try_flatten.rs":"16c02e1780bd312b8b386e41c1d9dd4bcc4e8ef10f26007364f857b3adcc6e99","src/future/try_future/try_flatten_err.rs":"130f3fc3fd95a19f4e4a50e69301106fab02f77d0faf3aac9c473a92b826c2ca","src/future/try_join.rs":"1836931f8ba32da41c6810e6acc0ea2fee75b74b3153e760c4542cb12b220540","src/future/try_join_all.rs":"5df69dcae742816b9ba68a0152a3a39a1154fccf22af36683158ae7abb5edc11","src/future/try_maybe_done.rs":"1cce46b2ee43ad51b7c5f9c02bc90a890af32bc549ce99098a2c8813508051e1","src/future/try_select.rs":"5d6187ace76b5f26e60c713a1fe9fcb9cbb0d161c5881c532ce9472a230b595d","src/io/allow_std.rs":"a125959c255fd344399fb0be19218a8ee7d613ce2485d6df9cdbc2ed5d3987df","src/io/buf_reader.rs":"46a1e24046c5bc2ab8f266e3d904281bec3ab4ba6c13d4213a52599b57b8de66","src/io/buf_writer.rs":"d6666b8dde60eefbb7fa69da4a2eea2b34ea0e4a85e21e5ac6e83cc680ea9140","src/io/chain.rs":"12f508fc39c3234a71a0f886505245c5d659aed09c7d874b1bd8ca0a0d456cf3","src/io/close.rs":"9832210a870637198fa58642cdf2779afab71f2e31a9953e663fa6854bd73ac7","src/io/copy.rs":"cb2466dcd7ea8bb1f07d00c03e66ed55abf71fe4be6937adc9f533ef9d99fb2d","src/io/copy_buf.rs":"e9a5f6aac8375e298bddb332f23d8b626d056ce452b58f772a05df7e2cd326cf","src/io/copy_buf_abortable.rs":"ced73b6420e892f220965315ed44ec774de4b44082ea53d0c9c64dbed72feed6","src/io/cursor.rs":"c12e9b82c6eff2108a5524b026d73fbb2c250072e8e3f673cc04d4da02a553b8","src/io/empty.rs":"6ae40b4bc8fc41572abad2d013285d78d8df445868d41fac77bde508ec9bc1a5","src/io/fill_buf.rs":"a3623e037db59efab227a769698098597f1b531a75b6c045e75f068c0137c738","src/io/flush.rs":"0c9b588dfd9da039dc123ba9448ac31ca21ee3da0a164a21f6c2c182183d43e2","src/io/into_sink.rs":"ab5bdb12bff62672175b69b8c9f5a4bbbea716b9cf89169ed6a723ab43da9df8","src/io/line_writer.rs":"16c151c68d89b7c2ab929c4a782539b1ad512b723eed9b544f50f1ff06f0b661","src/io/lines.rs":"137279b6b899ce438fb1b0ee9e6a412976f9f9db54fb7b961d2bad8787a26b1e","src/io/mod.rs":"eefa437d5ac91efb1328d9f50f10572206c7323be1c9919ca10e5ce1973f5c46","src/io/read.rs":"4ea675a83cec98a22c9c4731ff980209f0cf67f63c71871cd1deed53c1266345","src/io/read_exact.rs":"ddebd58db9f6766efa3f50543fb51b138538533921e1ee1da4621fff9c64efe2","src/io/read_line.rs":"e2829eb128f441c10dfc48f089a9dda7b6540753c9700f24cc9585e94affc11c","src/io/read_to_end.rs":"5e9e38dc087623dac5a3ae3ad329ed44ffe4f6205a78e546adadc3ffb76703fc","src/io/read_to_string.rs":"bef4cc292dd95fa9c850d0438ad0cf49a8cc4caf40a0384f763f8c9512ad9e79","src/io/read_until.rs":"354507ce95242a735940f0aaa6ef11cc7d6d0505ae148f05277ce6e7537f168a","src/io/read_vectored.rs":"bd7f442c92f2cb320075d0983b0d08d51c23078898d72e6c2857cf6c7ad4cec7","src/io/repeat.rs":"53bc472e4bd7d286bf90765ce574f13b7aabc871c4f04f712da7cea160491390","src/io/seek.rs":"9863e9fb6495eb6e1f8c45c283c8a6993b9bdb1462f75a3e525e135c6840dec7","src/io/sink.rs":"30a503631d196e5da92c386d0afc1af9656a5f7682456cfa2489a2c30a05cac5","src/io/split.rs":"b3702ba2f6e09ea014c809d45d9cc3bc7d20fc1e2a7281a8ca109656a9c421fe","src/io/take.rs":"c53fec5b5e8c3742b7e60e6ebfa625cf2e566fbea193fb1eee2f0a8e561d63d5","src/io/window.rs":"ec6a9d20a7b252a5b272a74afa32e2279d372b806840ab985eae17bc06a25d27","src/io/write.rs":"60670eb00f999f2e2c43b099759a7fb030325b323744d88c9d20f75926ec30df","src/io/write_all.rs":"8fcd4ff233650b5abd20f7b987000cac095d8de23445572de588dccf710623c6","src/io/write_all_vectored.rs":"53becf89c031bf4c3073f0903ce809eee7606b1b4fbeb518605875badba216d3","src/io/write_vectored.rs":"bc98ff4a709cb75cd9ffedefa8ef251089a49906b98e142d76447ddf4ac098bb","src/lib.rs":"515fe2c6fb0a7dd2a249a8411805bb7c36a6142466a405544a309346a009c9e9","src/lock/bilock.rs":"ac9ce60edba8faacee3f0aa48ad03e39510af20ad238d9aa7d0071a9186af3d2","src/lock/mod.rs":"17505464b0d63d00ccbfc0e512b4a0edb4c6d8fef98c6ac46d0dd43c995a0673","src/lock/mutex.rs":"745c68e571f84a7456681cd683b2b8eed28ea8b6d3f9a38337efad105a65e0b6","src/never.rs":"2066481ab04921269cfa768cb8b778a035ab6aa49ec404d9ac0aeb07a4bf6094","src/sink/buffer.rs":"33a7380f8232225a8e9ac5ee138fd095979efa3a64f9fecf5fcaf2e78fcbc355","src/sink/close.rs":"f2f31c884f048163abebd4f5a877b7b4306f7d02beae428325636fd00ed42ca9","src/sink/drain.rs":"60262bf3ef48c09b4d52e52953f9437d536e20f63690b73e975388751405d239","src/sink/err_into.rs":"ced2998b2b0b792d80f7543523c9e07e8f5d20a4336cae93084b995e46671b15","src/sink/fanout.rs":"66dcde056e0bbee4e0074d331838ed2743dc872ea1597f05d61970523dc34926","src/sink/feed.rs":"64b9d296d37aedde37e1421c459ebcd9a7e8814db905996996167850124f3b3f","src/sink/flush.rs":"fbba344f428ca7636541ba013f7db2ece480b404a9e0b421c5537552d61e2492","src/sink/map_err.rs":"0f68f444ef13fe7115164be855c3b7b1d269e1119e69fcdad1706988255641f1","src/sink/mod.rs":"37cf379170f3099992eb59f3181be4c4e4a5c2d3581dbe424d22ab360840d321","src/sink/send.rs":"56aaba9aa4a562e0af39473a5779206d91b0acb1fced4fc06cd8b959d1897524","src/sink/send_all.rs":"a8e4956604fe73e321b0a3896c2018bc5c27149f2862f8406112db140b3aa2dd","src/sink/unfold.rs":"5febcfb9295a79fe1187284d0d45055c787e399b00d73c0e85a0446ae2246d18","src/sink/with.rs":"850cd3b96304df1f38360a0bc60b02d485535e399ef7642acdd9add7876867d8","src/sink/with_flat_map.rs":"5e0f527b33ee8f1cc6a6a46d45b6d74dad5c735d88b2cb24e1cb34fdc6ef501b","src/stream/abortable.rs":"935d79aa44d793f4abe87ca27a9e4a20891500488cf942693cd2756d65b3aab2","src/stream/empty.rs":"5000c856186408a17f68bbef432d4a1a3edb7fb5a07ed8699342fef04b10a181","src/stream/futures_ordered.rs":"ca388121e9fae6ad250bd71b40da4bcf2eb0e56bdccd9086315141cd2a9759ee","src/stream/futures_unordered/abort.rs":"bdfece9f91accafd5122be36d628c37c5b219ac0eecec181267840fbb1e95a45","src/stream/futures_unordered/iter.rs":"01f8aaa2ac7ea493bf727a945424cc6ae695c9a0c289ac57cbb26697abb05827","src/stream/futures_unordered/mod.rs":"ef0abe0c4877e9e1cb74ed14e8afc5749c1756d5c4a5b7c8dc2a34211f04ce92","src/stream/futures_unordered/ready_to_run_queue.rs":"d2a3ab210175503cdec7d7625baf1e53f62b45fc1433d417d01ec21c33ffedba","src/stream/futures_unordered/task.rs":"2b780bcc97844bc0bdeced7bb4318066e86ba082c08c8628c9b2e92bfe36fb61","src/stream/iter.rs":"609fa821a460e901a54ae51f8da58220881157cef02b8b7b8c9e4321c2d05a23","src/stream/mod.rs":"9a0f4428681bf447c3b34eab0de58322ca0f0ab8cf9e0daf0e761d3fc9346e5e","src/stream/once.rs":"d7b70adabad1f10af711ac3dcef33fd4c287e9852fdb678406e7ff350ba8fd47","src/stream/pending.rs":"84aaa15c8bbb17a250da5b1b5f0c7f6717410915d63340a3fcbf098bebe19d6f","src/stream/poll_fn.rs":"35952ea514b8aade14a3934d7777006475f50bbf0c5b50141710e31637f980be","src/stream/poll_immediate.rs":"e7a53ff8275ebe89dab8f9b984cce2ee0fde0a828e540b77c5500ca017d5bb98","src/stream/repeat.rs":"e4e4a9b6f2fca72bcbf098c3ac0c4a41323a840741d4dce9d9416464b7e8bd0d","src/stream/repeat_with.rs":"525780d24f3f99152b879765ca6eab99bcc0c757dc6654b6635c099b93ea654d","src/stream/select.rs":"28eb422c0eca9fd02778a6003004471b3489db09746a70e617a506303ea8b81d","src/stream/select_all.rs":"19ef94abcf63fa9e46a73b6ab783642d2d069a015c7fa57fea36eeac7b6f2a20","src/stream/select_with_strategy.rs":"caa0f5d1fd02824b48a1cd2be13a6f96b532039eb88cf47ea5d2becf58595073","src/stream/stream/all.rs":"267a2cc251775fa0c60c6e41ae1e4a9611fc493be0fd1c3494ca75f24d60de51","src/stream/stream/any.rs":"a3eb3eecce02142b8eb95d0b8a62178f177c8152d63f52da5effbe3a4be45580","src/stream/stream/buffer_unordered.rs":"b0f7a1c72cee178e7bfd8990e6e426c1258eeba6d952b82c6be8e4cac0a054ea","src/stream/stream/buffered.rs":"e37d08d6a18090ba37079937575920cc8c7569f4183dba710d3f4b94c11da01b","src/stream/stream/catch_unwind.rs":"b2e801ff744d5d9e17177ec1156b0ab67bdd56b94c618ed8590344ec8a0f35e7","src/stream/stream/chain.rs":"809b6b5c8372f65341dc9810d39f60ae3bcf74a78f133b4ab8d289fb5f2a7cbb","src/stream/stream/chunks.rs":"9f872b473de14d2251584050f04d56eada9c3b1d8dc3e746bdd57c1f757bfc6f","src/stream/stream/collect.rs":"6e4d2d580189f7d3b6b294b6b17437e8e2570502f08c11786a71caac207f0309","src/stream/stream/concat.rs":"171ea941b45c0295ed978c3f318a449ea295e33cb4ea82c764f4e9e7c48ad5de","src/stream/stream/count.rs":"ff218aea3d2d2456c8163926ea0c357b2752e92578e5fd4bec6b789fe1246556","src/stream/stream/cycle.rs":"ed7e3d15e7b1adec5ad5789b0d3186b5995a3353cc974fb7f41a72f6d8ad4cbb","src/stream/stream/enumerate.rs":"fc7565d21d39565790859eeac9ae8dd74123a9d15b88258d3abe894f1876cc39","src/stream/stream/filter.rs":"5d871f416d41baff3733121f564229fe31bdf7dfaaeb78ab940fafba6ab4b7c6","src/stream/stream/filter_map.rs":"179045a5ab1295e77ab5cfea1964be69dc50984ef8ac9ee04034adf0a043514f","src/stream/stream/flatten.rs":"69493fc106a1447abe109fd54375bb30363f7bc419463a8f835e4c80d97f2186","src/stream/stream/flatten_unordered.rs":"dd5216fc0e34d09cc69ae6b3c4690efe8ff01404853756bf5aa6b92eb2e6750b","src/stream/stream/fold.rs":"75d61d4321db1bcbbdd1a0102d9ad60206275777167c008fc8953e50cd978a09","src/stream/stream/for_each.rs":"07bca889821bad18ff083e54abe679fbeb8cd19c086581c2f2722cba6b42263f","src/stream/stream/for_each_concurrent.rs":"4e1e7eb3d4ccfae0e8000651b75834e2960a7f9c62ab92dba35a0bdbbf5bbb21","src/stream/stream/forward.rs":"cd024ba1a3d5098d3ff2d5178a12e068916cc4307284b00c18dbc54b554a5560","src/stream/stream/fuse.rs":"061c5385f12f80c7906cb15ddb8f455ced6ce21d1de9a97de9db2616407c0cac","src/stream/stream/into_future.rs":"b46ad45cc03ddd778a9ffaa0d603c8ee0b411f49333100160959942cde9588bd","src/stream/stream/map.rs":"b91bdd5b33821a50c9b5034261a14f89ff1a9d541ab99b9d9a6921b12a5d434e","src/stream/stream/mod.rs":"df12e6db862e46850e06c2aad0fdcad6acccb1419120cf0cb9ce94b98890c5fd","src/stream/stream/next.rs":"7b4d5a22b5e00aa191ea82346bb1f392121cc68692864a8230e462d59e622928","src/stream/stream/peek.rs":"2e08e6990c31186c97edb21737f83fe8640a19561062879af83090935aef99cf","src/stream/stream/ready_chunks.rs":"7e17c49ff29c106c13a2ec13fb05f32ff048e482b47a157d3965bd03c38c01c2","src/stream/stream/scan.rs":"54489c8efef60dbf3c35ee803afee5c5ea7c364fb9b68939a04956e46febb856","src/stream/stream/select_next_some.rs":"0094eccc96cfe78d9b6d0a9bdb82cada8fb7929770a3ac00ffcb5441d7dc4f51","src/stream/stream/skip.rs":"61f7ec7fe25663d2c87cffaad19ed27eda032842edb8af731b521025b244f120","src/stream/stream/skip_while.rs":"6f114a3fa538bd479e4fa24d8aa0e0e0454613643a97c44242c5683ae7293b82","src/stream/stream/split.rs":"685187ea9a68e604b8a89c321329484288b94fc2b4e204fa1ca537aab0e8360f","src/stream/stream/take.rs":"57d381b482c3d584c4c26b0e15941bc2ea58e3f39a2e5c74391a2ee7b825cc8c","src/stream/stream/take_until.rs":"0f1fa7d158192a5dee32392dfdd062c15dab6d246b0ca267e91aae490d7d7fdb","src/stream/stream/take_while.rs":"2f57a6e5b903c045da642e9a40eb19dabbc612a80a6ce8098df1a1973555f108","src/stream/stream/then.rs":"c995c6b0d9151927b26b10fba70e135dfc41224b969d1367dc8c11697218c1e9","src/stream/stream/unzip.rs":"e7beedc2192604e0091ac3d0265b487127a37c780198838f6419c21ef1b38df0","src/stream/stream/zip.rs":"3890b40daea00341fac6ac977de0b534d1ec7cdaabece44af5df2ca56026fe62","src/stream/try_stream/and_then.rs":"6f92b333955f5ec30fddf8e087e3f60ebf53a054769fc72c80bbccdf13a9431e","src/stream/try_stream/into_async_read.rs":"5b200c76ccb95460d94286ca8e63f5454940eb62b5f15aae998da48aa06fbffd","src/stream/try_stream/into_stream.rs":"4fee94e89956a42871fc4a0cdba7ae1b7d4265e884528799cd227c9dd851acce","src/stream/try_stream/mod.rs":"865e920e0409730bb61e84f56763d21e83bfe6b56126f8330633d4b9505b925b","src/stream/try_stream/or_else.rs":"473ca77e0e81a1a0834d2d882076b8823a5a3027b2d7d78f887be2d5edfd0de3","src/stream/try_stream/try_all.rs":"58a4c9abe3b2d6ad2debcfc09701bb828732c9d7edf2a42f12a74beff5ae2db0","src/stream/try_stream/try_any.rs":"822f21af5cb27b1269046af076415216fdfc9e0b9fd877cb6e7d65c69d659471","src/stream/try_stream/try_buffer_unordered.rs":"64e698ea6aefbe7e32d48e737553b20b9cde5c258963bb20486b48b7d6899660","src/stream/try_stream/try_buffered.rs":"38f60d7290f44471a02084c6b394b754c224a84ee8d2ba01c08568168b48a21f","src/stream/try_stream/try_chunks.rs":"69c4d85a256250d73c6372d8047e6055da7eac918cb5d7ef4f3697898f4dcb4c","src/stream/try_stream/try_collect.rs":"979920e3034dad6c75961e3f6b4c0234691db7063eca1a05562cc5d41f2943c1","src/stream/try_stream/try_concat.rs":"f2330ebeeab30273e9ac0e8600bfe2f405ce671f6386e688b3afb1d2fdd7c2c6","src/stream/try_stream/try_filter.rs":"1344e9aea05e2d0078f30caff176a99e1ccb8fcdf0a287817abc82fbaf09c48b","src/stream/try_stream/try_filter_map.rs":"285e7ea875a3ea3e16942c1b1acae5a1cb26b9bac476dce3903547cb99306602","src/stream/try_stream/try_flatten.rs":"e05614d86a27ab8386476eea35fd424c07e5f7f99cf0401d63a6655eb7ca1247","src/stream/try_stream/try_flatten_unordered.rs":"1cc4c4a5ea0a8db3010958f34fb1886dcfbd2e1584082d2004030eb70b13cd6c","src/stream/try_stream/try_fold.rs":"b96aa2fe1a16f625d5045028a86ff8684dcf5198ef8c7c072f52f39aeaa8b619","src/stream/try_stream/try_for_each.rs":"3f3901d618333b740d470eb02fcbb645df92483493872298bb7bd0382646028a","src/stream/try_stream/try_for_each_concurrent.rs":"78a94a77f329862c2a245ec3add97e49c534985f0d9da98f205b7fa3c7c08df3","src/stream/try_stream/try_next.rs":"6e29473153db1435906e79f7eaa13ce9da842d4528ba9eb1c0034665feacc565","src/stream/try_stream/try_ready_chunks.rs":"e8a658f5e48bb5c12b59998adbc5534f7eb830d0a60b53c0a3acd945752166fd","src/stream/try_stream/try_skip_while.rs":"7c2fa31fe8b0b4e59c5d7f2972c8d9f83e8f01a687b08f5cd631f92a14b402f1","src/stream/try_stream/try_take_while.rs":"2783664637aff0442f0c9204d35600139c941332310f70495cbc4dc345cae99d","src/stream/try_stream/try_unfold.rs":"aaf0f4857a4ec8233ac842ae509f29e5a210827a0bb40cfc0dc3e858f153d2b4","src/stream/unfold.rs":"201428f3dfcd10c556367d9aa87c4ae20fc9db6396380674b3b8c43b5d2a307e","src/task/mod.rs":"781f6d7d2484d6bd88ef9533d5c4729eeb8d4ee9bb8b9f4bad7049a78e190c32","src/task/spawn.rs":"8ff3a3652d8d2cb45717324b6ead9c3f111629e7eb0c0b33d3639a0e7c5bbf3e","src/unfold_state.rs":"ffe848071a99d6afcdbe8281a8a77a559a7dde434fc41f734c90e6b9b5d8a5af"},"package":"3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"} \ No newline at end of file diff --git a/vendor/futures-util/Cargo.toml b/vendor/futures-util/Cargo.toml index 45cc34500..c95816a2b 100644 --- a/vendor/futures-util/Cargo.toml +++ b/vendor/futures-util/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures-util" -version = "0.3.29" +version = "0.3.30" description = """ Common utilities and extension traits for the futures-rs library. """ @@ -30,33 +30,33 @@ rustdoc-args = [ ] [dependencies.futures-channel] -version = "0.3.29" +version = "0.3.30" features = ["std"] optional = true default-features = false [dependencies.futures-core] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-io] -version = "0.3.29" +version = "0.3.30" features = ["std"] optional = true default-features = false [dependencies.futures-macro] -version = "=0.3.29" +version = "=0.3.30" optional = true default-features = false [dependencies.futures-sink] -version = "0.3.29" +version = "0.3.30" optional = true default-features = false [dependencies.futures-task] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures_01] diff --git a/vendor/futures-util/build.rs b/vendor/futures-util/build.rs deleted file mode 100644 index 05e0496d9..000000000 --- a/vendor/futures-util/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// The rustc-cfg listed below are considered public API, but it is *unstable* -// and outside of the normal semver guarantees: -// -// - `futures_no_atomic_cas` -// Assume the target does *not* support atomic CAS operations. -// This is usually detected automatically by the build script, but you may -// need to enable it manually when building for custom targets or using -// non-cargo build systems that don't run the build script. -// -// With the exceptions mentioned above, the rustc-cfg emitted by the build -// script are *not* public API. - -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::env; - -include!("no_atomic_cas.rs"); - -fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, - Err(e) => { - println!( - "cargo:warning={}: unable to get TARGET environment variable: {}", - env!("CARGO_PKG_NAME"), - e - ); - return; - } - }; - - // Note that this is `no_*`, not `has_*`. This allows treating - // `cfg(target_has_atomic = "ptr")` as true when the build script doesn't - // run. This is needed for compatibility with non-cargo build systems that - // don't run the build script. - if NO_ATOMIC_CAS.contains(&&*target) { - println!("cargo:rustc-cfg=futures_no_atomic_cas"); - } - - println!("cargo:rerun-if-changed=no_atomic_cas.rs"); -} diff --git a/vendor/futures-util/no_atomic_cas.rs b/vendor/futures-util/no_atomic_cas.rs deleted file mode 100644 index 16ec628cd..000000000 --- a/vendor/futures-util/no_atomic_cas.rs +++ /dev/null @@ -1,17 +0,0 @@ -// This file is @generated by no_atomic_cas.sh. -// It is not intended for manual editing. - -const NO_ATOMIC_CAS: &[&str] = &[ - "armv4t-none-eabi", - "armv5te-none-eabi", - "avr-unknown-gnu-atmega328", - "bpfeb-unknown-none", - "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32im-unknown-none-elf", - "riscv32imc-unknown-none-elf", - "thumbv4t-none-eabi", - "thumbv5te-none-eabi", - "thumbv6m-none-eabi", -]; diff --git a/vendor/futures-util/src/future/future/shared.rs b/vendor/futures-util/src/future/future/shared.rs index ecd1b426d..9ab3b4f1d 100644 --- a/vendor/futures-util/src/future/future/shared.rs +++ b/vendor/futures-util/src/future/future/shared.rs @@ -37,10 +37,6 @@ impl Clone for WeakShared { } } -// The future itself is polled behind the `Arc`, so it won't be moved -// when `Shared` is moved. -impl Unpin for Shared {} - impl fmt::Debug for Shared { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Shared") diff --git a/vendor/futures-util/src/future/join_all.rs b/vendor/futures-util/src/future/join_all.rs index 11b6f2728..79eee8dff 100644 --- a/vendor/futures-util/src/future/join_all.rs +++ b/vendor/futures-util/src/future/join_all.rs @@ -12,7 +12,7 @@ use core::task::{Context, Poll}; use super::{assert_future, MaybeDone}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] use crate::stream::{Collect, FuturesOrdered, StreamExt}; pub(crate) fn iter_pin_mut(slice: Pin<&mut [T]>) -> impl Iterator> { @@ -31,7 +31,7 @@ where kind: JoinAllKind, } -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] pub(crate) const SMALL: usize = 30; enum JoinAllKind @@ -41,7 +41,7 @@ where Small { elems: Pin]>>, }, - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] Big { fut: Collect, Vec>, }, @@ -57,7 +57,7 @@ where JoinAllKind::Small { ref elems } => { f.debug_struct("JoinAll").field("elems", elems).finish() } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] JoinAllKind::Big { ref fut, .. } => fmt::Debug::fmt(fut, f), } } @@ -106,7 +106,8 @@ where { let iter = iter.into_iter(); - #[cfg(futures_no_atomic_cas)] + #[cfg(target_os = "none")] + #[cfg_attr(target_os = "none", cfg(not(target_has_atomic = "ptr")))] { let kind = JoinAllKind::Small { elems: iter.map(MaybeDone::Future).collect::>().into() }; @@ -114,7 +115,7 @@ where assert_future::::Output>, _>(JoinAll { kind }) } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] { let kind = match iter.size_hint().1 { Some(max) if max <= SMALL => JoinAllKind::Small { @@ -153,7 +154,7 @@ where Poll::Pending } } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] JoinAllKind::Big { fut } => Pin::new(fut).poll(cx), } } diff --git a/vendor/futures-util/src/future/mod.rs b/vendor/futures-util/src/future/mod.rs index 374e36512..2d8fa4f65 100644 --- a/vendor/futures-util/src/future/mod.rs +++ b/vendor/futures-util/src/future/mod.rs @@ -111,13 +111,13 @@ pub use self::select_ok::{select_ok, SelectOk}; mod either; pub use self::either::Either; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod abortable; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use crate::abortable::{AbortHandle, AbortRegistration, Abortable, Aborted}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use abortable::abortable; diff --git a/vendor/futures-util/src/future/try_join_all.rs b/vendor/futures-util/src/future/try_join_all.rs index 506f45065..2d6a2a02c 100644 --- a/vendor/futures-util/src/future/try_join_all.rs +++ b/vendor/futures-util/src/future/try_join_all.rs @@ -12,7 +12,7 @@ use core::task::{Context, Poll}; use super::{assert_future, join_all, IntoFuture, TryFuture, TryMaybeDone}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] use crate::stream::{FuturesOrdered, TryCollect, TryStreamExt}; use crate::TryFutureExt; @@ -38,7 +38,7 @@ where Small { elems: Pin>]>>, }, - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] Big { fut: TryCollect>, Vec>, }, @@ -56,7 +56,7 @@ where TryJoinAllKind::Small { ref elems } => { f.debug_struct("TryJoinAll").field("elems", elems).finish() } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] TryJoinAllKind::Big { ref fut, .. } => fmt::Debug::fmt(fut, f), } } @@ -121,7 +121,8 @@ where { let iter = iter.into_iter().map(TryFutureExt::into_future); - #[cfg(futures_no_atomic_cas)] + #[cfg(target_os = "none")] + #[cfg_attr(target_os = "none", cfg(not(target_has_atomic = "ptr")))] { let kind = TryJoinAllKind::Small { elems: iter.map(TryMaybeDone::Future).collect::>().into(), @@ -132,7 +133,7 @@ where ) } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] { let kind = match iter.size_hint().1 { Some(max) if max <= join_all::SMALL => TryJoinAllKind::Small { @@ -184,7 +185,7 @@ where } } } - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] TryJoinAllKind::Big { fut } => Pin::new(fut).poll(cx), } } diff --git a/vendor/futures-util/src/io/copy_buf_abortable.rs b/vendor/futures-util/src/io/copy_buf_abortable.rs index fdbc4a5f0..ed22d6233 100644 --- a/vendor/futures-util/src/io/copy_buf_abortable.rs +++ b/vendor/futures-util/src/io/copy_buf_abortable.rs @@ -57,7 +57,7 @@ where } pin_project! { - /// Future for the [`copy_buf()`] function. + /// Future for the [`copy_buf_abortable()`] function. #[derive(Debug)] #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct CopyBufAbortable<'a, R, W: ?Sized> { diff --git a/vendor/futures-util/src/io/fill_buf.rs b/vendor/futures-util/src/io/fill_buf.rs index a1484c032..45862b8e2 100644 --- a/vendor/futures-util/src/io/fill_buf.rs +++ b/vendor/futures-util/src/io/fill_buf.rs @@ -3,6 +3,7 @@ use futures_core::task::{Context, Poll}; use futures_io::AsyncBufRead; use std::io; use std::pin::Pin; +use std::slice; /// Future for the [`fill_buf`](super::AsyncBufReadExt::fill_buf) method. #[derive(Debug)] @@ -30,17 +31,12 @@ where let reader = this.reader.take().expect("Polled FillBuf after completion"); match Pin::new(&mut *reader).poll_fill_buf(cx) { - // With polonius it is possible to remove this inner match and just have the correct - // lifetime of the reference inferred based on which branch is taken - Poll::Ready(Ok(_)) => match Pin::new(reader).poll_fill_buf(cx) { - Poll::Ready(Ok(slice)) => Poll::Ready(Ok(slice)), - Poll::Ready(Err(err)) => { - unreachable!("reader indicated readiness but then returned an error: {:?}", err) - } - Poll::Pending => { - unreachable!("reader indicated readiness but then returned pending") - } - }, + Poll::Ready(Ok(slice)) => { + // With polonius it is possible to remove this lifetime transmutation and just have + // the correct lifetime of the reference inferred based on which branch is taken + let slice: &'a [u8] = unsafe { slice::from_raw_parts(slice.as_ptr(), slice.len()) }; + Poll::Ready(Ok(slice)) + } Poll::Ready(Err(err)) => Poll::Ready(Err(err)), Poll::Pending => { this.reader = Some(reader); diff --git a/vendor/futures-util/src/io/split.rs b/vendor/futures-util/src/io/split.rs index 3f1b9af45..81d1e6dcb 100644 --- a/vendor/futures-util/src/io/split.rs +++ b/vendor/futures-util/src/io/split.rs @@ -31,6 +31,13 @@ pub(super) fn split(t: T) -> (ReadHalf, WriteHalf< (ReadHalf { handle: a }, WriteHalf { handle: b }) } +impl ReadHalf { + /// Checks if this `ReadHalf` and some `WriteHalf` were split from the same stream. + pub fn is_pair_of(&self, other: &WriteHalf) -> bool { + self.handle.is_pair_of(&other.handle) + } +} + impl ReadHalf { /// Attempts to put the two "halves" of a split `AsyncRead + AsyncWrite` back /// together. Succeeds only if the `ReadHalf` and `WriteHalf` are @@ -42,6 +49,13 @@ impl ReadHalf { } } +impl WriteHalf { + /// Checks if this `WriteHalf` and some `ReadHalf` were split from the same stream. + pub fn is_pair_of(&self, other: &ReadHalf) -> bool { + self.handle.is_pair_of(&other.handle) + } +} + impl WriteHalf { /// Attempts to put the two "halves" of a split `AsyncRead + AsyncWrite` back /// together. Succeeds only if the `ReadHalf` and `WriteHalf` are diff --git a/vendor/futures-util/src/lib.rs b/vendor/futures-util/src/lib.rs index 9a10c93c9..208eb73aa 100644 --- a/vendor/futures-util/src/lib.rs +++ b/vendor/futures-util/src/lib.rs @@ -329,7 +329,7 @@ pub use crate::io::{ #[cfg(feature = "alloc")] pub mod lock; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod abortable; diff --git a/vendor/futures-util/src/lock/bilock.rs b/vendor/futures-util/src/lock/bilock.rs index 7ddc66ad2..a89678e05 100644 --- a/vendor/futures-util/src/lock/bilock.rs +++ b/vendor/futures-util/src/lock/bilock.rs @@ -149,6 +149,11 @@ impl BiLock { BiLockAcquire { bilock: self } } + /// Returns `true` only if the other `BiLock` originated from the same call to `BiLock::new`. + pub fn is_pair_of(&self, other: &Self) -> bool { + Arc::ptr_eq(&self.arc, &other.arc) + } + /// Attempts to put the two "halves" of a `BiLock` back together and /// recover the original value. Succeeds only if the two `BiLock`s /// originated from the same call to `BiLock::new`. @@ -156,7 +161,7 @@ impl BiLock { where T: Unpin, { - if Arc::ptr_eq(&self.arc, &other.arc) { + if self.is_pair_of(&other) { drop(other); let inner = Arc::try_unwrap(self.arc) .ok() diff --git a/vendor/futures-util/src/lock/mod.rs b/vendor/futures-util/src/lock/mod.rs index 0be72717c..8ca0ff625 100644 --- a/vendor/futures-util/src/lock/mod.rs +++ b/vendor/futures-util/src/lock/mod.rs @@ -3,25 +3,25 @@ //! This module is only available when the `std` or `alloc` feature of this //! library is activated, and it is activated by default. -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(any(feature = "sink", feature = "io"))] #[cfg(not(feature = "bilock"))] pub(crate) use self::bilock::BiLock; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "bilock")] #[cfg_attr(docsrs, doc(cfg(feature = "bilock")))] pub use self::bilock::{BiLock, BiLockAcquire, BiLockGuard, ReuniteError}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "std")] pub use self::mutex::{ MappedMutexGuard, Mutex, MutexGuard, MutexLockFuture, OwnedMutexGuard, OwnedMutexLockFuture, }; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(any(feature = "bilock", feature = "sink", feature = "io"))] #[cfg_attr(docsrs, doc(cfg(feature = "bilock")))] #[cfg_attr(not(feature = "bilock"), allow(unreachable_pub))] mod bilock; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "std")] mod mutex; diff --git a/vendor/futures-util/src/stream/futures_ordered.rs b/vendor/futures-util/src/stream/futures_ordered.rs index 3aaef8bde..2cc144e81 100644 --- a/vendor/futures-util/src/stream/futures_ordered.rs +++ b/vendor/futures-util/src/stream/futures_ordered.rs @@ -19,7 +19,8 @@ pin_project! { struct OrderWrapper { #[pin] data: T, // A future or a future's output - index: isize, + // Use i64 for index since isize may overflow in 32-bit targets. + index: i64, } } @@ -98,8 +99,8 @@ where pub struct FuturesOrdered { in_progress_queue: FuturesUnordered>, queued_outputs: BinaryHeap>, - next_incoming_index: isize, - next_outgoing_index: isize, + next_incoming_index: i64, + next_outgoing_index: i64, } impl Unpin for FuturesOrdered {} diff --git a/vendor/futures-util/src/stream/futures_unordered/mod.rs b/vendor/futures-util/src/stream/futures_unordered/mod.rs index 0dbaea908..dedf75dee 100644 --- a/vendor/futures-util/src/stream/futures_unordered/mod.rs +++ b/vendor/futures-util/src/stream/futures_unordered/mod.rs @@ -558,20 +558,7 @@ impl Debug for FuturesUnordered { impl FuturesUnordered { /// Clears the set, removing all futures. pub fn clear(&mut self) { - self.clear_head_all(); - - // we just cleared all the tasks, and we have &mut self, so this is safe. - unsafe { self.ready_to_run_queue.clear() }; - - self.is_terminated.store(false, Relaxed); - } - - fn clear_head_all(&mut self) { - while !self.head_all.get_mut().is_null() { - let head = *self.head_all.get_mut(); - let task = unsafe { self.unlink(head) }; - self.release_task(task); - } + *self = Self::new(); } } @@ -581,7 +568,11 @@ impl Drop for FuturesUnordered { // associated with it. At the same time though there may be tons of // wakers flying around which contain `Task` references // inside them. We'll let those naturally get deallocated. - self.clear_head_all(); + while !self.head_all.get_mut().is_null() { + let head = *self.head_all.get_mut(); + let task = unsafe { self.unlink(head) }; + self.release_task(task); + } // Note that at this point we could still have a bunch of tasks in the // ready to run queue. None of those tasks, however, have futures diff --git a/vendor/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs b/vendor/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs index 451870532..a924935d2 100644 --- a/vendor/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs +++ b/vendor/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs @@ -85,38 +85,25 @@ impl ReadyToRunQueue { pub(super) fn stub(&self) -> *const Task { Arc::as_ptr(&self.stub) } - - // Clear the queue of tasks. - // - // Note that each task has a strong reference count associated with it - // which is owned by the ready to run queue. This method just pulls out - // tasks and drops their refcounts. - // - // # Safety - // - // - All tasks **must** have had their futures dropped already (by FuturesUnordered::clear) - // - The caller **must** guarantee unique access to `self` - pub(crate) unsafe fn clear(&self) { - loop { - // SAFETY: We have the guarantee of mutual exclusion required by `dequeue`. - match self.dequeue() { - Dequeue::Empty => break, - Dequeue::Inconsistent => abort("inconsistent in drop"), - Dequeue::Data(ptr) => drop(Arc::from_raw(ptr)), - } - } - } } impl Drop for ReadyToRunQueue { fn drop(&mut self) { // Once we're in the destructor for `Inner` we need to clear out // the ready to run queue of tasks if there's anything left in there. - - // All tasks have had their futures dropped already by the `FuturesUnordered` - // destructor above, and we have &mut self, so this is safe. + // + // Note that each task has a strong reference count associated with it + // which is owned by the ready to run queue. All tasks should have had + // their futures dropped already by the `FuturesUnordered` destructor + // above, so we're just pulling out tasks and dropping their refcounts. unsafe { - self.clear(); + loop { + match self.dequeue() { + Dequeue::Empty => break, + Dequeue::Inconsistent => abort("inconsistent in drop"), + Dequeue::Data(ptr) => drop(Arc::from_raw(ptr)), + } + } } } } diff --git a/vendor/futures-util/src/stream/mod.rs b/vendor/futures-util/src/stream/mod.rs index 34d68a80b..2438e58b6 100644 --- a/vendor/futures-util/src/stream/mod.rs +++ b/vendor/futures-util/src/stream/mod.rs @@ -37,13 +37,13 @@ pub use self::stream::ReadyChunks; #[cfg_attr(docsrs, doc(cfg(feature = "sink")))] pub use self::stream::Forward; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use self::stream::{ BufferUnordered, Buffered, FlatMapUnordered, FlattenUnordered, ForEachConcurrent, }; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "sink")] #[cfg_attr(docsrs, doc(cfg(feature = "sink")))] #[cfg(feature = "alloc")] @@ -51,9 +51,9 @@ pub use self::stream::{ReuniteError, SplitSink, SplitStream}; mod try_stream; pub use self::try_stream::{ - try_unfold, AndThen, ErrInto, InspectErr, InspectOk, IntoStream, MapErr, MapOk, OrElse, - TryCollect, TryConcat, TryFilter, TryFilterMap, TryFlatten, TryFold, TryForEach, TryNext, - TrySkipWhile, TryStreamExt, TryTakeWhile, TryUnfold, + try_unfold, AndThen, ErrInto, InspectErr, InspectOk, IntoStream, MapErr, MapOk, OrElse, TryAll, + TryAny, TryCollect, TryConcat, TryFilter, TryFilterMap, TryFlatten, TryFold, TryForEach, + TryNext, TrySkipWhile, TryStreamExt, TryTakeWhile, TryUnfold, }; #[cfg(feature = "io")] @@ -61,7 +61,7 @@ pub use self::try_stream::{ #[cfg(feature = "std")] pub use self::try_stream::IntoAsyncRead; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use self::try_stream::{ TryBufferUnordered, TryBuffered, TryFlattenUnordered, TryForEachConcurrent, @@ -105,36 +105,36 @@ pub use self::select_with_strategy::{select_with_strategy, PollNext, SelectWithS mod unfold; pub use self::unfold::{unfold, Unfold}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod futures_ordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use self::futures_ordered::FuturesOrdered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub mod futures_unordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[doc(inline)] pub use self::futures_unordered::FuturesUnordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub mod select_all; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[doc(inline)] pub use self::select_all::{select_all, SelectAll}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod abortable; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use crate::abortable::{AbortHandle, AbortRegistration, Abortable, Aborted}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use abortable::abortable; diff --git a/vendor/futures-util/src/stream/stream/mod.rs b/vendor/futures-util/src/stream/stream/mod.rs index 3978d188f..2da7036b2 100644 --- a/vendor/futures-util/src/stream/stream/mod.rs +++ b/vendor/futures-util/src/stream/stream/mod.rs @@ -181,32 +181,32 @@ mod scan; #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::scan::Scan; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod buffer_unordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::buffer_unordered::BufferUnordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod buffered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::buffered::Buffered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub(crate) mod flatten_unordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] pub use self::flatten_unordered::FlattenUnordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] delegate_all!( /// Stream for the [`flat_map_unordered`](StreamExt::flat_map_unordered) method. @@ -216,20 +216,20 @@ delegate_all!( where St: Stream, U: Stream, U: Unpin, F: FnMut(St::Item) -> U ); -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod for_each_concurrent; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::for_each_concurrent::ForEachConcurrent; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "sink")] #[cfg_attr(docsrs, doc(cfg(feature = "sink")))] #[cfg(feature = "alloc")] mod split; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "sink")] #[cfg_attr(docsrs, doc(cfg(feature = "sink")))] #[cfg(feature = "alloc")] @@ -820,7 +820,7 @@ pub trait StreamExt: Stream { /// assert_eq!(output, vec![1, 2, 3, 4]); /// # }); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn flatten_unordered(self, limit: impl Into>) -> FlattenUnordered where @@ -902,7 +902,7 @@ pub trait StreamExt: Stream { /// assert_eq!(vec![1usize, 2, 2, 3, 3, 3, 4, 4, 4, 4], values); /// # }); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn flat_map_unordered( self, @@ -1142,7 +1142,7 @@ pub trait StreamExt: Stream { /// fut.await; /// # }) /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn for_each_concurrent( self, @@ -1365,7 +1365,7 @@ pub trait StreamExt: Stream { /// /// This method is only available when the `std` or `alloc` feature of this /// library is activated, and it is activated by default. - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn buffered(self, n: usize) -> Buffered where @@ -1410,7 +1410,7 @@ pub trait StreamExt: Stream { /// assert_eq!(buffered.next().await, None); /// # Ok::<(), i32>(()) }).unwrap(); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn buffer_unordered(self, n: usize) -> BufferUnordered where @@ -1577,7 +1577,7 @@ pub trait StreamExt: Stream { /// library is activated, and it is activated by default. #[cfg(feature = "sink")] #[cfg_attr(docsrs, doc(cfg(feature = "sink")))] - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn split(self) -> (SplitSink, SplitStream) where diff --git a/vendor/futures-util/src/stream/stream/split.rs b/vendor/futures-util/src/stream/stream/split.rs index e2034e0c2..1a7fdcb38 100644 --- a/vendor/futures-util/src/stream/stream/split.rs +++ b/vendor/futures-util/src/stream/stream/split.rs @@ -15,6 +15,13 @@ pub struct SplitStream(BiLock); impl Unpin for SplitStream {} +impl SplitStream { + /// Returns `true` if the `SplitStream` and `SplitSink` originate from the same call to `StreamExt::split`. + pub fn is_pair_of(&self, other: &SplitSink) -> bool { + other.is_pair_of(&self) + } +} + impl SplitStream { /// Attempts to put the two "halves" of a split `Stream + Sink` back /// together. Succeeds only if the `SplitStream` and `SplitSink` are @@ -60,6 +67,13 @@ impl + Unpin, Item> SplitSink { } } +impl SplitSink { + /// Returns `true` if the `SplitStream` and `SplitSink` originate from the same call to `StreamExt::split`. + pub fn is_pair_of(&self, other: &SplitStream) -> bool { + self.lock.is_pair_of(&other.0) + } +} + impl, Item> SplitSink { fn poll_flush_slot( mut inner: Pin<&mut S>, @@ -142,3 +156,69 @@ impl fmt::Display for ReuniteError { #[cfg(feature = "std")] impl std::error::Error for ReuniteError {} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{sink::Sink, stream::StreamExt}; + use core::marker::PhantomData; + + struct NopStream { + phantom: PhantomData, + } + + impl Stream for NopStream { + type Item = Item; + + fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + todo!() + } + } + + impl Sink for NopStream { + type Error = (); + + fn poll_ready( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + todo!() + } + + fn start_send(self: Pin<&mut Self>, _item: Item) -> Result<(), Self::Error> { + todo!() + } + + fn poll_flush( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + todo!() + } + + fn poll_close( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + todo!() + } + } + + #[test] + fn test_pairing() { + let s1 = NopStream::<()> { phantom: PhantomData }; + let (sink1, stream1) = s1.split(); + assert!(sink1.is_pair_of(&stream1)); + assert!(stream1.is_pair_of(&sink1)); + + let s2 = NopStream::<()> { phantom: PhantomData }; + let (sink2, stream2) = s2.split(); + assert!(sink2.is_pair_of(&stream2)); + assert!(stream2.is_pair_of(&sink2)); + + assert!(!sink1.is_pair_of(&stream2)); + assert!(!stream1.is_pair_of(&sink2)); + assert!(!sink2.is_pair_of(&stream1)); + assert!(!stream2.is_pair_of(&sink1)); + } +} diff --git a/vendor/futures-util/src/stream/try_stream/mod.rs b/vendor/futures-util/src/stream/try_stream/mod.rs index 5d5702f36..7b55444b3 100644 --- a/vendor/futures-util/src/stream/try_stream/mod.rs +++ b/vendor/futures-util/src/stream/try_stream/mod.rs @@ -89,10 +89,10 @@ mod try_flatten; #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_flatten::TryFlatten; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod try_flatten_unordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_flatten_unordered::TryFlattenUnordered; @@ -133,26 +133,26 @@ mod try_take_while; #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_take_while::TryTakeWhile; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod try_buffer_unordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_buffer_unordered::TryBufferUnordered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod try_buffered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_buffered::TryBuffered; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] mod try_for_each_concurrent; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::try_for_each_concurrent::TryForEachConcurrent; @@ -551,7 +551,7 @@ pub trait TryStreamExt: TryStream { /// assert_eq!(Err(oneshot::Canceled), fut.await); /// # }) /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn try_for_each_concurrent( self, @@ -827,7 +827,7 @@ pub trait TryStreamExt: TryStream { /// assert_eq!(values, vec![Ok(1), Ok(2), Ok(4), Err(3), Err(5)]); /// # }); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn try_flatten_unordered(self, limit: impl Into>) -> TryFlattenUnordered where @@ -1029,7 +1029,7 @@ pub trait TryStreamExt: TryStream { /// assert_eq!(buffered.next().await, Some(Err("error in the stream"))); /// # Ok::<(), Box>(()) }).unwrap(); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered where @@ -1105,7 +1105,7 @@ pub trait TryStreamExt: TryStream { /// assert_eq!(buffered.next().await, Some(Err("error in the stream"))); /// # Ok::<(), Box>(()) }).unwrap(); /// ``` - #[cfg(not(futures_no_atomic_cas))] + #[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] fn try_buffered(self, n: usize) -> TryBuffered where diff --git a/vendor/futures-util/src/stream/try_stream/try_any.rs b/vendor/futures-util/src/stream/try_stream/try_any.rs index 15adb3097..55e876be0 100644 --- a/vendor/futures-util/src/stream/try_stream/try_any.rs +++ b/vendor/futures-util/src/stream/try_stream/try_any.rs @@ -7,7 +7,7 @@ use futures_core::task::{Context, Poll}; use pin_project_lite::pin_project; pin_project! { - /// Future for the [`any`](super::StreamExt::any) method. + /// Future for the [`try_any`](super::TryStreamExt::try_any) method. #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct TryAny { #[pin] diff --git a/vendor/futures-util/src/stream/unfold.rs b/vendor/futures-util/src/stream/unfold.rs index 7d8ef6bab..2f48cccb4 100644 --- a/vendor/futures-util/src/stream/unfold.rs +++ b/vendor/futures-util/src/stream/unfold.rs @@ -36,7 +36,7 @@ use pin_project_lite::pin_project; /// let stream = stream::unfold(0, |state| async move { /// if state <= 2 { /// let next_state = state + 1; -/// let yielded = state * 2; +/// let yielded = state * 2; /// Some((yielded, next_state)) /// } else { /// None diff --git a/vendor/futures-util/src/task/mod.rs b/vendor/futures-util/src/task/mod.rs index 3ed4bfada..7a9e993e5 100644 --- a/vendor/futures-util/src/task/mod.rs +++ b/vendor/futures-util/src/task/mod.rs @@ -18,19 +18,22 @@ pub use futures_task::{FutureObj, LocalFutureObj, LocalSpawn, Spawn, SpawnError, pub use futures_task::noop_waker; pub use futures_task::noop_waker_ref; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use futures_task::ArcWake; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use futures_task::waker; -#[cfg(not(futures_no_atomic_cas))] +#[cfg_attr(target_os = "none", cfg(target_has_atomic = "ptr"))] #[cfg(feature = "alloc")] pub use futures_task::{waker_ref, WakerRef}; -#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] +#[cfg_attr( + target_os = "none", + cfg(any(target_has_atomic = "ptr", feature = "portable-atomic")) +)] pub use futures_core::task::__internal::AtomicWaker; mod spawn; diff --git a/vendor/futures/.cargo-checksum.json b/vendor/futures/.cargo-checksum.json index d50aae8b4..af4968683 100644 --- a/vendor/futures/.cargo-checksum.json +++ b/vendor/futures/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"9162f9effcecfa23c06e5908fb47f0e818cff072b39b8c5bb22867144297d63e","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"842d0b8a539ab13ba2b9863cd8fb27da4fc7e9def1aefeb21db5aa04269b1e34","src/lib.rs":"bb07f533ba89a36c0385b57de17d51bf23ccab9e13e00ec812a74f376df15930","tests/_require_features.rs":"5ad24019430b498addfc1fd853e955c7b646d78d0727a8ca29f586c9aab45cff","tests/async_await_macros.rs":"87863f5b73217d727a4789d69229ab5dd85252b8e76a1aca0220feb98a0922af","tests/auto_traits.rs":"bff7c984267a9ec98d5549c971623e7d658fc6f26fd78cfcb2630838b73e46d0","tests/bilock.rs":"bd0bf617352528f686b3fbb1847f4da9f6fe351e456e0bdce888bc738311fa83","tests/compat.rs":"1449926cc046d2ae9f86a263efd9353ca8e174ea546c083b360136c5a2aef1d1","tests/eager_drop.rs":"dc25d067207c06bbe094752d70bf161e206f00e162ffa3219583c8b4eb0816a1","tests/eventual.rs":"9050809e5196d0870a3ee2a268a5b4b398739b01617e1e317a673ac0660974cf","tests/future_abortable.rs":"4c81607472a85c5d87a5fe8a510a24cf1e8793fedf7f6cd6741ba1efd66615cd","tests/future_basic_combinators.rs":"4508c1250b85a4f749b7261bbd0ba728d3970e7ba277e84a006e76cf068fb54f","tests/future_fuse.rs":"bb63141f1486e755d0cdea1d93e302ad864a2186aa5287f909a0b3a922e82065","tests/future_inspect.rs":"9c03ceb770ce04fe9fd88a3489362642a0e34ae86a7b4958703e89e8b7a1ecf4","tests/future_join.rs":"f59d7b948df7019e52f902ca7aef17f89ad26582bd1902d520ba99f6f61ba508","tests/future_join_all.rs":"6adacfca4d33a769dbe72fd04c54b49580ecd7a9994a185cfe97dd7a2b55c298","tests/future_obj.rs":"a6aae88a194dc7d3bb961c20db78f180a01796cf7ea4bf106da98c40d89ed36d","tests/future_select_all.rs":"4cefc84d6b7ae2cf0007912cd0325fff6b926a4c26310e7b14a21868de61616f","tests/future_select_ok.rs":"1cabd03268641e1ac42b880344528bad73e3aeb6d6a8a141e652f339dd40184b","tests/future_shared.rs":"4f2cba1e74dacc4fc6b92eef04700df832533efe4fe6a392e3fd0f655b5b8450","tests/future_try_flatten_stream.rs":"aa4542b5d88f62522b736fac4567613081df45ad3eb54b0b659cdadc9409c4db","tests/future_try_join_all.rs":"cca2c5a3b42fe4bf9705301cd1450b30a3822736c5c09793eee06b28ce686a19","tests/io_buf_reader.rs":"1d60479224d5aa9378d4aed6246362b08a823ee7c9977f6a5e44fce7c40116be","tests/io_buf_writer.rs":"8f7a78ab2955d2beb69d0881321d4191235540aef6448e875e7f76a2ffc55b89","tests/io_cursor.rs":"cba5a7b968b9f816ac33316ce1e4da67cb320aa5a21332c0f9a45694fa445dd7","tests/io_line_writer.rs":"5b1140de776a721a677911496daa4e7956cc52cc08838d593ab300a93e0d7984","tests/io_lines.rs":"72a310c885591793ed724d0aa2158ac2c9d1af22de417044d96b714f78317586","tests/io_read.rs":"e0a8fa9b27e042f03c9fe14e8f0f329a67e24afad1ce40b906a1ab4d2abef23a","tests/io_read_exact.rs":"42049cd67589992dc09764ffb3836c475115b26dee441fd4cc7e847b2d166667","tests/io_read_line.rs":"f360c30c32fc8c73b371281e86c3f1095da7ef23b702debb30d335046dc77dac","tests/io_read_to_end.rs":"ea3e961e39a0b92930bded05e8ba26e4902461ab53818843d40fae8065b1a803","tests/io_read_to_string.rs":"824921601ac49f15b9a0b349c900f9cc9081cf2646e6a86f443166f841f1320e","tests/io_read_until.rs":"36d9a98149b2410894121ccba49e5134e3209826b2225acfc787016cea2bc92a","tests/io_window.rs":"0d18334b1eb35f5e93099e19c0cab22abe5971d8531176b81345fc89d07692a8","tests/io_write.rs":"701032ff3d5a6e6a3d8cb4e373d1c93e4708f2e5ee0a6742fa626f27b6094b4d","tests/lock_mutex.rs":"eb47121b842096353165b1444bf679a2df0103b181f811b40042f5c3f1d00c73","tests/macro_comma_support.rs":"627024ccadfe95194469d5bae2cc29b897b0118a664d7222408a2e234a10e939","tests/object_safety.rs":"9d047190387ed8334113687003c23407c80c858411f5ec7d5c505500f9639dfc","tests/oneshot.rs":"2109a8b3b524f4b36be9fb100f9b8c0d38bbd38d51716adcafdb65994b4a81d6","tests/ready_queue.rs":"6380025061025c27cb3b521df9520f169c7aa8e1802b881d539023bb4651744a","tests/recurse.rs":"b01b3d73b69ad90a767d297f974dac435817c39e12556fa6a3e6c725dd84f706","tests/sink.rs":"d9b2ddcbbb6af9e36d057db97dbba233547be645a7e4901b2842a4671f9f0212","tests/sink_fanout.rs":"67ab58422040308353955311f75222e55378e4cc34557c7b34140bd20c259132","tests/stream.rs":"6cb49d74e63a6264b2862d1020517251262010441a9f3e1eb0b3a83c908b705b","tests/stream_abortable.rs":"60052b83b5eeb2395b77bc213f35098d2d5880529f0d83884582a8bbff78b139","tests/stream_buffer_unordered.rs":"143ee19056b9ee9e480903cf4a1b00da7d4e528c5804569bf8c40869e6ac6eed","tests/stream_catch_unwind.rs":"5cdaaf70436c49d3a7107bdc5547ddb8757c3d2057635aded70e485d0cb9cbfc","tests/stream_futures_ordered.rs":"f9083bd8cfa86620c51abffc390564432022b5c8d15a7cba15dd5cb53ae99dd6","tests/stream_futures_unordered.rs":"c888112d760db856e4d9191a2a6a3aa4a757d65e47a12fcd16fc5be7bf0b3e78","tests/stream_into_async_read.rs":"00ecb18289ebc8f46ea0cf43e0dce0631d7698bd1303a7bcd84d0addc9d8b645","tests/stream_peekable.rs":"c0addb0c510e13183ba3d6102633b75a9223651ae80a64542e913c712fe69a30","tests/stream_select_all.rs":"3a9045754939da5b30305e78f0571d79a03aaa77030c6ccf82225f076e9843c9","tests/stream_select_next_some.rs":"871edcee3ffc16c697251b29c9ba500aa4e3e503aa738748d7392e3462c82dce","tests/stream_split.rs":"074e9c9b51b6f7ea83d77347b5a0c8d414ca32b90445fec9b85f7f4cd2a6049f","tests/stream_try_stream.rs":"62ac8242ce3311930d352ad96573208d0df9ea5bc4e37d6edafabc7b3291ef88","tests/stream_unfold.rs":"7c6fbd10c782828793cbe1eb347ec776d99b185dad498e886f7161da76f76880","tests/task_arc_wake.rs":"5a49d074d1d5d9d5ec383dcd9a3868f636c1d7e34662e2573e467948db126206","tests/task_atomic_waker.rs":"8e85b4bc1360788646a52633dfe896d852773d6b482f81626cf534b97b7d937a","tests/test_macro.rs":"a46a946169c342c576936b60909165a50b94350501280ed9bba89d365af69287","tests/try_join.rs":"65f282f8351bd9a74642f2465c7aaf72ee7097002920989f156d60271652549e","tests_disabled/all.rs":"ddcd8fefb0d4a4a91a78328e7e652c35f93dc3669639d76fa0f56452b51abc23","tests_disabled/stream.rs":"8a615a472a35053d12b269d40fe244dfb3ba66fb78d217323aa2be177d5a111e"},"package":"da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335"} \ No newline at end of file +{"files":{"Cargo.toml":"e3980e49276114211a72785f2fd7fae0fe08f0849c6aaf8973d8b5ab5c9f9e6c","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"842d0b8a539ab13ba2b9863cd8fb27da4fc7e9def1aefeb21db5aa04269b1e34","src/lib.rs":"bb07f533ba89a36c0385b57de17d51bf23ccab9e13e00ec812a74f376df15930","tests/_require_features.rs":"5ad24019430b498addfc1fd853e955c7b646d78d0727a8ca29f586c9aab45cff","tests/async_await_macros.rs":"87863f5b73217d727a4789d69229ab5dd85252b8e76a1aca0220feb98a0922af","tests/auto_traits.rs":"bff7c984267a9ec98d5549c971623e7d658fc6f26fd78cfcb2630838b73e46d0","tests/bilock.rs":"bd0bf617352528f686b3fbb1847f4da9f6fe351e456e0bdce888bc738311fa83","tests/compat.rs":"1449926cc046d2ae9f86a263efd9353ca8e174ea546c083b360136c5a2aef1d1","tests/eager_drop.rs":"dc25d067207c06bbe094752d70bf161e206f00e162ffa3219583c8b4eb0816a1","tests/eventual.rs":"9050809e5196d0870a3ee2a268a5b4b398739b01617e1e317a673ac0660974cf","tests/future_abortable.rs":"4c81607472a85c5d87a5fe8a510a24cf1e8793fedf7f6cd6741ba1efd66615cd","tests/future_basic_combinators.rs":"4508c1250b85a4f749b7261bbd0ba728d3970e7ba277e84a006e76cf068fb54f","tests/future_fuse.rs":"bb63141f1486e755d0cdea1d93e302ad864a2186aa5287f909a0b3a922e82065","tests/future_inspect.rs":"9c03ceb770ce04fe9fd88a3489362642a0e34ae86a7b4958703e89e8b7a1ecf4","tests/future_join.rs":"f59d7b948df7019e52f902ca7aef17f89ad26582bd1902d520ba99f6f61ba508","tests/future_join_all.rs":"6adacfca4d33a769dbe72fd04c54b49580ecd7a9994a185cfe97dd7a2b55c298","tests/future_obj.rs":"a6aae88a194dc7d3bb961c20db78f180a01796cf7ea4bf106da98c40d89ed36d","tests/future_select_all.rs":"4cefc84d6b7ae2cf0007912cd0325fff6b926a4c26310e7b14a21868de61616f","tests/future_select_ok.rs":"1cabd03268641e1ac42b880344528bad73e3aeb6d6a8a141e652f339dd40184b","tests/future_shared.rs":"4f2cba1e74dacc4fc6b92eef04700df832533efe4fe6a392e3fd0f655b5b8450","tests/future_try_flatten_stream.rs":"aa4542b5d88f62522b736fac4567613081df45ad3eb54b0b659cdadc9409c4db","tests/future_try_join_all.rs":"cca2c5a3b42fe4bf9705301cd1450b30a3822736c5c09793eee06b28ce686a19","tests/io_buf_reader.rs":"1d60479224d5aa9378d4aed6246362b08a823ee7c9977f6a5e44fce7c40116be","tests/io_buf_writer.rs":"8f7a78ab2955d2beb69d0881321d4191235540aef6448e875e7f76a2ffc55b89","tests/io_cursor.rs":"cba5a7b968b9f816ac33316ce1e4da67cb320aa5a21332c0f9a45694fa445dd7","tests/io_line_writer.rs":"5b1140de776a721a677911496daa4e7956cc52cc08838d593ab300a93e0d7984","tests/io_lines.rs":"72a310c885591793ed724d0aa2158ac2c9d1af22de417044d96b714f78317586","tests/io_read.rs":"e0a8fa9b27e042f03c9fe14e8f0f329a67e24afad1ce40b906a1ab4d2abef23a","tests/io_read_exact.rs":"42049cd67589992dc09764ffb3836c475115b26dee441fd4cc7e847b2d166667","tests/io_read_line.rs":"f360c30c32fc8c73b371281e86c3f1095da7ef23b702debb30d335046dc77dac","tests/io_read_to_end.rs":"ea3e961e39a0b92930bded05e8ba26e4902461ab53818843d40fae8065b1a803","tests/io_read_to_string.rs":"824921601ac49f15b9a0b349c900f9cc9081cf2646e6a86f443166f841f1320e","tests/io_read_until.rs":"36d9a98149b2410894121ccba49e5134e3209826b2225acfc787016cea2bc92a","tests/io_window.rs":"0d18334b1eb35f5e93099e19c0cab22abe5971d8531176b81345fc89d07692a8","tests/io_write.rs":"701032ff3d5a6e6a3d8cb4e373d1c93e4708f2e5ee0a6742fa626f27b6094b4d","tests/lock_mutex.rs":"eb47121b842096353165b1444bf679a2df0103b181f811b40042f5c3f1d00c73","tests/macro_comma_support.rs":"627024ccadfe95194469d5bae2cc29b897b0118a664d7222408a2e234a10e939","tests/object_safety.rs":"9d047190387ed8334113687003c23407c80c858411f5ec7d5c505500f9639dfc","tests/oneshot.rs":"2109a8b3b524f4b36be9fb100f9b8c0d38bbd38d51716adcafdb65994b4a81d6","tests/ready_queue.rs":"6380025061025c27cb3b521df9520f169c7aa8e1802b881d539023bb4651744a","tests/recurse.rs":"b01b3d73b69ad90a767d297f974dac435817c39e12556fa6a3e6c725dd84f706","tests/sink.rs":"d9b2ddcbbb6af9e36d057db97dbba233547be645a7e4901b2842a4671f9f0212","tests/sink_fanout.rs":"67ab58422040308353955311f75222e55378e4cc34557c7b34140bd20c259132","tests/stream.rs":"6cb49d74e63a6264b2862d1020517251262010441a9f3e1eb0b3a83c908b705b","tests/stream_abortable.rs":"60052b83b5eeb2395b77bc213f35098d2d5880529f0d83884582a8bbff78b139","tests/stream_buffer_unordered.rs":"143ee19056b9ee9e480903cf4a1b00da7d4e528c5804569bf8c40869e6ac6eed","tests/stream_catch_unwind.rs":"5cdaaf70436c49d3a7107bdc5547ddb8757c3d2057635aded70e485d0cb9cbfc","tests/stream_futures_ordered.rs":"f9083bd8cfa86620c51abffc390564432022b5c8d15a7cba15dd5cb53ae99dd6","tests/stream_futures_unordered.rs":"e374b97bed3ceb3f584bfccb37128383e829680c8d679aa44bf93c878a4137e0","tests/stream_into_async_read.rs":"00ecb18289ebc8f46ea0cf43e0dce0631d7698bd1303a7bcd84d0addc9d8b645","tests/stream_peekable.rs":"c0addb0c510e13183ba3d6102633b75a9223651ae80a64542e913c712fe69a30","tests/stream_select_all.rs":"3a9045754939da5b30305e78f0571d79a03aaa77030c6ccf82225f076e9843c9","tests/stream_select_next_some.rs":"871edcee3ffc16c697251b29c9ba500aa4e3e503aa738748d7392e3462c82dce","tests/stream_split.rs":"074e9c9b51b6f7ea83d77347b5a0c8d414ca32b90445fec9b85f7f4cd2a6049f","tests/stream_try_stream.rs":"62ac8242ce3311930d352ad96573208d0df9ea5bc4e37d6edafabc7b3291ef88","tests/stream_unfold.rs":"7c6fbd10c782828793cbe1eb347ec776d99b185dad498e886f7161da76f76880","tests/task_arc_wake.rs":"5a49d074d1d5d9d5ec383dcd9a3868f636c1d7e34662e2573e467948db126206","tests/task_atomic_waker.rs":"8e85b4bc1360788646a52633dfe896d852773d6b482f81626cf534b97b7d937a","tests/test_macro.rs":"a46a946169c342c576936b60909165a50b94350501280ed9bba89d365af69287","tests/try_join.rs":"65f282f8351bd9a74642f2465c7aaf72ee7097002920989f156d60271652549e","tests_disabled/all.rs":"ddcd8fefb0d4a4a91a78328e7e652c35f93dc3669639d76fa0f56452b51abc23","tests_disabled/stream.rs":"8a615a472a35053d12b269d40fe244dfb3ba66fb78d217323aa2be177d5a111e"},"package":"645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"} \ No newline at end of file diff --git a/vendor/futures/Cargo.toml b/vendor/futures/Cargo.toml index f766861c7..5272299be 100644 --- a/vendor/futures/Cargo.toml +++ b/vendor/futures/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "futures" -version = "0.3.29" +version = "0.3.30" description = """ An implementation of futures and streams featuring zero allocations, composability, and iterator-like interfaces. @@ -47,33 +47,33 @@ features = [ ] [dependencies.futures-channel] -version = "0.3.29" +version = "0.3.30" features = ["sink"] default-features = false [dependencies.futures-core] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-executor] -version = "0.3.29" +version = "0.3.30" optional = true default-features = false [dependencies.futures-io] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-sink] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-task] -version = "0.3.29" +version = "0.3.30" default-features = false [dependencies.futures-util] -version = "0.3.29" +version = "0.3.30" features = ["sink"] default-features = false diff --git a/vendor/futures/tests/stream_futures_unordered.rs b/vendor/futures/tests/stream_futures_unordered.rs index b56828047..7bdf5432c 100644 --- a/vendor/futures/tests/stream_futures_unordered.rs +++ b/vendor/futures/tests/stream_futures_unordered.rs @@ -381,3 +381,28 @@ fn clear() { tasks.clear(); assert!(!tasks.is_terminated()); } + +// https://github.com/rust-lang/futures-rs/issues/2529#issuecomment-997290279 +#[test] +fn clear_in_loop() { + const N: usize = + if cfg!(miri) || option_env!("QEMU_LD_PREFIX").is_some() { 100 } else { 10_000 }; + futures::executor::block_on(async { + async fn task() { + let (s, r) = oneshot::channel(); + std::thread::spawn(|| { + std::thread::sleep(std::time::Duration::from_micros(100)); + let _ = s.send(()); + }); + r.await.unwrap() + } + let mut futures = FuturesUnordered::new(); + for _ in 0..N { + for _ in 0..24 { + futures.push(task()); + } + let _ = futures.next().await; + futures.clear(); + } + }); +} diff --git a/vendor/getrandom/.cargo-checksum.json b/vendor/getrandom/.cargo-checksum.json index fc46f728c..fc62f6bd6 100644 --- a/vendor/getrandom/.cargo-checksum.json +++ b/vendor/getrandom/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"fe1a0dc50ac5c7bdd60591f6d1027072c68dcf142131945f782169c74b9e8188","Cargo.toml":"5506345251dee6e156a3d0072d2b3b6bc6894d8cf91adb85fefe211741e7c7f9","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"e5858de17fc28ec7a3a62cbefedd301ace8a85291d0aad5cb416824d1b5abadd","SECURITY.md":"816ea79f8c7937888ab5a972a1efb270c4bada028b448953a195359fe11d526e","benches/buffer.rs":"242f56eaeecd1d0a0f6f9419d1bf312b8d211215355022bd4aef5e5e0f53e2a5","src/3ds.rs":"e41b653723740ed89fa68f495b64125786e8dec002e3556d164c5795db62ea50","src/apple-other.rs":"3ff0abc72786a2ac063cdc5df4d18cc53dc493cd68fcb33734cf40cfdbb8f644","src/bsd_arandom.rs":"cfa0627a6b4d1f37065d415972ab813bf1c9f43979d2ff9440c92a53868123aa","src/custom.rs":"a256bd6e7e9bb560803f23a36bd437859ea8a9d8ec92608930b94b33e7314c64","src/dragonfly.rs":"047008e742a7a8050e61ed9626b9f4146dfaa0675e11d6f3680eb8af498d9a6d","src/emscripten.rs":"e0b3b44b52f54454ec3e0a9e7c5222003369d9d1575cc0652e3e7cbe1b3b6da7","src/error.rs":"ff09a7e02d7aff3e45eca6bbef6c686cc46f3c2371a0897a856e4dec4b942e46","src/error_impls.rs":"9c34832ebb99cd5e31bc5c8ffc5beb5b3fa6f7ff0226aaa1cdf8e10e6d64b324","src/espidf.rs":"915ca14cbf9299de51a3c67f34fdd252461d6545f33a7232dfb7fa247ccc0209","src/fuchsia.rs":"d307b15db9f2d67b43050ae6027779a6eb2b8a69e1e89931b55b767aa2622250","src/hermit.rs":"18fdd7917c73f8b16aa82b18003948d32f9b314da10e16ef9cd2fa077b17af00","src/hurd.rs":"1053908c4eaeae9e44078c9509aa80268caa1d66642b7c6a9a80f5b9f0e63fb0","src/js.rs":"c4cd60bcfe63f8affe947773197e288536ab205a73001059f39fc2e5688e98b6","src/lib.rs":"178b4b1dae3a41721f365ea5a4eda3f5b936b310afa4431935968e96edac3120","src/linux_android.rs":"e5f9e579bbde254fcab8f6b79b893d6b74054e023b21c56a3b2b21d8f4b4d825","src/macos.rs":"8f51e095906e751b68e837bfc63cc02b243e1698b66353566ccba507c81ddad3","src/openbsd.rs":"f6fd0aa74f704335a7e0532bf5e61a7ca90b0cbc398a9c01a0fd891b6fabca0c","src/rdrand.rs":"846ac7b8380a05a50e0592dca57338beb1634c0efc878d6d1e9421be3469a744","src/solaris_illumos.rs":"7209c8b1172fc4df5ad8a79f165556b403cdd90b9eb5f7f7f9ec97bf06f4d8d7","src/solid.rs":"58919109faf06e6d546f75f785d78d6c055e1f95110d1791d9191d1e404f1e20","src/use_file.rs":"ecfc1011b4a9c962ae9b4b75ca5149a4ee83cb0951a80224ce5417046ce11717","src/util.rs":"580fb7c4e41eb6007def8626e019829c22a63980fa4da68a1adef687c57953a2","src/util_libc.rs":"48c1fe251958c6c57b7c93d83f3648d97034feeee0d5cda0cbe7bc0ee0a73fca","src/vita.rs":"ecfa9d347ad5c480ba8ff80a9de968ae060ffb435f1e95777ee413642e62e50a","src/vxworks.rs":"984726b6dd9638a38ceda83124683419b9d69a9041ad9117a470eaec5b386ce4","src/wasi.rs":"229a58af3f13a629571fb83a0c11ef0ed696ba7a44ee2e811c9f348a19b2fb69","src/windows.rs":"dd3d833979fb6b96c04b84dbf8461d5fc819bde93ad9dc26bd0f6c282656c733","tests/common/mod.rs":"b9a36043d71963ba43a9e2899ba8eea80ff9f3284d243d9b9b9f941afa4f4aa4","tests/custom.rs":"1e944ae523b62dba53fe3daf1b964a2498c8fdd21dfa7afe53781bff2fcf276e","tests/normal.rs":"9e1c4b1e468a09ed0225370dfb6608f8b8135e0fabb09bbc1a718105164aade6","tests/rdrand.rs":"156676b57f1e6bd4d66d85b8a999f1cf7a8fb749a10b8b2b4dbbcf803e8c4cd3"},"package":"fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"} \ No newline at end of file +{"files":{"CHANGELOG.md":"b92c1150dd0e321d4b57151949cb079e0fff6cadb068ed7116ff57e8ffba547b","Cargo.toml":"e063c2ea7cdaf007c46bf862e0048b738f6a9619cfb2a02b9b15e0b600bb3ece","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"42fa16951ce7f24b5a467a40e5b449a1d41e662f97ca779864f053f39e097737","README.md":"543f0efa922ff55d3cdc1c96a188dff669f57a2ff3b7dfa0c95368b8e646b5dd","SECURITY.md":"816ea79f8c7937888ab5a972a1efb270c4bada028b448953a195359fe11d526e","benches/buffer.rs":"242f56eaeecd1d0a0f6f9419d1bf312b8d211215355022bd4aef5e5e0f53e2a5","src/3ds.rs":"dae5b84328b063a3750a67e5086db530b905a661b152181f0d6b4d63e72b70e2","src/apple-other.rs":"75f2c3319068e06ec27135d516953ab645cc7c45033f045cba44136236ef5601","src/bsd_arandom.rs":"2ace9473afc3df95594884d87d8f484cf141c9d01f2c22ece2bb1118b73d51bb","src/custom.rs":"3fb6b72a45f1d7467bdcb1508441d41c0c7cd30bcc581c5991cdd404004d4345","src/dragonfly.rs":"4cffb7af2b62d515f28790b906f0293b44af1d75b23c87fa9e50d5ef99bfa02c","src/emscripten.rs":"e0b3b44b52f54454ec3e0a9e7c5222003369d9d1575cc0652e3e7cbe1b3b6da7","src/error.rs":"ab5b82ddb8304e8ad75d905d7dc5ba8deec92096930e81e87d7a28f3da382dee","src/error_impls.rs":"668a94c2086ad280c00d7a8e515cbc358e83a87249e65a0d41decdd6ae8c3ab0","src/espidf.rs":"50f70136fe46f9fe9a728aa7881cdc8144f430620168cf42519c2666a8edc11f","src/fuchsia.rs":"535ed84250cfe8f176494eba226d1c1df9687b5c30cf52d5949f56a591947656","src/hermit.rs":"c9d9d5c78e0e435c2678ef43d1296aef885fd62957d6b454d758ca475cd4e544","src/hurd.rs":"c0f807d7cc4ae6a5e0b1800bbd76639270503596c8f3cade2e59bf62e0bc7a89","src/js.rs":"4306b7a49441e0da2a0737f92f56d3258ddcd1566ec3aea4a4f4a865bbf0ff87","src/lazy.rs":"7519937544e9af04ce008452a65f7441adca7742d89e6afd373c7cede8828ad9","src/lib.rs":"c0c865fdadae4f7bf06a056bd2e42b193d24c1166fd220c57aca19cb96a685a5","src/linux_android.rs":"7bd8293d45f9897ee3a4a362c92b0570bd8c6e9f430a9cee8517fbc019e09114","src/macos.rs":"6e4f8377c7ad3c5dea1816a7bac22a3bb5ba85260aee71d027e32cd6602cb2dd","src/openbsd.rs":"f22ffe151d1797785c32e165459e15a34643f8a441c12da736e8a22d7103db6e","src/rdrand.rs":"ffbe1bfb8f5b30a95f462fa85db07e251f63248c6c0daf3b5f586034cedfa976","src/solaris_illumos.rs":"2f0d03956d042249aed1c2f02fc9ad389ab4dcd1dfe5c5e7c189830545497259","src/solid.rs":"a5a6e4b2b43400548b36035b9a513e70ec17809d521757e7228d2214352d24ed","src/use_file.rs":"1d7cf9370697ae69d29792d0a50ae972b093676536eb0529d9a801efbecbb096","src/util.rs":"e2c1b86ea97ca5c61d562182890cbe24c7eaa37ff8945c17fcfa665b767da1b0","src/util_libc.rs":"f586159c1fb87db093e89eac29fc2a144c6c070d1a6ccb3c3261d810ba88d6b1","src/vita.rs":"97dc7ddd706c0c64273cc5b2a6c9cab47c221921908809a9f9a8b72a1753ce90","src/vxworks.rs":"3c132cd52df3a8cf903f430ce90d3432c4b4bb99bf069f5546dee43f4f10a555","src/wasi.rs":"45b95d98766cfdc0495cfe5da6c3b63e99dda34c334deee779cf146a29350344","src/windows.rs":"7e3e73fb29a7e2748d32344d1bb9327603c6d78eb0fc5e62f50c6fa93b648c60","tests/common/mod.rs":"b9a36043d71963ba43a9e2899ba8eea80ff9f3284d243d9b9b9f941afa4f4aa4","tests/custom.rs":"1e944ae523b62dba53fe3daf1b964a2498c8fdd21dfa7afe53781bff2fcf276e","tests/normal.rs":"9e1c4b1e468a09ed0225370dfb6608f8b8135e0fabb09bbc1a718105164aade6","tests/rdrand.rs":"fcf3f78e3078e1b262d0efae8f3c4a730f3fbf68df656fceb78e22ee4cc98990"},"package":"190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"} \ No newline at end of file diff --git a/vendor/getrandom/CHANGELOG.md b/vendor/getrandom/CHANGELOG.md index 7b1f46aab..a283d3807 100644 --- a/vendor/getrandom/CHANGELOG.md +++ b/vendor/getrandom/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.12] - 2024-01-09 +### Fixed +- Custom backend for targets without atomics [#385] + +### Changed +- Improve robustness of the Hermit backend and `sys_fill_exact` [#386] +- Raise minimum supported Apple OS versions to macOS 10.12 and iOS 10 [#388] + +### Added +- Document platform support policy [#387] + +[#385]: https://github.com/rust-random/getrandom/pull/385 +[#386]: https://github.com/rust-random/getrandom/pull/386 +[#387]: https://github.com/rust-random/getrandom/pull/387 +[#388]: https://github.com/rust-random/getrandom/pull/388 + ## [0.2.11] - 2023-11-08 ### Added - GNU/Hurd support [#370] @@ -403,6 +419,7 @@ Publish initial implementation. ## [0.0.0] - 2019-01-19 Publish an empty template library. +[0.2.12]: https://github.com/rust-random/getrandom/compare/v0.2.11...v0.2.12 [0.2.11]: https://github.com/rust-random/getrandom/compare/v0.2.10...v0.2.11 [0.2.10]: https://github.com/rust-random/getrandom/compare/v0.2.9...v0.2.10 [0.2.9]: https://github.com/rust-random/getrandom/compare/v0.2.8...v0.2.9 diff --git a/vendor/getrandom/Cargo.toml b/vendor/getrandom/Cargo.toml index a4c3946b7..5d94d813b 100644 --- a/vendor/getrandom/Cargo.toml +++ b/vendor/getrandom/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "getrandom" -version = "0.2.11" +version = "0.2.12" authors = ["The Rand Project Developers"] exclude = [".*"] description = "A small cross-platform library for retrieving random data from system source" diff --git a/vendor/getrandom/LICENSE-MIT b/vendor/getrandom/LICENSE-MIT index d93b5baf3..8ca28a1a0 100644 --- a/vendor/getrandom/LICENSE-MIT +++ b/vendor/getrandom/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright 2018 Developers of the Rand project +Copyright (c) 2018-2024 The rust-random Project Developers Copyright (c) 2014 The Rust Project Developers Permission is hereby granted, free of charge, to any diff --git a/vendor/getrandom/README.md b/vendor/getrandom/README.md index c43ad42eb..b4b5a2b56 100644 --- a/vendor/getrandom/README.md +++ b/vendor/getrandom/README.md @@ -54,11 +54,28 @@ crate features, WASM support and Custom RNGs see the This crate requires Rust 1.36.0 or later. -# License +## Platform Support + +This crate generally supports the same operating system and platform versions that the Rust standard library does. +Additional targets may be supported using pluggable custom implementations. + +This means that as Rust drops support for old versions of operating systems (such as old Linux kernel versions, Android API levels, etc) +in stable releases, `getrandom` may create new patch releases (`0.N.x`) that remove support for outdated platform versions. + +## License The `getrandom` library is distributed under either of - * [Apache License, Version 2.0](LICENSE-APACHE) - * [MIT license](LICENSE-MIT) + * [Apache License, Version 2.0][LICENSE-APACHE] + * [MIT license][LICENSE-MIT] at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + +[LICENSE-APACHE]: https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE +[LICENSE-MIT]: https://github.com/rust-random/getrandom/blob/master/LICENSE-MIT diff --git a/vendor/getrandom/src/3ds.rs b/vendor/getrandom/src/3ds.rs index 87a32a1e8..a5aae77d1 100644 --- a/vendor/getrandom/src/3ds.rs +++ b/vendor/getrandom/src/3ds.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Nintendo 3DS use crate::util_libc::sys_fill_exact; use crate::Error; diff --git a/vendor/getrandom/src/apple-other.rs b/vendor/getrandom/src/apple-other.rs index 8f904859c..167d8cf0f 100644 --- a/vendor/getrandom/src/apple-other.rs +++ b/vendor/getrandom/src/apple-other.rs @@ -1,24 +1,21 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Implementation for iOS +//! Implementation for iOS, tvOS, and watchOS where `getentropy` is unavailable. use crate::Error; -use core::{ffi::c_void, mem::MaybeUninit, ptr::null}; +use core::{ffi::c_void, mem::MaybeUninit}; -#[link(name = "Security", kind = "framework")] +// libsystem contains the libc of Darwin, and every binary ends up linked against it either way. This +// makes it a more lightweight choice compared to `Security.framework`. extern "C" { - fn SecRandomCopyBytes(rnd: *const c_void, count: usize, bytes: *mut u8) -> i32; + // This RNG uses a thread-local CSPRNG to provide data, which is seeded by the operating system's root CSPRNG. + // Its the best option after `getentropy` on modern Darwin-based platforms that also avoids the + // high startup costs and linking of Security.framework. + // + // While its just an implementation detail, `Security.framework` just calls into this anyway. + fn CCRandomGenerateBytes(bytes: *mut c_void, size: usize) -> i32; } pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { - // Apple's documentation guarantees kSecRandomDefault is a synonym for NULL. - let ret = unsafe { SecRandomCopyBytes(null(), dest.len(), dest.as_mut_ptr() as *mut u8) }; - // errSecSuccess (from SecBase.h) is always zero. + let ret = unsafe { CCRandomGenerateBytes(dest.as_mut_ptr() as *mut c_void, dest.len()) }; + // kCCSuccess (from CommonCryptoError.h) is always zero. if ret != 0 { Err(Error::IOS_SEC_RANDOM) } else { diff --git a/vendor/getrandom/src/bsd_arandom.rs b/vendor/getrandom/src/bsd_arandom.rs index 5314c48f1..6e133d895 100644 --- a/vendor/getrandom/src/bsd_arandom.rs +++ b/vendor/getrandom/src/bsd_arandom.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for FreeBSD and NetBSD use crate::{ util_libc::{sys_fill_exact, Weak}, diff --git a/vendor/getrandom/src/custom.rs b/vendor/getrandom/src/custom.rs index 66e4256fa..8dc9cb796 100644 --- a/vendor/getrandom/src/custom.rs +++ b/vendor/getrandom/src/custom.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! An implementation which calls out to an externally defined function. use crate::{util::uninit_slice_fill_zero, Error}; use core::{mem::MaybeUninit, num::NonZeroU32}; diff --git a/vendor/getrandom/src/dragonfly.rs b/vendor/getrandom/src/dragonfly.rs index d3ef00aa9..ac4794cdd 100644 --- a/vendor/getrandom/src/dragonfly.rs +++ b/vendor/getrandom/src/dragonfly.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for DragonFly BSD use crate::{ use_file, diff --git a/vendor/getrandom/src/error.rs b/vendor/getrandom/src/error.rs index ab39a3c33..13c81c7af 100644 --- a/vendor/getrandom/src/error.rs +++ b/vendor/getrandom/src/error.rs @@ -1,10 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. use core::{fmt, num::NonZeroU32}; /// A small and `no_std` compatible error type @@ -35,7 +28,11 @@ impl Error { pub const UNSUPPORTED: Error = internal_error(0); /// The platform-specific `errno` returned a non-positive value. pub const ERRNO_NOT_POSITIVE: Error = internal_error(1); - /// Call to iOS [`SecRandomCopyBytes`](https://developer.apple.com/documentation/security/1399291-secrandomcopybytes) failed. + /// Encountered an unexpected situation which should not happen in practice. + pub const UNEXPECTED: Error = internal_error(2); + /// Call to [`CCRandomGenerateBytes`](https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60074/include/CommonRandom.h.auto.html) failed + /// on iOS, tvOS, or waatchOS. + // TODO: Update this constant name in the next breaking release. pub const IOS_SEC_RANDOM: Error = internal_error(3); /// Call to Windows [`RtlGenRandom`](https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom) failed. pub const WINDOWS_RTL_GEN_RANDOM: Error = internal_error(4); @@ -164,6 +161,7 @@ fn internal_desc(error: Error) -> Option<&'static str> { match error { Error::UNSUPPORTED => Some("getrandom: this target is not supported"), Error::ERRNO_NOT_POSITIVE => Some("errno: did not return a positive value"), + Error::UNEXPECTED => Some("unexpected situation"), Error::IOS_SEC_RANDOM => Some("SecRandomCopyBytes: iOS Security framework failure"), Error::WINDOWS_RTL_GEN_RANDOM => Some("RtlGenRandom: Windows system function failure"), Error::FAILED_RDRAND => Some("RDRAND: failed multiple times: CPU issue likely"), diff --git a/vendor/getrandom/src/error_impls.rs b/vendor/getrandom/src/error_impls.rs index 61f46d227..a7bffb897 100644 --- a/vendor/getrandom/src/error_impls.rs +++ b/vendor/getrandom/src/error_impls.rs @@ -1,10 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![cfg_attr(docsrs, doc(cfg(feature = "std")))] extern crate std; diff --git a/vendor/getrandom/src/espidf.rs b/vendor/getrandom/src/espidf.rs index d074dc4ce..7da5ca88e 100644 --- a/vendor/getrandom/src/espidf.rs +++ b/vendor/getrandom/src/espidf.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for ESP-IDF use crate::Error; use core::{ffi::c_void, mem::MaybeUninit}; diff --git a/vendor/getrandom/src/fuchsia.rs b/vendor/getrandom/src/fuchsia.rs index 5a135f343..11970685c 100644 --- a/vendor/getrandom/src/fuchsia.rs +++ b/vendor/getrandom/src/fuchsia.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Fuchsia Zircon use crate::Error; use core::mem::MaybeUninit; diff --git a/vendor/getrandom/src/hermit.rs b/vendor/getrandom/src/hermit.rs index 570b03d9a..c4f619417 100644 --- a/vendor/getrandom/src/hermit.rs +++ b/vendor/getrandom/src/hermit.rs @@ -1,5 +1,11 @@ +//! Implementation for Hermit use crate::Error; -use core::{cmp::min, mem::MaybeUninit, num::NonZeroU32}; +use core::{mem::MaybeUninit, num::NonZeroU32}; + +/// Minimum return value which we should get from syscalls in practice, +/// because Hermit uses positive `i32`s for error codes: +/// https://github.com/hermitcore/libhermit-rs/blob/main/src/errno.rs +const MIN_RET_CODE: isize = -(i32::MAX as isize); extern "C" { fn sys_read_entropy(buffer: *mut u8, length: usize, flags: u32) -> isize; @@ -8,14 +14,16 @@ extern "C" { pub fn getrandom_inner(mut dest: &mut [MaybeUninit]) -> Result<(), Error> { while !dest.is_empty() { let res = unsafe { sys_read_entropy(dest.as_mut_ptr() as *mut u8, dest.len(), 0) }; - if res < 0 { - // SAFETY: all Hermit error codes use i32 under the hood: - // https://github.com/hermitcore/libhermit-rs/blob/master/src/errno.rs - let code = unsafe { NonZeroU32::new_unchecked((-res) as u32) }; - return Err(code.into()); + // Positive `isize`s can be safely casted to `usize` + if res > 0 && (res as usize) <= dest.len() { + dest = &mut dest[res as usize..]; + } else { + let err = match res { + MIN_RET_CODE..=-1 => NonZeroU32::new(-res as u32).unwrap().into(), + _ => Error::UNEXPECTED, + }; + return Err(err); } - let len = min(res as usize, dest.len()); - dest = &mut dest[len..]; } Ok(()) } diff --git a/vendor/getrandom/src/hurd.rs b/vendor/getrandom/src/hurd.rs index 842b9bc48..472a7d86b 100644 --- a/vendor/getrandom/src/hurd.rs +++ b/vendor/getrandom/src/hurd.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for GNU/Hurd use crate::util_libc::sys_fill_exact; use crate::Error; diff --git a/vendor/getrandom/src/js.rs b/vendor/getrandom/src/js.rs index d03128226..e5428f50d 100644 --- a/vendor/getrandom/src/js.rs +++ b/vendor/getrandom/src/js.rs @@ -1,10 +1,4 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. +//! Implementation for WASM based on Web and Node.js use crate::Error; extern crate std; diff --git a/vendor/getrandom/src/lazy.rs b/vendor/getrandom/src/lazy.rs new file mode 100644 index 000000000..b9c2f88c1 --- /dev/null +++ b/vendor/getrandom/src/lazy.rs @@ -0,0 +1,56 @@ +use core::sync::atomic::{AtomicUsize, Ordering::Relaxed}; + +// This structure represents a lazily initialized static usize value. Useful +// when it is preferable to just rerun initialization instead of locking. +// Both unsync_init and sync_init will invoke an init() function until it +// succeeds, then return the cached value for future calls. +// +// Both methods support init() "failing". If the init() method returns UNINIT, +// that value will be returned as normal, but will not be cached. +// +// Users should only depend on the _value_ returned by init() functions. +// Specifically, for the following init() function: +// fn init() -> usize { +// a(); +// let v = b(); +// c(); +// v +// } +// the effects of c() or writes to shared memory will not necessarily be +// observed and additional synchronization methods with be needed. +pub(crate) struct LazyUsize(AtomicUsize); + +impl LazyUsize { + pub const fn new() -> Self { + Self(AtomicUsize::new(Self::UNINIT)) + } + + // The initialization is not completed. + pub const UNINIT: usize = usize::max_value(); + + // Runs the init() function at least once, returning the value of some run + // of init(). Multiple callers can run their init() functions in parallel. + // init() should always return the same value, if it succeeds. + pub fn unsync_init(&self, init: impl FnOnce() -> usize) -> usize { + // Relaxed ordering is fine, as we only have a single atomic variable. + let mut val = self.0.load(Relaxed); + if val == Self::UNINIT { + val = init(); + self.0.store(val, Relaxed); + } + val + } +} + +// Identical to LazyUsize except with bool instead of usize. +pub(crate) struct LazyBool(LazyUsize); + +impl LazyBool { + pub const fn new() -> Self { + Self(LazyUsize::new()) + } + + pub fn unsync_init(&self, init: impl FnOnce() -> bool) -> bool { + self.0.unsync_init(|| init() as usize) != 0 + } +} diff --git a/vendor/getrandom/src/lib.rs b/vendor/getrandom/src/lib.rs index 10cc22737..e80ec6f50 100644 --- a/vendor/getrandom/src/lib.rs +++ b/vendor/getrandom/src/lib.rs @@ -1,11 +1,3 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Interface to the operating system's random number generator. //! //! # Supported targets @@ -14,8 +6,8 @@ //! | ----------------- | ------------------ | -------------- //! | Linux, Android | `*‑linux‑*` | [`getrandom`][1] system call if available, otherwise [`/dev/urandom`][2] after successfully polling `/dev/random` //! | Windows | `*‑windows‑*` | [`BCryptGenRandom`] -//! | macOS | `*‑apple‑darwin` | [`getentropy`][3] if available, otherwise [`/dev/urandom`][4] (identical to `/dev/random`) -//! | iOS, tvOS, watchOS | `*‑apple‑ios`, `*-apple-tvos`, `*-apple-watchos` | [`SecRandomCopyBytes`] +//! | macOS | `*‑apple‑darwin` | [`getentropy`][3] +//! | iOS, tvOS, watchOS | `*‑apple‑ios`, `*-apple-tvos`, `*-apple-watchos` | [`CCRandomGenerateBytes`] //! | FreeBSD | `*‑freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6] //! | OpenBSD | `*‑openbsd` | [`getentropy`][7] //! | NetBSD | `*‑netbsd` | [`getrandom`][16] if available, otherwise [`kern.arandom`][8] @@ -106,6 +98,13 @@ //! ``` //! This crate will then use the provided `webcrypto` implementation. //! +//! ### Platform Support +//! This crate generally supports the same operating system and platform versions that the Rust standard library does. +//! Additional targets may be supported using pluggable custom implementations. +//! +//! This means that as Rust drops support for old versions of operating systems (such as old Linux kernel versions, Android API levels, etc) +//! in stable releases, `getrandom` may create new patch releases (`0.N.x`) that remove support for outdated platform versions. +//! //! ### Custom implementations //! //! The [`register_custom_getrandom!`] macro allows a user to mark their own @@ -172,7 +171,7 @@ //! [`BCryptGenRandom`]: https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom //! [`Crypto.getRandomValues`]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues //! [`RDRAND`]: https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide -//! [`SecRandomCopyBytes`]: https://developer.apple.com/documentation/security/1399291-secrandomcopybytes?language=objc +//! [`CCRandomGenerateBytes`]: https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60074/include/CommonRandom.h.auto.html //! [`cprng_draw`]: https://fuchsia.dev/fuchsia-src/zircon/syscalls/cprng_draw //! [`crypto.randomFillSync`]: https://nodejs.org/api/crypto.html#cryptorandomfillsyncbuffer-offset-size //! [`esp_fill_random`]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/random.html#_CPPv415esp_fill_randomPv6size_t @@ -187,7 +186,7 @@ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/getrandom/0.2.11" + html_root_url = "https://docs.rs/getrandom/0.2.12" )] #![no_std] #![warn(rust_2018_idioms, unused_lifetimes, missing_docs)] @@ -224,6 +223,7 @@ cfg_if! { } else if #[cfg(any(target_os = "android", target_os = "linux"))] { mod util_libc; mod use_file; + mod lazy; #[path = "linux_android.rs"] mod imp; } else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] { mod util_libc; @@ -242,7 +242,6 @@ cfg_if! { #[path = "apple-other.rs"] mod imp; } else if #[cfg(target_os = "macos")] { mod util_libc; - mod use_file; #[path = "macos.rs"] mod imp; } else if #[cfg(target_os = "openbsd")] { mod util_libc; @@ -272,9 +271,11 @@ cfg_if! { mod util_libc; #[path = "emscripten.rs"] mod imp; } else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] { + mod lazy; #[path = "rdrand.rs"] mod imp; } else if #[cfg(all(feature = "rdrand", any(target_arch = "x86_64", target_arch = "x86")))] { + mod lazy; #[path = "rdrand.rs"] mod imp; } else if #[cfg(all(feature = "js", any(target_arch = "wasm32", target_arch = "wasm64"), diff --git a/vendor/getrandom/src/linux_android.rs b/vendor/getrandom/src/linux_android.rs index e81f1e153..2517159e2 100644 --- a/vendor/getrandom/src/linux_android.rs +++ b/vendor/getrandom/src/linux_android.rs @@ -1,14 +1,6 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Linux / Android use crate::{ - util::LazyBool, + lazy::LazyBool, util_libc::{last_os_error, sys_fill_exact}, {use_file, Error}, }; diff --git a/vendor/getrandom/src/macos.rs b/vendor/getrandom/src/macos.rs index 312f9b27f..44af76b03 100644 --- a/vendor/getrandom/src/macos.rs +++ b/vendor/getrandom/src/macos.rs @@ -1,36 +1,18 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for macOS -use crate::{ - use_file, - util_libc::{last_os_error, Weak}, - Error, -}; -use core::mem::{self, MaybeUninit}; +use crate::{util_libc::last_os_error, Error}; +use core::mem::MaybeUninit; -type GetEntropyFn = unsafe extern "C" fn(*mut u8, libc::size_t) -> libc::c_int; +extern "C" { + // Supported as of macOS 10.12+. + fn getentropy(buf: *mut u8, size: libc::size_t) -> libc::c_int; +} pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { - // getentropy(2) was added in 10.12, Rust supports 10.7+ - static GETENTROPY: Weak = unsafe { Weak::new("getentropy\0") }; - if let Some(fptr) = GETENTROPY.ptr() { - let func: GetEntropyFn = unsafe { mem::transmute(fptr) }; - for chunk in dest.chunks_mut(256) { - let ret = unsafe { func(chunk.as_mut_ptr() as *mut u8, chunk.len()) }; - if ret != 0 { - return Err(last_os_error()); - } + for chunk in dest.chunks_mut(256) { + let ret = unsafe { getentropy(chunk.as_mut_ptr() as *mut u8, chunk.len()) }; + if ret != 0 { + return Err(last_os_error()); } - Ok(()) - } else { - // We fallback to reading from /dev/random instead of SecRandomCopyBytes - // to avoid high startup costs and linking the Security framework. - use_file::getrandom_inner(dest) } + Ok(()) } diff --git a/vendor/getrandom/src/openbsd.rs b/vendor/getrandom/src/openbsd.rs index 7a76f61d5..f4d64daf6 100644 --- a/vendor/getrandom/src/openbsd.rs +++ b/vendor/getrandom/src/openbsd.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for OpenBSD use crate::{util_libc::last_os_error, Error}; use core::mem::MaybeUninit; diff --git a/vendor/getrandom/src/rdrand.rs b/vendor/getrandom/src/rdrand.rs index 69f6a5d13..f527c8c64 100644 --- a/vendor/getrandom/src/rdrand.rs +++ b/vendor/getrandom/src/rdrand.rs @@ -1,14 +1,5 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. -use crate::{ - util::{slice_as_uninit, LazyBool}, - Error, -}; +//! RDRAND backend for x86(-64) targets +use crate::{lazy::LazyBool, util::slice_as_uninit, Error}; use core::mem::{size_of, MaybeUninit}; cfg_if! { diff --git a/vendor/getrandom/src/solaris_illumos.rs b/vendor/getrandom/src/solaris_illumos.rs index 501c610d7..fbc239433 100644 --- a/vendor/getrandom/src/solaris_illumos.rs +++ b/vendor/getrandom/src/solaris_illumos.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for the Solaris family //! //! `/dev/random` uses the Hash_DRBG with SHA512 algorithm from NIST SP 800-90A. diff --git a/vendor/getrandom/src/solid.rs b/vendor/getrandom/src/solid.rs index aeccc4e2b..cae8caf66 100644 --- a/vendor/getrandom/src/solid.rs +++ b/vendor/getrandom/src/solid.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for SOLID use crate::Error; use core::{mem::MaybeUninit, num::NonZeroU32}; diff --git a/vendor/getrandom/src/use_file.rs b/vendor/getrandom/src/use_file.rs index a6ef0d235..333325b5a 100644 --- a/vendor/getrandom/src/use_file.rs +++ b/vendor/getrandom/src/use_file.rs @@ -1,14 +1,5 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementations that just need to read from a file use crate::{ - util::LazyUsize, util_libc::{open_readonly, sys_fill_exact}, Error, }; @@ -21,7 +12,7 @@ use core::{ // We prefer using /dev/urandom and only use /dev/random if the OS // documentation indicates that /dev/urandom is insecure. // On Solaris/Illumos, see src/solaris_illumos.rs -// On Dragonfly, Haiku, macOS, and QNX Neutrino the devices are identical. +// On Dragonfly, Haiku, and QNX Neutrino the devices are identical. #[cfg(any(target_os = "solaris", target_os = "illumos"))] const FILE_PATH: &str = "/dev/random\0"; #[cfg(any( @@ -31,10 +22,10 @@ const FILE_PATH: &str = "/dev/random\0"; target_os = "redox", target_os = "dragonfly", target_os = "haiku", - target_os = "macos", target_os = "nto", ))] const FILE_PATH: &str = "/dev/urandom\0"; +const FD_UNINIT: usize = usize::max_value(); pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { let fd = get_rng_fd()?; @@ -47,10 +38,10 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { // bytes. The file will be opened exactly once. All subsequent calls will // return the same file descriptor. This file descriptor is never closed. fn get_rng_fd() -> Result { - static FD: AtomicUsize = AtomicUsize::new(LazyUsize::UNINIT); + static FD: AtomicUsize = AtomicUsize::new(FD_UNINIT); fn get_fd() -> Option { match FD.load(Relaxed) { - LazyUsize::UNINIT => None, + FD_UNINIT => None, val => Some(val as libc::c_int), } } @@ -75,8 +66,8 @@ fn get_rng_fd() -> Result { wait_until_rng_ready()?; let fd = unsafe { open_readonly(FILE_PATH)? }; - // The fd always fits in a usize without conflicting with UNINIT. - debug_assert!(fd >= 0 && (fd as usize) < LazyUsize::UNINIT); + // The fd always fits in a usize without conflicting with FD_UNINIT. + debug_assert!(fd >= 0 && (fd as usize) < FD_UNINIT); FD.store(fd as usize, Relaxed); Ok(fd) diff --git a/vendor/getrandom/src/util.rs b/vendor/getrandom/src/util.rs index 3162afad3..1c4e70ba4 100644 --- a/vendor/getrandom/src/util.rs +++ b/vendor/getrandom/src/util.rs @@ -1,71 +1,5 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![allow(dead_code)] -use core::{ - mem::MaybeUninit, - ptr, - sync::atomic::{AtomicUsize, Ordering::Relaxed}, -}; - -// This structure represents a lazily initialized static usize value. Useful -// when it is preferable to just rerun initialization instead of locking. -// Both unsync_init and sync_init will invoke an init() function until it -// succeeds, then return the cached value for future calls. -// -// Both methods support init() "failing". If the init() method returns UNINIT, -// that value will be returned as normal, but will not be cached. -// -// Users should only depend on the _value_ returned by init() functions. -// Specifically, for the following init() function: -// fn init() -> usize { -// a(); -// let v = b(); -// c(); -// v -// } -// the effects of c() or writes to shared memory will not necessarily be -// observed and additional synchronization methods with be needed. -pub struct LazyUsize(AtomicUsize); - -impl LazyUsize { - pub const fn new() -> Self { - Self(AtomicUsize::new(Self::UNINIT)) - } - - // The initialization is not completed. - pub const UNINIT: usize = usize::max_value(); - - // Runs the init() function at least once, returning the value of some run - // of init(). Multiple callers can run their init() functions in parallel. - // init() should always return the same value, if it succeeds. - pub fn unsync_init(&self, init: impl FnOnce() -> usize) -> usize { - // Relaxed ordering is fine, as we only have a single atomic variable. - let mut val = self.0.load(Relaxed); - if val == Self::UNINIT { - val = init(); - self.0.store(val, Relaxed); - } - val - } -} - -// Identical to LazyUsize except with bool instead of usize. -pub struct LazyBool(LazyUsize); - -impl LazyBool { - pub const fn new() -> Self { - Self(LazyUsize::new()) - } - - pub fn unsync_init(&self, init: impl FnOnce() -> bool) -> bool { - self.0.unsync_init(|| init() as usize) != 0 - } -} +use core::{mem::MaybeUninit, ptr}; /// Polyfill for `maybe_uninit_slice` feature's /// `MaybeUninit::slice_assume_init_mut`. Every element of `slice` must have diff --git a/vendor/getrandom/src/util_libc.rs b/vendor/getrandom/src/util_libc.rs index 99bee3824..0b792c35f 100644 --- a/vendor/getrandom/src/util_libc.rs +++ b/vendor/getrandom/src/util_libc.rs @@ -1,14 +1,6 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![allow(dead_code)] use crate::Error; use core::{ - cmp::min, mem::MaybeUninit, num::NonZeroU32, ptr::NonNull, @@ -70,17 +62,19 @@ pub fn sys_fill_exact( ) -> Result<(), Error> { while !buf.is_empty() { let res = sys_fill(buf); - if res < 0 { - let err = last_os_error(); - // We should try again if the call was interrupted. - if err.raw_os_error() != Some(libc::EINTR) { - return Err(err); + match res { + res if res > 0 => buf = buf.get_mut(res as usize..).ok_or(Error::UNEXPECTED)?, + -1 => { + let err = last_os_error(); + // We should try again if the call was interrupted. + if err.raw_os_error() != Some(libc::EINTR) { + return Err(err); + } } - } else { - // We don't check for EOF (ret = 0) as the data we are reading + // Negative return codes not equal to -1 should be impossible. + // EOF (ret = 0) should be impossible, as the data we are reading // should be an infinite stream of random bytes. - let len = min(res as usize, buf.len()); - buf = &mut buf[len..]; + _ => return Err(Error::UNEXPECTED), } } Ok(()) diff --git a/vendor/getrandom/src/vita.rs b/vendor/getrandom/src/vita.rs index 4f19b9cb0..20a987824 100644 --- a/vendor/getrandom/src/vita.rs +++ b/vendor/getrandom/src/vita.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for PS Vita use crate::{util_libc::last_os_error, Error}; use core::mem::MaybeUninit; diff --git a/vendor/getrandom/src/vxworks.rs b/vendor/getrandom/src/vxworks.rs index 9b2090fb0..7ca9d6bfd 100644 --- a/vendor/getrandom/src/vxworks.rs +++ b/vendor/getrandom/src/vxworks.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for VxWorks use crate::{util_libc::last_os_error, Error}; use core::{ diff --git a/vendor/getrandom/src/wasi.rs b/vendor/getrandom/src/wasi.rs index 9276ee74f..d6c8a912c 100644 --- a/vendor/getrandom/src/wasi.rs +++ b/vendor/getrandom/src/wasi.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for WASI use crate::Error; use core::{ diff --git a/vendor/getrandom/src/windows.rs b/vendor/getrandom/src/windows.rs index 92d70429e..2d1c48351 100644 --- a/vendor/getrandom/src/windows.rs +++ b/vendor/getrandom/src/windows.rs @@ -1,11 +1,4 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - +//! Implementation for Windows use crate::Error; use core::{ffi::c_void, mem::MaybeUninit, num::NonZeroU32, ptr}; diff --git a/vendor/getrandom/tests/rdrand.rs b/vendor/getrandom/tests/rdrand.rs index 25678683f..a355c31ee 100644 --- a/vendor/getrandom/tests/rdrand.rs +++ b/vendor/getrandom/tests/rdrand.rs @@ -6,6 +6,8 @@ use getrandom::Error; #[macro_use] extern crate cfg_if; +#[path = "../src/lazy.rs"] +mod lazy; #[path = "../src/rdrand.rs"] mod rdrand; #[path = "../src/util.rs"] diff --git a/vendor/h2/.cargo-checksum.json b/vendor/h2/.cargo-checksum.json index 74b4e2f7c..318bfe372 100644 --- a/vendor/h2/.cargo-checksum.json +++ b/vendor/h2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"f822d678c95c83283fd93d8c5b81bcbba2c6383fce38c1b9fe2c9d464240dfaa","CONTRIBUTING.md":"e10ba2a0ff65716859c70b036dfe9239cc40dd81a5f63b25d24f1bc55000c8fd","Cargo.lock":"323bd5dafab8cd17bcb171b49ab7de974ca7eb698a55936b7b1d61aca341d3b5","Cargo.toml":"7db98d566bde86ff538481292dd745352b5bad8025c7665a35df73a7d32f6496","LICENSE":"b21623012e6c453d944b0342c515b631cfcbf30704c2621b291526b69c10724d","README.md":"686a7e3e4b488fe813c4fb99b5082e00a168068cd80bdb29c496e8b68f1ce257","examples/akamai.rs":"f6e6fa87257f0fc8dc4864d31dfb6de15a5b2a9a04420368733d318e8b424dc1","examples/client.rs":"5ad136b838e9d55ae3d1fd8801cec4af88139b58864d6438f75d0e173eb3aeb3","examples/server.rs":"8cc7927c7fe98a2474c41ab0094ba2dc7a2ae6a7f58ce342a4c05bb8056a63a5","src/client.rs":"64e6bb12e3075c4b779086849d5e5715f237a220c1d85f68b52e76c350a066e2","src/codec/error.rs":"e4b494d6234d8e44de22188540af5e3e0964bbaabc1d8339c7702d401c55afa2","src/codec/framed_read.rs":"8ae7f34d3925b05d6126ac5151e00a066a52f529d3e21010e7008d193edb747a","src/codec/framed_write.rs":"01db6877623e913527fff92cc6a58a7025f97d9a65c4c4df61aa616919964a92","src/codec/mod.rs":"cf9c795756e782c2d01e6020b8e5b76a254e4e9f5dfa7f5d007c6d4287a77f6a","src/error.rs":"62af97622e13ec30cc89fdcda7e449f551581356543a9f59437a081cb8f736e4","src/ext.rs":"2fb968f754829fc50392b6ccb4b90cc4c8b88657a5e3a7259f53916e13dc1c91","src/frame/data.rs":"3f524ce64bf4135c0f248419b1d3af973464a1748bf0d3bab437c5a088f7c22f","src/frame/go_away.rs":"6b3fe966ed96bb941e55e6af3352d7afa43e9bde78dc261251a38b09f5c73202","src/frame/head.rs":"4073eb70a8ed9ec0ca460e18fb470fca1dbe6900c1ac08d66397ab4d75414e4c","src/frame/headers.rs":"a0e2d02b9c33d97e78dd2886771bfecfb862132aec47d0365e4ab80133411e30","src/frame/mod.rs":"06390bf0fd84ced203507f30b806feaedf983e4be31efc8d2359f6ea3b27f95c","src/frame/ping.rs":"ff4e4059101300e7b03c23d271026b058da4315c3bd68280422e144c2aa1b9e6","src/frame/priority.rs":"9392b7aa2636157024dc645c92d0e450a4d3f7a53bc9de1188d3b61178c2b5fc","src/frame/reason.rs":"45b13202141b1d8b261d64624b276a9b034d8c3f7d9b6870ee41a204589f4e14","src/frame/reset.rs":"91c17a7391fcb516223fd0358f7770524023b33dd6489902ba23e47b8acc9a9e","src/frame/settings.rs":"9aed52868a1ddbb5570025edde2e073d3da1291b58d8759bfed7f086d40ef293","src/frame/stream_id.rs":"0aa72cc3d735aa31e4d0cca0a8b94bae75c97d041c3712fe8e49f687881a73fe","src/frame/util.rs":"1a1408ddefe35f9efe5faa5360cb5ecc461fc0846175d4b43031720da7f5188d","src/frame/window_update.rs":"05c1b84478208802d09154f5d6fb5eb886d45397f43ccc6ccbf40bf3be912819","src/fuzz_bridge.rs":"c27c716732c21a972a8bef43c00ee851a78de80259db62f0b6e793008ccf01a3","src/hpack/decoder.rs":"5c909bfd48928cb040e1912b0c83505e9de00ed9f4bf5a4654e6d2aadd11a29f","src/hpack/encoder.rs":"f62a3dc317e17e3e0e8e13fd1e4dd1f7370d9831ec5c11675a4550952c7f3ede","src/hpack/header.rs":"b99153144455dcbe7f21161efb32cf5a3362aa7aa1180986e2e733348bb3796f","src/hpack/huffman/mod.rs":"01f3de4e479b96d1da31c242a02144aa8c431df540e7e4b984ee3aea5afcd212","src/hpack/huffman/table.rs":"6b7f94af0bb5d236d4e671eff4afe5dc254a20eaddd2d57dd6e8f53e2a60c337","src/hpack/mod.rs":"581033d44fd5525e9ccb546549a99f8357ab8f55d58b490d9980fb36323c5dbc","src/hpack/table.rs":"6efc933d47355050ed4119e8438513d31f966ccd20ac70a5c51721052184de81","src/hpack/test/fixture.rs":"8a0cfbdc314da9d6f98d0329e41f8b804011305d5f3047ef60faf39038541411","src/hpack/test/fuzz.rs":"89a8b1a79409e811c72897df479e2209f039b253fa6b9aa7510d615966b69d1f","src/hpack/test/mod.rs":"56ad5643e7f1e273e5bce8a6fc0552be39c326dacfffd7f9757ccdbe75e9b66e","src/lib.rs":"89108230365ed0645dec359cfd8ae1ccfcd236318848c6d282f55998a7b5e880","src/proto/connection.rs":"a68bb62afbba9ab9b4d74e9bbedf9a1d7e7d0e7c7b62f1cf6a725456d01c298f","src/proto/error.rs":"ab9a68acb60753fbb7c7ad54b9aac627cfa5099cf922163f823be618040998a1","src/proto/go_away.rs":"51d467027bc30873fc76166ed731e968a23725e7b106b58ecadcb85044466a5f","src/proto/mod.rs":"c9c7e30c44df73d267296f5c1dbaaf8402041beb6e525d5f75cf2fde05d2a1c8","src/proto/peer.rs":"e26317f7d0a27441e15bf8b4ca4af3e4cca0ea01803027078a088eafb83e0910","src/proto/ping_pong.rs":"21b8f1886ffa18420c4d57a32e8dd2b0cd8665824ace2b44c4e20e101f5aa2c9","src/proto/settings.rs":"e9c3fa389122f0591c746ca7ffe3dfce986d1a2aa9366b06ecf3f7ecc7e89839","src/proto/streams/buffer.rs":"cf2205c607f8a6b8aa8662983d9907fedeb14b5890e051d8e63d7bc2b0a960e9","src/proto/streams/counts.rs":"b03d849fe4fd685ffb5da520a863fffb9cb55cd731cd2dcc78324aa55978a7ba","src/proto/streams/flow_control.rs":"a8b3c5cd24b1f83770576ba21d5fcd555f144afd88f246f7d5dbe9e39563c74a","src/proto/streams/mod.rs":"1bf49e6bf4b7f315acb66b887e27c340224715e2db824526f94cd578a1de9d76","src/proto/streams/prioritize.rs":"23398cc237d68a117dedda3fe806c54990f361ab37aca7476021ab023c5acf89","src/proto/streams/recv.rs":"88429a855ebde2a080a5279746bd1d9491e7f6daa44d5ecdf065049761d0df35","src/proto/streams/send.rs":"2ef000b5c24d94f997ee74152f7a810a4403087590d141310fc4835ab8261efc","src/proto/streams/state.rs":"8d818ffe4d2c0d0703f771c8770e396e9bc6a2b3568e64ba8e9d54606a6c6726","src/proto/streams/store.rs":"603ea7a0ad9d8c0ef709b230b74d28c95af1bdae55ff6e6ee0e89d0d14f093c8","src/proto/streams/stream.rs":"721af69c69d42410932dc72c8db33ab5e60733c1b2b747a817f1933b7dc8a095","src/proto/streams/streams.rs":"1c30a55600c84685f396c4862b81552f5e8d4cab5b93f6a16f58e404080e221c","src/server.rs":"25afaf808e8523c40d412d37d708fdd04ad76f4c0e2c1001bdd66563f6e7b655","src/share.rs":"9b9c48b3198f3856267a6927ee3cac57a8236b8847b515611f55d1ed7b6ba38d"},"package":"4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178"} \ No newline at end of file +{"files":{"CHANGELOG.md":"86ddb67dadd01d1430bc4da71ecfec3968274386a6a7186ec63e96bef90e1af5","CONTRIBUTING.md":"e10ba2a0ff65716859c70b036dfe9239cc40dd81a5f63b25d24f1bc55000c8fd","Cargo.lock":"5dfabb80daa9e649386c6a3c9fab721d4439d206cd6fe65c2114df1527896bdd","Cargo.toml":"c775b79adab29ba95863fb4b225408c9983adc5a1cab811a82a45de910d50d11","LICENSE":"b21623012e6c453d944b0342c515b631cfcbf30704c2621b291526b69c10724d","README.md":"686a7e3e4b488fe813c4fb99b5082e00a168068cd80bdb29c496e8b68f1ce257","examples/akamai.rs":"f6e6fa87257f0fc8dc4864d31dfb6de15a5b2a9a04420368733d318e8b424dc1","examples/client.rs":"5ad136b838e9d55ae3d1fd8801cec4af88139b58864d6438f75d0e173eb3aeb3","examples/server.rs":"8cc7927c7fe98a2474c41ab0094ba2dc7a2ae6a7f58ce342a4c05bb8056a63a5","src/client.rs":"855ddf937244aa6e74af634a8c70fe537ecdc20cd781d060d5a38ef0db27c036","src/codec/error.rs":"e4b494d6234d8e44de22188540af5e3e0964bbaabc1d8339c7702d401c55afa2","src/codec/framed_read.rs":"8ae7f34d3925b05d6126ac5151e00a066a52f529d3e21010e7008d193edb747a","src/codec/framed_write.rs":"01db6877623e913527fff92cc6a58a7025f97d9a65c4c4df61aa616919964a92","src/codec/mod.rs":"cf9c795756e782c2d01e6020b8e5b76a254e4e9f5dfa7f5d007c6d4287a77f6a","src/error.rs":"b05dc52f36a29b29b1b3e0705a3f1ecf102a89896e173356f3e5fb1165dd6090","src/ext.rs":"2fb968f754829fc50392b6ccb4b90cc4c8b88657a5e3a7259f53916e13dc1c91","src/frame/data.rs":"3f524ce64bf4135c0f248419b1d3af973464a1748bf0d3bab437c5a088f7c22f","src/frame/go_away.rs":"6b3fe966ed96bb941e55e6af3352d7afa43e9bde78dc261251a38b09f5c73202","src/frame/head.rs":"4073eb70a8ed9ec0ca460e18fb470fca1dbe6900c1ac08d66397ab4d75414e4c","src/frame/headers.rs":"a0e2d02b9c33d97e78dd2886771bfecfb862132aec47d0365e4ab80133411e30","src/frame/mod.rs":"06390bf0fd84ced203507f30b806feaedf983e4be31efc8d2359f6ea3b27f95c","src/frame/ping.rs":"ff4e4059101300e7b03c23d271026b058da4315c3bd68280422e144c2aa1b9e6","src/frame/priority.rs":"9392b7aa2636157024dc645c92d0e450a4d3f7a53bc9de1188d3b61178c2b5fc","src/frame/reason.rs":"45b13202141b1d8b261d64624b276a9b034d8c3f7d9b6870ee41a204589f4e14","src/frame/reset.rs":"91c17a7391fcb516223fd0358f7770524023b33dd6489902ba23e47b8acc9a9e","src/frame/settings.rs":"9aed52868a1ddbb5570025edde2e073d3da1291b58d8759bfed7f086d40ef293","src/frame/stream_id.rs":"0aa72cc3d735aa31e4d0cca0a8b94bae75c97d041c3712fe8e49f687881a73fe","src/frame/util.rs":"1a1408ddefe35f9efe5faa5360cb5ecc461fc0846175d4b43031720da7f5188d","src/frame/window_update.rs":"05c1b84478208802d09154f5d6fb5eb886d45397f43ccc6ccbf40bf3be912819","src/fuzz_bridge.rs":"c27c716732c21a972a8bef43c00ee851a78de80259db62f0b6e793008ccf01a3","src/hpack/decoder.rs":"5c909bfd48928cb040e1912b0c83505e9de00ed9f4bf5a4654e6d2aadd11a29f","src/hpack/encoder.rs":"f62a3dc317e17e3e0e8e13fd1e4dd1f7370d9831ec5c11675a4550952c7f3ede","src/hpack/header.rs":"b99153144455dcbe7f21161efb32cf5a3362aa7aa1180986e2e733348bb3796f","src/hpack/huffman/mod.rs":"01f3de4e479b96d1da31c242a02144aa8c431df540e7e4b984ee3aea5afcd212","src/hpack/huffman/table.rs":"6b7f94af0bb5d236d4e671eff4afe5dc254a20eaddd2d57dd6e8f53e2a60c337","src/hpack/mod.rs":"581033d44fd5525e9ccb546549a99f8357ab8f55d58b490d9980fb36323c5dbc","src/hpack/table.rs":"6efc933d47355050ed4119e8438513d31f966ccd20ac70a5c51721052184de81","src/hpack/test/fixture.rs":"8a0cfbdc314da9d6f98d0329e41f8b804011305d5f3047ef60faf39038541411","src/hpack/test/fuzz.rs":"89a8b1a79409e811c72897df479e2209f039b253fa6b9aa7510d615966b69d1f","src/hpack/test/mod.rs":"56ad5643e7f1e273e5bce8a6fc0552be39c326dacfffd7f9757ccdbe75e9b66e","src/lib.rs":"b0a6a30a17fa74c6e4330efe8f0c5f726519bd00d77a414d7bcdd30d0e50aa90","src/proto/connection.rs":"aaccad30bfe51887e59d9be06a9238fecbd7001d8fc784a3f0f3838584489a5d","src/proto/error.rs":"ab9a68acb60753fbb7c7ad54b9aac627cfa5099cf922163f823be618040998a1","src/proto/go_away.rs":"51d467027bc30873fc76166ed731e968a23725e7b106b58ecadcb85044466a5f","src/proto/mod.rs":"7586a3aaadf8d75c4cb362506d36f5aba3a0c14d70202e23d55b314e91c87eec","src/proto/peer.rs":"e26317f7d0a27441e15bf8b4ca4af3e4cca0ea01803027078a088eafb83e0910","src/proto/ping_pong.rs":"21b8f1886ffa18420c4d57a32e8dd2b0cd8665824ace2b44c4e20e101f5aa2c9","src/proto/settings.rs":"e9c3fa389122f0591c746ca7ffe3dfce986d1a2aa9366b06ecf3f7ecc7e89839","src/proto/streams/buffer.rs":"cf2205c607f8a6b8aa8662983d9907fedeb14b5890e051d8e63d7bc2b0a960e9","src/proto/streams/counts.rs":"e42e0cbaed529c719a0d799667c6df342af5e5366024491adf3de535213fdcf4","src/proto/streams/flow_control.rs":"a8b3c5cd24b1f83770576ba21d5fcd555f144afd88f246f7d5dbe9e39563c74a","src/proto/streams/mod.rs":"885748f264c7d3882ff1ced0e6db5ef8051fc38fec6e0198ee8404cfdfd5bb76","src/proto/streams/prioritize.rs":"8e80d406a006f2db6a46b1a8300c56cb150f4e447b538c0c59fde35904e80b84","src/proto/streams/recv.rs":"88429a855ebde2a080a5279746bd1d9491e7f6daa44d5ecdf065049761d0df35","src/proto/streams/send.rs":"2ef000b5c24d94f997ee74152f7a810a4403087590d141310fc4835ab8261efc","src/proto/streams/state.rs":"8d818ffe4d2c0d0703f771c8770e396e9bc6a2b3568e64ba8e9d54606a6c6726","src/proto/streams/store.rs":"603ea7a0ad9d8c0ef709b230b74d28c95af1bdae55ff6e6ee0e89d0d14f093c8","src/proto/streams/stream.rs":"721af69c69d42410932dc72c8db33ab5e60733c1b2b747a817f1933b7dc8a095","src/proto/streams/streams.rs":"573af8bb8aa6f8c385aeec6e6b0a3d48712f33a288f5e9bffc5bf07a3e0b4120","src/server.rs":"edf44ad984605ba114f7cc884d8aae3eb1f579e163f3d3c288fde9f45f6b6971","src/share.rs":"9b9c48b3198f3856267a6927ee3cac57a8236b8847b515611f55d1ed7b6ba38d"},"package":"bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"} \ No newline at end of file diff --git a/vendor/h2/CHANGELOG.md b/vendor/h2/CHANGELOG.md index 00d69725a..dbd1cbed9 100644 --- a/vendor/h2/CHANGELOG.md +++ b/vendor/h2/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.3.24 (January 17, 2024) + +* Limit error resets for misbehaving connections. + +# 0.3.23 (January 10, 2024) + +* Backport fix from 0.4.1 for stream capacity assignment. + # 0.3.22 (November 15, 2023) * Add `header_table_size(usize)` option to client and server builders. diff --git a/vendor/h2/Cargo.lock b/vendor/h2/Cargo.lock index fb87ae3a7..3d2f9feae 100644 --- a/vendor/h2/Cargo.lock +++ b/vendor/h2/Cargo.lock @@ -129,7 +129,7 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" dependencies = [ "bytes", "env_logger", @@ -173,9 +173,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", diff --git a/vendor/h2/Cargo.toml b/vendor/h2/Cargo.toml index e4e902950..7e00e8050 100644 --- a/vendor/h2/Cargo.toml +++ b/vendor/h2/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.63" name = "h2" -version = "0.3.22" +version = "0.3.24" authors = [ "Carl Lerche ", "Sean McArthur ", diff --git a/vendor/h2/src/client.rs b/vendor/h2/src/client.rs index 35cfc1414..fe78767f7 100644 --- a/vendor/h2/src/client.rs +++ b/vendor/h2/src/client.rs @@ -336,6 +336,12 @@ pub struct Builder { /// The stream ID of the first (lowest) stream. Subsequent streams will use /// monotonically increasing stream IDs. stream_id: StreamId, + + /// Maximum number of locally reset streams due to protocol error across + /// the lifetime of the connection. + /// + /// When this gets exceeded, we issue GOAWAYs. + local_max_error_reset_streams: Option, } #[derive(Debug)] @@ -645,6 +651,7 @@ impl Builder { initial_max_send_streams: usize::MAX, settings: Default::default(), stream_id: 1.into(), + local_max_error_reset_streams: Some(proto::DEFAULT_LOCAL_RESET_COUNT_MAX), } } @@ -973,6 +980,23 @@ impl Builder { self } + /// Sets the maximum number of local resets due to protocol errors made by the remote end. + /// + /// Invalid frames and many other protocol errors will lead to resets being generated for those streams. + /// Too many of these often indicate a malicious client, and there are attacks which can abuse this to DOS servers. + /// This limit protects against these DOS attacks by limiting the amount of resets we can be forced to generate. + /// + /// When the number of local resets exceeds this threshold, the client will close the connection. + /// + /// If you really want to disable this, supply [`Option::None`] here. + /// Disabling this is not recommended and may expose you to DOS attacks. + /// + /// The default value is currently 1024, but could change. + pub fn max_local_error_reset_streams(&mut self, max: Option) -> &mut Self { + self.local_max_error_reset_streams = max; + self + } + /// Sets the maximum number of pending-accept remotely-reset streams. /// /// Streams that have been received by the peer, but not accepted by the @@ -1293,6 +1317,7 @@ where reset_stream_duration: builder.reset_stream_duration, reset_stream_max: builder.reset_stream_max, remote_reset_stream_max: builder.pending_accept_reset_stream_max, + local_error_reset_streams_max: builder.local_max_error_reset_streams, settings: builder.settings.clone(), }, ); diff --git a/vendor/h2/src/error.rs b/vendor/h2/src/error.rs index eb2b2acbc..96a471bcb 100644 --- a/vendor/h2/src/error.rs +++ b/vendor/h2/src/error.rs @@ -25,6 +25,7 @@ pub struct Error { #[derive(Debug)] enum Kind { /// A RST_STREAM frame was received or sent. + #[allow(dead_code)] Reset(StreamId, Reason, Initiator), /// A GO_AWAY frame was received or sent. diff --git a/vendor/h2/src/lib.rs b/vendor/h2/src/lib.rs index a1fde6eb4..cb7028f9b 100644 --- a/vendor/h2/src/lib.rs +++ b/vendor/h2/src/lib.rs @@ -78,7 +78,7 @@ //! [`server::handshake`]: server/fn.handshake.html //! [`client::handshake`]: client/fn.handshake.html -#![doc(html_root_url = "https://docs.rs/h2/0.3.22")] +#![doc(html_root_url = "https://docs.rs/h2/0.3.23")] #![deny( missing_debug_implementations, missing_docs, diff --git a/vendor/h2/src/proto/connection.rs b/vendor/h2/src/proto/connection.rs index 637fac358..5d6b9d2b1 100644 --- a/vendor/h2/src/proto/connection.rs +++ b/vendor/h2/src/proto/connection.rs @@ -81,6 +81,7 @@ pub(crate) struct Config { pub reset_stream_duration: Duration, pub reset_stream_max: usize, pub remote_reset_stream_max: usize, + pub local_error_reset_streams_max: Option, pub settings: frame::Settings, } @@ -125,6 +126,7 @@ where .settings .max_concurrent_streams() .map(|max| max as usize), + local_max_error_reset_streams: config.local_error_reset_streams_max, } } let streams = Streams::new(streams_config(&config)); diff --git a/vendor/h2/src/proto/mod.rs b/vendor/h2/src/proto/mod.rs index 567d03060..560927598 100644 --- a/vendor/h2/src/proto/mod.rs +++ b/vendor/h2/src/proto/mod.rs @@ -32,6 +32,7 @@ pub type WindowSize = u32; // Constants pub const MAX_WINDOW_SIZE: WindowSize = (1 << 31) - 1; // i32::MAX as u32 pub const DEFAULT_REMOTE_RESET_STREAM_MAX: usize = 20; +pub const DEFAULT_LOCAL_RESET_COUNT_MAX: usize = 1024; pub const DEFAULT_RESET_STREAM_MAX: usize = 10; pub const DEFAULT_RESET_STREAM_SECS: u64 = 30; pub const DEFAULT_MAX_SEND_BUFFER_SIZE: usize = 1024 * 400; diff --git a/vendor/h2/src/proto/streams/counts.rs b/vendor/h2/src/proto/streams/counts.rs index add1312e5..710d42c8d 100644 --- a/vendor/h2/src/proto/streams/counts.rs +++ b/vendor/h2/src/proto/streams/counts.rs @@ -31,6 +31,16 @@ pub(super) struct Counts { /// Current number of "pending accept" streams that were remotely reset num_remote_reset_streams: usize, + + /// Maximum number of locally reset streams due to protocol error across + /// the lifetime of the connection. + /// + /// When this gets exceeded, we issue GOAWAYs. + max_local_error_reset_streams: Option, + + /// Total number of locally reset streams due to protocol error across the + /// lifetime of the connection. + num_local_error_reset_streams: usize, } impl Counts { @@ -46,6 +56,8 @@ impl Counts { num_local_reset_streams: 0, max_remote_reset_streams: config.remote_reset_max, num_remote_reset_streams: 0, + max_local_error_reset_streams: config.local_max_error_reset_streams, + num_local_error_reset_streams: 0, } } @@ -66,6 +78,26 @@ impl Counts { self.num_send_streams != 0 || self.num_recv_streams != 0 } + /// Returns true if we can issue another local reset due to protocol error. + pub fn can_inc_num_local_error_resets(&self) -> bool { + if let Some(max) = self.max_local_error_reset_streams { + max > self.num_local_error_reset_streams + } else { + true + } + } + + pub fn inc_num_local_error_resets(&mut self) { + assert!(self.can_inc_num_local_error_resets()); + + // Increment the number of remote initiated streams + self.num_local_error_reset_streams += 1; + } + + pub(crate) fn max_local_error_resets(&self) -> Option { + self.max_local_error_reset_streams + } + /// Returns true if the receive stream concurrency can be incremented pub fn can_inc_num_recv_streams(&self) -> bool { self.max_recv_streams > self.num_recv_streams diff --git a/vendor/h2/src/proto/streams/mod.rs b/vendor/h2/src/proto/streams/mod.rs index fbe32c7b0..b347442af 100644 --- a/vendor/h2/src/proto/streams/mod.rs +++ b/vendor/h2/src/proto/streams/mod.rs @@ -69,4 +69,10 @@ pub struct Config { /// Maximum number of remote initiated streams pub remote_max_initiated: Option, + + /// Maximum number of locally reset streams due to protocol error across + /// the lifetime of the connection. + /// + /// When this gets exceeded, we issue GOAWAYs. + pub local_max_error_reset_streams: Option, } diff --git a/vendor/h2/src/proto/streams/prioritize.rs b/vendor/h2/src/proto/streams/prioritize.rs index 3196049a4..999bb0759 100644 --- a/vendor/h2/src/proto/streams/prioritize.rs +++ b/vendor/h2/src/proto/streams/prioritize.rs @@ -184,7 +184,15 @@ impl Prioritize { stream.requested_send_capacity = cmp::min(stream.buffered_send_data, WindowSize::MAX as usize) as WindowSize; - self.try_assign_capacity(stream); + // `try_assign_capacity` will queue the stream to `pending_capacity` if the capcaity + // cannot be assigned at the time it is called. + // + // Streams over the max concurrent count will still call `send_data` so we should be + // careful not to put it into `pending_capacity` as it will starve the connection + // capacity for other streams + if !stream.is_pending_open { + self.try_assign_capacity(stream); + } } if frame.is_end_stream() { @@ -522,6 +530,7 @@ impl Prioritize { loop { if let Some(mut stream) = self.pop_pending_open(store, counts) { self.pending_send.push_front(&mut stream); + self.try_assign_capacity(&mut stream); } match self.pop_frame(buffer, store, max_frame_len, counts) { diff --git a/vendor/h2/src/proto/streams/streams.rs b/vendor/h2/src/proto/streams/streams.rs index 274bf4553..7c00cd517 100644 --- a/vendor/h2/src/proto/streams/streams.rs +++ b/vendor/h2/src/proto/streams/streams.rs @@ -1542,10 +1542,24 @@ impl Actions { ) -> Result<(), Error> { if let Err(Error::Reset(stream_id, reason, initiator)) = res { debug_assert_eq!(stream_id, stream.id); - // Reset the stream. - self.send - .send_reset(reason, initiator, buffer, stream, counts, &mut self.task); - Ok(()) + + if counts.can_inc_num_local_error_resets() { + counts.inc_num_local_error_resets(); + + // Reset the stream. + self.send + .send_reset(reason, initiator, buffer, stream, counts, &mut self.task); + Ok(()) + } else { + tracing::warn!( + "reset_on_recv_stream_err; locally-reset streams reached limit ({:?})", + counts.max_local_error_resets().unwrap(), + ); + Err(Error::library_go_away_data( + Reason::ENHANCE_YOUR_CALM, + "too_many_internal_resets", + )) + } } else { res } diff --git a/vendor/h2/src/server.rs b/vendor/h2/src/server.rs index bb20adc5d..3c945726b 100644 --- a/vendor/h2/src/server.rs +++ b/vendor/h2/src/server.rs @@ -252,6 +252,12 @@ pub struct Builder { /// Maximum amount of bytes to "buffer" for writing per stream. max_send_buffer_size: usize, + + /// Maximum number of locally reset streams due to protocol error across + /// the lifetime of the connection. + /// + /// When this gets exceeded, we issue GOAWAYs. + local_max_error_reset_streams: Option, } /// Send a response back to the client @@ -650,6 +656,8 @@ impl Builder { settings: Settings::default(), initial_target_connection_window_size: None, max_send_buffer_size: proto::DEFAULT_MAX_SEND_BUFFER_SIZE, + + local_max_error_reset_streams: Some(proto::DEFAULT_LOCAL_RESET_COUNT_MAX), } } @@ -887,6 +895,24 @@ impl Builder { self } + /// Sets the maximum number of local resets due to protocol errors made by the remote end. + /// + /// Invalid frames and many other protocol errors will lead to resets being generated for those streams. + /// Too many of these often indicate a malicious client, and there are attacks which can abuse this to DOS servers. + /// This limit protects against these DOS attacks by limiting the amount of resets we can be forced to generate. + /// + /// When the number of local resets exceeds this threshold, the server will issue GOAWAYs with an error code of + /// `ENHANCE_YOUR_CALM` to the client. + /// + /// If you really want to disable this, supply [`Option::None`] here. + /// Disabling this is not recommended and may expose you to DOS attacks. + /// + /// The default value is currently 1024, but could change. + pub fn max_local_error_reset_streams(&mut self, max: Option) -> &mut Self { + self.local_max_error_reset_streams = max; + self + } + /// Sets the maximum number of pending-accept remotely-reset streams. /// /// Streams that have been received by the peer, but not accepted by the @@ -1361,6 +1387,9 @@ where reset_stream_duration: self.builder.reset_stream_duration, reset_stream_max: self.builder.reset_stream_max, remote_reset_stream_max: self.builder.pending_accept_reset_stream_max, + local_error_reset_streams_max: self + .builder + .local_max_error_reset_streams, settings: self.builder.settings.clone(), }, ); diff --git a/vendor/hermit-abi/.cargo-checksum.json b/vendor/hermit-abi/.cargo-checksum.json index 52bfa75c9..4f90a67df 100644 --- a/vendor/hermit-abi/.cargo-checksum.json +++ b/vendor/hermit-abi/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2fdd312de10adc759afb2008d22aa716f275f7ac82b517cafd2adfcf62fb4f14","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"d18b009fb1ac087d121ce82ea4a0f557d63b8641f4be4316ad105b00bf85867d","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"ce3e2dc736b3d369a80de2645ed5bb10779c236b5ad12e17d7e257d73780aada","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"} \ No newline at end of file +{"files":{"Cargo.toml":"2069506e4908d8c69fbc0eb95d28f40f08d45eb7c02d61aaf994d15b21f8517d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"d18b009fb1ac087d121ce82ea4a0f557d63b8641f4be4316ad105b00bf85867d","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"e5c10fb93ec32899f8a32c8cf80a2ea9eaccf51d3e5a15ffb69d74eca99e0ac5","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f"} \ No newline at end of file diff --git a/vendor/hermit-abi/Cargo.toml b/vendor/hermit-abi/Cargo.toml index b0c3a354c..b67166b17 100644 --- a/vendor/hermit-abi/Cargo.toml +++ b/vendor/hermit-abi/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" authors = ["Stefan Lankes"] description = "Hermit system calls definitions." readme = "README.md" diff --git a/vendor/hermit-abi/src/lib.rs b/vendor/hermit-abi/src/lib.rs index 0521b2bad..0c2664dc4 100644 --- a/vendor/hermit-abi/src/lib.rs +++ b/vendor/hermit-abi/src/lib.rs @@ -10,7 +10,8 @@ pub mod errno; pub mod tcplistener; pub mod tcpstream; -use core::ffi::{c_int, c_void}; +pub use self::errno::*; +pub use core::ffi::{c_int, c_short, c_void}; /// A thread handle type pub type Tid = u32; @@ -54,6 +55,12 @@ pub const O_CREAT: i32 = 0o100; pub const O_EXCL: i32 = 0o200; pub const O_TRUNC: i32 = 0o1000; pub const O_APPEND: i32 = 0o2000; +pub const F_DUPFD: i32 = 0; +pub const F_GETFD: i32 = 1; +pub const F_SETFD: i32 = 2; +pub const F_GETFL: i32 = 3; +pub const F_SETFL: i32 = 4; +pub const FD_CLOEXEC: i32 = 1; /// returns true if file descriptor `fd` is a tty pub fn isatty(_fd: c_int) -> bool { @@ -145,6 +152,8 @@ pub const POLLHUP: i16 = 0x10; pub const POLLNVAL: i16 = 0x20; pub const POLLRDNORM: i16 = 0x040; pub const POLLRDBAND: i16 = 0x080; +pub const POLLWRNORM: u16 = 0x0100; +pub const POLLWRBAND: u16 = 0x0200; pub const POLLRDHUP: i16 = 0x2000; pub type sa_family_t = u8; pub type socklen_t = u32; @@ -253,40 +262,49 @@ pub struct pollfd { } #[repr(C)] -pub struct dirent { - pub d_ino: u64, - pub d_off: u64, - pub d_namelen: u32, - pub d_type: u32, - pub d_name: [u8; 0], -} - -#[repr(C)] -#[derive(Copy, Clone, Debug)] -pub enum DirectoryEntry { - Invalid(i32), - Valid(*const dirent), -} - -#[repr(C)] -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Default, Copy, Clone)] pub struct stat { pub st_dev: u64, pub st_ino: u64, pub st_nlink: u64, + /// access permissions pub st_mode: u32, + /// user id pub st_uid: u32, + /// group id pub st_gid: u32, + /// device id pub st_rdev: u64, - pub st_size: i64, + /// size in bytes + pub st_size: u64, + /// block size pub st_blksize: i64, + /// size in blocks pub st_blocks: i64, - pub st_atime: i64, - pub st_atime_nsec: i64, - pub st_mtime: i64, - pub st_mtime_nsec: i64, - pub st_ctime: i64, - pub st_ctime_nsec: i64, + /// time of last access + pub st_atime: u64, + pub st_atime_nsec: u64, + /// time of last modification + pub st_mtime: u64, + pub st_mtime_nsec: u64, + /// time of last status change + pub st_ctime: u64, + pub st_ctime_nsec: u64, +} + +#[repr(C)] +#[derive(Debug, Clone, Copy)] +pub struct dirent64 { + /// 64-bit inode number + pub d_ino: u64, + /// 64-bit offset to next structure + pub d_off: i64, + /// Size of this dirent + pub d_reclen: u16, + /// File type + pub d_type: u8, + /// Filename (null-terminated) + pub d_name: core::marker::PhantomData, } pub const DT_UNKNOWN: u32 = 0; @@ -299,10 +317,10 @@ pub const DT_LNK: u32 = 10; pub const DT_SOCK: u32 = 12; pub const DT_WHT: u32 = 14; -pub const S_IFDIR: u32 = 16384; -pub const S_IFREG: u32 = 32768; -pub const S_IFLNK: u32 = 40960; -pub const S_IFMT: u32 = 61440; +pub const S_IFDIR: u32 = 0x4000; +pub const S_IFREG: u32 = 0x8000; +pub const S_IFLNK: u32 = 0xA000; +pub const S_IFMT: u32 = 0xF000; // sysmbols, which are part of the library operating system extern "C" { @@ -559,11 +577,10 @@ extern "C" { #[link_name = "sys_read"] pub fn read(fd: i32, buf: *mut u8, len: usize) -> isize; - /// 'readdir' returns a pointer to a dirent structure - /// representing the next directory entry in the directory stream - /// pointed to by the file descriptor - #[link_name = "sys_readdir"] - pub fn readdir(fd: i32) -> DirectoryEntry; + /// `getdents64` reads directory entries from the directory referenced + /// by the file descriptor `fd` into the buffer pointed to by `buf`. + #[link_name = "sys_getdents64"] + pub fn getdents64(fd: i32, dirp: *mut dirent64, count: usize) -> i64; /// 'mkdir' attempts to create a directory, /// it returns 0 on success and -1 on error diff --git a/vendor/home/.cargo-checksum.json b/vendor/home/.cargo-checksum.json index 2b46217b3..89ae0bd18 100644 --- a/vendor/home/.cargo-checksum.json +++ b/vendor/home/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2e05a776e06aef93bcc4e952c0d461155c62a720b98e3b5acf50bb5f432979c2","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"132d9e72011322528376c46965004ffb3d1be30841eb6ff5683a4a75deb35b37","src/env.rs":"4e8bd91330f6ae948f5b825e9884720631f4fe9282fb4548915218e1c43b54a5","src/lib.rs":"e884458a0797dcc70333b61c32503509659c165e81ee770553b616176b00df2c","src/windows.rs":"8eecb82021862b4fd04a1f85e14ad5069d8e49c68bb6bcddc57ae598b5bae826"},"package":"5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"} \ No newline at end of file +{"files":{"Cargo.toml":"f7861a9fdbed65ce6969d3baa0ebf300c01723d4c2f79bc30f49aad2d1b2445b","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"132d9e72011322528376c46965004ffb3d1be30841eb6ff5683a4a75deb35b37","src/env.rs":"de5ce25abee28dca6dc4af52257ed6dc230c2a09c587a361a2dda2ffec8f2bd9","src/lib.rs":"f986d439da63d1597057be177b7ffde982c3081b5ed967f0dcaed99d3490a0b2","src/windows.rs":"bfc979fb1db4bea3a13b5a9e987c8a0f19cfdf88aa1e66576a357394eefa26bd"},"package":"e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"} \ No newline at end of file diff --git a/vendor/home/Cargo.toml b/vendor/home/Cargo.toml index cd608b175..93e3432df 100644 --- a/vendor/home/Cargo.toml +++ b/vendor/home/Cargo.toml @@ -10,9 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" +edition = "2021" +rust-version = "1.70.0" name = "home" -version = "0.5.5" +version = "0.5.9" authors = ["Brian Anderson "] include = [ "/src", @@ -26,11 +27,28 @@ documentation = "https://docs.rs/home" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" -resolver = "2" [target."cfg(windows)".dependencies.windows-sys] -version = "0.48.0" +version = "0.52" features = [ "Win32_Foundation", "Win32_UI_Shell", + "Win32_System_Com", ] + +[lints.clippy] +dbg_macro = "warn" +disallowed_methods = "warn" +print_stderr = "warn" +print_stdout = "warn" +self_named_module_files = "warn" + +[lints.clippy.all] +level = "allow" +priority = -1 + +[lints.rust] +rust_2018_idioms = "warn" + +[lints.rustdoc] +private_intra_doc_links = "allow" diff --git a/vendor/home/src/env.rs b/vendor/home/src/env.rs index e47273bc8..49fea5422 100644 --- a/vendor/home/src/env.rs +++ b/vendor/home/src/env.rs @@ -9,7 +9,7 @@ use std::{ /// Permits parameterizing the home functions via the _from variants - used for /// in-process unit testing by rustup. pub trait Env { - /// Return the path to the the users home dir, or None if any error occurs: + /// Return the path to the users home dir, or None if any error occurs: /// see home_inner. fn home_dir(&self) -> Option; /// Return the current working directory. diff --git a/vendor/home/src/lib.rs b/vendor/home/src/lib.rs index a8af963f3..bbe7c32ca 100644 --- a/vendor/home/src/lib.rs +++ b/vendor/home/src/lib.rs @@ -1,14 +1,5 @@ //! Canonical definitions of `home_dir`, `cargo_home`, and `rustup_home`. //! -//! This provides the definition of `home_dir` used by Cargo and -//! rustup, as well functions to find the correct value of -//! `CARGO_HOME` and `RUSTUP_HOME`. -//! -//! See also the [`dirs`](https://docs.rs/dirs) crate. -//! -//! _Note that as of 2019/08/06 it appears that cargo uses this crate. And -//! rustup has used this crate since 2019/08/21._ -//! //! The definition of `home_dir` provided by the standard library is //! incorrect because it considers the `HOME` environment variable on //! Windows. This causes surprising situations where a Rust program @@ -17,16 +8,17 @@ //! rustup use the standard libraries definition - they use the //! definition here. //! -//! This crate further provides two functions, `cargo_home` and +//! This crate provides two additional functions, `cargo_home` and //! `rustup_home`, which are the canonical way to determine the -//! location that Cargo and rustup store their data. +//! location that Cargo and rustup use to store their data. +//! The `env` module contains utilities for mocking the process environment +//! by Cargo and rustup. //! //! See also this [discussion]. //! //! [discussion]: https://github.com/rust-lang/rust/pull/46799#issuecomment-361156935 -#![doc(html_root_url = "https://docs.rs/home/0.5.5")] -#![deny(rust_2018_idioms)] +#![allow(clippy::disallowed_methods)] pub mod env; @@ -36,29 +28,34 @@ mod windows; use std::io; use std::path::{Path, PathBuf}; -/// Returns the path of the current user's home directory if known. +/// Returns the path of the current user's home directory using environment +/// variables or OS-specific APIs. /// /// # Unix /// /// Returns the value of the `HOME` environment variable if it is set -/// and not equal to the empty string. Otherwise, it tries to determine the -/// home directory by invoking the `getpwuid_r` function on the UID of the -/// current user. +/// **even** if it is an empty string. Otherwise, it tries to determine the +/// home directory by invoking the [`getpwuid_r`][getpwuid] function with +/// the UID of the current user. +/// +/// [getpwuid]: https://linux.die.net/man/3/getpwuid_r /// /// # Windows /// -/// Returns the value of the `USERPROFILE` environment variable if it -/// is set and not equal to the empty string. If both do not exist, -/// [`SHGetFolderPathW`][msdn] is used to return the appropriate path. +/// Returns the value of the `USERPROFILE` environment variable if it is set +/// **and** it is not an empty string. Otherwise, it tries to determine the +/// home directory by invoking the [`SHGetKnownFolderPath`][shgkfp] function with +/// [`FOLDERID_Profile`][knownfolderid]. /// -/// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw +/// [shgkfp]: https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath +/// [knownfolderid]: https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid /// /// # Examples /// /// ``` /// match home::home_dir() { -/// Some(path) => println!("{}", path.display()), -/// None => println!("Impossible to get your home dir!"), +/// Some(path) if !path.as_os_str().is_empty() => println!("{}", path.display()), +/// _ => println!("Unable to get your home dir!"), /// } /// ``` pub fn home_dir() -> Option { diff --git a/vendor/home/src/windows.rs b/vendor/home/src/windows.rs index a35dc9c57..c9a63d97b 100644 --- a/vendor/home/src/windows.rs +++ b/vendor/home/src/windows.rs @@ -2,9 +2,12 @@ use std::env; use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; use std::path::PathBuf; +use std::ptr; +use std::slice; -use windows_sys::Win32::Foundation::{MAX_PATH, S_OK}; -use windows_sys::Win32::UI::Shell::{SHGetFolderPathW, CSIDL_PROFILE}; +use windows_sys::Win32::Foundation::S_OK; +use windows_sys::Win32::System::Com::CoTaskMemFree; +use windows_sys::Win32::UI::Shell::{FOLDERID_Profile, SHGetKnownFolderPath, KF_FLAG_DONT_VERIFY}; pub fn home_dir_inner() -> Option { env::var_os("USERPROFILE") @@ -16,15 +19,19 @@ pub fn home_dir_inner() -> Option { #[cfg(not(target_vendor = "uwp"))] fn home_dir_crt() -> Option { unsafe { - let mut path: Vec = Vec::with_capacity(MAX_PATH as usize); - match SHGetFolderPathW(0, CSIDL_PROFILE as i32, 0, 0, path.as_mut_ptr()) { + let mut path = ptr::null_mut(); + match SHGetKnownFolderPath(&FOLDERID_Profile, KF_FLAG_DONT_VERIFY as u32, 0, &mut path) { S_OK => { - let len = wcslen(path.as_ptr()); - path.set_len(len); - let s = OsString::from_wide(&path); + let path_slice = slice::from_raw_parts(path, wcslen(path)); + let s = OsString::from_wide(&path_slice); + CoTaskMemFree(path.cast()); Some(PathBuf::from(s)) } - _ => None, + _ => { + // Free any allocated memory even on failure. A null ptr is a no-op for `CoTaskMemFree`. + CoTaskMemFree(path.cast()); + None + } } } } diff --git a/vendor/http-body/.cargo-checksum.json b/vendor/http-body/.cargo-checksum.json index dd8581af9..a3d29455a 100644 --- a/vendor/http-body/.cargo-checksum.json +++ b/vendor/http-body/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"b225eb6c706ab729255efa55603551151216b9e5f96dd722469ff5f28d843338","Cargo.toml":"037a31b6a59c860c5fe9860ba07b91f0141311453af66275b6d1336db2b1b1fb","LICENSE":"0345e2b98685e3807fd802a2478085dcae35023e3da59b5a00f712504314d83a","README.md":"0f90f61ee419eefd4104005ef6900445fafce9a710dd1989463f3cebaf0fafe8","src/combinators/box_body.rs":"d27dfa9f289c9c8d1fe714415fb5df5bdaafafb80a5cff66fbbe720841e806bf","src/combinators/map_data.rs":"3063f44d1318feeec639eff6544e7fb91ad9abf9a295770af4cc69b48a691796","src/combinators/map_err.rs":"9db485a5904579147673ac7f9f347e322d283d95a421daaf5541d048045eec7e","src/combinators/mod.rs":"c9e32f64ab2f4866d14256fff4256ba61d4c1bcfaf2748754c561de3abe1eccd","src/empty.rs":"3e44cee68410101cb8bf88c0de504885075c084357e83bcd3a6761ba5c7c58d2","src/full.rs":"efcbf6831d32271170e2ed86c328bfb887aec0c93689f1218ab5a18c319b0fa8","src/lib.rs":"140ff217ecf7e361b9f083dc664f1d65be176b235a71fdb1e8031eafda989a38","src/limited.rs":"485fc1c58bba29d2c7afdb4a032cd0e3c3578979ccd71f7459ddcd67e0f16077","src/next.rs":"d6863067b20c4bb42dced5c17bd954816b1338ce53e8d34ab81dbe240a1601cf","src/size_hint.rs":"017ed58c59b446b93aa4922e35b596490bf8f03af37c631610cc6576f1c21439","tests/is_end_stream.rs":"3a66d80d064f8a447bfa9fd212c2f91855604b1b41f554da3a029bc4a5be3a7e"},"package":"d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"} \ No newline at end of file +{"files":{"CHANGELOG.md":"07aa2743e33442fdd69d4c8beeaaba938a3f177b5a48922886c5cd07c2f1a72d","Cargo.toml":"451b4b8125ced2429c8d2c6c33d972fab2dc3b59365bb38fe6e7f4d14613e44e","LICENSE":"0345e2b98685e3807fd802a2478085dcae35023e3da59b5a00f712504314d83a","README.md":"0f90f61ee419eefd4104005ef6900445fafce9a710dd1989463f3cebaf0fafe8","src/collect.rs":"a71ea9be6aa7100df2bb3520507ad8ebaede8ea5339310a63a0cd03081e14122","src/combinators/box_body.rs":"d27dfa9f289c9c8d1fe714415fb5df5bdaafafb80a5cff66fbbe720841e806bf","src/combinators/map_data.rs":"3063f44d1318feeec639eff6544e7fb91ad9abf9a295770af4cc69b48a691796","src/combinators/map_err.rs":"9db485a5904579147673ac7f9f347e322d283d95a421daaf5541d048045eec7e","src/combinators/mod.rs":"c9e32f64ab2f4866d14256fff4256ba61d4c1bcfaf2748754c561de3abe1eccd","src/empty.rs":"3e44cee68410101cb8bf88c0de504885075c084357e83bcd3a6761ba5c7c58d2","src/full.rs":"efcbf6831d32271170e2ed86c328bfb887aec0c93689f1218ab5a18c319b0fa8","src/lib.rs":"2fa07ea03a0afede091ea4bc02a70025754ce1b28a48d7269637a5397ded3df1","src/limited.rs":"485fc1c58bba29d2c7afdb4a032cd0e3c3578979ccd71f7459ddcd67e0f16077","src/next.rs":"d6863067b20c4bb42dced5c17bd954816b1338ce53e8d34ab81dbe240a1601cf","src/size_hint.rs":"017ed58c59b446b93aa4922e35b596490bf8f03af37c631610cc6576f1c21439","tests/is_end_stream.rs":"3a66d80d064f8a447bfa9fd212c2f91855604b1b41f554da3a029bc4a5be3a7e"},"package":"7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"} \ No newline at end of file diff --git a/vendor/http-body/CHANGELOG.md b/vendor/http-body/CHANGELOG.md index 4708a2007..bdb3a2515 100644 --- a/vendor/http-body/CHANGELOG.md +++ b/vendor/http-body/CHANGELOG.md @@ -1,6 +1,6 @@ -# Unreleased +# 0.4.6 (December 8, 2023) -None. +- Add `Collect` combinator (backported from http-body-util). # 0.4.5 (May 20, 2022) diff --git a/vendor/http-body/Cargo.toml b/vendor/http-body/Cargo.toml index 202ce7de8..8a6a94ba6 100644 --- a/vendor/http-body/Cargo.toml +++ b/vendor/http-body/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "http-body" -version = "0.4.5" +version = "0.4.6" authors = [ "Carl Lerche ", "Lucio Franco ", diff --git a/vendor/http-body/src/collect.rs b/vendor/http-body/src/collect.rs new file mode 100644 index 000000000..b065fffc9 --- /dev/null +++ b/vendor/http-body/src/collect.rs @@ -0,0 +1,222 @@ +use std::{ + collections::VecDeque, + future::Future, + pin::Pin, + task::{Context, Poll}, +}; + +use super::Body; + +use bytes::{Buf, Bytes}; +use http::HeaderMap; +use pin_project_lite::pin_project; + +pin_project! { + /// Future that resolves into a [`Collected`]. + pub struct Collect + where + T: Body, + { + #[pin] + body: T, + collected: Option>, + is_data_done: bool, + } +} + +impl Collect { + pub(crate) fn new(body: T) -> Self { + Self { + body, + collected: Some(Collected::default()), + is_data_done: false, + } + } +} + +impl Future for Collect { + type Output = Result, T::Error>; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let mut me = self.project(); + + loop { + if !*me.is_data_done { + match me.body.as_mut().poll_data(cx) { + Poll::Ready(Some(Ok(data))) => { + me.collected.as_mut().unwrap().push_data(data); + } + Poll::Ready(Some(Err(err))) => { + return Poll::Ready(Err(err)); + } + Poll::Ready(None) => { + *me.is_data_done = true; + } + Poll::Pending => return Poll::Pending, + } + } else { + match me.body.as_mut().poll_trailers(cx) { + Poll::Ready(Ok(Some(trailers))) => { + me.collected.as_mut().unwrap().push_trailers(trailers); + break; + } + Poll::Ready(Err(err)) => { + return Poll::Ready(Err(err)); + } + Poll::Ready(Ok(None)) => break, + Poll::Pending => return Poll::Pending, + } + } + } + + Poll::Ready(Ok(me.collected.take().expect("polled after complete"))) + } +} + +/// A collected body produced by [`Body::collect`] which collects all the DATA frames +/// and trailers. +#[derive(Debug)] +pub struct Collected { + bufs: BufList, + trailers: Option, +} + +impl Collected { + /// If there is a trailers frame buffered, returns a reference to it. + /// + /// Returns `None` if the body contained no trailers. + pub fn trailers(&self) -> Option<&HeaderMap> { + self.trailers.as_ref() + } + + /// Aggregate this buffered into a [`Buf`]. + pub fn aggregate(self) -> impl Buf { + self.bufs + } + + /// Convert this body into a [`Bytes`]. + pub fn to_bytes(mut self) -> Bytes { + self.bufs.copy_to_bytes(self.bufs.remaining()) + } + + fn push_data(&mut self, data: B) { + // Only push this frame if it has some data in it, to avoid crashing on + // `BufList::push`. + if data.has_remaining() { + self.bufs.push(data); + } + } + + fn push_trailers(&mut self, trailers: HeaderMap) { + if let Some(current) = &mut self.trailers { + current.extend(trailers); + } else { + self.trailers = Some(trailers); + } + } +} + +impl Default for Collected { + fn default() -> Self { + Self { + bufs: BufList::default(), + trailers: None, + } + } +} + +impl Unpin for Collected {} + +#[derive(Debug)] +struct BufList { + bufs: VecDeque, +} + +impl BufList { + #[inline] + pub(crate) fn push(&mut self, buf: T) { + debug_assert!(buf.has_remaining()); + self.bufs.push_back(buf); + } + + /* + #[inline] + pub(crate) fn pop(&mut self) -> Option { + self.bufs.pop_front() + } + */ +} + +impl Buf for BufList { + #[inline] + fn remaining(&self) -> usize { + self.bufs.iter().map(|buf| buf.remaining()).sum() + } + + #[inline] + fn chunk(&self) -> &[u8] { + self.bufs.front().map(Buf::chunk).unwrap_or_default() + } + + #[inline] + fn advance(&mut self, mut cnt: usize) { + while cnt > 0 { + { + let front = &mut self.bufs[0]; + let rem = front.remaining(); + if rem > cnt { + front.advance(cnt); + return; + } else { + front.advance(rem); + cnt -= rem; + } + } + self.bufs.pop_front(); + } + } + + #[inline] + fn chunks_vectored<'t>(&'t self, dst: &mut [std::io::IoSlice<'t>]) -> usize { + if dst.is_empty() { + return 0; + } + let mut vecs = 0; + for buf in &self.bufs { + vecs += buf.chunks_vectored(&mut dst[vecs..]); + if vecs == dst.len() { + break; + } + } + vecs + } + + #[inline] + fn copy_to_bytes(&mut self, len: usize) -> Bytes { + use bytes::{BufMut, BytesMut}; + // Our inner buffer may have an optimized version of copy_to_bytes, and if the whole + // request can be fulfilled by the front buffer, we can take advantage. + match self.bufs.front_mut() { + Some(front) if front.remaining() == len => { + let b = front.copy_to_bytes(len); + self.bufs.pop_front(); + b + } + Some(front) if front.remaining() > len => front.copy_to_bytes(len), + _ => { + assert!(len <= self.remaining(), "`len` greater than remaining"); + let mut bm = BytesMut::with_capacity(len); + bm.put(self.take(len)); + bm.freeze() + } + } + } +} + +impl Default for BufList { + fn default() -> Self { + BufList { + bufs: VecDeque::new(), + } + } +} diff --git a/vendor/http-body/src/lib.rs b/vendor/http-body/src/lib.rs index 84efd9169..2535cda16 100644 --- a/vendor/http-body/src/lib.rs +++ b/vendor/http-body/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/http-body/0.4.5")] +#![doc(html_root_url = "https://docs.rs/http-body/0.4.6")] #![deny( missing_debug_implementations, missing_docs, @@ -13,6 +13,7 @@ //! //! [`Body`]: trait.Body.html +mod collect; mod empty; mod full; mod limited; @@ -21,6 +22,7 @@ mod size_hint; pub mod combinators; +pub use self::collect::Collected; pub use self::empty::Empty; pub use self::full::Full; pub use self::limited::{LengthLimitError, Limited}; @@ -118,6 +120,15 @@ pub trait Body { MapErr::new(self, f) } + /// Turn this body into [`Collected`] body which will collect all the DATA frames + /// and trailers. + fn collect(self) -> crate::collect::Collect + where + Self: Sized, + { + collect::Collect::new(self) + } + /// Turn this body into a boxed trait object. fn boxed(self) -> BoxBody where diff --git a/vendor/hyper/.cargo-checksum.json b/vendor/hyper/.cargo-checksum.json index 79ea0a393..68a77970b 100644 --- a/vendor/hyper/.cargo-checksum.json +++ b/vendor/hyper/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"1be9dfabcde208feb57553a3d6d3321698fa18fac73a64792f915899a1b32939","Cargo.toml":"7e58dd0976adc46d64fe79af2d82ba853ad0dbbde91edb62e639cfd3ea316dc2","LICENSE":"25dfd9ec24ebbee73dc93e687526cd4c26deae17bc2179ea0fe3e5dc96105b9b","src/body/aggregate.rs":"bcba09b9dd91deee04f17383cb0d7ac5d876f8d462e08031cd3dfca205f1d118","src/body/body.rs":"67471d4cfd7bebbe88da504062f88afe52668ca381cb9845e71697128099fded","src/body/length.rs":"2d186f50f05b0562db92d3e1d272521c60c9ad259222ccb1a9310b1ff380a64e","src/body/mod.rs":"2870b04df5eef6a307a6f4699f99dbad54f5373bc95da4e6b29277efb645058f","src/body/to_bytes.rs":"7e0f7626545394459443c1d6fdbd526623d6b9856e7fc713006949c063ef6a97","src/cfg.rs":"de5fee5bba45a982c10e8f09fc24677be5494bf6da0b39a3a132f0f6eb3fe41e","src/client/client.rs":"fceac1f669d17ae17ac5fe447c384576c7d69867a41fd6a1bed5b6a31d015bc2","src/client/conn.rs":"3ca8efb16022db9f29d2059b9f353aa80daa7aa39e7bc1fac1e24907dde4f4de","src/client/conn/http1.rs":"50f7a6c0765a3a0e605fa3676e50124091e3984a1b0988af2da03bee19d29c22","src/client/conn/http2.rs":"e5186ffe0cc1f5d3ba88f5fd294357a5881eb36c6e205d129a67f0f0df6312e3","src/client/connect/dns.rs":"f3167a4e4fff56cbc2bcbd5b0eb6a15d5e3c7c002af2a11b7ecd055179535cf2","src/client/connect/http.rs":"57e8fcff426c38088f534d5118cd8bb8010936f7c50846e95a70cf84805b05d7","src/client/connect/mod.rs":"b02a39367686ca803d1190ee197051bc6b853fa2fb2a9aae7033fff603a65ecb","src/client/dispatch.rs":"7db545e8761522300cf9bf03abdc8166f45a726aeb4a228e61f161c7c4ed99f8","src/client/mod.rs":"d5580cda5e7dc9c5240c72a9ea0005d34b5412c28067ab3fa2301ba4cf49d9fa","src/client/pool.rs":"bffee52b070689466f88d2fe7044f4571e59ddae4e5c91adce7dbfd298ccbd54","src/client/service.rs":"78b0735027f148b8c23aaa58ee4b70f5b8bf442e1c6162380798d526dc74447f","src/client/tests.rs":"f7eb2d1dba18e1bd69990f59e61b73a0477db5cc4de68fd64bd7cd36a9406072","src/common/buf.rs":"c762dc2688828ffc88f0549ceddeef65e57d404c245118bcacf3dd8d402bc9cc","src/common/date.rs":"f9a1a63aa7e8f5d6f5800cd56e7e6182cf07e781089930afb529263c1d8adf14","src/common/drain.rs":"262b64cc88e9146dfa3732a25ddb22dfef7cf801cebbd87fc1234b5e3e1d62bd","src/common/exec.rs":"c9e24d6c624b9c237bcdea7c59c60c9b8539510ac053cad50e861567cea3e17b","src/common/io/mod.rs":"6f8e4518df7f24d81fc59b46a2deb61557e8d92700bdc62539fe0f034066fc89","src/common/io/rewind.rs":"be62d6a591a46bcc8a15fc62b8c9cdb6b84a0924a397b1e32d87e2029f57468d","src/common/lazy.rs":"f1a7ccad912492c23238f4c854e01b77e81db864455842cdc2890d76e464ff20","src/common/mod.rs":"76576a0b5a2fae70e40e397290314181c60bd548b6d8993ffd265ce6f305f343","src/common/never.rs":"b45b6a85f827081cdb7884907e7884c78540308102072dae563320acce8185fa","src/common/sync_wrapper.rs":"76206c2a52eeb62cdba279d620a4aef52134c6ac782a9f61e741edc8b653cb50","src/common/task.rs":"fd6444762d25ea6beb3b9f73bacf3b47c9f3f87e8e2037f58788b5d54767ce94","src/common/watch.rs":"eb6db13fbb266ec11200ffa1f5e7a9a132d7e6555373895efde1e2daea428e03","src/error.rs":"d3f3c8e2303c964904e84a4bf8b93ff6b036c8918bac2bd66edac5fd5967c7e3","src/ext.rs":"19a65a25be9b821ad4088583f712d4d7f388096ec9d69b33f40129c9945afe2c","src/ext/h1_reason_phrase.rs":"e1d18088f942b52dbee766d81e11a9caeadaf368ff12b58d53b97fc62d08876c","src/ffi/body.rs":"941fb8b79097e5a4eec0c611a1cd5db24bed3479f1a14cf754e33d19f6d25854","src/ffi/client.rs":"6b35700e9dec4a9cb40ad3155327bd6fe11165e0cef1874a3916cf96d8b0c7a6","src/ffi/error.rs":"de3d8c1eb3818b438ed28a9dea800dfdac47bf2dd21a7c3e5fc10cb331b6e39f","src/ffi/http_types.rs":"ae25e0fd07ec80e90d5b4f488ce972fe7858f009261fdf16a35b2bd0b1bbdad3","src/ffi/io.rs":"ab176e866c179a589d22e3aa7410612615e60117019d1e589f9732c36a2282da","src/ffi/macros.rs":"8e1fe58244295db1d19aceeb0e9a777fe484ccc20194fae88b54208e0cbeb515","src/ffi/mod.rs":"0e52ae3586c6a960ae68e862561aabcee690a1e23c6d5d1045fcdc3c74b7fc96","src/ffi/task.rs":"f348cdbe1f1d4e26b339cd9382bb739b0f37aaceb2aa85627b7fda0c6326de56","src/headers.rs":"edc1362c894a38eb4d401cbb88485a846bcf0e748a38048f00d4e6da49d1ddf6","src/lib.rs":"4014d93b86bda6a5f9beaed8f98b152a9d5d67517f08bbe1aa04e2f078f80553","src/mock.rs":"8b455312be74af6c4a27b3beba85a9493c86d43097947c5aad8a5e9dc0dcdbb3","src/proto/h1/conn.rs":"3f9eaffc4fb804f772401e115768ab3a6610ade41e6ba6a4cc2b16e549abb681","src/proto/h1/decode.rs":"73ddd8ffcec24a4c943d86996d43f7367c59bb44b57e804ee711ff8ba97593ef","src/proto/h1/dispatch.rs":"8d34da904590829ad8fb9a0851c2845310e04f8e70f68501b6d31a971bb16b96","src/proto/h1/encode.rs":"3a360356431ff3f011226cf81fb4eeb63cfe9ca25140e41e2e3907f6d64725f9","src/proto/h1/io.rs":"9ce45ac778fddffaaeaa4b20810b162ae0964399e756c51227d2b99d0f27a74e","src/proto/h1/mod.rs":"61ec22d19567116aadc365ca424c958744b058b55d2f064b9a74ee88b126c7be","src/proto/h1/role.rs":"60ecf2caad5d54f78234a12b58eb75d9fb72509313f194b9475301ad60756262","src/proto/h2/client.rs":"75a8f6ee466e65c64dc574c5bbdae52b0c3ea24c792950b4c1e45006dd1265d1","src/proto/h2/mod.rs":"a142cc41c9e8403d25ad1fb4ad93fc2182705858d95859f116adb8704256263a","src/proto/h2/ping.rs":"81620d250ba4f5e5e6782937415d6eb49623bb5b2a6dd73b643a18dfdcdec2c0","src/proto/h2/server.rs":"19af9637e4c20f76cca145aff592ed0526429bd259e92e2a70d26b5460789882","src/proto/mod.rs":"54810a69162af5ebc370e14c0f89b94bf111412470bbe3c1e341809edf2f1ad1","src/rt.rs":"1ef7d4bb3ad6637c6f37189e30d740c061a3c98ca008d266a99f865130909427","src/server/accept.rs":"9a78398b0e9d8104248288b39cbcda8f9968a866214b7d793e548a5cf359752e","src/server/conn.rs":"173bfcd93fe04a85739a0a2d024f8d236cf3953fd854f38f39d83fee9a160ff5","src/server/conn/http1.rs":"a3ab4489651fd5b18d313702a7100a8b157e5f47b12a8f1dfcda35dfa1ca428c","src/server/conn/http2.rs":"05d4c39db3a6e61d355f6c26aa0864cbfaf2d8cd48409c6a27d799bf29f62572","src/server/mod.rs":"2375370854ac8ae5b80378aa1e29bc781c50aad1d1150c32515393a3316b745c","src/server/server.rs":"f3c98d8e9fc0163da249405376875a47b95e9c8f44afa0c3b97305db87741223","src/server/server_stub.rs":"ab443f51ede637e0b0c08f36fbc143a34935102af2921edcc257660eeaad4537","src/server/shutdown.rs":"47957254c34dd351bf6b7aca55f5ec83a990e3ca9310197d3099052b6e05abd3","src/server/tcp.rs":"14f522a73a9d1c1dbee34a80fb0921ad0dfc4a9f44b0a5d1012c8455ac393e2b","src/service/http.rs":"3e7c2c49e5710f9229d7b01f6f7a4e9f5c7c7360f14870f726aa470311998e65","src/service/make.rs":"7e3d956fd0602b47d3adc520f9a614cb047323d3d162faf9162066dccefe4d11","src/service/mod.rs":"92c05f08a175fb847868a02e7aca96176df1237458d40a17a7a6aa377476df90","src/service/oneshot.rs":"871b51c455d58dd3a6db85bd60e3a663d914ee748fe0c455c4523407533c8b1a","src/service/util.rs":"90452fc10c8316fdc1f0227c4fcef3cfb94e4b2d8fd52ef8c0e276cd3f1cadd5","src/upgrade.rs":"668ebf06e51db3bb12f804bf7ec14c2a1dda6bcc3db57d45f81d59b4aa24f6c4"},"package":"ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"} \ No newline at end of file +{"files":{"Cargo.lock":"4ca397505ef102bb00638adc898b4bfbded735a57fa792a7d925915f30667239","Cargo.toml":"f902a0301e0322d08ab95ca777bdc1726944a59c30de0a6ae4d506fe8ab60251","LICENSE":"25dfd9ec24ebbee73dc93e687526cd4c26deae17bc2179ea0fe3e5dc96105b9b","src/body/aggregate.rs":"a4b05d775a7ef7807ce4eb3ccd0592f542398c7e14c876cb07298dc792b076e3","src/body/body.rs":"1fafdc91f9a48c19ec3eaeede79adc1b7c0162bca03efb40f85e9d7f7ed9eb3f","src/body/length.rs":"2d186f50f05b0562db92d3e1d272521c60c9ad259222ccb1a9310b1ff380a64e","src/body/mod.rs":"8098a367c239f05ba443a9b5394449142c6f144ad187f87f8d9f9cde74405b44","src/body/to_bytes.rs":"517077ed79a987c96a89f70a09eba776db5e8b867768da2ca291d28c2c0d70d2","src/cfg.rs":"de5fee5bba45a982c10e8f09fc24677be5494bf6da0b39a3a132f0f6eb3fe41e","src/client/client.rs":"00df0ef99e35d7b3b60c2da6aabee3418f2d35c45a0127ce64893331db040972","src/client/conn.rs":"1358a7b7b43588bd9863f2243ac78381d20018e530e3f8efc58fe4d7df239d04","src/client/conn/http1.rs":"9e4a9f2565f5a4bb8201d5a7321b89b6597b0a05f899da1326b72a9668639e15","src/client/conn/http2.rs":"95f2ae02b8297d48560049a5fd557d374fa6a325ac563996e88e2ae5fff0b4ec","src/client/connect/dns.rs":"98830a9163eae71cbf8d240c6e531ae98d6b51653c0d158fc1c5bddad4f7321e","src/client/connect/http.rs":"6d5b6e0d4f83ecfe66e79d1d4eb72597588af0ba70576faab2e658e3b781c09e","src/client/connect/mod.rs":"83ef7a4d8e8376bfd69321d4646ac439158f3d2c228acbc74dba208bfa0ae938","src/client/dispatch.rs":"39cac7daaf4b473c030d338e48c6fd4e4133742a06a0047ea7153e56def3cbdc","src/client/mod.rs":"d5580cda5e7dc9c5240c72a9ea0005d34b5412c28067ab3fa2301ba4cf49d9fa","src/client/pool.rs":"584f473408059b230adc1a74e80795d27b402e5de16224017157ed06694f7eab","src/client/service.rs":"e61baf9c206da67265c4fefe48fc037d65d93eebfecca68e3dc2215896ef4bd0","src/client/tests.rs":"f7eb2d1dba18e1bd69990f59e61b73a0477db5cc4de68fd64bd7cd36a9406072","src/common/buf.rs":"c762dc2688828ffc88f0549ceddeef65e57d404c245118bcacf3dd8d402bc9cc","src/common/date.rs":"f9a1a63aa7e8f5d6f5800cd56e7e6182cf07e781089930afb529263c1d8adf14","src/common/drain.rs":"058bbcf26dfeb96d7646c69e03b5a5f363b3bcee9afe0a9fe30ea52a9eb995ff","src/common/exec.rs":"c9e24d6c624b9c237bcdea7c59c60c9b8539510ac053cad50e861567cea3e17b","src/common/io/mod.rs":"6f8e4518df7f24d81fc59b46a2deb61557e8d92700bdc62539fe0f034066fc89","src/common/io/rewind.rs":"a708a373d96e7b1444d8497d57f0fe1902456fda8eb3dc42ade3a8f305880625","src/common/lazy.rs":"5cee776d65f28282e556567b433bddb908947df6601218872496ba088c2a7d12","src/common/mod.rs":"363cbf3853ffe6c4258010b17e67babdb8f518fc3cad39dc6588e7ba75587405","src/common/sync_wrapper.rs":"76206c2a52eeb62cdba279d620a4aef52134c6ac782a9f61e741edc8b653cb50","src/common/task.rs":"5a7c2b9255ab023cceedb8e42bd26db7ba8f11498d2f14d4b23a798618cbc920","src/common/watch.rs":"eb6db13fbb266ec11200ffa1f5e7a9a132d7e6555373895efde1e2daea428e03","src/error.rs":"d3f3c8e2303c964904e84a4bf8b93ff6b036c8918bac2bd66edac5fd5967c7e3","src/ext.rs":"19a65a25be9b821ad4088583f712d4d7f388096ec9d69b33f40129c9945afe2c","src/ext/h1_reason_phrase.rs":"e1d18088f942b52dbee766d81e11a9caeadaf368ff12b58d53b97fc62d08876c","src/ffi/body.rs":"941fb8b79097e5a4eec0c611a1cd5db24bed3479f1a14cf754e33d19f6d25854","src/ffi/client.rs":"6b35700e9dec4a9cb40ad3155327bd6fe11165e0cef1874a3916cf96d8b0c7a6","src/ffi/error.rs":"de3d8c1eb3818b438ed28a9dea800dfdac47bf2dd21a7c3e5fc10cb331b6e39f","src/ffi/http_types.rs":"ae25e0fd07ec80e90d5b4f488ce972fe7858f009261fdf16a35b2bd0b1bbdad3","src/ffi/io.rs":"ab176e866c179a589d22e3aa7410612615e60117019d1e589f9732c36a2282da","src/ffi/macros.rs":"8e1fe58244295db1d19aceeb0e9a777fe484ccc20194fae88b54208e0cbeb515","src/ffi/mod.rs":"0e52ae3586c6a960ae68e862561aabcee690a1e23c6d5d1045fcdc3c74b7fc96","src/ffi/task.rs":"f348cdbe1f1d4e26b339cd9382bb739b0f37aaceb2aa85627b7fda0c6326de56","src/headers.rs":"4d76596bfc90f88fe8b48bb8d0552a215a20c452197ea982b37ba30fa496e007","src/lib.rs":"4014d93b86bda6a5f9beaed8f98b152a9d5d67517f08bbe1aa04e2f078f80553","src/mock.rs":"8b455312be74af6c4a27b3beba85a9493c86d43097947c5aad8a5e9dc0dcdbb3","src/proto/h1/conn.rs":"ba7d5bb4875dbd11f622986034cab8eaa2a751235324bf7cf03bea20c66f9f00","src/proto/h1/decode.rs":"0d92ed844160099d385fa5b13afa6b8134700373b097c81f91416f7f2b800333","src/proto/h1/dispatch.rs":"da3a986e8e0d255bedac48109a31921b3faf575c6821d5f0f60dd06a24900f75","src/proto/h1/encode.rs":"3a360356431ff3f011226cf81fb4eeb63cfe9ca25140e41e2e3907f6d64725f9","src/proto/h1/io.rs":"321d845a497eb4761dbd4eedb994ae9d6e5aca7faabf3b05e83eb35cb4ebf214","src/proto/h1/mod.rs":"61ec22d19567116aadc365ca424c958744b058b55d2f064b9a74ee88b126c7be","src/proto/h1/role.rs":"60ecf2caad5d54f78234a12b58eb75d9fb72509313f194b9475301ad60756262","src/proto/h2/client.rs":"5862ca7bc2847f58ed5f57464f8eb74abe3fe89afe4bd632e575a3c51b8a8744","src/proto/h2/mod.rs":"1f3f157aaef6d91b7af8abea7f76ab1c49ee2038b71027c83f83a2648786fafc","src/proto/h2/ping.rs":"1ea4daea2317a72958879a89baecdea02fb7ab238083606461400ed9e3df0c83","src/proto/h2/server.rs":"a0a221bd960c57117da94160d9baddbbdd73ddfc06c328cd86d407bc25e07314","src/proto/mod.rs":"1a935a3da830131f848a6a64c049c559ce07e6b0012fd6e4002bb365f562ebeb","src/rt.rs":"1ef7d4bb3ad6637c6f37189e30d740c061a3c98ca008d266a99f865130909427","src/server/accept.rs":"07b9b520fbf7d8f472455412f359afdd7713fb408f88dbc050585249023fc075","src/server/conn.rs":"9b92acb5f53301cf623ffc0f347363dd6981c3deaed6c8ab425c28a3152e571b","src/server/conn/http1.rs":"af364abcd92aa78e05af83c9c606de66447170dc73276896294c4257e903a047","src/server/conn/http2.rs":"73bb19450798d804bf1b76e8ac495f9cdbad3453c009756b66f06c1e47f2f664","src/server/mod.rs":"2375370854ac8ae5b80378aa1e29bc781c50aad1d1150c32515393a3316b745c","src/server/server.rs":"f8d9007c44da3fded15244f88f9b781a9ec94924789136aba6b7c86312816e90","src/server/server_stub.rs":"ab443f51ede637e0b0c08f36fbc143a34935102af2921edcc257660eeaad4537","src/server/shutdown.rs":"45bf03fc9314873572775fb4ea336230340108239c88f2cd2b435759ad8c693c","src/server/tcp.rs":"8ed09df1ccfb59d0c9ff2561acd0f3d5e2a03929c960f6923e208e08fb5f1806","src/service/http.rs":"ac930efc71bcecc904fa65a44af254501ce8abd6f7d36e591b907eee45e77979","src/service/make.rs":"ee11adc469796427c7b694551d0bbda69f732536079aee53e3ef7f9be4385b2d","src/service/mod.rs":"92c05f08a175fb847868a02e7aca96176df1237458d40a17a7a6aa377476df90","src/service/oneshot.rs":"3ac3f0c7c20fcc3790cef868ca7a70c87a36687ae28c44e0c9978d2e514e4b22","src/service/util.rs":"67f5b4373a4d705a7277cda717b5f3a3ebd00365446e2beb60c1d6193d071a85","src/upgrade.rs":"d6c68680ad74ebbd6ff74ea28b52704c14d4547c67520048f7f84cfe03d11f94"},"package":"bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"} \ No newline at end of file diff --git a/vendor/hyper/Cargo.lock b/vendor/hyper/Cargo.lock index 625b45ed4..455bed930 100644 --- a/vendor/hyper/Cargo.lock +++ b/vendor/hyper/Cargo.lock @@ -3,10 +3,25 @@ version = 3 [[package]] -name = "aho-corasick" +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -51,10 +66,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "bytes" -version = "1.4.0" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -75,6 +114,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fnv" version = "1.0.7" @@ -83,45 +128,45 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-task", @@ -130,10 +175,16 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.3.19" +name = "gimli" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "h2" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -150,9 +201,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "hermit-abi" @@ -165,18 +216,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -185,9 +233,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -202,9 +250,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -217,7 +265,7 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" dependencies = [ "bytes", "futures-channel", @@ -251,9 +299,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -261,11 +309,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -280,21 +328,21 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matches" @@ -304,15 +352,24 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -321,14 +378,23 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.3", "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.18.0" @@ -337,24 +403,24 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", @@ -363,9 +429,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -414,9 +480,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -429,18 +495,30 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -449,30 +527,36 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", @@ -481,9 +565,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.97" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -492,21 +576,21 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "winapi", + "windows-sys", ] [[package]] @@ -517,9 +601,9 @@ checksum = "02a8428da277a8e3a15271d79943e80ccc2ef254e78813a166a08d65e4c3ece5" [[package]] name = "syn" -version = "2.0.18" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -528,9 +612,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -552,11 +636,11 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -569,9 +653,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -591,9 +675,9 @@ dependencies = [ [[package]] name = "tokio-test" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53474327ae5e166530d17f2d956afcb4f8a004de581b3cae10f12006bc8163e3" +checksum = "e89b3cbabd3ae862100094ae433e1def582cf86451b4e9bf83aa7ac1d8a7d719" dependencies = [ "async-stream", "bytes", @@ -604,9 +688,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -645,20 +729,19 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -671,15 +754,15 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -692,9 +775,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -734,9 +817,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -758,9 +841,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -773,42 +856,42 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/vendor/hyper/Cargo.toml b/vendor/hyper/Cargo.toml index defe73420..1ceb4060d 100644 --- a/vendor/hyper/Cargo.toml +++ b/vendor/hyper/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "hyper" -version = "0.14.27" +version = "0.14.28" authors = ["Sean McArthur "] include = [ "Cargo.toml", @@ -122,7 +122,10 @@ required-features = ["full"] [[example]] name = "tower_client" path = "examples/tower_client.rs" -required-features = ["full"] +required-features = [ + "full", + "backports", +] [[example]] name = "tower_server" @@ -220,7 +223,7 @@ optional = true version = "0.2.4" [dependencies.socket2] -version = "0.4.7" +version = ">=0.4.7, <0.6.0" features = ["all"] optional = true diff --git a/vendor/hyper/src/body/aggregate.rs b/vendor/hyper/src/body/aggregate.rs index 99662419d..4bce1767f 100644 --- a/vendor/hyper/src/body/aggregate.rs +++ b/vendor/hyper/src/body/aggregate.rs @@ -13,6 +13,13 @@ use crate::common::buf::BufList; /// Care needs to be taken if the remote is untrusted. The function doesn't implement any length /// checks and an malicious peer might make it consume arbitrary amounts of memory. Checking the /// `Content-Length` is a possibility, but it is not strictly mandated to be present. +#[cfg_attr( + feature = "deprecated", + deprecated( + note = "This function has been replaced by a method on the `hyper::body::HttpBody` trait. Use `.collect().await?.aggregate()` instead." + ) +)] +#[cfg_attr(feature = "deprecated", allow(deprecated))] pub async fn aggregate(body: T) -> Result where T: HttpBody, diff --git a/vendor/hyper/src/body/body.rs b/vendor/hyper/src/body/body.rs index 111867a5e..7df87404f 100644 --- a/vendor/hyper/src/body/body.rs +++ b/vendor/hyper/src/body/body.rs @@ -1,7 +1,12 @@ use std::borrow::Cow; +#[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] +use std::convert::Infallible; #[cfg(feature = "stream")] use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; use bytes::Bytes; use futures_channel::mpsc; @@ -15,10 +20,7 @@ use http_body::{Body as HttpBody, SizeHint}; use super::DecodedLength; #[cfg(feature = "stream")] use crate::common::sync_wrapper::SyncWrapper; -use crate::common::Future; -#[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] -use crate::common::Never; -use crate::common::{task, watch, Pin, Poll}; +use crate::common::watch; #[cfg(all(feature = "http2", any(feature = "client", feature = "server")))] use crate::proto::h2::ping; @@ -77,7 +79,7 @@ struct Extra { } #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] -type DelayEofUntil = oneshot::Receiver; +type DelayEofUntil = oneshot::Receiver; enum DelayEof { /// Initial state, stream hasn't seen EOF yet. @@ -239,7 +241,7 @@ impl Body { .get_or_insert_with(|| Box::new(Extra { delayed_eof: None })) } - fn poll_eof(&mut self, cx: &mut task::Context<'_>) -> Poll>> { + fn poll_eof(&mut self, cx: &mut Context<'_>) -> Poll>> { match self.take_delayed_eof() { #[cfg(any(feature = "http1", feature = "http2"))] #[cfg(feature = "client")] @@ -292,7 +294,7 @@ impl Body { } } - fn poll_inner(&mut self, cx: &mut task::Context<'_>) -> Poll>> { + fn poll_inner(&mut self, cx: &mut Context<'_>) -> Poll>> { match self.kind { Kind::Once(ref mut val) => Poll::Ready(val.take().map(Ok)), Kind::Chan { @@ -323,7 +325,12 @@ impl Body { ping.record_data(bytes.len()); Poll::Ready(Some(Ok(bytes))) } - Some(Err(e)) => Poll::Ready(Some(Err(crate::Error::new_body(e)))), + Some(Err(e)) => match e.reason() { + // These reasons should cause stop of body reading, but nor fail it. + // The same logic as for `AsyncRead for H2Upgraded` is applied here. + Some(h2::Reason::NO_ERROR) | Some(h2::Reason::CANCEL) => Poll::Ready(None), + _ => Poll::Ready(Some(Err(crate::Error::new_body(e)))), + }, None => Poll::Ready(None), }, @@ -362,14 +369,14 @@ impl HttpBody for Body { fn poll_data( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { self.poll_eof(cx) } fn poll_trailers( #[cfg_attr(not(feature = "http2"), allow(unused_mut))] mut self: Pin<&mut Self>, - #[cfg_attr(not(feature = "http2"), allow(unused))] cx: &mut task::Context<'_>, + #[cfg_attr(not(feature = "http2"), allow(unused))] cx: &mut Context<'_>, ) -> Poll, Self::Error>> { match self.kind { #[cfg(all(feature = "http2", any(feature = "client", feature = "server")))] @@ -465,7 +472,7 @@ impl fmt::Debug for Body { impl Stream for Body { type Item = crate::Result; - fn poll_next(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { HttpBody::poll_data(self, cx) } } @@ -545,7 +552,7 @@ impl From> for Body { impl Sender { /// Check to see if this `Sender` can send more data. - pub fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { // Check if the receiver end has tried polling for the body yet ready!(self.poll_want(cx)?); self.data_tx @@ -553,7 +560,7 @@ impl Sender { .map_err(|_| crate::Error::new_closed()) } - fn poll_want(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_want(&mut self, cx: &mut Context<'_>) -> Poll> { match self.want_rx.load(cx) { WANT_READY => Poll::Ready(Ok(())), WANT_PENDING => Poll::Pending, diff --git a/vendor/hyper/src/body/mod.rs b/vendor/hyper/src/body/mod.rs index 5e2181e94..109b1e6b7 100644 --- a/vendor/hyper/src/body/mod.rs +++ b/vendor/hyper/src/body/mod.rs @@ -19,9 +19,11 @@ pub use bytes::{Buf, Bytes}; pub use http_body::Body as HttpBody; pub use http_body::SizeHint; +#[cfg_attr(feature = "deprecated", allow(deprecated))] pub use self::aggregate::aggregate; pub use self::body::{Body, Sender}; pub(crate) use self::length::DecodedLength; +#[cfg_attr(feature = "deprecated", allow(deprecated))] pub use self::to_bytes::to_bytes; mod aggregate; diff --git a/vendor/hyper/src/body/to_bytes.rs b/vendor/hyper/src/body/to_bytes.rs index 038c6fd0f..2e398d250 100644 --- a/vendor/hyper/src/body/to_bytes.rs +++ b/vendor/hyper/src/body/to_bytes.rs @@ -44,6 +44,13 @@ use super::HttpBody; /// # Ok(()) /// # } /// ``` +#[cfg_attr( + feature = "deprecated", + deprecated( + note = "This function has been replaced by a method on the `hyper::body::HttpBody` trait. Use `.collect().await?.to_bytes()` instead." + ) +)] +#[cfg_attr(feature = "deprecated", allow(deprecated))] pub async fn to_bytes(body: T) -> Result where T: HttpBody, diff --git a/vendor/hyper/src/client/client.rs b/vendor/hyper/src/client/client.rs index bf4db79fd..8195554bd 100644 --- a/vendor/hyper/src/client/client.rs +++ b/vendor/hyper/src/client/client.rs @@ -1,6 +1,10 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; use std::mem; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::time::Duration; use futures_channel::oneshot; @@ -12,10 +16,9 @@ use tracing::{debug, trace, warn}; use crate::body::{Body, HttpBody}; use crate::client::connect::CaptureConnectionExtension; -use crate::common::{ - exec::BoxSendFuture, lazy as hyper_lazy, sync_wrapper::SyncWrapper, task, Future, Lazy, Pin, - Poll, -}; +use crate::common::{exec::BoxSendFuture, lazy as hyper_lazy, sync_wrapper::SyncWrapper, Lazy}; +#[cfg(feature = "http2")] +use crate::ext::Protocol; use crate::rt::Executor; use super::conn; @@ -251,7 +254,8 @@ where if req.version() == Version::HTTP_2 { warn!("Connection is HTTP/1, but request requires HTTP/2"); return Err(ClientError::Normal( - crate::Error::new_user_unsupported_version().with_client_connect_info(pooled.conn_info.clone()), + crate::Error::new_user_unsupported_version() + .with_client_connect_info(pooled.conn_info.clone()), )); } @@ -278,7 +282,13 @@ where origin_form(req.uri_mut()); } } else if req.method() == Method::CONNECT { + #[cfg(not(feature = "http2"))] authority_form(req.uri_mut()); + + #[cfg(feature = "http2")] + if req.extensions().get::().is_none() { + authority_form(req.uri_mut()); + } } let mut res = match pooled.send_request_retryable(req).await { @@ -544,7 +554,7 @@ where type Error = crate::Error; type Future = ResponseFuture; - fn poll_ready(&mut self, _: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -564,7 +574,7 @@ where type Error = crate::Error; type Future = ResponseFuture; - fn poll_ready(&mut self, _: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -598,7 +608,7 @@ impl ResponseFuture { F: Future>> + Send + 'static, { Self { - inner: SyncWrapper::new(Box::pin(value)) + inner: SyncWrapper::new(Box::pin(value)), } } @@ -619,7 +629,7 @@ impl fmt::Debug for ResponseFuture { impl Future for ResponseFuture { type Output = crate::Result>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { self.inner.get_mut().as_mut().poll(cx) } } @@ -641,7 +651,7 @@ enum PoolTx { } impl PoolClient { - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { match self.tx { PoolTx::Http1(ref mut tx) => tx.poll_ready(cx), #[cfg(feature = "http2")] @@ -703,7 +713,10 @@ where { fn is_open(&self) -> bool { if self.conn_info.poisoned.poisoned() { - trace!("marking {:?} as closed because it was poisoned", self.conn_info); + trace!( + "marking {:?} as closed because it was poisoned", + self.conn_info + ); return false; } match self.tx { @@ -1106,10 +1119,7 @@ impl Builder { /// line in the input to resume parsing the rest of the headers. An error /// will be emitted nonetheless if it finds `\0` or a lone `\r` while /// looking for the next line. - pub fn http1_ignore_invalid_headers_in_responses( - &mut self, - val: bool, - ) -> &mut Builder { + pub fn http1_ignore_invalid_headers_in_responses(&mut self, val: bool) -> &mut Builder { self.conn_builder .http1_ignore_invalid_headers_in_responses(val); self diff --git a/vendor/hyper/src/client/conn.rs b/vendor/hyper/src/client/conn.rs index 88e2c413a..8da457da6 100644 --- a/vendor/hyper/src/client/conn.rs +++ b/vendor/hyper/src/client/conn.rs @@ -59,11 +59,17 @@ pub mod http1; #[cfg(all(feature = "backports", feature = "http2"))] pub mod http2; +#[cfg(not(all(feature = "http1", feature = "http2")))] +use std::convert::Infallible; use std::error::Error as StdError; use std::fmt; +use std::future::Future; #[cfg(not(all(feature = "http1", feature = "http2")))] use std::marker::PhantomData; +use std::marker::Unpin; +use std::pin::Pin; use std::sync::Arc; +use std::task::{Context, Poll}; #[cfg(all(feature = "runtime", feature = "http2"))] use std::time::Duration; @@ -77,12 +83,7 @@ use tracing::{debug, trace}; use super::dispatch; use crate::body::HttpBody; -#[cfg(not(all(feature = "http1", feature = "http2")))] -use crate::common::Never; -use crate::common::{ - exec::{BoxSendFuture, Exec}, - task, Future, Pin, Poll, -}; +use crate::common::exec::{BoxSendFuture, Exec}; use crate::proto; use crate::rt::Executor; #[cfg(feature = "http1")] @@ -94,13 +95,13 @@ type Http1Dispatcher = proto::dispatch::Dispatcher, B, T, proto::h1::ClientTransaction>; #[cfg(not(feature = "http1"))] -type Http1Dispatcher = (Never, PhantomData<(T, Pin>)>); +type Http1Dispatcher = (Infallible, PhantomData<(T, Pin>)>); #[cfg(feature = "http2")] type Http2ClientTask = proto::h2::ClientTask; #[cfg(not(feature = "http2"))] -type Http2ClientTask = (Never, PhantomData>>); +type Http2ClientTask = (Infallible, PhantomData>>); pin_project! { #[project = ProtoClientProj] @@ -257,7 +258,7 @@ impl SendRequest { /// Polls to determine whether this sender can be used yet for a request. /// /// If the associated connection is closed, this returns an Error. - pub fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.dispatch.poll_ready(cx) } @@ -381,7 +382,7 @@ where type Error = crate::Error; type Future = ResponseFuture; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.poll_ready(cx) } @@ -502,7 +503,7 @@ where /// Use [`poll_fn`](https://docs.rs/futures/0.1.25/futures/future/fn.poll_fn.html) /// and [`try_ready!`](https://docs.rs/futures/0.1.25/futures/macro.try_ready.html) /// to work with this function; or use the `without_shutdown` wrapper. - pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> { match *self.inner.as_mut().expect("already upgraded") { #[cfg(feature = "http1")] ProtoClient::H1 { ref mut h1 } => h1.poll_without_shutdown(cx), @@ -554,7 +555,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(self.inner.as_mut().unwrap()).poll(cx))? { proto::Dispatched::Shutdown => Poll::Ready(Ok(())), #[cfg(feature = "http1")] @@ -710,10 +711,7 @@ impl Builder { /// Note that this setting does not affect HTTP/2. /// /// Default is false. - pub fn http1_ignore_invalid_headers_in_responses( - &mut self, - enabled: bool, - ) -> &mut Builder { + pub fn http1_ignore_invalid_headers_in_responses(&mut self, enabled: bool) -> &mut Builder { self.h1_parser_config .ignore_invalid_headers_in_responses(enabled); self @@ -1070,7 +1068,7 @@ impl Builder { impl Future for ResponseFuture { type Output = crate::Result>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.inner { ResponseFutureState::Waiting(ref mut rx) => { Pin::new(rx).poll(cx).map(|res| match res { @@ -1104,7 +1102,7 @@ where { type Output = crate::Result; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.project() { #[cfg(feature = "http1")] ProtoClientProj::H1 { h1 } => h1.poll(cx), diff --git a/vendor/hyper/src/client/conn/http1.rs b/vendor/hyper/src/client/conn/http1.rs index d8936d865..37eda0406 100644 --- a/vendor/hyper/src/client/conn/http1.rs +++ b/vendor/hyper/src/client/conn/http1.rs @@ -2,17 +2,18 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use bytes::Bytes; use http::{Request, Response}; use httparse::ParserConfig; use tokio::io::{AsyncRead, AsyncWrite}; -use crate::body::{Body as IncomingBody, HttpBody as Body}; use super::super::dispatch; -use crate::common::{ - task, Future, Pin, Poll, -}; +use crate::body::{Body as IncomingBody, HttpBody as Body}; use crate::proto; use crate::upgrade::Upgraded; @@ -44,7 +45,6 @@ pub struct Parts { _inner: (), } - /// A future that processes all HTTP state for the IO object. /// /// In most cases, this should just be spawned into an executor, so that it @@ -87,8 +87,21 @@ where /// Use [`poll_fn`](https://docs.rs/futures/0.1.25/futures/future/fn.poll_fn.html) /// and [`try_ready!`](https://docs.rs/futures/0.1.25/futures/macro.try_ready.html) /// to work with this function; or use the `without_shutdown` wrapper. - pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> { - self.inner.as_mut().expect("algready upgraded").poll_without_shutdown(cx) + pub fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> { + self.inner + .as_mut() + .expect("algready upgraded") + .poll_without_shutdown(cx) + } + + /// Prevent shutdown of the underlying IO object at the end of service the request, + /// instead run `into_parts`. This is a convenience wrapper over `poll_without_shutdown`. + pub fn without_shutdown(self) -> impl Future>> { + let mut conn = Some(self); + futures_util::future::poll_fn(move |cx| -> Poll>> { + ready!(conn.as_mut().unwrap().poll_without_shutdown(cx))?; + Poll::Ready(Ok(conn.take().unwrap().into_parts())) + }) } } @@ -112,9 +125,7 @@ pub struct Builder { /// /// This is a shortcut for `Builder::new().handshake(io)`. /// See [`client::conn`](crate::client::conn) for more. -pub async fn handshake( - io: T, -) -> crate::Result<(SendRequest, Connection)> +pub async fn handshake(io: T) -> crate::Result<(SendRequest, Connection)> where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, B: Body + 'static, @@ -130,7 +141,7 @@ impl SendRequest { /// Polls to determine whether this sender can be used yet for a request. /// /// If the associated connection is closed, this returns an Error. - pub fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.dispatch.poll_ready(cx) } @@ -260,7 +271,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(self.inner.as_mut().unwrap()).poll(cx))? { proto::Dispatched::Shutdown => Poll::Ready(Ok(())), proto::Dispatched::Upgrade(pending) => match self.inner.take() { @@ -324,10 +335,7 @@ impl Builder { /// Default is false. /// /// [RFC 7230 Section 3.2.4.]: https://tools.ietf.org/html/rfc7230#section-3.2.4 - pub fn allow_spaces_after_header_name_in_responses( - &mut self, - enabled: bool, - ) -> &mut Builder { + pub fn allow_spaces_after_header_name_in_responses(&mut self, enabled: bool) -> &mut Builder { self.h1_parser_config .allow_spaces_after_header_name_in_responses(enabled); self @@ -365,10 +373,7 @@ impl Builder { /// Default is false. /// /// [RFC 7230 Section 3.2.4.]: https://tools.ietf.org/html/rfc7230#section-3.2.4 - pub fn allow_obsolete_multiline_headers_in_responses( - &mut self, - enabled: bool, - ) -> &mut Builder { + pub fn allow_obsolete_multiline_headers_in_responses(&mut self, enabled: bool) -> &mut Builder { self.h1_parser_config .allow_obsolete_multiline_headers_in_responses(enabled); self @@ -381,10 +386,7 @@ impl Builder { /// and no error will be reported. /// /// Default is false. - pub fn ignore_invalid_headers_in_responses( - &mut self, - enabled: bool, - ) -> &mut Builder { + pub fn ignore_invalid_headers_in_responses(&mut self, enabled: bool) -> &mut Builder { self.h1_parser_config .ignore_invalid_headers_in_responses(enabled); self diff --git a/vendor/hyper/src/client/conn/http2.rs b/vendor/hyper/src/client/conn/http2.rs index fd0adf897..5697e9ee4 100644 --- a/vendor/hyper/src/client/conn/http2.rs +++ b/vendor/hyper/src/client/conn/http2.rs @@ -2,19 +2,20 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; use std::marker::PhantomData; +use std::marker::Unpin; +use std::pin::Pin; use std::sync::Arc; +use std::task::{Context, Poll}; use std::time::Duration; use http::{Request, Response}; use tokio::io::{AsyncRead, AsyncWrite}; use super::super::dispatch; -use crate::body::{HttpBody as Body, Body as IncomingBody}; -use crate::common::{ - exec::{BoxSendFuture, Exec}, - task, Future, Pin, Poll, -}; +use crate::body::{Body as IncomingBody, HttpBody as Body}; +use crate::common::exec::{BoxSendFuture, Exec}; use crate::proto; use crate::rt::Executor; @@ -25,7 +26,9 @@ pub struct SendRequest { impl Clone for SendRequest { fn clone(&self) -> SendRequest { - SendRequest { dispatch: self.dispatch.clone() } + SendRequest { + dispatch: self.dispatch.clone(), + } } } @@ -55,10 +58,7 @@ pub struct Builder { /// /// This is a shortcut for `Builder::new().handshake(io)`. /// See [`client::conn`](crate::client::conn) for more. -pub async fn handshake( - exec: E, - io: T, -) -> crate::Result<(SendRequest, Connection)> +pub async fn handshake(exec: E, io: T) -> crate::Result<(SendRequest, Connection)> where E: Executor + Send + Sync + 'static, T: AsyncRead + AsyncWrite + Unpin + Send + 'static, @@ -75,7 +75,7 @@ impl SendRequest { /// Polls to determine whether this sender can be used yet for a request. /// /// If the associated connection is closed, this returns an Error. - pub fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { if self.is_closed() { Poll::Ready(Err(crate::Error::new_closed())) } else { @@ -230,7 +230,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(&mut self.inner.1).poll(cx))? { proto::Dispatched::Shutdown => Poll::Ready(Ok(())), #[cfg(feature = "http1")] @@ -244,7 +244,7 @@ where impl Builder { /// Creates a new connection builder. #[inline] - pub fn new(exec: E) -> Builder + pub fn new(exec: E) -> Builder where E: Executor + Send + Sync + 'static, { @@ -285,10 +285,7 @@ impl Builder { /// Passing `None` will do nothing. /// /// If not set, hyper will use a default. - pub fn initial_connection_window_size( - &mut self, - sz: impl Into>, - ) -> &mut Self { + pub fn initial_connection_window_size(&mut self, sz: impl Into>) -> &mut Self { if let Some(sz) = sz.into() { self.h2_builder.adaptive_window = false; self.h2_builder.initial_conn_window_size = sz; @@ -331,10 +328,7 @@ impl Builder { /// /// Default is currently disabled. #[cfg(feature = "runtime")] - pub fn keep_alive_interval( - &mut self, - interval: impl Into>, - ) -> &mut Self { + pub fn keep_alive_interval(&mut self, interval: impl Into>) -> &mut Self { self.h2_builder.keep_alive_interval = interval.into(); self } @@ -412,8 +406,7 @@ impl Builder { tracing::trace!("client handshake HTTP/1"); let (tx, rx) = dispatch::channel(); - let h2 = proto::h2::client::handshake(io, rx, &opts.h2_builder, opts.exec) - .await?; + let h2 = proto::h2::client::handshake(io, rx, &opts.h2_builder, opts.exec).await?; Ok(( SendRequest { dispatch: tx.unbound(), diff --git a/vendor/hyper/src/client/connect/dns.rs b/vendor/hyper/src/client/connect/dns.rs index e4465078b..50245de68 100644 --- a/vendor/hyper/src/client/connect/dns.rs +++ b/vendor/hyper/src/client/connect/dns.rs @@ -26,7 +26,7 @@ use std::future::Future; use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs}; use std::pin::Pin; use std::str::FromStr; -use std::task::{self, Poll}; +use std::task::{Context, Poll}; use std::{fmt, io, vec}; use tokio::task::JoinHandle; @@ -113,7 +113,7 @@ impl Service for GaiResolver { type Error = io::Error; type Future = GaiFuture; - fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -138,7 +138,7 @@ impl fmt::Debug for GaiResolver { impl Future for GaiFuture { type Output = Result; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { Pin::new(&mut self.inner).poll(cx).map(|res| match res { Ok(Ok(addrs)) => Ok(GaiAddrs { inner: addrs }), Ok(Err(err)) => Err(err), @@ -286,7 +286,7 @@ impl Service for TokioThreadpoolGaiResolver { type Error = io::Error; type Future = TokioThreadpoolGaiFuture; - fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -299,7 +299,7 @@ impl Service for TokioThreadpoolGaiResolver { impl Future for TokioThreadpoolGaiFuture { type Output = Result; - fn poll(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll { match ready!(tokio_executor::threadpool::blocking(|| ( self.name.as_str(), 0 @@ -318,8 +318,10 @@ impl Future for TokioThreadpoolGaiFuture { */ mod sealed { - use super::{SocketAddr, Name}; - use crate::common::{task, Future, Poll}; + use std::future::Future; + use std::task::{Context, Poll}; + + use super::{Name, SocketAddr}; use tower_service::Service; // "Trait alias" for `Service` @@ -328,7 +330,7 @@ mod sealed { type Error: Into>; type Future: Future>; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll>; + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll>; fn resolve(&mut self, name: Name) -> Self::Future; } @@ -342,7 +344,7 @@ mod sealed { type Error = S::Error; type Future = S::Future; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { Service::poll_ready(self, cx) } diff --git a/vendor/hyper/src/client/connect/http.rs b/vendor/hyper/src/client/connect/http.rs index afe7b155e..ee09afe9a 100644 --- a/vendor/hyper/src/client/connect/http.rs +++ b/vendor/hyper/src/client/connect/http.rs @@ -362,7 +362,10 @@ impl Connection for TcpStream { fn connected(&self) -> Connected { let connected = Connected::new(); if let (Ok(remote_addr), Ok(local_addr)) = (self.peer_addr(), self.local_addr()) { - connected.extra(HttpInfo { remote_addr, local_addr }) + connected.extra(HttpInfo { + remote_addr, + local_addr, + }) } else { connected } @@ -521,7 +524,9 @@ struct ConnectingTcpRemote { impl ConnectingTcpRemote { fn new(addrs: dns::SocketAddrs, connect_timeout: Option) -> Self { - let connect_timeout = connect_timeout.map(|t| t / (addrs.len() as u32)); + let connect_timeout = connect_timeout + .map(|t| t.checked_div(addrs.len() as u32)) + .flatten(); Self { addrs, diff --git a/vendor/hyper/src/client/connect/mod.rs b/vendor/hyper/src/client/connect/mod.rs index 481552481..4c29dd3a3 100644 --- a/vendor/hyper/src/client/connect/mod.rs +++ b/vendor/hyper/src/client/connect/mod.rs @@ -81,8 +81,8 @@ //! [`Connection`]: Connection use std::fmt; use std::fmt::{Debug, Formatter}; -use std::sync::atomic::{AtomicBool, Ordering}; use std::ops::Deref; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use ::http::Extensions; @@ -129,7 +129,12 @@ pub(crate) struct PoisonPill { impl Debug for PoisonPill { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { // print the address of the pill—this makes debugging issues much easier - write!(f, "PoisonPill@{:p} {{ poisoned: {} }}", self.poisoned, self.poisoned.load(Ordering::Relaxed)) + write!( + f, + "PoisonPill@{:p} {{ poisoned: {} }}", + self.poisoned, + self.poisoned.load(Ordering::Relaxed) + ) } } @@ -422,12 +427,13 @@ where #[cfg(any(feature = "http1", feature = "http2"))] pub(super) mod sealed { use std::error::Error as StdError; + use std::future::Future; + use std::marker::Unpin; use ::http::Uri; use tokio::io::{AsyncRead, AsyncWrite}; use super::Connection; - use crate::common::{Future, Unpin}; /// Connect to a destination, returning an IO transport. /// @@ -448,6 +454,7 @@ pub(super) mod sealed { fn connect(self, internal_only: Internal, dst: Uri) -> ::Future; } + #[allow(unreachable_pub)] pub trait ConnectSvc { type Connection: AsyncRead + AsyncWrite + Connection + Unpin + Send + 'static; type Error: Into>; diff --git a/vendor/hyper/src/client/dispatch.rs b/vendor/hyper/src/client/dispatch.rs index 771c40da3..a1a93ea96 100644 --- a/vendor/hyper/src/client/dispatch.rs +++ b/vendor/hyper/src/client/dispatch.rs @@ -1,13 +1,13 @@ #[cfg(feature = "http2")] use std::future::Future; +use std::marker::Unpin; +#[cfg(feature = "http2")] +use std::pin::Pin; +use std::task::{Context, Poll}; use futures_util::FutureExt; use tokio::sync::{mpsc, oneshot}; -#[cfg(feature = "http2")] -use crate::common::Pin; -use crate::common::{task, Poll}; - pub(crate) type RetryPromise = oneshot::Receiver)>>; pub(crate) type Promise = oneshot::Receiver>; @@ -53,7 +53,7 @@ pub(crate) struct UnboundedSender { } impl Sender { - pub(crate) fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub(crate) fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.giver .poll_want(cx) .map_err(|_| crate::Error::new_closed()) @@ -155,10 +155,7 @@ pub(crate) struct Receiver { } impl Receiver { - pub(crate) fn poll_recv( - &mut self, - cx: &mut task::Context<'_>, - ) -> Poll)>> { + pub(crate) fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll)>> { match self.inner.poll_recv(cx) { Poll::Ready(item) => { Poll::Ready(item.map(|mut env| env.0.take().expect("envelope not dropped"))) @@ -245,7 +242,7 @@ impl Callback { } } - pub(crate) fn poll_canceled(&mut self, cx: &mut task::Context<'_>) -> Poll<()> { + pub(crate) fn poll_canceled(&mut self, cx: &mut Context<'_>) -> Poll<()> { match *self { Callback::Retry(Some(ref mut tx)) => tx.poll_closed(cx), Callback::NoRetry(Some(ref mut tx)) => tx.poll_closed(cx), diff --git a/vendor/hyper/src/client/pool.rs b/vendor/hyper/src/client/pool.rs index b9772d688..1dfd6ba3d 100644 --- a/vendor/hyper/src/client/pool.rs +++ b/vendor/hyper/src/client/pool.rs @@ -1,8 +1,12 @@ use std::collections::{HashMap, HashSet, VecDeque}; use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; use std::ops::{Deref, DerefMut}; +use std::pin::Pin; use std::sync::{Arc, Mutex, Weak}; +use std::task::{Context, Poll}; #[cfg(not(feature = "runtime"))] use std::time::{Duration, Instant}; @@ -13,7 +17,7 @@ use tokio::time::{Duration, Instant, Interval}; use tracing::{debug, trace}; use super::client::Ver; -use crate::common::{exec::Exec, task, Future, Pin, Poll, Unpin}; +use crate::common::exec::Exec; // FIXME: allow() required due to `impl Trait` leaking types to this lint #[allow(missing_debug_implementations)] @@ -79,7 +83,7 @@ struct PoolInner { // A oneshot channel is used to allow the interval to be notified when // the Pool completely drops. That way, the interval can cancel immediately. #[cfg(feature = "runtime")] - idle_interval_ref: Option>, + idle_interval_ref: Option>, #[cfg(feature = "runtime")] exec: Exec, timeout: Option, @@ -113,7 +117,7 @@ impl Pool { waiters: HashMap::new(), #[cfg(feature = "runtime")] exec: __exec.clone(), - timeout: config.idle_timeout, + timeout: config.idle_timeout.filter(|&t| t > Duration::ZERO), }))) } else { None @@ -576,10 +580,7 @@ impl fmt::Display for CheckoutIsClosedError { } impl Checkout { - fn poll_waiter( - &mut self, - cx: &mut task::Context<'_>, - ) -> Poll>>> { + fn poll_waiter(&mut self, cx: &mut Context<'_>) -> Poll>>> { if let Some(mut rx) = self.waiter.take() { match Pin::new(&mut rx).poll(cx) { Poll::Ready(Ok(value)) => { @@ -604,7 +605,7 @@ impl Checkout { } } - fn checkout(&mut self, cx: &mut task::Context<'_>) -> Option> { + fn checkout(&mut self, cx: &mut Context<'_>) -> Option> { let entry = { let mut inner = self.pool.inner.as_ref()?.lock().unwrap(); let expiration = Expiration::new(inner.timeout); @@ -657,7 +658,7 @@ impl Checkout { impl Future for Checkout { type Output = crate::Result>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { if let Some(pooled) = ready!(self.poll_waiter(cx)?) { return Poll::Ready(Ok(pooled)); } @@ -740,7 +741,7 @@ pin_project_lite::pin_project! { // Pool is fully dropped, and shutdown. This channel is never sent on, // but Err(Canceled) will be received when the Pool is dropped. #[pin] - pool_drop_notifier: oneshot::Receiver, + pool_drop_notifier: oneshot::Receiver, } } @@ -748,7 +749,7 @@ pin_project_lite::pin_project! { impl Future for IdleTask { type Output = (); - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut this = self.project(); loop { match this.pool_drop_notifier.as_mut().poll(cx) { @@ -790,11 +791,14 @@ impl WeakOpt { #[cfg(test)] mod tests { + use std::future::Future; + use std::pin::Pin; + use std::task::Context; use std::task::Poll; use std::time::Duration; use super::{Connecting, Key, Pool, Poolable, Reservation, WeakOpt}; - use crate::common::{exec::Exec, task, Future, Pin}; + use crate::common::exec::Exec; /// Test unique reservations. #[derive(Debug, PartialEq, Eq)] @@ -864,7 +868,7 @@ mod tests { { type Output = Option<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match Pin::new(&mut self.0).poll(cx) { Poll::Ready(Ok(_)) => Poll::Ready(Some(())), Poll::Ready(Err(_)) => Poll::Ready(Some(())), diff --git a/vendor/hyper/src/client/service.rs b/vendor/hyper/src/client/service.rs index f3560ea08..047dd9876 100644 --- a/vendor/hyper/src/client/service.rs +++ b/vendor/hyper/src/client/service.rs @@ -5,6 +5,8 @@ use std::error::Error as StdError; use std::future::Future; use std::marker::PhantomData; +use std::pin::Pin; +use std::task::{Context, Poll}; use tracing::debug; @@ -12,7 +14,6 @@ use tracing::debug; use super::conn::{Builder, SendRequest}; use crate::{ body::HttpBody, - common::{task, Pin, Poll}, service::{MakeConnection, Service}, }; @@ -58,7 +59,7 @@ where type Future = Pin> + Send + 'static>>; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.inner .poll_ready(cx) .map_err(|e| crate::Error::new(crate::error::Kind::Connect).with(e.into())) diff --git a/vendor/hyper/src/common/drain.rs b/vendor/hyper/src/common/drain.rs index 174da876d..c8562d3c9 100644 --- a/vendor/hyper/src/common/drain.rs +++ b/vendor/hyper/src/common/drain.rs @@ -1,10 +1,11 @@ +use std::future::Future; use std::mem; +use std::pin::Pin; +use std::task::{Context, Poll}; use pin_project_lite::pin_project; use tokio::sync::watch; -use super::{task, Future, Pin, Poll}; - pub(crate) fn channel() -> (Signal, Watch) { let (tx, rx) = watch::channel(()); (Signal { tx }, Watch { rx }) @@ -47,7 +48,7 @@ impl Signal { impl Future for Draining { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { Pin::new(&mut self.as_mut().0).poll(cx) } } @@ -80,7 +81,7 @@ where { type Output = F::Output; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut me = self.project(); loop { match mem::replace(me.state, State::Draining) { @@ -115,7 +116,7 @@ mod tests { impl Future for TestMe { type Output = (); - fn poll(mut self: Pin<&mut Self>, _: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { self.poll_cnt += 1; if self.finished { Poll::Ready(()) diff --git a/vendor/hyper/src/common/io/rewind.rs b/vendor/hyper/src/common/io/rewind.rs index 0afef5f7e..9ed7c42fe 100644 --- a/vendor/hyper/src/common/io/rewind.rs +++ b/vendor/hyper/src/common/io/rewind.rs @@ -1,11 +1,11 @@ use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::{cmp, io}; use bytes::{Buf, Bytes}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use crate::common::{task, Pin, Poll}; - /// Combine a buffer with an IO, rewinding reads to use the buffer. #[derive(Debug)] pub(crate) struct Rewind { @@ -50,7 +50,7 @@ where { fn poll_read( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll> { if let Some(mut prefix) = self.pre.take() { @@ -78,7 +78,7 @@ where { fn poll_write( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &[u8], ) -> Poll> { Pin::new(&mut self.inner).poll_write(cx, buf) @@ -86,17 +86,17 @@ where fn poll_write_vectored( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, bufs: &[io::IoSlice<'_>], ) -> Poll> { Pin::new(&mut self.inner).poll_write_vectored(cx, bufs) } - fn poll_flush(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { Pin::new(&mut self.inner).poll_flush(cx) } - fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { Pin::new(&mut self.inner).poll_shutdown(cx) } diff --git a/vendor/hyper/src/common/lazy.rs b/vendor/hyper/src/common/lazy.rs index 272207730..df2c07d59 100644 --- a/vendor/hyper/src/common/lazy.rs +++ b/vendor/hyper/src/common/lazy.rs @@ -1,6 +1,9 @@ -use pin_project_lite::pin_project; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; -use super::{task, Future, Pin, Poll}; +use pin_project_lite::pin_project; pub(crate) trait Started: Future { fn started(&self) -> bool; @@ -55,7 +58,7 @@ where { type Output = R::Output; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut this = self.project(); if let InnerProj::Fut { fut } = this.inner.as_mut().project() { diff --git a/vendor/hyper/src/common/mod.rs b/vendor/hyper/src/common/mod.rs index e38c6f5c7..3d8394624 100644 --- a/vendor/hyper/src/common/mod.rs +++ b/vendor/hyper/src/common/mod.rs @@ -17,23 +17,14 @@ pub(crate) mod exec; pub(crate) mod io; #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] mod lazy; -mod never; #[cfg(any( feature = "stream", all(feature = "client", any(feature = "http1", feature = "http2")) ))] pub(crate) mod sync_wrapper; +#[cfg(feature = "http1")] pub(crate) mod task; pub(crate) mod watch; #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))] pub(crate) use self::lazy::{lazy, Started as Lazy}; -#[cfg(any(feature = "http1", feature = "http2", feature = "runtime"))] -pub(crate) use self::never::Never; -pub(crate) use self::task::Poll; - -// group up types normally needed for `Future` -cfg_proto! { - pub(crate) use std::marker::Unpin; -} -pub(crate) use std::{future::Future, pin::Pin}; diff --git a/vendor/hyper/src/common/never.rs b/vendor/hyper/src/common/never.rs deleted file mode 100644 index f143caf60..000000000 --- a/vendor/hyper/src/common/never.rs +++ /dev/null @@ -1,21 +0,0 @@ -//! An uninhabitable type meaning it can never happen. -//! -//! To be replaced with `!` once it is stable. - -use std::error::Error; -use std::fmt; - -#[derive(Debug)] -pub(crate) enum Never {} - -impl fmt::Display for Never { - fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self {} - } -} - -impl Error for Never { - fn description(&self) -> &str { - match *self {} - } -} diff --git a/vendor/hyper/src/common/task.rs b/vendor/hyper/src/common/task.rs index ec70c957d..0ac047a46 100644 --- a/vendor/hyper/src/common/task.rs +++ b/vendor/hyper/src/common/task.rs @@ -1,12 +1,12 @@ -#[cfg(feature = "http1")] -use super::Never; -pub(crate) use std::task::{Context, Poll}; +use std::{ + convert::Infallible, + task::{Context, Poll}, +}; /// A function to help "yield" a future, such that it is re-scheduled immediately. /// /// Useful for spin counts, so a future doesn't hog too much time. -#[cfg(feature = "http1")] -pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll { +pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll { cx.waker().wake_by_ref(); Poll::Pending } diff --git a/vendor/hyper/src/headers.rs b/vendor/hyper/src/headers.rs index 8407be185..2e5e5db0f 100644 --- a/vendor/hyper/src/headers.rs +++ b/vendor/hyper/src/headers.rs @@ -53,15 +53,15 @@ pub(super) fn content_length_parse_all_values(values: ValueIter<'_, HeaderValue> return None; } } else { - return None + return None; } } } else { - return None + return None; } } - return content_length + content_length } fn from_digits(bytes: &[u8]) -> Option { @@ -80,7 +80,7 @@ fn from_digits(bytes: &[u8]) -> Option { b'0'..=b'9' => { result = result.checked_mul(RADIX)?; result = result.checked_add((b - b'0') as u64)?; - }, + } _ => { // not a DIGIT, get outta here! return None; diff --git a/vendor/hyper/src/proto/h1/conn.rs b/vendor/hyper/src/proto/h1/conn.rs index 5ebff2803..5ab72f264 100644 --- a/vendor/hyper/src/proto/h1/conn.rs +++ b/vendor/hyper/src/proto/h1/conn.rs @@ -1,6 +1,9 @@ use std::fmt; use std::io; use std::marker::PhantomData; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; #[cfg(all(feature = "server", feature = "runtime"))] use std::time::Duration; @@ -16,7 +19,6 @@ use tracing::{debug, error, trace}; use super::io::Buffered; use super::{Decoder, Encode, EncodedBuf, Encoder, Http1Transaction, ParseContext, Wants}; use crate::body::DecodedLength; -use crate::common::{task, Pin, Poll, Unpin}; use crate::headers::connection_keep_alive; use crate::proto::{BodyLength, MessageHead}; @@ -185,7 +187,7 @@ where pub(super) fn poll_read_head( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll, DecodedLength, Wants)>>> { debug_assert!(self.can_read_head()); trace!("Conn::read_head"); @@ -286,7 +288,7 @@ where pub(crate) fn poll_read_body( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { debug_assert!(self.can_read_body()); @@ -347,10 +349,7 @@ where ret } - pub(crate) fn poll_read_keep_alive( - &mut self, - cx: &mut task::Context<'_>, - ) -> Poll> { + pub(crate) fn poll_read_keep_alive(&mut self, cx: &mut Context<'_>) -> Poll> { debug_assert!(!self.can_read_head() && !self.can_read_body()); if self.is_read_closed() { @@ -373,7 +372,7 @@ where // // This should only be called for Clients wanting to enter the idle // state. - fn require_empty_read(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn require_empty_read(&mut self, cx: &mut Context<'_>) -> Poll> { debug_assert!(!self.can_read_head() && !self.can_read_body() && !self.is_read_closed()); debug_assert!(!self.is_mid_message()); debug_assert!(T::is_client()); @@ -406,7 +405,7 @@ where Poll::Ready(Err(crate::Error::new_unexpected_message())) } - fn mid_message_detect_eof(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn mid_message_detect_eof(&mut self, cx: &mut Context<'_>) -> Poll> { debug_assert!(!self.can_read_head() && !self.can_read_body() && !self.is_read_closed()); debug_assert!(self.is_mid_message()); @@ -425,7 +424,7 @@ where } } - fn force_io_read(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn force_io_read(&mut self, cx: &mut Context<'_>) -> Poll> { debug_assert!(!self.state.is_read_closed()); let result = ready!(self.io.poll_read_from_io(cx)); @@ -436,7 +435,7 @@ where })) } - fn maybe_notify(&mut self, cx: &mut task::Context<'_>) { + fn maybe_notify(&mut self, cx: &mut Context<'_>) { // its possible that we returned NotReady from poll() without having // exhausted the underlying Io. We would have done this when we // determined we couldn't keep reading until we knew how writing @@ -483,7 +482,7 @@ where } } - fn try_keep_alive(&mut self, cx: &mut task::Context<'_>) { + fn try_keep_alive(&mut self, cx: &mut Context<'_>) { self.state.try_keep_alive::(); self.maybe_notify(cx); } @@ -726,14 +725,14 @@ where Err(err) } - pub(crate) fn poll_flush(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub(crate) fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll> { ready!(Pin::new(&mut self.io).poll_flush(cx))?; self.try_keep_alive(cx); trace!("flushed({}): {:?}", T::LOG, self.state); Poll::Ready(Ok(())) } - pub(crate) fn poll_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub(crate) fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> { match ready!(Pin::new(self.io.io_mut()).poll_shutdown(cx)) { Ok(()) => { trace!("shut down IO complete"); @@ -747,7 +746,7 @@ where } /// If the read side can be cheaply drained, do so. Otherwise, close. - pub(super) fn poll_drain_or_close_read(&mut self, cx: &mut task::Context<'_>) { + pub(super) fn poll_drain_or_close_read(&mut self, cx: &mut Context<'_>) { if let Reading::Continue(ref decoder) = self.state.reading { // skip sending the 100-continue // just move forward to a read, in case a tiny body was included diff --git a/vendor/hyper/src/proto/h1/decode.rs b/vendor/hyper/src/proto/h1/decode.rs index 1e3a38eff..6752d5836 100644 --- a/vendor/hyper/src/proto/h1/decode.rs +++ b/vendor/hyper/src/proto/h1/decode.rs @@ -1,18 +1,22 @@ use std::error::Error as StdError; use std::fmt; use std::io; +use std::task::{Context, Poll}; use std::usize; use bytes::Bytes; use tracing::{debug, trace}; -use crate::common::{task, Poll}; - use super::io::MemRead; use super::DecodedLength; use self::Kind::{Chunked, Eof, Length}; +/// Maximum amount of bytes allowed in chunked extensions. +/// +/// This limit is currentlty applied for the entire body, not per chunk. +const CHUNKED_EXTENSIONS_LIMIT: u64 = 1024 * 16; + /// Decoders to handle different Transfer-Encodings. /// /// If a message body does not include a Transfer-Encoding, it *should* @@ -27,7 +31,11 @@ enum Kind { /// A Reader used when a Content-Length header is passed with a positive integer. Length(u64), /// A Reader used when Transfer-Encoding is `chunked`. - Chunked(ChunkedState, u64), + Chunked { + state: ChunkedState, + chunk_len: u64, + extensions_cnt: u64, + }, /// A Reader used for responses that don't indicate a length or chunked. /// /// The bool tracks when EOF is seen on the transport. @@ -49,6 +57,7 @@ enum Kind { #[derive(Debug, PartialEq, Clone, Copy)] enum ChunkedState { + Start, Size, SizeLws, Extension, @@ -74,7 +83,11 @@ impl Decoder { pub(crate) fn chunked() -> Decoder { Decoder { - kind: Kind::Chunked(ChunkedState::Size, 0), + kind: Kind::Chunked { + state: ChunkedState::new(), + chunk_len: 0, + extensions_cnt: 0, + }, } } @@ -95,12 +108,20 @@ impl Decoder { // methods pub(crate) fn is_eof(&self) -> bool { - matches!(self.kind, Length(0) | Chunked(ChunkedState::End, _) | Eof(true)) + matches!( + self.kind, + Length(0) + | Chunked { + state: ChunkedState::End, + .. + } + | Eof(true) + ) } pub(crate) fn decode( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, body: &mut R, ) -> Poll> { trace!("decode; state={:?}", self.kind); @@ -125,11 +146,15 @@ impl Decoder { Poll::Ready(Ok(buf)) } } - Chunked(ref mut state, ref mut size) => { + Chunked { + ref mut state, + ref mut chunk_len, + ref mut extensions_cnt, + } => { loop { let mut buf = None; // advances the chunked state - *state = ready!(state.step(cx, body, size, &mut buf))?; + *state = ready!(state.step(cx, body, chunk_len, extensions_cnt, &mut buf))?; if *state == ChunkedState::End { trace!("end of chunked"); return Poll::Ready(Ok(Bytes::new())); @@ -179,19 +204,36 @@ macro_rules! byte ( }) ); +macro_rules! or_overflow { + ($e:expr) => ( + match $e { + Some(val) => val, + None => return Poll::Ready(Err(io::Error::new( + io::ErrorKind::InvalidData, + "invalid chunk size: overflow", + ))), + } + ) +} + impl ChunkedState { + fn new() -> ChunkedState { + ChunkedState::Start + } fn step( &self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, body: &mut R, size: &mut u64, + extensions_cnt: &mut u64, buf: &mut Option, ) -> Poll> { use self::ChunkedState::*; match *self { + Start => ChunkedState::read_start(cx, body, size), Size => ChunkedState::read_size(cx, body, size), SizeLws => ChunkedState::read_size_lws(cx, body), - Extension => ChunkedState::read_extension(cx, body), + Extension => ChunkedState::read_extension(cx, body, extensions_cnt), SizeLf => ChunkedState::read_size_lf(cx, body, *size), Body => ChunkedState::read_body(cx, body, size, buf), BodyCr => ChunkedState::read_body_cr(cx, body), @@ -203,25 +245,46 @@ impl ChunkedState { End => Poll::Ready(Ok(ChunkedState::End)), } } + + fn read_start( + cx: &mut Context<'_>, + rdr: &mut R, + size: &mut u64, + ) -> Poll> { + trace!("Read chunk start"); + + let radix = 16; + match byte!(rdr, cx) { + b @ b'0'..=b'9' => { + *size = or_overflow!(size.checked_mul(radix)); + *size = or_overflow!(size.checked_add((b - b'0') as u64)); + } + b @ b'a'..=b'f' => { + *size = or_overflow!(size.checked_mul(radix)); + *size = or_overflow!(size.checked_add((b + 10 - b'a') as u64)); + } + b @ b'A'..=b'F' => { + *size = or_overflow!(size.checked_mul(radix)); + *size = or_overflow!(size.checked_add((b + 10 - b'A') as u64)); + } + _ => { + return Poll::Ready(Err(io::Error::new( + io::ErrorKind::InvalidInput, + "Invalid chunk size line: missing size digit", + ))); + } + } + + Poll::Ready(Ok(ChunkedState::Size)) + } + fn read_size( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, size: &mut u64, ) -> Poll> { trace!("Read chunk hex size"); - macro_rules! or_overflow { - ($e:expr) => ( - match $e { - Some(val) => val, - None => return Poll::Ready(Err(io::Error::new( - io::ErrorKind::InvalidData, - "invalid chunk size: overflow", - ))), - } - ) - } - let radix = 16; match byte!(rdr, cx) { b @ b'0'..=b'9' => { @@ -249,7 +312,7 @@ impl ChunkedState { Poll::Ready(Ok(ChunkedState::Size)) } fn read_size_lws( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { trace!("read_size_lws"); @@ -265,8 +328,9 @@ impl ChunkedState { } } fn read_extension( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, + extensions_cnt: &mut u64, ) -> Poll> { trace!("read_extension"); // We don't care about extensions really at all. Just ignore them. @@ -281,11 +345,21 @@ impl ChunkedState { io::ErrorKind::InvalidData, "invalid chunk extension contains newline", ))), - _ => Poll::Ready(Ok(ChunkedState::Extension)), // no supported extensions + _ => { + *extensions_cnt += 1; + if *extensions_cnt >= CHUNKED_EXTENSIONS_LIMIT { + Poll::Ready(Err(io::Error::new( + io::ErrorKind::InvalidData, + "chunk extensions over limit", + ))) + } else { + Poll::Ready(Ok(ChunkedState::Extension)) + } + } // no supported extensions } } fn read_size_lf( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, size: u64, ) -> Poll> { @@ -307,7 +381,7 @@ impl ChunkedState { } fn read_body( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, rem: &mut u64, buf: &mut Option, @@ -341,7 +415,7 @@ impl ChunkedState { } } fn read_body_cr( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { match byte!(rdr, cx) { @@ -353,7 +427,7 @@ impl ChunkedState { } } fn read_body_lf( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { match byte!(rdr, cx) { @@ -366,7 +440,7 @@ impl ChunkedState { } fn read_trailer( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { trace!("read_trailer"); @@ -376,7 +450,7 @@ impl ChunkedState { } } fn read_trailer_lf( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { match byte!(rdr, cx) { @@ -389,7 +463,7 @@ impl ChunkedState { } fn read_end_cr( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { match byte!(rdr, cx) { @@ -398,7 +472,7 @@ impl ChunkedState { } } fn read_end_lf( - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, rdr: &mut R, ) -> Poll> { match byte!(rdr, cx) { @@ -430,7 +504,7 @@ mod tests { use tokio::io::{AsyncRead, ReadBuf}; impl<'a> MemRead for &'a [u8] { - fn read_mem(&mut self, _: &mut task::Context<'_>, len: usize) -> Poll> { + fn read_mem(&mut self, _: &mut Context<'_>, len: usize) -> Poll> { let n = std::cmp::min(len, self.len()); if n > 0 { let (a, b) = self.split_at(n); @@ -444,7 +518,7 @@ mod tests { } impl<'a> MemRead for &'a mut (dyn AsyncRead + Unpin) { - fn read_mem(&mut self, cx: &mut task::Context<'_>, len: usize) -> Poll> { + fn read_mem(&mut self, cx: &mut Context<'_>, len: usize) -> Poll> { let mut v = vec![0; len]; let mut buf = ReadBuf::new(&mut v); ready!(Pin::new(self).poll_read(cx, &mut buf)?); @@ -452,9 +526,8 @@ mod tests { } } - #[cfg(feature = "nightly")] impl MemRead for Bytes { - fn read_mem(&mut self, _: &mut task::Context<'_>, len: usize) -> Poll> { + fn read_mem(&mut self, _: &mut Context<'_>, len: usize) -> Poll> { let n = std::cmp::min(len, self.len()); let ret = self.split_to(n); Poll::Ready(Ok(ret)) @@ -476,13 +549,15 @@ mod tests { use std::io::ErrorKind::{InvalidData, InvalidInput, UnexpectedEof}; async fn read(s: &str) -> u64 { - let mut state = ChunkedState::Size; + let mut state = ChunkedState::new(); let rdr = &mut s.as_bytes(); let mut size = 0; + let mut ext_cnt = 0; loop { - let result = - futures_util::future::poll_fn(|cx| state.step(cx, rdr, &mut size, &mut None)) - .await; + let result = futures_util::future::poll_fn(|cx| { + state.step(cx, rdr, &mut size, &mut ext_cnt, &mut None) + }) + .await; let desc = format!("read_size failed for {:?}", s); state = result.expect(desc.as_str()); if state == ChunkedState::Body || state == ChunkedState::EndCr { @@ -493,13 +568,15 @@ mod tests { } async fn read_err(s: &str, expected_err: io::ErrorKind) { - let mut state = ChunkedState::Size; + let mut state = ChunkedState::new(); let rdr = &mut s.as_bytes(); let mut size = 0; + let mut ext_cnt = 0; loop { - let result = - futures_util::future::poll_fn(|cx| state.step(cx, rdr, &mut size, &mut None)) - .await; + let result = futures_util::future::poll_fn(|cx| { + state.step(cx, rdr, &mut size, &mut ext_cnt, &mut None) + }) + .await; state = match result { Ok(s) => s, Err(e) => { @@ -530,6 +607,9 @@ mod tests { // Missing LF or CRLF read_err("F\rF", InvalidInput).await; read_err("F", UnexpectedEof).await; + // Missing digit + read_err("\r\n\r\n", InvalidInput).await; + read_err("\r\n", InvalidInput).await; // Invalid hex digit read_err("X\r\n", InvalidInput).await; read_err("1X\r\n", InvalidInput).await; @@ -586,6 +666,33 @@ mod tests { assert_eq!("1234567890abcdef", &result); } + #[tokio::test] + async fn test_read_chunked_extensions_over_limit() { + // construct a chunked body where each individual chunked extension + // is totally fine, but combined is over the limit. + let per_chunk = super::CHUNKED_EXTENSIONS_LIMIT * 2 / 3; + let mut scratch = vec![]; + for _ in 0..2 { + scratch.extend(b"1;"); + scratch.extend(b"x".repeat(per_chunk as usize)); + scratch.extend(b"\r\nA\r\n"); + } + scratch.extend(b"0\r\n\r\n"); + let mut mock_buf = Bytes::from(scratch); + + let mut decoder = Decoder::chunked(); + let buf1 = decoder.decode_fut(&mut mock_buf).await.expect("decode1"); + assert_eq!(&buf1[..], b"A"); + + let err = decoder + .decode_fut(&mut mock_buf) + .await + .expect_err("decode2"); + assert_eq!(err.kind(), io::ErrorKind::InvalidData); + assert_eq!(err.to_string(), "chunk extensions over limit"); + } + + #[cfg(not(miri))] #[tokio::test] async fn test_read_chunked_trailer_with_missing_lf() { let mut mock_buf = &b"10\r\n1234567890abcdef\r\n0\r\nbad\r\r\n"[..]; diff --git a/vendor/hyper/src/proto/h1/dispatch.rs b/vendor/hyper/src/proto/h1/dispatch.rs index fddf639d9..3516d7ad2 100644 --- a/vendor/hyper/src/proto/h1/dispatch.rs +++ b/vendor/hyper/src/proto/h1/dispatch.rs @@ -1,4 +1,8 @@ use std::error::Error as StdError; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use bytes::{Buf, Bytes}; use http::Request; @@ -7,10 +11,8 @@ use tracing::{debug, trace}; use super::{Http1Transaction, Wants}; use crate::body::{Body, DecodedLength, HttpBody}; -use crate::common::{task, Future, Pin, Poll, Unpin}; -use crate::proto::{ - BodyLength, Conn, Dispatched, MessageHead, RequestHead, -}; +use crate::common; +use crate::proto::{BodyLength, Conn, Dispatched, MessageHead, RequestHead}; use crate::upgrade::OnUpgrade; pub(crate) struct Dispatcher { @@ -28,10 +30,10 @@ pub(crate) trait Dispatch { type RecvItem; fn poll_msg( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>>; fn recv_msg(&mut self, msg: crate::Result<(Self::RecvItem, Body)>) -> crate::Result<()>; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll>; + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll>; fn should_poll(&self) -> bool; } @@ -60,10 +62,10 @@ cfg_client! { impl Dispatcher where D: Dispatch< - PollItem = MessageHead, - PollBody = Bs, - RecvItem = MessageHead, - > + Unpin, + PollItem = MessageHead, + PollBody = Bs, + RecvItem = MessageHead, + > + Unpin, D::PollError: Into>, I: AsyncRead + AsyncWrite + Unpin, T: Http1Transaction + Unpin, @@ -98,10 +100,7 @@ where /// /// This is useful for old-style HTTP upgrades, but ignores /// newer-style upgrade API. - pub(crate) fn poll_without_shutdown( - &mut self, - cx: &mut task::Context<'_>, - ) -> Poll> + pub(crate) fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> where Self: Unpin, { @@ -114,7 +113,7 @@ where fn poll_catch( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, should_shutdown: bool, ) -> Poll> { Poll::Ready(ready!(self.poll_inner(cx, should_shutdown)).or_else(|e| { @@ -133,7 +132,7 @@ where fn poll_inner( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, should_shutdown: bool, ) -> Poll> { T::update_date(); @@ -154,7 +153,7 @@ where } } - fn poll_loop(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_loop(&mut self, cx: &mut Context<'_>) -> Poll> { // Limit the looping on this connection, in case it is ready far too // often, so that other futures don't starve. // @@ -181,10 +180,10 @@ where trace!("poll_loop yielding (self = {:p})", self); - task::yield_now(cx).map(|never| match never {}) + common::task::yield_now(cx).map(|never| match never {}) } - fn poll_read(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_read(&mut self, cx: &mut Context<'_>) -> Poll> { loop { if self.is_closing { return Poll::Ready(Ok(())); @@ -238,7 +237,7 @@ where } } - fn poll_read_head(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_read_head(&mut self, cx: &mut Context<'_>) -> Poll> { // can dispatch receive, or does it still care about, an incoming message? match ready!(self.dispatch.poll_ready(cx)) { Ok(()) => (), @@ -262,7 +261,10 @@ where if wants.contains(Wants::UPGRADE) { let upgrade = self.conn.on_upgrade(); debug_assert!(!upgrade.is_none(), "empty upgrade"); - debug_assert!(head.extensions.get::().is_none(), "OnUpgrade already set"); + debug_assert!( + head.extensions.get::().is_none(), + "OnUpgrade already set" + ); head.extensions.insert(upgrade); } self.dispatch.recv_msg(Ok((head, body)))?; @@ -290,7 +292,7 @@ where } } - fn poll_write(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_write(&mut self, cx: &mut Context<'_>) -> Poll> { loop { if self.is_closing { return Poll::Ready(Ok(())); @@ -382,7 +384,7 @@ where } } - fn poll_flush(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll> { self.conn.poll_flush(cx).map_err(|err| { debug!("error writing: {}", err); crate::Error::new_body_write(err) @@ -416,10 +418,10 @@ where impl Future for Dispatcher where D: Dispatch< - PollItem = MessageHead, - PollBody = Bs, - RecvItem = MessageHead, - > + Unpin, + PollItem = MessageHead, + PollBody = Bs, + RecvItem = MessageHead, + > + Unpin, D::PollError: Into>, I: AsyncRead + AsyncWrite + Unpin, T: Http1Transaction + Unpin, @@ -429,7 +431,7 @@ where type Output = crate::Result; #[inline] - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { self.poll_catch(cx, true) } } @@ -493,7 +495,7 @@ cfg_server! { fn poll_msg( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { let mut this = self.as_mut(); let ret = if let Some(ref mut fut) = this.in_flight.as_mut().as_pin_mut() { @@ -528,7 +530,7 @@ cfg_server! { Ok(()) } - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { if self.in_flight.is_some() { Poll::Pending } else { @@ -564,13 +566,13 @@ cfg_client! { { type PollItem = RequestHead; type PollBody = B; - type PollError = crate::common::Never; + type PollError = std::convert::Infallible; type RecvItem = crate::proto::ResponseHead; fn poll_msg( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - ) -> Poll>> { + cx: &mut Context<'_>, + ) -> Poll>> { let mut this = self.as_mut(); debug_assert!(!this.rx_closed); match this.rx.poll_recv(cx) { @@ -640,7 +642,7 @@ cfg_client! { } } - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { match self.callback { Some(ref mut cb) => match cb.poll_canceled(cx) { Poll::Ready(()) => { diff --git a/vendor/hyper/src/proto/h1/io.rs b/vendor/hyper/src/proto/h1/io.rs index 1d251e2c8..02d8a4a9e 100644 --- a/vendor/hyper/src/proto/h1/io.rs +++ b/vendor/hyper/src/proto/h1/io.rs @@ -5,6 +5,8 @@ use std::future::Future; use std::io::{self, IoSlice}; use std::marker::Unpin; use std::mem::MaybeUninit; +use std::pin::Pin; +use std::task::{Context, Poll}; #[cfg(all(feature = "server", feature = "runtime"))] use std::time::Duration; @@ -16,7 +18,6 @@ use tracing::{debug, trace}; use super::{Http1Transaction, ParseContext, ParsedMessage}; use crate::common::buf::BufList; -use crate::common::{task, Pin, Poll}; /// The initial buffer size allocated before trying to read from IO. pub(crate) const INIT_BUFFER_SIZE: usize = 8192; @@ -174,7 +175,7 @@ where pub(super) fn parse( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, parse_ctx: ParseContext<'_>, ) -> Poll>> where @@ -250,10 +251,7 @@ where } } - pub(crate) fn poll_read_from_io( - &mut self, - cx: &mut task::Context<'_>, - ) -> Poll> { + pub(crate) fn poll_read_from_io(&mut self, cx: &mut Context<'_>) -> Poll> { self.read_blocked = false; let next = self.read_buf_strategy.next(); if self.read_buf_remaining_mut() < next { @@ -296,7 +294,7 @@ where self.read_blocked } - pub(crate) fn poll_flush(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub(crate) fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll> { if self.flush_pipeline && !self.read_buf.is_empty() { Poll::Ready(Ok(())) } else if self.write_buf.remaining() == 0 { @@ -336,7 +334,7 @@ where /// /// Since all buffered bytes are flattened into the single headers buffer, /// that skips some bookkeeping around using multiple buffers. - fn poll_flush_flattened(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush_flattened(&mut self, cx: &mut Context<'_>) -> Poll> { loop { let n = ready!(Pin::new(&mut self.io).poll_write(cx, self.write_buf.headers.chunk()))?; debug!("flushed {} bytes", n); @@ -366,7 +364,7 @@ impl Unpin for Buffered {} // TODO: This trait is old... at least rename to PollBytes or something... pub(crate) trait MemRead { - fn read_mem(&mut self, cx: &mut task::Context<'_>, len: usize) -> Poll>; + fn read_mem(&mut self, cx: &mut Context<'_>, len: usize) -> Poll>; } impl MemRead for Buffered @@ -374,7 +372,7 @@ where T: AsyncRead + AsyncWrite + Unpin, B: Buf, { - fn read_mem(&mut self, cx: &mut task::Context<'_>, len: usize) -> Poll> { + fn read_mem(&mut self, cx: &mut Context<'_>, len: usize) -> Poll> { if !self.read_buf.is_empty() { let n = std::cmp::min(len, self.read_buf.len()); Poll::Ready(Ok(self.read_buf.split_to(n).freeze())) diff --git a/vendor/hyper/src/proto/h2/client.rs b/vendor/hyper/src/proto/h2/client.rs index bac8eceb3..8c2a4d2e0 100644 --- a/vendor/hyper/src/proto/h2/client.rs +++ b/vendor/hyper/src/proto/h2/client.rs @@ -1,4 +1,9 @@ +use std::convert::Infallible; use std::error::Error as StdError; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; #[cfg(feature = "runtime")] use std::time::Duration; @@ -15,7 +20,7 @@ use tracing::{debug, trace, warn}; use super::{ping, H2Upgraded, PipeToSendStream, SendBuf}; use crate::body::HttpBody; use crate::client::dispatch::Callback; -use crate::common::{exec::Exec, task, Future, Never, Pin, Poll}; +use crate::common::exec::Exec; use crate::ext::Protocol; use crate::headers; use crate::proto::h2::UpgradedSendStream; @@ -28,11 +33,11 @@ type ClientRx = crate::client::dispatch::Receiver, Response> ///// An mpsc channel is used to help notify the `Connection` task when *all* ///// other handles to it have been dropped, so that it can shutdown. -type ConnDropRef = mpsc::Sender; +type ConnDropRef = mpsc::Sender; ///// A oneshot channel watches the `Connection` task, and when it completes, ///// the "dispatch" task will be notified and can shutdown sooner. -type ConnEof = oneshot::Receiver; +type ConnEof = oneshot::Receiver; // Our defaults are chosen for the "majority" case, which usually are not // resource constrained, and so the spec default of 64kb can be too limiting @@ -177,7 +182,7 @@ where }) } -async fn conn_task(conn: C, drop_rx: D, cancel_tx: oneshot::Sender) +async fn conn_task(conn: C, drop_rx: D, cancel_tx: oneshot::Sender) where C: Future + Unpin, D: Future + Unpin, @@ -239,7 +244,7 @@ where B::Data: Send, B::Error: Into>, { - fn poll_pipe(&mut self, f: FutCtx, cx: &mut task::Context<'_>) { + fn poll_pipe(&mut self, f: FutCtx, cx: &mut Context<'_>) { let ping = self.ping.clone(); let send_stream = if !f.is_connect { if !f.eos { @@ -334,7 +339,7 @@ where { type Output = crate::Result; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { loop { match ready!(self.h2_tx.poll_ready(cx)) { Ok(()) => (), diff --git a/vendor/hyper/src/proto/h2/mod.rs b/vendor/hyper/src/proto/h2/mod.rs index 5857c919d..d50850d0a 100644 --- a/vendor/hyper/src/proto/h2/mod.rs +++ b/vendor/hyper/src/proto/h2/mod.rs @@ -4,14 +4,15 @@ use http::header::{HeaderName, CONNECTION, TE, TRAILER, TRANSFER_ENCODING, UPGRA use http::HeaderMap; use pin_project_lite::pin_project; use std::error::Error as StdError; +use std::future::Future; use std::io::{self, Cursor, IoSlice}; use std::mem; -use std::task::Context; +use std::pin::Pin; +use std::task::{Context, Poll}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tracing::{debug, trace, warn}; use crate::body::HttpBody; -use crate::common::{task, Future, Pin, Poll}; use crate::proto::h2::ping::Recorder; pub(crate) mod ping; @@ -116,7 +117,7 @@ where { type Output = crate::Result<()>; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut me = self.project(); loop { if !*me.data_done { @@ -383,14 +384,12 @@ where cx: &mut Context<'_>, ) -> Poll> { if self.send_stream.write(&[], true).is_ok() { - return Poll::Ready(Ok(())) + return Poll::Ready(Ok(())); } Poll::Ready(Err(h2_to_io_error( match ready!(self.send_stream.poll_reset(cx)) { - Ok(Reason::NO_ERROR) => { - return Poll::Ready(Ok(())) - } + Ok(Reason::NO_ERROR) => return Poll::Ready(Ok(())), Ok(Reason::CANCEL) | Ok(Reason::STREAM_CLOSED) => { return Poll::Ready(Err(io::ErrorKind::BrokenPipe.into())) } diff --git a/vendor/hyper/src/proto/h2/ping.rs b/vendor/hyper/src/proto/h2/ping.rs index 1e8386497..d830c93ed 100644 --- a/vendor/hyper/src/proto/h2/ping.rs +++ b/vendor/hyper/src/proto/h2/ping.rs @@ -328,7 +328,7 @@ impl Ponger { } } - if let Some(ref mut bdp) = self.bdp { + if let Some(ref mut bdp) = self.bdp { let bytes = locked.bytes.expect("bdp enabled implies bytes"); locked.bytes = Some(0); // reset trace!("received BDP ack; bytes = {}, rtt = {:?}", bytes, rtt); @@ -336,7 +336,7 @@ impl Ponger { let update = bdp.calculate(bytes, rtt); locked.next_bdp_at = Some(now + bdp.ping_delay); if let Some(update) = update { - return Poll::Ready(Ponged::SizeUpdate(update)) + return Poll::Ready(Ponged::SizeUpdate(update)); } } } diff --git a/vendor/hyper/src/proto/h2/server.rs b/vendor/hyper/src/proto/h2/server.rs index 4127387e7..b4e8d68a1 100644 --- a/vendor/hyper/src/proto/h2/server.rs +++ b/vendor/hyper/src/proto/h2/server.rs @@ -1,5 +1,8 @@ use std::error::Error as StdError; +use std::future::Future; use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; #[cfg(feature = "runtime")] use std::time::Duration; @@ -13,8 +16,8 @@ use tracing::{debug, trace, warn}; use super::{ping, PipeToSendStream, SendBuf}; use crate::body::HttpBody; +use crate::common::date; use crate::common::exec::ConnStreamExec; -use crate::common::{date, task, Future, Pin, Poll}; use crate::ext::Protocol; use crate::headers; use crate::proto::h2::ping::Recorder; @@ -35,8 +38,7 @@ const DEFAULT_CONN_WINDOW: u32 = 1024 * 1024; // 1mb const DEFAULT_STREAM_WINDOW: u32 = 1024 * 1024; // 1mb const DEFAULT_MAX_FRAME_SIZE: u32 = 1024 * 16; // 16kb const DEFAULT_MAX_SEND_BUF_SIZE: usize = 1024 * 400; // 400kb -// 16 MB "sane default" taken from golang http2 -const DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: u32 = 16 << 20; +const DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: u32 = 16 << 20; // 16 MB "sane default" taken from golang http2 #[derive(Clone, Debug)] pub(crate) struct Config { @@ -193,7 +195,7 @@ where { type Output = crate::Result; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let me = &mut *self; loop { let next = match me.state { @@ -236,7 +238,7 @@ where { fn poll_server( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, service: &mut S, exec: &mut E, ) -> Poll> @@ -356,7 +358,7 @@ where Poll::Ready(Err(self.closing.take().expect("polled after error"))) } - fn poll_ping(&mut self, cx: &mut task::Context<'_>) { + fn poll_ping(&mut self, cx: &mut Context<'_>) { if let Some((_, ref mut estimator)) = self.ping { match estimator.poll(cx) { Poll::Ready(ping::Ponged::SizeUpdate(wnd)) => { @@ -447,7 +449,7 @@ where B::Error: Into>, E: Into>, { - fn poll2(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll2(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let mut me = self.project(); loop { let next = match me.state.as_mut().project() { @@ -542,7 +544,7 @@ where { type Output = (); - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { self.poll2(cx).map(|res| { if let Err(e) = res { debug!("stream error: {}", e); diff --git a/vendor/hyper/src/proto/mod.rs b/vendor/hyper/src/proto/mod.rs index f938bf532..3628576dc 100644 --- a/vendor/hyper/src/proto/mod.rs +++ b/vendor/hyper/src/proto/mod.rs @@ -50,7 +50,7 @@ pub(crate) enum BodyLength { Unknown, } -/// Status of when a Disaptcher future completes. +/// Status of when a Dispatcher future completes. pub(crate) enum Dispatched { /// Dispatcher completely shutdown connection. Shutdown, diff --git a/vendor/hyper/src/server/accept.rs b/vendor/hyper/src/server/accept.rs index 4b7a1487d..07dcd6252 100644 --- a/vendor/hyper/src/server/accept.rs +++ b/vendor/hyper/src/server/accept.rs @@ -6,16 +6,14 @@ //! connections. //! - Utilities like `poll_fn` to ease creating a custom `Accept`. +use std::pin::Pin; +use std::task::{Context, Poll}; + #[cfg(feature = "stream")] use futures_core::Stream; #[cfg(feature = "stream")] use pin_project_lite::pin_project; -use crate::common::{ - task::{self, Poll}, - Pin, -}; - /// Asynchronously accept incoming connections. pub trait Accept { /// The connection type that can be accepted. @@ -26,7 +24,7 @@ pub trait Accept { /// Poll to accept the next connection. fn poll_accept( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>>; } @@ -51,7 +49,7 @@ pub trait Accept { /// ``` pub fn poll_fn(func: F) -> impl Accept where - F: FnMut(&mut task::Context<'_>) -> Poll>>, + F: FnMut(&mut Context<'_>) -> Poll>>, { struct PollFn(F); @@ -60,13 +58,13 @@ where impl Accept for PollFn where - F: FnMut(&mut task::Context<'_>) -> Poll>>, + F: FnMut(&mut Context<'_>) -> Poll>>, { type Conn = IO; type Error = E; fn poll_accept( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { (self.get_mut().0)(cx) } @@ -101,7 +99,7 @@ where type Error = E; fn poll_accept( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { self.project().stream.poll_next(cx) } diff --git a/vendor/hyper/src/server/conn.rs b/vendor/hyper/src/server/conn.rs index dfe217245..8ce4c9519 100644 --- a/vendor/hyper/src/server/conn.rs +++ b/vendor/hyper/src/server/conn.rs @@ -68,6 +68,12 @@ cfg_feature! { use std::error::Error as StdError; use std::fmt; + use std::task::{Context, Poll}; + use std::pin::Pin; + use std::future::Future; + use std::marker::Unpin; + #[cfg(not(all(feature = "http1", feature = "http2")))] + use std::convert::Infallible; use bytes::Bytes; use pin_project_lite::pin_project; @@ -76,9 +82,6 @@ cfg_feature! { pub use super::server::Connecting; use crate::body::{Body, HttpBody}; - use crate::common::{task, Future, Pin, Poll, Unpin}; - #[cfg(not(all(feature = "http1", feature = "http2")))] - use crate::common::Never; use crate::common::exec::{ConnStreamExec, Exec}; use crate::proto; use crate::service::HttpService; @@ -156,14 +159,14 @@ type Http1Dispatcher = proto::h1::Dispatcher, B, T, proto::ServerTransaction>; #[cfg(all(not(feature = "http1"), feature = "http2"))] -type Http1Dispatcher = (Never, PhantomData<(T, Box>, Box>)>); +type Http1Dispatcher = (Infallible, PhantomData<(T, Box>, Box>)>); #[cfg(feature = "http2")] type Http2Server = proto::h2::Server, S, B, E>; #[cfg(all(not(feature = "http2"), feature = "http1"))] type Http2Server = ( - Never, + Infallible, PhantomData<(T, Box>, Box>, Box>)>, ); @@ -805,7 +808,7 @@ where /// upgrade. Once the upgrade is completed, the connection would be "done", /// but it is not desired to actually shutdown the IO object. Instead you /// would take it back using `into_parts`. - pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> { + pub fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> { loop { match *self.conn.as_mut().unwrap() { #[cfg(feature = "http1")] @@ -901,7 +904,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { loop { match ready!(Pin::new(self.conn.as_mut().unwrap()).poll(cx)) { Ok(done) => { @@ -980,7 +983,7 @@ where { type Output = crate::Result; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.project() { #[cfg(feature = "http1")] ProtoServerProj::H1 { h1, .. } => h1.poll(cx), @@ -1041,7 +1044,7 @@ mod upgrades { { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { loop { match ready!(Pin::new(self.inner.conn.as_mut().unwrap()).poll(cx)) { Ok(proto::Dispatched::Shutdown) => return Poll::Ready(Ok(())), diff --git a/vendor/hyper/src/server/conn/http1.rs b/vendor/hyper/src/server/conn/http1.rs index b2e54976e..ab833b938 100644 --- a/vendor/hyper/src/server/conn/http1.rs +++ b/vendor/hyper/src/server/conn/http1.rs @@ -2,13 +2,16 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::time::Duration; use bytes::Bytes; use tokio::io::{AsyncRead, AsyncWrite}; use crate::body::{Body as IncomingBody, HttpBody as Body}; -use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::proto; use crate::service::HttpService; @@ -126,7 +129,7 @@ where /// upgrade. Once the upgrade is completed, the connection would be "done", /// but it is not desired to actually shutdown the IO object. Instead you /// would take it back using `into_parts`. - pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> + pub fn poll_without_shutdown(&mut self, cx: &mut Context<'_>) -> Poll> where S: Unpin, S::Future: Unpin, @@ -175,7 +178,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(&mut self.conn).poll(cx)) { Ok(done) => { match done { @@ -431,7 +434,7 @@ mod upgrades { { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(&mut self.inner.as_mut().unwrap().conn).poll(cx)) { Ok(proto::Dispatched::Shutdown) => Poll::Ready(Ok(())), Ok(proto::Dispatched::Upgrade(pending)) => { diff --git a/vendor/hyper/src/server/conn/http2.rs b/vendor/hyper/src/server/conn/http2.rs index 978c646e1..4f7df823a 100644 --- a/vendor/hyper/src/server/conn/http2.rs +++ b/vendor/hyper/src/server/conn/http2.rs @@ -2,6 +2,10 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::time::Duration; use pin_project_lite::pin_project; @@ -9,7 +13,6 @@ use tokio::io::{AsyncRead, AsyncWrite}; use crate::body::{Body as IncomingBody, HttpBody as Body}; use crate::common::exec::ConnStreamExec; -use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::proto; use crate::service::HttpService; @@ -79,7 +82,7 @@ where { type Output = crate::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match ready!(Pin::new(&mut self.conn).poll(cx)) { Ok(_done) => { //TODO: the proto::h2::Server no longer needs to return diff --git a/vendor/hyper/src/server/server.rs b/vendor/hyper/src/server/server.rs index c90eac3e5..6d7d69e51 100644 --- a/vendor/hyper/src/server/server.rs +++ b/vendor/hyper/src/server/server.rs @@ -1,8 +1,11 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::marker::Unpin; #[cfg(feature = "tcp")] use std::net::{SocketAddr, TcpListener as StdTcpListener}; - +use std::pin::Pin; +use std::task::{Context, Poll}; #[cfg(feature = "tcp")] use std::time::Duration; @@ -17,7 +20,6 @@ use super::tcp::AddrIncoming; use crate::body::{Body, HttpBody}; use crate::common::exec::Exec; use crate::common::exec::{ConnStreamExec, NewSvcExec}; -use crate::common::{task, Future, Pin, Poll, Unpin}; // Renamed `Http` as `Http_` for now so that people upgrading don't see an // error that `hyper::server::Http` is private... use super::conn::{Connection, Http as Http_, UpgradeableConnection}; @@ -162,7 +164,7 @@ where fn poll_next_( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>>> { let me = self.project(); match ready!(me.make_service.poll_ready_ref(cx)) { @@ -188,7 +190,7 @@ where pub(super) fn poll_watch( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, watcher: &W, ) -> Poll> where @@ -221,7 +223,7 @@ where { type Output = crate::Result<()>; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { self.poll_watch(cx, &NoopWatcher) } } @@ -629,6 +631,14 @@ impl Builder { self.incoming.set_sleep_on_errors(val); self } + + /// Returns the local address that the server will be bound to. + /// + /// This might be useful when knowing the address is required before calling `Builder::serve`, + /// but the address is not otherwise available (for e.g. when binding to port 0). + pub fn local_addr(&self) -> SocketAddr { + self.incoming.local_addr() + } } // Used by `Server` to optionally watch a `Connection` future. @@ -667,13 +677,17 @@ where // used by exec.rs pub(crate) mod new_svc { use std::error::Error as StdError; + use std::future::Future; + use std::marker::Unpin; + use std::pin::Pin; + use std::task::{Context, Poll}; + use tokio::io::{AsyncRead, AsyncWrite}; use tracing::debug; use super::{Connecting, Watcher}; use crate::body::{Body, HttpBody}; use crate::common::exec::ConnStreamExec; - use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::service::HttpService; use pin_project_lite::pin_project; @@ -734,7 +748,7 @@ pub(crate) mod new_svc { { type Output = (); - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { // If it weren't for needing to name this type so the `Send` bounds // could be projected to the `Serve` executor, this could just be // an `async fn`, and much safer. Woe is me. @@ -802,7 +816,7 @@ where { type Output = Result, FE>; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut me = self.project(); let service = ready!(me.future.poll(cx))?; let io = Option::take(&mut me.io).expect("polled after complete"); diff --git a/vendor/hyper/src/server/shutdown.rs b/vendor/hyper/src/server/shutdown.rs index 96937d082..be858481c 100644 --- a/vendor/hyper/src/server/shutdown.rs +++ b/vendor/hyper/src/server/shutdown.rs @@ -1,4 +1,8 @@ use std::error::Error as StdError; +use std::future::Future; +use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite}; @@ -10,7 +14,6 @@ use super::server::{Server, Watcher}; use crate::body::{Body, HttpBody}; use crate::common::drain::{self, Draining, Signal, Watch, Watching}; use crate::common::exec::{ConnStreamExec, NewSvcExec}; -use crate::common::{task, Future, Pin, Poll, Unpin}; use crate::service::{HttpService, MakeServiceRef}; pin_project! { @@ -63,7 +66,7 @@ where { type Output = crate::Result<()>; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut me = self.project(); loop { let next = { diff --git a/vendor/hyper/src/server/tcp.rs b/vendor/hyper/src/server/tcp.rs index 3f937154b..edbddcd94 100644 --- a/vendor/hyper/src/server/tcp.rs +++ b/vendor/hyper/src/server/tcp.rs @@ -1,15 +1,16 @@ +use socket2::TcpKeepalive; use std::fmt; +use std::future::Future; use std::io; use std::net::{SocketAddr, TcpListener as StdTcpListener}; +use std::pin::Pin; +use std::task::{Context, Poll}; use std::time::Duration; -use socket2::TcpKeepalive; use tokio::net::TcpListener; use tokio::time::Sleep; use tracing::{debug, error, trace}; -use crate::common::{task, Future, Pin, Poll}; - #[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411 pub use self::addr_stream::AddrStream; use super::accept::Accept; @@ -71,7 +72,7 @@ impl TcpKeepaliveConfig { windows, )))] fn ka_with_interval(ka: TcpKeepalive, _: Duration, _: &mut bool) -> TcpKeepalive { - ka // no-op as keepalive interval is not supported on this platform + ka // no-op as keepalive interval is not supported on this platform } #[cfg(any( @@ -100,7 +101,7 @@ impl TcpKeepaliveConfig { target_vendor = "apple", )))] fn ka_with_retries(ka: TcpKeepalive, _: u32, _: &mut bool) -> TcpKeepalive { - ka // no-op as keepalive retries is not supported on this platform + ka // no-op as keepalive retries is not supported on this platform } } @@ -200,7 +201,7 @@ impl AddrIncoming { self.sleep_on_errors = val; } - fn poll_next_(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_next_(&mut self, cx: &mut Context<'_>) -> Poll> { // Check if a previous timeout is active that was set by IO errors. if let Some(ref mut to) = self.timeout { ready!(Pin::new(to).poll(cx)); @@ -261,7 +262,7 @@ impl Accept for AddrIncoming { fn poll_accept( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, ) -> Poll>> { let result = ready!(self.poll_next_(cx)); Poll::Ready(Some(result)) @@ -300,11 +301,11 @@ mod addr_stream { use std::net::SocketAddr; #[cfg(unix)] use std::os::unix::io::{AsRawFd, RawFd}; + use std::pin::Pin; + use std::task::{Context, Poll}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio::net::TcpStream; - use crate::common::{task, Pin, Poll}; - pin_project_lite::pin_project! { /// A transport returned yieled by `AddrIncoming`. #[derive(Debug)] @@ -352,7 +353,7 @@ mod addr_stream { /// not yet available. pub fn poll_peek( &mut self, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &mut tokio::io::ReadBuf<'_>, ) -> Poll> { self.inner.poll_peek(cx, buf) @@ -363,7 +364,7 @@ mod addr_stream { #[inline] fn poll_read( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll> { self.project().inner.poll_read(cx, buf) @@ -374,7 +375,7 @@ mod addr_stream { #[inline] fn poll_write( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &[u8], ) -> Poll> { self.project().inner.poll_write(cx, buf) @@ -383,20 +384,20 @@ mod addr_stream { #[inline] fn poll_write_vectored( self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, bufs: &[io::IoSlice<'_>], ) -> Poll> { self.project().inner.poll_write_vectored(cx, bufs) } #[inline] - fn poll_flush(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { // TCP flush is a noop Poll::Ready(Ok(())) } #[inline] - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { self.project().inner.poll_shutdown(cx) } @@ -420,8 +421,8 @@ mod addr_stream { #[cfg(test)] mod tests { - use std::time::Duration; use crate::server::tcp::TcpKeepaliveConfig; + use std::time::Duration; #[test] fn no_tcp_keepalive_config() { diff --git a/vendor/hyper/src/service/http.rs b/vendor/hyper/src/service/http.rs index 81a20c80b..d0586d8bd 100644 --- a/vendor/hyper/src/service/http.rs +++ b/vendor/hyper/src/service/http.rs @@ -1,7 +1,8 @@ use std::error::Error as StdError; +use std::future::Future; +use std::task::{Context, Poll}; use crate::body::HttpBody; -use crate::common::{task, Future, Poll}; use crate::{Request, Response}; /// An asynchronous function from `Request` to `Response`. @@ -20,7 +21,7 @@ pub trait HttpService: sealed::Sealed { type Future: Future, Self::Error>>; #[doc(hidden)] - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll>; + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll>; #[doc(hidden)] fn call(&mut self, req: Request) -> Self::Future; @@ -37,7 +38,7 @@ where type Error = T::Error; type Future = T::Future; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { tower_service::Service::poll_ready(self, cx) } diff --git a/vendor/hyper/src/service/make.rs b/vendor/hyper/src/service/make.rs index 63e6f298f..188e4f4c3 100644 --- a/vendor/hyper/src/service/make.rs +++ b/vendor/hyper/src/service/make.rs @@ -1,11 +1,12 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; +use std::task::{Context, Poll}; use tokio::io::{AsyncRead, AsyncWrite}; use super::{HttpService, Service}; use crate::body::HttpBody; -use crate::common::{task, Future, Poll}; // The same "trait alias" as tower::MakeConnection, but inlined to reduce // dependencies. @@ -14,7 +15,7 @@ pub trait MakeConnection: self::sealed::Sealed<(Target,)> { type Error; type Future: Future>; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll>; + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll>; fn make_connection(&mut self, target: Target) -> Self::Future; } @@ -29,7 +30,7 @@ where type Error = S::Error; type Future = S::Future; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { Service::poll_ready(self, cx) } @@ -58,7 +59,7 @@ pub trait MakeServiceRef: self::sealed::Sealed<(Target, ReqBody // if necessary. type __DontNameMe: self::sealed::CantImpl; - fn poll_ready_ref(&mut self, cx: &mut task::Context<'_>) -> Poll>; + fn poll_ready_ref(&mut self, cx: &mut Context<'_>) -> Poll>; fn make_service_ref(&mut self, target: &Target) -> Self::Future; } @@ -81,7 +82,7 @@ where type __DontNameMe = self::sealed::CantName; - fn poll_ready_ref(&mut self, cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready_ref(&mut self, cx: &mut Context<'_>) -> Poll> { self.poll_ready(cx) } @@ -159,7 +160,7 @@ where type Response = Svc; type Future = Ret; - fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } diff --git a/vendor/hyper/src/service/oneshot.rs b/vendor/hyper/src/service/oneshot.rs index 2697af8f4..5e2ca4763 100644 --- a/vendor/hyper/src/service/oneshot.rs +++ b/vendor/hyper/src/service/oneshot.rs @@ -1,10 +1,12 @@ // TODO: Eventually to be replaced with tower_util::Oneshot. +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; + use pin_project_lite::pin_project; use tower_service::Service; -use crate::common::{task, Future, Pin, Poll}; - pub(crate) fn oneshot(svc: S, req: Req) -> Oneshot where S: Service, @@ -47,7 +49,7 @@ where { type Output = Result; - fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let mut me = self.project(); loop { diff --git a/vendor/hyper/src/service/util.rs b/vendor/hyper/src/service/util.rs index 7cba1206f..59760a685 100644 --- a/vendor/hyper/src/service/util.rs +++ b/vendor/hyper/src/service/util.rs @@ -1,9 +1,10 @@ use std::error::Error as StdError; use std::fmt; +use std::future::Future; use std::marker::PhantomData; +use std::task::{Context, Poll}; use crate::body::HttpBody; -use crate::common::{task, Future, Poll}; use crate::{Request, Response}; /// Create a `Service` from a function. @@ -54,7 +55,7 @@ where type Error = E; type Future = Ret; - fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } diff --git a/vendor/hyper/src/upgrade.rs b/vendor/hyper/src/upgrade.rs index 1c7b5b01c..a46a8d224 100644 --- a/vendor/hyper/src/upgrade.rs +++ b/vendor/hyper/src/upgrade.rs @@ -42,8 +42,11 @@ use std::any::TypeId; use std::error::Error as StdError; use std::fmt; +use std::future::Future; use std::io; use std::marker::Unpin; +use std::pin::Pin; +use std::task::{Context, Poll}; use bytes::Bytes; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; @@ -52,7 +55,6 @@ use tokio::sync::oneshot; use tracing::trace; use crate::common::io::Rewind; -use crate::common::{task, Future, Pin, Poll}; /// An upgraded HTTP connection. /// @@ -151,7 +153,7 @@ impl Upgraded { impl AsyncRead for Upgraded { fn poll_read( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll> { Pin::new(&mut self.io).poll_read(cx, buf) @@ -161,7 +163,7 @@ impl AsyncRead for Upgraded { impl AsyncWrite for Upgraded { fn poll_write( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, buf: &[u8], ) -> Poll> { Pin::new(&mut self.io).poll_write(cx, buf) @@ -169,17 +171,17 @@ impl AsyncWrite for Upgraded { fn poll_write_vectored( mut self: Pin<&mut Self>, - cx: &mut task::Context<'_>, + cx: &mut Context<'_>, bufs: &[io::IoSlice<'_>], ) -> Poll> { Pin::new(&mut self.io).poll_write_vectored(cx, bufs) } - fn poll_flush(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { Pin::new(&mut self.io).poll_flush(cx) } - fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll> { + fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { Pin::new(&mut self.io).poll_shutdown(cx) } @@ -210,7 +212,7 @@ impl OnUpgrade { impl Future for OnUpgrade { type Output = Result; - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match self.rx { Some(ref mut rx) => Pin::new(rx).poll(cx).map(|res| match res { Ok(Ok(upgraded)) => Ok(upgraded), @@ -351,7 +353,7 @@ mod tests { impl AsyncRead for Mock { fn poll_read( self: Pin<&mut Self>, - _cx: &mut task::Context<'_>, + _cx: &mut Context<'_>, _buf: &mut ReadBuf<'_>, ) -> Poll> { unreachable!("Mock::poll_read") @@ -361,21 +363,18 @@ mod tests { impl AsyncWrite for Mock { fn poll_write( self: Pin<&mut Self>, - _: &mut task::Context<'_>, + _: &mut Context<'_>, buf: &[u8], ) -> Poll> { // panic!("poll_write shouldn't be called"); Poll::Ready(Ok(buf.len())) } - fn poll_flush(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { unreachable!("Mock::poll_flush") } - fn poll_shutdown( - self: Pin<&mut Self>, - _cx: &mut task::Context<'_>, - ) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { unreachable!("Mock::poll_shutdown") } } diff --git a/vendor/iana-time-zone/.cargo-checksum.json b/vendor/iana-time-zone/.cargo-checksum.json index 2d2162ed3..b15965e51 100644 --- a/vendor/iana-time-zone/.cargo-checksum.json +++ b/vendor/iana-time-zone/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"06a68167a7b076a65c27f291a2a30dcbbf6a279a1d0870d362e5ebb07e4e2c20","Cargo.lock":"eb4de93206cd66fb4f4589aabfe336548fb915df6bba9f89c853ece3d3f59bbb","Cargo.toml":"0f1c575c0046c5b5f01889f5ab73a4bbd5f5a1cf03d62602d03682c11047bb6c","LICENSE-APACHE":"696759d65dfe558ff7d9f031c76db19ec5c0767470fb67c4e8d990820d1e99c9","LICENSE-MIT":"da28ccc6b158fc2d8cccc74e99794b1cff1d29bd7bbeb019442fcf0c04c6cad9","README.md":"c5531c44131c4b4473a747d6eab8868d31964da70af6264650253212df5ba9f4","bindings.txt":"608c53ab0830c3da96367755f20082cb4d5d0e88eda37620aaf5a93be36584fa","examples/get_timezone.rs":"c4db7b1cc71c7b3728ddd70e76c0dbd40239c6b1b8c705cb63476757d3177dec","examples/stress-test.rs":"3ad469de5a650389699c9ffe5fd78af2bdd46e7140cc05391c60d793fc6f8e98","src/Windows.rs":"d03104c3fbeb63b239ba0191cf0b8fcfecbbe99d59a7a061adc0d745cd931c8e","src/ffi_utils.rs":"bfbd155b004c2fc4e793aec4604c7b353f71caf35bf67e9b34cd07349628571f","src/lib.rs":"6f0c90477b86f05edf9bfed7cd67f3277ac01bc6c039cc6d8f157e8d33429227","src/platform.rs":"7847381ca6976d9f39ce84759a3b0d7aabe31eae7a88bc20d7fb99bc376782b0","src/tz_aix.rs":"3eb9b1fe8cd6d2547ec6a52bedc120dca88100bef5e7610427048461daa237eb","src/tz_android.rs":"3da37f1b87f87a0ed215734f2b373b2d187bcf49386adfe8bfff207f9a5e8fe2","src/tz_freebsd.rs":"4247af5c6dd0712705186ed54d789193c64139f707af316d4fde86aa1e2a1b13","src/tz_haiku.rs":"761afd80301683a44bf937bbf6b13c5c792af42ed7037623bbeccbab6d0aa8fc","src/tz_illumos.rs":"375ae951d1417f63e6d77c9add7f7f646f24c0054cb8407bd4b9f06907494888","src/tz_linux.rs":"3f04dbc1345ef6783881f3ff9aef4449819dbdc8a1578ffad69c03dc65623f9a","src/tz_macos.rs":"081d5e60955268a1b6949089354eb6657de1c2eb569a69f4e094b995270d540d","src/tz_netbsd.rs":"ec278bbe1cb5f648c063ec23bff6081146454b9f6aa3918b9ca50b8804d5838f","src/tz_wasm32.rs":"10aa33caa86645a16e2126fe1a86dda2b57f63caa9addcd726245fbc9657dc1b","src/tz_windows.rs":"9eda7e9a4cc830f09c06cdaf70026cc95ca55248260a335e1fced68f381bbdfc"},"package":"8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"} \ No newline at end of file +{"files":{"CHANGELOG.md":"7e646dd6b78da599c9f30293e7e39ea66e82c309a0c1fe79e1fe29d12e6ed41a","Cargo.lock":"78b72364f8b23fdac5f2d50d40412cfde9ea66aa3407d2a7807ec78224f093b4","Cargo.toml":"e3848bb6d29083def81064ceb87804ffb7e44828187d79369199b30ffcc0851c","LICENSE-APACHE":"696759d65dfe558ff7d9f031c76db19ec5c0767470fb67c4e8d990820d1e99c9","LICENSE-MIT":"da28ccc6b158fc2d8cccc74e99794b1cff1d29bd7bbeb019442fcf0c04c6cad9","README.md":"620fdbc62e16014c8152092558a98dc20e26db152589b6f55c869c7b7e584c89","bindings.txt":"608c53ab0830c3da96367755f20082cb4d5d0e88eda37620aaf5a93be36584fa","examples/get_timezone.rs":"c4db7b1cc71c7b3728ddd70e76c0dbd40239c6b1b8c705cb63476757d3177dec","examples/stress-test.rs":"3ad469de5a650389699c9ffe5fd78af2bdd46e7140cc05391c60d793fc6f8e98","src/Windows.rs":"d03104c3fbeb63b239ba0191cf0b8fcfecbbe99d59a7a061adc0d745cd931c8e","src/ffi_utils.rs":"bfbd155b004c2fc4e793aec4604c7b353f71caf35bf67e9b34cd07349628571f","src/lib.rs":"6f0c90477b86f05edf9bfed7cd67f3277ac01bc6c039cc6d8f157e8d33429227","src/platform.rs":"7847381ca6976d9f39ce84759a3b0d7aabe31eae7a88bc20d7fb99bc376782b0","src/tz_aix.rs":"3eb9b1fe8cd6d2547ec6a52bedc120dca88100bef5e7610427048461daa237eb","src/tz_android.rs":"3da37f1b87f87a0ed215734f2b373b2d187bcf49386adfe8bfff207f9a5e8fe2","src/tz_freebsd.rs":"4247af5c6dd0712705186ed54d789193c64139f707af316d4fde86aa1e2a1b13","src/tz_haiku.rs":"761afd80301683a44bf937bbf6b13c5c792af42ed7037623bbeccbab6d0aa8fc","src/tz_illumos.rs":"375ae951d1417f63e6d77c9add7f7f646f24c0054cb8407bd4b9f06907494888","src/tz_linux.rs":"3f04dbc1345ef6783881f3ff9aef4449819dbdc8a1578ffad69c03dc65623f9a","src/tz_macos.rs":"081d5e60955268a1b6949089354eb6657de1c2eb569a69f4e094b995270d540d","src/tz_netbsd.rs":"ec278bbe1cb5f648c063ec23bff6081146454b9f6aa3918b9ca50b8804d5838f","src/tz_wasm32.rs":"10aa33caa86645a16e2126fe1a86dda2b57f63caa9addcd726245fbc9657dc1b","src/tz_windows.rs":"9eda7e9a4cc830f09c06cdaf70026cc95ca55248260a335e1fced68f381bbdfc"},"package":"b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539"} \ No newline at end of file diff --git a/vendor/iana-time-zone/CHANGELOG.md b/vendor/iana-time-zone/CHANGELOG.md index 6ba890049..d4c50f7ef 100644 --- a/vendor/iana-time-zone/CHANGELOG.md +++ b/vendor/iana-time-zone/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.59] - 2023-12-30 +### Changed +- update `windows` dependency ([#125](https://github.com/strawlab/iana-time-zone/pull/125)) + ## [0.1.58] - 2023-10-17 ### Added - use windows-core with embedded bindings via windows-bindgen ([#117](https://github.com/strawlab/iana-time-zone/pull/117)) @@ -258,6 +262,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Implement for Linux, Windows, MacOS +[0.1.59]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.59 [0.1.58]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.58 [0.1.57]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.57 [0.1.56]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.56 diff --git a/vendor/iana-time-zone/Cargo.lock b/vendor/iana-time-zone/Cargo.lock index 79b13938f..9600d5f70 100644 --- a/vendor/iana-time-zone/Cargo.lock +++ b/vendor/iana-time-zone/Cargo.lock @@ -13,15 +13,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "libc", ] @@ -50,7 +50,7 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "log" @@ -93,24 +93,24 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -123,9 +123,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "syn" -version = "2.0.37" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "wasm-bindgen" diff --git a/vendor/iana-time-zone/Cargo.toml b/vendor/iana-time-zone/Cargo.toml index 5df5ac7d8..4bcc85d43 100644 --- a/vendor/iana-time-zone/Cargo.toml +++ b/vendor/iana-time-zone/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" authors = [ "Andrew Straw ", "René Kijewski ", @@ -54,4 +54,4 @@ version = "0.1.5" version = "0.1.1" [target."cfg(target_os = \"windows\")".dependencies.windows-core] -version = ">=0.50, <=0.51" +version = ">=0.50, <=0.53" diff --git a/vendor/iana-time-zone/README.md b/vendor/iana-time-zone/README.md index f9e80e206..ac3a1e7f8 100644 --- a/vendor/iana-time-zone/README.md +++ b/vendor/iana-time-zone/README.md @@ -3,7 +3,7 @@ [![Crates.io](https://img.shields.io/crates/v/iana-time-zone.svg)](https://crates.io/crates/iana-time-zone) [![Documentation](https://docs.rs/iana-time-zone/badge.svg)](https://docs.rs/iana-time-zone/) [![Crate License](https://img.shields.io/crates/l/iana-time-zone.svg)](https://crates.io/crates/iana-time-zone) -[![build](https://github.com/strawlab/iana-time-zone/workflows/build/badge.svg?branch=main)](https://github.com/strawlab/iana-time-zone/actions?query=branch%3Amain) +[![build](https://github.com/strawlab/iana-time-zone/actions/workflows/rust.yml/badge.svg)](https://github.com/strawlab/iana-time-zone/actions?query=branch%3Amain) This small utility crate gets the IANA time zone for the current system. This is also known the [tz database](https://en.wikipedia.org/wiki/Tz_database), diff --git a/vendor/indexmap/.cargo-checksum.json b/vendor/indexmap/.cargo-checksum.json index e58b146fe..906376bd1 100644 --- a/vendor/indexmap/.cargo-checksum.json +++ b/vendor/indexmap/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"7049b39c9bc740c313a738053b3d058aa66a5fdc1bd9f2e195c961d6d0dd5e92","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ecc269ef87fd38a1d98e30bfac9ba964a9dbd9315c3770fed98d4d7cb5882055","README.md":"37c2da326dcc144e67b9371ec98c78becfbbb8fab93d0537999b6083bdb80243","RELEASES.md":"c22f67c4bc30852920125c80eb52ad00152b2b61b5254acb8d39081d7d8b5f32","benches/bench.rs":"3b2900abbc9e8a60af78b0395222ee75e86bc68519a0f38477387d1572eed397","benches/faststring.rs":"5fdd6cdb19d0557ed58f241e809a240cf8939d9e5b87a72d5f127f81ab98380b","src/arbitrary.rs":"068713b1e8e762dbe9e4d19d555e77c17e59408335a40f4777d6100340605655","src/lib.rs":"66bfcbc906d703f19715a03d42caa84435f71174316bd31d44beca698c22c8d4","src/macros.rs":"32ab59dfb19713598769252e5fbcef31744dd0399bc839375c4edb5f00701b0d","src/map.rs":"197b39ea7eca1497129a9d4059a1731d5306c9a08dd7cfd5eac13c89f759c8cb","src/map/core.rs":"d59dfa0a1838b6a034c32cc41426b42d9180127d5d36324a106c732f94db7e1e","src/map/core/raw.rs":"f8b19c728978278754ae49e98deb8de1034f007805d1f254d43208b0c453ed6f","src/map/iter.rs":"23278a1787d08dcbc30885c0653369d82a695a7b8f1084d7709fbf903e53a776","src/map/serde_seq.rs":"eff1ccbefe20c8f4338afa92732473e28fd0b752cb2bc153600ee5387d484627","src/map/slice.rs":"1aa189fe7b0cef6362a7c06cce31ee43c2c842ee288e5dab86196743789b76fd","src/map/tests.rs":"1866c233e34a06cc51a2e66824d68a11ac4fd3d1621a88a24af5a3882ef0de6a","src/mutable_keys.rs":"2bdd739bde1dd7f81c82e90595b877fbdb1cd9f963b180fcc819128bb1c750a7","src/rayon/map.rs":"22a30fa68437f69c24752c8ed17be6e084d02b0c12730e48e238a4e92f208b55","src/rayon/mod.rs":"019e9379ccab57a299ab5b5a2c0efc7561b77a715a5afe8f797c7e8330c6206c","src/rayon/set.rs":"cea2517db405ee64306e24b571ed773e129eae43ecfc866e93e365c118edc0ed","src/rustc.rs":"fe7a348c5a10a66880cb6c737593fe79d3b6de40f44ba0d7b89204aa95e14a3a","src/serde.rs":"91bbf14e3afbcf518aeb7f8a9b65011d0ede2f88d12857dfddda451f35574281","src/set.rs":"3d46a0d43878d965df81a2de16155c7ca8400cea245a81e28b8f9dd3f94727b2","src/set/iter.rs":"9b90c736185889fca8b0a461293da4a1a1e50d9db539bd5b9f72254bee461a3e","src/set/slice.rs":"18556170598113341e6381ad1a6234441969e7ac0e3674b7e6da29d7ffb82979","src/set/tests.rs":"155c6eec14c2979c3acebfa9c2675f249937b427780f61670a83fafd85cf1f3b","src/util.rs":"dbd57cfdac2a72db8c5ce83bf288bcaf33b5ae59adddcd088792a624c4c0e909","tests/equivalent_trait.rs":"efe9393069e3cfc893d2c9c0343679979578e437fdb98a10baefeced027ba310","tests/macros_full_path.rs":"c33c86d7341581fdd08e2e6375a4afca507fa603540c54a3b9e51c4cd011cd71","tests/quick.rs":"f34ae9ce8aa51d9338595c299a2088ab56dbb5c04786050009a2fa22a6bbfa32","tests/tests.rs":"f6dbeeb0e2950402b0e66ac52bf74c9e4197d3c5d9c0dde64a7998a2ef74d327"},"package":"d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"} \ No newline at end of file +{"files":{"Cargo.toml":"fd79afa3548b4cd15c304ed4a185d7b2e10c97a939e190f1e4cd118b706a0bec","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ecc269ef87fd38a1d98e30bfac9ba964a9dbd9315c3770fed98d4d7cb5882055","README.md":"98781168dcaf64ed3eecbf7146311045433773486259a372b985c9ae28545017","RELEASES.md":"c0afc02ff349030acc60cbf4a58a32b51bd71539d053fafb1935eebaae35a915","benches/bench.rs":"3b2900abbc9e8a60af78b0395222ee75e86bc68519a0f38477387d1572eed397","benches/faststring.rs":"5fdd6cdb19d0557ed58f241e809a240cf8939d9e5b87a72d5f127f81ab98380b","src/arbitrary.rs":"068713b1e8e762dbe9e4d19d555e77c17e59408335a40f4777d6100340605655","src/lib.rs":"288df4aefc05cca62a797e30ebdedfb44db114c28208714721af94db93d5587d","src/macros.rs":"1493afee2db2c9744be99e5fc32d0cd3742b8a3dbb31fa786ebbe28f1387e7d6","src/map.rs":"ccb7c5da334f3548b569adb1368a27ab069cd20b4342d37d9593518efaa81309","src/map/core.rs":"b7744c94cda90510cda9777646f2b5886af437e08052e0924c7e58f97be7cbdd","src/map/core/entry.rs":"209d3ecc5f100854c95884d50d71566e3abe95e341392684cbf8af83041f4ef7","src/map/core/raw.rs":"de8d4d403a382b462b6ec910c9d90b13cf1b759d4339b5fe5455a6fcb45578b7","src/map/core/raw_entry_v1.rs":"eb4d09bb0c56f77b3f5743a5c1b9cdcf7775ea12fe0b7ef03f821fa3d28a27f7","src/map/iter.rs":"ae0023c1ccc78ac765dc43fe51f233f2fca1ebba132490db8429941183d2c497","src/map/serde_seq.rs":"d9db16f740237ebe50c4acade4dc3de59fe40b95cd39396a02dbb75f5f242978","src/map/slice.rs":"40f063e78f0658b89cc3f6dfdedbd251c9cd00a2cb44be2404ce0020a7e8fac3","src/map/tests.rs":"3bb10e6cd84409747ab5b95eafc99b713b6631a34260056d978ecb417aafa023","src/mutable_keys.rs":"312f70e0e595b88977eb77e43dd1a4f282566048fb0cadb5d13fd87835fd9e0b","src/rayon/map.rs":"0fad36851fdf6894695e526c684c9b3afeac82e29016e6a523eea68cc3b2d19d","src/rayon/mod.rs":"1c9c13b5cf6974f652ded53b014774944c761f079a77a61b3bc52eaa3d4b972b","src/rayon/set.rs":"4b076dbfd9a7eb2fd65783f1c8a5acabe075403f3d05e30c337676acec25d8ee","src/rustc.rs":"fe7a348c5a10a66880cb6c737593fe79d3b6de40f44ba0d7b89204aa95e14a3a","src/serde.rs":"9d564a502083be3c23924f9680a49b8f00ee30117ef43df9c800290811104a36","src/set.rs":"05035156b1f6302ad519ceb07691f502f3ab9649dbc2a373699f8116b12754a3","src/set/iter.rs":"a387c48eff0338b5c8f4e2059403bd665a9c8037634cc5860f80b72a4fbbed30","src/set/slice.rs":"f3101f971da512fa7d9da1fab3ae76489ed082bc0f94300246ed705cf597e6eb","src/set/tests.rs":"d9eb244e25bdece6738f89aa96db9e5394f39b327ed6c7936281dd66134a71d2","src/util.rs":"dbd57cfdac2a72db8c5ce83bf288bcaf33b5ae59adddcd088792a624c4c0e909","tests/equivalent_trait.rs":"efe9393069e3cfc893d2c9c0343679979578e437fdb98a10baefeced027ba310","tests/macros_full_path.rs":"c33c86d7341581fdd08e2e6375a4afca507fa603540c54a3b9e51c4cd011cd71","tests/quick.rs":"f34ae9ce8aa51d9338595c299a2088ab56dbb5c04786050009a2fa22a6bbfa32","tests/tests.rs":"f6dbeeb0e2950402b0e66ac52bf74c9e4197d3c5d9c0dde64a7998a2ef74d327"},"package":"824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520"} \ No newline at end of file diff --git a/vendor/indexmap/Cargo.toml b/vendor/indexmap/Cargo.toml index 65be975ee..4fb0578bf 100644 --- a/vendor/indexmap/Cargo.toml +++ b/vendor/indexmap/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.63" name = "indexmap" -version = "2.1.0" +version = "2.2.2" description = "A hash table with consistent order and fast iteration." documentation = "https://docs.rs/indexmap/" readme = "README.md" @@ -26,7 +26,7 @@ categories = [ "no-std", ] license = "Apache-2.0 OR MIT" -repository = "https://github.com/bluss/indexmap" +repository = "https://github.com/indexmap-rs/indexmap" [package.metadata.docs.rs] features = [ @@ -90,7 +90,7 @@ version = "1.0" version = "0.2.1" [dev-dependencies.itertools] -version = "0.11" +version = "0.12" [dev-dependencies.lazy_static] version = "1.3" @@ -110,3 +110,6 @@ version = "1.0" default = ["std"] std = [] test_debug = [] + +[lints.clippy] +style = "allow" diff --git a/vendor/indexmap/README.md b/vendor/indexmap/README.md index bf8693231..9112d5289 100644 --- a/vendor/indexmap/README.md +++ b/vendor/indexmap/README.md @@ -1,6 +1,6 @@ # indexmap -[![build status](https://github.com/bluss/indexmap/workflows/Continuous%20integration/badge.svg?branch=master)](https://github.com/bluss/indexmap/actions) +[![build status](https://github.com/indexmap-rs/indexmap/workflows/Continuous%20integration/badge.svg?branch=master)](https://github.com/indexmap-rs/indexmap/actions) [![crates.io](https://img.shields.io/crates/v/indexmap.svg)](https://crates.io/crates/indexmap) [![docs](https://docs.rs/indexmap/badge.svg)](https://docs.rs/indexmap) [![rustc](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg) @@ -26,7 +26,9 @@ was indexmap, a hash table that has following properties: - Order is **independent of hash function** and hash values of keys. - Fast to iterate. - Indexed in compact space. -- Preserves insertion order **as long** as you don't call `.remove()`. +- Preserves insertion order **as long** as you don't call `.remove()`, + `.swap_remove()`, or other methods that explicitly change order. + The alternate `.shift_remove()` does preserve relative order. - Uses hashbrown for the inner table, just like Rust's libstd `HashMap` does. ## Performance @@ -52,4 +54,4 @@ which is roughly: # Recent Changes -See [RELEASES.md](https://github.com/bluss/indexmap/blob/master/RELEASES.md). +See [RELEASES.md](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md). diff --git a/vendor/indexmap/RELEASES.md b/vendor/indexmap/RELEASES.md index 817a2dc2f..15000bef2 100644 --- a/vendor/indexmap/RELEASES.md +++ b/vendor/indexmap/RELEASES.md @@ -1,3 +1,38 @@ +- 2.2.2 + + - Added indexing methods to raw entries: `RawEntryBuilder::from_hash_full`, + `RawEntryBuilder::index_from_hash`, and `RawEntryMut::index`. + +- 2.2.1 + + - Corrected the signature of `RawOccupiedEntryMut::into_key(self) -> &'a mut K`, + This a breaking change from 2.2.0, but that version was published for less + than a day and has now been yanked. + +- 2.2.0 + + - The new `IndexMap::get_index_entry` method finds an entry by its index for + in-place manipulation. + + - The `Keys` iterator now implements `Index` for quick access to the + entry's key, compared to indexing the map to get the value. + + - The new `IndexMap::splice` and `IndexSet::splice` methods will drain the + given range as an iterator, and then replace that range with entries from + an input iterator. + + - The new trait `RawEntryApiV1` offers opt-in access to a raw entry API for + `IndexMap`, corresponding to the unstable API on `HashSet` as of Rust 1.75. + + - Many `IndexMap` and `IndexSet` methods have relaxed their type constraints, + e.g. removing `K: Hash` on methods that don't actually need to hash. + + - Removal methods `remove`, `remove_entry`, and `take` are now deprecated + in favor of their `shift_` or `swap_` prefixed variants, which are more + explicit about their effect on the index and order of remaining items. + The deprecated methods will remain to guide drop-in replacements from + `HashMap` and `HashSet` toward the prefixed methods. + - 2.1.0 - Empty slices can now be created with `map::Slice::{new, new_mut}` and @@ -6,7 +41,7 @@ - `IndexMap`, `IndexSet`, and their respective `Slice`s all have binary search methods for sorted data: map `binary_search_keys` and set - `binary_search` for plain comparision, `binary_search_by` for custom + `binary_search` for plain comparison, `binary_search_by` for custom comparators, `binary_search_by_key` for key extraction, and `partition_point` for boolean conditions. @@ -95,7 +130,7 @@ - The new `IndexSet::replace_full` will return the index of the item along with the replaced value, if any, by @zakcutner in PR [222]. -[222]: https://github.com/bluss/indexmap/pull/222 +[222]: https://github.com/indexmap-rs/indexmap/pull/222 - 1.8.0 @@ -120,12 +155,12 @@ which sort in-place without preserving the order of equal items, by @bhgomes in PR [211]. -[195]: https://github.com/bluss/indexmap/pull/195 -[196]: https://github.com/bluss/indexmap/pull/196 -[197]: https://github.com/bluss/indexmap/pull/197 -[203]: https://github.com/bluss/indexmap/pull/203 -[205]: https://github.com/bluss/indexmap/pull/205 -[211]: https://github.com/bluss/indexmap/pull/211 +[195]: https://github.com/indexmap-rs/indexmap/pull/195 +[196]: https://github.com/indexmap-rs/indexmap/pull/196 +[197]: https://github.com/indexmap-rs/indexmap/pull/197 +[203]: https://github.com/indexmap-rs/indexmap/pull/203 +[205]: https://github.com/indexmap-rs/indexmap/pull/205 +[211]: https://github.com/indexmap-rs/indexmap/pull/211 - 1.7.0 @@ -141,8 +176,8 @@ - The new `Entry::or_insert_with_key` matches Rust 1.50's `Entry` method, passing `&K` to the callback to create a value, by @cuviper in PR [175]. -[170]: https://github.com/bluss/indexmap/pull/170 -[175]: https://github.com/bluss/indexmap/pull/175 +[170]: https://github.com/indexmap-rs/indexmap/pull/170 +[175]: https://github.com/indexmap-rs/indexmap/pull/175 - 1.6.1 @@ -153,8 +188,8 @@ `truncate`, `split_off`, `first`, `first_mut`, `last`, `last_mut`, and `swap_indices`, by @cuviper in PR [160]. -[158]: https://github.com/bluss/indexmap/pull/158 -[160]: https://github.com/bluss/indexmap/pull/160 +[158]: https://github.com/indexmap-rs/indexmap/pull/158 +[160]: https://github.com/indexmap-rs/indexmap/pull/160 - 1.6.0 @@ -168,7 +203,7 @@ want the default `S = RandomState`, bypassing the autodetection added in 1.3.0, by @cuviper in PR [145]. -[145]: https://github.com/bluss/indexmap/pull/145 +[145]: https://github.com/indexmap-rs/indexmap/pull/145 - 1.5.1 @@ -178,9 +213,9 @@ - `drain` now accepts any `R: RangeBounds` by @cuviper in PR [142]. -[132]: https://github.com/bluss/indexmap/pull/132 -[141]: https://github.com/bluss/indexmap/pull/141 -[142]: https://github.com/bluss/indexmap/pull/142 +[132]: https://github.com/indexmap-rs/indexmap/pull/132 +[141]: https://github.com/indexmap-rs/indexmap/pull/141 +[142]: https://github.com/indexmap-rs/indexmap/pull/142 - 1.5.0 @@ -196,10 +231,10 @@ - Add new method `reverse` by @linclelinkpart5 in PR [128] -[125]: https://github.com/bluss/indexmap/pull/125 -[128]: https://github.com/bluss/indexmap/pull/128 -[131]: https://github.com/bluss/indexmap/pull/131 -[136]: https://github.com/bluss/indexmap/pull/136 +[125]: https://github.com/indexmap-rs/indexmap/pull/125 +[128]: https://github.com/indexmap-rs/indexmap/pull/128 +[131]: https://github.com/indexmap-rs/indexmap/pull/131 +[136]: https://github.com/indexmap-rs/indexmap/pull/136 - 1.4.0 @@ -212,9 +247,9 @@ now run using Rust 1.32 or later (MSRV for building the crate has not changed). by @kjeremy and @bluss -[123]: https://github.com/bluss/indexmap/issues/123 -[115]: https://github.com/bluss/indexmap/pull/115 -[120]: https://github.com/bluss/indexmap/pull/120 +[123]: https://github.com/indexmap-rs/indexmap/issues/123 +[115]: https://github.com/indexmap-rs/indexmap/pull/115 +[120]: https://github.com/indexmap-rs/indexmap/pull/120 - 1.3.2 @@ -358,7 +393,7 @@ See [#10] for more information. - Implement `Extend<(&K, &V)>` by @xfix. -[#10]: https://github.com/bluss/ordermap/pull/10 +[#10]: https://github.com/indexmap-rs/indexmap/pull/10 - 0.2.13 @@ -407,7 +442,7 @@ - Improved performance of `.insert()` ([#3]) by @pczarn. -[#3]: https://github.com/bluss/ordermap/pull/3 +[#3]: https://github.com/indexmap-rs/indexmap/pull/3 - 0.2.3 diff --git a/vendor/indexmap/src/lib.rs b/vendor/indexmap/src/lib.rs index 5e427843f..b88c1bceb 100644 --- a/vendor/indexmap/src/lib.rs +++ b/vendor/indexmap/src/lib.rs @@ -1,7 +1,6 @@ // We *mostly* avoid unsafe code, but `map::core::raw` allows it to use `RawTable` buckets. #![deny(unsafe_code)] #![warn(rust_2018_idioms)] -#![doc(html_root_url = "https://docs.rs/indexmap/1/")] #![no_std] //! [`IndexMap`] is a hash table where the iteration order of the key-value @@ -10,10 +9,6 @@ //! [`IndexSet`] is a corresponding hash set using the same implementation and //! with similar properties. //! -//! [`IndexMap`]: map/struct.IndexMap.html -//! [`IndexSet`]: set/struct.IndexSet.html -//! -//! //! ### Highlights //! //! [`IndexMap`] and [`IndexSet`] are drop-in compatible with the std `HashMap` @@ -56,7 +51,8 @@ //! //! ### Alternate Hashers //! -//! [`IndexMap`] and [`IndexSet`] have a default hasher type `S = RandomState`, +//! [`IndexMap`] and [`IndexSet`] have a default hasher type +//! [`S = RandomState`][std::collections::hash_map::RandomState], //! just like the standard `HashMap` and `HashSet`, which is resistant to //! HashDoS attacks but not the most performant. Type aliases can make it easier //! to use alternate hashers: @@ -95,14 +91,11 @@ //! //! - Creating maps and sets using [`new`][IndexMap::new] and //! [`with_capacity`][IndexMap::with_capacity] is unavailable without `std`. -//! Use methods [`IndexMap::default`][def], -//! [`with_hasher`][IndexMap::with_hasher], +//! Use methods [`IndexMap::default`], [`with_hasher`][IndexMap::with_hasher], //! [`with_capacity_and_hasher`][IndexMap::with_capacity_and_hasher] instead. //! A no-std compatible hasher will be needed as well, for example //! from the crate `twox-hash`. //! - Macros [`indexmap!`] and [`indexset!`] are unavailable without `std`. -//! -//! [def]: map/struct.IndexMap.html#impl-Default #![cfg_attr(docsrs, feature(doc_cfg))] @@ -119,7 +112,6 @@ mod arbitrary; mod macros; mod mutable_keys; #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod serde; mod util; @@ -129,7 +121,6 @@ pub mod set; // Placed after `map` and `set` so new `rayon` methods on the types // are documented after the "normal" methods. #[cfg(feature = "rayon")] -#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))] mod rayon; #[cfg(feature = "rustc-rayon")] @@ -221,7 +212,7 @@ trait Entries { F: FnOnce(&mut [Self::Entry]); } -/// The error type for `try_reserve` methods. +/// The error type for [`try_reserve`][IndexMap::try_reserve] methods. #[derive(Clone, PartialEq, Eq, Debug)] pub struct TryReserveError { kind: TryReserveErrorKind, diff --git a/vendor/indexmap/src/macros.rs b/vendor/indexmap/src/macros.rs index 5317f1c94..b347de22d 100644 --- a/vendor/indexmap/src/macros.rs +++ b/vendor/indexmap/src/macros.rs @@ -1,7 +1,7 @@ #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[macro_export] -/// Create an `IndexMap` from a list of key-value pairs +/// Create an [`IndexMap`][crate::IndexMap] from a list of key-value pairs /// /// ## Example /// @@ -38,7 +38,7 @@ macro_rules! indexmap { #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[macro_export] -/// Create an `IndexSet` from a list of values +/// Create an [`IndexSet`][crate::IndexSet] from a list of values /// /// ## Example /// diff --git a/vendor/indexmap/src/map.rs b/vendor/indexmap/src/map.rs index 4ee24d5f7..428fac407 100644 --- a/vendor/indexmap/src/map.rs +++ b/vendor/indexmap/src/map.rs @@ -1,4 +1,4 @@ -//! `IndexMap` is a hash table where the iteration order of the key-value +//! [`IndexMap`] is a hash table where the iteration order of the key-value //! pairs is independent of the hash values of the keys. mod core; @@ -12,9 +12,10 @@ pub mod serde_seq; #[cfg(test)] mod tests; -pub use self::core::{Entry, OccupiedEntry, VacantEntry}; +pub use self::core::raw_entry_v1::{self, RawEntryApiV1}; +pub use self::core::{Entry, IndexedEntry, OccupiedEntry, VacantEntry}; pub use self::iter::{ - Drain, IntoIter, IntoKeys, IntoValues, Iter, IterMut, Keys, Values, ValuesMut, + Drain, IntoIter, IntoKeys, IntoValues, Iter, IterMut, Keys, Splice, Values, ValuesMut, }; pub use self::slice::Slice; pub use crate::mutable_keys::MutableKeys; @@ -39,8 +40,9 @@ use crate::{Bucket, Entries, Equivalent, HashValue, TryReserveError}; /// A hash table where the iteration order of the key-value pairs is independent /// of the hash values of the keys. /// -/// The interface is closely compatible with the standard `HashMap`, but also -/// has additional features. +/// The interface is closely compatible with the standard +/// [`HashMap`][std::collections::HashMap], +/// but also has additional features. /// /// # Order /// @@ -51,7 +53,8 @@ use crate::{Bucket, Entries, Equivalent, HashValue, TryReserveError}; /// All iterators traverse the map in *the order*. /// /// The insertion order is preserved, with **notable exceptions** like the -/// `.remove()` or `.swap_remove()` methods. Methods such as `.sort_by()` of +/// [`.remove()`][Self::remove] or [`.swap_remove()`][Self::swap_remove] methods. +/// Methods such as [`.sort_by()`][Self::sort_by] of /// course result in a new order, depending on the sorting order. /// /// # Indices @@ -281,7 +284,7 @@ impl IndexMap { /// Clears the `IndexMap` in the given index range, returning those /// key-value pairs as a drain iterator. /// - /// The range may be any type that implements `RangeBounds`, + /// The range may be any type that implements [`RangeBounds`], /// including all of the `std::ops::Range*` types, or even a tuple pair of /// `Bound` start and end values. To drain the map entirely, use `RangeFull` /// like `map.drain(..)`. @@ -314,13 +317,7 @@ impl IndexMap { hash_builder: self.hash_builder.clone(), } } -} -impl IndexMap -where - K: Hash + Eq, - S: BuildHasher, -{ /// Reserve capacity for `additional` more key-value pairs. /// /// Computes in **O(n)** time. @@ -372,13 +369,13 @@ where pub fn shrink_to(&mut self, min_capacity: usize) { self.core.shrink_to(min_capacity); } +} - fn hash(&self, key: &Q) -> HashValue { - let mut h = self.hash_builder.build_hasher(); - key.hash(&mut h); - HashValue(h.finish() as usize) - } - +impl IndexMap +where + K: Hash + Eq, + S: BuildHasher, +{ /// Insert a key-value pair in the map. /// /// If an equivalent key already exists in the map: the key remains and @@ -390,8 +387,9 @@ where /// /// Computes in **O(1)** time (amortized average). /// - /// See also [`entry`](#method.entry) if you you want to insert *or* modify - /// or if you need to get the index of the corresponding key-value pair. + /// See also [`entry`][Self::entry] if you you want to insert *or* modify, + /// or [`insert_full`][Self::insert_full] if you need to get the index of + /// the corresponding key-value pair. pub fn insert(&mut self, key: K, value: V) -> Option { self.insert_full(key, value).1 } @@ -407,8 +405,7 @@ where /// /// Computes in **O(1)** time (amortized average). /// - /// See also [`entry`](#method.entry) if you you want to insert *or* modify - /// or if you need to get the index of the corresponding key-value pair. + /// See also [`entry`][Self::entry] if you you want to insert *or* modify. pub fn insert_full(&mut self, key: K, value: V) -> (usize, Option) { let hash = self.hash(&key); self.core.insert_full(hash, key, value) @@ -423,6 +420,55 @@ where self.core.entry(hash, key) } + /// Creates a splicing iterator that replaces the specified range in the map + /// with the given `replace_with` key-value iterator and yields the removed + /// items. `replace_with` does not need to be the same length as `range`. + /// + /// The `range` is removed even if the iterator is not consumed until the + /// end. It is unspecified how many elements are removed from the map if the + /// `Splice` value is leaked. + /// + /// The input iterator `replace_with` is only consumed when the `Splice` + /// value is dropped. If a key from the iterator matches an existing entry + /// in the map (outside of `range`), then the value will be updated in that + /// position. Otherwise, the new key-value pair will be inserted in the + /// replaced `range`. + /// + /// ***Panics*** if the starting point is greater than the end point or if + /// the end point is greater than the length of the map. + /// + /// # Examples + /// + /// ``` + /// use indexmap::IndexMap; + /// + /// let mut map = IndexMap::from([(0, '_'), (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')]); + /// let new = [(5, 'E'), (4, 'D'), (3, 'C'), (2, 'B'), (1, 'A')]; + /// let removed: Vec<_> = map.splice(2..4, new).collect(); + /// + /// // 1 and 4 got new values, while 5, 3, and 2 were newly inserted. + /// assert!(map.into_iter().eq([(0, '_'), (1, 'A'), (5, 'E'), (3, 'C'), (2, 'B'), (4, 'D')])); + /// assert_eq!(removed, &[(2, 'b'), (3, 'c')]); + /// ``` + pub fn splice(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, K, V, S> + where + R: RangeBounds, + I: IntoIterator, + { + Splice::new(self, range, replace_with.into_iter()) + } +} + +impl IndexMap +where + S: BuildHasher, +{ + pub(crate) fn hash(&self, key: &Q) -> HashValue { + let mut h = self.hash_builder.build_hasher(); + key.hash(&mut h); + HashValue(h.finish() as usize) + } + /// Return `true` if an equivalent to `key` exists in the map. /// /// Computes in **O(1)** time (average). @@ -520,11 +566,12 @@ where /// Remove the key-value pair equivalent to `key` and return /// its value. /// - /// **NOTE:** This is equivalent to `.swap_remove(key)`, if you need to - /// preserve the order of the keys in the map, use `.shift_remove(key)` - /// instead. - /// - /// Computes in **O(1)** time (average). + /// **NOTE:** This is equivalent to [`.swap_remove(key)`][Self::swap_remove], replacing this + /// entry's position with the last element, and it is deprecated in favor of calling that + /// explicitly. If you need to preserve the relative order of the keys in the map, use + /// [`.shift_remove(key)`][Self::shift_remove] instead. + #[deprecated(note = "`remove` disrupts the map order -- \ + use `swap_remove` or `shift_remove` for explicit behavior.")] pub fn remove(&mut self, key: &Q) -> Option where Q: Hash + Equivalent, @@ -534,11 +581,12 @@ where /// Remove and return the key-value pair equivalent to `key`. /// - /// **NOTE:** This is equivalent to `.swap_remove_entry(key)`, if you need to - /// preserve the order of the keys in the map, use `.shift_remove_entry(key)` - /// instead. - /// - /// Computes in **O(1)** time (average). + /// **NOTE:** This is equivalent to [`.swap_remove_entry(key)`][Self::swap_remove_entry], + /// replacing this entry's position with the last element, and it is deprecated in favor of + /// calling that explicitly. If you need to preserve the relative order of the keys in the map, + /// use [`.shift_remove_entry(key)`][Self::shift_remove_entry] instead. + #[deprecated(note = "`remove_entry` disrupts the map order -- \ + use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] pub fn remove_entry(&mut self, key: &Q) -> Option<(K, V)> where Q: Hash + Equivalent, @@ -549,7 +597,7 @@ where /// Remove the key-value pair equivalent to `key` and return /// its value. /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the + /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the /// last element of the map and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -565,7 +613,7 @@ where /// Remove and return the key-value pair equivalent to `key`. /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the + /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the /// last element of the map and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -585,7 +633,7 @@ where /// Remove the key-value pair equivalent to `key` and return it and /// the index it had. /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the + /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the /// last element of the map and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -606,7 +654,7 @@ where /// Remove the key-value pair equivalent to `key` and return /// its value. /// - /// Like `Vec::remove`, the pair is removed by shifting all of the + /// Like [`Vec::remove`], the pair is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -622,7 +670,7 @@ where /// Remove and return the key-value pair equivalent to `key`. /// - /// Like `Vec::remove`, the pair is removed by shifting all of the + /// Like [`Vec::remove`], the pair is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -642,7 +690,7 @@ where /// Remove the key-value pair equivalent to `key` and return it and /// the index it had. /// - /// Like `Vec::remove`, the pair is removed by shifting all of the + /// Like [`Vec::remove`], the pair is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -659,7 +707,9 @@ where let hash = self.hash(key); self.core.shift_remove_full(hash, key) } +} +impl IndexMap { /// Remove the last key-value pair /// /// This preserves the order of the remaining elements. @@ -857,9 +907,7 @@ where pub fn reverse(&mut self) { self.core.reverse() } -} -impl IndexMap { /// Returns a slice of all the key-value pairs in the map. /// /// Computes in **O(1)** time. @@ -899,6 +947,18 @@ impl IndexMap { self.as_entries_mut().get_mut(index).map(Bucket::ref_mut) } + /// Get an entry in the map by index for in-place manipulation. + /// + /// Valid indices are *0 <= index < self.len()* + /// + /// Computes in **O(1)** time. + pub fn get_index_entry(&mut self, index: usize) -> Option> { + if index >= self.len() { + return None; + } + Some(IndexedEntry::new(&mut self.core, index)) + } + /// Returns a slice of key-value pairs in the given range of indices. /// /// Valid indices are *0 <= index < self.len()* @@ -953,7 +1013,7 @@ impl IndexMap { /// /// Valid indices are *0 <= index < self.len()* /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the + /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the /// last element of the map and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -966,7 +1026,7 @@ impl IndexMap { /// /// Valid indices are *0 <= index < self.len()* /// - /// Like `Vec::remove`, the pair is removed by shifting all of the + /// Like [`Vec::remove`], the pair is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -996,7 +1056,7 @@ impl IndexMap { } } -/// Access `IndexMap` values corresponding to a key. +/// Access [`IndexMap`] values corresponding to a key. /// /// # Examples /// @@ -1021,7 +1081,6 @@ impl IndexMap { impl Index<&Q> for IndexMap where Q: Hash + Equivalent, - K: Hash + Eq, S: BuildHasher, { type Output = V; @@ -1034,7 +1093,7 @@ where } } -/// Access `IndexMap` values corresponding to a key. +/// Access [`IndexMap`] values corresponding to a key. /// /// Mutable indexing allows changing / updating values of key-value /// pairs that are already present. @@ -1066,7 +1125,6 @@ where impl IndexMut<&Q> for IndexMap where Q: Hash + Equivalent, - K: Hash + Eq, S: BuildHasher, { /// Returns a mutable reference to the value corresponding to the supplied `key`. @@ -1077,7 +1135,11 @@ where } } -/// Access `IndexMap` values at indexed positions. +/// Access [`IndexMap`] values at indexed positions. +/// +/// See [`Index for Keys`][keys] to access a map's keys instead. +/// +/// [keys]: Keys#impl-Index-for-Keys<'a,+K,+V> /// /// # Examples /// @@ -1118,12 +1180,12 @@ impl Index for IndexMap { } } -/// Access `IndexMap` values at indexed positions. +/// Access [`IndexMap`] values at indexed positions. /// /// Mutable indexing allows changing / updating indexed values /// that are already present. /// -/// You can **not** insert new values with index syntax, use `.insert()`. +/// You can **not** insert new values with index syntax -- use [`.insert()`][IndexMap::insert]. /// /// # Examples /// @@ -1167,7 +1229,7 @@ where /// iterable. /// /// `from_iter` uses the same logic as `extend`. See - /// [`extend`](#method.extend) for more details. + /// [`extend`][IndexMap::extend] for more details. fn from_iter>(iterable: I) -> Self { let iter = iterable.into_iter(); let (low, _) = iter.size_hint(); @@ -1204,7 +1266,7 @@ where { /// Extend the map with all key-value pairs in the iterable. /// - /// This is equivalent to calling [`insert`](#method.insert) for each of + /// This is equivalent to calling [`insert`][IndexMap::insert] for each of /// them in order, which means that for keys that already existed /// in the map, their value is updated but it keeps the existing order. /// @@ -1248,7 +1310,7 @@ impl Default for IndexMap where S: Default, { - /// Return an empty `IndexMap` + /// Return an empty [`IndexMap`] fn default() -> Self { Self::with_capacity_and_hasher(0, S::default()) } diff --git a/vendor/indexmap/src/map/core.rs b/vendor/indexmap/src/map/core.rs index 4a78035c9..2dca04a5a 100644 --- a/vendor/indexmap/src/map/core.rs +++ b/vendor/indexmap/src/map/core.rs @@ -7,11 +7,14 @@ //! //! However, we should probably not let this show in the public API or docs. +mod entry; mod raw; +pub mod raw_entry_v1; + use hashbrown::raw::RawTable; -use crate::vec::{Drain, Vec}; +use crate::vec::{self, Vec}; use crate::TryReserveError; use core::fmt; use core::mem; @@ -20,6 +23,8 @@ use core::ops::RangeBounds; use crate::util::simplify_range; use crate::{Bucket, Entries, Equivalent, HashValue}; +pub use entry::{Entry, IndexedEntry, OccupiedEntry, VacantEntry}; + /// Core of the map that does not depend on S pub(crate) struct IndexMapCore { /// indices mapping from the entry hash to its index. @@ -160,7 +165,7 @@ impl IndexMapCore { } } - pub(crate) fn drain(&mut self, range: R) -> Drain<'_, Bucket> + pub(crate) fn drain(&mut self, range: R) -> vec::Drain<'_, Bucket> where R: RangeBounds, { @@ -192,6 +197,28 @@ impl IndexMapCore { Self { indices, entries } } + pub(crate) fn split_splice(&mut self, range: R) -> (Self, vec::IntoIter>) + where + R: RangeBounds, + { + let range = simplify_range(range, self.len()); + self.erase_indices(range.start, self.entries.len()); + let entries = self.entries.split_off(range.end); + let drained = self.entries.split_off(range.start); + + let mut indices = RawTable::with_capacity(entries.len()); + raw::insert_bulk_no_grow(&mut indices, &entries); + (Self { indices, entries }, drained.into_iter()) + } + + /// Append from another map without checking whether items already exist. + pub(crate) fn append_unchecked(&mut self, other: &mut Self) { + self.reserve(other.len()); + raw::insert_bulk_no_grow(&mut self.indices, &other.entries); + self.entries.append(&mut other.entries); + other.indices.clear(); + } + /// Reserve capacity for `additional` more key-value pairs. pub(crate) fn reserve(&mut self, additional: usize) { self.indices.reserve(additional, get_hash(&self.entries)); @@ -307,6 +334,33 @@ impl IndexMapCore { } } + /// Same as `insert_full`, except it also replaces the key + pub(crate) fn replace_full( + &mut self, + hash: HashValue, + key: K, + value: V, + ) -> (usize, Option<(K, V)>) + where + K: Eq, + { + match self.find_or_insert(hash, &key) { + Ok(i) => { + let entry = &mut self.entries[i]; + let kv = ( + mem::replace(&mut entry.key, key), + mem::replace(&mut entry.value, value), + ); + (i, Some(kv)) + } + Err(i) => { + debug_assert_eq!(i, self.entries.len()); + self.push_entry(hash, key, value); + (i, None) + } + } + } + /// Remove an entry by shifting all entries that follow it pub(crate) fn shift_remove_full(&mut self, hash: HashValue, key: &Q) -> Option<(usize, K, V)> where @@ -545,218 +599,10 @@ impl IndexMapCore { } } -/// Entry for an existing key-value pair or a vacant location to -/// insert one. -pub enum Entry<'a, K, V> { - /// Existing slot with equivalent key. - Occupied(OccupiedEntry<'a, K, V>), - /// Vacant slot (no equivalent key in the map). - Vacant(VacantEntry<'a, K, V>), -} - -impl<'a, K, V> Entry<'a, K, V> { - /// Inserts the given default value in the entry if it is vacant and returns a mutable - /// reference to it. Otherwise a mutable reference to an already existent value is returned. - /// - /// Computes in **O(1)** time (amortized average). - pub fn or_insert(self, default: V) -> &'a mut V { - match self { - Entry::Occupied(entry) => entry.into_mut(), - Entry::Vacant(entry) => entry.insert(default), - } - } - - /// Inserts the result of the `call` function in the entry if it is vacant and returns a mutable - /// reference to it. Otherwise a mutable reference to an already existent value is returned. - /// - /// Computes in **O(1)** time (amortized average). - pub fn or_insert_with(self, call: F) -> &'a mut V - where - F: FnOnce() -> V, - { - match self { - Entry::Occupied(entry) => entry.into_mut(), - Entry::Vacant(entry) => entry.insert(call()), - } - } - - /// Inserts the result of the `call` function with a reference to the entry's key if it is - /// vacant, and returns a mutable reference to the new value. Otherwise a mutable reference to - /// an already existent value is returned. - /// - /// Computes in **O(1)** time (amortized average). - pub fn or_insert_with_key(self, call: F) -> &'a mut V - where - F: FnOnce(&K) -> V, - { - match self { - Entry::Occupied(entry) => entry.into_mut(), - Entry::Vacant(entry) => { - let value = call(&entry.key); - entry.insert(value) - } - } - } - - /// Gets a reference to the entry's key, either within the map if occupied, - /// or else the new key that was used to find the entry. - pub fn key(&self) -> &K { - match *self { - Entry::Occupied(ref entry) => entry.key(), - Entry::Vacant(ref entry) => entry.key(), - } - } - - /// Return the index where the key-value pair exists or will be inserted. - pub fn index(&self) -> usize { - match *self { - Entry::Occupied(ref entry) => entry.index(), - Entry::Vacant(ref entry) => entry.index(), - } - } - - /// Modifies the entry if it is occupied. - pub fn and_modify(self, f: F) -> Self - where - F: FnOnce(&mut V), - { - match self { - Entry::Occupied(mut o) => { - f(o.get_mut()); - Entry::Occupied(o) - } - x => x, - } - } - - /// Inserts a default-constructed value in the entry if it is vacant and returns a mutable - /// reference to it. Otherwise a mutable reference to an already existent value is returned. - /// - /// Computes in **O(1)** time (amortized average). - pub fn or_default(self) -> &'a mut V - where - V: Default, - { - match self { - Entry::Occupied(entry) => entry.into_mut(), - Entry::Vacant(entry) => entry.insert(V::default()), - } - } -} - -impl fmt::Debug for Entry<'_, K, V> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self { - Entry::Vacant(ref v) => f.debug_tuple(stringify!(Entry)).field(v).finish(), - Entry::Occupied(ref o) => f.debug_tuple(stringify!(Entry)).field(o).finish(), - } - } -} - -pub use self::raw::OccupiedEntry; - -// Extra methods that don't threaten the unsafe encapsulation. -impl OccupiedEntry<'_, K, V> { - /// Sets the value of the entry to `value`, and returns the entry's old value. - pub fn insert(&mut self, value: V) -> V { - mem::replace(self.get_mut(), value) - } - - /// Remove the key, value pair stored in the map for this entry, and return the value. - /// - /// **NOTE:** This is equivalent to `.swap_remove()`. - pub fn remove(self) -> V { - self.swap_remove() - } - - /// Remove the key, value pair stored in the map for this entry, and return the value. - /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the - /// last element of the map and popping it off. **This perturbs - /// the position of what used to be the last element!** - /// - /// Computes in **O(1)** time (average). - pub fn swap_remove(self) -> V { - self.swap_remove_entry().1 - } - - /// Remove the key, value pair stored in the map for this entry, and return the value. - /// - /// Like `Vec::remove`, the pair is removed by shifting all of the - /// elements that follow it, preserving their relative order. - /// **This perturbs the index of all of those elements!** - /// - /// Computes in **O(n)** time (average). - pub fn shift_remove(self) -> V { - self.shift_remove_entry().1 - } - - /// Remove and return the key, value pair stored in the map for this entry - /// - /// **NOTE:** This is equivalent to `.swap_remove_entry()`. - pub fn remove_entry(self) -> (K, V) { - self.swap_remove_entry() - } -} - -impl fmt::Debug for OccupiedEntry<'_, K, V> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct(stringify!(OccupiedEntry)) - .field("key", self.key()) - .field("value", self.get()) - .finish() - } -} - -/// A view into a vacant entry in a `IndexMap`. -/// It is part of the [`Entry`] enum. -/// -/// [`Entry`]: enum.Entry.html -pub struct VacantEntry<'a, K, V> { - map: &'a mut IndexMapCore, - hash: HashValue, - key: K, -} - -impl<'a, K, V> VacantEntry<'a, K, V> { - /// Gets a reference to the key that was used to find the entry. - pub fn key(&self) -> &K { - &self.key - } - - /// Takes ownership of the key, leaving the entry vacant. - pub fn into_key(self) -> K { - self.key - } - - /// Return the index where the key-value pair will be inserted. - pub fn index(&self) -> usize { - self.map.indices.len() - } - - /// Inserts the entry's key and the given value into the map, and returns a mutable reference - /// to the value. - pub fn insert(self, value: V) -> &'a mut V { - let i = self.index(); - let Self { map, hash, key } = self; - map.indices.insert(hash.get(), i, get_hash(&map.entries)); - debug_assert_eq!(i, map.entries.len()); - map.push_entry(hash, key, value); - &mut map.entries[i].value - } -} - -impl fmt::Debug for VacantEntry<'_, K, V> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple(stringify!(VacantEntry)) - .field(self.key()) - .finish() - } -} - #[test] fn assert_send_sync() { fn assert_send_sync() {} assert_send_sync::>(); assert_send_sync::>(); + assert_send_sync::>(); } diff --git a/vendor/indexmap/src/map/core/entry.rs b/vendor/indexmap/src/map/core/entry.rs new file mode 100644 index 000000000..ada26ef73 --- /dev/null +++ b/vendor/indexmap/src/map/core/entry.rs @@ -0,0 +1,396 @@ +use super::raw::RawTableEntry; +use super::{get_hash, IndexMapCore}; +use crate::HashValue; +use core::{fmt, mem}; + +impl IndexMapCore { + pub(crate) fn entry(&mut self, hash: HashValue, key: K) -> Entry<'_, K, V> + where + K: Eq, + { + match self.raw_entry(hash, |k| *k == key) { + Ok(raw) => Entry::Occupied(OccupiedEntry { raw }), + Err(map) => Entry::Vacant(VacantEntry { map, hash, key }), + } + } +} + +/// Entry for an existing key-value pair in an [`IndexMap`][crate::IndexMap] +/// or a vacant location to insert one. +pub enum Entry<'a, K, V> { + /// Existing slot with equivalent key. + Occupied(OccupiedEntry<'a, K, V>), + /// Vacant slot (no equivalent key in the map). + Vacant(VacantEntry<'a, K, V>), +} + +impl<'a, K, V> Entry<'a, K, V> { + /// Return the index where the key-value pair exists or will be inserted. + pub fn index(&self) -> usize { + match *self { + Entry::Occupied(ref entry) => entry.index(), + Entry::Vacant(ref entry) => entry.index(), + } + } + + /// Inserts the given default value in the entry if it is vacant and returns a mutable + /// reference to it. Otherwise a mutable reference to an already existent value is returned. + /// + /// Computes in **O(1)** time (amortized average). + pub fn or_insert(self, default: V) -> &'a mut V { + match self { + Entry::Occupied(entry) => entry.into_mut(), + Entry::Vacant(entry) => entry.insert(default), + } + } + + /// Inserts the result of the `call` function in the entry if it is vacant and returns a mutable + /// reference to it. Otherwise a mutable reference to an already existent value is returned. + /// + /// Computes in **O(1)** time (amortized average). + pub fn or_insert_with(self, call: F) -> &'a mut V + where + F: FnOnce() -> V, + { + match self { + Entry::Occupied(entry) => entry.into_mut(), + Entry::Vacant(entry) => entry.insert(call()), + } + } + + /// Inserts the result of the `call` function with a reference to the entry's key if it is + /// vacant, and returns a mutable reference to the new value. Otherwise a mutable reference to + /// an already existent value is returned. + /// + /// Computes in **O(1)** time (amortized average). + pub fn or_insert_with_key(self, call: F) -> &'a mut V + where + F: FnOnce(&K) -> V, + { + match self { + Entry::Occupied(entry) => entry.into_mut(), + Entry::Vacant(entry) => { + let value = call(&entry.key); + entry.insert(value) + } + } + } + + /// Gets a reference to the entry's key, either within the map if occupied, + /// or else the new key that was used to find the entry. + pub fn key(&self) -> &K { + match *self { + Entry::Occupied(ref entry) => entry.key(), + Entry::Vacant(ref entry) => entry.key(), + } + } + + /// Modifies the entry if it is occupied. + pub fn and_modify(mut self, f: F) -> Self + where + F: FnOnce(&mut V), + { + if let Entry::Occupied(entry) = &mut self { + f(entry.get_mut()); + } + self + } + + /// Inserts a default-constructed value in the entry if it is vacant and returns a mutable + /// reference to it. Otherwise a mutable reference to an already existent value is returned. + /// + /// Computes in **O(1)** time (amortized average). + pub fn or_default(self) -> &'a mut V + where + V: Default, + { + match self { + Entry::Occupied(entry) => entry.into_mut(), + Entry::Vacant(entry) => entry.insert(V::default()), + } + } +} + +impl fmt::Debug for Entry<'_, K, V> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut tuple = f.debug_tuple("Entry"); + match self { + Entry::Vacant(v) => tuple.field(v), + Entry::Occupied(o) => tuple.field(o), + }; + tuple.finish() + } +} + +/// A view into an occupied entry in an [`IndexMap`][crate::IndexMap]. +/// It is part of the [`Entry`] enum. +pub struct OccupiedEntry<'a, K, V> { + raw: RawTableEntry<'a, K, V>, +} + +impl<'a, K, V> OccupiedEntry<'a, K, V> { + /// Return the index of the key-value pair + #[inline] + pub fn index(&self) -> usize { + self.raw.index() + } + + /// Gets a reference to the entry's key in the map. + /// + /// Note that this is not the key that was used to find the entry. There may be an observable + /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like + /// extra fields or the memory address of an allocation. + pub fn key(&self) -> &K { + &self.raw.bucket().key + } + + /// Gets a reference to the entry's value in the map. + pub fn get(&self) -> &V { + &self.raw.bucket().value + } + + /// Gets a mutable reference to the entry's value in the map. + /// + /// If you need a reference which may outlive the destruction of the + /// [`Entry`] value, see [`into_mut`][Self::into_mut]. + pub fn get_mut(&mut self) -> &mut V { + &mut self.raw.bucket_mut().value + } + + /// Converts into a mutable reference to the entry's value in the map, + /// with a lifetime bound to the map itself. + pub fn into_mut(self) -> &'a mut V { + &mut self.raw.into_bucket().value + } + + /// Sets the value of the entry to `value`, and returns the entry's old value. + pub fn insert(&mut self, value: V) -> V { + mem::replace(self.get_mut(), value) + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// **NOTE:** This is equivalent to [`.swap_remove()`][Self::swap_remove], replacing this + /// entry's position with the last element, and it is deprecated in favor of calling that + /// explicitly. If you need to preserve the relative order of the keys in the map, use + /// [`.shift_remove()`][Self::shift_remove] instead. + #[deprecated(note = "`remove` disrupts the map order -- \ + use `swap_remove` or `shift_remove` for explicit behavior.")] + pub fn remove(self) -> V { + self.swap_remove() + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove(self) -> V { + self.swap_remove_entry().1 + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove(self) -> V { + self.shift_remove_entry().1 + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// **NOTE:** This is equivalent to [`.swap_remove_entry()`][Self::swap_remove_entry], + /// replacing this entry's position with the last element, and it is deprecated in favor of + /// calling that explicitly. If you need to preserve the relative order of the keys in the map, + /// use [`.shift_remove_entry()`][Self::shift_remove_entry] instead. + #[deprecated(note = "`remove_entry` disrupts the map order -- \ + use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] + pub fn remove_entry(self) -> (K, V) { + self.swap_remove_entry() + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove_entry(self) -> (K, V) { + let (map, index) = self.raw.remove_index(); + map.swap_remove_finish(index) + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove_entry(self) -> (K, V) { + let (map, index) = self.raw.remove_index(); + map.shift_remove_finish(index) + } +} + +impl fmt::Debug for OccupiedEntry<'_, K, V> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("OccupiedEntry") + .field("key", self.key()) + .field("value", self.get()) + .finish() + } +} + +/// A view into a vacant entry in an [`IndexMap`][crate::IndexMap]. +/// It is part of the [`Entry`] enum. +pub struct VacantEntry<'a, K, V> { + map: &'a mut IndexMapCore, + hash: HashValue, + key: K, +} + +impl<'a, K, V> VacantEntry<'a, K, V> { + /// Return the index where a key-value pair may be inserted. + pub fn index(&self) -> usize { + self.map.indices.len() + } + + /// Gets a reference to the key that was used to find the entry. + pub fn key(&self) -> &K { + &self.key + } + + /// Takes ownership of the key, leaving the entry vacant. + pub fn into_key(self) -> K { + self.key + } + + /// Inserts the entry's key and the given value into the map, and returns a mutable reference + /// to the value. + pub fn insert(self, value: V) -> &'a mut V { + let i = self.index(); + let Self { map, hash, key } = self; + map.indices.insert(hash.get(), i, get_hash(&map.entries)); + debug_assert_eq!(i, map.entries.len()); + map.push_entry(hash, key, value); + &mut map.entries[i].value + } +} + +impl fmt::Debug for VacantEntry<'_, K, V> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("VacantEntry").field(self.key()).finish() + } +} + +/// A view into an occupied entry in an [`IndexMap`][crate::IndexMap] obtained by index. +/// +/// This `struct` is created from the [`get_index_entry`][crate::IndexMap::get_index_entry] method. +pub struct IndexedEntry<'a, K, V> { + map: &'a mut IndexMapCore, + // We have a mutable reference to the map, which keeps the index + // valid and pointing to the correct entry. + index: usize, +} + +impl<'a, K, V> IndexedEntry<'a, K, V> { + pub(crate) fn new(map: &'a mut IndexMapCore, index: usize) -> Self { + Self { map, index } + } + + /// Return the index of the key-value pair + #[inline] + pub fn index(&self) -> usize { + self.index + } + + /// Gets a reference to the entry's key in the map. + pub fn key(&self) -> &K { + &self.map.entries[self.index].key + } + + /// Gets a reference to the entry's value in the map. + pub fn get(&self) -> &V { + &self.map.entries[self.index].value + } + + /// Gets a mutable reference to the entry's value in the map. + /// + /// If you need a reference which may outlive the destruction of the + /// `IndexedEntry` value, see [`into_mut`][Self::into_mut]. + pub fn get_mut(&mut self) -> &mut V { + &mut self.map.entries[self.index].value + } + + /// Sets the value of the entry to `value`, and returns the entry's old value. + pub fn insert(&mut self, value: V) -> V { + mem::replace(self.get_mut(), value) + } + + /// Converts into a mutable reference to the entry's value in the map, + /// with a lifetime bound to the map itself. + pub fn into_mut(self) -> &'a mut V { + &mut self.map.entries[self.index].value + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove_entry(self) -> (K, V) { + self.map.swap_remove_index(self.index).unwrap() + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove_entry(self) -> (K, V) { + self.map.shift_remove_index(self.index).unwrap() + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove(self) -> V { + self.swap_remove_entry().1 + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove(self) -> V { + self.shift_remove_entry().1 + } +} + +impl fmt::Debug for IndexedEntry<'_, K, V> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("IndexedEntry") + .field("index", &self.index) + .field("key", self.key()) + .field("value", self.get()) + .finish() + } +} diff --git a/vendor/indexmap/src/map/core/raw.rs b/vendor/indexmap/src/map/core/raw.rs index be71c9cff..233e41e7b 100644 --- a/vendor/indexmap/src/map/core/raw.rs +++ b/vendor/indexmap/src/map/core/raw.rs @@ -2,9 +2,8 @@ //! This module encapsulates the `unsafe` access to `hashbrown::raw::RawTable`, //! mostly in dealing with its bucket "pointers". -use super::{equivalent, get_hash, Bucket, Entry, HashValue, IndexMapCore, VacantEntry}; +use super::{equivalent, get_hash, Bucket, HashValue, IndexMapCore}; use core::fmt; -use core::mem::replace; use hashbrown::raw::RawTable; type RawBucket = hashbrown::raw::Bucket; @@ -74,24 +73,21 @@ impl IndexMapCore { } } - pub(crate) fn entry(&mut self, hash: HashValue, key: K) -> Entry<'_, K, V> - where - K: Eq, - { - let eq = equivalent(&key, &self.entries); + pub(super) fn raw_entry( + &mut self, + hash: HashValue, + mut is_match: impl FnMut(&K) -> bool, + ) -> Result, &mut Self> { + let entries = &*self.entries; + let eq = move |&i: &usize| is_match(&entries[i].key); match self.indices.find(hash.get(), eq) { // SAFETY: The entry is created with a live raw bucket, at the same time // we have a &mut reference to the map, so it can not be modified further. - Some(raw_bucket) => Entry::Occupied(OccupiedEntry { + Some(raw_bucket) => Ok(RawTableEntry { map: self, raw_bucket, - key, - }), - None => Entry::Vacant(VacantEntry { - map: self, - hash, - key, }), + None => Err(self), } } @@ -102,93 +98,48 @@ impl IndexMapCore { } } -/// A view into an occupied entry in a `IndexMap`. -/// It is part of the [`Entry`] enum. -/// -/// [`Entry`]: enum.Entry.html +/// A view into an occupied raw entry in an `IndexMap`. // SAFETY: The lifetime of the map reference also constrains the raw bucket, // which is essentially a raw pointer into the map indices. -pub struct OccupiedEntry<'a, K, V> { +pub(super) struct RawTableEntry<'a, K, V> { map: &'a mut IndexMapCore, raw_bucket: RawBucket, - key: K, } // `hashbrown::raw::Bucket` is only `Send`, not `Sync`. // SAFETY: `&self` only accesses the bucket to read it. -unsafe impl Sync for OccupiedEntry<'_, K, V> {} - -// The parent module also adds methods that don't threaten the unsafe encapsulation. -impl<'a, K, V> OccupiedEntry<'a, K, V> { - /// Gets a reference to the entry's key in the map. - /// - /// Note that this is not the key that was used to find the entry. There may be an observable - /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like - /// extra fields or the memory address of an allocation. - pub fn key(&self) -> &K { - &self.map.entries[self.index()].key - } - - /// Gets a reference to the entry's value in the map. - pub fn get(&self) -> &V { - &self.map.entries[self.index()].value - } - - /// Gets a mutable reference to the entry's value in the map. - /// - /// If you need a reference which may outlive the destruction of the - /// `Entry` value, see `into_mut`. - pub fn get_mut(&mut self) -> &mut V { - let index = self.index(); - &mut self.map.entries[index].value - } - - /// Put the new key in the occupied entry's key slot - pub(crate) fn replace_key(self) -> K { - let index = self.index(); - let old_key = &mut self.map.entries[index].key; - replace(old_key, self.key) - } +unsafe impl Sync for RawTableEntry<'_, K, V> {} +impl<'a, K, V> RawTableEntry<'a, K, V> { /// Return the index of the key-value pair #[inline] - pub fn index(&self) -> usize { - // SAFETY: we have &mut map keep keeping the bucket stable + pub(super) fn index(&self) -> usize { + // SAFETY: we have `&mut map` keeping the bucket stable unsafe { *self.raw_bucket.as_ref() } } - /// Converts into a mutable reference to the entry's value in the map, - /// with a lifetime bound to the map itself. - pub fn into_mut(self) -> &'a mut V { + #[inline] + pub(super) fn bucket(&self) -> &Bucket { + &self.map.entries[self.index()] + } + + #[inline] + pub(super) fn bucket_mut(&mut self) -> &mut Bucket { let index = self.index(); - &mut self.map.entries[index].value + &mut self.map.entries[index] } - /// Remove and return the key, value pair stored in the map for this entry - /// - /// Like `Vec::swap_remove`, the pair is removed by swapping it with the - /// last element of the map and popping it off. **This perturbs - /// the position of what used to be the last element!** - /// - /// Computes in **O(1)** time (average). - pub fn swap_remove_entry(self) -> (K, V) { + #[inline] + pub(super) fn into_bucket(self) -> &'a mut Bucket { + let index = self.index(); + &mut self.map.entries[index] + } + + /// Remove the index from indices, leaving the actual entries to the caller. + pub(super) fn remove_index(self) -> (&'a mut IndexMapCore, usize) { // SAFETY: This is safe because it can only happen once (self is consumed) // and map.indices have not been modified since entry construction let (index, _slot) = unsafe { self.map.indices.remove(self.raw_bucket) }; - self.map.swap_remove_finish(index) - } - - /// Remove and return the key, value pair stored in the map for this entry - /// - /// Like `Vec::remove`, the pair is removed by shifting all of the - /// elements that follow it, preserving their relative order. - /// **This perturbs the index of all of those elements!** - /// - /// Computes in **O(n)** time (average). - pub fn shift_remove_entry(self) -> (K, V) { - // SAFETY: This is safe because it can only happen once (self is consumed) - // and map.indices have not been modified since entry construction - let (index, _slot) = unsafe { self.map.indices.remove(self.raw_bucket) }; - self.map.shift_remove_finish(index) + (self.map, index) } } diff --git a/vendor/indexmap/src/map/core/raw_entry_v1.rs b/vendor/indexmap/src/map/core/raw_entry_v1.rs new file mode 100644 index 000000000..68cdc7413 --- /dev/null +++ b/vendor/indexmap/src/map/core/raw_entry_v1.rs @@ -0,0 +1,592 @@ +//! Opt-in access to the experimental raw entry API. +//! +//! This module is designed to mimic the raw entry API of [`HashMap`][std::collections::hash_map], +//! matching its unstable state as of Rust 1.75. See the tracking issue +//! [rust#56167](https://github.com/rust-lang/rust/issues/56167) for more details. +//! +//! The trait [`RawEntryApiV1`] and the `_v1` suffix on its methods are meant to insulate this for +//! the future, in case later breaking changes are needed. If the standard library stabilizes its +//! `hash_raw_entry` feature (or some replacement), matching *inherent* methods will be added to +//! `IndexMap` without such an opt-in trait. + +use super::raw::RawTableEntry; +use super::{get_hash, IndexMapCore}; +use crate::{Equivalent, HashValue, IndexMap}; +use core::fmt; +use core::hash::{BuildHasher, Hash, Hasher}; +use core::marker::PhantomData; +use core::mem; + +/// Opt-in access to the experimental raw entry API. +/// +/// See the [`raw_entry_v1`][self] module documentation for more information. +pub trait RawEntryApiV1: private::Sealed { + /// Creates a raw immutable entry builder for the [`IndexMap`]. + /// + /// Raw entries provide the lowest level of control for searching and + /// manipulating a map. They must be manually initialized with a hash and + /// then manually searched. + /// + /// This is useful for + /// * Hash memoization + /// * Using a search key that doesn't work with the [`Equivalent`] trait + /// * Using custom comparison logic without newtype wrappers + /// + /// Unless you are in such a situation, higher-level and more foolproof APIs like + /// [`get`][IndexMap::get] should be preferred. + /// + /// Immutable raw entries have very limited use; you might instead want + /// [`raw_entry_mut_v1`][Self::raw_entry_mut_v1]. + /// + /// # Examples + /// + /// ``` + /// use core::hash::{BuildHasher, Hash}; + /// use indexmap::map::{IndexMap, RawEntryApiV1}; + /// + /// let mut map = IndexMap::new(); + /// map.extend([("a", 100), ("b", 200), ("c", 300)]); + /// + /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { + /// use core::hash::Hasher; + /// let mut state = hash_builder.build_hasher(); + /// key.hash(&mut state); + /// state.finish() + /// } + /// + /// for k in ["a", "b", "c", "d", "e", "f"] { + /// let hash = compute_hash(map.hasher(), k); + /// let i = map.get_index_of(k); + /// let v = map.get(k); + /// let kv = map.get_key_value(k); + /// let ikv = map.get_full(k); + /// + /// println!("Key: {} and value: {:?}", k, v); + /// + /// assert_eq!(map.raw_entry_v1().from_key(k), kv); + /// assert_eq!(map.raw_entry_v1().from_hash(hash, |q| *q == k), kv); + /// assert_eq!(map.raw_entry_v1().from_key_hashed_nocheck(hash, k), kv); + /// assert_eq!(map.raw_entry_v1().from_hash_full(hash, |q| *q == k), ikv); + /// assert_eq!(map.raw_entry_v1().index_from_hash(hash, |q| *q == k), i); + /// } + /// ``` + fn raw_entry_v1(&self) -> RawEntryBuilder<'_, K, V, S>; + + /// Creates a raw entry builder for the [`IndexMap`]. + /// + /// Raw entries provide the lowest level of control for searching and + /// manipulating a map. They must be manually initialized with a hash and + /// then manually searched. After this, insertions into a vacant entry + /// still require an owned key to be provided. + /// + /// Raw entries are useful for such exotic situations as: + /// + /// * Hash memoization + /// * Deferring the creation of an owned key until it is known to be required + /// * Using a search key that doesn't work with the [`Equivalent`] trait + /// * Using custom comparison logic without newtype wrappers + /// + /// Because raw entries provide much more low-level control, it's much easier + /// to put the `IndexMap` into an inconsistent state which, while memory-safe, + /// will cause the map to produce seemingly random results. Higher-level and more + /// foolproof APIs like [`entry`][IndexMap::entry] should be preferred when possible. + /// + /// Raw entries give mutable access to the keys. This must not be used + /// to modify how the key would compare or hash, as the map will not re-evaluate + /// where the key should go, meaning the keys may become "lost" if their + /// location does not reflect their state. For instance, if you change a key + /// so that the map now contains keys which compare equal, search may start + /// acting erratically, with two keys randomly masking each other. Implementations + /// are free to assume this doesn't happen (within the limits of memory-safety). + /// + /// # Examples + /// + /// ``` + /// use core::hash::{BuildHasher, Hash}; + /// use indexmap::map::{IndexMap, RawEntryApiV1}; + /// use indexmap::map::raw_entry_v1::RawEntryMut; + /// + /// let mut map = IndexMap::new(); + /// map.extend([("a", 100), ("b", 200), ("c", 300)]); + /// + /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { + /// use core::hash::Hasher; + /// let mut state = hash_builder.build_hasher(); + /// key.hash(&mut state); + /// state.finish() + /// } + /// + /// // Existing key (insert and update) + /// match map.raw_entry_mut_v1().from_key("a") { + /// RawEntryMut::Vacant(_) => unreachable!(), + /// RawEntryMut::Occupied(mut view) => { + /// assert_eq!(view.index(), 0); + /// assert_eq!(view.get(), &100); + /// let v = view.get_mut(); + /// let new_v = (*v) * 10; + /// *v = new_v; + /// assert_eq!(view.insert(1111), 1000); + /// } + /// } + /// + /// assert_eq!(map["a"], 1111); + /// assert_eq!(map.len(), 3); + /// + /// // Existing key (take) + /// let hash = compute_hash(map.hasher(), "c"); + /// match map.raw_entry_mut_v1().from_key_hashed_nocheck(hash, "c") { + /// RawEntryMut::Vacant(_) => unreachable!(), + /// RawEntryMut::Occupied(view) => { + /// assert_eq!(view.index(), 2); + /// assert_eq!(view.shift_remove_entry(), ("c", 300)); + /// } + /// } + /// assert_eq!(map.raw_entry_v1().from_key("c"), None); + /// assert_eq!(map.len(), 2); + /// + /// // Nonexistent key (insert and update) + /// let key = "d"; + /// let hash = compute_hash(map.hasher(), key); + /// match map.raw_entry_mut_v1().from_hash(hash, |q| *q == key) { + /// RawEntryMut::Occupied(_) => unreachable!(), + /// RawEntryMut::Vacant(view) => { + /// assert_eq!(view.index(), 2); + /// let (k, value) = view.insert("d", 4000); + /// assert_eq!((*k, *value), ("d", 4000)); + /// *value = 40000; + /// } + /// } + /// assert_eq!(map["d"], 40000); + /// assert_eq!(map.len(), 3); + /// + /// match map.raw_entry_mut_v1().from_hash(hash, |q| *q == key) { + /// RawEntryMut::Vacant(_) => unreachable!(), + /// RawEntryMut::Occupied(view) => { + /// assert_eq!(view.index(), 2); + /// assert_eq!(view.swap_remove_entry(), ("d", 40000)); + /// } + /// } + /// assert_eq!(map.get("d"), None); + /// assert_eq!(map.len(), 2); + /// ``` + fn raw_entry_mut_v1(&mut self) -> RawEntryBuilderMut<'_, K, V, S>; +} + +impl RawEntryApiV1 for IndexMap { + fn raw_entry_v1(&self) -> RawEntryBuilder<'_, K, V, S> { + RawEntryBuilder { map: self } + } + + fn raw_entry_mut_v1(&mut self) -> RawEntryBuilderMut<'_, K, V, S> { + RawEntryBuilderMut { map: self } + } +} + +/// A builder for computing where in an [`IndexMap`] a key-value pair would be stored. +/// +/// This `struct` is created by the [`IndexMap::raw_entry_v1`] method, provided by the +/// [`RawEntryApiV1`] trait. See its documentation for more. +pub struct RawEntryBuilder<'a, K, V, S> { + map: &'a IndexMap, +} + +impl fmt::Debug for RawEntryBuilder<'_, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("RawEntryBuilder").finish_non_exhaustive() + } +} + +impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S> { + /// Access an entry by key. + pub fn from_key(self, key: &Q) -> Option<(&'a K, &'a V)> + where + S: BuildHasher, + Q: Hash + Equivalent, + { + self.map.get_key_value(key) + } + + /// Access an entry by a key and its hash. + pub fn from_key_hashed_nocheck(self, hash: u64, key: &Q) -> Option<(&'a K, &'a V)> + where + Q: Equivalent, + { + let hash = HashValue(hash as usize); + let i = self.map.core.get_index_of(hash, key)?; + self.map.get_index(i) + } + + /// Access an entry by hash. + pub fn from_hash(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)> + where + F: FnMut(&K) -> bool, + { + let map = self.map; + let i = self.index_from_hash(hash, is_match)?; + map.get_index(i) + } + + /// Access an entry by hash, including its index. + pub fn from_hash_full(self, hash: u64, is_match: F) -> Option<(usize, &'a K, &'a V)> + where + F: FnMut(&K) -> bool, + { + let map = self.map; + let i = self.index_from_hash(hash, is_match)?; + let (key, value) = map.get_index(i)?; + Some((i, key, value)) + } + + /// Access the index of an entry by hash. + pub fn index_from_hash(self, hash: u64, mut is_match: F) -> Option + where + F: FnMut(&K) -> bool, + { + let hash = HashValue(hash as usize); + let entries = &*self.map.core.entries; + let eq = move |&i: &usize| is_match(&entries[i].key); + self.map.core.indices.get(hash.get(), eq).copied() + } +} + +/// A builder for computing where in an [`IndexMap`] a key-value pair would be stored. +/// +/// This `struct` is created by the [`IndexMap::raw_entry_mut_v1`] method, provided by the +/// [`RawEntryApiV1`] trait. See its documentation for more. +pub struct RawEntryBuilderMut<'a, K, V, S> { + map: &'a mut IndexMap, +} + +impl fmt::Debug for RawEntryBuilderMut<'_, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("RawEntryBuilderMut").finish_non_exhaustive() + } +} + +impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> { + /// Access an entry by key. + pub fn from_key(self, key: &Q) -> RawEntryMut<'a, K, V, S> + where + S: BuildHasher, + Q: Hash + Equivalent, + { + let hash = self.map.hash(key); + self.from_key_hashed_nocheck(hash.get(), key) + } + + /// Access an entry by a key and its hash. + pub fn from_key_hashed_nocheck(self, hash: u64, key: &Q) -> RawEntryMut<'a, K, V, S> + where + Q: Equivalent, + { + self.from_hash(hash, |k| Q::equivalent(key, k)) + } + + /// Access an entry by hash. + pub fn from_hash(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S> + where + F: FnMut(&K) -> bool, + { + let hash = HashValue(hash as usize); + match self.map.core.raw_entry(hash, is_match) { + Ok(raw) => RawEntryMut::Occupied(RawOccupiedEntryMut { + raw, + hash_builder: PhantomData, + }), + Err(map) => RawEntryMut::Vacant(RawVacantEntryMut { + map, + hash_builder: &self.map.hash_builder, + }), + } + } +} + +/// Raw entry for an existing key-value pair or a vacant location to +/// insert one. +pub enum RawEntryMut<'a, K, V, S> { + /// Existing slot with equivalent key. + Occupied(RawOccupiedEntryMut<'a, K, V, S>), + /// Vacant slot (no equivalent key in the map). + Vacant(RawVacantEntryMut<'a, K, V, S>), +} + +impl fmt::Debug for RawEntryMut<'_, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut tuple = f.debug_tuple("RawEntryMut"); + match self { + Self::Vacant(v) => tuple.field(v), + Self::Occupied(o) => tuple.field(o), + }; + tuple.finish() + } +} + +impl<'a, K, V, S> RawEntryMut<'a, K, V, S> { + /// Return the index where the key-value pair exists or may be inserted. + #[inline] + pub fn index(&self) -> usize { + match self { + Self::Occupied(entry) => entry.index(), + Self::Vacant(entry) => entry.index(), + } + } + + /// Inserts the given default key and value in the entry if it is vacant and returns mutable + /// references to them. Otherwise mutable references to an already existent pair are returned. + pub fn or_insert(self, default_key: K, default_value: V) -> (&'a mut K, &'a mut V) + where + K: Hash, + S: BuildHasher, + { + match self { + Self::Occupied(entry) => entry.into_key_value_mut(), + Self::Vacant(entry) => entry.insert(default_key, default_value), + } + } + + /// Inserts the result of the `call` function in the entry if it is vacant and returns mutable + /// references to them. Otherwise mutable references to an already existent pair are returned. + pub fn or_insert_with(self, call: F) -> (&'a mut K, &'a mut V) + where + F: FnOnce() -> (K, V), + K: Hash, + S: BuildHasher, + { + match self { + Self::Occupied(entry) => entry.into_key_value_mut(), + Self::Vacant(entry) => { + let (key, value) = call(); + entry.insert(key, value) + } + } + } + + /// Modifies the entry if it is occupied. + pub fn and_modify(mut self, f: F) -> Self + where + F: FnOnce(&mut K, &mut V), + { + if let Self::Occupied(entry) = &mut self { + let (k, v) = entry.get_key_value_mut(); + f(k, v); + } + self + } +} + +/// A raw view into an occupied entry in an [`IndexMap`]. +/// It is part of the [`RawEntryMut`] enum. +pub struct RawOccupiedEntryMut<'a, K, V, S> { + raw: RawTableEntry<'a, K, V>, + hash_builder: PhantomData<&'a S>, +} + +impl fmt::Debug for RawOccupiedEntryMut<'_, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("RawOccupiedEntryMut") + .field("key", self.key()) + .field("value", self.get()) + .finish_non_exhaustive() + } +} + +impl<'a, K, V, S> RawOccupiedEntryMut<'a, K, V, S> { + /// Return the index of the key-value pair + #[inline] + pub fn index(&self) -> usize { + self.raw.index() + } + + /// Gets a reference to the entry's key in the map. + /// + /// Note that this is not the key that was used to find the entry. There may be an observable + /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like + /// extra fields or the memory address of an allocation. + pub fn key(&self) -> &K { + &self.raw.bucket().key + } + + /// Gets a mutable reference to the entry's key in the map. + /// + /// Note that this is not the key that was used to find the entry. There may be an observable + /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like + /// extra fields or the memory address of an allocation. + pub fn key_mut(&mut self) -> &mut K { + &mut self.raw.bucket_mut().key + } + + /// Converts into a mutable reference to the entry's key in the map, + /// with a lifetime bound to the map itself. + /// + /// Note that this is not the key that was used to find the entry. There may be an observable + /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like + /// extra fields or the memory address of an allocation. + pub fn into_key(self) -> &'a mut K { + &mut self.raw.into_bucket().key + } + + /// Gets a reference to the entry's value in the map. + pub fn get(&self) -> &V { + &self.raw.bucket().value + } + + /// Gets a mutable reference to the entry's value in the map. + /// + /// If you need a reference which may outlive the destruction of the + /// [`RawEntryMut`] value, see [`into_mut`][Self::into_mut]. + pub fn get_mut(&mut self) -> &mut V { + &mut self.raw.bucket_mut().value + } + + /// Converts into a mutable reference to the entry's value in the map, + /// with a lifetime bound to the map itself. + pub fn into_mut(self) -> &'a mut V { + &mut self.raw.into_bucket().value + } + + /// Gets a reference to the entry's key and value in the map. + pub fn get_key_value(&self) -> (&K, &V) { + self.raw.bucket().refs() + } + + /// Gets a reference to the entry's key and value in the map. + pub fn get_key_value_mut(&mut self) -> (&mut K, &mut V) { + self.raw.bucket_mut().muts() + } + + /// Converts into a mutable reference to the entry's key and value in the map, + /// with a lifetime bound to the map itself. + pub fn into_key_value_mut(self) -> (&'a mut K, &'a mut V) { + self.raw.into_bucket().muts() + } + + /// Sets the value of the entry, and returns the entry's old value. + pub fn insert(&mut self, value: V) -> V { + mem::replace(self.get_mut(), value) + } + + /// Sets the key of the entry, and returns the entry's old key. + pub fn insert_key(&mut self, key: K) -> K { + mem::replace(self.key_mut(), key) + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// **NOTE:** This is equivalent to [`.swap_remove()`][Self::swap_remove], replacing this + /// entry's position with the last element, and it is deprecated in favor of calling that + /// explicitly. If you need to preserve the relative order of the keys in the map, use + /// [`.shift_remove()`][Self::shift_remove] instead. + #[deprecated(note = "`remove` disrupts the map order -- \ + use `swap_remove` or `shift_remove` for explicit behavior.")] + pub fn remove(self) -> V { + self.swap_remove() + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove(self) -> V { + self.swap_remove_entry().1 + } + + /// Remove the key, value pair stored in the map for this entry, and return the value. + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove(self) -> V { + self.shift_remove_entry().1 + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// **NOTE:** This is equivalent to [`.swap_remove_entry()`][Self::swap_remove_entry], + /// replacing this entry's position with the last element, and it is deprecated in favor of + /// calling that explicitly. If you need to preserve the relative order of the keys in the map, + /// use [`.shift_remove_entry()`][Self::shift_remove_entry] instead. + #[deprecated(note = "`remove_entry` disrupts the map order -- \ + use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] + pub fn remove_entry(self) -> (K, V) { + self.swap_remove_entry() + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with + /// the last element of the map and popping it off. + /// **This perturbs the position of what used to be the last element!** + /// + /// Computes in **O(1)** time (average). + pub fn swap_remove_entry(self) -> (K, V) { + let (map, index) = self.raw.remove_index(); + map.swap_remove_finish(index) + } + + /// Remove and return the key, value pair stored in the map for this entry + /// + /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the + /// elements that follow it, preserving their relative order. + /// **This perturbs the index of all of those elements!** + /// + /// Computes in **O(n)** time (average). + pub fn shift_remove_entry(self) -> (K, V) { + let (map, index) = self.raw.remove_index(); + map.shift_remove_finish(index) + } +} + +/// A view into a vacant raw entry in an [`IndexMap`]. +/// It is part of the [`RawEntryMut`] enum. +pub struct RawVacantEntryMut<'a, K, V, S> { + map: &'a mut IndexMapCore, + hash_builder: &'a S, +} + +impl fmt::Debug for RawVacantEntryMut<'_, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("RawVacantEntryMut").finish_non_exhaustive() + } +} + +impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> { + /// Return the index where a key-value pair may be inserted. + pub fn index(&self) -> usize { + self.map.indices.len() + } + + /// Inserts the given key and value into the map, + /// and returns mutable references to them. + pub fn insert(self, key: K, value: V) -> (&'a mut K, &'a mut V) + where + K: Hash, + S: BuildHasher, + { + let mut h = self.hash_builder.build_hasher(); + key.hash(&mut h); + self.insert_hashed_nocheck(h.finish(), key, value) + } + + /// Inserts the given key and value into the map with the provided hash, + /// and returns mutable references to them. + pub fn insert_hashed_nocheck(self, hash: u64, key: K, value: V) -> (&'a mut K, &'a mut V) { + let i = self.index(); + let map = self.map; + let hash = HashValue(hash as usize); + map.indices.insert(hash.get(), i, get_hash(&map.entries)); + debug_assert_eq!(i, map.entries.len()); + map.push_entry(hash, key, value); + map.entries[i].muts() + } +} + +mod private { + pub trait Sealed {} + + impl Sealed for super::IndexMap {} +} diff --git a/vendor/indexmap/src/map/iter.rs b/vendor/indexmap/src/map/iter.rs index db6e140dd..1ec3703cf 100644 --- a/vendor/indexmap/src/map/iter.rs +++ b/vendor/indexmap/src/map/iter.rs @@ -1,8 +1,11 @@ +use super::core::IndexMapCore; use super::{Bucket, Entries, IndexMap, Slice}; use alloc::vec::{self, Vec}; use core::fmt; +use core::hash::{BuildHasher, Hash}; use core::iter::FusedIterator; +use core::ops::{Index, RangeBounds}; use core::slice; impl<'a, K, V, S> IntoIterator for &'a IndexMap { @@ -32,13 +35,10 @@ impl IntoIterator for IndexMap { } } -/// An iterator over the entries of a `IndexMap`. +/// An iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`iter`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`iter`]: struct.IndexMap.html#method.iter -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::iter`] method. +/// See its documentation for more. pub struct Iter<'a, K, V> { iter: slice::Iter<'a, Bucket>, } @@ -95,13 +95,10 @@ impl Default for Iter<'_, K, V> { } } -/// A mutable iterator over the entries of a `IndexMap`. +/// A mutable iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`iter_mut`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`iter_mut`]: struct.IndexMap.html#method.iter_mut -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::iter_mut`] method. +/// See its documentation for more. pub struct IterMut<'a, K, V> { iter: slice::IterMut<'a, Bucket>, } @@ -159,13 +156,10 @@ impl Default for IterMut<'_, K, V> { } } -/// An owning iterator over the entries of a `IndexMap`. +/// An owning iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`into_iter`] method on [`IndexMap`] -/// (provided by the `IntoIterator` trait). See its documentation for more. -/// -/// [`into_iter`]: struct.IndexMap.html#method.into_iter -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::into_iter`] method +/// (provided by the [`IntoIterator`] trait). See its documentation for more. pub struct IntoIter { iter: vec::IntoIter>, } @@ -221,13 +215,10 @@ impl Default for IntoIter { } } -/// A draining iterator over the entries of a `IndexMap`. +/// A draining iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`drain`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`drain`]: struct.IndexMap.html#method.drain -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::drain`] method. +/// See its documentation for more. pub struct Drain<'a, K, V> { iter: vec::Drain<'a, Bucket>, } @@ -268,13 +259,10 @@ impl fmt::Debug for Drain<'_, K, V> { } } -/// An iterator over the keys of a `IndexMap`. +/// An iterator over the keys of an [`IndexMap`]. /// -/// This `struct` is created by the [`keys`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`keys`]: struct.IndexMap.html#method.keys -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::keys`] method. +/// See its documentation for more. pub struct Keys<'a, K, V> { iter: slice::Iter<'a, Bucket>, } @@ -326,13 +314,77 @@ impl Default for Keys<'_, K, V> { } } -/// An owning iterator over the keys of a `IndexMap`. +/// Access [`IndexMap`] keys at indexed positions. /// -/// This `struct` is created by the [`into_keys`] method on [`IndexMap`]. +/// While [`Index for IndexMap`][values] accesses a map's values, +/// indexing through [`IndexMap::keys`] offers an alternative to access a map's +/// keys instead. +/// +/// [values]: IndexMap#impl-Index-for-IndexMap +/// +/// Since `Keys` is also an iterator, consuming items from the iterator will +/// offset the effective indexes. Similarly, if `Keys` is obtained from +/// [`Slice::keys`], indexes will be interpreted relative to the position of +/// that slice. +/// +/// # Examples +/// +/// ``` +/// use indexmap::IndexMap; +/// +/// let mut map = IndexMap::new(); +/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { +/// map.insert(word.to_lowercase(), word.to_uppercase()); +/// } +/// +/// assert_eq!(map[0], "LOREM"); +/// assert_eq!(map.keys()[0], "lorem"); +/// assert_eq!(map[1], "IPSUM"); +/// assert_eq!(map.keys()[1], "ipsum"); +/// +/// map.reverse(); +/// assert_eq!(map.keys()[0], "amet"); +/// assert_eq!(map.keys()[1], "sit"); +/// +/// map.sort_keys(); +/// assert_eq!(map.keys()[0], "amet"); +/// assert_eq!(map.keys()[1], "dolor"); +/// +/// // Advancing the iterator will offset the indexing +/// let mut keys = map.keys(); +/// assert_eq!(keys[0], "amet"); +/// assert_eq!(keys.next().map(|s| &**s), Some("amet")); +/// assert_eq!(keys[0], "dolor"); +/// assert_eq!(keys[1], "ipsum"); +/// +/// // Slices may have an offset as well +/// let slice = &map[2..]; +/// assert_eq!(slice[0], "IPSUM"); +/// assert_eq!(slice.keys()[0], "ipsum"); +/// ``` +/// +/// ```should_panic +/// use indexmap::IndexMap; +/// +/// let mut map = IndexMap::new(); +/// map.insert("foo", 1); +/// println!("{:?}", map.keys()[10]); // panics! +/// ``` +impl<'a, K, V> Index for Keys<'a, K, V> { + type Output = K; + + /// Returns a reference to the key at the supplied `index`. + /// + /// ***Panics*** if `index` is out of bounds. + fn index(&self, index: usize) -> &K { + &self.iter.as_slice()[index].key + } +} + +/// An owning iterator over the keys of an [`IndexMap`]. +/// +/// This `struct` is created by the [`IndexMap::into_keys`] method. /// See its documentation for more. -/// -/// [`IndexMap`]: struct.IndexMap.html -/// [`into_keys`]: struct.IndexMap.html#method.into_keys pub struct IntoKeys { iter: vec::IntoIter>, } @@ -378,13 +430,10 @@ impl Default for IntoKeys { } } -/// An iterator over the values of a `IndexMap`. +/// An iterator over the values of an [`IndexMap`]. /// -/// This `struct` is created by the [`values`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`values`]: struct.IndexMap.html#method.values -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::values`] method. +/// See its documentation for more. pub struct Values<'a, K, V> { iter: slice::Iter<'a, Bucket>, } @@ -436,13 +485,10 @@ impl Default for Values<'_, K, V> { } } -/// A mutable iterator over the values of a `IndexMap`. +/// A mutable iterator over the values of an [`IndexMap`]. /// -/// This `struct` is created by the [`values_mut`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`values_mut`]: struct.IndexMap.html#method.values_mut -/// [`IndexMap`]: struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::values_mut`] method. +/// See its documentation for more. pub struct ValuesMut<'a, K, V> { iter: slice::IterMut<'a, Bucket>, } @@ -488,13 +534,10 @@ impl Default for ValuesMut<'_, K, V> { } } -/// An owning iterator over the values of a `IndexMap`. +/// An owning iterator over the values of an [`IndexMap`]. /// -/// This `struct` is created by the [`into_values`] method on [`IndexMap`]. +/// This `struct` is created by the [`IndexMap::into_values`] method. /// See its documentation for more. -/// -/// [`IndexMap`]: struct.IndexMap.html -/// [`into_values`]: struct.IndexMap.html#method.into_values pub struct IntoValues { iter: vec::IntoIter>, } @@ -539,3 +582,132 @@ impl Default for IntoValues { } } } + +/// A splicing iterator for `IndexMap`. +/// +/// This `struct` is created by [`IndexMap::splice()`]. +/// See its documentation for more. +pub struct Splice<'a, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + map: &'a mut IndexMap, + tail: IndexMapCore, + drain: vec::IntoIter>, + replace_with: I, +} + +impl<'a, I, K, V, S> Splice<'a, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + pub(super) fn new(map: &'a mut IndexMap, range: R, replace_with: I) -> Self + where + R: RangeBounds, + { + let (tail, drain) = map.core.split_splice(range); + Self { + map, + tail, + drain, + replace_with, + } + } +} + +impl Drop for Splice<'_, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + fn drop(&mut self) { + // Finish draining unconsumed items. We don't strictly *have* to do this + // manually, since we already split it into separate memory, but it will + // match the drop order of `vec::Splice` items this way. + let _ = self.drain.nth(usize::MAX); + + // Now insert all the new items. If a key matches an existing entry, it + // keeps the original position and only replaces the value, like `insert`. + while let Some((key, value)) = self.replace_with.next() { + // Since the tail is disjoint, we can try to update it first, + // or else insert (update or append) the primary map. + let hash = self.map.hash(&key); + if let Some(i) = self.tail.get_index_of(hash, &key) { + self.tail.as_entries_mut()[i].value = value; + } else { + self.map.core.insert_full(hash, key, value); + } + } + + // Finally, re-append the tail + self.map.core.append_unchecked(&mut self.tail); + } +} + +impl Iterator for Splice<'_, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + type Item = (K, V); + + fn next(&mut self) -> Option { + self.drain.next().map(Bucket::key_value) + } + + fn size_hint(&self) -> (usize, Option) { + self.drain.size_hint() + } +} + +impl DoubleEndedIterator for Splice<'_, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + fn next_back(&mut self) -> Option { + self.drain.next_back().map(Bucket::key_value) + } +} + +impl ExactSizeIterator for Splice<'_, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ + fn len(&self) -> usize { + self.drain.len() + } +} + +impl FusedIterator for Splice<'_, I, K, V, S> +where + I: Iterator, + K: Hash + Eq, + S: BuildHasher, +{ +} + +impl<'a, I, K, V, S> fmt::Debug for Splice<'a, I, K, V, S> +where + I: fmt::Debug + Iterator, + K: fmt::Debug + Hash + Eq, + V: fmt::Debug, + S: BuildHasher, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // Follow `vec::Splice` in only printing the drain and replacement + f.debug_struct("Splice") + .field("drain", &self.drain) + .field("replace_with", &self.replace_with) + .finish() + } +} diff --git a/vendor/indexmap/src/map/serde_seq.rs b/vendor/indexmap/src/map/serde_seq.rs index f10aa5781..c35a234d0 100644 --- a/vendor/indexmap/src/map/serde_seq.rs +++ b/vendor/indexmap/src/map/serde_seq.rs @@ -1,4 +1,4 @@ -//! Functions to serialize and deserialize an `IndexMap` as an ordered sequence. +//! Functions to serialize and deserialize an [`IndexMap`] as an ordered sequence. //! //! The default `serde` implementation serializes `IndexMap` as a normal map, //! but there is no guarantee that serialization formats will preserve the order @@ -29,7 +29,7 @@ use crate::map::Slice as MapSlice; use crate::set::Slice as SetSlice; use crate::IndexMap; -/// Serializes a `map::Slice` as an ordered sequence. +/// Serializes a [`map::Slice`][MapSlice] as an ordered sequence. /// /// This behaves like [`crate::map::serde_seq`] for `IndexMap`, serializing a sequence /// of `(key, value)` pairs, rather than as a map that might not preserve order. @@ -46,7 +46,7 @@ where } } -/// Serializes a `set::Slice` as an ordered sequence. +/// Serializes a [`set::Slice`][SetSlice] as an ordered sequence. impl Serialize for SetSlice where T: Serialize, @@ -59,9 +59,9 @@ where } } -/// Serializes an `IndexMap` as an ordered sequence. +/// Serializes an [`IndexMap`] as an ordered sequence. /// -/// This function may be used in a field attribute for deriving `Serialize`: +/// This function may be used in a field attribute for deriving [`Serialize`]: /// /// ``` /// # use indexmap::IndexMap; @@ -75,9 +75,8 @@ where /// ``` pub fn serialize(map: &IndexMap, serializer: T) -> Result where - K: Serialize + Hash + Eq, + K: Serialize, V: Serialize, - S: BuildHasher, T: Serializer, { serializer.collect_seq(map) @@ -113,9 +112,9 @@ where } } -/// Deserializes an `IndexMap` from an ordered sequence. +/// Deserializes an [`IndexMap`] from an ordered sequence. /// -/// This function may be used in a field attribute for deriving `Deserialize`: +/// This function may be used in a field attribute for deriving [`Deserialize`]: /// /// ``` /// # use indexmap::IndexMap; diff --git a/vendor/indexmap/src/map/slice.rs b/vendor/indexmap/src/map/slice.rs index ebab208c9..ce001ee85 100644 --- a/vendor/indexmap/src/map/slice.rs +++ b/vendor/indexmap/src/map/slice.rs @@ -11,13 +11,13 @@ use core::fmt; use core::hash::{Hash, Hasher}; use core::ops::{self, Bound, Index, IndexMut, RangeBounds}; -/// A dynamically-sized slice of key-value pairs in an `IndexMap`. +/// A dynamically-sized slice of key-value pairs in an [`IndexMap`]. /// /// This supports indexed operations much like a `[(K, V)]` slice, /// but not any hashed operations on the map keys. /// -/// Unlike `IndexMap`, `Slice` does consider the order for `PartialEq` -/// and `Eq`, and it also implements `PartialOrd`, `Ord`, and `Hash`. +/// Unlike `IndexMap`, `Slice` does consider the order for [`PartialEq`] +/// and [`Eq`], and it also implements [`PartialOrd`], [`Ord`], and [`Hash`]. #[repr(transparent)] pub struct Slice { pub(crate) entries: [Bucket], diff --git a/vendor/indexmap/src/map/tests.rs b/vendor/indexmap/src/map/tests.rs index 3d2315d3e..d81d51b9c 100644 --- a/vendor/indexmap/src/map/tests.rs +++ b/vendor/indexmap/src/map/tests.rs @@ -359,6 +359,36 @@ fn occupied_entry_key() { } } +#[test] +fn get_index_entry() { + let mut map = IndexMap::new(); + + assert!(map.get_index_entry(0).is_none()); + + map.insert(0, "0"); + map.insert(1, "1"); + map.insert(2, "2"); + map.insert(3, "3"); + + assert!(map.get_index_entry(4).is_none()); + + { + let e = map.get_index_entry(1).unwrap(); + assert_eq!(*e.key(), 1); + assert_eq!(*e.get(), "1"); + assert_eq!(e.swap_remove(), "1"); + } + + { + let mut e = map.get_index_entry(1).unwrap(); + assert_eq!(*e.key(), 3); + assert_eq!(*e.get(), "3"); + assert_eq!(e.insert("4"), "3"); + } + + assert_eq!(*map.get(&3).unwrap(), "4"); +} + #[test] fn keys() { let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; diff --git a/vendor/indexmap/src/mutable_keys.rs b/vendor/indexmap/src/mutable_keys.rs index 7efc779b1..917af8c66 100644 --- a/vendor/indexmap/src/mutable_keys.rs +++ b/vendor/indexmap/src/mutable_keys.rs @@ -2,7 +2,7 @@ use core::hash::{BuildHasher, Hash}; use super::{Bucket, Entries, Equivalent, IndexMap}; -/// Opt-in mutable access to keys. +/// Opt-in mutable access to [`IndexMap`] keys. /// /// These methods expose `&mut K`, mutable references to the key as it is stored /// in the map. @@ -11,7 +11,7 @@ use super::{Bucket, Entries, Equivalent, IndexMap}; /// /// If keys are modified erroneously, you can no longer look them up. /// This is sound (memory safe) but a logical error hazard (just like -/// implementing PartialEq, Eq, or Hash incorrectly would be). +/// implementing `PartialEq`, `Eq`, or `Hash` incorrectly would be). /// /// `use` this trait to enable its methods for `IndexMap`. /// @@ -51,10 +51,9 @@ pub trait MutableKeys: private::Sealed { /// Opt-in mutable access to keys. /// -/// See [`MutableKeys`](trait.MutableKeys.html) for more information. +/// See [`MutableKeys`] for more information. impl MutableKeys for IndexMap where - K: Eq + Hash, S: BuildHasher, { type Key = K; diff --git a/vendor/indexmap/src/rayon/map.rs b/vendor/indexmap/src/rayon/map.rs index d5325f2ee..8236cf70f 100644 --- a/vendor/indexmap/src/rayon/map.rs +++ b/vendor/indexmap/src/rayon/map.rs @@ -1,4 +1,4 @@ -//! Parallel iterator types for `IndexMap` with [rayon](https://docs.rs/rayon/1.0/rayon). +//! Parallel iterator types for [`IndexMap`] with [`rayon`][::rayon]. //! //! You will rarely need to interact with this module directly unless you need to name one of the //! iterator types. @@ -49,13 +49,10 @@ where } } -/// A parallel owning iterator over the entries of a `IndexMap`. +/// A parallel owning iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`into_par_iter`] method on [`IndexMap`] -/// (provided by rayon's `IntoParallelIterator` trait). See its documentation for more. -/// -/// [`into_par_iter`]: ../struct.IndexMap.html#method.into_par_iter -/// [`IndexMap`]: ../struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::into_par_iter`] method +/// (provided by rayon's [`IntoParallelIterator`] trait). See its documentation for more. pub struct IntoParIter { entries: Vec>, } @@ -107,13 +104,12 @@ where } } -/// A parallel iterator over the entries of a `IndexMap`. +/// A parallel iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_iter`] method on [`IndexMap`] -/// (provided by rayon's `IntoParallelRefIterator` trait). See its documentation for more. +/// This `struct` is created by the [`IndexMap::par_iter`] method +/// (provided by rayon's [`IntoParallelRefIterator`] trait). See its documentation for more. /// -/// [`par_iter`]: ../struct.IndexMap.html#method.par_iter -/// [`IndexMap`]: ../struct.IndexMap.html +/// [`IndexMap::par_iter`]: ../struct.IndexMap.html#method.par_iter pub struct ParIter<'a, K, V> { entries: &'a [Bucket], } @@ -171,13 +167,12 @@ where } } -/// A parallel mutable iterator over the entries of a `IndexMap`. +/// A parallel mutable iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_iter_mut`] method on [`IndexMap`] -/// (provided by rayon's `IntoParallelRefMutIterator` trait). See its documentation for more. +/// This `struct` is created by the [`IndexMap::par_iter_mut`] method +/// (provided by rayon's [`IntoParallelRefMutIterator`] trait). See its documentation for more. /// -/// [`par_iter_mut`]: ../struct.IndexMap.html#method.par_iter_mut -/// [`IndexMap`]: ../struct.IndexMap.html +/// [`IndexMap::par_iter_mut`]: ../struct.IndexMap.html#method.par_iter_mut pub struct ParIterMut<'a, K, V> { entries: &'a mut [Bucket], } @@ -214,13 +209,12 @@ where } } -/// A parallel draining iterator over the entries of a `IndexMap`. +/// A parallel draining iterator over the entries of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_drain`] method on [`IndexMap`] -/// (provided by rayon's `ParallelDrainRange` trait). See its documentation for more. +/// This `struct` is created by the [`IndexMap::par_drain`] method +/// (provided by rayon's [`ParallelDrainRange`] trait). See its documentation for more. /// -/// [`par_drain`]: ../struct.IndexMap.html#method.par_drain -/// [`IndexMap`]: ../struct.IndexMap.html +/// [`IndexMap::par_drain`]: ../struct.IndexMap.html#method.par_drain pub struct ParDrain<'a, K: Send, V: Send> { entries: rayon::vec::Drain<'a, Bucket>, } @@ -318,13 +312,10 @@ where } } -/// A parallel iterator over the keys of a `IndexMap`. +/// A parallel iterator over the keys of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_keys`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`par_keys`]: ../struct.IndexMap.html#method.par_keys -/// [`IndexMap`]: ../struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::par_keys`] method. +/// See its documentation for more. pub struct ParKeys<'a, K, V> { entries: &'a [Bucket], } @@ -352,13 +343,10 @@ impl IndexedParallelIterator for ParKeys<'_, K, V> { indexed_parallel_iterator_methods!(Bucket::key_ref); } -/// A parallel iterator over the values of a `IndexMap`. +/// A parallel iterator over the values of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_values`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`par_values`]: ../struct.IndexMap.html#method.par_values -/// [`IndexMap`]: ../struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::par_values`] method. +/// See its documentation for more. pub struct ParValues<'a, K, V> { entries: &'a [Bucket], } @@ -420,9 +408,8 @@ where impl IndexMap where - K: Hash + Eq + Send, + K: Send, V: Send, - S: BuildHasher, { /// Sort the map’s key-value pairs in parallel, by the default ordering of the keys. pub fn par_sort_keys(&mut self) @@ -507,13 +494,10 @@ where } } -/// A parallel mutable iterator over the values of a `IndexMap`. +/// A parallel mutable iterator over the values of an [`IndexMap`]. /// -/// This `struct` is created by the [`par_values_mut`] method on [`IndexMap`]. See its -/// documentation for more. -/// -/// [`par_values_mut`]: ../struct.IndexMap.html#method.par_values_mut -/// [`IndexMap`]: ../struct.IndexMap.html +/// This `struct` is created by the [`IndexMap::par_values_mut`] method. +/// See its documentation for more. pub struct ParValuesMut<'a, K, V> { entries: &'a mut [Bucket], } diff --git a/vendor/indexmap/src/rayon/mod.rs b/vendor/indexmap/src/rayon/mod.rs index ebb1ac2d1..1d21569c1 100644 --- a/vendor/indexmap/src/rayon/mod.rs +++ b/vendor/indexmap/src/rayon/mod.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, doc(cfg(feature = "rayon")))] + use rayon::prelude::*; use alloc::collections::LinkedList; diff --git a/vendor/indexmap/src/rayon/set.rs b/vendor/indexmap/src/rayon/set.rs index 0fc478ef0..3904234b2 100644 --- a/vendor/indexmap/src/rayon/set.rs +++ b/vendor/indexmap/src/rayon/set.rs @@ -1,4 +1,4 @@ -//! Parallel iterator types for `IndexSet` with [rayon](https://docs.rs/rayon/1.0/rayon). +//! Parallel iterator types for [`IndexSet`] with [rayon][::rayon]. //! //! You will rarely need to interact with this module directly unless you need to name one of the //! iterator types. @@ -48,13 +48,10 @@ where } } -/// A parallel owning iterator over the items of a `IndexSet`. +/// A parallel owning iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`into_par_iter`] method on [`IndexSet`] -/// (provided by rayon's `IntoParallelIterator` trait). See its documentation for more. -/// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`into_par_iter`]: ../struct.IndexSet.html#method.into_par_iter +/// This `struct` is created by the [`IndexSet::into_par_iter`] method +/// (provided by rayon's [`IntoParallelIterator`] trait). See its documentation for more. pub struct IntoParIter { entries: Vec>, } @@ -104,13 +101,12 @@ where } } -/// A parallel iterator over the items of a `IndexSet`. +/// A parallel iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`par_iter`] method on [`IndexSet`] -/// (provided by rayon's `IntoParallelRefIterator` trait). See its documentation for more. +/// This `struct` is created by the [`IndexSet::par_iter`] method +/// (provided by rayon's [`IntoParallelRefIterator`] trait). See its documentation for more. /// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`par_iter`]: ../struct.IndexSet.html#method.par_iter +/// [`IndexSet::par_iter`]: ../struct.IndexSet.html#method.par_iter pub struct ParIter<'a, T> { entries: &'a [Bucket], } @@ -152,13 +148,12 @@ where } } -/// A parallel draining iterator over the items of a `IndexSet`. +/// A parallel draining iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`par_drain`] method on [`IndexSet`] -/// (provided by rayon's `ParallelDrainRange` trait). See its documentation for more. +/// This `struct` is created by the [`IndexSet::par_drain`] method +/// (provided by rayon's [`ParallelDrainRange`] trait). See its documentation for more. /// -/// [`par_drain`]: ../struct.IndexSet.html#method.par_drain -/// [`IndexSet`]: ../struct.IndexSet.html +/// [`IndexSet::par_drain`]: ../struct.IndexSet.html#method.par_drain pub struct ParDrain<'a, T: Send> { entries: rayon::vec::Drain<'a, Bucket>, } @@ -294,13 +289,10 @@ where } } -/// A parallel iterator producing elements in the difference of `IndexSet`s. +/// A parallel iterator producing elements in the difference of [`IndexSet`]s. /// -/// This `struct` is created by the [`par_difference`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::par_difference`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`par_difference`]: ../struct.IndexSet.html#method.par_difference pub struct ParDifference<'a, T, S1, S2> { set1: &'a IndexSet, set2: &'a IndexSet, @@ -345,13 +337,10 @@ where } } -/// A parallel iterator producing elements in the intersection of `IndexSet`s. +/// A parallel iterator producing elements in the intersection of [`IndexSet`]s. /// -/// This `struct` is created by the [`par_intersection`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::par_intersection`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`par_intersection`]: ../struct.IndexSet.html#method.par_intersection pub struct ParIntersection<'a, T, S1, S2> { set1: &'a IndexSet, set2: &'a IndexSet, @@ -396,13 +385,10 @@ where } } -/// A parallel iterator producing elements in the symmetric difference of `IndexSet`s. +/// A parallel iterator producing elements in the symmetric difference of [`IndexSet`]s. /// -/// This `struct` is created by the [`par_symmetric_difference`] method on -/// [`IndexSet`]. See its documentation for more. -/// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`par_symmetric_difference`]: ../struct.IndexSet.html#method.par_symmetric_difference +/// This `struct` is created by the [`IndexSet::par_symmetric_difference`] method. +/// See its documentation for more. pub struct ParSymmetricDifference<'a, T, S1, S2> { set1: &'a IndexSet, set2: &'a IndexSet, @@ -447,13 +433,10 @@ where } } -/// A parallel iterator producing elements in the union of `IndexSet`s. +/// A parallel iterator producing elements in the union of [`IndexSet`]s. /// -/// This `struct` is created by the [`par_union`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::par_union`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: ../struct.IndexSet.html -/// [`par_union`]: ../struct.IndexSet.html#method.par_union pub struct ParUnion<'a, T, S1, S2> { set1: &'a IndexSet, set2: &'a IndexSet, @@ -501,8 +484,7 @@ where /// The following methods **require crate feature `"rayon"`**. impl IndexSet where - T: Hash + Eq + Send, - S: BuildHasher + Send, + T: Send, { /// Sort the set’s values in parallel by their default ordering. pub fn par_sort(&mut self) diff --git a/vendor/indexmap/src/serde.rs b/vendor/indexmap/src/serde.rs index 37de3e3e3..8920a0bd3 100644 --- a/vendor/indexmap/src/serde.rs +++ b/vendor/indexmap/src/serde.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] + use serde::de::value::{MapDeserializer, SeqDeserializer}; use serde::de::{ Deserialize, Deserializer, Error, IntoDeserializer, MapAccess, SeqAccess, Visitor, @@ -12,9 +14,8 @@ use crate::IndexMap; impl Serialize for IndexMap where - K: Serialize + Hash + Eq, + K: Serialize, V: Serialize, - S: BuildHasher, { fn serialize(&self, serializer: T) -> Result where @@ -85,8 +86,7 @@ use crate::IndexSet; impl Serialize for IndexSet where - T: Serialize + Hash + Eq, - S: BuildHasher, + T: Serialize, { fn serialize(&self, serializer: Se) -> Result where diff --git a/vendor/indexmap/src/set.rs b/vendor/indexmap/src/set.rs index c047b0bea..e25608438 100644 --- a/vendor/indexmap/src/set.rs +++ b/vendor/indexmap/src/set.rs @@ -1,4 +1,4 @@ -//! A hash set implemented using `IndexMap` +//! A hash set implemented using [`IndexMap`] mod iter; mod slice; @@ -6,7 +6,9 @@ mod slice; #[cfg(test)] mod tests; -pub use self::iter::{Difference, Drain, Intersection, IntoIter, Iter, SymmetricDifference, Union}; +pub use self::iter::{ + Difference, Drain, Intersection, IntoIter, Iter, Splice, SymmetricDifference, Union, +}; pub use self::slice::Slice; #[cfg(feature = "rayon")] @@ -31,8 +33,9 @@ type Bucket = super::Bucket; /// A hash set where the iteration order of the values is independent of their /// hash values. /// -/// The interface is closely compatible with the standard `HashSet`, but also -/// has additional features. +/// The interface is closely compatible with the standard +/// [`HashSet`][std::collections::HashSet], +/// but also has additional features. /// /// # Order /// @@ -43,11 +46,12 @@ type Bucket = super::Bucket; /// already present. /// /// All iterators traverse the set *in order*. Set operation iterators like -/// `union` produce a concatenated order, as do their matching "bitwise" +/// [`IndexSet::union`] produce a concatenated order, as do their matching "bitwise" /// operators. See their documentation for specifics. /// /// The insertion order is preserved, with **notable exceptions** like the -/// `.remove()` or `.swap_remove()` methods. Methods such as `.sort_by()` of +/// [`.remove()`][Self::remove] or [`.swap_remove()`][Self::swap_remove] methods. +/// Methods such as [`.sort_by()`][Self::sort_by] of /// course result in a new order, depending on the sorting order. /// /// # Indices @@ -232,7 +236,7 @@ impl IndexSet { /// Clears the `IndexSet` in the given index range, returning those values /// as a drain iterator. /// - /// The range may be any type that implements `RangeBounds`, + /// The range may be any type that implements [`RangeBounds`], /// including all of the `std::ops::Range*` types, or even a tuple pair of /// `Bound` start and end values. To drain the set entirely, use `RangeFull` /// like `set.drain(..)`. @@ -264,13 +268,7 @@ impl IndexSet { map: self.map.split_off(at), } } -} -impl IndexSet -where - T: Hash + Eq, - S: BuildHasher, -{ /// Reserve capacity for `additional` more values. /// /// Computes in **O(n)** time. @@ -322,7 +320,13 @@ where pub fn shrink_to(&mut self, min_capacity: usize) { self.map.shrink_to(min_capacity); } +} +impl IndexSet +where + T: Hash + Eq, + S: BuildHasher, +{ /// Insert the value into the set. /// /// If an equivalent item already exists in the set, it returns @@ -349,6 +353,28 @@ where (index, existing.is_none()) } + /// Adds a value to the set, replacing the existing value, if any, that is + /// equal to the given one, without altering its insertion order. Returns + /// the replaced value. + /// + /// Computes in **O(1)** time (average). + pub fn replace(&mut self, value: T) -> Option { + self.replace_full(value).1 + } + + /// Adds a value to the set, replacing the existing value, if any, that is + /// equal to the given one, without altering its insertion order. Returns + /// the index of the item and its replaced value. + /// + /// Computes in **O(1)** time (average). + pub fn replace_full(&mut self, value: T) -> (usize, Option) { + let hash = self.map.hash(&value); + match self.map.core.replace_full(hash, value, ()) { + (i, Some((replaced, ()))) => (i, Some(replaced)), + (i, None) => (i, None), + } + } + /// Return an iterator over the values that are in `self` but not `other`. /// /// Values are produced in the same order that they appear in `self`. @@ -395,6 +421,48 @@ where Union::new(self, other) } + /// Creates a splicing iterator that replaces the specified range in the set + /// with the given `replace_with` iterator and yields the removed items. + /// `replace_with` does not need to be the same length as `range`. + /// + /// The `range` is removed even if the iterator is not consumed until the + /// end. It is unspecified how many elements are removed from the set if the + /// `Splice` value is leaked. + /// + /// The input iterator `replace_with` is only consumed when the `Splice` + /// value is dropped. If a value from the iterator matches an existing entry + /// in the set (outside of `range`), then the original will be unchanged. + /// Otherwise, the new value will be inserted in the replaced `range`. + /// + /// ***Panics*** if the starting point is greater than the end point or if + /// the end point is greater than the length of the set. + /// + /// # Examples + /// + /// ``` + /// use indexmap::IndexSet; + /// + /// let mut set = IndexSet::from([0, 1, 2, 3, 4]); + /// let new = [5, 4, 3, 2, 1]; + /// let removed: Vec<_> = set.splice(2..4, new).collect(); + /// + /// // 1 and 4 kept their positions, while 5, 3, and 2 were newly inserted. + /// assert!(set.into_iter().eq([0, 1, 5, 3, 2, 4])); + /// assert_eq!(removed, &[2, 3]); + /// ``` + pub fn splice(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, T, S> + where + R: RangeBounds, + I: IntoIterator, + { + Splice::new(self, range, replace_with.into_iter()) + } +} + +impl IndexSet +where + S: BuildHasher, +{ /// Return `true` if an equivalent to `value` exists in the set. /// /// Computes in **O(1)** time (average). @@ -434,39 +502,14 @@ where self.map.get_index_of(value) } - /// Adds a value to the set, replacing the existing value, if any, that is - /// equal to the given one, without altering its insertion order. Returns - /// the replaced value. - /// - /// Computes in **O(1)** time (average). - pub fn replace(&mut self, value: T) -> Option { - self.replace_full(value).1 - } - - /// Adds a value to the set, replacing the existing value, if any, that is - /// equal to the given one, without altering its insertion order. Returns - /// the index of the item and its replaced value. - /// - /// Computes in **O(1)** time (average). - pub fn replace_full(&mut self, value: T) -> (usize, Option) { - use super::map::Entry::*; - - match self.map.entry(value) { - Vacant(e) => { - let index = e.index(); - e.insert(()); - (index, None) - } - Occupied(e) => (e.index(), Some(e.replace_key())), - } - } - /// Remove the value from the set, and return `true` if it was present. /// - /// **NOTE:** This is equivalent to `.swap_remove(value)`, if you want - /// to preserve the order of the values in the set, use `.shift_remove(value)`. - /// - /// Computes in **O(1)** time (average). + /// **NOTE:** This is equivalent to [`.swap_remove(value)`][Self::swap_remove], replacing this + /// value's position with the last element, and it is deprecated in favor of calling that + /// explicitly. If you need to preserve the relative order of the values in the set, use + /// [`.shift_remove(value)`][Self::shift_remove] instead. + #[deprecated(note = "`remove` disrupts the set order -- \ + use `swap_remove` or `shift_remove` for explicit behavior.")] pub fn remove(&mut self, value: &Q) -> bool where Q: Hash + Equivalent, @@ -476,7 +519,7 @@ where /// Remove the value from the set, and return `true` if it was present. /// - /// Like `Vec::swap_remove`, the value is removed by swapping it with the + /// Like [`Vec::swap_remove`], the value is removed by swapping it with the /// last element of the set and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -492,7 +535,7 @@ where /// Remove the value from the set, and return `true` if it was present. /// - /// Like `Vec::remove`, the value is removed by shifting all of the + /// Like [`Vec::remove`], the value is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -509,11 +552,12 @@ where /// Removes and returns the value in the set, if any, that is equal to the /// given one. /// - /// **NOTE:** This is equivalent to `.swap_take(value)`, if you need to - /// preserve the order of the values in the set, use `.shift_take(value)` - /// instead. - /// - /// Computes in **O(1)** time (average). + /// **NOTE:** This is equivalent to [`.swap_take(value)`][Self::swap_take], replacing this + /// value's position with the last element, and it is deprecated in favor of calling that + /// explicitly. If you need to preserve the relative order of the values in the set, use + /// [`.shift_take(value)`][Self::shift_take] instead. + #[deprecated(note = "`take` disrupts the set order -- \ + use `swap_take` or `shift_take` for explicit behavior.")] pub fn take(&mut self, value: &Q) -> Option where Q: Hash + Equivalent, @@ -524,7 +568,7 @@ where /// Removes and returns the value in the set, if any, that is equal to the /// given one. /// - /// Like `Vec::swap_remove`, the value is removed by swapping it with the + /// Like [`Vec::swap_remove`], the value is removed by swapping it with the /// last element of the set and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -541,7 +585,7 @@ where /// Removes and returns the value in the set, if any, that is equal to the /// given one. /// - /// Like `Vec::remove`, the value is removed by shifting all of the + /// Like [`Vec::remove`], the value is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -557,7 +601,7 @@ where /// Remove the value from the set return it and the index it had. /// - /// Like `Vec::swap_remove`, the value is removed by swapping it with the + /// Like [`Vec::swap_remove`], the value is removed by swapping it with the /// last element of the set and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -571,7 +615,7 @@ where /// Remove the value from the set return it and the index it had. /// - /// Like `Vec::remove`, the value is removed by shifting all of the + /// Like [`Vec::remove`], the value is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -582,7 +626,9 @@ where { self.map.shift_remove_full(value).map(|(i, x, ())| (i, x)) } +} +impl IndexSet { /// Remove the last value /// /// This preserves the order of the remaining elements. @@ -751,9 +797,7 @@ where pub fn reverse(&mut self) { self.map.reverse() } -} -impl IndexSet { /// Returns a slice of all the values in the set. /// /// Computes in **O(1)** time. @@ -806,7 +850,7 @@ impl IndexSet { /// /// Valid indices are *0 <= index < self.len()* /// - /// Like `Vec::swap_remove`, the value is removed by swapping it with the + /// Like [`Vec::swap_remove`], the value is removed by swapping it with the /// last element of the set and popping it off. **This perturbs /// the position of what used to be the last element!** /// @@ -819,7 +863,7 @@ impl IndexSet { /// /// Valid indices are *0 <= index < self.len()* /// - /// Like `Vec::remove`, the value is removed by shifting all of the + /// Like [`Vec::remove`], the value is removed by shifting all of the /// elements that follow it, preserving their relative order. /// **This perturbs the index of all of those elements!** /// @@ -849,7 +893,7 @@ impl IndexSet { } } -/// Access `IndexSet` values at indexed positions. +/// Access [`IndexSet`] values at indexed positions. /// /// # Examples /// @@ -948,7 +992,7 @@ impl Default for IndexSet where S: Default, { - /// Return an empty `IndexSet` + /// Return an empty [`IndexSet`] fn default() -> Self { IndexSet { map: IndexMap::default(), diff --git a/vendor/indexmap/src/set/iter.rs b/vendor/indexmap/src/set/iter.rs index 828756da1..3f8033c2d 100644 --- a/vendor/indexmap/src/set/iter.rs +++ b/vendor/indexmap/src/set/iter.rs @@ -4,6 +4,7 @@ use alloc::vec::{self, Vec}; use core::fmt; use core::hash::{BuildHasher, Hash}; use core::iter::{Chain, FusedIterator}; +use core::ops::RangeBounds; use core::slice::Iter as SliceIter; impl<'a, T, S> IntoIterator for &'a IndexSet { @@ -24,13 +25,10 @@ impl IntoIterator for IndexSet { } } -/// An iterator over the items of a `IndexSet`. +/// An iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`iter`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::iter`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`iter`]: struct.IndexSet.html#method.iter pub struct Iter<'a, T> { iter: SliceIter<'a, Bucket>, } @@ -86,13 +84,10 @@ impl Default for Iter<'_, T> { } } -/// An owning iterator over the items of a `IndexSet`. +/// An owning iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`into_iter`] method on [`IndexSet`] -/// (provided by the `IntoIterator` trait). See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`into_iter`]: struct.IndexSet.html#method.into_iter +/// This `struct` is created by the [`IndexSet::into_iter`] method +/// (provided by the [`IntoIterator`] trait). See its documentation for more. pub struct IntoIter { iter: vec::IntoIter>, } @@ -143,13 +138,10 @@ impl Default for IntoIter { } } -/// A draining iterator over the items of a `IndexSet`. +/// A draining iterator over the items of an [`IndexSet`]. /// -/// This `struct` is created by the [`drain`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::drain`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`drain`]: struct.IndexSet.html#method.drain pub struct Drain<'a, T> { iter: vec::Drain<'a, Bucket>, } @@ -190,13 +182,10 @@ impl fmt::Debug for Drain<'_, T> { } } -/// A lazy iterator producing elements in the difference of `IndexSet`s. +/// A lazy iterator producing elements in the difference of [`IndexSet`]s. /// -/// This `struct` is created by the [`difference`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::difference`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`difference`]: struct.IndexSet.html#method.difference pub struct Difference<'a, T, S> { iter: Iter<'a, T>, other: &'a IndexSet, @@ -273,13 +262,10 @@ where } } -/// A lazy iterator producing elements in the intersection of `IndexSet`s. +/// A lazy iterator producing elements in the intersection of [`IndexSet`]s. /// -/// This `struct` is created by the [`intersection`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::intersection`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`intersection`]: struct.IndexSet.html#method.intersection pub struct Intersection<'a, T, S> { iter: Iter<'a, T>, other: &'a IndexSet, @@ -356,13 +342,10 @@ where } } -/// A lazy iterator producing elements in the symmetric difference of `IndexSet`s. +/// A lazy iterator producing elements in the symmetric difference of [`IndexSet`]s. /// -/// This `struct` is created by the [`symmetric_difference`] method on -/// [`IndexSet`]. See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`symmetric_difference`]: struct.IndexSet.html#method.symmetric_difference +/// This `struct` is created by the [`IndexSet::symmetric_difference`] method. +/// See its documentation for more. pub struct SymmetricDifference<'a, T, S1, S2> { iter: Chain, Difference<'a, T, S1>>, } @@ -451,13 +434,10 @@ where } } -/// A lazy iterator producing elements in the union of `IndexSet`s. +/// A lazy iterator producing elements in the union of [`IndexSet`]s. /// -/// This `struct` is created by the [`union`] method on [`IndexSet`]. +/// This `struct` is created by the [`IndexSet::union`] method. /// See its documentation for more. -/// -/// [`IndexSet`]: struct.IndexSet.html -/// [`union`]: struct.IndexSet.html#method.union pub struct Union<'a, T, S> { iter: Chain, Difference<'a, T, S>>, } @@ -541,3 +521,106 @@ where f.debug_list().entries(self.clone()).finish() } } + +/// A splicing iterator for `IndexSet`. +/// +/// This `struct` is created by [`IndexSet::splice()`]. +/// See its documentation for more. +pub struct Splice<'a, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ + iter: crate::map::Splice<'a, UnitValue, T, (), S>, +} + +impl<'a, I, T, S> Splice<'a, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ + pub(super) fn new(set: &'a mut IndexSet, range: R, replace_with: I) -> Self + where + R: RangeBounds, + { + Self { + iter: set.map.splice(range, UnitValue(replace_with)), + } + } +} + +impl Iterator for Splice<'_, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ + type Item = T; + + fn next(&mut self) -> Option { + Some(self.iter.next()?.0) + } + + fn size_hint(&self) -> (usize, Option) { + self.iter.size_hint() + } +} + +impl DoubleEndedIterator for Splice<'_, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ + fn next_back(&mut self) -> Option { + Some(self.iter.next_back()?.0) + } +} + +impl ExactSizeIterator for Splice<'_, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ + fn len(&self) -> usize { + self.iter.len() + } +} + +impl FusedIterator for Splice<'_, I, T, S> +where + I: Iterator, + T: Hash + Eq, + S: BuildHasher, +{ +} + +struct UnitValue(I); + +impl Iterator for UnitValue { + type Item = (I::Item, ()); + + fn next(&mut self) -> Option { + self.0.next().map(|x| (x, ())) + } +} + +impl<'a, I, T, S> fmt::Debug for Splice<'a, I, T, S> +where + I: fmt::Debug + Iterator, + T: fmt::Debug + Hash + Eq, + S: BuildHasher, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.iter, f) + } +} + +impl fmt::Debug for UnitValue { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.0, f) + } +} diff --git a/vendor/indexmap/src/set/slice.rs b/vendor/indexmap/src/set/slice.rs index 251d0677d..be006c97d 100644 --- a/vendor/indexmap/src/set/slice.rs +++ b/vendor/indexmap/src/set/slice.rs @@ -8,13 +8,13 @@ use core::fmt; use core::hash::{Hash, Hasher}; use core::ops::{self, Bound, Index, RangeBounds}; -/// A dynamically-sized slice of values in an `IndexSet`. +/// A dynamically-sized slice of values in an [`IndexSet`]. /// /// This supports indexed operations much like a `[T]` slice, /// but not any hashed operations on the values. /// -/// Unlike `IndexSet`, `Slice` does consider the order for `PartialEq` -/// and `Eq`, and it also implements `PartialOrd`, `Ord`, and `Hash`. +/// Unlike `IndexSet`, `Slice` does consider the order for [`PartialEq`] +/// and [`Eq`], and it also implements [`PartialOrd`], [`Ord`], and [`Hash`]. #[repr(transparent)] pub struct Slice { pub(crate) entries: [Bucket], diff --git a/vendor/indexmap/src/set/tests.rs b/vendor/indexmap/src/set/tests.rs index d7bb9de64..a02d8a4f3 100644 --- a/vendor/indexmap/src/set/tests.rs +++ b/vendor/indexmap/src/set/tests.rs @@ -233,6 +233,18 @@ fn replace_order() { } } +#[test] +fn replace_change() { + // Check pointers to make sure it really changes + let mut set = indexset!(vec![42]); + let old_ptr = set[0].as_ptr(); + let new = set[0].clone(); + let new_ptr = new.as_ptr(); + assert_ne!(old_ptr, new_ptr); + let replaced = set.replace(new).unwrap(); + assert_eq!(replaced.as_ptr(), old_ptr); +} + #[test] fn grow() { let insert = [0, 4, 2, 12, 8, 7, 11]; diff --git a/vendor/is-terminal/.cargo-checksum.json b/vendor/is-terminal/.cargo-checksum.json index a9633aa3e..b4d0a54ac 100644 --- a/vendor/is-terminal/.cargo-checksum.json +++ b/vendor/is-terminal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"5b39dac082469ca2ed9a1df1dfdc80d5d014c7cafc646f8806fe44be4bd665cd","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-MIT-atty":"bab426a663ce3d5bbbcea9cdc300da74e94d76c3c79e46699a953f967a08e533","README.md":"252ffd0e461bf2c22cbedd3b05746cc133a3e9e5426635d6a147e575e8295ec3","src/lib.rs":"e0564f31ae15b98afc4bb0e3e8c60a63698637d2f87df6b0283077734f627af5"},"package":"cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"} \ No newline at end of file +{"files":{"Cargo.toml":"4bf07c8a80b8632eddd10fb9e9c687c47a47c36729b6aa0349927f6a3df18383","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-MIT-atty":"bab426a663ce3d5bbbcea9cdc300da74e94d76c3c79e46699a953f967a08e533","README.md":"252ffd0e461bf2c22cbedd3b05746cc133a3e9e5426635d6a147e575e8295ec3","src/lib.rs":"e0564f31ae15b98afc4bb0e3e8c60a63698637d2f87df6b0283077734f627af5"},"package":"0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"} \ No newline at end of file diff --git a/vendor/is-terminal/Cargo.toml b/vendor/is-terminal/Cargo.toml index 08933a7c1..a1168f2d6 100644 --- a/vendor/is-terminal/Cargo.toml +++ b/vendor/is-terminal/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.63" name = "is-terminal" -version = "0.4.9" +version = "0.4.10" authors = [ "softprops ", "Dan Gohman ", @@ -56,7 +56,7 @@ features = ["stdio"] version = "0.3.0" [target."cfg(windows)".dependencies.windows-sys] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", diff --git a/vendor/itoa/.cargo-checksum.json b/vendor/itoa/.cargo-checksum.json index 0d97ce68f..efd76a8b9 100644 --- a/vendor/itoa/.cargo-checksum.json +++ b/vendor/itoa/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"4df6cfa068258938a81aa6aadeb436552a6823b14efb4471120fb2a79f5e02cc","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"48573443063fa4e0786c3b46f42b6efd1f171c6b73408a64afc1b34de89f31fe","benches/bench.rs":"636f3093bd461210ad3063289d455f90669c4a1be3273bcd30898de39f02c641","src/lib.rs":"9c02e4ae0ea923175fb036799702ff97203f577f5de0e5f4b6c048627775d656","src/udiv128.rs":"d28c1872c37ee2185931babcb20a221b8706a5aa8abc4963419763888023ff17","tests/test.rs":"f7404fc5f7cd1bdaf74a3b64a70d5b30586241ddc1ce2c82bd1b564999fcce0e"},"package":"af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"} \ No newline at end of file +{"files":{"Cargo.toml":"fc26fe5442702edfa4cd1a9b0330aa51043d9f7b6a653decddabdf930543a424","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"48573443063fa4e0786c3b46f42b6efd1f171c6b73408a64afc1b34de89f31fe","benches/bench.rs":"636f3093bd461210ad3063289d455f90669c4a1be3273bcd30898de39f02c641","src/lib.rs":"c4c7f2e0bb9cb5090837629bfa8752e5b6cd537c98947e6ddd9467c81460ea51","src/udiv128.rs":"d28c1872c37ee2185931babcb20a221b8706a5aa8abc4963419763888023ff17","tests/test.rs":"aa1e910573a1d847d39773b4a2e4c597a8d3810070332673df0f6864cab24807"},"package":"b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"} \ No newline at end of file diff --git a/vendor/itoa/Cargo.toml b/vendor/itoa/Cargo.toml index 5173719d2..889aa5d63 100644 --- a/vendor/itoa/Cargo.toml +++ b/vendor/itoa/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.36" name = "itoa" -version = "1.0.9" +version = "1.0.10" authors = ["David Tolnay "] exclude = [ "performance.png", diff --git a/vendor/itoa/src/lib.rs b/vendor/itoa/src/lib.rs index 1683d241a..e2fad15a0 100644 --- a/vendor/itoa/src/lib.rs +++ b/vendor/itoa/src/lib.rs @@ -30,13 +30,14 @@ //! //! ![performance](https://raw.githubusercontent.com/dtolnay/itoa/master/performance.png) -#![doc(html_root_url = "https://docs.rs/itoa/1.0.9")] +#![doc(html_root_url = "https://docs.rs/itoa/1.0.10")] #![no_std] #![allow( clippy::cast_lossless, clippy::cast_possible_truncation, clippy::expl_impl_clone_on_copy, clippy::must_use_candidate, + clippy::needless_doctest_main, clippy::unreadable_literal )] @@ -72,7 +73,7 @@ impl Copy for Buffer {} impl Clone for Buffer { #[inline] - #[allow(clippy::incorrect_clone_impl_on_copy_type)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 + #[allow(clippy::non_canonical_clone_impl)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 fn clone(&self) -> Self { Buffer::new() } diff --git a/vendor/itoa/tests/test.rs b/vendor/itoa/tests/test.rs index 1d7e8cb60..f8275d6e7 100644 --- a/vendor/itoa/tests/test.rs +++ b/vendor/itoa/tests/test.rs @@ -26,4 +26,5 @@ test! { test_u128_0(0u128, "0") test_u128_max(u128::max_value(), "340282366920938463463374607431768211455") test_i128_min(i128::min_value(), "-170141183460469231731687303715884105728") + test_i128_max(i128::max_value(), "170141183460469231731687303715884105727") } diff --git a/vendor/js-sys/.cargo-checksum.json b/vendor/js-sys/.cargo-checksum.json index acd553c5c..3c5367ed3 100644 --- a/vendor/js-sys/.cargo-checksum.json +++ b/vendor/js-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"ced47935f0bc7bb95d90a38fe37cf78ee6e81cb40635fb556012752dc9583e7a","Cargo.toml":"0f72ea563b6d6cbfac19c678457e4d92307bf806e49f529363549784c38143e8","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"de73c6d7a9d9eac0674770fde362175700676be0dfaee0b22d4c75fdc28b068e","src/Temporal.rs":"6c3745bf5cbfbbaee3fabecd870c50669f7a4f1ee65fc96e2baa8f3e440cfe86","src/lib.rs":"5ee5bc3370f921ef11976cd2e6466eb2db723fad875764d3ed4865c4db17d296","tests/headless.js":"dc0fdafb377cd6aa1415897083bbbf3d53c0ca39fc1691cc1f1fa7c528190491","tests/headless.rs":"f9eb68e88cc40fc81b7afad881fbdf2243d574f4417705226aa2102a71187e60","tests/wasm/Array.js":"c21d3d69f388ed4574fa7670c4a41240d0cfa2a374ed29f32f93069983138c72","tests/wasm/Array.rs":"a72124c18addf94bd5a8c96c2f5ee59ba6f387dff404576a5295b52dda96879d","tests/wasm/ArrayBuffer.rs":"a465e7cf7114e7466eb843f6612e22f00eb070dda15759bf8c62a1a3147a8c8d","tests/wasm/ArrayIterator.rs":"d849e50fbb8ebf6979e962c89210cf278176b15198c37f59cb15337e9c30ffa0","tests/wasm/BigInt.rs":"55a8070545f477acea07aebccad1bfd36bac88202923c357f894d6721046f53e","tests/wasm/Boolean.rs":"a7ce23aac1cb7abb83ad92dfaec751cd89f8e5047043667f6cc37d36bbd8cfc3","tests/wasm/DataView.rs":"31c672e3771a9ab17da801c8cd83650d7c1dd8598bb42fbcb78ea42ad5ab8c77","tests/wasm/Date.rs":"4de15246207a5f4c961f448dd18c743aa4ae45950571c9e4ec948272677bf584","tests/wasm/Error.rs":"3d593bdce1dee56fa2c35c290d499d687cc7f08971f89f7aa5f9b52d73af1546","tests/wasm/EvalError.rs":"638641bdd06bb43cffee89d37cd39ee615fe98d44d4c8278756a798a6593111f","tests/wasm/Function.js":"6c5876f74cf2838823470c4c007089baa17e2b28e4f602b65a4b2bc67073b9d7","tests/wasm/Function.rs":"2ccfd94e301b569d70face86d31843d095380973673a811302fb67d8d58378fe","tests/wasm/Generator.js":"7be85b1acbc2de5c3d9d8d64a396baf8c5a5b111905759315b3b395a22ea49e2","tests/wasm/Generator.rs":"860e51ccd01a06076b713445a2eff27244f5b349211a322aa9e3e8df2e76c8ce","tests/wasm/Intl.rs":"93ffd147882daca4f482aaa6d18d013c854dfd0bd3d7631e6128c91e88612cc2","tests/wasm/Iterator.js":"525d29257a508e0cfcf4aa01dddd522d1dda6f8f968f271802ebd703e6f347d6","tests/wasm/Iterator.rs":"b2ac023d150179c0c3cd54f27f9b2775f62ad519111dc233e9ebbad5e9983193","tests/wasm/JSON.rs":"a8bf63aa9cbc64448ad320d88224f435cd2980f980b1c0da3ff1c8c3a935399e","tests/wasm/JsString.js":"931aedd837c316bd7e1e2d52142a92d663e36b79995e2dde6d91c9d762095c13","tests/wasm/JsString.rs":"6aa441665ee43d84b13ec0b021d4544b5b0bdbe2cee2329cfb8a00770964390b","tests/wasm/Map.rs":"022b4c26387190e36726b493615f9852ce40ed0c86a97db85bcf06e9086925f2","tests/wasm/MapIterator.rs":"ed0405dbc9a74885fc3c3614d08d5b7c9da2ad14e4b8d3c5f392ad03e12c61cc","tests/wasm/Math.rs":"0604f28481ac122ee88a5198c2b4f234e3f25e266f73c8e455973d486bcf4768","tests/wasm/Number.js":"a0b161084686deee75588a01834dea2bc12fde317d96bd3a0b73c825db71180f","tests/wasm/Number.rs":"3965a281c43e26659391e02ac7fa76de93ebe582858b53f0ca764e61e922f371","tests/wasm/Object.js":"a8ab74505388012de784b2f62f00a57058632e02a3e4bf70f33fa0e5332ff384","tests/wasm/Object.rs":"c8010cd257ba0a49dc864936104cb19c59f9e7801f5b296d909b772aa1f29fb3","tests/wasm/Promise.rs":"8c62a5c08cb43c60391f94e2d697d8925ba47069e19318a30fa64062ef372c8b","tests/wasm/Proxy.js":"63baac7050190339ed772fed09e4bd1845f34bcc36d7aa40ab2ecf93e9db786a","tests/wasm/Proxy.rs":"02d5ec8e5b781e12cdd96b38e643a4d0f6b725c0c904cc614bc83d829d501035","tests/wasm/RangeError.rs":"00a75d29880f53704c1ede81fb0f5c80efa8528a7c9f75b9f64d25234f74c3a4","tests/wasm/ReferenceError.rs":"47b60df993231f4631de2b9317bc1ac0a968976747f05d9b655dc61bcf2a58b4","tests/wasm/Reflect.js":"e5c43d410802ed45f38bffe60d0313dfcb978ac29a748258e889fbb3efa6d64a","tests/wasm/Reflect.rs":"f8bd8876b6bc1740652d51b6bad948eac7eb49541a08e2fe32a85043f9e0aa65","tests/wasm/RegExp.rs":"f91a9c838921832299185582900df6132dd5263fdcce4cc5342b6a1575d727b7","tests/wasm/Set.rs":"ccd68d9240f52d5129169f999a2d782c29c3e00d77f47521c9c4c3158d4f41cd","tests/wasm/SetIterator.rs":"0ad63f4852adcd91a40ffc1d95bb269e23bc338666acdc85a9516c492d5e1561","tests/wasm/SharedArrayBuffer.js":"6d30cec14dfc5890c8303cd1b81da235bce8a37d730232fc8b0d050f0e1db1b2","tests/wasm/SharedArrayBuffer.rs":"fadefea98f3c61aa5ab04f7f5f182a5f73c3436da39c35e9b48e95e7f57a5100","tests/wasm/Symbol.js":"76c6c15f9fd34ffb7efddc90e898e12be074e9c98e066076a2b46f0554754de2","tests/wasm/Symbol.rs":"ae91d396b867bdfd9fd0c66b8863fb8e5c569886eeec98ae6cbd0ffad1a952a8","tests/wasm/SyntaxError.rs":"526ae9168f4979594e9d44f456e6b2816e38860ebf5937c2c905577aae5be7c0","tests/wasm/Temporal.js":"83312c76bdaa0893b7a6d638ccedb5a3d35f9beeb36977e608a739a81a2f4460","tests/wasm/Temporal.rs":"36423a29a94c0d1a218fe2f34384ddb5ec30c8a812ce8a4635579f0d61496b17","tests/wasm/TypeError.rs":"618530b6556daad348106bd1c48c6dd808f54fe4efb344b15238db4ec3254d9f","tests/wasm/TypedArray.rs":"daaa2eb6336ad3868db6cc27846f2c1c7bac542585236efaee23defb20818002","tests/wasm/UriError.rs":"2e695b4823e8875aa72c41aa6679e4d3f924adf47b763cb4462cf96ecdacfda6","tests/wasm/WeakMap.rs":"930498b116924eda0d40ea11c73adbfc049ffd0f11e259f1faf29e090eeea853","tests/wasm/WeakSet.rs":"59c80b6ac0f60fe8499884ee4842b8a4f12039c6c29c58a329e85c187d42c94c","tests/wasm/WebAssembly.js":"5870c3811c8c17bab0b0e14c5ed62af987b8fa52382572a27cf704cded30f061","tests/wasm/WebAssembly.rs":"7d1ed7efb9fc8d052eea2c589a5f3e22f93933c67987b312bbf7eeac0a3afa43","tests/wasm/global_fns.rs":"34e12bfd548b8710297087920599d97e31971d142a8b0c4acb5712f71f1213d3","tests/wasm/main.rs":"e07b9a62897df33dba3d0962f403b19574d5cd99cd2e08e316be364c7a73d7e7"},"package":"cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca"} \ No newline at end of file +{"files":{"CHANGELOG.md":"ced47935f0bc7bb95d90a38fe37cf78ee6e81cb40635fb556012752dc9583e7a","Cargo.toml":"cd74be7dee8e14f1b2b89fa082067c9add8f5bbfc185a2aa1a1a2b160aaea970","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"de73c6d7a9d9eac0674770fde362175700676be0dfaee0b22d4c75fdc28b068e","src/Temporal.rs":"6c3745bf5cbfbbaee3fabecd870c50669f7a4f1ee65fc96e2baa8f3e440cfe86","src/lib.rs":"5ee5bc3370f921ef11976cd2e6466eb2db723fad875764d3ed4865c4db17d296","tests/headless.js":"dc0fdafb377cd6aa1415897083bbbf3d53c0ca39fc1691cc1f1fa7c528190491","tests/headless.rs":"f9eb68e88cc40fc81b7afad881fbdf2243d574f4417705226aa2102a71187e60","tests/wasm/Array.js":"c21d3d69f388ed4574fa7670c4a41240d0cfa2a374ed29f32f93069983138c72","tests/wasm/Array.rs":"a72124c18addf94bd5a8c96c2f5ee59ba6f387dff404576a5295b52dda96879d","tests/wasm/ArrayBuffer.rs":"a465e7cf7114e7466eb843f6612e22f00eb070dda15759bf8c62a1a3147a8c8d","tests/wasm/ArrayIterator.rs":"d849e50fbb8ebf6979e962c89210cf278176b15198c37f59cb15337e9c30ffa0","tests/wasm/BigInt.rs":"55a8070545f477acea07aebccad1bfd36bac88202923c357f894d6721046f53e","tests/wasm/Boolean.rs":"a7ce23aac1cb7abb83ad92dfaec751cd89f8e5047043667f6cc37d36bbd8cfc3","tests/wasm/DataView.rs":"31c672e3771a9ab17da801c8cd83650d7c1dd8598bb42fbcb78ea42ad5ab8c77","tests/wasm/Date.rs":"4de15246207a5f4c961f448dd18c743aa4ae45950571c9e4ec948272677bf584","tests/wasm/Error.rs":"3d593bdce1dee56fa2c35c290d499d687cc7f08971f89f7aa5f9b52d73af1546","tests/wasm/EvalError.rs":"638641bdd06bb43cffee89d37cd39ee615fe98d44d4c8278756a798a6593111f","tests/wasm/Function.js":"6c5876f74cf2838823470c4c007089baa17e2b28e4f602b65a4b2bc67073b9d7","tests/wasm/Function.rs":"2ccfd94e301b569d70face86d31843d095380973673a811302fb67d8d58378fe","tests/wasm/Generator.js":"7be85b1acbc2de5c3d9d8d64a396baf8c5a5b111905759315b3b395a22ea49e2","tests/wasm/Generator.rs":"860e51ccd01a06076b713445a2eff27244f5b349211a322aa9e3e8df2e76c8ce","tests/wasm/Intl.rs":"93ffd147882daca4f482aaa6d18d013c854dfd0bd3d7631e6128c91e88612cc2","tests/wasm/Iterator.js":"525d29257a508e0cfcf4aa01dddd522d1dda6f8f968f271802ebd703e6f347d6","tests/wasm/Iterator.rs":"b2ac023d150179c0c3cd54f27f9b2775f62ad519111dc233e9ebbad5e9983193","tests/wasm/JSON.rs":"a8bf63aa9cbc64448ad320d88224f435cd2980f980b1c0da3ff1c8c3a935399e","tests/wasm/JsString.js":"931aedd837c316bd7e1e2d52142a92d663e36b79995e2dde6d91c9d762095c13","tests/wasm/JsString.rs":"6aa441665ee43d84b13ec0b021d4544b5b0bdbe2cee2329cfb8a00770964390b","tests/wasm/Map.rs":"022b4c26387190e36726b493615f9852ce40ed0c86a97db85bcf06e9086925f2","tests/wasm/MapIterator.rs":"ed0405dbc9a74885fc3c3614d08d5b7c9da2ad14e4b8d3c5f392ad03e12c61cc","tests/wasm/Math.rs":"0604f28481ac122ee88a5198c2b4f234e3f25e266f73c8e455973d486bcf4768","tests/wasm/Number.js":"a0b161084686deee75588a01834dea2bc12fde317d96bd3a0b73c825db71180f","tests/wasm/Number.rs":"3965a281c43e26659391e02ac7fa76de93ebe582858b53f0ca764e61e922f371","tests/wasm/Object.js":"a8ab74505388012de784b2f62f00a57058632e02a3e4bf70f33fa0e5332ff384","tests/wasm/Object.rs":"c8010cd257ba0a49dc864936104cb19c59f9e7801f5b296d909b772aa1f29fb3","tests/wasm/Promise.rs":"8c62a5c08cb43c60391f94e2d697d8925ba47069e19318a30fa64062ef372c8b","tests/wasm/Proxy.js":"63baac7050190339ed772fed09e4bd1845f34bcc36d7aa40ab2ecf93e9db786a","tests/wasm/Proxy.rs":"02d5ec8e5b781e12cdd96b38e643a4d0f6b725c0c904cc614bc83d829d501035","tests/wasm/RangeError.rs":"00a75d29880f53704c1ede81fb0f5c80efa8528a7c9f75b9f64d25234f74c3a4","tests/wasm/ReferenceError.rs":"47b60df993231f4631de2b9317bc1ac0a968976747f05d9b655dc61bcf2a58b4","tests/wasm/Reflect.js":"e5c43d410802ed45f38bffe60d0313dfcb978ac29a748258e889fbb3efa6d64a","tests/wasm/Reflect.rs":"f8bd8876b6bc1740652d51b6bad948eac7eb49541a08e2fe32a85043f9e0aa65","tests/wasm/RegExp.rs":"f91a9c838921832299185582900df6132dd5263fdcce4cc5342b6a1575d727b7","tests/wasm/Set.rs":"ccd68d9240f52d5129169f999a2d782c29c3e00d77f47521c9c4c3158d4f41cd","tests/wasm/SetIterator.rs":"0ad63f4852adcd91a40ffc1d95bb269e23bc338666acdc85a9516c492d5e1561","tests/wasm/SharedArrayBuffer.js":"6d30cec14dfc5890c8303cd1b81da235bce8a37d730232fc8b0d050f0e1db1b2","tests/wasm/SharedArrayBuffer.rs":"fadefea98f3c61aa5ab04f7f5f182a5f73c3436da39c35e9b48e95e7f57a5100","tests/wasm/Symbol.js":"76c6c15f9fd34ffb7efddc90e898e12be074e9c98e066076a2b46f0554754de2","tests/wasm/Symbol.rs":"ae91d396b867bdfd9fd0c66b8863fb8e5c569886eeec98ae6cbd0ffad1a952a8","tests/wasm/SyntaxError.rs":"526ae9168f4979594e9d44f456e6b2816e38860ebf5937c2c905577aae5be7c0","tests/wasm/Temporal.js":"83312c76bdaa0893b7a6d638ccedb5a3d35f9beeb36977e608a739a81a2f4460","tests/wasm/Temporal.rs":"36423a29a94c0d1a218fe2f34384ddb5ec30c8a812ce8a4635579f0d61496b17","tests/wasm/TypeError.rs":"618530b6556daad348106bd1c48c6dd808f54fe4efb344b15238db4ec3254d9f","tests/wasm/TypedArray.rs":"daaa2eb6336ad3868db6cc27846f2c1c7bac542585236efaee23defb20818002","tests/wasm/UriError.rs":"2e695b4823e8875aa72c41aa6679e4d3f924adf47b763cb4462cf96ecdacfda6","tests/wasm/WeakMap.rs":"930498b116924eda0d40ea11c73adbfc049ffd0f11e259f1faf29e090eeea853","tests/wasm/WeakSet.rs":"59c80b6ac0f60fe8499884ee4842b8a4f12039c6c29c58a329e85c187d42c94c","tests/wasm/WebAssembly.js":"5870c3811c8c17bab0b0e14c5ed62af987b8fa52382572a27cf704cded30f061","tests/wasm/WebAssembly.rs":"7d1ed7efb9fc8d052eea2c589a5f3e22f93933c67987b312bbf7eeac0a3afa43","tests/wasm/global_fns.rs":"34e12bfd548b8710297087920599d97e31971d142a8b0c4acb5712f71f1213d3","tests/wasm/main.rs":"e07b9a62897df33dba3d0962f403b19574d5cd99cd2e08e316be364c7a73d7e7"},"package":"9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1"} \ No newline at end of file diff --git a/vendor/js-sys/Cargo.toml b/vendor/js-sys/Cargo.toml index 79f6e3e51..8d524e5cd 100644 --- a/vendor/js-sys/Cargo.toml +++ b/vendor/js-sys/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.57" name = "js-sys" -version = "0.3.66" +version = "0.3.67" authors = ["The wasm-bindgen Developers"] description = """ Bindings for all JS global objects and functions in all JS environments like @@ -32,16 +32,16 @@ test = false doctest = false [dependencies.wasm-bindgen] -version = "0.2.89" +version = "0.2.90" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-futures] -version = "0.4.39" +version = "0.4.40" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-test] -version = "=0.3.39" +version = "=0.3.40" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.web-sys] -version = "0.3.66" +version = "0.3.67" features = [ "Headers", "Response", diff --git a/vendor/libc/.cargo-checksum.json b/vendor/libc/.cargo-checksum.json index ea288caf8..f2b650512 100644 --- a/vendor/libc/.cargo-checksum.json +++ b/vendor/libc/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CONTRIBUTING.md":"bdc90b52cf803faac96e594069a86dd8ea150d5ba7fb3e6cadfc08dac4c7b0ce","Cargo.toml":"f4493f3fbb5476b37c7fe2210b5c76789115520ceb971de862dc13bb35b353fa","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"4188dac195bf9f4ef9c2b5608273dd31d869adf584d745d46773b627d07d3a18","build.rs":"1c29e9469ff1fc78dea3001aa812ab2c9c2bb2d724b98dccedd9ac6e4396061b","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"893fcec48142d273063ffd814dca33fbec92205fd39ada97075f85201d803996","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"baa0b7c7fadcee5ea91a693138a214de17eed1c592096035a9f4c565ecea9d92","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/riscv64.rs":"617cd75e79e0e20f664db764a4dc2a396d9fd11a4d95371acd91ed4811293b11","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"2d04cfa0d55dc0a2e36fdc4a45819b9d3722af19bb1932778b44feb4c2f81036","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"9d7030ba3e21064a0f3a8e79927c70d5a95a0026be61be084f3ab021e243e503","src/macros.rs":"b457eb028b8e8ab3c24bb7292b874ad4e491edbb83594f6a3da024df5348c088","src/psp.rs":"dd31aabd46171d474ec5828372e28588935120e7355c90c105360d8fa9264c1c","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/teeos/mod.rs":"6d372bb8a058f8749d8d9c4fb6aa3badb8b1ada027dea6043d0ad46c3a831bbf","src/unix/aix/mod.rs":"cf9261bac2ae484ed6b525026674f62d0be34a70668ee0954ce5b514dc20cea0","src/unix/aix/powerpc64.rs":"cf374d81139d45f9d77c6a764f640bfbf7e0a5903689652c8296f8e10d55169b","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"2eaf0f561a32bdcbf4e0477c8895d5e7bcb5cdebd5fef7b4df2ca8e38e144d94","src/unix/bsd/apple/b64/aarch64/mod.rs":"44c217a4f263afe7a97435de9323d20a96c37836f899ca0925306d4b7e073c27","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/long_array.rs":"3cf1f19b812e6d093c819dc65ce55b13491963e0780eda0d0bd1577603e81948","src/unix/bsd/apple/mod.rs":"673e44f65238503b4cd62326775fb30edcbc19a10d8970cd8023cbe030884717","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"2777f94909a798df1b8030fb86d02e2118d0ac3e49e9a542df54a569ca5ae2f9","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"6c8e216385f53a4bf5f171749b57602fc34a4e4b160a44ca31c058cb0c8a2126","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"e243ae0e89623d4fa9f85afe14369cc5fd5f2028ea715773dbec722ba80dac1f","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"bef9fae288a4f29e941ea369be1cd20b170040e60665a4d49a4a9e79009b72d8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"3c514e037694ce22724abb3c9c4687defda7f0e3456b615ca73593e860e38b16","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"318abe48bfdd1c74ecd6afbd6c9329c5c72ce4f7d420edd6be2fc12b223ae32f","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/mod.rs":"32c9085886df9d5eb78f92b5705df3f154c496298d22906f17debb4bb23d6ad9","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"fa4bed4c58cad24ba3395941c7fa6b11e089551a04714f9561078e400f5b2b62","src/unix/bsd/freebsdlike/freebsd/x86.rs":"6766e2ce85e187b306cd3b0b8d7e15b8f4042c5cff81d89b3af69ecc99c70ab0","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"401f00805531ea3e37d648aa10cd4120a4ad3f970199bf388942023f552e3729","src/unix/bsd/mod.rs":"dad51a24a524e92bfe9de3ac3b7d394d86058b9b8a1ccd4efa9bbb5c78e7fa1a","src/unix/bsd/netbsdlike/mod.rs":"779d73f4249f1bf76fbc603d07c0cfd48918d9e5cad71c18b50ecc421a27fc25","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"65dcb58d11e8d8028401a9d07ca3eb4cb4f053e04249cc877353449d84ccc4cb","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mips.rs":"88be18ac43ba224c77e78e4179b6761debc5e6c30a258fac56263809c7af4fbc","src/unix/bsd/netbsdlike/netbsd/mod.rs":"1ec48b98a40a3cd07d5a21fbc20b14735bf827af802d9df809d477f9939494ed","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"1cbe2e5ed681cb1054b699da37daaf6c714267df7d332c90fc2a589b11579625","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"1afe5ef46b14397cdd68664b5b232e4f5b035b6db1d4cf411c899d51ebca9f30","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"b2167eeb506765688edea266f437fe730e6f04e7a11da2434ea57acc5c471bfd","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"3526293942482ad5368f02aa45c961ad4482be8e8a547226ea5a020364a602dc","src/unix/haiku/native.rs":"dbfcbf4954a79d1df2ff58e0590bbcb8c57dfc7a32392aa73ee4726b66bd6cc8","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hurd/align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/hurd/b32.rs":"851f7e1ad0ca4e44628292e203755624f41e0cbccd64e6f70802f01f6fd4c6dc","src/unix/hurd/b64.rs":"0c957bd3c8e2cf1ad6723fa2c98b5340571c3dcee44fc5cdd9e9a7148ef23a61","src/unix/hurd/mod.rs":"cafda79b3f48d6d088e3fe65a8e3a11af07efd643a129ee980517befc704613c","src/unix/hurd/no_align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/linux_like/android/b32/arm.rs":"ce582de7e983a33d3bfad13075c53aac9016cee35f06ad8653ee9072c3ec2564","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"e6d107efbcd37b5b85dfa18f683300cbf768ffa0237997a9fa52b184a53323ac","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"10e963e29ff209703de6336c99cca96fd79789438d34c82a693eae56e8916c3c","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"19d4bf2237c47127eba9144e0b82e995bc079315e719179a91813b0ae7b0e49d","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"4ec2de11a9b65c4325b7b991f0b99a414975e0e61ba8668caca5d921e9b314d1","src/unix/linux_like/android/mod.rs":"62b53a05057c432268730babaa15a968e9b5823b68386502104bf015a9602212","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/lfs64.rs":"3776af30a758d765a88920ec4fde442ab89040da13d3b3625c7fbcb8a958559f","src/unix/linux_like/emscripten/mod.rs":"e447d3f5e5840c0431496359164e724a8f254c68483ef842192b44e9f237d020","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"bc5abcd38e2320171e0981e773c9c5fe3e0d5a66fdff049228f6a1acad80ef8b","src/unix/linux_like/linux/arch/generic/mod.rs":"55ed968a3b656a6e0c67759ac3637a6b3ba2c1001333e23bd7a2f95ce8ba6563","src/unix/linux_like/linux/arch/mips/mod.rs":"b81b4cd040360a77079597ca221159fb17461145786ebfff4d979ae0b0c3344a","src/unix/linux_like/linux/arch/mod.rs":"5bd5361f8a6ab4e18bbba6da9f92c164ae252b15a0ed10064812544aa1fdf198","src/unix/linux_like/linux/arch/powerpc/mod.rs":"e868a956f7c982b6dfbd56962c5f6803d0b9af3b2e977ce56501e3edbc233ce7","src/unix/linux_like/linux/arch/sparc/mod.rs":"737e3b4554e132d88700f3cd35aad60a1a5308ad295b87569a15c0b0b6cb6d48","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"b0528b4f3a80286fd28f94447a100d4455f0150f52e5a08cfedf6ebfce6073e1","src/unix/linux_like/linux/gnu/b32/csky/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"f3231dfdd81d33170976cffcceac67e52b20c4be163b60f15c6f96a8d645d4a8","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"80956d3fef163ecf248828a6f38782dd8ae856d86b1bb5aac2de36032dbd8ea0","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"96e22350d5d132d917c743d6560464500652c67b52c3d0e8474494487df3365d","src/unix/linux_like/linux/gnu/b32/mod.rs":"b56625dd20dd48a8699034d349ef089c540c0ddcbf8a3481d598d101f8b40b78","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"20fc3cc4fe1ef6617b63b61b897f782ceb9c2842fc718f504a1840537229bf47","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"887288a0a1cfff319d0e15edcdc4fcb31fd643ff41715ec5244c8f2413624169","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"cc4342b949e4d796f304acd9dfe3f721a1c2f37fec16b42d3bb27dc94723af37","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"977ff325dfadca1c022a80b7c74874702476ae09d34f894d5fde8e47af2aff2a","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"fdf1c72375a2167699157e0dd825422690bb6719f7bc69515a2e5846d0431d7c","src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs":"832e7487249c1c0bb6e9911ce3f7d32ca22378e42392ab83c56915cbc59d8be3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"bf4611b737813deef6787babf6c01698605f3b75482269b8546318667bc68e29","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"11a950697fdda0258c6e37c6b13993348c8de4134105ed4faa79358e53175072","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"40bf13c157bfc487682c62dae4bc49b58733076cc4ce55a32f51a5ed8f4cc068","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"060aa33cc737966c691aab8511c5c5729e551458ce18d0e284e0d45f39beeb60","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"dc29dfdadd754ec355b82a7ca6636de7ed97f7ba98f132b71cb49f39d6bd8e3f","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"73532be4b5775acf9524c77feeefe1f6d1936ceffef908d01dd2586986520f2d","src/unix/linux_like/linux/gnu/b64/mod.rs":"6a160ef25439c4fecdb0e3bd0b818742263c791364da874d4febd3aa644ec8e2","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"a90c2641616c620e9d1fea87695ce046e14f9da2282bb93f761eeb4077c74741","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"68a2a20fa4ef92cdf382d8095168eb88875b7aa8c9c47ee5f1e527393b6c16fa","src/unix/linux_like/linux/gnu/b64/s390x.rs":"1ea9e39432ce6bf68779d33546dacd7d39477a9f8fc3da4f4f339e4538cb74c3","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"bed381c44cec2a5b50125f7e548ab487d4c829006c971d152a611b7141760052","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"88b7b233db058fd0c7627bd318e43ec9508f89970f21de9df245ca006bba8b45","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"38f74ce15d9662ce4818815a2b87be1618d5e45f190f7e4db84ff3285b4421fb","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"b20218a11364a6dec87f96d6c0d8b19e660697ab09ad5ee0e9b3a9dafedaaebb","src/unix/linux_like/linux/gnu/mod.rs":"62cbad4e582706ec7d26b88047728beb3a8e928513e1648dac8d89376a4f0dd2","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"2e57887807020772c455397d8d5467acbae336df54ea29e1e024d06d08fb3c9e","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"af10147d7c3661751750a58ffad089d5d18d180cd18303c653aef126c07ccd91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"d079cab42529f7dab699334d43168c74ff4aa0282f11040a8b7d274b65767a7a","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"e44043766f7cd26de7ffa4232654afb6feb03e58dbd5890717970887bd003151","src/unix/linux_like/linux/musl/b32/mod.rs":"31677597fd9544c4b1ec1477628288f6273fabbc06e38f33da862ad55f019ce1","src/unix/linux_like/linux/musl/b32/powerpc.rs":"3dae56a4e7789bcc5314e419fea5e4b2495367b4f1a49d1c9477c60225d65eef","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"3ee845d272f91a1908d5f421d7c353e1f14681bbdfef64410e408f4c14365a91","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"4e99b080ca830e50370b596e36a96b6b024dd974c32a881e42fa51cee54a4454","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"45ce6897afcc960267bb7505702b639daf94dc69428a213bf1aefd367ca32adc","src/unix/linux_like/linux/musl/b64/mips64.rs":"a968ef9c54fa22293085f318c8472c1754482df92cc500568dc33bd807d71ea6","src/unix/linux_like/linux/musl/b64/mod.rs":"1a8391febf3e750185ffc5c69c9f9e411f4e8c53b5d994cb231df24480169686","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"140e579800a67315f4cb8a42b22aa8157eae34ffe626e77e421b43c53c23b34d","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"c5944526d7e19cd43e9d14d119a1d98f8780db7ecbcc79e69d7b9348e596b520","src/unix/linux_like/linux/musl/b64/s390x.rs":"8557b3477ca8cefef7fce764a3c25441929a54e50ead4091f6f7823c427cd728","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"a91c4f18027c9958037f78ae48f6352d23cb4e6f2995b2cc8de7dce0e5759470","src/unix/linux_like/linux/musl/lfs64.rs":"3e4fb381f3a0756520bde0f1692d4fa45e4ae8133bf7d7c64b0e3fdd512f235f","src/unix/linux_like/linux/musl/mod.rs":"48f671493a0a144d725914494716946e4236190e1207022d3753f5a35464babb","src/unix/linux_like/linux/no_align.rs":"62cdca0e011937aaf09a51ca86d9f0ee0fdb05f61ec3c058e6a5d5fa6357d784","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"50288ff9e411ab0966da24838f2c2a5618021bc19c422a04f577b2979ef4081e","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"d0c4434e2bf813372c418a8f516c706cdccc9f7be2f0921b2207b0afdb66fe81","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3f38ee6a4690b9d7594be20d216467a34d955f7653c2c8ce1e6147daeb53f1e0","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"a048fce1c2d9b1ad57305642e8ad05ca0f0c7e4753267a2e2d6b4fee5db3b072","src/unix/linux_like/linux/uclibc/mod.rs":"ea1a93363329a2225efc0423ff904a8bd4ff827d4d42e5e29b807b7a9927a7bc","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"024eba5753e852dbdd212427351affe7e83f9916c1864bce414d7aa2618f192e","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"196d03affbefb85716937c15904831e731eb222ee906e05e42102d639a8152ea","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"26321ca3d882a7a5b88c83f6019801324474f1a0df5adabb2e0d3a65a483f5cd","src/unix/mod.rs":"2c778b44b07a66151898caeb4b3a70d43dfbb84177ce3c30d1382f3b21644dfe","src/unix/newlib/aarch64/mod.rs":"964c096288da836b53c0c71d7f3a97048d177da220a69314c5ce93ba330d72af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cf754f8b1197489fca01e881a4b4b146e814998e4b365f116fa1a102c00e6a4e","src/unix/newlib/espidf/mod.rs":"29969da41f0042197b21cfa7c0ad2244b4519ecab0fb7de3d0a7655b4f3937e1","src/unix/newlib/generic.rs":"5f0b5d07ddb5a5d60580f9561fdb05e9218d9751d4068c4aadad2ba6b950aabf","src/unix/newlib/horizon/mod.rs":"3a521d22bf932fc01c1d26d1f9bff20f11b1855b03c8236a8eb18310f6cab5a8","src/unix/newlib/mod.rs":"e5d5faf27a6336b9f1c02b8726427801d906a14dae766852b4e85c1a92df06c8","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"cc9e188711b9bf614323ad6c48e0d2e1a1ecc5d3bc64961ba451f29c6c22d2d8","src/unix/newlib/vita/mod.rs":"d849a01841744ea5e04635c8f69c9e2b44791320eb9d629b9d0fee0a4c5d502a","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/nto/aarch64.rs":"4709c9afdc8d583be876598e7c238499ee3e8da5bd2baa614d9c7dd414851555","src/unix/nto/mod.rs":"8cacb926904eb9c901ba27d9914e62b7d5e88fc1001cdf0e392666e0f331f327","src/unix/nto/neutrino.rs":"799bff4ab01a6424db6c5a2b76aa5679826d41495f9d13c63485bf13bc80026b","src/unix/nto/x86_64.rs":"a3e18e93c2999da1cd7a6f748a4b60c07aefb73d8ea2aafec19a84cfb040bc8e","src/unix/redox/mod.rs":"3b7f61e747b05fe2ddd600698d51ddac689532d3a925dcbbd611835089b4ae9b","src/unix/solarish/compat.rs":"00f1ee3faec9da69204e42f025f6735dd13d894071a154425dcc43ecbdd06e7f","src/unix/solarish/illumos.rs":"cd93c2d84722bbf9933a92842a8998eb0b2afc962f50bc2546ad127b82809fa7","src/unix/solarish/mod.rs":"b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14","src/unix/solarish/solaris.rs":"41b350a89ddf01cd12a10f93640f92be53be0b0d976021cdc08da17bf3e72edf","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"ec2b01f194eb8a6a27133c57681da195a949e03098f3ea1e847227a9c09ef5fc","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"444249bebf289c9ec34e62332c13c7e716f8093c73faf95d5eee3ab7e40d6d85","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"09ee3b3348b212b050f6ca8ae008a28679ea44a375674307a4e7c9ca0d3ed7d5","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"9fdc5e1c62c441abef7bc62a7343efb2041edc24db9ac0efc0f74df55b69e249","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","src/xous.rs":"eb0675f25ba01f73072d2b70907fb8abb1148facefe5a20756c49250f3d65fae","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"} \ No newline at end of file +{"files":{"CONTRIBUTING.md":"a93fcda0a76e1975fcfb0aa2ba00c9b1864f9ae6062704a294d81a3688898e10","Cargo.toml":"c7d137b327d60cad5b7bd3ef97ec93f57fdde1101b14250b56fe1a1d3afc98ef","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"4da2919bb509f3f06163778478494f780ca6627cb79ccab5d2c828c8d88dc133","build.rs":"01bc1b8934bb80982a36f46c61508f32cb05c4deab15cb9afb5bf9da285d5c1b","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"893fcec48142d273063ffd814dca33fbec92205fd39ada97075f85201d803996","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"07410f511835da540e5bdc55f7384c71cd7836fe63bbca6be547de825f823c03","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/riscv64.rs":"617cd75e79e0e20f664db764a4dc2a396d9fd11a4d95371acd91ed4811293b11","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"2d04cfa0d55dc0a2e36fdc4a45819b9d3722af19bb1932778b44feb4c2f81036","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"9d7030ba3e21064a0f3a8e79927c70d5a95a0026be61be084f3ab021e243e503","src/macros.rs":"5f985b3de7b18833f866bf832b8ffb0430f0f70aa9a468b6a2c855c1bf9d33e4","src/psp.rs":"0a7d5121a8cc2903009f586c00e4ae2d6126d24eb90531dafaba6f59823aa6b2","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/teeos/mod.rs":"eb664b3e94bcd44d8c8147b56c2187139d01bf8402ee0bb81967a5a50a3e927f","src/unix/aix/mod.rs":"d4ed2a4eff43c60a251bba150868d0249bf79dd6fb835d5287c352577452712b","src/unix/aix/powerpc64.rs":"cf374d81139d45f9d77c6a764f640bfbf7e0a5903689652c8296f8e10d55169b","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"2eaf0f561a32bdcbf4e0477c8895d5e7bcb5cdebd5fef7b4df2ca8e38e144d94","src/unix/bsd/apple/b64/aarch64/mod.rs":"44c217a4f263afe7a97435de9323d20a96c37836f899ca0925306d4b7e073c27","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/long_array.rs":"3cf1f19b812e6d093c819dc65ce55b13491963e0780eda0d0bd1577603e81948","src/unix/bsd/apple/mod.rs":"1da404688e9d67171403f2486456aac9d36a2db31ee7ebc308f14d6277754eef","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"2777f94909a798df1b8030fb86d02e2118d0ac3e49e9a542df54a569ca5ae2f9","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"6c8e216385f53a4bf5f171749b57602fc34a4e4b160a44ca31c058cb0c8a2126","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"e243ae0e89623d4fa9f85afe14369cc5fd5f2028ea715773dbec722ba80dac1f","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"bef9fae288a4f29e941ea369be1cd20b170040e60665a4d49a4a9e79009b72d8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"88be47524b28b6635ccb1e85ea511bf17337be0af7e9baa740c341ac9e83a6f7","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"6ddc6abf6d5ccaea0d8cccf521e8ca6457efcad3086af4155628d5d06d672346","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs":"93115c1a9faa43ebf58b7dee3582aed5a54291b284764e370e7f649b2e6a9565","src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/mod.rs":"5669c341804bccf27eb03965f11bd640a762a9898a5baa18b5a319fb1d8abddf","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"fa4bed4c58cad24ba3395941c7fa6b11e089551a04714f9561078e400f5b2b62","src/unix/bsd/freebsdlike/freebsd/x86.rs":"6766e2ce85e187b306cd3b0b8d7e15b8f4042c5cff81d89b3af69ecc99c70ab0","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"29f5ae7c8bcd64219e77f99ba9b26527299cf4908b20f7d1ec4f625b5194a44c","src/unix/bsd/mod.rs":"f5974098ef3d1a29774bc0bde27dc9c89c3880f9ed7b4d7ea334b595dc39ff94","src/unix/bsd/netbsdlike/mod.rs":"ea60540aa4edd4e43136749d5df497b1dc072b9912b6030dd1ab794a6d1c3c3c","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"057ee877db7193ba0dc10801b9a6563ac6dbdb78376d6851a84cb12b30841759","src/unix/bsd/netbsdlike/netbsd/arm.rs":"949b55e4dee1c8c511f4f061a6a57ac876a6c0eabfaf5cc20e9ab40d8f41b2e0","src/unix/bsd/netbsdlike/netbsd/mips.rs":"88be18ac43ba224c77e78e4179b6761debc5e6c30a258fac56263809c7af4fbc","src/unix/bsd/netbsdlike/netbsd/mod.rs":"b8d6f089fc8eb2cb59e45335a26c9ce871b846216c9859b553c6b91982f8de33","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"1cbe2e5ed681cb1054b699da37daaf6c714267df7d332c90fc2a589b11579625","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"532b76199d6c71ff996eade9f906c55a72c9aff489595d25a21e21878cfd740b","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"7b93b5b24b3c72a79b2de19b47ac2f56b29d87e9fc8f4c721a63d1e87ec83fcc","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1fe3332dc705a13e6242219970f5449d6d7a73e2e6c8537ab8e421d8a6f2e3ff","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"ad70cc42ed83ac38664941418b0b9bfe1ead7a0ff82b121ea8df65483e3b7e1c","src/unix/haiku/native.rs":"3bbf42c3e3e437e8b626be67c72b6adcec60646eb5dd4bf8471a603cbbb5e5a4","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hurd/align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/hurd/b32.rs":"2ba90ed973f90366c36a6387833a3df42abfee9622d4a0352635937d4a89eaf4","src/unix/hurd/b64.rs":"d919b4aec9b3080ad24c125c57b2c8b2e483d72045f1554c429d14560355846f","src/unix/hurd/mod.rs":"6a2f0db80a3cd34b55ef82e357da4d453d5d190a2dd4501bfa5d0bb9bca0de4f","src/unix/hurd/no_align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/linux_like/android/b32/arm.rs":"ce582de7e983a33d3bfad13075c53aac9016cee35f06ad8653ee9072c3ec2564","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"e6d107efbcd37b5b85dfa18f683300cbf768ffa0237997a9fa52b184a53323ac","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"10e963e29ff209703de6336c99cca96fd79789438d34c82a693eae56e8916c3c","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"19d4bf2237c47127eba9144e0b82e995bc079315e719179a91813b0ae7b0e49d","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"4ec2de11a9b65c4325b7b991f0b99a414975e0e61ba8668caca5d921e9b314d1","src/unix/linux_like/android/mod.rs":"5f923c89c8fd6a672d695ddd690aeac6a025c947f565acbd829c0e69d72ca049","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/lfs64.rs":"3776af30a758d765a88920ec4fde442ab89040da13d3b3625c7fbcb8a958559f","src/unix/linux_like/emscripten/mod.rs":"70d4591730a731ee32788a9d8d2de379592844ec36b7d1723514179605587713","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"bc5abcd38e2320171e0981e773c9c5fe3e0d5a66fdff049228f6a1acad80ef8b","src/unix/linux_like/linux/arch/generic/mod.rs":"feff53cb116f60c302121f9a5701adf1e2a16ff7d52a6de161fe58a28553f870","src/unix/linux_like/linux/arch/mips/mod.rs":"18dade308bf04717630fd6467b92c23560c83ac5274a8469569f260aa4671239","src/unix/linux_like/linux/arch/mod.rs":"5bd5361f8a6ab4e18bbba6da9f92c164ae252b15a0ed10064812544aa1fdf198","src/unix/linux_like/linux/arch/powerpc/mod.rs":"0bc2d2667a00eca81f4abeb6d613a90848a947f51224103f83268928b8197629","src/unix/linux_like/linux/arch/sparc/mod.rs":"5e6777863e74a9e2aa9dc487f1059783dd211babc2b32d6bf676f311e49c55d6","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"f68ec59b6407f9d4e326f3e71a41ec21f19ecfc703edf9a93e496f661fed5506","src/unix/linux_like/linux/gnu/b32/csky/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"8729b68e433e94c2128e51a7db4fd555938e4be4dc64584c352b24a20d9c8e91","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"80956d3fef163ecf248828a6f38782dd8ae856d86b1bb5aac2de36032dbd8ea0","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"96e22350d5d132d917c743d6560464500652c67b52c3d0e8474494487df3365d","src/unix/linux_like/linux/gnu/b32/mod.rs":"b56625dd20dd48a8699034d349ef089c540c0ddcbf8a3481d598d101f8b40b78","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"20fc3cc4fe1ef6617b63b61b897f782ceb9c2842fc718f504a1840537229bf47","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"887288a0a1cfff319d0e15edcdc4fcb31fd643ff41715ec5244c8f2413624169","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"cc4342b949e4d796f304acd9dfe3f721a1c2f37fec16b42d3bb27dc94723af37","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"06d4db4ee8352f62a0a5ead0c4d6ea0a78feff522f19b9bc5772f6dd920ffd80","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"fdf1c72375a2167699157e0dd825422690bb6719f7bc69515a2e5846d0431d7c","src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs":"832e7487249c1c0bb6e9911ce3f7d32ca22378e42392ab83c56915cbc59d8be3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"bf4611b737813deef6787babf6c01698605f3b75482269b8546318667bc68e29","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"11a950697fdda0258c6e37c6b13993348c8de4134105ed4faa79358e53175072","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"8202614484da36c388d2ffdd2554c56bb4f9db8e5bd621f8c36114cdcfeec644","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"060aa33cc737966c691aab8511c5c5729e551458ce18d0e284e0d45f39beeb60","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"dc29dfdadd754ec355b82a7ca6636de7ed97f7ba98f132b71cb49f39d6bd8e3f","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"73532be4b5775acf9524c77feeefe1f6d1936ceffef908d01dd2586986520f2d","src/unix/linux_like/linux/gnu/b64/mod.rs":"6a160ef25439c4fecdb0e3bd0b818742263c791364da874d4febd3aa644ec8e2","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"a90c2641616c620e9d1fea87695ce046e14f9da2282bb93f761eeb4077c74741","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"68a2a20fa4ef92cdf382d8095168eb88875b7aa8c9c47ee5f1e527393b6c16fa","src/unix/linux_like/linux/gnu/b64/s390x.rs":"1ea9e39432ce6bf68779d33546dacd7d39477a9f8fc3da4f4f339e4538cb74c3","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"bed381c44cec2a5b50125f7e548ab487d4c829006c971d152a611b7141760052","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"332846e4a5920d7e6b05df0448a2333c5dd00fb27cb33654648f507ee89dbec5","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"38f74ce15d9662ce4818815a2b87be1618d5e45f190f7e4db84ff3285b4421fb","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"b20218a11364a6dec87f96d6c0d8b19e660697ab09ad5ee0e9b3a9dafedaaebb","src/unix/linux_like/linux/gnu/mod.rs":"583d04f92435da76fd3f87182ab67b5e6dd8c35a63b240d8c4555fb1ab70f3f8","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"099ae3b59e379cad0e57df710a81a3f8f208a5993051e6e0fcfb61595889ce18","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"af10147d7c3661751750a58ffad089d5d18d180cd18303c653aef126c07ccd91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"d079cab42529f7dab699334d43168c74ff4aa0282f11040a8b7d274b65767a7a","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"e44043766f7cd26de7ffa4232654afb6feb03e58dbd5890717970887bd003151","src/unix/linux_like/linux/musl/b32/mod.rs":"31677597fd9544c4b1ec1477628288f6273fabbc06e38f33da862ad55f019ce1","src/unix/linux_like/linux/musl/b32/powerpc.rs":"3dae56a4e7789bcc5314e419fea5e4b2495367b4f1a49d1c9477c60225d65eef","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"3ee845d272f91a1908d5f421d7c353e1f14681bbdfef64410e408f4c14365a91","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"f2b53ae0034c833244b7cdb8c670349bf8272a03abf04152eba65cf62810484d","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"45ce6897afcc960267bb7505702b639daf94dc69428a213bf1aefd367ca32adc","src/unix/linux_like/linux/musl/b64/mips64.rs":"a968ef9c54fa22293085f318c8472c1754482df92cc500568dc33bd807d71ea6","src/unix/linux_like/linux/musl/b64/mod.rs":"1a8391febf3e750185ffc5c69c9f9e411f4e8c53b5d994cb231df24480169686","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"140e579800a67315f4cb8a42b22aa8157eae34ffe626e77e421b43c53c23b34d","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"c5944526d7e19cd43e9d14d119a1d98f8780db7ecbcc79e69d7b9348e596b520","src/unix/linux_like/linux/musl/b64/s390x.rs":"8557b3477ca8cefef7fce764a3c25441929a54e50ead4091f6f7823c427cd728","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"a91c4f18027c9958037f78ae48f6352d23cb4e6f2995b2cc8de7dce0e5759470","src/unix/linux_like/linux/musl/lfs64.rs":"3e4fb381f3a0756520bde0f1692d4fa45e4ae8133bf7d7c64b0e3fdd512f235f","src/unix/linux_like/linux/musl/mod.rs":"f0a23b77e5465c05a5dd95c3c6b7959c597010416226503ff3719796367ba98e","src/unix/linux_like/linux/no_align.rs":"62cdca0e011937aaf09a51ca86d9f0ee0fdb05f61ec3c058e6a5d5fa6357d784","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"50288ff9e411ab0966da24838f2c2a5618021bc19c422a04f577b2979ef4081e","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"d0c4434e2bf813372c418a8f516c706cdccc9f7be2f0921b2207b0afdb66fe81","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3f38ee6a4690b9d7594be20d216467a34d955f7653c2c8ce1e6147daeb53f1e0","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"a048fce1c2d9b1ad57305642e8ad05ca0f0c7e4753267a2e2d6b4fee5db3b072","src/unix/linux_like/linux/uclibc/mod.rs":"193a03fa4aa5345394e39d2115c9427e806c9f28b0fde685719119e1c90ca08a","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"8485b9182b7c67f7344fab377e7cc2a72afefd9ab63837c860514abba9728d76","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"196d03affbefb85716937c15904831e731eb222ee906e05e42102d639a8152ea","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"86dbbd81484df25ad7c6a82d2d3b5eab2f8e7751853c1dd4308b7eee57b5fbca","src/unix/mod.rs":"923a32e8fd9e462eda4e90ae7ee501da1d12aaadc1bf2e9722f02581a5d3fc6c","src/unix/newlib/aarch64/mod.rs":"964c096288da836b53c0c71d7f3a97048d177da220a69314c5ce93ba330d72af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cf754f8b1197489fca01e881a4b4b146e814998e4b365f116fa1a102c00e6a4e","src/unix/newlib/espidf/mod.rs":"29969da41f0042197b21cfa7c0ad2244b4519ecab0fb7de3d0a7655b4f3937e1","src/unix/newlib/generic.rs":"5f0b5d07ddb5a5d60580f9561fdb05e9218d9751d4068c4aadad2ba6b950aabf","src/unix/newlib/horizon/mod.rs":"3a521d22bf932fc01c1d26d1f9bff20f11b1855b03c8236a8eb18310f6cab5a8","src/unix/newlib/mod.rs":"e5d5faf27a6336b9f1c02b8726427801d906a14dae766852b4e85c1a92df06c8","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"cc9e188711b9bf614323ad6c48e0d2e1a1ecc5d3bc64961ba451f29c6c22d2d8","src/unix/newlib/vita/mod.rs":"ff1caf74bb0696fe15d60dbac598db4520cd538aa0f5989713d97d008eee6ad8","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/nto/aarch64.rs":"4709c9afdc8d583be876598e7c238499ee3e8da5bd2baa614d9c7dd414851555","src/unix/nto/mod.rs":"07268897fc8810f2fed22ab56f87757f71c73ba401abd848bccca6b183a13b02","src/unix/nto/neutrino.rs":"799bff4ab01a6424db6c5a2b76aa5679826d41495f9d13c63485bf13bc80026b","src/unix/nto/x86_64.rs":"a3e18e93c2999da1cd7a6f748a4b60c07aefb73d8ea2aafec19a84cfb040bc8e","src/unix/redox/mod.rs":"a9f54687307883beb4a410216dc8e36b85d72b0463bc6b1520bd91edf3947d23","src/unix/solarish/compat.rs":"00f1ee3faec9da69204e42f025f6735dd13d894071a154425dcc43ecbdd06e7f","src/unix/solarish/illumos.rs":"cd93c2d84722bbf9933a92842a8998eb0b2afc962f50bc2546ad127b82809fa7","src/unix/solarish/mod.rs":"10b2369edc027fcb2e41e5342f24946aa01ee1549a6d7f06b9a3956ff84518bc","src/unix/solarish/solaris.rs":"41b350a89ddf01cd12a10f93640f92be53be0b0d976021cdc08da17bf3e72edf","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"ec2b01f194eb8a6a27133c57681da195a949e03098f3ea1e847227a9c09ef5fc","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"4105a2e6a6c9908fc1f2a770ede052bb0d6a5d9d49e32d815f557081efc49860","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"d4147353537d7556076ff1a1c4cb96cc2dae9416a5d176ba8a077ad55ab7ec18","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"9fdc5e1c62c441abef7bc62a7343efb2041edc24db9ac0efc0f74df55b69e249","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","src/xous.rs":"eb0675f25ba01f73072d2b70907fb8abb1148facefe5a20756c49250f3d65fae","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"} \ No newline at end of file diff --git a/vendor/libc/CONTRIBUTING.md b/vendor/libc/CONTRIBUTING.md index 8c551dbdb..b6f41cc6d 100644 --- a/vendor/libc/CONTRIBUTING.md +++ b/vendor/libc/CONTRIBUTING.md @@ -3,6 +3,13 @@ Welcome! If you are reading this document, it means you are interested in contributing to the `libc` crate. +## v0.2 changes + +If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch. +If you want to add any breaking changes, it should be submitted to the main branch, +which has changes for v0.3. +We will support and make a new release for v0.2 until we make the first release of v0.3. + ## Adding an API Want to use an API which currently isn't bound in `libc`? It's quite easy to add @@ -54,7 +61,7 @@ We have two automated tests running on [GitHub Actions](https://github.com/rust- - `cd libc-test && cargo test` - Use the `skip_*()` functions in `build.rs` if you really need a workaround. 2. Style checker - - `rustc ci/style.rs && ./style src` + - [`sh ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh) ## Breaking change policy diff --git a/vendor/libc/Cargo.toml b/vendor/libc/Cargo.toml index f03bd33b8..46ec3b407 100644 --- a/vendor/libc/Cargo.toml +++ b/vendor/libc/Cargo.toml @@ -11,7 +11,7 @@ [package] name = "libc" -version = "0.2.150" +version = "0.2.153" authors = ["The Rust Project Developers"] build = "build.rs" exclude = [ @@ -49,6 +49,7 @@ features = [ "extra_traits", ] targets = [ + "aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-linux-android", "aarch64-pc-windows-msvc", diff --git a/vendor/libc/README.md b/vendor/libc/README.md index 29d2a4b61..395b94ce0 100644 --- a/vendor/libc/README.md +++ b/vendor/libc/README.md @@ -16,6 +16,15 @@ More detailed information about the design of this library can be found in its [rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md +## v0.3 Roadmap + +The main branch is now for v0.3 which has some breaking changes. + +For v0.2, please submit PRs to the `libc-0.2` branch instead. +We will stop making new v0.2 releases once we release v0.3 on crates.io. + +See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details. + ## Usage Add the following to your `Cargo.toml`: diff --git a/vendor/libc/build.rs b/vendor/libc/build.rs index d7a9b7f78..ec932007a 100644 --- a/vendor/libc/build.rs +++ b/vendor/libc/build.rs @@ -13,6 +13,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[ "freebsd12", "freebsd13", "freebsd14", + "freebsd15", "libc_align", "libc_cfg_target_vendor", "libc_const_extern_fn", @@ -59,17 +60,18 @@ fn main() { ); } - // The ABI of libc used by libstd is backward compatible with FreeBSD 10. + // The ABI of libc used by std is backward compatible with FreeBSD 12. // The ABI of libc from crates.io is backward compatible with FreeBSD 11. // // On CI, we detect the actual FreeBSD version and match its ABI exactly, // running tests to ensure that the ABI is correct. match which_freebsd() { - Some(10) if libc_ci || rustc_dep_of_std => set_cfg("freebsd10"), + Some(10) if libc_ci => set_cfg("freebsd10"), Some(11) if libc_ci => set_cfg("freebsd11"), - Some(12) if libc_ci => set_cfg("freebsd12"), + Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"), Some(13) if libc_ci => set_cfg("freebsd13"), Some(14) if libc_ci => set_cfg("freebsd14"), + Some(15) if libc_ci => set_cfg("freebsd15"), Some(_) | None => set_cfg("freebsd11"), } @@ -252,6 +254,7 @@ fn which_freebsd() -> Option { s if s.starts_with("12") => Some(12), s if s.starts_with("13") => Some(13), s if s.starts_with("14") => Some(14), + s if s.starts_with("15") => Some(15), _ => None, } } @@ -274,7 +277,10 @@ fn emcc_version_code() -> Option { return None; } let version = stdout.unwrap(); - let mut pieces = version.trim().split('.'); + + // Some Emscripten versions come with `-git` attached, so split the + // version string also on the `-` char. + let mut pieces = version.trim().split(|c| c == '.' || c == '-'); let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); diff --git a/vendor/libc/src/fuchsia/mod.rs b/vendor/libc/src/fuchsia/mod.rs index bf1a54360..4e028ff6c 100644 --- a/vendor/libc/src/fuchsia/mod.rs +++ b/vendor/libc/src/fuchsia/mod.rs @@ -3233,6 +3233,9 @@ pub const O_DIRECT: ::c_int = 0x00000800; pub const O_LARGEFILE: ::c_int = 0x00001000; pub const O_NOFOLLOW: ::c_int = 0x00000080; +pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26; +pub const MAP_HUGE_SHIFT: u32 = 26; + // intentionally not public, only used for fd_set cfg_if! { if #[cfg(target_pointer_width = "32")] { @@ -3823,6 +3826,8 @@ extern "C" { pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int; + pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int; pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; pub fn getsockopt( @@ -4104,7 +4109,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn reboot(how_to: ::c_int) -> ::c_int; diff --git a/vendor/libc/src/macros.rs b/vendor/libc/src/macros.rs index fd473702f..beb80024d 100644 --- a/vendor/libc/src/macros.rs +++ b/vendor/libc/src/macros.rs @@ -120,6 +120,12 @@ macro_rules! s_no_extra_traits { ); } +macro_rules! missing { + ($($(#[$attr:meta])* pub enum $i:ident {})*) => ($( + $(#[$attr])* #[allow(missing_copy_implementations)] pub enum $i { } + )*); +} + macro_rules! e { ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($( __item! { diff --git a/vendor/libc/src/psp.rs b/vendor/libc/src/psp.rs index 575232dad..a4ca029b6 100644 --- a/vendor/libc/src/psp.rs +++ b/vendor/libc/src/psp.rs @@ -1382,15 +1382,18 @@ s_paren! { pub struct SceUid(pub i32); #[repr(transparent)] + #[allow(dead_code)] pub struct SceMpeg(*mut *mut c_void); #[repr(transparent)] + #[allow(dead_code)] pub struct SceMpegStream(*mut c_void); #[repr(transparent)] pub struct Mp3Handle(pub i32); #[repr(transparent)] + #[allow(dead_code)] pub struct RegHandle(u32); } diff --git a/vendor/libc/src/teeos/mod.rs b/vendor/libc/src/teeos/mod.rs index cffe04197..25e06ffaa 100644 --- a/vendor/libc/src/teeos/mod.rs +++ b/vendor/libc/src/teeos/mod.rs @@ -62,7 +62,7 @@ pub struct _CLongDouble(pub u128); // long double in C means A float point value, which has 128bit length. // but some bit maybe not used, so the really length of long double could be 80(x86) or 128(power pc/IEEE) -// this is different from f128(not stable and not inculded default) in Rust, so we use u128 for FFI(Rust to C). +// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C). // this is unstable and will couse to memfault/data abort. pub type c_longdouble = _CLongDouble; @@ -1106,6 +1106,12 @@ extern "C" { pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int; + pub fn pthread_cond_timedwait( + cond: *mut pthread_cond_t, + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int; pub fn pthread_create( diff --git a/vendor/libc/src/unix/aix/mod.rs b/vendor/libc/src/unix/aix/mod.rs index 0d7c2ed1d..0fc923d60 100644 --- a/vendor/libc/src/unix/aix/mod.rs +++ b/vendor/libc/src/unix/aix/mod.rs @@ -2889,7 +2889,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::size_t, serv: *mut ::c_char, - sevlen: ::size_t, + servlen: ::size_t, flags: ::c_int, ) -> ::c_int; pub fn getpagesize() -> ::c_int; diff --git a/vendor/libc/src/unix/bsd/apple/mod.rs b/vendor/libc/src/unix/bsd/apple/mod.rs index 21efb23eb..2e7827231 100644 --- a/vendor/libc/src/unix/bsd/apple/mod.rs +++ b/vendor/libc/src/unix/bsd/apple/mod.rs @@ -1138,6 +1138,49 @@ s! { #[cfg(not(libc_union))] pub ifc_ifcu: *mut ifreq, } + + #[cfg_attr(libc_align, repr(align(8)))] + pub struct tcp_connection_info { + pub tcpi_state: u8, + pub tcpi_snd_wscale: u8, + pub tcpi_rcv_wscale: u8, + __pad1: u8, + pub tcpi_options: u32, + pub tcpi_flags: u32, + pub tcpi_rto: u32, + pub tcpi_maxseg: u32, + pub tcpi_snd_ssthresh: u32, + pub tcpi_snd_cwnd: u32, + pub tcpi_snd_wnd: u32, + pub tcpi_snd_sbbytes: u32, + pub tcpi_rcv_wnd: u32, + pub tcpi_rttcur: u32, + pub tcpi_srtt: u32, + pub tcpi_rttvar: u32, + pub tcpi_tfo_cookie_req: u32, + pub tcpi_tfo_cookie_rcv: u32, + pub tcpi_tfo_syn_loss: u32, + pub tcpi_tfo_syn_data_sent: u32, + pub tcpi_tfo_syn_data_acked: u32, + pub tcpi_tfo_syn_data_rcv: u32, + pub tcpi_tfo_cookie_req_rcv: u32, + pub tcpi_tfo_cookie_sent: u32, + pub tcpi_tfo_cookie_invalid: u32, + pub tcpi_tfo_cookie_wrong: u32, + pub tcpi_tfo_no_cookie_rcv: u32, + pub tcpi_tfo_heuristics_disable: u32, + pub tcpi_tfo_send_blackhole: u32, + pub tcpi_tfo_recv_blackhole: u32, + pub tcpi_tfo_onebyte_proxy: u32, + __pad2: u32, + pub tcpi_txpackets: u64, + pub tcpi_txbytes: u64, + pub tcpi_txretransmitbytes: u64, + pub tcpi_rxpackets: u64, + pub tcpi_rxbytes: u64, + pub tcpi_rxoutoforderbytes: u64, + pub tcpi_rxretransmitpackets: u64, + } } s_no_extra_traits! { @@ -4075,6 +4118,7 @@ pub const IP_RECVDSTADDR: ::c_int = 7; pub const IP_ADD_MEMBERSHIP: ::c_int = 12; pub const IP_DROP_MEMBERSHIP: ::c_int = 13; pub const IP_RECVIF: ::c_int = 20; +pub const IP_RECVTTL: ::c_int = 24; pub const IP_BOUND_IF: ::c_int = 25; pub const IP_PKTINFO: ::c_int = 26; pub const IP_RECVTOS: ::c_int = 27; @@ -4084,6 +4128,7 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13; pub const IPV6_CHECKSUM: ::c_int = 26; pub const IPV6_RECVTCLASS: ::c_int = 35; pub const IPV6_TCLASS: ::c_int = 36; +pub const IPV6_RECVHOPLIMIT: ::c_int = 37; pub const IPV6_PKTINFO: ::c_int = 46; pub const IPV6_HOPLIMIT: ::c_int = 47; pub const IPV6_RECVPKTINFO: ::c_int = 61; @@ -4101,6 +4146,7 @@ pub const TCP_KEEPINTVL: ::c_int = 0x101; pub const TCP_KEEPCNT: ::c_int = 0x102; /// Enable/Disable TCP Fastopen on this socket pub const TCP_FASTOPEN: ::c_int = 0x105; +pub const TCP_CONNECTION_INFO: ::c_int = 0x106; pub const SOL_LOCAL: ::c_int = 0; @@ -5602,12 +5648,6 @@ extern "C" { pub fn asctime(tm: *const ::tm) -> *mut ::c_char; pub fn ctime(clock: *const time_t) -> *mut ::c_char; pub fn getdate(datestr: *const ::c_char) -> *mut ::tm; - pub fn strftime( - buf: *mut ::c_char, - maxsize: ::size_t, - format: *const ::c_char, - timeptr: *const ::tm, - ) -> ::size_t; pub fn strptime( buf: *const ::c_char, format: *const ::c_char, @@ -5622,7 +5662,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; @@ -6243,7 +6283,7 @@ extern "C" { buffersize: u32, ) -> ::c_int; pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int; - pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int; + pub fn proc_libversion(major: *mut ::c_int, minor: *mut ::c_int) -> ::c_int; pub fn proc_pid_rusage(pid: ::c_int, flavor: ::c_int, buffer: *mut rusage_info_t) -> ::c_int; // Available from Big Sur @@ -6260,6 +6300,7 @@ extern "C" { pub fn sethostid(hostid: ::c_long); pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int; pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char; @@ -6278,6 +6319,13 @@ extern "C" { inheritance: ::vm_inherit_t, ) -> ::kern_return_t; + pub fn vm_allocate( + target_task: vm_map_t, + address: *mut vm_address_t, + size: vm_size_t, + flags: ::c_int, + ) -> ::kern_return_t; + pub fn vm_deallocate( target_task: vm_map_t, address: vm_address_t, diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index 0e04a12e7..ec6bce2a0 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -1,4 +1,4 @@ -// APIs in FreeBSD 14 that have changed since 11. +// APIs in FreeBSD 13 that have changed since 11. pub type nlink_t = u64; pub type dev_t = u64; diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index a86ca6e7c..160a4baae 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -1,4 +1,4 @@ -// APIs in FreeBSD 13 that have changed since 11. +// APIs in FreeBSD 14 that have changed since 11. pub type nlink_t = u64; pub type dev_t = u64; diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs new file mode 100644 index 000000000..80c6fa168 --- /dev/null +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs @@ -0,0 +1,34 @@ +#[repr(C)] +#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + st_padding0: i16, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u64, + pub st_spare: [u64; 10], +} + +impl ::Copy for ::stat {} +impl ::Clone for ::stat { + fn clone(&self) -> ::stat { + *self + } +} diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs new file mode 100644 index 000000000..d73215a68 --- /dev/null +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs @@ -0,0 +1,546 @@ +// APIs in FreeBSD 15 that have changed since 11. + +pub type nlink_t = u64; +pub type dev_t = u64; +pub type ino_t = ::c_ulong; +pub type shmatt_t = ::c_uint; +pub type kpaddr_t = u64; +pub type kssize_t = i64; +pub type domainset_t = __c_anonymous_domainset; + +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: i64, + pub udata: *mut ::c_void, + pub ext: [u64; 4], + } + + pub struct kvm_page { + pub kp_version: ::u_int, + pub kp_paddr: ::kpaddr_t, + pub kp_kmap_vaddr: ::kvaddr_t, + pub kp_dmap_vaddr: ::kvaddr_t, + pub kp_prot: ::vm_prot_t, + pub kp_offset: ::off_t, + pub kp_len: ::size_t, + } + + pub struct __c_anonymous_domainset { + _priv: [::uintptr_t; 4], + } + + pub struct kinfo_proc { + /// Size of this structure. + pub ki_structsize: ::c_int, + /// Reserved: layout identifier. + pub ki_layout: ::c_int, + /// Address of command arguments. + pub ki_args: *mut ::pargs, + // This is normally "struct proc". + /// Address of proc. + pub ki_paddr: *mut ::c_void, + // This is normally "struct user". + /// Kernel virtual address of u-area. + pub ki_addr: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to trace file. + pub ki_tracep: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to executable file. + pub ki_textvp: *mut ::c_void, + // This is normally "struct filedesc". + /// Pointer to open file info. + pub ki_fd: *mut ::c_void, + // This is normally "struct vmspace". + /// Pointer to kernel vmspace struct. + pub ki_vmspace: *mut ::c_void, + /// Sleep address. + pub ki_wchan: *const ::c_void, + /// Process identifier. + pub ki_pid: ::pid_t, + /// Parent process ID. + pub ki_ppid: ::pid_t, + /// Process group ID. + pub ki_pgid: ::pid_t, + /// tty process group ID. + pub ki_tpgid: ::pid_t, + /// Process session ID. + pub ki_sid: ::pid_t, + /// Terminal session ID. + pub ki_tsid: ::pid_t, + /// Job control counter. + pub ki_jobc: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short1: ::c_short, + /// Controlling tty dev. + pub ki_tdev_freebsd11: u32, + /// Signals arrived but not delivered. + pub ki_siglist: ::sigset_t, + /// Current signal mask. + pub ki_sigmask: ::sigset_t, + /// Signals being ignored. + pub ki_sigignore: ::sigset_t, + /// Signals being caught by user. + pub ki_sigcatch: ::sigset_t, + /// Effective user ID. + pub ki_uid: ::uid_t, + /// Real user ID. + pub ki_ruid: ::uid_t, + /// Saved effective user ID. + pub ki_svuid: ::uid_t, + /// Real group ID. + pub ki_rgid: ::gid_t, + /// Saved effective group ID. + pub ki_svgid: ::gid_t, + /// Number of groups. + pub ki_ngroups: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short2: ::c_short, + /// Groups. + pub ki_groups: [::gid_t; ::KI_NGROUPS], + /// Virtual size. + pub ki_size: ::vm_size_t, + /// Current resident set size in pages. + pub ki_rssize: ::segsz_t, + /// Resident set size before last swap. + pub ki_swrss: ::segsz_t, + /// Text size (pages) XXX. + pub ki_tsize: ::segsz_t, + /// Data size (pages) XXX. + pub ki_dsize: ::segsz_t, + /// Stack size (pages). + pub ki_ssize: ::segsz_t, + /// Exit status for wait & stop signal. + pub ki_xstat: ::u_short, + /// Accounting flags. + pub ki_acflag: ::u_short, + /// %cpu for process during `ki_swtime`. + pub ki_pctcpu: ::fixpt_t, + /// Time averaged value of `ki_cpticks`. + pub ki_estcpu: ::u_int, + /// Time since last blocked. + pub ki_slptime: ::u_int, + /// Time swapped in or out. + pub ki_swtime: ::u_int, + /// Number of copy-on-write faults. + pub ki_cow: ::u_int, + /// Real time in microsec. + pub ki_runtime: u64, + /// Starting time. + pub ki_start: ::timeval, + /// Time used by process children. + pub ki_childtime: ::timeval, + /// P_* flags. + pub ki_flag: ::c_long, + /// KI_* flags (below). + pub ki_kiflag: ::c_long, + /// Kernel trace points. + pub ki_traceflag: ::c_int, + /// S* process status. + pub ki_stat: ::c_char, + /// Process "nice" value. + pub ki_nice: i8, // signed char + /// Process lock (prevent swap) count. + pub ki_lock: ::c_char, + /// Run queue index. + pub ki_rqindex: ::c_char, + /// Which cpu we are on. + pub ki_oncpu_old: ::c_uchar, + /// Last cpu we were on. + pub ki_lastcpu_old: ::c_uchar, + /// Thread name. + pub ki_tdname: [::c_char; ::TDNAMLEN + 1], + /// Wchan message. + pub ki_wmesg: [::c_char; ::WMESGLEN + 1], + /// Setlogin name. + pub ki_login: [::c_char; ::LOGNAMELEN + 1], + /// Lock name. + pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1], + /// Command name. + pub ki_comm: [::c_char; ::COMMLEN + 1], + /// Emulation name. + pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1], + /// Login class. + pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1], + /// More thread name. + pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1], + /// Spare string space. + pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq + /// Spare room for growth. + pub ki_spareints: [::c_int; ::KI_NSPARE_INT], + /// Controlling tty dev. + pub ki_tdev: u64, + /// Which cpu we are on. + pub ki_oncpu: ::c_int, + /// Last cpu we were on. + pub ki_lastcpu: ::c_int, + /// PID of tracing process. + pub ki_tracer: ::c_int, + /// P2_* flags. + pub ki_flag2: ::c_int, + /// Default FIB number. + pub ki_fibnum: ::c_int, + /// Credential flags. + pub ki_cr_flags: ::u_int, + /// Process jail ID. + pub ki_jid: ::c_int, + /// Number of threads in total. + pub ki_numthreads: ::c_int, + /// Thread ID. + pub ki_tid: ::lwpid_t, + /// Process priority. + pub ki_pri: ::priority, + /// Process rusage statistics. + pub ki_rusage: ::rusage, + /// rusage of children processes. + pub ki_rusage_ch: ::rusage, + // This is normally "struct pcb". + /// Kernel virtual addr of pcb. + pub ki_pcb: *mut ::c_void, + /// Kernel virtual addr of stack. + pub ki_kstack: *mut ::c_void, + /// User convenience pointer. + pub ki_udata: *mut ::c_void, + // This is normally "struct thread". + pub ki_tdaddr: *mut ::c_void, + // This is normally "struct pwddesc". + /// Pointer to process paths info. + pub ki_pd: *mut ::c_void, + pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR], + pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG], + /// PS_* flags. + pub ki_sflag: ::c_long, + /// kthread flag. + pub ki_tdflags: ::c_long, + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + d_pad0: u8, + pub d_namlen: u16, + d_pad1: u16, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + pub f_version: u32, + pub f_type: u32, + pub f_flags: u64, + pub f_bsize: u64, + pub f_iosize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: i64, + pub f_syncwrites: u64, + pub f_asyncwrites: u64, + pub f_syncreads: u64, + pub f_asyncreads: u64, + f_spare: [u64; 10], + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_fsid: ::fsid_t, + f_charspare: [::c_char; 80], + pub f_fstypename: [::c_char; 16], + pub f_mntfromname: [::c_char; 1024], + pub f_mntonname: [::c_char; 1024], + } + + pub struct vnstat { + pub vn_fileid: u64, + pub vn_size: u64, + pub vn_dev: u64, + pub vn_fsid: u64, + pub vn_mntdir: *mut ::c_char, + pub vn_type: ::c_int, + pub vn_mode: u16, + pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_version == other.f_version + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_fsid == other.f_fsid + && self.f_fstypename == other.f_fstypename + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_fsid", &self.f_fsid) + .field("f_fstypename", &self.f_fstypename) + .field("f_mntfromname", &&self.f_mntfromname[..]) + .field("f_mntonname", &&self.f_mntonname[..]) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_version.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_fsid.hash(state); + self.f_charspare.hash(state); + self.f_fstypename.hash(state); + self.f_mntfromname.hash(state); + self.f_mntonname.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name[..self.d_namlen as _] + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + .field("d_name", &&self.d_name[..self.d_namlen as _]) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name[..self.d_namlen as _].hash(state); + } + } + + impl PartialEq for vnstat { + fn eq(&self, other: &vnstat) -> bool { + let self_vn_devname: &[::c_char] = &self.vn_devname; + let other_vn_devname: &[::c_char] = &other.vn_devname; + + self.vn_fileid == other.vn_fileid && + self.vn_size == other.vn_size && + self.vn_dev == other.vn_dev && + self.vn_fsid == other.vn_fsid && + self.vn_mntdir == other.vn_mntdir && + self.vn_type == other.vn_type && + self.vn_mode == other.vn_mode && + self_vn_devname == other_vn_devname + } + } + impl Eq for vnstat {} + impl ::fmt::Debug for vnstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + f.debug_struct("vnstat") + .field("vn_fileid", &self.vn_fileid) + .field("vn_size", &self.vn_size) + .field("vn_dev", &self.vn_dev) + .field("vn_fsid", &self.vn_fsid) + .field("vn_mntdir", &self.vn_mntdir) + .field("vn_type", &self.vn_type) + .field("vn_mode", &self.vn_mode) + .field("vn_devname", &self_vn_devname) + .finish() + } + } + impl ::hash::Hash for vnstat { + fn hash(&self, state: &mut H) { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + self.vn_fileid.hash(state); + self.vn_size.hash(state); + self.vn_dev.hash(state); + self.vn_fsid.hash(state); + self.vn_mntdir.hash(state); + self.vn_type.hash(state); + self.vn_mode.hash(state); + self_vn_devname.hash(state); + } + } + } +} + +pub const RAND_MAX: ::c_int = 0x7fff_ffff; +pub const ELAST: ::c_int = 97; + +pub const KF_TYPE_EVENTFD: ::c_int = 13; + +/// max length of devicename +pub const SPECNAMELEN: ::c_int = 255; +pub const KI_NSPARE_PTR: usize = 5; + +/// domainset policies +pub const DOMAINSET_POLICY_INVALID: ::c_int = 0; +pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1; +pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2; +pub const DOMAINSET_POLICY_PREFER: ::c_int = 3; +pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4; + +pub const MINCORE_SUPER: ::c_int = 0x60; + +safe_f! { + pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + let major = major as ::dev_t; + let minor = minor as ::dev_t; + let mut dev = 0; + dev |= ((major & 0xffffff00) as dev_t) << 32; + dev |= ((major & 0x000000ff) as dev_t) << 8; + dev |= ((minor & 0x0000ff00) as dev_t) << 24; + dev |= ((minor & 0xffff00ff) as dev_t) << 0; + dev + } +} + +f! { + pub fn major(dev: ::dev_t) -> ::c_int { + (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int + } + + pub fn minor(dev: ::dev_t) -> ::c_int { + (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int + } +} + +extern "C" { + pub fn setgrent(); + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn freelocale(loc: ::locale_t); + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + + pub fn cpuset_getdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *mut ::domainset_t, + policy: *mut ::c_int, + ) -> ::c_int; + pub fn cpuset_setdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *const ::domainset_t, + policy: ::c_int, + ) -> ::c_int; + + pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; + pub fn basename(path: *mut ::c_char) -> *mut ::c_char; +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } +} diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs new file mode 100644 index 000000000..01d0b4328 --- /dev/null +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs @@ -0,0 +1,12 @@ +pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; +pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; +pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; +pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; +pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; +pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2; +pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3; +pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1; +pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2; +pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3; +pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000; +pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000; diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index c654ae42e..78314084c 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -48,6 +48,8 @@ pub type cpusetid_t = ::c_int; pub type sctp_assoc_t = u32; +pub type eventfd_t = u64; + #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] #[repr(u32)] pub enum devstat_support_flags { @@ -365,13 +367,13 @@ s! { } pub struct cpuset_t { - #[cfg(all(freebsd14, target_pointer_width = "64"))] + #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "64"))] __bits: [::c_long; 16], - #[cfg(all(freebsd14, target_pointer_width = "32"))] + #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "32"))] __bits: [::c_long; 32], - #[cfg(all(not(freebsd14), target_pointer_width = "64"))] + #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "64"))] __bits: [::c_long; 4], - #[cfg(all(not(freebsd14), target_pointer_width = "32"))] + #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "32"))] __bits: [::c_long; 8], } @@ -595,9 +597,9 @@ s! { pub sa_peer: ::sockaddr_storage, pub type_: ::c_int, pub dname: [::c_char; 32], - #[cfg(any(freebsd12, freebsd13, freebsd14))] + #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] pub sendq: ::c_uint, - #[cfg(any(freebsd12, freebsd13, freebsd14))] + #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] pub recvq: ::c_uint, } @@ -1044,39 +1046,41 @@ s! { pub tcpi_snd_rexmitpack: u32, pub tcpi_rcv_ooopack: u32, pub tcpi_snd_zerowin: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_delivered_ce: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_received_ce: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_delivered_e1_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_delivered_e0_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_delivered_ce_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_received_e1_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_received_e0_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub __tcpi_received_ce_bytes: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_total_tlp: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_total_tlp_bytes: u64, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_snd_una: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_snd_max: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_rcv_numsacks: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_rcv_adv: u32, - #[cfg(freebsd14)] + #[cfg(any(freebsd15, freebsd14))] pub tcpi_dupacks: u32, #[cfg(freebsd14)] pub __tcpi_pad: [u32; 10], - #[cfg(not(freebsd14))] + #[cfg(freebsd15)] + pub __tcpi_pad: [u32; 14], + #[cfg(not(any(freebsd15, freebsd14)))] pub __tcpi_pad: [u32; 26], } @@ -1404,9 +1408,9 @@ s_no_extra_traits! { } pub struct ptsstat { - #[cfg(any(freebsd12, freebsd13, freebsd14))] + #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] pub dev: u64, - #[cfg(not(any(freebsd12, freebsd13, freebsd14)))] + #[cfg(not(any(freebsd12, freebsd13, freebsd14, freebsd15)))] pub dev: u32, pub devname: [::c_char; SPECNAMELEN as usize + 1], } @@ -2620,7 +2624,7 @@ pub const DEVSTAT_NAME_LEN: ::c_int = 16; // sys/cpuset.h cfg_if! { - if #[cfg(freebsd14)] { + if #[cfg(any(freebsd15, freebsd14))] { pub const CPU_SETSIZE: ::c_int = 1024; } else { pub const CPU_SETSIZE: ::c_int = 256; @@ -3889,6 +3893,7 @@ pub const RFMEM: ::c_int = 32; pub const RFNOWAIT: ::c_int = 64; pub const RFCFDG: ::c_int = 4096; pub const RFTHREAD: ::c_int = 8192; +pub const RFSIGSHARE: ::c_int = 16384; pub const RFLINUXTHPN: ::c_int = 65536; pub const RFTSIGZMB: ::c_int = 524288; pub const RFSPAWN: ::c_int = 2147483648; @@ -4725,10 +4730,17 @@ pub const RB_POWERCYCLE: ::c_int = 0x400000; pub const RB_PROBE: ::c_int = 0x10000000; pub const RB_MULTIPLE: ::c_int = 0x20000000; +// sys/time.h +pub const CLOCK_BOOTTIME: ::clockid_t = ::CLOCK_UPTIME; +pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST; +pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST; + // sys/timerfd.h pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK; pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const TFD_TIMER_ABSTIME: ::c_int = 0x01; +pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02; cfg_if! { if #[cfg(libc_const_extern_fn)] { @@ -5358,13 +5370,6 @@ extern "C" { pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int; pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int; - pub fn clock_nanosleep( - clk_id: ::clockid_t, - flags: ::c_int, - rqtp: *const ::timespec, - rmtp: *mut ::timespec, - ) -> ::c_int; - pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char; pub fn shm_create_largepage( @@ -5383,6 +5388,8 @@ extern "C" { pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int; pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int; + pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int; pub fn fdatasync(fd: ::c_int) -> ::c_int; @@ -5703,7 +5710,10 @@ extern "C" { } cfg_if! { - if #[cfg(freebsd14)] { + if #[cfg(freebsd15)] { + mod freebsd15; + pub use self::freebsd15::*; + } else if #[cfg(freebsd14)] { mod freebsd14; pub use self::freebsd14::*; } else if #[cfg(freebsd13)] { diff --git a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs index d2cd7794b..00a944e42 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -824,15 +824,12 @@ pub const CLOCK_VIRTUAL: ::clockid_t = 1; pub const CLOCK_PROF: ::clockid_t = 2; pub const CLOCK_MONOTONIC: ::clockid_t = 4; pub const CLOCK_UPTIME: ::clockid_t = 5; -pub const CLOCK_BOOTTIME: ::clockid_t = CLOCK_UPTIME; pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; -pub const CLOCK_REALTIME_COARSE: ::clockid_t = CLOCK_REALTIME_FAST; pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; -pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = CLOCK_MONOTONIC_FAST; pub const CLOCK_SECOND: ::clockid_t = 13; pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; @@ -1493,6 +1490,13 @@ extern "C" { atflag: ::c_int, ) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; diff --git a/vendor/libc/src/unix/bsd/mod.rs b/vendor/libc/src/unix/bsd/mod.rs index 6ce041357..9a2e6c463 100644 --- a/vendor/libc/src/unix/bsd/mod.rs +++ b/vendor/libc/src/unix/bsd/mod.rs @@ -761,6 +761,7 @@ extern "C" { )] #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; pub fn getgrnam_r( @@ -899,6 +900,20 @@ extern "C" { longopts: *const option, longindex: *mut ::c_int, ) -> ::c_int; + + pub fn strftime( + buf: *mut ::c_char, + maxsize: ::size_t, + format: *const ::c_char, + timeptr: *const ::tm, + ) -> ::size_t; + pub fn strftime_l( + buf: *mut ::c_char, + maxsize: ::size_t, + format: *const ::c_char, + timeptr: *const ::tm, + locale: ::locale_t, + ) -> ::size_t; } cfg_if! { diff --git a/vendor/libc/src/unix/bsd/netbsdlike/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/mod.rs index a787ac6db..e92cf6594 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/mod.rs @@ -364,6 +364,13 @@ pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const POSIX_MADV_DONTNEED: ::c_int = 4; +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; + pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; @@ -646,6 +653,12 @@ pub const TIOCM_RI: ::c_int = TIOCM_RNG; pub const TIMER_ABSTIME: ::c_int = 1; +// sys/reboot.h + +pub const RB_AUTOBOOT: ::c_int = 0; + +pub const TCP_INFO: ::c_int = 9; + #[link(name = "util")] extern "C" { pub fn setgrent(); @@ -741,6 +754,89 @@ extern "C" { argv: *const *const ::c_char, envp: *const *const ::c_char, ) -> ::c_int; + pub fn waitid( + idtype: idtype_t, + id: ::id_t, + infop: *mut ::siginfo_t, + options: ::c_int, + ) -> ::c_int; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; } extern "C" { diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs index 7b895f632..45bca4778 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs @@ -101,3 +101,62 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0; pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1; pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2; pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3; + +pub const _REG_R0: ::c_int = 0; +pub const _REG_R1: ::c_int = 1; +pub const _REG_R2: ::c_int = 2; +pub const _REG_R3: ::c_int = 3; +pub const _REG_R4: ::c_int = 4; +pub const _REG_R5: ::c_int = 5; +pub const _REG_R6: ::c_int = 6; +pub const _REG_R7: ::c_int = 7; +pub const _REG_R8: ::c_int = 8; +pub const _REG_R9: ::c_int = 9; +pub const _REG_R10: ::c_int = 10; +pub const _REG_R11: ::c_int = 11; +pub const _REG_R12: ::c_int = 12; +pub const _REG_R13: ::c_int = 13; +pub const _REG_R14: ::c_int = 14; +pub const _REG_R15: ::c_int = 15; +pub const _REG_CPSR: ::c_int = 16; +pub const _REG_X0: ::c_int = 0; +pub const _REG_X1: ::c_int = 1; +pub const _REG_X2: ::c_int = 2; +pub const _REG_X3: ::c_int = 3; +pub const _REG_X4: ::c_int = 4; +pub const _REG_X5: ::c_int = 5; +pub const _REG_X6: ::c_int = 6; +pub const _REG_X7: ::c_int = 7; +pub const _REG_X8: ::c_int = 8; +pub const _REG_X9: ::c_int = 9; +pub const _REG_X10: ::c_int = 10; +pub const _REG_X11: ::c_int = 11; +pub const _REG_X12: ::c_int = 12; +pub const _REG_X13: ::c_int = 13; +pub const _REG_X14: ::c_int = 14; +pub const _REG_X15: ::c_int = 15; +pub const _REG_X16: ::c_int = 16; +pub const _REG_X17: ::c_int = 17; +pub const _REG_X18: ::c_int = 18; +pub const _REG_X19: ::c_int = 19; +pub const _REG_X20: ::c_int = 20; +pub const _REG_X21: ::c_int = 21; +pub const _REG_X22: ::c_int = 22; +pub const _REG_X23: ::c_int = 23; +pub const _REG_X24: ::c_int = 24; +pub const _REG_X25: ::c_int = 25; +pub const _REG_X26: ::c_int = 26; +pub const _REG_X27: ::c_int = 27; +pub const _REG_X28: ::c_int = 28; +pub const _REG_X29: ::c_int = 29; +pub const _REG_X30: ::c_int = 30; +pub const _REG_X31: ::c_int = 31; +pub const _REG_ELR: ::c_int = 32; +pub const _REG_SPSR: ::c_int = 33; +pub const _REG_TIPDR: ::c_int = 34; + +pub const _REG_RV: ::c_int = _REG_X0; +pub const _REG_FP: ::c_int = _REG_X29; +pub const _REG_LR: ::c_int = _REG_X30; +pub const _REG_SP: ::c_int = _REG_X31; +pub const _REG_PC: ::c_int = _REG_ELR; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs index 4bf3ccd02..b5000d34d 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs @@ -20,3 +20,62 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; + +pub const _REG_R0: ::c_int = 0; +pub const _REG_R1: ::c_int = 1; +pub const _REG_R2: ::c_int = 2; +pub const _REG_R3: ::c_int = 3; +pub const _REG_R4: ::c_int = 4; +pub const _REG_R5: ::c_int = 5; +pub const _REG_R6: ::c_int = 6; +pub const _REG_R7: ::c_int = 7; +pub const _REG_R8: ::c_int = 8; +pub const _REG_R9: ::c_int = 9; +pub const _REG_R10: ::c_int = 10; +pub const _REG_R11: ::c_int = 11; +pub const _REG_R12: ::c_int = 12; +pub const _REG_R13: ::c_int = 13; +pub const _REG_R14: ::c_int = 14; +pub const _REG_R15: ::c_int = 15; +pub const _REG_CPSR: ::c_int = 16; +pub const _REG_X0: ::c_int = 0; +pub const _REG_X1: ::c_int = 1; +pub const _REG_X2: ::c_int = 2; +pub const _REG_X3: ::c_int = 3; +pub const _REG_X4: ::c_int = 4; +pub const _REG_X5: ::c_int = 5; +pub const _REG_X6: ::c_int = 6; +pub const _REG_X7: ::c_int = 7; +pub const _REG_X8: ::c_int = 8; +pub const _REG_X9: ::c_int = 9; +pub const _REG_X10: ::c_int = 10; +pub const _REG_X11: ::c_int = 11; +pub const _REG_X12: ::c_int = 12; +pub const _REG_X13: ::c_int = 13; +pub const _REG_X14: ::c_int = 14; +pub const _REG_X15: ::c_int = 15; +pub const _REG_X16: ::c_int = 16; +pub const _REG_X17: ::c_int = 17; +pub const _REG_X18: ::c_int = 18; +pub const _REG_X19: ::c_int = 19; +pub const _REG_X20: ::c_int = 20; +pub const _REG_X21: ::c_int = 21; +pub const _REG_X22: ::c_int = 22; +pub const _REG_X23: ::c_int = 23; +pub const _REG_X24: ::c_int = 24; +pub const _REG_X25: ::c_int = 25; +pub const _REG_X26: ::c_int = 26; +pub const _REG_X27: ::c_int = 27; +pub const _REG_X28: ::c_int = 28; +pub const _REG_X29: ::c_int = 29; +pub const _REG_X30: ::c_int = 30; +pub const _REG_X31: ::c_int = 31; +pub const _REG_ELR: ::c_int = 32; +pub const _REG_SPSR: ::c_int = 33; +pub const _REG_TIPDR: ::c_int = 34; + +pub const _REG_RV: ::c_int = _REG_R0; +pub const _REG_FP: ::c_int = _REG_R11; +pub const _REG_LR: ::c_int = _REG_R13; +pub const _REG_SP: ::c_int = _REG_R14; +pub const _REG_PC: ::c_int = _REG_R15; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index c612689a5..7c63db8e0 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1549,7 +1549,6 @@ pub const TCP_KEEPIDLE: ::c_int = 3; pub const TCP_KEEPINTVL: ::c_int = 5; pub const TCP_KEEPCNT: ::c_int = 6; pub const TCP_KEEPINIT: ::c_int = 7; -pub const TCP_INFO: ::c_int = 9; pub const TCP_MD5SIG: ::c_int = 0x10; pub const TCP_CONGCTL: ::c_int = 0x20; @@ -1701,6 +1700,7 @@ pub const O_DSYNC: ::c_int = 0x10000; pub const MAP_RENAME: ::c_int = 0x20; pub const MAP_NORESERVE: ::c_int = 0x40; pub const MAP_HASSEMAPHORE: ::c_int = 0x200; +pub const MAP_TRYFIXED: ::c_int = 0x400; pub const MAP_WIRED: ::c_int = 0x800; pub const MAP_STACK: ::c_int = 0x2000; // map alignment aliases for MAP_ALIGNED @@ -2343,13 +2343,6 @@ pub const PT_LWPNEXT: ::c_int = 25; pub const PT_SET_SIGPASS: ::c_int = 26; pub const PT_GET_SIGPASS: ::c_int = 27; pub const PT_FIRSTMACH: ::c_int = 32; - -pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; -pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; -pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04; -pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08; -pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; -pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40; // Flags for chflags(2) @@ -2396,33 +2389,6 @@ pub const LSZOMB: ::c_int = 5; pub const LSONPROC: ::c_int = 7; pub const LSSUSPENDED: ::c_int = 8; -pub const _REG_RDI: ::c_int = 0; -pub const _REG_RSI: ::c_int = 1; -pub const _REG_RDX: ::c_int = 2; -pub const _REG_RCX: ::c_int = 3; -pub const _REG_R8: ::c_int = 4; -pub const _REG_R9: ::c_int = 5; -pub const _REG_R10: ::c_int = 6; -pub const _REG_R11: ::c_int = 7; -pub const _REG_R12: ::c_int = 8; -pub const _REG_R13: ::c_int = 9; -pub const _REG_R14: ::c_int = 10; -pub const _REG_R15: ::c_int = 11; -pub const _REG_RBP: ::c_int = 12; -pub const _REG_RBX: ::c_int = 13; -pub const _REG_RAX: ::c_int = 14; -pub const _REG_GS: ::c_int = 15; -pub const _REG_FS: ::c_int = 16; -pub const _REG_ES: ::c_int = 17; -pub const _REG_DS: ::c_int = 18; -pub const _REG_TRAPNO: ::c_int = 19; -pub const _REG_ERR: ::c_int = 20; -pub const _REG_RIP: ::c_int = 21; -pub const _REG_CS: ::c_int = 22; -pub const _REG_RFLAGS: ::c_int = 23; -pub const _REG_RSP: ::c_int = 24; -pub const _REG_SS: ::c_int = 25; - // sys/xattr.h pub const XATTR_CREATE: ::c_int = 0x01; pub const XATTR_REPLACE: ::c_int = 0x02; @@ -2434,6 +2400,20 @@ pub const GRND_NONBLOCK: ::c_uint = 0x1; pub const GRND_RANDOM: ::c_uint = 0x2; pub const GRND_INSECURE: ::c_uint = 0x4; +// sys/reboot.h +pub const RB_ASKNAME: ::c_int = 0x000000001; +pub const RB_SINGLE: ::c_int = 0x000000002; +pub const RB_NOSYNC: ::c_int = 0x000000004; +pub const RB_HALT: ::c_int = 0x000000008; +pub const RB_INITNAME: ::c_int = 0x000000010; +pub const RB_KDB: ::c_int = 0x000000040; +pub const RB_RDONLY: ::c_int = 0x000000080; +pub const RB_DUMP: ::c_int = 0x000000100; +pub const RB_MINIROOT: ::c_int = 0x000000200; +pub const RB_STRING: ::c_int = 0x000000400; +pub const RB_POWERDOWN: ::c_int = RB_HALT | 0x000000800; +pub const RB_USERCONF: ::c_int = 0x000001000; + cfg_if! { if #[cfg(libc_const_extern_fn)] { @@ -2674,7 +2654,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; @@ -2789,12 +2769,6 @@ extern "C" { timeout: *const ::timespec, ) -> ::c_int; pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; - pub fn waitid( - idtype: idtype_t, - id: ::id_t, - infop: *mut ::siginfo_t, - options: ::c_int, - ) -> ::c_int; pub fn duplocale(base: ::locale_t) -> ::locale_t; pub fn freelocale(loc: ::locale_t); @@ -2907,83 +2881,9 @@ extern "C" { ts: *const ::timespec, sigmask: *const ::sigset_t, ) -> ::c_int; - pub fn posix_spawn( - pid: *mut ::pid_t, - path: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - pub fn posix_spawnp( - pid: *mut ::pid_t, - file: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_getsigdefault( - attr: *const posix_spawnattr_t, - default: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigdefault( - attr: *mut posix_spawnattr_t, - default: *const ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_getsigmask( - attr: *const posix_spawnattr_t, - default: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigmask( - attr: *mut posix_spawnattr_t, - default: *const ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_getflags( - attr: *const posix_spawnattr_t, - flags: *mut ::c_short, - ) -> ::c_int; - pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; - pub fn posix_spawnattr_getpgroup( - attr: *const posix_spawnattr_t, - flags: *mut ::pid_t, - ) -> ::c_int; - pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; - pub fn posix_spawnattr_getschedpolicy( - attr: *const posix_spawnattr_t, - flags: *mut ::c_int, - ) -> ::c_int; - pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; - pub fn posix_spawnattr_getschedparam( - attr: *const posix_spawnattr_t, - param: *mut ::sched_param, - ) -> ::c_int; - pub fn posix_spawnattr_setschedparam( - attr: *mut posix_spawnattr_t, - param: *const ::sched_param, - ) -> ::c_int; - - pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; - pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; - pub fn posix_spawn_file_actions_addopen( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - path: *const ::c_char, - oflag: ::c_int, - mode: ::mode_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_addclose( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - ) -> ::c_int; - pub fn posix_spawn_file_actions_adddup2( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - newfd: ::c_int, - ) -> ::c_int; pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + + pub fn reboot(mode: ::c_int, bootstr: *mut ::c_char) -> ::c_int; } #[link(name = "rt")] diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs index 2f6e44545..ba259074f 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs @@ -38,3 +38,30 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; + +pub const _REG_RDI: ::c_int = 0; +pub const _REG_RSI: ::c_int = 1; +pub const _REG_RDX: ::c_int = 2; +pub const _REG_RCX: ::c_int = 3; +pub const _REG_R8: ::c_int = 4; +pub const _REG_R9: ::c_int = 5; +pub const _REG_R10: ::c_int = 6; +pub const _REG_R11: ::c_int = 7; +pub const _REG_R12: ::c_int = 8; +pub const _REG_R13: ::c_int = 9; +pub const _REG_R14: ::c_int = 10; +pub const _REG_R15: ::c_int = 11; +pub const _REG_RBP: ::c_int = 12; +pub const _REG_RBX: ::c_int = 13; +pub const _REG_RAX: ::c_int = 14; +pub const _REG_GS: ::c_int = 15; +pub const _REG_FS: ::c_int = 16; +pub const _REG_ES: ::c_int = 17; +pub const _REG_DS: ::c_int = 18; +pub const _REG_TRAPNO: ::c_int = 19; +pub const _REG_ERR: ::c_int = 20; +pub const _REG_RIP: ::c_int = 21; +pub const _REG_CS: ::c_int = 22; +pub const _REG_RFLAGS: ::c_int = 23; +pub const _REG_RSP: ::c_int = 24; +pub const _REG_SS: ::c_int = 25; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs index ea90ba780..8f470aff9 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -41,6 +41,10 @@ pub type Elf64_Xword = u64; pub type ENTRY = entry; pub type ACTION = ::c_uint; +// spawn.h +pub type posix_spawnattr_t = *mut ::c_void; +pub type posix_spawn_file_actions_t = *mut ::c_void; + cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -541,6 +545,68 @@ s! { #[cfg(not(libc_union))] pub ifr_ifru: ::sockaddr, } + + pub struct tcp_info { + pub tcpi_state: u8, + pub __tcpi_ca_state: u8, + pub __tcpi_retransmits: u8, + pub __tcpi_probes: u8, + pub __tcpi_backoff: u8, + pub tcpi_options: u8, + pub tcpi_snd_wscale: u8, + pub tcpi_rcv_wscale: u8, + pub tcpi_rto: u32, + pub __tcpi_ato: u32, + pub tcpi_snd_mss: u32, + pub tcpi_rcv_mss: u32, + pub __tcpi_unacked: u32, + pub __tcpi_sacked: u32, + pub __tcpi_lost: u32, + pub __tcpi_retrans: u32, + pub __tcpi_fackets: u32, + pub tcpi_last_data_sent: u32, + pub tcpi_last_ack_sent: u32, + pub tcpi_last_data_recv: u32, + pub tcpi_last_ack_recv: u32, + pub __tcpi_pmtu: u32, + pub __tcpi_rcv_ssthresh: u32, + pub tcpi_rtt: u32, + pub tcpi_rttvar: u32, + pub tcpi_snd_ssthresh: u32, + pub tcpi_snd_cwnd: u32, + pub __tcpi_advmss: u32, + pub __tcpi_reordering: u32, + pub __tcpi_rcv_rtt: u32, + pub tcpi_rcv_space: u32, + pub tcpi_snd_wnd: u32, + pub tcpi_snd_nxt: u32, + pub tcpi_rcv_nxt: u32, + pub tcpi_toe_tid: u32, + pub tcpi_snd_rexmitpack: u32, + pub tcpi_rcv_ooopack: u32, + pub tcpi_snd_zerowin: u32, + pub tcpi_rttmin: u32, + pub tcpi_max_sndwnd: u32, + pub tcpi_rcv_adv: u32, + pub tcpi_rcv_up: u32, + pub tcpi_snd_una: u32, + pub tcpi_snd_up: u32, + pub tcpi_snd_wl1: u32, + pub tcpi_snd_wl2: u32, + pub tcpi_snd_max: u32, + pub tcpi_ts_recent: u32, + pub tcpi_ts_recent_age: u32, + pub tcpi_rfbuf_cnt: u32, + pub tcpi_rfbuf_ts: u32, + pub tcpi_so_rcv_sb_cc: u32, + pub tcpi_so_rcv_sb_hiwat: u32, + pub tcpi_so_rcv_sb_lowat: u32, + pub tcpi_so_rcv_sb_wat: u32, + pub tcpi_so_snd_sb_cc: u32, + pub tcpi_so_snd_sb_hiwat: u32, + pub tcpi_so_snd_sb_lowat: u32, + pub tcpi_so_snd_sb_wat: u32, + } } impl siginfo_t { @@ -659,7 +725,7 @@ s_no_extra_traits! { pub ifru_metric: ::c_int, pub ifru_vnetid: i64, pub ifru_media: u64, - pub ifru_data: *mut ::c_char, + pub ifru_data: ::caddr_t, pub ifru_index: ::c_uint, } } @@ -1229,6 +1295,7 @@ pub const O_DSYNC: ::c_int = 128; pub const MAP_RENAME: ::c_int = 0x0000; pub const MAP_NORESERVE: ::c_int = 0x0000; pub const MAP_HASSEMAPHORE: ::c_int = 0x0000; +pub const MAP_TRYFIXED: ::c_int = 0; pub const EIPSEC: ::c_int = 82; pub const ENOMEDIUM: ::c_int = 85; @@ -1830,6 +1897,25 @@ pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2; pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t; +// sys/reboot.h +pub const RB_ASKNAME: ::c_int = 0x00001; +pub const RB_SINGLE: ::c_int = 0x00002; +pub const RB_NOSYNC: ::c_int = 0x00004; +pub const RB_HALT: ::c_int = 0x00008; +pub const RB_INITNAME: ::c_int = 0x00010; +pub const RB_KDB: ::c_int = 0x00040; +pub const RB_RDONLY: ::c_int = 0x00080; +pub const RB_DUMP: ::c_int = 0x00100; +pub const RB_MINIROOT: ::c_int = 0x00200; +pub const RB_CONFIG: ::c_int = 0x00400; +pub const RB_TIMEBAD: ::c_int = 0x00800; +pub const RB_POWERDOWN: ::c_int = 0x01000; +pub const RB_SERCONS: ::c_int = 0x02000; +pub const RB_USERREQ: ::c_int = 0x04000; +pub const RB_RESET: ::c_int = 0x08000; +pub const RB_GOODRANDOM: ::c_int = 0x10000; +pub const RB_UNHIBERNATE: ::c_int = 0x20000; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES @@ -2057,6 +2143,8 @@ extern "C" { ) -> ::c_int; pub fn mimmutable(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + + pub fn reboot(mode: ::c_int) -> ::c_int; } #[link(name = "execinfo")] diff --git a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs index 99350ec8d..35f1672bb 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs @@ -1,6 +1,25 @@ pub type c_long = i64; pub type c_ulong = u64; pub type c_char = u8; +pub type ucontext_t = sigcontext; + +s! { + pub struct sigcontext { + __sc_unused: ::c_int, + pub sc_mask: ::c_int, + pub sc_ra: ::c_long, + pub sc_sp: ::c_long, + pub sc_gp: ::c_long, + pub sc_tp: ::c_long, + pub sc_t: [::c_long; 7], + pub sc_s: [::c_long; 12], + pub sc_a: [::c_long; 8], + pub sc_sepc: ::c_long, + pub sc_f: [::c_long; 32], + pub sc_fcsr: ::c_long, + pub sc_cookie: ::c_long, + } +} // should be pub(crate), but that requires Rust 1.18.0 cfg_if! { diff --git a/vendor/libc/src/unix/haiku/mod.rs b/vendor/libc/src/unix/haiku/mod.rs index 00e9523c9..e7b0f34dd 100644 --- a/vendor/libc/src/unix/haiku/mod.rs +++ b/vendor/libc/src/unix/haiku/mod.rs @@ -865,7 +865,7 @@ pub const LC_NUMERIC: ::c_int = 4; pub const LC_TIME: ::c_int = 5; pub const LC_MESSAGES: ::c_int = 6; -// FIXME: Haiku does not have MAP_FILE, but libstd/os.rs requires it +// FIXME: Haiku does not have MAP_FILE, but library/std/os.rs requires it pub const MAP_FILE: ::c_int = 0x00; pub const MAP_SHARED: ::c_int = 0x01; pub const MAP_PRIVATE: ::c_int = 0x02; @@ -1708,7 +1708,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn pthread_mutex_timedlock( @@ -1782,6 +1782,7 @@ extern "C" { groupcount: *mut ::c_int, ) -> ::c_int; pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; pub fn getgrnam_r( diff --git a/vendor/libc/src/unix/haiku/native.rs b/vendor/libc/src/unix/haiku/native.rs index 44bcc1e3b..62d6392fa 100644 --- a/vendor/libc/src/unix/haiku/native.rs +++ b/vendor/libc/src/unix/haiku/native.rs @@ -197,6 +197,50 @@ e! { B_UTILITIES_DIRECTORY, B_PACKAGE_LINKS_DIRECTORY, } + + // kernel/OS.h + + pub enum topology_level_type { + B_TOPOLOGY_UNKNOWN, + B_TOPOLOGY_ROOT, + B_TOPOLOGY_SMT, + B_TOPOLOGY_CORE, + B_TOPOLOGY_PACKAGE, + } + + pub enum cpu_platform { + B_CPU_UNKNOWN, + B_CPU_x86, + B_CPU_x86_64, + B_CPU_PPC, + B_CPU_PPC_64, + B_CPU_M68K, + B_CPU_ARM, + B_CPU_ARM_64, + B_CPU_ALPHA, + B_CPU_MIPS, + B_CPU_SH, + B_CPU_SPARC, + B_CPU_RISC_V + } + + pub enum cpu_vendor { + B_CPU_VENDOR_UNKNOWN, + B_CPU_VENDOR_AMD, + B_CPU_VENDOR_CYRIX, + B_CPU_VENDOR_IDT, + B_CPU_VENDOR_INTEL, + B_CPU_VENDOR_NATIONAL_SEMICONDUCTOR, + B_CPU_VENDOR_RISE, + B_CPU_VENDOR_TRANSMETA, + B_CPU_VENDOR_VIA, + B_CPU_VENDOR_IBM, + B_CPU_VENDOR_MOTOROLA, + B_CPU_VENDOR_NEC, + B_CPU_VENDOR_HYGON, + B_CPU_VENDOR_SUN, + B_CPU_VENDOR_FUJITSU + } } s! { @@ -310,6 +354,19 @@ s! { pub events: u16 } + pub struct cpu_topology_root_info { + pub platform: cpu_platform, + } + + pub struct cpu_topology_package_info { + pub vendor: cpu_vendor, + pub cache_line_size: u32, + } + + pub struct cpu_topology_core_info { + pub model: u32, + pub default_frequency: u64, + } // kernel/fs_attr.h pub struct attr_info { pub type_: u32, @@ -412,6 +469,23 @@ s_no_extra_traits! { pub as_chars: [::c_char; 16], pub regs: __c_anonymous_regs, } + + #[cfg(libc_union)] + pub union __c_anonymous_cpu_topology_info_data { + pub root: cpu_topology_root_info, + pub package: cpu_topology_package_info, + pub core: cpu_topology_core_info, + } + + pub struct cpu_topology_node_info { + pub id: u32, + pub type_: topology_level_type, + pub level: u32, + #[cfg(libc_union)] + pub data: __c_anonymous_cpu_topology_info_data, + #[cfg(not(libc_union))] + pub data: cpu_topology_core_info, + } } cfg_if! { @@ -446,6 +520,50 @@ cfg_if! { } } } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_cpu_topology_info_data { + fn eq(&self, other: &__c_anonymous_cpu_topology_info_data) -> bool { + unsafe { + self.root == other.root + || self.package == other.package + || self.core == other.core + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_cpu_topology_info_data {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_cpu_topology_info_data { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous_cpu_topology_info_data") + .field("root", &self.root) + .field("package", &self.package) + .field("core", &self.core) + .finish() + } + } + } + + impl PartialEq for cpu_topology_node_info { + fn eq(&self, other: &cpu_topology_node_info) -> bool { + self.id == other.id + && self.type_ == other.type_ + && self.level == other.level + } + } + + impl Eq for cpu_topology_node_info {} + impl ::fmt::Debug for cpu_topology_node_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("cpu_topology_node_info") + .field("id", &self.id) + .field("type", &self.type_) + .field("level", &self.level) + .finish() + } + } } } @@ -1026,6 +1144,10 @@ extern "C" { info: *mut cpu_info, size: ::size_t, ) -> status_t; + pub fn get_cpu_topology_info( + topologyInfos: *mut cpu_topology_node_info, + topologyInfoCount: *mut u32, + ) -> status_t; pub fn is_computer_on() -> i32; pub fn is_computer_on_fire() -> ::c_double; pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int; diff --git a/vendor/libc/src/unix/hurd/b32.rs b/vendor/libc/src/unix/hurd/b32.rs index 7e83ed930..7e82a91d3 100644 --- a/vendor/libc/src/unix/hurd/b32.rs +++ b/vendor/libc/src/unix/hurd/b32.rs @@ -25,6 +25,8 @@ pub type __ulong32_type = ::c_ulong; pub type __s64_type = ::__int64_t; pub type __u64_type = ::__uint64_t; +pub type __ipc_pid_t = ::c_ushort; + pub type Elf32_Half = u16; pub type Elf32_Word = u32; pub type Elf32_Off = u32; diff --git a/vendor/libc/src/unix/hurd/b64.rs b/vendor/libc/src/unix/hurd/b64.rs index 3b171f104..e2e502af2 100644 --- a/vendor/libc/src/unix/hurd/b64.rs +++ b/vendor/libc/src/unix/hurd/b64.rs @@ -25,6 +25,8 @@ pub type __ulong32_type = ::c_uint; pub type __s64_type = ::c_long; pub type __u64_type = ::c_ulong; +pub type __ipc_pid_t = ::c_int; + pub type Elf64_Half = u16; pub type Elf64_Word = u32; pub type Elf64_Off = u64; diff --git a/vendor/libc/src/unix/hurd/mod.rs b/vendor/libc/src/unix/hurd/mod.rs index 05d75851d..2701649f6 100644 --- a/vendor/libc/src/unix/hurd/mod.rs +++ b/vendor/libc/src/unix/hurd/mod.rs @@ -164,6 +164,7 @@ pub type pthread_key_t = __pthread_key; pub type pthread_once_t = __pthread_once; pub type __rlimit_resource = ::c_uint; +pub type __rlimit_resource_t = __rlimit_resource; pub type rlim_t = __rlim_t; pub type rlim64_t = __rlim64_t; @@ -215,6 +216,34 @@ pub type tcp_ca_state = ::c_uint; pub type idtype_t = ::c_uint; +pub type mqd_t = ::c_int; + +pub type Lmid_t = ::c_long; + +pub type regoff_t = ::c_int; + +pub type nl_item = ::c_int; + +pub type iconv_t = *mut ::c_void; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos64_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos64_t {} +impl ::Clone for fpos64_t { + fn clone(&self) -> fpos64_t { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + // structs s! { pub struct ip_mreq { @@ -228,6 +257,12 @@ s! { pub imr_ifindex: ::c_int, } + pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + pub imr_sourceaddr: in_addr, + } + pub struct sockaddr { pub sa_len: ::c_uchar, pub sa_family: sa_family_t, @@ -322,6 +357,12 @@ s! { pub msg_flags: ::c_int, } + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + pub struct dirent { pub d_ino: __ino_t, pub d_reclen: ::c_ushort, @@ -343,13 +384,39 @@ s! { } pub struct termios { - pub c_iflag: tcflag_t, - pub c_oflag: tcflag_t, - pub c_cflag: tcflag_t, - pub c_lflag: tcflag_t, - pub c_cc: [cc_t; 20usize], - pub __ispeed: speed_t, - pub __ospeed: speed_t, + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_cc: [::cc_t; 20usize], + pub __ispeed: ::speed_t, + pub __ospeed: ::speed_t, + } + + pub struct mallinfo { + pub arena: ::c_int, + pub ordblks: ::c_int, + pub smblks: ::c_int, + pub hblks: ::c_int, + pub hblkhd: ::c_int, + pub usmblks: ::c_int, + pub fsmblks: ::c_int, + pub uordblks: ::c_int, + pub fordblks: ::c_int, + pub keepcost: ::c_int, + } + + pub struct mallinfo2 { + pub arena: ::size_t, + pub ordblks: ::size_t, + pub smblks: ::size_t, + pub hblks: ::size_t, + pub hblkhd: ::size_t, + pub usmblks: ::size_t, + pub fsmblks: ::size_t, + pub uordblks: ::size_t, + pub fordblks: ::size_t, + pub keepcost: ::size_t, } pub struct sigaction { @@ -389,7 +456,7 @@ s! { pub struct stat { pub st_fstype: ::c_int, - pub st_fsid: __fsid_t, + pub st_dev: __fsid_t, /* Actually st_fsid */ pub st_ino: __ino_t, pub st_gen: ::c_uint, pub st_rdev: __dev_t, @@ -429,6 +496,36 @@ s! { pub st_spare: [::c_int; 8usize], } + pub struct statx { + pub stx_mask: u32, + pub stx_blksize: u32, + pub stx_attributes: u64, + pub stx_nlink: u32, + pub stx_uid: u32, + pub stx_gid: u32, + pub stx_mode: u16, + __statx_pad1: [u16; 1], + pub stx_ino: u64, + pub stx_size: u64, + pub stx_blocks: u64, + pub stx_attributes_mask: u64, + pub stx_atime: ::statx_timestamp, + pub stx_btime: ::statx_timestamp, + pub stx_ctime: ::statx_timestamp, + pub stx_mtime: ::statx_timestamp, + pub stx_rdev_major: u32, + pub stx_rdev_minor: u32, + pub stx_dev_major: u32, + pub stx_dev_minor: u32, + __statx_pad2: [u64; 14], + } + + pub struct statx_timestamp { + pub tv_sec: i64, + pub tv_nsec: u32, + pub __statx_timestamp_pad1: [i32; 1], + } + pub struct statfs { pub f_type: ::c_uint, pub f_bsize: ::c_ulong, @@ -493,6 +590,36 @@ s! { pub f_spare: [::c_uint; 3usize], } + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __next_prio: *mut aiocb, + __abs_prio: ::c_int, + __policy: ::c_int, + __error_code: ::c_int, + __return_value: ::ssize_t, + pub aio_offset: off_t, + #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] + __unused1: [::c_char; 4], + __glibc_reserved: [::c_char; 32] + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + } + + pub struct __exit_status { + pub e_termination: ::c_short, + pub e_exit: ::c_short, + } + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] #[cfg_attr(target_pointer_width = "64", @@ -549,7 +676,7 @@ s! { } pub struct __pthread_attr { - pub __schedparam: __sched_param, + pub __schedparam: sched_param, pub __stackaddr: *mut ::c_void, pub __stacksize: size_t, pub __guardsize: size_t, @@ -578,12 +705,25 @@ s! { pub __data: *mut ::c_void, } + pub struct seminfo { + pub semmap: ::c_int, + pub semmni: ::c_int, + pub semmns: ::c_int, + pub semmnu: ::c_int, + pub semmsl: ::c_int, + pub semopm: ::c_int, + pub semume: ::c_int, + pub semusz: ::c_int, + pub semvmx: ::c_int, + pub semaem: ::c_int, + } + pub struct _IO_FILE { _unused: [u8; 0], } - pub struct __sched_param { - pub __sched_priority: ::c_int, + pub struct sched_param { + pub sched_priority: ::c_int, } pub struct iovec { @@ -601,6 +741,23 @@ s! { pub pw_shell: *mut ::c_char, } + pub struct spwd { + pub sp_namp: *mut ::c_char, + pub sp_pwdp: *mut ::c_char, + pub sp_lstchg: ::c_long, + pub sp_min: ::c_long, + pub sp_max: ::c_long, + pub sp_warn: ::c_long, + pub sp_inact: ::c_long, + pub sp_expire: ::c_long, + pub sp_flag: ::c_ulong, + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + pub struct tm { pub tm_sec: ::c_int, pub tm_min: ::c_int, @@ -649,6 +806,59 @@ s! { pub dli_saddr: *mut ::c_void, } + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *mut c_char, + pub ifa_flags: ::c_uint, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union + pub ifa_data: *mut ::c_void + } + + pub struct arpreq { + pub arp_pa: ::sockaddr, + pub arp_ha: ::sockaddr, + pub arp_flags: ::c_int, + pub arp_netmask: ::sockaddr, + pub arp_dev: [::c_char; 16], + } + + pub struct arpreq_old { + pub arp_pa: ::sockaddr, + pub arp_ha: ::sockaddr, + pub arp_flags: ::c_int, + pub arp_netmask: ::sockaddr, + } + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct arpd_request { + pub req: ::c_ushort, + pub ip: u32, + pub dev: ::c_ulong, + pub stamp: ::c_ulong, + pub updated: ::c_ulong, + pub ha: [::c_uchar; ::MAX_ADDR_LEN], + } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } + + pub struct ifreq { + /// interface name, e.g. "en0" + pub ifr_name: [::c_char; ::IFNAMSIZ], + pub ifr_ifru: ::sockaddr, + } + pub struct __locale_struct { pub __locales: [*mut __locale_data; 13usize], pub __ctype_b: *const ::c_ushort, @@ -715,6 +925,204 @@ s! { pub l_len : __off64_t, pub l_pid : __pid_t, } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct glob64_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut ::c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct regex_t { + __buffer: *mut ::c_void, + __allocated: ::size_t, + __used: ::size_t, + __syntax: ::c_ulong, + __fastmap: *mut ::c_char, + __translate: *mut ::c_char, + __re_nsub: ::size_t, + __bitfield: u8, + } + + pub struct cpu_set_t { + #[cfg(all(target_pointer_width = "32", + not(target_arch = "x86_64")))] + bits: [u32; 32], + #[cfg(not(all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + bits: [u64; 16], + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + // System V IPC + pub struct msginfo { + pub msgpool: ::c_int, + pub msgmap: ::c_int, + pub msgmax: ::c_int, + pub msgmnb: ::c_int, + pub msgmni: ::c_int, + pub msgssz: ::c_int, + pub msgtql: ::c_int, + pub msgseg: ::c_ushort, + } + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct mntent { + pub mnt_fsname: *mut ::c_char, + pub mnt_dir: *mut ::c_char, + pub mnt_type: *mut ::c_char, + pub mnt_opts: *mut ::c_char, + pub mnt_freq: ::c_int, + pub mnt_passno: ::c_int, + } + + pub struct posix_spawn_file_actions_t { + __allocated: ::c_int, + __used: ::c_int, + __actions: *mut ::c_int, + __pad: [::c_int; 16], + } + + pub struct posix_spawnattr_t { + __flags: ::c_short, + __pgrp: ::pid_t, + __sd: ::sigset_t, + __ss: ::sigset_t, + __sp: ::sched_param, + __policy: ::c_int, + __pad: [::c_int; 16], + } + + pub struct regmatch_t { + pub rm_so: regoff_t, + pub rm_eo: regoff_t, + } + + pub struct option { + pub name: *const ::c_char, + pub has_arg: ::c_int, + pub flag: *mut ::c_int, + pub val: ::c_int, + } + +} + +s_no_extra_traits! { + pub struct utmpx { + pub ut_type: ::c_short, + pub ut_pid: ::pid_t, + pub ut_line: [::c_char; __UT_LINESIZE], + pub ut_id: [::c_char; 4], + + pub ut_user: [::c_char; __UT_NAMESIZE], + pub ut_host: [::c_char; __UT_HOSTSIZE], + pub ut_exit: __exit_status, + + #[cfg(any( all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_session: ::c_long, + #[cfg(any(all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_tv: ::timeval, + + #[cfg(not(any(all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_session: i32, + #[cfg(not(any(all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_tv: __timeval, + + pub ut_addr_v6: [i32; 4], + __glibc_reserved: [::c_char; 20], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self.ut_line == other.ut_line + && self.ut_id == other.ut_id + && self.ut_user == other.ut_user + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + && self.ut_tv == other.ut_tv + && self.ut_addr_v6 == other.ut_addr_v6 + && self.__glibc_reserved == other.__glibc_reserved + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_type", &self.ut_type) + .field("ut_pid", &self.ut_pid) + .field("ut_line", &self.ut_line) + .field("ut_id", &self.ut_id) + .field("ut_user", &self.ut_user) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_exit", &self.ut_exit) + .field("ut_session", &self.ut_session) + .field("ut_tv", &self.ut_tv) + .field("ut_addr_v6", &self.ut_addr_v6) + .field("__glibc_reserved", &self.__glibc_reserved) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_user.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + self.ut_tv.hash(state); + self.ut_addr_v6.hash(state); + self.__glibc_reserved.hash(state); + } + } + } } impl siginfo_t { @@ -740,16 +1148,69 @@ impl siginfo_t { } // const -pub const IPOPT_COPY: u8 = 0x80; -pub const IPOPT_NUMBER_MASK: u8 = 0x1f; -pub const IPOPT_CLASS_MASK: u8 = 0x60; -pub const IPTOS_ECN_MASK: u8 = 0x03; -pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; +// aio.h +pub const AIO_CANCELED: ::c_int = 0; +pub const AIO_NOTCANCELED: ::c_int = 1; +pub const AIO_ALLDONE: ::c_int = 2; +pub const LIO_READ: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 1; +pub const LIO_NOP: ::c_int = 2; +pub const LIO_WAIT: ::c_int = 0; +pub const LIO_NOWAIT: ::c_int = 1; + +// glob.h +pub const GLOB_ERR: ::c_int = 1 << 0; +pub const GLOB_MARK: ::c_int = 1 << 1; +pub const GLOB_NOSORT: ::c_int = 1 << 2; +pub const GLOB_DOOFFS: ::c_int = 1 << 3; +pub const GLOB_NOCHECK: ::c_int = 1 << 4; +pub const GLOB_APPEND: ::c_int = 1 << 5; +pub const GLOB_NOESCAPE: ::c_int = 1 << 6; + +pub const GLOB_NOSPACE: ::c_int = 1; +pub const GLOB_ABORTED: ::c_int = 2; +pub const GLOB_NOMATCH: ::c_int = 3; + +pub const GLOB_PERIOD: ::c_int = 1 << 7; +pub const GLOB_ALTDIRFUNC: ::c_int = 1 << 9; +pub const GLOB_BRACE: ::c_int = 1 << 10; +pub const GLOB_NOMAGIC: ::c_int = 1 << 11; +pub const GLOB_TILDE: ::c_int = 1 << 12; +pub const GLOB_ONLYDIR: ::c_int = 1 << 13; +pub const GLOB_TILDE_CHECK: ::c_int = 1 << 14; + +// ipc.h +pub const IPC_PRIVATE: ::key_t = 0; + +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_INFO: ::c_int = 3; +pub const MSG_STAT: ::c_int = 11; +pub const MSG_INFO: ::c_int = 12; + +pub const MSG_NOERROR: ::c_int = 0o10000; +pub const MSG_EXCEPT: ::c_int = 0o20000; + +// shm.h +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_REMAP: ::c_int = 0o40000; + +pub const SHM_LOCK: ::c_int = 11; +pub const SHM_UNLOCK: ::c_int = 12; // unistd.h -pub const STDIN_FILENO: c_long = 0; -pub const STDOUT_FILENO: c_long = 1; -pub const STDERR_FILENO: c_long = 2; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; pub const __FD_SETSIZE: usize = 256; pub const R_OK: ::c_int = 4; pub const W_OK: ::c_int = 2; @@ -769,6 +1230,9 @@ pub const F_TLOCK: ::c_int = 2; pub const F_TEST: ::c_int = 3; pub const CLOSE_RANGE_CLOEXEC: ::c_int = 4; +// stdio.h +pub const EOF: ::c_int = -1; + // stdlib.h pub const WNOHANG: ::c_int = 1; pub const WUNTRACED: ::c_int = 2; @@ -884,8 +1348,17 @@ pub const _SS_SIZE: usize = 128; pub const CMGROUP_MAX: usize = 16; pub const SOL_SOCKET: ::c_int = 65535; +// sys/time.h +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + // netinet/in.h pub const SOL_IP: ::c_int = 0; +pub const SOL_TCP: ::c_int = 6; +pub const SOL_UDP: ::c_int = 17; +pub const SOL_IPV6: ::c_int = 41; +pub const SOL_ICMPV6: ::c_int = 58; pub const IP_OPTIONS: ::c_int = 1; pub const IP_HDRINCL: ::c_int = 2; pub const IP_TOS: ::c_int = 3; @@ -899,8 +1372,6 @@ pub const IP_MULTICAST_TTL: ::c_int = 10; pub const IP_MULTICAST_LOOP: ::c_int = 11; pub const IP_ADD_MEMBERSHIP: ::c_int = 12; pub const IP_DROP_MEMBERSHIP: ::c_int = 13; -pub const SOL_IPV6: ::c_int = 41; -pub const SOL_ICMPV6: ::c_int = 58; pub const IPV6_ADDRFORM: ::c_int = 1; pub const IPV6_2292PKTINFO: ::c_int = 2; pub const IPV6_2292HOPOPTS: ::c_int = 3; @@ -965,6 +1436,143 @@ pub const IN_LOOPBACKNET: u32 = 127; pub const INET_ADDRSTRLEN: usize = 16; pub const INET6_ADDRSTRLEN: usize = 46; +// netinet/ip.h +pub const IPTOS_TOS_MASK: u8 = 0x1E; +pub const IPTOS_PREC_MASK: u8 = 0xE0; + +pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; + +pub const IPTOS_LOWDELAY: u8 = 0x10; +pub const IPTOS_THROUGHPUT: u8 = 0x08; +pub const IPTOS_RELIABILITY: u8 = 0x04; +pub const IPTOS_MINCOST: u8 = 0x02; + +pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; +pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; +pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; +pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; +pub const IPTOS_PREC_FLASH: u8 = 0x60; +pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; +pub const IPTOS_PREC_PRIORITY: u8 = 0x20; +pub const IPTOS_PREC_ROUTINE: u8 = 0x00; + +pub const IPTOS_ECN_MASK: u8 = 0x03; +pub const IPTOS_ECN_ECT1: u8 = 0x01; +pub const IPTOS_ECN_ECT0: u8 = 0x02; +pub const IPTOS_ECN_CE: u8 = 0x03; + +pub const IPOPT_COPY: u8 = 0x80; +pub const IPOPT_CLASS_MASK: u8 = 0x60; +pub const IPOPT_NUMBER_MASK: u8 = 0x1f; + +pub const IPOPT_CONTROL: u8 = 0x00; +pub const IPOPT_RESERVED1: u8 = 0x20; +pub const IPOPT_MEASUREMENT: u8 = 0x40; +pub const IPOPT_RESERVED2: u8 = 0x60; +pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL; +pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL; +pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT; +pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL; +pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPVERSION: u8 = 4; +pub const MAXTTL: u8 = 255; +pub const IPDEFTTL: u8 = 64; +pub const IPOPT_OPTVAL: u8 = 0; +pub const IPOPT_OLEN: u8 = 1; +pub const IPOPT_OFFSET: u8 = 2; +pub const IPOPT_MINOFF: u8 = 4; +pub const MAX_IPOPTLEN: u8 = 40; +pub const IPOPT_NOP: u8 = IPOPT_NOOP; +pub const IPOPT_EOL: u8 = IPOPT_END; +pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP; +pub const IPOPT_TS_TSONLY: u8 = 0; +pub const IPOPT_TS_TSANDADDR: u8 = 1; +pub const IPOPT_TS_PRESPEC: u8 = 3; + +// net/if_arp.h +pub const ARPOP_REQUEST: u16 = 1; +pub const ARPOP_REPLY: u16 = 2; +pub const ARPOP_RREQUEST: u16 = 3; +pub const ARPOP_RREPLY: u16 = 4; +pub const ARPOP_InREQUEST: u16 = 8; +pub const ARPOP_InREPLY: u16 = 9; +pub const ARPOP_NAK: u16 = 10; + +pub const MAX_ADDR_LEN: usize = 7; +pub const ARPD_UPDATE: ::c_ushort = 0x01; +pub const ARPD_LOOKUP: ::c_ushort = 0x02; +pub const ARPD_FLUSH: ::c_ushort = 0x03; +pub const ATF_MAGIC: ::c_int = 0x80; + +pub const ATF_NETMASK: ::c_int = 0x20; +pub const ATF_DONTPUB: ::c_int = 0x40; + +pub const ARPHRD_NETROM: u16 = 0; +pub const ARPHRD_ETHER: u16 = 1; +pub const ARPHRD_EETHER: u16 = 2; +pub const ARPHRD_AX25: u16 = 3; +pub const ARPHRD_PRONET: u16 = 4; +pub const ARPHRD_CHAOS: u16 = 5; +pub const ARPHRD_IEEE802: u16 = 6; +pub const ARPHRD_ARCNET: u16 = 7; +pub const ARPHRD_APPLETLK: u16 = 8; +pub const ARPHRD_DLCI: u16 = 15; +pub const ARPHRD_ATM: u16 = 19; +pub const ARPHRD_METRICOM: u16 = 23; +pub const ARPHRD_IEEE1394: u16 = 24; +pub const ARPHRD_EUI64: u16 = 27; +pub const ARPHRD_INFINIBAND: u16 = 32; + +pub const ARPHRD_SLIP: u16 = 256; +pub const ARPHRD_CSLIP: u16 = 257; +pub const ARPHRD_SLIP6: u16 = 258; +pub const ARPHRD_CSLIP6: u16 = 259; +pub const ARPHRD_RSRVD: u16 = 260; +pub const ARPHRD_ADAPT: u16 = 264; +pub const ARPHRD_ROSE: u16 = 270; +pub const ARPHRD_X25: u16 = 271; +pub const ARPHRD_HWX25: u16 = 272; +pub const ARPHRD_CAN: u16 = 280; +pub const ARPHRD_PPP: u16 = 512; +pub const ARPHRD_CISCO: u16 = 513; +pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO; +pub const ARPHRD_LAPB: u16 = 516; +pub const ARPHRD_DDCMP: u16 = 517; +pub const ARPHRD_RAWHDLC: u16 = 518; + +pub const ARPHRD_TUNNEL: u16 = 768; +pub const ARPHRD_TUNNEL6: u16 = 769; +pub const ARPHRD_FRAD: u16 = 770; +pub const ARPHRD_SKIP: u16 = 771; +pub const ARPHRD_LOOPBACK: u16 = 772; +pub const ARPHRD_LOCALTLK: u16 = 773; +pub const ARPHRD_FDDI: u16 = 774; +pub const ARPHRD_BIF: u16 = 775; +pub const ARPHRD_SIT: u16 = 776; +pub const ARPHRD_IPDDP: u16 = 777; +pub const ARPHRD_IPGRE: u16 = 778; +pub const ARPHRD_PIMREG: u16 = 779; +pub const ARPHRD_HIPPI: u16 = 780; +pub const ARPHRD_ASH: u16 = 781; +pub const ARPHRD_ECONET: u16 = 782; +pub const ARPHRD_IRDA: u16 = 783; +pub const ARPHRD_FCPP: u16 = 784; +pub const ARPHRD_FCAL: u16 = 785; +pub const ARPHRD_FCPL: u16 = 786; +pub const ARPHRD_FCFABRIC: u16 = 787; +pub const ARPHRD_IEEE802_TR: u16 = 800; +pub const ARPHRD_IEEE80211: u16 = 801; +pub const ARPHRD_IEEE80211_PRISM: u16 = 802; +pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803; +pub const ARPHRD_IEEE802154: u16 = 804; + +pub const ARPHRD_VOID: u16 = 0xFFFF; +pub const ARPHRD_NONE: u16 = 0xFFFE; + // bits/posix1_lim.h pub const _POSIX_AIO_LISTIO_MAX: usize = 2; pub const _POSIX_AIO_MAX: usize = 1; @@ -1063,13 +1671,13 @@ pub const NI_DGRAM: ::c_int = 16; pub const NI_IDN: ::c_int = 32; // time.h -pub const CLOCK_REALTIME: clockid_t = 0; -pub const CLOCK_MONOTONIC: clockid_t = 1; -pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 2; -pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 3; -pub const CLOCK_MONOTONIC_RAW: clockid_t = 4; -pub const CLOCK_REALTIME_COARSE: clockid_t = 5; -pub const CLOCK_MONOTONIC_COARSE: clockid_t = 6; +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 1; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3; +pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4; +pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5; +pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6; pub const TIMER_ABSTIME: ::c_int = 1; pub const TIME_UTC: ::c_int = 1; @@ -1126,155 +1734,234 @@ pub const LC_MEASUREMENT_MASK: ::c_int = 2048; pub const LC_IDENTIFICATION_MASK: ::c_int = 4096; pub const LC_ALL_MASK: ::c_int = 8127; +pub const ABDAY_1: ::nl_item = 0x20000; +pub const ABDAY_2: ::nl_item = 0x20001; +pub const ABDAY_3: ::nl_item = 0x20002; +pub const ABDAY_4: ::nl_item = 0x20003; +pub const ABDAY_5: ::nl_item = 0x20004; +pub const ABDAY_6: ::nl_item = 0x20005; +pub const ABDAY_7: ::nl_item = 0x20006; + +pub const DAY_1: ::nl_item = 0x20007; +pub const DAY_2: ::nl_item = 0x20008; +pub const DAY_3: ::nl_item = 0x20009; +pub const DAY_4: ::nl_item = 0x2000A; +pub const DAY_5: ::nl_item = 0x2000B; +pub const DAY_6: ::nl_item = 0x2000C; +pub const DAY_7: ::nl_item = 0x2000D; + +pub const ABMON_1: ::nl_item = 0x2000E; +pub const ABMON_2: ::nl_item = 0x2000F; +pub const ABMON_3: ::nl_item = 0x20010; +pub const ABMON_4: ::nl_item = 0x20011; +pub const ABMON_5: ::nl_item = 0x20012; +pub const ABMON_6: ::nl_item = 0x20013; +pub const ABMON_7: ::nl_item = 0x20014; +pub const ABMON_8: ::nl_item = 0x20015; +pub const ABMON_9: ::nl_item = 0x20016; +pub const ABMON_10: ::nl_item = 0x20017; +pub const ABMON_11: ::nl_item = 0x20018; +pub const ABMON_12: ::nl_item = 0x20019; + +pub const MON_1: ::nl_item = 0x2001A; +pub const MON_2: ::nl_item = 0x2001B; +pub const MON_3: ::nl_item = 0x2001C; +pub const MON_4: ::nl_item = 0x2001D; +pub const MON_5: ::nl_item = 0x2001E; +pub const MON_6: ::nl_item = 0x2001F; +pub const MON_7: ::nl_item = 0x20020; +pub const MON_8: ::nl_item = 0x20021; +pub const MON_9: ::nl_item = 0x20022; +pub const MON_10: ::nl_item = 0x20023; +pub const MON_11: ::nl_item = 0x20024; +pub const MON_12: ::nl_item = 0x20025; + +pub const AM_STR: ::nl_item = 0x20026; +pub const PM_STR: ::nl_item = 0x20027; + +pub const D_T_FMT: ::nl_item = 0x20028; +pub const D_FMT: ::nl_item = 0x20029; +pub const T_FMT: ::nl_item = 0x2002A; +pub const T_FMT_AMPM: ::nl_item = 0x2002B; + +pub const ERA: ::nl_item = 0x2002C; +pub const ERA_D_FMT: ::nl_item = 0x2002E; +pub const ALT_DIGITS: ::nl_item = 0x2002F; +pub const ERA_D_T_FMT: ::nl_item = 0x20030; +pub const ERA_T_FMT: ::nl_item = 0x20031; + +pub const CODESET: ::nl_item = 14; +pub const CRNCYSTR: ::nl_item = 0x4000F; +pub const RADIXCHAR: ::nl_item = 0x10000; +pub const THOUSEP: ::nl_item = 0x10001; +pub const YESEXPR: ::nl_item = 0x50000; +pub const NOEXPR: ::nl_item = 0x50001; +pub const YESSTR: ::nl_item = 0x50002; +pub const NOSTR: ::nl_item = 0x50003; + +// reboot.h +pub const RB_AUTOBOOT: ::c_int = 0x0; +pub const RB_ASKNAME: ::c_int = 0x1; +pub const RB_SINGLE: ::c_int = 0x2; +pub const RB_KBD: ::c_int = 0x4; +pub const RB_HALT: ::c_int = 0x8; +pub const RB_INITNAME: ::c_int = 0x10; +pub const RB_DFLTROOT: ::c_int = 0x20; +pub const RB_NOBOOTRC: ::c_int = 0x20; +pub const RB_ALTBOOT: ::c_int = 0x40; +pub const RB_UNIPROC: ::c_int = 0x80; +pub const RB_DEBUGGER: ::c_int = 0x1000; + // semaphore.h pub const __SIZEOF_SEM_T: usize = 20; +pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; // termios.h -pub const IGNBRK: tcflag_t = 1; -pub const BRKINT: tcflag_t = 2; -pub const IGNPAR: tcflag_t = 4; -pub const PARMRK: tcflag_t = 8; -pub const INPCK: tcflag_t = 16; -pub const ISTRIP: tcflag_t = 32; -pub const INLCR: tcflag_t = 64; -pub const IGNCR: tcflag_t = 128; -pub const ICRNL: tcflag_t = 256; -pub const IXON: tcflag_t = 512; -pub const IXOFF: tcflag_t = 1024; -pub const IXANY: tcflag_t = 2048; -pub const IMAXBEL: tcflag_t = 8192; -pub const IUCLC: tcflag_t = 16384; -pub const OPOST: tcflag_t = 1; -pub const ONLCR: tcflag_t = 2; -pub const ONOEOT: tcflag_t = 8; -pub const OCRNL: tcflag_t = 16; -pub const ONOCR: tcflag_t = 32; -pub const ONLRET: tcflag_t = 64; -pub const NLDLY: tcflag_t = 768; -pub const NL0: tcflag_t = 0; -pub const NL1: tcflag_t = 256; -pub const TABDLY: tcflag_t = 3076; -pub const TAB0: tcflag_t = 0; -pub const TAB1: tcflag_t = 1024; -pub const TAB2: tcflag_t = 2048; -pub const TAB3: tcflag_t = 4; -pub const CRDLY: tcflag_t = 12288; -pub const CR0: tcflag_t = 0; -pub const CR1: tcflag_t = 4096; -pub const CR2: tcflag_t = 8192; -pub const CR3: tcflag_t = 12288; -pub const FFDLY: tcflag_t = 16384; -pub const FF0: tcflag_t = 0; -pub const FF1: tcflag_t = 16384; -pub const BSDLY: tcflag_t = 32768; -pub const BS0: tcflag_t = 0; -pub const BS1: tcflag_t = 32768; -pub const VTDLY: tcflag_t = 65536; -pub const VT0: tcflag_t = 0; -pub const VT1: tcflag_t = 65536; -pub const OLCUC: tcflag_t = 131072; -pub const OFILL: tcflag_t = 262144; -pub const OFDEL: tcflag_t = 524288; -pub const CIGNORE: tcflag_t = 1; -pub const CSIZE: tcflag_t = 768; -pub const CS5: tcflag_t = 0; -pub const CS6: tcflag_t = 256; -pub const CS7: tcflag_t = 512; -pub const CS8: tcflag_t = 768; -pub const CSTOPB: tcflag_t = 1024; -pub const CREAD: tcflag_t = 2048; -pub const PARENB: tcflag_t = 4096; -pub const PARODD: tcflag_t = 8192; -pub const HUPCL: tcflag_t = 16384; -pub const CLOCAL: tcflag_t = 32768; -pub const CRTSCTS: tcflag_t = 65536; -pub const CRTS_IFLOW: tcflag_t = 65536; -pub const CCTS_OFLOW: tcflag_t = 65536; -pub const CDTRCTS: tcflag_t = 131072; -pub const MDMBUF: tcflag_t = 1048576; -pub const CHWFLOW: tcflag_t = 1245184; -pub const ECHOKE: tcflag_t = 1; -pub const _ECHOE: tcflag_t = 2; -pub const ECHOE: tcflag_t = 2; -pub const _ECHOK: tcflag_t = 4; -pub const ECHOK: tcflag_t = 4; -pub const _ECHO: tcflag_t = 8; -pub const ECHO: tcflag_t = 8; -pub const _ECHONL: tcflag_t = 16; -pub const ECHONL: tcflag_t = 16; -pub const ECHOPRT: tcflag_t = 32; -pub const ECHOCTL: tcflag_t = 64; -pub const _ISIG: tcflag_t = 128; -pub const ISIG: tcflag_t = 128; -pub const _ICANON: tcflag_t = 256; -pub const ICANON: tcflag_t = 256; -pub const ALTWERASE: tcflag_t = 512; -pub const _IEXTEN: tcflag_t = 1024; -pub const IEXTEN: tcflag_t = 1024; -pub const EXTPROC: tcflag_t = 2048; -pub const _TOSTOP: tcflag_t = 4194304; -pub const TOSTOP: tcflag_t = 4194304; -pub const FLUSHO: tcflag_t = 8388608; -pub const NOKERNINFO: tcflag_t = 33554432; -pub const PENDIN: tcflag_t = 536870912; -pub const _NOFLSH: tcflag_t = 2147483648; -pub const NOFLSH: tcflag_t = 2147483648; -pub const VEOF: cc_t = 0; -pub const VEOL: cc_t = 1; -pub const VEOL2: cc_t = 2; -pub const VERASE: cc_t = 3; -pub const VWERASE: cc_t = 4; -pub const VKILL: cc_t = 5; -pub const VREPRINT: cc_t = 6; -pub const VINTR: cc_t = 8; -pub const VQUIT: cc_t = 9; -pub const VSUSP: cc_t = 10; -pub const VDSUSP: cc_t = 11; -pub const VSTART: cc_t = 12; -pub const VSTOP: cc_t = 13; -pub const VLNEXT: cc_t = 14; -pub const VDISCARD: cc_t = 15; -pub const VMIN: cc_t = 16; -pub const VTIME: cc_t = 17; -pub const VSTATUS: cc_t = 18; +pub const IGNBRK: ::tcflag_t = 1; +pub const BRKINT: ::tcflag_t = 2; +pub const IGNPAR: ::tcflag_t = 4; +pub const PARMRK: ::tcflag_t = 8; +pub const INPCK: ::tcflag_t = 16; +pub const ISTRIP: ::tcflag_t = 32; +pub const INLCR: ::tcflag_t = 64; +pub const IGNCR: ::tcflag_t = 128; +pub const ICRNL: ::tcflag_t = 256; +pub const IXON: ::tcflag_t = 512; +pub const IXOFF: ::tcflag_t = 1024; +pub const IXANY: ::tcflag_t = 2048; +pub const IMAXBEL: ::tcflag_t = 8192; +pub const IUCLC: ::tcflag_t = 16384; +pub const OPOST: ::tcflag_t = 1; +pub const ONLCR: ::tcflag_t = 2; +pub const ONOEOT: ::tcflag_t = 8; +pub const OCRNL: ::tcflag_t = 16; +pub const ONOCR: ::tcflag_t = 32; +pub const ONLRET: ::tcflag_t = 64; +pub const NLDLY: ::tcflag_t = 768; +pub const NL0: ::tcflag_t = 0; +pub const NL1: ::tcflag_t = 256; +pub const TABDLY: ::tcflag_t = 3076; +pub const TAB0: ::tcflag_t = 0; +pub const TAB1: ::tcflag_t = 1024; +pub const TAB2: ::tcflag_t = 2048; +pub const TAB3: ::tcflag_t = 4; +pub const CRDLY: ::tcflag_t = 12288; +pub const CR0: ::tcflag_t = 0; +pub const CR1: ::tcflag_t = 4096; +pub const CR2: ::tcflag_t = 8192; +pub const CR3: ::tcflag_t = 12288; +pub const FFDLY: ::tcflag_t = 16384; +pub const FF0: ::tcflag_t = 0; +pub const FF1: ::tcflag_t = 16384; +pub const BSDLY: ::tcflag_t = 32768; +pub const BS0: ::tcflag_t = 0; +pub const BS1: ::tcflag_t = 32768; +pub const VTDLY: ::tcflag_t = 65536; +pub const VT0: ::tcflag_t = 0; +pub const VT1: ::tcflag_t = 65536; +pub const OLCUC: ::tcflag_t = 131072; +pub const OFILL: ::tcflag_t = 262144; +pub const OFDEL: ::tcflag_t = 524288; +pub const CIGNORE: ::tcflag_t = 1; +pub const CSIZE: ::tcflag_t = 768; +pub const CS5: ::tcflag_t = 0; +pub const CS6: ::tcflag_t = 256; +pub const CS7: ::tcflag_t = 512; +pub const CS8: ::tcflag_t = 768; +pub const CSTOPB: ::tcflag_t = 1024; +pub const CREAD: ::tcflag_t = 2048; +pub const PARENB: ::tcflag_t = 4096; +pub const PARODD: ::tcflag_t = 8192; +pub const HUPCL: ::tcflag_t = 16384; +pub const CLOCAL: ::tcflag_t = 32768; +pub const CRTSCTS: ::tcflag_t = 65536; +pub const CRTS_IFLOW: ::tcflag_t = 65536; +pub const CCTS_OFLOW: ::tcflag_t = 65536; +pub const CDTRCTS: ::tcflag_t = 131072; +pub const MDMBUF: ::tcflag_t = 1048576; +pub const CHWFLOW: ::tcflag_t = 1245184; +pub const ECHOKE: ::tcflag_t = 1; +pub const _ECHOE: ::tcflag_t = 2; +pub const ECHOE: ::tcflag_t = 2; +pub const _ECHOK: ::tcflag_t = 4; +pub const ECHOK: ::tcflag_t = 4; +pub const _ECHO: ::tcflag_t = 8; +pub const ECHO: ::tcflag_t = 8; +pub const _ECHONL: ::tcflag_t = 16; +pub const ECHONL: ::tcflag_t = 16; +pub const ECHOPRT: ::tcflag_t = 32; +pub const ECHOCTL: ::tcflag_t = 64; +pub const _ISIG: ::tcflag_t = 128; +pub const ISIG: ::tcflag_t = 128; +pub const _ICANON: ::tcflag_t = 256; +pub const ICANON: ::tcflag_t = 256; +pub const ALTWERASE: ::tcflag_t = 512; +pub const _IEXTEN: ::tcflag_t = 1024; +pub const IEXTEN: ::tcflag_t = 1024; +pub const EXTPROC: ::tcflag_t = 2048; +pub const _TOSTOP: ::tcflag_t = 4194304; +pub const TOSTOP: ::tcflag_t = 4194304; +pub const FLUSHO: ::tcflag_t = 8388608; +pub const NOKERNINFO: ::tcflag_t = 33554432; +pub const PENDIN: ::tcflag_t = 536870912; +pub const _NOFLSH: ::tcflag_t = 2147483648; +pub const NOFLSH: ::tcflag_t = 2147483648; +pub const VEOF: usize = 0; +pub const VEOL: usize = 1; +pub const VEOL2: usize = 2; +pub const VERASE: usize = 3; +pub const VWERASE: usize = 4; +pub const VKILL: usize = 5; +pub const VREPRINT: usize = 6; +pub const VINTR: usize = 8; +pub const VQUIT: usize = 9; +pub const VSUSP: usize = 10; +pub const VDSUSP: usize = 11; +pub const VSTART: usize = 12; +pub const VSTOP: usize = 13; +pub const VLNEXT: usize = 14; +pub const VDISCARD: usize = 15; +pub const VMIN: usize = 16; +pub const VTIME: usize = 17; +pub const VSTATUS: usize = 18; pub const NCCS: usize = 20; -pub const B0: speed_t = 0; -pub const B50: speed_t = 50; -pub const B75: speed_t = 75; -pub const B110: speed_t = 110; -pub const B134: speed_t = 134; -pub const B150: speed_t = 150; -pub const B200: speed_t = 200; -pub const B300: speed_t = 300; -pub const B600: speed_t = 600; -pub const B1200: speed_t = 1200; -pub const B1800: speed_t = 1800; -pub const B2400: speed_t = 2400; -pub const B4800: speed_t = 4800; -pub const B9600: speed_t = 9600; -pub const B7200: speed_t = 7200; -pub const B14400: speed_t = 14400; -pub const B19200: speed_t = 19200; -pub const B28800: speed_t = 28800; -pub const B38400: speed_t = 38400; -pub const EXTA: speed_t = 19200; -pub const EXTB: speed_t = 38400; -pub const B57600: speed_t = 57600; -pub const B76800: speed_t = 76800; -pub const B115200: speed_t = 115200; -pub const B230400: speed_t = 230400; -pub const B460800: speed_t = 460800; -pub const B500000: speed_t = 500000; -pub const B576000: speed_t = 576000; -pub const B921600: speed_t = 921600; -pub const B1000000: speed_t = 1000000; -pub const B1152000: speed_t = 1152000; -pub const B1500000: speed_t = 1500000; -pub const B2000000: speed_t = 2000000; -pub const B2500000: speed_t = 2500000; -pub const B3000000: speed_t = 3000000; -pub const B3500000: speed_t = 3500000; -pub const B4000000: speed_t = 4000000; +pub const B0: ::speed_t = 0; +pub const B50: ::speed_t = 50; +pub const B75: ::speed_t = 75; +pub const B110: ::speed_t = 110; +pub const B134: ::speed_t = 134; +pub const B150: ::speed_t = 150; +pub const B200: ::speed_t = 200; +pub const B300: ::speed_t = 300; +pub const B600: ::speed_t = 600; +pub const B1200: ::speed_t = 1200; +pub const B1800: ::speed_t = 1800; +pub const B2400: ::speed_t = 2400; +pub const B4800: ::speed_t = 4800; +pub const B9600: ::speed_t = 9600; +pub const B7200: ::speed_t = 7200; +pub const B14400: ::speed_t = 14400; +pub const B19200: ::speed_t = 19200; +pub const B28800: ::speed_t = 28800; +pub const B38400: ::speed_t = 38400; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 57600; +pub const B76800: ::speed_t = 76800; +pub const B115200: ::speed_t = 115200; +pub const B230400: ::speed_t = 230400; +pub const B460800: ::speed_t = 460800; +pub const B500000: ::speed_t = 500000; +pub const B576000: ::speed_t = 576000; +pub const B921600: ::speed_t = 921600; +pub const B1000000: ::speed_t = 1000000; +pub const B1152000: ::speed_t = 1152000; +pub const B1500000: ::speed_t = 1500000; +pub const B2000000: ::speed_t = 2000000; +pub const B2500000: ::speed_t = 2500000; +pub const B3000000: ::speed_t = 3000000; +pub const B3500000: ::speed_t = 3500000; +pub const B4000000: ::speed_t = 4000000; pub const TCSANOW: ::c_int = 0; pub const TCSADRAIN: ::c_int = 1; pub const TCSAFLUSH: ::c_int = 2; @@ -1286,10 +1973,10 @@ pub const TCOOFF: ::c_int = 1; pub const TCOON: ::c_int = 2; pub const TCIOFF: ::c_int = 3; pub const TCION: ::c_int = 4; -pub const TTYDEF_IFLAG: tcflag_t = 11042; -pub const TTYDEF_LFLAG: tcflag_t = 1483; -pub const TTYDEF_CFLAG: tcflag_t = 23040; -pub const TTYDEF_SPEED: tcflag_t = 9600; +pub const TTYDEF_IFLAG: ::tcflag_t = 11042; +pub const TTYDEF_LFLAG: ::tcflag_t = 1483; +pub const TTYDEF_CFLAG: ::tcflag_t = 23040; +pub const TTYDEF_SPEED: ::tcflag_t = 9600; pub const CEOL: u8 = 0u8; pub const CERASE: u8 = 127; pub const CMIN: u8 = 1; @@ -1299,6 +1986,7 @@ pub const CBRK: u8 = 0u8; // dlfcn.h pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; +pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; pub const RTLD_LAZY: ::c_int = 1; pub const RTLD_NOW: ::c_int = 2; pub const RTLD_BINDING_MASK: ::c_int = 3; @@ -1467,35 +2155,35 @@ pub const SF_NOUNLINK: ::c_uint = 1048576; pub const SF_SNAPSHOT: ::c_uint = 2097152; pub const UTIME_NOW: ::c_long = -1; pub const UTIME_OMIT: ::c_long = -2; -pub const S_IFMT: mode_t = 61440; -pub const S_IFDIR: mode_t = 16384; -pub const S_IFCHR: mode_t = 8192; -pub const S_IFBLK: mode_t = 24576; -pub const S_IFREG: mode_t = 32768; -pub const S_IFIFO: mode_t = 4096; -pub const S_IFLNK: mode_t = 40960; -pub const S_IFSOCK: mode_t = 49152; -pub const S_ISUID: mode_t = 2048; -pub const S_ISGID: mode_t = 1024; -pub const S_ISVTX: mode_t = 512; -pub const S_IRUSR: mode_t = 256; -pub const S_IWUSR: mode_t = 128; -pub const S_IXUSR: mode_t = 64; -pub const S_IRWXU: mode_t = 448; -pub const S_IREAD: mode_t = 256; -pub const S_IWRITE: mode_t = 128; -pub const S_IEXEC: mode_t = 64; -pub const S_IRGRP: mode_t = 32; -pub const S_IWGRP: mode_t = 16; -pub const S_IXGRP: mode_t = 8; -pub const S_IRWXG: mode_t = 56; -pub const S_IROTH: mode_t = 4; -pub const S_IWOTH: mode_t = 2; -pub const S_IXOTH: mode_t = 1; -pub const S_IRWXO: mode_t = 7; -pub const ACCESSPERMS: mode_t = 511; -pub const ALLPERMS: mode_t = 4095; -pub const DEFFILEMODE: mode_t = 438; +pub const S_IFMT: ::mode_t = 61440; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_ISUID: ::mode_t = 2048; +pub const S_ISGID: ::mode_t = 1024; +pub const S_ISVTX: ::mode_t = 512; +pub const S_IRUSR: ::mode_t = 256; +pub const S_IWUSR: ::mode_t = 128; +pub const S_IXUSR: ::mode_t = 64; +pub const S_IRWXU: ::mode_t = 448; +pub const S_IREAD: ::mode_t = 256; +pub const S_IWRITE: ::mode_t = 128; +pub const S_IEXEC: ::mode_t = 64; +pub const S_IRGRP: ::mode_t = 32; +pub const S_IWGRP: ::mode_t = 16; +pub const S_IXGRP: ::mode_t = 8; +pub const S_IRWXG: ::mode_t = 56; +pub const S_IROTH: ::mode_t = 4; +pub const S_IWOTH: ::mode_t = 2; +pub const S_IXOTH: ::mode_t = 1; +pub const S_IRWXO: ::mode_t = 7; +pub const ACCESSPERMS: ::mode_t = 511; +pub const ALLPERMS: ::mode_t = 4095; +pub const DEFFILEMODE: ::mode_t = 438; pub const S_BLKSIZE: usize = 512; pub const STATX_TYPE: ::c_uint = 1; pub const STATX_MODE: ::c_uint = 2; @@ -1547,34 +2235,34 @@ pub const TIOCPKT_IOCTL: ::c_int = 64; pub const TTYDISC: ::c_int = 0; pub const TABLDISC: ::c_int = 3; pub const SLIPDISC: ::c_int = 4; -pub const TANDEM: tcflag_t = 1; -pub const CBREAK: tcflag_t = 2; -pub const LCASE: tcflag_t = 4; -pub const CRMOD: tcflag_t = 16; -pub const RAW: tcflag_t = 32; -pub const ODDP: tcflag_t = 64; -pub const EVENP: tcflag_t = 128; -pub const ANYP: tcflag_t = 192; -pub const NLDELAY: tcflag_t = 768; -pub const NL2: tcflag_t = 512; -pub const NL3: tcflag_t = 768; -pub const TBDELAY: tcflag_t = 3072; -pub const XTABS: tcflag_t = 3072; -pub const CRDELAY: tcflag_t = 12288; -pub const VTDELAY: tcflag_t = 16384; -pub const BSDELAY: tcflag_t = 32768; -pub const ALLDELAY: tcflag_t = 65280; -pub const CRTBS: tcflag_t = 65536; -pub const PRTERA: tcflag_t = 131072; -pub const CRTERA: tcflag_t = 262144; -pub const TILDE: tcflag_t = 524288; -pub const LITOUT: tcflag_t = 2097152; -pub const NOHANG: tcflag_t = 16777216; -pub const L001000: tcflag_t = 33554432; -pub const CRTKIL: tcflag_t = 67108864; -pub const PASS8: tcflag_t = 134217728; -pub const CTLECH: tcflag_t = 268435456; -pub const DECCTQ: tcflag_t = 1073741824; +pub const TANDEM: ::tcflag_t = 1; +pub const CBREAK: ::tcflag_t = 2; +pub const LCASE: ::tcflag_t = 4; +pub const CRMOD: ::tcflag_t = 16; +pub const RAW: ::tcflag_t = 32; +pub const ODDP: ::tcflag_t = 64; +pub const EVENP: ::tcflag_t = 128; +pub const ANYP: ::tcflag_t = 192; +pub const NLDELAY: ::tcflag_t = 768; +pub const NL2: ::tcflag_t = 512; +pub const NL3: ::tcflag_t = 768; +pub const TBDELAY: ::tcflag_t = 3072; +pub const XTABS: ::tcflag_t = 3072; +pub const CRDELAY: ::tcflag_t = 12288; +pub const VTDELAY: ::tcflag_t = 16384; +pub const BSDELAY: ::tcflag_t = 32768; +pub const ALLDELAY: ::tcflag_t = 65280; +pub const CRTBS: ::tcflag_t = 65536; +pub const PRTERA: ::tcflag_t = 131072; +pub const CRTERA: ::tcflag_t = 262144; +pub const TILDE: ::tcflag_t = 524288; +pub const LITOUT: ::tcflag_t = 2097152; +pub const NOHANG: ::tcflag_t = 16777216; +pub const L001000: ::tcflag_t = 33554432; +pub const CRTKIL: ::tcflag_t = 67108864; +pub const PASS8: ::tcflag_t = 134217728; +pub const CTLECH: ::tcflag_t = 268435456; +pub const DECCTQ: ::tcflag_t = 1073741824; pub const FIONBIO: ::c_ulong = 0xa008007e; pub const FIONREAD: ::c_ulong = 0x6008007f; @@ -2007,7 +2695,6 @@ pub const TCPOPT_TSTAMP_HDR: u32 = 16844810; pub const TCP_MSS: usize = 512; pub const TCP_MAXWIN: usize = 65535; pub const TCP_MAX_WINSHIFT: usize = 14; -pub const SOL_TCP: ::c_int = 6; pub const TCPI_OPT_TIMESTAMPS: u8 = 1; pub const TCPI_OPT_SACK: u8 = 2; pub const TCPI_OPT_WSCALE: u8 = 4; @@ -2042,21 +2729,64 @@ pub const PROT_NONE: ::c_int = 0; pub const PROT_READ: ::c_int = 4; pub const PROT_WRITE: ::c_int = 2; pub const PROT_EXEC: ::c_int = 1; -pub const MAP_PRIVATE: ::c_int = 0; pub const MAP_FILE: ::c_int = 1; pub const MAP_ANON: ::c_int = 2; -pub const MAP_SHARED: ::c_int = 16; +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; +pub const MAP_TYPE: ::c_int = 15; pub const MAP_COPY: ::c_int = 32; +pub const MAP_SHARED: ::c_int = 16; +pub const MAP_PRIVATE: ::c_int = 0; pub const MAP_FIXED: ::c_int = 256; +pub const MAP_NOEXTEND: ::c_int = 512; +pub const MAP_HASSEMPHORE: ::c_int = 1024; +pub const MAP_INHERIT: ::c_int = 2048; pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; -pub const MS_SYNC: ::c_int = 0; -pub const MS_ASYNC: ::c_int = 1; -pub const MS_INVALIDATE: ::c_int = 2; pub const MADV_NORMAL: ::c_int = 0; pub const MADV_RANDOM: ::c_int = 1; pub const MADV_SEQUENTIAL: ::c_int = 2; pub const MADV_WILLNEED: ::c_int = 3; pub const MADV_DONTNEED: ::c_int = 4; +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_MADV_WONTNEED: ::c_int = 4; + +pub const MS_ASYNC: ::c_int = 1; +pub const MS_SYNC: ::c_int = 0; +pub const MS_INVALIDATE: ::c_int = 2; +pub const MREMAP_MAYMOVE: ::c_int = 1; +pub const MREMAP_FIXED: ::c_int = 2; +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +// spawn.h +pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; +pub const POSIX_SPAWN_SETSID: ::c_int = 128; + +// sys/syslog.h +pub const LOG_CRON: ::c_int = 9 << 3; +pub const LOG_AUTHPRIV: ::c_int = 10 << 3; +pub const LOG_FTP: ::c_int = 11 << 3; +pub const LOG_PERROR: ::c_int = 0x20; + +// net/if.h +pub const IFF_UP: ::c_int = 0x1; +pub const IFF_BROADCAST: ::c_int = 0x2; +pub const IFF_DEBUG: ::c_int = 0x4; +pub const IFF_LOOPBACK: ::c_int = 0x8; +pub const IFF_POINTOPOINT: ::c_int = 0x10; +pub const IFF_NOTRAILERS: ::c_int = 0x20; +pub const IFF_RUNNING: ::c_int = 0x40; +pub const IFF_NOARP: ::c_int = 0x80; +pub const IFF_PROMISC: ::c_int = 0x100; +pub const IFF_ALLMULTI: ::c_int = 0x200; +pub const IFF_MASTER: ::c_int = 0x400; +pub const IFF_SLAVE: ::c_int = 0x800; +pub const IFF_MULTICAST: ::c_int = 0x1000; +pub const IFF_PORTSEL: ::c_int = 0x2000; +pub const IFF_AUTOMEDIA: ::c_int = 0x4000; +pub const IFF_DYNAMIC: ::c_int = 0x8000; // random.h pub const GRND_NONBLOCK: ::c_uint = 1; @@ -2391,21 +3121,21 @@ pub const PTHREAD_MUTEX_RECURSIVE: __pthread_mutex_type = 2; pub const PTHREAD_MUTEX_STALLED: __pthread_mutex_robustness = 0; pub const PTHREAD_MUTEX_ROBUST: __pthread_mutex_robustness = 256; -pub const RLIMIT_CPU: __rlimit_resource = 0; -pub const RLIMIT_FSIZE: __rlimit_resource = 1; -pub const RLIMIT_DATA: __rlimit_resource = 2; -pub const RLIMIT_STACK: __rlimit_resource = 3; -pub const RLIMIT_CORE: __rlimit_resource = 4; -pub const RLIMIT_RSS: __rlimit_resource = 5; -pub const RLIMIT_MEMLOCK: __rlimit_resource = 6; -pub const RLIMIT_NPROC: __rlimit_resource = 7; -pub const RLIMIT_OFILE: __rlimit_resource = 8; -pub const RLIMIT_NOFILE: __rlimit_resource = 8; -pub const RLIMIT_SBSIZE: __rlimit_resource = 9; -pub const RLIMIT_AS: __rlimit_resource = 10; -pub const RLIMIT_VMEM: __rlimit_resource = 10; -pub const RLIMIT_NLIMITS: __rlimit_resource = 11; -pub const RLIM_NLIMITS: __rlimit_resource = 11; +pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; +pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; +pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; +pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; +pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; +pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; +pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 6; +pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7; +pub const RLIMIT_OFILE: ::__rlimit_resource_t = 8; +pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 8; +pub const RLIMIT_SBSIZE: ::__rlimit_resource_t = 9; +pub const RLIMIT_AS: ::__rlimit_resource_t = 10; +pub const RLIMIT_VMEM: ::__rlimit_resource_t = 10; +pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 11; +pub const RLIM_NLIMITS: ::__rlimit_resource_t = 11; pub const RUSAGE_SELF: __rusage_who = 0; pub const RUSAGE_CHILDREN: __rusage_who = -1; @@ -2414,6 +3144,10 @@ pub const PRIO_PROCESS: __priority_which = 0; pub const PRIO_PGRP: __priority_which = 1; pub const PRIO_USER: __priority_which = 2; +pub const __UT_LINESIZE: usize = 32; +pub const __UT_NAMESIZE: usize = 32; +pub const __UT_HOSTSIZE: usize = 256; + pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_RAW: ::c_int = 3; @@ -2431,6 +3165,7 @@ pub const MSG_CTRUNC: ::c_int = 32; pub const MSG_WAITALL: ::c_int = 64; pub const MSG_DONTWAIT: ::c_int = 128; pub const MSG_NOSIGNAL: ::c_int = 1024; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; pub const SCM_RIGHTS: ::c_int = 1; pub const SCM_TIMESTAMP: ::c_int = 2; @@ -2693,8 +3428,105 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { }; pub const PTHREAD_STACK_MIN: ::size_t = 0; +const_fn! { + {const} fn CMSG_ALIGN(len: usize) -> usize { + len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) + } +} + // functions f! { + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::() { + (*mhdr).msg_control as *mut cmsghdr + } else { + 0 as *mut cmsghdr + } + } + + pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar { + cmsg.offset(1) as *mut ::c_uchar + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } + + pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + CMSG_ALIGN(::mem::size_of::()) as ::c_uint + length + } + + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + if ((*cmsg).cmsg_len as usize) < ::mem::size_of::() { + return 0 as *mut cmsghdr; + }; + let next = (cmsg as usize + + CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut cmsghdr; + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if (next.offset(1)) as usize > max || + next as usize + CMSG_ALIGN((*next).cmsg_len as usize) > max + { + 0 as *mut cmsghdr + } else { + next as *mut cmsghdr + } + } + + pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t { + let _dummy: cpu_set_t = ::mem::zeroed(); + let size_in_bits = 8 * ::mem::size_of_val(&_dummy.bits[0]); + ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]); + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + 0 != (cpuset.bits[idx] & (1 << offset)) + } + + pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int { + let mut s: u32 = 0; + let size_of_mask = ::mem::size_of_val(&cpuset.bits[0]); + for i in cpuset.bits[..(size / size_of_mask)].iter() { + s += i.count_ones(); + }; + s as ::c_int + } + + pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int { + CPU_COUNT_S(::mem::size_of::(), cpuset) + } + + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.bits == set2.bits + } + pub fn major(dev: ::dev_t) -> ::c_uint { ((dev >> 8) & 0xff) as ::c_uint } @@ -2703,6 +3535,14 @@ f! { (dev & 0xffff00ff) as ::c_uint } + pub fn IPTOS_TOS(tos: u8) -> u8 { + tos & IPTOS_TOS_MASK + } + + pub fn IPTOS_PREC(tos: u8) -> u8 { + tos & IPTOS_PREC_MASK + } + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; @@ -2756,11 +3596,26 @@ extern "C" { pub fn __libc_current_sigrtmax() -> ::c_int; + pub fn wait4( + pid: ::pid_t, + status: *mut ::c_int, + options: ::c_int, + rusage: *mut ::rusage, + ) -> ::pid_t; + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int; pub fn sigwait(__set: *const sigset_t, __sig: *mut ::c_int) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; pub fn ioctl(__fd: ::c_int, __request: ::c_ulong, ...) -> ::c_int; @@ -2806,10 +3661,72 @@ extern "C" { offset: ::off64_t, ) -> ::ssize_t; + pub fn fread_unlocked( + buf: *mut ::c_void, + size: ::size_t, + nobj: ::size_t, + stream: *mut ::FILE, + ) -> ::size_t; + + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut ::sigevent, + ) -> ::c_int; + + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; + pub fn lseek64(__fd: ::c_int, __offset: __off64_t, __whence: ::c_int) -> __off64_t; pub fn lseek(__fd: ::c_int, __offset: __off_t, __whence: ::c_int) -> __off_t; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; + pub fn bind(__fd: ::c_int, __addr: *const sockaddr, __len: socklen_t) -> ::c_int; pub fn accept4( @@ -2819,6 +3736,13 @@ extern "C" { flg: ::c_int, ) -> ::c_int; + pub fn ppoll( + fds: *mut ::pollfd, + nfds: nfds_t, + timeout: *const ::timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn recvmsg(__fd: ::c_int, __message: *mut msghdr, __flags: ::c_int) -> ::ssize_t; pub fn sendmsg(__fd: ::c_int, __message: *const msghdr, __flags: ::c_int) -> ssize_t; @@ -2832,12 +3756,95 @@ extern "C" { addrlen: *mut ::socklen_t, ) -> ::ssize_t; + pub fn sendfile( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn sendfile64( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off64_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn shutdown(__fd: ::c_int, __how: ::c_int) -> ::c_int; pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + servlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn gethostid() -> ::c_long; + pub fn sethostid(hostid: ::c_long) -> ::c_int; + + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; + pub fn setspent(); + pub fn endspent(); + pub fn getspent() -> *mut spwd; + + pub fn getspnam(name: *const ::c_char) -> *mut spwd; + + pub fn getpwent_r( + pwd: *mut ::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::passwd, + ) -> ::c_int; + pub fn getgrent_r( + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn fgetpwent_r( + stream: *mut ::FILE, + pwd: *mut ::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::passwd, + ) -> ::c_int; + pub fn fgetgrent_r( + stream: *mut ::FILE, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + + pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int; + pub fn putgrent(grp: *const ::group, stream: *mut ::FILE) -> ::c_int; + + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( uid: ::uid_t, pwd: *mut passwd, @@ -2846,23 +3853,111 @@ extern "C" { result: *mut *mut passwd, ) -> ::c_int; + pub fn fgetspent_r( + fp: *mut ::FILE, + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + pub fn sgetspent_r( + s: *const ::c_char, + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + pub fn getspent_r( + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + + pub fn getspnam_r( + name: *const ::c_char, + spbuf: *mut spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut spwd, + ) -> ::c_int; + + // mntent.h + pub fn getmntent_r( + stream: *mut ::FILE, + mntbuf: *mut ::mntent, + buf: *mut ::c_char, + buflen: ::c_int, + ) -> *mut ::mntent; + + pub fn utmpname(file: *const ::c_char) -> ::c_int; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; + pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; + pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; + + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; + + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + + pub fn getgrouplist( + user: *const ::c_char, + group: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + + pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE; + pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent; + pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int; + pub fn endmntent(streamp: *mut ::FILE) -> ::c_int; + pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char; + pub fn pthread_create( native: *mut ::pthread_t, attr: *const ::pthread_attr_t, f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, value: *mut ::c_void, ) -> ::c_int; - pub fn pthread_kill(__threadid: pthread_t, __signo: ::c_int) -> ::c_int; + pub fn pthread_kill(__threadid: ::pthread_t, __signo: ::c_int) -> ::c_int; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; pub fn __pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> ::c_int; - pub fn pthread_getattr_np(__thr: pthread_t, __attr: *mut pthread_attr_t) -> ::c_int; + pub fn pthread_getattr_np(__thr: ::pthread_t, __attr: *mut pthread_attr_t) -> ::c_int; pub fn pthread_attr_getguardsize( __attr: *const pthread_attr_t, __guardsize: *mut ::size_t, ) -> ::c_int; + pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int; pub fn pthread_attr_getstack( __attr: *const pthread_attr_t, @@ -2870,11 +3965,64 @@ extern "C" { __stacksize: *mut ::size_t, ) -> ::c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setpshared( + attr: *mut pthread_mutexattr_t, + pshared: ::c_int, + ) -> ::c_int; + + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + + pub fn pthread_rwlockattr_getpshared( + attr: *const pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; + + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; pub fn pthread_condattr_setclock( __attr: *mut pthread_condattr_t, __clock_id: __clockid_t, ) -> ::c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int; + + pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_getpshared( + attr: *const ::pthread_barrierattr_t, + shared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_barrierattr_setpshared( + attr: *mut ::pthread_barrierattr_t, + shared: ::c_int, + ) -> ::c_int; + pub fn pthread_barrier_init( + barrier: *mut pthread_barrier_t, + attr: *const ::pthread_barrierattr_t, + count: ::c_uint, + ) -> ::c_int; + pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; pub fn pthread_atfork( prepare: ::Option, parent: ::Option, @@ -2887,9 +4035,72 @@ extern "C" { __oldmask: *mut __sigset_t, ) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int; + + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn clock_getres(__clock_id: clockid_t, __res: *mut ::timespec) -> ::c_int; pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut ::timespec) -> ::c_int; pub fn clock_settime(__clock_id: clockid_t, __tp: *const ::timespec) -> ::c_int; + pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int; + + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + + pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char; + pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char; + + pub fn strftime( + s: *mut ::c_char, + max: ::size_t, + format: *const ::c_char, + tm: *const ::tm, + ) -> ::size_t; + pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char; + + pub fn timer_create( + clockid: ::clockid_t, + sevp: *mut ::sigevent, + timerid: *mut ::timer_t, + ) -> ::c_int; + pub fn timer_delete(timerid: ::timer_t) -> ::c_int; + pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int; + pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int; + pub fn timer_settime( + timerid: ::timer_t, + flags: ::c_int, + new_value: *const ::itimerspec, + old_value: *mut ::itimerspec, + ) -> ::c_int; pub fn fstat(__fd: ::c_int, __buf: *mut stat) -> ::c_int; pub fn fstat64(__fd: ::c_int, __buf: *mut stat64) -> ::c_int; @@ -2907,6 +4118,14 @@ extern "C" { __flag: ::c_int, ) -> ::c_int; + pub fn statx( + dirfd: ::c_int, + pathname: *const c_char, + flags: ::c_int, + mask: ::c_uint, + statxbuf: *mut statx, + ) -> ::c_int; + pub fn ftruncate(__fd: ::c_int, __length: __off_t) -> ::c_int; pub fn ftruncate64(__fd: ::c_int, __length: __off64_t) -> ::c_int; pub fn truncate64(__file: *const ::c_char, __length: __off64_t) -> ::c_int; @@ -2930,6 +4149,175 @@ extern "C" { pub fn openat(__fd: ::c_int, __file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int; pub fn openat64(__fd: ::c_int, __file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int; + pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn freopen64( + filename: *const c_char, + mode: *const c_char, + file: *mut ::FILE, + ) -> *mut ::FILE; + + pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; + + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn tmpfile64() -> *mut ::FILE; + + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + + pub fn getdtablesize() -> ::c_int; + + // Added in `glibc` 2.34 + pub fn close_range(first: ::c_uint, last: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn openpty( + __amaster: *mut ::c_int, + __aslave: *mut ::c_int, + __name: *mut ::c_char, + __termp: *const termios, + __winp: *const ::winsize, + ) -> ::c_int; + + pub fn forkpty( + __amaster: *mut ::c_int, + __name: *mut ::c_char, + __termp: *const termios, + __winp: *const ::winsize, + ) -> ::pid_t; + + pub fn getpt() -> ::c_int; + pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int; + pub fn login_tty(fd: ::c_int) -> ::c_int; + + pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; + + pub fn clearenv() -> ::c_int; + + pub fn execveat( + dirfd: ::c_int, + pathname: *const ::c_char, + argv: *const *mut c_char, + envp: *const *mut c_char, + flags: ::c_int, + ) -> ::c_int; + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + + // posix/spawn.h + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; + + // Added in `glibc` 2.29 + pub fn posix_spawn_file_actions_addchdir_np( + actions: *mut ::posix_spawn_file_actions_t, + path: *const ::c_char, + ) -> ::c_int; + // Added in `glibc` 2.29 + pub fn posix_spawn_file_actions_addfchdir_np( + actions: *mut ::posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + // Added in `glibc` 2.34 + pub fn posix_spawn_file_actions_addclosefrom_np( + actions: *mut ::posix_spawn_file_actions_t, + from: ::c_int, + ) -> ::c_int; + // Added in `glibc` 2.35 + pub fn posix_spawn_file_actions_addtcsetpgrp_np( + actions: *mut ::posix_spawn_file_actions_t, + tcfd: ::c_int, + ) -> ::c_int; + + pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int; + pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int; + pub fn faccessat( dirfd: ::c_int, pathname: *const ::c_char, @@ -2944,6 +4332,13 @@ extern "C" { pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent) -> ::c_int; + pub fn readdir64_r( + dirp: *mut ::DIR, + entry: *mut ::dirent64, + result: *mut *mut ::dirent64, + ) -> ::c_int; + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; @@ -2961,6 +4356,14 @@ extern "C" { __offset: __off64_t, ) -> *mut ::c_void; + pub fn mremap( + addr: *mut ::c_void, + len: ::size_t, + new_len: ::size_t, + flags: ::c_int, + ... + ) -> *mut ::c_void; + pub fn mprotect(__addr: *mut ::c_void, __len: ::size_t, __prot: ::c_int) -> ::c_int; pub fn msync(__addr: *mut ::c_void, __len: ::size_t, __flags: ::c_int) -> ::c_int; @@ -2983,10 +4386,12 @@ extern "C" { pub fn madvise(__addr: *mut ::c_void, __len: ::size_t, __advice: ::c_int) -> ::c_int; - pub fn getrlimit(resource: ::__rlimit_resource, rlim: *mut ::rlimit) -> ::c_int; - pub fn getrlimit64(resource: ::__rlimit_resource, rlim: *mut ::rlimit64) -> ::c_int; - pub fn setrlimit(resource: ::__rlimit_resource, rlim: *const ::rlimit) -> ::c_int; - pub fn setrlimit64(resource: ::__rlimit_resource, rlim: *const ::rlimit64) -> ::c_int; + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int; + pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int; + pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int; + pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int; pub fn getpriority(which: ::__priority_which, who: ::id_t) -> ::c_int; pub fn setpriority(which: ::__priority_which, who: ::id_t, prio: ::c_int) -> ::c_int; @@ -2994,7 +4399,179 @@ extern "C" { pub fn getrandom(__buffer: *mut ::c_void, __length: ::size_t, __flags: ::c_uint) -> ::ssize_t; pub fn getentropy(__buffer: *mut ::c_void, __length: ::size_t) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + + pub fn drand48() -> ::c_double; + pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double; + pub fn lrand48() -> ::c_long; + pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn mrand48() -> ::c_long; + pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn srand48(seed: ::c_long); + pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort; + pub fn lcong48(p: *mut ::c_ushort); + + pub fn qsort_r( + base: *mut ::c_void, + num: ::size_t, + size: ::size_t, + compar: ::Option< + unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int, + >, + arg: *mut ::c_void, + ); + + pub fn brk(addr: *mut ::c_void) -> ::c_int; + pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; + + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; + + pub fn mallinfo() -> ::mallinfo; + pub fn mallinfo2() -> ::mallinfo2; + pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int; + pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; + pub fn malloc_trim(__pad: ::size_t) -> ::c_int; + + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; + pub fn iconv( + cd: iconv_t, + inbuf: *mut *mut ::c_char, + inbytesleft: *mut ::size_t, + outbuf: *mut *mut ::c_char, + outbytesleft: *mut ::size_t, + ) -> ::size_t; + pub fn iconv_close(cd: iconv_t) -> ::c_int; + + pub fn getopt_long( + argc: ::c_int, + argv: *const *mut c_char, + optstring: *const c_char, + longopts: *const option, + longindex: *mut ::c_int, + ) -> ::c_int; + pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; + + pub fn reboot(how_to: ::c_int) -> ::c_int; + + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + + pub fn regexec( + preg: *const ::regex_t, + input: *const ::c_char, + nmatch: ::size_t, + pmatch: *mut regmatch_t, + eflags: ::c_int, + ) -> ::c_int; + + pub fn regerror( + errcode: ::c_int, + preg: *const ::regex_t, + errbuf: *mut ::c_char, + errbuf_size: ::size_t, + ) -> ::size_t; + + pub fn regfree(preg: *mut ::regex_t); + + pub fn glob( + pattern: *const c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + + pub fn glob64( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut glob64_t, + ) -> ::c_int; + pub fn globfree64(pglob: *mut glob64_t); + + pub fn getxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn lgetxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn setxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn lsetxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; + + pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; + /// POSIX version of `basename(3)`, defined in `libgen.h`. + #[link_name = "__xpg_basename"] + pub fn posix_basename(path: *mut ::c_char) -> *mut ::c_char; + /// GNU version of `basename(3)`, defined in `string.h`. + #[link_name = "basename"] + pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char; + + pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int; + pub fn dladdr1( + addr: *const ::c_void, + info: *mut ::Dl_info, + extra_info: *mut *mut ::c_void, + flags: ::c_int, + ) -> ::c_int; + + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn dl_iterate_phdr( callback: ::Option< unsafe extern "C" fn( @@ -3005,6 +4582,9 @@ extern "C" { >, data: *mut ::c_void, ) -> ::c_int; + + pub fn gnu_get_libc_release() -> *const ::c_char; + pub fn gnu_get_libc_version() -> *const ::c_char; } safe_f! { diff --git a/vendor/libc/src/unix/linux_like/android/mod.rs b/vendor/libc/src/unix/linux_like/android/mod.rs index 98a9d9b2b..2c1c1e9b9 100644 --- a/vendor/libc/src/unix/linux_like/android/mod.rs +++ b/vendor/libc/src/unix/linux_like/android/mod.rs @@ -46,6 +46,8 @@ pub type Elf64_Off = u64; pub type Elf64_Word = u32; pub type Elf64_Xword = u64; +pub type eventfd_t = u64; + s! { pub struct stack_t { pub ss_sp: *mut ::c_void, @@ -494,6 +496,22 @@ s! { pub flag: *mut ::c_int, pub val: ::c_int, } + + pub struct __c_anonymous_ifru_map { + pub mem_start: ::c_ulong, + pub mem_end: ::c_ulong, + pub base_addr: ::c_ushort, + pub irq: ::c_uchar, + pub dma: ::c_uchar, + pub port: ::c_uchar, + } + + pub struct in6_ifreq { + pub ifr6_addr: ::in6_addr, + pub ifr6_prefixlen: u32, + pub ifr6_ifindex: ::c_int, + } + } s_no_extra_traits! { @@ -589,6 +607,50 @@ s_no_extra_traits! { __serial: ::c_uint, __value: [[::c_char; 4]; 23], } + + #[cfg(libc_union)] + pub union __c_anonymous_ifr_ifru { + pub ifru_addr: ::sockaddr, + pub ifru_dstaddr: ::sockaddr, + pub ifru_broadaddr: ::sockaddr, + pub ifru_netmask: ::sockaddr, + pub ifru_hwaddr: ::sockaddr, + pub ifru_flags: ::c_short, + pub ifru_ifindex: ::c_int, + pub ifru_metric: ::c_int, + pub ifru_mtu: ::c_int, + pub ifru_map: __c_anonymous_ifru_map, + pub ifru_slave: [::c_char; ::IFNAMSIZ], + pub ifru_newname: [::c_char; ::IFNAMSIZ], + pub ifru_data: *mut ::c_char, + } + + pub struct ifreq { + /// interface name, e.g. "en0" + pub ifr_name: [::c_char; ::IFNAMSIZ], + #[cfg(libc_union)] + pub ifr_ifru: __c_anonymous_ifr_ifru, + #[cfg(not(libc_union))] + pub ifr_ifru: ::sockaddr, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifc_ifcu { + pub ifcu_buf: *mut ::c_char, + pub ifcu_req: *mut ::ifreq, + } + + /* Structure used in SIOCGIFCONF request. Used to retrieve interface + configuration for machine (useful for programs which must know all + networks accessible). */ + pub struct ifconf { + pub ifc_len: ::c_int, /* Size of buffer. */ + #[cfg(libc_union)] + pub ifc_ifcu: __c_anonymous_ifc_ifcu, + #[cfg(not(libc_union))] + pub ifc_ifcu: *mut ::ifreq, + } + } cfg_if! { @@ -936,6 +998,53 @@ cfg_if! { } } + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifr_ifru { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifr_ifru") + .field("ifru_addr", unsafe { &self.ifru_addr }) + .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) + .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) + .field("ifru_netmask", unsafe { &self.ifru_netmask }) + .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr }) + .field("ifru_flags", unsafe { &self.ifru_flags }) + .field("ifru_ifindex", unsafe { &self.ifru_ifindex }) + .field("ifru_metric", unsafe { &self.ifru_metric }) + .field("ifru_mtu", unsafe { &self.ifru_mtu }) + .field("ifru_map", unsafe { &self.ifru_map }) + .field("ifru_slave", unsafe { &self.ifru_slave }) + .field("ifru_newname", unsafe { &self.ifru_newname }) + .field("ifru_data", unsafe { &self.ifru_data }) + .finish() + } + } + impl ::fmt::Debug for ifreq { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifreq") + .field("ifr_name", &self.ifr_name) + .field("ifr_ifru", &self.ifr_ifru) + .finish() + } + } + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifc_ifcu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifr_ifru") + .field("ifcu_buf", unsafe { &self.ifcu_buf }) + .field("ifcu_req", unsafe { &self.ifcu_req }) + .finish() + } + } + impl ::fmt::Debug for ifconf { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifconf") + .field("ifc_len", &self.ifc_len) + .field("ifc_ifcu", &self.ifc_ifcu) + .finish() + } + } + #[allow(deprecated)] impl af_alg_iv { fn as_slice(&self) -> &[u8] { @@ -1800,6 +1909,34 @@ pub const BLKIOOPT: ::c_int = 0x1279; pub const BLKSSZGET: ::c_int = 0x1268; pub const BLKPBSZGET: ::c_int = 0x127B; +cfg_if! { + // Those type are constructed using the _IOC macro + // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN + // where D stands for direction (either None (00), Read (01) or Write (11)) + // where S stands for size (int, long, struct...) + // where T stands for type ('f','v','X'...) + // where N stands for NR (NumbeR) + if #[cfg(any(target_arch = "x86", target_arch = "arm"))] { + pub const FS_IOC_GETFLAGS: ::c_int = 0x80046601; + pub const FS_IOC_SETFLAGS: ::c_int = 0x40046602; + pub const FS_IOC_GETVERSION: ::c_int = 0x80047601; + pub const FS_IOC_SETVERSION: ::c_int = 0x40047602; + pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601; + pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602; + pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601; + pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602; + } else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] { + pub const FS_IOC_GETFLAGS: ::c_int = 0x80086601; + pub const FS_IOC_SETFLAGS: ::c_int = 0x40086602; + pub const FS_IOC_GETVERSION: ::c_int = 0x80087601; + pub const FS_IOC_SETVERSION: ::c_int = 0x40087602; + pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601; + pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602; + pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601; + pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602; + } +} + pub const EAI_AGAIN: ::c_int = 2; pub const EAI_BADFLAGS: ::c_int = 3; pub const EAI_FAIL: ::c_int = 4; @@ -2138,6 +2275,8 @@ pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; pub const MFD_CLOEXEC: ::c_uint = 0x0001; pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002; pub const MFD_HUGETLB: ::c_uint = 0x0004; +pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008; +pub const MFD_EXEC: ::c_uint = 0x0010; pub const MFD_HUGE_64KB: ::c_uint = 0x40000000; pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000; pub const MFD_HUGE_1MB: ::c_uint = 0x50000000; @@ -2481,6 +2620,7 @@ pub const IFF_TUN: ::c_int = 0x0001; pub const IFF_TAP: ::c_int = 0x0002; pub const IFF_NAPI: ::c_int = 0x0010; pub const IFF_NAPI_FRAGS: ::c_int = 0x0020; +pub const IFF_NO_CARRIER: ::c_int = 0x0040; pub const IFF_NO_PI: ::c_int = 0x1000; pub const IFF_ONE_QUEUE: ::c_int = 0x2000; pub const IFF_VNET_HDR: ::c_int = 0x4000; @@ -2490,6 +2630,14 @@ pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200; pub const IFF_DETACH_QUEUE: ::c_int = 0x0400; pub const IFF_PERSIST: ::c_int = 0x0800; pub const IFF_NOFILTER: ::c_int = 0x1000; +// Features for GSO (TUNSETOFFLOAD) +pub const TUN_F_CSUM: ::c_uint = 0x01; +pub const TUN_F_TSO4: ::c_uint = 0x02; +pub const TUN_F_TSO6: ::c_uint = 0x04; +pub const TUN_F_TSO_ECN: ::c_uint = 0x08; +pub const TUN_F_UFO: ::c_uint = 0x10; +pub const TUN_F_USO4: ::c_uint = 0x20; +pub const TUN_F_USO6: ::c_uint = 0x40; // start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h // from https://android.googlesource.com/platform/bionic/+/HEAD/libc/kernel/uapi/linux/if_ether.h @@ -2676,6 +2824,7 @@ pub const NFEA_DONT_REFRESH: ::c_ushort = 2; pub const SIOCADDRT: ::c_ulong = 0x0000890B; pub const SIOCDELRT: ::c_ulong = 0x0000890C; +pub const SIOCRTMSG: ::c_ulong = 0x0000890D; pub const SIOCGIFNAME: ::c_ulong = 0x00008910; pub const SIOCSIFLINK: ::c_ulong = 0x00008911; pub const SIOCGIFCONF: ::c_ulong = 0x00008912; @@ -2695,6 +2844,7 @@ pub const SIOCGIFMEM: ::c_ulong = 0x0000891F; pub const SIOCSIFMEM: ::c_ulong = 0x00008920; pub const SIOCGIFMTU: ::c_ulong = 0x00008921; pub const SIOCSIFMTU: ::c_ulong = 0x00008922; +pub const SIOCSIFNAME: ::c_ulong = 0x00008923; pub const SIOCSIFHWADDR: ::c_ulong = 0x00008924; pub const SIOCGIFENCAP: ::c_ulong = 0x00008925; pub const SIOCSIFENCAP: ::c_ulong = 0x00008926; @@ -2703,6 +2853,24 @@ pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929; pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930; pub const SIOCADDMULTI: ::c_ulong = 0x00008931; pub const SIOCDELMULTI: ::c_ulong = 0x00008932; +pub const SIOCGIFINDEX: ::c_ulong = 0x00008933; +pub const SIOGIFINDEX: ::c_ulong = SIOCGIFINDEX; +pub const SIOCSIFPFLAGS: ::c_ulong = 0x00008934; +pub const SIOCGIFPFLAGS: ::c_ulong = 0x00008935; +pub const SIOCDIFADDR: ::c_ulong = 0x00008936; +pub const SIOCSIFHWBROADCAST: ::c_ulong = 0x00008937; +pub const SIOCGIFCOUNT: ::c_ulong = 0x00008938; +pub const SIOCGIFBR: ::c_ulong = 0x00008940; +pub const SIOCSIFBR: ::c_ulong = 0x00008941; +pub const SIOCGIFTXQLEN: ::c_ulong = 0x00008942; +pub const SIOCSIFTXQLEN: ::c_ulong = 0x00008943; +pub const SIOCETHTOOL: ::c_ulong = 0x00008946; +pub const SIOCGMIIPHY: ::c_ulong = 0x00008947; +pub const SIOCGMIIREG: ::c_ulong = 0x00008948; +pub const SIOCSMIIREG: ::c_ulong = 0x00008949; +pub const SIOCWANDEV: ::c_ulong = 0x0000894A; +pub const SIOCOUTQNSD: ::c_ulong = 0x0000894B; +pub const SIOCGSKNS: ::c_ulong = 0x0000894C; pub const SIOCDARP: ::c_ulong = 0x00008953; pub const SIOCGARP: ::c_ulong = 0x00008954; pub const SIOCSARP: ::c_ulong = 0x00008955; @@ -2711,6 +2879,24 @@ pub const SIOCGRARP: ::c_ulong = 0x00008961; pub const SIOCSRARP: ::c_ulong = 0x00008962; pub const SIOCGIFMAP: ::c_ulong = 0x00008970; pub const SIOCSIFMAP: ::c_ulong = 0x00008971; +pub const SIOCADDDLCI: ::c_ulong = 0x00008980; +pub const SIOCDELDLCI: ::c_ulong = 0x00008981; +pub const SIOCGIFVLAN: ::c_ulong = 0x00008982; +pub const SIOCSIFVLAN: ::c_ulong = 0x00008983; +pub const SIOCBONDENSLAVE: ::c_ulong = 0x00008990; +pub const SIOCBONDRELEASE: ::c_ulong = 0x00008991; +pub const SIOCBONDSETHWADDR: ::c_ulong = 0x00008992; +pub const SIOCBONDSLAVEINFOQUERY: ::c_ulong = 0x00008993; +pub const SIOCBONDINFOQUERY: ::c_ulong = 0x00008994; +pub const SIOCBONDCHANGEACTIVE: ::c_ulong = 0x00008995; +pub const SIOCBRADDBR: ::c_ulong = 0x000089a0; +pub const SIOCBRDELBR: ::c_ulong = 0x000089a1; +pub const SIOCBRADDIF: ::c_ulong = 0x000089a2; +pub const SIOCBRDELIF: ::c_ulong = 0x000089a3; +pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0; +pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1; +pub const SIOCDEVPRIVATE: ::c_ulong = 0x000089F0; +pub const SIOCPROTOPRIVATE: ::c_ulong = 0x000089E0; // linux/module.h pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001; @@ -3153,6 +3339,168 @@ pub const RTMSG_DELDEVICE: u32 = 0x12; pub const RTMSG_NEWROUTE: u32 = 0x21; pub const RTMSG_DELROUTE: u32 = 0x22; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_NET: ::c_int = 3; +pub const CTL_FS: ::c_int = 5; +pub const CTL_DEBUG: ::c_int = 6; +pub const CTL_DEV: ::c_int = 7; +pub const CTL_BUS: ::c_int = 8; +pub const CTL_ABI: ::c_int = 9; +pub const CTL_CPU: ::c_int = 10; + +pub const CTL_BUS_ISA: ::c_int = 1; + +pub const INOTIFY_MAX_USER_INSTANCES: ::c_int = 1; +pub const INOTIFY_MAX_USER_WATCHES: ::c_int = 2; +pub const INOTIFY_MAX_QUEUED_EVENTS: ::c_int = 3; + +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_SECUREMASK: ::c_int = 5; +pub const KERN_PROF: ::c_int = 6; +pub const KERN_NODENAME: ::c_int = 7; +pub const KERN_DOMAINNAME: ::c_int = 8; +pub const KERN_PANIC: ::c_int = 15; +pub const KERN_REALROOTDEV: ::c_int = 16; +pub const KERN_SPARC_REBOOT: ::c_int = 21; +pub const KERN_CTLALTDEL: ::c_int = 22; +pub const KERN_PRINTK: ::c_int = 23; +pub const KERN_NAMETRANS: ::c_int = 24; +pub const KERN_PPC_HTABRECLAIM: ::c_int = 25; +pub const KERN_PPC_ZEROPAGED: ::c_int = 26; +pub const KERN_PPC_POWERSAVE_NAP: ::c_int = 27; +pub const KERN_MODPROBE: ::c_int = 28; +pub const KERN_SG_BIG_BUFF: ::c_int = 29; +pub const KERN_ACCT: ::c_int = 30; +pub const KERN_PPC_L2CR: ::c_int = 31; +pub const KERN_RTSIGNR: ::c_int = 32; +pub const KERN_RTSIGMAX: ::c_int = 33; +pub const KERN_SHMMAX: ::c_int = 34; +pub const KERN_MSGMAX: ::c_int = 35; +pub const KERN_MSGMNB: ::c_int = 36; +pub const KERN_MSGPOOL: ::c_int = 37; +pub const KERN_SYSRQ: ::c_int = 38; +pub const KERN_MAX_THREADS: ::c_int = 39; +pub const KERN_RANDOM: ::c_int = 40; +pub const KERN_SHMALL: ::c_int = 41; +pub const KERN_MSGMNI: ::c_int = 42; +pub const KERN_SEM: ::c_int = 43; +pub const KERN_SPARC_STOP_A: ::c_int = 44; +pub const KERN_SHMMNI: ::c_int = 45; +pub const KERN_OVERFLOWUID: ::c_int = 46; +pub const KERN_OVERFLOWGID: ::c_int = 47; +pub const KERN_SHMPATH: ::c_int = 48; +pub const KERN_HOTPLUG: ::c_int = 49; +pub const KERN_IEEE_EMULATION_WARNINGS: ::c_int = 50; +pub const KERN_S390_USER_DEBUG_LOGGING: ::c_int = 51; +pub const KERN_CORE_USES_PID: ::c_int = 52; +pub const KERN_TAINTED: ::c_int = 53; +pub const KERN_CADPID: ::c_int = 54; +pub const KERN_PIDMAX: ::c_int = 55; +pub const KERN_CORE_PATTERN: ::c_int = 56; +pub const KERN_PANIC_ON_OOPS: ::c_int = 57; +pub const KERN_HPPA_PWRSW: ::c_int = 58; +pub const KERN_HPPA_UNALIGNED: ::c_int = 59; +pub const KERN_PRINTK_RATELIMIT: ::c_int = 60; +pub const KERN_PRINTK_RATELIMIT_BURST: ::c_int = 61; +pub const KERN_PTY: ::c_int = 62; +pub const KERN_NGROUPS_MAX: ::c_int = 63; +pub const KERN_SPARC_SCONS_PWROFF: ::c_int = 64; +pub const KERN_HZ_TIMER: ::c_int = 65; +pub const KERN_UNKNOWN_NMI_PANIC: ::c_int = 66; +pub const KERN_BOOTLOADER_TYPE: ::c_int = 67; +pub const KERN_RANDOMIZE: ::c_int = 68; +pub const KERN_SETUID_DUMPABLE: ::c_int = 69; +pub const KERN_SPIN_RETRY: ::c_int = 70; +pub const KERN_ACPI_VIDEO_FLAGS: ::c_int = 71; +pub const KERN_IA64_UNALIGNED: ::c_int = 72; +pub const KERN_COMPAT_LOG: ::c_int = 73; +pub const KERN_MAX_LOCK_DEPTH: ::c_int = 74; + +pub const VM_OVERCOMMIT_MEMORY: ::c_int = 5; +pub const VM_PAGE_CLUSTER: ::c_int = 10; +pub const VM_DIRTY_BACKGROUND: ::c_int = 11; +pub const VM_DIRTY_RATIO: ::c_int = 12; +pub const VM_DIRTY_WB_CS: ::c_int = 13; +pub const VM_DIRTY_EXPIRE_CS: ::c_int = 14; +pub const VM_NR_PDFLUSH_THREADS: ::c_int = 15; +pub const VM_OVERCOMMIT_RATIO: ::c_int = 16; +pub const VM_PAGEBUF: ::c_int = 17; +pub const VM_HUGETLB_PAGES: ::c_int = 18; +pub const VM_SWAPPINESS: ::c_int = 19; +pub const VM_LOWMEM_RESERVE_RATIO: ::c_int = 20; +pub const VM_MIN_FREE_KBYTES: ::c_int = 21; +pub const VM_MAX_MAP_COUNT: ::c_int = 22; +pub const VM_LAPTOP_MODE: ::c_int = 23; +pub const VM_BLOCK_DUMP: ::c_int = 24; +pub const VM_HUGETLB_GROUP: ::c_int = 25; +pub const VM_VFS_CACHE_PRESSURE: ::c_int = 26; +pub const VM_LEGACY_VA_LAYOUT: ::c_int = 27; +pub const VM_SWAP_TOKEN_TIMEOUT: ::c_int = 28; +pub const VM_DROP_PAGECACHE: ::c_int = 29; +pub const VM_PERCPU_PAGELIST_FRACTION: ::c_int = 30; +pub const VM_ZONE_RECLAIM_MODE: ::c_int = 31; +pub const VM_MIN_UNMAPPED: ::c_int = 32; +pub const VM_PANIC_ON_OOM: ::c_int = 33; +pub const VM_VDSO_ENABLED: ::c_int = 34; + +pub const NET_CORE: ::c_int = 1; +pub const NET_ETHER: ::c_int = 2; +pub const NET_802: ::c_int = 3; +pub const NET_UNIX: ::c_int = 4; +pub const NET_IPV4: ::c_int = 5; +pub const NET_IPX: ::c_int = 6; +pub const NET_ATALK: ::c_int = 7; +pub const NET_NETROM: ::c_int = 8; +pub const NET_AX25: ::c_int = 9; +pub const NET_BRIDGE: ::c_int = 10; +pub const NET_ROSE: ::c_int = 11; +pub const NET_IPV6: ::c_int = 12; +pub const NET_X25: ::c_int = 13; +pub const NET_TR: ::c_int = 14; +pub const NET_DECNET: ::c_int = 15; +pub const NET_ECONET: ::c_int = 16; +pub const NET_SCTP: ::c_int = 17; +pub const NET_LLC: ::c_int = 18; +pub const NET_NETFILTER: ::c_int = 19; +pub const NET_DCCP: ::c_int = 20; +pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; +pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; + +// include/linux/sched.h +pub const PF_VCPU: ::c_int = 0x00000001; +pub const PF_IDLE: ::c_int = 0x00000002; +pub const PF_EXITING: ::c_int = 0x00000004; +pub const PF_POSTCOREDUMP: ::c_int = 0x00000008; +pub const PF_IO_WORKER: ::c_int = 0x00000010; +pub const PF_WQ_WORKER: ::c_int = 0x00000020; +pub const PF_FORKNOEXEC: ::c_int = 0x00000040; +pub const PF_MCE_PROCESS: ::c_int = 0x00000080; +pub const PF_SUPERPRIV: ::c_int = 0x00000100; +pub const PF_DUMPCORE: ::c_int = 0x00000200; +pub const PF_SIGNALED: ::c_int = 0x00000400; +pub const PF_MEMALLOC: ::c_int = 0x00000800; +pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000; +pub const PF_USED_MATH: ::c_int = 0x00002000; +pub const PF_USER_WORKER: ::c_int = 0x00004000; +pub const PF_NOFREEZE: ::c_int = 0x00008000; + +pub const PF_KSWAPD: ::c_int = 0x00020000; +pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000; +pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000; +pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000; +pub const PF_KTHREAD: ::c_int = 0x00200000; +pub const PF_RANDOMIZE: ::c_int = 0x00400000; + +pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000; +pub const PF_MCE_EARLY: ::c_int = 0x08000000; +pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000; + +pub const PF_SUSPEND_TASK: ::c_int = 0x80000000; + // Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the // following are only available on newer Linux versions than the versions // currently used in CI in some configurations, so we define them here. @@ -3293,7 +3641,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::size_t, serv: *mut ::c_char, - sevlen: ::size_t, + servlen: ::size_t, flags: ::c_int, ) -> ::c_int; pub fn preadv(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t; @@ -3428,6 +3776,8 @@ extern "C" { flags: ::c_uint, ) -> ::ssize_t; pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int; + pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int; pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/emscripten/mod.rs b/vendor/libc/src/unix/linux_like/emscripten/mod.rs index 1c9e4e6f5..1dc607496 100644 --- a/vendor/libc/src/unix/linux_like/emscripten/mod.rs +++ b/vendor/libc/src/unix/linux_like/emscripten/mod.rs @@ -1702,7 +1702,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs b/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs index 10e1fcca6..83f97fbd9 100644 --- a/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs @@ -211,6 +211,38 @@ pub const BLKIOOPT: ::Ioctl = 0x1279; pub const BLKSSZGET: ::Ioctl = 0x1268; pub const BLKPBSZGET: ::Ioctl = 0x127B; +cfg_if! { + // Those type are constructed using the _IOC macro + // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN + // where D stands for direction (either None (00), Read (01) or Write (11)) + // where S stands for size (int, long, struct...) + // where T stands for type ('f','v','X'...) + // where N stands for NR (NumbeR) + if #[cfg(any(target_arch = "x86", target_arch = "arm"))] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602; + } else if #[cfg(any(target_arch = "x86_64", + target_arch = "riscv64", + target_arch = "aarch64", + target_arch = "s390x", + target_arch = "loongarch64"))] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602; + } +} + cfg_if! { if #[cfg(any(target_arch = "arm", target_arch = "s390x"))] { diff --git a/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs b/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs index 6c0aecf8c..769967702 100644 --- a/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs @@ -193,6 +193,34 @@ pub const BLKIOOPT: ::Ioctl = 0x20001279; pub const BLKSSZGET: ::Ioctl = 0x20001268; pub const BLKPBSZGET: ::Ioctl = 0x2000127B; +cfg_if! { + // Those type are constructed using the _IOC macro + // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN + // where D stands for direction (either None (00), Read (01) or Write (11)) + // where S stands for size (int, long, struct...) + // where T stands for type ('f','v','X'...) + // where N stands for NR (NumbeR) + if #[cfg(target_arch = "mips")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } else if #[cfg(target_arch = "mips64")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } +} + cfg_if! { if #[cfg(target_env = "musl")] { pub const TIOCGRS485: ::Ioctl = 0x4020542e; diff --git a/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs b/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs index 584be5b6c..27834dbfe 100644 --- a/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -179,6 +179,34 @@ pub const BLKSSZGET: ::Ioctl = 0x20001268; pub const BLKPBSZGET: ::Ioctl = 0x2000127B; //pub const FIOQSIZE: ::Ioctl = 0x40086680; +cfg_if! { + // Those type are constructed using the _IOC macro + // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN + // where D stands for direction (either None (00), Read (01) or Write (11)) + // where S stands for size (int, long, struct...) + // where T stands for type ('f','v','X'...) + // where N stands for NR (NumbeR) + if #[cfg(target_arch = "powerpc")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } else if #[cfg(target_arch = "powerpc64")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } +} + pub const TIOCM_LE: ::c_int = 0x001; pub const TIOCM_DTR: ::c_int = 0x002; pub const TIOCM_RTS: ::c_int = 0x004; diff --git a/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs b/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs index c7813aa46..fce466c77 100644 --- a/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs @@ -229,3 +229,31 @@ cfg_if! { pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; } } + +cfg_if! { + // Those type are constructed using the _IOC macro + // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN + // where D stands for direction (either None (00), Read (01) or Write (11)) + // where S stands for size (int, long, struct...) + // where T stands for type ('f','v','X'...) + // where N stands for NR (NumbeR) + if #[cfg(target_arch = "sparc")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } else if #[cfg(target_arch = "sparc64")] { + pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601; + pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602; + pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601; + pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602; + pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601; + pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602; + pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601; + pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602; + } +} diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs index 9b3a2ff86..89c93aba8 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -162,12 +162,6 @@ s! { pub ss_size: ::size_t } - pub struct seccomp_notif_sizes { - pub seccomp_notif: ::__u16, - pub seccomp_notif_resp: ::__u16, - pub seccomp_data: ::__u16, - } - pub struct mcontext_t { pub trap_no: ::c_ulong, pub error_code: ::c_ulong, @@ -466,11 +460,6 @@ pub const B3000000: ::speed_t = 0o010015; pub const B3500000: ::speed_t = 0o010016; pub const B4000000: ::speed_t = 0o010017; -pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; -pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; -pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; -pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; - pub const VEOL: usize = 11; pub const VEOL2: usize = 16; pub const VMIN: usize = 6; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs index 9807cea83..5e92e3007 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs @@ -415,11 +415,6 @@ pub const B3000000: ::speed_t = 0o010015; pub const B3500000: ::speed_t = 0o010016; pub const B4000000: ::speed_t = 0o010017; -pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; -pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; -pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; -pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; - pub const VEOL: usize = 11; pub const VEOL2: usize = 16; pub const VMIN: usize = 6; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs index a3531c141..27f477bb4 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -236,11 +236,6 @@ s! { pub ss_size: ::size_t } - pub struct seccomp_notif_sizes { - pub seccomp_notif: ::__u16, - pub seccomp_notif_resp: ::__u16, - pub seccomp_data: ::__u16, - } } s_no_extra_traits! { @@ -1090,11 +1085,6 @@ pub const REG_EFL: ::c_int = 16; pub const REG_UESP: ::c_int = 17; pub const REG_SS: ::c_int = 18; -pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; -pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; -pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; -pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; - extern "C" { pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index 206283e22..284a1788f 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -197,11 +197,6 @@ s! { pub ss_size: ::size_t } - pub struct seccomp_notif_sizes { - pub seccomp_notif: ::__u16, - pub seccomp_notif_resp: ::__u16, - pub seccomp_data: ::__u16, - } } pub const VEOF: usize = 4; @@ -513,11 +508,6 @@ pub const B3000000: ::speed_t = 0o010015; pub const B3500000: ::speed_t = 0o010016; pub const B4000000: ::speed_t = 0o010017; -pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; -pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; -pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; -pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; - pub const VEOL: usize = 11; pub const VEOL2: usize = 16; pub const VMIN: usize = 6; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 9b2aac5c2..609c74429 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -260,12 +260,6 @@ s! { __unused5: u64 } - pub struct seccomp_notif_sizes { - pub seccomp_notif: ::__u16, - pub seccomp_notif_resp: ::__u16, - pub seccomp_data: ::__u16, - } - pub struct ptrace_rseq_configuration { pub rseq_abi_pointer: ::__u64, pub rseq_abi_size: ::__u32, @@ -803,11 +797,6 @@ pub const REG_TRAPNO: ::c_int = 20; pub const REG_OLDMASK: ::c_int = 21; pub const REG_CR2: ::c_int = 22; -pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; -pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; -pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; -pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; - extern "C" { pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs index 377b9f122..9af519e90 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs @@ -3,6 +3,7 @@ pub type __priority_which_t = ::c_uint; pub type __rlimit_resource_t = ::c_uint; pub type Lmid_t = ::c_long; pub type regoff_t = ::c_int; +pub type __kernel_rwf_t = ::c_int; cfg_if! { if #[cfg(doc)] { @@ -355,6 +356,104 @@ s! { #[cfg(libc_union)] pub u: __c_anonymous_ptrace_syscall_info_data, } + + // linux/if_xdp.h + + pub struct sockaddr_xdp { + pub sxdp_family: ::__u16, + pub sxdp_flags: ::__u16, + pub sxdp_ifindex: ::__u32, + pub sxdp_queue_id: ::__u32, + pub sxdp_shared_umem_fd: ::__u32, + } + + pub struct xdp_ring_offset { + pub producer: ::__u64, + pub consumer: ::__u64, + pub desc: ::__u64, + pub flags: ::__u64, + } + + pub struct xdp_mmap_offsets { + pub rx: xdp_ring_offset, + pub tx: xdp_ring_offset, + pub fr: xdp_ring_offset, + pub cr: xdp_ring_offset, + } + + pub struct xdp_ring_offset_v1 { + pub producer: ::__u64, + pub consumer: ::__u64, + pub desc: ::__u64, + } + + pub struct xdp_mmap_offsets_v1 { + pub rx: xdp_ring_offset_v1, + pub tx: xdp_ring_offset_v1, + pub fr: xdp_ring_offset_v1, + pub cr: xdp_ring_offset_v1, + } + + pub struct xdp_umem_reg { + pub addr: ::__u64, + pub len: ::__u64, + pub chunk_size: ::__u32, + pub headroom: ::__u32, + pub flags: ::__u32, + } + + pub struct xdp_umem_reg_v1 { + pub addr: ::__u64, + pub len: ::__u64, + pub chunk_size: ::__u32, + pub headroom: ::__u32, + } + + pub struct xdp_statistics { + pub rx_dropped: ::__u64, + pub rx_invalid_descs: ::__u64, + pub tx_invalid_descs: ::__u64, + pub rx_ring_full: ::__u64, + pub rx_fill_ring_empty_descs: ::__u64, + pub tx_ring_empty_descs: ::__u64, + } + + pub struct xdp_statistics_v1 { + pub rx_dropped: ::__u64, + pub rx_invalid_descs: ::__u64, + pub tx_invalid_descs: ::__u64, + } + + pub struct xdp_options { + pub flags: ::__u32, + } + + pub struct xdp_desc { + pub addr: ::__u64, + pub len: ::__u32, + pub options: ::__u32, + } + + pub struct iocb { + pub aio_data: ::__u64, + #[cfg(target_endian = "little")] + pub aio_key: ::__u32, + #[cfg(target_endian = "little")] + pub aio_rw_flags: ::__kernel_rwf_t, + #[cfg(target_endian = "big")] + pub aio_rw_flags: ::__kernel_rwf_t, + #[cfg(target_endian = "big")] + pub aio_key: ::__u32, + pub aio_lio_opcode: ::__u16, + pub aio_reqprio: ::__s16, + pub aio_fildes: ::__u32, + pub aio_buf: ::__u64, + pub aio_nbytes: ::__u64, + pub aio_offset: ::__s64, + aio_reserved2: ::__u64, + pub aio_flags: ::__u32, + pub aio_resfd: ::__u32, + } } impl siginfo_t { @@ -920,6 +1019,38 @@ pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2; +// linux/if_xdp.h +pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0; +pub const XDP_COPY: ::__u16 = 1 << 1; +pub const XDP_ZEROCOPY: ::__u16 = 1 << 2; +pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3; +pub const XDP_USE_SG: ::__u16 = 1 << 4; + +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0; + +pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0; + +pub const XDP_MMAP_OFFSETS: ::c_int = 1; +pub const XDP_RX_RING: ::c_int = 2; +pub const XDP_TX_RING: ::c_int = 3; +pub const XDP_UMEM_REG: ::c_int = 4; +pub const XDP_UMEM_FILL_RING: ::c_int = 5; +pub const XDP_UMEM_COMPLETION_RING: ::c_int = 6; +pub const XDP_STATISTICS: ::c_int = 7; +pub const XDP_OPTIONS: ::c_int = 8; + +pub const XDP_OPTIONS_ZEROCOPY: ::__u32 = 1 << 0; + +pub const XDP_PGOFF_RX_RING: ::off_t = 0; +pub const XDP_PGOFF_TX_RING: ::off_t = 0x80000000; +pub const XDP_UMEM_PGOFF_FILL_RING: ::c_ulonglong = 0x100000000; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000; + +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; + +pub const XDP_PKT_CONTD: ::__u32 = 1 << 0; + // elf.h pub const NT_PRSTATUS: ::c_int = 1; pub const NT_PRFPREG: ::c_int = 2; @@ -1353,6 +1484,13 @@ extern "C" { format: *const ::c_char, tm: *const ::tm, ) -> ::size_t; + pub fn strftime_l( + s: *mut ::c_char, + max: ::size_t, + format: *const ::c_char, + tm: *const ::tm, + locale: ::locale_t, + ) -> ::size_t; pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char; pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; diff --git a/vendor/libc/src/unix/linux_like/linux/mod.rs b/vendor/libc/src/unix/linux_like/linux/mod.rs index 224300a64..cbb3f7bdf 100644 --- a/vendor/libc/src/unix/linux_like/linux/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/mod.rs @@ -52,13 +52,10 @@ pub type iconv_t = *mut ::c_void; // linux/sctp.h pub type sctp_assoc_t = ::__s32; -#[cfg_attr(feature = "extra_traits", derive(Debug))] -pub enum fpos64_t {} // FIXME: fill this out with a struct -impl ::Copy for fpos64_t {} -impl ::Clone for fpos64_t { - fn clone(&self) -> fpos64_t { - *self - } +pub type eventfd_t = u64; +missing! { + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum fpos64_t {} // FIXME: fill this out with a struct } s! { @@ -578,6 +575,34 @@ s! { pub args: [::__u64; 6], } + pub struct seccomp_notif_sizes { + pub seccomp_notif: ::__u16, + pub seccomp_notif_resp: ::__u16, + pub seccomp_data: ::__u16, + } + + pub struct seccomp_notif { + pub id: ::__u64, + pub pid: ::__u32, + pub flags: ::__u32, + pub data: seccomp_data, + } + + pub struct seccomp_notif_resp { + pub id: ::__u64, + pub val: ::__s64, + pub error: ::__s32, + pub flags: ::__u32, + } + + pub struct seccomp_notif_addfd { + pub id: ::__u64, + pub flags: ::__u32, + pub srcfd: ::__u32, + pub newfd: ::__u32, + pub newfd_flags: ::__u32, + } + pub struct nlmsghdr { pub nlmsg_len: u32, pub nlmsg_type: u16, @@ -686,6 +711,37 @@ s! { pub rlim_cur: rlim64_t, pub rlim_max: rlim64_t, } + + // linux/tls.h + + pub struct tls_crypto_info { + pub version: ::__u16, + pub cipher_type: ::__u16, + } + + pub struct tls12_crypto_info_aes_gcm_128 { + pub info: tls_crypto_info, + pub iv: [::c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE], + pub key: [::c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE], + pub salt: [::c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE], + pub rec_seq: [::c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE], + } + + pub struct tls12_crypto_info_aes_gcm_256 { + pub info: tls_crypto_info, + pub iv: [::c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE], + pub key: [::c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE], + pub salt: [::c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE], + pub rec_seq: [::c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE], + } + + pub struct tls12_crypto_info_chacha20_poly1305 { + pub info: tls_crypto_info, + pub iv: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE], + pub key: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE], + pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE], + pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE], + } } s_no_extra_traits! { @@ -822,6 +878,17 @@ s_no_extra_traits! { pub d_type: ::c_uchar, pub d_name: [::c_char; 256], } + + pub struct sched_attr { + pub size: ::__u32, + pub sched_policy: ::__u32, + pub sched_flags: ::__u64, + pub sched_nice: ::__s32, + pub sched_priority: ::__u32, + pub sched_runtime: ::__u64, + pub sched_deadline: ::__u64, + pub sched_period: ::__u64, + } } s_no_extra_traits! { @@ -1287,6 +1354,46 @@ cfg_if! { self.rx_filter.hash(state); } } + + impl ::fmt::Debug for sched_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sched_attr") + .field("size", &self.size) + .field("sched_policy", &self.sched_policy) + .field("sched_flags", &self.sched_flags) + .field("sched_nice", &self.sched_nice) + .field("sched_priority", &self.sched_priority) + .field("sched_runtime", &self.sched_runtime) + .field("sched_deadline", &self.sched_deadline) + .field("sched_period", &self.sched_period) + .finish() + } + } + impl PartialEq for sched_attr { + fn eq(&self, other: &sched_attr) -> bool { + self.size == other.size && + self.sched_policy == other.sched_policy && + self.sched_flags == other.sched_flags && + self.sched_nice == other.sched_nice && + self.sched_priority == other.sched_priority && + self.sched_runtime == other.sched_runtime && + self.sched_deadline == other.sched_deadline && + self.sched_period == other.sched_period + } + } + impl Eq for sched_attr {} + impl ::hash::Hash for sched_attr { + fn hash(&self, state: &mut H) { + self.size.hash(state); + self.sched_policy.hash(state); + self.sched_flags.hash(state); + self.sched_nice.hash(state); + self.sched_priority.hash(state); + self.sched_runtime.hash(state); + self.sched_deadline.hash(state); + self.sched_period.hash(state); + } + } } } @@ -1866,6 +1973,8 @@ pub const IFF_TUN: ::c_int = 0x0001; pub const IFF_TAP: ::c_int = 0x0002; pub const IFF_NAPI: ::c_int = 0x0010; pub const IFF_NAPI_FRAGS: ::c_int = 0x0020; +// Used in TUNSETIFF to bring up tun/tap without carrier +pub const IFF_NO_CARRIER: ::c_int = 0x0040; pub const IFF_NO_PI: ::c_int = 0x1000; // Read queue size pub const TUN_READQ_SIZE: ::c_short = 500; @@ -1886,11 +1995,13 @@ pub const IFF_NOFILTER: ::c_int = 0x1000; // Socket options pub const TUN_TX_TIMESTAMP: ::c_int = 1; // Features for GSO (TUNSETOFFLOAD) -pub const TUN_F_CSUM: ::c_ushort = 0x01; /* You can hand me unchecksummed packets. */ -pub const TUN_F_TSO4: ::c_ushort = 0x02; /* I can handle TSO for IPv4 packets */ -pub const TUN_F_TSO6: ::c_ushort = 0x04; /* I can handle TSO for IPv6 packets */ -pub const TUN_F_TSO_ECN: ::c_ushort = 0x08; /* I can handle TSO with ECN bits. */ -pub const TUN_F_UFO: ::c_ushort = 0x10; /* I can handle UFO packets */ +pub const TUN_F_CSUM: ::c_uint = 0x01; +pub const TUN_F_TSO4: ::c_uint = 0x02; +pub const TUN_F_TSO6: ::c_uint = 0x04; +pub const TUN_F_TSO_ECN: ::c_uint = 0x08; +pub const TUN_F_UFO: ::c_uint = 0x10; +pub const TUN_F_USO4: ::c_uint = 0x20; +pub const TUN_F_USO6: ::c_uint = 0x40; // Protocol info prepended to the packets (when IFF_NO_PI is not set) pub const TUN_PKT_STRIP: ::c_int = 0x0001; // Accept all multicast packets @@ -1964,22 +2075,14 @@ pub const PTHREAD_PRIO_INHERIT: ::c_int = 1; pub const PTHREAD_PRIO_PROTECT: ::c_int = 2; pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const PTHREAD_INHERIT_SCHED: ::c_int = 0; +pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 1; pub const __SIZEOF_PTHREAD_COND_T: usize = 48; pub const RENAME_NOREPLACE: ::c_uint = 1; pub const RENAME_EXCHANGE: ::c_uint = 2; pub const RENAME_WHITEOUT: ::c_uint = 4; -pub const SCHED_OTHER: ::c_int = 0; -pub const SCHED_FIFO: ::c_int = 1; -pub const SCHED_RR: ::c_int = 2; -pub const SCHED_BATCH: ::c_int = 3; -pub const SCHED_IDLE: ::c_int = 5; - -pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; - -pub const CLONE_PIDFD: ::c_int = 0x1000; - // netinet/in.h // NOTE: These are in addition to the constants defined in src/unix/mod.rs @@ -2068,6 +2171,7 @@ pub const NI_NUMERICSERV: ::c_int = 2; pub const NI_NOFQDN: ::c_int = 4; pub const NI_NAMEREQD: ::c_int = 8; pub const NI_DGRAM: ::c_int = 16; +pub const NI_IDN: ::c_int = 32; pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; @@ -2237,13 +2341,22 @@ pub const GRND_NONBLOCK: ::c_uint = 0x0001; pub const GRND_RANDOM: ::c_uint = 0x0002; pub const GRND_INSECURE: ::c_uint = 0x0004; +// pub const SECCOMP_MODE_DISABLED: ::c_uint = 0; pub const SECCOMP_MODE_STRICT: ::c_uint = 1; pub const SECCOMP_MODE_FILTER: ::c_uint = 2; +pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; +pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; +pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; +pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; + pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1; pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2; pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4; +pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8; +pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: ::c_ulong = 16; +pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: ::c_ulong = 32; pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000; pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000; @@ -2258,6 +2371,11 @@ pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000; pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000; pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff; +pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: ::c_ulong = 1; + +pub const SECCOMP_ADDFD_FLAG_SETFD: ::c_ulong = 1; +pub const SECCOMP_ADDFD_FLAG_SEND: ::c_ulong = 2; + pub const ITIMER_REAL: ::c_int = 0; pub const ITIMER_VIRTUAL: ::c_int = 1; pub const ITIMER_PROF: ::c_int = 2; @@ -2315,6 +2433,8 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000; pub const MFD_CLOEXEC: ::c_uint = 0x0001; pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002; pub const MFD_HUGETLB: ::c_uint = 0x0004; +pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008; +pub const MFD_EXEC: ::c_uint = 0x0010; pub const MFD_HUGE_64KB: ::c_uint = 0x40000000; pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000; pub const MFD_HUGE_1MB: ::c_uint = 0x50000000; @@ -2854,6 +2974,293 @@ pub const SIOCSIFMAP: ::c_ulong = 0x00008971; pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0; pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1; +// wireless.h +pub const WIRELESS_EXT: ::c_ulong = 0x16; + +pub const SIOCSIWCOMMIT: ::c_ulong = 0x8B00; +pub const SIOCGIWNAME: ::c_ulong = 0x8B01; + +pub const SIOCSIWNWID: ::c_ulong = 0x8B02; +pub const SIOCGIWNWID: ::c_ulong = 0x8B03; +pub const SIOCSIWFREQ: ::c_ulong = 0x8B04; +pub const SIOCGIWFREQ: ::c_ulong = 0x8B05; +pub const SIOCSIWMODE: ::c_ulong = 0x8B06; +pub const SIOCGIWMODE: ::c_ulong = 0x8B07; +pub const SIOCSIWSENS: ::c_ulong = 0x8B08; +pub const SIOCGIWSENS: ::c_ulong = 0x8B09; + +pub const SIOCSIWRANGE: ::c_ulong = 0x8B0A; +pub const SIOCGIWRANGE: ::c_ulong = 0x8B0B; +pub const SIOCSIWPRIV: ::c_ulong = 0x8B0C; +pub const SIOCGIWPRIV: ::c_ulong = 0x8B0D; +pub const SIOCSIWSTATS: ::c_ulong = 0x8B0E; +pub const SIOCGIWSTATS: ::c_ulong = 0x8B0F; + +pub const SIOCSIWSPY: ::c_ulong = 0x8B10; +pub const SIOCGIWSPY: ::c_ulong = 0x8B11; +pub const SIOCSIWTHRSPY: ::c_ulong = 0x8B12; +pub const SIOCGIWTHRSPY: ::c_ulong = 0x8B13; + +pub const SIOCSIWAP: ::c_ulong = 0x8B14; +pub const SIOCGIWAP: ::c_ulong = 0x8B15; +pub const SIOCGIWAPLIST: ::c_ulong = 0x8B17; +pub const SIOCSIWSCAN: ::c_ulong = 0x8B18; +pub const SIOCGIWSCAN: ::c_ulong = 0x8B19; + +pub const SIOCSIWESSID: ::c_ulong = 0x8B1A; +pub const SIOCGIWESSID: ::c_ulong = 0x8B1B; +pub const SIOCSIWNICKN: ::c_ulong = 0x8B1C; +pub const SIOCGIWNICKN: ::c_ulong = 0x8B1D; + +pub const SIOCSIWRATE: ::c_ulong = 0x8B20; +pub const SIOCGIWRATE: ::c_ulong = 0x8B21; +pub const SIOCSIWRTS: ::c_ulong = 0x8B22; +pub const SIOCGIWRTS: ::c_ulong = 0x8B23; +pub const SIOCSIWFRAG: ::c_ulong = 0x8B24; +pub const SIOCGIWFRAG: ::c_ulong = 0x8B25; +pub const SIOCSIWTXPOW: ::c_ulong = 0x8B26; +pub const SIOCGIWTXPOW: ::c_ulong = 0x8B27; +pub const SIOCSIWRETRY: ::c_ulong = 0x8B28; +pub const SIOCGIWRETRY: ::c_ulong = 0x8B29; + +pub const SIOCSIWENCODE: ::c_ulong = 0x8B2A; +pub const SIOCGIWENCODE: ::c_ulong = 0x8B2B; + +pub const SIOCSIWPOWER: ::c_ulong = 0x8B2C; +pub const SIOCGIWPOWER: ::c_ulong = 0x8B2D; + +pub const SIOCSIWGENIE: ::c_ulong = 0x8B30; +pub const SIOCGIWGENIE: ::c_ulong = 0x8B31; + +pub const SIOCSIWMLME: ::c_ulong = 0x8B16; + +pub const SIOCSIWAUTH: ::c_ulong = 0x8B32; +pub const SIOCGIWAUTH: ::c_ulong = 0x8B33; + +pub const SIOCSIWENCODEEXT: ::c_ulong = 0x8B34; +pub const SIOCGIWENCODEEXT: ::c_ulong = 0x8B35; + +pub const SIOCSIWPMKSA: ::c_ulong = 0x8B36; + +pub const SIOCIWFIRSTPRIV: ::c_ulong = 0x8BE0; +pub const SIOCIWLASTPRIV: ::c_ulong = 0x8BFF; + +pub const SIOCIWFIRST: ::c_ulong = 0x8B00; +pub const SIOCIWLAST: ::c_ulong = SIOCIWLASTPRIV; + +pub const IWEVTXDROP: ::c_ulong = 0x8C00; +pub const IWEVQUAL: ::c_ulong = 0x8C01; +pub const IWEVCUSTOM: ::c_ulong = 0x8C02; +pub const IWEVREGISTERED: ::c_ulong = 0x8C03; +pub const IWEVEXPIRED: ::c_ulong = 0x8C04; +pub const IWEVGENIE: ::c_ulong = 0x8C05; +pub const IWEVMICHAELMICFAILURE: ::c_ulong = 0x8C06; +pub const IWEVASSOCREQIE: ::c_ulong = 0x8C07; +pub const IWEVASSOCRESPIE: ::c_ulong = 0x8C08; +pub const IWEVPMKIDCAND: ::c_ulong = 0x8C09; +pub const IWEVFIRST: ::c_ulong = 0x8C00; + +pub const IW_PRIV_TYPE_MASK: ::c_ulong = 0x7000; +pub const IW_PRIV_TYPE_NONE: ::c_ulong = 0x0000; +pub const IW_PRIV_TYPE_BYTE: ::c_ulong = 0x1000; +pub const IW_PRIV_TYPE_CHAR: ::c_ulong = 0x2000; +pub const IW_PRIV_TYPE_INT: ::c_ulong = 0x4000; +pub const IW_PRIV_TYPE_FLOAT: ::c_ulong = 0x5000; +pub const IW_PRIV_TYPE_ADDR: ::c_ulong = 0x6000; + +pub const IW_PRIV_SIZE_FIXED: ::c_ulong = 0x0800; + +pub const IW_PRIV_SIZE_MASK: ::c_ulong = 0x07FF; + +pub const IW_MAX_FREQUENCIES: usize = 32; +pub const IW_MAX_BITRATES: usize = 32; +pub const IW_MAX_TXPOWER: usize = 8; +pub const IW_MAX_SPY: usize = 8; +pub const IW_MAX_AP: usize = 64; +pub const IW_ESSID_MAX_SIZE: usize = 32; + +pub const IW_MODE_AUTO: usize = 0; +pub const IW_MODE_ADHOC: usize = 1; +pub const IW_MODE_INFRA: usize = 2; +pub const IW_MODE_MASTER: usize = 3; +pub const IW_MODE_REPEAT: usize = 4; +pub const IW_MODE_SECOND: usize = 5; +pub const IW_MODE_MONITOR: usize = 6; +pub const IW_MODE_MESH: usize = 7; + +pub const IW_QUAL_QUAL_UPDATED: ::c_ulong = 0x01; +pub const IW_QUAL_LEVEL_UPDATED: ::c_ulong = 0x02; +pub const IW_QUAL_NOISE_UPDATED: ::c_ulong = 0x04; +pub const IW_QUAL_ALL_UPDATED: ::c_ulong = 0x07; +pub const IW_QUAL_DBM: ::c_ulong = 0x08; +pub const IW_QUAL_QUAL_INVALID: ::c_ulong = 0x10; +pub const IW_QUAL_LEVEL_INVALID: ::c_ulong = 0x20; +pub const IW_QUAL_NOISE_INVALID: ::c_ulong = 0x40; +pub const IW_QUAL_RCPI: ::c_ulong = 0x80; +pub const IW_QUAL_ALL_INVALID: ::c_ulong = 0x70; + +pub const IW_FREQ_AUTO: ::c_ulong = 0x00; +pub const IW_FREQ_FIXED: ::c_ulong = 0x01; + +pub const IW_MAX_ENCODING_SIZES: usize = 8; +pub const IW_ENCODING_TOKEN_MAX: usize = 64; + +pub const IW_ENCODE_INDEX: ::c_ulong = 0x00FF; +pub const IW_ENCODE_FLAGS: ::c_ulong = 0xFF00; +pub const IW_ENCODE_MODE: ::c_ulong = 0xF000; +pub const IW_ENCODE_DISABLED: ::c_ulong = 0x8000; +pub const IW_ENCODE_ENABLED: ::c_ulong = 0x0000; +pub const IW_ENCODE_RESTRICTED: ::c_ulong = 0x4000; +pub const IW_ENCODE_OPEN: ::c_ulong = 0x2000; +pub const IW_ENCODE_NOKEY: ::c_ulong = 0x0800; +pub const IW_ENCODE_TEMP: ::c_ulong = 0x0400; + +pub const IW_POWER_ON: ::c_ulong = 0x0000; +pub const IW_POWER_TYPE: ::c_ulong = 0xF000; +pub const IW_POWER_PERIOD: ::c_ulong = 0x1000; +pub const IW_POWER_TIMEOUT: ::c_ulong = 0x2000; +pub const IW_POWER_MODE: ::c_ulong = 0x0F00; +pub const IW_POWER_UNICAST_R: ::c_ulong = 0x0100; +pub const IW_POWER_MULTICAST_R: ::c_ulong = 0x0200; +pub const IW_POWER_ALL_R: ::c_ulong = 0x0300; +pub const IW_POWER_FORCE_S: ::c_ulong = 0x0400; +pub const IW_POWER_REPEATER: ::c_ulong = 0x0800; +pub const IW_POWER_MODIFIER: ::c_ulong = 0x000F; +pub const IW_POWER_MIN: ::c_ulong = 0x0001; +pub const IW_POWER_MAX: ::c_ulong = 0x0002; +pub const IW_POWER_RELATIVE: ::c_ulong = 0x0004; + +pub const IW_TXPOW_TYPE: ::c_ulong = 0x00FF; +pub const IW_TXPOW_DBM: ::c_ulong = 0x0000; +pub const IW_TXPOW_MWATT: ::c_ulong = 0x0001; +pub const IW_TXPOW_RELATIVE: ::c_ulong = 0x0002; +pub const IW_TXPOW_RANGE: ::c_ulong = 0x1000; + +pub const IW_RETRY_ON: ::c_ulong = 0x0000; +pub const IW_RETRY_TYPE: ::c_ulong = 0xF000; +pub const IW_RETRY_LIMIT: ::c_ulong = 0x1000; +pub const IW_RETRY_LIFETIME: ::c_ulong = 0x2000; +pub const IW_RETRY_MODIFIER: ::c_ulong = 0x00FF; +pub const IW_RETRY_MIN: ::c_ulong = 0x0001; +pub const IW_RETRY_MAX: ::c_ulong = 0x0002; +pub const IW_RETRY_RELATIVE: ::c_ulong = 0x0004; +pub const IW_RETRY_SHORT: ::c_ulong = 0x0010; +pub const IW_RETRY_LONG: ::c_ulong = 0x0020; + +pub const IW_SCAN_DEFAULT: ::c_ulong = 0x0000; +pub const IW_SCAN_ALL_ESSID: ::c_ulong = 0x0001; +pub const IW_SCAN_THIS_ESSID: ::c_ulong = 0x0002; +pub const IW_SCAN_ALL_FREQ: ::c_ulong = 0x0004; +pub const IW_SCAN_THIS_FREQ: ::c_ulong = 0x0008; +pub const IW_SCAN_ALL_MODE: ::c_ulong = 0x0010; +pub const IW_SCAN_THIS_MODE: ::c_ulong = 0x0020; +pub const IW_SCAN_ALL_RATE: ::c_ulong = 0x0040; +pub const IW_SCAN_THIS_RATE: ::c_ulong = 0x0080; + +pub const IW_SCAN_TYPE_ACTIVE: usize = 0; +pub const IW_SCAN_TYPE_PASSIVE: usize = 1; + +pub const IW_SCAN_MAX_DATA: usize = 4096; + +pub const IW_SCAN_CAPA_NONE: ::c_ulong = 0x00; +pub const IW_SCAN_CAPA_ESSID: ::c_ulong = 0x01; +pub const IW_SCAN_CAPA_BSSID: ::c_ulong = 0x02; +pub const IW_SCAN_CAPA_CHANNEL: ::c_ulong = 0x04; +pub const IW_SCAN_CAPA_MODE: ::c_ulong = 0x08; +pub const IW_SCAN_CAPA_RATE: ::c_ulong = 0x10; +pub const IW_SCAN_CAPA_TYPE: ::c_ulong = 0x20; +pub const IW_SCAN_CAPA_TIME: ::c_ulong = 0x40; + +pub const IW_CUSTOM_MAX: ::c_ulong = 256; + +pub const IW_GENERIC_IE_MAX: ::c_ulong = 1024; + +pub const IW_MLME_DEAUTH: ::c_ulong = 0; +pub const IW_MLME_DISASSOC: ::c_ulong = 1; +pub const IW_MLME_AUTH: ::c_ulong = 2; +pub const IW_MLME_ASSOC: ::c_ulong = 3; + +pub const IW_AUTH_INDEX: ::c_ulong = 0x0FFF; +pub const IW_AUTH_FLAGS: ::c_ulong = 0xF000; + +pub const IW_AUTH_WPA_VERSION: usize = 0; +pub const IW_AUTH_CIPHER_PAIRWISE: usize = 1; +pub const IW_AUTH_CIPHER_GROUP: usize = 2; +pub const IW_AUTH_KEY_MGMT: usize = 3; +pub const IW_AUTH_TKIP_COUNTERMEASURES: usize = 4; +pub const IW_AUTH_DROP_UNENCRYPTED: usize = 5; +pub const IW_AUTH_80211_AUTH_ALG: usize = 6; +pub const IW_AUTH_WPA_ENABLED: usize = 7; +pub const IW_AUTH_RX_UNENCRYPTED_EAPOL: usize = 8; +pub const IW_AUTH_ROAMING_CONTROL: usize = 9; +pub const IW_AUTH_PRIVACY_INVOKED: usize = 10; +pub const IW_AUTH_CIPHER_GROUP_MGMT: usize = 11; +pub const IW_AUTH_MFP: usize = 12; + +pub const IW_AUTH_WPA_VERSION_DISABLED: ::c_ulong = 0x00000001; +pub const IW_AUTH_WPA_VERSION_WPA: ::c_ulong = 0x00000002; +pub const IW_AUTH_WPA_VERSION_WPA2: ::c_ulong = 0x00000004; + +pub const IW_AUTH_CIPHER_NONE: ::c_ulong = 0x00000001; +pub const IW_AUTH_CIPHER_WEP40: ::c_ulong = 0x00000002; +pub const IW_AUTH_CIPHER_TKIP: ::c_ulong = 0x00000004; +pub const IW_AUTH_CIPHER_CCMP: ::c_ulong = 0x00000008; +pub const IW_AUTH_CIPHER_WEP104: ::c_ulong = 0x00000010; +pub const IW_AUTH_CIPHER_AES_CMAC: ::c_ulong = 0x00000020; + +pub const IW_AUTH_KEY_MGMT_802_1X: usize = 1; +pub const IW_AUTH_KEY_MGMT_PSK: usize = 2; + +pub const IW_AUTH_ALG_OPEN_SYSTEM: ::c_ulong = 0x00000001; +pub const IW_AUTH_ALG_SHARED_KEY: ::c_ulong = 0x00000002; +pub const IW_AUTH_ALG_LEAP: ::c_ulong = 0x00000004; + +pub const IW_AUTH_ROAMING_ENABLE: usize = 0; +pub const IW_AUTH_ROAMING_DISABLE: usize = 1; + +pub const IW_AUTH_MFP_DISABLED: usize = 0; +pub const IW_AUTH_MFP_OPTIONAL: usize = 1; +pub const IW_AUTH_MFP_REQUIRED: usize = 2; + +pub const IW_ENCODE_SEQ_MAX_SIZE: usize = 8; + +pub const IW_ENCODE_ALG_NONE: usize = 0; +pub const IW_ENCODE_ALG_WEP: usize = 1; +pub const IW_ENCODE_ALG_TKIP: usize = 2; +pub const IW_ENCODE_ALG_CCMP: usize = 3; +pub const IW_ENCODE_ALG_PMK: usize = 4; +pub const IW_ENCODE_ALG_AES_CMAC: usize = 5; + +pub const IW_ENCODE_EXT_TX_SEQ_VALID: ::c_ulong = 0x00000001; +pub const IW_ENCODE_EXT_RX_SEQ_VALID: ::c_ulong = 0x00000002; +pub const IW_ENCODE_EXT_GROUP_KEY: ::c_ulong = 0x00000004; +pub const IW_ENCODE_EXT_SET_TX_KEY: ::c_ulong = 0x00000008; + +pub const IW_MICFAILURE_KEY_ID: ::c_ulong = 0x00000003; +pub const IW_MICFAILURE_GROUP: ::c_ulong = 0x00000004; +pub const IW_MICFAILURE_PAIRWISE: ::c_ulong = 0x00000008; +pub const IW_MICFAILURE_STAKEY: ::c_ulong = 0x00000010; +pub const IW_MICFAILURE_COUNT: ::c_ulong = 0x00000060; + +pub const IW_ENC_CAPA_WPA: ::c_ulong = 0x00000001; +pub const IW_ENC_CAPA_WPA2: ::c_ulong = 0x00000002; +pub const IW_ENC_CAPA_CIPHER_TKIP: ::c_ulong = 0x00000004; +pub const IW_ENC_CAPA_CIPHER_CCMP: ::c_ulong = 0x00000008; +pub const IW_ENC_CAPA_4WAY_HANDSHAKE: ::c_ulong = 0x00000010; + +pub const IW_PMKSA_ADD: usize = 1; +pub const IW_PMKSA_REMOVE: usize = 2; +pub const IW_PMKSA_FLUSH: usize = 3; + +pub const IW_PMKID_LEN: usize = 16; + +pub const IW_PMKID_CAND_PREAUTH: ::c_ulong = 0x00000001; + +pub const IW_EV_LCP_PK_LEN: usize = 4; + +pub const IW_EV_CHAR_PK_LEN: usize = IW_EV_LCP_PK_LEN + ::IFNAMSIZ; +pub const IW_EV_POINT_PK_LEN: usize = IW_EV_LCP_PK_LEN + 4; + pub const IPTOS_TOS_MASK: u8 = 0x1E; pub const IPTOS_PREC_MASK: u8 = 0xE0; @@ -3234,6 +3641,41 @@ pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14; pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15; // linux/tls.h +pub const TLS_TX: ::c_int = 1; +pub const TLS_RX: ::c_int = 2; + +pub const TLS_1_2_VERSION_MAJOR: ::__u8 = 0x3; +pub const TLS_1_2_VERSION_MINOR: ::__u8 = 0x3; +pub const TLS_1_2_VERSION: ::__u16 = + ((TLS_1_2_VERSION_MAJOR as ::__u16) << 8) | (TLS_1_2_VERSION_MINOR as ::__u16); + +pub const TLS_1_3_VERSION_MAJOR: ::__u8 = 0x3; +pub const TLS_1_3_VERSION_MINOR: ::__u8 = 0x4; +pub const TLS_1_3_VERSION: ::__u16 = + ((TLS_1_3_VERSION_MAJOR as ::__u16) << 8) | (TLS_1_3_VERSION_MINOR as ::__u16); + +pub const TLS_CIPHER_AES_GCM_128: ::__u16 = 51; +pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: usize = 8; +pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: usize = 16; +pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: usize = 4; +pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: usize = 16; +pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: usize = 8; + +pub const TLS_CIPHER_AES_GCM_256: ::__u16 = 52; +pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: usize = 8; +pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: usize = 32; +pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: usize = 4; +pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: usize = 16; +pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: usize = 8; + +pub const TLS_CIPHER_CHACHA20_POLY1305: ::__u16 = 54; +pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: usize = 12; +pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: usize = 32; +pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: usize = 0; +pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: usize = 16; +pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: usize = 8; + +pub const TLS_SET_RECORD_TYPE: ::c_int = 1; pub const TLS_GET_RECORD_TYPE: ::c_int = 2; pub const SOL_TLS: ::c_int = 282; @@ -4029,6 +4471,198 @@ pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; /// maximum number of services provided on the same listening port pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_NET: ::c_int = 3; +pub const CTL_FS: ::c_int = 5; +pub const CTL_DEBUG: ::c_int = 6; +pub const CTL_DEV: ::c_int = 7; +pub const CTL_BUS: ::c_int = 8; +pub const CTL_ABI: ::c_int = 9; +pub const CTL_CPU: ::c_int = 10; + +pub const CTL_BUS_ISA: ::c_int = 1; + +pub const INOTIFY_MAX_USER_INSTANCES: ::c_int = 1; +pub const INOTIFY_MAX_USER_WATCHES: ::c_int = 2; +pub const INOTIFY_MAX_QUEUED_EVENTS: ::c_int = 3; + +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_SECUREMASK: ::c_int = 5; +pub const KERN_PROF: ::c_int = 6; +pub const KERN_NODENAME: ::c_int = 7; +pub const KERN_DOMAINNAME: ::c_int = 8; +pub const KERN_PANIC: ::c_int = 15; +pub const KERN_REALROOTDEV: ::c_int = 16; +pub const KERN_SPARC_REBOOT: ::c_int = 21; +pub const KERN_CTLALTDEL: ::c_int = 22; +pub const KERN_PRINTK: ::c_int = 23; +pub const KERN_NAMETRANS: ::c_int = 24; +pub const KERN_PPC_HTABRECLAIM: ::c_int = 25; +pub const KERN_PPC_ZEROPAGED: ::c_int = 26; +pub const KERN_PPC_POWERSAVE_NAP: ::c_int = 27; +pub const KERN_MODPROBE: ::c_int = 28; +pub const KERN_SG_BIG_BUFF: ::c_int = 29; +pub const KERN_ACCT: ::c_int = 30; +pub const KERN_PPC_L2CR: ::c_int = 31; +pub const KERN_RTSIGNR: ::c_int = 32; +pub const KERN_RTSIGMAX: ::c_int = 33; +pub const KERN_SHMMAX: ::c_int = 34; +pub const KERN_MSGMAX: ::c_int = 35; +pub const KERN_MSGMNB: ::c_int = 36; +pub const KERN_MSGPOOL: ::c_int = 37; +pub const KERN_SYSRQ: ::c_int = 38; +pub const KERN_MAX_THREADS: ::c_int = 39; +pub const KERN_RANDOM: ::c_int = 40; +pub const KERN_SHMALL: ::c_int = 41; +pub const KERN_MSGMNI: ::c_int = 42; +pub const KERN_SEM: ::c_int = 43; +pub const KERN_SPARC_STOP_A: ::c_int = 44; +pub const KERN_SHMMNI: ::c_int = 45; +pub const KERN_OVERFLOWUID: ::c_int = 46; +pub const KERN_OVERFLOWGID: ::c_int = 47; +pub const KERN_SHMPATH: ::c_int = 48; +pub const KERN_HOTPLUG: ::c_int = 49; +pub const KERN_IEEE_EMULATION_WARNINGS: ::c_int = 50; +pub const KERN_S390_USER_DEBUG_LOGGING: ::c_int = 51; +pub const KERN_CORE_USES_PID: ::c_int = 52; +pub const KERN_TAINTED: ::c_int = 53; +pub const KERN_CADPID: ::c_int = 54; +pub const KERN_PIDMAX: ::c_int = 55; +pub const KERN_CORE_PATTERN: ::c_int = 56; +pub const KERN_PANIC_ON_OOPS: ::c_int = 57; +pub const KERN_HPPA_PWRSW: ::c_int = 58; +pub const KERN_HPPA_UNALIGNED: ::c_int = 59; +pub const KERN_PRINTK_RATELIMIT: ::c_int = 60; +pub const KERN_PRINTK_RATELIMIT_BURST: ::c_int = 61; +pub const KERN_PTY: ::c_int = 62; +pub const KERN_NGROUPS_MAX: ::c_int = 63; +pub const KERN_SPARC_SCONS_PWROFF: ::c_int = 64; +pub const KERN_HZ_TIMER: ::c_int = 65; +pub const KERN_UNKNOWN_NMI_PANIC: ::c_int = 66; +pub const KERN_BOOTLOADER_TYPE: ::c_int = 67; +pub const KERN_RANDOMIZE: ::c_int = 68; +pub const KERN_SETUID_DUMPABLE: ::c_int = 69; +pub const KERN_SPIN_RETRY: ::c_int = 70; +pub const KERN_ACPI_VIDEO_FLAGS: ::c_int = 71; +pub const KERN_IA64_UNALIGNED: ::c_int = 72; +pub const KERN_COMPAT_LOG: ::c_int = 73; +pub const KERN_MAX_LOCK_DEPTH: ::c_int = 74; +pub const KERN_NMI_WATCHDOG: ::c_int = 75; +pub const KERN_PANIC_ON_NMI: ::c_int = 76; + +pub const VM_OVERCOMMIT_MEMORY: ::c_int = 5; +pub const VM_PAGE_CLUSTER: ::c_int = 10; +pub const VM_DIRTY_BACKGROUND: ::c_int = 11; +pub const VM_DIRTY_RATIO: ::c_int = 12; +pub const VM_DIRTY_WB_CS: ::c_int = 13; +pub const VM_DIRTY_EXPIRE_CS: ::c_int = 14; +pub const VM_NR_PDFLUSH_THREADS: ::c_int = 15; +pub const VM_OVERCOMMIT_RATIO: ::c_int = 16; +pub const VM_PAGEBUF: ::c_int = 17; +pub const VM_HUGETLB_PAGES: ::c_int = 18; +pub const VM_SWAPPINESS: ::c_int = 19; +pub const VM_LOWMEM_RESERVE_RATIO: ::c_int = 20; +pub const VM_MIN_FREE_KBYTES: ::c_int = 21; +pub const VM_MAX_MAP_COUNT: ::c_int = 22; +pub const VM_LAPTOP_MODE: ::c_int = 23; +pub const VM_BLOCK_DUMP: ::c_int = 24; +pub const VM_HUGETLB_GROUP: ::c_int = 25; +pub const VM_VFS_CACHE_PRESSURE: ::c_int = 26; +pub const VM_LEGACY_VA_LAYOUT: ::c_int = 27; +pub const VM_SWAP_TOKEN_TIMEOUT: ::c_int = 28; +pub const VM_DROP_PAGECACHE: ::c_int = 29; +pub const VM_PERCPU_PAGELIST_FRACTION: ::c_int = 30; +pub const VM_ZONE_RECLAIM_MODE: ::c_int = 31; +pub const VM_MIN_UNMAPPED: ::c_int = 32; +pub const VM_PANIC_ON_OOM: ::c_int = 33; +pub const VM_VDSO_ENABLED: ::c_int = 34; +pub const VM_MIN_SLAB: ::c_int = 35; + +pub const NET_CORE: ::c_int = 1; +pub const NET_ETHER: ::c_int = 2; +pub const NET_802: ::c_int = 3; +pub const NET_UNIX: ::c_int = 4; +pub const NET_IPV4: ::c_int = 5; +pub const NET_IPX: ::c_int = 6; +pub const NET_ATALK: ::c_int = 7; +pub const NET_NETROM: ::c_int = 8; +pub const NET_AX25: ::c_int = 9; +pub const NET_BRIDGE: ::c_int = 10; +pub const NET_ROSE: ::c_int = 11; +pub const NET_IPV6: ::c_int = 12; +pub const NET_X25: ::c_int = 13; +pub const NET_TR: ::c_int = 14; +pub const NET_DECNET: ::c_int = 15; +pub const NET_ECONET: ::c_int = 16; +pub const NET_SCTP: ::c_int = 17; +pub const NET_LLC: ::c_int = 18; +pub const NET_NETFILTER: ::c_int = 19; +pub const NET_DCCP: ::c_int = 20; +pub const NET_IRDA: ::c_int = 412; + +// include/linux/sched.h +pub const PF_VCPU: ::c_int = 0x00000001; +pub const PF_IDLE: ::c_int = 0x00000002; +pub const PF_EXITING: ::c_int = 0x00000004; +pub const PF_POSTCOREDUMP: ::c_int = 0x00000008; +pub const PF_IO_WORKER: ::c_int = 0x00000010; +pub const PF_WQ_WORKER: ::c_int = 0x00000020; +pub const PF_FORKNOEXEC: ::c_int = 0x00000040; +pub const PF_MCE_PROCESS: ::c_int = 0x00000080; +pub const PF_SUPERPRIV: ::c_int = 0x00000100; +pub const PF_DUMPCORE: ::c_int = 0x00000200; +pub const PF_SIGNALED: ::c_int = 0x00000400; +pub const PF_MEMALLOC: ::c_int = 0x00000800; +pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000; +pub const PF_USED_MATH: ::c_int = 0x00002000; +pub const PF_USER_WORKER: ::c_int = 0x00004000; +pub const PF_NOFREEZE: ::c_int = 0x00008000; +pub const PF_KSWAPD: ::c_int = 0x00020000; +pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000; +pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000; +pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000; +pub const PF_KTHREAD: ::c_int = 0x00200000; +pub const PF_RANDOMIZE: ::c_int = 0x00400000; +pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000; +pub const PF_MCE_EARLY: ::c_int = 0x08000000; +pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000; + +pub const CSIGNAL: ::c_int = 0x000000ff; + +pub const SCHED_NORMAL: ::c_int = 0; +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; +pub const SCHED_DEADLINE: ::c_int = 6; + +pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; + +pub const CLONE_PIDFD: ::c_int = 0x1000; + +pub const SCHED_FLAG_RESET_ON_FORK: ::c_int = 0x01; +pub const SCHED_FLAG_RECLAIM: ::c_int = 0x02; +pub const SCHED_FLAG_DL_OVERRUN: ::c_int = 0x04; +pub const SCHED_FLAG_KEEP_POLICY: ::c_int = 0x08; +pub const SCHED_FLAG_KEEP_PARAMS: ::c_int = 0x10; +pub const SCHED_FLAG_UTIL_CLAMP_MIN: ::c_int = 0x20; +pub const SCHED_FLAG_UTIL_CLAMP_MAX: ::c_int = 0x40; + +pub const SCHED_FLAG_KEEP_ALL: ::c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS; + +pub const SCHED_FLAG_UTIL_CLAMP: ::c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX; + +pub const SCHED_FLAG_ALL: ::c_int = SCHED_FLAG_RESET_ON_FORK + | SCHED_FLAG_RECLAIM + | SCHED_FLAG_DL_OVERRUN + | SCHED_FLAG_KEEP_ALL + | SCHED_FLAG_UTIL_CLAMP; + f! { pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) @@ -4243,7 +4877,7 @@ cfg_if! { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn getloadavg( @@ -4602,6 +5236,9 @@ extern "C" { flags: ::c_uint, ) -> ::ssize_t; pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int; + pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int; + pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; @@ -4684,6 +5321,27 @@ extern "C" { guardsize: *mut ::size_t, ) -> ::c_int; pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int; + pub fn pthread_attr_getinheritsched( + attr: *const ::pthread_attr_t, + inheritsched: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_attr_setinheritsched( + attr: *mut ::pthread_attr_t, + inheritsched: ::c_int, + ) -> ::c_int; + pub fn pthread_attr_getschedpolicy( + attr: *const ::pthread_attr_t, + policy: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_attr_setschedpolicy(attr: *mut ::pthread_attr_t, policy: ::c_int) -> ::c_int; + pub fn pthread_attr_getschedparam( + attr: *const ::pthread_attr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn pthread_attr_setschedparam( + attr: *mut ::pthread_attr_t, + param: *const ::sched_param, + ) -> ::c_int; pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; pub fn pthread_condattr_getpshared( diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs index 944d6e787..12280851e 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -157,6 +157,22 @@ s! { } s_no_extra_traits! { + pub struct user_fpxregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, + pub twd: ::c_ushort, + pub fop: ::c_ushort, + pub fip: ::c_long, + pub fcs: ::c_long, + pub foo: ::c_long, + pub fos: ::c_long, + pub mxcsr: ::c_long, + __reserved: ::c_long, + pub st_space: [::c_long; 32], + pub xmm_space: [::c_long; 32], + padding: [::c_long; 56], + } + pub struct ucontext_t { pub uc_flags: ::c_ulong, pub uc_link: *mut ucontext_t, @@ -169,6 +185,64 @@ s_no_extra_traits! { cfg_if! { if #[cfg(feature = "extra_traits")] { + impl PartialEq for user_fpxregs_struct { + fn eq(&self, other: &user_fpxregs_struct) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.twd == other.twd + && self.fop == other.fop + && self.fip == other.fip + && self.fcs == other.fcs + && self.foo == other.foo + && self.fos == other.fos + && self.mxcsr == other.mxcsr + // Ignore __reserved field + && self.st_space == other.st_space + && self.xmm_space == other.xmm_space + // Ignore padding field + } + } + + impl Eq for user_fpxregs_struct {} + + impl ::fmt::Debug for user_fpxregs_struct { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("user_fpxregs_struct") + .field("cwd", &self.cwd) + .field("swd", &self.swd) + .field("twd", &self.twd) + .field("fop", &self.fop) + .field("fip", &self.fip) + .field("fcs", &self.fcs) + .field("foo", &self.foo) + .field("fos", &self.fos) + .field("mxcsr", &self.mxcsr) + // Ignore __reserved field + .field("st_space", &self.st_space) + .field("xmm_space", &self.xmm_space) + // Ignore padding field + .finish() + } + } + + impl ::hash::Hash for user_fpxregs_struct { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.swd.hash(state); + self.twd.hash(state); + self.fop.hash(state); + self.fip.hash(state); + self.fcs.hash(state); + self.foo.hash(state); + self.fos.hash(state); + self.mxcsr.hash(state); + // Ignore __reserved field + self.st_space.hash(state); + self.xmm_space.hash(state); + // Ignore padding field + } + } + impl PartialEq for ucontext_t { fn eq(&self, other: &ucontext_t) -> bool { self.uc_flags == other.uc_flags diff --git a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs index b67d55e99..a4c1f708a 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs @@ -271,6 +271,83 @@ s! { pub maxerror: ::c_long, pub esterror: ::c_long, } + + // linux/if_xdp.h + + pub struct sockaddr_xdp { + pub sxdp_family: ::__u16, + pub sxdp_flags: ::__u16, + pub sxdp_ifindex: ::__u32, + pub sxdp_queue_id: ::__u32, + pub sxdp_shared_umem_fd: ::__u32, + } + + pub struct xdp_ring_offset { + pub producer: ::__u64, + pub consumer: ::__u64, + pub desc: ::__u64, + pub flags: ::__u64, + } + + pub struct xdp_mmap_offsets { + pub rx: xdp_ring_offset, + pub tx: xdp_ring_offset, + pub fr: xdp_ring_offset, + pub cr: xdp_ring_offset, + } + + pub struct xdp_ring_offset_v1 { + pub producer: ::__u64, + pub consumer: ::__u64, + pub desc: ::__u64, + } + + pub struct xdp_mmap_offsets_v1 { + pub rx: xdp_ring_offset_v1, + pub tx: xdp_ring_offset_v1, + pub fr: xdp_ring_offset_v1, + pub cr: xdp_ring_offset_v1, + } + + pub struct xdp_umem_reg { + pub addr: ::__u64, + pub len: ::__u64, + pub chunk_size: ::__u32, + pub headroom: ::__u32, + pub flags: ::__u32, + } + + pub struct xdp_umem_reg_v1 { + pub addr: ::__u64, + pub len: ::__u64, + pub chunk_size: ::__u32, + pub headroom: ::__u32, + } + + pub struct xdp_statistics { + pub rx_dropped: ::__u64, + pub rx_invalid_descs: ::__u64, + pub tx_invalid_descs: ::__u64, + pub rx_ring_full: ::__u64, + pub rx_fill_ring_empty_descs: ::__u64, + pub tx_ring_empty_descs: ::__u64, + } + + pub struct xdp_statistics_v1 { + pub rx_dropped: ::__u64, + pub rx_invalid_descs: ::__u64, + pub tx_invalid_descs: ::__u64, + } + + pub struct xdp_options { + pub flags: ::__u32, + } + + pub struct xdp_desc { + pub addr: ::__u64, + pub len: ::__u32, + pub options: ::__u32, + } } s_no_extra_traits! { @@ -703,6 +780,40 @@ pub const TIME_ERROR: ::c_int = 5; pub const TIME_BAD: ::c_int = TIME_ERROR; pub const MAXTC: ::c_long = 6; +pub const SOL_XDP: ::c_int = 283; + +// linux/if_xdp.h +pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0; +pub const XDP_COPY: ::__u16 = 1 << 1; +pub const XDP_ZEROCOPY: ::__u16 = 1 << 2; +pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3; +pub const XDP_USE_SG: ::__u16 = 1 << 4; + +pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0; + +pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0; + +pub const XDP_MMAP_OFFSETS: ::c_int = 1; +pub const XDP_RX_RING: ::c_int = 2; +pub const XDP_TX_RING: ::c_int = 3; +pub const XDP_UMEM_REG: ::c_int = 4; +pub const XDP_UMEM_FILL_RING: ::c_int = 5; +pub const XDP_UMEM_COMPLETION_RING: ::c_int = 6; +pub const XDP_STATISTICS: ::c_int = 7; +pub const XDP_OPTIONS: ::c_int = 8; + +pub const XDP_OPTIONS_ZEROCOPY: ::__u32 = 1 << 0; + +pub const XDP_PGOFF_RX_RING: ::off_t = 0; +pub const XDP_PGOFF_TX_RING: ::off_t = 0x80000000; +pub const XDP_UMEM_PGOFF_FILL_RING: ::c_ulonglong = 0x100000000; +pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000; + +pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; + +pub const XDP_PKT_CONTD: ::__u32 = 1 << 0; + cfg_if! { if #[cfg(target_arch = "s390x")] { pub const POSIX_FADV_DONTNEED: ::c_int = 6; @@ -778,6 +889,13 @@ extern "C" { format: *const ::c_char, tm: *const ::tm, ) -> ::size_t; + pub fn strftime_l( + s: *mut ::c_char, + max: ::size_t, + format: *const ::c_char, + tm: *const ::tm, + locale: ::locale_t, + ) -> ::size_t; pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char; pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs index 4afb98e95..48b03e9ee 100644 --- a/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs @@ -343,7 +343,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs index c7cbafa16..56a0e37f6 100644 --- a/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs +++ b/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs @@ -13,7 +13,7 @@ s! { /// Combination of granularity and offset. /// /// The granularity defines how many CPUs each bit in map describes. - /// The offset is the numer of the first CPU described by the first + /// The offset is the number of the first CPU described by the first /// bit in the bitmap. /// offset must be a multiple of 2^graularity. /// diff --git a/vendor/libc/src/unix/linux_like/mod.rs b/vendor/libc/src/unix/linux_like/mod.rs index 26fd68de4..35c7598c9 100644 --- a/vendor/libc/src/unix/linux_like/mod.rs +++ b/vendor/libc/src/unix/linux_like/mod.rs @@ -6,13 +6,9 @@ pub type timer_t = *mut ::c_void; pub type key_t = ::c_int; pub type id_t = ::c_uint; -#[cfg_attr(feature = "extra_traits", derive(Debug))] -pub enum timezone {} -impl ::Copy for timezone {} -impl ::Clone for timezone { - fn clone(&self) -> timezone { - *self - } +missing! { + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum timezone {} } s! { diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs index 9daebcaa6..3dca83305 100644 --- a/vendor/libc/src/unix/mod.rs +++ b/vendor/libc/src/unix/mod.rs @@ -41,13 +41,9 @@ cfg_if! { } } -#[cfg_attr(feature = "extra_traits", derive(Debug))] -pub enum DIR {} -impl ::Copy for DIR {} -impl ::Clone for DIR { - fn clone(&self) -> DIR { - *self - } +missing! { + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum DIR {} } pub type locale_t = *mut ::c_void; @@ -321,7 +317,7 @@ cfg_if! { if #[cfg(any(target_os = "l4re", target_os = "espidf"))] { // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM } else if #[cfg(feature = "std")] { - // cargo build, don't pull in anything extra as the libstd dep + // cargo build, don't pull in anything extra as the std dep // already pulls in all libs. } else if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc"), @@ -414,21 +410,11 @@ cfg_if! { } } -#[cfg_attr(feature = "extra_traits", derive(Debug))] -pub enum FILE {} -impl ::Copy for FILE {} -impl ::Clone for FILE { - fn clone(&self) -> FILE { - *self - } -} -#[cfg_attr(feature = "extra_traits", derive(Debug))] -pub enum fpos_t {} // FIXME: fill this out with a struct -impl ::Copy for fpos_t {} -impl ::Clone for fpos_t { - fn clone(&self) -> fpos_t { - *self - } +missing! { + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum FILE {} + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub enum fpos_t {} // FIXME: fill this out with a struct } extern "C" { diff --git a/vendor/libc/src/unix/newlib/vita/mod.rs b/vendor/libc/src/unix/newlib/vita/mod.rs index e80f061ea..d4c6955f3 100644 --- a/vendor/libc/src/unix/newlib/vita/mod.rs +++ b/vendor/libc/src/unix/newlib/vita/mod.rs @@ -94,6 +94,8 @@ pub const SOCK_RAW: ::c_int = 3; pub const SOCK_RDM: ::c_int = 4; pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOMAXCONN: ::c_int = 128; + pub const FIONBIO: ::c_ulong = 1; pub const POLLIN: ::c_short = 0x0001; diff --git a/vendor/libc/src/unix/nto/mod.rs b/vendor/libc/src/unix/nto/mod.rs index 91e531ffd..9eef23458 100644 --- a/vendor/libc/src/unix/nto/mod.rs +++ b/vendor/libc/src/unix/nto/mod.rs @@ -3283,7 +3283,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; diff --git a/vendor/libc/src/unix/redox/mod.rs b/vendor/libc/src/unix/redox/mod.rs index cd219a777..19315c387 100644 --- a/vendor/libc/src/unix/redox/mod.rs +++ b/vendor/libc/src/unix/redox/mod.rs @@ -28,7 +28,7 @@ pub type nfds_t = ::c_ulong; pub type nlink_t = ::c_ulong; pub type off_t = ::c_longlong; pub type pthread_t = *mut ::c_void; -// Must be usize due to libstd/sys_common/thread_local.rs, +// Must be usize due to library/std/sys_common/thread_local.rs, // should technically be *mut ::c_void pub type pthread_key_t = usize; pub type rlim_t = ::c_ulonglong; @@ -729,6 +729,7 @@ pub const FIOCLEX: ::c_ulong = 0x5451; pub const TCGETS: ::c_ulong = 0x5401; pub const TCSETS: ::c_ulong = 0x5402; pub const TCFLSH: ::c_ulong = 0x540B; +pub const TIOCSCTTY: ::c_ulong = 0x540E; pub const TIOCGPGRP: ::c_ulong = 0x540F; pub const TIOCSPGRP: ::c_ulong = 0x5410; pub const TIOCGWINSZ: ::c_ulong = 0x5413; @@ -813,6 +814,7 @@ pub const SOCK_NONBLOCK: ::c_int = 0o4_000; pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000; pub const SOCK_SEQPACKET: ::c_int = 5; pub const SOL_SOCKET: ::c_int = 1; +pub const SOMAXCONN: ::c_int = 128; // sys/termios.h pub const VEOF: usize = 0; @@ -1137,6 +1139,15 @@ extern "C" { clock_id: ::clockid_t, ) -> ::c_int; + //pty.h + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, + ) -> ::c_int; + // pwd.h pub fn getpwent() -> *mut passwd; pub fn setpwent(); @@ -1172,9 +1183,15 @@ extern "C" { pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; // stdlib.h + pub fn getsubopt( + optionp: *mut *mut c_char, + tokens: *const *mut c_char, + valuep: *mut *mut c_char, + ) -> ::c_int; pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; // string.h + pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t); pub fn strlcat(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t; pub fn strlcpy(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t; @@ -1201,6 +1218,8 @@ extern "C" { pub fn shm_unlink(name: *const ::c_char) -> ::c_int; // sys/resource.h + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; @@ -1229,17 +1248,8 @@ extern "C" { pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; - // strings.h - pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t); - - pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; - pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; - - pub fn getsubopt( - optionp: *mut *mut c_char, - tokens: *const *mut c_char, - valuep: *mut *mut c_char, - ) -> ::c_int; + // utmp.h + pub fn login_tty(fd: ::c_int) -> ::c_int; } cfg_if! { diff --git a/vendor/libc/src/unix/solarish/mod.rs b/vendor/libc/src/unix/solarish/mod.rs index a3fa56a65..c68cfba3c 100644 --- a/vendor/libc/src/unix/solarish/mod.rs +++ b/vendor/libc/src/unix/solarish/mod.rs @@ -1294,12 +1294,13 @@ pub const O_EXCL: ::c_int = 1024; pub const O_NOCTTY: ::c_int = 2048; pub const O_TRUNC: ::c_int = 512; pub const O_NOFOLLOW: ::c_int = 0x20000; -pub const O_DIRECTORY: ::c_int = 0x1000000; pub const O_SEARCH: ::c_int = 0x200000; pub const O_EXEC: ::c_int = 0x400000; pub const O_CLOEXEC: ::c_int = 0x800000; pub const O_ACCMODE: ::c_int = 0x600003; pub const O_XATTR: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x1000000; +pub const O_DIRECT: ::c_int = 0x2000000; pub const S_IFIFO: mode_t = 4096; pub const S_IFCHR: mode_t = 8192; pub const S_IFBLK: mode_t = 24576; @@ -2588,6 +2589,9 @@ const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>(); const NEWDEV: ::c_int = 1; +// sys/sendfile.h +pub const SFV_FD_SELF: ::c_int = -2; + const_fn! { {const} fn _CMSG_HDR_ALIGN(p: usize) -> usize { (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) @@ -2753,7 +2757,7 @@ extern "C" { host: *mut ::c_char, hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::socklen_t, + servlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn setpwent(); @@ -2948,6 +2952,7 @@ extern "C" { result: *mut *mut ::group, ) -> ::c_int; pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; @@ -3203,9 +3208,9 @@ extern "C" { pub fn sync(); - fn __major(version: ::c_int, devnum: ::dev_t) -> ::major_t; - fn __minor(version: ::c_int, devnum: ::dev_t) -> ::minor_t; - fn __makedev(version: ::c_int, majdev: ::major_t, mindev: ::minor_t) -> ::dev_t; + pub fn __major(version: ::c_int, devnum: ::dev_t) -> ::major_t; + pub fn __minor(version: ::c_int, devnum: ::dev_t) -> ::minor_t; + pub fn __makedev(version: ::c_int, majdev: ::major_t, mindev: ::minor_t) -> ::dev_t; } #[link(name = "sendfile")] diff --git a/vendor/libc/src/vxworks/mod.rs b/vendor/libc/src/vxworks/mod.rs index 21d33a4e5..43afbc3e2 100644 --- a/vendor/libc/src/vxworks/mod.rs +++ b/vendor/libc/src/vxworks/mod.rs @@ -582,8 +582,8 @@ pub const EAI_SERVICE: ::c_int = 9; pub const EAI_SOCKTYPE: ::c_int = 10; pub const EAI_SYSTEM: ::c_int = 11; -// This is not defined in vxWorks, but we have to define it here -// to make the building pass for getrandom and libstd, FIXME +// FIXME: This is not defined in vxWorks, but we have to define it here +// to make the building pass for getrandom and std pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; //Clock Lib Stuff diff --git a/vendor/libc/src/wasi.rs b/vendor/libc/src/wasi.rs index 1a855e0e0..ae490bf94 100644 --- a/vendor/libc/src/wasi.rs +++ b/vendor/libc/src/wasi.rs @@ -65,6 +65,7 @@ s_paren! { // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct), // but that's an implementation detail that we don't want to have to deal with #[repr(transparent)] + #[allow(dead_code)] pub struct clockid_t(*const u8); } diff --git a/vendor/libloading/.cargo-checksum.json b/vendor/libloading/.cargo-checksum.json index 5021ea7cf..85daf0b09 100644 --- a/vendor/libloading/.cargo-checksum.json +++ b/vendor/libloading/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"30f23c025249e7779afd2a52fdaba7145dd75c2a3e5a0a23f3322261d6b94c59","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"973a5fa332a8f33abc73ffc0ed509f81c66dbd681d8f50969cac32cdfe16ecb2","src/changelog.rs":"a49ff30e81a245fdcef957a3fffed5a5a5b56825bc51f6ed26fe4c12f75d359c","src/error.rs":"156c53e299e8f1cd4694b277a5d92772a8a9e7ec4004bae067367f4c2502de8b","src/lib.rs":"2eebab93230a59cd87c7884e95c91b3a8736c0a76814dd040864b8c25f0d5f9e","src/os/mod.rs":"6c59ef8c1120953ae6b6c32f27766c643ca90d85075c49c3545d2fe1ed82cedd","src/os/unix/consts.rs":"1418cc26329d01ee6bc9c1144881873a66ac2183c1bf1d589904d569656c80f2","src/os/unix/mod.rs":"dff9590acbbb9a02baea9d2eb870515104c9d519b1896887f3bf1434db442929","src/os/windows/mod.rs":"b14478d7f9d4e8edc8afcbc7aa695ede1ccdd739a94242cb8dbb154fe04e4999","src/safe.rs":"b0dc1cb5c8e0216e365063b5e84218b2377bb7a62714fca9a6215a22a7bc58b8","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"0b6dcfb9eafff2d87966460ef6b1b99980f888813037e787ed92deee602f8c2b","tests/constants.rs":"4778c062605ed22238c1bed16de4c076d0857282f090f36e6d985dafb7b4544d","tests/functions.rs":"0cbcc193f8aad71df626aefab9881a76f17c5a4b241855b602ce874018392db7","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/windows.rs":"35584a46658b305cd539712d3ba3c21fe7a130fd693aa1389e4886a67625d532"},"package":"b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"} \ No newline at end of file +{"files":{"Cargo.toml":"c0d4bc05235281ab5751e7458fee7d67c64c89acea9b72c3974387496bdb795e","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"707e1cae9fa4b691ce5cb8a3976573158fc60b67cb89948f8f5d51c5908bd0a8","src/changelog.rs":"c272619522f03b856ece92945fc30a42d15600c4fd9a34f2a520fdb7a657868d","src/error.rs":"156c53e299e8f1cd4694b277a5d92772a8a9e7ec4004bae067367f4c2502de8b","src/lib.rs":"dd8856368636b3341fd325407e32b9464a98fd3667458b94e4012afe9a7b42c2","src/os/mod.rs":"6c59ef8c1120953ae6b6c32f27766c643ca90d85075c49c3545d2fe1ed82cedd","src/os/unix/consts.rs":"a1f98372a58acc6d00a1df19550e0593ede60a53f2aa3ff26cf678cf1015594c","src/os/unix/mod.rs":"dff9590acbbb9a02baea9d2eb870515104c9d519b1896887f3bf1434db442929","src/os/windows/mod.rs":"af0d7ae503c89d0a44c5318935635f68da3c3b1786e1033909453f21a207d6ac","src/safe.rs":"b0dc1cb5c8e0216e365063b5e84218b2377bb7a62714fca9a6215a22a7bc58b8","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"0b6dcfb9eafff2d87966460ef6b1b99980f888813037e787ed92deee602f8c2b","tests/constants.rs":"4778c062605ed22238c1bed16de4c076d0857282f090f36e6d985dafb7b4544d","tests/functions.rs":"c3d4770704de40e9592cfd109cf506e6b04f0738d8a1ee02ec858b4fa4632a2b","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/windows.rs":"35584a46658b305cd539712d3ba3c21fe7a130fd693aa1389e4886a67625d532"},"package":"c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"} \ No newline at end of file diff --git a/vendor/libloading/Cargo.toml b/vendor/libloading/Cargo.toml index 65168d585..01654533f 100644 --- a/vendor/libloading/Cargo.toml +++ b/vendor/libloading/Cargo.toml @@ -10,9 +10,9 @@ # See Cargo.toml.orig for the original contents. [package] -rust-version = "1.40.0" +rust-version = "1.48.0" name = "libloading" -version = "0.7.4" +version = "0.8.1" authors = ["Simonas Kazlauskas "] description = "Bindings around the platform's dynamic library loading primitives with greatly improved memory safety." documentation = "https://docs.rs/libloading/" @@ -43,9 +43,10 @@ version = "1.1" [target."cfg(unix)".dependencies.cfg-if] version = "1" -[target."cfg(windows)".dependencies.winapi] -version = "0.3" +[target."cfg(windows)".dependencies.windows-sys] +version = "0.48" features = [ - "errhandlingapi", - "libloaderapi", + "Win32_Foundation", + "Win32_System_Diagnostics_Debug", + "Win32_System_LibraryLoader", ] diff --git a/vendor/libloading/README.mkd b/vendor/libloading/README.mkd index 66abb30b6..7ff55b04b 100644 --- a/vendor/libloading/README.mkd +++ b/vendor/libloading/README.mkd @@ -1,8 +1,11 @@ # libloading -Bindings around the platform's dynamic library loading primitives with greatly improved memory safety. The most important safety guarantee of this library is the prevention of dangling `Symbol`s that may occur after a `Library` is unloaded. +Bindings around the platform's dynamic library loading primitives with greatly improved memory +safety. The most important safety guarantee of this library is the prevention of dangling `Symbol`s +that may occur after a `Library` is unloaded. -Using this library allows the loading of dynamic libraries, also known as shared libraries, as well as the use of the functions and static variables that these libraries may contain. +Using this library allows the loading of dynamic libraries, also known as shared libraries, as well +as the use of the functions and static variables that these libraries may contain. * [Documentation][docs] * [Changelog][changelog] diff --git a/vendor/libloading/src/changelog.rs b/vendor/libloading/src/changelog.rs index 162544f34..536834be1 100644 --- a/vendor/libloading/src/changelog.rs +++ b/vendor/libloading/src/changelog.rs @@ -1,5 +1,23 @@ //! The change log. +/// Release 0.8.1 (2023-09-30) +/// +/// ## Non-breaking changes +/// +/// * Support for GNU Hurd. + +/// Release 0.8.0 (2023-04-11) +/// +/// ## (Potentially) breaking changes +/// +/// * `winapi` dependency has been replaced with `windows-sys`. +/// * As a result the MSRV has been increased to 1.48. +/// +/// ## Non-breaking changes +/// +/// * Support for the QNX Neutrino target has been added. +pub mod r0_8_0 {} + /// Release 0.7.4 (2022-11-07) /// /// This release has no functional changes. diff --git a/vendor/libloading/src/lib.rs b/vendor/libloading/src/lib.rs index 6f0e4cb7f..b517a5c7b 100644 --- a/vendor/libloading/src/lib.rs +++ b/vendor/libloading/src/lib.rs @@ -16,7 +16,7 @@ //! //! ```toml //! [dependencies] -//! libloading = "0.7" +//! libloading = "0.8" //! ``` //! //! # Usage diff --git a/vendor/libloading/src/os/unix/consts.rs b/vendor/libloading/src/os/unix/consts.rs index ea7a6a102..ed3edaf82 100644 --- a/vendor/libloading/src/os/unix/consts.rs +++ b/vendor/libloading/src/os/unix/consts.rs @@ -82,6 +82,8 @@ mod posix { target_os = "fuchsia", target_os = "redox", + target_os = "nto", + target_os = "hurd", ))] { pub(super) const RTLD_LAZY: c_int = 1; } else { @@ -115,6 +117,8 @@ mod posix { target_os = "fuchsia", target_os = "redox", + target_os = "nto", + target_os = "hurd", ))] { pub(super) const RTLD_NOW: c_int = 2; } else if #[cfg(all(target_os = "android",target_pointer_width = "32"))] { @@ -162,6 +166,8 @@ mod posix { target_os = "fuchsia", target_os = "redox", + target_os = "nto", + target_os = "hurd", ))] { pub(super) const RTLD_GLOBAL: c_int = 0x100; } else { @@ -172,7 +178,10 @@ mod posix { } cfg_if! { - if #[cfg(target_os = "netbsd")] { + if #[cfg(any( + target_os = "netbsd", + target_os = "nto", + ))] { pub(super) const RTLD_LOCAL: c_int = 0x200; } else if #[cfg(target_os = "aix")] { pub(super) const RTLD_LOCAL: c_int = 0x80000; @@ -200,6 +209,7 @@ mod posix { target_os = "fuchsia", target_os = "redox", + target_os = "hurd", ))] { pub(super) const RTLD_LOCAL: c_int = 0; } else { diff --git a/vendor/libloading/src/os/windows/mod.rs b/vendor/libloading/src/os/windows/mod.rs index e3da940a2..ff96ef8ef 100644 --- a/vendor/libloading/src/os/windows/mod.rs +++ b/vendor/libloading/src/os/windows/mod.rs @@ -2,38 +2,44 @@ // same rustdoc build visible. #[cfg(all(libloading_docs, not(windows)))] mod windows_imports { - pub(super) enum WORD {} - pub(super) struct DWORD; pub(super) enum HMODULE {} pub(super) enum FARPROC {} + #[allow(non_camel_case_types)] + pub(super) enum THREAD_ERROR_MODE {} + #[allow(non_camel_case_types)] + pub(super) struct LOAD_LIBRARY_FLAGS; pub(super) mod consts { - use super::DWORD; - pub(crate) const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_AS_DATAFILE: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = DWORD; - pub(crate) const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = DWORD; - pub(crate) const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = DWORD; + use super::LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_IGNORE_CODE_AUTHZ_LEVEL: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_AS_IMAGE_RESOURCE: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SEARCH_SYSTEM32: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SEARCH_USER_DIRS: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_WITH_ALTERED_SEARCH_PATH: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; + pub(crate) const LOAD_LIBRARY_SAFE_CURRENT_DIRS: LOAD_LIBRARY_FLAGS = LOAD_LIBRARY_FLAGS; } } #[cfg(any(not(libloading_docs), windows))] mod windows_imports { - extern crate winapi; - pub(super) use self::winapi::shared::minwindef::{WORD, DWORD, HMODULE, FARPROC}; - pub(super) use self::winapi::shared::ntdef::WCHAR; - pub(super) use self::winapi::um::{errhandlingapi, libloaderapi}; + extern crate windows_sys; + pub(super) use self::windows_sys::Win32::Foundation::{GetLastError, FARPROC, HMODULE}; + pub(super) use self::windows_sys::Win32::System::Diagnostics::Debug as debug_api; + pub(super) use self::windows_sys::Win32::System::Diagnostics::Debug::SEM_FAILCRITICALERRORS; + pub(super) use self::windows_sys::Win32::System::Diagnostics::Debug::THREAD_ERROR_MODE; + + pub(super) use self::windows_sys::Win32::System::LibraryLoader as library_loader; + pub(super) use self::windows_sys::Win32::System::LibraryLoader::LOAD_LIBRARY_FLAGS; + pub(super) use std::os::windows::ffi::{OsStrExt, OsStringExt}; - pub(super) const SEM_FAILCE: DWORD = 1; pub(super) mod consts { - pub(crate) use super::winapi::um::libloaderapi::{ + pub(crate) use super::windows_sys::Win32::System::LibraryLoader::{ LOAD_IGNORE_CODE_AUTHZ_LEVEL, LOAD_LIBRARY_AS_DATAFILE, LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE, @@ -116,9 +122,9 @@ impl Library { /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw pub fn this() -> Result { unsafe { - let mut handle: HMODULE = std::ptr::null_mut(); + let mut handle: HMODULE = 0; with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { - let result = libloaderapi::GetModuleHandleExW(0, std::ptr::null_mut(), &mut handle); + let result = library_loader::GetModuleHandleExW(0, std::ptr::null_mut(), &mut handle); if result == 0 { None } else { @@ -149,11 +155,11 @@ impl Library { let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); let ret = unsafe { - let mut handle: HMODULE = std::ptr::null_mut(); + let mut handle: HMODULE = 0; with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { // Make sure no winapi calls as a result of drop happen inside this closure, because // otherwise that might change the return value of the GetLastError. - let result = libloaderapi::GetModuleHandleExW(0, wide_filename.as_ptr(), &mut handle); + let result = library_loader::GetModuleHandleExW(0, wide_filename.as_ptr(), &mut handle); if result == 0 { None } else { @@ -186,16 +192,15 @@ impl Library { /// Additionally, the callers of this function must also ensure that execution of the /// termination routines contained within the library is safe as well. These routines may be /// executed when the library is unloaded. - pub unsafe fn load_with_flags>(filename: P, flags: DWORD) -> Result { + pub unsafe fn load_with_flags>(filename: P, flags: LOAD_LIBRARY_FLAGS) -> Result { let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); let _guard = ErrorModeGuard::new(); let ret = with_get_last_error(|source| crate::Error::LoadLibraryExW { source }, || { // Make sure no winapi calls as a result of drop happen inside this closure, because // otherwise that might change the return value of the GetLastError. - let handle = - libloaderapi::LoadLibraryExW(wide_filename.as_ptr(), std::ptr::null_mut(), flags); - if handle.is_null() { + let handle = library_loader::LoadLibraryExW(wide_filename.as_ptr(), 0, flags); + if handle == 0 { None } else { Some(Library(handle)) @@ -221,8 +226,8 @@ impl Library { ensure_compatible_types::()?; let symbol = cstr_cow_from_bytes(symbol)?; with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { - let symbol = libloaderapi::GetProcAddress(self.0, symbol.as_ptr()); - if symbol.is_null() { + let symbol = library_loader::GetProcAddress(self.0, symbol.as_ptr().cast()); + if symbol.is_none() { None } else { Some(Symbol { @@ -238,12 +243,12 @@ impl Library { /// # Safety /// /// Users of this API must specify the correct type of the function or variable loaded. - pub unsafe fn get_ordinal(&self, ordinal: WORD) -> Result, crate::Error> { + pub unsafe fn get_ordinal(&self, ordinal: u16) -> Result, crate::Error> { ensure_compatible_types::()?; with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { - let ordinal = ordinal as usize as *mut _; - let symbol = libloaderapi::GetProcAddress(self.0, ordinal); - if symbol.is_null() { + let ordinal = ordinal as usize as *const _; + let symbol = library_loader::GetProcAddress(self.0, ordinal); + if symbol.is_none() { None } else { Some(Symbol { @@ -280,7 +285,7 @@ impl Library { /// The underlying data structures may still get leaked if an error does occur. pub fn close(self) -> Result<(), crate::Error> { let result = with_get_last_error(|source| crate::Error::FreeLibrary { source }, || { - if unsafe { libloaderapi::FreeLibrary(self.0) == 0 } { + if unsafe { library_loader::FreeLibrary(self.0) == 0 } { None } else { Some(()) @@ -296,7 +301,7 @@ impl Library { impl Drop for Library { fn drop(&mut self) { - unsafe { libloaderapi::FreeLibrary(self.0); } + unsafe { library_loader::FreeLibrary(self.0); } } } @@ -305,17 +310,17 @@ impl fmt::Debug for Library { unsafe { // FIXME: use Maybeuninit::uninit_array when stable let mut buf = - mem::MaybeUninit::<[mem::MaybeUninit::; 1024]>::uninit().assume_init(); - let len = libloaderapi::GetModuleFileNameW(self.0, + mem::MaybeUninit::<[mem::MaybeUninit; 1024]>::uninit().assume_init(); + let len = library_loader::GetModuleFileNameW(self.0, buf[..].as_mut_ptr().cast(), 1024) as usize; if len == 0 { - f.write_str(&format!("Library@{:p}", self.0)) + f.write_str(&format!("Library@{:#x}", self.0)) } else { let string: OsString = OsString::from_wide( // FIXME: use Maybeuninit::slice_get_ref when stable - &*(&buf[..len] as *const [_] as *const [WCHAR]) + &*(&buf[..len] as *const [_] as *const [u16]), ); - f.write_str(&format!("Library@{:p} from {:?}", self.0, string)) + f.write_str(&format!("Library@{:#x} from {:?}", self.0, string)) } } } @@ -340,7 +345,7 @@ impl Symbol { impl Symbol> { /// Lift Option out of the symbol. pub fn lift_option(self) -> Option> { - if self.pointer.is_null() { + if self.pointer.is_none() { None } else { Some(Symbol { @@ -363,33 +368,33 @@ impl Clone for Symbol { impl ::std::ops::Deref for Symbol { type Target = T; fn deref(&self) -> &T { - unsafe { - // Additional reference level for a dereference on `deref` return value. - &*(&self.pointer as *const *mut _ as *const T) - } + unsafe { &*((&self.pointer) as *const FARPROC as *const T) } } } impl fmt::Debug for Symbol { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str(&format!("Symbol@{:p}", self.pointer)) + match self.pointer { + None => f.write_str("Symbol@0x0"), + Some(ptr) => f.write_str(&format!("Symbol@{:p}", ptr as *const ())), + } } } -struct ErrorModeGuard(DWORD); +struct ErrorModeGuard(THREAD_ERROR_MODE); impl ErrorModeGuard { #[allow(clippy::if_same_then_else)] fn new() -> Option { unsafe { let mut previous_mode = 0; - if errhandlingapi::SetThreadErrorMode(SEM_FAILCE, &mut previous_mode) == 0 { + if debug_api::SetThreadErrorMode(SEM_FAILCRITICALERRORS, &mut previous_mode) == 0 { // How in the world is it possible for what is essentially a simple variable swap // to fail? For now we just ignore the error -- the worst that can happen here is // the previous mode staying on and user seeing a dialog error on older Windows // machines. None - } else if previous_mode == SEM_FAILCE { + } else if previous_mode == SEM_FAILCRITICALERRORS { None } else { Some(ErrorModeGuard(previous_mode)) @@ -401,7 +406,7 @@ impl ErrorModeGuard { impl Drop for ErrorModeGuard { fn drop(&mut self) { unsafe { - errhandlingapi::SetThreadErrorMode(self.0, ptr::null_mut()); + debug_api::SetThreadErrorMode(self.0, ptr::null_mut()); } } } @@ -410,7 +415,7 @@ fn with_get_last_error(wrap: fn(crate::error::WindowsError) -> crate::Erro -> Result> where F: FnOnce() -> Option { closure().ok_or_else(|| { - let error = unsafe { errhandlingapi::GetLastError() }; + let error = unsafe { GetLastError() }; if error == 0 { None } else { @@ -425,7 +430,7 @@ where F: FnOnce() -> Option { /// recommended for use in setup programs that must run extracted DLLs during installation. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = consts::LOAD_IGNORE_CODE_AUTHZ_LEVEL; +pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: LOAD_LIBRARY_FLAGS = consts::LOAD_IGNORE_CODE_AUTHZ_LEVEL; /// Map the file into the calling process’ virtual address space as if it were a data file. /// @@ -435,7 +440,7 @@ pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = consts::LOAD_IGNORE_CODE_AUTHZ_L /// messages or resources from it. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_AS_DATAFILE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE; +pub const LOAD_LIBRARY_AS_DATAFILE: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_AS_DATAFILE; /// Map the file into the calling process’ virtual address space as if it were a data file. /// @@ -444,7 +449,7 @@ pub const LOAD_LIBRARY_AS_DATAFILE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE; /// while it is in use. However, the DLL can still be opened by other processes. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE; +pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE; /// Map the file into the process’ virtual address space as an image file. /// @@ -456,7 +461,7 @@ pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = consts::LOAD_LIBRARY_AS_DA /// [`LOAD_LIBRARY_AS_DATAFILE`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = consts::LOAD_LIBRARY_AS_IMAGE_RESOURCE; +pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_AS_IMAGE_RESOURCE; /// Search the application's installation directory for the DLL and its dependencies. /// @@ -464,7 +469,7 @@ pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = consts::LOAD_LIBRARY_AS_IMAGE_ /// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_APPLICATION_DIR; +pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SEARCH_APPLICATION_DIR; /// Search default directories when looking for the DLL and its dependencies. /// @@ -474,7 +479,7 @@ pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = consts::LOAD_LIBRARY_SEAR /// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS; +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS; /// Directory that contains the DLL is temporarily added to the beginning of the list of /// directories that are searched for the DLL’s dependencies. @@ -485,7 +490,7 @@ pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_ /// with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR; +pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR; /// Search `%windows%\system32` for the DLL and its dependencies. /// @@ -493,7 +498,7 @@ pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_ /// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = consts::LOAD_LIBRARY_SEARCH_SYSTEM32; +pub const LOAD_LIBRARY_SEARCH_SYSTEM32: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SEARCH_SYSTEM32; /// Directories added using the `AddDllDirectory` or the `SetDllDirectory` function are searched /// for the DLL and its dependencies. @@ -503,7 +508,7 @@ pub const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = consts::LOAD_LIBRARY_SEARCH_SYST /// combined with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_USER_DIRS; +pub const LOAD_LIBRARY_SEARCH_USER_DIRS: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SEARCH_USER_DIRS; /// If `filename` specifies an absolute path, the system uses the alternate file search strategy /// discussed in the [Remarks section] to find associated executable modules that the specified @@ -518,15 +523,15 @@ pub const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_USE /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). /// /// [Remarks]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#remarks -pub const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = consts::LOAD_WITH_ALTERED_SEARCH_PATH; +pub const LOAD_WITH_ALTERED_SEARCH_PATH: LOAD_LIBRARY_FLAGS = consts::LOAD_WITH_ALTERED_SEARCH_PATH; /// Specifies that the digital signature of the binary image must be checked at load time. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = consts::LOAD_LIBRARY_REQUIRE_SIGNED_TARGET; +pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_REQUIRE_SIGNED_TARGET; /// Allow loading a DLL for execution from the current directory only if it is under a directory in /// the Safe load list. /// /// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). -pub const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = consts::LOAD_LIBRARY_SAFE_CURRENT_DIRS; +pub const LOAD_LIBRARY_SAFE_CURRENT_DIRS: LOAD_LIBRARY_FLAGS = consts::LOAD_LIBRARY_SAFE_CURRENT_DIRS; diff --git a/vendor/libloading/tests/functions.rs b/vendor/libloading/tests/functions.rs index c8d1952b3..a0175a674 100644 --- a/vendor/libloading/tests/functions.rs +++ b/vendor/libloading/tests/functions.rs @@ -1,5 +1,5 @@ #[cfg(windows)] -extern crate winapi; +extern crate windows_sys; extern crate libloading; use libloading::{Library, Symbol}; @@ -237,14 +237,13 @@ fn library_this() { #[test] fn works_getlasterror() { use libloading::os::windows::{Library, Symbol}; - use winapi::shared::minwindef::DWORD; - use winapi::um::errhandlingapi; + use windows_sys::Win32::Foundation::{GetLastError, SetLastError}; unsafe { let lib = Library::new("kernel32.dll").unwrap(); - let gle: Symbol DWORD> = lib.get(b"GetLastError").unwrap(); - errhandlingapi::SetLastError(42); - assert_eq!(errhandlingapi::GetLastError(), gle()) + let gle: Symbol u32> = lib.get(b"GetLastError").unwrap(); + SetLastError(42); + assert_eq!(GetLastError(), gle()) } } @@ -252,14 +251,13 @@ fn works_getlasterror() { #[test] fn works_getlasterror0() { use libloading::os::windows::{Library, Symbol}; - use winapi::shared::minwindef::DWORD; - use winapi::um::errhandlingapi; + use windows_sys::Win32::Foundation::{GetLastError, SetLastError}; unsafe { let lib = Library::new("kernel32.dll").unwrap(); - let gle: Symbol DWORD> = lib.get(b"GetLastError\0").unwrap(); - errhandlingapi::SetLastError(42); - assert_eq!(errhandlingapi::GetLastError(), gle()) + let gle: Symbol u32> = lib.get(b"GetLastError\0").unwrap(); + SetLastError(42); + assert_eq!(GetLastError(), gle()) } } diff --git a/vendor/linux-raw-sys/.cargo-checksum.json b/vendor/linux-raw-sys/.cargo-checksum.json index 8c2f5a01c..9dab29952 100644 --- a/vendor/linux-raw-sys/.cargo-checksum.json +++ b/vendor/linux-raw-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CODE_OF_CONDUCT.md":"ccd9e538ce44713a2486cc8e4c01b8c8b846d1ccff15de728d8d6fa9a7f846cd","COPYRIGHT":"3290ae0fbc9ddb77d2239121d710f0bb9d31b3b4744e6d97fe01e652b4c1870b","Cargo.toml":"1e8d669d6fb3a81410b8370be07d7e4b7a968270cb11d6cada24fb6ec5e7d867","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"3d4ae2ec9429adfd329b4506f7ca6faa84dca30d1c3b416f8f4e6f57bdb3aa96","src/aarch64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/aarch64/general.rs":"0cc1ed00b1ef7efb16a7109138acdf679d591325458938cee150b221af063822","src/aarch64/if_ether.rs":"f558bfec1f5e80235db79f507e4afd3120647a5caddf17a87b7ad5540e5c1462","src/aarch64/io_uring.rs":"9ce4c9005b5b99e041b9d58be6866367605e4bee1e30a7096235cb234ed73e1b","src/aarch64/ioctl.rs":"4ec2865dd9d66287b741ed5d68ffbbd9ef65b4010abb4f9ff7e7024e1a202dfc","src/aarch64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/aarch64/net.rs":"53279ed39ebe891b02824ccb380083f8fa1c6cd92b03195d1c680e1bcfcab0a1","src/aarch64/netlink.rs":"f6642310b8bd37b5775ba1a52cfe638beddd7c880f8dfacab62c3180255fb75f","src/aarch64/prctl.rs":"a80e2f89aa978210d980538e1d9c5b922bb073d118ee51b1f14c1f397c7cd576","src/aarch64/system.rs":"851a95c0d1b76782970a28c373a313954eea0db35f6ebce562e6047095f587c4","src/aarch64/xdp.rs":"8602704977fdf3c9721c88866dfb77ec31b949f7b44d287c41fb6616a08fbaaf","src/arm/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/arm/general.rs":"bdbb40ba5630044c9555fe38a3640638f3ff7f437d94f82428e2bedad32e180f","src/arm/if_ether.rs":"3873beb1f57bdcc52da345608c5deda5937d7b92b114b414ce6161784173b925","src/arm/io_uring.rs":"5e2e254d5853ed30568e17fab184f8cc458607465d19dcee6c87ca1b565d6d2d","src/arm/ioctl.rs":"3f470208ae7e26b356a182a8396b8e4e7522e52d280a0b220c0b79b90ec8fb75","src/arm/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/arm/net.rs":"0b2addcd77882d71155bbe6e501ab2927ddca878effb4e8a6d4bce4d02ee6fef","src/arm/netlink.rs":"2f98b8c0349c2d3d538164e4d06c28fa1fb9308f7691aa097526ce2fb3ac176f","src/arm/prctl.rs":"5477c74fec958d9f9d2028f58e95657840ead28445956e53fe0894e45922f8a5","src/arm/system.rs":"9aca94a4a553e09e6d2d43741fb8c120c05a193822e850951dc469bbd89cc703","src/arm/xdp.rs":"a4ae33a218d9967b56b3c70d3c1c1180df49379b05044e3a5c7534b542b4a529","src/csky/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/csky/general.rs":"94aba82d2a76a9ca272b4766f8d2f5f14e10bc2166e03d695a5b8b5d207e6755","src/csky/if_ether.rs":"aac7a069000195b9b18c6d25b2d7c338efb1062347a84e31cda7c93de374b3c6","src/csky/io_uring.rs":"bb7541d82f627cb681ea11f4e5c4162b0d0616ca08fcc6d31bcf22ef813f754d","src/csky/ioctl.rs":"77f30e67f9a4748bc31184454a0ff45fd821c3536cd98dc2411def8eeb59a268","src/csky/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/csky/net.rs":"508650776f6a282e9a1d5109e08ff0d1678d86d1068fe43a9870f37787755166","src/csky/netlink.rs":"9fc99e88df0efc15d39b397c9d653c32b4729e31a2434e730435fbdfcb362da4","src/csky/prctl.rs":"8df2f33387d5b4865d9417f796cc4d43b3cf549cfa41d7ce7d41dd367ed8b6c9","src/csky/system.rs":"a2913685b359e60bbfae413b89a6fd37ea38fa448f980ffadef42d227b33ada5","src/csky/xdp.rs":"2138939b87c7c75d2b3ee499507142e2a5abeecd40783c297dd3c555285b3a54","src/elf.rs":"441bcf378b5603f957e053369d18d95c1efe981665846c220bca82123c04843a","src/lib.rs":"d8720fb7b7a66834a75677a708ddeeff10340e178330188ed95145e68e2a028d","src/loongarch64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/loongarch64/general.rs":"fadd5884c6ad645300540dd30150984857819a986772fca4eba1e1fc0c3f4f1e","src/loongarch64/if_ether.rs":"a7b0918afc9dbf8e79490f83a809e4bd563af20ab2b3432d58b763ff31418daf","src/loongarch64/io_uring.rs":"ef851913c86bc2d629048e781edc76b59c63e659f8bd4bcd7fa7ff982186ed6d","src/loongarch64/ioctl.rs":"6f631e0ac37f2c2398168683a1523d1559b85369ffe4cdcc284ffe7455672c18","src/loongarch64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/loongarch64/net.rs":"af6d52d44def3ebdb01e047c588f353a9a3e6d20c6c57be5a846270a4505235b","src/loongarch64/netlink.rs":"789357343b94276e6f8fc8f3a32f06f3d3efd464c7850b2568dc609a49d1f305","src/loongarch64/prctl.rs":"624e4d3b8f3b4f1d6dcb1540c124ed03ce47f0580aa3425c0baed431dcd267ea","src/loongarch64/system.rs":"4cfcd4c28481b9ff5fc0330d5c713d637d3615c0184830d3a4391882eaed68f5","src/loongarch64/xdp.rs":"2270c2b3cce1cf55922ed685c6cb7197a3932d756763f7528ab36c034609d856","src/mips/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips/general.rs":"1c16f4e0a015eaf27e9a30f4b74ec824220798f47c535d3aaf322ad799c054ab","src/mips/if_ether.rs":"1ecdc654cb3eda633bb7192829b1001a0a5ae5a126110b4208bbee5b41f87f5e","src/mips/io_uring.rs":"c69479bb1f862febe78e0989745c202146aaef7e8ceaa0d7bf291af584748992","src/mips/ioctl.rs":"8d4bcd3cd6aa7e87267430bc7b102df012bafa8b0ea4b24a3cfa490447431ef9","src/mips/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips/net.rs":"553750bad3660aff2efb5b2a828860792d76eddf7cb4913d3be98b34901f6a83","src/mips/netlink.rs":"5045dece259abaa5b5974500a20a9325e4cd6eb87c344dd7448056dff469994f","src/mips/prctl.rs":"cd59615adf6f561ef6c542df59cf25f75877693ca1c4c489f5e460eb7e798d4d","src/mips/system.rs":"acbc69a1fe7299860f8bd142bc2ff5595a410e1528994139062fc680d1a87e71","src/mips/xdp.rs":"0dc8bed8c75615fc119bf4cc4231ce22639515b1165911dc0b7f6d5a07dbcd44","src/mips32r6/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips32r6/general.rs":"1c16f4e0a015eaf27e9a30f4b74ec824220798f47c535d3aaf322ad799c054ab","src/mips32r6/if_ether.rs":"1ecdc654cb3eda633bb7192829b1001a0a5ae5a126110b4208bbee5b41f87f5e","src/mips32r6/io_uring.rs":"c69479bb1f862febe78e0989745c202146aaef7e8ceaa0d7bf291af584748992","src/mips32r6/ioctl.rs":"8d4bcd3cd6aa7e87267430bc7b102df012bafa8b0ea4b24a3cfa490447431ef9","src/mips32r6/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips32r6/net.rs":"553750bad3660aff2efb5b2a828860792d76eddf7cb4913d3be98b34901f6a83","src/mips32r6/netlink.rs":"5045dece259abaa5b5974500a20a9325e4cd6eb87c344dd7448056dff469994f","src/mips32r6/prctl.rs":"cd59615adf6f561ef6c542df59cf25f75877693ca1c4c489f5e460eb7e798d4d","src/mips32r6/system.rs":"acbc69a1fe7299860f8bd142bc2ff5595a410e1528994139062fc680d1a87e71","src/mips32r6/xdp.rs":"0dc8bed8c75615fc119bf4cc4231ce22639515b1165911dc0b7f6d5a07dbcd44","src/mips64/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips64/general.rs":"700b52614c604ce58aa8a5bb1ebd46221c0106ec2d8d6600d681d1594a89118a","src/mips64/if_ether.rs":"6d24518acba5bc8fa2a775d039ed9594de8349d6028621134626ccaa8ea18bcd","src/mips64/io_uring.rs":"18bd5d96c53aff44f4a37a71f16fa12c11b7c934b395bf841e47d98283146a50","src/mips64/ioctl.rs":"f0059994ece12ced8e4040aa68ccd58850119b5746d87000f8f538af8bd6359c","src/mips64/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips64/net.rs":"a5bd6d654ea16c02f6f85b969bfc2177a88603d38a9a52f09685ca4114f6e199","src/mips64/netlink.rs":"18f139573337be18fb9bd56de4d0bd8af5c80828cdf68ef68751c18dcb39c761","src/mips64/prctl.rs":"a8d9ae240ce582d7b66e13937b99df73c7247ce9f69bfdd12109903d7c6dfb0e","src/mips64/system.rs":"95805c533a8eb8f53c28f138e6a2d12064681cc9db55d3042ee748c655a5d7cd","src/mips64/xdp.rs":"19fdf2b824b95184dabd5c8960d9482788ab8ef027e23acaae9e7992be8eb4e4","src/mips64r6/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips64r6/general.rs":"700b52614c604ce58aa8a5bb1ebd46221c0106ec2d8d6600d681d1594a89118a","src/mips64r6/if_ether.rs":"6d24518acba5bc8fa2a775d039ed9594de8349d6028621134626ccaa8ea18bcd","src/mips64r6/io_uring.rs":"18bd5d96c53aff44f4a37a71f16fa12c11b7c934b395bf841e47d98283146a50","src/mips64r6/ioctl.rs":"f0059994ece12ced8e4040aa68ccd58850119b5746d87000f8f538af8bd6359c","src/mips64r6/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips64r6/net.rs":"a5bd6d654ea16c02f6f85b969bfc2177a88603d38a9a52f09685ca4114f6e199","src/mips64r6/netlink.rs":"18f139573337be18fb9bd56de4d0bd8af5c80828cdf68ef68751c18dcb39c761","src/mips64r6/prctl.rs":"a8d9ae240ce582d7b66e13937b99df73c7247ce9f69bfdd12109903d7c6dfb0e","src/mips64r6/system.rs":"95805c533a8eb8f53c28f138e6a2d12064681cc9db55d3042ee748c655a5d7cd","src/mips64r6/xdp.rs":"19fdf2b824b95184dabd5c8960d9482788ab8ef027e23acaae9e7992be8eb4e4","src/powerpc/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/powerpc/general.rs":"7940ad742585d501f4742af51c6310ecf651863a8aaa0305193e9c8ee07aca90","src/powerpc/if_ether.rs":"56ab5fbf8c9d0dd0654412fabdca6759cbb421a876e5cebe2fec10e25728b55c","src/powerpc/io_uring.rs":"38ead79180c96e8af69929dacbc36e8cfbccec96875c61f094e531e6860639db","src/powerpc/ioctl.rs":"1fabc6c3481d6710b343aa27bf9331e81d16c3cdf86eb76eac61b19839d9b2f4","src/powerpc/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/powerpc/net.rs":"d1c6c36e71354ef35f64ae1195eff75c73f0a4b90fa8a4070cab9e79b81f8b78","src/powerpc/netlink.rs":"4f10870fbd23de17efd4cba6d5a40ba85564effc5d0b71f9d7f928a42cb77b20","src/powerpc/prctl.rs":"f236987bc8ae993ab2b0e88b2eacbae51eee4da170ac075552070a76c717d803","src/powerpc/system.rs":"3e01e5e145adb87263f04c9e053faac0c0758689fd32917d2c7c2eec1d89f9e6","src/powerpc/xdp.rs":"9f04a2ef343109f1bb5ac5bc7ef66cb3c1c966744653a70a79b91f04b9609d07","src/powerpc64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/powerpc64/general.rs":"7862eb3dfac845331b624b3322bdeb3441bb86e914719e125dd5dc7b3860db43","src/powerpc64/if_ether.rs":"15e12d56b1367cb5c9d8fd1b9995acf1429a923bf603698bd732efe1acc30cd6","src/powerpc64/io_uring.rs":"50018e504d78c584beaec3b1a6d477d30d566d25cb1a40b0a2adfb23d726674f","src/powerpc64/ioctl.rs":"1fabc6c3481d6710b343aa27bf9331e81d16c3cdf86eb76eac61b19839d9b2f4","src/powerpc64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/powerpc64/net.rs":"706e58efa77918ac96f20fa33afd5f498e2e118507084c1ae9db93483103ab32","src/powerpc64/netlink.rs":"352a06995f7de6e4fc1c2ff54c1eccb93a3d833a923e834ec75c6a4d30ea5051","src/powerpc64/prctl.rs":"1fcccc5b6dac472a30b7701b5c9e436c238410077cfe158d600b51d55bcc074a","src/powerpc64/system.rs":"500116b7613a504ebad028cec1ba37323310e29864d885ae62191ccb1f86d333","src/powerpc64/xdp.rs":"baad88c60c08fc79dc3c223c0e8d9adef4462728b6e46e5143ce10f6ce5e32bd","src/riscv32/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/riscv32/general.rs":"16ffe747a8f75ac6594dc7afddef4fbb89735da50af9f19f152fd2f04b509463","src/riscv32/if_ether.rs":"aac7a069000195b9b18c6d25b2d7c338efb1062347a84e31cda7c93de374b3c6","src/riscv32/io_uring.rs":"5c67dde8fdb3641407d4ebd744171606b82596176343fe6766afd3220eda2ab1","src/riscv32/ioctl.rs":"6f631e0ac37f2c2398168683a1523d1559b85369ffe4cdcc284ffe7455672c18","src/riscv32/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/riscv32/net.rs":"508650776f6a282e9a1d5109e08ff0d1678d86d1068fe43a9870f37787755166","src/riscv32/netlink.rs":"9fc99e88df0efc15d39b397c9d653c32b4729e31a2434e730435fbdfcb362da4","src/riscv32/prctl.rs":"8df2f33387d5b4865d9417f796cc4d43b3cf549cfa41d7ce7d41dd367ed8b6c9","src/riscv32/system.rs":"a2913685b359e60bbfae413b89a6fd37ea38fa448f980ffadef42d227b33ada5","src/riscv32/xdp.rs":"2138939b87c7c75d2b3ee499507142e2a5abeecd40783c297dd3c555285b3a54","src/riscv64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/riscv64/general.rs":"8ec4907ac81b62e21451731a468e5f4fe7a37a46d80c56b33e0969d2d059d442","src/riscv64/if_ether.rs":"a7b0918afc9dbf8e79490f83a809e4bd563af20ab2b3432d58b763ff31418daf","src/riscv64/io_uring.rs":"ef851913c86bc2d629048e781edc76b59c63e659f8bd4bcd7fa7ff982186ed6d","src/riscv64/ioctl.rs":"9c4645f03ac8bdfba148aed2d123688c3638e8b742aa69e03f9f886e4dc0132c","src/riscv64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/riscv64/net.rs":"af6d52d44def3ebdb01e047c588f353a9a3e6d20c6c57be5a846270a4505235b","src/riscv64/netlink.rs":"789357343b94276e6f8fc8f3a32f06f3d3efd464c7850b2568dc609a49d1f305","src/riscv64/prctl.rs":"624e4d3b8f3b4f1d6dcb1540c124ed03ce47f0580aa3425c0baed431dcd267ea","src/riscv64/system.rs":"4cfcd4c28481b9ff5fc0330d5c713d637d3615c0184830d3a4391882eaed68f5","src/riscv64/xdp.rs":"2270c2b3cce1cf55922ed685c6cb7197a3932d756763f7528ab36c034609d856","src/s390x/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/s390x/general.rs":"687f6e3d4502d31aaec08a41335b6a368f0949049875d939065a66df86e06b8a","src/s390x/if_ether.rs":"2a6b2132be1aebe126eb64ea230a82c2ab18433ece37226c9dacd81392ad6ca2","src/s390x/io_uring.rs":"57790b4ce46a4a2a87a329ff935033dfb430117bcc2154fa066c5d681f115319","src/s390x/ioctl.rs":"0aa7214e5a0fe1159a13afb0fa185505e5bcebb7bc8ba8abd7b210bc8c63c47a","src/s390x/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/s390x/net.rs":"792ef0d83c1e7640e5c6e15a96d3bc9d90f4fc96740f076792ce203c31db9a09","src/s390x/netlink.rs":"c3c11102a55d15dfb534d748c8bc8ece58c9d56170b6afe07d1f2cc783fd6372","src/s390x/prctl.rs":"6fe9f5349f9a694b391f309f208235c1d4669430d3f051ef64467576e91df7a1","src/s390x/system.rs":"f68e8afbd02bc87a8fec2cae4e367f296873f2c1a651032da4ccc4f1c0ed4670","src/s390x/xdp.rs":"fc298028f317486df5e28595c3a5ee0802b7b4dc1e113231332982ae8226b8cb","src/sparc/errno.rs":"b3c5e1a6c8378d613c6ef3dd44e2199ea7455da65e83d6bb19582a79de880f80","src/sparc/general.rs":"a38a371e8ceeecc4384999b4cc8ee6d65a35a20542c96c62e04c24b2b2953858","src/sparc/if_ether.rs":"c574c6d1ea11a8bb213b18928fe2d342c897d8ff04458991a5192eb401fbbc57","src/sparc/io_uring.rs":"d813aabc93f383c8522773ed431209627d810c78bcdb4dae931a702aae55e09f","src/sparc/ioctl.rs":"b2a4c7d649b18a4d2a1142400de687d48c195dcf8a86b58ac261413c33809d7b","src/sparc/mempolicy.rs":"4b03f870283b21150e322f00d8bab5088189b0a1189a6a8dc6b93da7d647f629","src/sparc/net.rs":"9c2f69c2d2bb193f5ff1b5f54d1f992555157d7d2af8d4cdee32a45c12ff4ee6","src/sparc/netlink.rs":"0f176c24de7b2b19ac16dd95625947b8047d48bc7b871e12a3acd31f8e97c6f5","src/sparc/prctl.rs":"5f5686fe04d8cc5e746d789340331095044f244c123ecf1468dcb089bbb931cd","src/sparc/system.rs":"6f1f8ce9978693845621880031ac4805f00027315a691cfe1d466703c7a96e8d","src/sparc/xdp.rs":"f62496e93ea3230b914d3c7263957f9377c0b9c87cfc6e85e9779433d1a4747a","src/sparc64/errno.rs":"b3c5e1a6c8378d613c6ef3dd44e2199ea7455da65e83d6bb19582a79de880f80","src/sparc64/general.rs":"d4138f0e663833811365fdc2e1008525df0f21044b5e31ab80d97d63fcb9f45f","src/sparc64/if_ether.rs":"e51661cb54922c3c01853617a61b3d141768adf5b94162c4aefb326d31ef55f5","src/sparc64/io_uring.rs":"688f4678c259eb940aa0216c0183843d436b918d214e13bed56a38ddb55132db","src/sparc64/ioctl.rs":"b2a4c7d649b18a4d2a1142400de687d48c195dcf8a86b58ac261413c33809d7b","src/sparc64/mempolicy.rs":"4b03f870283b21150e322f00d8bab5088189b0a1189a6a8dc6b93da7d647f629","src/sparc64/net.rs":"629b4860c128d4ebb2249f43fd733dea87ca65d3ded5ea8123b43d08a73ba080","src/sparc64/netlink.rs":"7cec2a77af7ec17cad96d63027fd4a9164f0e6503f2e6cc2a99e79aa1bba3147","src/sparc64/prctl.rs":"ff897312b99274ce4eefecccc9797e34accc69efce1299712ab631e9542cb8ca","src/sparc64/system.rs":"becb2e706ed6df77860a2a3884b28181dca606db22fcd604a8a1803f937e8baf","src/sparc64/xdp.rs":"5e1ea3534a0a81f56ea35ea38eddc3bab420bab57d5b34b3f6fafffd43c51a47","src/x32/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x32/general.rs":"c2aeaf3096d559a86d3f72e0ec4a91245edfce35e85c51b50d13e115ec357974","src/x32/if_ether.rs":"859047581be4a3ae923b88516e86230a4f9a447a5203285dd8bcc539038c5c4f","src/x32/io_uring.rs":"40834d29cf819e43a23f9a2e075e2ea0c001be817f7200aa059c24eae6d29123","src/x32/ioctl.rs":"f2b8a984878ecc004089ef138b00d78ab7747cce45d3bb9b60b46e35f49f3ec7","src/x32/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x32/net.rs":"e6f5f56160ead3ce9d39be3477a4bfb33a1adbc5fba53575304336a6ff1b5370","src/x32/netlink.rs":"f74042f6cf0eabccfa6b8008a89ee7ab347fb7eaa89499757a786b13b2403982","src/x32/prctl.rs":"2d1eb6873dc5b72a8252f12e695d98a045e01026f730302a6515f53a394bba7c","src/x32/system.rs":"69c125aea6b21f2c4981f3386602283a691524671fef1da7d67de3b67fffdc42","src/x32/xdp.rs":"955fb2683206fce1e5c763060c8a5b1f930ad82d127f330f72e91bba56adbc8b","src/x86/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x86/general.rs":"a9b002ea136dabb9fd1c489c999cd1bfeca62490202aab095221fc70c2b6e30e","src/x86/if_ether.rs":"3873beb1f57bdcc52da345608c5deda5937d7b92b114b414ce6161784173b925","src/x86/io_uring.rs":"3f60400dfc11a5eafa5a54466f7f9ca74a63219feda2278c388529bf40c0a6a3","src/x86/ioctl.rs":"11e753119d8491145a6b2af6fff2041ba3c49d61f7ee130d9737c4b3e40ee41d","src/x86/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x86/net.rs":"0b2addcd77882d71155bbe6e501ab2927ddca878effb4e8a6d4bce4d02ee6fef","src/x86/netlink.rs":"2f98b8c0349c2d3d538164e4d06c28fa1fb9308f7691aa097526ce2fb3ac176f","src/x86/prctl.rs":"5477c74fec958d9f9d2028f58e95657840ead28445956e53fe0894e45922f8a5","src/x86/system.rs":"9aca94a4a553e09e6d2d43741fb8c120c05a193822e850951dc469bbd89cc703","src/x86/xdp.rs":"a4ae33a218d9967b56b3c70d3c1c1180df49379b05044e3a5c7534b542b4a529","src/x86_64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x86_64/general.rs":"f0c763abb8d7e7bd594c674d2774b272844829ecee4e3ed42932004616a2380e","src/x86_64/if_ether.rs":"feb5362d90fbd5113b6f1f22fcc77a7b3bb7c8f5081be7eacb2e270d2f24a293","src/x86_64/io_uring.rs":"6c008c59b6905b7872b788e30d546efa3b5bb03a0fe17e33b90bfc8beec23f29","src/x86_64/ioctl.rs":"f2b8a984878ecc004089ef138b00d78ab7747cce45d3bb9b60b46e35f49f3ec7","src/x86_64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x86_64/net.rs":"65f921d16a2380b95496db75169b0ef97048e3226a295740cc1e237f817deb9b","src/x86_64/netlink.rs":"d47b8b117007b1c29db325dad68ed1b92562b98f90916b1b192f57a935a98038","src/x86_64/prctl.rs":"6d0f63fff8d76cc2f4678f38e40a68d072d7da4094d5217ce92872370bb4df9b","src/x86_64/system.rs":"6a415f104e7dd34829b36c19ad89e0cfcfbc69a846c87f81e202411386d46966","src/x86_64/xdp.rs":"20776ba35015ad659b5bb8fb47a7d10fc1aee5530ffe650f2f4e10ec653d7857"},"package":"c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"} \ No newline at end of file +{"files":{"CODE_OF_CONDUCT.md":"ccd9e538ce44713a2486cc8e4c01b8c8b846d1ccff15de728d8d6fa9a7f846cd","COPYRIGHT":"3290ae0fbc9ddb77d2239121d710f0bb9d31b3b4744e6d97fe01e652b4c1870b","Cargo.toml":"79db455f0f60a19369addc51b65e686d1f9ec0d2fac3017f50a8a1f1668342f5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"3d4ae2ec9429adfd329b4506f7ca6faa84dca30d1c3b416f8f4e6f57bdb3aa96","src/aarch64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/aarch64/general.rs":"0cc1ed00b1ef7efb16a7109138acdf679d591325458938cee150b221af063822","src/aarch64/if_ether.rs":"f558bfec1f5e80235db79f507e4afd3120647a5caddf17a87b7ad5540e5c1462","src/aarch64/if_packet.rs":"78c1154790a6a8bbe14b0ff08465fa2e090cbf5f6528b5526053b5d8ff568133","src/aarch64/io_uring.rs":"9ce4c9005b5b99e041b9d58be6866367605e4bee1e30a7096235cb234ed73e1b","src/aarch64/ioctl.rs":"4ec2865dd9d66287b741ed5d68ffbbd9ef65b4010abb4f9ff7e7024e1a202dfc","src/aarch64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/aarch64/net.rs":"53279ed39ebe891b02824ccb380083f8fa1c6cd92b03195d1c680e1bcfcab0a1","src/aarch64/netlink.rs":"f6642310b8bd37b5775ba1a52cfe638beddd7c880f8dfacab62c3180255fb75f","src/aarch64/prctl.rs":"a80e2f89aa978210d980538e1d9c5b922bb073d118ee51b1f14c1f397c7cd576","src/aarch64/system.rs":"851a95c0d1b76782970a28c373a313954eea0db35f6ebce562e6047095f587c4","src/aarch64/xdp.rs":"8602704977fdf3c9721c88866dfb77ec31b949f7b44d287c41fb6616a08fbaaf","src/arm/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/arm/general.rs":"bdbb40ba5630044c9555fe38a3640638f3ff7f437d94f82428e2bedad32e180f","src/arm/if_ether.rs":"3873beb1f57bdcc52da345608c5deda5937d7b92b114b414ce6161784173b925","src/arm/if_packet.rs":"45e401c44d540bde6f7b2a5c4b67adf99353639bd7d82829480b34a6a174f4ca","src/arm/io_uring.rs":"5e2e254d5853ed30568e17fab184f8cc458607465d19dcee6c87ca1b565d6d2d","src/arm/ioctl.rs":"3f470208ae7e26b356a182a8396b8e4e7522e52d280a0b220c0b79b90ec8fb75","src/arm/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/arm/net.rs":"0b2addcd77882d71155bbe6e501ab2927ddca878effb4e8a6d4bce4d02ee6fef","src/arm/netlink.rs":"2f98b8c0349c2d3d538164e4d06c28fa1fb9308f7691aa097526ce2fb3ac176f","src/arm/prctl.rs":"5477c74fec958d9f9d2028f58e95657840ead28445956e53fe0894e45922f8a5","src/arm/system.rs":"9aca94a4a553e09e6d2d43741fb8c120c05a193822e850951dc469bbd89cc703","src/arm/xdp.rs":"a4ae33a218d9967b56b3c70d3c1c1180df49379b05044e3a5c7534b542b4a529","src/csky/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/csky/general.rs":"94aba82d2a76a9ca272b4766f8d2f5f14e10bc2166e03d695a5b8b5d207e6755","src/csky/if_ether.rs":"aac7a069000195b9b18c6d25b2d7c338efb1062347a84e31cda7c93de374b3c6","src/csky/if_packet.rs":"f88c8926dea84c835ad156b389ad29f50f9e8cb453cdfb5aece6d9fc9be681b6","src/csky/io_uring.rs":"bb7541d82f627cb681ea11f4e5c4162b0d0616ca08fcc6d31bcf22ef813f754d","src/csky/ioctl.rs":"54ee7b43b78b1920159fd924a1110a1c77d072113bb28b29991eacac9bff1a93","src/csky/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/csky/net.rs":"508650776f6a282e9a1d5109e08ff0d1678d86d1068fe43a9870f37787755166","src/csky/netlink.rs":"9fc99e88df0efc15d39b397c9d653c32b4729e31a2434e730435fbdfcb362da4","src/csky/prctl.rs":"8df2f33387d5b4865d9417f796cc4d43b3cf549cfa41d7ce7d41dd367ed8b6c9","src/csky/system.rs":"a2913685b359e60bbfae413b89a6fd37ea38fa448f980ffadef42d227b33ada5","src/csky/xdp.rs":"2138939b87c7c75d2b3ee499507142e2a5abeecd40783c297dd3c555285b3a54","src/elf.rs":"441bcf378b5603f957e053369d18d95c1efe981665846c220bca82123c04843a","src/lib.rs":"be5d81f17a8d15b2f631e362cf87b2ee3217fda06457cfc319b25ecb5c6732eb","src/loongarch64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/loongarch64/general.rs":"fadd5884c6ad645300540dd30150984857819a986772fca4eba1e1fc0c3f4f1e","src/loongarch64/if_ether.rs":"a7b0918afc9dbf8e79490f83a809e4bd563af20ab2b3432d58b763ff31418daf","src/loongarch64/if_packet.rs":"25e69ec7b16d27befb2b64c8540011563f3c02991588489b258febbbcf7c45d0","src/loongarch64/io_uring.rs":"ef851913c86bc2d629048e781edc76b59c63e659f8bd4bcd7fa7ff982186ed6d","src/loongarch64/ioctl.rs":"6f631e0ac37f2c2398168683a1523d1559b85369ffe4cdcc284ffe7455672c18","src/loongarch64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/loongarch64/net.rs":"af6d52d44def3ebdb01e047c588f353a9a3e6d20c6c57be5a846270a4505235b","src/loongarch64/netlink.rs":"789357343b94276e6f8fc8f3a32f06f3d3efd464c7850b2568dc609a49d1f305","src/loongarch64/prctl.rs":"624e4d3b8f3b4f1d6dcb1540c124ed03ce47f0580aa3425c0baed431dcd267ea","src/loongarch64/system.rs":"4cfcd4c28481b9ff5fc0330d5c713d637d3615c0184830d3a4391882eaed68f5","src/loongarch64/xdp.rs":"2270c2b3cce1cf55922ed685c6cb7197a3932d756763f7528ab36c034609d856","src/mips/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips/general.rs":"1c16f4e0a015eaf27e9a30f4b74ec824220798f47c535d3aaf322ad799c054ab","src/mips/if_ether.rs":"1ecdc654cb3eda633bb7192829b1001a0a5ae5a126110b4208bbee5b41f87f5e","src/mips/if_packet.rs":"222bec433d7773de2d576f6341ab1f37a72df7ca39c5214a6e0fff380700930f","src/mips/io_uring.rs":"c69479bb1f862febe78e0989745c202146aaef7e8ceaa0d7bf291af584748992","src/mips/ioctl.rs":"8d4bcd3cd6aa7e87267430bc7b102df012bafa8b0ea4b24a3cfa490447431ef9","src/mips/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips/net.rs":"553750bad3660aff2efb5b2a828860792d76eddf7cb4913d3be98b34901f6a83","src/mips/netlink.rs":"5045dece259abaa5b5974500a20a9325e4cd6eb87c344dd7448056dff469994f","src/mips/prctl.rs":"cd59615adf6f561ef6c542df59cf25f75877693ca1c4c489f5e460eb7e798d4d","src/mips/system.rs":"acbc69a1fe7299860f8bd142bc2ff5595a410e1528994139062fc680d1a87e71","src/mips/xdp.rs":"0dc8bed8c75615fc119bf4cc4231ce22639515b1165911dc0b7f6d5a07dbcd44","src/mips32r6/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips32r6/general.rs":"1c16f4e0a015eaf27e9a30f4b74ec824220798f47c535d3aaf322ad799c054ab","src/mips32r6/if_ether.rs":"1ecdc654cb3eda633bb7192829b1001a0a5ae5a126110b4208bbee5b41f87f5e","src/mips32r6/if_packet.rs":"222bec433d7773de2d576f6341ab1f37a72df7ca39c5214a6e0fff380700930f","src/mips32r6/io_uring.rs":"c69479bb1f862febe78e0989745c202146aaef7e8ceaa0d7bf291af584748992","src/mips32r6/ioctl.rs":"8d4bcd3cd6aa7e87267430bc7b102df012bafa8b0ea4b24a3cfa490447431ef9","src/mips32r6/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips32r6/net.rs":"553750bad3660aff2efb5b2a828860792d76eddf7cb4913d3be98b34901f6a83","src/mips32r6/netlink.rs":"5045dece259abaa5b5974500a20a9325e4cd6eb87c344dd7448056dff469994f","src/mips32r6/prctl.rs":"cd59615adf6f561ef6c542df59cf25f75877693ca1c4c489f5e460eb7e798d4d","src/mips32r6/system.rs":"acbc69a1fe7299860f8bd142bc2ff5595a410e1528994139062fc680d1a87e71","src/mips32r6/xdp.rs":"0dc8bed8c75615fc119bf4cc4231ce22639515b1165911dc0b7f6d5a07dbcd44","src/mips64/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips64/general.rs":"700b52614c604ce58aa8a5bb1ebd46221c0106ec2d8d6600d681d1594a89118a","src/mips64/if_ether.rs":"6d24518acba5bc8fa2a775d039ed9594de8349d6028621134626ccaa8ea18bcd","src/mips64/if_packet.rs":"04ddeec1897afb84f5905e5122617d5436842aecb0480b6f36e6d0a46e7ab9c0","src/mips64/io_uring.rs":"18bd5d96c53aff44f4a37a71f16fa12c11b7c934b395bf841e47d98283146a50","src/mips64/ioctl.rs":"f0059994ece12ced8e4040aa68ccd58850119b5746d87000f8f538af8bd6359c","src/mips64/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips64/net.rs":"a5bd6d654ea16c02f6f85b969bfc2177a88603d38a9a52f09685ca4114f6e199","src/mips64/netlink.rs":"18f139573337be18fb9bd56de4d0bd8af5c80828cdf68ef68751c18dcb39c761","src/mips64/prctl.rs":"a8d9ae240ce582d7b66e13937b99df73c7247ce9f69bfdd12109903d7c6dfb0e","src/mips64/system.rs":"95805c533a8eb8f53c28f138e6a2d12064681cc9db55d3042ee748c655a5d7cd","src/mips64/xdp.rs":"19fdf2b824b95184dabd5c8960d9482788ab8ef027e23acaae9e7992be8eb4e4","src/mips64r6/errno.rs":"9ab1ed2bf371a27401745c2a6f9692f7e66dfd481d032cb40a354826d394ea8e","src/mips64r6/general.rs":"700b52614c604ce58aa8a5bb1ebd46221c0106ec2d8d6600d681d1594a89118a","src/mips64r6/if_ether.rs":"6d24518acba5bc8fa2a775d039ed9594de8349d6028621134626ccaa8ea18bcd","src/mips64r6/if_packet.rs":"04ddeec1897afb84f5905e5122617d5436842aecb0480b6f36e6d0a46e7ab9c0","src/mips64r6/io_uring.rs":"18bd5d96c53aff44f4a37a71f16fa12c11b7c934b395bf841e47d98283146a50","src/mips64r6/ioctl.rs":"f0059994ece12ced8e4040aa68ccd58850119b5746d87000f8f538af8bd6359c","src/mips64r6/mempolicy.rs":"1bb5200d678b4ffeb06eb1728bd391742bc300b363421bb24b8dea340b991594","src/mips64r6/net.rs":"a5bd6d654ea16c02f6f85b969bfc2177a88603d38a9a52f09685ca4114f6e199","src/mips64r6/netlink.rs":"18f139573337be18fb9bd56de4d0bd8af5c80828cdf68ef68751c18dcb39c761","src/mips64r6/prctl.rs":"a8d9ae240ce582d7b66e13937b99df73c7247ce9f69bfdd12109903d7c6dfb0e","src/mips64r6/system.rs":"95805c533a8eb8f53c28f138e6a2d12064681cc9db55d3042ee748c655a5d7cd","src/mips64r6/xdp.rs":"19fdf2b824b95184dabd5c8960d9482788ab8ef027e23acaae9e7992be8eb4e4","src/powerpc/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/powerpc/general.rs":"7940ad742585d501f4742af51c6310ecf651863a8aaa0305193e9c8ee07aca90","src/powerpc/if_ether.rs":"56ab5fbf8c9d0dd0654412fabdca6759cbb421a876e5cebe2fec10e25728b55c","src/powerpc/if_packet.rs":"b7f556f37ba3b5e97d10065e028c4158a821b0d135893a9b4871d0d477b5ef98","src/powerpc/io_uring.rs":"38ead79180c96e8af69929dacbc36e8cfbccec96875c61f094e531e6860639db","src/powerpc/ioctl.rs":"1fabc6c3481d6710b343aa27bf9331e81d16c3cdf86eb76eac61b19839d9b2f4","src/powerpc/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/powerpc/net.rs":"d1c6c36e71354ef35f64ae1195eff75c73f0a4b90fa8a4070cab9e79b81f8b78","src/powerpc/netlink.rs":"4f10870fbd23de17efd4cba6d5a40ba85564effc5d0b71f9d7f928a42cb77b20","src/powerpc/prctl.rs":"f236987bc8ae993ab2b0e88b2eacbae51eee4da170ac075552070a76c717d803","src/powerpc/system.rs":"3e01e5e145adb87263f04c9e053faac0c0758689fd32917d2c7c2eec1d89f9e6","src/powerpc/xdp.rs":"9f04a2ef343109f1bb5ac5bc7ef66cb3c1c966744653a70a79b91f04b9609d07","src/powerpc64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/powerpc64/general.rs":"7862eb3dfac845331b624b3322bdeb3441bb86e914719e125dd5dc7b3860db43","src/powerpc64/if_ether.rs":"15e12d56b1367cb5c9d8fd1b9995acf1429a923bf603698bd732efe1acc30cd6","src/powerpc64/if_packet.rs":"272be02b20e65330c89b87ee0a642eeafdbc40b830d54d6eef041fd9eab9ec77","src/powerpc64/io_uring.rs":"50018e504d78c584beaec3b1a6d477d30d566d25cb1a40b0a2adfb23d726674f","src/powerpc64/ioctl.rs":"1fabc6c3481d6710b343aa27bf9331e81d16c3cdf86eb76eac61b19839d9b2f4","src/powerpc64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/powerpc64/net.rs":"706e58efa77918ac96f20fa33afd5f498e2e118507084c1ae9db93483103ab32","src/powerpc64/netlink.rs":"352a06995f7de6e4fc1c2ff54c1eccb93a3d833a923e834ec75c6a4d30ea5051","src/powerpc64/prctl.rs":"1fcccc5b6dac472a30b7701b5c9e436c238410077cfe158d600b51d55bcc074a","src/powerpc64/system.rs":"500116b7613a504ebad028cec1ba37323310e29864d885ae62191ccb1f86d333","src/powerpc64/xdp.rs":"baad88c60c08fc79dc3c223c0e8d9adef4462728b6e46e5143ce10f6ce5e32bd","src/riscv32/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/riscv32/general.rs":"16ffe747a8f75ac6594dc7afddef4fbb89735da50af9f19f152fd2f04b509463","src/riscv32/if_ether.rs":"aac7a069000195b9b18c6d25b2d7c338efb1062347a84e31cda7c93de374b3c6","src/riscv32/if_packet.rs":"1834cbc6b60973021393a52c88aaff0310f2dcfc1786a9d7ae13c2705752a7e0","src/riscv32/io_uring.rs":"5c67dde8fdb3641407d4ebd744171606b82596176343fe6766afd3220eda2ab1","src/riscv32/ioctl.rs":"6f631e0ac37f2c2398168683a1523d1559b85369ffe4cdcc284ffe7455672c18","src/riscv32/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/riscv32/net.rs":"508650776f6a282e9a1d5109e08ff0d1678d86d1068fe43a9870f37787755166","src/riscv32/netlink.rs":"9fc99e88df0efc15d39b397c9d653c32b4729e31a2434e730435fbdfcb362da4","src/riscv32/prctl.rs":"8df2f33387d5b4865d9417f796cc4d43b3cf549cfa41d7ce7d41dd367ed8b6c9","src/riscv32/system.rs":"a2913685b359e60bbfae413b89a6fd37ea38fa448f980ffadef42d227b33ada5","src/riscv32/xdp.rs":"2138939b87c7c75d2b3ee499507142e2a5abeecd40783c297dd3c555285b3a54","src/riscv64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/riscv64/general.rs":"8ec4907ac81b62e21451731a468e5f4fe7a37a46d80c56b33e0969d2d059d442","src/riscv64/if_ether.rs":"a7b0918afc9dbf8e79490f83a809e4bd563af20ab2b3432d58b763ff31418daf","src/riscv64/if_packet.rs":"25e69ec7b16d27befb2b64c8540011563f3c02991588489b258febbbcf7c45d0","src/riscv64/io_uring.rs":"ef851913c86bc2d629048e781edc76b59c63e659f8bd4bcd7fa7ff982186ed6d","src/riscv64/ioctl.rs":"9c4645f03ac8bdfba148aed2d123688c3638e8b742aa69e03f9f886e4dc0132c","src/riscv64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/riscv64/net.rs":"af6d52d44def3ebdb01e047c588f353a9a3e6d20c6c57be5a846270a4505235b","src/riscv64/netlink.rs":"789357343b94276e6f8fc8f3a32f06f3d3efd464c7850b2568dc609a49d1f305","src/riscv64/prctl.rs":"624e4d3b8f3b4f1d6dcb1540c124ed03ce47f0580aa3425c0baed431dcd267ea","src/riscv64/system.rs":"4cfcd4c28481b9ff5fc0330d5c713d637d3615c0184830d3a4391882eaed68f5","src/riscv64/xdp.rs":"2270c2b3cce1cf55922ed685c6cb7197a3932d756763f7528ab36c034609d856","src/s390x/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/s390x/general.rs":"687f6e3d4502d31aaec08a41335b6a368f0949049875d939065a66df86e06b8a","src/s390x/if_ether.rs":"2a6b2132be1aebe126eb64ea230a82c2ab18433ece37226c9dacd81392ad6ca2","src/s390x/if_packet.rs":"718a17518e3eea871f5e6536d13496cd4ea3172f163a461f7ab2e114468b3560","src/s390x/io_uring.rs":"57790b4ce46a4a2a87a329ff935033dfb430117bcc2154fa066c5d681f115319","src/s390x/ioctl.rs":"0aa7214e5a0fe1159a13afb0fa185505e5bcebb7bc8ba8abd7b210bc8c63c47a","src/s390x/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/s390x/net.rs":"792ef0d83c1e7640e5c6e15a96d3bc9d90f4fc96740f076792ce203c31db9a09","src/s390x/netlink.rs":"c3c11102a55d15dfb534d748c8bc8ece58c9d56170b6afe07d1f2cc783fd6372","src/s390x/prctl.rs":"6fe9f5349f9a694b391f309f208235c1d4669430d3f051ef64467576e91df7a1","src/s390x/system.rs":"f68e8afbd02bc87a8fec2cae4e367f296873f2c1a651032da4ccc4f1c0ed4670","src/s390x/xdp.rs":"fc298028f317486df5e28595c3a5ee0802b7b4dc1e113231332982ae8226b8cb","src/sparc/errno.rs":"b3c5e1a6c8378d613c6ef3dd44e2199ea7455da65e83d6bb19582a79de880f80","src/sparc/general.rs":"a38a371e8ceeecc4384999b4cc8ee6d65a35a20542c96c62e04c24b2b2953858","src/sparc/if_ether.rs":"c574c6d1ea11a8bb213b18928fe2d342c897d8ff04458991a5192eb401fbbc57","src/sparc/if_packet.rs":"c3e8bce80c279fb92c9d7f6f4a593ea9f61180f728224c60dd1efa9b2950b297","src/sparc/io_uring.rs":"d813aabc93f383c8522773ed431209627d810c78bcdb4dae931a702aae55e09f","src/sparc/ioctl.rs":"b2a4c7d649b18a4d2a1142400de687d48c195dcf8a86b58ac261413c33809d7b","src/sparc/mempolicy.rs":"4b03f870283b21150e322f00d8bab5088189b0a1189a6a8dc6b93da7d647f629","src/sparc/net.rs":"9c2f69c2d2bb193f5ff1b5f54d1f992555157d7d2af8d4cdee32a45c12ff4ee6","src/sparc/netlink.rs":"0f176c24de7b2b19ac16dd95625947b8047d48bc7b871e12a3acd31f8e97c6f5","src/sparc/prctl.rs":"5f5686fe04d8cc5e746d789340331095044f244c123ecf1468dcb089bbb931cd","src/sparc/system.rs":"6f1f8ce9978693845621880031ac4805f00027315a691cfe1d466703c7a96e8d","src/sparc/xdp.rs":"f62496e93ea3230b914d3c7263957f9377c0b9c87cfc6e85e9779433d1a4747a","src/sparc64/errno.rs":"b3c5e1a6c8378d613c6ef3dd44e2199ea7455da65e83d6bb19582a79de880f80","src/sparc64/general.rs":"d4138f0e663833811365fdc2e1008525df0f21044b5e31ab80d97d63fcb9f45f","src/sparc64/if_ether.rs":"e51661cb54922c3c01853617a61b3d141768adf5b94162c4aefb326d31ef55f5","src/sparc64/if_packet.rs":"4944db85104ae65eb61af6df4e6c37a1037d849b1056f33ffcc56f7daa8da5ed","src/sparc64/io_uring.rs":"688f4678c259eb940aa0216c0183843d436b918d214e13bed56a38ddb55132db","src/sparc64/ioctl.rs":"b2a4c7d649b18a4d2a1142400de687d48c195dcf8a86b58ac261413c33809d7b","src/sparc64/mempolicy.rs":"4b03f870283b21150e322f00d8bab5088189b0a1189a6a8dc6b93da7d647f629","src/sparc64/net.rs":"629b4860c128d4ebb2249f43fd733dea87ca65d3ded5ea8123b43d08a73ba080","src/sparc64/netlink.rs":"7cec2a77af7ec17cad96d63027fd4a9164f0e6503f2e6cc2a99e79aa1bba3147","src/sparc64/prctl.rs":"ff897312b99274ce4eefecccc9797e34accc69efce1299712ab631e9542cb8ca","src/sparc64/system.rs":"becb2e706ed6df77860a2a3884b28181dca606db22fcd604a8a1803f937e8baf","src/sparc64/xdp.rs":"5e1ea3534a0a81f56ea35ea38eddc3bab420bab57d5b34b3f6fafffd43c51a47","src/x32/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x32/general.rs":"c2aeaf3096d559a86d3f72e0ec4a91245edfce35e85c51b50d13e115ec357974","src/x32/if_ether.rs":"859047581be4a3ae923b88516e86230a4f9a447a5203285dd8bcc539038c5c4f","src/x32/if_packet.rs":"e9846f5a713ba4b13efcdbaa7499121857347f5fb7b5b8cf137ee84aeba8d768","src/x32/io_uring.rs":"40834d29cf819e43a23f9a2e075e2ea0c001be817f7200aa059c24eae6d29123","src/x32/ioctl.rs":"f2b8a984878ecc004089ef138b00d78ab7747cce45d3bb9b60b46e35f49f3ec7","src/x32/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x32/net.rs":"e6f5f56160ead3ce9d39be3477a4bfb33a1adbc5fba53575304336a6ff1b5370","src/x32/netlink.rs":"f74042f6cf0eabccfa6b8008a89ee7ab347fb7eaa89499757a786b13b2403982","src/x32/prctl.rs":"2d1eb6873dc5b72a8252f12e695d98a045e01026f730302a6515f53a394bba7c","src/x32/system.rs":"69c125aea6b21f2c4981f3386602283a691524671fef1da7d67de3b67fffdc42","src/x32/xdp.rs":"955fb2683206fce1e5c763060c8a5b1f930ad82d127f330f72e91bba56adbc8b","src/x86/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x86/general.rs":"a9b002ea136dabb9fd1c489c999cd1bfeca62490202aab095221fc70c2b6e30e","src/x86/if_ether.rs":"3873beb1f57bdcc52da345608c5deda5937d7b92b114b414ce6161784173b925","src/x86/if_packet.rs":"33e3e967a2f52b9796205f48867a38b87c7f77424f9ed4a765def5ee4037c528","src/x86/io_uring.rs":"3f60400dfc11a5eafa5a54466f7f9ca74a63219feda2278c388529bf40c0a6a3","src/x86/ioctl.rs":"11e753119d8491145a6b2af6fff2041ba3c49d61f7ee130d9737c4b3e40ee41d","src/x86/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x86/net.rs":"0b2addcd77882d71155bbe6e501ab2927ddca878effb4e8a6d4bce4d02ee6fef","src/x86/netlink.rs":"2f98b8c0349c2d3d538164e4d06c28fa1fb9308f7691aa097526ce2fb3ac176f","src/x86/prctl.rs":"5477c74fec958d9f9d2028f58e95657840ead28445956e53fe0894e45922f8a5","src/x86/system.rs":"9aca94a4a553e09e6d2d43741fb8c120c05a193822e850951dc469bbd89cc703","src/x86/xdp.rs":"a4ae33a218d9967b56b3c70d3c1c1180df49379b05044e3a5c7534b542b4a529","src/x86_64/errno.rs":"db283e5ea7fb63e0f57acb241e6471a951b4218660c01ca37b80be9a53629b92","src/x86_64/general.rs":"f0c763abb8d7e7bd594c674d2774b272844829ecee4e3ed42932004616a2380e","src/x86_64/if_ether.rs":"feb5362d90fbd5113b6f1f22fcc77a7b3bb7c8f5081be7eacb2e270d2f24a293","src/x86_64/if_packet.rs":"102801c066a4372a7bb67f91af78de4a99fa7f99dffe3a015799ed16409e0b4d","src/x86_64/io_uring.rs":"6c008c59b6905b7872b788e30d546efa3b5bb03a0fe17e33b90bfc8beec23f29","src/x86_64/ioctl.rs":"f2b8a984878ecc004089ef138b00d78ab7747cce45d3bb9b60b46e35f49f3ec7","src/x86_64/mempolicy.rs":"fc2d0688a67779b521762ae850605f754be487560f888bd5c0bce80c426dfc35","src/x86_64/net.rs":"65f921d16a2380b95496db75169b0ef97048e3226a295740cc1e237f817deb9b","src/x86_64/netlink.rs":"d47b8b117007b1c29db325dad68ed1b92562b98f90916b1b192f57a935a98038","src/x86_64/prctl.rs":"6d0f63fff8d76cc2f4678f38e40a68d072d7da4094d5217ce92872370bb4df9b","src/x86_64/system.rs":"6a415f104e7dd34829b36c19ad89e0cfcfbc69a846c87f81e202411386d46966","src/x86_64/xdp.rs":"20776ba35015ad659b5bb8fb47a7d10fc1aee5530ffe650f2f4e10ec653d7857"},"package":"01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"} \ No newline at end of file diff --git a/vendor/linux-raw-sys/Cargo.toml b/vendor/linux-raw-sys/Cargo.toml index eeb2069e5..1ff4cf2bf 100644 --- a/vendor/linux-raw-sys/Cargo.toml +++ b/vendor/linux-raw-sys/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.63" name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" authors = ["Dan Gohman "] exclude = [ "/gen", @@ -41,6 +41,9 @@ features = [ "net", "prctl", "elf", + "xdp", + "mempolicy", + "system", ] targets = [ "x86_64-unknown-linux-gnu", @@ -72,6 +75,7 @@ elf = [] errno = [] general = [] if_ether = [] +if_packet = [] io_uring = [] ioctl = [] mempolicy = [] diff --git a/vendor/linux-raw-sys/src/aarch64/if_packet.rs b/vendor/linux-raw-sys/src/aarch64/if_packet.rs new file mode 100644 index 000000000..06bf17602 --- /dev/null +++ b/vendor/linux-raw-sys/src/aarch64/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/arm/if_packet.rs b/vendor/linux-raw-sys/src/arm/if_packet.rs new file mode 100644 index 000000000..4a2ac325d --- /dev/null +++ b/vendor/linux-raw-sys/src/arm/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/csky/if_packet.rs b/vendor/linux-raw-sys/src/csky/if_packet.rs new file mode 100644 index 000000000..8eebb1148 --- /dev/null +++ b/vendor/linux-raw-sys/src/csky/if_packet.rs @@ -0,0 +1,309 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/csky/ioctl.rs b/vendor/linux-raw-sys/src/csky/ioctl.rs index 536d7ace2..3f0b8ddaf 100644 --- a/vendor/linux-raw-sys/src/csky/ioctl.rs +++ b/vendor/linux-raw-sys/src/csky/ioctl.rs @@ -104,6 +104,22 @@ pub const BLKDISCARDZEROES: u32 = 4732; pub const BLKSECDISCARD: u32 = 4733; pub const BLKROTATIONAL: u32 = 4734; pub const BLKZEROOUT: u32 = 4735; +pub const FIEMAP_MAX_OFFSET: u32 = 4294967295; +pub const FIEMAP_FLAG_SYNC: u32 = 1; +pub const FIEMAP_FLAG_XATTR: u32 = 2; +pub const FIEMAP_FLAG_CACHE: u32 = 4; +pub const FIEMAP_FLAGS_COMPAT: u32 = 3; +pub const FIEMAP_EXTENT_LAST: u32 = 1; +pub const FIEMAP_EXTENT_UNKNOWN: u32 = 2; +pub const FIEMAP_EXTENT_DELALLOC: u32 = 4; +pub const FIEMAP_EXTENT_ENCODED: u32 = 8; +pub const FIEMAP_EXTENT_DATA_ENCRYPTED: u32 = 128; +pub const FIEMAP_EXTENT_NOT_ALIGNED: u32 = 256; +pub const FIEMAP_EXTENT_DATA_INLINE: u32 = 512; +pub const FIEMAP_EXTENT_DATA_TAIL: u32 = 1024; +pub const FIEMAP_EXTENT_UNWRITTEN: u32 = 2048; +pub const FIEMAP_EXTENT_MERGED: u32 = 4096; +pub const FIEMAP_EXTENT_SHARED: u32 = 8192; pub const UFFDIO_REGISTER: u32 = 3223366144; pub const UFFDIO_UNREGISTER: u32 = 2148575745; pub const UFFDIO_WAKE: u32 = 2148575746; @@ -914,7 +930,6 @@ pub const IOC_OPAL_SAVE: u32 = 1092120796; pub const VIDIOC_G_DV_TIMINGS: u32 = 3229898328; pub const TUNSETIFINDEX: u32 = 1074025690; pub const CCISS_SETINTINFO: u32 = 1074283011; -pub const CM_IOSDBGLVL: u32 = 1074029562; pub const RTC_VL_CLR: u32 = 28692; pub const VIDIOC_REQBUFS: u32 = 3222558216; pub const USBDEVFS_REAPURBNDELAY32: u32 = 1074025741; @@ -1044,7 +1059,6 @@ pub const UI_SET_RELBIT: u32 = 1074025830; pub const VFIO_SET_IOMMU: u32 = 15206; pub const VIDIOC_S_MODULATOR: u32 = 1078220343; pub const TUNGETFILTER: u32 = 2148029659; -pub const MEYEIOC_SYNC: u32 = 3221518019; pub const CCISS_SETNODENAME: u32 = 1074807301; pub const FBIO_GETCONTROL2: u32 = 2147763849; pub const TUNSETDEBUG: u32 = 1074025673; @@ -1325,7 +1339,6 @@ pub const PERF_EVENT_IOC_QUERY_BPF: u32 = 3221496842; pub const VIDIOC_STREAMOFF: u32 = 1074026003; pub const VDUSE_DESTROY_DEV: u32 = 1090552067; pub const FDGETFDCSTAT: u32 = 2149581333; -pub const CM_IOCGATR: u32 = 3221512961; pub const VIDIOC_S_PRIORITY: u32 = 1074026052; pub const SNAPSHOT_FREEZE: u32 = 13057; pub const VIDIOC_ENUMINPUT: u32 = 3226228250; diff --git a/vendor/linux-raw-sys/src/lib.rs b/vendor/linux-raw-sys/src/lib.rs index 5dcd8f00e..bd5c3ffbc 100644 --- a/vendor/linux-raw-sys/src/lib.rs +++ b/vendor/linux-raw-sys/src/lib.rs @@ -202,6 +202,10 @@ pub mod general; #[cfg(target_arch = "arm")] #[path = "arm/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "arm")] +#[path = "arm/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "arm")] #[path = "arm/io_uring.rs"] @@ -246,6 +250,10 @@ pub mod general; #[cfg(target_arch = "aarch64")] #[path = "aarch64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "aarch64")] +#[path = "aarch64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "aarch64")] #[path = "aarch64/io_uring.rs"] @@ -290,6 +298,10 @@ pub mod general; #[cfg(target_arch = "csky")] #[path = "csky/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "csky")] +#[path = "csky/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "csky")] #[path = "csky/io_uring.rs"] @@ -334,6 +346,10 @@ pub mod general; #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "loongarch64")] +#[path = "loongarch64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/io_uring.rs"] @@ -378,6 +394,10 @@ pub mod general; #[cfg(target_arch = "mips")] #[path = "mips/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "mips")] +#[path = "mips/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "mips")] #[path = "mips/io_uring.rs"] @@ -422,6 +442,10 @@ pub mod general; #[cfg(target_arch = "mips64")] #[path = "mips64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "mips64")] +#[path = "mips64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "mips64")] #[path = "mips64/io_uring.rs"] @@ -466,6 +490,10 @@ pub mod general; #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "mips32r6")] +#[path = "mips32r6/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/io_uring.rs"] @@ -510,6 +538,10 @@ pub mod general; #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "mips64r6")] +#[path = "mips64r6/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/io_uring.rs"] @@ -554,6 +586,10 @@ pub mod general; #[cfg(target_arch = "powerpc")] #[path = "powerpc/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "powerpc")] +#[path = "powerpc/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "powerpc")] #[path = "powerpc/io_uring.rs"] @@ -598,6 +634,10 @@ pub mod general; #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "powerpc64")] +#[path = "powerpc64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/io_uring.rs"] @@ -642,6 +682,10 @@ pub mod general; #[cfg(target_arch = "riscv32")] #[path = "riscv32/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "riscv32")] +#[path = "riscv32/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "riscv32")] #[path = "riscv32/io_uring.rs"] @@ -686,6 +730,10 @@ pub mod general; #[cfg(target_arch = "riscv64")] #[path = "riscv64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "riscv64")] +#[path = "riscv64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "riscv64")] #[path = "riscv64/io_uring.rs"] @@ -730,6 +778,10 @@ pub mod general; #[cfg(target_arch = "s390x")] #[path = "s390x/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "s390x")] +#[path = "s390x/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "s390x")] #[path = "s390x/io_uring.rs"] @@ -774,6 +826,10 @@ pub mod general; #[cfg(target_arch = "sparc")] #[path = "sparc/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "sparc")] +#[path = "sparc/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "sparc")] #[path = "sparc/io_uring.rs"] @@ -818,6 +874,10 @@ pub mod general; #[cfg(target_arch = "sparc64")] #[path = "sparc64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "sparc64")] +#[path = "sparc64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "sparc64")] #[path = "sparc64/io_uring.rs"] @@ -862,6 +922,10 @@ pub mod general; #[cfg(target_arch = "x86")] #[path = "x86/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(target_arch = "x86")] +#[path = "x86/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(target_arch = "x86")] #[path = "x86/io_uring.rs"] @@ -906,6 +970,10 @@ pub mod general; #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +#[path = "x86_64/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/io_uring.rs"] @@ -950,6 +1018,10 @@ pub mod general; #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/if_ether.rs"] pub mod if_ether; +#[cfg(feature = "if_packet")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[path = "x32/if_packet.rs"] +pub mod if_packet; #[cfg(feature = "io_uring")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/io_uring.rs"] diff --git a/vendor/linux-raw-sys/src/loongarch64/if_packet.rs b/vendor/linux-raw-sys/src/loongarch64/if_packet.rs new file mode 100644 index 000000000..03ca2f7e4 --- /dev/null +++ b/vendor/linux-raw-sys/src/loongarch64/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/mips/if_packet.rs b/vendor/linux-raw-sys/src/mips/if_packet.rs new file mode 100644 index 000000000..7229987f9 --- /dev/null +++ b/vendor/linux-raw-sys/src/mips/if_packet.rs @@ -0,0 +1,317 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/mips32r6/if_packet.rs b/vendor/linux-raw-sys/src/mips32r6/if_packet.rs new file mode 100644 index 000000000..7229987f9 --- /dev/null +++ b/vendor/linux-raw-sys/src/mips32r6/if_packet.rs @@ -0,0 +1,317 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/mips64/if_packet.rs b/vendor/linux-raw-sys/src/mips64/if_packet.rs new file mode 100644 index 000000000..191386e06 --- /dev/null +++ b/vendor/linux-raw-sys/src/mips64/if_packet.rs @@ -0,0 +1,317 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/mips64r6/if_packet.rs b/vendor/linux-raw-sys/src/mips64r6/if_packet.rs new file mode 100644 index 000000000..191386e06 --- /dev/null +++ b/vendor/linux-raw-sys/src/mips64r6/if_packet.rs @@ -0,0 +1,317 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/powerpc/if_packet.rs b/vendor/linux-raw-sys/src/powerpc/if_packet.rs new file mode 100644 index 000000000..de8dfa81b --- /dev/null +++ b/vendor/linux-raw-sys/src/powerpc/if_packet.rs @@ -0,0 +1,313 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_short; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/powerpc64/if_packet.rs b/vendor/linux-raw-sys/src/powerpc64/if_packet.rs new file mode 100644 index 000000000..712b46b78 --- /dev/null +++ b/vendor/linux-raw-sys/src/powerpc64/if_packet.rs @@ -0,0 +1,313 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/riscv32/if_packet.rs b/vendor/linux-raw-sys/src/riscv32/if_packet.rs new file mode 100644 index 000000000..7f658477a --- /dev/null +++ b/vendor/linux-raw-sys/src/riscv32/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/riscv64/if_packet.rs b/vendor/linux-raw-sys/src/riscv64/if_packet.rs new file mode 100644 index 000000000..03ca2f7e4 --- /dev/null +++ b/vendor/linux-raw-sys/src/riscv64/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/s390x/if_packet.rs b/vendor/linux-raw-sys/src/s390x/if_packet.rs new file mode 100644 index 000000000..fc9a98942 --- /dev/null +++ b/vendor/linux-raw-sys/src/s390x/if_packet.rs @@ -0,0 +1,327 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type addr_t = crate::ctypes::c_ulong; +pub type saddr_t = crate::ctypes::c_long; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_ulong; +pub type __kernel_ssize_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_ino_t = crate::ctypes::c_uint; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_sigset_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub struct __vector128 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __vector128__bindgen_ty_1__bindgen_ty_1 { +pub high: __u64, +pub low: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __vector128__bindgen_ty_1 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1__bindgen_ty_1, +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/sparc/if_packet.rs b/vendor/linux-raw-sys/src/sparc/if_packet.rs new file mode 100644 index 000000000..ed8d9623b --- /dev/null +++ b/vendor/linux-raw-sys/src/sparc/if_packet.rs @@ -0,0 +1,523 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const ASI_NULL1: u32 = 0; +pub const ASI_NULL2: u32 = 1; +pub const ASI_CONTROL: u32 = 2; +pub const ASI_SEGMAP: u32 = 3; +pub const ASI_PTE: u32 = 4; +pub const ASI_HWFLUSHSEG: u32 = 5; +pub const ASI_HWFLUSHPAGE: u32 = 6; +pub const ASI_REGMAP: u32 = 6; +pub const ASI_HWFLUSHCONTEXT: u32 = 7; +pub const ASI_USERTXT: u32 = 8; +pub const ASI_KERNELTXT: u32 = 9; +pub const ASI_USERDATA: u32 = 10; +pub const ASI_KERNELDATA: u32 = 11; +pub const ASI_FLUSHSEG: u32 = 12; +pub const ASI_FLUSHPG: u32 = 13; +pub const ASI_FLUSHCTX: u32 = 14; +pub const ASI_M_RES00: u32 = 0; +pub const ASI_M_UNA01: u32 = 1; +pub const ASI_M_MXCC: u32 = 2; +pub const ASI_M_FLUSH_PROBE: u32 = 3; +pub const ASI_M_MMUREGS: u32 = 4; +pub const ASI_M_TLBDIAG: u32 = 5; +pub const ASI_M_DIAGS: u32 = 6; +pub const ASI_M_IODIAG: u32 = 7; +pub const ASI_M_USERTXT: u32 = 8; +pub const ASI_M_KERNELTXT: u32 = 9; +pub const ASI_M_USERDATA: u32 = 10; +pub const ASI_M_KERNELDATA: u32 = 11; +pub const ASI_M_TXTC_TAG: u32 = 12; +pub const ASI_M_TXTC_DATA: u32 = 13; +pub const ASI_M_DATAC_TAG: u32 = 14; +pub const ASI_M_DATAC_DATA: u32 = 15; +pub const ASI_M_FLUSH_PAGE: u32 = 16; +pub const ASI_M_FLUSH_SEG: u32 = 17; +pub const ASI_M_FLUSH_REGION: u32 = 18; +pub const ASI_M_FLUSH_CTX: u32 = 19; +pub const ASI_M_FLUSH_USER: u32 = 20; +pub const ASI_M_BCOPY: u32 = 23; +pub const ASI_M_IFLUSH_PAGE: u32 = 24; +pub const ASI_M_IFLUSH_SEG: u32 = 25; +pub const ASI_M_IFLUSH_REGION: u32 = 26; +pub const ASI_M_IFLUSH_CTX: u32 = 27; +pub const ASI_M_IFLUSH_USER: u32 = 28; +pub const ASI_M_BFILL: u32 = 31; +pub const ASI_M_BYPASS: u32 = 32; +pub const ASI_M_FBMEM: u32 = 41; +pub const ASI_M_VMEUS: u32 = 42; +pub const ASI_M_VMEPS: u32 = 43; +pub const ASI_M_VMEUT: u32 = 44; +pub const ASI_M_VMEPT: u32 = 45; +pub const ASI_M_SBUS: u32 = 46; +pub const ASI_M_CTL: u32 = 47; +pub const ASI_M_FLUSH_IWHOLE: u32 = 49; +pub const ASI_M_IC_FLCLEAR: u32 = 54; +pub const ASI_M_DC_FLCLEAR: u32 = 55; +pub const ASI_M_DCDR: u32 = 57; +pub const ASI_M_VIKING_TMP1: u32 = 64; +pub const ASI_M_ACTION: u32 = 76; +pub const ASI_LEON_NOCACHE: u32 = 1; +pub const ASI_LEON_DCACHE_MISS: u32 = 1; +pub const ASI_LEON_CACHEREGS: u32 = 2; +pub const ASI_LEON_IFLUSH: u32 = 16; +pub const ASI_LEON_DFLUSH: u32 = 17; +pub const ASI_LEON_MMUFLUSH: u32 = 24; +pub const ASI_LEON_MMUREGS: u32 = 25; +pub const ASI_LEON_BYPASS: u32 = 28; +pub const ASI_LEON_FLUSH_PAGE: u32 = 16; +pub const ASI_N: u32 = 4; +pub const ASI_NL: u32 = 12; +pub const ASI_AIUP: u32 = 16; +pub const ASI_AIUS: u32 = 17; +pub const ASI_AIUPL: u32 = 24; +pub const ASI_AIUSL: u32 = 25; +pub const ASI_P: u32 = 128; +pub const ASI_S: u32 = 129; +pub const ASI_PNF: u32 = 130; +pub const ASI_SNF: u32 = 131; +pub const ASI_PL: u32 = 136; +pub const ASI_SL: u32 = 137; +pub const ASI_PNFL: u32 = 138; +pub const ASI_SNFL: u32 = 139; +pub const ASI_MCD_PRIV_PRIMARY: u32 = 2; +pub const ASI_MCD_REAL: u32 = 5; +pub const ASI_PHYS_USE_EC: u32 = 20; +pub const ASI_PHYS_BYPASS_EC_E: u32 = 21; +pub const ASI_BLK_AIUP_4V: u32 = 22; +pub const ASI_BLK_AIUS_4V: u32 = 23; +pub const ASI_PHYS_USE_EC_L: u32 = 28; +pub const ASI_PHYS_BYPASS_EC_E_L: u32 = 29; +pub const ASI_BLK_AIUP_L_4V: u32 = 30; +pub const ASI_BLK_AIUS_L_4V: u32 = 31; +pub const ASI_SCRATCHPAD: u32 = 32; +pub const ASI_MMU: u32 = 33; +pub const ASI_BLK_INIT_QUAD_LDD_AIUS: u32 = 35; +pub const ASI_NUCLEUS_QUAD_LDD: u32 = 36; +pub const ASI_QUEUE: u32 = 37; +pub const ASI_QUAD_LDD_PHYS_4V: u32 = 38; +pub const ASI_NUCLEUS_QUAD_LDD_L: u32 = 44; +pub const ASI_QUAD_LDD_PHYS_L_4V: u32 = 46; +pub const ASI_PCACHE_DATA_STATUS: u32 = 48; +pub const ASI_PCACHE_DATA: u32 = 49; +pub const ASI_PCACHE_TAG: u32 = 50; +pub const ASI_PCACHE_SNOOP_TAG: u32 = 51; +pub const ASI_QUAD_LDD_PHYS: u32 = 52; +pub const ASI_WCACHE_VALID_BITS: u32 = 56; +pub const ASI_WCACHE_DATA: u32 = 57; +pub const ASI_WCACHE_TAG: u32 = 58; +pub const ASI_WCACHE_SNOOP_TAG: u32 = 59; +pub const ASI_QUAD_LDD_PHYS_L: u32 = 60; +pub const ASI_SRAM_FAST_INIT: u32 = 64; +pub const ASI_CORE_AVAILABLE: u32 = 65; +pub const ASI_CORE_ENABLE_STAT: u32 = 65; +pub const ASI_CORE_ENABLE: u32 = 65; +pub const ASI_XIR_STEERING: u32 = 65; +pub const ASI_CORE_RUNNING_RW: u32 = 65; +pub const ASI_CORE_RUNNING_W1S: u32 = 65; +pub const ASI_CORE_RUNNING_W1C: u32 = 65; +pub const ASI_CORE_RUNNING_STAT: u32 = 65; +pub const ASI_CMT_ERROR_STEERING: u32 = 65; +pub const ASI_DCACHE_INVALIDATE: u32 = 66; +pub const ASI_DCACHE_UTAG: u32 = 67; +pub const ASI_DCACHE_SNOOP_TAG: u32 = 68; +pub const ASI_LSU_CONTROL: u32 = 69; +pub const ASI_DCU_CONTROL_REG: u32 = 69; +pub const ASI_DCACHE_DATA: u32 = 70; +pub const ASI_DCACHE_TAG: u32 = 71; +pub const ASI_INTR_DISPATCH_STAT: u32 = 72; +pub const ASI_INTR_RECEIVE: u32 = 73; +pub const ASI_UPA_CONFIG: u32 = 74; +pub const ASI_JBUS_CONFIG: u32 = 74; +pub const ASI_SAFARI_CONFIG: u32 = 74; +pub const ASI_SAFARI_ADDRESS: u32 = 74; +pub const ASI_ESTATE_ERROR_EN: u32 = 75; +pub const ASI_AFSR: u32 = 76; +pub const ASI_AFAR: u32 = 77; +pub const ASI_EC_TAG_DATA: u32 = 78; +pub const ASI_IMMU: u32 = 80; +pub const ASI_IMMU_TSB_8KB_PTR: u32 = 81; +pub const ASI_IMMU_TSB_64KB_PTR: u32 = 82; +pub const ASI_ITLB_DATA_IN: u32 = 84; +pub const ASI_ITLB_DATA_ACCESS: u32 = 85; +pub const ASI_ITLB_TAG_READ: u32 = 86; +pub const ASI_IMMU_DEMAP: u32 = 87; +pub const ASI_DMMU: u32 = 88; +pub const ASI_DMMU_TSB_8KB_PTR: u32 = 89; +pub const ASI_DMMU_TSB_64KB_PTR: u32 = 90; +pub const ASI_DMMU_TSB_DIRECT_PTR: u32 = 91; +pub const ASI_DTLB_DATA_IN: u32 = 92; +pub const ASI_DTLB_DATA_ACCESS: u32 = 93; +pub const ASI_DTLB_TAG_READ: u32 = 94; +pub const ASI_DMMU_DEMAP: u32 = 95; +pub const ASI_IIU_INST_TRAP: u32 = 96; +pub const ASI_INTR_ID: u32 = 99; +pub const ASI_CORE_ID: u32 = 99; +pub const ASI_CESR_ID: u32 = 99; +pub const ASI_IC_INSTR: u32 = 102; +pub const ASI_IC_TAG: u32 = 103; +pub const ASI_IC_STAG: u32 = 104; +pub const ASI_IC_PRE_DECODE: u32 = 110; +pub const ASI_IC_NEXT_FIELD: u32 = 111; +pub const ASI_BRPRED_ARRAY: u32 = 111; +pub const ASI_BLK_AIUP: u32 = 112; +pub const ASI_BLK_AIUS: u32 = 113; +pub const ASI_MCU_CTRL_REG: u32 = 114; +pub const ASI_EC_DATA: u32 = 116; +pub const ASI_EC_CTRL: u32 = 117; +pub const ASI_EC_W: u32 = 118; +pub const ASI_UDB_ERROR_W: u32 = 119; +pub const ASI_UDB_CONTROL_W: u32 = 119; +pub const ASI_INTR_W: u32 = 119; +pub const ASI_INTR_DATAN_W: u32 = 119; +pub const ASI_INTR_DISPATCH_W: u32 = 119; +pub const ASI_BLK_AIUPL: u32 = 120; +pub const ASI_BLK_AIUSL: u32 = 121; +pub const ASI_EC_R: u32 = 126; +pub const ASI_UDBH_ERROR_R: u32 = 127; +pub const ASI_UDBL_ERROR_R: u32 = 127; +pub const ASI_UDBH_CONTROL_R: u32 = 127; +pub const ASI_UDBL_CONTROL_R: u32 = 127; +pub const ASI_INTR_R: u32 = 127; +pub const ASI_INTR_DATAN_R: u32 = 127; +pub const ASI_MCD_PRIMARY: u32 = 144; +pub const ASI_MCD_ST_BLKINIT_PRIMARY: u32 = 146; +pub const ASI_PIC: u32 = 176; +pub const ASI_PST8_P: u32 = 192; +pub const ASI_PST8_S: u32 = 193; +pub const ASI_PST16_P: u32 = 194; +pub const ASI_PST16_S: u32 = 195; +pub const ASI_PST32_P: u32 = 196; +pub const ASI_PST32_S: u32 = 197; +pub const ASI_PST8_PL: u32 = 200; +pub const ASI_PST8_SL: u32 = 201; +pub const ASI_PST16_PL: u32 = 202; +pub const ASI_PST16_SL: u32 = 203; +pub const ASI_PST32_PL: u32 = 204; +pub const ASI_PST32_SL: u32 = 205; +pub const ASI_FL8_P: u32 = 208; +pub const ASI_FL8_S: u32 = 209; +pub const ASI_FL16_P: u32 = 210; +pub const ASI_FL16_S: u32 = 211; +pub const ASI_FL8_PL: u32 = 216; +pub const ASI_FL8_SL: u32 = 217; +pub const ASI_FL16_PL: u32 = 218; +pub const ASI_FL16_SL: u32 = 219; +pub const ASI_BLK_COMMIT_P: u32 = 224; +pub const ASI_BLK_COMMIT_S: u32 = 225; +pub const ASI_BLK_INIT_QUAD_LDD_P: u32 = 226; +pub const ASI_BLK_INIT_QUAD_LDD_S: u32 = 227; +pub const ASI_BLK_P: u32 = 240; +pub const ASI_BLK_S: u32 = 241; +pub const ASI_ST_BLKINIT_MRU_P: u32 = 242; +pub const ASI_ST_BLKINIT_MRU_S: u32 = 243; +pub const ASI_BLK_PL: u32 = 248; +pub const ASI_BLK_SL: u32 = 249; +pub const ASI_ST_BLKINIT_MRU_PL: u32 = 250; +pub const ASI_ST_BLKINIT_MRU_SL: u32 = 251; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/sparc64/if_packet.rs b/vendor/linux-raw-sys/src/sparc64/if_packet.rs new file mode 100644 index 000000000..49ec61c6c --- /dev/null +++ b/vendor/linux-raw-sys/src/sparc64/if_packet.rs @@ -0,0 +1,529 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_suseconds_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_old_timeval { +pub tv_sec: __kernel_long_t, +pub tv_usec: __kernel_suseconds_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub type_flags: __u16, +pub id: __u16, +pub max_num_members: __u32, +} +pub const __BIG_ENDIAN: u32 = 4321; +pub const ASI_NULL1: u32 = 0; +pub const ASI_NULL2: u32 = 1; +pub const ASI_CONTROL: u32 = 2; +pub const ASI_SEGMAP: u32 = 3; +pub const ASI_PTE: u32 = 4; +pub const ASI_HWFLUSHSEG: u32 = 5; +pub const ASI_HWFLUSHPAGE: u32 = 6; +pub const ASI_REGMAP: u32 = 6; +pub const ASI_HWFLUSHCONTEXT: u32 = 7; +pub const ASI_USERTXT: u32 = 8; +pub const ASI_KERNELTXT: u32 = 9; +pub const ASI_USERDATA: u32 = 10; +pub const ASI_KERNELDATA: u32 = 11; +pub const ASI_FLUSHSEG: u32 = 12; +pub const ASI_FLUSHPG: u32 = 13; +pub const ASI_FLUSHCTX: u32 = 14; +pub const ASI_M_RES00: u32 = 0; +pub const ASI_M_UNA01: u32 = 1; +pub const ASI_M_MXCC: u32 = 2; +pub const ASI_M_FLUSH_PROBE: u32 = 3; +pub const ASI_M_MMUREGS: u32 = 4; +pub const ASI_M_TLBDIAG: u32 = 5; +pub const ASI_M_DIAGS: u32 = 6; +pub const ASI_M_IODIAG: u32 = 7; +pub const ASI_M_USERTXT: u32 = 8; +pub const ASI_M_KERNELTXT: u32 = 9; +pub const ASI_M_USERDATA: u32 = 10; +pub const ASI_M_KERNELDATA: u32 = 11; +pub const ASI_M_TXTC_TAG: u32 = 12; +pub const ASI_M_TXTC_DATA: u32 = 13; +pub const ASI_M_DATAC_TAG: u32 = 14; +pub const ASI_M_DATAC_DATA: u32 = 15; +pub const ASI_M_FLUSH_PAGE: u32 = 16; +pub const ASI_M_FLUSH_SEG: u32 = 17; +pub const ASI_M_FLUSH_REGION: u32 = 18; +pub const ASI_M_FLUSH_CTX: u32 = 19; +pub const ASI_M_FLUSH_USER: u32 = 20; +pub const ASI_M_BCOPY: u32 = 23; +pub const ASI_M_IFLUSH_PAGE: u32 = 24; +pub const ASI_M_IFLUSH_SEG: u32 = 25; +pub const ASI_M_IFLUSH_REGION: u32 = 26; +pub const ASI_M_IFLUSH_CTX: u32 = 27; +pub const ASI_M_IFLUSH_USER: u32 = 28; +pub const ASI_M_BFILL: u32 = 31; +pub const ASI_M_BYPASS: u32 = 32; +pub const ASI_M_FBMEM: u32 = 41; +pub const ASI_M_VMEUS: u32 = 42; +pub const ASI_M_VMEPS: u32 = 43; +pub const ASI_M_VMEUT: u32 = 44; +pub const ASI_M_VMEPT: u32 = 45; +pub const ASI_M_SBUS: u32 = 46; +pub const ASI_M_CTL: u32 = 47; +pub const ASI_M_FLUSH_IWHOLE: u32 = 49; +pub const ASI_M_IC_FLCLEAR: u32 = 54; +pub const ASI_M_DC_FLCLEAR: u32 = 55; +pub const ASI_M_DCDR: u32 = 57; +pub const ASI_M_VIKING_TMP1: u32 = 64; +pub const ASI_M_ACTION: u32 = 76; +pub const ASI_LEON_NOCACHE: u32 = 1; +pub const ASI_LEON_DCACHE_MISS: u32 = 1; +pub const ASI_LEON_CACHEREGS: u32 = 2; +pub const ASI_LEON_IFLUSH: u32 = 16; +pub const ASI_LEON_DFLUSH: u32 = 17; +pub const ASI_LEON_MMUFLUSH: u32 = 24; +pub const ASI_LEON_MMUREGS: u32 = 25; +pub const ASI_LEON_BYPASS: u32 = 28; +pub const ASI_LEON_FLUSH_PAGE: u32 = 16; +pub const ASI_N: u32 = 4; +pub const ASI_NL: u32 = 12; +pub const ASI_AIUP: u32 = 16; +pub const ASI_AIUS: u32 = 17; +pub const ASI_AIUPL: u32 = 24; +pub const ASI_AIUSL: u32 = 25; +pub const ASI_P: u32 = 128; +pub const ASI_S: u32 = 129; +pub const ASI_PNF: u32 = 130; +pub const ASI_SNF: u32 = 131; +pub const ASI_PL: u32 = 136; +pub const ASI_SL: u32 = 137; +pub const ASI_PNFL: u32 = 138; +pub const ASI_SNFL: u32 = 139; +pub const ASI_MCD_PRIV_PRIMARY: u32 = 2; +pub const ASI_MCD_REAL: u32 = 5; +pub const ASI_PHYS_USE_EC: u32 = 20; +pub const ASI_PHYS_BYPASS_EC_E: u32 = 21; +pub const ASI_BLK_AIUP_4V: u32 = 22; +pub const ASI_BLK_AIUS_4V: u32 = 23; +pub const ASI_PHYS_USE_EC_L: u32 = 28; +pub const ASI_PHYS_BYPASS_EC_E_L: u32 = 29; +pub const ASI_BLK_AIUP_L_4V: u32 = 30; +pub const ASI_BLK_AIUS_L_4V: u32 = 31; +pub const ASI_SCRATCHPAD: u32 = 32; +pub const ASI_MMU: u32 = 33; +pub const ASI_BLK_INIT_QUAD_LDD_AIUS: u32 = 35; +pub const ASI_NUCLEUS_QUAD_LDD: u32 = 36; +pub const ASI_QUEUE: u32 = 37; +pub const ASI_QUAD_LDD_PHYS_4V: u32 = 38; +pub const ASI_NUCLEUS_QUAD_LDD_L: u32 = 44; +pub const ASI_QUAD_LDD_PHYS_L_4V: u32 = 46; +pub const ASI_PCACHE_DATA_STATUS: u32 = 48; +pub const ASI_PCACHE_DATA: u32 = 49; +pub const ASI_PCACHE_TAG: u32 = 50; +pub const ASI_PCACHE_SNOOP_TAG: u32 = 51; +pub const ASI_QUAD_LDD_PHYS: u32 = 52; +pub const ASI_WCACHE_VALID_BITS: u32 = 56; +pub const ASI_WCACHE_DATA: u32 = 57; +pub const ASI_WCACHE_TAG: u32 = 58; +pub const ASI_WCACHE_SNOOP_TAG: u32 = 59; +pub const ASI_QUAD_LDD_PHYS_L: u32 = 60; +pub const ASI_SRAM_FAST_INIT: u32 = 64; +pub const ASI_CORE_AVAILABLE: u32 = 65; +pub const ASI_CORE_ENABLE_STAT: u32 = 65; +pub const ASI_CORE_ENABLE: u32 = 65; +pub const ASI_XIR_STEERING: u32 = 65; +pub const ASI_CORE_RUNNING_RW: u32 = 65; +pub const ASI_CORE_RUNNING_W1S: u32 = 65; +pub const ASI_CORE_RUNNING_W1C: u32 = 65; +pub const ASI_CORE_RUNNING_STAT: u32 = 65; +pub const ASI_CMT_ERROR_STEERING: u32 = 65; +pub const ASI_DCACHE_INVALIDATE: u32 = 66; +pub const ASI_DCACHE_UTAG: u32 = 67; +pub const ASI_DCACHE_SNOOP_TAG: u32 = 68; +pub const ASI_LSU_CONTROL: u32 = 69; +pub const ASI_DCU_CONTROL_REG: u32 = 69; +pub const ASI_DCACHE_DATA: u32 = 70; +pub const ASI_DCACHE_TAG: u32 = 71; +pub const ASI_INTR_DISPATCH_STAT: u32 = 72; +pub const ASI_INTR_RECEIVE: u32 = 73; +pub const ASI_UPA_CONFIG: u32 = 74; +pub const ASI_JBUS_CONFIG: u32 = 74; +pub const ASI_SAFARI_CONFIG: u32 = 74; +pub const ASI_SAFARI_ADDRESS: u32 = 74; +pub const ASI_ESTATE_ERROR_EN: u32 = 75; +pub const ASI_AFSR: u32 = 76; +pub const ASI_AFAR: u32 = 77; +pub const ASI_EC_TAG_DATA: u32 = 78; +pub const ASI_IMMU: u32 = 80; +pub const ASI_IMMU_TSB_8KB_PTR: u32 = 81; +pub const ASI_IMMU_TSB_64KB_PTR: u32 = 82; +pub const ASI_ITLB_DATA_IN: u32 = 84; +pub const ASI_ITLB_DATA_ACCESS: u32 = 85; +pub const ASI_ITLB_TAG_READ: u32 = 86; +pub const ASI_IMMU_DEMAP: u32 = 87; +pub const ASI_DMMU: u32 = 88; +pub const ASI_DMMU_TSB_8KB_PTR: u32 = 89; +pub const ASI_DMMU_TSB_64KB_PTR: u32 = 90; +pub const ASI_DMMU_TSB_DIRECT_PTR: u32 = 91; +pub const ASI_DTLB_DATA_IN: u32 = 92; +pub const ASI_DTLB_DATA_ACCESS: u32 = 93; +pub const ASI_DTLB_TAG_READ: u32 = 94; +pub const ASI_DMMU_DEMAP: u32 = 95; +pub const ASI_IIU_INST_TRAP: u32 = 96; +pub const ASI_INTR_ID: u32 = 99; +pub const ASI_CORE_ID: u32 = 99; +pub const ASI_CESR_ID: u32 = 99; +pub const ASI_IC_INSTR: u32 = 102; +pub const ASI_IC_TAG: u32 = 103; +pub const ASI_IC_STAG: u32 = 104; +pub const ASI_IC_PRE_DECODE: u32 = 110; +pub const ASI_IC_NEXT_FIELD: u32 = 111; +pub const ASI_BRPRED_ARRAY: u32 = 111; +pub const ASI_BLK_AIUP: u32 = 112; +pub const ASI_BLK_AIUS: u32 = 113; +pub const ASI_MCU_CTRL_REG: u32 = 114; +pub const ASI_EC_DATA: u32 = 116; +pub const ASI_EC_CTRL: u32 = 117; +pub const ASI_EC_W: u32 = 118; +pub const ASI_UDB_ERROR_W: u32 = 119; +pub const ASI_UDB_CONTROL_W: u32 = 119; +pub const ASI_INTR_W: u32 = 119; +pub const ASI_INTR_DATAN_W: u32 = 119; +pub const ASI_INTR_DISPATCH_W: u32 = 119; +pub const ASI_BLK_AIUPL: u32 = 120; +pub const ASI_BLK_AIUSL: u32 = 121; +pub const ASI_EC_R: u32 = 126; +pub const ASI_UDBH_ERROR_R: u32 = 127; +pub const ASI_UDBL_ERROR_R: u32 = 127; +pub const ASI_UDBH_CONTROL_R: u32 = 127; +pub const ASI_UDBL_CONTROL_R: u32 = 127; +pub const ASI_INTR_R: u32 = 127; +pub const ASI_INTR_DATAN_R: u32 = 127; +pub const ASI_MCD_PRIMARY: u32 = 144; +pub const ASI_MCD_ST_BLKINIT_PRIMARY: u32 = 146; +pub const ASI_PIC: u32 = 176; +pub const ASI_PST8_P: u32 = 192; +pub const ASI_PST8_S: u32 = 193; +pub const ASI_PST16_P: u32 = 194; +pub const ASI_PST16_S: u32 = 195; +pub const ASI_PST32_P: u32 = 196; +pub const ASI_PST32_S: u32 = 197; +pub const ASI_PST8_PL: u32 = 200; +pub const ASI_PST8_SL: u32 = 201; +pub const ASI_PST16_PL: u32 = 202; +pub const ASI_PST16_SL: u32 = 203; +pub const ASI_PST32_PL: u32 = 204; +pub const ASI_PST32_SL: u32 = 205; +pub const ASI_FL8_P: u32 = 208; +pub const ASI_FL8_S: u32 = 209; +pub const ASI_FL16_P: u32 = 210; +pub const ASI_FL16_S: u32 = 211; +pub const ASI_FL8_PL: u32 = 216; +pub const ASI_FL8_SL: u32 = 217; +pub const ASI_FL16_PL: u32 = 218; +pub const ASI_FL16_SL: u32 = 219; +pub const ASI_BLK_COMMIT_P: u32 = 224; +pub const ASI_BLK_COMMIT_S: u32 = 225; +pub const ASI_BLK_INIT_QUAD_LDD_P: u32 = 226; +pub const ASI_BLK_INIT_QUAD_LDD_S: u32 = 227; +pub const ASI_BLK_P: u32 = 240; +pub const ASI_BLK_S: u32 = 241; +pub const ASI_ST_BLKINIT_MRU_P: u32 = 242; +pub const ASI_ST_BLKINIT_MRU_S: u32 = 243; +pub const ASI_BLK_PL: u32 = 248; +pub const ASI_BLK_SL: u32 = 249; +pub const ASI_ST_BLKINIT_MRU_PL: u32 = 250; +pub const ASI_ST_BLKINIT_MRU_SL: u32 = 251; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/x32/if_packet.rs b/vendor/linux-raw-sys/src/x32/if_packet.rs new file mode 100644 index 000000000..f2e068686 --- /dev/null +++ b/vendor/linux-raw-sys/src/x32/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_longlong; +pub type __kernel_ulong_t = crate::ctypes::c_ulonglong; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/x86/if_packet.rs b/vendor/linux-raw-sys/src/x86/if_packet.rs new file mode 100644 index 000000000..540857fc8 --- /dev/null +++ b/vendor/linux-raw-sys/src/x86/if_packet.rs @@ -0,0 +1,309 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/linux-raw-sys/src/x86_64/if_packet.rs b/vendor/linux-raw-sys/src/x86_64/if_packet.rs new file mode 100644 index 000000000..c10d8fb19 --- /dev/null +++ b/vendor/linux-raw-sys/src/x86_64/if_packet.rs @@ -0,0 +1,307 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_pkt { +pub spkt_family: crate::ctypes::c_ushort, +pub spkt_device: [crate::ctypes::c_uchar; 14usize], +pub spkt_protocol: __be16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_ll { +pub sll_family: crate::ctypes::c_ushort, +pub sll_protocol: __be16, +pub sll_ifindex: crate::ctypes::c_int, +pub sll_hatype: crate::ctypes::c_ushort, +pub sll_pkttype: crate::ctypes::c_uchar, +pub sll_halen: crate::ctypes::c_uchar, +pub sll_addr: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_stats_v3 { +pub tp_packets: crate::ctypes::c_uint, +pub tp_drops: crate::ctypes::c_uint, +pub tp_freeze_q_cnt: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_rollover_stats { +pub tp_all: __u64, +pub tp_huge: __u64, +pub tp_failed: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_auxdata { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr { +pub tp_status: crate::ctypes::c_ulong, +pub tp_len: crate::ctypes::c_uint, +pub tp_snaplen: crate::ctypes::c_uint, +pub tp_mac: crate::ctypes::c_ushort, +pub tp_net: crate::ctypes::c_ushort, +pub tp_sec: crate::ctypes::c_uint, +pub tp_usec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket2_hdr { +pub tp_status: __u32, +pub tp_len: __u32, +pub tp_snaplen: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_vlan_tci: __u16, +pub tp_vlan_tpid: __u16, +pub tp_padding: [__u8; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_hdr_variant1 { +pub tp_rxhash: __u32, +pub tp_vlan_tci: __u32, +pub tp_vlan_tpid: __u16, +pub tp_padding: __u16, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket3_hdr { +pub tp_next_offset: __u32, +pub tp_sec: __u32, +pub tp_nsec: __u32, +pub tp_snaplen: __u32, +pub tp_len: __u32, +pub tp_status: __u32, +pub tp_mac: __u16, +pub tp_net: __u16, +pub __bindgen_anon_1: tpacket3_hdr__bindgen_ty_1, +pub tp_padding: [__u8; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_bd_ts { +pub ts_sec: crate::ctypes::c_uint, +pub __bindgen_anon_1: tpacket_bd_ts__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_hdr_v1 { +pub block_status: __u32, +pub num_pkts: __u32, +pub offset_to_first_pkt: __u32, +pub blk_len: __u32, +pub seq_num: __u64, +pub ts_first_pkt: tpacket_bd_ts, +pub ts_last_pkt: tpacket_bd_ts, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tpacket_block_desc { +pub version: __u32, +pub offset_to_priv: __u32, +pub hdr: tpacket_bd_header_u, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tpacket_req3 { +pub tp_block_size: crate::ctypes::c_uint, +pub tp_block_nr: crate::ctypes::c_uint, +pub tp_frame_size: crate::ctypes::c_uint, +pub tp_frame_nr: crate::ctypes::c_uint, +pub tp_retire_blk_tov: crate::ctypes::c_uint, +pub tp_sizeof_priv: crate::ctypes::c_uint, +pub tp_feature_req_word: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct packet_mreq { +pub mr_ifindex: crate::ctypes::c_int, +pub mr_type: crate::ctypes::c_ushort, +pub mr_alen: crate::ctypes::c_ushort, +pub mr_address: [crate::ctypes::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fanout_args { +pub id: __u16, +pub type_flags: __u16, +pub max_num_members: __u32, +} +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PACKET_HOST: u32 = 0; +pub const PACKET_BROADCAST: u32 = 1; +pub const PACKET_MULTICAST: u32 = 2; +pub const PACKET_OTHERHOST: u32 = 3; +pub const PACKET_OUTGOING: u32 = 4; +pub const PACKET_LOOPBACK: u32 = 5; +pub const PACKET_USER: u32 = 6; +pub const PACKET_KERNEL: u32 = 7; +pub const PACKET_FASTROUTE: u32 = 6; +pub const PACKET_ADD_MEMBERSHIP: u32 = 1; +pub const PACKET_DROP_MEMBERSHIP: u32 = 2; +pub const PACKET_RECV_OUTPUT: u32 = 3; +pub const PACKET_RX_RING: u32 = 5; +pub const PACKET_STATISTICS: u32 = 6; +pub const PACKET_COPY_THRESH: u32 = 7; +pub const PACKET_AUXDATA: u32 = 8; +pub const PACKET_ORIGDEV: u32 = 9; +pub const PACKET_VERSION: u32 = 10; +pub const PACKET_HDRLEN: u32 = 11; +pub const PACKET_RESERVE: u32 = 12; +pub const PACKET_TX_RING: u32 = 13; +pub const PACKET_LOSS: u32 = 14; +pub const PACKET_VNET_HDR: u32 = 15; +pub const PACKET_TX_TIMESTAMP: u32 = 16; +pub const PACKET_TIMESTAMP: u32 = 17; +pub const PACKET_FANOUT: u32 = 18; +pub const PACKET_TX_HAS_OFF: u32 = 19; +pub const PACKET_QDISC_BYPASS: u32 = 20; +pub const PACKET_ROLLOVER_STATS: u32 = 21; +pub const PACKET_FANOUT_DATA: u32 = 22; +pub const PACKET_IGNORE_OUTGOING: u32 = 23; +pub const PACKET_FANOUT_HASH: u32 = 0; +pub const PACKET_FANOUT_LB: u32 = 1; +pub const PACKET_FANOUT_CPU: u32 = 2; +pub const PACKET_FANOUT_ROLLOVER: u32 = 3; +pub const PACKET_FANOUT_RND: u32 = 4; +pub const PACKET_FANOUT_QM: u32 = 5; +pub const PACKET_FANOUT_CBPF: u32 = 6; +pub const PACKET_FANOUT_EBPF: u32 = 7; +pub const PACKET_FANOUT_FLAG_ROLLOVER: u32 = 4096; +pub const PACKET_FANOUT_FLAG_UNIQUEID: u32 = 8192; +pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: u32 = 16384; +pub const PACKET_FANOUT_FLAG_DEFRAG: u32 = 32768; +pub const TP_STATUS_KERNEL: u32 = 0; +pub const TP_STATUS_USER: u32 = 1; +pub const TP_STATUS_COPY: u32 = 2; +pub const TP_STATUS_LOSING: u32 = 4; +pub const TP_STATUS_CSUMNOTREADY: u32 = 8; +pub const TP_STATUS_VLAN_VALID: u32 = 16; +pub const TP_STATUS_BLK_TMO: u32 = 32; +pub const TP_STATUS_VLAN_TPID_VALID: u32 = 64; +pub const TP_STATUS_CSUM_VALID: u32 = 128; +pub const TP_STATUS_GSO_TCP: u32 = 256; +pub const TP_STATUS_AVAILABLE: u32 = 0; +pub const TP_STATUS_SEND_REQUEST: u32 = 1; +pub const TP_STATUS_SENDING: u32 = 2; +pub const TP_STATUS_WRONG_FORMAT: u32 = 4; +pub const TP_STATUS_TS_SOFTWARE: u32 = 536870912; +pub const TP_STATUS_TS_SYS_HARDWARE: u32 = 1073741824; +pub const TP_STATUS_TS_RAW_HARDWARE: u32 = 2147483648; +pub const TP_FT_REQ_FILL_RXHASH: u32 = 1; +pub const TPACKET_ALIGNMENT: u32 = 16; +pub const PACKET_MR_MULTICAST: u32 = 0; +pub const PACKET_MR_PROMISC: u32 = 1; +pub const PACKET_MR_ALLMULTI: u32 = 2; +pub const PACKET_MR_UNICAST: u32 = 3; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum tpacket_versions { +TPACKET_V1 = 0, +TPACKET_V2 = 1, +TPACKET_V3 = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_stats_u { +pub stats1: tpacket_stats, +pub stats3: tpacket_stats_v3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket3_hdr__bindgen_ty_1 { +pub hv1: tpacket_hdr_variant1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_ts__bindgen_ty_1 { +pub ts_usec: crate::ctypes::c_uint, +pub ts_nsec: crate::ctypes::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_bd_header_u { +pub bh1: tpacket_hdr_v1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tpacket_req_u { +pub req: tpacket_req, +pub req3: tpacket_req3, +} diff --git a/vendor/memchr/.cargo-checksum.json b/vendor/memchr/.cargo-checksum.json index 3b8044fe3..4b915f333 100644 --- a/vendor/memchr/.cargo-checksum.json +++ b/vendor/memchr/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"a56f004ee16ebce155f8a2ebbde8f5bbc8045e3d46e73828e5db15a008cede12","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"898ebf0019a21a33fa869de1b40ba35041798f553d883f016e976658866e95bd","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/arch/aarch64/memchr.rs":"5bb70f915084e629d940dbc322f5b9096b2e658cf63fea8a2f6e7550412e73a0","src/arch/aarch64/mod.rs":"44cd1a614bd66f1e66fc86c541d3c3b8d3a14a644c13e8bf816df3f555eac2d4","src/arch/aarch64/neon/memchr.rs":"e8c00b8fb2c7e2711832ae3cedefe59f32ebedd7dfa4d0ec6de2a566c979daea","src/arch/aarch64/neon/mod.rs":"eab6d56c2b2354db4ee395f40282cd49f97e2ab853547be5de6e65fbe1b2f634","src/arch/aarch64/neon/packedpair.rs":"fbdfdbfaf7b76b234db261fbe55a55c4479d32cdc65a654d60417c2d1c237849","src/arch/all/memchr.rs":"f6c51e50309f80e749887572297aa5efc19a3c7e5434b4404a101b3e6b152be1","src/arch/all/mod.rs":"b3190c1c48b23efe4b5e320aebdf8f0260a2cb2f63c0deba95ad0ef8219695d7","src/arch/all/packedpair/default_rank.rs":"abffd1b5b8b7a3be95c03dd1105b905c246a379854dc56f1e846ea7c4408f2c7","src/arch/all/packedpair/mod.rs":"292b66042c5b5c78bba33db6526aeae6904db803d601fcdd29032b87b3eb3754","src/arch/all/rabinkarp.rs":"236f69c04b90c14c253ae6c8d9b78150b4a56df75bb50af6d63b15145668b7cc","src/arch/all/shiftor.rs":"0d79117f52a1e4795843603a3bb0b45397df4ad5e4184bbc923658dab9dc3b5f","src/arch/all/twoway.rs":"47c97a265bfbafde90a618946643d3e97dfd9a85f01aa4ac758cd4c1573a450d","src/arch/generic/memchr.rs":"88290761bab740878401e914d71866da6501cdcef53d1249ec6fda4c7f9c12ae","src/arch/generic/mod.rs":"1dd75f61e0ea2563b8205a08aaa7b55500130aa331d18b9e9f995724b66c7a39","src/arch/generic/packedpair.rs":"a4a6efb29877ced9cf4c4e5ae9f36a79f019a16b831f2b9424899a1513d458ad","src/arch/mod.rs":"6dbd9e0b1b89fecb9faac5df6edfc87e24607e9099136aa831f3f056b14e22db","src/arch/wasm32/memchr.rs":"bfaaeca702cc32e605a06d5078d26ac59263d3c4eb04f9756e6be5e2850c3d0d","src/arch/wasm32/mod.rs":"a20377aa8fe07d68594879101dc73061e4f51d9c8d812b593b1f376e3c8add79","src/arch/wasm32/simd128/memchr.rs":"bac2c4c43fe710c83a6f2b1118fede043be89dd821d4b532907f129f09fdb5cf","src/arch/wasm32/simd128/mod.rs":"c157b373faedbfd65323be432e25bc411d97aa1b7bc58e76048614c7b2bf3bf6","src/arch/wasm32/simd128/packedpair.rs":"47e7875f1a0b502f3f30ddfd9257ed7ad4568fb7d968b5e6c01ba9e2aab2a459","src/arch/x86_64/avx2/memchr.rs":"576ec0c30f49874f7fd9f6caeb490d56132c0fbbaa4d877b1aa532cafce19323","src/arch/x86_64/avx2/mod.rs":"0033d1b712d0b10f0f273ef9aa8caa53e05e49f4c56a64f39af0b9df97eec584","src/arch/x86_64/avx2/packedpair.rs":"87b69cb4301815906127db4f6370f572c7c5d5dad35c0946c00ad888dbcaec8c","src/arch/x86_64/memchr.rs":"99a1dbe4156d498e6f910d06d3d3b31e7f6d06dff7d13a4c51b33a02b7e2fba9","src/arch/x86_64/mod.rs":"61b2aa876942fd3e78714c2ae21e356c8634545c06995020f443fa50218df027","src/arch/x86_64/sse2/memchr.rs":"68fc3b8f9eddf82192979c3aa11e5141f085cbb993c49c340558719a904679dc","src/arch/x86_64/sse2/mod.rs":"38b70ae52a64ec974dbb91d04d6ca8013d9e06d1fe4af852206bbc2faf1c59aa","src/arch/x86_64/sse2/packedpair.rs":"241ea981d8eea6024769f1c9375f726a9bb9700160c5857781d4befd9f5ef55d","src/cow.rs":"34eddd02cb82cc2d5a2c640891d64efe332dabcc1eea5115764200d8f46b66f7","src/ext.rs":"c472bcc41a7ef48980d976e954e87ef9fdfdfd30ac0199b959cc7e5b9d563ab3","src/lib.rs":"4e56613894535a80d669dda77697fb8c23769ede5e3fcedc5d999617b5b1d094","src/macros.rs":"3e4b39252bfa471fad384160a43f113ebfec7bec46a85d16f006622881dd2081","src/memchr.rs":"36f1c03304261877cd7f75c7ed8f7daff7a5c570cedce375e38e9b1ca44467f7","src/memmem/mod.rs":"7297b60ac7d7cb50ba44bf58a7cde7d32819237f2ec45f311d20bfe9379d4c78","src/memmem/searcher.rs":"69c38fb33d8f1a2a26769a81e514428240c8f8f15cea5302873d90b80391dd89","src/tests/memchr/mod.rs":"269f8e4b4f7f5ea458f27a3c174eb1020ffb2484eeba9464170beb51747df69b","src/tests/memchr/naive.rs":"6a0bee033e5edfb5b1d5769a5fa1c78388f7e9ff7bb91cb67f0ad029289e00e7","src/tests/memchr/prop.rs":"7bf7435087fbf08c5014c216b76575349735590d6b1d0e448921a1dc17bc0ea7","src/tests/mod.rs":"7cec8f809e279310a465c6a7725087970f219a676cc76c83de30c695bb490740","src/tests/packedpair.rs":"b02ec4fbb61a8653cb5f2268c31bc9168b8043347f2abdcc74081acf83b98e15","src/tests/substring/mod.rs":"c7660d10749363ac4687e7da2b5fda60768230425df8ba416c0c28b8d56a5c74","src/tests/substring/naive.rs":"df6f55d165382b8a53762ba4c324926cac13ebc62cde1805f4ce08740b326483","src/tests/substring/prop.rs":"38c15992609b5681a95d838ae6f2933e00a1219f2c971bfba245f96e0729fcdc","src/tests/x86_64-soft_float.json":"c0e416487fe9b4809534edb7db2a9eff3453dc40d9f1e23362c37f45a77ec717","src/vector.rs":"ef823ae8c54053780a0e7aeaee14b6c6ac2aea4567bf701ae8be137806c6d293"},"package":"f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"} \ No newline at end of file +{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"8f521805349c8df78da2ccaeec8b48f2f9fa1667887aaf89950ae555cbf6f8b2","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"92a74aaffe011bdaa06fbc34a01686a6eba58ca1322e976759417a547fddf734","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/arch/aarch64/memchr.rs":"5bb70f915084e629d940dbc322f5b9096b2e658cf63fea8a2f6e7550412e73a0","src/arch/aarch64/mod.rs":"44cd1a614bd66f1e66fc86c541d3c3b8d3a14a644c13e8bf816df3f555eac2d4","src/arch/aarch64/neon/memchr.rs":"e8c00b8fb2c7e2711832ae3cedefe59f32ebedd7dfa4d0ec6de2a566c979daea","src/arch/aarch64/neon/mod.rs":"eab6d56c2b2354db4ee395f40282cd49f97e2ab853547be5de6e65fbe1b2f634","src/arch/aarch64/neon/packedpair.rs":"fbdfdbfaf7b76b234db261fbe55a55c4479d32cdc65a654d60417c2d1c237849","src/arch/all/memchr.rs":"f6c51e50309f80e749887572297aa5efc19a3c7e5434b4404a101b3e6b152be1","src/arch/all/mod.rs":"05f3fc2b069682eb1545fc6366d167bb620a454365dac8b8dd6cde6cd64de18a","src/arch/all/packedpair/default_rank.rs":"abffd1b5b8b7a3be95c03dd1105b905c246a379854dc56f1e846ea7c4408f2c7","src/arch/all/packedpair/mod.rs":"292b66042c5b5c78bba33db6526aeae6904db803d601fcdd29032b87b3eb3754","src/arch/all/rabinkarp.rs":"236f69c04b90c14c253ae6c8d9b78150b4a56df75bb50af6d63b15145668b7cc","src/arch/all/shiftor.rs":"0d79117f52a1e4795843603a3bb0b45397df4ad5e4184bbc923658dab9dc3b5f","src/arch/all/twoway.rs":"47c97a265bfbafde90a618946643d3e97dfd9a85f01aa4ac758cd4c1573a450d","src/arch/generic/memchr.rs":"88290761bab740878401e914d71866da6501cdcef53d1249ec6fda4c7f9c12ae","src/arch/generic/mod.rs":"1dd75f61e0ea2563b8205a08aaa7b55500130aa331d18b9e9f995724b66c7a39","src/arch/generic/packedpair.rs":"a4a6efb29877ced9cf4c4e5ae9f36a79f019a16b831f2b9424899a1513d458ad","src/arch/mod.rs":"6dbd9e0b1b89fecb9faac5df6edfc87e24607e9099136aa831f3f056b14e22db","src/arch/wasm32/memchr.rs":"bfaaeca702cc32e605a06d5078d26ac59263d3c4eb04f9756e6be5e2850c3d0d","src/arch/wasm32/mod.rs":"a20377aa8fe07d68594879101dc73061e4f51d9c8d812b593b1f376e3c8add79","src/arch/wasm32/simd128/memchr.rs":"bac2c4c43fe710c83a6f2b1118fede043be89dd821d4b532907f129f09fdb5cf","src/arch/wasm32/simd128/mod.rs":"c157b373faedbfd65323be432e25bc411d97aa1b7bc58e76048614c7b2bf3bf6","src/arch/wasm32/simd128/packedpair.rs":"47e7875f1a0b502f3f30ddfd9257ed7ad4568fb7d968b5e6c01ba9e2aab2a459","src/arch/x86_64/avx2/memchr.rs":"576ec0c30f49874f7fd9f6caeb490d56132c0fbbaa4d877b1aa532cafce19323","src/arch/x86_64/avx2/mod.rs":"0033d1b712d0b10f0f273ef9aa8caa53e05e49f4c56a64f39af0b9df97eec584","src/arch/x86_64/avx2/packedpair.rs":"87b69cb4301815906127db4f6370f572c7c5d5dad35c0946c00ad888dbcaec8c","src/arch/x86_64/memchr.rs":"99a1dbe4156d498e6f910d06d3d3b31e7f6d06dff7d13a4c51b33a02b7e2fba9","src/arch/x86_64/mod.rs":"61b2aa876942fd3e78714c2ae21e356c8634545c06995020f443fa50218df027","src/arch/x86_64/sse2/memchr.rs":"68fc3b8f9eddf82192979c3aa11e5141f085cbb993c49c340558719a904679dc","src/arch/x86_64/sse2/mod.rs":"38b70ae52a64ec974dbb91d04d6ca8013d9e06d1fe4af852206bbc2faf1c59aa","src/arch/x86_64/sse2/packedpair.rs":"241ea981d8eea6024769f1c9375f726a9bb9700160c5857781d4befd9f5ef55d","src/cow.rs":"34eddd02cb82cc2d5a2c640891d64efe332dabcc1eea5115764200d8f46b66f7","src/ext.rs":"c472bcc41a7ef48980d976e954e87ef9fdfdfd30ac0199b959cc7e5b9d563ab3","src/lib.rs":"22509be5f0c201773ee26bb21bf5c0491e287c4414c02b7faa6ea5177ce0f32f","src/macros.rs":"3e4b39252bfa471fad384160a43f113ebfec7bec46a85d16f006622881dd2081","src/memchr.rs":"36f1c03304261877cd7f75c7ed8f7daff7a5c570cedce375e38e9b1ca44467f7","src/memmem/mod.rs":"1b0a9d6a681fd0887c677c4fc8d4c8f9719ddde250bdd5ea545365c1a7fb9094","src/memmem/searcher.rs":"69c38fb33d8f1a2a26769a81e514428240c8f8f15cea5302873d90b80391dd89","src/tests/memchr/mod.rs":"269f8e4b4f7f5ea458f27a3c174eb1020ffb2484eeba9464170beb51747df69b","src/tests/memchr/naive.rs":"6a0bee033e5edfb5b1d5769a5fa1c78388f7e9ff7bb91cb67f0ad029289e00e7","src/tests/memchr/prop.rs":"7bf7435087fbf08c5014c216b76575349735590d6b1d0e448921a1dc17bc0ea7","src/tests/mod.rs":"7cec8f809e279310a465c6a7725087970f219a676cc76c83de30c695bb490740","src/tests/packedpair.rs":"b02ec4fbb61a8653cb5f2268c31bc9168b8043347f2abdcc74081acf83b98e15","src/tests/substring/mod.rs":"c7660d10749363ac4687e7da2b5fda60768230425df8ba416c0c28b8d56a5c74","src/tests/substring/naive.rs":"df6f55d165382b8a53762ba4c324926cac13ebc62cde1805f4ce08740b326483","src/tests/substring/prop.rs":"38c15992609b5681a95d838ae6f2933e00a1219f2c971bfba245f96e0729fcdc","src/tests/x86_64-soft_float.json":"c0e416487fe9b4809534edb7db2a9eff3453dc40d9f1e23362c37f45a77ec717","src/vector.rs":"ef823ae8c54053780a0e7aeaee14b6c6ac2aea4567bf701ae8be137806c6d293"},"package":"523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"} \ No newline at end of file diff --git a/vendor/memchr/Cargo.toml b/vendor/memchr/Cargo.toml index 394d85dbb..9e95051a0 100644 --- a/vendor/memchr/Cargo.toml +++ b/vendor/memchr/Cargo.toml @@ -13,15 +13,14 @@ edition = "2021" rust-version = "1.61" name = "memchr" -version = "2.6.4" +version = "2.7.1" authors = [ "Andrew Gallant ", "bluss", ] exclude = [ - "/bench", - "/benchmarks", "/.github", + "/benchmarks", "/fuzz", "/scripts", "/tmp", diff --git a/vendor/memchr/README.md b/vendor/memchr/README.md index fe44625e3..db00ebbc9 100644 --- a/vendor/memchr/README.md +++ b/vendor/memchr/README.md @@ -94,3 +94,103 @@ has a few different algorithms to choose from depending on the situation. is used. If possible, a prefilter based on the "Generic SIMD" algorithm linked above is used to find candidates quickly. A dynamic heuristic is used to detect if the prefilter is ineffective, and if so, disables it. + + +### Why is the standard library's substring search so much slower? + +We'll start by establishing what the difference in performance actually +is. There are two relevant benchmark classes to consider: `prebuilt` and +`oneshot`. The `prebuilt` benchmarks are designed to measure---to the extent +possible---search time only. That is, the benchmark first starts by building a +searcher and then only tracking the time for _using_ the searcher: + +``` +$ rebar rank benchmarks/record/x86_64/2023-08-26.csv --intersection -e memchr/memmem/prebuilt -e std/memmem/prebuilt +Engine Version Geometric mean of speed ratios Benchmark count +------ ------- ------------------------------ --------------- +rust/memchr/memmem/prebuilt 2.5.0 1.03 53 +rust/std/memmem/prebuilt 1.73.0-nightly 180dffba1 6.50 53 +``` + +Conversely, the `oneshot` benchmark class measures the time it takes to both +build the searcher _and_ use it: + +``` +$ rebar rank benchmarks/record/x86_64/2023-08-26.csv --intersection -e memchr/memmem/oneshot -e std/memmem/oneshot +Engine Version Geometric mean of speed ratios Benchmark count +------ ------- ------------------------------ --------------- +rust/memchr/memmem/oneshot 2.5.0 1.04 53 +rust/std/memmem/oneshot 1.73.0-nightly 180dffba1 5.26 53 +``` + +**NOTE:** Replace `rebar rank` with `rebar cmp` in the above commands to +explore the specific benchmarks and their differences. + +So in both cases, this crate is quite a bit faster over a broad sampling of +benchmarks regardless of whether you measure only search time or search time +plus construction time. The difference is a little smaller when you include +construction time in your measurements. + +These two different types of benchmark classes make for a nice segue into +one reason why the standard library's substring search can be slower: API +design. In the standard library, the only APIs available to you require +one to re-construct the searcher for every search. While you can benefit +from building a searcher once and iterating over all matches in a single +string, you cannot reuse that searcher to search other strings. This might +come up when, for example, searching a file one line at a time. You'll need +to re-build the searcher for every line searched, and this can [really +matter][burntsushi-bstr-blog]. + +**NOTE:** The `prebuilt` benchmark for the standard library can't actually +avoid measuring searcher construction at some level, because there is no API +for it. Instead, the benchmark consists of building the searcher once and then +finding all matches in a single string via an iterator. This tends to +approximate a benchmark where searcher construction isn't measured, but it +isn't perfect. While this means the comparison is not strictly +apples-to-apples, it does reflect what is maximally possible with the standard +library, and thus reflects the best that one could do in a real world scenario. + +While there is more to the story than just API design here, it's important to +point out that even if the standard library's substring search were a precise +clone of this crate internally, it would still be at a disadvantage in some +workloads because of its API. (The same also applies to C's standard library +`memmem` function. There is no way to amortize construction of the searcher. +You need to pay for it on every call.) + +The other reason for the difference in performance is that +the standard library has trouble using SIMD. In particular, substring search +is implemented in the `core` library, where platform specific code generally +can't exist. That's an issue because in order to utilize SIMD beyond SSE2 +while maintaining portable binaries, one needs to use [dynamic CPU feature +detection][dynamic-cpu], and that in turn requires platform specific code. +While there is [an RFC for enabling target feature detection in +`core`][core-feature], it doesn't yet exist. + +The bottom line here is that `core`'s substring search implementation is +limited to making use of SSE2, but not AVX. + +Still though, this crate does accelerate substring search even when only SSE2 +is available. The standard library could therefore adopt the techniques in this +crate just for SSE2. The reason why that hasn't happened yet isn't totally +clear to me. It likely needs a champion to push it through. The standard +library tends to be more conservative in these things. With that said, the +standard library does use some [SSE2 acceleration on `x86-64`][std-sse2] added +in [this PR][std-sse2-pr]. However, at the time of writing, it is only used +for short needles and doesn't use the frequency based heuristics found in this +crate. + +**NOTE:** Another thing worth mentioning is that the standard library's +substring search routine requires that both the needle and haystack have type +`&str`. Unless you can assume that your data is valid UTF-8, building a `&str` +will come with the overhead of UTF-8 validation. This may in turn result in +overall slower searching depending on your workload. In contrast, the `memchr` +crate permits both the needle and the haystack to have type `&[u8]`, where +`&[u8]` can be created from a `&str` with zero cost. Therefore, the substring +search in this crate is strictly more flexible than what the standard library +provides. + +[burntsushi-bstr-blog]: https://blog.burntsushi.net/bstr/#motivation-based-on-performance +[dynamic-cpu]: https://doc.rust-lang.org/std/arch/index.html#dynamic-cpu-feature-detection +[core-feature]: https://github.com/rust-lang/rfcs/pull/3469 +[std-sse2]: https://github.com/rust-lang/rust/blob/bf9229a2e366b4c311f059014a4aa08af16de5d8/library/core/src/str/pattern.rs#L1719-L1857 +[std-sse2-pr]: https://github.com/rust-lang/rust/pull/103779 diff --git a/vendor/memchr/src/arch/all/mod.rs b/vendor/memchr/src/arch/all/mod.rs index b3d0ca2e9..559cb7510 100644 --- a/vendor/memchr/src/arch/all/mod.rs +++ b/vendor/memchr/src/arch/all/mod.rs @@ -108,26 +108,8 @@ pub fn is_equal(x: &[u8], y: &[u8]) -> bool { pub unsafe fn is_equal_raw( mut x: *const u8, mut y: *const u8, - n: usize, + mut n: usize, ) -> bool { - // If we don't have enough bytes to do 4-byte at a time loads, then - // handle each possible length specially. Note that I used to have a - // byte-at-a-time loop here and that turned out to be quite a bit slower - // for the memmem/pathological/defeat-simple-vector-alphabet benchmark. - if n < 4 { - return match n { - 0 => true, - 1 => x.read() == y.read(), - 2 => { - x.cast::().read_unaligned() - == y.cast::().read_unaligned() - } - // I also tried copy_nonoverlapping here and it looks like the - // codegen is the same. - 3 => x.cast::<[u8; 3]>().read() == y.cast::<[u8; 3]>().read(), - _ => unreachable!(), - }; - } // When we have 4 or more bytes to compare, then proceed in chunks of 4 at // a time using unaligned loads. // @@ -143,9 +125,7 @@ pub unsafe fn is_equal_raw( // valid and readable for at least `n` bytes. We also do unaligned loads, // so there's no need to ensure we're aligned. (This is justified by this // routine being specifically for short strings.) - let xend = x.add(n.wrapping_sub(4)); - let yend = y.add(n.wrapping_sub(4)); - while x < xend { + while n >= 4 { let vx = x.cast::().read_unaligned(); let vy = y.cast::().read_unaligned(); if vx != vy { @@ -153,10 +133,28 @@ pub unsafe fn is_equal_raw( } x = x.add(4); y = y.add(4); + n -= 4; } - let vx = xend.cast::().read_unaligned(); - let vy = yend.cast::().read_unaligned(); - vx == vy + // If we don't have enough bytes to do 4-byte at a time loads, then + // do partial loads. Note that I used to have a byte-at-a-time + // loop here and that turned out to be quite a bit slower for the + // memmem/pathological/defeat-simple-vector-alphabet benchmark. + if n >= 2 { + let vx = x.cast::().read_unaligned(); + let vy = y.cast::().read_unaligned(); + if vx != vy { + return false; + } + x = x.add(2); + y = y.add(2); + n -= 2; + } + if n > 0 { + if x.read() != y.read() { + return false; + } + } + true } #[cfg(test)] diff --git a/vendor/memchr/src/lib.rs b/vendor/memchr/src/lib.rs index 05b2c13f9..de366fb3e 100644 --- a/vendor/memchr/src/lib.rs +++ b/vendor/memchr/src/lib.rs @@ -146,7 +146,7 @@ will also use AVX2 accelerated routines when the `avx2` feature is enabled at compile time. In general, enable this feature if you can. * **alloc** - When enabled (the default), APIs in this crate requiring some kind of allocation will become available. For example, the -[`memmem::Finder::into_ownedd`](crate::memmem::Finder::into_owned) API and the +[`memmem::Finder::into_owned`](crate::memmem::Finder::into_owned) API and the [`arch::all::shiftor`](crate::arch::all::shiftor) substring search implementation. Otherwise, this crate is designed from the ground up to be usable in core-only contexts, so the `alloc` feature doesn't add much diff --git a/vendor/memchr/src/memmem/mod.rs b/vendor/memchr/src/memmem/mod.rs index 1a2a7e10c..4f04943e6 100644 --- a/vendor/memchr/src/memmem/mod.rs +++ b/vendor/memchr/src/memmem/mod.rs @@ -233,7 +233,7 @@ pub fn rfind(haystack: &[u8], needle: &[u8]) -> Option { /// /// `'h` is the lifetime of the haystack while `'n` is the lifetime of the /// needle. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct FindIter<'h, 'n> { haystack: &'h [u8], prestate: PrefilterState, @@ -310,7 +310,7 @@ impl<'h, 'n> Iterator for FindIter<'h, 'n> { /// /// `'h` is the lifetime of the haystack while `'n` is the lifetime of the /// needle. -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct FindRevIter<'h, 'n> { haystack: &'h [u8], finder: FinderRev<'n>, diff --git a/vendor/mio/.cargo-checksum.json b/vendor/mio/.cargo-checksum.json index 6b8504b30..a084d256e 100644 --- a/vendor/mio/.cargo-checksum.json +++ b/vendor/mio/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"c9196a8655c6ea7c39f37bc43679a855f0a108e67fca8f6601fe7f40c699b19a","Cargo.lock":"e56bfd38558c24cc5f0b99e361d6a93d877d2ef765c597eb3d4a89c1d701b08f","Cargo.toml":"a28a3cecc8b10740192fed0edf90157b94a790957d2358516db79ffeb08c943b","LICENSE":"07919255c7e04793d8ea760d6c2ce32d19f9ff02bdbdde3ce90b1e1880929a9b","README.md":"e33863e6f79ed1f7e85b10b7108030b698460f280c8598b1fcb981e515e46edc","examples/tcp_listenfd_server.rs":"f05bbee8eb91a2e42fec29cbacbdd6dc5f9c95097b3ee12dfe944143e45f5996","examples/tcp_server.rs":"7309036fe2cd17530bcbc53b2b0ec12478caad39bcae5bda72cdd0263c647f4f","examples/udp_server.rs":"8e0795247be36b78a8cec02bd16af78083ac963d7d7fda3f422c673b17b62493","src/event/event.rs":"00ff34dd2e391784d5f7c4613029fb9aa8cc31a019306936960c27092486e5a9","src/event/events.rs":"5cad85e0d0c9e619b6017f868c681ed0dc023e7aae8c0c5c0c7337b2fa96a8a6","src/event/mod.rs":"c129c42114867e3e7337a6605952db8cef8a7ef0938f67a28fa68e73fc420c6a","src/event/source.rs":"d2d1aaff10fb31e7d2dfe8a4500d100a9b2d0a2ab1663503c0f275b35b0072b6","src/interest.rs":"983bb64b4e4443fbbf20461e7b198b128ca13cd1e853c1e9258ce401a8d046ea","src/io_source.rs":"166d4555f96cca194542361f7114a7e6456ce45b23097cb6afd26b7165e6ca1f","src/lib.rs":"230807008c9956195cd74d63a00879aa2ac67cede03723d336bb177c130f237f","src/macros.rs":"954a9c57fcdabc8625664880a41fedf2457ff87d5d5d6fee5e3c8c6112ac765b","src/net/mod.rs":"22b7f18555a06c1d5b074b67ed28ace5c59b1a3842232a9cd50f612cf0214cdc","src/net/tcp/listener.rs":"94e0277c84fc09041ef3f4c757ed0a935afa03edbdeadcb19a6a89938392a691","src/net/tcp/mod.rs":"f2c50c1d338a69d704e18727142d8495be2927b390d7bbb77cc0cf4e945ed83a","src/net/tcp/stream.rs":"aae550afe7dc458ad2b8860b7fc29c1feda345fe63a1e66e4de17610bead970e","src/net/udp.rs":"0d6245c99b1d4bedf6967ec138d0f4f9073a29e0d4404e3f96ff6830edb8250e","src/net/uds/datagram.rs":"a8d781620846997e5a89800d80e09a7b962c3f9ab14622a054b0b0d1b1b5c84e","src/net/uds/listener.rs":"0971d863f286333a6e7bcf5b031205a2f3a3160222160757a79a1e3d642e62c7","src/net/uds/mod.rs":"70d4368adae74652d46771b29e633396e5f1b70e9b7d1370cf5fec9a78605c04","src/net/uds/stream.rs":"93805ef2abc2ced64a3a0a095f60cd41db0349c49265a00b24b68444f32bba63","src/poll.rs":"e1e8a8cf0152fc231275ca9f211d0e3594daf93952a03a4e722d364a47c658c9","src/sys/mod.rs":"ad8eaa44a560caa8d01788b4e798705ef26ccdfc29b5de9eae2f23172a064aba","src/sys/shell/mod.rs":"140595b0c19c0c63640eb5e2913fd16e3f1f88c06f15867b526e7cb75a5c35f3","src/sys/shell/selector.rs":"32aaf1145def1659983e2f6041c41aab33fd25c88b8d55f707502ab164019dd1","src/sys/shell/tcp.rs":"81a5219507eea81895f4f984ceb157a9c0d3c046d50190b1c562f52d77f2b607","src/sys/shell/udp.rs":"0db637a4ce1ec3a5ccb410d1e94bcc525df8ad005c1d4235d7d50111d335dbde","src/sys/shell/uds.rs":"af4ff92fe38e1b58d5aa4ea49bfcc6b0a1f842f08f2335d54ef0c279b76de99e","src/sys/shell/waker.rs":"81bc18cf52345a8d17e8142291e43dd70a36dfd9f5eb486f3e787998ee4451dc","src/sys/unix/mod.rs":"682ce812cfc799782895d737b9ed9d67c3a885c25297eb64ba59c95e119c4f0d","src/sys/unix/net.rs":"e646a3c81097d952f8ee40c900bca3b075a71579ffbfb07328e7dd21dc5954f9","src/sys/unix/pipe.rs":"5e71959c5d5ab6316c41ee74185481117b2a3fb7b966f9818fdd624e2adb4f3f","src/sys/unix/selector/epoll.rs":"1c79b7a4dbc2e0bdd89562289cb6e5f84f5a5850e5438362290f9aee71cb6fff","src/sys/unix/selector/kqueue.rs":"e5cd64e9838b6af1a59a13d61bac384f4b823d1955817fc76dd75525c4abe34a","src/sys/unix/selector/mod.rs":"6336a77618a9037f02ad358281eccf64478550c247e390fc086fcb209be9b0d8","src/sys/unix/selector/poll.rs":"3a4d7749c919f795c0524cf20733710ad4478470880c87c0e2e68dbe2142cebd","src/sys/unix/sourcefd.rs":"18292d551d78a4ae6900ee31c969909a784d42b49184b7e0581c08f170dabf04","src/sys/unix/tcp.rs":"b4bf8e5c4dc246d61153bda94297df8941f2e7f4c3a81ecfbc4e4043a6290ad2","src/sys/unix/udp.rs":"ff8f15655e2cbb2ebec5153bda9bad021a418c2a42976af899392f63f5af9633","src/sys/unix/uds/datagram.rs":"01634c6b9e57ebaa96463850408410970259dc0a6d948494d16372a5f9f3ef6f","src/sys/unix/uds/listener.rs":"4d6f2d0d8a3e22415990056b0f229c19c9f07486a8fad243f5c73446739f037b","src/sys/unix/uds/mod.rs":"7d743fb1952cbb5cefd5b30b5c3918f8f5c27bed9203f05fa5ffa514f3d994eb","src/sys/unix/uds/socketaddr.rs":"394f81f4ac7c30716ad84d1f17e06a44a8d090e8e6535e4354c7d474e23e32fe","src/sys/unix/uds/stream.rs":"a762f933789c8f6e8d690adc1a71f1996aebb0ce17ee8781de27cf681edccec1","src/sys/unix/waker.rs":"29c4e6f3283b2be43dce9fc66c3a91006ae6aa30bac8605cd7ed76c8fb5ebcf3","src/sys/wasi/mod.rs":"dd4945e34b2169c4d3737fe7566269e2f7d1867664657b9b49bd097c88759699","src/sys/windows/afd.rs":"97caca7e7a15de2b16ad23d714f5b508b354bcaca01f26a769bb98fab4968b18","src/sys/windows/event.rs":"0b3f9c4ba4f10e8ede7c7c7163b8b4207c0d8155285dca7b4737cd055ec2c459","src/sys/windows/handle.rs":"f75276733a6f930f755a1bc5651cba8be52320a45709eec0b4ce5efe8779c5b6","src/sys/windows/io_status_block.rs":"74f51e68fc3b5bcf03a5d6d1c23ab3a0ac31a05c7314f329fdfa10d3d552828a","src/sys/windows/iocp.rs":"f82ee941190849e345174d6a20771984685411cc48716e3c79dede5ba925f33d","src/sys/windows/mod.rs":"2359bea017df508a5c47d5d8896d7b70b077e08647ce4f526e1d666072210621","src/sys/windows/named_pipe.rs":"10b3c46a9939093df780b01a683573155ec50920a802e69ae6ef2f4c9730d33e","src/sys/windows/net.rs":"67093e8c2c672bc7e7c809c83f400061abac0b9e01a748811e3b91e410df008b","src/sys/windows/overlapped.rs":"94fa619a7655228485c714ef5b5ed4b703a360e51130cdfc07d20c1aa38cb3c5","src/sys/windows/selector.rs":"f405fa81757e9505982d9b96fea3b2390d1bcbae4fb6833939abc04efc2d9d5a","src/sys/windows/tcp.rs":"1911960fd32657d31a53ed3ba4a374d1592bae2b2c7fca80213cdfbfa773a831","src/sys/windows/udp.rs":"45cbba2941287d89e089f168e29f65cea03b8b11aa8f5b7fee173d53a5c0e6b0","src/sys/windows/waker.rs":"cf27f75061b86dabe362d936c5945fd0e644aea833993de45d40b4be5fbbe56c","src/token.rs":"4e64c8e337fbee4e3a2f5e8661241b5261c9c5487e20fa73425d89e2e152e8de","src/waker.rs":"cd521418aede70369775607232d1162ff70f3993f4951ed113cc18fcd7af6539"},"package":"3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"} \ No newline at end of file +{"files":{"CHANGELOG.md":"3d83e49761225c32fdd474e555685a50cbd6ecaed8e6132cc717142a3e5a93c2","Cargo.lock":"a3c8049acd7c8864c0be45765983a20d284995244c11ab83e0adb3e656aa5a74","Cargo.toml":"18ac4411a6e8557bb049b603ef6cb26bdf7ef2f2b2c1ebb00369a92590ef648d","LICENSE":"07919255c7e04793d8ea760d6c2ce32d19f9ff02bdbdde3ce90b1e1880929a9b","README.md":"e33863e6f79ed1f7e85b10b7108030b698460f280c8598b1fcb981e515e46edc","examples/tcp_listenfd_server.rs":"f05bbee8eb91a2e42fec29cbacbdd6dc5f9c95097b3ee12dfe944143e45f5996","examples/tcp_server.rs":"7309036fe2cd17530bcbc53b2b0ec12478caad39bcae5bda72cdd0263c647f4f","examples/udp_server.rs":"8e0795247be36b78a8cec02bd16af78083ac963d7d7fda3f422c673b17b62493","src/event/event.rs":"00ff34dd2e391784d5f7c4613029fb9aa8cc31a019306936960c27092486e5a9","src/event/events.rs":"5cad85e0d0c9e619b6017f868c681ed0dc023e7aae8c0c5c0c7337b2fa96a8a6","src/event/mod.rs":"c129c42114867e3e7337a6605952db8cef8a7ef0938f67a28fa68e73fc420c6a","src/event/source.rs":"d2d1aaff10fb31e7d2dfe8a4500d100a9b2d0a2ab1663503c0f275b35b0072b6","src/interest.rs":"983bb64b4e4443fbbf20461e7b198b128ca13cd1e853c1e9258ce401a8d046ea","src/io_source.rs":"166d4555f96cca194542361f7114a7e6456ce45b23097cb6afd26b7165e6ca1f","src/lib.rs":"230807008c9956195cd74d63a00879aa2ac67cede03723d336bb177c130f237f","src/macros.rs":"954a9c57fcdabc8625664880a41fedf2457ff87d5d5d6fee5e3c8c6112ac765b","src/net/mod.rs":"22b7f18555a06c1d5b074b67ed28ace5c59b1a3842232a9cd50f612cf0214cdc","src/net/tcp/listener.rs":"94e0277c84fc09041ef3f4c757ed0a935afa03edbdeadcb19a6a89938392a691","src/net/tcp/mod.rs":"f2c50c1d338a69d704e18727142d8495be2927b390d7bbb77cc0cf4e945ed83a","src/net/tcp/stream.rs":"aae550afe7dc458ad2b8860b7fc29c1feda345fe63a1e66e4de17610bead970e","src/net/udp.rs":"0d6245c99b1d4bedf6967ec138d0f4f9073a29e0d4404e3f96ff6830edb8250e","src/net/uds/datagram.rs":"a8d781620846997e5a89800d80e09a7b962c3f9ab14622a054b0b0d1b1b5c84e","src/net/uds/listener.rs":"0971d863f286333a6e7bcf5b031205a2f3a3160222160757a79a1e3d642e62c7","src/net/uds/mod.rs":"70d4368adae74652d46771b29e633396e5f1b70e9b7d1370cf5fec9a78605c04","src/net/uds/stream.rs":"93805ef2abc2ced64a3a0a095f60cd41db0349c49265a00b24b68444f32bba63","src/poll.rs":"b596d13c2df7132b723cf639261b910462bfb2b07f53a448fe682cb48467813a","src/sys/mod.rs":"b5d208443393e6c05084159d32dee9dae4c1e91409cc09a2d86e11e67d2f042f","src/sys/shell/mod.rs":"140595b0c19c0c63640eb5e2913fd16e3f1f88c06f15867b526e7cb75a5c35f3","src/sys/shell/selector.rs":"32aaf1145def1659983e2f6041c41aab33fd25c88b8d55f707502ab164019dd1","src/sys/shell/tcp.rs":"81a5219507eea81895f4f984ceb157a9c0d3c046d50190b1c562f52d77f2b607","src/sys/shell/udp.rs":"0db637a4ce1ec3a5ccb410d1e94bcc525df8ad005c1d4235d7d50111d335dbde","src/sys/shell/uds.rs":"af4ff92fe38e1b58d5aa4ea49bfcc6b0a1f842f08f2335d54ef0c279b76de99e","src/sys/shell/waker.rs":"81bc18cf52345a8d17e8142291e43dd70a36dfd9f5eb486f3e787998ee4451dc","src/sys/unix/mod.rs":"0b4528cdf3833f1a26c680b0f6b55f3c8b6bf628286b5d40ba07b6d41ed6b072","src/sys/unix/net.rs":"9f8ee521427404fb456d8d872bcdfd75f2e6f6872b1e7d1a4cbd6c87f0747eb9","src/sys/unix/pipe.rs":"f370aa8d75be97f1d584bc2adab7eb2812ee69cc421796375ea9ea36b694694d","src/sys/unix/selector/epoll.rs":"1c79b7a4dbc2e0bdd89562289cb6e5f84f5a5850e5438362290f9aee71cb6fff","src/sys/unix/selector/kqueue.rs":"e5cd64e9838b6af1a59a13d61bac384f4b823d1955817fc76dd75525c4abe34a","src/sys/unix/selector/mod.rs":"488f8e9a37ec608d477f22991f9ffa36d85c16a4f2e74f5fc97e1be9ff24aa45","src/sys/unix/selector/poll.rs":"9184841c3372e01cff30d25a7f90d0474a67b2f8b0b7456b7ac41dfae279d8e0","src/sys/unix/sourcefd.rs":"18292d551d78a4ae6900ee31c969909a784d42b49184b7e0581c08f170dabf04","src/sys/unix/tcp.rs":"8bdfd74dac5897e5c364a9b370828e2a22f2193539b499ff9ce688ae185894ec","src/sys/unix/udp.rs":"ff8f15655e2cbb2ebec5153bda9bad021a418c2a42976af899392f63f5af9633","src/sys/unix/uds/datagram.rs":"01634c6b9e57ebaa96463850408410970259dc0a6d948494d16372a5f9f3ef6f","src/sys/unix/uds/listener.rs":"4d6f2d0d8a3e22415990056b0f229c19c9f07486a8fad243f5c73446739f037b","src/sys/unix/uds/mod.rs":"7d743fb1952cbb5cefd5b30b5c3918f8f5c27bed9203f05fa5ffa514f3d994eb","src/sys/unix/uds/socketaddr.rs":"394f81f4ac7c30716ad84d1f17e06a44a8d090e8e6535e4354c7d474e23e32fe","src/sys/unix/uds/stream.rs":"a762f933789c8f6e8d690adc1a71f1996aebb0ce17ee8781de27cf681edccec1","src/sys/unix/waker.rs":"7f29fcaa11040203865ccc8e143b6b60824e8fbaf440c325c3f8312ec8625216","src/sys/wasi/mod.rs":"dd4945e34b2169c4d3737fe7566269e2f7d1867664657b9b49bd097c88759699","src/sys/windows/afd.rs":"97caca7e7a15de2b16ad23d714f5b508b354bcaca01f26a769bb98fab4968b18","src/sys/windows/event.rs":"0b3f9c4ba4f10e8ede7c7c7163b8b4207c0d8155285dca7b4737cd055ec2c459","src/sys/windows/handle.rs":"f75276733a6f930f755a1bc5651cba8be52320a45709eec0b4ce5efe8779c5b6","src/sys/windows/io_status_block.rs":"74f51e68fc3b5bcf03a5d6d1c23ab3a0ac31a05c7314f329fdfa10d3d552828a","src/sys/windows/iocp.rs":"f82ee941190849e345174d6a20771984685411cc48716e3c79dede5ba925f33d","src/sys/windows/mod.rs":"2359bea017df508a5c47d5d8896d7b70b077e08647ce4f526e1d666072210621","src/sys/windows/named_pipe.rs":"10b3c46a9939093df780b01a683573155ec50920a802e69ae6ef2f4c9730d33e","src/sys/windows/net.rs":"67093e8c2c672bc7e7c809c83f400061abac0b9e01a748811e3b91e410df008b","src/sys/windows/overlapped.rs":"94fa619a7655228485c714ef5b5ed4b703a360e51130cdfc07d20c1aa38cb3c5","src/sys/windows/selector.rs":"f405fa81757e9505982d9b96fea3b2390d1bcbae4fb6833939abc04efc2d9d5a","src/sys/windows/tcp.rs":"1911960fd32657d31a53ed3ba4a374d1592bae2b2c7fca80213cdfbfa773a831","src/sys/windows/udp.rs":"45cbba2941287d89e089f168e29f65cea03b8b11aa8f5b7fee173d53a5c0e6b0","src/sys/windows/waker.rs":"cf27f75061b86dabe362d936c5945fd0e644aea833993de45d40b4be5fbbe56c","src/token.rs":"4e64c8e337fbee4e3a2f5e8661241b5261c9c5487e20fa73425d89e2e152e8de","src/waker.rs":"cd521418aede70369775607232d1162ff70f3993f4951ed113cc18fcd7af6539"},"package":"8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09"} \ No newline at end of file diff --git a/vendor/mio/CHANGELOG.md b/vendor/mio/CHANGELOG.md index 94fb3239e..de6b39c7a 100644 --- a/vendor/mio/CHANGELOG.md +++ b/vendor/mio/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.8.10 + +## Added + +* Solaris support + (https://github.com/tokio-rs/mio/pull/1724). + # 0.8.9 ## Added diff --git a/vendor/mio/Cargo.lock b/vendor/mio/Cargo.lock index 1e9f072f0..b2ac22f83 100644 --- a/vendor/mio/Cargo.lock +++ b/vendor/mio/Cargo.lock @@ -45,7 +45,7 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" dependencies = [ "env_logger", "libc", diff --git a/vendor/mio/Cargo.toml b/vendor/mio/Cargo.toml index 924bb7008..67c05c22e 100644 --- a/vendor/mio/Cargo.toml +++ b/vendor/mio/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "mio" -version = "0.8.9" +version = "0.8.10" authors = [ "Carl Lerche ", "Thomas de Zeeuw ", diff --git a/vendor/mio/src/poll.rs b/vendor/mio/src/poll.rs index 0a7b4bedf..092482f24 100644 --- a/vendor/mio/src/poll.rs +++ b/vendor/mio/src/poll.rs @@ -1,4 +1,8 @@ -#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))] +#[cfg(all( + unix, + not(mio_unsupported_force_poll_poll), + not(any(target_os = "solaris", target_os = "vita")) +))] use std::os::unix::io::{AsRawFd, RawFd}; #[cfg(all(debug_assertions, not(target_os = "wasi")))] use std::sync::atomic::{AtomicBool, Ordering}; @@ -423,7 +427,11 @@ impl Poll { } } -#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))] +#[cfg(all( + unix, + not(mio_unsupported_force_poll_poll), + not(any(target_os = "solaris", target_os = "vita")) +))] impl AsRawFd for Poll { fn as_raw_fd(&self) -> RawFd { self.registry.as_raw_fd() @@ -710,7 +718,11 @@ impl fmt::Debug for Registry { } } -#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))] +#[cfg(all( + unix, + not(mio_unsupported_force_poll_poll), + not(any(target_os = "solaris", target_os = "vita")) +))] impl AsRawFd for Registry { fn as_raw_fd(&self) -> RawFd { self.selector.as_raw_fd() @@ -721,7 +733,7 @@ cfg_os_poll! { #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(target_os = "vita"), + not(any(target_os = "solaris", target_os = "vita")), ))] #[test] pub fn as_raw_fd() { diff --git a/vendor/mio/src/sys/mod.rs b/vendor/mio/src/sys/mod.rs index 2a968b265..04e0b2000 100644 --- a/vendor/mio/src/sys/mod.rs +++ b/vendor/mio/src/sys/mod.rs @@ -54,6 +54,7 @@ cfg_os_poll! { #[cfg(unix)] cfg_os_poll! { mod unix; + #[allow(unused_imports)] pub use self::unix::*; } @@ -76,6 +77,7 @@ cfg_not_os_poll! { #[cfg(unix)] cfg_any_os_ext! { mod unix; + #[cfg(feature = "os-ext")] pub use self::unix::SourceFd; } diff --git a/vendor/mio/src/sys/unix/mod.rs b/vendor/mio/src/sys/unix/mod.rs index 7804236da..bd2fe7d76 100644 --- a/vendor/mio/src/sys/unix/mod.rs +++ b/vendor/mio/src/sys/unix/mod.rs @@ -18,6 +18,7 @@ cfg_os_poll! { pub(crate) use self::selector::{event, Event, Events, Selector}; mod sourcefd; + #[cfg(feature = "os-ext")] pub use self::sourcefd::SourceFd; mod waker; @@ -34,7 +35,7 @@ cfg_os_poll! { cfg_io_source! { // Both `kqueue` and `epoll` don't need to hold any user space state. - #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "vita")))] + #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "solaris", target_os = "vita")))] mod stateless_io_source { use std::io; use std::os::unix::io::RawFd; @@ -87,10 +88,10 @@ cfg_os_poll! { } } - #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "vita")))] + #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "solaris",target_os = "vita")))] pub(crate) use self::stateless_io_source::IoSourceState; - #[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] + #[cfg(any(mio_unsupported_force_poll_poll, target_os = "solaris", target_os = "vita"))] pub(crate) use self::selector::IoSourceState; } @@ -105,6 +106,7 @@ cfg_os_poll! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "vita", ))] pub(crate) mod pipe; @@ -118,6 +120,7 @@ cfg_not_os_poll! { cfg_any_os_ext! { mod sourcefd; + #[cfg(feature = "os-ext")] pub use self::sourcefd::SourceFd; } } diff --git a/vendor/mio/src/sys/unix/net.rs b/vendor/mio/src/sys/unix/net.rs index 75f015c2f..32f68a663 100644 --- a/vendor/mio/src/sys/unix/net.rs +++ b/vendor/mio/src/sys/unix/net.rs @@ -21,6 +21,7 @@ pub(crate) fn new_socket(domain: libc::c_int, socket_type: libc::c_int) -> io::R target_os = "linux", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", ))] let socket_type = socket_type | libc::SOCK_NONBLOCK | libc::SOCK_CLOEXEC; @@ -149,7 +150,7 @@ pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, libc::socklen_ sin6_len: 0, #[cfg(target_os = "vita")] sin6_vport: addr.port().to_be(), - #[cfg(target_os = "illumos")] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] __sin6_src_id: 0, }; diff --git a/vendor/mio/src/sys/unix/pipe.rs b/vendor/mio/src/sys/unix/pipe.rs index 4defd588c..7f23787f7 100644 --- a/vendor/mio/src/sys/unix/pipe.rs +++ b/vendor/mio/src/sys/unix/pipe.rs @@ -17,6 +17,7 @@ pub(crate) fn new_raw() -> io::Result<[RawFd; 2]> { target_os = "openbsd", target_os = "illumos", target_os = "redox", + target_os = "solaris", target_os = "vita", ))] unsafe { @@ -68,6 +69,7 @@ pub(crate) fn new_raw() -> io::Result<[RawFd; 2]> { target_os = "tvos", target_os = "watchos", target_os = "espidf", + target_os = "solaris", target_os = "vita", )))] compile_error!("unsupported target for `mio::unix::pipe`"); @@ -558,7 +560,7 @@ impl IntoRawFd for Receiver { } } -#[cfg(not(any(target_os = "illumos", target_os = "vita")))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "vita")))] fn set_nonblocking(fd: RawFd, nonblocking: bool) -> io::Result<()> { let value = nonblocking as libc::c_int; if unsafe { libc::ioctl(fd, libc::FIONBIO, &value) } == -1 { @@ -568,7 +570,7 @@ fn set_nonblocking(fd: RawFd, nonblocking: bool) -> io::Result<()> { } } -#[cfg(any(target_os = "illumos", target_os = "vita"))] +#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "vita"))] fn set_nonblocking(fd: RawFd, nonblocking: bool) -> io::Result<()> { let flags = unsafe { libc::fcntl(fd, libc::F_GETFL) }; if flags < 0 { diff --git a/vendor/mio/src/sys/unix/selector/mod.rs b/vendor/mio/src/sys/unix/selector/mod.rs index 9dd3ee44d..322673d1d 100644 --- a/vendor/mio/src/sys/unix/selector/mod.rs +++ b/vendor/mio/src/sys/unix/selector/mod.rs @@ -20,14 +20,22 @@ mod epoll; ))] pub(crate) use self::epoll::{event, Event, Events, Selector}; -#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] +#[cfg(any( + mio_unsupported_force_poll_poll, + target_os = "solaris", + target_os = "vita" +))] mod poll; -#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] +#[cfg(any( + mio_unsupported_force_poll_poll, + target_os = "solaris", + target_os = "vita" +))] pub(crate) use self::poll::{event, Event, Events, Selector}; cfg_io_source! { - #[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] + #[cfg(any(mio_unsupported_force_poll_poll, target_os = "solaris", target_os = "vita"))] pub(crate) use self::poll::IoSourceState; } diff --git a/vendor/mio/src/sys/unix/selector/poll.rs b/vendor/mio/src/sys/unix/selector/poll.rs index cfafbc182..8346e07bc 100644 --- a/vendor/mio/src/sys/unix/selector/poll.rs +++ b/vendor/mio/src/sys/unix/selector/poll.rs @@ -263,9 +263,9 @@ impl SelectorState { closed_raw_fds.push(poll_fd.fd); } - // Remove the interest which just got triggered - // the IoSourceState/WakerRegistrar used with this selector will add back - // the interest using reregister. + // Remove the interest which just got triggered the IoSourceState's do_io + // wrapper used with this selector will add back the interest using + // reregister. poll_fd.events &= !poll_fd.revents; // Minor optimization to potentially avoid looping n times where n is the diff --git a/vendor/mio/src/sys/unix/tcp.rs b/vendor/mio/src/sys/unix/tcp.rs index 130f4d685..6f755e870 100644 --- a/vendor/mio/src/sys/unix/tcp.rs +++ b/vendor/mio/src/sys/unix/tcp.rs @@ -67,6 +67,7 @@ pub(crate) fn accept(listener: &net::TcpListener) -> io::Result<(net::TcpStream, target_os = "linux", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", ))] let stream = { syscall!(accept4( diff --git a/vendor/mio/src/sys/unix/waker.rs b/vendor/mio/src/sys/unix/waker.rs index 3a08a8222..968f1a876 100644 --- a/vendor/mio/src/sys/unix/waker.rs +++ b/vendor/mio/src/sys/unix/waker.rs @@ -10,7 +10,7 @@ target_os = "watchos", ) )), - not(target_os = "vita"), + not(any(target_os = "solaris", target_os = "vita")), ))] mod fdbased { #[cfg(all( @@ -63,7 +63,7 @@ mod fdbased { target_os = "watchos", ) )), - not(target_os = "vita"), + not(any(target_os = "solaris", target_os = "vita")), ))] pub use self::fdbased::Waker; @@ -207,6 +207,7 @@ pub use self::kqueue::Waker; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "vita", ))] mod pipe { @@ -253,7 +254,11 @@ mod pipe { } } - #[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] + #[cfg(any( + mio_unsupported_force_poll_poll, + target_os = "solaris", + target_os = "vita" + ))] pub fn ack_and_reset(&self) { self.empty(); } @@ -291,11 +296,16 @@ mod pipe { target_os = "redox", ) ), + target_os = "solaris", target_os = "vita", ))] pub(crate) use self::pipe::WakerInternal; -#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] +#[cfg(any( + mio_unsupported_force_poll_poll, + target_os = "solaris", + target_os = "vita" +))] mod poll { use crate::sys::Selector; use crate::Token; @@ -321,5 +331,9 @@ mod poll { } } -#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))] +#[cfg(any( + mio_unsupported_force_poll_poll, + target_os = "solaris", + target_os = "vita" +))] pub use self::poll::Waker; diff --git a/vendor/num-conv/.cargo-checksum.json b/vendor/num-conv/.cargo-checksum.json new file mode 100644 index 000000000..3886e6978 --- /dev/null +++ b/vendor/num-conv/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"c1d8999190f493d43b84b07eaffd2a9144e16be197bb3ef13eb69305e2f23047","LICENSE-Apache":"c0fd5f9df8d17e13587f8fe403d2326b835e60d532817d0b42ae4aea44209251","LICENSE-MIT":"af85fff507d80e6c7ff242acfc4b0a7f5de9a72286bb3c883c782772ca4b4402","src/lib.rs":"ab6c4b28902164204179f5c31473753fbe5220a4b23082e227478e19c2aa47ca"},"package":"51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"} \ No newline at end of file diff --git a/vendor/num-conv/Cargo.toml b/vendor/num-conv/Cargo.toml new file mode 100644 index 000000000..0b8a9a6c0 --- /dev/null +++ b/vendor/num-conv/Cargo.toml @@ -0,0 +1,55 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.57.0" +name = "num-conv" +version = "0.1.0" +authors = ["Jacob Pratt "] +include = [ + "src/**/*", + "LICENSE-*", +] +description = """ +`num_conv` is a crate to convert between integer types without using `as` casts. This provides +better certainty when refactoring, makes the exact behavior of code more explicit, and allows using +turbofish syntax. +""" +readme = "README.md" +keywords = [ + "cast", + "extend", + "truncate", + "convert", + "integer", +] +categories = [ + "no-std", + "no-std::no-alloc", + "rust-patterns", +] +license = "MIT OR Apache-2.0" +repository = "https://github.com/jhpratt/num-conv" + +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + +[features] + +[lints.clippy] +alloc-instead-of-core = "deny" +std-instead-of-core = "deny" + +[lints.rust] +missing-docs = "warn" +unreachable-pub = "warn" +unused = "warn" diff --git a/vendor/num-conv/LICENSE-Apache b/vendor/num-conv/LICENSE-Apache new file mode 100644 index 000000000..d8bca8b9f --- /dev/null +++ b/vendor/num-conv/LICENSE-Apache @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Jacob Pratt + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/num-conv/LICENSE-MIT b/vendor/num-conv/LICENSE-MIT new file mode 100644 index 000000000..7c7f78a5e --- /dev/null +++ b/vendor/num-conv/LICENSE-MIT @@ -0,0 +1,19 @@ +Copyright (c) 2023 Jacob Pratt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/num-conv/src/lib.rs b/vendor/num-conv/src/lib.rs new file mode 100644 index 000000000..cbf3ff21d --- /dev/null +++ b/vendor/num-conv/src/lib.rs @@ -0,0 +1,329 @@ +//! `num_conv` is a crate to convert between integer types without using `as` casts. This provides +//! better certainty when refactoring, makes the exact behavior of code more explicit, and allows +//! using turbofish syntax. + +#![no_std] + +/// Anonymously import all extension traits. +/// +/// This allows you to use the methods without worrying about polluting the namespace or importing +/// them individually. +/// +/// ```rust +/// use num_conv::prelude::*; +/// ``` +pub mod prelude { + pub use crate::{CastSigned as _, CastUnsigned as _, Extend as _, Truncate as _}; +} + +mod sealed { + pub trait Integer {} + + macro_rules! impl_integer { + ($($t:ty)*) => {$( + impl Integer for $t {} + )*}; + } + + impl_integer! { + u8 u16 u32 u64 u128 usize + i8 i16 i32 i64 i128 isize + } + + pub trait ExtendTargetSealed { + fn extend(self) -> T; + } + + pub trait TruncateTargetSealed { + fn truncate(self) -> T; + } +} + +/// Cast to a signed integer of the same size. +/// +/// This trait is implemented for all integers. Unsigned to signed casts are equivalent to +/// `0.wrapping_add_signed(value)`, while signed to signed casts are an identity conversion. +/// +/// ```rust +/// # use num_conv::CastSigned; +/// assert_eq!(u8::MAX.cast_signed(), -1_i8); +/// assert_eq!(u16::MAX.cast_signed(), -1_i16); +/// assert_eq!(u32::MAX.cast_signed(), -1_i32); +/// assert_eq!(u64::MAX.cast_signed(), -1_i64); +/// assert_eq!(u128::MAX.cast_signed(), -1_i128); +/// assert_eq!(usize::MAX.cast_signed(), -1_isize); +/// ``` +/// +/// ```rust +/// # use num_conv::CastSigned; +/// assert_eq!(0_i8.cast_signed(), 0_i8); +/// assert_eq!(0_i16.cast_signed(), 0_i16); +/// assert_eq!(0_i32.cast_signed(), 0_i32); +/// assert_eq!(0_i64.cast_signed(), 0_i64); +/// assert_eq!(0_i128.cast_signed(), 0_i128); +/// assert_eq!(0_isize.cast_signed(), 0_isize); +/// ``` +pub trait CastSigned: sealed::Integer { + /// The signed integer type with the same size as `Self`. + type Signed; + + /// Cast an integer to the signed integer of the same size. + fn cast_signed(self) -> Self::Signed; +} + +/// Cast to an unsigned integer of the same size. +/// +/// This trait is implemented for all integers. Signed to unsigned casts are equivalent to +/// `0.wrapping_add_unsigned(value)`, while unsigned to unsigned casts are an identity conversion. +/// +/// ```rust +/// # use num_conv::CastUnsigned; +/// assert_eq!((-1_i8).cast_unsigned(), u8::MAX); +/// assert_eq!((-1_i16).cast_unsigned(), u16::MAX); +/// assert_eq!((-1_i32).cast_unsigned(), u32::MAX); +/// assert_eq!((-1_i64).cast_unsigned(), u64::MAX); +/// assert_eq!((-1_i128).cast_unsigned(), u128::MAX); +/// assert_eq!((-1_isize).cast_unsigned(), usize::MAX); +/// ``` +/// +/// ```rust +/// # use num_conv::CastUnsigned; +/// assert_eq!(0_u8.cast_unsigned(), 0_u8); +/// assert_eq!(0_u16.cast_unsigned(), 0_u16); +/// assert_eq!(0_u32.cast_unsigned(), 0_u32); +/// assert_eq!(0_u64.cast_unsigned(), 0_u64); +/// assert_eq!(0_u128.cast_unsigned(), 0_u128); +/// assert_eq!(0_usize.cast_unsigned(), 0_usize); +/// ``` +pub trait CastUnsigned: sealed::Integer { + /// The unsigned integer type with the same size as `Self`. + type Unsigned; + + /// Cast an integer to the unsigned integer of the same size. + fn cast_unsigned(self) -> Self::Unsigned; +} + +/// A type that can be used with turbofish syntax in [`Extend::extend`]. +/// +/// It is unlikely that you will want to use this trait directly. You are probably looking for the +/// [`Extend`] trait. +pub trait ExtendTarget: sealed::ExtendTargetSealed {} + +/// A type that can be used with turbofish syntax in [`Truncate::truncate`]. +/// +/// It is unlikely that you will want to use this trait directly. You are probably looking for the +/// [`Truncate`] trait. +pub trait TruncateTarget: sealed::TruncateTargetSealed {} + +/// Extend to an integer of the same size or larger, preserving its value. +/// +/// ```rust +/// # use num_conv::Extend; +/// assert_eq!(0_u8.extend::(), 0_u16); +/// assert_eq!(0_u16.extend::(), 0_u32); +/// assert_eq!(0_u32.extend::(), 0_u64); +/// assert_eq!(0_u64.extend::(), 0_u128); +/// ``` +/// +/// ```rust +/// # use num_conv::Extend; +/// assert_eq!((-1_i8).extend::(), -1_i16); +/// assert_eq!((-1_i16).extend::(), -1_i32); +/// assert_eq!((-1_i32).extend::(), -1_i64); +/// assert_eq!((-1_i64).extend::(), -1_i128); +/// ``` +pub trait Extend: sealed::Integer { + /// Extend an integer to an integer of the same size or larger, preserving its value. + fn extend(self) -> T + where + Self: ExtendTarget; +} + +impl Extend for T { + fn extend(self) -> U + where + T: ExtendTarget, + { + sealed::ExtendTargetSealed::extend(self) + } +} + +/// Truncate to an integer of the same size or smaller, preserving the least significant bits. +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!(u16::MAX.truncate::(), u8::MAX); +/// assert_eq!(u32::MAX.truncate::(), u16::MAX); +/// assert_eq!(u64::MAX.truncate::(), u32::MAX); +/// assert_eq!(u128::MAX.truncate::(), u64::MAX); +/// ``` +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!((-1_i16).truncate::(), -1_i8); +/// assert_eq!((-1_i32).truncate::(), -1_i16); +/// assert_eq!((-1_i64).truncate::(), -1_i32); +/// assert_eq!((-1_i128).truncate::(), -1_i64); +/// ``` +pub trait Truncate: sealed::Integer { + /// Truncate an integer to an integer of the same size or smaller, preserving the least + /// significant bits. + fn truncate(self) -> T + where + Self: TruncateTarget; +} + +impl Truncate for T { + fn truncate(self) -> U + where + T: TruncateTarget, + { + sealed::TruncateTargetSealed::truncate(self) + } +} + +macro_rules! impl_cast_signed { + ($($($from:ty),+ => $to:ty;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() == core::mem::size_of::<$to>(), + concat!( + "cannot cast ", + stringify!($from), + " to ", + stringify!($to), + " because they are different sizes" + ) + ); + + impl CastSigned for $from { + type Signed = $to; + fn cast_signed(self) -> Self::Signed { + self as _ + } + } + )+)*}; +} + +macro_rules! impl_cast_unsigned { + ($($($from:ty),+ => $to:ty;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() == core::mem::size_of::<$to>(), + concat!( + "cannot cast ", + stringify!($from), + " to ", + stringify!($to), + " because they are different sizes" + ) + ); + + impl CastUnsigned for $from { + type Unsigned = $to; + fn cast_unsigned(self) -> Self::Unsigned { + self as _ + } + } + )+)*}; +} + +macro_rules! impl_extend { + ($($from:ty => $($to:ty),+;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() <= core::mem::size_of::<$to>(), + concat!( + "cannot extend ", + stringify!($from), + " to ", + stringify!($to), + " because ", + stringify!($from), + " is larger than ", + stringify!($to) + ) + ); + + impl sealed::ExtendTargetSealed<$to> for $from { + fn extend(self) -> $to { + self as _ + } + } + + impl ExtendTarget<$to> for $from {} + )+)*}; +} + +macro_rules! impl_truncate { + ($($($from:ty),+ => $to:ty;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() >= core::mem::size_of::<$to>(), + concat!( + "cannot truncate ", + stringify!($from), + " to ", + stringify!($to), + " because ", + stringify!($from), + " is smaller than ", + stringify!($to) + ) + ); + + impl sealed::TruncateTargetSealed<$to> for $from { + fn truncate(self) -> $to { + self as _ + } + } + + impl TruncateTarget<$to> for $from {} + )+)*}; +} + +impl_cast_signed! { + u8, i8 => i8; + u16, i16 => i16; + u32, i32 => i32; + u64, i64 => i64; + u128, i128 => i128; + usize, isize => isize; +} + +impl_cast_unsigned! { + u8, i8 => u8; + u16, i16 => u16; + u32, i32 => u32; + u64, i64 => u64; + u128, i128 => u128; + usize, isize => usize; +} + +impl_extend! { + u8 => u8, u16, u32, u64, u128, usize; + u16 => u16, u32, u64, u128, usize; + u32 => u32, u64, u128; + u64 => u64, u128; + u128 => u128; + usize => usize; + + i8 => i8, i16, i32, i64, i128, isize; + i16 => i16, i32, i64, i128, isize; + i32 => i32, i64, i128; + i64 => i64, i128; + i128 => i128; + isize => isize; +} + +impl_truncate! { + u8, u16, u32, u64, u128, usize => u8; + u16, u32, u64, u128, usize => u16; + u32, u64, u128 => u32; + u64, u128 => u64; + u128 => u128; + usize => usize; + + i8, i16, i32, i64, i128, isize => i8; + i16, i32, i64, i128, isize => i16; + i32, i64, i128 => i32; + i64, i128 => i64; + i128 => i128; + isize => isize; +} diff --git a/vendor/object/.cargo-checksum.json b/vendor/object/.cargo-checksum.json index 3d60664ee..ae4a4fb7b 100644 --- a/vendor/object/.cargo-checksum.json +++ b/vendor/object/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"867d01e5cb8d68526590eb3f1aea7dec68756d4bc11054a17949dae3ff6a33f6","Cargo.toml":"6b5aa628b5bcbe39c32e9e9cf743d678e3d06ffec89aab4951c8f7992148b374","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b74dfa0bcee5c420c6b7f67b4b2658f9ab8388c97b8e733975f2cecbdd668a6","README.md":"3772fdfd89e6321cc298413b8c0ba847bd125dfe64785e8faeaac05a87cbb2d3","clippy.toml":"e1e95839ba8e8bbf07f99ff49e2f151b9048c7981301a5480571842bbaf78ca2","src/archive.rs":"d6cead723242c26db2967b63385b79ed2008980a8c64b123a5eecffd7ed388fc","src/common.rs":"27a01eb0a1efcd10a988bc3922a2159e97fd133fbc07ff90faca4ff1722bd605","src/elf.rs":"79d638966c52f06262b8546d819660353fbe700a036a4454a7b961938403f3c6","src/endian.rs":"b4f63a85ccd3d5c11615baf5ba946c82046c221a1b8c74ee8c6fa4360782980c","src/lib.rs":"7f1261ebed84cd10169c1846a70dcafa7c8b25c06f32981335a9a676f45856a4","src/macho.rs":"e62808b0c84494b68e7e69b2f7fd9c0620b2ef61b6a2af3403de30284cf6b898","src/pe.rs":"8432e949a5bbf7ca28ba27f6a8ee926fe2e8632ffd88845714a6f64d6f7c0a40","src/pod.rs":"d2967732f0052e6cfa18a2dd62c57bc3b640a20eb9a6db9f39836000ceabb399","src/read/any.rs":"8ef08da67f083ee3f2758b5d64349d8032d5c63198d0c55815cd17054281a207","src/read/archive.rs":"479574cff125a74fc5512d75c1531da3bb006005fe544ffd2531a7d4f35a9bb4","src/read/coff/comdat.rs":"5204e6e44a33d1fe04ae551892d9dae2bd8ca4a0d9f1b46dd06a9e512b8ec6cc","src/read/coff/file.rs":"007c52c0a2d6f763a3c74e13f5cc15cf870a0701b87f01346ad550e52c5e5146","src/read/coff/import.rs":"1de0db515a0a6b1eee355d93a715f6d2ff152d1b815e1e859af0b0e5ded36efc","src/read/coff/mod.rs":"66bdcc772291cb53be378a66723e3c246e30df5aa4e4d4ce8e55bfeb156849a9","src/read/coff/relocation.rs":"57deb22ed0c9c31de0fe0bb483ded94459bcfd93b9f979191500d223a8517fe2","src/read/coff/section.rs":"de023dc46d4e1a37e77ab8e7080ff9fc9588633d790ae664e138d70e8fc8a39f","src/read/coff/symbol.rs":"e3b629112fe73e4627daa45093df1a1a2844ffe395d1c4de479f0f4c2bdac624","src/read/elf/attributes.rs":"1a5bc8dc081903d6b318761f50010ab08dee74b7f2d68ffbbd1aff7ed7b7c538","src/read/elf/comdat.rs":"253e00621d9a5249cfa20a2ebda76127113b42fc960235308333c9d35acdd628","src/read/elf/compression.rs":"097ff8bdc78d01a1532b11c1c0cae3b35905128c7d98b471de188d46da3ff970","src/read/elf/dynamic.rs":"8f59bd6d352f6810be6b6dc02c2f88229f15aa02a42f8fc09bcf3f284d4b1021","src/read/elf/file.rs":"860f6ed4e98e8672daef71065ea885f47d25593f6adeb7907545dadb9d398768","src/read/elf/hash.rs":"b330af7e2356512cfdf162986437c81a3b149a91e26bf82455a6976e2571a618","src/read/elf/mod.rs":"fceb322ac4e2cb182e0abd93f794622e58ae7c64e83c8703c9c888af5d93889d","src/read/elf/note.rs":"4b7e33582bff27918240d34d70f0099260dfd3122345c12ce10e6f7fcdf79e35","src/read/elf/relocation.rs":"7b95b7fbac280645f6d5900cc0158653bc8fb3adc9beeeae1b3f61eb77ada5d0","src/read/elf/section.rs":"c626a53afa196ba5b81a3d6278956f1d1ddf04ff2ac81f934425cfaef870aafd","src/read/elf/segment.rs":"ebcefba06c6f4a3e60403a1112c59f3390c39840aac011a8b040c77f8d29d655","src/read/elf/symbol.rs":"d50755b3acd34b9c77dd51f94d436265e79ed8f6f167b593e2a482543abde30b","src/read/elf/version.rs":"2c5f63e526cf26f83bdaaead4124949fc53b6198983e4681b6a3895794ad8754","src/read/macho/dyld_cache.rs":"c5247e9121a57fd411c86aea435b9c3d6d03d3cbb3fb7dfe6e75576013d71f14","src/read/macho/fat.rs":"d27a1052f2e47cd5b798a6359f33c3bfe7f7971b13259f6545118213ace7f5dd","src/read/macho/file.rs":"2531c245722202173ff762179af2c88af0108156457c848e7d756e348e72bc80","src/read/macho/load_command.rs":"d8c0ebc8f65dafa4fbb1f9a3c944fdeee96fddacfcc863650b94d9a62e8fe37a","src/read/macho/mod.rs":"23b353da3b7e076c68a067776e6a5b346a746116ac42c2c90bafd95ad54a90b3","src/read/macho/relocation.rs":"477d98b507550c29ceceba49308d14e1f086cb01a4ea9af691e995d1d29767a4","src/read/macho/section.rs":"9b21b3a02f509bb09983d116d7f0938cd61d5293e5e31907964611495b8a575e","src/read/macho/segment.rs":"0dee483eb9b6c731e69a9fe0bd9ef84b2a797a8203e5e870e15a6a2165326cc3","src/read/macho/symbol.rs":"3d3ad557c205d834ba305a9eaf3b97b2ed05f1906cd8430ad2fadabf81f14b9f","src/read/mod.rs":"b1224dc6654be52b8c2f6403503ffa662b576d05c0382146a386915d23c894dd","src/read/pe/data_directory.rs":"c08c095a4287c55bf7d7774bbade1d7610d8e82433b0de23af8c4c7ef23d75e3","src/read/pe/export.rs":"07ac5ec7b67d4a09037d8f11eb4426d96515687ee299df2a3d8cd4fd93eb2036","src/read/pe/file.rs":"507d800775adae687ca9ac7dca1a6f42463103af0731a5fe548d4745a9bee686","src/read/pe/import.rs":"ea20dfc0d462ba20e149bf9408f4ec1d0b202abf1f15536f6d091f0c0e756ac8","src/read/pe/mod.rs":"69832b7f4ccd93b59e08bafcbd0d3226c450d7801ad49ab554b38b660c8997fd","src/read/pe/relocation.rs":"0335c06b6d37df4939c8b88044313e88661ee45e5a57d2eec40143f2fe481838","src/read/pe/resource.rs":"0209eb96391bc367633b6d868505cb30947157702b0c85ef6677e5a1283d448f","src/read/pe/rich.rs":"ae9b2fc927bab2661e8d200a10128aebde37d26b50cb9069e9af9eb7bacee591","src/read/pe/section.rs":"bafde5a1584f6ce0456e32756e825c1b2b9dc0ec220ab29e668c2ff700600b87","src/read/read_cache.rs":"e9dbaa385435f5ef6ca5951c26ed1f6793ad3a8f3aee918257a5df6783d4b36d","src/read/read_ref.rs":"14966a1da9951633a7e73aedccfeadbbed4a977a8fb9d415d572250f6ebaf438","src/read/traits.rs":"8d094ba6ac06639bad448c70378d5154195d4ab36b13588b72105a869dfc053e","src/read/util.rs":"7ed8c5c88a52549734df67d2cbd3f0ea1a571728cae62152e57018f3140f9ebc","src/read/wasm.rs":"31c755ce17bba20ba287f53af7b7787bdbb5f8920333412fb11d81239102b423","src/read/xcoff/comdat.rs":"9a0a8a16682a28a54b51d28d382578e4b1e0212a34460eb93b50e8f97e4bf745","src/read/xcoff/file.rs":"17f751578d052cb8f74ee56a4e17b053b06e82e4efbe943907943bc561fb301e","src/read/xcoff/mod.rs":"d0179d3f95797464ca5919563454d1123ce8c35dfc5f40ecd6ca0d002a9824a8","src/read/xcoff/relocation.rs":"84993f477231cd1b8c79c385bc0e892640de89ddae268b845bc82c41999953b4","src/read/xcoff/section.rs":"c5ce72c214398125c7a4bc160fc5a7b27a6d92035dadcc84fd2852b73c75c123","src/read/xcoff/segment.rs":"627dabf3003aa1442bb4a2292cd68e1f572c3b95864a99e50a505b2894ffc804","src/read/xcoff/symbol.rs":"23be12b614937f8ea5de90d097fb8034f82bff798aa09636cd53a0670e39a984","src/write/coff.rs":"d26916ef57587534d2639d6d537aefff7583667b92ce3a91934913ea6c2c23a6","src/write/elf/mod.rs":"1bb945edad539b4f19dda5d46c9b86fa4ea3721eedda77ca2595b5519c3e30f2","src/write/elf/object.rs":"7cbf1dcb28e4228fa8417942f94ca1fedb1ba5fe21d1654a90c6b11e4f947d41","src/write/elf/writer.rs":"84336230a24413a41e342735c153c3421c70707ec92c2df02e7d3536e5d41b55","src/write/macho.rs":"c8b35d79f98a1db3f9bd5dcce9e46eab4f3559dc1ec14c69d3e410add55d07ae","src/write/mod.rs":"b429b9bdbe48f09bd6aeda9428657e4eb15ce8eab263e0bb5f4d9cd2f3786b26","src/write/pe.rs":"6c72185705a3e067c481f2b9f81c64a84e062e67781928e58fd1150314dad8f9","src/write/string.rs":"0033a6f5137b42988ac41dbaa2efb94a4d74d8b043c9a34c40125e8ee6912420","src/write/util.rs":"7a1083d305e9446767ce2d5f69be2c4c155495cf97e595f8fa53c4e153ccf186","src/write/xcoff.rs":"290e98f8c71baafc1f2111e1513f35a95a7f7914cc0f446bbc24547a17eb3af1","src/xcoff.rs":"fbd50fc4b61ccfdf218185ea4eafe8cf9793e8d034e7ce243fb54ecae12af5ce","tests/integration.rs":"0fa704827e4da1be38dac2e3820d92f6b20c4d415803b04f67c3516020b1de97","tests/parse_self.rs":"81b44b2dd1de9a5d8c18d9bd8926156e39fb83931837afa8ca344da0d309aeee","tests/read/coff.rs":"d3ec2079f00237640d01cb66eb24c55c85d7a775bb94f9f5c9f77e21cb7a785d","tests/read/mod.rs":"7833826f169ac3be2b4f274e5fc8cf4a51742bd0010803ff0dc20ea5643a7e61","tests/round_trip/bss.rs":"849d69b063fd757fed02219dd81e9d13b82068a2025d2cc5cfd40cf557e31bda","tests/round_trip/coff.rs":"8a25aab7164a5c8aa7a21279f8bae1f4d5f68a8d09c29a4ecd0d0c14564851cc","tests/round_trip/comdat.rs":"a8f729e218fee21e90b9f39b5cfcb4f80bc3ce26d3a297323667e6eb14f882cc","tests/round_trip/common.rs":"ced08ff559ca4d343ceef54bb4c581a3405cd96d6a1628ba43b7aab82070800b","tests/round_trip/elf.rs":"d7351d888ccad246a646ab3bea1afc3d445adeb28c5d3c8f157f7cde3717281c","tests/round_trip/macho.rs":"8cf6297f1b9e31153b15f2e409e68b561f135a233d32b601a47f5fd4dfa014cc","tests/round_trip/mod.rs":"14db36fae698b75fedc4dc832465394350049f54b01b1215022a44ebe920f7e9","tests/round_trip/section_flags.rs":"0e17639e5f86d576f039a294c274ce8db2e2a8add31a2fffc33a6e93a6d2791e","tests/round_trip/tls.rs":"23a49a1036b9173ece82a3080745930e5925e745280ab38866c9d3c29f463e63"},"package":"9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"} \ No newline at end of file +{"files":{"CHANGELOG.md":"8b7856a7b2ed9d534abaf22e924f28b7dc470ee62b8b83a81836111e8e6b8a17","Cargo.toml":"7a6f454c405b4debc0ba393deac7d32bb844745f80d1e42bc6aa6ca30f2078cd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b74dfa0bcee5c420c6b7f67b4b2658f9ab8388c97b8e733975f2cecbdd668a6","README.md":"f2e83094c790fee1543503a19763c80afbfc35ab3bcf9e273e0efef0646ca181","clippy.toml":"e1e95839ba8e8bbf07f99ff49e2f151b9048c7981301a5480571842bbaf78ca2","src/archive.rs":"d6cead723242c26db2967b63385b79ed2008980a8c64b123a5eecffd7ed388fc","src/common.rs":"4b08104045d9f4fc6b0cd87d273a694e3a442d38e8cea88dadaf56202069310b","src/elf.rs":"76013b28af828ea4828c2fdce1ccc0753330bbb59f92b0feeb2902ca5277a931","src/endian.rs":"b4f63a85ccd3d5c11615baf5ba946c82046c221a1b8c74ee8c6fa4360782980c","src/lib.rs":"e9344c09eaaa38b3b68c5721da7593c35b21bcd19e2f8fa8b9e086359883fef1","src/macho.rs":"e62808b0c84494b68e7e69b2f7fd9c0620b2ef61b6a2af3403de30284cf6b898","src/pe.rs":"cd61391b064bea4c99cff515d9c635227218cf62b7aa719b66e3b1935379c497","src/pod.rs":"d2967732f0052e6cfa18a2dd62c57bc3b640a20eb9a6db9f39836000ceabb399","src/read/any.rs":"8b9c1c4d3e42a4a31d8aa3a8e00873eeb59c39e39a95f18375414046386c55a3","src/read/archive.rs":"e72051dc3315ca5c8e43eae0ab68dadef774f2e88f7755cd663ee0996b567d9a","src/read/coff/comdat.rs":"bc48209a993c67d9151d45e6cb0c4d05781cba50fc3ee19261adca6ef49772de","src/read/coff/file.rs":"bac38db07bee4d05342da7df2d352fd6d9bb41d684531f643916f4c4612b14dc","src/read/coff/import.rs":"2688a34ae2169e93405a4aad2380e15a28edd2db94286becd6644e9996ceb7b2","src/read/coff/mod.rs":"c3b0c4f09993b07a85fda3dd2de9c80258aaadce6c0598eb25e55fab4c6bbf1c","src/read/coff/relocation.rs":"001c5dab38a3f49d3a07ea9be78e1c6fe085a34accc041916b82779dd003177e","src/read/coff/section.rs":"cf4d098074ef45e25e98466cc2edb17f4209c955508c550fd8281a93fd5d10db","src/read/coff/symbol.rs":"b4323e6d905c520e43c1886f71423048397fdcda685e66be673f5dcaa62ee48f","src/read/elf/attributes.rs":"a9ac569d6ce02c98af70f83dcc74b0e27d008da5471851d6d307ecb270f60468","src/read/elf/comdat.rs":"44f281b8b2f7f763ac79bc8136e7f06bb9c145ff445054789fb0e045987b8904","src/read/elf/compression.rs":"726bb1ca96a480ac2a0c8ccaa4c2291d62ca6c4af2b1a2e43b74ae7be17f6d75","src/read/elf/dynamic.rs":"c934f8b72d71ed39ff129ce37a8177b5bf12fba93695914eae48112bf89702b4","src/read/elf/file.rs":"cc088179cae5c961991a553df10a52f61a5ee4122f9683faf988f94f5f209c3f","src/read/elf/hash.rs":"caf8cd5eb547bd212c3ecff5d33b39bc22f68e1d78de72a9333c0062e06e0507","src/read/elf/mod.rs":"7c0d4d10c1055f57184f470aa014e6358394ec95019a74da8d5079d275437d0b","src/read/elf/note.rs":"ca7fe4d04fe130e7c29bea5f5f559f4561272e4658a502444164003f36e620ec","src/read/elf/relocation.rs":"e43491ecfcd84b3a4b01d595cb28aea85fde5f8968a21053c0f28ae2fc4c5bc6","src/read/elf/section.rs":"c0ea5bc99c22791e2992dc348769bc72cfffac637ac6881cd34b3e1a767a692b","src/read/elf/segment.rs":"a9b235d4193e879957c0c929830870cbe57cb0305f5d9ed10911c4fe10b19430","src/read/elf/symbol.rs":"ed4f3cdffe33435a600561d8cc0c20842c58c8c922cfdac9067eaab6d1e37cf7","src/read/elf/version.rs":"70d2d9a0eae9d4602a79bbf8cc03e689921801b7d463a4381b331df534e59fda","src/read/macho/dyld_cache.rs":"855845db4eeaae89513e525786adc9f42225e3a4ec0e3a063629e87dd29f1059","src/read/macho/fat.rs":"a57272f0cd4bfdbacad1aac953e874631fcc445ce406b990892630542cdf2bda","src/read/macho/file.rs":"2d33692bae78ac7f07f946044c5c54c1294e774f7dc530181b9683e440828ba7","src/read/macho/load_command.rs":"bcb912923b5da843670275451ccb94527d50fa97d643b28924377f1c83d2339b","src/read/macho/mod.rs":"0e97e28f379766511f33d8ccb97eaa690a352f9180080a376a86516249b1bdd8","src/read/macho/relocation.rs":"be5d2588d7e6ccb0b9dda6f495eb0bc730eb01eb129e0a418ce5dce2ebb7de69","src/read/macho/section.rs":"dfc40939fc511bb6ad784eef7465d8c224d8efc246fceacaa7c8e4c6153e1f48","src/read/macho/segment.rs":"4888f4020ff98e7495405865631a3de4f1d1f21cc9df157900d689b0f64791f0","src/read/macho/symbol.rs":"f51e723355d84270d05bf289cefa4bcc35815f00ad075c2d63289e2d6ee6e9fd","src/read/mod.rs":"c53ea9bbf3129c4a837db5aebe3f4ae6ed05eb71f3305499a1434c8548a35f31","src/read/pe/data_directory.rs":"730c5b90174ddcce49f78fc9ff6fbdde0a011dc7d50154c8fe3a5a8b1a09a015","src/read/pe/export.rs":"88cd068d1ed84c1153f94ee5d71d9d9dc07de4a65499938379006e2d0801f592","src/read/pe/file.rs":"d88319d9e1358f5c0f1789c85770d144b45b94c6273e901682645acc717e2113","src/read/pe/import.rs":"5d5cedc95294cbfbab705b48e87bce29b57b083c17e47ce09806cf53588d2859","src/read/pe/mod.rs":"f0c70bf86680e7afdfdffbf4f3118efc9801516c6898663f574b115b62b1fbcd","src/read/pe/relocation.rs":"27795df870bc38b3aab57a9ef78c141633442727dbcd5b1c4b61513ec64069a6","src/read/pe/resource.rs":"1cbac8460d717c6fb5782aaad25a9c4148a1fbf050bd33b0eef476116b072711","src/read/pe/rich.rs":"ae9b2fc927bab2661e8d200a10128aebde37d26b50cb9069e9af9eb7bacee591","src/read/pe/section.rs":"5658ab6c7fc3b03c646d8dc28e795b5ec7a047ba7065db037d82b6f71ecbd81f","src/read/read_cache.rs":"775c3b357898981b5944302f2d773d637ac0dc6e26074023863153d30101b657","src/read/read_ref.rs":"712d276e6891f4cf512ed35be73ce2872ecd25c523c8554bdfd175445e120e56","src/read/traits.rs":"53a234182e58450b80972350b5645916877e6c30b4bd9ee8ed569deff7bef28a","src/read/util.rs":"03f3dc16d43e0b351feaff4e47f5cb996f9cc05e540e7996bff6961ff9901034","src/read/wasm.rs":"34c5a7344efcc57105f105282deb22b4dd3641394f518fb25aa9d7ea7ab2319f","src/read/xcoff/comdat.rs":"d054619dabe880f90b9a7935d13e8aaf35b10c7a52bd6d517cb93f1fc9a847d1","src/read/xcoff/file.rs":"dfa599bab234220089cf8b891dae299d1a760366535956ad55fe70b5e179b167","src/read/xcoff/mod.rs":"40921a3e9d65360f57c7301f11dd12ec82f71311b689272f209758ecbc755eb3","src/read/xcoff/relocation.rs":"b383d883f8966a4d9da8de5c2146b324e8758500ea73fd1c51c0216407db6ce9","src/read/xcoff/section.rs":"b39d79d680ce48de13526ca3dfbbb39baece92174e6732fa040418e1d4cfe89c","src/read/xcoff/segment.rs":"ce6f0c1c6dd5aa3dce620c7645fa9c790ee56765b6586782ac0e747c0e949f79","src/read/xcoff/symbol.rs":"c15031c2a0fd8cc7202087adac14baf8abbdd5ffb30d0f4b6bbbea9024e1ada0","src/write/coff/mod.rs":"511bd3a19575b1d888d0d1abb17bb697c36eda0e7032375afb13daedc972c27e","src/write/coff/object.rs":"13c8e7ca89a470280cae8478fe2637a518d81a087af2958868611c4e6a39f4cf","src/write/coff/writer.rs":"65754d28af57fc5a415af5665759a728e4526d13052f50dc7f2c00f3e307b225","src/write/elf/mod.rs":"1bb945edad539b4f19dda5d46c9b86fa4ea3721eedda77ca2595b5519c3e30f2","src/write/elf/object.rs":"ebb433b0e5afa4945b6ac2152137f56331507a2b5d8e8e698052f77ccb351486","src/write/elf/writer.rs":"84336230a24413a41e342735c153c3421c70707ec92c2df02e7d3536e5d41b55","src/write/macho.rs":"28d41a8423f4652d558c43fd9abf86488e60dc0be311aa4ddc4a863879179707","src/write/mod.rs":"7561a31d1e5da73a8c56b742ed550deffa1dd64ddf33e46d12ffde464906df61","src/write/pe.rs":"6c72185705a3e067c481f2b9f81c64a84e062e67781928e58fd1150314dad8f9","src/write/string.rs":"0033a6f5137b42988ac41dbaa2efb94a4d74d8b043c9a34c40125e8ee6912420","src/write/util.rs":"d93a7d00260cf6df0cca481d5fb5845ee5a87787dc4fc35a64f2abeb91096965","src/write/xcoff.rs":"290e98f8c71baafc1f2111e1513f35a95a7f7914cc0f446bbc24547a17eb3af1","src/xcoff.rs":"bfcfbcea61436aa41a6fc8ee2395654552d1dadd3d0e17d7e11679c65b7978aa","tests/integration.rs":"0fa704827e4da1be38dac2e3820d92f6b20c4d415803b04f67c3516020b1de97","tests/parse_self.rs":"81b44b2dd1de9a5d8c18d9bd8926156e39fb83931837afa8ca344da0d309aeee","tests/read/coff.rs":"d3ec2079f00237640d01cb66eb24c55c85d7a775bb94f9f5c9f77e21cb7a785d","tests/read/mod.rs":"7833826f169ac3be2b4f274e5fc8cf4a51742bd0010803ff0dc20ea5643a7e61","tests/round_trip/bss.rs":"849d69b063fd757fed02219dd81e9d13b82068a2025d2cc5cfd40cf557e31bda","tests/round_trip/coff.rs":"8a25aab7164a5c8aa7a21279f8bae1f4d5f68a8d09c29a4ecd0d0c14564851cc","tests/round_trip/comdat.rs":"a8f729e218fee21e90b9f39b5cfcb4f80bc3ce26d3a297323667e6eb14f882cc","tests/round_trip/common.rs":"ced08ff559ca4d343ceef54bb4c581a3405cd96d6a1628ba43b7aab82070800b","tests/round_trip/elf.rs":"d7351d888ccad246a646ab3bea1afc3d445adeb28c5d3c8f157f7cde3717281c","tests/round_trip/macho.rs":"f6566e658f8c627668646763010a3872fd7b7b0a5aebeed00b0690acad90d147","tests/round_trip/mod.rs":"a7ac4075f61ddec0b6bf87e7d447ba27bab01c8ae0b14d78af87bcc9df34fe9c","tests/round_trip/section_flags.rs":"0e17639e5f86d576f039a294c274ce8db2e2a8add31a2fffc33a6e93a6d2791e","tests/round_trip/tls.rs":"302f46d7481e1738b7561057869cec33d03b8760aba1d78ef0fe5adf603001f6"},"package":"a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"} \ No newline at end of file diff --git a/vendor/object/CHANGELOG.md b/vendor/object/CHANGELOG.md index 167a2d6b6..12c8653b5 100644 --- a/vendor/object/CHANGELOG.md +++ b/vendor/object/CHANGELOG.md @@ -2,6 +2,70 @@ -------------------------------------------------------------------------------- +## 0.32.2 + +Released 2023/12/24. + +### Added + +* Added ELF relocations for LoongArch ABI v2.20. + [#578](https://github.com/gimli-rs/object/pull/578) + [#589](https://github.com/gimli-rs/object/pull/589) + +* Added ELF support for SHARC. + [#593](https://github.com/gimli-rs/object/pull/593) + +* Added `write::coff::Writer`. + [#595](https://github.com/gimli-rs/object/pull/595) + +* Added `SubArchitecture::Arm64EC` support for PE/COFF. + [#607](https://github.com/gimli-rs/object/pull/607) + +* Added `SubArchitecture::Arm64E` support for Mach-O. + [#614](https://github.com/gimli-rs/object/pull/614) + +* Added `read::Object::symbol_by_name` and `read::Object::symbol_by_name_bytes`. + [#602](https://github.com/gimli-rs/object/pull/602) + +* Added more functions to the low level API in `read::xcoff`. + [#608](https://github.com/gimli-rs/object/pull/608) + +* Added more functions to the low level API in `read::macho`. + [#584](https://github.com/gimli-rs/object/pull/584) + +### Changed + +* Fixes for AArch64 relocation addends for Mach-O. + [#581](https://github.com/gimli-rs/object/pull/581) + +* Changes to `write::Object` output for Mach-O, including the addition of a `LC_DYSYMTAB` load command. + [#584](https://github.com/gimli-rs/object/pull/584) + +* Changed `write::Object` to always use `R_X86_64_PLT32` for x86-64 branches for ELF. + [#590](https://github.com/gimli-rs/object/pull/590) + +* Fixed `read::ObjectSymbol::kind` for undefined section symbols for COFF. + [#592](https://github.com/gimli-rs/object/pull/592) + +* Fixed `write::Object` to accept undefined section symbols for COFF. + [#594](https://github.com/gimli-rs/object/pull/594) + +* Improved parsing of auxiliary section symbols for COFF. + [#603](https://github.com/gimli-rs/object/pull/603) + +* Improved the selection of symbols for `read::Object::symbol_map`. + This includes changes to `read::Symbol::is_definition`. + [#601](https://github.com/gimli-rs/object/pull/601) + [#606](https://github.com/gimli-rs/object/pull/606) + +* Changed `read::ObjectSymbol::kind` for ELF `STT_NOTYPE` symbols to `SymbolKind::Unknown`. + [#604](https://github.com/gimli-rs/object/pull/604) + +* Changed `read::ObjectSymbol::scope` for XCOFF `C_HIDEXT` symbols to `SymbolScope::Compilation`. + [#605](https://github.com/gimli-rs/object/pull/605) + +-------------------------------------------------------------------------------- + ## 0.32.1 Released 2023/09/03. diff --git a/vendor/object/Cargo.toml b/vendor/object/Cargo.toml index a007712d2..c408ae513 100644 --- a/vendor/object/Cargo.toml +++ b/vendor/object/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.60" name = "object" -version = "0.32.1" +version = "0.32.2" exclude = [ "/.github", "/testfiles", @@ -73,11 +73,11 @@ version = "2.4.1" default-features = false [dependencies.ruzstd] -version = "0.4.0" +version = "0.5.0" optional = true [dependencies.wasmparser] -version = "0.110.0" +version = "0.118.0" optional = true [features] diff --git a/vendor/object/README.md b/vendor/object/README.md index 5b90fca30..08d9c803f 100644 --- a/vendor/object/README.md +++ b/vendor/object/README.md @@ -19,16 +19,14 @@ use object::{Object, ObjectSection}; use std::error::Error; use std::fs; -/// Reads a file and displays the content of the ".boot" section. +/// Reads a file and displays the name of each section. fn main() -> Result<(), Box> { - let bin_data = fs::read("./multiboot2-binary.elf")?; - let obj_file = object::File::parse(&*bin_data)?; - if let Some(section) = obj_file.section_by_name(".boot") { - println!("{:#x?}", section.data()?); - } else { - eprintln!("section not available"); - } - Ok(()) + let binary_data = fs::read("path/to/binary")?; + let file = object::File::parse(&*binary_data)?; + for section in file.sections() { + println!("{}", section.name()?); + } + Ok(()) } ``` diff --git a/vendor/object/src/common.rs b/vendor/object/src/common.rs index 0e6af091c..36f6656ff 100644 --- a/vendor/object/src/common.rs +++ b/vendor/object/src/common.rs @@ -26,12 +26,22 @@ pub enum Architecture { Riscv64, S390x, Sbf, + Sharc, Sparc64, Wasm32, Wasm64, Xtensa, } +/// A CPU sub-architecture. +#[allow(missing_docs)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] +pub enum SubArchitecture { + Arm64E, + Arm64EC, +} + impl Architecture { /// The size of an address value for this architecture. /// @@ -59,6 +69,7 @@ impl Architecture { Architecture::Riscv64 => Some(AddressSize::U64), Architecture::S390x => Some(AddressSize::U64), Architecture::Sbf => Some(AddressSize::U64), + Architecture::Sharc => Some(AddressSize::U32), Architecture::Sparc64 => Some(AddressSize::U64), Architecture::Wasm32 => Some(AddressSize::U32), Architecture::Wasm64 => Some(AddressSize::U64), @@ -367,6 +378,30 @@ pub enum RelocationEncoding { /// /// The `RelocationKind` must be PC relative. LoongArchBranch, + + /// SHARC+ 48-bit Type A instruction + /// + /// Represents these possible variants, each with a corresponding + /// `R_SHARC_*` constant: + /// + /// * 24-bit absolute address + /// * 32-bit absolute address + /// * 6-bit relative address + /// * 24-bit relative address + /// * 6-bit absolute address in the immediate value field + /// * 16-bit absolute address in the immediate value field + SharcTypeA, + + /// SHARC+ 32-bit Type B instruction + /// + /// Represents these possible variants, each with a corresponding + /// `R_SHARC_*` constant: + /// + /// * 6-bit absolute address in the immediate value field + /// * 7-bit absolute address in the immediate value field + /// * 16-bit absolute address + /// * 6-bit relative address + SharcTypeB, } /// File flags that are specific to each file format. diff --git a/vendor/object/src/elf.rs b/vendor/object/src/elf.rs index f202c5989..f62017121 100644 --- a/vendor/object/src/elf.rs +++ b/vendor/object/src/elf.rs @@ -2207,6 +2207,114 @@ pub const R_386_IRELATIVE: u32 = 42; /// Load from 32 bit GOT entry, relaxable. pub const R_386_GOT32X: u32 = 43; +// ADI SHARC specific definitions + +// SHARC values for `Rel*::r_type` + +/// 24-bit absolute address in bits 23:0 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 25a (PC_DIRECT) +pub const R_SHARC_ADDR24_V3: u32 = 0x0b; + +/// 32-bit absolute address in bits 31:0 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 14a +/// * Type 14d +/// * Type 15a +/// * Type 16a +/// * Type 17a +/// * Type 18a +/// * Type 19a +pub const R_SHARC_ADDR32_V3: u32 = 0x0c; + +/// 32-bit absolute address in bits 31:0 of a 32-bit data location +/// +/// Represented with `RelocationEncoding::Generic` +pub const R_SHARC_ADDR_VAR_V3: u32 = 0x0d; + +/// 6-bit PC-relative address in bits 32:27 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 9a +/// * Type 10a +pub const R_SHARC_PCRSHORT_V3: u32 = 0x0e; + +/// 24-bit PC-relative address in bits 23:0 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 8a +/// * Type 12a (truncated to 23 bits after relocation) +/// * Type 13a (truncated to 23 bits after relocation) +/// * Type 25a (PC Relative) +pub const R_SHARC_PCRLONG_V3: u32 = 0x0f; + +/// 6-bit absolute address in bits 32:27 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 4a +/// * Type 4b +/// * Type 4d +pub const R_SHARC_DATA6_V3: u32 = 0x10; + +/// 16-bit absolute address in bits 39:24 of a 48-bit instr +/// +/// Targets: +/// +/// * Type 12a +pub const R_SHARC_DATA16_V3: u32 = 0x11; + +/// 6-bit absolute address into bits 16:11 of a 32-bit instr +/// +/// Targets: +/// +/// * Type 4b +pub const R_SHARC_DATA6_VISA_V3: u32 = 0x12; + +/// 7-bit absolute address into bits 6:0 of a 32-bit instr +pub const R_SHARC_DATA7_VISA_V3: u32 = 0x13; + +/// 16-bit absolute address into bits 15:0 of a 32-bit instr +pub const R_SHARC_DATA16_VISA_V3: u32 = 0x14; + +/// 6-bit PC-relative address into bits 16:11 of a Type B +/// +/// Targets: +/// +/// * Type 9b +pub const R_SHARC_PCR6_VISA_V3: u32 = 0x17; + +/// 16-bit absolute address into bits 15:0 of a 16-bit location. +/// +/// Represented with `RelocationEncoding::Generic` +pub const R_SHARC_ADDR_VAR16_V3: u32 = 0x19; + +pub const R_SHARC_CALC_PUSH_ADDR: u32 = 0xe0; +pub const R_SHARC_CALC_PUSH_ADDEND: u32 = 0xe1; +pub const R_SHARC_CALC_ADD: u32 = 0xe2; +pub const R_SHARC_CALC_SUB: u32 = 0xe3; +pub const R_SHARC_CALC_MUL: u32 = 0xe4; +pub const R_SHARC_CALC_DIV: u32 = 0xe5; +pub const R_SHARC_CALC_MOD: u32 = 0xe6; +pub const R_SHARC_CALC_LSHIFT: u32 = 0xe7; +pub const R_SHARC_CALC_RSHIFT: u32 = 0xe8; +pub const R_SHARC_CALC_AND: u32 = 0xe9; +pub const R_SHARC_CALC_OR: u32 = 0xea; +pub const R_SHARC_CALC_XOR: u32 = 0xeb; +pub const R_SHARC_CALC_PUSH_LEN: u32 = 0xec; +pub const R_SHARC_CALC_NOT: u32 = 0xf6; + +// SHARC values for `SectionHeader*::sh_type`. + +/// .adi.attributes +pub const SHT_SHARC_ADI_ATTRIBUTES: u32 = SHT_LOPROC + 0x2; + // SUN SPARC specific definitions. // SPARC values for `st_type` component of `Sym*::st_info`. @@ -4088,14 +4196,14 @@ pub const R_ARM_PC13: u32 = 4; pub const R_ARM_ABS16: u32 = 5; /// Direct 12 bit pub const R_ARM_ABS12: u32 = 6; -/// Direct & 0x7C (LDR, STR). +/// Direct & 0x7C (`LDR`, `STR`). pub const R_ARM_THM_ABS5: u32 = 7; /// Direct 8 bit pub const R_ARM_ABS8: u32 = 8; pub const R_ARM_SBREL32: u32 = 9; -/// PC relative 24 bit (Thumb32 BL). +/// PC relative 24 bit (Thumb32 `BL`). pub const R_ARM_THM_PC22: u32 = 10; -/// PC relative & 0x3FC (Thumb16 LDR, ADD, ADR). +/// PC relative & 0x3FC (Thumb16 `LDR`, `ADD`, `ADR`). pub const R_ARM_THM_PC8: u32 = 11; pub const R_ARM_AMP_VCALL9: u32 = 12; /// Obsolete static relocation. @@ -4130,11 +4238,11 @@ pub const R_ARM_GOTPC: u32 = 25; pub const R_ARM_GOT32: u32 = 26; /// Deprecated, 32 bit PLT address. pub const R_ARM_PLT32: u32 = 27; -/// PC relative 24 bit (BL, BLX). +/// PC relative 24 bit (`BL`, `BLX`). pub const R_ARM_CALL: u32 = 28; -/// PC relative 24 bit (B, BL). +/// PC relative 24 bit (`B`, `BL`). pub const R_ARM_JUMP24: u32 = 29; -/// PC relative 24 bit (Thumb32 B.W). +/// PC relative 24 bit (Thumb32 `B.W`). pub const R_ARM_THM_JUMP24: u32 = 30; /// Adjust by program base. pub const R_ARM_BASE_ABS: u32 = 31; @@ -4157,99 +4265,99 @@ pub const R_ARM_V4BX: u32 = 40; pub const R_ARM_TARGET2: u32 = 41; /// 32 bit PC relative. pub const R_ARM_PREL31: u32 = 42; -/// Direct 16-bit (MOVW). +/// Direct 16-bit (`MOVW`). pub const R_ARM_MOVW_ABS_NC: u32 = 43; -/// Direct high 16-bit (MOVT). +/// Direct high 16-bit (`MOVT`). pub const R_ARM_MOVT_ABS: u32 = 44; -/// PC relative 16-bit (MOVW). +/// PC relative 16-bit (`MOVW`). pub const R_ARM_MOVW_PREL_NC: u32 = 45; /// PC relative (MOVT). pub const R_ARM_MOVT_PREL: u32 = 46; -/// Direct 16 bit (Thumb32 MOVW). +/// Direct 16 bit (Thumb32 `MOVW`). pub const R_ARM_THM_MOVW_ABS_NC: u32 = 47; -/// Direct high 16 bit (Thumb32 MOVT). +/// Direct high 16 bit (Thumb32 `MOVT`). pub const R_ARM_THM_MOVT_ABS: u32 = 48; -/// PC relative 16 bit (Thumb32 MOVW). +/// PC relative 16 bit (Thumb32 `MOVW`). pub const R_ARM_THM_MOVW_PREL_NC: u32 = 49; -/// PC relative high 16 bit (Thumb32 MOVT). +/// PC relative high 16 bit (Thumb32 `MOVT`). pub const R_ARM_THM_MOVT_PREL: u32 = 50; -/// PC relative 20 bit (Thumb32 B.W). +/// PC relative 20 bit (Thumb32 `B.W`). pub const R_ARM_THM_JUMP19: u32 = 51; -/// PC relative X & 0x7E (Thumb16 CBZ, CBNZ). +/// PC relative X & 0x7E (Thumb16 `CBZ`, `CBNZ`). pub const R_ARM_THM_JUMP6: u32 = 52; -/// PC relative 12 bit (Thumb32 ADR.W). +/// PC relative 12 bit (Thumb32 `ADR.W`). pub const R_ARM_THM_ALU_PREL_11_0: u32 = 53; -/// PC relative 12 bit (Thumb32 LDR{D,SB,H,SH}). +/// PC relative 12 bit (Thumb32 `LDR{D,SB,H,SH}`). pub const R_ARM_THM_PC12: u32 = 54; /// Direct 32-bit. pub const R_ARM_ABS32_NOI: u32 = 55; /// PC relative 32-bit. pub const R_ARM_REL32_NOI: u32 = 56; -/// PC relative (ADD, SUB). +/// PC relative (`ADD`, `SUB`). pub const R_ARM_ALU_PC_G0_NC: u32 = 57; -/// PC relative (ADD, SUB). +/// PC relative (`ADD`, `SUB`). pub const R_ARM_ALU_PC_G0: u32 = 58; -/// PC relative (ADD, SUB). +/// PC relative (`ADD`, `SUB`). pub const R_ARM_ALU_PC_G1_NC: u32 = 59; -/// PC relative (ADD, SUB). +/// PC relative (`ADD`, `SUB`). pub const R_ARM_ALU_PC_G1: u32 = 60; -/// PC relative (ADD, SUB). +/// PC relative (`ADD`, `SUB`). pub const R_ARM_ALU_PC_G2: u32 = 61; -/// PC relative (LDR,STR,LDRB,STRB). +/// PC relative (`LDR`,`STR`,`LDRB`,`STRB`). pub const R_ARM_LDR_PC_G1: u32 = 62; -/// PC relative (LDR,STR,LDRB,STRB). +/// PC relative (`LDR`,`STR`,`LDRB`,`STRB`). pub const R_ARM_LDR_PC_G2: u32 = 63; -/// PC relative (STR{D,H}, LDR{D,SB,H,SH}). +/// PC relative (`STR{D,H}`, `LDR{D,SB,H,SH}`). pub const R_ARM_LDRS_PC_G0: u32 = 64; -/// PC relative (STR{D,H}, LDR{D,SB,H,SH}). +/// PC relative (`STR{D,H}`, `LDR{D,SB,H,SH}`). pub const R_ARM_LDRS_PC_G1: u32 = 65; -/// PC relative (STR{D,H}, LDR{D,SB,H,SH}). +/// PC relative (`STR{D,H}`, `LDR{D,SB,H,SH}`). pub const R_ARM_LDRS_PC_G2: u32 = 66; -/// PC relative (LDC, STC). +/// PC relative (`LDC`, `STC`). pub const R_ARM_LDC_PC_G0: u32 = 67; -/// PC relative (LDC, STC). +/// PC relative (`LDC`, `STC`). pub const R_ARM_LDC_PC_G1: u32 = 68; -/// PC relative (LDC, STC). +/// PC relative (`LDC`, `STC`). pub const R_ARM_LDC_PC_G2: u32 = 69; -/// Program base relative (ADD,SUB). +/// Program base relative (`ADD`,`SUB`). pub const R_ARM_ALU_SB_G0_NC: u32 = 70; -/// Program base relative (ADD,SUB). +/// Program base relative (`ADD`,`SUB`). pub const R_ARM_ALU_SB_G0: u32 = 71; -/// Program base relative (ADD,SUB). +/// Program base relative (`ADD`,`SUB`). pub const R_ARM_ALU_SB_G1_NC: u32 = 72; -/// Program base relative (ADD,SUB). +/// Program base relative (`ADD`,`SUB`). pub const R_ARM_ALU_SB_G1: u32 = 73; -/// Program base relative (ADD,SUB). +/// Program base relative (`ADD`,`SUB`). pub const R_ARM_ALU_SB_G2: u32 = 74; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDR_SB_G0: u32 = 75; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDR_SB_G1: u32 = 76; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDR_SB_G2: u32 = 77; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDRS_SB_G0: u32 = 78; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDRS_SB_G1: u32 = 79; -/// Program base relative (LDR, STR, LDRB, STRB). +/// Program base relative (`LDR`, `STR`, `LDRB`, `STRB`). pub const R_ARM_LDRS_SB_G2: u32 = 80; -/// Program base relative (LDC,STC). +/// Program base relative (`LDC`,`STC`). pub const R_ARM_LDC_SB_G0: u32 = 81; -/// Program base relative (LDC,STC). +/// Program base relative (`LDC`,`STC`). pub const R_ARM_LDC_SB_G1: u32 = 82; -/// Program base relative (LDC,STC). +/// Program base relative (`LDC`,`STC`). pub const R_ARM_LDC_SB_G2: u32 = 83; -/// Program base relative 16 bit (MOVW). +/// Program base relative 16 bit (`MOVW`). pub const R_ARM_MOVW_BREL_NC: u32 = 84; -/// Program base relative high 16 bit (MOVT). +/// Program base relative high 16 bit (`MOVT`). pub const R_ARM_MOVT_BREL: u32 = 85; -/// Program base relative 16 bit (MOVW). +/// Program base relative 16 bit (`MOVW`). pub const R_ARM_MOVW_BREL: u32 = 86; -/// Program base relative 16 bit (Thumb32 MOVW). +/// Program base relative 16 bit (Thumb32 `MOVW`). pub const R_ARM_THM_MOVW_BREL_NC: u32 = 87; -/// Program base relative high 16 bit (Thumb32 MOVT). +/// Program base relative high 16 bit (Thumb32 `MOVT`). pub const R_ARM_THM_MOVT_BREL: u32 = 88; -/// Program base relative 16 bit (Thumb32 MOVW). +/// Program base relative 16 bit (Thumb32 `MOVW`). pub const R_ARM_THM_MOVW_BREL: u32 = 89; pub const R_ARM_TLS_GOTDESC: u32 = 90; pub const R_ARM_TLS_CALL: u32 = 91; @@ -4261,16 +4369,16 @@ pub const R_ARM_PLT32_ABS: u32 = 94; pub const R_ARM_GOT_ABS: u32 = 95; /// PC relative GOT entry. pub const R_ARM_GOT_PREL: u32 = 96; -/// GOT entry relative to GOT origin (LDR). +/// GOT entry relative to GOT origin (`LDR`). pub const R_ARM_GOT_BREL12: u32 = 97; -/// 12 bit, GOT entry relative to GOT origin (LDR, STR). +/// 12 bit, GOT entry relative to GOT origin (`LDR`, `STR`). pub const R_ARM_GOTOFF12: u32 = 98; pub const R_ARM_GOTRELAX: u32 = 99; pub const R_ARM_GNU_VTENTRY: u32 = 100; pub const R_ARM_GNU_VTINHERIT: u32 = 101; -/// PC relative & 0xFFE (Thumb16 B). +/// PC relative & 0xFFE (Thumb16 `B`). pub const R_ARM_THM_PC11: u32 = 102; -/// PC relative & 0x1FE (Thumb16 B/B). +/// PC relative & 0x1FE (Thumb16 `B`/`B`). pub const R_ARM_THM_PC9: u32 = 103; /// PC-rel 32 bit for global dynamic thread local data pub const R_ARM_TLS_GD32: u32 = 104; @@ -4282,18 +4390,18 @@ pub const R_ARM_TLS_LDO32: u32 = 106; pub const R_ARM_TLS_IE32: u32 = 107; /// 32 bit offset relative to static TLS block pub const R_ARM_TLS_LE32: u32 = 108; -/// 12 bit relative to TLS block (LDR, STR). +/// 12 bit relative to TLS block (`LDR`, `STR`). pub const R_ARM_TLS_LDO12: u32 = 109; -/// 12 bit relative to static TLS block (LDR, STR). +/// 12 bit relative to static TLS block (`LDR`, `STR`). pub const R_ARM_TLS_LE12: u32 = 110; -/// 12 bit GOT entry relative to GOT origin (LDR). +/// 12 bit GOT entry relative to GOT origin (`LDR`). pub const R_ARM_TLS_IE12GP: u32 = 111; /// Obsolete. pub const R_ARM_ME_TOO: u32 = 128; pub const R_ARM_THM_TLS_DESCSEQ: u32 = 129; pub const R_ARM_THM_TLS_DESCSEQ16: u32 = 129; pub const R_ARM_THM_TLS_DESCSEQ32: u32 = 130; -/// GOT entry relative to GOT origin, 12 bit (Thumb32 LDR). +/// GOT entry relative to GOT origin, 12 bit (Thumb32 `LDR`). pub const R_ARM_THM_GOT_BREL12: u32 = 131; pub const R_ARM_IRELATIVE: u32 = 160; pub const R_ARM_RXPC25: u32 = 249; @@ -6053,8 +6161,30 @@ pub const R_LARCH_TLS_GD_HI20: u32 = 98; /// 32-bit PC relative pub const R_LARCH_32_PCREL: u32 = 99; /// Paired with a normal relocation at the same address to indicate the -/// insturction can be relaxed +/// instruction can be relaxed pub const R_LARCH_RELAX: u32 = 100; +/// Reserved +pub const R_LARCH_DELETE: u32 = 101; +/// Delete some bytes to ensure the instruction at PC + A aligned to +/// `A.next_power_of_two()`-byte boundary +pub const R_LARCH_ALIGN: u32 = 102; +/// 22-bit PC-relative offset with two trailing zeros +pub const R_LARCH_PCREL20_S2: u32 = 103; +/// Reserved +pub const R_LARCH_CFA: u32 = 104; +/// 6-bit in-place addition +pub const R_LARCH_ADD6: u32 = 105; +/// 6-bit in-place subtraction +pub const R_LARCH_SUB6: u32 = 106; +/// LEB128 in-place addition +pub const R_LARCH_ADD_ULEB128: u32 = 107; +/// LEB128 in-place subtraction +pub const R_LARCH_SUB_ULEB128: u32 = 108; +/// 64-bit PC relative +pub const R_LARCH_64_PCREL: u32 = 109; +/// 18..=37 bits of `S + A - PC` into the `pcaddu18i` instruction at `PC`, +/// and 2..=17 bits of `S + A - PC` into the `jirl` instruction at `PC + 4` +pub const R_LARCH_CALL36: u32 = 110; // Xtensa values Rel*::r_type`. pub const R_XTENSA_NONE: u32 = 0; diff --git a/vendor/object/src/lib.rs b/vendor/object/src/lib.rs index e17802c4f..5956e06d8 100644 --- a/vendor/object/src/lib.rs +++ b/vendor/object/src/lib.rs @@ -8,52 +8,34 @@ //! //! Raw structs are defined for: [ELF](elf), [Mach-O](macho), [PE/COFF](pe), //! [XCOFF](xcoff), [archive]. -//! Types and traits for zerocopy support are defined in [pod] and [endian]. +//! Types and traits for zerocopy support are defined in the [`pod`] and [`endian`] modules. //! //! ## Unified read API //! -//! The [read::Object] trait defines the unified interface. This trait is implemented -//! by [read::File], which allows reading any file format, as well as implementations -//! for each file format: [ELF](read::elf::ElfFile), [Mach-O](read::macho::MachOFile), -//! [COFF](read::coff::CoffFile), [PE](read::pe::PeFile), [Wasm](read::wasm::WasmFile), -//! [XCOFF](read::xcoff::XcoffFile). +//! The [`read`] module provides a unified read API using the [`read::Object`] trait. +//! There is an implementation of this trait for [`read::File`], which allows reading any +//! file format, as well as implementations for each file format. //! //! ## Low level read API //! -//! In addition to the unified read API, the various `read` modules define helpers that -//! operate on the raw structs. These also provide traits that abstract over the differences -//! between 32-bit and 64-bit versions of the file format. +//! The [`read#modules`] submodules define helpers that operate on the raw structs. +//! These can be used instead of the unified API, or in conjunction with it to access +//! details that are not available via the unified API. //! //! ## Unified write API //! -//! [write::Object] allows building a COFF/ELF/Mach-O/XCOFF relocatable object file and -//! then writing it out. +//! The [`mod@write`] module provides a unified write API for relocatable object files +//! using [`write::Object`]. This does not support writing executable files. //! -//! ## Low level executable writers +//! ## Low level write API //! -//! [write::elf::Writer] and [write::pe::Writer] allow writing executable files. +//! The [`mod@write#modules`] submodules define helpers for writing the raw structs. //! -//! ## Example for unified read API -//! ```no_run -//! # #[cfg(feature = "read")] -//! use object::{Object, ObjectSection}; -//! use std::error::Error; -//! use std::fs; +//! ## Shared definitions //! -//! /// Reads a file and displays the content of the ".boot" section. -//! fn main() -> Result<(), Box> { -//! # #[cfg(all(feature = "read", feature = "std"))] { -//! let bin_data = fs::read("./multiboot2-binary.elf")?; -//! let obj_file = object::File::parse(&*bin_data)?; -//! if let Some(section) = obj_file.section_by_name(".boot") { -//! println!("{:#x?}", section.data()?); -//! } else { -//! eprintln!("section not available"); -//! } -//! # } -//! Ok(()) -//! } -//! ``` +//! The crate provides a number of definitions that are used by both the read and write +//! APIs. These are defined at the top level module, but none of these are the main entry +//! points of the crate. #![deny(missing_docs)] #![deny(missing_debug_implementations)] @@ -62,6 +44,7 @@ // Style. #![allow(clippy::collapsible_if)] #![allow(clippy::comparison_chain)] +#![allow(clippy::manual_flatten)] #![allow(clippy::match_like_matches_macro)] #![allow(clippy::single_match)] #![allow(clippy::type_complexity)] diff --git a/vendor/object/src/pe.rs b/vendor/object/src/pe.rs index f274d2270..64ccf0696 100644 --- a/vendor/object/src/pe.rs +++ b/vendor/object/src/pe.rs @@ -359,6 +359,8 @@ pub const IMAGE_FILE_MACHINE_AMD64: u16 = 0x8664; pub const IMAGE_FILE_MACHINE_M32R: u16 = 0x9041; /// ARM64 Little-Endian pub const IMAGE_FILE_MACHINE_ARM64: u16 = 0xAA64; +/// ARM64EC ("Emulation Compatible") +pub const IMAGE_FILE_MACHINE_ARM64EC: u16 = 0xA641; pub const IMAGE_FILE_MACHINE_CEE: u16 = 0xC0EE; /// RISCV32 pub const IMAGE_FILE_MACHINE_RISCV32: u16 = 0x5032; diff --git a/vendor/object/src/read/any.rs b/vendor/object/src/read/any.rs index 2e147c672..a14e56d39 100644 --- a/vendor/object/src/read/any.rs +++ b/vendor/object/src/read/any.rs @@ -22,7 +22,7 @@ use crate::read::{ SymbolMap, SymbolMapName, SymbolScope, SymbolSection, }; #[allow(unused_imports)] -use crate::{AddressSize, Endian, Endianness}; +use crate::{AddressSize, Endian, Endianness, SubArchitecture}; /// Evaluate an expression on the contents of a file format enum. /// @@ -204,9 +204,9 @@ macro_rules! next_inner { }; } -/// An object file. +/// An object file that can be any supported file format. /// -/// Most functionality is provided by the `Object` trait implementation. +/// Most functionality is provided by the [`Object`] trait implementation. #[derive(Debug)] #[non_exhaustive] #[allow(missing_docs)] @@ -323,6 +323,10 @@ where with_inner!(self, File, |x| x.architecture()) } + fn sub_architecture(&self) -> Option { + with_inner!(self, File, |x| x.sub_architecture()) + } + fn is_little_endian(&self) -> bool { with_inner!(self, File, |x| x.is_little_endian()) } @@ -481,7 +485,7 @@ where } } -/// An iterator over the segments of a `File`. +/// An iterator for the loadable segments in a [`File`]. #[derive(Debug)] pub struct SegmentIterator<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: SegmentIteratorInternal<'data, 'file, R>, @@ -522,7 +526,9 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for SegmentIterator<'data, 'file, } } -/// A segment of a `File`. +/// A loadable segment in a [`File`]. +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. pub struct Segment<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: SegmentInternal<'data, 'file, R>, } @@ -612,7 +618,7 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectSegment<'data> for Segment<'data, 'f } } -/// An iterator of the sections of a `File`. +/// An iterator for the sections in a [`File`]. #[derive(Debug)] pub struct SectionIterator<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: SectionIteratorInternal<'data, 'file, R>, @@ -654,7 +660,9 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for SectionIterator<'data, 'file, } } -/// A Section of a File +/// A section in a [`File`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. pub struct Section<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: SectionInternal<'data, 'file, R>, } @@ -784,7 +792,7 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectSection<'data> for Section<'data, 'f } } -/// An iterator of the COMDAT section groups of a `File`. +/// An iterator for the COMDAT section groups in a [`File`]. #[derive(Debug)] pub struct ComdatIterator<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: ComdatIteratorInternal<'data, 'file, R>, @@ -825,7 +833,9 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for ComdatIterator<'data, 'file, } } -/// A COMDAT section group of a `File`. +/// A COMDAT section group in a [`File`]. +/// +/// Most functionality is provided by the [`ObjectComdat`] trait implementation. pub struct Comdat<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: ComdatInternal<'data, 'file, R>, } @@ -898,7 +908,7 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectComdat<'data> for Comdat<'data, 'fil } } -/// An iterator over COMDAT section entries. +/// An iterator for the sections in a [`Comdat`]. #[derive(Debug)] pub struct ComdatSectionIterator<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: ComdatSectionIteratorInternal<'data, 'file, R>, @@ -938,7 +948,9 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for ComdatSectionIterator<'data, } } -/// A symbol table. +/// A symbol table in a [`File`]. +/// +/// Most functionality is provided by the [`ObjectSymbolTable`] trait implementation. #[derive(Debug)] pub struct SymbolTable<'data, 'file, R = &'data [u8]> where @@ -1022,7 +1034,7 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectSymbolTable<'data> for SymbolTable<' } } -/// An iterator over symbol table entries. +/// An iterator for the symbols in a [`SymbolTable`]. #[derive(Debug)] pub struct SymbolIterator<'data, 'file, R = &'data [u8]> where @@ -1101,7 +1113,9 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for SymbolIterator<'data, 'file, } } -/// A symbol table entry. +/// An symbol in a [`SymbolTable`]. +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. pub struct Symbol<'data, 'file, R = &'data [u8]> where R: ReadRef<'data>, @@ -1236,7 +1250,7 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectSymbol<'data> for Symbol<'data, 'fil } } -/// An iterator over dynamic relocation entries. +/// An iterator for the dynamic relocation entries in a [`File`]. #[derive(Debug)] pub struct DynamicRelocationIterator<'data, 'file, R = &'data [u8]> where @@ -1273,7 +1287,7 @@ impl<'data, 'file, R: ReadRef<'data>> Iterator for DynamicRelocationIterator<'da } } -/// An iterator over section relocation entries. +/// An iterator for the relocation entries in a [`Section`]. #[derive(Debug)] pub struct SectionRelocationIterator<'data, 'file, R: ReadRef<'data> = &'data [u8]> { inner: SectionRelocationIteratorInternal<'data, 'file, R>, diff --git a/vendor/object/src/read/archive.rs b/vendor/object/src/read/archive.rs index f5aaa9b19..5d4ec4a4a 100644 --- a/vendor/object/src/read/archive.rs +++ b/vendor/object/src/read/archive.rs @@ -1,4 +1,24 @@ //! Support for archive files. +//! +//! ## Example +//! ```no_run +//! use object::{Object, ObjectSection}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads an archive and displays the name of each member. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let file = object::read::archive::ArchiveFile::parse(&*data)?; +//! for member in file.members() { +//! let member = member?; +//! println!("{}", String::from_utf8_lossy(member.name())); +//! } +//! # } +//! Ok(()) +//! } +//! ``` use core::convert::TryInto; diff --git a/vendor/object/src/read/coff/comdat.rs b/vendor/object/src/read/coff/comdat.rs index 22e061a23..90c29be63 100644 --- a/vendor/object/src/read/coff/comdat.rs +++ b/vendor/object/src/read/coff/comdat.rs @@ -8,11 +8,11 @@ use crate::read::{ use super::{CoffFile, CoffHeader, ImageSymbol}; -/// An iterator over the COMDAT section groups of a `CoffBigFile`. +/// An iterator for the COMDAT section groups in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigComdatIterator<'data, 'file, R = &'data [u8]> = CoffComdatIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the COMDAT section groups of a `CoffFile`. +/// An iterator for the COMDAT section groups in a [`CoffFile`]. #[derive(Debug)] pub struct CoffComdatIterator< 'data, @@ -41,11 +41,15 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator } } -/// A COMDAT section group of a `CoffBigFile`. +/// A COMDAT section group in a [`CoffBigFile`](super::CoffBigFile). +/// +/// Most functionality is provided by the [`ObjectComdat`] trait implementation. pub type CoffBigComdat<'data, 'file, R = &'data [u8]> = CoffComdat<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// A COMDAT section group of a `CoffFile`. +/// A COMDAT section group in a [`CoffFile`]. +/// +/// Most functionality is provided by the [`ObjectComdat`] trait implementation. #[derive(Debug)] pub struct CoffComdat< 'data, @@ -150,11 +154,11 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectComdat<'data> } } -/// An iterator over the sections in a COMDAT section group of a `CoffBigFile`. +/// An iterator for the sections in a COMDAT section group in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigComdatSectionIterator<'data, 'file, R = &'data [u8]> = CoffComdatSectionIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the sections in a COMDAT section group of a `CoffFile`. +/// An iterator for the sections in a COMDAT section group in a [`CoffFile`]. #[derive(Debug)] pub struct CoffComdatSectionIterator< 'data, diff --git a/vendor/object/src/read/coff/file.rs b/vendor/object/src/read/coff/file.rs index 4219f8f02..40b9e7081 100644 --- a/vendor/object/src/read/coff/file.rs +++ b/vendor/object/src/read/coff/file.rs @@ -3,7 +3,7 @@ use core::fmt::Debug; use crate::read::{ self, Architecture, Export, FileFlags, Import, NoDynamicRelocationIterator, Object, ObjectKind, - ObjectSection, ReadError, ReadRef, Result, SectionIndex, SymbolIndex, + ObjectSection, ReadError, ReadRef, Result, SectionIndex, SubArchitecture, SymbolIndex, }; use crate::{pe, LittleEndian as LE, Pod}; @@ -22,9 +22,19 @@ pub(crate) struct CoffCommon<'data, R: ReadRef<'data>, Coff: CoffHeader = pe::Im } /// A COFF bigobj object file with 32-bit section numbers. +/// +/// This is a file that starts with [`pe::AnonObjectHeaderBigobj`], and corresponds +/// to [`crate::FileKind::CoffBig`]. +/// +/// Most functionality is provided by the [`Object`] trait implementation. pub type CoffBigFile<'data, R = &'data [u8]> = CoffFile<'data, R, pe::AnonObjectHeaderBigobj>; /// A COFF object file. +/// +/// This is a file that starts with [`pe::ImageFileHeader`], and corresponds +/// to [`crate::FileKind::Coff`]. +/// +/// Most functionality is provided by the [`Object`] trait implementation. #[derive(Debug)] pub struct CoffFile<'data, R: ReadRef<'data> = &'data [u8], Coff: CoffHeader = pe::ImageFileHeader> { @@ -78,13 +88,20 @@ where fn architecture(&self) -> Architecture { match self.header.machine() { pe::IMAGE_FILE_MACHINE_ARMNT => Architecture::Arm, - pe::IMAGE_FILE_MACHINE_ARM64 => Architecture::Aarch64, + pe::IMAGE_FILE_MACHINE_ARM64 | pe::IMAGE_FILE_MACHINE_ARM64EC => Architecture::Aarch64, pe::IMAGE_FILE_MACHINE_I386 => Architecture::I386, pe::IMAGE_FILE_MACHINE_AMD64 => Architecture::X86_64, _ => Architecture::Unknown, } } + fn sub_architecture(&self) -> Option { + match self.header.machine() { + pe::IMAGE_FILE_MACHINE_ARM64EC => Some(SubArchitecture::Arm64EC), + _ => None, + } + } + #[inline] fn is_little_endian(&self) -> bool { true @@ -215,7 +232,7 @@ where } } -/// Read the `class_id` field from an anon object header. +/// Read the `class_id` field from a [`pe::AnonObjectHeader`]. /// /// This can be used to determine the format of the header. pub fn anon_object_class_id<'data, R: ReadRef<'data>>(data: R) -> Result { @@ -225,13 +242,13 @@ pub fn anon_object_class_id<'data, R: ReadRef<'data>>(data: R) -> Result bool; diff --git a/vendor/object/src/read/coff/import.rs b/vendor/object/src/read/coff/import.rs index d635e7592..a296ac31d 100644 --- a/vendor/object/src/read/coff/import.rs +++ b/vendor/object/src/read/coff/import.rs @@ -4,12 +4,15 @@ //! dynamically imported symbols. use crate::read::{Architecture, Error, ReadError, ReadRef, Result}; -use crate::{pe, ByteString, Bytes, LittleEndian as LE}; +use crate::{pe, ByteString, Bytes, LittleEndian as LE, SubArchitecture}; /// A Windows short form description of a symbol to import. /// /// Used in Windows import libraries to provide a mapping from /// a symbol name to a DLL export. This is not an object file. +/// +/// This is a file that starts with [`pe::ImportObjectHeader`], and corresponds +/// to [`crate::FileKind::CoffImport`]. #[derive(Debug, Clone)] pub struct ImportFile<'data> { header: &'data pe::ImportObjectHeader, @@ -64,13 +67,21 @@ impl<'data> ImportFile<'data> { pub fn architecture(&self) -> Architecture { match self.header.machine.get(LE) { pe::IMAGE_FILE_MACHINE_ARMNT => Architecture::Arm, - pe::IMAGE_FILE_MACHINE_ARM64 => Architecture::Aarch64, + pe::IMAGE_FILE_MACHINE_ARM64 | pe::IMAGE_FILE_MACHINE_ARM64EC => Architecture::Aarch64, pe::IMAGE_FILE_MACHINE_I386 => Architecture::I386, pe::IMAGE_FILE_MACHINE_AMD64 => Architecture::X86_64, _ => Architecture::Unknown, } } + /// Get the sub machine type, if available. + pub fn sub_architecture(&self) -> Option { + match self.header.machine.get(LE) { + pe::IMAGE_FILE_MACHINE_ARM64EC => Some(SubArchitecture::Arm64EC), + _ => None, + } + } + /// The public symbol name. pub fn symbol(&self) -> &'data [u8] { self.symbol.0 @@ -181,7 +192,7 @@ impl pe::ImportObjectHeader { } } -/// The data following `ImportObjectHeader`. +/// The data following [`pe::ImportObjectHeader`]. #[derive(Debug, Clone)] pub struct ImportObjectData<'data> { symbol: ByteString<'data>, diff --git a/vendor/object/src/read/coff/mod.rs b/vendor/object/src/read/coff/mod.rs index 26020d797..de397da0a 100644 --- a/vendor/object/src/read/coff/mod.rs +++ b/vendor/object/src/read/coff/mod.rs @@ -1,6 +1,51 @@ //! Support for reading Windows COFF files. //! -//! Provides `CoffFile` and related types which implement the `Object` trait. +//! Traits are used to abstract over the difference between COFF object files +//! and COFF bigobj files. The primary trait for this is [`CoffHeader`]. +//! +//! ## High level API +//! +//! [`CoffFile`] implements the [`Object`](crate::read::Object) trait for +//! COFF files. [`CoffFile`] is parameterised by [`CoffHeader`]. +//! The default parameter allows reading regular COFF object files, +//! while the type alias [`CoffBigFile`] allows reading COFF bigobj files. +//! +//! [`ImportFile`] allows reading COFF short imports that are used in import +//! libraries. Currently these are not integrated with the unified read API. +//! +//! ## Low level API +//! +//! The [`CoffHeader`] trait can be directly used to parse both COFF +//! object files (which start with [`pe::ImageFileHeader`]) and COFF bigobj +//! files (which start with [`pe::AnonObjectHeaderBigobj`]). +//! +//! ### Example for low level API +//! ```no_run +//! use object::pe; +//! use object::read::coff::{CoffHeader, ImageSymbol as _}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each section and symbol. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let mut offset = 0; +//! let header = pe::ImageFileHeader::parse(&*data, &mut offset)?; +//! let sections = header.sections(&*data, offset)?; +//! let symbols = header.symbols(&*data)?; +//! for section in sections.iter() { +//! println!("{}", String::from_utf8_lossy(section.name(symbols.strings())?)); +//! } +//! for (_index, symbol) in symbols.iter() { +//! println!("{}", String::from_utf8_lossy(symbol.name(symbols.strings())?)); +//! } +//! # } +//! Ok(()) +//! } +//! ``` +#[cfg(doc)] +use crate::pe; mod file; pub use file::*; diff --git a/vendor/object/src/read/coff/relocation.rs b/vendor/object/src/read/coff/relocation.rs index 44d2c68d0..e99094487 100644 --- a/vendor/object/src/read/coff/relocation.rs +++ b/vendor/object/src/read/coff/relocation.rs @@ -9,11 +9,11 @@ use crate::read::{ use super::{CoffFile, CoffHeader}; -/// An iterator over the relocations in a `CoffBigSection`. +/// An iterator for the relocations in a [`CoffBigSection`](super::CoffBigSection). pub type CoffBigRelocationIterator<'data, 'file, R = &'data [u8]> = CoffRelocationIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the relocations in a `CoffSection`. +/// An iterator for the relocations in a [`CoffSection`](super::CoffSection). pub struct CoffRelocationIterator< 'data, 'file, @@ -40,15 +40,17 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator pe::IMAGE_REL_ARM_SECREL => (RelocationKind::SectionOffset, 32, 0), typ => (RelocationKind::Coff(typ), 0, 0), }, - pe::IMAGE_FILE_MACHINE_ARM64 => match relocation.typ.get(LE) { - pe::IMAGE_REL_ARM64_ADDR32 => (RelocationKind::Absolute, 32, 0), - pe::IMAGE_REL_ARM64_ADDR32NB => (RelocationKind::ImageOffset, 32, 0), - pe::IMAGE_REL_ARM64_SECREL => (RelocationKind::SectionOffset, 32, 0), - pe::IMAGE_REL_ARM64_SECTION => (RelocationKind::SectionIndex, 16, 0), - pe::IMAGE_REL_ARM64_ADDR64 => (RelocationKind::Absolute, 64, 0), - pe::IMAGE_REL_ARM64_REL32 => (RelocationKind::Relative, 32, -4), - typ => (RelocationKind::Coff(typ), 0, 0), - }, + pe::IMAGE_FILE_MACHINE_ARM64 | pe::IMAGE_FILE_MACHINE_ARM64EC => { + match relocation.typ.get(LE) { + pe::IMAGE_REL_ARM64_ADDR32 => (RelocationKind::Absolute, 32, 0), + pe::IMAGE_REL_ARM64_ADDR32NB => (RelocationKind::ImageOffset, 32, 0), + pe::IMAGE_REL_ARM64_SECREL => (RelocationKind::SectionOffset, 32, 0), + pe::IMAGE_REL_ARM64_SECTION => (RelocationKind::SectionIndex, 16, 0), + pe::IMAGE_REL_ARM64_ADDR64 => (RelocationKind::Absolute, 64, 0), + pe::IMAGE_REL_ARM64_REL32 => (RelocationKind::Relative, 32, -4), + typ => (RelocationKind::Coff(typ), 0, 0), + } + } pe::IMAGE_FILE_MACHINE_I386 => match relocation.typ.get(LE) { pe::IMAGE_REL_I386_DIR16 => (RelocationKind::Absolute, 16, 0), pe::IMAGE_REL_I386_REL16 => (RelocationKind::Relative, 16, 0), diff --git a/vendor/object/src/read/coff/section.rs b/vendor/object/src/read/coff/section.rs index 75804034b..84a3fa983 100644 --- a/vendor/object/src/read/coff/section.rs +++ b/vendor/object/src/read/coff/section.rs @@ -12,6 +12,9 @@ use crate::read::{ use super::{CoffFile, CoffHeader, CoffRelocationIterator}; /// The table of section headers in a COFF or PE file. +/// +/// Returned by [`CoffHeader::sections`] and +/// [`ImageNtHeaders::sections`](crate::read::pe::ImageNtHeaders::sections). #[derive(Debug, Default, Clone, Copy)] pub struct SectionTable<'data> { sections: &'data [pe::ImageSectionHeader], @@ -104,11 +107,11 @@ impl<'data> SectionTable<'data> { } } -/// An iterator over the loadable sections of a `CoffBigFile`. +/// An iterator for the loadable sections in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigSegmentIterator<'data, 'file, R = &'data [u8]> = CoffSegmentIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the loadable sections of a `CoffFile`. +/// An iterator for the loadable sections in a [`CoffFile`]. #[derive(Debug)] pub struct CoffSegmentIterator< 'data, @@ -133,11 +136,15 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator } } -/// A loadable section of a `CoffBigFile`. +/// A loadable section in a [`CoffBigFile`](super::CoffBigFile). +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. pub type CoffBigSegment<'data, 'file, R = &'data [u8]> = CoffSegment<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// A loadable section of a `CoffFile`. +/// A loadable section in a [`CoffFile`]. +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. #[derive(Debug)] pub struct CoffSegment< 'data, @@ -222,11 +229,11 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectSegment<'data> } } -/// An iterator over the sections of a `CoffBigFile`. +/// An iterator for the sections in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigSectionIterator<'data, 'file, R = &'data [u8]> = CoffSectionIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the sections of a `CoffFile`. +/// An iterator for the sections in a [`CoffFile`]. #[derive(Debug)] pub struct CoffSectionIterator< 'data, @@ -252,11 +259,15 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator } } -/// A section of a `CoffBigFile`. +/// A section in a [`CoffBigFile`](super::CoffBigFile). +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. pub type CoffBigSection<'data, 'file, R = &'data [u8]> = CoffSection<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// A section of a `CoffFile`. +/// A section in a [`CoffFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct CoffSection< 'data, diff --git a/vendor/object/src/read/coff/symbol.rs b/vendor/object/src/read/coff/symbol.rs index e95468d7e..4f8a0c6e8 100644 --- a/vendor/object/src/read/coff/symbol.rs +++ b/vendor/object/src/read/coff/symbol.rs @@ -17,6 +17,9 @@ use crate::read::{ /// A table of symbol entries in a COFF or PE file. /// /// Also includes the string table used for the symbol names. +/// +/// Returned by [`CoffHeader::symbols`] and +/// [`ImageNtHeaders::symbols`](crate::read::pe::ImageNtHeaders::symbols). #[derive(Debug)] pub struct SymbolTable<'data, R = &'data [u8], Coff = pe::ImageFileHeader> where @@ -187,11 +190,12 @@ impl<'data, 'table, R: ReadRef<'data>, Coff: CoffHeader> Iterator } } -/// A symbol table of a `CoffBigFile`. +/// A symbol table in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigSymbolTable<'data, 'file, R = &'data [u8]> = CoffSymbolTable<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// A symbol table of a `CoffFile`. +/// A symbol table in a [`CoffFile`](super::CoffFile) +/// or [`PeFile`](crate::read::pe::PeFile). #[derive(Debug, Clone, Copy)] pub struct CoffSymbolTable<'data, 'file, R = &'data [u8], Coff = pe::ImageFileHeader> where @@ -229,11 +233,12 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectSymbolTable<'data> } } -/// An iterator over the symbols of a `CoffBigFile`. +/// An iterator for the symbols in a [`CoffBigFile`](super::CoffBigFile). pub type CoffBigSymbolIterator<'data, 'file, R = &'data [u8]> = CoffSymbolIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// An iterator over the symbols of a `CoffFile`. +/// An iterator for the symbols in a [`CoffFile`](super::CoffFile) +/// or [`PeFile`](crate::read::pe::PeFile). pub struct CoffSymbolIterator<'data, 'file, R = &'data [u8], Coff = pe::ImageFileHeader> where R: ReadRef<'data>, @@ -268,11 +273,15 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator } } -/// A symbol of a `CoffBigFile`. +/// A symbol in a [`CoffBigFile`](super::CoffBigFile). +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. pub type CoffBigSymbol<'data, 'file, R = &'data [u8]> = CoffSymbol<'data, 'file, R, pe::AnonObjectHeaderBigobj>; -/// A symbol of a `CoffFile`. +/// A symbol in a [`CoffFile`](super::CoffFile) or [`PeFile`](crate::read::pe::PeFile). +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. #[derive(Debug, Clone, Copy)] pub struct CoffSymbol<'data, 'file, R = &'data [u8], Coff = pe::ImageFileHeader> where @@ -384,7 +393,7 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectSymbol<'data> }; match self.symbol.storage_class() { pe::IMAGE_SYM_CLASS_STATIC => { - if self.symbol.value() == 0 && self.symbol.number_of_aux_symbols() > 0 { + if self.symbol.has_aux_section() { SymbolKind::Section } else { derived_kind @@ -401,12 +410,16 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectSymbol<'data> fn section(&self) -> SymbolSection { match self.symbol.section_number() { pe::IMAGE_SYM_UNDEFINED => { - if self.symbol.storage_class() == pe::IMAGE_SYM_CLASS_EXTERNAL - && self.symbol.value() == 0 - { + if self.symbol.storage_class() == pe::IMAGE_SYM_CLASS_EXTERNAL { + if self.symbol.value() == 0 { + SymbolSection::Undefined + } else { + SymbolSection::Common + } + } else if self.symbol.storage_class() == pe::IMAGE_SYM_CLASS_SECTION { SymbolSection::Undefined } else { - SymbolSection::Common + SymbolSection::Unknown } } pe::IMAGE_SYM_ABSOLUTE => SymbolSection::Absolute, @@ -492,7 +505,7 @@ impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> ObjectSymbol<'data> } } -/// A trait for generic access to `ImageSymbol` and `ImageSymbolEx`. +/// A trait for generic access to [`pe::ImageSymbol`] and [`pe::ImageSymbolEx`]. #[allow(missing_docs)] pub trait ImageSymbol: Debug + Pod { fn raw_name(&self) -> &[u8; 8]; @@ -538,15 +551,11 @@ pub trait ImageSymbol: Debug + Pod { /// Return true if the symbol is a definition of a function or data object. fn is_definition(&self) -> bool { - let section_number = self.section_number(); - if section_number == pe::IMAGE_SYM_UNDEFINED { + if self.section_number() <= 0 { return false; } match self.storage_class() { - pe::IMAGE_SYM_CLASS_STATIC => { - // Exclude section symbols. - !(self.value() == 0 && self.number_of_aux_symbols() > 0) - } + pe::IMAGE_SYM_CLASS_STATIC => !self.has_aux_section(), pe::IMAGE_SYM_CLASS_EXTERNAL | pe::IMAGE_SYM_CLASS_WEAK_EXTERNAL => true, _ => false, } @@ -566,7 +575,7 @@ pub trait ImageSymbol: Debug + Pod { fn has_aux_section(&self) -> bool { self.number_of_aux_symbols() > 0 && self.storage_class() == pe::IMAGE_SYM_CLASS_STATIC - && self.value() == 0 + && self.typ() == 0 } fn base_type(&self) -> u16 { diff --git a/vendor/object/src/read/elf/attributes.rs b/vendor/object/src/read/elf/attributes.rs index 6ec535d72..bf6f35ccd 100644 --- a/vendor/object/src/read/elf/attributes.rs +++ b/vendor/object/src/read/elf/attributes.rs @@ -10,7 +10,10 @@ use super::FileHeader; /// /// This may be a GNU attributes section, or an architecture specific attributes section. /// -/// An attributes section contains a series of subsections. +/// An attributes section contains a series of [`AttributesSubsection`]. +/// +/// Returned by [`SectionHeader::attributes`](super::SectionHeader::attributes) +/// and [`SectionHeader::gnu_attributes`](super::SectionHeader::gnu_attributes). #[derive(Debug, Clone)] pub struct AttributesSection<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -54,7 +57,7 @@ impl<'data, Elf: FileHeader> AttributesSection<'data, Elf> { } } -/// An iterator over the subsections in an ELF attributes section. +/// An iterator for the subsections in an [`AttributesSection`]. #[derive(Debug, Clone)] pub struct AttributesSubsectionIterator<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -105,9 +108,10 @@ impl<'data, Elf: FileHeader> AttributesSubsectionIterator<'data, Elf> { } } -/// A subsection in an ELF attributes section. +/// A subsection in an [`AttributesSection`]. /// -/// A subsection is identified by a vendor name. It contains a series of sub-subsections. +/// A subsection is identified by a vendor name. It contains a series of +/// [`AttributesSubsubsection`]. #[derive(Debug, Clone)] pub struct AttributesSubsection<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -136,7 +140,7 @@ impl<'data, Elf: FileHeader> AttributesSubsection<'data, Elf> { } } -/// An iterator over the sub-subsections in an ELF attributes section. +/// An iterator for the sub-subsections in an [`AttributesSubsection`]. #[derive(Debug, Clone)] pub struct AttributesSubsubsectionIterator<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -200,7 +204,7 @@ impl<'data, Elf: FileHeader> AttributesSubsubsectionIterator<'data, Elf> { } } -/// A sub-subsection in an ELF attributes section. +/// A sub-subsection in an [`AttributesSubsection`]. /// /// A sub-subsection is identified by a tag. It contains an optional series of indices, /// followed by a series of attributes. @@ -248,7 +252,7 @@ impl<'data> AttributesSubsubsection<'data> { } } -/// An iterator over the indices in a sub-subsection in an ELF attributes section. +/// An iterator over the indices in an [`AttributesSubsubsection`]. #[derive(Debug, Clone)] pub struct AttributeIndexIterator<'data> { data: Bytes<'data>, @@ -271,7 +275,7 @@ impl<'data> AttributeIndexIterator<'data> { } } -/// A parser for the attributes in a sub-subsection in an ELF attributes section. +/// A parser for the attributes in an [`AttributesSubsubsection`]. /// /// The parser relies on the caller to know the format of the data for each attribute tag. #[derive(Debug, Clone)] diff --git a/vendor/object/src/read/elf/comdat.rs b/vendor/object/src/read/elf/comdat.rs index 1a2f2f44a..882d2536b 100644 --- a/vendor/object/src/read/elf/comdat.rs +++ b/vendor/object/src/read/elf/comdat.rs @@ -7,14 +7,14 @@ use crate::read::{self, ComdatKind, ObjectComdat, ReadError, ReadRef, SectionInd use super::{ElfFile, FileHeader, SectionHeader, Sym}; -/// An iterator over the COMDAT section groups of an `ElfFile32`. +/// An iterator for the COMDAT section groups in an [`ElfFile32`](super::ElfFile32). pub type ElfComdatIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdatIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the COMDAT section groups of an `ElfFile64`. +/// An iterator for the COMDAT section groups in an [`ElfFile64`](super::ElfFile64). pub type ElfComdatIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdatIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the COMDAT section groups of an `ElfFile`. +/// An iterator for the COMDAT section groups in an [`ElfFile`]. #[derive(Debug)] pub struct ElfComdatIterator<'data, 'file, Elf, R = &'data [u8]> where @@ -42,14 +42,16 @@ where } } -/// A COMDAT section group of an `ElfFile32`. +/// A COMDAT section group in an [`ElfFile32`](super::ElfFile32). pub type ElfComdat32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdat<'data, 'file, elf::FileHeader32, R>; -/// A COMDAT section group of an `ElfFile64`. +/// A COMDAT section group in an [`ElfFile64`](super::ElfFile64). pub type ElfComdat64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdat<'data, 'file, elf::FileHeader64, R>; -/// A COMDAT section group of an `ElfFile`. +/// A COMDAT section group in an [`ElfFile`]. +/// +/// Most functionality is provided by the [`ObjectComdat`] trait implementation. #[derive(Debug)] pub struct ElfComdat<'data, 'file, Elf, R = &'data [u8]> where @@ -128,14 +130,14 @@ where } } -/// An iterator over the sections in a COMDAT section group of an `ElfFile32`. +/// An iterator for the sections in a COMDAT section group in an [`ElfFile32`](super::ElfFile32). pub type ElfComdatSectionIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdatSectionIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the sections in a COMDAT section group of an `ElfFile64`. +/// An iterator for the sections in a COMDAT section group in an [`ElfFile64`](super::ElfFile64). pub type ElfComdatSectionIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfComdatSectionIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the sections in a COMDAT section group of an `ElfFile`. +/// An iterator for the sections in a COMDAT section group in an [`ElfFile`]. #[derive(Debug)] pub struct ElfComdatSectionIterator<'data, 'file, Elf, R = &'data [u8]> where diff --git a/vendor/object/src/read/elf/compression.rs b/vendor/object/src/read/elf/compression.rs index 7242dd39c..de2533f2d 100644 --- a/vendor/object/src/read/elf/compression.rs +++ b/vendor/object/src/read/elf/compression.rs @@ -4,7 +4,7 @@ use crate::elf; use crate::endian; use crate::pod::Pod; -/// A trait for generic access to `CompressionHeader32` and `CompressionHeader64`. +/// A trait for generic access to [`elf::CompressionHeader32`] and [`elf::CompressionHeader64`]. #[allow(missing_docs)] pub trait CompressionHeader: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/elf/dynamic.rs b/vendor/object/src/read/elf/dynamic.rs index 5fe15b560..1661434ac 100644 --- a/vendor/object/src/read/elf/dynamic.rs +++ b/vendor/object/src/read/elf/dynamic.rs @@ -6,7 +6,7 @@ use crate::endian; use crate::pod::Pod; use crate::read::{ReadError, Result, StringTable}; -/// A trait for generic access to `Dyn32` and `Dyn64`. +/// A trait for generic access to [`elf::Dyn32`] and [`elf::Dyn64`]. #[allow(missing_docs)] pub trait Dyn: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/elf/file.rs b/vendor/object/src/read/elf/file.rs index 67be37e21..14ba56853 100644 --- a/vendor/object/src/read/elf/file.rs +++ b/vendor/object/src/read/elf/file.rs @@ -17,15 +17,21 @@ use super::{ }; /// A 32-bit ELF object file. +/// +/// This is a file that starts with [`elf::FileHeader32`], and corresponds +/// to [`crate::FileKind::Elf32`]. pub type ElfFile32<'data, Endian = Endianness, R = &'data [u8]> = ElfFile<'data, elf::FileHeader32, R>; /// A 64-bit ELF object file. +/// +/// This is a file that starts with [`elf::FileHeader64`], and corresponds +/// to [`crate::FileKind::Elf64`]. pub type ElfFile64<'data, Endian = Endianness, R = &'data [u8]> = ElfFile<'data, elf::FileHeader64, R>; /// A partially parsed ELF file. /// -/// Most of the functionality of this type is provided by the `Object` trait implementation. +/// Most functionality is provided by the [`Object`] trait implementation. #[derive(Debug)] pub struct ElfFile<'data, Elf, R = &'data [u8]> where @@ -178,6 +184,7 @@ where // We only support the 64-bit variant s390x here. (elf::EM_S390, true) => Architecture::S390x, (elf::EM_SBF, _) => Architecture::Sbf, + (elf::EM_SHARC, false) => Architecture::Sharc, (elf::EM_SPARCV9, true) => Architecture::Sparc64, (elf::EM_XTENSA, false) => Architecture::Xtensa, _ => Architecture::Unknown, @@ -305,7 +312,6 @@ where }) } - /// Get the imported symbols. fn imports(&self) -> read::Result>> { let mut imports = Vec::new(); for symbol in self.dynamic_symbols.iter() { @@ -323,7 +329,6 @@ where Ok(imports) } - /// Get the exported symbols. fn exports(&self) -> read::Result>> { let mut exports = Vec::new(); for symbol in self.dynamic_symbols.iter() { @@ -436,7 +441,7 @@ where } } -/// A trait for generic access to `FileHeader32` and `FileHeader64`. +/// A trait for generic access to [`elf::FileHeader32`] and [`elf::FileHeader64`]. #[allow(missing_docs)] pub trait FileHeader: Debug + Pod { // Ideally this would be a `u64: From`, but can't express that. @@ -461,7 +466,7 @@ pub trait FileHeader: Debug + Pod { /// /// This is a property of the type, not a value in the header data. /// - /// This is the same as `is_type_64`, but is non-dispatchable. + /// This is the same as [`Self::is_type_64`], but is non-dispatchable. fn is_type_64_sized() -> bool where Self: Sized; diff --git a/vendor/object/src/read/elf/hash.rs b/vendor/object/src/read/elf/hash.rs index aadbb9208..b0130cc90 100644 --- a/vendor/object/src/read/elf/hash.rs +++ b/vendor/object/src/read/elf/hash.rs @@ -7,6 +7,8 @@ use crate::{U32, U64}; use super::{FileHeader, Sym, SymbolTable, Version, VersionTable}; /// A SysV symbol hash table in an ELF file. +/// +/// Returned by [`SectionHeader::hash`](super::SectionHeader::hash). #[derive(Debug)] pub struct HashTable<'data, Elf: FileHeader> { buckets: &'data [U32], @@ -16,8 +18,8 @@ pub struct HashTable<'data, Elf: FileHeader> { impl<'data, Elf: FileHeader> HashTable<'data, Elf> { /// Parse a SysV hash table. /// - /// `data` should be from a `SHT_HASH` section, or from a - /// segment pointed to via the `DT_HASH` entry. + /// `data` should be from an [`elf::SHT_HASH`] section, or from a + /// segment pointed to via the [`elf::DT_HASH`] entry. /// /// The header is read at offset 0 in the given `data`. pub fn parse(endian: Elf::Endian, data: &'data [u8]) -> Result { @@ -70,6 +72,8 @@ impl<'data, Elf: FileHeader> HashTable<'data, Elf> { } /// A GNU symbol hash table in an ELF file. +/// +/// Returned by [`SectionHeader::gnu_hash`](super::SectionHeader::gnu_hash). #[derive(Debug)] pub struct GnuHashTable<'data, Elf: FileHeader> { symbol_base: u32, @@ -82,15 +86,15 @@ pub struct GnuHashTable<'data, Elf: FileHeader> { impl<'data, Elf: FileHeader> GnuHashTable<'data, Elf> { /// Parse a GNU hash table. /// - /// `data` should be from a `SHT_GNU_HASH` section, or from a - /// segment pointed to via the `DT_GNU_HASH` entry. + /// `data` should be from an [`elf::SHT_GNU_HASH`] section, or from a + /// segment pointed to via the [`elf::DT_GNU_HASH`] entry. /// /// The header is read at offset 0 in the given `data`. /// /// The header does not contain a length field, and so all of `data` /// will be used as the hash table values. It does not matter if this /// is longer than needed, and this will often the case when accessing - /// the hash table via the `DT_GNU_HASH` entry. + /// the hash table via the [`elf::DT_GNU_HASH`] entry. pub fn parse(endian: Elf::Endian, data: &'data [u8]) -> Result { let mut offset = 0; let header = data diff --git a/vendor/object/src/read/elf/mod.rs b/vendor/object/src/read/elf/mod.rs index 07db6cd66..66931bdd5 100644 --- a/vendor/object/src/read/elf/mod.rs +++ b/vendor/object/src/read/elf/mod.rs @@ -1,9 +1,45 @@ //! Support for reading ELF files. //! -//! Defines traits to abstract over the difference between ELF32/ELF64, -//! and implements read functionality in terms of these traits. +//! Traits are used to abstract over the difference between 32-bit and 64-bit ELF. +//! The primary trait for this is [`FileHeader`]. //! -//! Also provides `ElfFile` and related types which implement the `Object` trait. +//! ## High level API +//! +//! [`ElfFile`] implements the [`Object`](crate::read::Object) trait for ELF files. +//! [`ElfFile`] is parameterised by [`FileHeader`] to allow reading both 32-bit and +//! 64-bit ELF. There are type aliases for these parameters ([`ElfFile32`] and +//! [`ElfFile64`]). +//! +//! ## Low level API +//! +//! The [`FileHeader`] trait can be directly used to parse both [`elf::FileHeader32`] +//! and [`elf::FileHeader64`]. +//! +//! ### Example for low level API +//! ```no_run +//! use object::elf; +//! use object::read::elf::{FileHeader, Sym}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each symbol. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let elf = elf::FileHeader64::::parse(&*data)?; +//! let endian = elf.endian()?; +//! let sections = elf.sections(endian, &*data)?; +//! let symbols = sections.symbols(endian, &*data, elf::SHT_SYMTAB)?; +//! for symbol in symbols.iter() { +//! let name = symbol.name(endian, symbols.strings())?; +//! println!("{}", String::from_utf8_lossy(name)); +//! } +//! # } +//! Ok(()) +//! } +//! ``` +#[cfg(doc)] +use crate::elf; mod file; pub use file::*; diff --git a/vendor/object/src/read/elf/note.rs b/vendor/object/src/read/elf/note.rs index 84d4179de..e2beef922 100644 --- a/vendor/object/src/read/elf/note.rs +++ b/vendor/object/src/read/elf/note.rs @@ -10,6 +10,9 @@ use crate::read::{self, Bytes, Error, ReadError}; use super::FileHeader; /// An iterator over the notes in an ELF section or segment. +/// +/// Returned [`ProgramHeader::notes`](super::ProgramHeader::notes) +/// and [`SectionHeader::notes`](super::SectionHeader::notes). #[derive(Debug)] pub struct NoteIterator<'data, Elf> where @@ -84,7 +87,7 @@ where } } -/// A parsed `NoteHeader`. +/// A parsed [`NoteHeader`]. #[derive(Debug)] pub struct Note<'data, Elf> where @@ -141,7 +144,7 @@ impl<'data, Elf: FileHeader> Note<'data, Elf> { self.desc } - /// Return an iterator for properties if this note's type is `NT_GNU_PROPERTY_TYPE_0`. + /// Return an iterator for properties if this note's type is [`elf::NT_GNU_PROPERTY_TYPE_0`]. pub fn gnu_properties( &self, endian: Elf::Endian, @@ -160,7 +163,7 @@ impl<'data, Elf: FileHeader> Note<'data, Elf> { } } -/// A trait for generic access to `NoteHeader32` and `NoteHeader64`. +/// A trait for generic access to [`elf::NoteHeader32`] and [`elf::NoteHeader64`]. #[allow(missing_docs)] pub trait NoteHeader: Debug + Pod { type Endian: endian::Endian; @@ -208,7 +211,9 @@ impl NoteHeader for elf::NoteHeader64 { } } -/// An iterator over the properties in a `NT_GNU_PROPERTY_TYPE_0` note. +/// An iterator for the properties in a [`elf::NT_GNU_PROPERTY_TYPE_0`] note. +/// +/// Returned by [`Note::gnu_properties`]. #[derive(Debug)] pub struct GnuPropertyIterator<'data, Endian: endian::Endian> { endian: Endian, @@ -236,7 +241,7 @@ impl<'data, Endian: endian::Endian> GnuPropertyIterator<'data, Endian> { } } -/// A property in a `NT_GNU_PROPERTY_TYPE_0` note. +/// A property in a [`elf::NT_GNU_PROPERTY_TYPE_0`] note. #[derive(Debug)] pub struct GnuProperty<'data> { pr_type: u32, diff --git a/vendor/object/src/read/elf/relocation.rs b/vendor/object/src/read/elf/relocation.rs index 78032dfdb..aac1574ee 100644 --- a/vendor/object/src/read/elf/relocation.rs +++ b/vendor/object/src/read/elf/relocation.rs @@ -91,14 +91,14 @@ impl<'data, Elf: FileHeader> Iterator for ElfRelaIterator<'data, Elf> { } } -/// An iterator over the dynamic relocations for an `ElfFile32`. +/// An iterator for the dynamic relocations in an [`ElfFile32`](super::ElfFile32). pub type ElfDynamicRelocationIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfDynamicRelocationIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the dynamic relocations for an `ElfFile64`. +/// An iterator for the dynamic relocations in an [`ElfFile64`](super::ElfFile64). pub type ElfDynamicRelocationIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfDynamicRelocationIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the dynamic relocations for an `ElfFile`. +/// An iterator for the dynamic relocations in an [`ElfFile`]. pub struct ElfDynamicRelocationIterator<'data, 'file, Elf, R = &'data [u8]> where Elf: FileHeader, @@ -164,14 +164,14 @@ where } } -/// An iterator over the relocations for an `ElfSection32`. +/// An iterator for the relocations for an [`ElfSection32`](super::ElfSection32). pub type ElfSectionRelocationIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSectionRelocationIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the relocations for an `ElfSection64`. +/// An iterator for the relocations for an [`ElfSection64`](super::ElfSection64). pub type ElfSectionRelocationIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSectionRelocationIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the relocations for an `ElfSection`. +/// An iterator for the relocations for an [`ElfSection`](super::ElfSection). pub struct ElfSectionRelocationIterator<'data, 'file, Elf, R = &'data [u8]> where Elf: FileHeader, @@ -319,6 +319,7 @@ fn parse_relocation( elf::R_LARCH_32 => (RelocationKind::Absolute, 32), elf::R_LARCH_64 => (RelocationKind::Absolute, 64), elf::R_LARCH_32_PCREL => (RelocationKind::Relative, 32), + elf::R_LARCH_64_PCREL => (RelocationKind::Relative, 64), elf::R_LARCH_B16 => { encoding = RelocationEncoding::LoongArchBranch; (RelocationKind::Relative, 16) @@ -404,6 +405,57 @@ fn parse_relocation( elf::R_SBF_64_32 => (RelocationKind::Absolute, 32), r_type => (RelocationKind::Elf(r_type), 0), }, + elf::EM_SHARC => match reloc.r_type(endian, false) { + elf::R_SHARC_ADDR24_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Absolute, 24) + } + elf::R_SHARC_ADDR32_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Absolute, 32) + } + elf::R_SHARC_ADDR_VAR_V3 => { + encoding = RelocationEncoding::Generic; + (RelocationKind::Absolute, 32) + } + elf::R_SHARC_PCRSHORT_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Relative, 6) + } + elf::R_SHARC_PCRLONG_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Relative, 24) + } + elf::R_SHARC_DATA6_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Absolute, 6) + } + elf::R_SHARC_DATA16_V3 => { + encoding = RelocationEncoding::SharcTypeA; + (RelocationKind::Absolute, 16) + } + elf::R_SHARC_DATA6_VISA_V3 => { + encoding = RelocationEncoding::SharcTypeB; + (RelocationKind::Absolute, 6) + } + elf::R_SHARC_DATA7_VISA_V3 => { + encoding = RelocationEncoding::SharcTypeB; + (RelocationKind::Absolute, 7) + } + elf::R_SHARC_DATA16_VISA_V3 => { + encoding = RelocationEncoding::SharcTypeB; + (RelocationKind::Absolute, 16) + } + elf::R_SHARC_PCR6_VISA_V3 => { + encoding = RelocationEncoding::SharcTypeB; + (RelocationKind::Relative, 16) + } + elf::R_SHARC_ADDR_VAR16_V3 => { + encoding = RelocationEncoding::Generic; + (RelocationKind::Absolute, 16) + } + r_type => (RelocationKind::Elf(r_type), 0), + }, elf::EM_SPARC | elf::EM_SPARC32PLUS | elf::EM_SPARCV9 => { match reloc.r_type(endian, false) { elf::R_SPARC_32 | elf::R_SPARC_UA32 => (RelocationKind::Absolute, 32), @@ -434,7 +486,7 @@ fn parse_relocation( } } -/// A trait for generic access to `Rel32` and `Rel64`. +/// A trait for generic access to [`elf::Rel32`] and [`elf::Rel64`]. #[allow(missing_docs)] pub trait Rel: Debug + Pod + Clone { type Word: Into; @@ -499,7 +551,7 @@ impl Rel for elf::Rel64 { } } -/// A trait for generic access to `Rela32` and `Rela64`. +/// A trait for generic access to [`elf::Rela32`] and [`elf::Rela64`]. #[allow(missing_docs)] pub trait Rela: Debug + Pod + Clone { type Word: Into; diff --git a/vendor/object/src/read/elf/section.rs b/vendor/object/src/read/elf/section.rs index df08f9e3e..2b5ae01da 100644 --- a/vendor/object/src/read/elf/section.rs +++ b/vendor/object/src/read/elf/section.rs @@ -18,6 +18,8 @@ use super::{ /// The table of section headers in an ELF file. /// /// Also includes the string table used for the section names. +/// +/// Returned by [`FileHeader::sections`]. #[derive(Debug, Default, Clone, Copy)] pub struct SectionTable<'data, Elf: FileHeader, R = &'data [u8]> where @@ -318,14 +320,14 @@ impl<'data, Elf: FileHeader, R: ReadRef<'data>> SectionTable<'data, Elf, R> { } } -/// An iterator over the sections of an `ElfFile32`. +/// An iterator for the sections in an [`ElfFile32`](super::ElfFile32). pub type ElfSectionIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSectionIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the sections of an `ElfFile64`. +/// An iterator for the sections in an [`ElfFile64`](super::ElfFile64). pub type ElfSectionIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSectionIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the sections of an `ElfFile`. +/// An iterator for the sections in an [`ElfFile`]. #[derive(Debug)] pub struct ElfSectionIterator<'data, 'file, Elf, R = &'data [u8]> where @@ -352,14 +354,16 @@ where } } -/// A section of an `ElfFile32`. +/// A section in an [`ElfFile32`](super::ElfFile32). pub type ElfSection32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSection<'data, 'file, elf::FileHeader32, R>; -/// A section of an `ElfFile64`. +/// A section in an [`ElfFile64`](super::ElfFile64). pub type ElfSection64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSection<'data, 'file, elf::FileHeader64, R>; -/// A section of an `ElfFile`. +/// A section in an [`ElfFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct ElfSection<'data, 'file, Elf, R = &'data [u8]> where @@ -592,7 +596,7 @@ where } } -/// A trait for generic access to `SectionHeader32` and `SectionHeader64`. +/// A trait for generic access to [`elf::SectionHeader32`] and [`elf::SectionHeader64`]. #[allow(missing_docs)] pub trait SectionHeader: Debug + Pod { type Elf: FileHeader; diff --git a/vendor/object/src/read/elf/segment.rs b/vendor/object/src/read/elf/segment.rs index 3972731ec..957117a4c 100644 --- a/vendor/object/src/read/elf/segment.rs +++ b/vendor/object/src/read/elf/segment.rs @@ -8,14 +8,14 @@ use crate::read::{self, Bytes, ObjectSegment, ReadError, ReadRef, SegmentFlags}; use super::{ElfFile, FileHeader, NoteIterator}; -/// An iterator over the segments of an `ElfFile32`. +/// An iterator for the segments in an [`ElfFile32`](super::ElfFile32). pub type ElfSegmentIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSegmentIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the segments of an `ElfFile64`. +/// An iterator for the segments in an [`ElfFile64`](super::ElfFile64). pub type ElfSegmentIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSegmentIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the segments of an `ElfFile`. +/// An iterator for the segments in an [`ElfFile`]. #[derive(Debug)] pub struct ElfSegmentIterator<'data, 'file, Elf, R = &'data [u8]> where @@ -46,14 +46,16 @@ where } } -/// A segment of an `ElfFile32`. +/// A segment in an [`ElfFile32`](super::ElfFile32). pub type ElfSegment32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSegment<'data, 'file, elf::FileHeader32, R>; -/// A segment of an `ElfFile64`. +/// A segment in an [`ElfFile64`](super::ElfFile64). pub type ElfSegment64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSegment<'data, 'file, elf::FileHeader64, R>; -/// A segment of an `ElfFile`. +/// A segment in an [`ElfFile`]. +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. #[derive(Debug)] pub struct ElfSegment<'data, 'file, Elf, R = &'data [u8]> where @@ -135,7 +137,7 @@ where } } -/// A trait for generic access to `ProgramHeader32` and `ProgramHeader64`. +/// A trait for generic access to [`elf::ProgramHeader32`] and [`elf::ProgramHeader64`]. #[allow(missing_docs)] pub trait ProgramHeader: Debug + Pod { type Elf: FileHeader; diff --git a/vendor/object/src/read/elf/symbol.rs b/vendor/object/src/read/elf/symbol.rs index ee5aa37f1..8ba707f76 100644 --- a/vendor/object/src/read/elf/symbol.rs +++ b/vendor/object/src/read/elf/symbol.rs @@ -18,6 +18,8 @@ use super::{FileHeader, SectionHeader, SectionTable}; /// A table of symbol entries in an ELF file. /// /// Also includes the string table used for the symbol names. +/// +/// Returned by [`SectionTable::symbols`]. #[derive(Debug, Clone, Copy)] pub struct SymbolTable<'data, Elf: FileHeader, R = &'data [u8]> where @@ -197,14 +199,14 @@ impl<'data, Elf: FileHeader, R: ReadRef<'data>> SymbolTable<'data, Elf, R> { } } -/// A symbol table of an `ElfFile32`. +/// A symbol table in an [`ElfFile32`](super::ElfFile32). pub type ElfSymbolTable32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbolTable<'data, 'file, elf::FileHeader32, R>; -/// A symbol table of an `ElfFile32`. +/// A symbol table in an [`ElfFile32`](super::ElfFile32). pub type ElfSymbolTable64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbolTable<'data, 'file, elf::FileHeader64, R>; -/// A symbol table of an `ElfFile`. +/// A symbol table in an [`ElfFile`](super::ElfFile). #[derive(Debug, Clone, Copy)] pub struct ElfSymbolTable<'data, 'file, Elf, R = &'data [u8]> where @@ -245,14 +247,14 @@ impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ObjectSymbolTable<'data> } } -/// An iterator over the symbols of an `ElfFile32`. +/// An iterator for the symbols in an [`ElfFile32`](super::ElfFile32). pub type ElfSymbolIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbolIterator<'data, 'file, elf::FileHeader32, R>; -/// An iterator over the symbols of an `ElfFile64`. +/// An iterator for the symbols in an [`ElfFile64`](super::ElfFile64). pub type ElfSymbolIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbolIterator<'data, 'file, elf::FileHeader64, R>; -/// An iterator over the symbols of an `ElfFile`. +/// An iterator for the symbols in an [`ElfFile`](super::ElfFile). pub struct ElfSymbolIterator<'data, 'file, Elf, R = &'data [u8]> where Elf: FileHeader, @@ -289,14 +291,16 @@ impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> Iterator } } -/// A symbol of an `ElfFile32`. +/// A symbol in an [`ElfFile32`](super::ElfFile32). pub type ElfSymbol32<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbol<'data, 'file, elf::FileHeader32, R>; -/// A symbol of an `ElfFile64`. +/// A symbol in an [`ElfFile64`](super::ElfFile64). pub type ElfSymbol64<'data, 'file, Endian = Endianness, R = &'data [u8]> = ElfSymbol<'data, 'file, elf::FileHeader64, R>; -/// A symbol of an `ElfFile`. +/// A symbol in an [`ElfFile`](super::ElfFile). +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. #[derive(Debug, Clone, Copy)] pub struct ElfSymbol<'data, 'file, Elf, R = &'data [u8]> where @@ -354,7 +358,7 @@ impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> fn kind(&self) -> SymbolKind { match self.symbol.st_type() { elf::STT_NOTYPE if self.index.0 == 0 => SymbolKind::Null, - elf::STT_NOTYPE => SymbolKind::Label, + elf::STT_NOTYPE => SymbolKind::Unknown, elf::STT_OBJECT | elf::STT_COMMON => SymbolKind::Data, elf::STT_FUNC | elf::STT_GNU_IFUNC => SymbolKind::Text, elf::STT_SECTION => SymbolKind::Section, @@ -443,7 +447,7 @@ impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> } } -/// A trait for generic access to `Sym32` and `Sym64`. +/// A trait for generic access to [`elf::Sym32`] and [`elf::Sym64`]. #[allow(missing_docs)] pub trait Sym: Debug + Pod { type Word: Into; @@ -478,9 +482,15 @@ pub trait Sym: Debug + Pod { /// Return true if the symbol is a definition of a function or data object. fn is_definition(&self, endian: Self::Endian) -> bool { - let st_type = self.st_type(); - (st_type == elf::STT_NOTYPE || st_type == elf::STT_FUNC || st_type == elf::STT_OBJECT) - && self.st_shndx(endian) != elf::SHN_UNDEF + let shndx = self.st_shndx(endian); + if shndx == elf::SHN_UNDEF || (shndx >= elf::SHN_LORESERVE && shndx != elf::SHN_XINDEX) { + return false; + } + match self.st_type() { + elf::STT_NOTYPE => self.st_size(endian).into() != 0, + elf::STT_FUNC | elf::STT_OBJECT => true, + _ => false, + } } } diff --git a/vendor/object/src/read/elf/version.rs b/vendor/object/src/read/elf/version.rs index cc87bbef1..28eeed0aa 100644 --- a/vendor/object/src/read/elf/version.rs +++ b/vendor/object/src/read/elf/version.rs @@ -33,7 +33,7 @@ impl VersionIndex { /// A version definition or requirement. /// -/// This is derived from entries in the `SHT_GNU_verdef` and `SHT_GNU_verneed` sections. +/// This is derived from entries in the [`elf::SHT_GNU_VERDEF`] and [`elf::SHT_GNU_VERNEED`] sections. #[derive(Debug, Default, Clone, Copy)] pub struct Version<'data> { name: &'data [u8], @@ -58,7 +58,10 @@ impl<'data> Version<'data> { /// /// It allows looking up the version information for a given symbol index. /// -/// This is derived from entries in the `SHT_GNU_versym`, `SHT_GNU_verdef` and `SHT_GNU_verneed` sections. +/// This is derived from entries in the [`elf::SHT_GNU_VERSYM`], [`elf::SHT_GNU_VERDEF`] +/// and [`elf::SHT_GNU_VERNEED`] sections. +/// +/// Returned by [`SectionTable::versions`](super::SectionTable::versions). #[derive(Debug, Clone)] pub struct VersionTable<'data, Elf: FileHeader> { symbols: &'data [elf::Versym], @@ -210,7 +213,7 @@ impl<'data, Elf: FileHeader> VersionTable<'data, Elf> { } } -/// An iterator over the entries in an ELF `SHT_GNU_verdef` section. +/// An iterator for the entries in an ELF [`elf::SHT_GNU_VERDEF`] section. #[derive(Debug, Clone)] pub struct VerdefIterator<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -257,7 +260,7 @@ impl<'data, Elf: FileHeader> VerdefIterator<'data, Elf> { } } -/// An iterator over the auxiliary records for an entry in an ELF `SHT_GNU_verdef` section. +/// An iterator for the auxiliary records for an entry in an ELF [`elf::SHT_GNU_VERDEF`] section. #[derive(Debug, Clone)] pub struct VerdauxIterator<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -293,7 +296,7 @@ impl<'data, Elf: FileHeader> VerdauxIterator<'data, Elf> { } } -/// An iterator over the entries in an ELF `SHT_GNU_verneed` section. +/// An iterator for the entries in an ELF [`elf::SHT_GNU_VERNEED`] section. #[derive(Debug, Clone)] pub struct VerneedIterator<'data, Elf: FileHeader> { endian: Elf::Endian, @@ -345,7 +348,7 @@ impl<'data, Elf: FileHeader> VerneedIterator<'data, Elf> { } } -/// An iterator over the auxiliary records for an entry in an ELF `SHT_GNU_verneed` section. +/// An iterator for the auxiliary records for an entry in an ELF [`elf::SHT_GNU_VERNEED`] section. #[derive(Debug, Clone)] pub struct VernauxIterator<'data, Elf: FileHeader> { endian: Elf::Endian, diff --git a/vendor/object/src/read/macho/dyld_cache.rs b/vendor/object/src/read/macho/dyld_cache.rs index 68f27f549..0f5dfc57f 100644 --- a/vendor/object/src/read/macho/dyld_cache.rs +++ b/vendor/object/src/read/macho/dyld_cache.rs @@ -39,10 +39,11 @@ where R: ReadRef<'data>, { /// Parse the raw dyld shared cache data. + /// /// For shared caches from macOS 12 / iOS 15 and above, the subcache files need to be - /// supplied as well, in the correct order, with the .symbols subcache last (if present). - /// For example, data would be the data for dyld_shared_cache_x86_64, - /// and subcache_data would be the data for [dyld_shared_cache_x86_64.1, dyld_shared_cache_x86_64.2, ...] + /// supplied as well, in the correct order, with the `.symbols` subcache last (if present). + /// For example, `data` would be the data for `dyld_shared_cache_x86_64`, + /// and `subcache_data` would be the data for `[dyld_shared_cache_x86_64.1, dyld_shared_cache_x86_64.2, ...]`. pub fn parse(data: R, subcache_data: &[R]) -> Result { let header = macho::DyldCacheHeader::parse(data)?; let (arch, endian) = header.parse_magic()?; diff --git a/vendor/object/src/read/macho/fat.rs b/vendor/object/src/read/macho/fat.rs index d4301b7e1..a4813512e 100644 --- a/vendor/object/src/read/macho/fat.rs +++ b/vendor/object/src/read/macho/fat.rs @@ -39,7 +39,7 @@ impl FatHeader { } } -/// A trait for generic access to `FatArch32` and `FatArch64`. +/// A trait for generic access to [`macho::FatArch32`] and [`macho::FatArch64`]. #[allow(missing_docs)] pub trait FatArch: Pod { type Word: Into; diff --git a/vendor/object/src/read/macho/file.rs b/vendor/object/src/read/macho/file.rs index 368c28bbd..0e04477d9 100644 --- a/vendor/object/src/read/macho/file.rs +++ b/vendor/object/src/read/macho/file.rs @@ -5,7 +5,7 @@ use core::{mem, str}; use crate::read::{ self, Architecture, ComdatKind, Error, Export, FileFlags, Import, NoDynamicRelocationIterator, Object, ObjectComdat, ObjectKind, ObjectMap, ObjectSection, ReadError, ReadRef, Result, - SectionIndex, SymbolIndex, + SectionIndex, SubArchitecture, SymbolIndex, }; use crate::{endian, macho, BigEndian, ByteString, Endian, Endianness, Pod}; @@ -16,15 +16,21 @@ use super::{ }; /// A 32-bit Mach-O object file. +/// +/// This is a file that starts with [`macho::MachHeader32`], and corresponds +/// to [`crate::FileKind::MachO32`]. pub type MachOFile32<'data, Endian = Endianness, R = &'data [u8]> = MachOFile<'data, macho::MachHeader32, R>; /// A 64-bit Mach-O object file. +/// +/// This is a file that starts with [`macho::MachHeader64`], and corresponds +/// to [`crate::FileKind::MachO64`]. pub type MachOFile64<'data, Endian = Endianness, R = &'data [u8]> = MachOFile<'data, macho::MachHeader64, R>; /// A partially parsed Mach-O file. /// -/// Most of the functionality of this type is provided by the `Object` trait implementation. +/// Most of the functionality of this type is provided by the [`Object`] trait implementation. #[derive(Debug)] pub struct MachOFile<'data, Mach, R = &'data [u8]> where @@ -162,6 +168,34 @@ where .get(index) .read_error("Invalid Mach-O segment index") } + + /// Returns the endianness. + pub fn endian(&self) -> Mach::Endian { + self.endian + } + + /// Returns the raw data. + pub fn data(&self) -> R { + self.data + } + + /// Returns the raw Mach-O file header. + pub fn raw_header(&self) -> &'data Mach { + self.header + } + + /// Return the `LC_BUILD_VERSION` load command if present. + pub fn build_version(&self) -> Result>> { + let mut commands = self + .header + .load_commands(self.endian, self.data, self.header_offset)?; + while let Some(command) = commands.next()? { + if let Some(build_version) = command.build_version()? { + return Ok(Some(build_version)); + } + } + Ok(None) + } } impl<'data, Mach, R> read::private::Sealed for MachOFile<'data, Mach, R> @@ -202,6 +236,16 @@ where } } + fn sub_architecture(&self) -> Option { + match ( + self.header.cputype(self.endian), + self.header.cpusubtype(self.endian), + ) { + (macho::CPU_TYPE_ARM64, macho::CPU_SUBTYPE_ARM64E) => Some(SubArchitecture::Arm64E), + _ => None, + } + } + #[inline] fn is_little_endian(&self) -> bool { self.header.is_little_endian() @@ -431,14 +475,16 @@ where } } -/// An iterator over the COMDAT section groups of a `MachOFile64`. +/// An iterator for the COMDAT section groups in a [`MachOFile64`]. pub type MachOComdatIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdatIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the COMDAT section groups of a `MachOFile64`. +/// An iterator for the COMDAT section groups in a [`MachOFile64`]. pub type MachOComdatIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdatIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the COMDAT section groups of a `MachOFile`. +/// An iterator for the COMDAT section groups in a [`MachOFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct MachOComdatIterator<'data, 'file, Mach, R = &'data [u8]> where @@ -462,15 +508,17 @@ where } } -/// A COMDAT section group of a `MachOFile32`. +/// A COMDAT section group in a [`MachOFile32`]. pub type MachOComdat32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdat<'data, 'file, macho::MachHeader32, R>; -/// A COMDAT section group of a `MachOFile64`. +/// A COMDAT section group in a [`MachOFile64`]. pub type MachOComdat64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdat<'data, 'file, macho::MachHeader64, R>; -/// A COMDAT section group of a `MachOFile`. +/// A COMDAT section group in a [`MachOFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct MachOComdat<'data, 'file, Mach, R = &'data [u8]> where @@ -521,14 +569,16 @@ where } } -/// An iterator over the sections in a COMDAT section group of a `MachOFile32`. +/// An iterator for the sections in a COMDAT section group in a [`MachOFile32`]. pub type MachOComdatSectionIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdatSectionIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the sections in a COMDAT section group of a `MachOFile64`. +/// An iterator for the sections in a COMDAT section group in a [`MachOFile64`]. pub type MachOComdatSectionIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOComdatSectionIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the sections in a COMDAT section group of a `MachOFile`. +/// An iterator for the sections in a COMDAT section group in a [`MachOFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct MachOComdatSectionIterator<'data, 'file, Mach, R = &'data [u8]> where @@ -551,7 +601,7 @@ where } } -/// A trait for generic access to `MachHeader32` and `MachHeader64`. +/// A trait for generic access to [`macho::MachHeader32`] and [`macho::MachHeader64`]. #[allow(missing_docs)] pub trait MachHeader: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/macho/load_command.rs b/vendor/object/src/read/macho/load_command.rs index e9af89d8b..7225fbdb7 100644 --- a/vendor/object/src/read/macho/load_command.rs +++ b/vendor/object/src/read/macho/load_command.rs @@ -7,7 +7,7 @@ use crate::pod::Pod; use crate::read::macho::{MachHeader, SymbolTable}; use crate::read::{Bytes, Error, ReadError, ReadRef, Result, StringTable}; -/// An iterator over the load commands of a `MachHeader`. +/// An iterator for the load commands from a [`MachHeader`]. #[derive(Debug, Default, Clone, Copy)] pub struct LoadCommandIterator<'data, E: Endian> { endian: E, @@ -51,7 +51,7 @@ impl<'data, E: Endian> LoadCommandIterator<'data, E> { } } -/// The data for a `LoadCommand`. +/// The data for a [`macho::LoadCommand`]. #[derive(Debug, Clone, Copy)] pub struct LoadCommandData<'data, E: Endian> { cmd: u32, @@ -61,14 +61,14 @@ pub struct LoadCommandData<'data, E: Endian> { } impl<'data, E: Endian> LoadCommandData<'data, E> { - /// Return the `cmd` field of the `LoadCommand`. + /// Return the `cmd` field of the [`macho::LoadCommand`]. /// /// This is one of the `LC_` constants. pub fn cmd(&self) -> u32 { self.cmd } - /// Return the `cmdsize` field of the `LoadCommand`. + /// Return the `cmdsize` field of the [`macho::LoadCommand`]. pub fn cmdsize(&self) -> u32 { self.data.len() as u32 } @@ -81,7 +81,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { .read_error("Invalid Mach-O command size") } - /// Raw bytes of this LoadCommand structure. + /// Raw bytes of this [`macho::LoadCommand`] structure. pub fn raw_data(&self) -> &'data [u8] { self.data.0 } @@ -163,7 +163,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { }) } - /// Try to parse this command as a `SegmentCommand32`. + /// Try to parse this command as a [`macho::SegmentCommand32`]. /// /// Returns the segment command and the data containing the sections. pub fn segment_32(self) -> Result, &'data [u8])>> { @@ -176,7 +176,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `SymtabCommand`. + /// Try to parse this command as a [`macho::SymtabCommand`]. /// /// Returns the segment command and the data containing the sections. pub fn symtab(self) -> Result>> { @@ -187,7 +187,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `DysymtabCommand`. + /// Try to parse this command as a [`macho::DysymtabCommand`]. pub fn dysymtab(self) -> Result>> { if self.cmd == macho::LC_DYSYMTAB { Some(self.data()).transpose() @@ -196,7 +196,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `DylibCommand`. + /// Try to parse this command as a [`macho::DylibCommand`]. pub fn dylib(self) -> Result>> { if self.cmd == macho::LC_LOAD_DYLIB || self.cmd == macho::LC_LOAD_WEAK_DYLIB @@ -210,7 +210,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `UuidCommand`. + /// Try to parse this command as a [`macho::UuidCommand`]. pub fn uuid(self) -> Result>> { if self.cmd == macho::LC_UUID { Some(self.data()).transpose() @@ -219,7 +219,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `SegmentCommand64`. + /// Try to parse this command as a [`macho::SegmentCommand64`]. pub fn segment_64(self) -> Result, &'data [u8])>> { if self.cmd == macho::LC_SEGMENT_64 { let mut data = self.data; @@ -230,7 +230,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as a `DyldInfoCommand`. + /// Try to parse this command as a [`macho::DyldInfoCommand`]. pub fn dyld_info(self) -> Result>> { if self.cmd == macho::LC_DYLD_INFO || self.cmd == macho::LC_DYLD_INFO_ONLY { Some(self.data()).transpose() @@ -239,7 +239,7 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { } } - /// Try to parse this command as an `EntryPointCommand`. + /// Try to parse this command as an [`macho::EntryPointCommand`]. pub fn entry_point(self) -> Result>> { if self.cmd == macho::LC_MAIN { Some(self.data()).transpose() @@ -247,9 +247,18 @@ impl<'data, E: Endian> LoadCommandData<'data, E> { Ok(None) } } + + /// Try to parse this command as a [`macho::BuildVersionCommand`]. + pub fn build_version(self) -> Result>> { + if self.cmd == macho::LC_BUILD_VERSION { + Some(self.data()).transpose() + } else { + Ok(None) + } + } } -/// A `LoadCommand` that has been interpreted according to its `cmd` field. +/// A [`macho::LoadCommand`] that has been interpreted according to its `cmd` field. #[derive(Debug, Clone, Copy)] #[non_exhaustive] pub enum LoadCommandVariant<'data, E: Endian> { diff --git a/vendor/object/src/read/macho/mod.rs b/vendor/object/src/read/macho/mod.rs index f07ed581b..ab51ff32e 100644 --- a/vendor/object/src/read/macho/mod.rs +++ b/vendor/object/src/read/macho/mod.rs @@ -1,9 +1,51 @@ //! Support for reading Mach-O files. //! -//! Defines traits to abstract over the difference between 32-bit and 64-bit -//! Mach-O files, and implements read functionality in terms of these traits. +//! Traits are used to abstract over the difference between 32-bit and 64-bit Mach-O +//! files. The primary trait for this is [`MachHeader`]. //! -//! Also provides `MachOFile` and related types which implement the `Object` trait. +//! ## High level API +//! +//! [`MachOFile`] implements the [`Object`](crate::read::Object) trait for Mach-O files. +//! [`MachOFile`] is parameterised by [`MachHeader`] to allow reading both 32-bit and +//! 64-bit Mach-O files. There are type aliases for these parameters ([`MachOFile32`] and +//! [`MachOFile64`]). +//! +//! ## Low level API +//! +//! The [`MachHeader`] trait can be directly used to parse both [`macho::MachHeader32`] +//! and [`macho::MachHeader64`]. Additionally, [`FatHeader`] and the [`FatArch`] trait +//! can be used to iterate images in multi-architecture binaries, and [`DyldCache`] can +//! be used to locate images in a dyld shared cache. +//! +//! ### Example for low level API +//! ```no_run +//! use object::macho; +//! use object::read::macho::{MachHeader, Nlist}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each symbol. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let header = macho::MachHeader64::::parse(&*data, 0)?; +//! let endian = header.endian()?; +//! let mut commands = header.load_commands(endian, &*data, 0)?; +//! while let Some(command) = commands.next()? { +//! if let Some(symtab_command) = command.symtab()? { +//! let symbols = symtab_command.symbols::, _>(endian, &*data)?; +//! for symbol in symbols.iter() { +//! let name = symbol.name(endian, symbols.strings())?; +//! println!("{}", String::from_utf8_lossy(name)); +//! } +//! } +//! } +//! # } +//! Ok(()) +//! } +//! ``` +#[cfg(doc)] +use crate::macho; mod dyld_cache; pub use dyld_cache::*; diff --git a/vendor/object/src/read/macho/relocation.rs b/vendor/object/src/read/macho/relocation.rs index 18e22ef70..709f1a443 100644 --- a/vendor/object/src/read/macho/relocation.rs +++ b/vendor/object/src/read/macho/relocation.rs @@ -9,14 +9,14 @@ use crate::read::{ use super::{MachHeader, MachOFile}; -/// An iterator over the relocations in a `MachOSection32`. +/// An iterator for the relocations in a [`MachOSection32`](super::MachOSection32). pub type MachORelocationIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachORelocationIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the relocations in a `MachOSection64`. +/// An iterator for the relocations in a [`MachOSection64`](super::MachOSection64). pub type MachORelocationIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachORelocationIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the relocations in a `MachOSection`. +/// An iterator for the relocations in a [`MachOSection`](super::MachOSection). pub struct MachORelocationIterator<'data, 'file, Mach, R = &'data [u8]> where Mach: MachHeader, @@ -34,6 +34,7 @@ where type Item = (u64, Relocation); fn next(&mut self) -> Option { + let mut paired_addend = 0; loop { let reloc = self.relocations.next()?; let endian = self.file.endian; @@ -56,6 +57,12 @@ where macho::CPU_TYPE_ARM64 | macho::CPU_TYPE_ARM64_32 => { match (reloc.r_type, reloc.r_pcrel) { (macho::ARM64_RELOC_UNSIGNED, false) => RelocationKind::Absolute, + (macho::ARM64_RELOC_ADDEND, _) => { + paired_addend = i64::from(reloc.r_symbolnum) + .wrapping_shl(64 - 24) + .wrapping_shr(64 - 24); + continue; + } _ => RelocationKind::MachO { value: reloc.r_type, relative: reloc.r_pcrel, @@ -100,7 +107,31 @@ where } else { RelocationTarget::Section(SectionIndex(reloc.r_symbolnum as usize)) }; - let addend = if reloc.r_pcrel { -4 } else { 0 }; + let implicit_addend = paired_addend == 0; + let mut addend = paired_addend; + if reloc.r_pcrel { + // For PC relative relocations on some architectures, the + // addend does not include the offset required due to the + // PC being different from the place of the relocation. + // This differs from other file formats, so adjust the + // addend here to account for this. + match cputype { + macho::CPU_TYPE_X86 => { + addend -= 1 << reloc.r_length; + } + macho::CPU_TYPE_X86_64 => { + addend -= 1 << reloc.r_length; + match reloc.r_type { + macho::X86_64_RELOC_SIGNED_1 => addend -= 1, + macho::X86_64_RELOC_SIGNED_2 => addend -= 2, + macho::X86_64_RELOC_SIGNED_4 => addend -= 4, + _ => {} + } + } + // TODO: maybe missing support for some architectures and relocations + _ => {} + } + } return Some(( reloc.r_address as u64, Relocation { @@ -109,7 +140,7 @@ where size, target, addend, - implicit_addend: true, + implicit_addend, }, )); } diff --git a/vendor/object/src/read/macho/section.rs b/vendor/object/src/read/macho/section.rs index f43a5b83d..7c79123bb 100644 --- a/vendor/object/src/read/macho/section.rs +++ b/vendor/object/src/read/macho/section.rs @@ -11,14 +11,14 @@ use crate::read::{ use super::{MachHeader, MachOFile, MachORelocationIterator}; -/// An iterator over the sections of a `MachOFile32`. +/// An iterator for the sections in a [`MachOFile32`](super::MachOFile32). pub type MachOSectionIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSectionIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the sections of a `MachOFile64`. +/// An iterator for the sections in a [`MachOFile64`](super::MachOFile64). pub type MachOSectionIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSectionIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the sections of a `MachOFile`. +/// An iterator for the sections in a [`MachOFile`]. pub struct MachOSectionIterator<'data, 'file, Mach, R = &'data [u8]> where Mach: MachHeader, @@ -54,14 +54,16 @@ where } } -/// A section of a `MachOFile32`. +/// A section in a [`MachOFile32`](super::MachOFile32). pub type MachOSection32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSection<'data, 'file, macho::MachHeader32, R>; -/// A section of a `MachOFile64`. +/// A section in a [`MachOFile64`](super::MachOFile64). pub type MachOSection64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSection<'data, 'file, macho::MachHeader64, R>; -/// A section of a `MachOFile`. +/// A section in a [`MachOFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct MachOSection<'data, 'file, Mach, R = &'data [u8]> where @@ -247,7 +249,7 @@ impl<'data, Mach: MachHeader> MachOSectionInternal<'data, Mach> { } } -/// A trait for generic access to `Section32` and `Section64`. +/// A trait for generic access to [`macho::Section32`] and [`macho::Section64`]. #[allow(missing_docs)] pub trait Section: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/macho/segment.rs b/vendor/object/src/read/macho/segment.rs index 01037e1dd..c889ad248 100644 --- a/vendor/object/src/read/macho/segment.rs +++ b/vendor/object/src/read/macho/segment.rs @@ -8,14 +8,14 @@ use crate::read::{self, ObjectSegment, ReadError, ReadRef, Result, SegmentFlags} use super::{LoadCommandData, MachHeader, MachOFile, Section}; -/// An iterator over the segments of a `MachOFile32`. +/// An iterator for the segments in a [`MachOFile32`](super::MachOFile32). pub type MachOSegmentIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSegmentIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the segments of a `MachOFile64`. +/// An iterator for the segments in a [`MachOFile64`](super::MachOFile64). pub type MachOSegmentIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSegmentIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the segments of a `MachOFile`. +/// An iterator for the segments in a [`MachOFile`]. #[derive(Debug)] pub struct MachOSegmentIterator<'data, 'file, Mach, R = &'data [u8]> where @@ -41,14 +41,16 @@ where } } -/// A segment of a `MachOFile32`. +/// A segment in a [`MachOFile32`](super::MachOFile32). pub type MachOSegment32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSegment<'data, 'file, macho::MachHeader32, R>; -/// A segment of a `MachOFile64`. +/// A segment in a [`MachOFile64`](super::MachOFile64). pub type MachOSegment64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSegment<'data, 'file, macho::MachHeader64, R>; -/// A segment of a `MachOFile`. +/// A segment in a [`MachOFile`]. +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. #[derive(Debug)] pub struct MachOSegment<'data, 'file, Mach, R = &'data [u8]> where @@ -151,7 +153,7 @@ pub(super) struct MachOSegmentInternal<'data, Mach: MachHeader, R: ReadRef<'data pub segment: &'data Mach::Segment, } -/// A trait for generic access to `SegmentCommand32` and `SegmentCommand64`. +/// A trait for generic access to [`macho::SegmentCommand32`] and [`macho::SegmentCommand64`]. #[allow(missing_docs)] pub trait Segment: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/macho/symbol.rs b/vendor/object/src/read/macho/symbol.rs index ef8852145..434361f4c 100644 --- a/vendor/object/src/read/macho/symbol.rs +++ b/vendor/object/src/read/macho/symbol.rs @@ -17,6 +17,8 @@ use super::{MachHeader, MachOFile}; /// A table of symbol entries in a Mach-O file. /// /// Also includes the string table used for the symbol names. +/// +/// Returned by [`macho::SymtabCommand::symbols`]. #[derive(Debug, Clone, Copy)] pub struct SymbolTable<'data, Mach: MachHeader, R = &'data [u8]> where @@ -143,14 +145,14 @@ impl<'data, Mach: MachHeader, R: ReadRef<'data>> SymbolTable<'data, Mach, R> { } } -/// An iterator over the symbols of a `MachOFile32`. +/// A symbol table in a [`MachOFile32`](super::MachOFile32). pub type MachOSymbolTable32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbolTable<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the symbols of a `MachOFile64`. +/// A symbol table in a [`MachOFile64`](super::MachOFile64). pub type MachOSymbolTable64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbolTable<'data, 'file, macho::MachHeader64, R>; -/// A symbol table of a `MachOFile`. +/// A symbol table in a [`MachOFile`]. #[derive(Debug, Clone, Copy)] pub struct MachOSymbolTable<'data, 'file, Mach, R = &'data [u8]> where @@ -188,14 +190,14 @@ where } } -/// An iterator over the symbols of a `MachOFile32`. +/// An iterator for the symbols in a [`MachOFile32`](super::MachOFile32). pub type MachOSymbolIterator32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbolIterator<'data, 'file, macho::MachHeader32, R>; -/// An iterator over the symbols of a `MachOFile64`. +/// An iterator for the symbols in a [`MachOFile64`](super::MachOFile64). pub type MachOSymbolIterator64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbolIterator<'data, 'file, macho::MachHeader64, R>; -/// An iterator over the symbols of a `MachOFile`. +/// An iterator for the symbols in a [`MachOFile`]. pub struct MachOSymbolIterator<'data, 'file, Mach, R = &'data [u8]> where Mach: MachHeader, @@ -234,14 +236,16 @@ where } } -/// A symbol of a `MachOFile32`. +/// A symbol in a [`MachOFile32`](super::MachOFile32). pub type MachOSymbol32<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbol<'data, 'file, macho::MachHeader32, R>; -/// A symbol of a `MachOFile64`. +/// A symbol in a [`MachOFile64`](super::MachOFile64). pub type MachOSymbol64<'data, 'file, Endian = Endianness, R = &'data [u8]> = MachOSymbol<'data, 'file, macho::MachHeader64, R>; -/// A symbol of a `MachOFile`. +/// A symbol in a [`MachOFile`]. +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. #[derive(Debug, Clone, Copy)] pub struct MachOSymbol<'data, 'file, Mach, R = &'data [u8]> where @@ -394,7 +398,7 @@ where } } -/// A trait for generic access to `Nlist32` and `Nlist64`. +/// A trait for generic access to [`macho::Nlist32`] and [`macho::Nlist64`]. #[allow(missing_docs)] pub trait Nlist: Debug + Pod { type Word: Into; @@ -432,7 +436,7 @@ pub trait Nlist: Debug + Pod { /// Return true if the symbol is a definition of a function or data object. fn is_definition(&self) -> bool { let n_type = self.n_type(); - n_type & macho::N_STAB == 0 && n_type & macho::N_TYPE != macho::N_UNDF + n_type & macho::N_STAB == 0 && n_type & macho::N_TYPE == macho::N_SECT } /// Return the library ordinal. diff --git a/vendor/object/src/read/mod.rs b/vendor/object/src/read/mod.rs index 8230d43ba..c13e30913 100644 --- a/vendor/object/src/read/mod.rs +++ b/vendor/object/src/read/mod.rs @@ -1,4 +1,45 @@ //! Interface for reading object files. +//! +//! ## Unified read API +//! +//! The [`Object`] trait provides a unified read API for accessing common features of +//! object files, such as sections and symbols. There is an implementation of this +//! trait for [`File`], which allows reading any file format, as well as implementations +//! for each file format: +//! [`ElfFile`](elf::ElfFile), [`MachOFile`](macho::MachOFile), [`CoffFile`](coff::CoffFile), +//! [`PeFile`](pe::PeFile), [`WasmFile`](wasm::WasmFile), [`XcoffFile`](xcoff::XcoffFile). +//! +//! ## Low level read API +//! +//! The submodules for each file format define helpers that operate on the raw structs. +//! These can be used instead of the unified API, or in conjunction with it to access +//! details that are not available via the unified API. +//! +//! See the [submodules](#modules) for examples of the low level read API. +//! +//! ## Naming Convention +//! +//! Types that form part of the unified API for a file format are prefixed with the +//! name of the file format. +//! +//! ## Example for unified read API +//! ```no_run +//! use object::{Object, ObjectSection}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each section. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let file = object::File::parse(&*data)?; +//! for section in file.sections() { +//! println!("{}", section.name()?); +//! } +//! # } +//! Ok(()) +//! } +//! ``` use alloc::borrow::Cow; use alloc::vec::Vec; @@ -146,53 +187,85 @@ pub type NativeFile<'data, R = &'data [u8]> = wasm::WasmFile<'data, R>; #[non_exhaustive] pub enum FileKind { /// A Unix archive. + /// + /// See [`archive::ArchiveFile`]. #[cfg(feature = "archive")] Archive, /// A COFF object file. + /// + /// See [`coff::CoffFile`]. #[cfg(feature = "coff")] Coff, /// A COFF bigobj object file. /// /// This supports a larger number of sections. + /// + /// See [`coff::CoffBigFile`]. #[cfg(feature = "coff")] CoffBig, /// A Windows short import file. + /// + /// See [`coff::ImportFile`]. #[cfg(feature = "coff")] CoffImport, /// A dyld cache file containing Mach-O images. + /// + /// See [`macho::DyldCache`] #[cfg(feature = "macho")] DyldCache, /// A 32-bit ELF file. + /// + /// See [`elf::ElfFile32`]. #[cfg(feature = "elf")] Elf32, /// A 64-bit ELF file. + /// + /// See [`elf::ElfFile64`]. #[cfg(feature = "elf")] Elf64, /// A 32-bit Mach-O file. + /// + /// See [`macho::MachOFile32`]. #[cfg(feature = "macho")] MachO32, /// A 64-bit Mach-O file. + /// + /// See [`macho::MachOFile64`]. #[cfg(feature = "macho")] MachO64, /// A 32-bit Mach-O fat binary. + /// + /// See [`macho::FatHeader::parse_arch32`]. #[cfg(feature = "macho")] MachOFat32, /// A 64-bit Mach-O fat binary. + /// + /// See [`macho::FatHeader::parse_arch64`]. #[cfg(feature = "macho")] MachOFat64, /// A 32-bit PE file. + /// + /// See [`pe::PeFile32`]. #[cfg(feature = "pe")] Pe32, /// A 64-bit PE file. + /// + /// See [`pe::PeFile64`]. #[cfg(feature = "pe")] Pe64, /// A Wasm file. + /// + /// See [`wasm::WasmFile`]. #[cfg(feature = "wasm")] Wasm, /// A 32-bit XCOFF file. + /// + /// See [`xcoff::XcoffFile32`]. #[cfg(feature = "xcoff")] Xcoff32, /// A 64-bit XCOFF file. + /// + /// See [`xcoff::XcoffFile64`]. #[cfg(feature = "xcoff")] Xcoff64, } @@ -252,6 +325,8 @@ impl FileKind { [0xc4, 0x01, ..] // COFF arm64 | [0x64, 0xaa, ..] + // COFF arm64ec + | [0x41, 0xa6, ..] // COFF x86 | [0x4c, 0x01, ..] // COFF x86-64 @@ -277,6 +352,8 @@ impl FileKind { } /// An object kind. +/// +/// Returned by [`Object::kind`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[non_exhaustive] pub enum ObjectKind { @@ -292,15 +369,15 @@ pub enum ObjectKind { Core, } -/// The index used to identify a section of a file. +/// The index used to identify a section in a file. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct SectionIndex(pub usize); -/// The index used to identify a symbol of a file. +/// The index used to identify a symbol in a symbol table. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct SymbolIndex(pub usize); -/// The section where a symbol is defined. +/// The section where an [`ObjectSymbol`] is defined. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[non_exhaustive] pub enum SymbolSection { @@ -332,13 +409,17 @@ impl SymbolSection { } } -/// An entry in a `SymbolMap`. +/// An entry in a [`SymbolMap`]. pub trait SymbolMapEntry { /// The symbol address. fn address(&self) -> u64; } -/// A map from addresses to symbols. +/// A map from addresses to symbol information. +/// +/// The symbol information depends on the chosen entry type, such as [`SymbolMapName`]. +/// +/// Returned by [`Object::symbol_map`]. #[derive(Debug, Default, Clone)] pub struct SymbolMap { symbols: Vec, @@ -349,7 +430,7 @@ impl SymbolMap { /// /// This function will sort the symbols by address. pub fn new(mut symbols: Vec) -> Self { - symbols.sort_unstable_by_key(|s| s.address()); + symbols.sort_by_key(|s| s.address()); SymbolMap { symbols } } @@ -372,7 +453,7 @@ impl SymbolMap { } } -/// A `SymbolMap` entry for symbol names. +/// The type used for entries in a [`SymbolMap`] that maps from addresses to names. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct SymbolMapName<'data> { address: u64, @@ -408,6 +489,8 @@ impl<'data> SymbolMapEntry for SymbolMapName<'data> { /// A map from addresses to symbol names and object files. /// /// This is derived from STAB entries in Mach-O files. +/// +/// Returned by [`Object::object_map`]. #[derive(Debug, Default, Clone)] pub struct ObjectMap<'data> { symbols: SymbolMap>, @@ -435,7 +518,7 @@ impl<'data> ObjectMap<'data> { } } -/// A `ObjectMap` entry. +/// An [`ObjectMap`] entry. #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] pub struct ObjectMapEntry<'data> { address: u64, @@ -486,6 +569,8 @@ impl<'data> SymbolMapEntry for ObjectMapEntry<'data> { } /// An imported symbol. +/// +/// Returned by [`Object::imports`]. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Import<'data> { library: ByteString<'data>, @@ -508,6 +593,8 @@ impl<'data> Import<'data> { } /// An exported symbol. +/// +/// Returned by [`Object::exports`]. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Export<'data> { // TODO: and ordinal? @@ -529,7 +616,7 @@ impl<'data> Export<'data> { } } -/// PDB Information +/// PDB information from the debug directory in a PE file. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct CodeView<'data> { guid: [u8; 16], @@ -538,13 +625,13 @@ pub struct CodeView<'data> { } impl<'data> CodeView<'data> { - /// The path to the PDB as stored in CodeView + /// The path to the PDB as stored in CodeView. #[inline] pub fn path(&self) -> &'data [u8] { self.path.0 } - /// The age of the PDB + /// The age of the PDB. #[inline] pub fn age(&self) -> u32 { self.age @@ -557,7 +644,7 @@ impl<'data> CodeView<'data> { } } -/// The target referenced by a relocation. +/// The target referenced by a [`Relocation`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[non_exhaustive] pub enum RelocationTarget { @@ -570,6 +657,8 @@ pub enum RelocationTarget { } /// A relocation entry. +/// +/// Returned by [`Object::dynamic_relocations`] or [`ObjectSection::relocations`]. #[derive(Debug)] pub struct Relocation { kind: RelocationKind, @@ -646,6 +735,8 @@ pub enum CompressionFormat { } /// A range in a file that may be compressed. +/// +/// Returned by [`ObjectSection::compressed_file_range`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct CompressedFileRange { /// The data compression format. @@ -679,7 +770,7 @@ impl CompressedFileRange { } } - /// Convert to `CompressedData` by reading from the file. + /// Convert to [`CompressedData`] by reading from the file. pub fn data<'data, R: ReadRef<'data>>(self, file: R) -> Result> { let data = file .read_bytes_at(self.offset, self.compressed_size) @@ -693,6 +784,8 @@ impl CompressedFileRange { } /// Data that may be compressed. +/// +/// Returned by [`ObjectSection::compressed_data`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct CompressedData<'data> { /// The data compression format. diff --git a/vendor/object/src/read/pe/data_directory.rs b/vendor/object/src/read/pe/data_directory.rs index 0e10244bf..a17179f19 100644 --- a/vendor/object/src/read/pe/data_directory.rs +++ b/vendor/object/src/read/pe/data_directory.rs @@ -9,6 +9,8 @@ use super::{ }; /// The table of data directories in a PE file. +/// +/// Returned by [`ImageNtHeaders::parse`](super::ImageNtHeaders::parse). #[derive(Debug, Clone, Copy)] pub struct DataDirectories<'data> { entries: &'data [pe::ImageDataDirectory], diff --git a/vendor/object/src/read/pe/export.rs b/vendor/object/src/read/pe/export.rs index 88dc78d50..1aba844f8 100644 --- a/vendor/object/src/read/pe/export.rs +++ b/vendor/object/src/read/pe/export.rs @@ -80,6 +80,8 @@ impl<'a> Debug for ExportTarget<'a> { } /// A partially parsed PE export table. +/// +/// Returned by [`DataDirectories::export_table`](super::DataDirectories::export_table). #[derive(Debug, Clone)] pub struct ExportTable<'data> { data: Bytes<'data>, diff --git a/vendor/object/src/read/pe/file.rs b/vendor/object/src/read/pe/file.rs index 0f8ce9f25..5372bddad 100644 --- a/vendor/object/src/read/pe/file.rs +++ b/vendor/object/src/read/pe/file.rs @@ -9,7 +9,7 @@ use crate::read::{ self, Architecture, ComdatKind, Error, Export, FileFlags, Import, NoDynamicRelocationIterator, Object, ObjectComdat, ObjectKind, ReadError, ReadRef, Result, SectionIndex, SymbolIndex, }; -use crate::{pe, ByteString, Bytes, CodeView, LittleEndian as LE, Pod, U32}; +use crate::{pe, ByteString, Bytes, CodeView, LittleEndian as LE, Pod, SubArchitecture, U32}; use super::{ DataDirectories, ExportTable, ImageThunkData, ImportTable, PeSection, PeSectionIterator, @@ -17,11 +17,19 @@ use super::{ }; /// A PE32 (32-bit) image file. +/// +/// This is a file that starts with [`pe::ImageNtHeaders32`], and corresponds +/// to [`crate::FileKind::Pe32`]. pub type PeFile32<'data, R = &'data [u8]> = PeFile<'data, pe::ImageNtHeaders32, R>; /// A PE32+ (64-bit) image file. +/// +/// This is a file that starts with [`pe::ImageNtHeaders64`], and corresponds +/// to [`crate::FileKind::Pe64`]. pub type PeFile64<'data, R = &'data [u8]> = PeFile<'data, pe::ImageNtHeaders64, R>; -/// A PE object file. +/// A PE image file. +/// +/// Most functionality is provided by the [`Object`] trait implementation. #[derive(Debug)] pub struct PeFile<'data, Pe, R = &'data [u8]> where @@ -147,13 +155,20 @@ where fn architecture(&self) -> Architecture { match self.nt_headers.file_header().machine.get(LE) { pe::IMAGE_FILE_MACHINE_ARMNT => Architecture::Arm, - pe::IMAGE_FILE_MACHINE_ARM64 => Architecture::Aarch64, + pe::IMAGE_FILE_MACHINE_ARM64 | pe::IMAGE_FILE_MACHINE_ARM64EC => Architecture::Aarch64, pe::IMAGE_FILE_MACHINE_I386 => Architecture::I386, pe::IMAGE_FILE_MACHINE_AMD64 => Architecture::X86_64, _ => Architecture::Unknown, } } + fn sub_architecture(&self) -> Option { + match self.nt_headers.file_header().machine.get(LE) { + pe::IMAGE_FILE_MACHINE_ARM64EC => Some(SubArchitecture::Arm64EC), + _ => None, + } + } + #[inline] fn is_little_endian(&self) -> bool { // Only little endian is supported. @@ -380,14 +395,16 @@ where } } -/// An iterator over the COMDAT section groups of a `PeFile32`. +/// An iterator for the COMDAT section groups in a [`PeFile32`]. pub type PeComdatIterator32<'data, 'file, R = &'data [u8]> = PeComdatIterator<'data, 'file, pe::ImageNtHeaders32, R>; -/// An iterator over the COMDAT section groups of a `PeFile64`. +/// An iterator for the COMDAT section groups in a [`PeFile64`]. pub type PeComdatIterator64<'data, 'file, R = &'data [u8]> = PeComdatIterator<'data, 'file, pe::ImageNtHeaders64, R>; -/// An iterator over the COMDAT section groups of a `PeFile`. +/// An iterator for the COMDAT section groups in a [`PeFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct PeComdatIterator<'data, 'file, Pe, R = &'data [u8]> where @@ -411,14 +428,16 @@ where } } -/// A COMDAT section group of a `PeFile32`. +/// A COMDAT section group in a [`PeFile32`]. pub type PeComdat32<'data, 'file, R = &'data [u8]> = PeComdat<'data, 'file, pe::ImageNtHeaders32, R>; -/// A COMDAT section group of a `PeFile64`. +/// A COMDAT section group in a [`PeFile64`]. pub type PeComdat64<'data, 'file, R = &'data [u8]> = PeComdat<'data, 'file, pe::ImageNtHeaders64, R>; -/// A COMDAT section group of a `PeFile`. +/// A COMDAT section group in a [`PeFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct PeComdat<'data, 'file, Pe, R = &'data [u8]> where @@ -469,14 +488,16 @@ where } } -/// An iterator over the sections in a COMDAT section group of a `PeFile32`. +/// An iterator for the sections in a COMDAT section group in a [`PeFile32`]. pub type PeComdatSectionIterator32<'data, 'file, R = &'data [u8]> = PeComdatSectionIterator<'data, 'file, pe::ImageNtHeaders32, R>; -/// An iterator over the sections in a COMDAT section group of a `PeFile64`. +/// An iterator for the sections in a COMDAT section group in a [`PeFile64`]. pub type PeComdatSectionIterator64<'data, 'file, R = &'data [u8]> = PeComdatSectionIterator<'data, 'file, pe::ImageNtHeaders64, R>; -/// An iterator over the sections in a COMDAT section group of a `PeFile`. +/// An iterator for the sections in a COMDAT section group in a [`PeFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct PeComdatSectionIterator<'data, 'file, Pe, R = &'data [u8]> where @@ -521,7 +542,7 @@ impl pe::ImageDosHeader { } } -/// Find the optional header and read the `optional_header.magic`. +/// Find the optional header and read its `magic` field. /// /// It can be useful to know this magic value before trying to /// fully parse the NT headers. @@ -540,7 +561,7 @@ pub fn optional_header_magic<'data, R: ReadRef<'data>>(data: R) -> Result { Ok(nt_headers.optional_header().magic()) } -/// A trait for generic access to `ImageNtHeaders32` and `ImageNtHeaders64`. +/// A trait for generic access to [`pe::ImageNtHeaders32`] and [`pe::ImageNtHeaders64`]. #[allow(missing_docs)] pub trait ImageNtHeaders: Debug + Pod { type ImageOptionalHeader: ImageOptionalHeader; @@ -569,7 +590,7 @@ pub trait ImageNtHeaders: Debug + Pod { /// /// `data` must be for the entire file. /// - /// `offset` must be headers offset, which can be obtained from `ImageDosHeader::nt_headers_offset`. + /// `offset` must be headers offset, which can be obtained from [`pe::ImageDosHeader::nt_headers_offset`]. /// It is updated to point after the optional header, which is where the section headers are located. /// /// Also checks that the `signature` and `magic` fields in the headers are valid. @@ -626,7 +647,7 @@ pub trait ImageNtHeaders: Debug + Pod { } } -/// A trait for generic access to `ImageOptionalHeader32` and `ImageOptionalHeader64`. +/// A trait for generic access to [`pe::ImageOptionalHeader32`] and [`pe::ImageOptionalHeader64`]. #[allow(missing_docs)] pub trait ImageOptionalHeader: Debug + Pod { // Standard fields. diff --git a/vendor/object/src/read/pe/import.rs b/vendor/object/src/read/pe/import.rs index a5535dc36..8e9a9a9f1 100644 --- a/vendor/object/src/read/pe/import.rs +++ b/vendor/object/src/read/pe/import.rs @@ -7,6 +7,8 @@ use crate::{pe, LittleEndian as LE, Pod, U16Bytes}; use super::ImageNtHeaders; /// Information for parsing a PE import table. +/// +/// Returned by [`DataDirectories::import_table`](super::DataDirectories::import_table). #[derive(Debug, Clone)] pub struct ImportTable<'data> { section_data: Bytes<'data>, @@ -218,6 +220,9 @@ impl ImageThunkData for pe::ImageThunkData32 { } /// Information for parsing a PE delay-load import table. +/// +/// Returned by +/// [`DataDirectories::delay_load_import_table`](super::DataDirectories::delay_load_import_table). #[derive(Debug, Clone)] pub struct DelayLoadImportTable<'data> { section_data: Bytes<'data>, diff --git a/vendor/object/src/read/pe/mod.rs b/vendor/object/src/read/pe/mod.rs index 2b7cc5d7a..ab6011c88 100644 --- a/vendor/object/src/read/pe/mod.rs +++ b/vendor/object/src/read/pe/mod.rs @@ -1,11 +1,45 @@ //! Support for reading PE files. //! -//! Defines traits to abstract over the difference between PE32/PE32+, -//! and implements read functionality in terms of these traits. +//! Traits are used to abstract over the difference between PE32 and PE32+. +//! The primary trait for this is [`ImageNtHeaders`]. //! -//! This module reuses some of the COFF functionality. +//! ## High level API //! -//! Also provides `PeFile` and related types which implement the `Object` trait. +//! [`PeFile`] implements the [`Object`](crate::read::Object) trait for +//! PE files. [`PeFile`] is parameterised by [`ImageNtHeaders`] to allow +//! reading both PE32 and PE32+. There are type aliases for these parameters +//! ([`PeFile32`] and [`PeFile64`]). +//! +//! ## Low level API +//! +//! The [`ImageNtHeaders`] trait can be directly used to parse both +//! [`pe::ImageNtHeaders32`] and [`pe::ImageNtHeaders64`]. +//! +//! ### Example for low level API +//! ```no_run +//! use object::pe; +//! use object::read::pe::ImageNtHeaders; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each section. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let dos_header = pe::ImageDosHeader::parse(&*data)?; +//! let mut offset = dos_header.nt_headers_offset().into(); +//! let (nt_headers, data_directories) = pe::ImageNtHeaders64::parse(&*data, &mut offset)?; +//! let sections = nt_headers.sections(&*data, offset)?; +//! let symbols = nt_headers.symbols(&*data)?; +//! for section in sections.iter() { +//! println!("{}", String::from_utf8_lossy(section.name(symbols.strings())?)); +//! } +//! # } +//! Ok(()) +//! } +//! ``` +#[cfg(doc)] +use crate::pe; mod file; pub use file::*; diff --git a/vendor/object/src/read/pe/relocation.rs b/vendor/object/src/read/pe/relocation.rs index 06215bd1a..77421b7ba 100644 --- a/vendor/object/src/read/pe/relocation.rs +++ b/vendor/object/src/read/pe/relocation.rs @@ -5,6 +5,8 @@ use crate::pe; use crate::read::{Bytes, Error, ReadError, Result}; /// An iterator over the relocation blocks in the `.reloc` section of a PE file. +/// +/// Returned by [`DataDirectories::relocation_blocks`](super::DataDirectories::relocation_blocks). #[derive(Debug, Default, Clone, Copy)] pub struct RelocationBlockIterator<'data> { data: Bytes<'data>, diff --git a/vendor/object/src/read/pe/resource.rs b/vendor/object/src/read/pe/resource.rs index 646eaefaa..331da3f68 100644 --- a/vendor/object/src/read/pe/resource.rs +++ b/vendor/object/src/read/pe/resource.rs @@ -5,6 +5,8 @@ use crate::read::{ReadError, ReadRef, Result}; use crate::{pe, LittleEndian as LE, U16Bytes}; /// The `.rsrc` section of a PE file. +/// +/// Returned by [`DataDirectories::resource_directory`](super::DataDirectories::resource_directory). #[derive(Debug, Clone, Copy)] pub struct ResourceDirectory<'data> { data: &'data [u8], diff --git a/vendor/object/src/read/pe/section.rs b/vendor/object/src/read/pe/section.rs index 2880e401f..74c9d7f51 100644 --- a/vendor/object/src/read/pe/section.rs +++ b/vendor/object/src/read/pe/section.rs @@ -11,14 +11,14 @@ use crate::read::{ use super::{ImageNtHeaders, PeFile, SectionTable}; -/// An iterator over the loadable sections of a `PeFile32`. +/// An iterator for the loadable sections in a [`PeFile32`](super::PeFile32). pub type PeSegmentIterator32<'data, 'file, R = &'data [u8]> = PeSegmentIterator<'data, 'file, pe::ImageNtHeaders32, R>; -/// An iterator over the loadable sections of a `PeFile64`. +/// An iterator for the loadable sections in a [`PeFile64`](super::PeFile64). pub type PeSegmentIterator64<'data, 'file, R = &'data [u8]> = PeSegmentIterator<'data, 'file, pe::ImageNtHeaders64, R>; -/// An iterator over the loadable sections of a `PeFile`. +/// An iterator for the loadable sections in a [`PeFile`]. #[derive(Debug)] pub struct PeSegmentIterator<'data, 'file, Pe, R = &'data [u8]> where @@ -44,14 +44,16 @@ where } } -/// A loadable section of a `PeFile32`. +/// A loadable section in a [`PeFile32`](super::PeFile32). pub type PeSegment32<'data, 'file, R = &'data [u8]> = PeSegment<'data, 'file, pe::ImageNtHeaders32, R>; -/// A loadable section of a `PeFile64`. +/// A loadable section in a [`PeFile64`](super::PeFile64). pub type PeSegment64<'data, 'file, R = &'data [u8]> = PeSegment<'data, 'file, pe::ImageNtHeaders64, R>; -/// A loadable section of a `PeFile`. +/// A loadable section in a [`PeFile`]. +/// +/// Most functionality is provided by the [`ObjectSegment`] trait implementation. #[derive(Debug)] pub struct PeSegment<'data, 'file, Pe, R = &'data [u8]> where @@ -132,14 +134,14 @@ where } } -/// An iterator over the sections of a `PeFile32`. +/// An iterator for the sections in a [`PeFile32`](super::PeFile32). pub type PeSectionIterator32<'data, 'file, R = &'data [u8]> = PeSectionIterator<'data, 'file, pe::ImageNtHeaders32, R>; -/// An iterator over the sections of a `PeFile64`. +/// An iterator for the sections in a [`PeFile64`](super::PeFile64). pub type PeSectionIterator64<'data, 'file, R = &'data [u8]> = PeSectionIterator<'data, 'file, pe::ImageNtHeaders64, R>; -/// An iterator over the sections of a `PeFile`. +/// An iterator for the sections in a [`PeFile`]. #[derive(Debug)] pub struct PeSectionIterator<'data, 'file, Pe, R = &'data [u8]> where @@ -166,14 +168,16 @@ where } } -/// A section of a `PeFile32`. +/// A section in a [`PeFile32`](super::PeFile32). pub type PeSection32<'data, 'file, R = &'data [u8]> = PeSection<'data, 'file, pe::ImageNtHeaders32, R>; -/// A section of a `PeFile64`. +/// A section in a [`PeFile64`](super::PeFile64). pub type PeSection64<'data, 'file, R = &'data [u8]> = PeSection<'data, 'file, pe::ImageNtHeaders64, R>; -/// A section of a `PeFile`. +/// A section in a [`PeFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct PeSection<'data, 'file, Pe, R = &'data [u8]> where @@ -419,7 +423,9 @@ impl pe::ImageSectionHeader { } } -/// An iterator over the relocations in an `PeSection`. +/// An iterator for the relocations in an [`PeSection`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct PeRelocationIterator<'data, 'file, R = &'data [u8]>( PhantomData<(&'data (), &'file (), R)>, diff --git a/vendor/object/src/read/read_cache.rs b/vendor/object/src/read/read_cache.rs index dfce1e1b1..d1377f1f3 100644 --- a/vendor/object/src/read/read_cache.rs +++ b/vendor/object/src/read/read_cache.rs @@ -10,7 +10,7 @@ use std::vec::Vec; use crate::read::ReadRef; -/// An implementation of `ReadRef` for data in a stream that implements +/// An implementation of [`ReadRef`] for data in a stream that implements /// `Read + Seek`. /// /// Contains a cache of read-only blocks of data, allowing references to @@ -128,7 +128,7 @@ impl<'a, R: Read + Seek> ReadRef<'a> for &'a ReadCache { } } -/// An implementation of `ReadRef` for a range of data in a stream that +/// An implementation of [`ReadRef`] for a range of data in a stream that /// implements `Read + Seek`. /// /// Shares an underlying `ReadCache` with a lifetime of `'a`. @@ -141,11 +141,7 @@ pub struct ReadCacheRange<'a, R: Read + Seek> { impl<'a, R: Read + Seek> Clone for ReadCacheRange<'a, R> { fn clone(&self) -> Self { - Self { - r: self.r, - offset: self.offset, - size: self.size, - } + *self } } diff --git a/vendor/object/src/read/read_ref.rs b/vendor/object/src/read/read_ref.rs index a9b425221..8b87cbabc 100644 --- a/vendor/object/src/read/read_ref.rs +++ b/vendor/object/src/read/read_ref.rs @@ -8,7 +8,7 @@ use crate::pod::{from_bytes, slice_from_bytes, Pod}; type Result = result::Result; -/// A trait for reading references to `Pod` types from a block of data. +/// A trait for reading references to [`Pod`] types from a block of data. /// /// This allows parsers to handle both of these cases: /// - the block of data exists in memory, and it is desirable diff --git a/vendor/object/src/read/traits.rs b/vendor/object/src/read/traits.rs index d35b0b0ca..67105d37d 100644 --- a/vendor/object/src/read/traits.rs +++ b/vendor/object/src/read/traits.rs @@ -4,35 +4,37 @@ use alloc::vec::Vec; use crate::read::{ self, Architecture, CodeView, ComdatKind, CompressedData, CompressedFileRange, Export, FileFlags, Import, ObjectKind, ObjectMap, Relocation, Result, SectionFlags, SectionIndex, - SectionKind, SegmentFlags, SymbolFlags, SymbolIndex, SymbolKind, SymbolMap, SymbolMapName, - SymbolScope, SymbolSection, + SectionKind, SegmentFlags, SubArchitecture, SymbolFlags, SymbolIndex, SymbolKind, SymbolMap, + SymbolMapName, SymbolScope, SymbolSection, }; use crate::Endianness; /// An object file. +/// +/// This is the primary trait for the unified read API. pub trait Object<'data: 'file, 'file>: read::private::Sealed { - /// A segment in the object file. + /// A loadable segment in the object file. type Segment: ObjectSegment<'data>; - /// An iterator over the segments in the object file. + /// An iterator for the loadable segments in the object file. type SegmentIterator: Iterator; /// A section in the object file. type Section: ObjectSection<'data>; - /// An iterator over the sections in the object file. + /// An iterator for the sections in the object file. type SectionIterator: Iterator; /// A COMDAT section group in the object file. type Comdat: ObjectComdat<'data>; - /// An iterator over the COMDAT section groups in the object file. + /// An iterator for the COMDAT section groups in the object file. type ComdatIterator: Iterator; /// A symbol in the object file. type Symbol: ObjectSymbol<'data>; - /// An iterator over symbols in the object file. + /// An iterator for symbols in the object file. type SymbolIterator: Iterator; /// A symbol table in the object file. @@ -42,7 +44,7 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { SymbolIterator = Self::SymbolIterator, >; - /// An iterator over dynamic relocations in the file. + /// An iterator for the dynamic relocations in the file. /// /// The first field in the item tuple is the address /// that the relocation applies to. @@ -51,6 +53,15 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Get the architecture type of the file. fn architecture(&self) -> Architecture; + /// Get the sub-architecture type of the file if known. + /// + /// A value of `None` has a range of meanings: the file supports all + /// sub-architectures, the file does not explicitly specify a + /// sub-architecture, or the sub-architecture is currently unrecognized. + fn sub_architecture(&self) -> Option { + None + } + /// Get the endianness of the file. #[inline] fn endianness(&self) -> Endianness { @@ -70,7 +81,12 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Return the kind of this object. fn kind(&self) -> ObjectKind; - /// Get an iterator over the segments in the file. + /// Get an iterator for the loadable segments in the file. + /// + /// For ELF, this is program headers with type [`PT_LOAD`](crate::elf::PT_LOAD). + /// For Mach-O, this is load commands with type [`LC_SEGMENT`](crate::macho::LC_SEGMENT) + /// or [`LC_SEGMENT_64`](crate::macho::LC_SEGMENT_64). + /// For PE, this is all sections. fn segments(&'file self) -> Self::SegmentIterator; /// Get the section named `section_name`, if such a section exists. @@ -103,13 +119,13 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Returns an error if the index is invalid. fn section_by_index(&'file self, index: SectionIndex) -> Result; - /// Get an iterator over the sections in the file. + /// Get an iterator for the sections in the file. fn sections(&'file self) -> Self::SectionIterator; - /// Get an iterator over the COMDAT section groups in the file. + /// Get an iterator for the COMDAT section groups in the file. fn comdats(&'file self) -> Self::ComdatIterator; - /// Get the symbol table, if any. + /// Get the debugging symbol table, if any. fn symbol_table(&'file self) -> Option; /// Get the debugging symbol at the given index. @@ -119,24 +135,37 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Returns an error if the index is invalid. fn symbol_by_index(&'file self, index: SymbolIndex) -> Result; - /// Get an iterator over the debugging symbols in the file. + /// Get an iterator for the debugging symbols in the file. /// /// This may skip over symbols that are malformed or unsupported. /// /// For Mach-O files, this does not include STAB entries. fn symbols(&'file self) -> Self::SymbolIterator; + /// Get the symbol named `symbol_name`, if the symbol exists. + fn symbol_by_name(&'file self, symbol_name: &str) -> Option { + self.symbol_by_name_bytes(symbol_name.as_bytes()) + } + + /// Like [`Self::symbol_by_name`], but allows names that are not UTF-8. + fn symbol_by_name_bytes(&'file self, symbol_name: &[u8]) -> Option { + self.symbols() + .find(|sym| sym.name_bytes() == Ok(symbol_name)) + } + /// Get the dynamic linking symbol table, if any. /// /// Only ELF has a separate dynamic linking symbol table. + /// Consider using [`Self::exports`] or [`Self::imports`] instead. fn dynamic_symbol_table(&'file self) -> Option; - /// Get an iterator over the dynamic linking symbols in the file. + /// Get an iterator for the dynamic linking symbols in the file. /// /// This may skip over symbols that are malformed or unsupported. /// - /// Only ELF has separate dynamic linking symbols. + /// Only ELF has dynamic linking symbols. /// Other file formats will return an empty iterator. + /// Consider using [`Self::exports`] or [`Self::imports`] instead. fn dynamic_symbols(&'file self) -> Self::SymbolIterator; /// Get the dynamic relocations for this file. @@ -153,12 +182,56 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { fn symbol_map(&'file self) -> SymbolMap> { let mut symbols = Vec::new(); if let Some(table) = self.symbol_table().or_else(|| self.dynamic_symbol_table()) { + // Sometimes symbols share addresses. Collect them all then choose the "best". + let mut all_symbols = Vec::new(); for symbol in table.symbols() { + // Must have an address. if !symbol.is_definition() { continue; } - if let Ok(name) = symbol.name() { - symbols.push(SymbolMapName::new(symbol.address(), name)); + // Must have a name. + let name = match symbol.name() { + Ok(name) => name, + _ => continue, + }; + if name.is_empty() { + continue; + } + + // Lower is better. + let mut priority = 0u32; + + // Prefer known kind. + match symbol.kind() { + SymbolKind::Text | SymbolKind::Data => {} + SymbolKind::Unknown => priority += 1, + _ => continue, + } + priority *= 2; + + // Prefer global visibility. + priority += match symbol.scope() { + SymbolScope::Unknown => 3, + SymbolScope::Compilation => 2, + SymbolScope::Linkage => 1, + SymbolScope::Dynamic => 0, + }; + priority *= 4; + + // Prefer later entries (earlier symbol is likely to be less specific). + let index = !0 - symbol.index().0; + + // Tuple is ordered for sort. + all_symbols.push((symbol.address(), priority, index, name)); + } + // Unstable sort is okay because tuple includes index. + all_symbols.sort_unstable(); + + let mut previous_address = !0; + for (address, _priority, _index, name) in all_symbols { + if address != previous_address { + symbols.push(SymbolMapName::new(address, name)); + previous_address = address; } } } @@ -177,20 +250,20 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Get the exported symbols that expose both a name and an address. /// - /// Some file formats may provide other kinds of symbols, that can be retrieved using - /// the lower-level API. + /// Some file formats may provide other kinds of symbols that can be retrieved using + /// the low level API. fn exports(&self) -> Result>>; - /// Return true if the file contains debug information sections, false if not. + /// Return true if the file contains DWARF debug information sections, false if not. fn has_debug_symbols(&self) -> bool; - /// The UUID from a Mach-O `LC_UUID` load command. + /// The UUID from a Mach-O [`LC_UUID`](crate::macho::LC_UUID) load command. #[inline] fn mach_uuid(&self) -> Result> { Ok(None) } - /// The build ID from an ELF `NT_GNU_BUILD_ID` note. + /// The build ID from an ELF [`NT_GNU_BUILD_ID`](crate::elf::NT_GNU_BUILD_ID) note. #[inline] fn build_id(&self) -> Result> { Ok(None) @@ -208,7 +281,7 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { Ok(None) } - /// The filename and GUID from the PE CodeView section + /// The filename and GUID from the PE CodeView section. #[inline] fn pdb_info(&self) -> Result>> { Ok(None) @@ -219,17 +292,16 @@ pub trait Object<'data: 'file, 'file>: read::private::Sealed { /// Currently this is only non-zero for PE. fn relative_address_base(&'file self) -> u64; - /// Get the virtual address of the entry point of the binary + /// Get the virtual address of the entry point of the binary. fn entry(&'file self) -> u64; /// File flags that are specific to each file format. fn flags(&self) -> FileFlags; } -/// A loadable segment defined in an object file. +/// A loadable segment in an [`Object`]. /// -/// For ELF, this is a program header with type `PT_LOAD`. -/// For Mach-O, this is a load command with type `LC_SEGMENT` or `LC_SEGMENT_64`. +/// This trait is part of the unified read API. pub trait ObjectSegment<'data>: read::private::Sealed { /// Returns the virtual address of the segment. fn address(&self) -> u64; @@ -266,9 +338,11 @@ pub trait ObjectSegment<'data>: read::private::Sealed { fn flags(&self) -> SegmentFlags; } -/// A section defined in an object file. +/// A section in an [`Object`]. +/// +/// This trait is part of the unified read API. pub trait ObjectSection<'data>: read::private::Sealed { - /// An iterator over the relocations for a section. + /// An iterator for the relocations for a section. /// /// The first field in the item tuple is the section offset /// that the relocation applies to. @@ -349,9 +423,11 @@ pub trait ObjectSection<'data>: read::private::Sealed { fn flags(&self) -> SectionFlags; } -/// A COMDAT section group defined in an object file. +/// A COMDAT section group in an [`Object`]. +/// +/// This trait is part of the unified read API. pub trait ObjectComdat<'data>: read::private::Sealed { - /// An iterator over the sections in the object file. + /// An iterator for the sections in the section group. type SectionIterator: Iterator; /// Returns the COMDAT selection kind. @@ -372,15 +448,17 @@ pub trait ObjectComdat<'data>: read::private::Sealed { fn sections(&self) -> Self::SectionIterator; } -/// A symbol table. +/// A symbol table in an [`Object`]. +/// +/// This trait is part of the unified read API. pub trait ObjectSymbolTable<'data>: read::private::Sealed { /// A symbol table entry. type Symbol: ObjectSymbol<'data>; - /// An iterator over the symbols in a symbol table. + /// An iterator for the symbols in a symbol table. type SymbolIterator: Iterator; - /// Get an iterator over the symbols in the table. + /// Get an iterator for the symbols in the table. /// /// This may skip over symbols that are malformed or unsupported. fn symbols(&self) -> Self::SymbolIterator; @@ -393,7 +471,9 @@ pub trait ObjectSymbolTable<'data>: read::private::Sealed { fn symbol_by_index(&self, index: SymbolIndex) -> Result; } -/// A symbol table entry. +/// A symbol table entry in an [`Object`]. +/// +/// This trait is part of the unified read API. pub trait ObjectSymbol<'data>: read::private::Sealed { /// The index of the symbol. fn index(&self) -> SymbolIndex; @@ -430,11 +510,13 @@ pub trait ObjectSymbol<'data>: read::private::Sealed { /// Return true if the symbol is a definition of a function or data object /// that has a known address. + /// + /// This is primarily used to implement [`Object::symbol_map`]. fn is_definition(&self) -> bool; /// Return true if the symbol is common data. /// - /// Note: does not check for `SymbolSection::Section` with `SectionKind::Common`. + /// Note: does not check for [`SymbolSection::Section`] with [`SectionKind::Common`]. fn is_common(&self) -> bool; /// Return true if the symbol is weak. @@ -445,7 +527,7 @@ pub trait ObjectSymbol<'data>: read::private::Sealed { /// Return true if the symbol visible outside of the compilation unit. /// - /// This treats `SymbolScope::Unknown` as global. + /// This treats [`SymbolScope::Unknown`] as global. fn is_global(&self) -> bool; /// Return true if the symbol is only visible within the compilation unit. diff --git a/vendor/object/src/read/util.rs b/vendor/object/src/read/util.rs index 7c3c65ec9..7d85b2728 100644 --- a/vendor/object/src/read/util.rs +++ b/vendor/object/src/read/util.rs @@ -269,7 +269,7 @@ pub(crate) fn data_range( /// A table of zero-terminated strings. /// -/// This is used for most file formats. +/// This is used by most file formats for strings such as section names and symbol names. #[derive(Debug, Clone, Copy)] pub struct StringTable<'data, R = &'data [u8]> where diff --git a/vendor/object/src/read/wasm.rs b/vendor/object/src/read/wasm.rs index b950ef2b2..4d034bcc1 100644 --- a/vendor/object/src/read/wasm.rs +++ b/vendor/object/src/read/wasm.rs @@ -1,8 +1,6 @@ //! Support for reading Wasm files. //! -//! Provides `WasmFile` and related types which implement the `Object` trait. -//! -//! Currently implements the minimum required to access DWARF debugging information. +//! [`WasmFile`] implements the [`Object`] trait for Wasm files. use alloc::boxed::Box; use alloc::vec::Vec; use core::marker::PhantomData; @@ -505,7 +503,9 @@ where } } -/// An iterator over the segments of a `WasmFile`. +/// An iterator for the segments in a [`WasmFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmSegmentIterator<'data, 'file, R = &'data [u8]> { #[allow(unused)] @@ -521,7 +521,9 @@ impl<'data, 'file, R> Iterator for WasmSegmentIterator<'data, 'file, R> { } } -/// A segment of a `WasmFile`. +/// A segment in a [`WasmFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmSegment<'data, 'file, R = &'data [u8]> { #[allow(unused)] @@ -575,7 +577,7 @@ impl<'data, 'file, R> ObjectSegment<'data> for WasmSegment<'data, 'file, R> { } } -/// An iterator over the sections of a `WasmFile`. +/// An iterator for the sections in a [`WasmFile`]. #[derive(Debug)] pub struct WasmSectionIterator<'data, 'file, R = &'data [u8]> { file: &'file WasmFile<'data, R>, @@ -594,7 +596,9 @@ impl<'data, 'file, R> Iterator for WasmSectionIterator<'data, 'file, R> { } } -/// A section of a `WasmFile`. +/// A section in a [`WasmFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct WasmSection<'data, 'file, R = &'data [u8]> { file: &'file WasmFile<'data, R>, @@ -725,7 +729,9 @@ impl<'data, 'file, R: ReadRef<'data>> ObjectSection<'data> for WasmSection<'data } } -/// An iterator over the COMDAT section groups of a `WasmFile`. +/// An iterator for the COMDAT section groups in a [`WasmFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmComdatIterator<'data, 'file, R = &'data [u8]> { #[allow(unused)] @@ -741,7 +747,9 @@ impl<'data, 'file, R> Iterator for WasmComdatIterator<'data, 'file, R> { } } -/// A COMDAT section group of a `WasmFile`. +/// A COMDAT section group in a [`WasmFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmComdat<'data, 'file, R = &'data [u8]> { #[allow(unused)] @@ -779,7 +787,9 @@ impl<'data, 'file, R> ObjectComdat<'data> for WasmComdat<'data, 'file, R> { } } -/// An iterator over the sections in a COMDAT section group of a `WasmFile`. +/// An iterator for the sections in a COMDAT section group in a [`WasmFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmComdatSectionIterator<'data, 'file, R = &'data [u8]> { #[allow(unused)] @@ -794,7 +804,7 @@ impl<'data, 'file, R> Iterator for WasmComdatSectionIterator<'data, 'file, R> { } } -/// A symbol table of a `WasmFile`. +/// A symbol table in a [`WasmFile`]. #[derive(Debug)] pub struct WasmSymbolTable<'data, 'file> { symbols: &'file [WasmSymbolInternal<'data>], @@ -821,7 +831,7 @@ impl<'data, 'file> ObjectSymbolTable<'data> for WasmSymbolTable<'data, 'file> { } } -/// An iterator over the symbols of a `WasmFile`. +/// An iterator for the symbols in a [`WasmFile`]. #[derive(Debug)] pub struct WasmSymbolIterator<'data, 'file> { symbols: core::iter::Enumerate>>, @@ -839,7 +849,9 @@ impl<'data, 'file> Iterator for WasmSymbolIterator<'data, 'file> { } } -/// A symbol of a `WasmFile`. +/// A symbol in a [`WasmFile`]. +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. #[derive(Clone, Copy, Debug)] pub struct WasmSymbol<'data, 'file> { index: SymbolIndex, @@ -901,7 +913,8 @@ impl<'data, 'file> ObjectSymbol<'data> for WasmSymbol<'data, 'file> { #[inline] fn is_definition(&self) -> bool { - self.symbol.kind == SymbolKind::Text && self.symbol.section != SymbolSection::Undefined + (self.symbol.kind == SymbolKind::Text || self.symbol.kind == SymbolKind::Data) + && self.symbol.section != SymbolSection::Undefined } #[inline] @@ -935,7 +948,9 @@ impl<'data, 'file> ObjectSymbol<'data> for WasmSymbol<'data, 'file> { } } -/// An iterator over the relocations in a `WasmSection`. +/// An iterator for the relocations for a [`WasmSection`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct WasmRelocationIterator<'data, 'file, R = &'data [u8]>( PhantomData<(&'data (), &'file (), R)>, diff --git a/vendor/object/src/read/xcoff/comdat.rs b/vendor/object/src/read/xcoff/comdat.rs index 2b23d1dba..03e52bfa4 100644 --- a/vendor/object/src/read/xcoff/comdat.rs +++ b/vendor/object/src/read/xcoff/comdat.rs @@ -8,14 +8,16 @@ use crate::read::{self, ComdatKind, ObjectComdat, ReadRef, Result, SectionIndex, use super::{FileHeader, XcoffFile}; -/// An iterator over the COMDAT section groups of a `XcoffFile32`. +/// An iterator for the COMDAT section groups in a [`XcoffFile32`](super::XcoffFile32). pub type XcoffComdatIterator32<'data, 'file, R = &'data [u8]> = XcoffComdatIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the COMDAT section groups of a `XcoffFile64`. +/// An iterator for the COMDAT section groups in a [`XcoffFile64`](super::XcoffFile64). pub type XcoffComdatIterator64<'data, 'file, R = &'data [u8]> = XcoffComdatIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the COMDAT section groups of a `XcoffFile`. +/// An iterator for the COMDAT section groups in a [`XcoffFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct XcoffComdatIterator<'data, 'file, Xcoff, R = &'data [u8]> where @@ -39,15 +41,17 @@ where } } -/// A COMDAT section group of a `XcoffFile32`. +/// A COMDAT section group in a [`XcoffFile32`](super::XcoffFile32). pub type XcoffComdat32<'data, 'file, R = &'data [u8]> = XcoffComdat<'data, 'file, xcoff::FileHeader32, R>; -/// A COMDAT section group of a `XcoffFile64`. +/// A COMDAT section group in a [`XcoffFile64`](super::XcoffFile64). pub type XcoffComdat64<'data, 'file, R = &'data [u8]> = XcoffComdat<'data, 'file, xcoff::FileHeader64, R>; -/// A COMDAT section group of a `XcoffFile`. +/// A COMDAT section group in a [`XcoffFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct XcoffComdat<'data, 'file, Xcoff, R = &'data [u8]> where @@ -98,14 +102,16 @@ where } } -/// An iterator over the sections in a COMDAT section group of a `XcoffFile32`. +/// An iterator for the sections in a COMDAT section group in a [`XcoffFile32`](super::XcoffFile32). pub type XcoffComdatSectionIterator32<'data, 'file, R = &'data [u8]> = XcoffComdatSectionIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the sections in a COMDAT section group of a `XcoffFile64`. +/// An iterator for the sections in a COMDAT section group in a [`XcoffFile64`](super::XcoffFile64). pub type XcoffComdatSectionIterator64<'data, 'file, R = &'data [u8]> = XcoffComdatSectionIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the sections in a COMDAT section group of a `XcoffFile`. +/// An iterator for the sections in a COMDAT section group in a [`XcoffFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct XcoffComdatSectionIterator<'data, 'file, Xcoff, R = &'data [u8]> where diff --git a/vendor/object/src/read/xcoff/file.rs b/vendor/object/src/read/xcoff/file.rs index bac9e7075..70d980a9b 100644 --- a/vendor/object/src/read/xcoff/file.rs +++ b/vendor/object/src/read/xcoff/file.rs @@ -17,13 +17,19 @@ use super::{ }; /// A 32-bit XCOFF object file. +/// +/// This is a file that starts with [`xcoff::FileHeader32`], and corresponds +/// to [`crate::FileKind::Xcoff32`]. pub type XcoffFile32<'data, R = &'data [u8]> = XcoffFile<'data, xcoff::FileHeader32, R>; /// A 64-bit XCOFF object file. +/// +/// This is a file that starts with [`xcoff::FileHeader64`], and corresponds +/// to [`crate::FileKind::Xcoff64`]. pub type XcoffFile64<'data, R = &'data [u8]> = XcoffFile<'data, xcoff::FileHeader64, R>; /// A partially parsed XCOFF file. /// -/// Most of the functionality of this type is provided by the `Object` trait implementation. +/// Most functionality is provided by the [`Object`] trait implementation. #[derive(Debug)] pub struct XcoffFile<'data, Xcoff, R = &'data [u8]> where @@ -183,9 +189,8 @@ where fn symbols(&'file self) -> XcoffSymbolIterator<'data, 'file, Xcoff, R> { XcoffSymbolIterator { - symbols: &self.symbols, - index: 0, file: self, + symbols: self.symbols.iter(), } } @@ -197,9 +202,7 @@ where // TODO: return the symbols in the STYP_LOADER section. XcoffSymbolIterator { file: self, - symbols: &self.symbols, - // Hack: don't return any. - index: self.symbols.len(), + symbols: self.symbols.iter_none(), } } @@ -241,7 +244,7 @@ where } } -/// A trait for generic access to `FileHeader32` and `FileHeader64`. +/// A trait for generic access to [`xcoff::FileHeader32`] and [`xcoff::FileHeader64`]. #[allow(missing_docs)] pub trait FileHeader: Debug + Pod { type Word: Into; @@ -407,10 +410,12 @@ impl FileHeader for xcoff::FileHeader64 { } } +/// A trait for generic access to [`xcoff::AuxHeader32`] and [`xcoff::AuxHeader64`]. #[allow(missing_docs)] pub trait AuxHeader: Debug + Pod { type Word: Into; + fn o_mflag(&self) -> u16; fn o_vstamp(&self) -> u16; fn o_tsize(&self) -> Self::Word; fn o_dsize(&self) -> Self::Word; @@ -425,20 +430,30 @@ pub trait AuxHeader: Debug + Pod { fn o_sntoc(&self) -> u16; fn o_snloader(&self) -> u16; fn o_snbss(&self) -> u16; - fn o_sntdata(&self) -> u16; - fn o_sntbss(&self) -> u16; fn o_algntext(&self) -> u16; fn o_algndata(&self) -> u16; + fn o_modtype(&self) -> u16; + fn o_cpuflag(&self) -> u8; + fn o_cputype(&self) -> u8; fn o_maxstack(&self) -> Self::Word; fn o_maxdata(&self) -> Self::Word; + fn o_debugger(&self) -> u32; fn o_textpsize(&self) -> u8; fn o_datapsize(&self) -> u8; fn o_stackpsize(&self) -> u8; + fn o_flags(&self) -> u8; + fn o_sntdata(&self) -> u16; + fn o_sntbss(&self) -> u16; + fn o_x64flags(&self) -> Option; } impl AuxHeader for xcoff::AuxHeader32 { type Word = u32; + fn o_mflag(&self) -> u16 { + self.o_mflag.get(BE) + } + fn o_vstamp(&self) -> u16 { self.o_vstamp.get(BE) } @@ -495,14 +510,6 @@ impl AuxHeader for xcoff::AuxHeader32 { self.o_snbss.get(BE) } - fn o_sntdata(&self) -> u16 { - self.o_sntdata.get(BE) - } - - fn o_sntbss(&self) -> u16 { - self.o_sntbss.get(BE) - } - fn o_algntext(&self) -> u16 { self.o_algntext.get(BE) } @@ -511,6 +518,18 @@ impl AuxHeader for xcoff::AuxHeader32 { self.o_algndata.get(BE) } + fn o_modtype(&self) -> u16 { + self.o_modtype.get(BE) + } + + fn o_cpuflag(&self) -> u8 { + self.o_cpuflag + } + + fn o_cputype(&self) -> u8 { + self.o_cputype + } + fn o_maxstack(&self) -> Self::Word { self.o_maxstack.get(BE) } @@ -519,6 +538,10 @@ impl AuxHeader for xcoff::AuxHeader32 { self.o_maxdata.get(BE) } + fn o_debugger(&self) -> u32 { + self.o_debugger.get(BE) + } + fn o_textpsize(&self) -> u8 { self.o_textpsize } @@ -530,11 +553,31 @@ impl AuxHeader for xcoff::AuxHeader32 { fn o_stackpsize(&self) -> u8 { self.o_stackpsize } + + fn o_flags(&self) -> u8 { + self.o_flags + } + + fn o_sntdata(&self) -> u16 { + self.o_sntdata.get(BE) + } + + fn o_sntbss(&self) -> u16 { + self.o_sntbss.get(BE) + } + + fn o_x64flags(&self) -> Option { + None + } } impl AuxHeader for xcoff::AuxHeader64 { type Word = u64; + fn o_mflag(&self) -> u16 { + self.o_mflag.get(BE) + } + fn o_vstamp(&self) -> u16 { self.o_vstamp.get(BE) } @@ -591,14 +634,6 @@ impl AuxHeader for xcoff::AuxHeader64 { self.o_snbss.get(BE) } - fn o_sntdata(&self) -> u16 { - self.o_sntdata.get(BE) - } - - fn o_sntbss(&self) -> u16 { - self.o_sntbss.get(BE) - } - fn o_algntext(&self) -> u16 { self.o_algntext.get(BE) } @@ -607,6 +642,18 @@ impl AuxHeader for xcoff::AuxHeader64 { self.o_algndata.get(BE) } + fn o_modtype(&self) -> u16 { + self.o_modtype.get(BE) + } + + fn o_cpuflag(&self) -> u8 { + self.o_cpuflag + } + + fn o_cputype(&self) -> u8 { + self.o_cputype + } + fn o_maxstack(&self) -> Self::Word { self.o_maxstack.get(BE) } @@ -615,6 +662,10 @@ impl AuxHeader for xcoff::AuxHeader64 { self.o_maxdata.get(BE) } + fn o_debugger(&self) -> u32 { + self.o_debugger.get(BE) + } + fn o_textpsize(&self) -> u8 { self.o_textpsize } @@ -626,4 +677,20 @@ impl AuxHeader for xcoff::AuxHeader64 { fn o_stackpsize(&self) -> u8 { self.o_stackpsize } + + fn o_flags(&self) -> u8 { + self.o_flags + } + + fn o_sntdata(&self) -> u16 { + self.o_sntdata.get(BE) + } + + fn o_sntbss(&self) -> u16 { + self.o_sntbss.get(BE) + } + + fn o_x64flags(&self) -> Option { + Some(self.o_x64flags.get(BE)) + } } diff --git a/vendor/object/src/read/xcoff/mod.rs b/vendor/object/src/read/xcoff/mod.rs index 136e31073..b75c4da27 100644 --- a/vendor/object/src/read/xcoff/mod.rs +++ b/vendor/object/src/read/xcoff/mod.rs @@ -1,6 +1,48 @@ //! Support for reading AIX XCOFF files. //! -//! Provides `XcoffFile` and related types which implement the `Object` trait. +//! Traits are used to abstract over the difference between 32-bit and 64-bit XCOFF. +//! The primary trait for this is [`FileHeader`]. +//! +//! ## High level API +//! +//! [`XcoffFile`] implements the [`Object`](crate::read::Object) trait for XCOFF files. +//! [`XcoffFile`] is parameterised by [`FileHeader`] to allow reading both 32-bit and +//! 64-bit XCOFF. There are type aliases for these parameters ([`XcoffFile32`] and +//! [`XcoffFile64`]). +//! +//! ## Low level API +//! +//! The [`FileHeader`] trait can be directly used to parse both [`xcoff::FileHeader32`] +//! and [`xcoff::FileHeader64`]. +//! +//! ### Example for low level API +//! ```no_run +//! use object::xcoff; +//! use object::read::xcoff::{FileHeader, SectionHeader, Symbol}; +//! use std::error::Error; +//! use std::fs; +//! +//! /// Reads a file and displays the name of each section and symbol. +//! fn main() -> Result<(), Box> { +//! # #[cfg(feature = "std")] { +//! let data = fs::read("path/to/binary")?; +//! let mut offset = 0; +//! let header = xcoff::FileHeader64::parse(&*data, &mut offset)?; +//! let aux_header = header.aux_header(&*data, &mut offset)?; +//! let sections = header.sections(&*data, &mut offset)?; +//! let symbols = header.symbols(&*data)?; +//! for section in sections.iter() { +//! println!("{}", String::from_utf8_lossy(section.name())); +//! } +//! for (_index, symbol) in symbols.iter() { +//! println!("{}", String::from_utf8_lossy(symbol.name(symbols.strings())?)); +//! } +//! # } +//! Ok(()) +//! } +//! ``` +#[cfg(doc)] +use crate::xcoff; mod file; pub use file::*; diff --git a/vendor/object/src/read/xcoff/relocation.rs b/vendor/object/src/read/xcoff/relocation.rs index 78c6acfc7..a655cccf0 100644 --- a/vendor/object/src/read/xcoff/relocation.rs +++ b/vendor/object/src/read/xcoff/relocation.rs @@ -9,14 +9,14 @@ use crate::read::{ReadRef, RelocationEncoding, RelocationKind, RelocationTarget, use super::{FileHeader, SectionHeader, XcoffFile}; -/// An iterator over the relocations in a `XcoffSection32`. +/// An iterator for the relocations in an [`XcoffSection32`](super::XcoffSection32). pub type XcoffRelocationIterator32<'data, 'file, R = &'data [u8]> = XcoffRelocationIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the relocations in a `XcoffSection64`. +/// An iterator for the relocations in an [`XcoffSection64`](super::XcoffSection64). pub type XcoffRelocationIterator64<'data, 'file, R = &'data [u8]> = XcoffRelocationIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the relocations in a `XcoffSection`. +/// An iterator for the relocations in an [`XcoffSection`](super::XcoffSection). pub struct XcoffRelocationIterator<'data, 'file, Xcoff, R = &'data [u8]> where Xcoff: FileHeader, @@ -76,7 +76,7 @@ where } } -/// A trait for generic access to `Rel32` and `Rel64`. +/// A trait for generic access to [`xcoff::Rel32`] and [`xcoff::Rel64`]. #[allow(missing_docs)] pub trait Rel: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/xcoff/section.rs b/vendor/object/src/read/xcoff/section.rs index 77453fcd2..8a36bcf26 100644 --- a/vendor/object/src/read/xcoff/section.rs +++ b/vendor/object/src/read/xcoff/section.rs @@ -9,14 +9,14 @@ use crate::read::{self, Error, ObjectSection, ReadError, ReadRef, Result, Sectio use super::{AuxHeader, FileHeader, Rel, XcoffFile, XcoffRelocationIterator}; -/// An iterator over the sections of an `XcoffFile32`. +/// An iterator for the sections in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSectionIterator32<'data, 'file, R = &'data [u8]> = XcoffSectionIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the sections of an `XcoffFile64`. +/// An iterator for the sections in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSectionIterator64<'data, 'file, R = &'data [u8]> = XcoffSectionIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the sections of an `XcoffFile`. +/// An iterator for the sections in an [`XcoffFile`]. #[derive(Debug)] pub struct XcoffSectionIterator<'data, 'file, Xcoff, R = &'data [u8]> where @@ -43,14 +43,16 @@ where } } -/// A section of an `XcoffFile32`. +/// A section in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSection32<'data, 'file, R = &'data [u8]> = XcoffSection<'data, 'file, xcoff::FileHeader32, R>; -/// A section of an `XcoffFile64`. +/// A section in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSection64<'data, 'file, R = &'data [u8]> = XcoffSection<'data, 'file, xcoff::FileHeader64, R>; -/// A section of an `XcoffFile`. +/// A section in an [`XcoffFile`]. +/// +/// Most functionality is provided by the [`ObjectSection`] trait implementation. #[derive(Debug)] pub struct XcoffSection<'data, 'file, Xcoff, R = &'data [u8]> where @@ -199,6 +201,8 @@ where } /// The table of section headers in an XCOFF file. +/// +/// Returned by [`FileHeader::sections`]. #[derive(Debug, Clone, Copy)] pub struct SectionTable<'data, Xcoff: FileHeader> { sections: &'data [Xcoff::SectionHeader], @@ -260,7 +264,7 @@ where } } -/// A trait for generic access to `SectionHeader32` and `SectionHeader64`. +/// A trait for generic access to [`xcoff::SectionHeader32`] and [`xcoff::SectionHeader64`]. #[allow(missing_docs)] pub trait SectionHeader: Debug + Pod { type Word: Into; diff --git a/vendor/object/src/read/xcoff/segment.rs b/vendor/object/src/read/xcoff/segment.rs index 7eca72367..d30d7d8e2 100644 --- a/vendor/object/src/read/xcoff/segment.rs +++ b/vendor/object/src/read/xcoff/segment.rs @@ -8,14 +8,16 @@ use crate::xcoff; use super::{FileHeader, XcoffFile}; -/// An iterator over the segments of an `XcoffFile32`. +/// An iterator for the segments in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSegmentIterator32<'data, 'file, R = &'data [u8]> = XcoffSegmentIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the segments of an `XcoffFile64`. +/// An iterator for the segments in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSegmentIterator64<'data, 'file, R = &'data [u8]> = XcoffSegmentIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the segments of an `XcoffFile`. +/// An iterator for the segments in an [`XcoffFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct XcoffSegmentIterator<'data, 'file, Xcoff, R = &'data [u8]> where @@ -38,14 +40,16 @@ where } } -/// A segment of an `XcoffFile32`. +/// A segment in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSegment32<'data, 'file, R = &'data [u8]> = XcoffSegment<'data, 'file, xcoff::FileHeader32, R>; -/// A segment of an `XcoffFile64`. +/// A segment in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSegment64<'data, 'file, R = &'data [u8]> = XcoffSegment<'data, 'file, xcoff::FileHeader64, R>; -/// A loadable section of an `XcoffFile`. +/// A loadable section in an [`XcoffFile`]. +/// +/// This is a stub that doesn't implement any functionality. #[derive(Debug)] pub struct XcoffSegment<'data, 'file, Xcoff, R = &'data [u8]> where diff --git a/vendor/object/src/read/xcoff/symbol.rs b/vendor/object/src/read/xcoff/symbol.rs index 7ce215fac..72651c3f2 100644 --- a/vendor/object/src/read/xcoff/symbol.rs +++ b/vendor/object/src/read/xcoff/symbol.rs @@ -19,6 +19,8 @@ use super::{FileHeader, XcoffFile}; /// A table of symbol entries in an XCOFF file. /// /// Also includes the string table used for the symbol names. +/// +/// Returned by [`FileHeader::symbols`]. #[derive(Debug)] pub struct SymbolTable<'data, Xcoff, R = &'data [u8]> where @@ -80,6 +82,30 @@ where }) } + /// Return the string table used for the symbol names. + #[inline] + pub fn strings(&self) -> StringTable<'data, R> { + self.strings + } + + /// Iterate over the symbols. + #[inline] + pub fn iter<'table>(&'table self) -> SymbolIterator<'data, 'table, Xcoff, R> { + SymbolIterator { + symbols: self, + index: 0, + } + } + + /// Empty symbol iterator. + #[inline] + pub(super) fn iter_none<'table>(&'table self) -> SymbolIterator<'data, 'table, Xcoff, R> { + SymbolIterator { + symbols: self, + index: self.symbols.len(), + } + } + /// Return the symbol entry at the given index and offset. pub fn get(&self, index: usize, offset: usize) -> Result<&'data T> { let entry = index @@ -134,21 +160,47 @@ where } } -/// A symbol table of an `XcoffFile32`. +/// An iterator for symbol entries in an XCOFF file. +/// +/// Yields the index and symbol structure for each symbol. +#[derive(Debug)] +pub struct SymbolIterator<'data, 'table, Xcoff, R = &'data [u8]> +where + Xcoff: FileHeader, + R: ReadRef<'data>, +{ + symbols: &'table SymbolTable<'data, Xcoff, R>, + index: usize, +} + +impl<'data, 'table, Xcoff: FileHeader, R: ReadRef<'data>> Iterator + for SymbolIterator<'data, 'table, Xcoff, R> +{ + type Item = (SymbolIndex, &'data Xcoff::Symbol); + + fn next(&mut self) -> Option { + let index = self.index; + let symbol = self.symbols.symbol(index).ok()?; + self.index += 1 + symbol.n_numaux() as usize; + Some((SymbolIndex(index), symbol)) + } +} + +/// A symbol table in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSymbolTable32<'data, 'file, R = &'data [u8]> = XcoffSymbolTable<'data, 'file, xcoff::FileHeader32, R>; -/// A symbol table of an `XcoffFile64`. +/// A symbol table in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSymbolTable64<'data, 'file, R = &'data [u8]> = XcoffSymbolTable<'data, 'file, xcoff::FileHeader64, R>; -/// A symbol table of an `XcoffFile`. +/// A symbol table in an [`XcoffFile`]. #[derive(Debug, Clone, Copy)] pub struct XcoffSymbolTable<'data, 'file, Xcoff, R = &'data [u8]> where Xcoff: FileHeader, R: ReadRef<'data>, { - pub(crate) file: &'file XcoffFile<'data, Xcoff, R>, + pub(super) file: &'file XcoffFile<'data, Xcoff, R>, pub(super) symbols: &'file SymbolTable<'data, Xcoff, R>, } @@ -166,8 +218,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbolTable<'data fn symbols(&self) -> Self::SymbolIterator { XcoffSymbolIterator { file: self.file, - symbols: self.symbols, - index: 0, + symbols: self.symbols.iter(), } } @@ -182,22 +233,21 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbolTable<'data } } -/// An iterator over the symbols of an `XcoffFile32`. +/// An iterator for the symbols in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSymbolIterator32<'data, 'file, R = &'data [u8]> = XcoffSymbolIterator<'data, 'file, xcoff::FileHeader32, R>; -/// An iterator over the symbols of an `XcoffFile64`. +/// An iterator for the symbols in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSymbolIterator64<'data, 'file, R = &'data [u8]> = XcoffSymbolIterator<'data, 'file, xcoff::FileHeader64, R>; -/// An iterator over the symbols of an `XcoffFile`. +/// An iterator for the symbols in an [`XcoffFile`]. pub struct XcoffSymbolIterator<'data, 'file, Xcoff, R = &'data [u8]> where Xcoff: FileHeader, R: ReadRef<'data>, { - pub(crate) file: &'file XcoffFile<'data, Xcoff, R>, - pub(super) symbols: &'file SymbolTable<'data, Xcoff, R>, - pub(super) index: usize, + pub(super) file: &'file XcoffFile<'data, Xcoff, R>, + pub(super) symbols: SymbolIterator<'data, 'file, Xcoff, R>, } impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> fmt::Debug @@ -214,34 +264,33 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> Iterator type Item = XcoffSymbol<'data, 'file, Xcoff, R>; fn next(&mut self) -> Option { - let index = self.index; - let symbol = self.symbols.symbol(index).ok()?; - // TODO: skip over the auxiliary symbols for now. - self.index += 1 + symbol.n_numaux() as usize; + let (index, symbol) = self.symbols.next()?; Some(XcoffSymbol { file: self.file, - symbols: self.symbols, - index: SymbolIndex(index), + symbols: self.symbols.symbols, + index, symbol, }) } } -/// A symbol of an `XcoffFile32`. +/// A symbol in an [`XcoffFile32`](super::XcoffFile32). pub type XcoffSymbol32<'data, 'file, R = &'data [u8]> = XcoffSymbol<'data, 'file, xcoff::FileHeader32, R>; -/// A symbol of an `XcoffFile64`. +/// A symbol in an [`XcoffFile64`](super::XcoffFile64). pub type XcoffSymbol64<'data, 'file, R = &'data [u8]> = XcoffSymbol<'data, 'file, xcoff::FileHeader64, R>; -/// A symbol of an `XcoffFile`. +/// A symbol in an [`XcoffFile`]. +/// +/// Most functionality is provided by the [`ObjectSymbol`] trait implementation. #[derive(Debug, Clone, Copy)] pub struct XcoffSymbol<'data, 'file, Xcoff, R = &'data [u8]> where Xcoff: FileHeader, R: ReadRef<'data>, { - pub(crate) file: &'file XcoffFile<'data, Xcoff, R>, + pub(super) file: &'file XcoffFile<'data, Xcoff, R>, pub(super) symbols: &'file SymbolTable<'data, Xcoff, R>, pub(super) index: SymbolIndex, pub(super) symbol: &'data Xcoff::Symbol, @@ -303,7 +352,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> .symbols .aux_csect(self.index.0, self.symbol.n_numaux() as usize) { - let sym_type = aux_csect.sym_type() & 0x07; + let sym_type = aux_csect.sym_type(); if sym_type == xcoff::XTY_SD || sym_type == xcoff::XTY_CM { return aux_csect.x_scnlen(); } @@ -319,7 +368,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> .symbols .aux_csect(self.index.0, self.symbol.n_numaux() as usize) { - let sym_type = aux_csect.sym_type() & 0x07; + let sym_type = aux_csect.sym_type(); if sym_type == xcoff::XTY_SD || sym_type == xcoff::XTY_CM { return match aux_csect.x_smclas() { xcoff::XMC_PR | xcoff::XMC_GL => SymbolKind::Text, @@ -366,16 +415,16 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> /// Return true if the symbol is a definition of a function or data object. #[inline] fn is_definition(&self) -> bool { + if self.symbol.n_scnum() <= 0 { + return false; + } if self.symbol.has_aux_csect() { if let Ok(aux_csect) = self .symbols .aux_csect(self.index.0, self.symbol.n_numaux() as usize) { - let smclas = aux_csect.x_smclas(); - self.symbol.n_scnum() != xcoff::N_UNDEF - && (smclas == xcoff::XMC_PR - || smclas == xcoff::XMC_RW - || smclas == xcoff::XMC_RO) + let sym_type = aux_csect.sym_type(); + sym_type == xcoff::XTY_SD || sym_type == xcoff::XTY_LD || sym_type == xcoff::XTY_CM } else { false } @@ -399,7 +448,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> SymbolScope::Unknown } else { match self.symbol.n_sclass() { - xcoff::C_EXT | xcoff::C_WEAKEXT | xcoff::C_HIDEXT => { + xcoff::C_EXT | xcoff::C_WEAKEXT => { let visibility = self.symbol.n_type() & xcoff::SYM_V_MASK; if visibility == xcoff::SYM_V_HIDDEN { SymbolScope::Linkage @@ -438,7 +487,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> { x_smtyp = aux_csect.x_smtyp(); x_smclas = aux_csect.x_smclas(); - if x_smtyp == xcoff::XTY_LD { + if aux_csect.sym_type() == xcoff::XTY_LD { containing_csect = Some(SymbolIndex(aux_csect.x_scnlen() as usize)) } } @@ -452,7 +501,7 @@ impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> } } -/// A trait for generic access to `Symbol32` and `Symbol64`. +/// A trait for generic access to [`xcoff::Symbol32`] and [`xcoff::Symbol64`]. #[allow(missing_docs)] pub trait Symbol: Debug + Pod { type Word: Into; @@ -463,6 +512,7 @@ pub trait Symbol: Debug + Pod { fn n_sclass(&self) -> u8; fn n_numaux(&self) -> u8; + fn name_offset(&self) -> Option; fn name<'data, R: ReadRef<'data>>( &'data self, strings: StringTable<'data, R>, @@ -515,6 +565,10 @@ impl Symbol for xcoff::Symbol64 { self.n_numaux } + fn name_offset(&self) -> Option { + Some(self.n_offset.get(BE)) + } + /// Parse the symbol name for XCOFF64. fn name<'data, R: ReadRef<'data>>( &'data self, @@ -549,14 +603,22 @@ impl Symbol for xcoff::Symbol32 { self.n_numaux } + fn name_offset(&self) -> Option { + if self.n_name[0] == 0 { + let offset = u32::from_be_bytes(self.n_name[4..8].try_into().unwrap()); + Some(offset) + } else { + None + } + } + /// Parse the symbol name for XCOFF32. fn name<'data, R: ReadRef<'data>>( &'data self, strings: StringTable<'data, R>, ) -> Result<&'data [u8]> { - if self.n_name[0] == 0 { + if let Some(offset) = self.name_offset() { // If the name starts with 0 then the last 4 bytes are a string table offset. - let offset = u32::from_be_bytes(self.n_name[4..8].try_into().unwrap()); strings .get(offset) .read_error("Invalid XCOFF symbol name offset") @@ -570,27 +632,35 @@ impl Symbol for xcoff::Symbol32 { } } -/// A trait for generic access to `FileAux32` and `FileAux64`. +/// A trait for generic access to [`xcoff::FileAux32`] and [`xcoff::FileAux64`]. #[allow(missing_docs)] pub trait FileAux: Debug + Pod { fn x_fname(&self) -> &[u8; 8]; fn x_ftype(&self) -> u8; fn x_auxtype(&self) -> Option; + fn name_offset(&self) -> Option { + let x_fname = self.x_fname(); + if x_fname[0] == 0 { + Some(u32::from_be_bytes(x_fname[4..8].try_into().unwrap())) + } else { + None + } + } + /// Parse the x_fname field, which may be an inline string or a string table offset. fn fname<'data, R: ReadRef<'data>>( &'data self, strings: StringTable<'data, R>, ) -> Result<&'data [u8]> { - let x_fname = self.x_fname(); - if x_fname[0] == 0 { + if let Some(offset) = self.name_offset() { // If the name starts with 0 then the last 4 bytes are a string table offset. - let offset = u32::from_be_bytes(x_fname[4..8].try_into().unwrap()); strings .get(offset) .read_error("Invalid XCOFF symbol name offset") } else { // The name is inline and padded with nulls. + let x_fname = self.x_fname(); Ok(match memchr::memchr(b'\0', x_fname) { Some(end) => &x_fname[..end], None => x_fname, @@ -627,7 +697,7 @@ impl FileAux for xcoff::FileAux32 { } } -/// A trait for generic access to `CsectAux32` and `CsectAux64`. +/// A trait for generic access to [`xcoff::CsectAux32`] and [`xcoff::CsectAux64`]. #[allow(missing_docs)] pub trait CsectAux: Debug + Pod { fn x_scnlen(&self) -> u64; @@ -635,8 +705,13 @@ pub trait CsectAux: Debug + Pod { fn x_snhash(&self) -> u16; fn x_smtyp(&self) -> u8; fn x_smclas(&self) -> u8; + fn x_stab(&self) -> Option; + fn x_snstab(&self) -> Option; fn x_auxtype(&self) -> Option; + fn alignment(&self) -> u8 { + self.x_smtyp() >> 3 + } fn sym_type(&self) -> u8 { self.x_smtyp() & 0x07 } @@ -663,6 +738,14 @@ impl CsectAux for xcoff::CsectAux64 { self.x_smclas } + fn x_stab(&self) -> Option { + None + } + + fn x_snstab(&self) -> Option { + None + } + fn x_auxtype(&self) -> Option { Some(self.x_auxtype) } @@ -689,6 +772,14 @@ impl CsectAux for xcoff::CsectAux32 { self.x_smclas } + fn x_stab(&self) -> Option { + Some(self.x_stab.get(BE)) + } + + fn x_snstab(&self) -> Option { + Some(self.x_snstab.get(BE)) + } + fn x_auxtype(&self) -> Option { None } diff --git a/vendor/object/src/write/coff/mod.rs b/vendor/object/src/write/coff/mod.rs new file mode 100644 index 000000000..6e0f5edd4 --- /dev/null +++ b/vendor/object/src/write/coff/mod.rs @@ -0,0 +1,10 @@ +//! Support for writing COFF files. +//! +//! Provides [`Writer`] for low level writing of COFF files. +//! This is also used to provide COFF support for [`write::Object`](crate::write::Object). + +mod object; +pub use self::object::*; + +mod writer; +pub use writer::*; diff --git a/vendor/object/src/write/coff.rs b/vendor/object/src/write/coff/object.rs similarity index 68% rename from vendor/object/src/write/coff.rs rename to vendor/object/src/write/coff/object.rs index 2277a08e2..522966591 100644 --- a/vendor/object/src/write/coff.rs +++ b/vendor/object/src/write/coff/object.rs @@ -1,25 +1,23 @@ use alloc::vec::Vec; -use core::mem; -use crate::endian::{LittleEndian as LE, U16Bytes, U32Bytes, U16, U32}; use crate::pe as coff; -use crate::write::string::*; +use crate::write::coff::writer; use crate::write::util::*; use crate::write::*; #[derive(Default, Clone, Copy)] struct SectionOffsets { - offset: usize, - str_id: Option, - reloc_offset: usize, + name: writer::Name, + offset: u32, + reloc_offset: u32, selection: u8, - associative_section: u16, + associative_section: u32, } #[derive(Default, Clone, Copy)] struct SymbolOffsets { - index: usize, - str_id: Option, + name: writer::Name, + index: u32, aux_count: u8, } @@ -188,42 +186,12 @@ impl<'a> Object<'a> { } pub(crate) fn coff_write(&self, buffer: &mut dyn WritableBuffer) -> Result<()> { - // Calculate offsets of everything, and build strtab. - let mut offset = 0; - let mut strtab = StringTable::default(); + let mut writer = writer::Writer::new(buffer); - // COFF header. - offset += mem::size_of::(); - - // Section headers. - offset += self.sections.len() * mem::size_of::(); - - // Calculate size of section data and add section strings to strtab. + // Add section strings to strtab. let mut section_offsets = vec![SectionOffsets::default(); self.sections.len()]; for (index, section) in self.sections.iter().enumerate() { - if section.name.len() > 8 { - section_offsets[index].str_id = Some(strtab.add(§ion.name)); - } - - let len = section.data.len(); - if len != 0 { - // TODO: not sure what alignment is required here, but this seems to match LLVM - offset = align(offset, 4); - section_offsets[index].offset = offset; - offset += len; - } else { - section_offsets[index].offset = 0; - } - - // Calculate size of relocations. - let mut count = section.relocations.len(); - if count != 0 { - section_offsets[index].reloc_offset = offset; - if count > 0xffff { - count += 1; - } - offset += count * mem::size_of::(); - } + section_offsets[index].name = writer.add_name(§ion.name); } // Set COMDAT flags. @@ -264,84 +232,63 @@ impl<'a> Object<'a> { } if id.0 != comdat_section { section_offsets[id.0].selection = coff::IMAGE_COMDAT_SELECT_ASSOCIATIVE; - section_offsets[id.0].associative_section = comdat_section as u16 + 1; + section_offsets[id.0].associative_section = comdat_section as u32 + 1; } } } - // Calculate size of symbols and add symbol strings to strtab. + // Reserve symbol indices and add symbol strings to strtab. let mut symbol_offsets = vec![SymbolOffsets::default(); self.symbols.len()]; - let mut symtab_count = 0; for (index, symbol) in self.symbols.iter().enumerate() { - symbol_offsets[index].index = symtab_count; - symtab_count += 1; + symbol_offsets[index].index = writer.reserve_symbol_index(); + let mut name = &*symbol.name; match symbol.kind { SymbolKind::File => { // Name goes in auxiliary symbol records. - let aux_count = (symbol.name.len() + coff::IMAGE_SIZEOF_SYMBOL - 1) - / coff::IMAGE_SIZEOF_SYMBOL; - symbol_offsets[index].aux_count = aux_count as u8; - symtab_count += aux_count; - // Don't add name to strtab. - continue; + symbol_offsets[index].aux_count = writer.reserve_aux_file_name(&symbol.name); + name = b".file"; } - SymbolKind::Section => { - symbol_offsets[index].aux_count = 1; - symtab_count += 1; + SymbolKind::Section if symbol.section.id().is_some() => { + symbol_offsets[index].aux_count = writer.reserve_aux_section(); } _ => {} - } - if symbol.name.len() > 8 { - symbol_offsets[index].str_id = Some(strtab.add(&symbol.name)); - } + }; + symbol_offsets[index].name = writer.add_name(name); } - // Calculate size of symtab. - let symtab_offset = offset; - let symtab_len = symtab_count * coff::IMAGE_SIZEOF_SYMBOL; - offset += symtab_len; - - // Calculate size of strtab. - let strtab_offset = offset; - let mut strtab_data = Vec::new(); - // First 4 bytes of strtab are the length. - strtab.write(4, &mut strtab_data); - let strtab_len = strtab_data.len() + 4; - offset += strtab_len; + // Reserve file ranges. + writer.reserve_file_header(); + writer.reserve_section_headers(self.sections.len() as u16); + for (index, section) in self.sections.iter().enumerate() { + section_offsets[index].offset = writer.reserve_section(section.data.len()); + section_offsets[index].reloc_offset = + writer.reserve_relocations(section.relocations.len()); + } + writer.reserve_symtab_strtab(); // Start writing. - buffer - .reserve(offset) - .map_err(|_| Error(String::from("Cannot allocate buffer")))?; - - // Write file header. - let header = coff::ImageFileHeader { - machine: U16::new( - LE, - match self.architecture { - Architecture::Arm => coff::IMAGE_FILE_MACHINE_ARMNT, - Architecture::Aarch64 => coff::IMAGE_FILE_MACHINE_ARM64, - Architecture::I386 => coff::IMAGE_FILE_MACHINE_I386, - Architecture::X86_64 => coff::IMAGE_FILE_MACHINE_AMD64, - _ => { - return Err(Error(format!( - "unimplemented architecture {:?}", - self.architecture - ))); - } - }, - ), - number_of_sections: U16::new(LE, self.sections.len() as u16), - time_date_stamp: U32::default(), - pointer_to_symbol_table: U32::new(LE, symtab_offset as u32), - number_of_symbols: U32::new(LE, symtab_count as u32), - size_of_optional_header: U16::default(), - characteristics: match self.flags { - FileFlags::Coff { characteristics } => U16::new(LE, characteristics), - _ => U16::default(), + writer.write_file_header(writer::FileHeader { + machine: match (self.architecture, self.sub_architecture) { + (Architecture::Arm, None) => coff::IMAGE_FILE_MACHINE_ARMNT, + (Architecture::Aarch64, None) => coff::IMAGE_FILE_MACHINE_ARM64, + (Architecture::Aarch64, Some(SubArchitecture::Arm64EC)) => { + coff::IMAGE_FILE_MACHINE_ARM64EC + } + (Architecture::I386, None) => coff::IMAGE_FILE_MACHINE_I386, + (Architecture::X86_64, None) => coff::IMAGE_FILE_MACHINE_AMD64, + _ => { + return Err(Error(format!( + "unimplemented architecture {:?} with sub-architecture {:?}", + self.architecture, self.sub_architecture + ))); + } }, - }; - buffer.write(&header); + time_date_stamp: 0, + characteristics: match self.flags { + FileFlags::Coff { characteristics } => characteristics, + _ => 0, + }, + })?; // Write section headers. for (index, section) in self.sections.iter().enumerate() { @@ -423,85 +370,25 @@ impl<'a> Object<'a> { ))); } }; - let mut coff_section = coff::ImageSectionHeader { - name: [0; 8], - virtual_size: U32::default(), - virtual_address: U32::default(), - size_of_raw_data: U32::new(LE, section.size as u32), - pointer_to_raw_data: U32::new(LE, section_offsets[index].offset as u32), - pointer_to_relocations: U32::new(LE, section_offsets[index].reloc_offset as u32), - pointer_to_linenumbers: U32::default(), - number_of_relocations: if section.relocations.len() > 0xffff { - U16::new(LE, 0xffff) - } else { - U16::new(LE, section.relocations.len() as u16) - }, - number_of_linenumbers: U16::default(), - characteristics: U32::new(LE, characteristics), - }; - if section.name.len() <= 8 { - coff_section.name[..section.name.len()].copy_from_slice(§ion.name); - } else { - let mut str_offset = strtab.get_offset(section_offsets[index].str_id.unwrap()); - if str_offset <= 9_999_999 { - let mut name = [0; 7]; - let mut len = 0; - if str_offset == 0 { - name[6] = b'0'; - len = 1; - } else { - while str_offset != 0 { - let rem = (str_offset % 10) as u8; - str_offset /= 10; - name[6 - len] = b'0' + rem; - len += 1; - } - } - coff_section.name = [0; 8]; - coff_section.name[0] = b'/'; - coff_section.name[1..][..len].copy_from_slice(&name[7 - len..]); - } else if str_offset as u64 <= 0xf_ffff_ffff { - coff_section.name[0] = b'/'; - coff_section.name[1] = b'/'; - for i in 0..6 { - let rem = (str_offset % 64) as u8; - str_offset /= 64; - let c = match rem { - 0..=25 => b'A' + rem, - 26..=51 => b'a' + rem - 26, - 52..=61 => b'0' + rem - 52, - 62 => b'+', - 63 => b'/', - _ => unreachable!(), - }; - coff_section.name[7 - i] = c; - } - } else { - return Err(Error(format!("invalid section name offset {}", str_offset))); - } - } - buffer.write(&coff_section); + writer.write_section_header(writer::SectionHeader { + name: section_offsets[index].name, + size_of_raw_data: section.size as u32, + pointer_to_raw_data: section_offsets[index].offset, + pointer_to_relocations: section_offsets[index].reloc_offset, + pointer_to_linenumbers: 0, + number_of_relocations: section.relocations.len() as u32, + number_of_linenumbers: 0, + characteristics, + }); } // Write section data and relocations. - for (index, section) in self.sections.iter().enumerate() { - let len = section.data.len(); - if len != 0 { - write_align(buffer, 4); - debug_assert_eq!(section_offsets[index].offset, buffer.len()); - buffer.write_bytes(§ion.data); - } + for section in &self.sections { + writer.write_section(§ion.data); if !section.relocations.is_empty() { - debug_assert_eq!(section_offsets[index].reloc_offset, buffer.len()); - if section.relocations.len() > 0xffff { - let coff_relocation = coff::ImageRelocation { - virtual_address: U32Bytes::new(LE, section.relocations.len() as u32 + 1), - symbol_table_index: U32Bytes::new(LE, 0), - typ: U16Bytes::new(LE, 0), - }; - buffer.write(&coff_relocation); - } + //debug_assert_eq!(section_offsets[index].reloc_offset, buffer.len()); + writer.write_relocations_count(section.relocations.len()); for reloc in §ion.relocations { //assert!(reloc.implicit_addend); let typ = match self.architecture { @@ -567,23 +454,17 @@ impl<'a> Object<'a> { ))); } }; - let coff_relocation = coff::ImageRelocation { - virtual_address: U32Bytes::new(LE, reloc.offset as u32), - symbol_table_index: U32Bytes::new( - LE, - symbol_offsets[reloc.symbol.0].index as u32, - ), - typ: U16Bytes::new(LE, typ), - }; - buffer.write(&coff_relocation); + writer.write_relocation(writer::Relocation { + virtual_address: reloc.offset as u32, + symbol: symbol_offsets[reloc.symbol.0].index, + typ, + }); } } } // Write symbols. - debug_assert_eq!(symtab_offset, buffer.len()); for (index, symbol) in self.symbols.iter().enumerate() { - let mut name = &symbol.name[..]; let section_number = match symbol.section { SymbolSection::None => { debug_assert_eq!(symbol.kind, SymbolKind::File); @@ -600,12 +481,14 @@ impl<'a> Object<'a> { coff::IMAGE_SYM_TYPE_NULL }; let storage_class = match symbol.kind { - SymbolKind::File => { - // Name goes in auxiliary symbol records. - name = b".file"; - coff::IMAGE_SYM_CLASS_FILE + SymbolKind::File => coff::IMAGE_SYM_CLASS_FILE, + SymbolKind::Section => { + if symbol.section.id().is_some() { + coff::IMAGE_SYM_CLASS_STATIC + } else { + coff::IMAGE_SYM_CLASS_SECTION + } } - SymbolKind::Section => coff::IMAGE_SYM_CLASS_STATIC, SymbolKind::Label => coff::IMAGE_SYM_CLASS_LABEL, SymbolKind::Text | SymbolKind::Data | SymbolKind::Tls => { match symbol.section { @@ -651,54 +534,32 @@ impl<'a> Object<'a> { } else { symbol.value as u32 }; - let mut coff_symbol = coff::ImageSymbol { - name: [0; 8], - value: U32Bytes::new(LE, value), - section_number: U16Bytes::new(LE, section_number), - typ: U16Bytes::new(LE, typ), + writer.write_symbol(writer::Symbol { + name: symbol_offsets[index].name, + value, + section_number, + typ, storage_class, number_of_aux_symbols, - }; - if name.len() <= 8 { - coff_symbol.name[..name.len()].copy_from_slice(name); - } else { - let str_offset = strtab.get_offset(symbol_offsets[index].str_id.unwrap()); - coff_symbol.name[4..8].copy_from_slice(&u32::to_le_bytes(str_offset as u32)); - } - buffer.write(&coff_symbol); + }); // Write auxiliary symbols. match symbol.kind { SymbolKind::File => { - let aux_len = number_of_aux_symbols as usize * coff::IMAGE_SIZEOF_SYMBOL; - debug_assert!(aux_len >= symbol.name.len()); - let old_len = buffer.len(); - buffer.write_bytes(&symbol.name); - buffer.resize(old_len + aux_len); + writer.write_aux_file_name(&symbol.name, number_of_aux_symbols); } - SymbolKind::Section => { + SymbolKind::Section if symbol.section.id().is_some() => { debug_assert_eq!(number_of_aux_symbols, 1); let section_index = symbol.section.id().unwrap().0; let section = &self.sections[section_index]; - let aux = coff::ImageAuxSymbolSection { - length: U32Bytes::new(LE, section.size as u32), - number_of_relocations: if section.relocations.len() > 0xffff { - U16Bytes::new(LE, 0xffff) - } else { - U16Bytes::new(LE, section.relocations.len() as u16) - }, - number_of_linenumbers: U16Bytes::default(), - check_sum: U32Bytes::new(LE, checksum(section.data())), - number: U16Bytes::new( - LE, - section_offsets[section_index].associative_section, - ), + writer.write_aux_section(writer::AuxSymbolSection { + length: section.size as u32, + number_of_relocations: section.relocations.len() as u32, + number_of_linenumbers: 0, + check_sum: checksum(section.data()), + number: section_offsets[section_index].associative_section, selection: section_offsets[section_index].selection, - reserved: 0, - // TODO: bigobj - high_number: U16Bytes::default(), - }; - buffer.write(&aux); + }); } _ => { debug_assert_eq!(number_of_aux_symbols, 0); @@ -706,12 +567,9 @@ impl<'a> Object<'a> { } } - // Write strtab section. - debug_assert_eq!(strtab_offset, buffer.len()); - buffer.write_bytes(&u32::to_le_bytes(strtab_len as u32)); - buffer.write_bytes(&strtab_data); + writer.write_strtab(); - debug_assert_eq!(offset, buffer.len()); + debug_assert_eq!(writer.reserved_len(), writer.len()); Ok(()) } diff --git a/vendor/object/src/write/coff/writer.rs b/vendor/object/src/write/coff/writer.rs new file mode 100644 index 000000000..8c7ada391 --- /dev/null +++ b/vendor/object/src/write/coff/writer.rs @@ -0,0 +1,518 @@ +//! Helper for writing COFF files. +use alloc::string::String; +use alloc::vec::Vec; +use core::mem; + +use crate::endian::{LittleEndian as LE, U16Bytes, U32Bytes, U16, U32}; +use crate::pe; +use crate::write::string::{StringId, StringTable}; +use crate::write::util; +use crate::write::{Error, Result, WritableBuffer}; + +/// A helper for writing COFF files. +/// +/// Writing uses a two phase approach. The first phase builds up all of the information +/// that may need to be known ahead of time: +/// - build string table +/// - reserve section indices +/// - reserve symbol indices +/// - reserve file ranges for headers and sections +/// +/// Some of the information has ordering requirements. For example, strings must be added +/// to the string table before reserving the file range for the string table. There are debug +/// asserts to check some of these requirements. +/// +/// The second phase writes everything out in order. Thus the caller must ensure writing +/// is in the same order that file ranges were reserved. There are debug asserts to assist +/// with checking this. +#[allow(missing_debug_implementations)] +pub struct Writer<'a> { + buffer: &'a mut dyn WritableBuffer, + len: usize, + + section_num: u16, + + symtab_offset: u32, + symtab_num: u32, + + strtab: StringTable<'a>, + strtab_len: usize, + strtab_offset: u32, + strtab_data: Vec, +} + +impl<'a> Writer<'a> { + /// Create a new `Writer`. + pub fn new(buffer: &'a mut dyn WritableBuffer) -> Self { + Writer { + buffer, + len: 0, + + section_num: 0, + + symtab_offset: 0, + symtab_num: 0, + + strtab: StringTable::default(), + strtab_len: 0, + strtab_offset: 0, + strtab_data: Vec::new(), + } + } + + /// Return the current file length that has been reserved. + pub fn reserved_len(&self) -> usize { + self.len + } + + /// Return the current file length that has been written. + #[allow(clippy::len_without_is_empty)] + pub fn len(&self) -> usize { + self.buffer.len() + } + + /// Reserve a file range with the given size and starting alignment. + /// + /// Returns the aligned offset of the start of the range. + pub fn reserve(&mut self, len: usize, align_start: usize) -> u32 { + if align_start > 1 { + self.len = util::align(self.len, align_start); + } + let offset = self.len; + self.len += len; + offset as u32 + } + + /// Write alignment padding bytes. + pub fn write_align(&mut self, align_start: usize) { + if align_start > 1 { + util::write_align(self.buffer, align_start); + } + } + + /// Write data. + pub fn write(&mut self, data: &[u8]) { + self.buffer.write_bytes(data); + } + + /// Reserve the file range up to the given file offset. + pub fn reserve_until(&mut self, offset: usize) { + debug_assert!(self.len <= offset); + self.len = offset; + } + + /// Write padding up to the given file offset. + pub fn pad_until(&mut self, offset: usize) { + debug_assert!(self.buffer.len() <= offset); + self.buffer.resize(offset); + } + + /// Reserve the range for the file header. + /// + /// This must be at the start of the file. + pub fn reserve_file_header(&mut self) { + debug_assert_eq!(self.len, 0); + self.reserve(mem::size_of::(), 1); + } + + /// Write the file header. + /// + /// This must be at the start of the file. + /// + /// Fields that can be derived from known information are automatically set by this function. + pub fn write_file_header(&mut self, header: FileHeader) -> Result<()> { + debug_assert_eq!(self.buffer.len(), 0); + + // Start writing. + self.buffer + .reserve(self.len) + .map_err(|_| Error(String::from("Cannot allocate buffer")))?; + + // Write file header. + let header = pe::ImageFileHeader { + machine: U16::new(LE, header.machine), + number_of_sections: U16::new(LE, self.section_num), + time_date_stamp: U32::new(LE, header.time_date_stamp), + pointer_to_symbol_table: U32::new(LE, self.symtab_offset), + number_of_symbols: U32::new(LE, self.symtab_num), + size_of_optional_header: U16::default(), + characteristics: U16::new(LE, header.characteristics), + }; + self.buffer.write(&header); + + Ok(()) + } + + /// Reserve the range for the section headers. + pub fn reserve_section_headers(&mut self, section_num: u16) { + debug_assert_eq!(self.section_num, 0); + self.section_num = section_num; + self.reserve( + section_num as usize * mem::size_of::(), + 1, + ); + } + + /// Write a section header. + pub fn write_section_header(&mut self, section: SectionHeader) { + let mut coff_section = pe::ImageSectionHeader { + name: [0; 8], + virtual_size: U32::default(), + virtual_address: U32::default(), + size_of_raw_data: U32::new(LE, section.size_of_raw_data), + pointer_to_raw_data: U32::new(LE, section.pointer_to_raw_data), + pointer_to_relocations: U32::new(LE, section.pointer_to_relocations), + pointer_to_linenumbers: U32::new(LE, section.pointer_to_linenumbers), + number_of_relocations: if section.number_of_relocations > 0xffff { + U16::new(LE, 0xffff) + } else { + U16::new(LE, section.number_of_relocations as u16) + }, + number_of_linenumbers: U16::default(), + characteristics: U32::new(LE, section.characteristics), + }; + match section.name { + Name::Short(name) => coff_section.name = name, + Name::Long(str_id) => { + let mut str_offset = self.strtab.get_offset(str_id); + if str_offset <= 9_999_999 { + let mut name = [0; 7]; + let mut len = 0; + if str_offset == 0 { + name[6] = b'0'; + len = 1; + } else { + while str_offset != 0 { + let rem = (str_offset % 10) as u8; + str_offset /= 10; + name[6 - len] = b'0' + rem; + len += 1; + } + } + coff_section.name = [0; 8]; + coff_section.name[0] = b'/'; + coff_section.name[1..][..len].copy_from_slice(&name[7 - len..]); + } else { + debug_assert!(str_offset as u64 <= 0xf_ffff_ffff); + coff_section.name[0] = b'/'; + coff_section.name[1] = b'/'; + for i in 0..6 { + let rem = (str_offset % 64) as u8; + str_offset /= 64; + let c = match rem { + 0..=25 => b'A' + rem, + 26..=51 => b'a' + rem - 26, + 52..=61 => b'0' + rem - 52, + 62 => b'+', + 63 => b'/', + _ => unreachable!(), + }; + coff_section.name[7 - i] = c; + } + } + } + } + self.buffer.write(&coff_section); + } + + /// Reserve the range for the section data. + /// + /// Returns the aligned offset of the start of the range. + /// Does nothing and returns 0 if the length is zero. + pub fn reserve_section(&mut self, len: usize) -> u32 { + if len == 0 { + return 0; + } + // TODO: not sure what alignment is required here, but this seems to match LLVM + self.reserve(len, 4) + } + + /// Write the alignment bytes prior to section data. + /// + /// This is unneeded if you are using `write_section` or `write_section_zeroes` + /// for the data. + pub fn write_section_align(&mut self) { + util::write_align(self.buffer, 4); + } + + /// Write the section data. + /// + /// Writes alignment bytes prior to the data. + /// Does nothing if the data is empty. + pub fn write_section(&mut self, data: &[u8]) { + if data.is_empty() { + return; + } + self.write_section_align(); + self.buffer.write_bytes(data); + } + + /// Write the section data using zero bytes. + /// + /// Writes alignment bytes prior to the data. + /// Does nothing if the length is zero. + pub fn write_section_zeroes(&mut self, len: usize) { + if len == 0 { + return; + } + self.write_section_align(); + self.buffer.resize(self.buffer.len() + len); + } + + /// Reserve a file range for the given number of relocations. + /// + /// This will automatically reserve an extra relocation if there are more than 0xffff. + /// + /// Returns the offset of the range. + /// Does nothing and returns 0 if the count is zero. + pub fn reserve_relocations(&mut self, mut count: usize) -> u32 { + if count == 0 { + return 0; + } + if count > 0xffff { + count += 1; + } + self.reserve(count * mem::size_of::(), 1) + } + + /// Write a relocation containing the count if required. + /// + /// This should be called before writing the first relocation for a section. + pub fn write_relocations_count(&mut self, count: usize) { + if count > 0xffff { + let coff_relocation = pe::ImageRelocation { + virtual_address: U32Bytes::new(LE, count as u32 + 1), + symbol_table_index: U32Bytes::new(LE, 0), + typ: U16Bytes::new(LE, 0), + }; + self.buffer.write(&coff_relocation); + } + } + + /// Write a relocation. + pub fn write_relocation(&mut self, reloc: Relocation) { + let coff_relocation = pe::ImageRelocation { + virtual_address: U32Bytes::new(LE, reloc.virtual_address), + symbol_table_index: U32Bytes::new(LE, reloc.symbol), + typ: U16Bytes::new(LE, reloc.typ), + }; + self.buffer.write(&coff_relocation); + } + + /// Reserve a symbol table entry. + /// + /// This must be called before [`Self::reserve_symtab_strtab`]. + pub fn reserve_symbol_index(&mut self) -> u32 { + debug_assert_eq!(self.symtab_offset, 0); + let index = self.symtab_num; + self.symtab_num += 1; + index + } + + /// Reserve a number of symbol table entries. + pub fn reserve_symbol_indices(&mut self, count: u32) { + debug_assert_eq!(self.symtab_offset, 0); + self.symtab_num += count; + } + + /// Write a symbol table entry. + pub fn write_symbol(&mut self, symbol: Symbol) { + let mut coff_symbol = pe::ImageSymbol { + name: [0; 8], + value: U32Bytes::new(LE, symbol.value), + section_number: U16Bytes::new(LE, symbol.section_number), + typ: U16Bytes::new(LE, symbol.typ), + storage_class: symbol.storage_class, + number_of_aux_symbols: symbol.number_of_aux_symbols, + }; + match symbol.name { + Name::Short(name) => coff_symbol.name = name, + Name::Long(str_id) => { + let str_offset = self.strtab.get_offset(str_id); + coff_symbol.name[4..8].copy_from_slice(&u32::to_le_bytes(str_offset as u32)); + } + } + self.buffer.write(&coff_symbol); + } + + /// Reserve auxiliary symbols for a file name. + /// + /// Returns the number of auxiliary symbols required. + /// + /// This must be called before [`Self::reserve_symtab_strtab`]. + pub fn reserve_aux_file_name(&mut self, name: &[u8]) -> u8 { + debug_assert_eq!(self.symtab_offset, 0); + let aux_count = (name.len() + pe::IMAGE_SIZEOF_SYMBOL - 1) / pe::IMAGE_SIZEOF_SYMBOL; + self.symtab_num += aux_count as u32; + aux_count as u8 + } + + /// Write auxiliary symbols for a file name. + pub fn write_aux_file_name(&mut self, name: &[u8], aux_count: u8) { + let aux_len = aux_count as usize * pe::IMAGE_SIZEOF_SYMBOL; + debug_assert!(aux_len >= name.len()); + let old_len = self.buffer.len(); + self.buffer.write_bytes(name); + self.buffer.resize(old_len + aux_len); + } + + /// Reserve an auxiliary symbol for a section. + /// + /// Returns the number of auxiliary symbols required. + /// + /// This must be called before [`Self::reserve_symtab_strtab`]. + pub fn reserve_aux_section(&mut self) -> u8 { + debug_assert_eq!(self.symtab_offset, 0); + self.symtab_num += 1; + 1 + } + + /// Write an auxiliary symbol for a section. + pub fn write_aux_section(&mut self, section: AuxSymbolSection) { + let aux = pe::ImageAuxSymbolSection { + length: U32Bytes::new(LE, section.length), + number_of_relocations: if section.number_of_relocations > 0xffff { + U16Bytes::new(LE, 0xffff) + } else { + U16Bytes::new(LE, section.number_of_relocations as u16) + }, + number_of_linenumbers: U16Bytes::new(LE, section.number_of_linenumbers), + check_sum: U32Bytes::new(LE, section.check_sum), + number: U16Bytes::new(LE, section.number as u16), + selection: section.selection, + reserved: 0, + high_number: U16Bytes::new(LE, (section.number >> 16) as u16), + }; + self.buffer.write(&aux); + } + + /// Return the number of reserved symbol table entries. + pub fn symbol_count(&self) -> u32 { + self.symtab_num + } + + /// Add a string to the string table. + /// + /// This must be called before [`Self::reserve_symtab_strtab`]. + pub fn add_string(&mut self, name: &'a [u8]) -> StringId { + debug_assert_eq!(self.strtab_offset, 0); + self.strtab.add(name) + } + + /// Add a section or symbol name to the string table if required. + /// + /// This must be called before [`Self::reserve_symtab_strtab`]. + pub fn add_name(&mut self, name: &'a [u8]) -> Name { + if name.len() > 8 { + Name::Long(self.add_string(name)) + } else { + let mut short_name = [0; 8]; + short_name[..name.len()].copy_from_slice(name); + Name::Short(short_name) + } + } + + /// Reserve the range for the symbol table and string table. + /// + /// This must be called after functions that reserve symbol + /// indices or add strings. + pub fn reserve_symtab_strtab(&mut self) { + debug_assert_eq!(self.symtab_offset, 0); + self.symtab_offset = self.reserve(self.symtab_num as usize * pe::IMAGE_SIZEOF_SYMBOL, 1); + + debug_assert_eq!(self.strtab_offset, 0); + // First 4 bytes of strtab are the length. + self.strtab.write(4, &mut self.strtab_data); + self.strtab_len = self.strtab_data.len() + 4; + self.strtab_offset = self.reserve(self.strtab_len, 1); + } + + /// Write the string table. + pub fn write_strtab(&mut self) { + debug_assert_eq!(self.strtab_offset, self.buffer.len() as u32); + self.buffer + .write_bytes(&u32::to_le_bytes(self.strtab_len as u32)); + self.buffer.write_bytes(&self.strtab_data); + } +} + +/// Shortened and native endian version of [`pe::ImageFileHeader`]. +#[allow(missing_docs)] +#[derive(Debug, Default, Clone)] +pub struct FileHeader { + pub machine: u16, + pub time_date_stamp: u32, + pub characteristics: u16, +} + +/// A section or symbol name. +#[derive(Debug, Clone, Copy)] +pub enum Name { + /// An inline name. + Short([u8; 8]), + /// An id of a string table entry. + Long(StringId), +} + +impl Default for Name { + fn default() -> Name { + Name::Short([0; 8]) + } +} + +// From isn't useful. +#[allow(clippy::from_over_into)] +impl<'a> Into for &'a [u8; 8] { + fn into(self) -> Name { + Name::Short(*self) + } +} + +/// Native endian version of [`pe::ImageSectionHeader`]. +#[allow(missing_docs)] +#[derive(Debug, Default, Clone)] +pub struct SectionHeader { + pub name: Name, + pub size_of_raw_data: u32, + pub pointer_to_raw_data: u32, + pub pointer_to_relocations: u32, + pub pointer_to_linenumbers: u32, + /// This will automatically be clamped if there are more than 0xffff. + pub number_of_relocations: u32, + pub number_of_linenumbers: u16, + pub characteristics: u32, +} + +/// Native endian version of [`pe::ImageSymbol`]. +#[allow(missing_docs)] +#[derive(Debug, Default, Clone)] +pub struct Symbol { + pub name: Name, + pub value: u32, + pub section_number: u16, + pub typ: u16, + pub storage_class: u8, + pub number_of_aux_symbols: u8, +} + +/// Native endian version of [`pe::ImageAuxSymbolSection`]. +#[allow(missing_docs)] +#[derive(Debug, Default, Clone)] +pub struct AuxSymbolSection { + pub length: u32, + /// This will automatically be clamped if there are more than 0xffff. + pub number_of_relocations: u32, + pub number_of_linenumbers: u16, + pub check_sum: u32, + pub number: u32, + pub selection: u8, +} + +/// Native endian version of [`pe::ImageRelocation`]. +#[allow(missing_docs)] +#[derive(Debug, Default, Clone)] +pub struct Relocation { + pub virtual_address: u32, + pub symbol: u32, + pub typ: u16, +} diff --git a/vendor/object/src/write/elf/object.rs b/vendor/object/src/write/elf/object.rs index 421d23a86..5d7a93e53 100644 --- a/vendor/object/src/write/elf/object.rs +++ b/vendor/object/src/write/elf/object.rs @@ -141,6 +141,7 @@ impl<'a> Object<'a> { Architecture::Riscv32 => true, Architecture::S390x => true, Architecture::Sbf => false, + Architecture::Sharc => true, Architecture::Sparc64 => true, Architecture::Xtensa => true, _ => { @@ -153,50 +154,6 @@ impl<'a> Object<'a> { } pub(crate) fn elf_fixup_relocation(&mut self, relocation: &mut Relocation) -> Result { - // Return true if we should use a section symbol to avoid preemption. - fn want_section_symbol(relocation: &Relocation, symbol: &Symbol) -> bool { - if symbol.scope != SymbolScope::Dynamic { - // Only dynamic symbols can be preemptible. - return false; - } - match symbol.kind { - SymbolKind::Text | SymbolKind::Data => {} - _ => return false, - } - match relocation.kind { - // Anything using GOT or PLT is preemptible. - // We also require that `Other` relocations must already be correct. - RelocationKind::Got - | RelocationKind::GotRelative - | RelocationKind::GotBaseRelative - | RelocationKind::PltRelative - | RelocationKind::Elf(_) => return false, - // Absolute relocations are preemptible for non-local data. - // TODO: not sure if this rule is exactly correct - // This rule was added to handle global data references in debuginfo. - // Maybe this should be a new relocation kind so that the caller can decide. - RelocationKind::Absolute => { - if symbol.kind == SymbolKind::Data { - return false; - } - } - _ => {} - } - true - } - - // Use section symbols for relocations where required to avoid preemption. - // Otherwise, the linker will fail with: - // relocation R_X86_64_PC32 against symbol `SomeSymbolName' can not be used when - // making a shared object; recompile with -fPIC - let symbol = &self.symbols[relocation.symbol.0]; - if want_section_symbol(relocation, symbol) { - if let Some(section) = symbol.section.id() { - relocation.addend += symbol.value as i64; - relocation.symbol = self.section_symbol(section); - } - } - // Determine whether the addend is stored in the relocation or the data. if self.elf_has_relocation_addend()? { Ok(0) @@ -324,33 +281,34 @@ impl<'a> Object<'a> { // Start writing. let e_type = elf::ET_REL; - let e_machine = match self.architecture { - Architecture::Aarch64 => elf::EM_AARCH64, - Architecture::Aarch64_Ilp32 => elf::EM_AARCH64, - Architecture::Arm => elf::EM_ARM, - Architecture::Avr => elf::EM_AVR, - Architecture::Bpf => elf::EM_BPF, - Architecture::Csky => elf::EM_CSKY, - Architecture::I386 => elf::EM_386, - Architecture::X86_64 => elf::EM_X86_64, - Architecture::X86_64_X32 => elf::EM_X86_64, - Architecture::Hexagon => elf::EM_HEXAGON, - Architecture::LoongArch64 => elf::EM_LOONGARCH, - Architecture::Mips => elf::EM_MIPS, - Architecture::Mips64 => elf::EM_MIPS, - Architecture::Msp430 => elf::EM_MSP430, - Architecture::PowerPc => elf::EM_PPC, - Architecture::PowerPc64 => elf::EM_PPC64, - Architecture::Riscv32 => elf::EM_RISCV, - Architecture::Riscv64 => elf::EM_RISCV, - Architecture::S390x => elf::EM_S390, - Architecture::Sbf => elf::EM_SBF, - Architecture::Sparc64 => elf::EM_SPARCV9, - Architecture::Xtensa => elf::EM_XTENSA, + let e_machine = match (self.architecture, self.sub_architecture) { + (Architecture::Aarch64, None) => elf::EM_AARCH64, + (Architecture::Aarch64_Ilp32, None) => elf::EM_AARCH64, + (Architecture::Arm, None) => elf::EM_ARM, + (Architecture::Avr, None) => elf::EM_AVR, + (Architecture::Bpf, None) => elf::EM_BPF, + (Architecture::Csky, None) => elf::EM_CSKY, + (Architecture::I386, None) => elf::EM_386, + (Architecture::X86_64, None) => elf::EM_X86_64, + (Architecture::X86_64_X32, None) => elf::EM_X86_64, + (Architecture::Hexagon, None) => elf::EM_HEXAGON, + (Architecture::LoongArch64, None) => elf::EM_LOONGARCH, + (Architecture::Mips, None) => elf::EM_MIPS, + (Architecture::Mips64, None) => elf::EM_MIPS, + (Architecture::Msp430, None) => elf::EM_MSP430, + (Architecture::PowerPc, None) => elf::EM_PPC, + (Architecture::PowerPc64, None) => elf::EM_PPC64, + (Architecture::Riscv32, None) => elf::EM_RISCV, + (Architecture::Riscv64, None) => elf::EM_RISCV, + (Architecture::S390x, None) => elf::EM_S390, + (Architecture::Sbf, None) => elf::EM_SBF, + (Architecture::Sharc, None) => elf::EM_SHARC, + (Architecture::Sparc64, None) => elf::EM_SPARCV9, + (Architecture::Xtensa, None) => elf::EM_XTENSA, _ => { return Err(Error(format!( - "unimplemented architecture {:?}", - self.architecture + "unimplemented architecture {:?} with sub-architecture {:?}", + self.architecture, self.sub_architecture ))); } }; @@ -581,6 +539,9 @@ impl<'a> Object<'a> { (RelocationKind::Absolute, RelocationEncoding::Generic, 64) => { elf::R_X86_64_64 } + (RelocationKind::Relative, RelocationEncoding::X86Branch, 32) => { + elf::R_X86_64_PLT32 + } (RelocationKind::Relative, _, 32) => elf::R_X86_64_PC32, (RelocationKind::Got, _, 32) => elf::R_X86_64_GOT32, (RelocationKind::PltRelative, _, 32) => elf::R_X86_64_PLT32, @@ -616,6 +577,7 @@ impl<'a> Object<'a> { (RelocationKind::Absolute, _, 32) => elf::R_LARCH_32, (RelocationKind::Absolute, _, 64) => elf::R_LARCH_64, (RelocationKind::Relative, _, 32) => elf::R_LARCH_32_PCREL, + (RelocationKind::Relative, _, 64) => elf::R_LARCH_64_PCREL, (RelocationKind::Relative, RelocationEncoding::LoongArchBranch, 16) | ( RelocationKind::PltRelative, @@ -766,6 +728,48 @@ impl<'a> Object<'a> { return Err(Error(format!("unimplemented relocation {:?}", reloc))); } }, + Architecture::Sharc => match (reloc.kind, reloc.encoding, reloc.size) { + (RelocationKind::Absolute, RelocationEncoding::SharcTypeA, 32) => { + elf::R_SHARC_ADDR32_V3 + } + (RelocationKind::Absolute, RelocationEncoding::Generic, 32) => { + elf::R_SHARC_ADDR_VAR_V3 + } + (RelocationKind::Relative, RelocationEncoding::SharcTypeA, 24) => { + elf::R_SHARC_PCRLONG_V3 + } + (RelocationKind::Relative, RelocationEncoding::SharcTypeA, 6) => { + elf::R_SHARC_PCRSHORT_V3 + } + (RelocationKind::Relative, RelocationEncoding::SharcTypeB, 6) => { + elf::R_SHARC_PCRSHORT_V3 + } + (RelocationKind::Absolute, RelocationEncoding::Generic, 16) => { + elf::R_SHARC_ADDR_VAR16_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeA, 16) => { + elf::R_SHARC_DATA16_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeB, 16) => { + elf::R_SHARC_DATA16_VISA_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeA, 24) => { + elf::R_SHARC_ADDR24_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeA, 6) => { + elf::R_SHARC_DATA6_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeB, 6) => { + elf::R_SHARC_DATA6_VISA_V3 + } + (RelocationKind::Absolute, RelocationEncoding::SharcTypeB, 7) => { + elf::R_SHARC_DATA7_VISA_V3 + } + (RelocationKind::Elf(x), _, _) => x, + _ => { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, Architecture::Sparc64 => match (reloc.kind, reloc.encoding, reloc.size) { // TODO: use R_SPARC_32/R_SPARC_64 if aligned. (RelocationKind::Absolute, _, 32) => elf::R_SPARC_UA32, diff --git a/vendor/object/src/write/macho.rs b/vendor/object/src/write/macho.rs index 05c376cf9..1c6152344 100644 --- a/vendor/object/src/write/macho.rs +++ b/vendor/object/src/write/macho.rs @@ -13,11 +13,11 @@ struct SectionOffsets { offset: usize, address: u64, reloc_offset: usize, + reloc_count: usize, } #[derive(Default, Clone, Copy)] struct SymbolOffsets { - emit: bool, index: usize, str_id: Option, } @@ -252,19 +252,62 @@ impl<'a> Object<'a> { } pub(crate) fn macho_fixup_relocation(&mut self, relocation: &mut Relocation) -> i64 { - let constant = match relocation.kind { - // AArch64Call relocations have special handling for the addend, so don't adjust it - RelocationKind::Relative if relocation.encoding == RelocationEncoding::AArch64Call => 0, + let relative = match relocation.kind { RelocationKind::Relative | RelocationKind::GotRelative - | RelocationKind::PltRelative => relocation.addend + 4, - _ => relocation.addend, + | RelocationKind::PltRelative + | RelocationKind::MachO { relative: true, .. } => true, + _ => false, }; + if relative { + // For PC relative relocations on some architectures, the + // addend does not include the offset required due to the + // PC being different from the place of the relocation. + // This differs from other file formats, so adjust the + // addend here to account for this. + let pcrel_offset = match self.architecture { + Architecture::I386 => 4, + Architecture::X86_64 => match relocation.kind { + RelocationKind::MachO { + value: macho::X86_64_RELOC_SIGNED_1, + .. + } => 5, + RelocationKind::MachO { + value: macho::X86_64_RELOC_SIGNED_2, + .. + } => 6, + RelocationKind::MachO { + value: macho::X86_64_RELOC_SIGNED_4, + .. + } => 8, + _ => 4, + }, + // TODO: maybe missing support for some architectures and relocations + _ => 0, + }; + relocation.addend += pcrel_offset; + } // Aarch64 relocs of these sizes act as if they are double-word length if self.architecture == Architecture::Aarch64 && matches!(relocation.size, 12 | 21 | 26) { relocation.size = 32; } - relocation.addend -= constant; + // Check for relocations that use an explicit addend. + if self.architecture == Architecture::Aarch64 { + if relocation.encoding == RelocationEncoding::AArch64Call { + return 0; + } + if let RelocationKind::MachO { value, .. } = relocation.kind { + match value { + macho::ARM64_RELOC_BRANCH26 + | macho::ARM64_RELOC_PAGE21 + | macho::ARM64_RELOC_PAGEOFF12 => return 0, + _ => {} + } + } + } + // Signify implicit addend. + let constant = relocation.addend; + relocation.addend = 0; constant } @@ -289,12 +332,6 @@ impl<'a> Object<'a> { let mut ncmds = 0; let command_offset = offset; - let build_version_offset = offset; - if let Some(version) = &self.macho_build_version { - offset += version.cmdsize() as usize; - ncmds += 1; - } - // Calculate size of segment command and section headers. let segment_command_offset = offset; let segment_command_len = @@ -302,12 +339,25 @@ impl<'a> Object<'a> { offset += segment_command_len; ncmds += 1; + // Calculate size of build version. + let build_version_offset = offset; + if let Some(version) = &self.macho_build_version { + offset += version.cmdsize() as usize; + ncmds += 1; + } + // Calculate size of symtab command. let symtab_command_offset = offset; let symtab_command_len = mem::size_of::>(); offset += symtab_command_len; ncmds += 1; + // Calculate size of dysymtab command. + let dysymtab_command_offset = offset; + let dysymtab_command_len = mem::size_of::>(); + offset += dysymtab_command_len; + ncmds += 1; + let sizeofcmds = offset - command_offset; // Calculate size of section data. @@ -335,10 +385,12 @@ impl<'a> Object<'a> { } } - // Count symbols and add symbol strings to strtab. + // Partition symbols and add symbol strings to strtab. let mut strtab = StringTable::default(); let mut symbol_offsets = vec![SymbolOffsets::default(); self.symbols.len()]; - let mut nsyms = 0; + let mut local_symbols = vec![]; + let mut external_symbols = vec![]; + let mut undefined_symbols = vec![]; for (index, symbol) in self.symbols.iter().enumerate() { // The unified API allows creating symbols that we don't emit, so filter // them out here. @@ -355,12 +407,47 @@ impl<'a> Object<'a> { ))); } } - symbol_offsets[index].emit = true; - symbol_offsets[index].index = nsyms; - nsyms += 1; if !symbol.name.is_empty() { symbol_offsets[index].str_id = Some(strtab.add(&symbol.name)); } + if symbol.is_undefined() { + undefined_symbols.push(index); + } else if symbol.is_local() { + local_symbols.push(index); + } else { + external_symbols.push(index); + } + } + + external_symbols.sort_by_key(|index| &*self.symbols[*index].name); + undefined_symbols.sort_by_key(|index| &*self.symbols[*index].name); + + // Count symbols. + let mut nsyms = 0; + for index in local_symbols + .iter() + .copied() + .chain(external_symbols.iter().copied()) + .chain(undefined_symbols.iter().copied()) + { + symbol_offsets[index].index = nsyms; + nsyms += 1; + } + + // Calculate size of relocations. + for (index, section) in self.sections.iter().enumerate() { + let count: usize = section + .relocations + .iter() + .map(|reloc| 1 + usize::from(reloc.addend != 0)) + .sum(); + if count != 0 { + offset = align(offset, pointer_align); + section_offsets[index].reloc_offset = offset; + section_offsets[index].reloc_count = count; + let len = count * mem::size_of::>(); + offset += len; + } } // Calculate size of symtab. @@ -374,39 +461,36 @@ impl<'a> Object<'a> { // Start with null name. let mut strtab_data = vec![0]; strtab.write(1, &mut strtab_data); + write_align(&mut strtab_data, pointer_align); offset += strtab_data.len(); - // Calculate size of relocations. - for (index, section) in self.sections.iter().enumerate() { - let count = section.relocations.len(); - if count != 0 { - offset = align(offset, 4); - section_offsets[index].reloc_offset = offset; - let len = count * mem::size_of::>(); - offset += len; - } - } - // Start writing. buffer .reserve(offset) .map_err(|_| Error(String::from("Cannot allocate buffer")))?; // Write file header. - let (cputype, mut cpusubtype) = match self.architecture { - Architecture::Arm => (macho::CPU_TYPE_ARM, macho::CPU_SUBTYPE_ARM_ALL), - Architecture::Aarch64 => (macho::CPU_TYPE_ARM64, macho::CPU_SUBTYPE_ARM64_ALL), - Architecture::Aarch64_Ilp32 => { + let (cputype, mut cpusubtype) = match (self.architecture, self.sub_architecture) { + (Architecture::Arm, None) => (macho::CPU_TYPE_ARM, macho::CPU_SUBTYPE_ARM_ALL), + (Architecture::Aarch64, None) => (macho::CPU_TYPE_ARM64, macho::CPU_SUBTYPE_ARM64_ALL), + (Architecture::Aarch64, Some(SubArchitecture::Arm64E)) => { + (macho::CPU_TYPE_ARM64, macho::CPU_SUBTYPE_ARM64E) + } + (Architecture::Aarch64_Ilp32, None) => { (macho::CPU_TYPE_ARM64_32, macho::CPU_SUBTYPE_ARM64_32_V8) } - Architecture::I386 => (macho::CPU_TYPE_X86, macho::CPU_SUBTYPE_I386_ALL), - Architecture::X86_64 => (macho::CPU_TYPE_X86_64, macho::CPU_SUBTYPE_X86_64_ALL), - Architecture::PowerPc => (macho::CPU_TYPE_POWERPC, macho::CPU_SUBTYPE_POWERPC_ALL), - Architecture::PowerPc64 => (macho::CPU_TYPE_POWERPC64, macho::CPU_SUBTYPE_POWERPC_ALL), + (Architecture::I386, None) => (macho::CPU_TYPE_X86, macho::CPU_SUBTYPE_I386_ALL), + (Architecture::X86_64, None) => (macho::CPU_TYPE_X86_64, macho::CPU_SUBTYPE_X86_64_ALL), + (Architecture::PowerPc, None) => { + (macho::CPU_TYPE_POWERPC, macho::CPU_SUBTYPE_POWERPC_ALL) + } + (Architecture::PowerPc64, None) => { + (macho::CPU_TYPE_POWERPC64, macho::CPU_SUBTYPE_POWERPC_ALL) + } _ => { return Err(Error(format!( - "unimplemented architecture {:?}", - self.architecture + "unimplemented architecture {:?} with sub-architecture {:?}", + self.architecture, self.sub_architecture ))); } }; @@ -431,18 +515,6 @@ impl<'a> Object<'a> { }, ); - if let Some(version) = &self.macho_build_version { - debug_assert_eq!(build_version_offset, buffer.len()); - buffer.write(&macho::BuildVersionCommand { - cmd: U32::new(endian, macho::LC_BUILD_VERSION), - cmdsize: U32::new(endian, version.cmdsize()), - platform: U32::new(endian, version.platform), - minos: U32::new(endian, version.minos), - sdk: U32::new(endian, version.sdk), - ntools: U32::new(endian, 0), - }); - } - // Write segment command. debug_assert_eq!(segment_command_offset, buffer.len()); macho.write_segment_command( @@ -519,12 +591,25 @@ impl<'a> Object<'a> { offset: section_offsets[index].offset as u32, align: section.align.trailing_zeros(), reloff: section_offsets[index].reloc_offset as u32, - nreloc: section.relocations.len() as u32, + nreloc: section_offsets[index].reloc_count as u32, flags, }, ); } + // Write build version. + if let Some(version) = &self.macho_build_version { + debug_assert_eq!(build_version_offset, buffer.len()); + buffer.write(&macho::BuildVersionCommand { + cmd: U32::new(endian, macho::LC_BUILD_VERSION), + cmdsize: U32::new(endian, version.cmdsize()), + platform: U32::new(endian, version.platform), + minos: U32::new(endian, version.minos), + sdk: U32::new(endian, version.sdk), + ntools: U32::new(endian, 0), + }); + } + // Write symtab command. debug_assert_eq!(symtab_command_offset, buffer.len()); let symtab_command = macho::SymtabCommand { @@ -537,6 +622,35 @@ impl<'a> Object<'a> { }; buffer.write(&symtab_command); + // Write dysymtab command. + debug_assert_eq!(dysymtab_command_offset, buffer.len()); + let dysymtab_command = macho::DysymtabCommand { + cmd: U32::new(endian, macho::LC_DYSYMTAB), + cmdsize: U32::new(endian, dysymtab_command_len as u32), + ilocalsym: U32::new(endian, 0), + nlocalsym: U32::new(endian, local_symbols.len() as u32), + iextdefsym: U32::new(endian, local_symbols.len() as u32), + nextdefsym: U32::new(endian, external_symbols.len() as u32), + iundefsym: U32::new( + endian, + local_symbols.len() as u32 + external_symbols.len() as u32, + ), + nundefsym: U32::new(endian, undefined_symbols.len() as u32), + tocoff: U32::default(), + ntoc: U32::default(), + modtaboff: U32::default(), + nmodtab: U32::default(), + extrefsymoff: U32::default(), + nextrefsyms: U32::default(), + indirectsymoff: U32::default(), + nindirectsyms: U32::default(), + extreloff: U32::default(), + nextrel: U32::default(), + locreloff: U32::default(), + nlocrel: U32::default(), + }; + buffer.write(&dysymtab_command); + // Write section data. for (index, section) in self.sections.iter().enumerate() { if !section.is_bss() { @@ -546,13 +660,138 @@ impl<'a> Object<'a> { } debug_assert_eq!(segment_file_offset + segment_file_size, buffer.len()); + // Write relocations. + for (index, section) in self.sections.iter().enumerate() { + if !section.relocations.is_empty() { + write_align(buffer, pointer_align); + debug_assert_eq!(section_offsets[index].reloc_offset, buffer.len()); + for reloc in §ion.relocations { + let r_length = match reloc.size { + 8 => 0, + 16 => 1, + 32 => 2, + 64 => 3, + _ => return Err(Error(format!("unimplemented reloc size {:?}", reloc))), + }; + + // Write explicit addend. + if reloc.addend != 0 { + let r_type = match self.architecture { + Architecture::Aarch64 | Architecture::Aarch64_Ilp32 => { + macho::ARM64_RELOC_ADDEND + } + _ => { + return Err(Error(format!("unimplemented relocation {:?}", reloc))) + } + }; + + let reloc_info = macho::RelocationInfo { + r_address: reloc.offset as u32, + r_symbolnum: reloc.addend as u32, + r_pcrel: false, + r_length, + r_extern: false, + r_type, + }; + buffer.write(&reloc_info.relocation(endian)); + } + + let r_extern; + let r_symbolnum; + let symbol = &self.symbols[reloc.symbol.0]; + if symbol.kind == SymbolKind::Section { + r_symbolnum = section_offsets[symbol.section.id().unwrap().0].index as u32; + r_extern = false; + } else { + r_symbolnum = symbol_offsets[reloc.symbol.0].index as u32; + r_extern = true; + } + let (r_pcrel, r_type) = match self.architecture { + Architecture::I386 => match reloc.kind { + RelocationKind::Absolute => (false, macho::GENERIC_RELOC_VANILLA), + _ => { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, + Architecture::X86_64 => match (reloc.kind, reloc.encoding) { + (RelocationKind::Absolute, RelocationEncoding::Generic) => { + (false, macho::X86_64_RELOC_UNSIGNED) + } + (RelocationKind::Relative, RelocationEncoding::Generic) => { + (true, macho::X86_64_RELOC_SIGNED) + } + (RelocationKind::Relative, RelocationEncoding::X86RipRelative) => { + (true, macho::X86_64_RELOC_SIGNED) + } + (RelocationKind::Relative, RelocationEncoding::X86Branch) => { + (true, macho::X86_64_RELOC_BRANCH) + } + (RelocationKind::PltRelative, RelocationEncoding::X86Branch) => { + (true, macho::X86_64_RELOC_BRANCH) + } + (RelocationKind::GotRelative, RelocationEncoding::Generic) => { + (true, macho::X86_64_RELOC_GOT) + } + ( + RelocationKind::GotRelative, + RelocationEncoding::X86RipRelativeMovq, + ) => (true, macho::X86_64_RELOC_GOT_LOAD), + (RelocationKind::MachO { value, relative }, _) => (relative, value), + _ => { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, + Architecture::Aarch64 | Architecture::Aarch64_Ilp32 => { + match (reloc.kind, reloc.encoding) { + (RelocationKind::Absolute, RelocationEncoding::Generic) => { + (false, macho::ARM64_RELOC_UNSIGNED) + } + (RelocationKind::Relative, RelocationEncoding::AArch64Call) => { + (true, macho::ARM64_RELOC_BRANCH26) + } + ( + RelocationKind::MachO { value, relative }, + RelocationEncoding::Generic, + ) => (relative, value), + _ => { + return Err(Error(format!( + "unimplemented relocation {:?}", + reloc + ))); + } + } + } + _ => { + if let RelocationKind::MachO { value, relative } = reloc.kind { + (relative, value) + } else { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + } + }; + let reloc_info = macho::RelocationInfo { + r_address: reloc.offset as u32, + r_symbolnum, + r_pcrel, + r_length, + r_extern, + r_type, + }; + buffer.write(&reloc_info.relocation(endian)); + } + } + } + // Write symtab. write_align(buffer, pointer_align); debug_assert_eq!(symtab_offset, buffer.len()); - for (index, symbol) in self.symbols.iter().enumerate() { - if !symbol_offsets[index].emit { - continue; - } + for index in local_symbols + .iter() + .copied() + .chain(external_symbols.iter().copied()) + .chain(undefined_symbols.iter().copied()) + { + let symbol = &self.symbols[index]; // TODO: N_STAB let (mut n_type, n_sect) = match symbol.section { SymbolSection::Undefined => (macho::N_UNDF | macho::N_EXT, 0), @@ -616,128 +855,6 @@ impl<'a> Object<'a> { debug_assert_eq!(strtab_offset, buffer.len()); buffer.write_bytes(&strtab_data); - // Write relocations. - for (index, section) in self.sections.iter().enumerate() { - if !section.relocations.is_empty() { - write_align(buffer, 4); - debug_assert_eq!(section_offsets[index].reloc_offset, buffer.len()); - for reloc in §ion.relocations { - let r_extern; - let mut r_symbolnum; - let symbol = &self.symbols[reloc.symbol.0]; - if symbol.kind == SymbolKind::Section { - r_symbolnum = section_offsets[symbol.section.id().unwrap().0].index as u32; - r_extern = false; - } else { - r_symbolnum = symbol_offsets[reloc.symbol.0].index as u32; - r_extern = true; - } - let r_length = match reloc.size { - 8 => 0, - 16 => 1, - 32 => 2, - 64 => 3, - _ => return Err(Error(format!("unimplemented reloc size {:?}", reloc))), - }; - let (r_pcrel, r_type) = match self.architecture { - Architecture::I386 => match reloc.kind { - RelocationKind::Absolute => (false, macho::GENERIC_RELOC_VANILLA), - _ => { - return Err(Error(format!("unimplemented relocation {:?}", reloc))); - } - }, - Architecture::X86_64 => match (reloc.kind, reloc.encoding, reloc.addend) { - (RelocationKind::Absolute, RelocationEncoding::Generic, 0) => { - (false, macho::X86_64_RELOC_UNSIGNED) - } - (RelocationKind::Relative, RelocationEncoding::Generic, -4) => { - (true, macho::X86_64_RELOC_SIGNED) - } - (RelocationKind::Relative, RelocationEncoding::X86RipRelative, -4) => { - (true, macho::X86_64_RELOC_SIGNED) - } - (RelocationKind::Relative, RelocationEncoding::X86Branch, -4) => { - (true, macho::X86_64_RELOC_BRANCH) - } - (RelocationKind::PltRelative, RelocationEncoding::X86Branch, -4) => { - (true, macho::X86_64_RELOC_BRANCH) - } - (RelocationKind::GotRelative, RelocationEncoding::Generic, -4) => { - (true, macho::X86_64_RELOC_GOT) - } - ( - RelocationKind::GotRelative, - RelocationEncoding::X86RipRelativeMovq, - -4, - ) => (true, macho::X86_64_RELOC_GOT_LOAD), - (RelocationKind::MachO { value, relative }, _, _) => (relative, value), - _ => { - return Err(Error(format!("unimplemented relocation {:?}", reloc))); - } - }, - Architecture::Aarch64 | Architecture::Aarch64_Ilp32 => { - match (reloc.kind, reloc.encoding, reloc.addend) { - (RelocationKind::Absolute, RelocationEncoding::Generic, 0) => { - (false, macho::ARM64_RELOC_UNSIGNED) - } - (RelocationKind::Relative, RelocationEncoding::AArch64Call, 0) => { - (true, macho::ARM64_RELOC_BRANCH26) - } - // Non-zero addend, so we have to encode the addend separately - ( - RelocationKind::Relative, - RelocationEncoding::AArch64Call, - value, - ) => { - // first emit the BR26 relocation - let reloc_info = macho::RelocationInfo { - r_address: reloc.offset as u32, - r_symbolnum, - r_pcrel: true, - r_length, - r_extern: true, - r_type: macho::ARM64_RELOC_BRANCH26, - }; - buffer.write(&reloc_info.relocation(endian)); - - // set up a separate relocation for the addend - r_symbolnum = value as u32; - (false, macho::ARM64_RELOC_ADDEND) - } - ( - RelocationKind::MachO { value, relative }, - RelocationEncoding::Generic, - 0, - ) => (relative, value), - _ => { - return Err(Error(format!( - "unimplemented relocation {:?}", - reloc - ))); - } - } - } - _ => { - if let RelocationKind::MachO { value, relative } = reloc.kind { - (relative, value) - } else { - return Err(Error(format!("unimplemented relocation {:?}", reloc))); - } - } - }; - let reloc_info = macho::RelocationInfo { - r_address: reloc.offset as u32, - r_symbolnum, - r_pcrel, - r_length, - r_extern, - r_type, - }; - buffer.write(&reloc_info.relocation(endian)); - } - } - } - debug_assert_eq!(offset, buffer.len()); Ok(()) diff --git a/vendor/object/src/write/mod.rs b/vendor/object/src/write/mod.rs index 15ca29d79..cea4d2e7f 100644 --- a/vendor/object/src/write/mod.rs +++ b/vendor/object/src/write/mod.rs @@ -12,11 +12,11 @@ use std::{boxed::Box, collections::HashMap, error, io}; use crate::endian::{Endianness, U32, U64}; use crate::{ Architecture, BinaryFormat, ComdatKind, FileFlags, RelocationEncoding, RelocationKind, - SectionFlags, SectionKind, SymbolFlags, SymbolKind, SymbolScope, + SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope, }; #[cfg(feature = "coff")] -mod coff; +pub mod coff; #[cfg(feature = "coff")] pub use coff::CoffExportStyle; @@ -62,6 +62,7 @@ pub type Result = result::Result; pub struct Object<'a> { format: BinaryFormat, architecture: Architecture, + sub_architecture: Option, endian: Endianness, sections: Vec>, standard_sections: HashMap, @@ -88,6 +89,7 @@ impl<'a> Object<'a> { Object { format, architecture, + sub_architecture: None, endian, sections: Vec::new(), standard_sections: HashMap::new(), @@ -117,6 +119,17 @@ impl<'a> Object<'a> { self.architecture } + /// Return the sub-architecture. + #[inline] + pub fn sub_architecture(&self) -> Option { + self.sub_architecture + } + + /// Specify the sub-architecture. + pub fn set_sub_architecture(&mut self, sub_architecture: Option) { + self.sub_architecture = sub_architecture; + } + /// Return the current mangling setting. #[inline] pub fn mangling(&self) -> Mangling { diff --git a/vendor/object/src/write/util.rs b/vendor/object/src/write/util.rs index b05b14d92..f7ee2f41a 100644 --- a/vendor/object/src/write/util.rs +++ b/vendor/object/src/write/util.rs @@ -190,7 +190,7 @@ pub(crate) fn write_uleb128(buf: &mut Vec, mut val: u64) -> usize { /// /// Returns the number of bytes written. #[allow(dead_code)] -pub(crate) fn write_sleb128(buf: &mut Vec, mut val: i64) -> usize { +pub(crate) fn write_sleb128(buf: &mut Vec, mut val: i64) -> usize { let mut len = 0; loop { let mut byte = val as u8; diff --git a/vendor/object/src/xcoff.rs b/vendor/object/src/xcoff.rs index 038698926..dbe5d737b 100644 --- a/vendor/object/src/xcoff.rs +++ b/vendor/object/src/xcoff.rs @@ -331,6 +331,18 @@ pub const STYP_TYPCHK: u16 = 0x4000; /// when either of the counts exceeds 65,534. pub const STYP_OVRFLO: u16 = 0x8000; +pub const SSUBTYP_DWINFO: u32 = 0x10000; +pub const SSUBTYP_DWLINE: u32 = 0x20000; +pub const SSUBTYP_DWPBNMS: u32 = 0x30000; +pub const SSUBTYP_DWPBTYP: u32 = 0x40000; +pub const SSUBTYP_DWARNGE: u32 = 0x50000; +pub const SSUBTYP_DWABREV: u32 = 0x60000; +pub const SSUBTYP_DWSTR: u32 = 0x70000; +pub const SSUBTYP_DWRNGES: u32 = 0x80000; +pub const SSUBTYP_DWLOC: u32 = 0x90000; +pub const SSUBTYP_DWFRAME: u32 = 0xA0000; +pub const SSUBTYP_DWMAC: u32 = 0xB0000; + pub const SIZEOF_SYMBOL: usize = 18; #[derive(Debug, Clone, Copy)] diff --git a/vendor/object/tests/round_trip/macho.rs b/vendor/object/tests/round_trip/macho.rs index f45d3db12..1aa81565d 100644 --- a/vendor/object/tests/round_trip/macho.rs +++ b/vendor/object/tests/round_trip/macho.rs @@ -33,7 +33,7 @@ fn issue_552_section_file_alignment() { Endianness::Little, ); - // Odd number of sections ensures that the starting file offset is not a multiple of 32. + // The starting file offset is not a multiple of 32 (checked later). // Length of 32 ensures that the file offset of the end of this section is still not a // multiple of 32. let section = object.add_section(vec![], vec![], object::SectionKind::ReadOnlyDataWithRel); @@ -44,20 +44,21 @@ fn issue_552_section_file_alignment() { let section = object.add_section(vec![], vec![], object::SectionKind::ReadOnlyData); object.append_section_data(section, &vec![0u8; 1], 32); - let section = object.add_section(vec![], vec![], object::SectionKind::Text); - object.append_section_data(section, &vec![0u8; 1], 1); - let bytes = &*object.write().unwrap(); + //std::fs::write(&"align.o", &bytes).unwrap(); let object = read::File::parse(bytes).unwrap(); let mut sections = object.sections(); let section = sections.next().unwrap(); - assert_eq!(section.file_range(), Some((368, 32))); + let offset = section.file_range().unwrap().0; + // Check file offset is not aligned to 32. + assert_ne!(offset % 32, 0); assert_eq!(section.address(), 0); assert_eq!(section.size(), 32); let section = sections.next().unwrap(); - assert_eq!(section.file_range(), Some((400, 1))); + // Check there is no padding. + assert_eq!(section.file_range(), Some((offset + 32, 1))); assert_eq!(section.address(), 32); assert_eq!(section.size(), 1); } diff --git a/vendor/object/tests/round_trip/mod.rs b/vendor/object/tests/round_trip/mod.rs index cd696f608..b92a94a8c 100644 --- a/vendor/object/tests/round_trip/mod.rs +++ b/vendor/object/tests/round_trip/mod.rs @@ -1,7 +1,7 @@ #![cfg(all(feature = "read", feature = "write"))] use object::read::{Object, ObjectSection, ObjectSymbol}; -use object::{read, write, SectionIndex}; +use object::{read, write, SectionIndex, SubArchitecture}; use object::{ Architecture, BinaryFormat, Endianness, RelocationEncoding, RelocationKind, SectionKind, SymbolFlags, SymbolKind, SymbolScope, SymbolSection, @@ -17,100 +17,142 @@ mod section_flags; mod tls; #[test] -fn coff_x86_64() { - let mut object = - write::Object::new(BinaryFormat::Coff, Architecture::X86_64, Endianness::Little); +fn coff_any() { + for (arch, sub_arch) in [ + (Architecture::Aarch64, None), + (Architecture::Aarch64, Some(SubArchitecture::Arm64EC)), + (Architecture::Arm, None), + (Architecture::I386, None), + (Architecture::X86_64, None), + ] + .iter() + .copied() + { + let mut object = write::Object::new(BinaryFormat::Coff, arch, Endianness::Little); + object.set_sub_architecture(sub_arch); - object.add_file_symbol(b"file.c".to_vec()); + object.add_file_symbol(b"file.c".to_vec()); - let text = object.section_id(write::StandardSection::Text); - object.append_section_data(text, &[1; 30], 4); + let text = object.section_id(write::StandardSection::Text); + object.append_section_data(text, &[1; 30], 4); - let func1_offset = object.append_section_data(text, &[1; 30], 4); - assert_eq!(func1_offset, 32); - let func1_symbol = object.add_symbol(write::Symbol { - name: b"func1".to_vec(), - value: func1_offset, - size: 32, - kind: SymbolKind::Text, - scope: SymbolScope::Linkage, - weak: false, - section: write::SymbolSection::Section(text), - flags: SymbolFlags::None, - }); - object - .add_relocation( - text, - write::Relocation { - offset: 8, - size: 64, - kind: RelocationKind::Absolute, - encoding: RelocationEncoding::Generic, - symbol: func1_symbol, - addend: 0, - }, - ) - .unwrap(); + let func1_offset = object.append_section_data(text, &[1; 30], 4); + assert_eq!(func1_offset, 32); + let func1_symbol = object.add_symbol(write::Symbol { + name: b"func1".to_vec(), + value: func1_offset, + size: 32, + kind: SymbolKind::Text, + scope: SymbolScope::Linkage, + weak: false, + section: write::SymbolSection::Section(text), + flags: SymbolFlags::None, + }); + let func2_offset = object.append_section_data(text, &[1; 30], 4); + assert_eq!(func2_offset, 64); + object.add_symbol(write::Symbol { + name: b"func2_long".to_vec(), + value: func2_offset, + size: 32, + kind: SymbolKind::Text, + scope: SymbolScope::Linkage, + weak: false, + section: write::SymbolSection::Section(text), + flags: SymbolFlags::None, + }); + object + .add_relocation( + text, + write::Relocation { + offset: 8, + size: arch.address_size().unwrap().bytes() * 8, + kind: RelocationKind::Absolute, + encoding: RelocationEncoding::Generic, + symbol: func1_symbol, + addend: 0, + }, + ) + .unwrap(); - let bytes = object.write().unwrap(); - let object = read::File::parse(&*bytes).unwrap(); - assert_eq!(object.format(), BinaryFormat::Coff); - assert_eq!(object.architecture(), Architecture::X86_64); - assert_eq!(object.endianness(), Endianness::Little); + let bytes = object.write().unwrap(); + let object = read::File::parse(&*bytes).unwrap(); + assert_eq!(object.format(), BinaryFormat::Coff); + assert_eq!(object.architecture(), arch); + assert_eq!(object.sub_architecture(), sub_arch); + assert_eq!(object.endianness(), Endianness::Little); - let mut sections = object.sections(); + let mut sections = object.sections(); - let text = sections.next().unwrap(); - println!("{:?}", text); - let text_index = text.index(); - assert_eq!(text.name(), Ok(".text")); - assert_eq!(text.kind(), SectionKind::Text); - assert_eq!(text.address(), 0); - assert_eq!(text.size(), 62); - assert_eq!(&text.data().unwrap()[..30], &[1; 30]); - assert_eq!(&text.data().unwrap()[32..62], &[1; 30]); + let text = sections.next().unwrap(); + println!("{:?}", text); + let text_index = text.index(); + assert_eq!(text.name(), Ok(".text")); + assert_eq!(text.kind(), SectionKind::Text); + assert_eq!(text.address(), 0); + assert_eq!(text.size(), 94); + assert_eq!(&text.data().unwrap()[..30], &[1; 30]); + assert_eq!(&text.data().unwrap()[32..62], &[1; 30]); - let mut symbols = object.symbols(); + let mut symbols = object.symbols(); - let symbol = symbols.next().unwrap(); - println!("{:?}", symbol); - assert_eq!(symbol.name(), Ok("file.c")); - assert_eq!(symbol.address(), 0); - assert_eq!(symbol.kind(), SymbolKind::File); - assert_eq!(symbol.section(), SymbolSection::None); - assert_eq!(symbol.scope(), SymbolScope::Compilation); - assert_eq!(symbol.is_weak(), false); + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + assert_eq!(symbol.name(), Ok("file.c")); + assert_eq!(symbol.address(), 0); + assert_eq!(symbol.kind(), SymbolKind::File); + assert_eq!(symbol.section(), SymbolSection::None); + assert_eq!(symbol.scope(), SymbolScope::Compilation); + assert_eq!(symbol.is_weak(), false); - let symbol = symbols.next().unwrap(); - println!("{:?}", symbol); - let func1_symbol = symbol.index(); - assert_eq!(symbol.name(), Ok("func1")); - assert_eq!(symbol.address(), func1_offset); - assert_eq!(symbol.kind(), SymbolKind::Text); - assert_eq!(symbol.section_index(), Some(text_index)); - assert_eq!(symbol.scope(), SymbolScope::Linkage); - assert_eq!(symbol.is_weak(), false); - assert_eq!(symbol.is_undefined(), false); + let decorated_name = |name: &str| { + if arch == Architecture::I386 { + format!("_{name}") + } else { + name.to_owned() + } + }; - let mut relocations = text.relocations(); + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + let func1_symbol = symbol.index(); + assert_eq!(symbol.name(), Ok(decorated_name("func1").as_str())); + assert_eq!(symbol.address(), func1_offset); + assert_eq!(symbol.kind(), SymbolKind::Text); + assert_eq!(symbol.section_index(), Some(text_index)); + assert_eq!(symbol.scope(), SymbolScope::Linkage); + assert_eq!(symbol.is_weak(), false); + assert_eq!(symbol.is_undefined(), false); - let (offset, relocation) = relocations.next().unwrap(); - println!("{:?}", relocation); - assert_eq!(offset, 8); - assert_eq!(relocation.kind(), RelocationKind::Absolute); - assert_eq!(relocation.encoding(), RelocationEncoding::Generic); - assert_eq!(relocation.size(), 64); - assert_eq!( - relocation.target(), - read::RelocationTarget::Symbol(func1_symbol) - ); - assert_eq!(relocation.addend(), 0); + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + assert_eq!(symbol.name(), Ok(decorated_name("func2_long").as_str())); + assert_eq!(symbol.address(), func2_offset); + assert_eq!(symbol.kind(), SymbolKind::Text); + assert_eq!(symbol.section_index(), Some(text_index)); + assert_eq!(symbol.scope(), SymbolScope::Linkage); + assert_eq!(symbol.is_weak(), false); + assert_eq!(symbol.is_undefined(), false); - let map = object.symbol_map(); - let symbol = map.get(func1_offset + 1).unwrap(); - assert_eq!(symbol.address(), func1_offset); - assert_eq!(symbol.name(), "func1"); - assert_eq!(map.get(func1_offset - 1), None); + let mut relocations = text.relocations(); + + let (offset, relocation) = relocations.next().unwrap(); + println!("{:?}", relocation); + assert_eq!(offset, 8); + assert_eq!(relocation.kind(), RelocationKind::Absolute); + assert_eq!(relocation.encoding(), RelocationEncoding::Generic); + assert_eq!(relocation.size(), arch.address_size().unwrap().bytes() * 8); + assert_eq!( + relocation.target(), + read::RelocationTarget::Symbol(func1_symbol) + ); + assert_eq!(relocation.addend(), 0); + + let map = object.symbol_map(); + let symbol = map.get(func1_offset + 1).unwrap(); + assert_eq!(symbol.address(), func1_offset); + assert_eq!(symbol.name(), decorated_name("func1")); + assert_eq!(map.get(func1_offset - 1), None); + } } #[test] @@ -453,23 +495,29 @@ fn macho_x86_64() { #[test] fn macho_any() { - for (arch, endian) in [ - (Architecture::Aarch64, Endianness::Little), - (Architecture::Aarch64_Ilp32, Endianness::Little), + for (arch, subarch, endian) in [ + (Architecture::Aarch64, None, Endianness::Little), + ( + Architecture::Aarch64, + Some(SubArchitecture::Arm64E), + Endianness::Little, + ), + (Architecture::Aarch64_Ilp32, None, Endianness::Little), /* TODO: - (Architecture::Arm, Endianness::Little), + (Architecture::Arm, None, Endianness::Little), */ - (Architecture::I386, Endianness::Little), - (Architecture::X86_64, Endianness::Little), + (Architecture::I386, None, Endianness::Little), + (Architecture::X86_64, None, Endianness::Little), /* TODO: - (Architecture::PowerPc, Endianness::Big), - (Architecture::PowerPc64, Endianness::Big), + (Architecture::PowerPc, None, Endianness::Big), + (Architecture::PowerPc64, None, Endianness::Big), */ ] .iter() .copied() { let mut object = write::Object::new(BinaryFormat::MachO, arch, endian); + object.set_sub_architecture(subarch); let section = object.section_id(write::StandardSection::Data); object.append_section_data(section, &[1; 30], 4); @@ -509,6 +557,7 @@ fn macho_any() { println!("{:?}", object.architecture()); assert_eq!(object.format(), BinaryFormat::MachO); assert_eq!(object.architecture(), arch); + assert_eq!(object.sub_architecture(), subarch); assert_eq!(object.endianness(), endian); let mut sections = object.sections(); diff --git a/vendor/object/tests/round_trip/tls.rs b/vendor/object/tests/round_trip/tls.rs index 999e2f181..0af90bd76 100644 --- a/vendor/object/tests/round_trip/tls.rs +++ b/vendor/object/tests/round_trip/tls.rs @@ -216,15 +216,6 @@ fn macho_x86_64_tls() { let mut symbols = object.symbols(); - let symbol = symbols.next().unwrap(); - println!("{:?}", symbol); - assert_eq!(symbol.name(), Ok("_tls1")); - assert_eq!(symbol.kind(), SymbolKind::Tls); - assert_eq!(symbol.section_index(), Some(thread_vars_index)); - assert_eq!(symbol.scope(), SymbolScope::Linkage); - assert_eq!(symbol.is_weak(), false); - assert_eq!(symbol.is_undefined(), false); - let symbol = symbols.next().unwrap(); println!("{:?}", symbol); let tls1_init_symbol = symbol.index(); @@ -235,25 +226,6 @@ fn macho_x86_64_tls() { assert_eq!(symbol.is_weak(), false); assert_eq!(symbol.is_undefined(), false); - let symbol = symbols.next().unwrap(); - println!("{:?}", symbol); - let tlv_bootstrap_symbol = symbol.index(); - assert_eq!(symbol.name(), Ok("__tlv_bootstrap")); - assert_eq!(symbol.kind(), SymbolKind::Unknown); - assert_eq!(symbol.section_index(), None); - assert_eq!(symbol.scope(), SymbolScope::Unknown); - assert_eq!(symbol.is_weak(), false); - assert_eq!(symbol.is_undefined(), true); - - let symbol = symbols.next().unwrap(); - println!("{:?}", symbol); - assert_eq!(symbol.name(), Ok("_tls2")); - assert_eq!(symbol.kind(), SymbolKind::Tls); - assert_eq!(symbol.section_index(), Some(thread_vars_index)); - assert_eq!(symbol.scope(), SymbolScope::Linkage); - assert_eq!(symbol.is_weak(), false); - assert_eq!(symbol.is_undefined(), false); - let symbol = symbols.next().unwrap(); println!("{:?}", symbol); let tls2_init_symbol = symbol.index(); @@ -264,6 +236,34 @@ fn macho_x86_64_tls() { assert_eq!(symbol.is_weak(), false); assert_eq!(symbol.is_undefined(), false); + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + assert_eq!(symbol.name(), Ok("_tls1")); + assert_eq!(symbol.kind(), SymbolKind::Tls); + assert_eq!(symbol.section_index(), Some(thread_vars_index)); + assert_eq!(symbol.scope(), SymbolScope::Linkage); + assert_eq!(symbol.is_weak(), false); + assert_eq!(symbol.is_undefined(), false); + + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + assert_eq!(symbol.name(), Ok("_tls2")); + assert_eq!(symbol.kind(), SymbolKind::Tls); + assert_eq!(symbol.section_index(), Some(thread_vars_index)); + assert_eq!(symbol.scope(), SymbolScope::Linkage); + assert_eq!(symbol.is_weak(), false); + assert_eq!(symbol.is_undefined(), false); + + let symbol = symbols.next().unwrap(); + println!("{:?}", symbol); + let tlv_bootstrap_symbol = symbol.index(); + assert_eq!(symbol.name(), Ok("__tlv_bootstrap")); + assert_eq!(symbol.kind(), SymbolKind::Unknown); + assert_eq!(symbol.section_index(), None); + assert_eq!(symbol.scope(), SymbolScope::Unknown); + assert_eq!(symbol.is_weak(), false); + assert_eq!(symbol.is_undefined(), true); + let mut relocations = thread_vars.relocations(); let (offset, relocation) = relocations.next().unwrap(); diff --git a/vendor/once_cell/.cargo-checksum.json b/vendor/once_cell/.cargo-checksum.json index 4cb726782..9a714b701 100644 --- a/vendor/once_cell/.cargo-checksum.json +++ b/vendor/once_cell/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"24f417c25ccab9a49ff4b3b16b0da609517fd81b443df8e1b5f96322f997fb0b","Cargo.lock":"07dcbd89a8fb48503b73e50f44aa46cbb5ada9b2d9593cdb879226feaecc541f","Cargo.toml":"0682d1bd57d5d43262af293a755d29df111a515f00a60d70246947a37f8e7be3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e883909b29dc4d1c44270136fe2cfe7b2df6b416226b13928fdf9f1e15130be7","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/lazy_static.rs":"8bca1b264da21eceb1ccaf30477fc941bc71bedd030f1c6982ed3a7804abfb4f","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_cs.rs":"2f99fd6f993393bc98fd7b52203b1f210262cc834fb30661e0e7f66bc487d357","src/imp_pl.rs":"6a97f60a91ab44192dcaf028e987f6be0328b5d4d69216dcdaec93bc39401f68","src/imp_std.rs":"1c130f83be5c1360dfd379911f97797c1e4c730b845f465c8c2630467ca317d2","src/lib.rs":"cdb40128852d5624120aa49fa82ca573800d955f9c35144878604307c487bdce","src/race.rs":"917f1bc0ba2887644da447a6e9e38990c9a12e3c41c980be37ee916bf79d7677","tests/it/main.rs":"e6e9987e053af84b9d76052602995b1e777efb5bc06cd5f49009e6f03b18626c","tests/it/race.rs":"8dfe38563b6d0be890ab076be1fc1122d41a7c7792354cd7f60bc4454666b968","tests/it/race_once_box.rs":"1c2fe9e2988ec38d60c93c797fceb4c7a65d1b2e48a6a1e78db78ab91388e844","tests/it/sync_lazy.rs":"a36c5d66340b3d6d20aad331a499858a2125dfdfd624c5bf3b4b06a0b157c75c","tests/it/sync_once_cell.rs":"0d04beeb394eb53dd3fc0309fcfc382d56350e72b89d22356e0047d6c7bfef58","tests/it/unsync_lazy.rs":"51a1ffd411770d1e32399ec23feb5f61be362bbed34e100eb7509f8496224e1a","tests/it/unsync_once_cell.rs":"82b72936d7bd4090db25cfc543c01ef3206d6917ac56f09d17d4110a65deb30a"},"package":"dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"} \ No newline at end of file +{"files":{"CHANGELOG.md":"cc4e490ceb3a92be753f3ffee297921a341faf67b304e1e0e63833aba4c3d529","Cargo.lock":"57fb641115940cc1870a3460ebb53ca921461c38894a68e62bf0fc4438825fa8","Cargo.toml":"b0c4dcab027bb78093c9cd0e643b778303bb113fed7f3ab251252141d2b6735d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"2331182c8b5a6971fd0d04a0ca711d5839e93b3de6b2003108940a8c93850aaf","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/lazy_static.rs":"8bca1b264da21eceb1ccaf30477fc941bc71bedd030f1c6982ed3a7804abfb4f","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_cs.rs":"32ee2c252d176726e62cf1f81a270d3738cb06784c47d4064e62350d9f7672cd","src/imp_pl.rs":"6a97f60a91ab44192dcaf028e987f6be0328b5d4d69216dcdaec93bc39401f68","src/imp_std.rs":"1c130f83be5c1360dfd379911f97797c1e4c730b845f465c8c2630467ca317d2","src/lib.rs":"60fe685113e11203ec32876b5dad9c8e1eb705da5854eff8f044d3f4651a7d0f","src/race.rs":"e8400987cc44b3e4b1a321d1e0506df07be7034a7d1c16be641dc75b44fee05c","tests/it/main.rs":"e6e9987e053af84b9d76052602995b1e777efb5bc06cd5f49009e6f03b18626c","tests/it/race.rs":"8dfe38563b6d0be890ab076be1fc1122d41a7c7792354cd7f60bc4454666b968","tests/it/race_once_box.rs":"1c2fe9e2988ec38d60c93c797fceb4c7a65d1b2e48a6a1e78db78ab91388e844","tests/it/sync_lazy.rs":"a36c5d66340b3d6d20aad331a499858a2125dfdfd624c5bf3b4b06a0b157c75c","tests/it/sync_once_cell.rs":"0d04beeb394eb53dd3fc0309fcfc382d56350e72b89d22356e0047d6c7bfef58","tests/it/unsync_lazy.rs":"51a1ffd411770d1e32399ec23feb5f61be362bbed34e100eb7509f8496224e1a","tests/it/unsync_once_cell.rs":"82b72936d7bd4090db25cfc543c01ef3206d6917ac56f09d17d4110a65deb30a"},"package":"3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"} \ No newline at end of file diff --git a/vendor/once_cell/CHANGELOG.md b/vendor/once_cell/CHANGELOG.md index 0cb846a4f..66d27e610 100644 --- a/vendor/once_cell/CHANGELOG.md +++ b/vendor/once_cell/CHANGELOG.md @@ -4,6 +4,10 @@ - +## 1.19.0 + +- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251). + ## 1.18.0 - `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features, diff --git a/vendor/once_cell/Cargo.lock b/vendor/once_cell/Cargo.lock index c545648c6..69b025cc9 100644 --- a/vendor/once_cell/Cargo.lock +++ b/vendor/once_cell/Cargo.lock @@ -11,15 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314e70d181aa6053b26e3f7fbf86d1dfff84f816a6175b967666b3506ef7289" -dependencies = [ - "critical-section", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -52,11 +43,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" dependencies = [ - "atomic-polyfill", "critical-section", "parking_lot_core", + "portable-atomic", "regex", ] @@ -73,6 +64,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "redox_syscall" version = "0.2.16" diff --git a/vendor/once_cell/Cargo.toml b/vendor/once_cell/Cargo.toml index b3a6ba60b..92a473db9 100644 --- a/vendor/once_cell/Cargo.toml +++ b/vendor/once_cell/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.60" name = "once_cell" -version = "1.18.0" +version = "1.19.0" authors = ["Aleksey Kladov "] exclude = [ "*.png", @@ -37,6 +37,7 @@ repository = "https://github.com/matklad/once_cell" [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--generate-link-to-definition"] [[example]] name = "bench" @@ -62,10 +63,6 @@ required-features = ["std"] name = "test_synchronization" required-features = ["std"] -[dependencies.atomic-polyfill] -version = "1" -optional = true - [dependencies.critical-section] version = "1" optional = true @@ -75,6 +72,10 @@ version = "0.9.3" optional = true default_features = false +[dependencies.portable-atomic] +version = "1" +optional = true + [dev-dependencies.critical-section] version = "1.1.1" features = ["std"] @@ -87,7 +88,7 @@ alloc = ["race"] atomic-polyfill = ["critical-section"] critical-section = [ "dep:critical-section", - "dep:atomic-polyfill", + "portable-atomic", ] default = ["std"] parking_lot = ["dep:parking_lot_core"] diff --git a/vendor/once_cell/README.md b/vendor/once_cell/README.md index 737f2defd..2ac9b53a7 100644 --- a/vendor/once_cell/README.md +++ b/vendor/once_cell/README.md @@ -54,5 +54,4 @@ More patterns and use-cases are in the [docs](https://docs.rs/once_cell/)! * [async_once_cell](https://crates.io/crates/async_once_cell) * [generic_once_cell](https://crates.io/crates/generic_once_cell) (bring your own mutex) -The API of `once_cell` is being proposed for inclusion in -[`std`](https://github.com/rust-lang/rfcs/pull/2788). +Parts of `once_cell` API are included into `std` [as of Rust 1.70.0](https://github.com/rust-lang/rust/pull/105587). diff --git a/vendor/once_cell/src/imp_cs.rs b/vendor/once_cell/src/imp_cs.rs index 04018f119..7d05e5044 100644 --- a/vendor/once_cell/src/imp_cs.rs +++ b/vendor/once_cell/src/imp_cs.rs @@ -1,6 +1,6 @@ use core::panic::{RefUnwindSafe, UnwindSafe}; -use atomic_polyfill::{AtomicBool, Ordering}; +use portable_atomic::{AtomicBool, Ordering}; use critical_section::{CriticalSection, Mutex}; use crate::unsync; diff --git a/vendor/once_cell/src/lib.rs b/vendor/once_cell/src/lib.rs index db7e19a8a..90d3657ca 100644 --- a/vendor/once_cell/src/lib.rs +++ b/vendor/once_cell/src/lib.rs @@ -275,13 +275,11 @@ //! //! # Minimum Supported `rustc` Version //! -//! This crate's minimum supported `rustc` version is `1.56.0`. -//! -//! If only the `std` feature is enabled, MSRV will be updated conservatively, -//! supporting at least latest 8 versions of the compiler. When using other -//! features, like `parking_lot`, MSRV might be updated more frequently, up to -//! the latest stable. In both cases, increasing MSRV is *not* considered a -//! semver-breaking change. +//! If only the `std`, `alloc`, or `race` features are enabled, MSRV will be +//! updated conservatively, supporting at least latest 8 versions of the compiler. +//! When using other features, like `parking_lot`, MSRV might be updated more +//! frequently, up to the latest stable. In both cases, increasing MSRV is *not* +//! considered a semver-breaking change and requires only a minor version bump. //! //! # Implementation details //! diff --git a/vendor/once_cell/src/race.rs b/vendor/once_cell/src/race.rs index fe36fa174..da8a2fc51 100644 --- a/vendor/once_cell/src/race.rs +++ b/vendor/once_cell/src/race.rs @@ -20,7 +20,7 @@ //! architectures versus `Relaxed`. #[cfg(feature = "critical-section")] -use atomic_polyfill as atomic; +use portable_atomic as atomic; #[cfg(not(feature = "critical-section"))] use core::sync::atomic; diff --git a/vendor/openssl-sys/.cargo-checksum.json b/vendor/openssl-sys/.cargo-checksum.json index 36af0e5cb..2a6bda34a 100644 --- a/vendor/openssl-sys/.cargo-checksum.json +++ b/vendor/openssl-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"b6ad5835dd7622263e75408a03db3f7191ab23e4ba3cb07cc879a836bf09d235","Cargo.toml":"67875b23ef6065c7de91d3747f225a1051269ade6f1fda4849fe6d67611f352b","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"c5ddde25c2756a1115daaa671fb4297cdc83bf23009c8356ba65b5311d0dd30d","build/cfgs.rs":"5f93ab4f03d3d1463f15984769988f4ce8f0a76ad84f2650ec1d1126598d63fb","build/expando.c":"70183c7062c6bf4808376e9e9ef81ee76eface58616bbeea2abf7cd1bbda50ba","build/find_normal.rs":"b2cbaa5bfac5e7d5550aa0eb8e5c65a9f7e86a3692b759fb13330ef6e3b26b30","build/find_vendored.rs":"4907761e6bc1115f5081dd4c42aa1df6ec7db3cc8b6e2a46071631c23125fe15","build/main.rs":"3a9d3ba268fe346f5a3406f8ad1a28e65a774f0dfb84c52ebcad7fe3a8b77989","build/run_bindgen.rs":"cf484c616eb768185a6155c91c81b7e3243e7e3df7222a62eab90981b7664438","src/aes.rs":"e744b2d608216fb98d365dced84e044951939b6e1868ab52226bf0eeaac3c0f5","src/asn1.rs":"88ce843ffd803b9c6768869d179ddc38b8c1225b092272fdfddd9bd1bdcb3c44","src/bio.rs":"35a5bfd4f38302f3ea47a70d80889280f4f0ae2e3e119082d21322a27c4bb48e","src/bn.rs":"d1b7578c0ec448e3f8ebe68d5048f2761e46715619d81173a5aa89205b9ba8b2","src/cms.rs":"6dbd69d39da588ece53fabdb3a1e2136602eb24ed26106f59c8b852bce0d1a84","src/crypto.rs":"10b73c19f9a8b7383f5337397e00723090de01b20478011df8421d901f653e42","src/dtls1.rs":"0477022d5bcf2b7a620c70ece4da08a2958be3eca5a57127c89d79525c692ebd","src/ec.rs":"2fa5d9a495bc80bf583064c2a0671e13051da2e11bfd725accf2f32e1dabfb0b","src/err.rs":"2eb2bba43e6fc607d7e9cc99c26dfb006a425e647e9bdd1a0b28c014e1363b67","src/evp.rs":"4b23453d673e7d347c0e4ec093380a90ce115a17ec4d960cead0fd263ad7876d","src/handwritten/aes.rs":"31d07045f63d7ea88d1d182487f6cbd42a613119bed32f12affef37bcba26879","src/handwritten/asn1.rs":"218fd7b3f14a374f7585ed665a68a240a4e3f2422b809255770bc0412c5c9924","src/handwritten/bio.rs":"5c969104d8211533f356d058310e7e7e69243343e93b508ccb1419ecd4d28a85","src/handwritten/bn.rs":"ee4370b17e313996f63e0d525caab3271cb6c489ac055b54feb73a207a19f7c2","src/handwritten/cmac.rs":"0ec98c75d6f3d5b097a435a651af101f0e6bde003d0913f62009aff1f51c1f0c","src/handwritten/cms.rs":"2aeff50ca7061f8cba7d0cf9d5da7e17e38909aff0295e5b6301aaa7655c5bfd","src/handwritten/conf.rs":"56835aece385e1093665684fa65b7ade778e3f244e1cc9254d75aa6258eef6b2","src/handwritten/crypto.rs":"910fcf6df345e6bdc43e79088f2eb18bd9b8461a786eee38c7799b9d6ecf9fd4","src/handwritten/dh.rs":"d062c91151f3687186c642d709957a2dca6440f95200b8b9e4e4a91c8d425008","src/handwritten/dsa.rs":"69da4a548c4bcde09cf1b7ca9d0fb20185fd95d1728638a3efcaf7e4c25fc0e4","src/handwritten/ec.rs":"46ce0880b27ce5d1f7df28ab464cdef144028c9b32477d95d499f1e54ebc44fc","src/handwritten/err.rs":"391a867241db4656411b3da5cc8b30ab23dcc9e928a290f6f215caeeb498403d","src/handwritten/evp.rs":"4e5231760631a7feed49940085d0c4a46fa3ee6b4febe8a218ae06283e3de99e","src/handwritten/hmac.rs":"f31cb39769625adb3bcaf5689a0666801ebea4bf5383077b1e76747451a4d07b","src/handwritten/kdf.rs":"bf4ed9a10d8cbeacbdb7a738c76b1a26885e4aa87758879f217a273a5172607a","src/handwritten/mod.rs":"c8a231ff482a427b0d988f04420ba4d57467d13eb17fc23986e1e5b70052ce91","src/handwritten/object.rs":"3a91e4b03fa4f84b5211cddd5a02cc908ccf9ea5f4413d8ef2c503884592f368","src/handwritten/ocsp.rs":"27979cc0439dff61f4c21c68e3d585c0221bd025425ff9bc181c8e870d44f1a7","src/handwritten/pem.rs":"1d04f7b600f7422a24e81705d8f9467fdf63a5fa4c61468178da4b71c85ea429","src/handwritten/pkcs12.rs":"65534ca2844850576e08113990be3a3241ac54c486c48ceae77b382a657facc0","src/handwritten/pkcs7.rs":"9614eb04fdaa430f219cb13df116d6874cb8ca7d6a88ff66d0f6f649670221c2","src/handwritten/poly1305.rs":"3c96081a77ea69441d572a4845d2fccb0bb17dc31006bc936f96e8531e6caa4c","src/handwritten/provider.rs":"86d1dbfd1147fcd3bb7ecde52c5b694e7beb599cd5a26754c5af1b179b170f5d","src/handwritten/rand.rs":"c771057f37c64406aa750f36397fa877caf330a8c725e49356c7081c2b2fdd67","src/handwritten/rsa.rs":"64c34e9d207bb562514e6b7fa9892777b2fb1df32a49d4672bf4eb33345a6e30","src/handwritten/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/handwritten/sha.rs":"7107e2e7e09e9f8b10433b0005a3f4aafead896d7d35949b607dc42b76e24d44","src/handwritten/srtp.rs":"0e9693c840c696cb31774c35c5af55f197de675a6c7e3326a19d7c79958f1e78","src/handwritten/ssl.rs":"9fe0318be8c780fda95e01d9012125f8d190f6765e6bada7b82880d982618a08","src/handwritten/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/handwritten/tls1.rs":"eccb78cf777389a975ec79d5efa634a44802fc963a6a392888640c1cfb00da11","src/handwritten/types.rs":"d4836cd6e2523f97ccd383db5261924fe6d01d1ac3ac67b83a981c5199d1be06","src/handwritten/x509.rs":"9dd08b3125c48e0a287d8743e3ed830c11cac34c2755ef685916617e25ef5a90","src/handwritten/x509_vfy.rs":"f97861f4ce0a20942eae43b852fe73fd0f3a279035c7884eb5853b9e2d890c82","src/handwritten/x509v3.rs":"94270dab5ab0b792e4f712a238bb9004a60c48e269ccf170045e6d762bdc3c6d","src/lib.rs":"b9ba62ea8fd44f47a38b02f952f02b415450f6491363201f871ce6b590f50345","src/macros.rs":"270fa673eba5497b52bd62159e604773dc767cd4536a2377b24ce35cabf680a6","src/obj_mac.rs":"2a02eb89e6eae62c5313173130359d736a5567cc76efec8114d98e1d7f137587","src/ocsp.rs":"63c9ce598f67eb0bb162d4c8d78cb5049c53c4baa41988328b42f7b1bd982ac8","src/pem.rs":"3a0197173331d8b6143d8036a6b121e6b59cac260107d8f42f9b1a1a3426d6fe","src/pkcs7.rs":"f77db0a26e5546d752001701ea43cd55a0c1f7c317425e1f7529ff92590c5076","src/rsa.rs":"8ac9c7a88687ecc8035d56e57c69ba400b3779fd434993c9f53b3e26acd928f0","src/sha.rs":"a5c50aee5fe7a9ba6287129836fce23b9cb35b18de331778d4edbf500b1163b7","src/srtp.rs":"2829d69f64a7c64635340b5e8db48af1d32678b42e7c3b8266c29e26f5b83838","src/ssl.rs":"618ee2f5ce58583d7f4b645701da2748ca41e3b1b624137cd8cf5584c6486dbd","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/tls1.rs":"a60a545a4bc60aaa976cf4304cc892e7b2060e120748670ef14e89a50c6a771b","src/types.rs":"e201d386731c7d20ee827acab33d10d0fe8aa65559f3e61efbf465e468fb34eb","src/x509.rs":"3193e9e0de000571468ec7467887ed931fede88de54584f8823a789fdb1edd58","src/x509_vfy.rs":"eb4a8f36623bafc40ccba26ba3eada5c57fd1f4e780bfc0e6210e4d772ce09fc","src/x509v3.rs":"bbaca7754f6a5f587f2213204eeaa10ea1afddc3c837b3cf7a6da915d2413742"},"package":"3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f"} \ No newline at end of file +{"files":{"CHANGELOG.md":"c04ac7b6795cdd97aec97426734d5516796f8997e08d72fccccc7928ffaa9a66","Cargo.toml":"e3c3101763f7c959e9796963fd4e8ff97560b8cc2df86aaf88f13e5bdf85af90","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"c5ddde25c2756a1115daaa671fb4297cdc83bf23009c8356ba65b5311d0dd30d","build/cfgs.rs":"6b0297581bbfc29c865e171bfeab4af03e3c0e751367d55c21058307d01cbde3","build/expando.c":"70183c7062c6bf4808376e9e9ef81ee76eface58616bbeea2abf7cd1bbda50ba","build/find_normal.rs":"9ccb46a9461c052b510ff79bd6a809a6eef8b546d9721a3af46240818fd28068","build/find_vendored.rs":"4907761e6bc1115f5081dd4c42aa1df6ec7db3cc8b6e2a46071631c23125fe15","build/main.rs":"05ffa5aa9edc94b61ed21b65dd36149ce507a42f4d98b127cd93350a75ea2841","build/run_bindgen.rs":"1e2e7c272976aac92faaee561e7d2def0087ee3f0a18037b99c4919176fef316","src/aes.rs":"e744b2d608216fb98d365dced84e044951939b6e1868ab52226bf0eeaac3c0f5","src/asn1.rs":"88ce843ffd803b9c6768869d179ddc38b8c1225b092272fdfddd9bd1bdcb3c44","src/bio.rs":"35a5bfd4f38302f3ea47a70d80889280f4f0ae2e3e119082d21322a27c4bb48e","src/bn.rs":"d1b7578c0ec448e3f8ebe68d5048f2761e46715619d81173a5aa89205b9ba8b2","src/cms.rs":"6dbd69d39da588ece53fabdb3a1e2136602eb24ed26106f59c8b852bce0d1a84","src/crypto.rs":"10b73c19f9a8b7383f5337397e00723090de01b20478011df8421d901f653e42","src/dtls1.rs":"0477022d5bcf2b7a620c70ece4da08a2958be3eca5a57127c89d79525c692ebd","src/ec.rs":"2fa5d9a495bc80bf583064c2a0671e13051da2e11bfd725accf2f32e1dabfb0b","src/err.rs":"2eb2bba43e6fc607d7e9cc99c26dfb006a425e647e9bdd1a0b28c014e1363b67","src/evp.rs":"4b23453d673e7d347c0e4ec093380a90ce115a17ec4d960cead0fd263ad7876d","src/handwritten/aes.rs":"31d07045f63d7ea88d1d182487f6cbd42a613119bed32f12affef37bcba26879","src/handwritten/asn1.rs":"218fd7b3f14a374f7585ed665a68a240a4e3f2422b809255770bc0412c5c9924","src/handwritten/bio.rs":"5c969104d8211533f356d058310e7e7e69243343e93b508ccb1419ecd4d28a85","src/handwritten/bn.rs":"ee4370b17e313996f63e0d525caab3271cb6c489ac055b54feb73a207a19f7c2","src/handwritten/cmac.rs":"0ec98c75d6f3d5b097a435a651af101f0e6bde003d0913f62009aff1f51c1f0c","src/handwritten/cms.rs":"2aeff50ca7061f8cba7d0cf9d5da7e17e38909aff0295e5b6301aaa7655c5bfd","src/handwritten/conf.rs":"56835aece385e1093665684fa65b7ade778e3f244e1cc9254d75aa6258eef6b2","src/handwritten/crypto.rs":"910fcf6df345e6bdc43e79088f2eb18bd9b8461a786eee38c7799b9d6ecf9fd4","src/handwritten/dh.rs":"d062c91151f3687186c642d709957a2dca6440f95200b8b9e4e4a91c8d425008","src/handwritten/dsa.rs":"69da4a548c4bcde09cf1b7ca9d0fb20185fd95d1728638a3efcaf7e4c25fc0e4","src/handwritten/ec.rs":"46ce0880b27ce5d1f7df28ab464cdef144028c9b32477d95d499f1e54ebc44fc","src/handwritten/err.rs":"391a867241db4656411b3da5cc8b30ab23dcc9e928a290f6f215caeeb498403d","src/handwritten/evp.rs":"4e5231760631a7feed49940085d0c4a46fa3ee6b4febe8a218ae06283e3de99e","src/handwritten/hmac.rs":"f31cb39769625adb3bcaf5689a0666801ebea4bf5383077b1e76747451a4d07b","src/handwritten/kdf.rs":"bf4ed9a10d8cbeacbdb7a738c76b1a26885e4aa87758879f217a273a5172607a","src/handwritten/mod.rs":"c8a231ff482a427b0d988f04420ba4d57467d13eb17fc23986e1e5b70052ce91","src/handwritten/object.rs":"3a91e4b03fa4f84b5211cddd5a02cc908ccf9ea5f4413d8ef2c503884592f368","src/handwritten/ocsp.rs":"27979cc0439dff61f4c21c68e3d585c0221bd025425ff9bc181c8e870d44f1a7","src/handwritten/pem.rs":"1d04f7b600f7422a24e81705d8f9467fdf63a5fa4c61468178da4b71c85ea429","src/handwritten/pkcs12.rs":"65534ca2844850576e08113990be3a3241ac54c486c48ceae77b382a657facc0","src/handwritten/pkcs7.rs":"9614eb04fdaa430f219cb13df116d6874cb8ca7d6a88ff66d0f6f649670221c2","src/handwritten/poly1305.rs":"3c96081a77ea69441d572a4845d2fccb0bb17dc31006bc936f96e8531e6caa4c","src/handwritten/provider.rs":"86d1dbfd1147fcd3bb7ecde52c5b694e7beb599cd5a26754c5af1b179b170f5d","src/handwritten/rand.rs":"fb65a8669ca31664c996aa7d975f02bc01d7b60b192f8e4a3cb31e8aa7e04e25","src/handwritten/rsa.rs":"64c34e9d207bb562514e6b7fa9892777b2fb1df32a49d4672bf4eb33345a6e30","src/handwritten/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/handwritten/sha.rs":"7107e2e7e09e9f8b10433b0005a3f4aafead896d7d35949b607dc42b76e24d44","src/handwritten/srtp.rs":"0e9693c840c696cb31774c35c5af55f197de675a6c7e3326a19d7c79958f1e78","src/handwritten/ssl.rs":"f69b6958d5ac36db6c8cf99037c972fef69305a84b797ce98eacc5606aa78c3c","src/handwritten/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/handwritten/tls1.rs":"eccb78cf777389a975ec79d5efa634a44802fc963a6a392888640c1cfb00da11","src/handwritten/types.rs":"d4836cd6e2523f97ccd383db5261924fe6d01d1ac3ac67b83a981c5199d1be06","src/handwritten/x509.rs":"38ae918f9d029257559308c1f0eaa0b5b68a64d0ec62cee730605dc20e00a279","src/handwritten/x509_vfy.rs":"f97861f4ce0a20942eae43b852fe73fd0f3a279035c7884eb5853b9e2d890c82","src/handwritten/x509v3.rs":"5296c824fbe4fe2c176281395a7f83e916219cf70a1c03d5491ec248d807c747","src/lib.rs":"b9ba62ea8fd44f47a38b02f952f02b415450f6491363201f871ce6b590f50345","src/macros.rs":"270fa673eba5497b52bd62159e604773dc767cd4536a2377b24ce35cabf680a6","src/obj_mac.rs":"15da8a4645390c39e68fa7368b928c39c12863e5f1a08d39a25b186afa85d645","src/ocsp.rs":"63c9ce598f67eb0bb162d4c8d78cb5049c53c4baa41988328b42f7b1bd982ac8","src/pem.rs":"3a0197173331d8b6143d8036a6b121e6b59cac260107d8f42f9b1a1a3426d6fe","src/pkcs7.rs":"f77db0a26e5546d752001701ea43cd55a0c1f7c317425e1f7529ff92590c5076","src/rsa.rs":"8ac9c7a88687ecc8035d56e57c69ba400b3779fd434993c9f53b3e26acd928f0","src/sha.rs":"a5c50aee5fe7a9ba6287129836fce23b9cb35b18de331778d4edbf500b1163b7","src/srtp.rs":"2829d69f64a7c64635340b5e8db48af1d32678b42e7c3b8266c29e26f5b83838","src/ssl.rs":"618ee2f5ce58583d7f4b645701da2748ca41e3b1b624137cd8cf5584c6486dbd","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/tls1.rs":"a60a545a4bc60aaa976cf4304cc892e7b2060e120748670ef14e89a50c6a771b","src/types.rs":"e201d386731c7d20ee827acab33d10d0fe8aa65559f3e61efbf465e468fb34eb","src/x509.rs":"3193e9e0de000571468ec7467887ed931fede88de54584f8823a789fdb1edd58","src/x509_vfy.rs":"eb4a8f36623bafc40ccba26ba3eada5c57fd1f4e780bfc0e6210e4d772ce09fc","src/x509v3.rs":"bbaca7754f6a5f587f2213204eeaa10ea1afddc3c837b3cf7a6da915d2413742"},"package":"22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae"} \ No newline at end of file diff --git a/vendor/openssl-sys/CHANGELOG.md b/vendor/openssl-sys/CHANGELOG.md index 84262e407..ba024b68e 100644 --- a/vendor/openssl-sys/CHANGELOG.md +++ b/vendor/openssl-sys/CHANGELOG.md @@ -2,6 +2,39 @@ ## [Unreleased] +## [v0.9.99] - 2024-01-19 + +### Added + +* On macOS added Homebrew's `openssl@3.0` to the list of candidates to build against. +* `NID_brainpoolP256r1`, `NID_brainpoolP320r1`, `NID_brainpoolP384r1`, and `NID_brainpoolP512r1` are now available on LibreSSL. + +### Changed + +* `X509_PURPOSE` is now opaque on LibreSSL 3.9.0+. + +## [v0.9.98] - 2023-12-22 + +### Added + +* Added `RAND_priv_bytes`. +* Added `NID_brainpoolP320r1`. + +### Changed + +* `X509_PURPOSE_get0` now returns a `const` pointer on LibreSSL 3.9.0+. +* `X509V3_EXT_add_alias` is removed on LibreSSL 3.9.0+. + +## [v0.9.97] - 2023-12-04 + +### Changed + +* libatomic is no longer dynamically linked for 32 bit ARM targets. + +### Added + +* Added `SSL_read_ex`, `SSL_peek_ex`, and `SSL_write_ex`. + ## [v0.9.96] - 2023-11-22 ### Changed @@ -545,7 +578,10 @@ Fixed builds against OpenSSL built with `no-cast`. * Added `X509_verify` and `X509_REQ_verify`. * Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`. -[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.96..master +[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.99..master +[v0.9.99]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.98...openssl-sys-v0.9.99 +[v0.9.98]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.97...openssl-sys-v0.9.98 +[v0.9.97]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.96...openssl-sys-v0.9.97 [v0.9.96]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.95...openssl-sys-v0.9.96 [v0.9.95]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.94...openssl-sys-v0.9.95 [v0.9.94]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.93...openssl-sys-v0.9.94 diff --git a/vendor/openssl-sys/Cargo.toml b/vendor/openssl-sys/Cargo.toml index b103523fa..728f515f9 100644 --- a/vendor/openssl-sys/Cargo.toml +++ b/vendor/openssl-sys/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "openssl-sys" -version = "0.9.96" +version = "0.9.99" authors = [ "Alex Crichton ", "Steven Fackler ", @@ -39,7 +39,7 @@ optional = true version = "0.2" [build-dependencies.bindgen] -version = "0.64.0" +version = "0.65.0" features = ["experimental"] optional = true diff --git a/vendor/openssl-sys/build/cfgs.rs b/vendor/openssl-sys/build/cfgs.rs index 2454ef66a..91cb734c3 100644 --- a/vendor/openssl-sys/build/cfgs.rs +++ b/vendor/openssl-sys/build/cfgs.rs @@ -62,6 +62,9 @@ pub fn get(openssl_version: Option, libressl_version: Option) -> Vec<& if libressl_version >= 0x3_08_02_00_0 { cfgs.push("libressl382"); } + if libressl_version >= 0x3_09_00_00_0 { + cfgs.push("libressl390"); + } } else { let openssl_version = openssl_version.unwrap(); diff --git a/vendor/openssl-sys/build/find_normal.rs b/vendor/openssl-sys/build/find_normal.rs index 4d461039c..ce278f5c7 100644 --- a/vendor/openssl-sys/build/find_normal.rs +++ b/vendor/openssl-sys/build/find_normal.rs @@ -32,7 +32,7 @@ pub fn get_openssl(target: &str) -> (Vec, PathBuf) { } fn resolve_with_wellknown_homebrew_location(dir: &str) -> Option { - let versions = ["openssl@3", "openssl@1.1"]; + let versions = ["openssl@3", "openssl@3.0", "openssl@1.1"]; // Check up default aarch 64 Homebrew installation location first // for quick resolution if possible. diff --git a/vendor/openssl-sys/build/main.rs b/vendor/openssl-sys/build/main.rs index bbee7c5c0..692ff7250 100644 --- a/vendor/openssl-sys/build/main.rs +++ b/vendor/openssl-sys/build/main.rs @@ -130,7 +130,7 @@ fn main() { || env::var("CARGO_CFG_TARGET_OS").unwrap() == "android") && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32" { - println!("cargo:rustc-link-lib=dylib=atomic"); + println!("cargo:rustc-link-lib=atomic"); } if kind == "static" && target.contains("windows") { diff --git a/vendor/openssl-sys/build/run_bindgen.rs b/vendor/openssl-sys/build/run_bindgen.rs index 1eeaad225..5e62237f3 100644 --- a/vendor/openssl-sys/build/run_bindgen.rs +++ b/vendor/openssl-sys/build/run_bindgen.rs @@ -111,6 +111,12 @@ pub fn run(include_dirs: &[PathBuf]) { #[cfg(feature = "bindgen")] pub fn run_boringssl(include_dirs: &[PathBuf]) { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); + + fs::File::create(out_dir.join("boring_static_wrapper.h")) + .expect("Failed to create boring_static_wrapper.h") + .write_all(INCLUDES.as_bytes()) + .expect("Failed to write contents to boring_static_wrapper.h"); + let mut builder = bindgen::builder() .rust_target(RustTarget::Stable_1_47) .ctypes_prefix("::libc") @@ -119,14 +125,19 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) { .enable_function_attribute_detection() .default_macro_constant_type(MacroTypeVariation::Signed) .rustified_enum("point_conversion_form_t") - .allowlist_file(".*/openssl/[^/]+\\.h") + .allowlist_file(".*[/\\\\]openssl/[^/]+\\.h") .allowlist_recursively(false) .blocklist_function("BIO_vsnprintf") .blocklist_function("OPENSSL_vasprintf") .wrap_static_fns(true) .wrap_static_fns_path(out_dir.join("boring_static_wrapper").display().to_string()) .layout_tests(false) - .header_contents("includes.h", INCLUDES); + .header( + out_dir + .join("boring_static_wrapper.h") + .display() + .to_string(), + ); for include_dir in include_dirs { builder = builder @@ -140,21 +151,9 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) { .write_to_file(out_dir.join("bindgen.rs")) .unwrap(); - fs::File::create(out_dir.join("boring_static_wrapper.h")) - .expect("Failed to create boring_static_wrapper.h") - .write_all(INCLUDES.as_bytes()) - .expect("Failed to write contents to boring_static_wrapper.h"); - cc::Build::new() .file(out_dir.join("boring_static_wrapper.c")) .includes(include_dirs) - .flag("-include") - .flag( - &out_dir - .join("boring_static_wrapper.h") - .display() - .to_string(), - ) .compile("boring_static_wrapper"); } @@ -180,7 +179,7 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) { .arg("--enable-function-attribute-detection") .arg("--default-macro-constant-type=signed") .arg("--rustified-enum=point_conversion_form_t") - .arg("--allowlist-file=.*/openssl/[^/]+\\.h") + .arg("--allowlist-file=.*[/\\\\]openssl/[^/]+\\.h") .arg("--no-recursive-allowlist") .arg("--blocklist-function=BIO_vsnprintf") .arg("--blocklist-function=OPENSSL_vasprintf") @@ -203,13 +202,6 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) { cc::Build::new() .file(out_dir.join("boring_static_wrapper.c")) .includes(include_dirs) - .flag("-include") - .flag( - &out_dir - .join("boring_static_wrapper.h") - .display() - .to_string(), - ) .compile("boring_static_wrapper"); } diff --git a/vendor/openssl-sys/src/handwritten/rand.rs b/vendor/openssl-sys/src/handwritten/rand.rs index 3bf9da592..df553bd14 100644 --- a/vendor/openssl-sys/src/handwritten/rand.rs +++ b/vendor/openssl-sys/src/handwritten/rand.rs @@ -3,6 +3,9 @@ use libc::*; extern "C" { pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int; + #[cfg(ossl111)] + pub fn RAND_priv_bytes(buf: *mut u8, num: c_int) -> c_int; + #[cfg(ossl111)] pub fn RAND_keep_random_devices_open(keep: c_int); diff --git a/vendor/openssl-sys/src/handwritten/ssl.rs b/vendor/openssl-sys/src/handwritten/ssl.rs index 944a47661..cdcdea588 100644 --- a/vendor/openssl-sys/src/handwritten/ssl.rs +++ b/vendor/openssl-sys/src/handwritten/ssl.rs @@ -640,7 +640,13 @@ extern "C" { pub fn SSL_stateless(s: *mut SSL) -> c_int; pub fn SSL_connect(ssl: *mut SSL) -> c_int; pub fn SSL_read(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int; + #[cfg(any(ossl111, libressl350))] + pub fn SSL_read_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize) + -> c_int; pub fn SSL_peek(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int; + #[cfg(any(ossl111, libressl350))] + pub fn SSL_peek_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize) + -> c_int; #[cfg(any(ossl111, libressl340))] pub fn SSL_read_early_data( s: *mut SSL, @@ -661,6 +667,13 @@ extern "C" { extern "C" { pub fn SSL_write(ssl: *mut SSL, buf: *const c_void, num: c_int) -> c_int; + #[cfg(any(ossl111, libressl350))] + pub fn SSL_write_ex( + ssl: *mut SSL, + buf: *const c_void, + num: size_t, + written: *mut size_t, + ) -> c_int; #[cfg(any(ossl111, libressl340))] pub fn SSL_write_early_data( s: *mut SSL, diff --git a/vendor/openssl-sys/src/handwritten/x509.rs b/vendor/openssl-sys/src/handwritten/x509.rs index c5419ed6e..15f527e65 100644 --- a/vendor/openssl-sys/src/handwritten/x509.rs +++ b/vendor/openssl-sys/src/handwritten/x509.rs @@ -687,26 +687,31 @@ extern "C" { pub fn X509_REQ_print(bio: *mut BIO, req: *mut X509_REQ) -> c_int; } -#[repr(C)] -pub struct X509_PURPOSE { - pub purpose: c_int, - pub trust: c_int, // Default trust ID - pub flags: c_int, - pub check_purpose: - Option c_int>, - pub name: *mut c_char, - pub sname: *mut c_char, - pub usr_data: *mut c_void, +cfg_if! { + if #[cfg(libressl390)] { + pub enum X509_PURPOSE {} + } else { + #[repr(C)] + pub struct X509_PURPOSE { + pub purpose: c_int, + pub trust: c_int, // Default trust ID + pub flags: c_int, + pub check_purpose: + Option c_int>, + pub name: *mut c_char, + pub sname: *mut c_char, + pub usr_data: *mut c_void, + } + } } const_ptr_api! { extern "C" { pub fn X509_PURPOSE_get_by_sname(sname: #[const_ptr_if(any(ossl110, libressl280))] c_char) -> c_int; + pub fn X509_PURPOSE_get_id(purpose: #[const_ptr_if(any(ossl110, libressl280))] X509_PURPOSE) -> c_int; + pub fn X509_PURPOSE_get0(idx: c_int) -> #[const_ptr_if(libressl390)] X509_PURPOSE; } } -extern "C" { - pub fn X509_PURPOSE_get0(idx: c_int) -> *mut X509_PURPOSE; -} extern "C" { pub fn X509_ATTRIBUTE_new() -> *mut X509_ATTRIBUTE; diff --git a/vendor/openssl-sys/src/handwritten/x509v3.rs b/vendor/openssl-sys/src/handwritten/x509v3.rs index 2f59bf666..1a548c0e2 100644 --- a/vendor/openssl-sys/src/handwritten/x509v3.rs +++ b/vendor/openssl-sys/src/handwritten/x509v3.rs @@ -84,6 +84,7 @@ const_ptr_api! { } extern "C" { + #[cfg(not(libressl390))] pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int; pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void; pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION; diff --git a/vendor/openssl-sys/src/obj_mac.rs b/vendor/openssl-sys/src/obj_mac.rs index 2c4b6aaeb..400f73388 100644 --- a/vendor/openssl-sys/src/obj_mac.rs +++ b/vendor/openssl-sys/src/obj_mac.rs @@ -94,12 +94,27 @@ pub const NID_sect409k1: c_int = 731; pub const NID_sect409r1: c_int = 732; pub const NID_sect571k1: c_int = 733; pub const NID_sect571r1: c_int = 734; + #[cfg(ossl110)] pub const NID_brainpoolP256r1: c_int = 927; +#[cfg(libressl)] +pub const NID_brainpoolP256r1: c_int = 928; + +#[cfg(ossl110)] +pub const NID_brainpoolP320r1: c_int = 929; +#[cfg(libressl)] +pub const NID_brainpoolP320r1: c_int = 930; + #[cfg(ossl110)] pub const NID_brainpoolP384r1: c_int = 931; +#[cfg(libressl)] +pub const NID_brainpoolP384r1: c_int = 932; + #[cfg(ossl110)] pub const NID_brainpoolP512r1: c_int = 933; +#[cfg(libressl)] +pub const NID_brainpoolP512r1: c_int = 934; + pub const NID_wap_wsg_idm_ecid_wtls1: c_int = 735; pub const NID_wap_wsg_idm_ecid_wtls3: c_int = 736; pub const NID_wap_wsg_idm_ecid_wtls4: c_int = 737; diff --git a/vendor/openssl/.cargo-checksum.json b/vendor/openssl/.cargo-checksum.json index 0a94b59b6..1647da7b7 100644 --- a/vendor/openssl/.cargo-checksum.json +++ b/vendor/openssl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"7d4bb60f0ed6f1e00aebd48b9cd88021db0db1713854eea6741546358aa340e7","Cargo.lock":"e9fe187a635e38c7d6aabc8ce3156179690bcb7acd664c9e2f38bbd63ac33a28","Cargo.toml":"000ac614fc4e3973684b3e964915c9c0c8b8f519b0b79477bb78b389c33440e4","LICENSE":"f3d4287b4a21c5176fea2f9bd4ae800696004e2fb8e05cbc818be513f188a941","README.md":"c5ddde25c2756a1115daaa671fb4297cdc83bf23009c8356ba65b5311d0dd30d","build.rs":"3dfd1bd2d4c66e1c833b33ca64abac0a216f3db43ad695f57c0c19aecde757f3","examples/mk_certs.rs":"012569fc734c314c5d3c1c9dc8ae64a32db4cfa917e8fbc363c1eef118600d0a","src/aes.rs":"a428f06147e4b48219a789da0af12371d967d2eefcc55536df4d1547001dda8b","src/asn1.rs":"ebdb0ba959b1756133c69432d86045b60f3e7b6a8581299d3f5e14f7c99ff439","src/base64.rs":"8be8ad4fe10055cdd55d0147d569e7669d3ac82927569bb917a76e447dfe90d1","src/bio.rs":"c19b865b79bb7ea3460083046f50757800f6c93fe9ec9f3dbb438980fe127aa4","src/bn.rs":"966356af877c59fbbf3d43d03ac643f6021933cbccab330b143e00fea7bfea5e","src/cipher.rs":"c1cba8c0d7ec2f6b08254900fb0ba64b243ff692cba663b9f14fb9446dd722fe","src/cipher_ctx.rs":"01ffd0005693695c41e5dd1d86b448bca4808e43d5778c5b9f707c1e867a75bb","src/cms.rs":"19e14cdf5ccdf9199df34a7d8f26374d4ce9277248f79b45cbd850a15ca104f6","src/conf.rs":"c374003c606c331fedbe9075abfaf41eba38bfbbbefe9c9f2d2a1d445e4b1606","src/derive.rs":"963694c3cf7b0b70802b5b2b3f93f857ed7b320d5db331b57c2ff11bcb0891ad","src/dh.rs":"61d7a4984db877d8360db8848e04d70758dc964a987fd1ce514696ba751f56fd","src/dsa.rs":"10b6aca140fe332cb35c78cb3b0e9f1aa7cf18971059ac93a9a458481de26f85","src/ec.rs":"43142ab898dd4dc25efd7cd5c081be4f1a65c39d48e715fa3a208c7a2c5cb534","src/ecdsa.rs":"b5bbfd49fafc9f08bd309a0046eca20016990cd266d442973498c6f2951aed37","src/encrypt.rs":"d1c6de4f5998f06d33de66005a1926eab895f0ecff01396b46dc697dc1593b26","src/envelope.rs":"773551074ece307aff215686e6a43471edf0ef6f74c520e4611e70f96e928652","src/error.rs":"ede27beebf1594a9165f16aa8732816f28501a8454d3125b6eb5ce98756e0255","src/ex_data.rs":"0a58a3a274a4ef2251dadb64cbcd44b43710d252201b137ecfb91cf14373c04f","src/fips.rs":"761cd7cdfbc16af88fbfefd38e54cb77b4ba8e2f49221607e145bc541f089d7e","src/hash.rs":"ee695fa92f63807c8689e8375e2616fd8798bbe655e7162f2fa1349d0b3ad8aa","src/lib.rs":"e9a6b41ea361b1e44d0bd79189371514deb63c056a0b41e81ed7f78332bbf985","src/lib_ctx.rs":"ec6431adad53f3a9621b011506678104bd4f62bdea38ef9d1b731334507ab068","src/macros.rs":"648054f2ee89a22314b942a882878d47121b97b47d9b1146e323b8c6c255a52c","src/md.rs":"038fb8c568634590d5beeb81e47d8bffa201b3ec0297b7b83a06af7abc3bf780","src/md_ctx.rs":"a00fbe465477fd1209fffd7b83eebb1e86af2bfd3acf2c1ca691f19da1a5b35f","src/memcmp.rs":"f48e0e29f372db2d0eb2239290abec8819300eb3e01e3bb1030783d6f6a8b2c9","src/nid.rs":"bd255663fc0a91050b51aca002ea585a110b950216c3e8da82e65d7eda229c63","src/ocsp.rs":"bfb378fa87945eee583521e350f427406888bbb8a804a90aeb06bdbf1b656ddf","src/pkcs12.rs":"e5de1453b93e08b07fc10d90f85ee5dc29e435a1377b3db015aca8ed74495cfd","src/pkcs5.rs":"b73bdd59ec857830a4fcc1e2e9b954e69f18df5302c5cc3366f11a877b0e655f","src/pkcs7.rs":"16e2312f8f5b83433ca29b48ee4b4ce7756fc5bfd5af681f95348281c974cf2f","src/pkey.rs":"48318aed4820d917956d89c9984ba0dd95cf024a06a50564c9e5e9b5f16653bf","src/pkey_ctx.rs":"70382b9d16112ec347c9114dc479ca703e7091fb224f3a6daf2ab59bb3f7d1d5","src/provider.rs":"c77886efcc4f962ebc4d8b693a69375aa58186cf1990c692a572723d3e46779b","src/rand.rs":"5025bc51effe6a2bad23787aaa457ae030065f6ec757aaba148a74b775a5a853","src/rsa.rs":"48e1d8c0100f87a69123daae20350c61e4ad6a256a535612c297bcb855aeada0","src/sha.rs":"c34f2f9df5fb52b578022568e195e011d0967f9f5ff57b559d7d2a235951a5b9","src/sign.rs":"9af5544b9c5d81c494ba055c247c8d152e5853a26efa60ff7c1788b569225fd9","src/srtp.rs":"3defe1815cfc790e2407ff935f8ca7b0e8d504242886e8841715279e0d85f721","src/ssl/bio.rs":"f6c20da805b711d69f527e9df8897061f9d6f3ef22d2d0a8f9fd87f96dc3947e","src/ssl/callbacks.rs":"07bacf44efc4977a7ad327bb026786585c78ebd991a0983c15669429f8d5d99b","src/ssl/connector.rs":"32afe0925584b349b3595aaabd0dadbf6ab383b5879c49c68ad2d0fddf0b0e4a","src/ssl/error.rs":"f39ac3e1037a35ae5cccbf5cf5976044614a6368c9ffe3f1b96bead63c0c4231","src/ssl/mod.rs":"2c5928c98ec958fb195a4a544ed44ffae550f8b6896455dbcb15a0e0e1aee255","src/ssl/test/mod.rs":"5054039dc032a9862f54dc140eaaaa38990053dc89ba914451783dddb8057540","src/ssl/test/server.rs":"4276ba970a0fac5c9cae21d7df7af36389c377472f3546ce597678ffc6ad5b38","src/stack.rs":"29aa6e467153b951cbf56ab62ac806941b4eb0e1dd22f22d4b1ab562cc037d55","src/string.rs":"8276d719b35cd74ee0efbecce9e58e754d50d8cc96111f2febd3c0d8849847a8","src/symm.rs":"3da30db9c0c67dff2e68a36b1497f542f08ee20f6fe1ca6bc0986bd7c88575ba","src/util.rs":"e6794bf0643d0c29e96325653f2bb4a00221de55bb5b3c6c96d5dbae3debe238","src/version.rs":"e3acbb0db2095ab616870055c7c7a902fb7b1439520574fd20b7c1164b1178b7","src/x509/extension.rs":"26a265248eb0e54c3b106708f8fce7d5fb5b91b7195f17a97e1b8b1d3b6fa119","src/x509/mod.rs":"fafd666515c0f2f11c9f84339ddb144cb46434cdb59eea78fbbb46b68a002d40","src/x509/store.rs":"964636ad1bf95cbc3964702e1b6636b83ef9a270a7380ee6ef790b6511acaa74","src/x509/tests.rs":"a64605f77fed97471fd3cb467a9b30ee249c7e2d1cfcf07be7ea25ec4c88e008","src/x509/verify.rs":"d7ec7421d0b9fe33755a031154487348beecccc87ef5fd8221dacce79278f48b","test/aia_test_cert.pem":"9eaf52b5d0023f3be7911938d937ed16fc75d43d14dbe41557a800b0a82f4b1b","test/alt_name_cert.pem":"f3cc0a1d21657164918dffab0dac8f1c499fc1cf5717805420a0134b3aee128c","test/authority_key_identifier.pem":"4644b83bbcd36a6e1917d1f7bd3b8ff913bf86cc74917c07dd78b6731b4d5bec","test/ca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/cert.pem":"53c8b338be254490c71a6b13da90dc5a59ba596587c548be5673657e04824afb","test/certs.pem":"106d5d22c86e26c3db619b9525567f22333d22de82e4d2850ed379150c638008","test/certv3.pem":"c230b76b6efb973816d0e3096ae95cdcf4941ec928c01c31b6537d01743fcd8a","test/certv3_extfile":"610fdc10edac2da398a582895e53d288d3e47a9d4f3868c2c7f7662c212b60bd","test/cms.p12":"d33fc5edd6b9caa672e7570b869135235bb2583580a273f6e88c6a6c68fd5a8a","test/cms_pubkey.der":"03682a732e1fd861f5fa687915a8e6f5c935d10273b0f6f73f3db52a8d71fc6d","test/crl-ca.crt":"911360ccdf700fd7d6091bd78c4138da0e9f027ca211f7ed80b394e570eb897c","test/csr.pem":"24423008144c43cf33f56ebcc245931b2d61bcd4eee17b476d7adb6f7416e24d","test/dhparams.pem":"14d9461949d9ae8ca50a393b008ee2168254f14342b0e17b56c0a62d2905b963","test/dsa.pem":"826d513234205fd3dee0bbbf844f0b6fea501145bdf05ea3b14e14df98cbe090","test/dsa.pem.pub":"721677bebf9ab28b8650f98a0cd27658de0c1acd867a4b6e985fe1df95a8bd37","test/dsaparam.pem":"94a1284bdd7d7566151cfde0c7f245e84f7b99ba840f202e3f27ea0160f82988","test/entry_extensions.crl":"bee73d33a326bde92d3c38f275b3f94943e46cf778d7043e1176e84413dc22e9","test/identity.p12":"aceeb3e5516471bd5af9a44bbeffc9559c4f228f67c677d29f36a4b368e2779f","test/intermediate-ca.key":"a5f3d331af87c1305843e235841e494a0669a95d3824a6c766d09371f62c3bab","test/intermediate-ca.pem":"5ff8055325d0cbb60586f4e20bd2df7718e4d94f5261f2ee05ba52a8fb9223f0","test/key.der":"e8842cd6674b5c77a83e0283cd876a91de404561dfc86d79ce525f6e55b28197","test/key.der.pub":"e559d56bb6ec57ad743dbf972bbcaf263a9fa7d320433baa71b04f849d987060","test/key.pem":"12d9105a92bf39b615ccb4820c5c1e38c61905483cd30be13f9ab99b98af64ed","test/key.pem.pub":"f5d030df843ddbaba5bf316ae18f1434de5a63a955be66442429dd4f16f161ef","test/keystore-empty-chain.p12":"bbea280f6fe10556d7470df7072ef0e4ee3997e2c0b3666197f423430c0e6b61","test/leaf.pem":"4f2c3fd02f73b3f49a1e05cf0622669ed014ba019876d89d3f21c788457c1e01","test/nid_test_cert.pem":"7047e8d317e284c6b698eee4a0f1a629d50cd4615ad7da85fe90a2ffb6c21611","test/nid_uid_test_cert.pem":"a735211f3b40edbde7084337138fb0aea06aea6c78369c52015253e4b7a17d83","test/pkcs1.pem.pub":"4d446864b63c4178ec2c7dc8df9b7121d9271851c1f4701231fccb8b07c94918","test/pkcs8-nocrypt.der":"5590d03cc0d037c6c27d78fafc937f48defb226e9a52cde84d54df68086d0575","test/pkcs8.der":"8719fc002d59313fb97e46e068ae40db4d9acc0e2debd308ac9eb46329bea487","test/root-ca.key":"b37cf88614980c38e43c4329cdf7162bae48cc8af1fafd54db2fe0d17e458e1d","test/root-ca.pem":"59b9200c35e818bf21be4aaa97ba87bb6a18fd780527a9f9c51cc74212c631a0","test/rsa-encrypted.pem":"ea41b0f1816056672de6abbab43d0e8089da047c329ceed14aace5a5bde713f1","test/rsa.pem":"f866a5506ea9a37ed2f73f62f503e1aff32f7e4145be62b023535f4da1c24416","test/rsa.pem.pub":"2c5eeea39708e90396f9f09d920f2af8b7e9f84ace963c1319072224dd3d302b","test/subca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/test.crl":"ac8443257214f9e82543871c3df48694ea39f2b16bd6c4ef5998a161edbb8fba"},"package":"79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800"} \ No newline at end of file +{"files":{"CHANGELOG.md":"0cca6cde9e4298114a1b214a59743d809b0c93aebbe8dff74b7b0fc260dc2ff4","Cargo.lock":"9519d827b2d8988cac022ee2ded63a5c29da0a2b9036dfa9f9caec8f2c9d1897","Cargo.toml":"71ef8066138f79ce254fb51f52e163892644b85f9c95f51c66e4bad92c5c8117","LICENSE":"f3d4287b4a21c5176fea2f9bd4ae800696004e2fb8e05cbc818be513f188a941","README.md":"c5ddde25c2756a1115daaa671fb4297cdc83bf23009c8356ba65b5311d0dd30d","build.rs":"3c92eb5e68da6943dabc614fd1b1a2c77c7a9c65ea7fe27624f11700d4a7c0f0","examples/mk_certs.rs":"012569fc734c314c5d3c1c9dc8ae64a32db4cfa917e8fbc363c1eef118600d0a","src/aes.rs":"a428f06147e4b48219a789da0af12371d967d2eefcc55536df4d1547001dda8b","src/asn1.rs":"d250233df5913879a6dc205e16f2404bd7512e29a2b8dab2b9ea83c670ee85be","src/base64.rs":"8be8ad4fe10055cdd55d0147d569e7669d3ac82927569bb917a76e447dfe90d1","src/bio.rs":"c19b865b79bb7ea3460083046f50757800f6c93fe9ec9f3dbb438980fe127aa4","src/bn.rs":"966356af877c59fbbf3d43d03ac643f6021933cbccab330b143e00fea7bfea5e","src/cipher.rs":"3bf4595773be7c5f292b671c9272979d2b300b0e2961e14d3aa0d1c03a24b83d","src/cipher_ctx.rs":"01ffd0005693695c41e5dd1d86b448bca4808e43d5778c5b9f707c1e867a75bb","src/cms.rs":"0dfa2f1134b84de1c7c9a8ad78ad2b8cd773cea75c9b80cf57bcf181f7ed4573","src/conf.rs":"c374003c606c331fedbe9075abfaf41eba38bfbbbefe9c9f2d2a1d445e4b1606","src/derive.rs":"963694c3cf7b0b70802b5b2b3f93f857ed7b320d5db331b57c2ff11bcb0891ad","src/dh.rs":"e9fc6d5910241a6cba0b7c6ce4139ba8cbd04be7de5c92a479406ddc79a581cd","src/dsa.rs":"10b6aca140fe332cb35c78cb3b0e9f1aa7cf18971059ac93a9a458481de26f85","src/ec.rs":"43142ab898dd4dc25efd7cd5c081be4f1a65c39d48e715fa3a208c7a2c5cb534","src/ecdsa.rs":"b5bbfd49fafc9f08bd309a0046eca20016990cd266d442973498c6f2951aed37","src/encrypt.rs":"d1c6de4f5998f06d33de66005a1926eab895f0ecff01396b46dc697dc1593b26","src/envelope.rs":"773551074ece307aff215686e6a43471edf0ef6f74c520e4611e70f96e928652","src/error.rs":"ede27beebf1594a9165f16aa8732816f28501a8454d3125b6eb5ce98756e0255","src/ex_data.rs":"0a58a3a274a4ef2251dadb64cbcd44b43710d252201b137ecfb91cf14373c04f","src/fips.rs":"761cd7cdfbc16af88fbfefd38e54cb77b4ba8e2f49221607e145bc541f089d7e","src/hash.rs":"ee695fa92f63807c8689e8375e2616fd8798bbe655e7162f2fa1349d0b3ad8aa","src/lib.rs":"c845f485a5772705f25a0bfa4033604b9586d6174288f1ff712b82ccff91994e","src/lib_ctx.rs":"ec6431adad53f3a9621b011506678104bd4f62bdea38ef9d1b731334507ab068","src/macros.rs":"648054f2ee89a22314b942a882878d47121b97b47d9b1146e323b8c6c255a52c","src/md.rs":"038fb8c568634590d5beeb81e47d8bffa201b3ec0297b7b83a06af7abc3bf780","src/md_ctx.rs":"a00fbe465477fd1209fffd7b83eebb1e86af2bfd3acf2c1ca691f19da1a5b35f","src/memcmp.rs":"f48e0e29f372db2d0eb2239290abec8819300eb3e01e3bb1030783d6f6a8b2c9","src/nid.rs":"8ed819d454abb0e531d5dd359bc6ca8c16c7c48ec8cf07dd52e59a7bebd1d77a","src/ocsp.rs":"bfb378fa87945eee583521e350f427406888bbb8a804a90aeb06bdbf1b656ddf","src/pkcs12.rs":"e5de1453b93e08b07fc10d90f85ee5dc29e435a1377b3db015aca8ed74495cfd","src/pkcs5.rs":"b73bdd59ec857830a4fcc1e2e9b954e69f18df5302c5cc3366f11a877b0e655f","src/pkcs7.rs":"24431303749047c08aad278f53ea47d6e47130318d368dd5213194e27bd58620","src/pkey.rs":"e8a509baf35b2477253c024f06c45da7b6804580673d7b1f84b021ea80a29d71","src/pkey_ctx.rs":"70382b9d16112ec347c9114dc479ca703e7091fb224f3a6daf2ab59bb3f7d1d5","src/provider.rs":"5ab0b25e8866ecea327ad764d44594912f1dc09eb73c3ed5db134714e9f4b73e","src/rand.rs":"d409044aeabc86314b5b3dd9511f2341042582bab2ed9862ffeb87b031d73872","src/rsa.rs":"48e1d8c0100f87a69123daae20350c61e4ad6a256a535612c297bcb855aeada0","src/sha.rs":"c34f2f9df5fb52b578022568e195e011d0967f9f5ff57b559d7d2a235951a5b9","src/sign.rs":"9af5544b9c5d81c494ba055c247c8d152e5853a26efa60ff7c1788b569225fd9","src/srtp.rs":"3defe1815cfc790e2407ff935f8ca7b0e8d504242886e8841715279e0d85f721","src/ssl/bio.rs":"f6c20da805b711d69f527e9df8897061f9d6f3ef22d2d0a8f9fd87f96dc3947e","src/ssl/callbacks.rs":"07bacf44efc4977a7ad327bb026786585c78ebd991a0983c15669429f8d5d99b","src/ssl/connector.rs":"32afe0925584b349b3595aaabd0dadbf6ab383b5879c49c68ad2d0fddf0b0e4a","src/ssl/error.rs":"f39ac3e1037a35ae5cccbf5cf5976044614a6368c9ffe3f1b96bead63c0c4231","src/ssl/mod.rs":"e0136846f682344e89c8d5a8debdf0d398912a9e2d8772c094552ed1a96d44f5","src/ssl/test/mod.rs":"0bf87ab47287ce40f1317016beeb54602a9a5836d00e0424072e67bedafa9c35","src/ssl/test/server.rs":"4276ba970a0fac5c9cae21d7df7af36389c377472f3546ce597678ffc6ad5b38","src/stack.rs":"29aa6e467153b951cbf56ab62ac806941b4eb0e1dd22f22d4b1ab562cc037d55","src/string.rs":"8276d719b35cd74ee0efbecce9e58e754d50d8cc96111f2febd3c0d8849847a8","src/symm.rs":"3da30db9c0c67dff2e68a36b1497f542f08ee20f6fe1ca6bc0986bd7c88575ba","src/util.rs":"e6794bf0643d0c29e96325653f2bb4a00221de55bb5b3c6c96d5dbae3debe238","src/version.rs":"e3acbb0db2095ab616870055c7c7a902fb7b1439520574fd20b7c1164b1178b7","src/x509/extension.rs":"26a265248eb0e54c3b106708f8fce7d5fb5b91b7195f17a97e1b8b1d3b6fa119","src/x509/mod.rs":"01ea5ba97459df800d73ac2868be220512957bc3a7268e2bacd1bd8e593110ca","src/x509/store.rs":"0af658e5434daaffa61bab74d765d04e1926186c0038b5a73cfcaf1834556ae8","src/x509/tests.rs":"6cf8c00bb7d21cf41af3428eb085be4985c3570c1aa853c0016aa32e4a44ea84","src/x509/verify.rs":"d7ec7421d0b9fe33755a031154487348beecccc87ef5fd8221dacce79278f48b","test/aia_test_cert.pem":"9eaf52b5d0023f3be7911938d937ed16fc75d43d14dbe41557a800b0a82f4b1b","test/alt_name_cert.pem":"f3cc0a1d21657164918dffab0dac8f1c499fc1cf5717805420a0134b3aee128c","test/authority_key_identifier.pem":"4644b83bbcd36a6e1917d1f7bd3b8ff913bf86cc74917c07dd78b6731b4d5bec","test/ca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/cert.pem":"53c8b338be254490c71a6b13da90dc5a59ba596587c548be5673657e04824afb","test/certs.pem":"106d5d22c86e26c3db619b9525567f22333d22de82e4d2850ed379150c638008","test/certv3.pem":"c230b76b6efb973816d0e3096ae95cdcf4941ec928c01c31b6537d01743fcd8a","test/certv3_extfile":"610fdc10edac2da398a582895e53d288d3e47a9d4f3868c2c7f7662c212b60bd","test/cms.p12":"d33fc5edd6b9caa672e7570b869135235bb2583580a273f6e88c6a6c68fd5a8a","test/cms_pubkey.der":"03682a732e1fd861f5fa687915a8e6f5c935d10273b0f6f73f3db52a8d71fc6d","test/crl-ca.crt":"911360ccdf700fd7d6091bd78c4138da0e9f027ca211f7ed80b394e570eb897c","test/csr.pem":"24423008144c43cf33f56ebcc245931b2d61bcd4eee17b476d7adb6f7416e24d","test/dhparams.pem":"14d9461949d9ae8ca50a393b008ee2168254f14342b0e17b56c0a62d2905b963","test/dsa.pem":"826d513234205fd3dee0bbbf844f0b6fea501145bdf05ea3b14e14df98cbe090","test/dsa.pem.pub":"721677bebf9ab28b8650f98a0cd27658de0c1acd867a4b6e985fe1df95a8bd37","test/dsaparam.pem":"94a1284bdd7d7566151cfde0c7f245e84f7b99ba840f202e3f27ea0160f82988","test/entry_extensions.crl":"bee73d33a326bde92d3c38f275b3f94943e46cf778d7043e1176e84413dc22e9","test/identity.p12":"aceeb3e5516471bd5af9a44bbeffc9559c4f228f67c677d29f36a4b368e2779f","test/intermediate-ca.key":"a5f3d331af87c1305843e235841e494a0669a95d3824a6c766d09371f62c3bab","test/intermediate-ca.pem":"5ff8055325d0cbb60586f4e20bd2df7718e4d94f5261f2ee05ba52a8fb9223f0","test/key.der":"e8842cd6674b5c77a83e0283cd876a91de404561dfc86d79ce525f6e55b28197","test/key.der.pub":"e559d56bb6ec57ad743dbf972bbcaf263a9fa7d320433baa71b04f849d987060","test/key.pem":"12d9105a92bf39b615ccb4820c5c1e38c61905483cd30be13f9ab99b98af64ed","test/key.pem.pub":"f5d030df843ddbaba5bf316ae18f1434de5a63a955be66442429dd4f16f161ef","test/keystore-empty-chain.p12":"bbea280f6fe10556d7470df7072ef0e4ee3997e2c0b3666197f423430c0e6b61","test/leaf.pem":"4f2c3fd02f73b3f49a1e05cf0622669ed014ba019876d89d3f21c788457c1e01","test/nid_test_cert.pem":"7047e8d317e284c6b698eee4a0f1a629d50cd4615ad7da85fe90a2ffb6c21611","test/nid_uid_test_cert.pem":"a735211f3b40edbde7084337138fb0aea06aea6c78369c52015253e4b7a17d83","test/pkcs1.pem.pub":"4d446864b63c4178ec2c7dc8df9b7121d9271851c1f4701231fccb8b07c94918","test/pkcs8-nocrypt.der":"5590d03cc0d037c6c27d78fafc937f48defb226e9a52cde84d54df68086d0575","test/pkcs8.der":"8719fc002d59313fb97e46e068ae40db4d9acc0e2debd308ac9eb46329bea487","test/root-ca.key":"b37cf88614980c38e43c4329cdf7162bae48cc8af1fafd54db2fe0d17e458e1d","test/root-ca.pem":"59b9200c35e818bf21be4aaa97ba87bb6a18fd780527a9f9c51cc74212c631a0","test/rsa-encrypted.pem":"ea41b0f1816056672de6abbab43d0e8089da047c329ceed14aace5a5bde713f1","test/rsa.pem":"f866a5506ea9a37ed2f73f62f503e1aff32f7e4145be62b023535f4da1c24416","test/rsa.pem.pub":"2c5eeea39708e90396f9f09d920f2af8b7e9f84ace963c1319072224dd3d302b","test/subca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/test.crl":"ac8443257214f9e82543871c3df48694ea39f2b16bd6c4ef5998a161edbb8fba"},"package":"15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8"} \ No newline at end of file diff --git a/vendor/openssl/CHANGELOG.md b/vendor/openssl/CHANGELOG.md index d616f57fc..8b34e48ca 100644 --- a/vendor/openssl/CHANGELOG.md +++ b/vendor/openssl/CHANGELOG.md @@ -2,6 +2,42 @@ ## [Unreleased] +## [v0.10.63] - 2024-01-19 + +### Added + +* Added `Pkcs7Ref::{type_,signed}`. +* Added `Pkcs7SignedRef::certificates`. +* Added `Cipher::{aes_256_xts,des_ede3_ecb,des_ede3_cfb8,des_ede3_ofb,camellia128_ofb,camellia192_ofb,camellia256_ofb,cast5_ofb,idea_ofb}` +* Added `PKey::from_dhx` +* Added `PKey::{public_key_from_pem_passphrase,public_key_from_pem_callback}`. + +### Changed + +* `Cipher::aes_128_ofb` is now available on BoringSSL +* `Nid::{BRAINPOOL_P256R1,BRAINPOOL_P320R1,BRAINPOOL_P384R1,BRAINPOOL_P512R1}` are now available on LibreSSL. + +## [v0.10.62] - 2023-12-22 + +### Added + +* Added `Nid::BRAINPOOL_P320R1` +* Added `rand_priv_bytes` + +### Fixed + +* Fixed building on the latest version of BoringSSL + +## [v0.10.61] - 2023-12-04 + +### Changed + +* `SslStream` now uses `SSL_read_ex`, `SSL_write_ex`, and `SSL_peek_ex` when available + +### Added + +* Added `SslStream::{read_uninit, ssl_read_uninit}`. + ## [v0.10.60] - 2023-11-22 ### Deprecated @@ -848,7 +884,10 @@ Look at the [release tags] for information about older releases. -[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...master +[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...master +[v0.10.63]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.62...openssl-v0.10.63 +[v0.10.62]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.61...openssl-v0.10.62 +[v0.10.61]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...openssl-v0.10.61 [v0.10.60]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.59...openssl-v0.10.60 [v0.10.59]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.58...openssl-v0.10.59 [v0.10.58]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.57...openssl-v0.10.58 diff --git a/vendor/openssl/Cargo.lock b/vendor/openssl/Cargo.lock index 8174d63b2..581fa46a1 100644 --- a/vendor/openssl/Cargo.lock +++ b/vendor/openssl/Cargo.lock @@ -3,38 +3,50 @@ version = 3 [[package]] -name = "bindgen" -version = "0.64.0" +name = "annotate-snippets" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" dependencies = [ - "bitflags 1.2.1", + "unicode-width", + "yansi-term", +] + +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "annotate-snippets", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", "lazycell", "log", "peeking_take_while", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn", "which", ] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bssl-sys" @@ -42,17 +54,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312d12393c060384f2e6ed14c7b4be37b3dd90249857485613c1a91b9a1abb5c" -[[package]] -name = "byteorder" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" - [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cexpr" @@ -71,9 +80,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.0.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9da1484c6a890e374ca5086062d4847e0a2c1e5eba9afa5d48c09e8eb39b2519" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -82,110 +91,104 @@ dependencies = [ [[package]] name = "either" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "foreign-types" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21b40436003b2a1e22483c5ed6c3d25e755b6b3120f601cc22aa57e25dc9065" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ "foreign-types-shared", ] [[package]] name = "foreign-types-shared" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa1839fc3c5487b5e129ea4f774e3fd84e6c4607127315521bc014a722ebc9e" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hex" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66c2649564633dd569707d91459ac1d2deefd9fa2a1def6fffc55b4bfee0b1f" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "lazy_static" -version = "1.0.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.0.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.65" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" -version = "0.6.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c979a19ffb457f0273965c333053f3d586bf759bf7b683fbebc37f9a9ebedc4" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ + "cfg-if", "winapi", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.0.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01e64d9017d18e7fc09d8e4fe0e28ff6931019e979fb8019319db7ca827f8a6" -dependencies = [ - "libc", -] +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "minimal-lexical" -version = "0.1.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6595bb28ed34f43c3fe088e48f6cfb2e033cab45f25a5384d5fdf564fbc8c4b2" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "nom" -version = "7.0.0" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "once_cell" -version = "1.5.2" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.63" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.4.1", "cfg-if", "foreign-types", "hex", @@ -203,23 +206,23 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "openssl-src" -version = "300.1.2+3.1.1" +version = "300.1.6+3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94773a6131a4d91f737a31debb0b3258964a47d923ef539c8be1d496dfb5145d" +checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "bindgen", "bssl-sys", @@ -238,74 +241,70 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pkg-config" -version = "0.3.9" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn", +] [[package]] name = "proc-macro2" -version = "1.0.55" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.5.0" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a250501c60d8ee37c3c8cd93d95344a4653ce4999136cc9b3eb4c98770a4aea3" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.24" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00efb87459ba4f6fb2169d20f68565555688e1250ee6825cdf6254f8b48fafb2" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "rustc-hash" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" -dependencies = [ - "byteorder", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "shlex" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -314,38 +313,38 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "vcpkg" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" - -[[package]] -name = "version_check" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45d3d553fd9413fffe7147a20171d640eda0ad4c070acd7d0c885a21bcd2e8b7" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "which" -version = "4.2.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] name = "winapi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -362,3 +361,12 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yansi-term" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1" +dependencies = [ + "winapi", +] diff --git a/vendor/openssl/Cargo.toml b/vendor/openssl/Cargo.toml index 95459cb9a..c57e82e53 100644 --- a/vendor/openssl/Cargo.toml +++ b/vendor/openssl/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "openssl" -version = "0.10.60" +version = "0.10.63" authors = ["Steven Fackler "] description = "OpenSSL bindings" readme = "README.md" @@ -36,7 +36,7 @@ version = "2.2.1" version = "1.0" [dependencies.ffi] -version = "0.9.96" +version = "0.9.99" package = "openssl-sys" [dependencies.foreign-types] diff --git a/vendor/openssl/build.rs b/vendor/openssl/build.rs index 87a9fa06f..7677abc08 100644 --- a/vendor/openssl/build.rs +++ b/vendor/openssl/build.rs @@ -72,6 +72,9 @@ fn main() { if version >= 0x3_08_02_00_0 { println!("cargo:rustc-cfg=libressl382"); } + if version >= 0x3_09_00_00_0 { + println!("cargo:rustc-cfg=libressl390"); + } } if let Ok(vars) = env::var("DEP_OPENSSL_CONF") { diff --git a/vendor/openssl/src/asn1.rs b/vendor/openssl/src/asn1.rs index 801310d41..8618be0e9 100644 --- a/vendor/openssl/src/asn1.rs +++ b/vendor/openssl/src/asn1.rs @@ -166,7 +166,7 @@ impl Asn1Type { /// [`diff`]: struct.Asn1TimeRef.html#method.diff /// [`Asn1TimeRef`]: struct.Asn1TimeRef.html #[derive(Debug, Clone, PartialEq, Eq, Hash)] -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] pub struct TimeDiff { /// Difference in days pub days: c_int, @@ -199,7 +199,7 @@ foreign_type_and_impl_send_sync! { impl Asn1TimeRef { /// Find difference between two times #[corresponds(ASN1_TIME_diff)] - #[cfg(ossl102)] + #[cfg(any(ossl102, boringssl))] pub fn diff(&self, compare: &Self) -> Result { let mut days = 0; let mut secs = 0; @@ -215,7 +215,7 @@ impl Asn1TimeRef { /// Compare two times #[corresponds(ASN1_TIME_compare)] - #[cfg(ossl102)] + #[cfg(any(ossl102, boringssl))] pub fn compare(&self, other: &Self) -> Result { let d = self.diff(other)?; if d.days > 0 || d.secs > 0 { @@ -229,7 +229,7 @@ impl Asn1TimeRef { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialEq for Asn1TimeRef { fn eq(&self, other: &Asn1TimeRef) -> bool { self.diff(other) @@ -238,7 +238,7 @@ impl PartialEq for Asn1TimeRef { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialEq for Asn1TimeRef { fn eq(&self, other: &Asn1Time) -> bool { self.diff(other) @@ -247,7 +247,7 @@ impl PartialEq for Asn1TimeRef { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl<'a> PartialEq for &'a Asn1TimeRef { fn eq(&self, other: &Asn1Time) -> bool { self.diff(other) @@ -256,21 +256,21 @@ impl<'a> PartialEq for &'a Asn1TimeRef { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialOrd for Asn1TimeRef { fn partial_cmp(&self, other: &Asn1TimeRef) -> Option { self.compare(other).ok() } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialOrd for Asn1TimeRef { fn partial_cmp(&self, other: &Asn1Time) -> Option { self.compare(other).ok() } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl<'a> PartialOrd for &'a Asn1TimeRef { fn partial_cmp(&self, other: &Asn1Time) -> Option { self.compare(other).ok() @@ -352,9 +352,9 @@ impl Asn1Time { /// Creates a new time corresponding to the specified X509 time string. /// - /// Requires OpenSSL 1.1.1 or newer. + /// Requires BoringSSL or OpenSSL 1.1.1 or newer. #[corresponds(ASN1_TIME_set_string_X509)] - #[cfg(ossl111)] + #[cfg(any(ossl111, boringssl))] pub fn from_str_x509(s: &str) -> Result { unsafe { let s = CString::new(s).unwrap(); @@ -367,7 +367,7 @@ impl Asn1Time { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialEq for Asn1Time { fn eq(&self, other: &Asn1Time) -> bool { self.diff(other) @@ -376,7 +376,7 @@ impl PartialEq for Asn1Time { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialEq for Asn1Time { fn eq(&self, other: &Asn1TimeRef) -> bool { self.diff(other) @@ -385,7 +385,7 @@ impl PartialEq for Asn1Time { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time { fn eq(&self, other: &&'a Asn1TimeRef) -> bool { self.diff(other) @@ -394,21 +394,21 @@ impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time { } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialOrd for Asn1Time { fn partial_cmp(&self, other: &Asn1Time) -> Option { self.compare(other).ok() } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl PartialOrd for Asn1Time { fn partial_cmp(&self, other: &Asn1TimeRef) -> Option { self.compare(other).ok() } } -#[cfg(ossl102)] +#[cfg(any(ossl102, boringssl))] impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time { fn partial_cmp(&self, other: &&'a Asn1TimeRef) -> Option { self.compare(other).ok() @@ -809,7 +809,7 @@ mod tests { } #[test] - #[cfg(ossl102)] + #[cfg(any(ossl102, boringssl))] fn time_eq() { let a = Asn1Time::from_str("99991231235959Z").unwrap(); let b = Asn1Time::from_str("99991231235959Z").unwrap(); @@ -828,7 +828,7 @@ mod tests { } #[test] - #[cfg(ossl102)] + #[cfg(any(ossl102, boringssl))] fn time_ord() { let a = Asn1Time::from_str("99991231235959Z").unwrap(); let b = Asn1Time::from_str("99991231235959Z").unwrap(); diff --git a/vendor/openssl/src/cipher.rs b/vendor/openssl/src/cipher.rs index b5c82e8f6..c4cb26043 100644 --- a/vendor/openssl/src/cipher.rs +++ b/vendor/openssl/src/cipher.rs @@ -167,6 +167,10 @@ impl Cipher { } #[cfg(not(boringssl))] + pub fn aes_256_xts() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_xts() as *mut _) } + } + pub fn aes_128_ctr() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ctr() as *mut _) } } @@ -195,7 +199,6 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ccm() as *mut _) } } - #[cfg(not(boringssl))] pub fn aes_128_ofb() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ofb() as *mut _) } } @@ -364,15 +367,29 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3() as *mut _) } } + pub fn des_ede3_ecb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ecb() as *mut _) } + } + pub fn des_ede3_cbc() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cbc() as *mut _) } } + #[cfg(not(boringssl))] + pub fn des_ede3_cfb8() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb8() as *mut _) } + } + #[cfg(not(boringssl))] pub fn des_ede3_cfb64() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb64() as *mut _) } } + #[cfg(not(boringssl))] + pub fn des_ede3_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ofb() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_RC4"))] pub fn rc4() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_rc4() as *mut _) } @@ -393,6 +410,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cbc() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia128_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ofb() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] pub fn camellia192_cfb128() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cfb128() as *mut _) } @@ -408,6 +430,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cbc() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia192_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ofb() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] pub fn camellia256_cfb128() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cfb128() as *mut _) } @@ -423,6 +450,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cbc() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia256_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ofb() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAST"))] pub fn cast5_cfb64() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cfb64() as *mut _) } @@ -438,6 +470,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cbc() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAST"))] + pub fn cast5_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ofb() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))] pub fn idea_cfb64() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_idea_cfb64() as *mut _) } @@ -453,6 +490,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))] + pub fn idea_ofb() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_idea_ofb() as *mut _) } + } + #[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))] pub fn chacha20() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) } diff --git a/vendor/openssl/src/cms.rs b/vendor/openssl/src/cms.rs index d11443b5c..a946230a5 100644 --- a/vendor/openssl/src/cms.rs +++ b/vendor/openssl/src/cms.rs @@ -475,14 +475,10 @@ mod test { // check verification result - this is an invalid signature // defined in openssl crypto/cms/cms.h const CMS_R_CERTIFICATE_VERIFY_ERROR: i32 = 100; - match res { - Err(es) => { - let error_array = es.errors(); - assert_eq!(1, error_array.len()); - let code = error_array[0].code(); - assert_eq!(ffi::ERR_GET_REASON(code), CMS_R_CERTIFICATE_VERIFY_ERROR); - } - _ => panic!("expected CMS verification error, got Ok()"), - } + let es = res.unwrap_err(); + let error_array = es.errors(); + assert_eq!(1, error_array.len()); + let code = error_array[0].reason_code(); + assert_eq!(code, CMS_R_CERTIFICATE_VERIFY_ERROR); } } diff --git a/vendor/openssl/src/dh.rs b/vendor/openssl/src/dh.rs index d46b9ee46..c8d135f30 100644 --- a/vendor/openssl/src/dh.rs +++ b/vendor/openssl/src/dh.rs @@ -334,6 +334,8 @@ cfg_if! { mod tests { use crate::bn::BigNum; use crate::dh::Dh; + #[cfg(all(not(boringssl), ossl110))] + use crate::pkey::PKey; use crate::ssl::{SslContext, SslMethod}; #[test] @@ -382,6 +384,23 @@ mod tests { assert_eq!(dh.generator(), &generator); } + #[test] + #[cfg(all(not(boringssl), ossl110))] + fn test_from_dhx_serializes_q() { + let p = BigNum::from_hex_str("00ad107e1e9123a9d0d660faa79559c51fa20d64e5683b9fd1b54b1597b61d0a75e6fa141df95a56dbaf9a3c407ba1df15eb3d688a309c180e1de6b85a1274a0a66d3f8152ad6ac2129037c9edefda4df8d91e8fef55b7394b7ad5b7d0b6c12207c9f98d11ed34dbf6c6ba0b2c8bbc27be6a00e0a0b9c49708b3bf8a317091883681286130bc8985db1602e714415d9330278273c7de31efdc7310f7121fd5a07415987d9adc0a486dcdf93acc44328387315d75e198c641a480cd86a1b9e587e8be60e69cc928b2b9c52172e413042e9b23f10b0e16e79763c9b53dcf4ba80a29e3fb73c16b8e75b97ef363e2ffa31f71cf9de5384e71b81c0ac4dffe0c10e64f").unwrap(); + let g = BigNum::from_hex_str("00ac4032ef4f2d9ae39df30b5c8ffdac506cdebe7b89998caf74866a08cfe4ffe3a6824a4e10b9a6f0dd921f01a70c4afaab739d7700c29f52c57db17c620a8652be5e9001a8d66ad7c17669101999024af4d027275ac1348bb8a762d0521bc98ae247150422ea1ed409939d54da7460cdb5f6c6b250717cbef180eb34118e98d119529a45d6f834566e3025e316a330efbb77a86f0c1ab15b051ae3d428c8f8acb70a8137150b8eeb10e183edd19963ddd9e263e4770589ef6aa21e7f5f2ff381b539cce3409d13cd566afbb48d6c019181e1bcfe94b30269edfe72fe9b6aa4bd7b5a0f1c71cfff4c19c418e1f6ec017981bc087f2a7065b384b890d3191f2bfa").unwrap(); + let q = BigNum::from_hex_str("00801c0d34c58d93fe997177101f80535a4738cebcbf389a99b36371eb") + .unwrap(); + let y = BigNum::from_hex_str("0082c165bb576243ecf46d58c3d1501616955fca0320fa95ea11d2e6c1b9cf217676720dc1c08c85bf20c4d232b60a29a1e51c7b773bc645014587c525c86151b30d75486ec7b6c98efb5f74955b83116d01d0af1232af89213c2de574369d701aba9357300b920d3d8b98252d46c46952c16a5f33554b38317809c7b9add4701f5c158c1b7035e9fe39366ececb90d2896b78c523c4a577287ef5ba7a2663ed58aa20b5ec66e30f316610dfaa38583e495ab6af771c284387e660edbef4edb872e2e80e1d244ee95622e76d028e61c1e887c2aa792717362139f4dd26eafd49b2366eeb2350b01fe1b56022a2809e379559c37b375ba01c4eaacc14fd1b247837").unwrap(); + + let dh = Dh::from_params(p, g, q).unwrap(); + let dh = dh.set_public_key(y).unwrap(); + + // Verify that 'q' is serialized in the public key. + let pkey = PKey::from_dhx(dh).unwrap(); + assert_eq!(pkey.public_key_to_der().unwrap(), b"\x30\x82\x03\x44\x30\x82\x02\x36\x06\x07\x2a\x86\x48\xce\x3e\x02\x01\x30\x82\x02\x29\x02\x82\x01\x01\x00\xad\x10\x7e\x1e\x91\x23\xa9\xd0\xd6\x60\xfa\xa7\x95\x59\xc5\x1f\xa2\x0d\x64\xe5\x68\x3b\x9f\xd1\xb5\x4b\x15\x97\xb6\x1d\x0a\x75\xe6\xfa\x14\x1d\xf9\x5a\x56\xdb\xaf\x9a\x3c\x40\x7b\xa1\xdf\x15\xeb\x3d\x68\x8a\x30\x9c\x18\x0e\x1d\xe6\xb8\x5a\x12\x74\xa0\xa6\x6d\x3f\x81\x52\xad\x6a\xc2\x12\x90\x37\xc9\xed\xef\xda\x4d\xf8\xd9\x1e\x8f\xef\x55\xb7\x39\x4b\x7a\xd5\xb7\xd0\xb6\xc1\x22\x07\xc9\xf9\x8d\x11\xed\x34\xdb\xf6\xc6\xba\x0b\x2c\x8b\xbc\x27\xbe\x6a\x00\xe0\xa0\xb9\xc4\x97\x08\xb3\xbf\x8a\x31\x70\x91\x88\x36\x81\x28\x61\x30\xbc\x89\x85\xdb\x16\x02\xe7\x14\x41\x5d\x93\x30\x27\x82\x73\xc7\xde\x31\xef\xdc\x73\x10\xf7\x12\x1f\xd5\xa0\x74\x15\x98\x7d\x9a\xdc\x0a\x48\x6d\xcd\xf9\x3a\xcc\x44\x32\x83\x87\x31\x5d\x75\xe1\x98\xc6\x41\xa4\x80\xcd\x86\xa1\xb9\xe5\x87\xe8\xbe\x60\xe6\x9c\xc9\x28\xb2\xb9\xc5\x21\x72\xe4\x13\x04\x2e\x9b\x23\xf1\x0b\x0e\x16\xe7\x97\x63\xc9\xb5\x3d\xcf\x4b\xa8\x0a\x29\xe3\xfb\x73\xc1\x6b\x8e\x75\xb9\x7e\xf3\x63\xe2\xff\xa3\x1f\x71\xcf\x9d\xe5\x38\x4e\x71\xb8\x1c\x0a\xc4\xdf\xfe\x0c\x10\xe6\x4f\x02\x82\x01\x01\x00\xac\x40\x32\xef\x4f\x2d\x9a\xe3\x9d\xf3\x0b\x5c\x8f\xfd\xac\x50\x6c\xde\xbe\x7b\x89\x99\x8c\xaf\x74\x86\x6a\x08\xcf\xe4\xff\xe3\xa6\x82\x4a\x4e\x10\xb9\xa6\xf0\xdd\x92\x1f\x01\xa7\x0c\x4a\xfa\xab\x73\x9d\x77\x00\xc2\x9f\x52\xc5\x7d\xb1\x7c\x62\x0a\x86\x52\xbe\x5e\x90\x01\xa8\xd6\x6a\xd7\xc1\x76\x69\x10\x19\x99\x02\x4a\xf4\xd0\x27\x27\x5a\xc1\x34\x8b\xb8\xa7\x62\xd0\x52\x1b\xc9\x8a\xe2\x47\x15\x04\x22\xea\x1e\xd4\x09\x93\x9d\x54\xda\x74\x60\xcd\xb5\xf6\xc6\xb2\x50\x71\x7c\xbe\xf1\x80\xeb\x34\x11\x8e\x98\xd1\x19\x52\x9a\x45\xd6\xf8\x34\x56\x6e\x30\x25\xe3\x16\xa3\x30\xef\xbb\x77\xa8\x6f\x0c\x1a\xb1\x5b\x05\x1a\xe3\xd4\x28\xc8\xf8\xac\xb7\x0a\x81\x37\x15\x0b\x8e\xeb\x10\xe1\x83\xed\xd1\x99\x63\xdd\xd9\xe2\x63\xe4\x77\x05\x89\xef\x6a\xa2\x1e\x7f\x5f\x2f\xf3\x81\xb5\x39\xcc\xe3\x40\x9d\x13\xcd\x56\x6a\xfb\xb4\x8d\x6c\x01\x91\x81\xe1\xbc\xfe\x94\xb3\x02\x69\xed\xfe\x72\xfe\x9b\x6a\xa4\xbd\x7b\x5a\x0f\x1c\x71\xcf\xff\x4c\x19\xc4\x18\xe1\xf6\xec\x01\x79\x81\xbc\x08\x7f\x2a\x70\x65\xb3\x84\xb8\x90\xd3\x19\x1f\x2b\xfa\x02\x1d\x00\x80\x1c\x0d\x34\xc5\x8d\x93\xfe\x99\x71\x77\x10\x1f\x80\x53\x5a\x47\x38\xce\xbc\xbf\x38\x9a\x99\xb3\x63\x71\xeb\x03\x82\x01\x06\x00\x02\x82\x01\x01\x00\x82\xc1\x65\xbb\x57\x62\x43\xec\xf4\x6d\x58\xc3\xd1\x50\x16\x16\x95\x5f\xca\x03\x20\xfa\x95\xea\x11\xd2\xe6\xc1\xb9\xcf\x21\x76\x76\x72\x0d\xc1\xc0\x8c\x85\xbf\x20\xc4\xd2\x32\xb6\x0a\x29\xa1\xe5\x1c\x7b\x77\x3b\xc6\x45\x01\x45\x87\xc5\x25\xc8\x61\x51\xb3\x0d\x75\x48\x6e\xc7\xb6\xc9\x8e\xfb\x5f\x74\x95\x5b\x83\x11\x6d\x01\xd0\xaf\x12\x32\xaf\x89\x21\x3c\x2d\xe5\x74\x36\x9d\x70\x1a\xba\x93\x57\x30\x0b\x92\x0d\x3d\x8b\x98\x25\x2d\x46\xc4\x69\x52\xc1\x6a\x5f\x33\x55\x4b\x38\x31\x78\x09\xc7\xb9\xad\xd4\x70\x1f\x5c\x15\x8c\x1b\x70\x35\xe9\xfe\x39\x36\x6e\xce\xcb\x90\xd2\x89\x6b\x78\xc5\x23\xc4\xa5\x77\x28\x7e\xf5\xba\x7a\x26\x63\xed\x58\xaa\x20\xb5\xec\x66\xe3\x0f\x31\x66\x10\xdf\xaa\x38\x58\x3e\x49\x5a\xb6\xaf\x77\x1c\x28\x43\x87\xe6\x60\xed\xbe\xf4\xed\xb8\x72\xe2\xe8\x0e\x1d\x24\x4e\xe9\x56\x22\xe7\x6d\x02\x8e\x61\xc1\xe8\x87\xc2\xaa\x79\x27\x17\x36\x21\x39\xf4\xdd\x26\xea\xfd\x49\xb2\x36\x6e\xeb\x23\x50\xb0\x1f\xe1\xb5\x60\x22\xa2\x80\x9e\x37\x95\x59\xc3\x7b\x37\x5b\xa0\x1c\x4e\xaa\xcc\x14\xfd\x1b\x24\x78\x37"); + } + #[test] #[cfg(ossl102)] fn test_dh_stored_restored() { diff --git a/vendor/openssl/src/lib.rs b/vendor/openssl/src/lib.rs index 5c9ccf7a0..a73dbea4c 100644 --- a/vendor/openssl/src/lib.rs +++ b/vendor/openssl/src/lib.rs @@ -48,6 +48,9 @@ //! //! # Alpine Linux //! $ apk add pkgconfig openssl-dev +//! +//! # openSUSE +//! $ sudo zypper in libopenssl-devel //! ``` //! //! ## Manual @@ -205,6 +208,15 @@ fn cvt_p(r: *mut T) -> Result<*mut T, ErrorStack> { } } +#[inline] +fn cvt_p_const(r: *const T) -> Result<*const T, ErrorStack> { + if r.is_null() { + Err(ErrorStack::get()) + } else { + Ok(r) + } +} + #[inline] fn cvt(r: c_int) -> Result { if r <= 0 { diff --git a/vendor/openssl/src/nid.rs b/vendor/openssl/src/nid.rs index a5bd93ca4..e50feb068 100644 --- a/vendor/openssl/src/nid.rs +++ b/vendor/openssl/src/nid.rs @@ -215,11 +215,13 @@ impl Nid { pub const SECT409R1: Nid = Nid(ffi::NID_sect409r1); pub const SECT571K1: Nid = Nid(ffi::NID_sect571k1); pub const SECT571R1: Nid = Nid(ffi::NID_sect571r1); - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl))] pub const BRAINPOOL_P256R1: Nid = Nid(ffi::NID_brainpoolP256r1); - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl))] + pub const BRAINPOOL_P320R1: Nid = Nid(ffi::NID_brainpoolP320r1); + #[cfg(any(ossl110, libressl))] pub const BRAINPOOL_P384R1: Nid = Nid(ffi::NID_brainpoolP384r1); - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl))] pub const BRAINPOOL_P512R1: Nid = Nid(ffi::NID_brainpoolP512r1); pub const WAP_WSG_IDM_ECID_WTLS1: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls1); pub const WAP_WSG_IDM_ECID_WTLS3: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls3); diff --git a/vendor/openssl/src/pkcs7.rs b/vendor/openssl/src/pkcs7.rs index a272c598b..65a6e7318 100644 --- a/vendor/openssl/src/pkcs7.rs +++ b/vendor/openssl/src/pkcs7.rs @@ -4,16 +4,31 @@ use libc::c_int; use std::mem; use std::ptr; +use crate::asn1::Asn1ObjectRef; use crate::bio::{MemBio, MemBioSlice}; use crate::error::ErrorStack; +use crate::nid::Nid; use crate::pkey::{HasPrivate, PKeyRef}; -use crate::stack::{Stack, StackRef}; +use crate::stack::{Stack, StackRef, Stackable}; use crate::symm::Cipher; +use crate::util::ForeignTypeRefExt; use crate::x509::store::X509StoreRef; use crate::x509::{X509Ref, X509}; use crate::{cvt, cvt_p}; use openssl_macros::corresponds; +foreign_type_and_impl_send_sync! { + type CType = ffi::PKCS7_SIGNER_INFO; + fn drop = ffi::PKCS7_SIGNER_INFO_free; + + pub struct Pkcs7SignerInfo; + pub struct Pkcs7SignerInfoRef; +} + +impl Stackable for Pkcs7SignerInfo { + type StackType = ffi::stack_st_PKCS7_SIGNER_INFO; +} + foreign_type_and_impl_send_sync! { type CType = ffi::PKCS7; fn drop = ffi::PKCS7_free; @@ -27,6 +42,19 @@ foreign_type_and_impl_send_sync! { pub struct Pkcs7Ref; } +foreign_type_and_impl_send_sync! { + type CType = ffi::PKCS7_SIGNED; + fn drop = ffi::PKCS7_SIGNED_free; + + /// A PKCS#7 signed data structure. + /// + /// Contains signed data. + pub struct Pkcs7Signed; + + /// Reference to `Pkcs7Signed` + pub struct Pkcs7SignedRef; +} + bitflags! { #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[repr(transparent)] @@ -281,11 +309,43 @@ impl Pkcs7Ref { Ok(stack) } } + + /// Return the type of a PKCS#7 structure as an Asn1Object + pub fn type_(&self) -> Option<&Asn1ObjectRef> { + unsafe { + let ptr = (*self.as_ptr()).type_; + Asn1ObjectRef::from_const_ptr_opt(ptr) + } + } + + /// Get the signed data of a PKCS#7 structure of type PKCS7_SIGNED + pub fn signed(&self) -> Option<&Pkcs7SignedRef> { + unsafe { + if self.type_().map(|x| x.nid()) != Some(Nid::PKCS7_SIGNED) { + return None; + } + let signed_data = (*self.as_ptr()).d.sign; + Pkcs7SignedRef::from_const_ptr_opt(signed_data) + } + } +} + +impl Pkcs7SignedRef { + /// Get the stack of certificates from the PKCS7_SIGNED object + pub fn certificates(&self) -> Option<&StackRef> { + unsafe { + self.as_ptr() + .as_ref() + .and_then(|x| x.cert.as_mut()) + .and_then(|x| StackRef::::from_const_ptr_opt(x)) + } + } } #[cfg(test)] mod tests { use crate::hash::MessageDigest; + use crate::nid::Nid; use crate::pkcs7::{Pkcs7, Pkcs7Flags}; use crate::pkey::PKey; use crate::stack::Stack; @@ -307,6 +367,10 @@ mod tests { let pkcs7 = Pkcs7::encrypt(&certs, message.as_bytes(), cipher, flags).expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_ENVELOPED + ); let encrypted = pkcs7 .to_smime(message.as_bytes(), flags) @@ -340,6 +404,10 @@ mod tests { let pkcs7 = Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_SIGNED + ); let signed = pkcs7 .to_smime(message.as_bytes(), flags) @@ -384,6 +452,10 @@ mod tests { let pkcs7 = Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_SIGNED + ); let signed = pkcs7 .to_smime(message.as_bytes(), flags) @@ -421,6 +493,10 @@ mod tests { let pkcs7 = Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_SIGNED + ); let signed = pkcs7 .to_smime(message.as_bytes(), flags) @@ -445,4 +521,53 @@ mod tests { assert!(result.is_err()); } + + #[test] + fn signed_data_certificates() { + let cert = include_bytes!("../test/cert.pem"); + let cert = X509::from_pem(cert).unwrap(); + let mut extra_certs = Stack::::new().unwrap(); + for cert in + X509::stack_from_pem(include_bytes!("../test/certs.pem")).expect("should succeed") + { + extra_certs.push(cert).expect("should succeed"); + } + + let message = "foo"; + let flags = Pkcs7Flags::STREAM; + let pkey = include_bytes!("../test/key.pem"); + let pkey = PKey::private_key_from_pem(pkey).unwrap(); + + let pkcs7 = Pkcs7::sign(&cert, &pkey, &extra_certs, message.as_bytes(), flags) + .expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_SIGNED + ); + let signed_data_certs = pkcs7.signed().and_then(|x| x.certificates()); + assert_eq!(signed_data_certs.expect("should succeed").len(), 3); + } + + #[test] + fn signed_data_certificates_no_signed_data() { + let cert = include_bytes!("../test/certs.pem"); + let cert = X509::from_pem(cert).unwrap(); + let mut certs = Stack::new().unwrap(); + certs.push(cert).unwrap(); + let message: String = String::from("foo"); + let cipher = Cipher::des_ede3_cbc(); + let flags = Pkcs7Flags::STREAM; + + // Use `Pkcs7::encrypt` since it populates the PKCS7_ENVELOPE struct rather than + // PKCS7_SIGNED + let pkcs7 = + Pkcs7::encrypt(&certs, message.as_bytes(), cipher, flags).expect("should succeed"); + assert_eq!( + pkcs7.type_().expect("PKCS7 should have a type").nid(), + Nid::PKCS7_ENVELOPED + ); + + let signed_data_certs = pkcs7.signed().and_then(|x| x.certificates()); + assert!(signed_data_certs.is_none()) + } } diff --git a/vendor/openssl/src/pkey.rs b/vendor/openssl/src/pkey.rs index 8f0b5bdf7..7892e65cb 100644 --- a/vendor/openssl/src/pkey.rs +++ b/vendor/openssl/src/pkey.rs @@ -443,6 +443,22 @@ impl PKey { } } + /// Creates a new `PKey` containing a Diffie-Hellman key with type DHX. + #[cfg(all(not(boringssl), ossl110))] + pub fn from_dhx(dh: Dh) -> Result, ErrorStack> { + unsafe { + let evp = cvt_p(ffi::EVP_PKEY_new())?; + let pkey = PKey::from_ptr(evp); + cvt(ffi::EVP_PKEY_assign( + pkey.0, + ffi::EVP_PKEY_DHX, + dh.as_ptr().cast(), + ))?; + mem::forget(dh); + Ok(pkey) + } + } + /// Creates a new `PKey` containing an elliptic curve key. #[corresponds(EVP_PKEY_assign_EC_KEY)] pub fn from_ec_key(ec_key: EcKey) -> Result, ErrorStack> { @@ -747,12 +763,22 @@ impl PKey { } impl PKey { - from_pem! { + private_key_from_pem! { /// Decodes a PEM-encoded SubjectPublicKeyInfo structure. /// /// The input should have a header of `-----BEGIN PUBLIC KEY-----`. #[corresponds(PEM_read_bio_PUBKEY)] public_key_from_pem, + + /// Decodes a PEM-encoded SubjectPublicKeyInfo structure. + #[corresponds(PEM_read_bio_PUBKEY)] + public_key_from_pem_passphrase, + + /// Decodes a PEM-encoded SubjectPublicKeyInfo structure. + /// + /// The callback should fill the password into the provided buffer and return its length. + #[corresponds(PEM_read_bio_PrivateKey)] + public_key_from_pem_callback, PKey, ffi::PEM_read_bio_PUBKEY } diff --git a/vendor/openssl/src/provider.rs b/vendor/openssl/src/provider.rs index 147fadfdb..01b5820af 100644 --- a/vendor/openssl/src/provider.rs +++ b/vendor/openssl/src/provider.rs @@ -55,6 +55,10 @@ impl Provider { retain_fallbacks as _, ))?; + // OSSL_PROVIDER_try_load seems to leave errors on the stack, even + // when it succeeds. + let _ = ErrorStack::get(); + Ok(Provider::from_ptr(p)) } } diff --git a/vendor/openssl/src/rand.rs b/vendor/openssl/src/rand.rs index 8317951f8..ef0f7685c 100644 --- a/vendor/openssl/src/rand.rs +++ b/vendor/openssl/src/rand.rs @@ -37,6 +37,31 @@ pub fn rand_bytes(buf: &mut [u8]) -> Result<(), ErrorStack> { } } +/// Fill buffer with cryptographically strong pseudo-random bytes. It is +/// intended to be used for generating values that should remain private. +/// +/// # Examples +/// +/// To generate a buffer with cryptographically strong random bytes: +/// +/// ``` +/// use openssl::rand::rand_priv_bytes; +/// +/// let mut buf = [0; 256]; +/// rand_priv_bytes(&mut buf).unwrap(); +/// ``` +/// +/// Requires OpenSSL 1.1.1 or newer. +#[corresponds(RAND_priv_bytes)] +#[cfg(ossl111)] +pub fn rand_priv_bytes(buf: &mut [u8]) -> Result<(), ErrorStack> { + unsafe { + ffi::init(); + assert!(buf.len() <= c_int::max_value() as usize); + cvt(ffi::RAND_priv_bytes(buf.as_mut_ptr(), buf.len() as LenType)).map(|_| ()) + } +} + /// Controls random device file descriptor behavior. /// /// Requires OpenSSL 1.1.1 or newer. @@ -50,11 +75,16 @@ pub fn keep_random_devices_open(keep: bool) { #[cfg(test)] mod tests { - use super::rand_bytes; - #[test] fn test_rand_bytes() { let mut buf = [0; 32]; - rand_bytes(&mut buf).unwrap(); + super::rand_bytes(&mut buf).unwrap(); + } + + #[test] + #[cfg(ossl111)] + fn test_rand_priv_bytes() { + let mut buf = [0; 32]; + super::rand_priv_bytes(&mut buf).unwrap(); } } diff --git a/vendor/openssl/src/ssl/mod.rs b/vendor/openssl/src/ssl/mod.rs index fb38bb3e4..30fd23665 100644 --- a/vendor/openssl/src/ssl/mod.rs +++ b/vendor/openssl/src/ssl/mod.rs @@ -90,14 +90,13 @@ use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_void}; use once_cell::sync::{Lazy, OnceCell}; use openssl_macros::corresponds; use std::any::TypeId; -use std::cmp; use std::collections::HashMap; use std::ffi::{CStr, CString}; use std::fmt; use std::io; use std::io::prelude::*; use std::marker::PhantomData; -use std::mem::{self, ManuallyDrop}; +use std::mem::{self, ManuallyDrop, MaybeUninit}; use std::ops::{Deref, DerefMut}; use std::panic::resume_unwind; use std::path::Path; @@ -655,8 +654,8 @@ impl SslVersion { /// TLSv1.3 /// - /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer. - #[cfg(any(ossl111, libressl340))] + /// Requires BoringSSL or OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer. + #[cfg(any(ossl111, libressl340, boringssl))] pub const TLS1_3: SslVersion = SslVersion(ffi::TLS1_3_VERSION); /// DTLSv1.0 @@ -667,7 +666,7 @@ impl SslVersion { /// DTLSv1.2 /// /// DTLS 1.2 corresponds to TLS 1.2 to harmonize versions. There was never a DTLS 1.1. - #[cfg(any(ossl102, libressl332))] + #[cfg(any(ossl102, libressl332, boringssl))] pub const DTLS1_2: SslVersion = SslVersion(ffi::DTLS1_2_VERSION); } @@ -1148,9 +1147,9 @@ impl SslContextBuilder { /// A value of `None` will enable protocol versions down to the lowest version supported by /// OpenSSL. /// - /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer. #[corresponds(SSL_CTX_set_min_proto_version)] - #[cfg(any(ossl110, libressl261))] + #[cfg(any(ossl110, libressl261, boringssl))] pub fn set_min_proto_version(&mut self, version: Option) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_CTX_set_min_proto_version( @@ -1166,9 +1165,9 @@ impl SslContextBuilder { /// A value of `None` will enable protocol versions up to the highest version supported by /// OpenSSL. /// - /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer. #[corresponds(SSL_CTX_set_max_proto_version)] - #[cfg(any(ossl110, libressl261))] + #[cfg(any(ossl110, libressl261, boringssl))] pub fn set_max_proto_version(&mut self, version: Option) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_CTX_set_max_proto_version( @@ -1224,16 +1223,16 @@ impl SslContextBuilder { /// and `http/1.1` is encoded as `b"\x06spdy/1\x08http/1.1"`. The protocols are ordered by /// preference. /// - /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. #[corresponds(SSL_CTX_set_alpn_protos)] - #[cfg(any(ossl102, libressl261))] + #[cfg(any(ossl102, libressl261, boringssl))] pub fn set_alpn_protos(&mut self, protocols: &[u8]) -> Result<(), ErrorStack> { unsafe { assert!(protocols.len() <= c_uint::max_value() as usize); let r = ffi::SSL_CTX_set_alpn_protos( self.as_ptr(), protocols.as_ptr(), - protocols.len() as c_uint, + protocols.len() as _, ); // fun fact, SSL_CTX_set_alpn_protos has a reversed return code D: if r == 0 { @@ -2367,21 +2366,6 @@ impl SslRef { unsafe { ffi::SSL_get_rbio(self.as_ptr()) } } - fn read(&mut self, buf: &mut [u8]) -> c_int { - let len = cmp::min(c_int::max_value() as usize, buf.len()) as c_int; - unsafe { ffi::SSL_read(self.as_ptr(), buf.as_ptr() as *mut c_void, len) } - } - - fn peek(&mut self, buf: &mut [u8]) -> c_int { - let len = cmp::min(c_int::max_value() as usize, buf.len()) as c_int; - unsafe { ffi::SSL_peek(self.as_ptr(), buf.as_ptr() as *mut c_void, len) } - } - - fn write(&mut self, buf: &[u8]) -> c_int { - let len = cmp::min(c_int::max_value() as usize, buf.len()) as c_int; - unsafe { ffi::SSL_write(self.as_ptr(), buf.as_ptr() as *const c_void, len) } - } - fn get_error(&self, ret: c_int) -> ErrorCode { unsafe { ErrorCode::from_raw(ffi::SSL_get_error(self.as_ptr(), ret)) } } @@ -2496,19 +2480,16 @@ impl SslRef { /// Like [`SslContextBuilder::set_alpn_protos`]. /// - /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. /// /// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos #[corresponds(SSL_set_alpn_protos)] - #[cfg(any(ossl102, libressl261))] + #[cfg(any(ossl102, libressl261, boringssl))] pub fn set_alpn_protos(&mut self, protocols: &[u8]) -> Result<(), ErrorStack> { unsafe { assert!(protocols.len() <= c_uint::max_value() as usize); - let r = ffi::SSL_set_alpn_protos( - self.as_ptr(), - protocols.as_ptr(), - protocols.len() as c_uint, - ); + let r = + ffi::SSL_set_alpn_protos(self.as_ptr(), protocols.as_ptr(), protocols.len() as _); // fun fact, SSL_set_alpn_protos has a reversed return code D: if r == 0 { Ok(()) @@ -2655,9 +2636,9 @@ impl SslRef { /// The protocol's name is returned is an opaque sequence of bytes. It is up to the client /// to interpret it. /// - /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer. #[corresponds(SSL_get0_alpn_selected)] - #[cfg(any(ossl102, libressl261))] + #[cfg(any(ossl102, libressl261, boringssl))] pub fn selected_alpn_protocol(&self) -> Option<&[u8]> { unsafe { let mut data: *const c_uchar = ptr::null(); @@ -3350,9 +3331,9 @@ impl SslRef { /// A value of `None` will enable protocol versions down to the lowest version supported by /// OpenSSL. /// - /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer. #[corresponds(SSL_set_min_proto_version)] - #[cfg(any(ossl110, libressl261))] + #[cfg(any(ossl110, libressl261, boringssl))] pub fn set_min_proto_version(&mut self, version: Option) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_set_min_proto_version( @@ -3368,9 +3349,9 @@ impl SslRef { /// A value of `None` will enable protocol versions up to the highest version supported by /// OpenSSL. /// - /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer. + /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer. #[corresponds(SSL_set_max_proto_version)] - #[cfg(any(ossl110, libressl261))] + #[cfg(any(ossl110, libressl261, boringssl))] pub fn set_max_proto_version(&mut self, version: Option) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_set_max_proto_version( @@ -3750,26 +3731,86 @@ impl SslStream { } } + /// Like `read`, but takes a possibly-uninitialized slice. + /// + /// # Safety + /// + /// No portion of `buf` will be de-initialized by this method. If the method returns `Ok(n)`, + /// then the first `n` bytes of `buf` are guaranteed to be initialized. + #[corresponds(SSL_read_ex)] + pub fn read_uninit(&mut self, buf: &mut [MaybeUninit]) -> io::Result { + loop { + match self.ssl_read_uninit(buf) { + Ok(n) => return Ok(n), + Err(ref e) if e.code() == ErrorCode::ZERO_RETURN => return Ok(0), + Err(ref e) if e.code() == ErrorCode::SYSCALL && e.io_error().is_none() => { + return Ok(0); + } + Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {} + Err(e) => { + return Err(e + .into_io_error() + .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e))); + } + } + } + } + /// Like `read`, but returns an `ssl::Error` rather than an `io::Error`. /// /// It is particularly useful with a non-blocking socket, where the error value will identify if /// OpenSSL is waiting on read or write readiness. - #[corresponds(SSL_read)] + #[corresponds(SSL_read_ex)] pub fn ssl_read(&mut self, buf: &mut [u8]) -> Result { - // The interpretation of the return code here is a little odd with a - // zero-length write. OpenSSL will likely correctly report back to us - // that it read zero bytes, but zero is also the sentinel for "error". - // To avoid that confusion short-circuit that logic and return quickly - // if `buf` has a length of zero. - if buf.is_empty() { - return Ok(0); + // SAFETY: `ssl_read_uninit` does not de-initialize the buffer. + unsafe { + self.ssl_read_uninit(slice::from_raw_parts_mut( + buf.as_mut_ptr().cast::>(), + buf.len(), + )) } + } - let ret = self.ssl.read(buf); - if ret > 0 { - Ok(ret as usize) - } else { - Err(self.make_error(ret)) + /// Like `read_ssl`, but takes a possibly-uninitialized slice. + /// + /// # Safety + /// + /// No portion of `buf` will be de-initialized by this method. If the method returns `Ok(n)`, + /// then the first `n` bytes of `buf` are guaranteed to be initialized. + #[corresponds(SSL_read_ex)] + pub fn ssl_read_uninit(&mut self, buf: &mut [MaybeUninit]) -> Result { + cfg_if! { + if #[cfg(any(ossl111, libressl350))] { + let mut readbytes = 0; + let ret = unsafe { + ffi::SSL_read_ex( + self.ssl().as_ptr(), + buf.as_mut_ptr().cast(), + buf.len(), + &mut readbytes, + ) + }; + + if ret > 0 { + Ok(readbytes) + } else { + Err(self.make_error(ret)) + } + } else { + if buf.is_empty() { + return Ok(0); + } + + let len = usize::min(c_int::max_value() as usize, buf.len()) as c_int; + let ret = unsafe { + ffi::SSL_read(self.ssl().as_ptr(), buf.as_mut_ptr().cast(), len) + }; + if ret > 0 { + Ok(ret as usize) + } else { + Err(self.make_error(ret)) + } + } } } @@ -3777,34 +3818,78 @@ impl SslStream { /// /// It is particularly useful with a non-blocking socket, where the error value will identify if /// OpenSSL is waiting on read or write readiness. - #[corresponds(SSL_write)] + #[corresponds(SSL_write_ex)] pub fn ssl_write(&mut self, buf: &[u8]) -> Result { - // See above for why we short-circuit on zero-length buffers - if buf.is_empty() { - return Ok(0); - } + cfg_if! { + if #[cfg(any(ossl111, libressl350))] { + let mut written = 0; + let ret = unsafe { + ffi::SSL_write_ex( + self.ssl().as_ptr(), + buf.as_ptr().cast(), + buf.len(), + &mut written, + ) + }; - let ret = self.ssl.write(buf); - if ret > 0 { - Ok(ret as usize) - } else { - Err(self.make_error(ret)) + if ret > 0 { + Ok(written) + } else { + Err(self.make_error(ret)) + } + } else { + if buf.is_empty() { + return Ok(0); + } + + let len = usize::min(c_int::max_value() as usize, buf.len()) as c_int; + let ret = unsafe { + ffi::SSL_write(self.ssl().as_ptr(), buf.as_ptr().cast(), len) + }; + if ret > 0 { + Ok(ret as usize) + } else { + Err(self.make_error(ret)) + } + } } } /// Reads data from the stream, without removing it from the queue. - #[corresponds(SSL_peek)] + #[corresponds(SSL_peek_ex)] pub fn ssl_peek(&mut self, buf: &mut [u8]) -> Result { - // See above for why we short-circuit on zero-length buffers - if buf.is_empty() { - return Ok(0); - } + cfg_if! { + if #[cfg(any(ossl111, libressl350))] { + let mut readbytes = 0; + let ret = unsafe { + ffi::SSL_peek_ex( + self.ssl().as_ptr(), + buf.as_mut_ptr().cast(), + buf.len(), + &mut readbytes, + ) + }; - let ret = self.ssl.peek(buf); - if ret > 0 { - Ok(ret as usize) - } else { - Err(self.make_error(ret)) + if ret > 0 { + Ok(readbytes) + } else { + Err(self.make_error(ret)) + } + } else { + if buf.is_empty() { + return Ok(0); + } + + let len = usize::min(c_int::max_value() as usize, buf.len()) as c_int; + let ret = unsafe { + ffi::SSL_peek(self.ssl().as_ptr(), buf.as_mut_ptr().cast(), len) + }; + if ret > 0 { + Ok(ret as usize) + } else { + Err(self.make_error(ret)) + } + } } } @@ -3910,20 +3995,12 @@ impl SslStream { impl Read for SslStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { - loop { - match self.ssl_read(buf) { - Ok(n) => return Ok(n), - Err(ref e) if e.code() == ErrorCode::ZERO_RETURN => return Ok(0), - Err(ref e) if e.code() == ErrorCode::SYSCALL && e.io_error().is_none() => { - return Ok(0); - } - Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {} - Err(e) => { - return Err(e - .into_io_error() - .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e))); - } - } + // SAFETY: `read_uninit` does not de-initialize the buffer + unsafe { + self.read_uninit(slice::from_raw_parts_mut( + buf.as_mut_ptr().cast::>(), + buf.len(), + )) } } } diff --git a/vendor/openssl/src/ssl/test/mod.rs b/vendor/openssl/src/ssl/test/mod.rs index 412c4a5dc..a98bc5644 100644 --- a/vendor/openssl/src/ssl/test/mod.rs +++ b/vendor/openssl/src/ssl/test/mod.rs @@ -552,7 +552,7 @@ fn test_alpn_server_select_none() { } #[test] -#[cfg(any(ossl102, libressl261))] +#[cfg(any(boringssl, ossl102, libressl261))] fn test_alpn_server_unilateral() { let server = Server::builder().build(); diff --git a/vendor/openssl/src/x509/mod.rs b/vendor/openssl/src/x509/mod.rs index 97242ff4d..cf3e3c76f 100644 --- a/vendor/openssl/src/x509/mod.rs +++ b/vendor/openssl/src/x509/mod.rs @@ -38,7 +38,7 @@ use crate::ssl::SslRef; use crate::stack::{Stack, StackRef, Stackable}; use crate::string::OpensslString; use crate::util::{ForeignTypeExt, ForeignTypeRefExt}; -use crate::{cvt, cvt_n, cvt_p}; +use crate::{cvt, cvt_n, cvt_p, cvt_p_const}; use openssl_macros::corresponds; #[cfg(any(ossl102, libressl261))] @@ -383,11 +383,6 @@ foreign_type_and_impl_send_sync! { pub struct X509Ref; } -#[cfg(boringssl)] -type X509LenTy = c_uint; -#[cfg(not(boringssl))] -type X509LenTy = c_int; - impl X509Ref { /// Returns this certificate's subject name. #[corresponds(X509_get_subject_name)] @@ -485,7 +480,7 @@ impl X509Ref { /// Retrieves the path length extension from a certificate, if it exists. #[corresponds(X509_get_pathlen)] - #[cfg(ossl110)] + #[cfg(any(ossl110, boringssl))] pub fn pathlen(&self) -> Option { let v = unsafe { ffi::X509_get_pathlen(self.as_ptr()) }; u32::try_from(v).ok() @@ -493,7 +488,7 @@ impl X509Ref { /// Returns this certificate's subject key id, if it exists. #[corresponds(X509_get0_subject_key_id)] - #[cfg(ossl110)] + #[cfg(any(ossl110, boringssl))] pub fn subject_key_id(&self) -> Option<&Asn1OctetStringRef> { unsafe { let data = ffi::X509_get0_subject_key_id(self.as_ptr()); @@ -503,7 +498,7 @@ impl X509Ref { /// Returns this certificate's authority key id, if it exists. #[corresponds(X509_get0_authority_key_id)] - #[cfg(ossl110)] + #[cfg(any(ossl110, boringssl))] pub fn authority_key_id(&self) -> Option<&Asn1OctetStringRef> { unsafe { let data = ffi::X509_get0_authority_key_id(self.as_ptr()); @@ -760,15 +755,17 @@ impl X509 { let r = ffi::PEM_read_bio_X509(bio.as_ptr(), ptr::null_mut(), None, ptr::null_mut()); if r.is_null() { - let err = ffi::ERR_peek_last_error(); - if ffi::ERR_GET_LIB(err) as X509LenTy == ffi::ERR_LIB_PEM - && ffi::ERR_GET_REASON(err) == ffi::PEM_R_NO_START_LINE - { - ffi::ERR_clear_error(); - break; + let e = ErrorStack::get(); + + if let Some(err) = e.errors().last() { + if err.library_code() == ffi::ERR_LIB_PEM as libc::c_int + && err.reason_code() == ffi::PEM_R_NO_START_LINE as libc::c_int + { + break; + } } - return Err(ErrorStack::get()); + return Err(e); } else { certs.push(X509(r)); } @@ -1022,6 +1019,7 @@ impl X509Extension { /// # Safety /// /// This method modifies global state without locking and therefore is not thread safe + #[cfg(not(libressl390))] #[corresponds(X509V3_EXT_add_alias)] #[deprecated( note = "Use x509::extension types or new_from_der and then this is not necessary", @@ -2439,10 +2437,8 @@ cfg_if! { } cfg_if! { - if #[cfg(any(ossl110, libressl350))] { + if #[cfg(any(ossl110, libressl350, boringssl))] { use ffi::X509_OBJECT_free; - } else if #[cfg(boringssl)] { - use ffi::X509_OBJECT_free_contents as X509_OBJECT_free; } else { #[allow(bad_style)] unsafe fn X509_OBJECT_free(x: *mut ffi::X509_OBJECT) { @@ -2540,7 +2536,7 @@ impl X509PurposeRef { unsafe { let sname = CString::new(sname).unwrap(); cfg_if! { - if #[cfg(any(ossl110, libressl280))] { + if #[cfg(any(ossl110, libressl280, boringssl))] { let purpose = cvt_n(ffi::X509_PURPOSE_get_by_sname(sname.as_ptr() as *const _))?; } else { let purpose = cvt_n(ffi::X509_PURPOSE_get_by_sname(sname.as_ptr() as *mut _))?; @@ -2554,8 +2550,8 @@ impl X509PurposeRef { #[corresponds(X509_PURPOSE_get0)] pub fn from_idx(idx: c_int) -> Result<&'static X509PurposeRef, ErrorStack> { unsafe { - let ptr = cvt_p(ffi::X509_PURPOSE_get0(idx))?; - Ok(X509PurposeRef::from_ptr(ptr)) + let ptr = cvt_p_const(ffi::X509_PURPOSE_get0(idx))?; + Ok(X509PurposeRef::from_const_ptr(ptr)) } } @@ -2571,8 +2567,14 @@ impl X509PurposeRef { /// - `X509_PURPOSE_TIMESTAMP_SIGN` pub fn purpose(&self) -> X509PurposeId { unsafe { - let x509_purpose: *mut ffi::X509_PURPOSE = self.as_ptr(); - X509PurposeId::from_raw((*x509_purpose).purpose) + cfg_if! { + if #[cfg(any(ossl110, libressl280, boringssl))] { + let x509_purpose = self.as_ptr() as *const ffi::X509_PURPOSE; + } else { + let x509_purpose = self.as_ptr() as *mut ffi::X509_PURPOSE; + } + } + X509PurposeId::from_raw(ffi::X509_PURPOSE_get_id(x509_purpose)) } } } diff --git a/vendor/openssl/src/x509/store.rs b/vendor/openssl/src/x509/store.rs index 8619086eb..944a2803e 100644 --- a/vendor/openssl/src/x509/store.rs +++ b/vendor/openssl/src/x509/store.rs @@ -51,6 +51,7 @@ use crate::ssl::SslFiletype; #[cfg(ossl300)] use crate::stack::Stack; use crate::stack::StackRef; +use crate::util::ForeignTypeRefExt; #[cfg(any(ossl102, libressl261))] use crate::x509::verify::{X509VerifyFlags, X509VerifyParamRef}; use crate::x509::{X509Object, X509PurposeId, X509}; @@ -165,7 +166,7 @@ impl X509Lookup { /// directory. #[corresponds(X509_LOOKUP_hash_dir)] pub fn hash_dir() -> &'static X509LookupMethodRef { - unsafe { X509LookupMethodRef::from_ptr(ffi::X509_LOOKUP_hash_dir()) } + unsafe { X509LookupMethodRef::from_const_ptr(ffi::X509_LOOKUP_hash_dir()) } } } @@ -197,7 +198,7 @@ impl X509Lookup { /// into memory at the time the file is added as a lookup source. #[corresponds(X509_LOOKUP_file)] pub fn file() -> &'static X509LookupMethodRef { - unsafe { X509LookupMethodRef::from_ptr(ffi::X509_LOOKUP_file()) } + unsafe { X509LookupMethodRef::from_const_ptr(ffi::X509_LOOKUP_file()) } } } diff --git a/vendor/openssl/src/x509/tests.rs b/vendor/openssl/src/x509/tests.rs index 0444a067d..7d6611281 100644 --- a/vendor/openssl/src/x509/tests.rs +++ b/vendor/openssl/src/x509/tests.rs @@ -172,7 +172,7 @@ fn test_subject_alt_name() { } #[test] -#[cfg(ossl110)] +#[cfg(any(ossl110, boringssl))] fn test_retrieve_pathlen() { let cert = include_bytes!("../../test/root-ca.pem"); let cert = X509::from_pem(cert).unwrap(); @@ -188,7 +188,7 @@ fn test_retrieve_pathlen() { } #[test] -#[cfg(ossl110)] +#[cfg(any(ossl110, boringssl))] fn test_subject_key_id() { let cert = include_bytes!("../../test/certv3.pem"); let cert = X509::from_pem(cert).unwrap(); @@ -201,7 +201,7 @@ fn test_subject_key_id() { } #[test] -#[cfg(ossl110)] +#[cfg(any(ossl110, boringssl))] fn test_authority_key_id() { let cert = include_bytes!("../../test/certv3.pem"); let cert = X509::from_pem(cert).unwrap(); diff --git a/vendor/pest/.cargo-checksum.json b/vendor/pest/.cargo-checksum.json index 656b839fe..61c6b2d10 100644 --- a/vendor/pest/.cargo-checksum.json +++ b/vendor/pest/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"16e8bbb54bf61944772b3f6c7aba60d1f8908fc3aa68379efab574fb4556cb23","Cargo.toml":"3060a600efca6e84d6f1354e21c48f275a0938fffb7a72478c333596aa8d7af3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","benches/stack.rs":"1a4b327dd779fbebe4c485408856541252118760fba53ef6cc37a918bd0d3c37","examples/parens.rs":"2b022b5ed1fbc9b41a4359e3b79648317415217768f88234c3e3efc0db34bcce","src/error.rs":"39c064fe7b47de01a385ab543db5214cb404322fe57622c350c3ca0f62c26ded","src/iterators/flat_pairs.rs":"9c9c284d06bdd55ff8461cb62b93b22d9f4f67f22808ac7b40041bf9fd28d9ab","src/iterators/line_index.rs":"19729b5da43527a52910908d67f406f137bced5ab535e879a26032f5b97f9f48","src/iterators/mod.rs":"b8ac4e586c7b49403c694ceded242a9ed9c499d995e3db2df19b27aaff3d4e4d","src/iterators/pair.rs":"148cb590680e69484725d3e7aaf06677f6e4bb37cf151bc3da08c395497d89b4","src/iterators/pairs.rs":"8e121dee8409a30b63bd213acf035771b45cbf0b9251e835e97aaadab217620d","src/iterators/queueable_token.rs":"50b126c8d5cc68008c938420f8e3d1adcf401a85a64f3deed15f18cab5df9329","src/iterators/tokens.rs":"19060114c6b4f61da67a46e4e9cdb7b4ab8e91d55c0d11e26f1a5d54986f634b","src/lib.rs":"40aff134251162f21f2d593f27a5032b820ee26714a921a7b8040c2b632a2f76","src/macros.rs":"95637b87ecad9db34e3b23985d32ef56a0ea1f99f729281f9c2afe8057d0ea61","src/parser.rs":"3c453a737eac42b113c91dba459c49d8417fcc46aa2d8d3d3297d29de079cb42","src/parser_state.rs":"139536ed02cfc40e58de053f26b806319ac8b0e2fd3d9d346f9f6bf2e5da9819","src/position.rs":"b0418c3db0836d44429d2d4659bf1335150ab22251f0205cb23e38449d2ed8b5","src/pratt_parser.rs":"81840653126031e4f069fab09a6d0773c59defc4c9686f4c50a7d08dcb52251f","src/prec_climber.rs":"e068f7abe105d39f56ba057e32c32450793b4180d243640cb1008c61f588ce48","src/span.rs":"3b47b71fe6ddb0f2cae245e277692d5249acc82b8e74b335f34544fd3c618b30","src/stack.rs":"94e2daf503c93b48db30894083343d3ee353acaf75d99a470fda547817afa470","src/token.rs":"8c3a09c7f9a5c059f94900cd8c16b3eb17f893154f395e2f1cfa1a472cfd2ba6","src/unicode/binary.rs":"3527606dee7387917b1e3c449c33105de0ae914ddd8377b4855a10a15324065a","src/unicode/category.rs":"05a2dcdae0704293d09462ccd2661b2717bc382ef593dbcecc95f0b96ac87fda","src/unicode/mod.rs":"99ab177391d588f821e2da6fba9fdae9a3a01b882ed93893d50b36cd61f8708f","src/unicode/script.rs":"38121f755d610609dcde5f856a7844ff1dc287cd8bcea977e749ff4a52b6ea10","tests/calculator.rs":"a782fc114c3a59cb6bcfebd9738f88157a31103167e54693708a3e5dc1ed44a8","tests/json.rs":"1f11b97a3cd6801b36f54fa7605a174d1eb34431889597595cc15e908cf6b0ee"},"package":"ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5"} \ No newline at end of file +{"files":{"Cargo.lock":"21af9627da6b636332da744f34090ad44edc14bfd25151df65cd9165a44b6bbb","Cargo.toml":"7f2d0059c3f86f7e68b46b75ea4df47b604f5c9b073b571454195b3d77a0feca","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","benches/stack.rs":"1a4b327dd779fbebe4c485408856541252118760fba53ef6cc37a918bd0d3c37","examples/parens.rs":"2b022b5ed1fbc9b41a4359e3b79648317415217768f88234c3e3efc0db34bcce","src/error.rs":"39c064fe7b47de01a385ab543db5214cb404322fe57622c350c3ca0f62c26ded","src/iterators/flat_pairs.rs":"9c9c284d06bdd55ff8461cb62b93b22d9f4f67f22808ac7b40041bf9fd28d9ab","src/iterators/line_index.rs":"19729b5da43527a52910908d67f406f137bced5ab535e879a26032f5b97f9f48","src/iterators/mod.rs":"b8ac4e586c7b49403c694ceded242a9ed9c499d995e3db2df19b27aaff3d4e4d","src/iterators/pair.rs":"148cb590680e69484725d3e7aaf06677f6e4bb37cf151bc3da08c395497d89b4","src/iterators/pairs.rs":"f86251d9bc378bc7543a5e626249bd4650ec238d5118035ba765a44fe4bfa7c5","src/iterators/queueable_token.rs":"1fc1a8255cc7488a7e8770a3b58763d24639821cfdc70fc868cf8594a978ea89","src/iterators/tokens.rs":"19060114c6b4f61da67a46e4e9cdb7b4ab8e91d55c0d11e26f1a5d54986f634b","src/lib.rs":"40aff134251162f21f2d593f27a5032b820ee26714a921a7b8040c2b632a2f76","src/macros.rs":"95637b87ecad9db34e3b23985d32ef56a0ea1f99f729281f9c2afe8057d0ea61","src/parser.rs":"3c453a737eac42b113c91dba459c49d8417fcc46aa2d8d3d3297d29de079cb42","src/parser_state.rs":"7d945bf7d38cf7e8c8cd3ed84970f89cf32d65d9fbeef5f6b3178c2bac39df4a","src/position.rs":"b0418c3db0836d44429d2d4659bf1335150ab22251f0205cb23e38449d2ed8b5","src/pratt_parser.rs":"81840653126031e4f069fab09a6d0773c59defc4c9686f4c50a7d08dcb52251f","src/prec_climber.rs":"e068f7abe105d39f56ba057e32c32450793b4180d243640cb1008c61f588ce48","src/span.rs":"3b47b71fe6ddb0f2cae245e277692d5249acc82b8e74b335f34544fd3c618b30","src/stack.rs":"94e2daf503c93b48db30894083343d3ee353acaf75d99a470fda547817afa470","src/token.rs":"8c3a09c7f9a5c059f94900cd8c16b3eb17f893154f395e2f1cfa1a472cfd2ba6","src/unicode/binary.rs":"3527606dee7387917b1e3c449c33105de0ae914ddd8377b4855a10a15324065a","src/unicode/category.rs":"05a2dcdae0704293d09462ccd2661b2717bc382ef593dbcecc95f0b96ac87fda","src/unicode/mod.rs":"99ab177391d588f821e2da6fba9fdae9a3a01b882ed93893d50b36cd61f8708f","src/unicode/script.rs":"38121f755d610609dcde5f856a7844ff1dc287cd8bcea977e749ff4a52b6ea10","tests/calculator.rs":"a782fc114c3a59cb6bcfebd9738f88157a31103167e54693708a3e5dc1ed44a8","tests/json.rs":"de661e934e014d829895db0ac2f983745da7f84e25b1f3085ac95182318762fe"},"package":"1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06"} \ No newline at end of file diff --git a/vendor/pest/Cargo.lock b/vendor/pest/Cargo.lock index ac190b32e..4424c0ec5 100644 --- a/vendor/pest/Cargo.lock +++ b/vendor/pest/Cargo.lock @@ -82,18 +82,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstyle", "clap_lex", @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "criterion" @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -154,22 +154,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -182,9 +180,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys", @@ -204,9 +202,9 @@ checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", @@ -224,30 +222,30 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.149" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "log" @@ -257,18 +255,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "num-traits" @@ -281,9 +270,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -293,7 +282,7 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" dependencies = [ "criterion", "memchr", @@ -333,18 +322,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -400,9 +389,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags", "errno", @@ -413,9 +402,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -426,26 +415,20 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "serde" -version = "1.0.189" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", @@ -454,9 +437,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -465,9 +448,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb" dependencies = [ "proc-macro2", "quote", @@ -476,18 +459,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -528,9 +511,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -538,9 +521,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -553,9 +536,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -563,9 +546,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -576,15 +559,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -623,18 +606,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -647,42 +630,42 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/vendor/pest/Cargo.toml b/vendor/pest/Cargo.toml index 80614f734..2a8ccdcef 100644 --- a/vendor/pest/Cargo.toml +++ b/vendor/pest/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.61" name = "pest" -version = "2.7.5" +version = "2.7.6" authors = ["Dragoș Tiselice "] description = "The Elegant Parser" homepage = "https://pest.rs/" diff --git a/vendor/pest/src/iterators/pairs.rs b/vendor/pest/src/iterators/pairs.rs index 805b5a346..ed6a9a13a 100644 --- a/vendor/pest/src/iterators/pairs.rs +++ b/vendor/pest/src/iterators/pairs.rs @@ -227,9 +227,9 @@ impl<'i, R: RuleType> Pairs<'i, R> { /// state: Box>, /// ) -> ParseResult>> { /// expr(state, Rule::mul, "*") - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("mul"))) + /// .and_then(|state| state.tag_node("mul")) /// .or_else(|state| expr(state, Rule::add, "+")) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("add"))) + /// .and_then(|state| state.tag_node("add")) /// } /// fn expr<'a>( /// state: Box>, @@ -239,10 +239,10 @@ impl<'i, R: RuleType> Pairs<'i, R> { /// state.rule(r, |state| { /// state.sequence(|state| { /// number(state) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("lhs"))) + /// .and_then(|state| state.tag_node("lhs")) /// .and_then(|state| state.match_string(o)) /// .and_then(number) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("rhs"))) + /// .and_then(|state| state.tag_node("rhs")) /// }) /// }) /// } @@ -278,9 +278,9 @@ impl<'i, R: RuleType> Pairs<'i, R> { /// state: Box>, /// ) -> ParseResult>> { /// expr(state, Rule::mul, "*") - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("mul"))) + /// .and_then(|state| state.tag_node("mul")) /// .or_else(|state| expr(state, Rule::add, "+")) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("add"))) + /// .and_then(|state| state.tag_node("add")) /// } /// fn expr<'a>( /// state: Box>, @@ -290,10 +290,10 @@ impl<'i, R: RuleType> Pairs<'i, R> { /// state.rule(r, |state| { /// state.sequence(|state| { /// number(state) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("lhs"))) + /// .and_then(|state| state.tag_node("lhs")) /// .and_then(|state| state.match_string(o)) /// .and_then(number) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("rhs"))) + /// .and_then(|state| state.tag_node("rhs")) /// }) /// }) /// } @@ -676,9 +676,9 @@ mod tests { state: Box>, ) -> ParseResult>> { expr(state, Rule::mul, "*") - .and_then(|state| state.tag_node(alloc::borrow::Cow::Borrowed("mul"))) + .and_then(|state| state.tag_node("mul")) .or_else(|state| expr(state, Rule::add, "+")) - .and_then(|state| state.tag_node(alloc::borrow::Cow::Borrowed("add"))) + .and_then(|state| state.tag_node("add")) } fn expr<'a>( state: Box>, @@ -688,10 +688,10 @@ mod tests { state.rule(r, |state| { state.sequence(|state| { number(state) - .and_then(|state| state.tag_node(alloc::borrow::Cow::Borrowed("lhs"))) + .and_then(|state| state.tag_node("lhs")) .and_then(|state| state.match_string(o)) .and_then(number) - .and_then(|state| state.tag_node(alloc::borrow::Cow::Borrowed("rhs"))) + .and_then(|state| state.tag_node("rhs")) }) }) } diff --git a/vendor/pest/src/iterators/queueable_token.rs b/vendor/pest/src/iterators/queueable_token.rs index 67426092b..530742b59 100644 --- a/vendor/pest/src/iterators/queueable_token.rs +++ b/vendor/pest/src/iterators/queueable_token.rs @@ -7,8 +7,6 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. -use alloc::borrow::Cow; - // This structure serves to improve performance over Token objects in two ways: // // * it is smaller than a Token, leading to both less memory use when stored in the queue but also @@ -24,7 +22,7 @@ pub enum QueueableToken<'i, R> { End { start_token_index: usize, rule: R, - tag: Option>, + tag: Option<&'i str>, input_pos: usize, }, } diff --git a/vendor/pest/src/parser_state.rs b/vendor/pest/src/parser_state.rs index 58c9ecb1f..f665bf234 100644 --- a/vendor/pest/src/parser_state.rs +++ b/vendor/pest/src/parser_state.rs @@ -7,7 +7,7 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. -use alloc::borrow::{Cow, ToOwned}; +use alloc::borrow::ToOwned; use alloc::boxed::Box; use alloc::rc::Rc; use alloc::vec; @@ -392,7 +392,7 @@ impl<'i, R: RuleType> ParserState<'i, R> { /// character(state) /// .and_then(|state| character(state)) /// .and_then(|state| character(state)) - /// .and_then(|state| state.tag_node(std::borrow::Cow::Borrowed("c"))) + /// .and_then(|state| state.tag_node("c")) /// .and_then(|state| character(state)) /// }) /// } @@ -407,7 +407,7 @@ impl<'i, R: RuleType> ParserState<'i, R> { /// assert_eq!(find[0].as_str(), "c") /// ``` #[inline] - pub fn tag_node(mut self: Box, tag: Cow<'i, str>) -> ParseResult> { + pub fn tag_node(mut self: Box, tag: &'i str) -> ParseResult> { if let Some(QueueableToken::End { tag: old, .. }) = self.queue.last_mut() { *old = Some(tag) } diff --git a/vendor/pest/tests/json.rs b/vendor/pest/tests/json.rs index be64057f7..0313d81bb 100644 --- a/vendor/pest/tests/json.rs +++ b/vendor/pest/tests/json.rs @@ -457,7 +457,7 @@ fn ast() { let vals: Vec<&Json> = pairs.values().collect(); assert_eq!( - **vals.get(0).unwrap(), + **vals.first().unwrap(), Json::Array(vec![Json::Null, Json::Bool(true), Json::Number(3.4)]) ); } diff --git a/vendor/pest_derive/.cargo-checksum.json b/vendor/pest_derive/.cargo-checksum.json index c1441ac02..68ad72a34 100644 --- a/vendor/pest_derive/.cargo-checksum.json +++ b/vendor/pest_derive/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"80c42ecc5d50d69d749afb2581680641af9a7713e8e9c756edbef7cf4086ae9c","Cargo.toml":"24a03d801c18b8c812a87c636a77dc837c58c90502bf5e5defda807d9916dfe8","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","examples/base.pest":"949b57af96904b47da714890dd1ab5ce8937a92aac71be1b5cc3c3573198ad24","examples/calc.pest":"4347730e9c77c74545b205e8aa5a1128c064056eb6bfe47d31d3e0f76d9c25ea","examples/calc.rs":"0ded248d3d04adde5eafc69e1ed5d8c120400f7a01181db4a30408c4b777b641","examples/help-menu.pest":"901550581cf040a346c78b64a3320e34da5e4b3941b127ba81820de0dedd2906","examples/help-menu.rs":"c6b9b4d860101a4e3ef0f9e59d967dc5ed9bd3ed4acd4b2e8f30ed2a61a899c9","src/lib.rs":"ef3426de6a0c667066202be87f23a7605461884aba71eda8aae5f82b04846149","tests/grammar.pest":"4d172b9d3851292aed1b8e5ce95c49ef10fda2b3b269baaf5ad2c333fe3744b0","tests/grammar.rs":"fca526a09e4a6ebd27641be7377caae5a867a720e256ef60c324825cc19e5ea1","tests/grammar_inline.rs":"349527e75a1fc10e0208d3d88cbac427dd5999b8a2a79d2b9c981e73af22da37","tests/implicit.pest":"18cd082b71214f7d6bbf32fcf4cd9e3a0b10f99212a640db5327deddb434925e","tests/implicit.rs":"6a30987f22000d1afa186ba9ad1781868d35a418ea381d8bcd08ca8f0b1b1477","tests/lists.pest":"96d90ad5eb7b14648fa8720f0a48e680327080b07251a4dd74e1a023625e9c1a","tests/lists.rs":"2dc0cb9c07f5b077743ce9313488599347061ea486e0f5160bff50b3d07ca72c","tests/oneormore.pest":"6599ad31c3e81da6abf05929d7c1a2c8ba63ffea7fa41898e9385f8142d765ad","tests/oneormore.rs":"0379e54652714b6434560707961da2fd679f964bd9700408452fa6b57d6d1a1c","tests/reporting.pest":"f5bc8405ea117b76338e0003e359731a8aaf1a36672f31a6a639a4e67a65e331","tests/reporting.rs":"8b88238dc33abff5dbc76434a7468dceeb9db3dfa8826d44c8ea1d13d52431e8"},"package":"81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2"} \ No newline at end of file +{"files":{"Cargo.lock":"cfb8b2bfc6d84ac16139b191cb0a02fdaf1e2e5b046838e71494c8e795881801","Cargo.toml":"194f98a342af9604985906c8f6ebae72481df68b10566316a86ae4cb91ad4c8e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","examples/base.pest":"949b57af96904b47da714890dd1ab5ce8937a92aac71be1b5cc3c3573198ad24","examples/calc.pest":"4347730e9c77c74545b205e8aa5a1128c064056eb6bfe47d31d3e0f76d9c25ea","examples/calc.rs":"0ded248d3d04adde5eafc69e1ed5d8c120400f7a01181db4a30408c4b777b641","examples/help-menu.pest":"901550581cf040a346c78b64a3320e34da5e4b3941b127ba81820de0dedd2906","examples/help-menu.rs":"c6b9b4d860101a4e3ef0f9e59d967dc5ed9bd3ed4acd4b2e8f30ed2a61a899c9","src/lib.rs":"ef3426de6a0c667066202be87f23a7605461884aba71eda8aae5f82b04846149","tests/grammar.pest":"4d172b9d3851292aed1b8e5ce95c49ef10fda2b3b269baaf5ad2c333fe3744b0","tests/grammar.rs":"fca526a09e4a6ebd27641be7377caae5a867a720e256ef60c324825cc19e5ea1","tests/grammar_inline.rs":"349527e75a1fc10e0208d3d88cbac427dd5999b8a2a79d2b9c981e73af22da37","tests/implicit.pest":"18cd082b71214f7d6bbf32fcf4cd9e3a0b10f99212a640db5327deddb434925e","tests/implicit.rs":"6a30987f22000d1afa186ba9ad1781868d35a418ea381d8bcd08ca8f0b1b1477","tests/lists.pest":"96d90ad5eb7b14648fa8720f0a48e680327080b07251a4dd74e1a023625e9c1a","tests/lists.rs":"2dc0cb9c07f5b077743ce9313488599347061ea486e0f5160bff50b3d07ca72c","tests/oneormore.pest":"6599ad31c3e81da6abf05929d7c1a2c8ba63ffea7fa41898e9385f8142d765ad","tests/oneormore.rs":"0379e54652714b6434560707961da2fd679f964bd9700408452fa6b57d6d1a1c","tests/reporting.pest":"f5bc8405ea117b76338e0003e359731a8aaf1a36672f31a6a639a4e67a65e331","tests/reporting.rs":"8b88238dc33abff5dbc76434a7468dceeb9db3dfa8826d44c8ea1d13d52431e8"},"package":"bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde"} \ No newline at end of file diff --git a/vendor/pest_derive/Cargo.lock b/vendor/pest_derive/Cargo.lock index e0360821c..e0377332d 100644 --- a/vendor/pest_derive/Cargo.lock +++ b/vendor/pest_derive/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -32,9 +32,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -52,37 +52,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -152,9 +152,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "regex-automata", @@ -253,23 +253,23 @@ dependencies = [ "unicode-xid", "url", "walkdir", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] [[package]] name = "cargo-util" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77042b5b585f701f1cfb4b6b12ebc02b9b0cefbc8dcce235906b6bf376d4245d" +checksum = "bb2bdd1d8ab2353ddd763881eaba60cb53f1deee0ff9d271b9f0e4cdbcd063fb" dependencies = [ "anyhow", "core-foundation", @@ -284,7 +284,7 @@ dependencies = [ "tempfile", "tracing", "walkdir", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -305,18 +305,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.6" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -327,9 +327,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clru" @@ -345,15 +345,15 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -361,15 +361,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -399,28 +399,50 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", ] [[package]] -name = "crossbeam-utils" -version = "0.8.16" +name = "crossbeam-deque" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -461,9 +483,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.68+curl-8.4.0" +version = "0.4.70+curl-8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a0d18d88360e374b16b2273c832b5e57258ffc1d4aa4f96b108e0738d5752f" +checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" dependencies = [ "cc", "libc", @@ -472,7 +494,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -488,9 +510,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -515,9 +537,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest", @@ -529,9 +551,9 @@ dependencies = [ [[package]] name = "ed25519-compact" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3d382e8464107391c8706b4c14b087808ecb909f6c15c34114bc42e53a9e4c" +checksum = "a667e6426df16c2ac478efa4a439d0e674cba769c5556e8cf221739251640c8c" dependencies = [ "getrandom", ] @@ -544,9 +566,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -565,9 +587,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -584,12 +606,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -619,20 +641,20 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys", + "redox_syscall", + "windows-sys 0.52.0", ] [[package]] @@ -646,17 +668,11 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -684,9 +700,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -803,18 +819,18 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.7" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" +checksum = "78b6cd0f246180034ddafac9b00a112f19178135b21eb031b3f79355891f7325" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" +checksum = "003ec6deacf68076a0c157271a127e0bb2c031c1a41f7168cbe5d248d9b85c78" dependencies = [ "thiserror", ] @@ -976,7 +992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" dependencies = [ "gix-hash", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "parking_lot", ] @@ -1151,9 +1167,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" +checksum = "9f7dc10303d73a960d10fb82f81188b036ac3e6b11b5795b20b1a60b51d1321f" dependencies = [ "bstr", "btoi", @@ -1237,9 +1253,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" +checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89" [[package]] name = "gix-transport" @@ -1288,9 +1304,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" +checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f" dependencies = [ "fastrand", ] @@ -1334,15 +1350,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata", + "regex-syntax", ] [[package]] @@ -1364,9 +1380,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" @@ -1382,9 +1398,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -1400,18 +1416,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "http-auth" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430cacd7a1f9a02fbeb350dfc81a0e5ed42d81f3398cb0ba184017f85bdcfbc" +checksum = "643c9bbf6a4ea8a656d6b4cd53d34f79e3f841ad5203c1a55fb7d761923bc255" dependencies = [ "memchr", ] @@ -1424,9 +1440,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1434,17 +1450,16 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -1485,12 +1500,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -1505,13 +1520,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1525,9 +1540,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -1540,9 +1555,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -1570,9 +1585,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libgit2-sys" @@ -1590,9 +1605,9 @@ dependencies = [ [[package]] name = "libnghttp2-sys" -version = "0.1.8+1.55.1" +version = "0.1.9+1.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fae956c192dadcdb5dace96db71fa0b827333cce7c7b38dc71446f024d8a340" +checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64" dependencies = [ "cc", "libc", @@ -1626,9 +1641,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -1659,9 +1674,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -1693,7 +1708,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "359f76430b20a79f9e20e115b3428614e654f04fab314482fc0fda0ebd3c6044" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1726,9 +1741,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opener" @@ -1748,9 +1763,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -1819,16 +1834,16 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "pasetors" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba765699a309908d55950919a3445e9491453e89b2587b1b2abe4143a48894c0" +checksum = "6b36d47c66f2230dd1b7143d9afb2b4891879020210eddf2ccb624e529b96dba" dependencies = [ "ct-codecs", "ed25519-compact", @@ -1862,15 +1877,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -1879,7 +1894,7 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" dependencies = [ "pest", "pest_generator", @@ -1887,22 +1902,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "cargo", "once_cell", @@ -1928,9 +1943,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "powerfmt" @@ -1946,18 +1961,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primeorder" -version = "0.13.2" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] @@ -1973,9 +1988,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2019,15 +2034,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2090,22 +2096,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2118,11 +2124,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2147,18 +2153,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.189" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] @@ -2175,29 +2181,29 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", ] [[package]] name = "serde_ignored" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c31d5c53fd39f208e770f5a20a0bb214dee2a8d0d8adba18e19ad95a482ca5" +checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf" dependencies = [ "serde", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -2206,9 +2212,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2268,9 +2274,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -2288,9 +2294,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -2304,9 +2310,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -2352,9 +2358,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb" dependencies = [ "proc-macro2", "quote", @@ -2373,22 +2379,22 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -2400,44 +2406,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", + "syn 2.0.47", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -2457,9 +2453,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -2506,7 +2502,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -2532,7 +2528,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", ] [[package]] @@ -2558,15 +2554,15 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-bom" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" @@ -2597,9 +2593,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2663,9 +2659,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2673,24 +2669,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2698,22 +2694,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "winapi" @@ -2752,7 +2748,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2761,7 +2757,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -2770,13 +2775,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2785,36 +2805,72 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -2822,36 +2878,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "winnow" -version = "0.5.17" +name = "windows_x86_64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8434aeec7b290e8da5c3f0d628cb0eac6cabcb31d14bb74f779a08109a5914d6" dependencies = [ "memchr", ] [[package]] name = "zerocopy" -version = "0.7.11" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.11" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.47", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/vendor/pest_derive/Cargo.toml b/vendor/pest_derive/Cargo.toml index 69505f47b..a443792f2 100644 --- a/vendor/pest_derive/Cargo.toml +++ b/vendor/pest_derive/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.61" name = "pest_derive" -version = "2.7.5" +version = "2.7.6" authors = ["Dragoș Tiselice "] description = "pest's derive macro" homepage = "https://pest.rs/" @@ -34,11 +34,11 @@ name = "pest_derive" proc-macro = true [dependencies.pest] -version = "2.7.5" +version = "2.7.6" default-features = false [dependencies.pest_generator] -version = "2.7.5" +version = "2.7.6" default-features = false [features] diff --git a/vendor/pest_generator/.cargo-checksum.json b/vendor/pest_generator/.cargo-checksum.json index 30e72c2cf..141f9020f 100644 --- a/vendor/pest_generator/.cargo-checksum.json +++ b/vendor/pest_generator/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ad7558bd6b4e3996834c611afe58bcf5b6b0448e8f664def2c1e2cc77bc6eae9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","src/docs.rs":"041b2c24377955dfdb6c29991b1f1dd7d7191431d8e5eaa245325253b250f702","src/generator.rs":"e49e3655da7d0ebc2b1f03dcec47111d469e52164b6e0f904a1b723d9348c921","src/lib.rs":"034624c6d8ad89b365f81ab04ad96a3d67909ba3485008355f21429a42b5e02c","src/macros.rs":"897d9004449b1c219f17c079630a790f3de1a27f61bc6a03cd777a163a6a1fba","tests/base.pest":"30f6965031bc52937114f60233a327e41ccc43429ae41a8e40c7b7c8006c466f","tests/test.pest":"f3fea8154a9a26c773ab8392685039d0d84bd845587bb2d42b970946f7967ee8"},"package":"68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227"} \ No newline at end of file +{"files":{"Cargo.toml":"2936f4743aacfebd9824fb7fd69f6b03204312bd41153c2dcdfafa42ad0b05c1","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","src/docs.rs":"041b2c24377955dfdb6c29991b1f1dd7d7191431d8e5eaa245325253b250f702","src/generator.rs":"21dea1774cbca7c03bc7283157c449f1acad6ac387078bbaa3fd0d5134a5e4ab","src/lib.rs":"034624c6d8ad89b365f81ab04ad96a3d67909ba3485008355f21429a42b5e02c","src/macros.rs":"897d9004449b1c219f17c079630a790f3de1a27f61bc6a03cd777a163a6a1fba","tests/base.pest":"30f6965031bc52937114f60233a327e41ccc43429ae41a8e40c7b7c8006c466f","tests/test.pest":"f3fea8154a9a26c773ab8392685039d0d84bd845587bb2d42b970946f7967ee8"},"package":"2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275"} \ No newline at end of file diff --git a/vendor/pest_generator/Cargo.toml b/vendor/pest_generator/Cargo.toml index 08d6e76a7..85dabacd4 100644 --- a/vendor/pest_generator/Cargo.toml +++ b/vendor/pest_generator/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.61" name = "pest_generator" -version = "2.7.5" +version = "2.7.6" authors = ["Dragoș Tiselice "] description = "pest code generator" homepage = "https://pest.rs/" @@ -28,11 +28,11 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/pest-parser/pest" [dependencies.pest] -version = "2.7.5" +version = "2.7.6" default-features = false [dependencies.pest_meta] -version = "2.7.5" +version = "2.7.6" [dependencies.proc-macro2] version = "1.0" diff --git a/vendor/pest_generator/src/generator.rs b/vendor/pest_generator/src/generator.rs index d301e43a2..7a527c5ad 100644 --- a/vendor/pest_generator/src/generator.rs +++ b/vendor/pest_generator/src/generator.rs @@ -568,14 +568,8 @@ fn generate_expr(expr: OptimizedExpr) -> TokenStream { #[cfg(feature = "grammar-extras")] OptimizedExpr::NodeTag(expr, tag) => { let expr = generate_expr(*expr); - let tag_cow = { - #[cfg(feature = "std")] - quote! { ::std::borrow::Cow::Borrowed(#tag) } - #[cfg(not(feature = "std"))] - quote! { ::alloc::borrow::Cow::Borrowed(#tag) } - }; quote! { - #expr.and_then(|state| state.tag_node(#tag_cow)) + #expr.and_then(|state| state.tag_node(#tag)) } } } @@ -729,14 +723,8 @@ fn generate_expr_atomic(expr: OptimizedExpr) -> TokenStream { #[cfg(feature = "grammar-extras")] OptimizedExpr::NodeTag(expr, tag) => { let expr = generate_expr_atomic(*expr); - let tag_cow = { - #[cfg(feature = "std")] - quote! { ::std::borrow::Cow::Borrowed(#tag) } - #[cfg(not(feature = "std"))] - quote! { ::alloc::borrow::Cow::Borrowed(#tag) } - }; quote! { - #expr.and_then(|state| state.tag_node(#tag_cow)) + #expr.and_then(|state| state.tag_node(#tag)) } } } diff --git a/vendor/pest_meta/.cargo-checksum.json b/vendor/pest_meta/.cargo-checksum.json index 2cdb890b0..487346d40 100644 --- a/vendor/pest_meta/.cargo-checksum.json +++ b/vendor/pest_meta/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"51c506ecb704c48c0f8eea5f5a1bfabdfc0f7cfc6151fc58604afa0d740a85fc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","src/ast.rs":"5787ea2618f7da5a7d9c63a8a9440d22a8f8676b33629ecfc4551b27475a522a","src/grammar.pest":"90077510db0513bed4eb723548aee349e85837ab3a4286a6379b32b9bc237ac8","src/grammar.rs":"d45d92df133c776d9dc5f0dc8638bbac2fe9914f19f50ba2cee60f5b8b0a0cf5","src/lib.rs":"a8cfd7c64bbd2b9dc9f0d21b4f3a6139095ead0964f12da86f4ee8079e546c1e","src/optimizer/concatenator.rs":"ab613bedc7001ab2057a8afee295ee72fc5ba7fc1017f6806477b8caa37af3c8","src/optimizer/factorizer.rs":"b79591db09a2066315f30398a5a2911db19c982ce49bbc7aa6acce894b4e3ede","src/optimizer/lister.rs":"01acfdcadd197c6a1d9dcf313ea9d0bf13983ef34a1c8638e5b439036b7ee924","src/optimizer/mod.rs":"4231e15d3cb283d49310bbe73f0ab39bd47d8f9922d3d4d4bd7f062e20dfb9c0","src/optimizer/restorer.rs":"8b65cfe7dfd4d812bee6ac3cdbcc3d0026e03fd2b456a7c866dd83e6fdbf26a7","src/optimizer/rotater.rs":"08da3716296a6bd7d1872b3dacd961814b87854cdd0d9c714974507fe7aca307","src/optimizer/skipper.rs":"4e9b01e93eac9225d4e05481ce362003bad05121f45543f55f58e5da89857a15","src/optimizer/unroller.rs":"f032acb6b13cfd12aaada312209db8c23e54d5159d9e7283c59887fe5b03aba0","src/parser.rs":"25d1970afde206d7f000cf67854632cd6ecbd6d1cae03ce9251191ae61044131","src/validator.rs":"98b02bead02f8d1dc36245dafb02658c63324a4549ee98f2c942b8356923c5d4"},"package":"7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6"} \ No newline at end of file +{"files":{"Cargo.toml":"838c43e98436996c366fb27b44e148d43930bf6d7df263899c0438faab46c64d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","_README.md":"bde746653575153be4ae26ce950963ced5034449e352e60cfd8825260c666c16","src/ast.rs":"5787ea2618f7da5a7d9c63a8a9440d22a8f8676b33629ecfc4551b27475a522a","src/grammar.pest":"90077510db0513bed4eb723548aee349e85837ab3a4286a6379b32b9bc237ac8","src/grammar.rs":"d45d92df133c776d9dc5f0dc8638bbac2fe9914f19f50ba2cee60f5b8b0a0cf5","src/lib.rs":"a8cfd7c64bbd2b9dc9f0d21b4f3a6139095ead0964f12da86f4ee8079e546c1e","src/optimizer/concatenator.rs":"ab613bedc7001ab2057a8afee295ee72fc5ba7fc1017f6806477b8caa37af3c8","src/optimizer/factorizer.rs":"b79591db09a2066315f30398a5a2911db19c982ce49bbc7aa6acce894b4e3ede","src/optimizer/lister.rs":"01acfdcadd197c6a1d9dcf313ea9d0bf13983ef34a1c8638e5b439036b7ee924","src/optimizer/mod.rs":"4231e15d3cb283d49310bbe73f0ab39bd47d8f9922d3d4d4bd7f062e20dfb9c0","src/optimizer/restorer.rs":"8b65cfe7dfd4d812bee6ac3cdbcc3d0026e03fd2b456a7c866dd83e6fdbf26a7","src/optimizer/rotater.rs":"08da3716296a6bd7d1872b3dacd961814b87854cdd0d9c714974507fe7aca307","src/optimizer/skipper.rs":"4e9b01e93eac9225d4e05481ce362003bad05121f45543f55f58e5da89857a15","src/optimizer/unroller.rs":"f032acb6b13cfd12aaada312209db8c23e54d5159d9e7283c59887fe5b03aba0","src/parser.rs":"25d1970afde206d7f000cf67854632cd6ecbd6d1cae03ce9251191ae61044131","src/validator.rs":"98b02bead02f8d1dc36245dafb02658c63324a4549ee98f2c942b8356923c5d4"},"package":"a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d"} \ No newline at end of file diff --git a/vendor/pest_meta/Cargo.toml b/vendor/pest_meta/Cargo.toml index c2d8e2a89..2f5f2c5d0 100644 --- a/vendor/pest_meta/Cargo.toml +++ b/vendor/pest_meta/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.61" name = "pest_meta" -version = "2.7.5" +version = "2.7.6" authors = ["Dragoș Tiselice "] exclude = ["src/grammar.pest"] include = [ @@ -41,7 +41,7 @@ repository = "https://github.com/pest-parser/pest" version = "1.8.0" [dependencies.pest] -version = "2.7.5" +version = "2.7.6" [build-dependencies.cargo] version = "0.72.2" diff --git a/vendor/pkg-config/.cargo-checksum.json b/vendor/pkg-config/.cargo-checksum.json index d3cf5dcf5..137d8c218 100644 --- a/vendor/pkg-config/.cargo-checksum.json +++ b/vendor/pkg-config/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"8227908c9f30da6d80d2b7a01faa38993f8260b654026a3995b6f2a02dc0b3a3","Cargo.toml":"8a16e91f6d84cc0eed8569c0a206095b400ce2b350f8090da5557438fa40cb6a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"52c4d689d9d9c3806444255a0fde35cfe363cc524f1c97db2a5da41b5bc0119d","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/rpath.pc":"424a844e844edfef02692492def9864833391f581338962946646989a69c1180","tests/test.rs":"d1e93c60096baa30fbd1ef961fd01a36ced36c7f05939171d1f58054c9c4b08a"},"package":"26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"} \ No newline at end of file +{"files":{"CHANGELOG.md":"1cb5d1b8562626f776f11d47d776c036ae0dd3cf10bb703a3e01cee97e0f8075","Cargo.toml":"ef5a55205622d91a1033296dc496865d3f46b14ff28fff3a1fc2e09df3208f24","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"4be163525a9464d04fc168892d751d08fe9f8bfd23c5867797c837aac19ad0b0","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/rpath.pc":"424a844e844edfef02692492def9864833391f581338962946646989a69c1180","tests/test.rs":"d1e93c60096baa30fbd1ef961fd01a36ced36c7f05939171d1f58054c9c4b08a"},"package":"2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"} \ No newline at end of file diff --git a/vendor/pkg-config/CHANGELOG.md b/vendor/pkg-config/CHANGELOG.md index dc2a8c980..8a17bfc81 100644 --- a/vendor/pkg-config/CHANGELOG.md +++ b/vendor/pkg-config/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.29] - 2024-01-17 + +### Fixed + +- Detection and usage of Windows static libraries (#154). + +- Passing `-Wl,-u` to the linker if specified in the pkg-config file (#154). + +## [0.3.28] - 2023-12-20 + +### Fixed + +- Pass -l:libfoo.a to linker directly (#149). + +### Changed + +- Improve error message when library not found (#158). + ## [0.3.27] - 2023-05-03 ### Added diff --git a/vendor/pkg-config/Cargo.toml b/vendor/pkg-config/Cargo.toml index ba00d1458..72b2201ed 100644 --- a/vendor/pkg-config/Cargo.toml +++ b/vendor/pkg-config/Cargo.toml @@ -12,7 +12,7 @@ [package] rust-version = "1.30" name = "pkg-config" -version = "0.3.27" +version = "0.3.29" authors = ["Alex Crichton "] description = """ A library to run the pkg-config system tool at build time in order to be used in diff --git a/vendor/pkg-config/src/lib.rs b/vendor/pkg-config/src/lib.rs index 3653032e8..62b26f545 100644 --- a/vendor/pkg-config/src/lib.rs +++ b/vendor/pkg-config/src/lib.rs @@ -67,12 +67,23 @@ use std::env; use std::error; use std::ffi::{OsStr, OsString}; use std::fmt; +use std::fmt::Display; use std::io; use std::ops::{Bound, RangeBounds}; use std::path::PathBuf; use std::process::{Command, Output}; use std::str; +/// Wrapper struct to polyfill methods introduced in 1.57 (`get_envs`, `get_args` etc). +/// This is needed to reconstruct the pkg-config command for output in a copy- +/// paste friendly format via `Display`. +struct WrappedCommand { + inner: Command, + program: OsString, + env_vars: Vec<(OsString, OsString)>, + args: Vec, +} + #[derive(Clone, Debug)] pub struct Config { statik: Option, @@ -129,12 +140,12 @@ pub enum Error { /// Contains the command and the cause. Command { command: String, cause: io::Error }, - /// `pkg-config` did not exit sucessfully after probing a library. + /// `pkg-config` did not exit successfully after probing a library. /// /// Contains the command and output. Failure { command: String, output: Output }, - /// `pkg-config` did not exit sucessfully on the first attempt to probe a library. + /// `pkg-config` did not exit successfully on the first attempt to probe a library. /// /// Contains the command and output. ProbeFailure { @@ -148,6 +159,81 @@ pub enum Error { __Nonexhaustive, } +impl WrappedCommand { + fn new>(program: S) -> Self { + Self { + inner: Command::new(program.as_ref()), + program: program.as_ref().to_os_string(), + env_vars: Vec::new(), + args: Vec::new(), + } + } + + fn args(&mut self, args: I) -> &mut Self + where + I: IntoIterator + Clone, + S: AsRef, + { + self.inner.args(args.clone()); + self.args + .extend(args.into_iter().map(|arg| arg.as_ref().to_os_string())); + + self + } + + fn arg>(&mut self, arg: S) -> &mut Self { + self.inner.arg(arg.as_ref()); + self.args.push(arg.as_ref().to_os_string()); + + self + } + + fn env(&mut self, key: K, value: V) -> &mut Self + where + K: AsRef, + V: AsRef, + { + self.inner.env(key.as_ref(), value.as_ref()); + self.env_vars + .push((key.as_ref().to_os_string(), value.as_ref().to_os_string())); + + self + } + + fn output(&mut self) -> io::Result { + self.inner.output() + } +} + +/// Output a command invocation that can be copy-pasted into the terminal. +/// `Command`'s existing debug implementation is not used for that reason, +/// as it can sometimes lead to output such as: +/// `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "mylibrary"` +/// Which cannot be copy-pasted into terminals such as nushell, and is a bit noisy. +/// This will look something like: +/// `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs --cflags mylibrary` +impl Display for WrappedCommand { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // Format all explicitly defined environment variables + let envs = self + .env_vars + .iter() + .map(|(env, arg)| format!("{}={}", env.to_string_lossy(), arg.to_string_lossy())) + .collect::>() + .join(" "); + + // Format all pkg-config arguments + let args = self + .args + .iter() + .map(|arg| arg.to_string_lossy().to_string()) + .collect::>() + .join(" "); + + write!(f, "{} {} {}", envs, self.program.to_string_lossy(), args) + } +} + impl error::Error for Error {} impl fmt::Debug for Error { @@ -208,12 +294,80 @@ impl fmt::Display for Error { ref command, ref output, } => { - write!( + let crate_name = + env::var("CARGO_PKG_NAME").unwrap_or(String::from("")); + + writeln!(f, "")?; + + // Give a short explanation of what the error is + writeln!( f, - "`{}` did not exit successfully: {}\nerror: could not find system library '{}' required by the '{}' crate\n", - command, output.status, name, env::var("CARGO_PKG_NAME").unwrap_or_default(), + "pkg-config {}", + match output.status.code() { + Some(code) => format!("exited with status code {}", code), + None => "was terminated by signal".to_string(), + } )?; - format_output(output, f) + + // Give the command run so users can reproduce the error + writeln!(f, "> {}\n", command)?; + + // Explain how it was caused + writeln!( + f, + "The system library `{}` required by crate `{}` was not found.", + name, crate_name + )?; + writeln!( + f, + "The file `{}.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.", + name + )?; + + // There will be no status code if terminated by signal + if let Some(_code) = output.status.code() { + // Nix uses a wrapper script for pkg-config that sets the custom + // environment variable PKG_CONFIG_PATH_FOR_TARGET + let search_locations = ["PKG_CONFIG_PATH_FOR_TARGET", "PKG_CONFIG_PATH"]; + + // Find a search path to use + let mut search_data = None; + for location in search_locations.iter() { + if let Ok(search_path) = env::var(location) { + search_data = Some((location, search_path)); + break; + } + } + + // Guess the most reasonable course of action + let hint = if let Some((search_location, search_path)) = search_data { + writeln!( + f, + "{} contains the following:\n{}", + search_location, + search_path + .split(':') + .map(|path| format!(" - {}", path)) + .collect::>() + .join("\n"), + )?; + + format!("you may need to install a package such as {name}, {name}-dev or {name}-devel.", name=name) + } else { + // Even on Nix, setting PKG_CONFIG_PATH seems to be a viable option + writeln!(f, "The PKG_CONFIG_PATH environment variable is not set.")?; + + format!( + "if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `{}.pc`.", + name + ) + }; + + // Try and nudge the user in the right direction so they don't get stuck + writeln!(f, "\nHINT: {}", hint)?; + } + + Ok(()) } Error::Failure { ref command, @@ -423,15 +577,15 @@ impl Config { // pkg-config may not be aware of cross-compilation, and require // a wrapper script that sets up platform-specific prefixes. - match self.targetted_env_var("PKG_CONFIG_ALLOW_CROSS") { + match self.targeted_env_var("PKG_CONFIG_ALLOW_CROSS") { // don't use pkg-config if explicitly disabled Some(ref val) if val == "0" => false, Some(_) => true, None => { // if not disabled, and pkg-config is customized, // then assume it's prepared for cross-compilation - self.targetted_env_var("PKG_CONFIG").is_some() - || self.targetted_env_var("PKG_CONFIG_SYSROOT_DIR").is_some() + self.targeted_env_var("PKG_CONFIG").is_some() + || self.targeted_env_var("PKG_CONFIG_SYSROOT_DIR").is_some() } } } @@ -442,7 +596,7 @@ impl Config { get_variable(package, variable).map_err(|e| e.to_string()) } - fn targetted_env_var(&self, var_base: &str) -> Option { + fn targeted_env_var(&self, var_base: &str) -> Option { match (env::var("TARGET"), env::var("HOST")) { (Ok(target), Ok(host)) => { let kind = if host == target { "HOST" } else { "TARGET" }; @@ -477,7 +631,7 @@ impl Config { } fn run(&self, name: &str, args: &[&str]) -> Result, Error> { - let pkg_config_exe = self.targetted_env_var("PKG_CONFIG"); + let pkg_config_exe = self.targeted_env_var("PKG_CONFIG"); let fallback_exe = if pkg_config_exe.is_none() { Some(OsString::from("pkgconf")) } else { @@ -499,32 +653,32 @@ impl Config { Ok(output.stdout) } else { Err(Error::Failure { - command: format!("{:?}", cmd), + command: format!("{}", cmd), output, }) } } Err(cause) => Err(Error::Command { - command: format!("{:?}", cmd), + command: format!("{}", cmd), cause, }), } } - fn command(&self, exe: OsString, name: &str, args: &[&str]) -> Command { - let mut cmd = Command::new(exe); + fn command(&self, exe: OsString, name: &str, args: &[&str]) -> WrappedCommand { + let mut cmd = WrappedCommand::new(exe); if self.is_static(name) { cmd.arg("--static"); } cmd.args(args).args(&self.extra_args); - if let Some(value) = self.targetted_env_var("PKG_CONFIG_PATH") { + if let Some(value) = self.targeted_env_var("PKG_CONFIG_PATH") { cmd.env("PKG_CONFIG_PATH", value); } - if let Some(value) = self.targetted_env_var("PKG_CONFIG_LIBDIR") { + if let Some(value) = self.targeted_env_var("PKG_CONFIG_LIBDIR") { cmd.env("PKG_CONFIG_LIBDIR", value); } - if let Some(value) = self.targetted_env_var("PKG_CONFIG_SYSROOT_DIR") { + if let Some(value) = self.targeted_env_var("PKG_CONFIG_SYSROOT_DIR") { cmd.env("PKG_CONFIG_SYSROOT_DIR", value); } if self.print_system_libs { @@ -577,7 +731,7 @@ impl Config { } } -// Implement Default manualy since Bound does not implement Default. +// Implement Default manually since Bound does not implement Default. impl Default for Config { fn default() -> Config { Config { @@ -622,34 +776,38 @@ impl Library { } let prefix = "lib"; - if target.contains("msvc") { - // According to link.exe documentation: - // https://learn.microsoft.com/en-us/cpp/build/reference/link-input-files?view=msvc-170 - // - // LINK doesn't use file extensions to make assumptions about the contents of a file. - // Instead, LINK examines each input file to determine what kind of file it is. - // - // However, rustc appends `.lib` to the string it receives from the -l command line argument, - // which it receives from Cargo via cargo:rustc-link-lib: - // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L828 - // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L843 - // So the only file extension that works for MSVC targets is `.lib` - return test_suffixes(filename, &[".lib"]); - } else if target.contains("windows") && target.contains("gnu") { - // GNU targets for Windows, including gnullvm, use `LinkerFlavor::Gcc` internally in rustc, - // which tells rustc to use the GNU linker. rustc does not prepend/append to the string it - // receives via the -l command line argument before passing it to the linker: - // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L446 - // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L457 - // GNU ld can work with more types of files than just the .lib files that MSVC's link.exe needs. - // GNU ld will prepend the `lib` prefix to the filename if necessary, so it is okay to remove - // the `lib` prefix from the filename. The `.a` suffix *requires* the `lib` prefix. - // https://sourceware.org/binutils/docs-2.39/ld.html#index-direct-linking-to-a-dll - if filename.starts_with(prefix) { + if target.contains("windows") { + if target.contains("gnu") && filename.starts_with(prefix) { + // GNU targets for Windows, including gnullvm, use `LinkerFlavor::Gcc` internally in rustc, + // which tells rustc to use the GNU linker. rustc does not prepend/append to the string it + // receives via the -l command line argument before passing it to the linker: + // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L446 + // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L457 + // GNU ld can work with more types of files than just the .lib files that MSVC's link.exe needs. + // GNU ld will prepend the `lib` prefix to the filename if necessary, so it is okay to remove + // the `lib` prefix from the filename. The `.a` suffix *requires* the `lib` prefix. + // https://sourceware.org/binutils/docs-2.39/ld.html#index-direct-linking-to-a-dll let filename = &filename[prefix.len()..]; return test_suffixes(filename, &[".dll.a", ".dll", ".lib", ".a"]); } else { - return test_suffixes(filename, &[".dll.a", ".dll", ".lib"]); + // According to link.exe documentation: + // https://learn.microsoft.com/en-us/cpp/build/reference/link-input-files?view=msvc-170 + // + // LINK doesn't use file extensions to make assumptions about the contents of a file. + // Instead, LINK examines each input file to determine what kind of file it is. + // + // However, rustc appends `.lib` to the string it receives from the -l command line argument, + // which it receives from Cargo via cargo:rustc-link-lib: + // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L828 + // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L843 + // So the only file extension that works for MSVC targets is `.lib` + // However, for externally created libraries, there's no + // guarantee that the extension is ".lib" so we need to + // consider all options. + // See: + // https://github.com/mesonbuild/meson/issues/8153 + // https://github.com/rust-lang/rust/issues/114013 + return test_suffixes(filename, &[".dll.a", ".dll", ".lib", ".a"]); } } else if target.contains("apple") { if filename.starts_with(prefix) { @@ -726,7 +884,11 @@ impl Library { continue; } - if statik && is_static_available(val, &system_roots, &dirs) { + if val.starts_with(':') { + // Pass this flag to linker directly. + let meta = format!("cargo:rustc-link-arg={}{}", flag, val); + config.print_metadata(&meta); + } else if statik && is_static_available(val, &system_roots, &dirs) { let meta = format!("rustc-link-lib=static={}", val); config.print_metadata(&meta); } else { @@ -743,6 +905,10 @@ impl Library { iter.next().map(|s| s.to_owned()), ); } + "-u" => { + let meta = format!("rustc-link-arg=-Wl,-u,{}", val); + config.print_metadata(&meta); + } _ => {} } } @@ -769,6 +935,12 @@ impl Library { self.include_paths.push(PathBuf::from(inc)); } } + "-undefined" | "--undefined" => { + if let Some(symbol) = iter.next() { + let meta = format!("rustc-link-arg=-Wl,{},{}", part, symbol); + config.print_metadata(&meta); + } + } _ => { let path = std::path::Path::new(part); if path.is_file() { @@ -842,10 +1014,19 @@ fn envify(name: &str) -> String { /// System libraries should only be linked dynamically fn is_static_available(name: &str, system_roots: &[PathBuf], dirs: &[PathBuf]) -> bool { - let libname = format!("lib{}.a", name); + let libnames = { + let mut names = vec![format!("lib{}.a", name)]; + + if cfg!(target_os = "windows") { + names.push(format!("{}.lib", name)); + } + + names + }; dirs.iter().any(|dir| { - !system_roots.iter().any(|sys| dir.starts_with(sys)) && dir.join(&libname).exists() + let library_exists = libnames.iter().any(|libname| dir.join(&libname).exists()); + library_exists && !system_roots.iter().any(|sys| dir.starts_with(sys)) }) } diff --git a/vendor/proc-macro2/.cargo-checksum.json b/vendor/proc-macro2/.cargo-checksum.json index cf64e7d03..9368d276c 100644 --- a/vendor/proc-macro2/.cargo-checksum.json +++ b/vendor/proc-macro2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"42e4f7a2ceba017dd6f2819091c7da6dbff0370880b72f80c242832de473d100","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c609b6865476d6c35879784e9155367a97a0da496aa5c3c61488440a20f59883","build.rs":"6b0b19a3af5248513b186b9c28c133f5af34a1d11122c0268c68e89724aa40fa","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/extra.rs":"d378a9e799e5c49933b067cd38f5364d16a152ef337eef86ce42fdc86005ddf3","src/fallback.rs":"df10a5ac00a2bbc0d4a9b9fce33578727c7d24eb2ac8d13c8350ef7897a6175c","src/lib.rs":"d7fb225946fd8f3edae9f8cd6d93cd1b60ad5b5354976aae37c787052bffdfb7","src/location.rs":"f55d2e61f1bb1af65e14ed04c9e91eb1ddbf8430e8c05f2048d1cd538d27368e","src/marker.rs":"43f5a18f5059f1a16507c047b3b7387afee7f25ac45ba4eb1621ca7fa733eb01","src/parse.rs":"4b77cddbc2752bc4d38a65acd8b96b6786c5220d19b1e1b37810257b5d24132d","src/rcvec.rs":"1c3c48c4f819927cc445ae15ca3bb06775feff2fd1cb21901ae4c40c7e6b4e82","src/wrapper.rs":"833bad90b8bee76c7dc9d617aa203a43b6b4a76fcca07dcc695e57aa692f5635","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"3190ee07dae510251f360db701ce257030f94a479b6689c3a9ef804bd5d8d099","tests/test.rs":"7511be57e097b15403cf36feb858b4aabdc832fac7024571059a559a7e2ed2a0","tests/test_fmt.rs":"b7743b612af65f2c88cbe109d50a093db7aa7e87f9e37bf45b7bbaeb240aa020","tests/test_size.rs":"acf05963c1e62052d769d237b50844a2c59b4182b491231b099a4f74e5456ab0"},"package":"39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"} \ No newline at end of file +{"files":{"Cargo.toml":"cf58b9b5cd9abb5dca91d4d61809edcf425156bd8e9bb69e0398e00e74aa7af1","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c609b6865476d6c35879784e9155367a97a0da496aa5c3c61488440a20f59883","build.rs":"8b4facae0d125ca3b437b4f5ebcd6ea3da3fcc65fcfc2cf357ae544423aa4568","build/probe.rs":"971fd2178dc506ccdc5c2065c37b77696a4aee8e00330ca52625db4a857f68d3","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/extra.rs":"7c3864497cb5298fd5d0e9f5ae5797860338a9a4263220a8e8eabecda1583797","src/fallback.rs":"2e668a1ed90243e6f627a0c85c73c61f5c4107d82e149de5960d806d5eae99f9","src/lib.rs":"ea7a33758942e0911d5545e57b6a726c5bca7960fe3eed58a46b692244ac575a","src/location.rs":"f55d2e61f1bb1af65e14ed04c9e91eb1ddbf8430e8c05f2048d1cd538d27368e","src/marker.rs":"c11c5a1be8bdf18be3fcd224393f350a9aae7ce282e19ce583c84910c6903a8f","src/parse.rs":"4b77cddbc2752bc4d38a65acd8b96b6786c5220d19b1e1b37810257b5d24132d","src/rcvec.rs":"1c3c48c4f819927cc445ae15ca3bb06775feff2fd1cb21901ae4c40c7e6b4e82","src/wrapper.rs":"029fc07e8adbea2dd2a0aab49b07c3fb9cd8bc0539ea85bf9166c46922933742","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"3190ee07dae510251f360db701ce257030f94a479b6689c3a9ef804bd5d8d099","tests/test.rs":"de9163d0b7d53a56de4c3d00acb415785e55c161becfe37b2a0c5d8d1931f14f","tests/test_fmt.rs":"b7743b612af65f2c88cbe109d50a093db7aa7e87f9e37bf45b7bbaeb240aa020","tests/test_size.rs":"acf05963c1e62052d769d237b50844a2c59b4182b491231b099a4f74e5456ab0"},"package":"e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"} \ No newline at end of file diff --git a/vendor/proc-macro2/Cargo.toml b/vendor/proc-macro2/Cargo.toml index 9d3d21e5b..65506c21e 100644 --- a/vendor/proc-macro2/Cargo.toml +++ b/vendor/proc-macro2/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" authors = [ "David Tolnay ", "Alex Crichton ", @@ -53,13 +53,22 @@ doc-scrape-examples = false [dependencies.unicode-ident] version = "1.0" +[dev-dependencies.flate2] +version = "1.0" + [dev-dependencies.quote] version = "1.0" default_features = false +[dev-dependencies.rayon] +version = "1.0" + [dev-dependencies.rustversion] version = "1" +[dev-dependencies.tar] +version = "0.4" + [features] default = ["proc-macro"] nightly = [] diff --git a/vendor/proc-macro2/build.rs b/vendor/proc-macro2/build.rs index 9f0fb51e6..3347f878a 100644 --- a/vendor/proc-macro2/build.rs +++ b/vendor/proc-macro2/build.rs @@ -35,17 +35,14 @@ // 1.57+. use std::env; -use std::process::Command; +use std::ffi::OsString; +use std::path::Path; +use std::process::{self, Command, Stdio}; use std::str; use std::u32; fn main() { - println!("cargo:rerun-if-changed=build.rs"); - - let version = rustc_version().unwrap_or(RustcVersion { - minor: u32::MAX, - nightly: false, - }); + let rustc = rustc_minor_version().unwrap_or(u32::MAX); let docs_rs = env::var_os("DOCS_RS").is_some(); let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs; @@ -58,76 +55,148 @@ fn main() { println!("cargo:rustc-cfg=span_locations"); } - if version.minor < 57 { + if rustc < 57 { println!("cargo:rustc-cfg=no_is_available"); } - if version.minor < 66 { + if rustc < 66 { println!("cargo:rustc-cfg=no_source_text"); } if !cfg!(feature = "proc-macro") { + println!("cargo:rerun-if-changed=build.rs"); return; } - if version.nightly || !semver_exempt { + println!("cargo:rerun-if-changed=build/probe.rs"); + + let proc_macro_span; + let consider_rustc_bootstrap; + if compile_probe(false) { + // This is a nightly or dev compiler, so it supports unstable features + // regardless of RUSTC_BOOTSTRAP. No need to rerun build script if + // RUSTC_BOOTSTRAP is changed. + proc_macro_span = true; + consider_rustc_bootstrap = false; + } else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") { + if compile_probe(true) { + // This is a stable or beta compiler for which the user has set + // RUSTC_BOOTSTRAP to turn on unstable features. Rerun build script + // if they change it. + proc_macro_span = true; + consider_rustc_bootstrap = true; + } else if rustc_bootstrap == "1" { + // This compiler does not support the proc macro Span API in the + // form that proc-macro2 expects. No need to pay attention to + // RUSTC_BOOTSTRAP. + proc_macro_span = false; + consider_rustc_bootstrap = false; + } else { + // This is a stable or beta compiler for which RUSTC_BOOTSTRAP is + // set to restrict the use of unstable features by this crate. + proc_macro_span = false; + consider_rustc_bootstrap = true; + } + } else { + // Without RUSTC_BOOTSTRAP, this compiler does not support the proc + // macro Span API in the form that proc-macro2 expects, but try again if + // the user turns on unstable features. + proc_macro_span = false; + consider_rustc_bootstrap = true; + } + + if proc_macro_span || !semver_exempt { println!("cargo:rustc-cfg=wrap_proc_macro"); } - if version.nightly && feature_allowed("proc_macro_span") { + if proc_macro_span { println!("cargo:rustc-cfg=proc_macro_span"); } - if semver_exempt && version.nightly { + if semver_exempt && proc_macro_span { println!("cargo:rustc-cfg=super_unstable"); } + + if consider_rustc_bootstrap { + println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP"); + } } -struct RustcVersion { - minor: u32, - nightly: bool, +fn compile_probe(rustc_bootstrap: bool) -> bool { + if env::var_os("RUSTC_STAGE").is_some() { + // We are running inside rustc bootstrap. This is a highly non-standard + // environment with issues such as: + // + // https://github.com/rust-lang/cargo/issues/11138 + // https://github.com/rust-lang/rust/issues/114839 + // + // Let's just not use nightly features here. + return false; + } + + let rustc = cargo_env_var("RUSTC"); + let out_dir = cargo_env_var("OUT_DIR"); + let probefile = Path::new("build").join("probe.rs"); + + // Make sure to pick up Cargo rustc configuration. + let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") { + let mut cmd = Command::new(wrapper); + // The wrapper's first argument is supposed to be the path to rustc. + cmd.arg(rustc); + cmd + } else { + Command::new(rustc) + }; + + if !rustc_bootstrap { + cmd.env_remove("RUSTC_BOOTSTRAP"); + } + + cmd.stderr(Stdio::null()) + .arg("--edition=2021") + .arg("--crate-name=proc_macro2") + .arg("--crate-type=lib") + .arg("--emit=dep-info,metadata") + .arg("--out-dir") + .arg(out_dir) + .arg(probefile); + + if let Some(target) = env::var_os("TARGET") { + cmd.arg("--target").arg(target); + } + + // If Cargo wants to set RUSTFLAGS, use that. + if let Ok(rustflags) = env::var("CARGO_ENCODED_RUSTFLAGS") { + if !rustflags.is_empty() { + for arg in rustflags.split('\x1f') { + cmd.arg(arg); + } + } + } + + match cmd.status() { + Ok(status) => status.success(), + Err(_) => false, + } } -fn rustc_version() -> Option { - let rustc = env::var_os("RUSTC")?; +fn rustc_minor_version() -> Option { + let rustc = cargo_env_var("RUSTC"); let output = Command::new(rustc).arg("--version").output().ok()?; let version = str::from_utf8(&output.stdout).ok()?; - let nightly = version.contains("nightly") || version.contains("dev"); let mut pieces = version.split('.'); if pieces.next() != Some("rustc 1") { return None; } - let minor = pieces.next()?.parse().ok()?; - Some(RustcVersion { minor, nightly }) + pieces.next()?.parse().ok() } -fn feature_allowed(feature: &str) -> bool { - // Recognized formats: - // - // -Z allow-features=feature1,feature2 - // - // -Zallow-features=feature1,feature2 - - let flags_var; - let flags_var_string; - let flags = if let Some(encoded_rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") { - flags_var = encoded_rustflags; - flags_var_string = flags_var.to_string_lossy(); - flags_var_string.split('\x1f') - } else { - return true; - }; - - for mut flag in flags { - if flag.starts_with("-Z") { - flag = &flag["-Z".len()..]; - } - if flag.starts_with("allow-features=") { - flag = &flag["allow-features=".len()..]; - return flag.split(',').any(|allowed| allowed == feature); - } - } - - // No allow-features= flag, allowed by default. - true +fn cargo_env_var(key: &str) -> OsString { + env::var_os(key).unwrap_or_else(|| { + eprintln!( + "Environment variable ${} is not set during execution of build script", + key, + ); + process::exit(1); + }) } diff --git a/vendor/proc-macro2/build/probe.rs b/vendor/proc-macro2/build/probe.rs new file mode 100644 index 000000000..2c4947a0b --- /dev/null +++ b/vendor/proc-macro2/build/probe.rs @@ -0,0 +1,25 @@ +// This code exercises the surface area that we expect of Span's unstable API. +// If the current toolchain is able to compile it, then proc-macro2 is able to +// offer these APIs too. + +#![feature(proc_macro_span)] + +extern crate proc_macro; + +use core::ops::{Range, RangeBounds}; +use proc_macro::{Literal, Span}; + +pub fn byte_range(this: &Span) -> Range { + this.byte_range() +} + +pub fn join(this: &Span, other: Span) -> Option { + this.join(other) +} + +pub fn subspan>(this: &Literal, range: R) -> Option { + this.subspan(range) +} + +// Include in sccache cache key. +const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP"); diff --git a/vendor/proc-macro2/src/extra.rs b/vendor/proc-macro2/src/extra.rs index 4a69d4657..543ec1d9b 100644 --- a/vendor/proc-macro2/src/extra.rs +++ b/vendor/proc-macro2/src/extra.rs @@ -3,18 +3,85 @@ use crate::fallback; use crate::imp; -use crate::marker::Marker; +use crate::marker::{ProcMacroAutoTraits, MARKER}; use crate::Span; use core::fmt::{self, Debug}; +/// Invalidate any `proc_macro2::Span` that exist on the current thread. +/// +/// The implementation of `Span` uses thread-local data structures and this +/// function clears them. Calling any method on a `Span` on the current thread +/// created prior to the invalidation will return incorrect values or crash. +/// +/// This function is useful for programs that process more than 232 +/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2 +/// uses 32-bit source locations, and these wrap around when the total source +/// code processed by the same thread exceeds 232 bytes (4 +/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can +/// return wrong data. +/// +/// # Example +/// +/// As of late 2023, there is 200 GB of Rust code published on crates.io. +/// Looking at just the newest version of every crate, it is 16 GB of code. So a +/// workload that involves parsing it all would overflow a 32-bit source +/// location unless spans are being invalidated. +/// +/// ``` +/// use flate2::read::GzDecoder; +/// use std::ffi::OsStr; +/// use std::io::{BufReader, Read}; +/// use std::str::FromStr; +/// use tar::Archive; +/// +/// rayon::scope(|s| { +/// for krate in every_version_of_every_crate() { +/// s.spawn(move |_| { +/// proc_macro2::extra::invalidate_current_thread_spans(); +/// +/// let reader = BufReader::new(krate); +/// let tar = GzDecoder::new(reader); +/// let mut archive = Archive::new(tar); +/// for entry in archive.entries().unwrap() { +/// let mut entry = entry.unwrap(); +/// let path = entry.path().unwrap(); +/// if path.extension() != Some(OsStr::new("rs")) { +/// continue; +/// } +/// let mut content = String::new(); +/// entry.read_to_string(&mut content).unwrap(); +/// match proc_macro2::TokenStream::from_str(&content) { +/// Ok(tokens) => {/* ... */}, +/// Err(_) => continue, +/// } +/// } +/// }); +/// } +/// }); +/// # +/// # fn every_version_of_every_crate() -> Vec { +/// # Vec::new() +/// # } +/// ``` +/// +/// # Panics +/// +/// This function is not applicable to and will panic if called from a +/// procedural macro. +#[cfg(span_locations)] +#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))] +pub fn invalidate_current_thread_spans() { + crate::imp::invalidate_current_thread_spans(); +} + /// An object that holds a [`Group`]'s `span_open()` and `span_close()` together -/// (in a more compact representation than holding those 2 spans individually. +/// in a more compact representation than holding those 2 spans individually. /// /// [`Group`]: crate::Group #[derive(Copy, Clone)] pub struct DelimSpan { inner: DelimSpanEnum, - _marker: Marker, + _marker: ProcMacroAutoTraits, } #[derive(Copy, Clone)] @@ -45,7 +112,7 @@ impl DelimSpan { DelimSpan { inner, - _marker: Marker, + _marker: MARKER, } } diff --git a/vendor/proc-macro2/src/fallback.rs b/vendor/proc-macro2/src/fallback.rs index 55773bcc0..16bf645ca 100644 --- a/vendor/proc-macro2/src/fallback.rs +++ b/vendor/proc-macro2/src/fallback.rs @@ -11,6 +11,8 @@ use core::cell::RefCell; use core::cmp; use core::fmt::{self, Debug, Display, Write}; use core::mem::ManuallyDrop; +#[cfg(span_locations)] +use core::ops::Range; use core::ops::RangeBounds; use core::ptr; use core::str::FromStr; @@ -45,7 +47,7 @@ impl LexError { self.span } - fn call_site() -> Self { + pub(crate) fn call_site() -> Self { LexError { span: Span::call_site(), } @@ -151,9 +153,9 @@ fn get_cursor(src: &str) -> Cursor { // Create a dummy file & add it to the source map #[cfg(not(fuzzing))] - SOURCE_MAP.with(|cm| { - let mut cm = cm.borrow_mut(); - let span = cm.add_file(src); + SOURCE_MAP.with(|sm| { + let mut sm = sm.borrow_mut(); + let span = sm.add_file(src); Cursor { rest: src, off: span.lo, @@ -334,6 +336,12 @@ thread_local! { }); } +#[cfg(span_locations)] +pub(crate) fn invalidate_current_thread_spans() { + #[cfg(not(fuzzing))] + SOURCE_MAP.with(|sm| sm.borrow_mut().files.truncate(1)); +} + #[cfg(all(span_locations, not(fuzzing)))] struct FileInfo { source_text: String, @@ -366,7 +374,7 @@ impl FileInfo { span.lo >= self.span.lo && span.hi <= self.span.hi } - fn source_text(&mut self, span: Span) -> String { + fn byte_range(&mut self, span: Span) -> Range { let lo_char = (span.lo - self.span.lo) as usize; // Look up offset of the largest already-computed char index that is @@ -395,11 +403,15 @@ impl FileInfo { let trunc_lo = &self.source_text[lo_byte..]; let char_len = (span.hi - span.lo) as usize; - let source_text = match trunc_lo.char_indices().nth(char_len) { - Some((offset, _ch)) => &trunc_lo[..offset], - None => trunc_lo, - }; - source_text.to_owned() + lo_byte..match trunc_lo.char_indices().nth(char_len) { + Some((offset, _ch)) => lo_byte + offset, + None => self.source_text.len(), + } + } + + fn source_text(&mut self, span: Span) -> String { + let byte_range = self.byte_range(span); + self.source_text[byte_range].to_owned() } } @@ -534,22 +546,37 @@ impl Span { }; #[cfg(not(fuzzing))] - SOURCE_MAP.with(|cm| { - let cm = cm.borrow(); - let path = cm.filepath(*self); + SOURCE_MAP.with(|sm| { + let sm = sm.borrow(); + let path = sm.filepath(*self); SourceFile { path } }) } + #[cfg(span_locations)] + pub fn byte_range(&self) -> Range { + #[cfg(fuzzing)] + return 0..0; + + #[cfg(not(fuzzing))] + { + if self.is_call_site() { + 0..0 + } else { + SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).byte_range(*self)) + } + } + } + #[cfg(span_locations)] pub fn start(&self) -> LineColumn { #[cfg(fuzzing)] return LineColumn { line: 0, column: 0 }; #[cfg(not(fuzzing))] - SOURCE_MAP.with(|cm| { - let cm = cm.borrow(); - let fi = cm.fileinfo(*self); + SOURCE_MAP.with(|sm| { + let sm = sm.borrow(); + let fi = sm.fileinfo(*self); fi.offset_line_column(self.lo as usize) }) } @@ -560,9 +587,9 @@ impl Span { return LineColumn { line: 0, column: 0 }; #[cfg(not(fuzzing))] - SOURCE_MAP.with(|cm| { - let cm = cm.borrow(); - let fi = cm.fileinfo(*self); + SOURCE_MAP.with(|sm| { + let sm = sm.borrow(); + let fi = sm.fileinfo(*self); fi.offset_line_column(self.hi as usize) }) } @@ -581,10 +608,10 @@ impl Span { }; #[cfg(not(fuzzing))] - SOURCE_MAP.with(|cm| { - let cm = cm.borrow(); + SOURCE_MAP.with(|sm| { + let sm = sm.borrow(); // If `other` is not within the same FileInfo as us, return None. - if !cm.fileinfo(*self).span_within(other) { + if !sm.fileinfo(*self).span_within(other) { return None; } Some(Span { @@ -609,7 +636,7 @@ impl Span { if self.is_call_site() { None } else { - Some(SOURCE_MAP.with(|cm| cm.borrow_mut().fileinfo_mut(*self).source_text(*self))) + Some(SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).source_text(*self))) } } } diff --git a/vendor/proc-macro2/src/lib.rs b/vendor/proc-macro2/src/lib.rs index d5a5b9957..01f2049cc 100644 --- a/vendor/proc-macro2/src/lib.rs +++ b/vendor/proc-macro2/src/lib.rs @@ -86,10 +86,11 @@ //! a different thread. // Proc-macro2 types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.70")] +#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.78")] #![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] #![cfg_attr(super_unstable, feature(proc_macro_def_site))] #![cfg_attr(doc_cfg, feature(doc_cfg))] +#![deny(unsafe_op_in_unsafe_fn)] #![allow( clippy::cast_lossless, clippy::cast_possible_truncation, @@ -121,6 +122,15 @@ compile_error! {"\ build script as well. "} +#[cfg(all( + procmacro2_nightly_testing, + feature = "proc-macro", + not(proc_macro_span) +))] +compile_error! {"\ + Build script probe failed to compile. +"} + extern crate alloc; #[cfg(feature = "proc-macro")] @@ -150,10 +160,12 @@ mod imp; mod location; use crate::extra::DelimSpan; -use crate::marker::Marker; +use crate::marker::{ProcMacroAutoTraits, MARKER}; use core::cmp::Ordering; use core::fmt::{self, Debug, Display}; use core::hash::{Hash, Hasher}; +#[cfg(span_locations)] +use core::ops::Range; use core::ops::RangeBounds; use core::str::FromStr; use std::error::Error; @@ -161,6 +173,7 @@ use std::error::Error; use std::path::PathBuf; #[cfg(span_locations)] +#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))] pub use crate::location::LineColumn; /// An abstract stream of tokens, or more concretely a sequence of token trees. @@ -173,27 +186,27 @@ pub use crate::location::LineColumn; #[derive(Clone)] pub struct TokenStream { inner: imp::TokenStream, - _marker: Marker, + _marker: ProcMacroAutoTraits, } /// Error returned from `TokenStream::from_str`. pub struct LexError { inner: imp::LexError, - _marker: Marker, + _marker: ProcMacroAutoTraits, } impl TokenStream { fn _new(inner: imp::TokenStream) -> Self { TokenStream { inner, - _marker: Marker, + _marker: MARKER, } } fn _new_fallback(inner: fallback::TokenStream) -> Self { TokenStream { inner: inner.into(), - _marker: Marker, + _marker: MARKER, } } @@ -230,7 +243,7 @@ impl FromStr for TokenStream { fn from_str(src: &str) -> Result { let e = src.parse().map_err(|e| LexError { inner: e, - _marker: Marker, + _marker: MARKER, })?; Ok(TokenStream::_new(e)) } @@ -328,7 +341,7 @@ impl Error for LexError {} #[derive(Clone, PartialEq, Eq)] pub struct SourceFile { inner: imp::SourceFile, - _marker: Marker, + _marker: ProcMacroAutoTraits, } #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] @@ -336,7 +349,7 @@ impl SourceFile { fn _new(inner: imp::SourceFile) -> Self { SourceFile { inner, - _marker: Marker, + _marker: MARKER, } } @@ -375,21 +388,21 @@ impl Debug for SourceFile { #[derive(Copy, Clone)] pub struct Span { inner: imp::Span, - _marker: Marker, + _marker: ProcMacroAutoTraits, } impl Span { fn _new(inner: imp::Span) -> Self { Span { inner, - _marker: Marker, + _marker: MARKER, } } fn _new_fallback(inner: fallback::Span) -> Self { Span { inner: inner.into(), - _marker: Marker, + _marker: MARKER, } } @@ -461,6 +474,21 @@ impl Span { SourceFile::_new(self.inner.source_file()) } + /// Returns the span's byte position range in the source file. + /// + /// This method requires the `"span-locations"` feature to be enabled. + /// + /// When executing in a procedural macro context, the returned range is only + /// accurate if compiled with a nightly toolchain. The stable toolchain does + /// not have this information available. When executing outside of a + /// procedural macro, such as main.rs or build.rs, the byte range is always + /// accurate regardless of toolchain. + #[cfg(span_locations)] + #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))] + pub fn byte_range(&self) -> Range { + self.inner.byte_range() + } + /// Get the starting line/column in the source file for this span. /// /// This method requires the `"span-locations"` feature to be enabled. @@ -908,14 +936,14 @@ impl Debug for Punct { #[derive(Clone)] pub struct Ident { inner: imp::Ident, - _marker: Marker, + _marker: ProcMacroAutoTraits, } impl Ident { fn _new(inner: imp::Ident) -> Self { Ident { inner, - _marker: Marker, + _marker: MARKER, } } @@ -1035,7 +1063,7 @@ impl Debug for Ident { #[derive(Clone)] pub struct Literal { inner: imp::Literal, - _marker: Marker, + _marker: ProcMacroAutoTraits, } macro_rules! suffixed_int_literals { @@ -1082,14 +1110,14 @@ impl Literal { fn _new(inner: imp::Literal) -> Self { Literal { inner, - _marker: Marker, + _marker: MARKER, } } fn _new_fallback(inner: fallback::Literal) -> Self { Literal { inner: inner.into(), - _marker: Marker, + _marker: MARKER, } } @@ -1239,7 +1267,7 @@ impl Literal { // representation. This is not public API other than for quote. #[doc(hidden)] pub unsafe fn from_str_unchecked(repr: &str) -> Self { - Literal::_new(imp::Literal::from_str_unchecked(repr)) + Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) }) } } @@ -1249,7 +1277,7 @@ impl FromStr for Literal { fn from_str(repr: &str) -> Result { repr.parse().map(Literal::_new).map_err(|inner| LexError { inner, - _marker: Marker, + _marker: MARKER, }) } } @@ -1268,7 +1296,7 @@ impl Display for Literal { /// Public implementation details for the `TokenStream` type, such as iterators. pub mod token_stream { - use crate::marker::Marker; + use crate::marker::{ProcMacroAutoTraits, MARKER}; use crate::{imp, TokenTree}; use core::fmt::{self, Debug}; @@ -1281,7 +1309,7 @@ pub mod token_stream { #[derive(Clone)] pub struct IntoIter { inner: imp::TokenTreeIter, - _marker: Marker, + _marker: ProcMacroAutoTraits, } impl Iterator for IntoIter { @@ -1310,7 +1338,7 @@ pub mod token_stream { fn into_iter(self) -> IntoIter { IntoIter { inner: self.inner.into_iter(), - _marker: Marker, + _marker: MARKER, } } } diff --git a/vendor/proc-macro2/src/marker.rs b/vendor/proc-macro2/src/marker.rs index e648dd21a..23b94ce6f 100644 --- a/vendor/proc-macro2/src/marker.rs +++ b/vendor/proc-macro2/src/marker.rs @@ -4,15 +4,14 @@ use core::panic::{RefUnwindSafe, UnwindSafe}; // Zero sized marker with the correct set of autotrait impls we want all proc // macro types to have. -pub(crate) type Marker = PhantomData; +#[derive(Copy, Clone)] +#[cfg_attr( + all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)), + derive(PartialEq, Eq) +)] +pub(crate) struct ProcMacroAutoTraits(PhantomData>); -pub(crate) use self::value::*; - -mod value { - pub(crate) use core::marker::PhantomData as Marker; -} - -pub(crate) struct ProcMacroAutoTraits(Rc<()>); +pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData); impl UnwindSafe for ProcMacroAutoTraits {} impl RefUnwindSafe for ProcMacroAutoTraits {} diff --git a/vendor/proc-macro2/src/wrapper.rs b/vendor/proc-macro2/src/wrapper.rs index 37fdf37f2..a71043abc 100644 --- a/vendor/proc-macro2/src/wrapper.rs +++ b/vendor/proc-macro2/src/wrapper.rs @@ -3,6 +3,8 @@ use crate::detection::inside_proc_macro; use crate::location::LineColumn; use crate::{fallback, Delimiter, Punct, Spacing, TokenTree}; use core::fmt::{self, Debug, Display}; +#[cfg(span_locations)] +use core::ops::Range; use core::ops::RangeBounds; use core::str::FromStr; use std::panic; @@ -28,18 +30,23 @@ pub(crate) struct DeferredTokenStream { pub(crate) enum LexError { Compiler(proc_macro::LexError), Fallback(fallback::LexError), + + // Rustc was supposed to return a LexError, but it panicked instead. + // https://github.com/rust-lang/rust/issues/58736 + CompilerPanic, } -impl LexError { - fn call_site() -> Self { - LexError::Fallback(fallback::LexError { - span: fallback::Span::call_site(), - }) +#[cold] +fn mismatch(line: u32) -> ! { + #[cfg(procmacro2_backtrace)] + { + let backtrace = std::backtrace::Backtrace::force_capture(); + panic!("compiler/fallback mismatch #{}\n\n{}", line, backtrace) + } + #[cfg(not(procmacro2_backtrace))] + { + panic!("compiler/fallback mismatch #{}", line) } -} - -fn mismatch() -> ! { - panic!("compiler/fallback mismatch") } impl DeferredTokenStream { @@ -88,13 +95,13 @@ impl TokenStream { fn unwrap_nightly(self) -> proc_macro::TokenStream { match self { TokenStream::Compiler(s) => s.into_token_stream(), - TokenStream::Fallback(_) => mismatch(), + TokenStream::Fallback(_) => mismatch(line!()), } } fn unwrap_stable(self) -> fallback::TokenStream { match self { - TokenStream::Compiler(_) => mismatch(), + TokenStream::Compiler(_) => mismatch(line!()), TokenStream::Fallback(s) => s, } } @@ -117,7 +124,7 @@ impl FromStr for TokenStream { // Work around https://github.com/rust-lang/rust/issues/58736. fn proc_macro_parse(src: &str) -> Result { let result = panic::catch_unwind(|| src.parse().map_err(LexError::Compiler)); - result.unwrap_or_else(|_| Err(LexError::call_site())) + result.unwrap_or_else(|_| Err(LexError::CompilerPanic)) } impl Display for TokenStream { @@ -198,14 +205,14 @@ impl FromIterator for TokenStream { first.evaluate_now(); first.stream.extend(streams.map(|s| match s { TokenStream::Compiler(s) => s.into_token_stream(), - TokenStream::Fallback(_) => mismatch(), + TokenStream::Fallback(_) => mismatch(line!()), })); TokenStream::Compiler(first) } Some(TokenStream::Fallback(mut first)) => { first.extend(streams.map(|s| match s { TokenStream::Fallback(s) => s, - TokenStream::Compiler(_) => mismatch(), + TokenStream::Compiler(_) => mismatch(line!()), })); TokenStream::Fallback(first) } @@ -255,7 +262,7 @@ impl Debug for TokenStream { impl LexError { pub(crate) fn span(&self) -> Span { match self { - LexError::Compiler(_) => Span::call_site(), + LexError::Compiler(_) | LexError::CompilerPanic => Span::call_site(), LexError::Fallback(e) => Span::Fallback(e.span()), } } @@ -278,6 +285,10 @@ impl Debug for LexError { match self { LexError::Compiler(e) => Debug::fmt(e, f), LexError::Fallback(e) => Debug::fmt(e, f), + LexError::CompilerPanic => { + let fallback = fallback::LexError::call_site(); + Debug::fmt(&fallback, f) + } } } } @@ -287,6 +298,10 @@ impl Display for LexError { match self { LexError::Compiler(e) => Display::fmt(e, f), LexError::Fallback(e) => Display::fmt(e, f), + LexError::CompilerPanic => { + let fallback = fallback::LexError::call_site(); + Display::fmt(&fallback, f) + } } } } @@ -418,7 +433,8 @@ impl Span { match (self, other) { (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), - _ => mismatch(), + (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()), + (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()), } } @@ -426,7 +442,8 @@ impl Span { match (self, other) { (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), - _ => mismatch(), + (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()), + (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()), } } @@ -445,6 +462,17 @@ impl Span { } } + #[cfg(span_locations)] + pub fn byte_range(&self) -> Range { + match self { + #[cfg(proc_macro_span)] + Span::Compiler(s) => s.byte_range(), + #[cfg(not(proc_macro_span))] + Span::Compiler(_) => 0..0, + Span::Fallback(s) => s.byte_range(), + } + } + #[cfg(span_locations)] pub fn start(&self) -> LineColumn { match self { @@ -493,7 +521,7 @@ impl Span { fn unwrap_nightly(self) -> proc_macro::Span { match self { Span::Compiler(s) => s, - Span::Fallback(_) => mismatch(), + Span::Fallback(_) => mismatch(line!()), } } } @@ -596,14 +624,15 @@ impl Group { match (self, span) { (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s), (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s), - _ => mismatch(), + (Group::Compiler(_), Span::Fallback(_)) => mismatch(line!()), + (Group::Fallback(_), Span::Compiler(_)) => mismatch(line!()), } } fn unwrap_nightly(self) -> proc_macro::Group { match self { Group::Compiler(g) => g, - Group::Fallback(_) => mismatch(), + Group::Fallback(_) => mismatch(line!()), } } } @@ -674,14 +703,15 @@ impl Ident { match (self, span) { (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s), (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s), - _ => mismatch(), + (Ident::Compiler(_), Span::Fallback(_)) => mismatch(line!()), + (Ident::Fallback(_), Span::Compiler(_)) => mismatch(line!()), } } fn unwrap_nightly(self) -> proc_macro::Ident { match self { Ident::Compiler(s) => s, - Ident::Fallback(_) => mismatch(), + Ident::Fallback(_) => mismatch(line!()), } } } @@ -691,7 +721,8 @@ impl PartialEq for Ident { match (self, other) { (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(), (Ident::Fallback(t), Ident::Fallback(o)) => t == o, - _ => mismatch(), + (Ident::Compiler(_), Ident::Fallback(_)) => mismatch(line!()), + (Ident::Fallback(_), Ident::Compiler(_)) => mismatch(line!()), } } } @@ -762,7 +793,7 @@ impl Literal { if inside_proc_macro() { Literal::Compiler(proc_macro::Literal::from_str(repr).expect("invalid literal")) } else { - Literal::Fallback(fallback::Literal::from_str_unchecked(repr)) + Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) }) } } @@ -850,7 +881,8 @@ impl Literal { match (self, span) { (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s), (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s), - _ => mismatch(), + (Literal::Compiler(_), Span::Fallback(_)) => mismatch(line!()), + (Literal::Fallback(_), Span::Compiler(_)) => mismatch(line!()), } } @@ -867,7 +899,7 @@ impl Literal { fn unwrap_nightly(self) -> proc_macro::Literal { match self { Literal::Compiler(s) => s, - Literal::Fallback(_) => mismatch(), + Literal::Fallback(_) => mismatch(line!()), } } } @@ -909,3 +941,14 @@ impl Debug for Literal { } } } + +#[cfg(span_locations)] +pub(crate) fn invalidate_current_thread_spans() { + if inside_proc_macro() { + panic!( + "proc_macro2::extra::invalidate_current_thread_spans is not available in procedural macros" + ); + } else { + crate::fallback::invalidate_current_thread_spans(); + } +} diff --git a/vendor/proc-macro2/tests/test.rs b/vendor/proc-macro2/tests/test.rs index b75cd5527..486955cfc 100644 --- a/vendor/proc-macro2/tests/test.rs +++ b/vendor/proc-macro2/tests/test.rs @@ -757,3 +757,39 @@ fn byte_order_mark() { let string = "foo\u{feff}"; string.parse::().unwrap_err(); } + +#[cfg(span_locations)] +fn create_span() -> proc_macro2::Span { + let tts: TokenStream = "1".parse().unwrap(); + match tts.into_iter().next().unwrap() { + TokenTree::Literal(literal) => literal.span(), + _ => unreachable!(), + } +} + +#[cfg(span_locations)] +#[test] +fn test_invalidate_current_thread_spans() { + let actual = format!("{:#?}", create_span()); + assert_eq!(actual, "bytes(1..2)"); + let actual = format!("{:#?}", create_span()); + assert_eq!(actual, "bytes(3..4)"); + + proc_macro2::extra::invalidate_current_thread_spans(); + + let actual = format!("{:#?}", create_span()); + // Test that span offsets have been reset after the call + // to invalidate_current_thread_spans() + assert_eq!(actual, "bytes(1..2)"); +} + +#[cfg(span_locations)] +#[test] +#[should_panic(expected = "Invalid span with no related FileInfo!")] +fn test_use_span_after_invalidation() { + let span = create_span(); + + proc_macro2::extra::invalidate_current_thread_spans(); + + span.source_text(); +} diff --git a/vendor/proxmox-api-macro/.cargo-checksum.json b/vendor/proxmox-api-macro/.cargo-checksum.json index 13870bb5a..b9096f959 100644 --- a/vendor/proxmox-api-macro/.cargo-checksum.json +++ b/vendor/proxmox-api-macro/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"93316e92fcd2f53847af6cb0eff7d17bfc5ad5fc6dd203bb017d99ab2a65c302","src/api/attributes.rs":"0b080a3985f5dde6847927567eec6711bb593af6b046bfe7e6342bc26a6deabd","src/api/enums.rs":"fbfc9d46a829992e8bd6b07700e78ef3fb8904907e3b1c3d7bcfc2256e647a53","src/api/method.rs":"b7e91477c00ef39de819eaf8768f4ebffb379e2e03a8f34d7d802186022466d1","src/api/mod.rs":"619314d9750ac3b0cb82f397bfae6bd6e15399cb3607117accf342cbc27327cb","src/api/structs.rs":"e3a823713092e12f1c343911e4cd3e12514773eff9a04dff2264413450819e09","src/lib.rs":"f87643e20b46bd0a1357e7444706a85dd0e8195971330f083f27eae3950763b9","src/serde.rs":"7ba03f736063dcec5e47226b5049fe66148a0d65a8e2925ea3d12d05e1cc4fad","src/types.rs":"658011b06efa084615ca0fb09b20b67d4eb0c04e4c600b09cddd34cab9c9abe8","src/updater.rs":"699e45fa975e12e0dcc0e2f69649ec1ebeaee87c6ef593ea1d0dd2a3f6c2146b","src/util.rs":"70cd3706deee82fb184db25b26a47dae1878208eba8acc1e6b790d2438c6d3ff","tests/allof.rs":"44a776563e8fd66519cafd274a7188d448b56474f7522d898d37e2f919c4318b","tests/api1.rs":"494e9360a35eee79cb6c4afbb374540aaa0d743459105b75f3a3155cf4883384","tests/api2.rs":"2b238982c2582ca9145f842e495772d6c65e1e509356d9e451e29970b0b01544","tests/ext-schema.rs":"cb2ff7aef371721ce84b9ff57ba06af553f52336f165bf76754732dd2b28d032","tests/int-limits.rs":"9daba02a0ffe128961298b43a4fe83b8edc4c76a43285e610f481670e02ab5a6","tests/options.rs":"12faf5ba2761318bd454d6bc85ac5e9e1e344318b40851742d8eb8f5209576f0","tests/types.rs":"ad6b2eeb6cc96fc043b0ab23b6530566e3038ff5d4c07a5e864699d85dc47a25","tests/updater.rs":"6d1abad2ac9be5ecc3ae9f4565b2e445f1e033941545a8f600fcc9b78f0fc937"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"f26fde9b4ac1a710bb3a194e085ef01f7e6cdb6665f3fe0dbefa65d3a60e6eaf","src/api/attributes.rs":"0b080a3985f5dde6847927567eec6711bb593af6b046bfe7e6342bc26a6deabd","src/api/enums.rs":"a9ac212d9d76a7fbe9e761fe7afaf28381aa82fb90ea815e64a09b971dd9bb1a","src/api/method.rs":"b7e91477c00ef39de819eaf8768f4ebffb379e2e03a8f34d7d802186022466d1","src/api/mod.rs":"619314d9750ac3b0cb82f397bfae6bd6e15399cb3607117accf342cbc27327cb","src/api/structs.rs":"d1c250024c7f0a29987995718faf8383f1c57e6f345aa4f22454ec63b47ee3d5","src/lib.rs":"f87643e20b46bd0a1357e7444706a85dd0e8195971330f083f27eae3950763b9","src/serde.rs":"df9ef4708e4326225cbe66def72cc2dce8169ba01cb5fa62e48b0eef99e46af9","src/types.rs":"658011b06efa084615ca0fb09b20b67d4eb0c04e4c600b09cddd34cab9c9abe8","src/updater.rs":"699e45fa975e12e0dcc0e2f69649ec1ebeaee87c6ef593ea1d0dd2a3f6c2146b","src/util.rs":"70cd3706deee82fb184db25b26a47dae1878208eba8acc1e6b790d2438c6d3ff","tests/allof.rs":"44a776563e8fd66519cafd274a7188d448b56474f7522d898d37e2f919c4318b","tests/api1.rs":"494e9360a35eee79cb6c4afbb374540aaa0d743459105b75f3a3155cf4883384","tests/api2.rs":"2b238982c2582ca9145f842e495772d6c65e1e509356d9e451e29970b0b01544","tests/ext-schema.rs":"cb2ff7aef371721ce84b9ff57ba06af553f52336f165bf76754732dd2b28d032","tests/int-limits.rs":"9daba02a0ffe128961298b43a4fe83b8edc4c76a43285e610f481670e02ab5a6","tests/options.rs":"12faf5ba2761318bd454d6bc85ac5e9e1e344318b40851742d8eb8f5209576f0","tests/types.rs":"ad6b2eeb6cc96fc043b0ab23b6530566e3038ff5d4c07a5e864699d85dc47a25","tests/updater.rs":"6d1abad2ac9be5ecc3ae9f4565b2e445f1e033941545a8f600fcc9b78f0fc937"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-api-macro/Cargo.toml b/vendor/proxmox-api-macro/Cargo.toml index 4adfdf772..9bc8ef8fd 100644 --- a/vendor/proxmox-api-macro/Cargo.toml +++ b/vendor/proxmox-api-macro/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-api-macro" -version = "1.0.6" +version = "1.0.8" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "Proxmox API macro" @@ -40,12 +40,12 @@ futures = "0.3" serde_json = "1.0" [dev-dependencies.proxmox-router] -version = "2.1.1" +version = "2.1.3" path = "../proxmox-router" features = ["test-harness"] [dev-dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = [ "test-harness", diff --git a/vendor/proxmox-api-macro/src/api/enums.rs b/vendor/proxmox-api-macro/src/api/enums.rs index 879100bb2..2ad7ac821 100644 --- a/vendor/proxmox-api-macro/src/api/enums.rs +++ b/vendor/proxmox-api-macro/src/api/enums.rs @@ -57,7 +57,7 @@ pub fn handle_enum( comment = "".to_string(); } - let attrs = serde::SerdeAttrib::try_from(&variant.attrs[..])?; + let attrs = serde::VariantAttrib::try_from(&variant.attrs[..])?; let variant_string = if let Some(renamed) = attrs.rename { renamed } else if let Some(rename_all) = container_attrs.rename_all { diff --git a/vendor/proxmox-api-macro/src/api/structs.rs b/vendor/proxmox-api-macro/src/api/structs.rs index 459d47593..f9d35be86 100644 --- a/vendor/proxmox-api-macro/src/api/structs.rs +++ b/vendor/proxmox-api-macro/src/api/structs.rs @@ -160,7 +160,7 @@ fn handle_regular_struct( if let syn::Fields::Named(ref fields) = &stru.fields { for field in &fields.named { - let attrs = serde::SerdeAttrib::try_from(&field.attrs[..])?; + let attrs = serde::FieldAttrib::try_from(&field.attrs[..])?; let (name, span) = { let ident: &Ident = field @@ -168,7 +168,7 @@ fn handle_regular_struct( .as_ref() .ok_or_else(|| format_err!(field => "field without name?"))?; - if let Some(renamed) = attrs.rename { + if let Some(renamed) = attrs.rename.clone() { (renamed.value(), ident.span()) } else if let Some(rename_all) = container_attrs.rename_all { let name = rename_all.apply_to_field(&ident.to_string()); @@ -201,7 +201,7 @@ fn handle_regular_struct( } } - handle_regular_field(field_def, field, false)?; + handle_regular_field(field_def, field, false, &attrs)?; if attrs.flatten { all_of_schemas.extend(quote::quote! {&}); @@ -215,7 +215,7 @@ fn handle_regular_struct( false, Schema::blank(span), ); - handle_regular_field(&mut field_def, field, true)?; + handle_regular_field(&mut field_def, field, true, &attrs)?; if attrs.flatten { all_of_schemas.extend(quote::quote! {&}); @@ -373,6 +373,7 @@ fn handle_regular_field( field_def: &mut ObjectEntry, field: &syn::Field, derived: bool, // whether this field was missing in the schema + attrs: &serde::FieldAttrib, ) -> Result<(), Error> { let schema: &mut Schema = &mut field_def.schema; @@ -389,6 +390,8 @@ fn handle_regular_field( } else if !field_def.optional.expect_bool() { error!(&field.ty => "non-optional Option type?"); } + } else { + attrs.check_non_option_type(); } Ok(()) diff --git a/vendor/proxmox-api-macro/src/serde.rs b/vendor/proxmox-api-macro/src/serde.rs index c3148a086..2821f8d57 100644 --- a/vendor/proxmox-api-macro/src/serde.rs +++ b/vendor/proxmox-api-macro/src/serde.rs @@ -5,7 +5,9 @@ use std::convert::TryFrom; +use proc_macro2::Span; use syn::punctuated::Punctuated; +use syn::spanned::Spanned; use syn::Token; /// Serde name types. @@ -166,14 +168,16 @@ impl TryFrom<&[syn::Attribute]> for ContainerAttrib { } } -/// `serde` field/variant attributes we support +/// `serde` field attributes we support #[derive(Default)] -pub struct SerdeAttrib { +pub struct FieldAttrib { pub rename: Option, pub flatten: bool, + has_skip_serializing_if: Option, + has_default: bool, } -impl SerdeAttrib { +impl FieldAttrib { pub fn parse_attribute(&mut self, attrib: &syn::Attribute) -> Result<(), syn::Error> { let list = match &attrib.meta { syn::Meta::List(list) if list.path.is_ident("serde") => list, @@ -200,14 +204,80 @@ impl SerdeAttrib { } else if path.is_ident("flatten") { arg.require_path_only()?; self.flatten = true; + } else if path.is_ident("skip_serializing_if") { + self.has_skip_serializing_if = Some(match arg.require_name_value() { + Ok(nv) => nv.span(), + Err(_) => arg.span(), + }); + } else if path.is_ident("default") { + self.has_default = true; } } Ok(()) } + + pub fn check_non_option_type(&self) { + if let Some(span) = self.has_skip_serializing_if { + if !self.has_default { + error!(span, "`skip_serializing_if` without `default`"); + } + } + } } -impl TryFrom<&[syn::Attribute]> for SerdeAttrib { +impl TryFrom<&[syn::Attribute]> for FieldAttrib { + type Error = syn::Error; + + fn try_from(attributes: &[syn::Attribute]) -> Result { + let mut this: Self = Default::default(); + + for attrib in attributes { + this.parse_attribute(attrib)?; + } + + Ok(this) + } +} + +/// `serde` variant attributes we support +#[derive(Default)] +pub struct VariantAttrib { + pub rename: Option, +} + +impl VariantAttrib { + pub fn parse_attribute(&mut self, attrib: &syn::Attribute) -> Result<(), syn::Error> { + let list = match &attrib.meta { + syn::Meta::List(list) if list.path.is_ident("serde") => list, + _ => return Ok(()), + }; + + let args = list.parse_args_with(Punctuated::::parse_terminated)?; + + for arg in args { + let path = arg.path(); + if path.is_ident("rename") { + match &arg.require_name_value()?.value { + syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(rename), + .. + }) => { + if self.rename.is_some() && self.rename.as_ref() != Some(rename) { + error!(&rename => "multiple conflicting 'rename' attributes"); + } + self.rename = Some(rename.clone()); + } + value => error!(value => "'rename' value must be a string literal"), + } + } + } + + Ok(()) + } +} + +impl TryFrom<&[syn::Attribute]> for VariantAttrib { type Error = syn::Error; fn try_from(attributes: &[syn::Attribute]) -> Result { diff --git a/vendor/proxmox-apt/.cargo-checksum.json b/vendor/proxmox-apt/.cargo-checksum.json index ccc730a22..2ea5cfcde 100644 --- a/vendor/proxmox-apt/.cargo-checksum.json +++ b/vendor/proxmox-apt/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"690cc34c205a9cbf230981ff64b759e082f8b52068828283f2cfe6313f26949e","src/config.rs":"b400366c5c2b3584f1ea0635150292e6031a1a6e35746c1d93749cb90a601256","src/deb822/mod.rs":"24a2e9d9150c4d3115b831add95ac13ae196a5fca47c61b382a027e1ac0fba02","src/deb822/packages_file.rs":"125d9b2584c8623e25b726cab3827fcfd94eba02f017d369b900eba6c783f344","src/deb822/release_file.rs":"6f3e3a59d6b00b6318addbb55ea36e6101dbef24d8333132e05969267b2644fa","src/deb822/sources_file.rs":"5513691f534756b2c99033b318ab7212d19f32742b6fa78674286a0743591bee","src/lib.rs":"8801c07bc03b99b129e7e42b2a2ec1d77f328b2f4d94022c9471045b9e7cba5e","src/repositories/file.rs":"0979b95ae8a7b123528f61fb2f52675f267b2842efbfb2d85652f4f6210c798c","src/repositories/file/list_parser.rs":"a015358388ad0c7331e1f35a2897ef9bba0923237f9a0693d1bacc7f2c9ba6db","src/repositories/file/sources_parser.rs":"c2a89c6ddb61959097044ab19fb24f862499fc8fe090ef351d82267243f4225d","src/repositories/mod.rs":"5edccaad744eb1767a42484cb89a5ed700dffdef1e6a2aab13f8500bafce96ae","src/repositories/release.rs":"ecf45cb4e00e2b99003d4c48d58c0d5023acb9d62f4f3105b909ee30bf9ee566","src/repositories/repository.rs":"aa6ffff6fb83dd0136c0311c3d54dd6c6cbb226a8ca782431f1c68ec8c1be72e","src/repositories/standard.rs":"8c49a64e78165d444baaef02c3920b32b3625d8d9202bef545ca1a32e65760fe","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_contrib_binary-amd64_Packages":"81076d23927be8e29244fed341860e9a1ac6469956f211f8a673238f02f97f7d","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_main_binary-amd64_Packages":"cf77eaa6fb5f4cda14da07de79f02af4ab532bac707b0767b0cf3a3a83008480","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_non-free_binary-amd64_Packages":"57290bd3407a886a55a3295d805e27f0886c2bed21b38eaedba79a7b5488556d","tests/deb822/release/deb.debian.org_debian_dists_bullseye_Release":"2242eb47fc19cc562e1143ff3d29141ec2b5570379cd24a40628b49c2997d3a2","tests/deb822/release/deb.debian.org_debian_dists_bullseye_Release_insecure":"ce0e5017550f91650fe4237e5654c6cfc2e7facf882c42a6eb8d5b5b5729b55d","tests/deb822/sources/deb.debian.org_debian_dists_bullseye_main_source_Sources":"a44bbb047176e5b2633d2fa74d06840c6677b74be8fc1f784aa91ed8c79952cf","tests/lists/download.proxmox.com_debian_pve_dists_bullseye_InRelease":"c870f184bc0ec69cb929e9a6b94f768a3b41f1ba4f7c09a1d8bc650dc339add0","tests/lists/ftp.debian.org_debian_dists_bullseye-updates_InRelease":"2b73e0e57577fa2014773ae367bdb6fa89a0c869c140871c5db7e6b801703ad2","tests/lists/ftp.debian.org_debian_dists_bullseye_InRelease":"c8b716f3e06ba9bec9065037600dd80252c080fc533c7d923800e569d4a913d4","tests/lists/security.debian.org_debian-security_dists_bullseye-security_InRelease":"8928b176cdb7a6010a55dd3e9890b572509ecdf66ea2e550c4c4fda46725152a","tests/repositories.rs":"9a08c5ee910ec0cc6d82e6dda684644fe1d0815fe69c45f79174cb0281ec2580","tests/sources.list.d.expected/absolute_suite.list":"fa084aa1bb07fe6e5e68556f6d746709d8d5cda9ef91d950b41fe929aacda086","tests/sources.list.d.expected/absolute_suite.sources":"8f252c92d7cd6b5aa9d5bf532c60fd6d2af8cdb6956000077c7cd17e5de8f2da","tests/sources.list.d.expected/bad-security.list":"b73fe5934101b11d748d6991fa32c29720e819fe4029faf38d5c2150e47f16e7","tests/sources.list.d.expected/bad.sources":"5f2a427e093c31c1046101185dfece80c8696650cad2946e3dabbe29b2aff4c6","tests/sources.list.d.expected/case.sources":"c6c18117d4b425fb163c27aa034b023446d80b74542eaef017ef280f3463dd7e","tests/sources.list.d.expected/cdroms.list":"036c0c6f31db59f5b15f7f1f3e2f3ecfd6d21b70a4923bb8448279207a9e9f19","tests/sources.list.d.expected/ceph-quincy-bookworm.list":"f42f1b8b3356e79d5011a398d73602afeee61878b2920c4e69b720aa2ee6c663","tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list":"eaa0d5799c1ff36be2f86ce35dfbf08f123e02d5519a75c5eec17e4a95a44f9d","tests/sources.list.d.expected/ceph-reef-enterprise-bookworm.list":"25ad9c5b60fc3fe4fa83e1791e2747205527042a5ad02bfa73a84ff783d2ee69","tests/sources.list.d.expected/files.list":"23d3cb433b65e01c85ee5080508eb27dfe145df91f3c6cf6f6849fa1e5b426a1","tests/sources.list.d.expected/multiline.sources":"a2466c6f67db81d18a4d2010e8328b2d22db6b363502024586b045eac8cd410e","tests/sources.list.d.expected/options_comment.list":"30612a8c7eb7599dd734b7ad48e22e00d8aad49c1b7e5c7853534d38e3ba544f","tests/sources.list.d.expected/pbs-enterprise.list":"ecefb881429f7a08b62a4120950b40bb1c545aa63f18044b9e50cf93bed6344d","tests/sources.list.d.expected/pve-alt.list":"cc45872b161d82756755235fb39a56f4221ba9006980833d042a51683bdde68c","tests/sources.list.d.expected/pve.list":"d9ec4f5cf0c40ebaba5fc03c49873187956374a9871c0d068c91d15466352a1e","tests/sources.list.d.expected/standard.list":"37d3e0a97eccc3eab642a6182f13be5afbcafde2ec379d7f651baf3c402695c8","tests/sources.list.d.expected/standard.sources":"894d7de0eae65741626724c2a0db08eef5535e8a764976f40600d523952722f6","tests/sources.list.d/absolute_suite.list":"677cbdf744461ec07aff2f7863ae9e2af492816c9c0e50268d510733972febb3","tests/sources.list.d/absolute_suite.sources":"8f252c92d7cd6b5aa9d5bf532c60fd6d2af8cdb6956000077c7cd17e5de8f2da","tests/sources.list.d/bad-security.list":"b73fe5934101b11d748d6991fa32c29720e819fe4029faf38d5c2150e47f16e7","tests/sources.list.d/bad.sources":"11b305d30219969ccdacd3e4fb60fa04e3f8f4b3e1c46346596ded176d4a714a","tests/sources.list.d/case.sources":"7cec22fb9c93a756056e0aba88efc524f07bc17c18b40f11e1573328ccc2be3a","tests/sources.list.d/cdroms.list":"123a21df5255efec1ab5f71c82778c960c37cf3fb0425d31a58b32bd421784e4","tests/sources.list.d/ceph-quincy-bookworm.list":"65eeb5b68b4e8159d732eda0b7eded10d2a13a61c40fbeca8042fce5711509d0","tests/sources.list.d/ceph-quincy-nosub-bookworm.list":"eaa0d5799c1ff36be2f86ce35dfbf08f123e02d5519a75c5eec17e4a95a44f9d","tests/sources.list.d/ceph-reef-enterprise-bookworm.list":"25ad9c5b60fc3fe4fa83e1791e2747205527042a5ad02bfa73a84ff783d2ee69","tests/sources.list.d/files.list":"581d106c0eb001e30607e069df26eb5bc469cd7eaca61b3d451661b06780c1a3","tests/sources.list.d/multiline.sources":"e5218510dfc8794eb88d73a7d444d8f34325b6286c8a7e08fdb4b49afe1a78f2","tests/sources.list.d/options_comment.list":"14d39dac1dbbff50435c3f2c3aa4808ed8bdf1b2c6f05dc73712e1fc4bdade80","tests/sources.list.d/pbs-enterprise.list":"9fa57cad75e19cef83b83cd3ca41a48939348f2b9b7e66a61094f22fc739eeee","tests/sources.list.d/pve-alt.list":"fecc83dc1459984107e7dc6f0d6d96423d5a6eefbc8ac614f28276a6b1359a78","tests/sources.list.d/pve.list":"62f412f71de38970018d46e882cbd9e38a70f8281af83811b15fd89e9e6f7d4f","tests/sources.list.d/standard.list":"70fb1508f23137973ae6161e2d47bd90ddac173361d131c9f95f38bd715a5c1a","tests/sources.list.d/standard.sources":"eaa221d673207eaf4e63908b17896305f717c08253ebe3745fe25248d950b2b2"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"ae773f2694e96681b919afcd9e4483839385cb605439b0369577ace757c27f2d","src/config.rs":"b400366c5c2b3584f1ea0635150292e6031a1a6e35746c1d93749cb90a601256","src/deb822/mod.rs":"24a2e9d9150c4d3115b831add95ac13ae196a5fca47c61b382a027e1ac0fba02","src/deb822/packages_file.rs":"125d9b2584c8623e25b726cab3827fcfd94eba02f017d369b900eba6c783f344","src/deb822/release_file.rs":"6f3e3a59d6b00b6318addbb55ea36e6101dbef24d8333132e05969267b2644fa","src/deb822/sources_file.rs":"5513691f534756b2c99033b318ab7212d19f32742b6fa78674286a0743591bee","src/lib.rs":"8801c07bc03b99b129e7e42b2a2ec1d77f328b2f4d94022c9471045b9e7cba5e","src/repositories/file.rs":"0979b95ae8a7b123528f61fb2f52675f267b2842efbfb2d85652f4f6210c798c","src/repositories/file/list_parser.rs":"a015358388ad0c7331e1f35a2897ef9bba0923237f9a0693d1bacc7f2c9ba6db","src/repositories/file/sources_parser.rs":"c2a89c6ddb61959097044ab19fb24f862499fc8fe090ef351d82267243f4225d","src/repositories/mod.rs":"5edccaad744eb1767a42484cb89a5ed700dffdef1e6a2aab13f8500bafce96ae","src/repositories/release.rs":"ecf45cb4e00e2b99003d4c48d58c0d5023acb9d62f4f3105b909ee30bf9ee566","src/repositories/repository.rs":"aa6ffff6fb83dd0136c0311c3d54dd6c6cbb226a8ca782431f1c68ec8c1be72e","src/repositories/standard.rs":"8c49a64e78165d444baaef02c3920b32b3625d8d9202bef545ca1a32e65760fe","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_contrib_binary-amd64_Packages":"81076d23927be8e29244fed341860e9a1ac6469956f211f8a673238f02f97f7d","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_main_binary-amd64_Packages":"cf77eaa6fb5f4cda14da07de79f02af4ab532bac707b0767b0cf3a3a83008480","tests/deb822/packages/deb.debian.org_debian_dists_bullseye_non-free_binary-amd64_Packages":"57290bd3407a886a55a3295d805e27f0886c2bed21b38eaedba79a7b5488556d","tests/deb822/release/deb.debian.org_debian_dists_bullseye_Release":"2242eb47fc19cc562e1143ff3d29141ec2b5570379cd24a40628b49c2997d3a2","tests/deb822/release/deb.debian.org_debian_dists_bullseye_Release_insecure":"ce0e5017550f91650fe4237e5654c6cfc2e7facf882c42a6eb8d5b5b5729b55d","tests/deb822/sources/deb.debian.org_debian_dists_bullseye_main_source_Sources":"a44bbb047176e5b2633d2fa74d06840c6677b74be8fc1f784aa91ed8c79952cf","tests/lists/download.proxmox.com_debian_pve_dists_bullseye_InRelease":"c870f184bc0ec69cb929e9a6b94f768a3b41f1ba4f7c09a1d8bc650dc339add0","tests/lists/ftp.debian.org_debian_dists_bullseye-updates_InRelease":"2b73e0e57577fa2014773ae367bdb6fa89a0c869c140871c5db7e6b801703ad2","tests/lists/ftp.debian.org_debian_dists_bullseye_InRelease":"c8b716f3e06ba9bec9065037600dd80252c080fc533c7d923800e569d4a913d4","tests/lists/security.debian.org_debian-security_dists_bullseye-security_InRelease":"8928b176cdb7a6010a55dd3e9890b572509ecdf66ea2e550c4c4fda46725152a","tests/repositories.rs":"9a08c5ee910ec0cc6d82e6dda684644fe1d0815fe69c45f79174cb0281ec2580","tests/sources.list.d.expected/absolute_suite.list":"fa084aa1bb07fe6e5e68556f6d746709d8d5cda9ef91d950b41fe929aacda086","tests/sources.list.d.expected/absolute_suite.sources":"8f252c92d7cd6b5aa9d5bf532c60fd6d2af8cdb6956000077c7cd17e5de8f2da","tests/sources.list.d.expected/bad-security.list":"b73fe5934101b11d748d6991fa32c29720e819fe4029faf38d5c2150e47f16e7","tests/sources.list.d.expected/bad.sources":"5f2a427e093c31c1046101185dfece80c8696650cad2946e3dabbe29b2aff4c6","tests/sources.list.d.expected/case.sources":"c6c18117d4b425fb163c27aa034b023446d80b74542eaef017ef280f3463dd7e","tests/sources.list.d.expected/cdroms.list":"036c0c6f31db59f5b15f7f1f3e2f3ecfd6d21b70a4923bb8448279207a9e9f19","tests/sources.list.d.expected/ceph-quincy-bookworm.list":"f42f1b8b3356e79d5011a398d73602afeee61878b2920c4e69b720aa2ee6c663","tests/sources.list.d.expected/ceph-quincy-nosub-bookworm.list":"eaa0d5799c1ff36be2f86ce35dfbf08f123e02d5519a75c5eec17e4a95a44f9d","tests/sources.list.d.expected/ceph-reef-enterprise-bookworm.list":"25ad9c5b60fc3fe4fa83e1791e2747205527042a5ad02bfa73a84ff783d2ee69","tests/sources.list.d.expected/files.list":"23d3cb433b65e01c85ee5080508eb27dfe145df91f3c6cf6f6849fa1e5b426a1","tests/sources.list.d.expected/multiline.sources":"a2466c6f67db81d18a4d2010e8328b2d22db6b363502024586b045eac8cd410e","tests/sources.list.d.expected/options_comment.list":"30612a8c7eb7599dd734b7ad48e22e00d8aad49c1b7e5c7853534d38e3ba544f","tests/sources.list.d.expected/pbs-enterprise.list":"ecefb881429f7a08b62a4120950b40bb1c545aa63f18044b9e50cf93bed6344d","tests/sources.list.d.expected/pve-alt.list":"cc45872b161d82756755235fb39a56f4221ba9006980833d042a51683bdde68c","tests/sources.list.d.expected/pve.list":"d9ec4f5cf0c40ebaba5fc03c49873187956374a9871c0d068c91d15466352a1e","tests/sources.list.d.expected/standard.list":"37d3e0a97eccc3eab642a6182f13be5afbcafde2ec379d7f651baf3c402695c8","tests/sources.list.d.expected/standard.sources":"894d7de0eae65741626724c2a0db08eef5535e8a764976f40600d523952722f6","tests/sources.list.d/absolute_suite.list":"677cbdf744461ec07aff2f7863ae9e2af492816c9c0e50268d510733972febb3","tests/sources.list.d/absolute_suite.sources":"8f252c92d7cd6b5aa9d5bf532c60fd6d2af8cdb6956000077c7cd17e5de8f2da","tests/sources.list.d/bad-security.list":"b73fe5934101b11d748d6991fa32c29720e819fe4029faf38d5c2150e47f16e7","tests/sources.list.d/bad.sources":"11b305d30219969ccdacd3e4fb60fa04e3f8f4b3e1c46346596ded176d4a714a","tests/sources.list.d/case.sources":"7cec22fb9c93a756056e0aba88efc524f07bc17c18b40f11e1573328ccc2be3a","tests/sources.list.d/cdroms.list":"123a21df5255efec1ab5f71c82778c960c37cf3fb0425d31a58b32bd421784e4","tests/sources.list.d/ceph-quincy-bookworm.list":"65eeb5b68b4e8159d732eda0b7eded10d2a13a61c40fbeca8042fce5711509d0","tests/sources.list.d/ceph-quincy-nosub-bookworm.list":"eaa0d5799c1ff36be2f86ce35dfbf08f123e02d5519a75c5eec17e4a95a44f9d","tests/sources.list.d/ceph-reef-enterprise-bookworm.list":"25ad9c5b60fc3fe4fa83e1791e2747205527042a5ad02bfa73a84ff783d2ee69","tests/sources.list.d/files.list":"581d106c0eb001e30607e069df26eb5bc469cd7eaca61b3d451661b06780c1a3","tests/sources.list.d/multiline.sources":"e5218510dfc8794eb88d73a7d444d8f34325b6286c8a7e08fdb4b49afe1a78f2","tests/sources.list.d/options_comment.list":"14d39dac1dbbff50435c3f2c3aa4808ed8bdf1b2c6f05dc73712e1fc4bdade80","tests/sources.list.d/pbs-enterprise.list":"9fa57cad75e19cef83b83cd3ca41a48939348f2b9b7e66a61094f22fc739eeee","tests/sources.list.d/pve-alt.list":"fecc83dc1459984107e7dc6f0d6d96423d5a6eefbc8ac614f28276a6b1359a78","tests/sources.list.d/pve.list":"62f412f71de38970018d46e882cbd9e38a70f8281af83811b15fd89e9e6f7d4f","tests/sources.list.d/standard.list":"70fb1508f23137973ae6161e2d47bd90ddac173361d131c9f95f38bd715a5c1a","tests/sources.list.d/standard.sources":"eaa221d673207eaf4e63908b17896305f717c08253ebe3745fe25248d950b2b2"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-apt/Cargo.toml b/vendor/proxmox-apt/Cargo.toml index 58e86ec56..ac6cf2c98 100644 --- a/vendor/proxmox-apt/Cargo.toml +++ b/vendor/proxmox-apt/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-apt" -version = "0.10.6" +version = "0.10.8" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "Proxmox library for APT" @@ -29,7 +29,7 @@ rfc822-like = "0.2.1" serde_json = "1.0" [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = ["api-macro"] diff --git a/vendor/proxmox-auth-api/.cargo-checksum.json b/vendor/proxmox-auth-api/.cargo-checksum.json index d8eec4fbe..23d9153c3 100644 --- a/vendor/proxmox-auth-api/.cargo-checksum.json +++ b/vendor/proxmox-auth-api/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"0c8da0a83b0e35d4bb30faa0b9e2ed1c10c17ea42eb420fe16cf6aea34b5541e","examples/passwd.rs":"16cc8b8b34aa83c40910dd98d6b8318434bb95aba81b3207dea85bd00e3d7dc3","src/api/access.rs":"99ecf21f8864fea260771d33d7d5618c359e77b0c60c46ce89ac729fa72128a8","src/api/mod.rs":"72321160a7c57bf58c6e664d7c0b311d29ac474ee83abff37c8430c452b4a9c9","src/api/ticket.rs":"c19b08a02a02b16c5103c997eaeb97145b02b3e860ced1932e848a3f545bd9a7","src/auth_key.rs":"a6cd10aeb0c6cd1a401b6a54cb968592da2349e136acf064c36d00c465122697","src/lib.rs":"f7a2eae01ef0a47d93a0898709e5accb5ed53affb4ca3045728085b8be294d76","src/pam_authenticator.rs":"49a4372ea25cf8a80f6e9ab4f73fcc267a0de48c5890d2c2fee938637d694803","src/ticket.rs":"48eab6008bec10aafdbbac8656735d1f0b25b3e5644d38a98d67e47404f68656","src/time.rs":"150571353602f092565d353c59e818188a4307e124d478d1aaac2dbd9927402a","src/types.rs":"6d80127db93c9d3360ce7d4deeed8f6a1c7e93be1178b6841392798ece61aa09"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"3ef1efb8f4b8544ec51ca11eae02d9eff7b278209e71af8546fab622e5cd0c82","examples/passwd.rs":"16cc8b8b34aa83c40910dd98d6b8318434bb95aba81b3207dea85bd00e3d7dc3","src/api/access.rs":"99ecf21f8864fea260771d33d7d5618c359e77b0c60c46ce89ac729fa72128a8","src/api/mod.rs":"72321160a7c57bf58c6e664d7c0b311d29ac474ee83abff37c8430c452b4a9c9","src/api/ticket.rs":"c19b08a02a02b16c5103c997eaeb97145b02b3e860ced1932e848a3f545bd9a7","src/auth_key.rs":"a6cd10aeb0c6cd1a401b6a54cb968592da2349e136acf064c36d00c465122697","src/lib.rs":"f7a2eae01ef0a47d93a0898709e5accb5ed53affb4ca3045728085b8be294d76","src/pam_authenticator.rs":"49a4372ea25cf8a80f6e9ab4f73fcc267a0de48c5890d2c2fee938637d694803","src/ticket.rs":"48eab6008bec10aafdbbac8656735d1f0b25b3e5644d38a98d67e47404f68656","src/time.rs":"150571353602f092565d353c59e818188a4307e124d478d1aaac2dbd9927402a","src/types.rs":"6d80127db93c9d3360ce7d4deeed8f6a1c7e93be1178b6841392798ece61aa09"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-auth-api/Cargo.toml b/vendor/proxmox-auth-api/Cargo.toml index 1983035b3..64ab77f12 100644 --- a/vendor/proxmox-auth-api/Cargo.toml +++ b/vendor/proxmox-auth-api/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-auth-api" -version = "0.3.2" +version = "0.3.3" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "Tickets, API and Realm handling" @@ -59,17 +59,17 @@ version = "2.1" optional = true [dependencies.proxmox-rest-server] -version = "0.5.0" +version = "0.5.2" path = "../proxmox-rest-server" optional = true [dependencies.proxmox-router] -version = "2.1.1" +version = "2.1.3" path = "../proxmox-router" optional = true [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = [ "api-macro", diff --git a/vendor/proxmox-compression/.cargo-checksum.json b/vendor/proxmox-compression/.cargo-checksum.json index 373d3e178..b344b62aa 100644 --- a/vendor/proxmox-compression/.cargo-checksum.json +++ b/vendor/proxmox-compression/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3e433211af04546a2b0425664bdee7098dbdf3f72c9d3fe7fd90cbd3dda390d0","src/compression.rs":"fd2334b377eb023525ae8aa9d0c2535e6713c64fab64f071f1598e018d60c935","src/lib.rs":"e39aa6c5668a9adf0be0df2dcd7bbc03866e3e977c80079546d51c96d53c5dd6","src/tar.rs":"9089305d890a76e4ea81b6d760ab265d8854879cb94339e1f3b77251928d8a59","src/zip.rs":"3dff059b733e35b6596d4e094c164c7e548328bb6b3625d448f2b5d2e896dab6","src/zstd.rs":"20b1c799b3d0c1737d45a82d6b2ffbbcc54142066e5fe9fc2643260d781e4ceb"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"e1b166dc536a796d751ca202e8423d4ffbf1534a754a94f1bf4bf179ed7cebd3","src/compression.rs":"fd2334b377eb023525ae8aa9d0c2535e6713c64fab64f071f1598e018d60c935","src/lib.rs":"e39aa6c5668a9adf0be0df2dcd7bbc03866e3e977c80079546d51c96d53c5dd6","src/tar.rs":"9089305d890a76e4ea81b6d760ab265d8854879cb94339e1f3b77251928d8a59","src/zip.rs":"3dff059b733e35b6596d4e094c164c7e548328bb6b3625d448f2b5d2e896dab6","src/zstd.rs":"20b1c799b3d0c1737d45a82d6b2ffbbcc54142066e5fe9fc2643260d781e4ceb"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-compression/Cargo.toml b/vendor/proxmox-compression/Cargo.toml index e887c3ea4..fee59bd29 100644 --- a/vendor/proxmox-compression/Cargo.toml +++ b/vendor/proxmox-compression/Cargo.toml @@ -40,7 +40,7 @@ version = "1.1" path = "../proxmox-lang" [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [dependencies.tokio] diff --git a/vendor/proxmox-http/.cargo-checksum.json b/vendor/proxmox-http/.cargo-checksum.json index 41e42dfc2..f018a18fc 100644 --- a/vendor/proxmox-http/.cargo-checksum.json +++ b/vendor/proxmox-http/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"452e8bfd8b66bb844b5c77653080211cc01b1d06214c04454fae2a694f913409","src/client/connector.rs":"33d5dd1b4343875b7312259549096ccf8f7a73e5aed52371796c8586088c6327","src/client/mod.rs":"e983aae53b78b92bce946aa4ec0ba888dcfcc5f43f767c9cefe77d458184c5f7","src/client/simple.rs":"3da764ad7daff74e2335962762dd2cca6b0b5eadbfe2f822f7e764d6c6d81d89","src/client/sync.rs":"a588a11a512dbb030a4f16c454f09d51dd51e8474cb4464fb4e3182fb8fd0ae5","src/client/tls.rs":"31af1bb8eeaa53f5de06d5000839c99e8bf9559984ab4c6d1ae58f8dea76ba2d","src/client_trait.rs":"123c7977bdd7bd33731cb8d0f3d0a6cf8793755d6cf3a20884df1ef522d4eece","src/http_options.rs":"083a6ec2cd20dee74590a6da994f2aaa8d1d60b4e61949afe519b2bfa9729fcb","src/lib.rs":"b4f6f128aa781945ed862b387a90b92e12b121f08043175a7677128cab1c0fc2","src/proxy_config.rs":"fa593b46d0628e36a18a56c4e902be547688c53d6e286df1e3f301848928e07c","src/rate_limited_stream.rs":"f0b4b9e6faef9b9d6a891dcf65617eb0aef3e063d15dd03dd407ff00ef18cd42","src/rate_limiter.rs":"19a3d4d9192079a61e47bad3eb0b1e2639b83beb9eb0ab9bc67ec63048d63c37","src/uri.rs":"2acb95a8700e3bc06ee348011caa0756f6ac63300167d70085e263023bb498ca","src/websocket/mod.rs":"103afc1df63d83870e025259a1892642fb60611f239d0ed689fedadd6f3e2942"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"452e8bfd8b66bb844b5c77653080211cc01b1d06214c04454fae2a694f913409","src/client/connector.rs":"33d5dd1b4343875b7312259549096ccf8f7a73e5aed52371796c8586088c6327","src/client/mod.rs":"e983aae53b78b92bce946aa4ec0ba888dcfcc5f43f767c9cefe77d458184c5f7","src/client/simple.rs":"3da764ad7daff74e2335962762dd2cca6b0b5eadbfe2f822f7e764d6c6d81d89","src/client/sync.rs":"34abc739d4a93e0ba1086274420858225e25c503f58d52f0747a21342bcc9f3b","src/client/tls.rs":"31af1bb8eeaa53f5de06d5000839c99e8bf9559984ab4c6d1ae58f8dea76ba2d","src/client_trait.rs":"123c7977bdd7bd33731cb8d0f3d0a6cf8793755d6cf3a20884df1ef522d4eece","src/http_options.rs":"083a6ec2cd20dee74590a6da994f2aaa8d1d60b4e61949afe519b2bfa9729fcb","src/lib.rs":"b4f6f128aa781945ed862b387a90b92e12b121f08043175a7677128cab1c0fc2","src/proxy_config.rs":"fa593b46d0628e36a18a56c4e902be547688c53d6e286df1e3f301848928e07c","src/rate_limited_stream.rs":"f0b4b9e6faef9b9d6a891dcf65617eb0aef3e063d15dd03dd407ff00ef18cd42","src/rate_limiter.rs":"19a3d4d9192079a61e47bad3eb0b1e2639b83beb9eb0ab9bc67ec63048d63c37","src/uri.rs":"2acb95a8700e3bc06ee348011caa0756f6ac63300167d70085e263023bb498ca","src/websocket/mod.rs":"103afc1df63d83870e025259a1892642fb60611f239d0ed689fedadd6f3e2942"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-http/src/client/sync.rs b/vendor/proxmox-http/src/client/sync.rs index 119d8d683..195ce98fb 100644 --- a/vendor/proxmox-http/src/client/sync.rs +++ b/vendor/proxmox-http/src/client/sync.rs @@ -21,8 +21,8 @@ impl Client { fn agent(&self) -> Result { let mut builder = ureq::AgentBuilder::new(); - builder = builder.user_agent(self.options.user_agent.as_deref().unwrap_or(&format!( - "proxmox-sync-http-client/{}", + builder = builder.user_agent(self.options.user_agent.as_deref().unwrap_or(concat!( + "proxmox-sync-http-client/", env!("CARGO_PKG_VERSION") ))); diff --git a/vendor/proxmox-human-byte/.cargo-checksum.json b/vendor/proxmox-human-byte/.cargo-checksum.json index 05b64fa64..6faf1d65a 100644 --- a/vendor/proxmox-human-byte/.cargo-checksum.json +++ b/vendor/proxmox-human-byte/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"c1294ae30d1bf770ec6456abf5f2a260e6f5a8975262e204073e943279f4713f","src/lib.rs":"63efdf976089636bb53b391ea28d77a1ac4ed74f7ffa7f2537d816bc85f67162"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"38b8a9e0f4282124efd3a1397c2572ffc21e60c94ba516b0e1f3edfbbe865749","src/lib.rs":"63efdf976089636bb53b391ea28d77a1ac4ed74f7ffa7f2537d816bc85f67162"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-human-byte/Cargo.toml b/vendor/proxmox-human-byte/Cargo.toml index 0bc4247f8..93e002554 100644 --- a/vendor/proxmox-human-byte/Cargo.toml +++ b/vendor/proxmox-human-byte/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-human-byte" -version = "0.1.2" +version = "0.1.3" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "Proxmox library for formatting byte sizes (IEC or SI)" @@ -24,7 +24,7 @@ anyhow = "1.0" serde = "1.0" [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = ["api-macro"] diff --git a/vendor/proxmox-openid/.cargo-checksum.json b/vendor/proxmox-openid/.cargo-checksum.json index edb9bec9b..055eea231 100644 --- a/vendor/proxmox-openid/.cargo-checksum.json +++ b/vendor/proxmox-openid/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"84c432ff1f4206128f92b8c0c9086eb7cf5ef3eefba0f1070dfc75d960422b5f","src/auth_state.rs":"4f759614a8a7893c0e3e9a09225a05ac7c581c7dc158d790a9cbac4da92a26e1","src/http_client.rs":"ef5ef63a15f7d70985caa0ef2f28063e883ed7d9b52df89823061fe316bf5e38","src/lib.rs":"4a4c8491d12c42593fd53b052a7febfb9a6e931784b58460e5bd2ce31ea417ee"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"cd1092c566d02f2139f66b77fdf79e64116eba222721a5bfd4e3a63da39ab973","src/auth_state.rs":"4f759614a8a7893c0e3e9a09225a05ac7c581c7dc158d790a9cbac4da92a26e1","src/http_client.rs":"ef5ef63a15f7d70985caa0ef2f28063e883ed7d9b52df89823061fe316bf5e38","src/lib.rs":"4a4c8491d12c42593fd53b052a7febfb9a6e931784b58460e5bd2ce31ea417ee"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-openid/Cargo.toml b/vendor/proxmox-openid/Cargo.toml index eb6d5633a..ddbd35a23 100644 --- a/vendor/proxmox-openid/Cargo.toml +++ b/vendor/proxmox-openid/Cargo.toml @@ -41,7 +41,7 @@ path = "../proxmox-sys" features = ["timer"] [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [dependencies.serde] diff --git a/vendor/proxmox-rest-server/.cargo-checksum.json b/vendor/proxmox-rest-server/.cargo-checksum.json index b1f2ac06d..dc0400d26 100644 --- a/vendor/proxmox-rest-server/.cargo-checksum.json +++ b/vendor/proxmox-rest-server/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f66117a0d37fbb930807a3256f13535c8f4c80de0a671f3f85b45c91413a127e","examples/minimal-rest-server.rs":"24d2dd50f31924e68ffdc21786b2a6f6aeffcbb71834cfae8e6136d3b4d16dff","src/api_config.rs":"43c22d92b8ea68e2550cdea39e73b7d884f51af3349ac69f314c9a6bb04a2bda","src/command_socket.rs":"61e20888ffe917dc80461a297922761e86e8632a9d938833536192c6f6e03557","src/compression.rs":"b5075345ee0d3b2970f5b98bc077894726d0bc7bcb88ded39e4729c73b4aed5c","src/connection.rs":"e66a6317d902058f0d63add16a2e3a1820999c35e7c017ddc3432a425d2ded4d","src/daemon.rs":"b6b5cf9253cb1fc0a2adde041e2a2891c16dbee697ca1ae129be497f33a347e3","src/environment.rs":"e8e02fa96a935d2792560f018c9f4fa23b7f272d5c5bd21d97a4aaeeca415d06","src/file_logger.rs":"fa83c76fccd64da1d27ab73d5ee067bfdb99cbd5ebdca4665f7816390c90b4ee","src/formatter.rs":"4a0fe749ffb673c1087352de08dd0051f086f07b419060a1b11624407707f3d1","src/h2service.rs":"c9f4663e5bfca99c93a202bfdd845d8a3705f8fc8966374b722835213956ee75","src/lib.rs":"f9df4d29a3dddfc8003f3155a625ae8ce6bef20d304f9069a27018ac576ccc89","src/rest.rs":"02a75c252647190e7aedc5689cf035ab6c1e0cd6d4386ea76fce3cb924b0fd93","src/state.rs":"65718aa4093fe2f87fe47f7a2dca05bf19a13e6330d2a30cd5873b55c18bdb55","src/worker_task.rs":"a8c8ed3cc0b8817d35e2b88e4bb5856ac5174ce364cfef33636caf866f9f1e2e"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"da3730c43067380c696bf8c3afdcb55618c1fe802977ec5c6e1f81d8bfc731f4","examples/minimal-rest-server.rs":"24d2dd50f31924e68ffdc21786b2a6f6aeffcbb71834cfae8e6136d3b4d16dff","src/api_config.rs":"9f82fbcf62bcb67e9b11aaf5c8b64bb58ac19406d3668301024d6b9cf5e2fe60","src/command_socket.rs":"61e20888ffe917dc80461a297922761e86e8632a9d938833536192c6f6e03557","src/compression.rs":"b5075345ee0d3b2970f5b98bc077894726d0bc7bcb88ded39e4729c73b4aed5c","src/connection.rs":"e66a6317d902058f0d63add16a2e3a1820999c35e7c017ddc3432a425d2ded4d","src/daemon.rs":"6f48c2e4ae129ab7138b41e3e6e45f5adc4eebaaac96033e8ae3c8f77964aab1","src/environment.rs":"e8e02fa96a935d2792560f018c9f4fa23b7f272d5c5bd21d97a4aaeeca415d06","src/file_logger.rs":"fa83c76fccd64da1d27ab73d5ee067bfdb99cbd5ebdca4665f7816390c90b4ee","src/formatter.rs":"4a0fe749ffb673c1087352de08dd0051f086f07b419060a1b11624407707f3d1","src/h2service.rs":"c9f4663e5bfca99c93a202bfdd845d8a3705f8fc8966374b722835213956ee75","src/lib.rs":"d35a79f6c766d3dd5676313e85faa6291c44dfb5f2dd95580094f5eed4e46e7d","src/rest.rs":"8323deae3e3e365183427ccbec3df98d240b42e6abc7c2424789120f6a45f061","src/state.rs":"65718aa4093fe2f87fe47f7a2dca05bf19a13e6330d2a30cd5873b55c18bdb55","src/worker_task.rs":"a8c8ed3cc0b8817d35e2b88e4bb5856ac5174ce364cfef33636caf866f9f1e2e"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-rest-server/Cargo.toml b/vendor/proxmox-rest-server/Cargo.toml index 8eab89ca7..b667a6fc9 100644 --- a/vendor/proxmox-rest-server/Cargo.toml +++ b/vendor/proxmox-rest-server/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-rest-server" -version = "0.5.1" +version = "0.5.2" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "REST server implementation" @@ -67,11 +67,11 @@ version = "1.1" path = "../proxmox-lang" [dependencies.proxmox-router] -version = "2.1.1" +version = "2.1.3" path = "../proxmox-router" [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = [ "api-macro", @@ -87,7 +87,7 @@ features = [ ] [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [dependencies.serde] @@ -102,7 +102,7 @@ features = [ ] [dev-dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = ["api-macro"] diff --git a/vendor/proxmox-rest-server/src/api_config.rs b/vendor/proxmox-rest-server/src/api_config.rs index ad9a81113..805894466 100644 --- a/vendor/proxmox-rest-server/src/api_config.rs +++ b/vendor/proxmox-rest-server/src/api_config.rs @@ -1,13 +1,16 @@ use std::collections::HashMap; use std::future::Future; +use std::io; use std::path::PathBuf; use std::pin::Pin; use std::sync::{Arc, Mutex}; +use std::task::{Context, Poll}; use anyhow::{format_err, Error}; -use http::{HeaderMap, Method}; +use http::{HeaderMap, Method, Uri}; use hyper::http::request::Parts; use hyper::{Body, Response}; +use tower_service::Service; use proxmox_router::{Router, RpcEnvironmentType, UserInformation}; use proxmox_sys::fs::{create_path, CreateOptions}; @@ -25,6 +28,7 @@ pub struct ApiConfig { handlers: Vec, auth_handler: Option, index_handler: Option, + pub(crate) privileged_addr: Option, #[cfg(feature = "templates")] templates: templates::Templates, @@ -53,6 +57,7 @@ impl ApiConfig { handlers: Vec::new(), auth_handler: None, index_handler: None, + privileged_addr: None, #[cfg(feature = "templates")] templates: Default::default(), @@ -73,6 +78,12 @@ impl ApiConfig { self.auth_handler(AuthHandler::from_fn(func)) } + /// This is used for `protected` API calls to proxy to a more privileged service. + pub fn privileged_addr(mut self, addr: impl Into) -> Self { + self.privileged_addr = Some(addr.into()); + self + } + /// Set the index handler. pub fn index_handler(mut self, index_handler: IndexHandler) -> Self { self.index_handler = Some(index_handler); @@ -452,3 +463,156 @@ impl From for AuthError { AuthError::Generic(err) } } + +#[derive(Clone, Debug)] +/// For `protected` requests we support TCP or Unix connections. +pub enum PrivilegedAddr { + Tcp(std::net::SocketAddr), + Unix(std::os::unix::net::SocketAddr), +} + +impl From for PrivilegedAddr { + fn from(addr: std::net::SocketAddr) -> Self { + Self::Tcp(addr) + } +} + +impl From for PrivilegedAddr { + fn from(addr: std::os::unix::net::SocketAddr) -> Self { + Self::Unix(addr) + } +} + +impl Service for PrivilegedAddr { + type Response = PrivilegedSocket; + type Error = io::Error; + type Future = Pin> + Send>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _req: Uri) -> Self::Future { + match self { + PrivilegedAddr::Tcp(addr) => { + let addr = addr.clone(); + Box::pin(async move { + tokio::net::TcpStream::connect(addr) + .await + .map(PrivilegedSocket::Tcp) + }) + } + PrivilegedAddr::Unix(addr) => { + let addr = addr.clone(); + Box::pin(async move { + tokio::net::UnixStream::connect(addr.as_pathname().ok_or_else(|| { + io::Error::new(io::ErrorKind::Other, "empty path for unix socket") + })?) + .await + .map(PrivilegedSocket::Unix) + }) + } + } + } +} + +/// A socket which is either a TCP stream or a UNIX stream. +pub enum PrivilegedSocket { + Tcp(tokio::net::TcpStream), + Unix(tokio::net::UnixStream), +} + +impl tokio::io::AsyncRead for PrivilegedSocket { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &mut tokio::io::ReadBuf<'_>, + ) -> Poll> { + match self.get_mut() { + Self::Tcp(s) => Pin::new(s).poll_read(cx, buf), + Self::Unix(s) => Pin::new(s).poll_read(cx, buf), + } + } +} + +impl tokio::io::AsyncWrite for PrivilegedSocket { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + match self.get_mut() { + Self::Tcp(s) => Pin::new(s).poll_write(cx, buf), + Self::Unix(s) => Pin::new(s).poll_write(cx, buf), + } + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.get_mut() { + Self::Tcp(s) => Pin::new(s).poll_flush(cx), + Self::Unix(s) => Pin::new(s).poll_flush(cx), + } + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.get_mut() { + Self::Tcp(s) => Pin::new(s).poll_shutdown(cx), + Self::Unix(s) => Pin::new(s).poll_shutdown(cx), + } + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[io::IoSlice<'_>], + ) -> Poll> { + match self.get_mut() { + Self::Tcp(s) => Pin::new(s).poll_write_vectored(cx, bufs), + Self::Unix(s) => Pin::new(s).poll_write_vectored(cx, bufs), + } + } + + fn is_write_vectored(&self) -> bool { + match self { + Self::Tcp(s) => s.is_write_vectored(), + Self::Unix(s) => s.is_write_vectored(), + } + } +} + +impl hyper::client::connect::Connection for PrivilegedSocket { + fn connected(&self) -> hyper::client::connect::Connected { + match self { + Self::Tcp(s) => s.connected(), + Self::Unix(_) => hyper::client::connect::Connected::new(), + } + } +} + +/// Implements hyper's `Accept` for `UnixListener`s. +pub struct UnixAcceptor { + listener: tokio::net::UnixListener, +} + +impl From for UnixAcceptor { + fn from(listener: tokio::net::UnixListener) -> Self { + Self { listener } + } +} + +impl hyper::server::accept::Accept for UnixAcceptor { + type Conn = tokio::net::UnixStream; + type Error = io::Error; + + fn poll_accept( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll>> { + Pin::new(&mut self.get_mut().listener) + .poll_accept(cx) + .map(|res| match res { + Ok((stream, _addr)) => Some(Ok(stream)), + Err(err) => Some(Err(err)), + }) + } +} diff --git a/vendor/proxmox-rest-server/src/daemon.rs b/vendor/proxmox-rest-server/src/daemon.rs index 86d77dc09..fedbf5458 100644 --- a/vendor/proxmox-rest-server/src/daemon.rs +++ b/vendor/proxmox-rest-server/src/daemon.rs @@ -2,12 +2,13 @@ use std::ffi::CString; use std::future::Future; -use std::io::{Read, Write}; +use std::io::{self, Read, Write}; use std::os::raw::{c_char, c_int, c_uchar}; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}; use std::panic::UnwindSafe; use std::path::PathBuf; +use std::pin::Pin; use anyhow::{bail, format_err, Error}; use futures::future::{self, Either}; @@ -22,7 +23,8 @@ type BoxedStoreFunc = Box Result + UnwindSafe + Se // Helper trait to "store" something in the environment to be re-used after re-executing the // service on a reload. -trait Reloadable: Sized { +#[doc(hidden)] // not public api +pub trait Reloadable: Sized { fn restore(var: &str) -> Result; fn get_store_func(&self) -> Result; } @@ -222,33 +224,79 @@ impl Reloader { } } +fn fd_store_func(fd: RawFd) -> Result { + let mut fd_opt = Some(unsafe { + OwnedFd::from_raw_fd(nix::fcntl::fcntl( + fd, + nix::fcntl::FcntlArg::F_DUPFD_CLOEXEC(0), + )?) + }); + Ok(Box::new(move || { + let fd = fd_opt.take().unwrap(); + fd_change_cloexec(fd.as_raw_fd(), false)?; + Ok(fd.into_raw_fd().to_string()) + })) +} + +/// NOTE: This must only be used for *async* I/O objects! +unsafe fn fd_restore_func(var: &str) -> Result +where + T: FromRawFd, +{ + let fd = var + .parse::() + .map_err(|e| format_err!("invalid file descriptor: {}", e))? as RawFd; + fd_change_cloexec(fd, true)?; + Ok(unsafe { T::from_raw_fd(fd) }) +} + // For now all we need to do is store and reuse a tcp listening socket: impl Reloadable for tokio::net::TcpListener { // NOTE: The socket must not be closed when the store-function is called: - // FIXME: We could become "independent" of the TcpListener and its reference to the file - // descriptor by `dup()`ing it (and check if the listener still exists via kcmp()?) fn get_store_func(&self) -> Result { - let mut fd_opt = Some(unsafe { - OwnedFd::from_raw_fd(nix::fcntl::fcntl( - self.as_raw_fd(), - nix::fcntl::FcntlArg::F_DUPFD_CLOEXEC(0), - )?) - }); - Ok(Box::new(move || { - let fd = fd_opt.take().unwrap(); - fd_change_cloexec(fd.as_raw_fd(), false)?; - Ok(fd.into_raw_fd().to_string()) - })) + fd_store_func(self.as_raw_fd()) } fn restore(var: &str) -> Result { - let fd = var - .parse::() - .map_err(|e| format_err!("invalid file descriptor: {}", e))? as RawFd; - fd_change_cloexec(fd, true)?; - Ok(Self::from_std(unsafe { - std::net::TcpListener::from_raw_fd(fd) - })?) + Ok(Self::from_std(unsafe { fd_restore_func(var) }?)?) + } +} + +// For now all we need to do is store and reuse a tcp listening socket: +impl Reloadable for tokio::net::UnixListener { + // NOTE: The socket must not be closed when the store-function is called: + fn get_store_func(&self) -> Result { + fd_store_func(self.as_raw_fd()) + } + + fn restore(var: &str) -> Result { + Ok(Self::from_std(unsafe { fd_restore_func(var) }?)?) + } +} + +pub trait Listenable: Reloadable { + type Address; + fn bind(addr: &Self::Address) -> Pin> + Send + '_>>; +} + +impl Listenable for tokio::net::TcpListener { + type Address = std::net::SocketAddr; + + fn bind(addr: &Self::Address) -> Pin> + Send + '_>> { + Box::pin(Self::bind(addr)) + } +} + +impl Listenable for tokio::net::UnixListener { + type Address = std::os::unix::net::SocketAddr; + + fn bind(addr: &Self::Address) -> Pin> + Send + '_>> { + Box::pin(async move { + let addr = addr.as_pathname().ok_or_else(|| { + io::Error::new(io::ErrorKind::Other, "missing path for unix socket") + })?; + Self::bind(addr) + }) } } @@ -259,20 +307,21 @@ impl Reloadable for tokio::net::TcpListener { /// socket. The finished listening socket is then passed to the `create_service` function which /// can be used to setup the TLS and the HTTP daemon. The returned future has to call /// [systemd_notify] with [SystemdNotify::Ready] when the service is ready. -pub async fn create_daemon( - address: std::net::SocketAddr, +pub async fn create_daemon( + address: L::Address, create_service: F, pidfn: Option<&str>, ) -> Result<(), Error> where - F: FnOnce(tokio::net::TcpListener) -> Result, + L: Listenable, + F: FnOnce(L) -> Result, S: Future>, { let mut reloader = Reloader::new()?; - let listener: tokio::net::TcpListener = reloader + let listener: L = reloader .restore("PROXMOX_BACKUP_LISTEN_FD", move || async move { - Ok(tokio::net::TcpListener::bind(&address).await?) + Ok(L::bind(&address).await?) }) .await?; diff --git a/vendor/proxmox-rest-server/src/lib.rs b/vendor/proxmox-rest-server/src/lib.rs index 1c64ffb4a..ce9e4f15e 100644 --- a/vendor/proxmox-rest-server/src/lib.rs +++ b/vendor/proxmox-rest-server/src/lib.rs @@ -45,7 +45,7 @@ mod file_logger; pub use file_logger::{FileLogOptions, FileLogger}; mod api_config; -pub use api_config::{ApiConfig, AuthError, AuthHandler, IndexHandler}; +pub use api_config::{ApiConfig, AuthError, AuthHandler, IndexHandler, UnixAcceptor}; mod rest; pub use rest::{Redirector, RestServer}; diff --git a/vendor/proxmox-rest-server/src/rest.rs b/vendor/proxmox-rest-server/src/rest.rs index 39f98e55f..4900592d2 100644 --- a/vendor/proxmox-rest-server/src/rest.rs +++ b/vendor/proxmox-rest-server/src/rest.rs @@ -8,7 +8,7 @@ use std::sync::{Arc, Mutex}; use std::task::{Context, Poll}; use anyhow::{bail, format_err, Error}; -use futures::future::{FutureExt, TryFutureExt}; +use futures::future::FutureExt; use futures::stream::TryStreamExt; use hyper::body::HttpBody; use hyper::header::{self, HeaderMap}; @@ -443,7 +443,8 @@ async fn get_request_parameters( struct NoLogExtension(); async fn proxy_protected_request( - info: &'static ApiMethod, + config: &ApiConfig, + info: &ApiMethod, mut parts: Parts, req_body: Body, peer: &std::net::SocketAddr, @@ -464,14 +465,16 @@ async fn proxy_protected_request( let reload_timezone = info.reload_timezone; - let resp = hyper::client::Client::new() - .request(request) - .map_err(Error::from) - .map_ok(|mut resp| { - resp.extensions_mut().insert(NoLogExtension()); - resp - }) - .await?; + let mut resp = match config.privileged_addr.clone() { + None => hyper::client::Client::new().request(request).await?, + Some(addr) => { + hyper::client::Client::builder() + .build(addr) + .request(request) + .await? + } + }; + resp.extensions_mut().insert(NoLogExtension()); if reload_timezone { unsafe { @@ -1024,7 +1027,7 @@ impl Formatted { let result = if api_method.protected && rpcenv.env_type == RpcEnvironmentType::PUBLIC { - proxy_protected_request(api_method, parts, body, peer).await + proxy_protected_request(config, api_method, parts, body, peer).await } else { handle_api_request(rpcenv, api_method, formatter, parts, body, uri_param).await }; @@ -1129,7 +1132,7 @@ impl Unformatted { let result = if api_method.protected && rpcenv.env_type == RpcEnvironmentType::PUBLIC { - proxy_protected_request(api_method, parts, body, peer).await + proxy_protected_request(config, api_method, parts, body, peer).await } else { handle_unformatted_api_request(rpcenv, api_method, parts, body, uri_param).await }; diff --git a/vendor/proxmox-router/.cargo-checksum.json b/vendor/proxmox-router/.cargo-checksum.json index 2215db891..ee7a7d8ff 100644 --- a/vendor/proxmox-router/.cargo-checksum.json +++ b/vendor/proxmox-router/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"22ee308b224c07031ce9af13483f2c26b857c30d73a8b9d2721a8f014adc380f","src/cli/command.rs":"9b97434e5180ebcaa804543e14c46888653e404fc33a0de767be159887abcf38","src/cli/completion.rs":"68b42c855d6781ebaa22053ba55d5b06051b338e85282e26e523f70781502ce6","src/cli/completion_helpers.rs":"9948a2c5f9f728bfa7ba35cac55d6687616d1504a3c11b4829f23e954e67186d","src/cli/environment.rs":"cea5b5bef0fa55c78edb03d9c1dda7c6238c43619ab6f6d86989a33833203042","src/cli/format.rs":"82c5c7d9a963311a99c5b6e3bc428ad7f7feb89f4b966acada8ae04adc0c730c","src/cli/getopts.rs":"4262e2c3a620cadb83e267c4ed44fa0d9e4c0f4d3dea750887312b77de3d00d5","src/cli/mod.rs":"16b7f00be691910bac51889b3d6b269ef721de0839e717eb716c250bdc2fbc93","src/cli/readline.rs":"79c8f41da7bc3d2d17b2b46f9a7c025217a90d6414280770eddf08a4454fbe37","src/cli/shellword.rs":"fb754a916f725541bd0f1dba7717f4eab1dd460b260b49f077dac0ed8aa1379c","src/cli/text_table.rs":"2ef8e7ef6d82470c5c1f182a25b50f34435057870bee1de696303c71787c777c","src/error.rs":"65e1a3c0f5611ae8081752152994caf69ea32ddb58c2f1a1a5cc5e4ad72941d0","src/format.rs":"82437d5c2e2e1142b5a93d46f3c16bc704360641925c3e8dfdb18152471696c6","src/lib.rs":"017bd1a2a6152c8d5489f55632b5caf08e6fe5637aa6c7edad8d66f05dc2fe81","src/permission.rs":"cebde79270125268e3ad3088b077f08f968c39f567501baae60311e6fb97913f","src/router.rs":"c2935c9cebe8d184a5a636297d8b147e6c638d5a9c77206bb0c26b0546eba6d8","src/rpc_environment.rs":"ef0975dea98630c360e2507fa8caaafd71948c11639f87f44a36e20985ae58e3","src/serializable_return.rs":"e07fcf57d0ed88e1b10788dd96fa9cfac7d1a2cdf817bfd2c5f60f337ee3a0c1"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"5079051941d4c3c725cd722db5bb01c12a3357a510a5c18d6e933906da5c1395","src/cli/command.rs":"1b6ffd27d06ad0c6c15bb7b2dcc44990c0faef941eda58d133d621026bd02e20","src/cli/completion.rs":"68b42c855d6781ebaa22053ba55d5b06051b338e85282e26e523f70781502ce6","src/cli/completion_helpers.rs":"9948a2c5f9f728bfa7ba35cac55d6687616d1504a3c11b4829f23e954e67186d","src/cli/environment.rs":"cea5b5bef0fa55c78edb03d9c1dda7c6238c43619ab6f6d86989a33833203042","src/cli/format.rs":"82c5c7d9a963311a99c5b6e3bc428ad7f7feb89f4b966acada8ae04adc0c730c","src/cli/getopts.rs":"96ccd7d0d0ee7821f74faf48d3a235388acc9a186de42ba7b8c63b26ca546704","src/cli/mod.rs":"569b95710731582c1fcc9c0577eab46f44d216866b74e7357315d25849578e4b","src/cli/readline.rs":"79c8f41da7bc3d2d17b2b46f9a7c025217a90d6414280770eddf08a4454fbe37","src/cli/shellword.rs":"fb754a916f725541bd0f1dba7717f4eab1dd460b260b49f077dac0ed8aa1379c","src/cli/text_table.rs":"446c71c4916ccb2feff1fcfedce33c931671e8949d76f216dc63a9de21de99ae","src/error.rs":"65e1a3c0f5611ae8081752152994caf69ea32ddb58c2f1a1a5cc5e4ad72941d0","src/format.rs":"82437d5c2e2e1142b5a93d46f3c16bc704360641925c3e8dfdb18152471696c6","src/lib.rs":"017bd1a2a6152c8d5489f55632b5caf08e6fe5637aa6c7edad8d66f05dc2fe81","src/permission.rs":"cebde79270125268e3ad3088b077f08f968c39f567501baae60311e6fb97913f","src/router.rs":"c2935c9cebe8d184a5a636297d8b147e6c638d5a9c77206bb0c26b0546eba6d8","src/rpc_environment.rs":"ef0975dea98630c360e2507fa8caaafd71948c11639f87f44a36e20985ae58e3","src/serializable_return.rs":"e07fcf57d0ed88e1b10788dd96fa9cfac7d1a2cdf817bfd2c5f60f337ee3a0c1"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-router/Cargo.toml b/vendor/proxmox-router/Cargo.toml index 382df7415..31fa51557 100644 --- a/vendor/proxmox-router/Cargo.toml +++ b/vendor/proxmox-router/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-router" -version = "2.1.1" +version = "2.1.3" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "proxmox API Router and CLI utilities" @@ -57,7 +57,7 @@ version = "1.1" path = "../proxmox-lang" [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" [dependencies.rustyline] diff --git a/vendor/proxmox-router/src/cli/command.rs b/vendor/proxmox-router/src/cli/command.rs index 8ae889f95..7a26ffb98 100644 --- a/vendor/proxmox-router/src/cli/command.rs +++ b/vendor/proxmox-router/src/cli/command.rs @@ -335,9 +335,10 @@ pub fn handle_command( result } -fn prepare_cli_command(def: &CommandLineInterface) -> (String, Vec) { - let mut args = std::env::args(); - +fn prepare_cli_command(def: &CommandLineInterface, mut args: A) -> (String, Vec) +where + A: Iterator, +{ let prefix = args.next().unwrap(); let prefix = prefix.rsplit('/').next().unwrap().to_string(); // without path @@ -379,12 +380,44 @@ fn prepare_cli_command(def: &CommandLineInterface) -> (String, Vec) { /// - ``printdoc``: Output ReST documentation. /// pub async fn run_async_cli_command>(def: C, rpcenv: CliEnvironment) { + run_async_cli_command_with_args(def, rpcenv, std::env::args()).await +} + +/// Helper to get arguments and invoke the command. +/// +/// This is the synchrounous version of run_async_cli_command. You can +/// pass an optional ``run`` function to execute async commands (else +/// async commands simply fail). +pub fn run_cli_command>( + def: C, + rpcenv: CliEnvironment, + run: Option Result>, +) { + run_cli_command_with_args(def, rpcenv, run, std::env::args()) +} + +/// Helper to get arguments and invoke the command (async). +/// +/// The first argument is assumed to be the program name, and is passed as ``prefix`` to +/// ``handle_command()``. +/// +/// This helper automatically add the help command, and two special +/// sub-command: +/// +/// - ``bashcomplete``: Output bash completions instead of running the command. +/// - ``printdoc``: Output ReST documentation. +/// +pub async fn run_async_cli_command_with_args(def: C, rpcenv: CliEnvironment, args: A) +where + C: Into, + A: IntoIterator, +{ let def = match def.into() { CommandLineInterface::Simple(cli_cmd) => CommandLineInterface::Simple(cli_cmd), CommandLineInterface::Nested(map) => CommandLineInterface::Nested(map.insert_help()), }; - let (prefix, args) = prepare_cli_command(&def); + let (prefix, args) = prepare_cli_command(&def, args.into_iter()); if handle_command_future(Arc::new(def), &prefix, args, rpcenv) .await @@ -399,17 +432,21 @@ pub async fn run_async_cli_command>(def: C, rpcenv /// This is the synchrounous version of run_async_cli_command. You can /// pass an optional ``run`` function to execute async commands (else /// async commands simply fail). -pub fn run_cli_command>( +pub fn run_cli_command_with_args( def: C, rpcenv: CliEnvironment, run: Option Result>, -) { + args: A, +) where + C: Into, + A: IntoIterator, +{ let def = match def.into() { CommandLineInterface::Simple(cli_cmd) => CommandLineInterface::Simple(cli_cmd), CommandLineInterface::Nested(map) => CommandLineInterface::Nested(map.insert_help()), }; - let (prefix, args) = prepare_cli_command(&def); + let (prefix, args) = prepare_cli_command(&def, args.into_iter()); if handle_command(Arc::new(def), &prefix, args, rpcenv, run).is_err() { std::process::exit(-1); diff --git a/vendor/proxmox-router/src/cli/getopts.rs b/vendor/proxmox-router/src/cli/getopts.rs index 6ab821876..85796bed7 100644 --- a/vendor/proxmox-router/src/cli/getopts.rs +++ b/vendor/proxmox-router/src/cli/getopts.rs @@ -76,10 +76,7 @@ pub(crate) fn parse_argument_list>( let mut can_default = false; if let Some((_opt, Schema::Boolean(boolean_schema))) = schema.lookup(&name) { want_bool = true; - match boolean_schema.default { - Some(false) | None => can_default = true, - Some(true) => (), - } + can_default = matches!(boolean_schema.default, Some(false) | None); } let mut next_is_argument = false; diff --git a/vendor/proxmox-router/src/cli/mod.rs b/vendor/proxmox-router/src/cli/mod.rs index 208df4a44..7df94ad99 100644 --- a/vendor/proxmox-router/src/cli/mod.rs +++ b/vendor/proxmox-router/src/cli/mod.rs @@ -29,7 +29,6 @@ mod text_table; pub use text_table::*; mod completion; -pub use completion::*; mod completion_helpers; pub use completion_helpers::*; diff --git a/vendor/proxmox-router/src/cli/text_table.rs b/vendor/proxmox-router/src/cli/text_table.rs index 9bc7210e0..ea50b04bc 100644 --- a/vendor/proxmox-router/src/cli/text_table.rs +++ b/vendor/proxmox-router/src/cli/text_table.rs @@ -1,11 +1,11 @@ use std::io::Write; -use anyhow::{bail, Error}; +use anyhow::{bail, format_err, Error}; use serde_json::Value; use unicode_width::UnicodeWidthStr; use proxmox_lang::c_str; -use proxmox_schema::{ObjectSchemaType, Schema, SchemaPropertyEntry}; +use proxmox_schema::{ObjectSchemaType, OneOfSchema, Schema, SchemaPropertyEntry}; /// allows to configure the default output fromat using environment vars pub const ENV_VAR_PROXMOX_OUTPUT_FORMAT: &str = "PROXMOX_OUTPUT_FORMAT"; @@ -66,10 +66,9 @@ fn data_to_text(data: &Value, schema: &Schema) -> Result { } match schema { - Schema::Null => { - // makes no sense to display Null columns - bail!("internal error"); - } + // When printing a table of OneOf values, different variants have different properties, and + // nonexistent properties will be null. + Schema::Null => Ok(String::new()), Schema::Boolean(_) => match data.as_bool() { Some(value) => Ok(String::from(if value { "1" } else { "0" })), None => bail!("got unexpected data (expected bool)."), @@ -89,6 +88,7 @@ fn data_to_text(data: &Value, schema: &Schema) -> Result { Schema::Object(_) => Ok(data.to_string()), Schema::Array(_) => Ok(data.to_string()), Schema::AllOf(_) => Ok(data.to_string()), + Schema::OneOf(_) => Ok(data.to_string()), } } @@ -620,6 +620,16 @@ fn format_object( .collect() }; + format_object_with_properties(output, data, schema, options, properties_to_print) +} + +fn format_object_with_properties( + output: W, + data: &Value, + schema: &dyn ObjectSchemaType, + options: &TableFormatOptions, + properties_to_print: Vec, +) -> Result<(), Error> { let row_count = properties_to_print.len(); if row_count == 0 { return Ok(()); @@ -723,6 +733,25 @@ fn format_object( render_table(output, &tabledata, &column_names, options) } +fn format_one_of( + output: W, + data: &Value, + schema: &OneOfSchema, + options: &TableFormatOptions, +) -> Result<(), Error> { + let properties_to_print = if options.column_config.is_empty() { + extract_one_of_variant_properties(data, schema)? + } else { + options + .column_config + .iter() + .map(|v| v.name.clone()) + .collect() + }; + + format_object_with_properties(output, data, schema, options, properties_to_print) +} + fn extract_properties_to_print(properties: I) -> Vec where I: Iterator, @@ -743,6 +772,21 @@ where result } +fn extract_one_of_variant_properties( + value: &Value, + schema: &OneOfSchema, +) -> Result, Error> { + let variant_name = value[schema.type_property()] + .as_str() + .ok_or_else(|| format_err!("missing '{}' property", schema.type_property()))?; + let variant_schema = schema + .lookup_variant(variant_name) + .ok_or_else(|| format_err!("invalid variant '{variant_name}'"))?; + Ok(extract_properties_to_print( + variant_schema.unwrap_object_schema().properties(), + )) +} + /// Format data using TableFormatOptions pub fn value_to_text( output: W, @@ -768,8 +812,8 @@ pub fn value_to_text( Schema::String(_string_schema) => { unimplemented!(); } - Schema::Object(object_schema) => { - format_object(output, data, object_schema, options)?; + Schema::Object(schema) => { + format_object(output, data, schema, options)?; } Schema::Array(array_schema) => { let list = match data.as_array_mut() { @@ -781,19 +825,25 @@ pub fn value_to_text( } match array_schema.items { - Schema::Object(object_schema) => { - format_table(output, list, object_schema, options)?; + Schema::Object(schema) => { + format_table(output, list, schema, options)?; } - Schema::AllOf(all_of_schema) => { - format_table(output, list, all_of_schema, options)?; + Schema::AllOf(schema) => { + format_table(output, list, schema, options)?; + } + Schema::OneOf(schema) => { + format_table(output, list, schema, options)?; } _ => { unimplemented!(); } } } - Schema::AllOf(all_of_schema) => { - format_object(output, data, all_of_schema, options)?; + Schema::AllOf(schema) => { + format_object(output, data, schema, options)?; + } + Schema::OneOf(schema) => { + format_one_of(output, data, schema, options)?; } } Ok(()) diff --git a/vendor/proxmox-rrd/.cargo-checksum.json b/vendor/proxmox-rrd/.cargo-checksum.json new file mode 100644 index 000000000..7d719a302 --- /dev/null +++ b/vendor/proxmox-rrd/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"6312348337ec983b64f0d3195249f5150944ea5cf7cd1dcbd1ef2f2a75717251","examples/prrd.rs":"92c2e78906bcdb5dca9c9f11176b56aa69a92943d425f20eda2a8285f6be020c","src/cache.rs":"fd3071c402f029205c585b766f922781562652ea3ef2b1eff1cbe06b7c832d6b","src/cache/journal.rs":"b37dce328be0b2c6ea3b126dbaa957b751cc222aadb0e29a0ae202345fb61665","src/cache/rrd_map.rs":"09723b1cf88cdb50da5b8bdad61600959365bee2090f9fa14dbdc41bac07e971","src/lib.rs":"c794b2cd63382feb65c88980a0017fcb9950663f968dad0df532665bd82a3d5c","src/rrd.rs":"6779ba10541ff07b980f6105ab98bb3e2bea7218159ad4737d3f901da20c6921","src/rrd_v1.rs":"19216411d7b223d4e5b565198239509e48d12daa1e7a5e4043ba906ab84d3d15","tests/file_format_test.rs":"52e879f0135a9a71b17ad389c1da27ad9239a18005289e8d15031b0601c2ccb6","tests/testdata/cpu.rrd_v1":"f0507e1cf69f10c0313b0c74627e1552fab71f7b5adb3fc6f65122724c2000ff","tests/testdata/cpu.rrd_v2":"478ce56dfc7caafcc0590ca87f9ab707c7b5cee07fda38041c7bd7eb7556fdbe"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-rrd/Cargo.toml b/vendor/proxmox-rrd/Cargo.toml new file mode 100644 index 000000000..53322acf3 --- /dev/null +++ b/vendor/proxmox-rrd/Cargo.toml @@ -0,0 +1,56 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +name = "proxmox-rrd" +version = "0.1.1" +authors = ["Proxmox Support Team "] +exclude = ["debian"] +description = "Simple RRD database implementation." +license = "AGPL-3" +repository = "https://git.proxmox.com/?p=proxmox.git" + +[dependencies] +anyhow = "1.0" +bitflags = "1.2.1" +crossbeam-channel = "0.5" +libc = "0.2.107" +log = "0.4.17" +nix = "0.26.1" +serde = "1.0" +serde_cbor = "0.11.1" +serde_json = "1.0" + +[dependencies.proxmox-schema] +version = "3.0.0" +path = "../proxmox-schema" +features = ["api-macro"] + +[dependencies.proxmox-sys] +version = "0.5.1" +path = "../proxmox-sys" + +[dependencies.proxmox-time] +version = "1.1.6" +path = "../proxmox-time" + +[dev-dependencies.proxmox-router] +version = "2.1.3" +path = "../proxmox-router" +features = [ + "cli", + "server", +] + +[features] +default = ["rrd_v1"] +rrd_v1 = [] diff --git a/vendor/proxmox-rrd/examples/prrd.rs b/vendor/proxmox-rrd/examples/prrd.rs new file mode 100644 index 000000000..5e098c2ca --- /dev/null +++ b/vendor/proxmox-rrd/examples/prrd.rs @@ -0,0 +1,390 @@ +//! RRD toolkit - create/manage/update proxmox RRD (v2) file + +use std::path::PathBuf; + +use anyhow::{bail, Error}; +use serde::{Deserialize, Serialize}; +use serde_json::json; + +use proxmox_router::cli::{ + complete_file_name, run_cli_command, CliCommand, CliCommandMap, CliEnvironment, +}; +use proxmox_router::RpcEnvironment; +use proxmox_schema::{api, ApiStringFormat, ApiType, IntegerSchema, Schema, StringSchema}; + +use proxmox_sys::fs::CreateOptions; + +use proxmox_rrd::rrd::{AggregationFn, Archive, DataSourceType, Database}; + +pub const RRA_INDEX_SCHEMA: Schema = IntegerSchema::new("Index of the RRA.").minimum(0).schema(); + +pub const RRA_CONFIG_STRING_SCHEMA: Schema = StringSchema::new("RRA configuration") + .format(&ApiStringFormat::PropertyString(&RRAConfig::API_SCHEMA)) + .schema(); + +#[api( + properties: {}, + default_key: "cf", +)] +#[derive(Debug, Serialize, Deserialize)] +/// RRA configuration +pub struct RRAConfig { + /// Time resolution + pub r: u64, + pub cf: AggregationFn, + /// Number of data points + pub n: u64, +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + }, + }, +)] +/// Dump the RRD file in JSON format +pub fn dump_rrd(path: String) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + serde_json::to_writer_pretty(std::io::stdout(), &rrd)?; + println!(); + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + }, + }, +)] +/// RRD file information +pub fn rrd_info(path: String) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + + println!("DST: {:?}", rrd.source.dst); + + for (i, rra) in rrd.rra_list.iter().enumerate() { + // use RRAConfig property string format + println!( + "RRA[{}]: {:?},r={},n={}", + i, + rra.cf, + rra.resolution, + rra.data.len() + ); + } + + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + time: { + description: "Update time.", + optional: true, + }, + value: { + description: "Update value.", + }, + }, + }, +)] +/// Update the RRD database +pub fn update_rrd(path: String, time: Option, value: f64) -> Result<(), Error> { + let path = PathBuf::from(path); + + let time = time + .map(|v| v as f64) + .unwrap_or_else(proxmox_time::epoch_f64); + + let mut rrd = Database::load(&path, false)?; + rrd.update(time, value); + + rrd.save(&path, CreateOptions::new(), false)?; + + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + cf: { + type: CF, + }, + resolution: { + description: "Time resolution", + }, + start: { + description: "Start time. If not specified, we simply extract 10 data points.", + optional: true, + }, + end: { + description: "End time (Unix Epoch). Default is the last update time.", + optional: true, + }, + }, + }, +)] +/// Fetch data from the RRD file +pub fn fetch_rrd( + path: String, + cf: AggregationFn, + resolution: u64, + start: Option, + end: Option, +) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + + let data = rrd.extract_data(cf, resolution, start, end)?; + + println!("{}", serde_json::to_string_pretty(&data)?); + + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + "rra-index": { + schema: RRA_INDEX_SCHEMA, + }, + }, + }, +)] +/// Return the Unix timestamp of the first time slot inside the +/// specified RRA (slot start time) +pub fn first_update_time(path: String, rra_index: usize) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + + if rra_index >= rrd.rra_list.len() { + bail!("rra-index is out of range"); + } + let rra = &rrd.rra_list[rra_index]; + let duration = (rra.data.len() as u64) * rra.resolution; + let first = rra.slot_start_time((rrd.source.last_update as u64).saturating_sub(duration)); + + println!("{}", first); + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + }, + }, +)] +/// Return the Unix timestamp of the last update +pub fn last_update_time(path: String) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + + println!("{}", rrd.source.last_update); + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + }, + }, +)] +/// Return the time and value from the last update +pub fn last_update(path: String) -> Result<(), Error> { + let rrd = Database::load(&PathBuf::from(path), false)?; + + let result = json!({ + "time": rrd.source.last_update, + "value": rrd.source.last_value, + }); + + println!("{}", serde_json::to_string_pretty(&result)?); + + Ok(()) +} + +#[api( + input: { + properties: { + dst: { + type: DST, + }, + path: { + description: "The filename to create." + }, + rra: { + description: "Configuration of contained RRAs.", + type: Array, + items: { + schema: RRA_CONFIG_STRING_SCHEMA, + } + }, + }, + }, +)] +/// Create a new RRD file +pub fn create_rrd(dst: DataSourceType, path: String, rra: Vec) -> Result<(), Error> { + let mut rra_list = Vec::new(); + + for item in rra.iter() { + let rra: RRAConfig = + serde_json::from_value(RRAConfig::API_SCHEMA.parse_property_string(item)?)?; + println!("GOT {:?}", rra); + rra_list.push(Archive::new(rra.cf, rra.r, rra.n as usize)); + } + + let path = PathBuf::from(path); + + let rrd = Database::new(dst, rra_list); + + rrd.save(&path, CreateOptions::new(), false)?; + + Ok(()) +} + +#[api( + input: { + properties: { + path: { + description: "The filename." + }, + "rra-index": { + schema: RRA_INDEX_SCHEMA, + }, + slots: { + description: "The number of slots you want to add or remove.", + type: i64, + }, + }, + }, +)] +/// Resize. Change the number of data slots for the specified RRA. +pub fn resize_rrd(path: String, rra_index: usize, slots: i64) -> Result<(), Error> { + let path = PathBuf::from(&path); + + let mut rrd = Database::load(&path, false)?; + + if rra_index >= rrd.rra_list.len() { + bail!("rra-index is out of range"); + } + + let rra = &rrd.rra_list[rra_index]; + + let new_slots = (rra.data.len() as i64) + slots; + + if new_slots < 1 { + bail!("number of new slots is too small ('{}' < 1)", new_slots); + } + + if new_slots > 1024 * 1024 { + bail!("number of new slots is too big ('{}' > 1M)", new_slots); + } + + let rra_end = rra.slot_end_time(rrd.source.last_update as u64); + let rra_start = rra_end - rra.resolution * (rra.data.len() as u64); + let (start, reso, data) = rra + .extract_data(rra_start, rra_end, rrd.source.last_update) + .into(); + + let mut new_rra = Archive::new(rra.cf, rra.resolution, new_slots as usize); + new_rra.last_count = rra.last_count; + + new_rra.insert_data(start, reso, data)?; + + rrd.rra_list[rra_index] = new_rra; + + rrd.save(&path, CreateOptions::new(), false)?; + + Ok(()) +} + +fn main() -> Result<(), Error> { + let uid = nix::unistd::Uid::current(); + + let username = match nix::unistd::User::from_uid(uid)? { + Some(user) => user.name, + None => bail!("unable to get user name"), + }; + + let cmd_def = CliCommandMap::new() + .insert( + "create", + CliCommand::new(&API_METHOD_CREATE_RRD) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "dump", + CliCommand::new(&API_METHOD_DUMP_RRD) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "fetch", + CliCommand::new(&API_METHOD_FETCH_RRD) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "first", + CliCommand::new(&API_METHOD_FIRST_UPDATE_TIME) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "info", + CliCommand::new(&API_METHOD_RRD_INFO) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "last", + CliCommand::new(&API_METHOD_LAST_UPDATE_TIME) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "lastupdate", + CliCommand::new(&API_METHOD_LAST_UPDATE) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "resize", + CliCommand::new(&API_METHOD_RESIZE_RRD) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ) + .insert( + "update", + CliCommand::new(&API_METHOD_UPDATE_RRD) + .arg_param(&["path"]) + .completion_cb("path", complete_file_name), + ); + + let mut rpcenv = CliEnvironment::new(); + rpcenv.set_auth_id(Some(format!("{}@pam", username))); + + run_cli_command(cmd_def, rpcenv, None); + + Ok(()) +} diff --git a/vendor/proxmox-rrd/src/cache.rs b/vendor/proxmox-rrd/src/cache.rs new file mode 100644 index 000000000..e3d2f8d56 --- /dev/null +++ b/vendor/proxmox-rrd/src/cache.rs @@ -0,0 +1,448 @@ +use std::collections::BTreeSet; +use std::fs::File; +use std::io::{BufRead, BufReader}; +use std::os::unix::io::AsRawFd; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, RwLock}; +use std::thread::spawn; +use std::time::SystemTime; + +use anyhow::{bail, format_err, Error}; +use crossbeam_channel::{bounded, TryRecvError}; + +use proxmox_sys::fs::{create_path, CreateOptions}; + +use crate::rrd::{AggregationFn, Archive, DataSourceType, Database}; +use crate::Entry; + +mod journal; +use journal::*; + +mod rrd_map; +use rrd_map::*; + +/// RRD cache - keep RRD data in RAM, but write updates to disk +/// +/// This cache is designed to run as single instance (no concurrent +/// access from other processes). +pub struct Cache { + config: Arc, + state: Arc>, + rrd_map: Arc>, +} + +pub(crate) struct CacheConfig { + apply_interval: f64, + basedir: PathBuf, + file_options: CreateOptions, + dir_options: CreateOptions, +} + +impl Cache { + /// Creates a new instance + /// + /// `basedir`: All files are stored relative to this path. + /// + /// `file_options`: Files are created with this options. + /// + /// `dir_options`: Directories are created with this options. + /// + /// `apply_interval`: Commit journal after `apply_interval` seconds. + /// + /// `load_rrd_cb`; The callback function is used to load RRD files, + /// and should return a newly generated RRD if the file does not + /// exists (or is unreadable). This may generate RRDs with + /// different configurations (dependent on `rel_path`). + pub fn new>( + basedir: P, + file_options: Option, + dir_options: Option, + apply_interval: f64, + load_rrd_cb: fn(path: &Path, rel_path: &str, dst: DataSourceType) -> Database, + ) -> Result { + let basedir = basedir.as_ref().to_owned(); + + let file_options = file_options.unwrap_or_else(CreateOptions::new); + let dir_options = dir_options.unwrap_or_else(CreateOptions::new); + + create_path( + &basedir, + Some(dir_options.clone()), + Some(dir_options.clone()), + ) + .map_err(|err: Error| format_err!("unable to create rrdb stat dir - {}", err))?; + + let config = Arc::new(CacheConfig { + basedir, + file_options, + dir_options, + apply_interval, + }); + + let state = JournalState::new(Arc::clone(&config))?; + let rrd_map = RRDMap::new(Arc::clone(&config), load_rrd_cb); + + Ok(Self { + config: Arc::clone(&config), + state: Arc::new(RwLock::new(state)), + rrd_map: Arc::new(RwLock::new(rrd_map)), + }) + } + + /// Create a new RRD as used by the proxmox backup server + /// + /// It contains the following RRAs: + /// + /// * cf=average,r=60,n=1440 => 1day + /// * cf=maximum,r=60,n=1440 => 1day + /// * cf=average,r=30*60,n=1440 => 1month + /// * cf=maximum,r=30*60,n=1440 => 1month + /// * cf=average,r=6*3600,n=1440 => 1year + /// * cf=maximum,r=6*3600,n=1440 => 1year + /// * cf=average,r=7*86400,n=570 => 10years + /// * cf=maximum,r=7*86400,n=570 => 10year + /// + /// The resulting data file size is about 80KB. + pub fn create_proxmox_backup_default_rrd(dst: DataSourceType) -> Database { + let rra_list = vec![ + // 1 min * 1440 => 1 day + Archive::new(AggregationFn::Average, 60, 1440), + Archive::new(AggregationFn::Maximum, 60, 1440), + // 30 min * 1440 => 30 days ~ 1 month + Archive::new(AggregationFn::Average, 30 * 60, 1440), + Archive::new(AggregationFn::Maximum, 30 * 60, 1440), + // 6 h * 1440 => 360 days ~ 1 year + Archive::new(AggregationFn::Average, 6 * 3600, 1440), + Archive::new(AggregationFn::Maximum, 6 * 3600, 1440), + // 1 week * 570 => 10 years + Archive::new(AggregationFn::Average, 7 * 86400, 570), + Archive::new(AggregationFn::Maximum, 7 * 86400, 570), + ]; + + Database::new(dst, rra_list) + } + + /// Sync the journal data to disk (using `fdatasync` syscall) + pub fn sync_journal(&self) -> Result<(), Error> { + self.state.read().unwrap().sync_journal() + } + + /// Apply and commit the journal. Should be used at server startup. + pub fn apply_journal(&self) -> Result { + let config = Arc::clone(&self.config); + let state = Arc::clone(&self.state); + let rrd_map = Arc::clone(&self.rrd_map); + + let mut state_guard = self.state.write().unwrap(); + let journal_applied = state_guard.journal_applied; + + if let Some(ref recv) = state_guard.apply_thread_result { + match recv.try_recv() { + Ok(Ok(())) => { + // finished without errors, OK + state_guard.apply_thread_result = None; + } + Ok(Err(err)) => { + // finished with errors, log them + log::error!("{}", err); + state_guard.apply_thread_result = None; + } + Err(TryRecvError::Empty) => { + // still running + return Ok(journal_applied); + } + Err(TryRecvError::Disconnected) => { + // crashed, start again + log::error!("apply journal thread crashed - try again"); + state_guard.apply_thread_result = None; + } + } + } + + let now = proxmox_time::epoch_f64(); + let wants_commit = (now - state_guard.last_journal_flush) > self.config.apply_interval; + + if journal_applied && !wants_commit { + return Ok(journal_applied); + } + + state_guard.last_journal_flush = proxmox_time::epoch_f64(); + + let (sender, receiver) = bounded(1); + state_guard.apply_thread_result = Some(receiver); + + spawn(move || { + let result = apply_and_commit_journal_thread(config, state, rrd_map, journal_applied) + .map_err(|err| err.to_string()); + sender.send(result).unwrap(); + }); + + Ok(journal_applied) + } + + /// Update data in RAM and write file back to disk (journal) + pub fn update_value( + &self, + rel_path: &str, + time: f64, + value: f64, + dst: DataSourceType, + ) -> Result<(), Error> { + let journal_applied = self.apply_journal()?; + + self.state + .write() + .unwrap() + .append_journal_entry(time, value, dst, rel_path)?; + + if journal_applied { + self.rrd_map + .write() + .unwrap() + .update(rel_path, time, value, dst, false)?; + } + + Ok(()) + } + + /// Extract data from cached RRD + /// + /// `start`: Start time. If not specified, we simply extract 10 data points. + /// + /// `end`: End time. Default is to use the current time. + pub fn extract_cached_data( + &self, + base: &str, + name: &str, + cf: AggregationFn, + resolution: u64, + start: Option, + end: Option, + ) -> Result, Error> { + self.rrd_map + .read() + .unwrap() + .extract_cached_data(base, name, cf, resolution, start, end) + } +} + +fn apply_and_commit_journal_thread( + config: Arc, + state: Arc>, + rrd_map: Arc>, + commit_only: bool, +) -> Result<(), Error> { + if commit_only { + state.write().unwrap().rotate_journal()?; // start new journal, keep old one + } else { + let start_time = SystemTime::now(); + log::debug!("applying rrd journal"); + + match apply_journal_impl(Arc::clone(&state), Arc::clone(&rrd_map)) { + Ok(entries) => { + let elapsed = start_time.elapsed().unwrap().as_secs_f64(); + log::info!( + "applied rrd journal ({} entries in {:.3} seconds)", + entries, + elapsed + ); + } + Err(err) => bail!("apply rrd journal failed - {}", err), + } + } + + let start_time = SystemTime::now(); + log::debug!("commit rrd journal"); + + match commit_journal_impl(config, state, rrd_map) { + Ok(rrd_file_count) => { + let elapsed = start_time.elapsed().unwrap().as_secs_f64(); + log::info!( + "rrd journal successfully committed ({} files in {:.3} seconds)", + rrd_file_count, + elapsed + ); + } + Err(err) => bail!("rrd journal commit failed: {}", err), + } + Ok(()) +} + +fn apply_journal_lines( + state: Arc>, + rrd_map: Arc>, + journal_name: &str, // used for logging + reader: &mut BufReader, + lock_read_line: bool, +) -> Result { + let mut linenr = 0; + + loop { + linenr += 1; + let mut line = String::new(); + let len = if lock_read_line { + let _lock = state.read().unwrap(); // make sure we read entire lines + reader.read_line(&mut line)? + } else { + reader.read_line(&mut line)? + }; + + if len == 0 { + break; + } + + let entry: JournalEntry = match line.parse() { + Ok(entry) => entry, + Err(err) => { + log::warn!( + "unable to parse rrd journal '{}' line {} (skip) - {}", + journal_name, + linenr, + err, + ); + continue; // skip unparseable lines + } + }; + + rrd_map.write().unwrap().update( + &entry.rel_path, + entry.time, + entry.value, + entry.dst, + true, + )?; + } + Ok(linenr) +} + +fn apply_journal_impl( + state: Arc>, + rrd_map: Arc>, +) -> Result { + let mut lines = 0; + + // Apply old journals first + let journal_list = state.read().unwrap().list_old_journals()?; + + for entry in journal_list { + log::info!("apply old journal log {}", entry.name); + let file = std::fs::OpenOptions::new().read(true).open(&entry.path)?; + let mut reader = BufReader::new(file); + lines += apply_journal_lines( + Arc::clone(&state), + Arc::clone(&rrd_map), + &entry.name, + &mut reader, + false, + )?; + } + + let mut journal = state.read().unwrap().open_journal_reader()?; + + lines += apply_journal_lines( + Arc::clone(&state), + Arc::clone(&rrd_map), + "rrd.journal", + &mut journal, + true, + )?; + + { + let mut state_guard = state.write().unwrap(); // block other writers + + lines += apply_journal_lines( + Arc::clone(&state), + Arc::clone(&rrd_map), + "rrd.journal", + &mut journal, + false, + )?; + + state_guard.rotate_journal()?; // start new journal, keep old one + + // We need to apply the journal only once, because further updates + // are always directly applied. + state_guard.journal_applied = true; + } + + Ok(lines) +} + +fn fsync_file_or_dir(path: &Path) -> Result<(), Error> { + let file = std::fs::File::open(path)?; + nix::unistd::fsync(file.as_raw_fd())?; + Ok(()) +} + +pub(crate) fn fsync_file_and_parent(path: &Path) -> Result<(), Error> { + let file = std::fs::File::open(path)?; + nix::unistd::fsync(file.as_raw_fd())?; + if let Some(parent) = path.parent() { + fsync_file_or_dir(parent)?; + } + Ok(()) +} + +fn rrd_parent_dir(basedir: &Path, rel_path: &str) -> PathBuf { + let mut path = basedir.to_owned(); + let rel_path = Path::new(rel_path); + if let Some(parent) = rel_path.parent() { + path.push(parent); + } + path +} + +fn commit_journal_impl( + config: Arc, + state: Arc>, + rrd_map: Arc>, +) -> Result { + let files = rrd_map.read().unwrap().file_list(); + + let mut rrd_file_count = 0; + let mut errors = 0; + + let mut dir_set = BTreeSet::new(); + + log::info!("write rrd data back to disk"); + + // save all RRDs - we only need a read lock here + // Note: no fsync here (we do it afterwards) + for rel_path in files.iter() { + let parent_dir = rrd_parent_dir(&config.basedir, rel_path); + dir_set.insert(parent_dir); + rrd_file_count += 1; + if let Err(err) = rrd_map.read().unwrap().flush_rrd_file(rel_path) { + errors += 1; + log::error!("unable to save rrd {}: {}", rel_path, err); + } + } + + if errors != 0 { + bail!("errors during rrd flush - unable to commit rrd journal"); + } + + // Important: We fsync files after writing all data! This increase + // the likelihood that files are already synced, so this is + // much faster (although we need to re-open the files). + + log::info!("starting rrd data sync"); + + for rel_path in files.iter() { + let mut path = config.basedir.clone(); + path.push(rel_path); + fsync_file_or_dir(&path) + .map_err(|err| format_err!("fsync rrd file {} failed - {}", rel_path, err))?; + } + + // also fsync directories + for dir_path in dir_set { + fsync_file_or_dir(&dir_path) + .map_err(|err| format_err!("fsync rrd dir {:?} failed - {}", dir_path, err))?; + } + + // if everything went ok, remove the old journal files + state.write().unwrap().remove_old_journals()?; + + Ok(rrd_file_count) +} diff --git a/vendor/proxmox-rrd/src/cache/journal.rs b/vendor/proxmox-rrd/src/cache/journal.rs new file mode 100644 index 000000000..c196b3429 --- /dev/null +++ b/vendor/proxmox-rrd/src/cache/journal.rs @@ -0,0 +1,200 @@ +use std::ffi::OsStr; +use std::fs::File; +use std::io::{BufReader, Write}; +use std::os::unix::io::AsRawFd; +use std::path::PathBuf; +use std::str::FromStr; +use std::sync::Arc; + +use anyhow::{bail, format_err, Error}; +use crossbeam_channel::Receiver; +use nix::fcntl::OFlag; + +use proxmox_sys::fs::atomic_open_or_create_file; + +const RRD_JOURNAL_NAME: &str = "rrd.journal"; + +use crate::cache::CacheConfig; +use crate::rrd::DataSourceType; + +// shared state behind RwLock +pub struct JournalState { + config: Arc, + journal: File, + pub last_journal_flush: f64, + pub journal_applied: bool, + pub apply_thread_result: Option>>, +} + +pub struct JournalEntry { + pub time: f64, + pub value: f64, + pub dst: DataSourceType, + pub rel_path: String, +} + +impl FromStr for JournalEntry { + type Err = Error; + + fn from_str(line: &str) -> Result { + let line = line.trim(); + + let parts: Vec<&str> = line.splitn(4, ':').collect(); + if parts.len() != 4 { + bail!("wrong number of components"); + } + + let time: f64 = parts[0] + .parse() + .map_err(|_| format_err!("unable to parse time"))?; + let value: f64 = parts[1] + .parse() + .map_err(|_| format_err!("unable to parse value"))?; + let dst: u8 = parts[2] + .parse() + .map_err(|_| format_err!("unable to parse data source type"))?; + + let dst = match dst { + 0 => DataSourceType::Gauge, + 1 => DataSourceType::Derive, + _ => bail!("got strange value for data source type '{}'", dst), + }; + + let rel_path = parts[3].to_string(); + + Ok(JournalEntry { + time, + value, + dst, + rel_path, + }) + } +} + +pub struct JournalFileInfo { + pub time: u64, + pub name: String, + pub path: PathBuf, +} + +impl JournalState { + pub(crate) fn new(config: Arc) -> Result { + let journal = JournalState::open_journal_writer(&config)?; + Ok(Self { + config, + journal, + last_journal_flush: 0.0, + journal_applied: false, + apply_thread_result: None, + }) + } + + pub fn sync_journal(&self) -> Result<(), Error> { + nix::unistd::fdatasync(self.journal.as_raw_fd())?; + Ok(()) + } + + pub fn append_journal_entry( + &mut self, + time: f64, + value: f64, + dst: DataSourceType, + rel_path: &str, + ) -> Result<(), Error> { + let journal_entry = format!("{}:{}:{}:{}\n", time, value, dst as u8, rel_path); + self.journal.write_all(journal_entry.as_bytes())?; + Ok(()) + } + + pub fn open_journal_reader(&self) -> Result, Error> { + // fixme : dup self.journal instead?? + let mut journal_path = self.config.basedir.clone(); + journal_path.push(RRD_JOURNAL_NAME); + + let flags = OFlag::O_CLOEXEC | OFlag::O_RDONLY; + let journal = atomic_open_or_create_file( + &journal_path, + flags, + &[], + self.config.file_options.clone(), + false, + )?; + Ok(BufReader::new(journal)) + } + + fn open_journal_writer(config: &CacheConfig) -> Result { + let mut journal_path = config.basedir.clone(); + journal_path.push(RRD_JOURNAL_NAME); + + let flags = OFlag::O_CLOEXEC | OFlag::O_WRONLY | OFlag::O_APPEND; + let journal = atomic_open_or_create_file( + &journal_path, + flags, + &[], + config.file_options.clone(), + false, + )?; + Ok(journal) + } + + pub fn rotate_journal(&mut self) -> Result<(), Error> { + let mut journal_path = self.config.basedir.clone(); + journal_path.push(RRD_JOURNAL_NAME); + + let mut new_name = journal_path.clone(); + let now = proxmox_time::epoch_i64(); + new_name.set_extension(format!("journal-{:08x}", now)); + std::fs::rename(journal_path, &new_name)?; + + self.journal = Self::open_journal_writer(&self.config)?; + + // make sure the old journal data landed on the disk + super::fsync_file_and_parent(&new_name)?; + + Ok(()) + } + + pub fn remove_old_journals(&self) -> Result<(), Error> { + let journal_list = self.list_old_journals()?; + + for entry in journal_list { + std::fs::remove_file(entry.path)?; + } + + Ok(()) + } + + pub fn list_old_journals(&self) -> Result, Error> { + let mut list = Vec::new(); + for entry in std::fs::read_dir(&self.config.basedir)? { + let entry = entry?; + let path = entry.path(); + + if !path.is_file() { + continue; + } + + match path.file_stem() { + None => continue, + Some(stem) if stem != OsStr::new("rrd") => continue, + Some(_) => (), + } + + if let Some(extension) = path.extension() { + if let Some(extension) = extension.to_str() { + if let Some(rest) = extension.strip_prefix("journal-") { + if let Ok(time) = u64::from_str_radix(rest, 16) { + list.push(JournalFileInfo { + time, + name: format!("rrd.{}", extension), + path: path.to_owned(), + }); + } + } + } + } + } + list.sort_unstable_by_key(|entry| entry.time); + Ok(list) + } +} diff --git a/vendor/proxmox-rrd/src/cache/rrd_map.rs b/vendor/proxmox-rrd/src/cache/rrd_map.rs new file mode 100644 index 000000000..881b3987e --- /dev/null +++ b/vendor/proxmox-rrd/src/cache/rrd_map.rs @@ -0,0 +1,97 @@ +use std::collections::HashMap; +use std::path::Path; +use std::sync::Arc; + +use anyhow::{bail, Error}; + +use proxmox_sys::fs::create_path; + +use crate::rrd::{AggregationFn, DataSourceType, Database}; + +use super::CacheConfig; +use crate::Entry; + +pub struct RRDMap { + config: Arc, + map: HashMap, + load_rrd_cb: fn(path: &Path, rel_path: &str, dst: DataSourceType) -> Database, +} + +impl RRDMap { + pub(crate) fn new( + config: Arc, + load_rrd_cb: fn(path: &Path, rel_path: &str, dst: DataSourceType) -> Database, + ) -> Self { + Self { + config, + map: HashMap::new(), + load_rrd_cb, + } + } + + pub fn update( + &mut self, + rel_path: &str, + time: f64, + value: f64, + dst: DataSourceType, + new_only: bool, + ) -> Result<(), Error> { + if let Some(rrd) = self.map.get_mut(rel_path) { + if !new_only || time > rrd.last_update() { + rrd.update(time, value); + } + } else { + let mut path = self.config.basedir.clone(); + path.push(rel_path); + create_path( + path.parent().unwrap(), + Some(self.config.dir_options.clone()), + Some(self.config.dir_options.clone()), + )?; + + let mut rrd = (self.load_rrd_cb)(&path, rel_path, dst); + + if !new_only || time > rrd.last_update() { + rrd.update(time, value); + } + self.map.insert(rel_path.to_string(), rrd); + } + Ok(()) + } + + pub fn file_list(&self) -> Vec { + let mut list = Vec::new(); + + for rel_path in self.map.keys() { + list.push(rel_path.clone()); + } + + list + } + + pub fn flush_rrd_file(&self, rel_path: &str) -> Result<(), Error> { + if let Some(rrd) = self.map.get(rel_path) { + let mut path = self.config.basedir.clone(); + path.push(rel_path); + rrd.save(&path, self.config.file_options.clone(), true) + } else { + bail!("rrd file {} not loaded", rel_path); + } + } + + pub fn extract_cached_data( + &self, + base: &str, + name: &str, + cf: AggregationFn, + resolution: u64, + start: Option, + end: Option, + ) -> Result, Error> { + match self.map.get(&format!("{}/{}", base, name)) { + Some(rrd) => Ok(Some(rrd.extract_data(cf, resolution, start, end)?)), + None => Ok(None), + } + } +} diff --git a/vendor/proxmox-rrd/src/lib.rs b/vendor/proxmox-rrd/src/lib.rs new file mode 100644 index 000000000..65e042479 --- /dev/null +++ b/vendor/proxmox-rrd/src/lib.rs @@ -0,0 +1,17 @@ +//! # Round Robin Database files +//! +//! ## Features +//! +//! * One file stores a single data source +//! * Stores data for different time resolution +//! * Simple cache implementation with journal support + +#[cfg(feature = "rrd_v1")] +mod rrd_v1; + +pub mod rrd; +#[doc(inline)] +pub use rrd::Entry; + +mod cache; +pub use cache::*; diff --git a/vendor/proxmox-rrd/src/rrd.rs b/vendor/proxmox-rrd/src/rrd.rs new file mode 100644 index 000000000..440abe06c --- /dev/null +++ b/vendor/proxmox-rrd/src/rrd.rs @@ -0,0 +1,698 @@ +//! # Proxmox RRD format version 2 +//! +//! The new format uses +//! [CBOR](https://datatracker.ietf.org/doc/html/rfc8949) as storage +//! format. This way we can use the serde serialization framework, +//! which make our code more flexible, much nicer and type safe. +//! +//! ## Features +//! +//! * Well defined data format [CBOR](https://datatracker.ietf.org/doc/html/rfc8949) +//! * Platform independent (big endian f64, hopefully a standard format?) +//! * Arbitrary number of RRAs (dynamically changeable) + +use std::io::{Read, Write}; +use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd}; +use std::path::Path; + +use anyhow::{bail, format_err, Error}; +use serde::{Deserialize, Serialize}; + +use proxmox_schema::api; +use proxmox_sys::fs::{make_tmp_file, CreateOptions}; + +/// Proxmox RRD v2 file magic number +// openssl::sha::sha256(b"Proxmox Round Robin Database file v2.0")[0..8]; +pub const PROXMOX_RRD_MAGIC_2_0: [u8; 8] = [224, 200, 228, 27, 239, 112, 122, 159]; + +#[api()] +#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +/// RRD data source type +pub enum DataSourceType { + /// Gauge values are stored unmodified. + Gauge, + /// Stores the difference to the previous value. + Derive, + /// Stores the difference to the previous value (like Derive), but + /// detect counter overflow (and ignores that value) + Counter, +} + +#[api()] +#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +/// Aggregation function +pub enum AggregationFn { + /// Average + Average, + /// Maximum + Maximum, + /// Minimum + Minimum, + /// Use the last value + Last, +} + +#[derive(Serialize, Deserialize)] +/// Data source specification +pub struct DataSource { + /// Data source type + pub dst: DataSourceType, + /// Last update time (epoch) + pub last_update: f64, + /// Stores the last value, used to compute differential value for + /// derive/counters + pub last_value: f64, +} + +/// An RRD entry. +/// +/// Serializes as a tuple. +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde( + from = "(u64, u64, Vec>)", + into = "(u64, u64, Vec>)" +)] +pub struct Entry { + pub start: u64, + pub resolution: u64, + pub data: Vec>, +} + +impl Entry { + pub const fn new(start: u64, resolution: u64, data: Vec>) -> Self { + Self { + start, + resolution, + data, + } + } + + /// Get a data point at a specific index which also does bound checking and returns `None` for + /// out of bounds indices. + pub fn get(&self, idx: usize) -> Option { + self.data.get(idx).copied().flatten() + } +} + +impl From for (u64, u64, Vec>) { + fn from(entry: Entry) -> (u64, u64, Vec>) { + (entry.start, entry.resolution, entry.data) + } +} + +impl From<(u64, u64, Vec>)> for Entry { + fn from(data: (u64, u64, Vec>)) -> Self { + Self::new(data.0, data.1, data.2) + } +} + +impl DataSource { + /// Create a new Instance + pub fn new(dst: DataSourceType) -> Self { + Self { + dst, + last_update: 0.0, + last_value: f64::NAN, + } + } + + fn compute_new_value(&mut self, time: f64, mut value: f64) -> Result { + if time < 0.0 { + bail!("got negative time"); + } + if time <= self.last_update { + bail!("time in past ({} < {})", time, self.last_update); + } + + if value.is_nan() { + bail!("new value is NAN"); + } + + // derive counter value + let is_counter = self.dst == DataSourceType::Counter; + + if is_counter || self.dst == DataSourceType::Derive { + let time_diff = time - self.last_update; + + let diff = if self.last_value.is_nan() { + 0.0 + } else if is_counter && value < 0.0 { + bail!("got negative value for counter"); + } else if is_counter && value < self.last_value { + // Note: We do not try automatic overflow corrections, but + // we update last_value anyways, so that we can compute the diff + // next time. + self.last_value = value; + bail!("counter overflow/reset detected"); + } else { + value - self.last_value + }; + self.last_value = value; + value = diff / time_diff; + } else { + self.last_value = value; + } + + Ok(value) + } +} + +#[derive(Serialize, Deserialize)] +/// Round Robin Archive +pub struct Archive { + /// Number of seconds spanned by a single data entry. + pub resolution: u64, + /// Consolidation function. + pub cf: AggregationFn, + /// Count values computed inside this update interval. + pub last_count: u64, + /// The actual data entries. + pub data: Vec, +} + +impl Archive { + /// Creates a new instance + pub fn new(cf: AggregationFn, resolution: u64, points: usize) -> Self { + Self { + cf, + resolution, + last_count: 0, + data: vec![f64::NAN; points], + } + } + + /// Data slot end time + pub fn slot_end_time(&self, time: u64) -> u64 { + self.resolution * (time / self.resolution + 1) + } + + /// Data slot start time + pub fn slot_start_time(&self, time: u64) -> u64 { + self.resolution * (time / self.resolution) + } + + /// Data slot index + pub fn slot(&self, time: u64) -> usize { + ((time / self.resolution) as usize) % self.data.len() + } + + /// Directly overwrite data slots. + /// + /// The caller need to set `last_update` value on the [DataSource] manually. + pub fn insert_data( + &mut self, + start: u64, + resolution: u64, + data: Vec>, + ) -> Result<(), Error> { + if resolution != self.resolution { + bail!("insert_data failed: got wrong resolution"); + } + + let mut index = self.slot(start); + + for item in data { + if let Some(v) = item { + self.data[index] = v; + } + index += 1; + if index >= self.data.len() { + index = 0; + } + } + Ok(()) + } + + fn delete_old_slots(&mut self, time: f64, last_update: f64) { + let epoch = time as u64; + let last_update = last_update as u64; + let reso = self.resolution; + let num_entries = self.data.len() as u64; + + let min_time = epoch.saturating_sub(num_entries * reso); + let min_time = self.slot_end_time(min_time); + + let mut t = last_update.saturating_sub(num_entries * reso); + let mut index = self.slot(t); + + for _ in 0..num_entries { + t += reso; + index += 1; + if index >= self.data.len() { + index = 0; + } + if t < min_time { + self.data[index] = f64::NAN; + } else { + break; + } + } + } + + fn compute_new_value(&mut self, time: f64, last_update: f64, value: f64) { + let epoch = time as u64; + let last_update = last_update as u64; + let reso = self.resolution; + + let index = self.slot(epoch); + let last_index = self.slot(last_update); + + if (epoch - last_update) > reso || index != last_index { + self.last_count = 0; + } + + let last_value = self.data[index]; + if last_value.is_nan() { + self.last_count = 0; + } + + let new_count = self.last_count.saturating_add(1); + + if self.last_count == 0 { + self.data[index] = value; + self.last_count = 1; + } else { + let new_value = match self.cf { + AggregationFn::Maximum => { + if last_value > value { + last_value + } else { + value + } + } + AggregationFn::Minimum => { + if last_value < value { + last_value + } else { + value + } + } + AggregationFn::Last => value, + AggregationFn::Average => { + (last_value * (self.last_count as f64)) / (new_count as f64) + + value / (new_count as f64) + } + }; + self.data[index] = new_value; + self.last_count = new_count; + } + } + + /// Extract data + /// + /// Extract data from `start` to `end`. The RRA itself does not + /// store the `last_update` time, so you need to pass this a + /// parameter (see [DataSource]). + pub fn extract_data(&self, start: u64, end: u64, last_update: f64) -> Entry { + let last_update = last_update as u64; + let reso = self.resolution; + let num_entries = self.data.len() as u64; + + let mut list = Vec::new(); + + let rrd_end = self.slot_end_time(last_update); + let rrd_start = rrd_end.saturating_sub(reso * num_entries); + + let mut t = start; + let mut index = self.slot(t); + for _ in 0..num_entries { + if t > end { + break; + }; + if t < rrd_start || t >= rrd_end { + list.push(None); + } else { + let value = self.data[index]; + if value.is_nan() { + list.push(None); + } else { + list.push(Some(value)); + } + } + t += reso; + index += 1; + if index >= self.data.len() { + index = 0; + } + } + + Entry::new(start, reso, list) + } +} + +#[derive(Serialize, Deserialize)] +/// Round Robin Database +pub struct Database { + /// The data source definition + pub source: DataSource, + /// List of round robin archives + pub rra_list: Vec, +} + +impl Database { + /// Creates a new Instance + pub fn new(dst: DataSourceType, rra_list: Vec) -> Database { + let source = DataSource::new(dst); + + Database { source, rra_list } + } + + fn from_raw(raw: &[u8]) -> Result { + if raw.len() < 8 { + bail!("not an rrd file - file is too small ({})", raw.len()); + } + + let rrd: Database = match &raw[0..8] { + #[cfg(feature = "rrd_v1")] + magic if magic == crate::rrd_v1::PROXMOX_RRD_MAGIC_1_0 => { + let v1 = crate::rrd_v1::RRDv1::from_raw(raw)?; + v1.to_rrd_v2() + .map_err(|err| format_err!("unable to convert from old V1 format - {err}"))? + } + magic if magic == PROXMOX_RRD_MAGIC_2_0 => serde_cbor::from_slice(&raw[8..]) + .map_err(|err| format_err!("unable to decode RRD file - {err}"))?, + _ => bail!("not an rrd file - unknown magic number"), + }; + + if rrd.source.last_update < 0.0 { + bail!("rrd file has negative last_update time"); + } + + Ok(rrd) + } + + /// Load data from a file + /// + /// Setting `avoid_page_cache` uses + /// `fadvise(..,POSIX_FADV_DONTNEED)` to avoid keeping the data in + /// the linux page cache. + pub fn load(path: &Path, avoid_page_cache: bool) -> Result { + let mut file = std::fs::File::open(path)?; + let buffer_size = file.metadata().map(|m| m.len() as usize + 1).unwrap_or(0); + let mut raw = Vec::with_capacity(buffer_size); + file.read_to_end(&mut raw)?; + + if avoid_page_cache { + nix::fcntl::posix_fadvise( + file.as_raw_fd(), + 0, + buffer_size as i64, + nix::fcntl::PosixFadviseAdvice::POSIX_FADV_DONTNEED, + ) + .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err.to_string()))?; + } + + match Self::from_raw(&raw) { + Ok(rrd) => Ok(rrd), + Err(err) => Err(std::io::Error::new( + std::io::ErrorKind::Other, + err.to_string(), + )), + } + } + + /// Store data into a file (atomic replace file) + /// + /// Setting `avoid_page_cache` uses + /// `fadvise(..,POSIX_FADV_DONTNEED)` to avoid keeping the data in + /// the linux page cache. + pub fn save( + &self, + path: &Path, + options: CreateOptions, + avoid_page_cache: bool, + ) -> Result<(), Error> { + let (fd, tmp_path) = make_tmp_file(path, options)?; + let mut file = unsafe { std::fs::File::from_raw_fd(fd.into_raw_fd()) }; + + let mut try_block = || -> Result<(), Error> { + let mut data: Vec = Vec::new(); + data.extend(PROXMOX_RRD_MAGIC_2_0); + serde_cbor::to_writer(&mut data, self)?; + file.write_all(&data)?; + + if avoid_page_cache { + nix::fcntl::posix_fadvise( + file.as_raw_fd(), + 0, + data.len() as i64, + nix::fcntl::PosixFadviseAdvice::POSIX_FADV_DONTNEED, + )?; + } + + Ok(()) + }; + + match try_block() { + Ok(()) => (), + error => { + let _ = nix::unistd::unlink(&tmp_path); + return error; + } + } + + if let Err(err) = std::fs::rename(&tmp_path, path) { + let _ = nix::unistd::unlink(&tmp_path); + bail!("Atomic rename failed - {}", err); + } + + Ok(()) + } + + /// Returns the last update time. + pub fn last_update(&self) -> f64 { + self.source.last_update + } + + /// Update the value (in memory) + /// + /// Note: This does not call [Self::save]. + pub fn update(&mut self, time: f64, value: f64) { + let value = match self.source.compute_new_value(time, value) { + Ok(value) => value, + Err(err) => { + log::error!("rrd update failed: {}", err); + return; + } + }; + + let last_update = self.source.last_update; + self.source.last_update = time; + + for rra in self.rra_list.iter_mut() { + rra.delete_old_slots(time, last_update); + rra.compute_new_value(time, last_update, value); + } + } + + /// Extract data from the archive + /// + /// This selects the RRA with specified [AggregationFn] and (minimum) + /// resolution, and extract data from `start` to `end`. + /// + /// `start`: Start time. If not specified, we simply extract 10 data points. + /// `end`: End time. Default is to use the current time. + pub fn extract_data( + &self, + cf: AggregationFn, + resolution: u64, + start: Option, + end: Option, + ) -> Result { + let mut rra: Option<&Archive> = None; + for item in self.rra_list.iter() { + if item.cf != cf { + continue; + } + if item.resolution > resolution { + continue; + } + + if let Some(current) = rra { + if item.resolution > current.resolution { + rra = Some(item); + } + } else { + rra = Some(item); + } + } + + match rra { + Some(rra) => { + let end = end.unwrap_or_else(|| proxmox_time::epoch_f64() as u64); + let start = start.unwrap_or_else(|| end.saturating_sub(10 * rra.resolution)); + Ok(rra.extract_data(start, end, self.source.last_update)) + } + None => bail!("unable to find RRA suitable ({:?}:{})", cf, resolution), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn basic_rra_maximum_gauge_test() -> Result<(), Error> { + let rra = Archive::new(AggregationFn::Maximum, 60, 5); + let mut rrd = Database::new(DataSourceType::Gauge, vec![rra]); + + for i in 2..10 { + rrd.update((i as f64) * 30.0, i as f64); + } + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Maximum, 60, Some(0), Some(5 * 60))?; + assert_eq!(start, 0); + assert_eq!(resolution, 60); + assert_eq!(data, [None, Some(3.0), Some(5.0), Some(7.0), Some(9.0)]); + + Ok(()) + } + + #[test] + fn basic_rra_minimum_gauge_test() -> Result<(), Error> { + let rra = Archive::new(AggregationFn::Minimum, 60, 5); + let mut rrd = Database::new(DataSourceType::Gauge, vec![rra]); + + for i in 2..10 { + rrd.update((i as f64) * 30.0, i as f64); + } + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Minimum, 60, Some(0), Some(5 * 60))?; + assert_eq!(start, 0); + assert_eq!(resolution, 60); + assert_eq!(data, [None, Some(2.0), Some(4.0), Some(6.0), Some(8.0)]); + + Ok(()) + } + + #[test] + fn basic_rra_last_gauge_test() -> Result<(), Error> { + let rra = Archive::new(AggregationFn::Last, 60, 5); + let mut rrd = Database::new(DataSourceType::Gauge, vec![rra]); + + for i in 2..10 { + rrd.update((i as f64) * 30.0, i as f64); + } + + assert!( + rrd.extract_data(AggregationFn::Average, 60, Some(0), Some(5 * 60)) + .is_err(), + "CF::Average should not exist" + ); + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Last, 60, Some(0), Some(20 * 60))?; + assert_eq!(start, 0); + assert_eq!(resolution, 60); + assert_eq!(data, [None, Some(3.0), Some(5.0), Some(7.0), Some(9.0)]); + + Ok(()) + } + + #[test] + fn basic_rra_average_derive_test() -> Result<(), Error> { + let rra = Archive::new(AggregationFn::Average, 60, 5); + let mut rrd = Database::new(DataSourceType::Derive, vec![rra]); + + for i in 2..10 { + rrd.update((i as f64) * 30.0, (i * 60) as f64); + } + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Average, 60, Some(60), Some(5 * 60))?; + assert_eq!(start, 60); + assert_eq!(resolution, 60); + assert_eq!(data, [Some(1.0), Some(2.0), Some(2.0), Some(2.0), None]); + + Ok(()) + } + + #[test] + fn basic_rra_average_gauge_test() -> Result<(), Error> { + let rra = Archive::new(AggregationFn::Average, 60, 5); + let mut rrd = Database::new(DataSourceType::Gauge, vec![rra]); + + for i in 2..10 { + rrd.update((i as f64) * 30.0, i as f64); + } + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Average, 60, Some(60), Some(5 * 60))?; + assert_eq!(start, 60); + assert_eq!(resolution, 60); + assert_eq!(data, [Some(2.5), Some(4.5), Some(6.5), Some(8.5), None]); + + for i in 10..14 { + rrd.update((i as f64) * 30.0, i as f64); + } + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Average, 60, Some(60), Some(5 * 60))?; + assert_eq!(start, 60); + assert_eq!(resolution, 60); + assert_eq!(data, [None, Some(4.5), Some(6.5), Some(8.5), Some(10.5)]); + + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Average, 60, Some(3 * 60), Some(8 * 60))?; + assert_eq!(start, 3 * 60); + assert_eq!(resolution, 60); + assert_eq!(data, [Some(6.5), Some(8.5), Some(10.5), Some(12.5), None]); + + // add much newer value (should delete all previous/outdated value) + let i = 100; + rrd.update((i as f64) * 30.0, i as f64); + println!("TEST {:?}", serde_json::to_string_pretty(&rrd)); + + let Entry { + start, + resolution, + data, + } = rrd.extract_data( + AggregationFn::Average, + 60, + Some(100 * 30), + Some(100 * 30 + 5 * 60), + )?; + assert_eq!(start, 100 * 30); + assert_eq!(resolution, 60); + assert_eq!(data, [Some(100.0), None, None, None, None]); + + // extract with end time smaller than start time + let Entry { + start, + resolution, + data, + } = rrd.extract_data(AggregationFn::Average, 60, Some(100 * 30), Some(60))?; + assert_eq!(start, 100 * 30); + assert_eq!(resolution, 60); + assert_eq!(data, []); + + Ok(()) + } +} diff --git a/vendor/proxmox-rrd/src/rrd_v1.rs b/vendor/proxmox-rrd/src/rrd_v1.rs new file mode 100644 index 000000000..a62e3a7c5 --- /dev/null +++ b/vendor/proxmox-rrd/src/rrd_v1.rs @@ -0,0 +1,295 @@ +use std::io::Read; + +use anyhow::Error; +use bitflags::bitflags; + +/// The number of data entries per RRA +pub const RRD_DATA_ENTRIES: usize = 70; + +/// Proxmox RRD file magic number +// openssl::sha::sha256(b"Proxmox Round Robin Database file v1.0")[0..8]; +pub const PROXMOX_RRD_MAGIC_1_0: [u8; 8] = [206, 46, 26, 212, 172, 158, 5, 186]; + +use crate::rrd::{AggregationFn, Archive, DataSource, DataSourceType, Database}; + +bitflags! { + /// Flags to specify the data source type and consolidation function + pub struct RRAFlags: u64 { + // Data Source Types + const DST_GAUGE = 1; + const DST_DERIVE = 2; + const DST_COUNTER = 4; + const DST_MASK = 255; // first 8 bits + + // Consolidation Functions + const CF_AVERAGE = 1 << 8; + const CF_MAX = 2 << 8; + const CF_MASK = 255 << 8; + } +} + +/// Round Robin Archive with [RRD_DATA_ENTRIES] data slots. +/// +/// This data structure is used inside [Database] and directly written to the +/// RRD files. +#[repr(C)] +pub struct RRAv1 { + /// Defined the data source type and consolidation function + pub flags: RRAFlags, + /// Resolution (seconds) + pub resolution: u64, + /// Last update time (epoch) + pub last_update: f64, + /// Count values computed inside this update interval + pub last_count: u64, + /// Stores the last value, used to compute differential value for derive/counters + pub counter_value: f64, + /// Data slots + pub data: [f64; RRD_DATA_ENTRIES], +} + +impl RRAv1 { + fn extract_data(&self) -> (u64, u64, Vec>) { + let reso = self.resolution; + + let mut list = Vec::new(); + + let rra_end = reso * ((self.last_update as u64) / reso); + let rra_start = rra_end - reso * (RRD_DATA_ENTRIES as u64); + + let mut t = rra_start; + let mut index = ((t / reso) % (RRD_DATA_ENTRIES as u64)) as usize; + for _ in 0..RRD_DATA_ENTRIES { + let value = self.data[index]; + if value.is_nan() { + list.push(None); + } else { + list.push(Some(value)); + } + + t += reso; + index = (index + 1) % RRD_DATA_ENTRIES; + } + + (rra_start, reso, list) + } +} + +/// Round Robin Database file format with fixed number of [Archive]s +#[repr(C)] +// Note: Avoid alignment problems by using 8byte types only +pub struct RRDv1 { + /// The magic number to identify the file type + pub magic: [u8; 8], + /// Hourly data (average values) + pub hour_avg: RRAv1, + /// Hourly data (maximum values) + pub hour_max: RRAv1, + /// Daily data (average values) + pub day_avg: RRAv1, + /// Daily data (maximum values) + pub day_max: RRAv1, + /// Weekly data (average values) + pub week_avg: RRAv1, + /// Weekly data (maximum values) + pub week_max: RRAv1, + /// Monthly data (average values) + pub month_avg: RRAv1, + /// Monthly data (maximum values) + pub month_max: RRAv1, + /// Yearly data (average values) + pub year_avg: RRAv1, + /// Yearly data (maximum values) + pub year_max: RRAv1, +} + +impl RRDv1 { + pub fn from_raw(mut raw: &[u8]) -> Result { + let expected_len = std::mem::size_of::(); + + if raw.len() != expected_len { + let msg = format!("wrong data size ({} != {})", raw.len(), expected_len); + return Err(std::io::Error::new(std::io::ErrorKind::Other, msg)); + } + + let mut rrd: RRDv1 = unsafe { std::mem::zeroed() }; + unsafe { + let rrd_slice = + std::slice::from_raw_parts_mut(&mut rrd as *mut _ as *mut u8, expected_len); + raw.read_exact(rrd_slice)?; + } + + if rrd.magic != PROXMOX_RRD_MAGIC_1_0 { + let msg = "wrong magic number".to_string(); + return Err(std::io::Error::new(std::io::ErrorKind::Other, msg)); + } + + Ok(rrd) + } + + pub fn to_rrd_v2(&self) -> Result { + let mut rra_list = Vec::new(); + + // old format v1: + // + // hour 1 min, 70 points + // day 30 min, 70 points + // week 3 hours, 70 points + // month 12 hours, 70 points + // year 1 week, 70 points + // + // new default for RRD v2: + // + // day 1 min, 1440 points + // month 30 min, 1440 points + // year 365 min (6h), 1440 points + // decade 1 week, 570 points + + // Linear extrapolation + fn extrapolate_data( + start: u64, + reso: u64, + factor: u64, + data: Vec>, + ) -> (u64, u64, Vec>) { + let mut new = Vec::new(); + + for i in 0..data.len() { + let mut next = i + 1; + if next >= data.len() { + next = 0 + }; + let v = data[i]; + let v1 = data[next]; + match (v, v1) { + (Some(v), Some(v1)) => { + let diff = (v1 - v) / (factor as f64); + for j in 0..factor { + new.push(Some(v + diff * (j as f64))); + } + } + (Some(v), None) => { + new.push(Some(v)); + for _ in 0..factor - 1 { + new.push(None); + } + } + (None, Some(v1)) => { + for _ in 0..factor - 1 { + new.push(None); + } + new.push(Some(v1)); + } + (None, None) => { + for _ in 0..factor { + new.push(None); + } + } + } + } + + (start, reso / factor, new) + } + + // Try to convert to new, higher capacity format + + // compute daily average (merge old self.day_avg and self.hour_avg + let mut day_avg = Archive::new(AggregationFn::Average, 60, 1440); + + let (start, reso, data) = self.day_avg.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 30, data); + day_avg.insert_data(start, reso, data)?; + + let (start, reso, data) = self.hour_avg.extract_data(); + day_avg.insert_data(start, reso, data)?; + + // compute daily maximum (merge old self.day_max and self.hour_max + let mut day_max = Archive::new(AggregationFn::Maximum, 60, 1440); + + let (start, reso, data) = self.day_max.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 30, data); + day_max.insert_data(start, reso, data)?; + + let (start, reso, data) = self.hour_max.extract_data(); + day_max.insert_data(start, reso, data)?; + + // compute monthly average (merge old self.month_avg, + // self.week_avg and self.day_avg) + let mut month_avg = Archive::new(AggregationFn::Average, 30 * 60, 1440); + + let (start, reso, data) = self.month_avg.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 24, data); + month_avg.insert_data(start, reso, data)?; + + let (start, reso, data) = self.week_avg.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 6, data); + month_avg.insert_data(start, reso, data)?; + + let (start, reso, data) = self.day_avg.extract_data(); + month_avg.insert_data(start, reso, data)?; + + // compute monthly maximum (merge old self.month_max, + // self.week_max and self.day_max) + let mut month_max = Archive::new(AggregationFn::Maximum, 30 * 60, 1440); + + let (start, reso, data) = self.month_max.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 24, data); + month_max.insert_data(start, reso, data)?; + + let (start, reso, data) = self.week_max.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 6, data); + month_max.insert_data(start, reso, data)?; + + let (start, reso, data) = self.day_max.extract_data(); + month_max.insert_data(start, reso, data)?; + + // compute yearly average (merge old self.year_avg) + let mut year_avg = Archive::new(AggregationFn::Average, 6 * 3600, 1440); + + let (start, reso, data) = self.year_avg.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 28, data); + year_avg.insert_data(start, reso, data)?; + + // compute yearly maximum (merge old self.year_avg) + let mut year_max = Archive::new(AggregationFn::Maximum, 6 * 3600, 1440); + + let (start, reso, data) = self.year_max.extract_data(); + let (start, reso, data) = extrapolate_data(start, reso, 28, data); + year_max.insert_data(start, reso, data)?; + + // compute decade average (merge old self.year_avg) + let mut decade_avg = Archive::new(AggregationFn::Average, 7 * 86400, 570); + let (start, reso, data) = self.year_avg.extract_data(); + decade_avg.insert_data(start, reso, data)?; + + // compute decade maximum (merge old self.year_max) + let mut decade_max = Archive::new(AggregationFn::Maximum, 7 * 86400, 570); + let (start, reso, data) = self.year_max.extract_data(); + decade_max.insert_data(start, reso, data)?; + + rra_list.push(day_avg); + rra_list.push(day_max); + rra_list.push(month_avg); + rra_list.push(month_max); + rra_list.push(year_avg); + rra_list.push(year_max); + rra_list.push(decade_avg); + rra_list.push(decade_max); + + // use values from hour_avg for source (all RRAv1 must have the same config) + let dst = if self.hour_avg.flags.contains(RRAFlags::DST_COUNTER) { + DataSourceType::Counter + } else if self.hour_avg.flags.contains(RRAFlags::DST_DERIVE) { + DataSourceType::Derive + } else { + DataSourceType::Gauge + }; + + let source = DataSource { + dst, + last_value: f64::NAN, + last_update: self.hour_avg.last_update, // IMPORTANT! + }; + Ok(Database { source, rra_list }) + } +} diff --git a/vendor/proxmox-rrd/tests/file_format_test.rs b/vendor/proxmox-rrd/tests/file_format_test.rs new file mode 100644 index 000000000..c505f829d --- /dev/null +++ b/vendor/proxmox-rrd/tests/file_format_test.rs @@ -0,0 +1,57 @@ +use std::path::Path; +use std::process::Command; + +use anyhow::{bail, Error}; + +use proxmox_rrd::rrd::Database; +use proxmox_sys::fs::CreateOptions; + +fn compare_file(fn1: &str, fn2: &str) -> Result<(), Error> { + let status = Command::new("/usr/bin/cmp") + .arg(fn1) + .arg(fn2) + .status() + .expect("failed to execute process"); + + if !status.success() { + bail!("file compare failed"); + } + + Ok(()) +} + +const RRD_V2_FN: &str = "./tests/testdata/cpu.rrd_v2"; + +// make sure we can load and convert RRD v1 +#[test] +#[cfg(feature = "rrd_v1")] +fn upgrade_from_rrd_v1() -> Result<(), Error> { + const RRD_V1_FN: &str = "./tests/testdata/cpu.rrd_v1"; + let rrd = Database::load(Path::new(RRD_V1_FN), true)?; + + const RRD_V2_NEW_FN: &str = "./tests/testdata/cpu.rrd_v2.upgraded"; + let new_path = Path::new(RRD_V2_NEW_FN); + rrd.save(new_path, CreateOptions::new(), true)?; + + let result = compare_file(RRD_V2_FN, RRD_V2_NEW_FN); + let _ = std::fs::remove_file(RRD_V2_NEW_FN); + result?; + + Ok(()) +} + +// make sure we can load and save RRD v2 +#[test] +fn load_and_save_rrd_v2() -> Result<(), Error> { + let rrd = Database::load(Path::new(RRD_V2_FN), true)?; + + const RRD_V2_NEW_FN: &str = "./tests/testdata/cpu.rrd_v2.saved"; + let new_path = Path::new(RRD_V2_NEW_FN); + rrd.save(new_path, CreateOptions::new(), true)?; + + let result = compare_file(RRD_V2_FN, RRD_V2_NEW_FN); + let _ = std::fs::remove_file(RRD_V2_NEW_FN); + result?; + + Ok(()) +} diff --git a/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v1 b/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v1 new file mode 100644 index 000000000..99d43d34b Binary files /dev/null and b/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v1 differ diff --git a/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v2 b/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v2 new file mode 100644 index 000000000..5e4dfc771 Binary files /dev/null and b/vendor/proxmox-rrd/tests/testdata/cpu.rrd_v2 differ diff --git a/vendor/proxmox-schema/.cargo-checksum.json b/vendor/proxmox-schema/.cargo-checksum.json index fe982fc01..8477ebf49 100644 --- a/vendor/proxmox-schema/.cargo-checksum.json +++ b/vendor/proxmox-schema/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"bc841bb53d3da8a286a306e5e06ee31da7a730cdfe59b353c5969e6203d47295","src/api_type_macros.rs":"8f3e8a4dea0570c840f1ace43f9ab840ca1df4b4786be96c0e27eba146ba0875","src/api_types.rs":"beb2e939dc7495dff5a60ae4f00613cc34cb7dbdcc5ee1f4e5065f05035d25d1","src/const_regex.rs":"3c3f822d09136ccd52fbd66042b2ad37fc12945bef320d7a29b38b72cbd6465b","src/de/cow3.rs":"35e669ce7c8ae6f0dfb04cc6e18269a295ce1c65918354d7e70e0b12177d06ca","src/de/extract.rs":"2ba92355cae965a6a5dfe4b050a8f0cbb74afbf4e6f991f87ddffdb8ac858446","src/de/mod.rs":"1f18ae995a2133c90c6b1eb88b0dcc3117626126042c10714124d15a5c002cae","src/de/no_schema.rs":"4e8f04ee2fceb965dd504ae2ad665f7d93674bb2b3e7ee789789b741ceb44c51","src/de/verify.rs":"d81d289a6a1c5cb65f089a818244691ac8020ce1014dc54db7f6ac0d25c0b001","src/format.rs":"86b67c48b8f0813ac842e3b5d02fde19a0bc4f256ce3622e2eb26e88314a8980","src/lib.rs":"310a443c57789eb234c2a0d770764614abe9c108578e6198e0b2d130009f991c","src/property_string.rs":"c332ffff9b30cc896af52100bb2d63beac17a6380a487f5873e64c122bc37543","src/schema.rs":"5f6e5243afcdc1ad0830253f2161b7a4989001999a7e50aee7749e479f71f5f7","src/ser/mod.rs":"c0e7d6246c28e00e909cd864f23fd23933add192916a0c1ab424c468244e4431","src/upid.rs":"6d0f629b0c652b1f156541ffe31fe9dff4b5d923cd3ee2fb31f7a9baaec5f1fe","tests/schema.rs":"a4703c7344fe2b02da63c3a542d09c8a89d78369aa87ebf17990581b2c92810d","tests/schema_verification.rs":"6995f32c6a82bff25c218127ba5b4cf5103aa5a39872a306bd8e73bcf898ec74"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"3d17609bb6d58afe13ab3b7f894d19d7efb1b2434651a298913c6162fb31c0af","src/api_type_macros.rs":"8f3e8a4dea0570c840f1ace43f9ab840ca1df4b4786be96c0e27eba146ba0875","src/api_types.rs":"beb2e939dc7495dff5a60ae4f00613cc34cb7dbdcc5ee1f4e5065f05035d25d1","src/const_regex.rs":"3c3f822d09136ccd52fbd66042b2ad37fc12945bef320d7a29b38b72cbd6465b","src/de/cow3.rs":"35e669ce7c8ae6f0dfb04cc6e18269a295ce1c65918354d7e70e0b12177d06ca","src/de/extract.rs":"a18ab6429e1ccb95a07191ade26d8d9c0751739655b94fc42fd9aa13c0c0defd","src/de/mod.rs":"cef0c7239d3d5ae791ce85b726320e9e1dec016cd5319f8278f97e4459419af7","src/de/no_schema.rs":"27dac17ec316cd65c7dfeed5ec1830919acfaa8a2300569472fe7e7cb8baed6e","src/de/verify.rs":"9a0247d47698e5f5f6eea2be10d08237ee23667c42e67ac9086d34acda845f3b","src/format.rs":"7d9ca55e7d3d4fd50ea9853d358cbd1b85af41004068c4598392f6aeff4b0140","src/lib.rs":"310a443c57789eb234c2a0d770764614abe9c108578e6198e0b2d130009f991c","src/property_string.rs":"c332ffff9b30cc896af52100bb2d63beac17a6380a487f5873e64c122bc37543","src/schema.rs":"112c8d5fcc56bc05346bab9db3044da06ff44f79349e59cf7c6ae7eaf519e078","src/ser/mod.rs":"c0e7d6246c28e00e909cd864f23fd23933add192916a0c1ab424c468244e4431","src/upid.rs":"6d0f629b0c652b1f156541ffe31fe9dff4b5d923cd3ee2fb31f7a9baaec5f1fe","tests/schema.rs":"a4703c7344fe2b02da63c3a542d09c8a89d78369aa87ebf17990581b2c92810d","tests/schema_verification.rs":"6995f32c6a82bff25c218127ba5b4cf5103aa5a39872a306bd8e73bcf898ec74"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-schema/Cargo.toml b/vendor/proxmox-schema/Cargo.toml index 695401d50..628937852 100644 --- a/vendor/proxmox-schema/Cargo.toml +++ b/vendor/proxmox-schema/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-schema" -version = "2.0.2" +version = "3.0.0" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "proxmox api schema and validation" @@ -36,7 +36,7 @@ version = "0.26.1" optional = true [dependencies.proxmox-api-macro] -version = "1.0.6" +version = "1.0.8" path = "../proxmox-api-macro" optional = true @@ -44,7 +44,7 @@ optional = true url = "2.2" [dev-dependencies.proxmox-api-macro] -version = "1.0.6" +version = "1.0.8" path = "../proxmox-api-macro" [dev-dependencies.serde] diff --git a/vendor/proxmox-schema/src/de/extract.rs b/vendor/proxmox-schema/src/de/extract.rs index 6c2edcd8d..6166c7b25 100644 --- a/vendor/proxmox-schema/src/de/extract.rs +++ b/vendor/proxmox-schema/src/de/extract.rs @@ -52,7 +52,9 @@ impl<'o> ExtractValueDeserializer<'o> { schema: &'static Schema, ) -> Option { match schema { - Schema::Object(_) | Schema::AllOf(_) => Some(Self { object, schema }), + Schema::Object(_) | Schema::AllOf(_) | Schema::OneOf(_) => { + Some(Self { object, schema }) + } _ => None, } } @@ -106,6 +108,10 @@ impl<'de> de::Deserializer<'de> for ExtractValueDeserializer<'de> { self.object, schema.properties().map(|(name, _, _)| *name), )), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::<'de>::new( + self.object, + schema.properties().map(|(name, _, _)| *name), + )), // The following should be caught by ExtractValueDeserializer::new()! _ => Err(Error::custom( @@ -134,6 +140,10 @@ impl<'de> de::Deserializer<'de> for ExtractValueDeserializer<'de> { self.object, schema.properties().map(|(name, _, _)| *name), )), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::<'de>::new( + self.object, + schema.properties().map(|(name, _, _)| *name), + )), // The following should be caught by ExtractValueDeserializer::new()! _ => Err(Error::custom( diff --git a/vendor/proxmox-schema/src/de/mod.rs b/vendor/proxmox-schema/src/de/mod.rs index cccca06f9..75b500e54 100644 --- a/vendor/proxmox-schema/src/de/mod.rs +++ b/vendor/proxmox-schema/src/de/mod.rs @@ -19,6 +19,8 @@ pub use extract::ExtractValueDeserializer; use cow3::{str_slice_to_range, Cow3}; +pub use no_schema::{split_list, SplitList}; + // Used to disable calling `check_constraints` on a `StringSchema` if it is being deserialized // for a `PropertyString`, which performs its own checking. thread_local! { @@ -129,6 +131,7 @@ impl<'de, 'i> SchemaDeserializer<'de, 'i> { match schema { Schema::Object(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::AllOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), _ => Err(Error::msg( "non-object-like schema in ApiStringFormat::PropertyString while deserializing a property string", )), @@ -162,6 +165,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { match self.schema { Schema::Array(schema) => visitor.visit_seq(SeqAccess::new(self.input, schema)), Schema::AllOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::Object(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::Null => Err(Error::msg("null")), Schema::Boolean(_) => visitor.visit_bool( @@ -263,6 +267,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { match self.schema { Schema::Object(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::AllOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::String(schema) => match schema.format { Some(schema::ApiStringFormat::PropertyString(schema)) => { self.deserialize_property_string(visitor, schema) @@ -286,6 +291,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { match self.schema { Schema::Object(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::AllOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), + Schema::OneOf(schema) => visitor.visit_map(MapAccess::new_cow(self.input, schema)), Schema::String(schema) => match schema.format { Some(schema::ApiStringFormat::PropertyString(schema)) => { self.deserialize_property_string(visitor, schema) @@ -346,7 +352,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { } } -fn next_str_entry(input: &str, at: &mut usize, has_null: bool) -> Option> { +pub(crate) fn next_str_entry(input: &str, at: &mut usize, has_null: bool) -> Option> { while *at != input.len() { let begin = *at; @@ -369,7 +375,7 @@ fn next_str_entry(input: &str, at: &mut usize, has_null: bool) -> Option de::SeqAccess<'de> for SeqAccess<'de, 'i, 's> { } while let Some(el_range) = next_str_entry(&self.input, &mut self.at, self.has_null) { - if el_range.is_empty() { - continue; - } - if let Some(max) = self.schema.max_length { if self.count == max { return Err(Error::msg("too many elements")); diff --git a/vendor/proxmox-schema/src/de/no_schema.rs b/vendor/proxmox-schema/src/de/no_schema.rs index 254ebd96e..546e50017 100644 --- a/vendor/proxmox-schema/src/de/no_schema.rs +++ b/vendor/proxmox-schema/src/de/no_schema.rs @@ -271,41 +271,39 @@ impl<'de, 'i> de::SeqAccess<'de> for SimpleSeqAccess<'de, 'i> { where T: de::DeserializeSeed<'de>, { - while self.at != self.input.len() { - let begin = self.at; + let range = match super::next_str_entry(&self.input, &mut self.at, self.has_null) { + None => return Ok(None), + Some(range) => range, + }; - let input = &self.input[self.at..]; - - let end = if self.has_null { - input.find('\0') - } else { - input.find(|c: char| c == ',' || c == ';' || char::is_ascii_whitespace(&c)) - }; - - let end = match end { - None => { - self.at = self.input.len(); - input.len() - } - Some(pos) => { - self.at += pos + 1; - pos - } - }; - - if input[..end].is_empty() { - continue; - } - - return seed - .deserialize(NoSchemaDeserializer::new(match &self.input { - Cow3::Original(input) => Cow::Borrowed(&input[begin..end]), - Cow3::Intermediate(input) => Cow::Owned(input[begin..end].to_string()), - Cow3::Owned(input) => Cow::Owned(input[begin..end].to_string()), - })) - .map(Some); - } - - Ok(None) + seed.deserialize(NoSchemaDeserializer::new(match &self.input { + Cow3::Original(input) => Cow::Borrowed(&input[range]), + Cow3::Intermediate(input) => Cow::Owned(input[range].to_string()), + Cow3::Owned(input) => Cow::Owned(input[range].to_string()), + })) + .map(Some) + } +} + +pub fn split_list(input: &str) -> SplitList<'_> { + SplitList { + has_null: input.contains('\0'), + input, + at: 0, + } +} + +pub struct SplitList<'a> { + input: &'a str, + has_null: bool, + at: usize, +} + +impl<'a> Iterator for SplitList<'a> { + type Item = &'a str; + + fn next(&mut self) -> Option<&'a str> { + let range = super::next_str_entry(&self.input, &mut self.at, self.has_null)?; + Some(&self.input[range]) } } diff --git a/vendor/proxmox-schema/src/de/verify.rs b/vendor/proxmox-schema/src/de/verify.rs index 0ed47138c..24a14772f 100644 --- a/vendor/proxmox-schema/src/de/verify.rs +++ b/vendor/proxmox-schema/src/de/verify.rs @@ -120,6 +120,7 @@ impl<'de> Deserialize<'de> for Verifier { Schema::String(_) => deserializer.deserialize_str(visitor), Schema::Object(_) => deserializer.deserialize_map(visitor), Schema::AllOf(_) => deserializer.deserialize_map(visitor), + Schema::OneOf(_) => deserializer.deserialize_map(visitor), Schema::Array(_) => deserializer.deserialize_seq(visitor), Schema::Null => deserializer.deserialize_unit(visitor), } @@ -153,6 +154,7 @@ impl<'de> de::Visitor<'de> for Visitor { Schema::String(_) => f.write_str("string"), Schema::Object(_) => f.write_str("object"), Schema::AllOf(_) => f.write_str("allOf"), + Schema::OneOf(_) => f.write_str("oneOf"), Schema::Array(_) => f.write_str("Array"), Schema::Null => f.write_str("null"), } @@ -226,6 +228,7 @@ impl<'de> de::Visitor<'de> for Visitor { let schema: &'static dyn crate::schema::ObjectSchemaType = match self.0 { Schema::Object(schema) => schema, Schema::AllOf(schema) => schema, + Schema::OneOf(schema) => schema, _ => return Err(A::Error::invalid_type(Unexpected::Map, &self)), }; diff --git a/vendor/proxmox-schema/src/format.rs b/vendor/proxmox-schema/src/format.rs index 4e497ba5b..066bb4b22 100644 --- a/vendor/proxmox-schema/src/format.rs +++ b/vendor/proxmox-schema/src/format.rs @@ -213,6 +213,7 @@ pub fn get_property_description( ), Schema::Object(ref schema) => (schema.description, None, None), Schema::AllOf(ref schema) => (schema.description, None, None), + Schema::OneOf(ref schema) => (schema.description, None, None), Schema::Array(ref schema) => ( schema.description, None, @@ -318,6 +319,7 @@ pub fn get_schema_type_text(schema: &Schema, _style: ParameterDisplayStyle) -> S Schema::Object(_) => String::from(""), Schema::Array(schema) => get_schema_type_text(schema.items, _style), Schema::AllOf(_) => String::from(""), + Schema::OneOf(_) => String::from(""), } } @@ -459,6 +461,11 @@ pub fn dump_api_return_schema(returns: &ReturnType, style: ParameterDisplayStyle res.push_str(&description); res.push_str(&dump_properties(all_of_schema, "", style, &[])); } + Schema::OneOf(all_of_schema) => { + let description = wrap_text("", "", all_of_schema.description, 80); + res.push_str(&description); + res.push_str(&dump_properties(all_of_schema, "", style, &[])); + } } res.push('\n'); diff --git a/vendor/proxmox-schema/src/schema.rs b/vendor/proxmox-schema/src/schema.rs index 21b9d8a6e..2377718e1 100644 --- a/vendor/proxmox-schema/src/schema.rs +++ b/vendor/proxmox-schema/src/schema.rs @@ -4,6 +4,7 @@ //! completely static API definitions that can be included within the programs read-only text //! segment. +use std::collections::HashSet; use std::fmt; use anyhow::{bail, format_err, Error}; @@ -693,18 +694,12 @@ impl AllOfSchema { pub fn lookup(&self, key: &str) -> Option<(bool, &Schema)> { for entry in self.list { - match entry { - Schema::AllOf(s) => { - if let Some(v) = s.lookup(key) { - return Some(v); - } - } - Schema::Object(s) => { - if let Some(v) = s.lookup(key) { - return Some(v); - } - } - _ => panic!("non-object-schema in `AllOfSchema`"), + if let Some(v) = entry + .any_object() + .expect("non-object-schema in `AllOfSchema`") + .lookup(key) + { + return Some(v); } } @@ -724,6 +719,93 @@ impl AllOfSchema { } } +/// An object schema which is basically like a rust enum: exactly one variant may match. +/// +/// Contrary to JSON Schema, we require there be a 'type' property to distinguish the types. +/// In serde-language, we use an internally tagged enum representation. +/// +/// Note that these are limited to object schemas. Other schemas will produce errors. +#[derive(Debug)] +#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))] +pub struct OneOfSchema { + pub description: &'static str, + + /// The type property entry. + /// + /// This must be a static reference due to how we implemented the property iterator. + pub type_property_entry: &'static SchemaPropertyEntry, + + /// The parameter is checked against all of the schemas in the list. Note that all schemas must + /// be object schemas. + pub list: &'static [(&'static str, &'static Schema)], +} + +impl OneOfSchema { + pub const fn new( + description: &'static str, + type_property_entry: &'static SchemaPropertyEntry, + list: &'static [(&'static str, &'static Schema)], + ) -> Self { + Self { + description, + type_property_entry, + list, + } + } + + pub const fn schema(self) -> Schema { + Schema::OneOf(self) + } + + pub fn type_property(&self) -> &'static str { + self.type_property_entry.0 + } + + pub fn type_schema(&self) -> &'static Schema { + self.type_property_entry.2 + } + + pub fn lookup(&self, key: &str) -> Option<(bool, &Schema)> { + if key == self.type_property() { + return Some((false, self.type_schema())); + } + + for (_variant, entry) in self.list { + if let Some(v) = entry + .any_object() + .expect("non-object-schema in `OneOfSchema`") + .lookup(key) + { + return Some(v); + } + } + + None + } + + pub fn lookup_variant(&self, name: &str) -> Option<&Schema> { + Some( + self.list[self + .list + .binary_search_by_key(&name, |(name, _)| name) + .ok()?] + .1, + ) + } + + /// Parse key/value pairs and verify with object schema + /// + /// - `test_required`: is set, checks if all required properties are + /// present. + pub fn parse_parameter_strings( + &'static self, + data: &[(String, String)], + test_required: bool, + ) -> Result { + ParameterSchema::from(self).parse_parameter_strings(data, test_required) + } +} + /// Beside [`ObjectSchema`] we also have an [`AllOfSchema`] which also represents objects. pub trait ObjectSchemaType { fn description(&self) -> &'static str; @@ -774,6 +856,23 @@ pub trait ObjectSchemaType { } } +#[doc(hidden)] +pub enum ObjectPropertyIterator { + Simple(SimpleObjectPropertyIterator), + OneOf(OneOfPropertyIterator), +} + +impl Iterator for ObjectPropertyIterator { + type Item = &'static SchemaPropertyEntry; + + fn next(&mut self) -> Option<&'static SchemaPropertyEntry> { + match self { + Self::Simple(iter) => iter.next(), + Self::OneOf(iter) => iter.next(), + } + } +} + impl ObjectSchemaType for ObjectSchema { fn description(&self) -> &'static str { self.description @@ -784,11 +883,11 @@ impl ObjectSchemaType for ObjectSchema { } fn properties(&self) -> ObjectPropertyIterator { - ObjectPropertyIterator { + ObjectPropertyIterator::Simple(SimpleObjectPropertyIterator { schemas: [].iter(), properties: Some(self.properties.iter()), nested: None, - } + }) } fn additional_properties(&self) -> bool { @@ -810,11 +909,11 @@ impl ObjectSchemaType for AllOfSchema { } fn properties(&self) -> ObjectPropertyIterator { - ObjectPropertyIterator { + ObjectPropertyIterator::Simple(SimpleObjectPropertyIterator { schemas: self.list.iter(), properties: None, nested: None, - } + }) } fn additional_properties(&self) -> bool { @@ -823,11 +922,10 @@ impl ObjectSchemaType for AllOfSchema { fn default_key(&self) -> Option<&'static str> { for schema in self.list { - let default_key = match schema { - Schema::Object(schema) => schema.default_key(), - Schema::AllOf(schema) => schema.default_key(), - _ => panic!("non-object-schema in `AllOfSchema`"), - }; + let default_key = schema + .any_object() + .expect("non-object-schema in `AllOfSchema`") + .default_key(); if default_key.is_some() { return default_key; @@ -839,13 +937,13 @@ impl ObjectSchemaType for AllOfSchema { } #[doc(hidden)] -pub struct ObjectPropertyIterator { +pub struct SimpleObjectPropertyIterator { schemas: std::slice::Iter<'static, &'static Schema>, properties: Option>, nested: Option>, } -impl Iterator for ObjectPropertyIterator { +impl Iterator for SimpleObjectPropertyIterator { type Item = &'static SchemaPropertyEntry; fn next(&mut self) -> Option<&'static SchemaPropertyEntry> { @@ -859,6 +957,7 @@ impl Iterator for ObjectPropertyIterator { Some(item) => return Some(item), None => match self.schemas.next()? { Schema::AllOf(o) => self.nested = Some(Box::new(o.properties())), + Schema::OneOf(o) => self.nested = Some(Box::new(o.properties())), Schema::Object(o) => self.properties = Some(o.properties.iter()), _ => { self.properties = None; @@ -870,6 +969,93 @@ impl Iterator for ObjectPropertyIterator { } } +impl ObjectSchemaType for OneOfSchema { + fn description(&self) -> &'static str { + self.description + } + + fn lookup(&self, key: &str) -> Option<(bool, &Schema)> { + OneOfSchema::lookup(self, key) + } + + fn properties(&self) -> ObjectPropertyIterator { + ObjectPropertyIterator::OneOf(OneOfPropertyIterator { + type_property_entry: self.type_property_entry, + schemas: self.list.iter(), + done: HashSet::new(), + nested: None, + }) + } + + fn additional_properties(&self) -> bool { + true + } + + fn default_key(&self) -> Option<&'static str> { + None + } + + fn verify_json(&self, data: &Value) -> Result<(), Error> { + let map = match data { + Value::Object(ref map) => map, + Value::Array(_) => bail!("Expected object - got array."), + _ => bail!("Expected object - got scalar value."), + }; + + // Without the type we also cannot verify anything else...: + let variant = match map.get(self.type_property()) { + None => bail!("Missing '{}' property", self.type_property()), + Some(Value::String(v)) => v, + _ => bail!("Expected string in '{}'", self.type_property()), + }; + + let schema = self + .lookup_variant(variant) + .ok_or_else(|| format_err!("invalid '{}': {}", self.type_property(), variant))?; + + schema.verify_json(data) + } +} + +#[doc(hidden)] +pub struct OneOfPropertyIterator { + type_property_entry: &'static SchemaPropertyEntry, + schemas: std::slice::Iter<'static, (&'static str, &'static Schema)>, + done: HashSet<&'static str>, + nested: Option>, +} + +impl Iterator for OneOfPropertyIterator { + type Item = &'static SchemaPropertyEntry; + + fn next(&mut self) -> Option<&'static SchemaPropertyEntry> { + if self.done.insert(self.type_property_entry.0) { + return Some(self.type_property_entry); + } + + loop { + match self.nested.as_mut().and_then(Iterator::next) { + Some(item) => { + if !self.done.insert(item.0) { + continue; + } + return Some(item); + } + None => self.nested = None, + } + + self.nested = Some(Box::new( + self.schemas + .next()? + .1 + .any_object() + .expect("non-object-schema in `OneOfSchema`") + .properties(), + )); + } + } +} + /// Schemas are used to describe complex data types. /// /// All schema types implement constant builder methods, and a final @@ -910,6 +1096,7 @@ pub enum Schema { Object(ObjectSchema), Array(ArraySchema), AllOf(AllOfSchema), + OneOf(OneOfSchema), } impl Schema { @@ -928,6 +1115,7 @@ impl Schema { Schema::Number(s) => s.verify_json(data)?, Schema::String(s) => s.verify_json(data)?, Schema::AllOf(s) => s.verify_json(data)?, + Schema::OneOf(s) => s.verify_json(data)?, } Ok(()) } @@ -1072,6 +1260,14 @@ impl Schema { } } + /// Gets the underlying [`OneOfSchema`], panics on different schemas. + pub const fn unwrap_one_of_schema(&self) -> &OneOfSchema { + match self { + Schema::OneOf(s) => s, + _ => panic!("unwrap_one_of_schema on different schema"), + } + } + /// Gets the underlying [`BooleanSchema`]. pub const fn boolean(&self) -> Option<&BooleanSchema> { match self { @@ -1128,10 +1324,19 @@ impl Schema { } } + /// Gets the underlying [`AllOfSchema`]. + pub const fn one_of(&self) -> Option<&OneOfSchema> { + match self { + Schema::OneOf(s) => Some(s), + _ => None, + } + } + pub fn any_object(&self) -> Option<&dyn ObjectSchemaType> { match self { Schema::Object(s) => Some(s), Schema::AllOf(s) => Some(s), + Schema::OneOf(s) => Some(s), _ => None, } } @@ -1295,6 +1500,7 @@ impl PartialEq for ApiStringFormat { pub enum ParameterSchema { Object(&'static ObjectSchema), AllOf(&'static AllOfSchema), + OneOf(&'static OneOfSchema), } impl ParameterSchema { @@ -1316,6 +1522,7 @@ impl ObjectSchemaType for ParameterSchema { match self { ParameterSchema::Object(o) => o.description(), ParameterSchema::AllOf(o) => o.description(), + ParameterSchema::OneOf(o) => o.description(), } } @@ -1323,6 +1530,7 @@ impl ObjectSchemaType for ParameterSchema { match self { ParameterSchema::Object(o) => o.lookup(key), ParameterSchema::AllOf(o) => o.lookup(key), + ParameterSchema::OneOf(o) => o.lookup(key), } } @@ -1330,6 +1538,7 @@ impl ObjectSchemaType for ParameterSchema { match self { ParameterSchema::Object(o) => o.properties(), ParameterSchema::AllOf(o) => o.properties(), + ParameterSchema::OneOf(o) => o.properties(), } } @@ -1337,6 +1546,7 @@ impl ObjectSchemaType for ParameterSchema { match self { ParameterSchema::Object(o) => o.additional_properties(), ParameterSchema::AllOf(o) => o.additional_properties(), + ParameterSchema::OneOf(o) => o.additional_properties(), } } @@ -1344,6 +1554,7 @@ impl ObjectSchemaType for ParameterSchema { match self { ParameterSchema::Object(o) => o.default_key(), ParameterSchema::AllOf(o) => o.default_key(), + ParameterSchema::OneOf(o) => o.default_key(), } } } @@ -1360,6 +1571,12 @@ impl From<&'static AllOfSchema> for ParameterSchema { } } +impl From<&'static OneOfSchema> for ParameterSchema { + fn from(schema: &'static OneOfSchema) -> Self { + ParameterSchema::OneOf(schema) + } +} + /// Helper function to parse boolean values /// /// - true: `1 | on | yes | true` diff --git a/vendor/proxmox-section-config/.cargo-checksum.json b/vendor/proxmox-section-config/.cargo-checksum.json index f77010b7c..c67d2fbeb 100644 --- a/vendor/proxmox-section-config/.cargo-checksum.json +++ b/vendor/proxmox-section-config/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2bdb185efd3c49fb77c3915f3011ad499c008a6d672172528849f35cdf590bfb","src/lib.rs":"4abfe7c63d0087bf714fa0744ef1a78ee1dd8025bc3dfdb3e532143253521dbd"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"dc1bda8cf85a0882318d124be9f274269e19493cd2d38ec13a82b1427ae382fa","src/lib.rs":"4abfe7c63d0087bf714fa0744ef1a78ee1dd8025bc3dfdb3e532143253521dbd"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-section-config/Cargo.toml b/vendor/proxmox-section-config/Cargo.toml index ad81359b0..b2fd6ceae 100644 --- a/vendor/proxmox-section-config/Cargo.toml +++ b/vendor/proxmox-section-config/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-section-config" -version = "2.0.0" +version = "2.0.1" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "proxmox schema based section config format parsing" @@ -30,5 +30,5 @@ version = "1.1" path = "../proxmox-lang" [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" diff --git a/vendor/proxmox-serde/.cargo-checksum.json b/vendor/proxmox-serde/.cargo-checksum.json index fc9a1c450..80da2c27e 100644 --- a/vendor/proxmox-serde/.cargo-checksum.json +++ b/vendor/proxmox-serde/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"c13145a418804cdb14cc8a79a814461133294b7c399d1c1228f9ede4a3daed14","src/json.rs":"e84b666663ac1f25c92cd0e3fcd75d9980384faf6b901417bcb09489691da05a","src/lib.rs":"8c4857fcd24e49c4025ea27ba0271b08cca871e7cc194b0184aa47c239e2c6b5","src/serde_macros.rs":"7c04ee501a3908be40c9b0f3c8ea964d65e112aee34e784a8e21da08ce881167"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"b5f22eaed29afdbf8f4d754ccabfcbe8a4b734b2718f1129240a750aae62c5b5","src/json.rs":"e84b666663ac1f25c92cd0e3fcd75d9980384faf6b901417bcb09489691da05a","src/lib.rs":"8c4857fcd24e49c4025ea27ba0271b08cca871e7cc194b0184aa47c239e2c6b5","src/serde_macros.rs":"7c04ee501a3908be40c9b0f3c8ea964d65e112aee34e784a8e21da08ce881167"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-serde/Cargo.toml b/vendor/proxmox-serde/Cargo.toml index 5a76e7348..40d90d5d4 100644 --- a/vendor/proxmox-serde/Cargo.toml +++ b/vendor/proxmox-serde/Cargo.toml @@ -24,7 +24,7 @@ anyhow = "1.0" base64 = "0.13" [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [dependencies.serde] diff --git a/vendor/proxmox-subscription/.cargo-checksum.json b/vendor/proxmox-subscription/.cargo-checksum.json index 0539be4f6..e1508aa40 100644 --- a/vendor/proxmox-subscription/.cargo-checksum.json +++ b/vendor/proxmox-subscription/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b713b5de7dbc835cf13d225dcf7ca63c16fdb6bb1a74a2bd9136ad11c1019a43","src/check.rs":"6ad7ab47182fb56db2c5781ee015a02d8e5963dd19e198fe3d84da1a4f44c6b8","src/files.rs":"8846cc27b9c8f991b2984119daa3925c56312cd6575376bffd8954121709f1db","src/lib.rs":"29f777c8b2bde286bd61d3a86c18463c97e31a9729767d3556355e80e9778377","src/sign.rs":"338f9f57ba4200ad73a3de441523b37298243474d4a6c19899a2bac4b9c788b1","src/subscription_info.rs":"a48a3c42a2a5b4ad03656a0c3fb53ff60cbd2c53816c6ac3483ee6391e99189c"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"4f4ac290c21718bb75e89e865ea666902741d1dbd04b08cbd5b9a447aae09577","src/check.rs":"6ad7ab47182fb56db2c5781ee015a02d8e5963dd19e198fe3d84da1a4f44c6b8","src/files.rs":"8846cc27b9c8f991b2984119daa3925c56312cd6575376bffd8954121709f1db","src/lib.rs":"29f777c8b2bde286bd61d3a86c18463c97e31a9729767d3556355e80e9778377","src/sign.rs":"338f9f57ba4200ad73a3de441523b37298243474d4a6c19899a2bac4b9c788b1","src/subscription_info.rs":"a48a3c42a2a5b4ad03656a0c3fb53ff60cbd2c53816c6ac3483ee6391e99189c"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-subscription/Cargo.toml b/vendor/proxmox-subscription/Cargo.toml index 5c006aebb..70b618f0b 100644 --- a/vendor/proxmox-subscription/Cargo.toml +++ b/vendor/proxmox-subscription/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-subscription" -version = "0.4.2" +version = "0.4.3" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "Proxmox subscription utilitites" @@ -38,7 +38,7 @@ features = [ ] [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = ["api-macro"] optional = true @@ -53,7 +53,7 @@ version = "0.5.1" path = "../proxmox-sys" [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [features] diff --git a/vendor/proxmox-sys/.cargo-checksum.json b/vendor/proxmox-sys/.cargo-checksum.json index b13f74eb7..fcaac7ec2 100644 --- a/vendor/proxmox-sys/.cargo-checksum.json +++ b/vendor/proxmox-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ba391d2f91803c6c2e38e316f28e95618e0429e59f99d55eed134f7a67565e2f","src/boot_mode.rs":"c8cb771c20f8e81ebd50c2719c55aad9afa25038a0c57a9a3733ef540b9b341d","src/command.rs":"c6582d05cf9f15693036c980f76ab2fa76d9faba35ca362219c79de16e8eb681","src/crypt.rs":"b6cb2d63609358b86bde9ba6052b10ca77817da07a44797a9fbdd499088e6acb","src/email.rs":"b13086588d369b1873e07bf5ed62a36f879bf3e71d34f0d8bfa7c731d3d48d6a","src/error.rs":"bd620b3113ebcde0fb86335ab009bfa574635b0a2ce72d25661f12d427e748ae","src/fd/borrowed_fd.rs":"b8a5a27cb046b05ce3e70c2895ed4da235644082c98b589e64496c96213c635e","src/fd/fd_impl.rs":"8b7de4098617a8617f98bf06ab96cd094d707bb8e16face34d343262410c9ee9","src/fd/mod.rs":"052b8c6901e115e8174d9e32acf93f0a76903634ddeef49cf81bd8b6ca3ffb8a","src/fd/raw_fd_num.rs":"0f7642bd320712d6fe187a3d462eb0ddaa19c495cdb704d8fab8ff73922d089b","src/fs/acl.rs":"c190976ecd881f7929df2a1c27b7b789120c27592f27dfcbe2b062cb2c841277","src/fs/dir.rs":"1e50effd2bf2ed609b78dde393fa7cc3a1324bb5285f468683c9e0560ca32eb4","src/fs/file.rs":"69af2c0240c5fe869367cf72f50a7ac3817b527245edf84bc305fd2712813f15","src/fs/fsx_attr.rs":"a21d30282aec66c075c4eaa8038ed845b2cbaae5ce52c14531207e03cfb0d13b","src/fs/mod.rs":"5626dc324f836939621285e38988cc2d42379de6444c3d68e851ed6f4c4986db","src/fs/read_dir.rs":"91e6499893b19539945c6d5a62a9fb152f72a34b14f244f8e0b4909dd7618269","src/fs/xattr.rs":"17d798312eccb1fa68968da9aa4872a01bb0b82fbe407b0aa1140a4643422b29","src/lib.rs":"eaef33451c04de487530d3144ad44c21bdb7d7421239111342d128ec5a9e2919","src/linux/magic.rs":"1316000dc334c2eb29419548517bee455ff3f736c139bc6eaa5c48bbd5e22124","src/linux/mod.rs":"6e8a190e1c0b5c46a40edbb4aa8ad437070ef4dfe6b052f42982965c9cdea259","src/linux/pid.rs":"5d820d1cde8e7002186de4eeec61d9e85ba30d92f0a4b2961135eb6f108c8a77","src/linux/procfs/mod.rs":"31b803741c53548e9881cd3ae12653f918d8bd5e8c86204dc29142c0b9674782","src/linux/procfs/mountinfo.rs":"6b00d34338aa659e07fecb8bb682951c1918d16976d9bbd4d06494a8407b0427","src/linux/socket.rs":"ab704b7f3d3177ef963cb57939cc436af0ddd42ab91ed2365a4fc84182118f2b","src/linux/timer.rs":"7cbff1509bd13edbae53ed2aa20d869a7400dab8df3d2287e9b57391b45442ae","src/linux/tty.rs":"f57f500d91c81f1a873ca0bd3a2b3876735ef14bff61774fee6cd16f90a90dfa","src/logrotate.rs":"611866c2ab4f6a2c40f565be7e606b5fa407255c53ab54123a256fbefc278cd3","src/macros.rs":"4462ff84a473bfea445a71f22484038e27a8733969d6cb0d8a232538f12dce43","src/mmap.rs":"cb8faead471127ded5fca1e34b2a22638e762a1053b9ad2a2612f8a788e0b4ff","src/process_locker.rs":"13dda81f15f603b8e3d77cb46cf0a48ae139d93029fc2695c7cf18164c94ad87","src/systemd.rs":"0a86bd9ccdbc27a355bfc3f301165c2fccdad554d1a4facacddcadcd7b036d05","src/worker_task_context.rs":"dad2d86f18aed18de2040b80dfcedc7e9eccb08efe5c700b83360fac3060a0c2","tests/xattr.rs":"ee1c1a75a97c69f5971132ffe71dbff304ebc93ab3027b30f268a4f1ba41f610"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"e7b820d23024f082890368c9e8618c428226f0f3bc32d02e6ba5c1247ace454e","src/boot_mode.rs":"c8cb771c20f8e81ebd50c2719c55aad9afa25038a0c57a9a3733ef540b9b341d","src/command.rs":"c6582d05cf9f15693036c980f76ab2fa76d9faba35ca362219c79de16e8eb681","src/crypt.rs":"b6cb2d63609358b86bde9ba6052b10ca77817da07a44797a9fbdd499088e6acb","src/email.rs":"a04bcedfe468502b0326f9a004867c1e15be1d9ffcc8835f0ea650dce1928d23","src/error.rs":"bd620b3113ebcde0fb86335ab009bfa574635b0a2ce72d25661f12d427e748ae","src/fd/borrowed_fd.rs":"b8a5a27cb046b05ce3e70c2895ed4da235644082c98b589e64496c96213c635e","src/fd/fd_impl.rs":"8b7de4098617a8617f98bf06ab96cd094d707bb8e16face34d343262410c9ee9","src/fd/mod.rs":"052b8c6901e115e8174d9e32acf93f0a76903634ddeef49cf81bd8b6ca3ffb8a","src/fd/raw_fd_num.rs":"0f7642bd320712d6fe187a3d462eb0ddaa19c495cdb704d8fab8ff73922d089b","src/fs/acl.rs":"c190976ecd881f7929df2a1c27b7b789120c27592f27dfcbe2b062cb2c841277","src/fs/dir.rs":"1e50effd2bf2ed609b78dde393fa7cc3a1324bb5285f468683c9e0560ca32eb4","src/fs/file.rs":"69af2c0240c5fe869367cf72f50a7ac3817b527245edf84bc305fd2712813f15","src/fs/fsx_attr.rs":"a21d30282aec66c075c4eaa8038ed845b2cbaae5ce52c14531207e03cfb0d13b","src/fs/mod.rs":"5626dc324f836939621285e38988cc2d42379de6444c3d68e851ed6f4c4986db","src/fs/read_dir.rs":"91e6499893b19539945c6d5a62a9fb152f72a34b14f244f8e0b4909dd7618269","src/fs/xattr.rs":"17d798312eccb1fa68968da9aa4872a01bb0b82fbe407b0aa1140a4643422b29","src/lib.rs":"eaef33451c04de487530d3144ad44c21bdb7d7421239111342d128ec5a9e2919","src/linux/magic.rs":"1316000dc334c2eb29419548517bee455ff3f736c139bc6eaa5c48bbd5e22124","src/linux/mod.rs":"6e8a190e1c0b5c46a40edbb4aa8ad437070ef4dfe6b052f42982965c9cdea259","src/linux/pid.rs":"5d820d1cde8e7002186de4eeec61d9e85ba30d92f0a4b2961135eb6f108c8a77","src/linux/procfs/mod.rs":"31b803741c53548e9881cd3ae12653f918d8bd5e8c86204dc29142c0b9674782","src/linux/procfs/mountinfo.rs":"6b00d34338aa659e07fecb8bb682951c1918d16976d9bbd4d06494a8407b0427","src/linux/socket.rs":"ab704b7f3d3177ef963cb57939cc436af0ddd42ab91ed2365a4fc84182118f2b","src/linux/timer.rs":"7cbff1509bd13edbae53ed2aa20d869a7400dab8df3d2287e9b57391b45442ae","src/linux/tty.rs":"f57f500d91c81f1a873ca0bd3a2b3876735ef14bff61774fee6cd16f90a90dfa","src/logrotate.rs":"611866c2ab4f6a2c40f565be7e606b5fa407255c53ab54123a256fbefc278cd3","src/macros.rs":"4462ff84a473bfea445a71f22484038e27a8733969d6cb0d8a232538f12dce43","src/mmap.rs":"cb8faead471127ded5fca1e34b2a22638e762a1053b9ad2a2612f8a788e0b4ff","src/process_locker.rs":"13dda81f15f603b8e3d77cb46cf0a48ae139d93029fc2695c7cf18164c94ad87","src/systemd.rs":"0a86bd9ccdbc27a355bfc3f301165c2fccdad554d1a4facacddcadcd7b036d05","src/worker_task_context.rs":"dad2d86f18aed18de2040b80dfcedc7e9eccb08efe5c700b83360fac3060a0c2","tests/xattr.rs":"ee1c1a75a97c69f5971132ffe71dbff304ebc93ab3027b30f268a4f1ba41f610"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-sys/Cargo.toml b/vendor/proxmox-sys/Cargo.toml index 4d63cd03d..2fc9f3dd8 100644 --- a/vendor/proxmox-sys/Cargo.toml +++ b/vendor/proxmox-sys/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-sys" -version = "0.5.2" +version = "0.5.3" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "System tools (using nix)." @@ -38,7 +38,7 @@ version = "1.1" path = "../proxmox-lang" [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" [dependencies.serde] diff --git a/vendor/proxmox-sys/src/email.rs b/vendor/proxmox-sys/src/email.rs index be92f30e2..85d171d72 100644 --- a/vendor/proxmox-sys/src/email.rs +++ b/vendor/proxmox-sys/src/email.rs @@ -63,8 +63,7 @@ pub fn sendmail( } let _ = writeln!(body, "From: {} <{}>", author, mailfrom); let _ = writeln!(body, "To: {}", &recipients); - let localtime = proxmox_time::localtime(now)?; - let rfc2822_date = proxmox_time::strftime("%a, %d %b %Y %T %z", &localtime)?; + let rfc2822_date = proxmox_time::epoch_to_rfc2822(now)?; let _ = writeln!(body, "Date: {}", rfc2822_date); body.push_str("Auto-Submitted: auto-generated;\n"); diff --git a/vendor/proxmox-tfa/.cargo-checksum.json b/vendor/proxmox-tfa/.cargo-checksum.json index 5e7d53ebe..6c2b29d01 100644 --- a/vendor/proxmox-tfa/.cargo-checksum.json +++ b/vendor/proxmox-tfa/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"7c1ee2e4f4da227d459c60e4d56d5e99eb5ceeb87b7ccf9bc44c4e1caaa9b1af","src/api/methods.rs":"c8189cb7f802fac3e03db36ed8220e08282767c414bcc5bdb93d8fb181a16949","src/api/mod.rs":"316c64a7a4be10cd278e0330b431b9f49c540f83b2e3c7caeac4e6df0309e25e","src/api/recovery.rs":"f4564ef879c29b11eeefbb9c4d853632f3f7c3702cd94fa672fc456eef9c4123","src/api/serde_tools.rs":"e7f7f10899a023997e368ab816c9f109412d86bebe0de75415e94db3660f3b57","src/api/u2f.rs":"a15d506ab39ee5b301977f40f624c2eccb497b07de40f7d306024dd6e5af9409","src/api/webauthn.rs":"2d4719e58e4b5c52191378eff625069a350d16300073a6e16f1e57387549e70a","src/lib.rs":"309a4b220d886f1c7537af85886a327c391082a209c76a6d06f7d2840306ff30","src/totp.rs":"a5aa13921a475d01a356930d19e0c1795f7c024b25f11066b1a68bd324661563","src/types.rs":"729fb925e4198f3cfb3e71e53ef00eab41900d7b49d9b72afce9374adbe98b69","src/u2f.rs":"66e121f4028367d3d0be0f228e4e47edf89c28d3297fdded8219a289c05f8c0e"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"a762dc1828721f9ce34f4884007e6eafed500b1a182579b0514d50c133a06894","src/api/methods.rs":"0f67996c3e92741e6d8da2ba5acaaaf3418cf5e541770cd81021bf49482fa1c4","src/api/mod.rs":"316c64a7a4be10cd278e0330b431b9f49c540f83b2e3c7caeac4e6df0309e25e","src/api/recovery.rs":"f4564ef879c29b11eeefbb9c4d853632f3f7c3702cd94fa672fc456eef9c4123","src/api/serde_tools.rs":"e7f7f10899a023997e368ab816c9f109412d86bebe0de75415e94db3660f3b57","src/api/u2f.rs":"a15d506ab39ee5b301977f40f624c2eccb497b07de40f7d306024dd6e5af9409","src/api/webauthn.rs":"2d4719e58e4b5c52191378eff625069a350d16300073a6e16f1e57387549e70a","src/lib.rs":"309a4b220d886f1c7537af85886a327c391082a209c76a6d06f7d2840306ff30","src/totp.rs":"a5aa13921a475d01a356930d19e0c1795f7c024b25f11066b1a68bd324661563","src/types.rs":"729fb925e4198f3cfb3e71e53ef00eab41900d7b49d9b72afce9374adbe98b69","src/u2f.rs":"66e121f4028367d3d0be0f228e4e47edf89c28d3297fdded8219a289c05f8c0e"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-tfa/Cargo.toml b/vendor/proxmox-tfa/Cargo.toml index 8c63efbf9..86249e282 100644 --- a/vendor/proxmox-tfa/Cargo.toml +++ b/vendor/proxmox-tfa/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-tfa" -version = "4.1.0" +version = "4.1.2" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "tfa implementation for totp and u2f" @@ -55,13 +55,13 @@ version = "2.1" optional = true [dependencies.proxmox-schema] -version = "2.0.0" +version = "3.0.0" path = "../proxmox-schema" features = ["api-macro"] optional = true [dependencies.proxmox-time] -version = "1.1.4" +version = "1.1.6" path = "../proxmox-time" optional = true diff --git a/vendor/proxmox-tfa/src/api/methods.rs b/vendor/proxmox-tfa/src/api/methods.rs index 86781908e..17715b877 100644 --- a/vendor/proxmox-tfa/src/api/methods.rs +++ b/vendor/proxmox-tfa/src/api/methods.rs @@ -235,7 +235,7 @@ pub struct TfaUser { pub entries: Vec, /// The user is locked out of TOTP authentication. - #[serde(skip_serializing_if = "super::bool_is_false")] + #[serde(default, skip_serializing_if = "super::bool_is_false")] pub totp_locked: bool, /// If a user's second factor is blocked, this contains the block's expiration time. diff --git a/vendor/proxmox-time/.cargo-checksum.json b/vendor/proxmox-time/.cargo-checksum.json index ce381326b..7240be553 100644 --- a/vendor/proxmox-time/.cargo-checksum.json +++ b/vendor/proxmox-time/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"cb5e760df36e0894ebb0ec1c9d198815aa2bd5788249f999b5de7ccec048aebb","src/calendar_event.rs":"36ae345956cdb28f6335f1a99a8e387dc699281d8b89b517f0fdf288019c7ce0","src/daily_duration.rs":"d4f73d10f280a31bb9ec9a0b6026e128bfc11ac396d10301b3faa7f24404060d","src/date_time_value.rs":"5491874bb8202fa1a176a02595eca16c194cacd4cc65cc527788f10cf8ec7cb0","src/lib.rs":"7655443d4a5240b28b4d2cc8b08d5e9449618f0fcb8310602992cb982709c174","src/parse_helpers.rs":"4102daf2b87e4c2f62d558a7859bbc76f510dad328fd46f3a4ad916c3f7dd8b6","src/posix.rs":"28aa79205bdcb776a18ec46c3b8fdca9bae56a3acef8942d2fca23821dc0cdee","src/test.rs":"8d07294a8ae82c52626f62c7178340f1590403972172b66bee2c096af77f731d","src/time_span.rs":"aa9564c643098a5bbea9bddd01fedb20ef320389743f2738b82a5455a21318b0","src/tm_editor.rs":"aae0dcfcf42d9042133543d0d18f11a5d8b91ad16aae77dbb1d4cb4b7e7ac870","src/wasm.rs":"64dd1b4c156e85d17a365dc2e95b0ea08bf24f628f05aebdeaff574af5226035","src/week_days.rs":"93ecddd78efa57bad16e1514ee51d72856b939abfd8dddc0dba5cbc466a8e5e8"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"fcc1e43cdbd9c4337eaab3d33e36f3254ca6361528440be824651d1eef757334","src/calendar_event.rs":"36ae345956cdb28f6335f1a99a8e387dc699281d8b89b517f0fdf288019c7ce0","src/daily_duration.rs":"d4f73d10f280a31bb9ec9a0b6026e128bfc11ac396d10301b3faa7f24404060d","src/date_time_value.rs":"5491874bb8202fa1a176a02595eca16c194cacd4cc65cc527788f10cf8ec7cb0","src/lib.rs":"7655443d4a5240b28b4d2cc8b08d5e9449618f0fcb8310602992cb982709c174","src/parse_helpers.rs":"4102daf2b87e4c2f62d558a7859bbc76f510dad328fd46f3a4ad916c3f7dd8b6","src/posix.rs":"cba337b1dddbc6f93d52c8d33ccd217e429dcc46a9903b06ab661651f75c6cb7","src/test.rs":"8d07294a8ae82c52626f62c7178340f1590403972172b66bee2c096af77f731d","src/time_span.rs":"aa9564c643098a5bbea9bddd01fedb20ef320389743f2738b82a5455a21318b0","src/tm_editor.rs":"aae0dcfcf42d9042133543d0d18f11a5d8b91ad16aae77dbb1d4cb4b7e7ac870","src/wasm.rs":"64dd1b4c156e85d17a365dc2e95b0ea08bf24f628f05aebdeaff574af5226035","src/week_days.rs":"93ecddd78efa57bad16e1514ee51d72856b939abfd8dddc0dba5cbc466a8e5e8"},"package":null} \ No newline at end of file diff --git a/vendor/proxmox-time/Cargo.toml b/vendor/proxmox-time/Cargo.toml index 6e19f9370..ff3776583 100644 --- a/vendor/proxmox-time/Cargo.toml +++ b/vendor/proxmox-time/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "proxmox-time" -version = "1.1.5" +version = "1.1.6" authors = ["Proxmox Support Team "] exclude = ["debian"] description = "time utilities and TmEditor" diff --git a/vendor/proxmox-time/src/posix.rs b/vendor/proxmox-time/src/posix.rs index 6157f8bcc..73a5368b0 100644 --- a/vendor/proxmox-time/src/posix.rs +++ b/vendor/proxmox-time/src/posix.rs @@ -13,7 +13,7 @@ pub fn timelocal(t: &mut libc::tm) -> Result { let epoch = unsafe { libc::mktime(t) }; if epoch == -1 { - bail!("libc::mktime failed for {:?}", t); + bail!("libc::mktime failed for {t:?}"); } Ok(epoch) } @@ -27,7 +27,7 @@ pub fn timegm(t: &mut libc::tm) -> Result { let epoch = unsafe { libc::timegm(t) }; if epoch == -1 { - bail!("libc::timegm failed for {:?}", t); + bail!("libc::timegm failed for {t:?}"); } Ok(epoch) } @@ -54,7 +54,7 @@ pub fn localtime(epoch: i64) -> Result { unsafe { if libc::localtime_r(&epoch, &mut result).is_null() { - bail!("libc::localtime failed for '{}'", epoch); + bail!("libc::localtime failed for '{epoch}'"); } } @@ -67,7 +67,7 @@ pub fn gmtime(epoch: i64) -> Result { unsafe { if libc::gmtime_r(&epoch, &mut result).is_null() { - bail!("libc::gmtime failed for '{}'", epoch); + bail!("libc::gmtime failed for '{epoch}'"); } } @@ -108,25 +108,13 @@ pub fn epoch_f64() -> f64 { } } -// rust libc bindings do not include strftime -#[link(name = "c")] -extern "C" { - #[link_name = "strftime"] - fn libc_strftime( - s: *mut libc::c_char, - max: libc::size_t, - format: *const libc::c_char, - time: *const libc::tm, - ) -> libc::size_t; -} - /// Safe bindings to libc strftime pub fn strftime(format: &str, t: &libc::tm) -> Result { - let format = CString::new(format).map_err(|err| format_err!("{}", err))?; + let format = CString::new(format).map_err(|err| format_err!("{err}"))?; let mut buf = vec![0u8; 8192]; let res = unsafe { - libc_strftime( + libc::strftime( buf.as_mut_ptr() as *mut libc::c_char, buf.len() as libc::size_t, format.as_ptr(), @@ -147,11 +135,98 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result { bail!("strftime: result len is 0 (string too large)"); }; - let c_str = CStr::from_bytes_with_nul(&buf[..len + 1]).map_err(|err| format_err!("{}", err))?; + let c_str = CStr::from_bytes_with_nul(&buf[..len + 1]).map_err(|err| format_err!("{err}"))?; let str_slice: &str = c_str.to_str().unwrap(); Ok(str_slice.to_owned()) } +// The `libc` crate does not yet contain bindings for `strftime_l` +#[link(name = "c")] +extern "C" { + #[link_name = "strftime_l"] + fn libc_strftime_l( + s: *mut libc::c_char, + max: libc::size_t, + format: *const libc::c_char, + time: *const libc::tm, + locale: libc::locale_t, + ) -> libc::size_t; +} + +/// Safe bindings to libc's `strftime_l` +/// +/// The compared to `strftime`, `strftime_l` allows the caller to provide a +/// locale object. +pub fn strftime_l(format: &str, t: &libc::tm, locale: &Locale) -> Result { + let format = CString::new(format).map_err(|err| format_err!("{err}"))?; + let mut buf = vec![0u8; 8192]; + + let res = unsafe { + libc_strftime_l( + buf.as_mut_ptr() as *mut libc::c_char, + buf.len() as libc::size_t, + format.as_ptr(), + t as *const libc::tm, + locale.locale, + ) + }; + if res == !0 { + // -1,, it's unsigned + // man strftime: POSIX.1-2001 does not specify any errno settings for strftime() + bail!("strftime failed"); + } + + // `res` is a `libc::size_t`, which on a different target architecture might not be directly + // assignable to a `usize`. Thus, we actually want a cast here. + #[allow(clippy::unnecessary_cast)] + let len = res as usize; + + if len == 0 { + bail!("strftime: result len is 0 (string too large)"); + }; + + let c_str = CStr::from_bytes_with_nul(&buf[..len + 1]).map_err(|err| format_err!("{err}"))?; + let str_slice: &str = c_str.to_str()?; + Ok(str_slice.to_owned()) +} + +/// A safe wrapper for `libc::locale_t`. +/// +/// The enclosed locale object will be automatically freed by `Drop::drop` +pub struct Locale { + locale: libc::locale_t, +} + +impl Locale { + /// Portable, minimal locale environment + const C: &'static str = "C"; + + /// Create a new locale object. + /// `category_mask` is expected to be a bitmask based on the + /// LC_*_MASK constants from libc. The locale will be set to `locale` + /// for every entry in the bitmask which is set. + pub fn new(category_mask: i32, locale: &str) -> Result { + let format = CString::new(locale).map_err(|err| format_err!("{err}"))?; + + let locale = + unsafe { libc::newlocale(category_mask, format.as_ptr(), std::ptr::null_mut()) }; + + if locale.is_null() { + return Err(std::io::Error::last_os_error().into()); + } + + Ok(Self { locale }) + } +} + +impl Drop for Locale { + fn drop(&mut self) { + unsafe { + libc::freelocale(self.locale); + } + } +} + /// Format epoch as local time pub fn strftime_local(format: &str, epoch: i64) -> Result { let localtime = localtime(epoch)?; @@ -170,7 +245,7 @@ pub fn epoch_to_rfc3339_utc(epoch: i64) -> Result { let year = gmtime.tm_year + 1900; if year < 0 || year > 9999 { - bail!("epoch_to_rfc3339_utc: wrong year '{}'", year); + bail!("epoch_to_rfc3339_utc: wrong year '{year}'"); } strftime("%010FT%TZ", &gmtime) @@ -184,7 +259,7 @@ pub fn epoch_to_rfc3339(epoch: i64) -> Result { let year = localtime.tm_year + 1900; if year < 0 || year > 9999 { - bail!("epoch_to_rfc3339: wrong year '{}'", year); + bail!("epoch_to_rfc3339: wrong year '{year}'"); } // Note: We cannot use strftime %z because of missing collon @@ -204,20 +279,15 @@ pub fn epoch_to_rfc3339(epoch: i64) -> Result { let mut s = strftime("%10FT%T", &localtime)?; s.push(prefix); - let _ = write!(s, "{:02}:{:02}", hours, mins); + let _ = write!(s, "{hours:02}:{mins:02}"); Ok(s) } /// Parse RFC3339 into Unix epoch pub fn parse_rfc3339(input_str: &str) -> Result { - parse_rfc3339_do(input_str).map_err(|err| { - format_err!( - "failed to parse rfc3339 timestamp ({:?}) - {}", - input_str, - err - ) - }) + parse_rfc3339_do(input_str) + .map_err(|err| format_err!("failed to parse rfc3339 timestamp ({input_str:?}) - {err}",)) } fn parse_rfc3339_do(input_str: &str) -> Result { @@ -225,7 +295,7 @@ fn parse_rfc3339_do(input_str: &str) -> Result { let expect = |pos: usize, c: u8| { if input[pos] != c { - bail!("unexpected char at pos {}", pos); + bail!("unexpected char at pos {pos}"); } Ok(()) }; @@ -233,14 +303,14 @@ fn parse_rfc3339_do(input_str: &str) -> Result { let digit = |pos: usize| -> Result { let digit = input[pos] as i32; if digit < 48 || digit > 57 { - bail!("unexpected char at pos {}", pos); + bail!("unexpected char at pos {pos}"); } Ok(digit - 48) }; fn check_max(i: i32, max: i32) -> Result { if i > max { - bail!("value too large ({} > {})", i, max); + bail!("value too large ({i} > {max})"); } Ok(i) } @@ -301,6 +371,15 @@ fn parse_rfc3339_do(input_str: &str) -> Result { Ok(epoch) } +/// Convert Unix epoch into RFC2822 local time with TZ +pub fn epoch_to_rfc2822(epoch: i64) -> Result { + let localtime = localtime(epoch)?; + let locale = Locale::new(libc::LC_ALL, Locale::C)?; + let rfc2822_date = strftime_l("%a, %d %b %Y %T %z", &localtime, &locale)?; + + Ok(rfc2822_date) +} + #[test] fn test_leap_seconds() { let convert_reconvert = |epoch| { @@ -408,3 +487,23 @@ fn test_timezones() { let res = epoch_to_rfc3339_utc(parsed).expect("converting to RFC failed"); assert_eq!(expected_utc, res); } + +#[test] +fn test_strftime_l() { + let epoch = 1609263000; + + let locale = Locale::new(libc::LC_ALL, Locale::C).expect("could not create locale"); + let time = gmtime(epoch).expect("gmtime failed"); + + let formatted = strftime_l("%a, %d %b %Y %T %z", &time, &locale).expect("strftime_l failed"); + + assert_eq!(formatted, "Tue, 29 Dec 2020 17:30:00 +0000"); +} + +#[test] +fn test_epoch_to_rfc2822() { + let epoch = 1609263000; + // Output is TZ-dependent, so only verify that it did not fail. + // Internally, it uses strftime_l which we test already. + assert!(epoch_to_rfc2822(epoch).is_ok()); +} diff --git a/vendor/quote/.cargo-checksum.json b/vendor/quote/.cargo-checksum.json index 499572729..0d900a272 100644 --- a/vendor/quote/.cargo-checksum.json +++ b/vendor/quote/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"1eab00879906063b283945ad8ffd68f41fb2d99b54773fadd9154c86b98b827f","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"626e7079eab0baacf0fcaf3e244f407b2014ebaeca45905d72e8fb8bed18aaea","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/ext.rs":"9881576cac3e476a4bf04f9b601cf9a53b79399fb0ca9634e8b861ac91709843","src/format.rs":"c595015418f35e6992e710441b9999f09b2afe4678b138039d670d100c0bdd86","src/ident_fragment.rs":"0b3e6c2129e55910fd2d240e1e7efba6f1796801d24352d1c0bfbceb0e8b678f","src/lib.rs":"2a4bafc9784df4bac935139d72795e0eeb25e05bbf2bc98c134aedbd3f3a2377","src/runtime.rs":"7f37326edaeac2c42ed806b447eeba12e36dd4b1bc25fbf52f8eb23140f3be7a","src/spanned.rs":"3ccf5120593f35787442c0a37d243e802c5262e7f8b35aed503873008ec035c5","src/to_tokens.rs":"1c76311fcc82098e630056d71fd6f3929194ee31b0840e2aa643ed7e78026e3e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test.rs":"3be80741f84a707376c230d9cf70ce9537caa359691d8d4c34968e28175e4ad7","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"90a4bdb9267535f5d2785940148338d6b7d905548051d2c9c5dcbd58f2c11d8e","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"ae7c2739554c862b331705e82781aa4687a4375210cef6ae899a4be4a4ec2d97","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"03fd560979ebcd5aa6f83858bc2c3c01ba6546c16335101275505304895c1ae9","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"d6da483c29e232ced72059bbdf05d31afb1df9e02954edaa9cfaea1ec6df72dc","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"459bdadbf1e73b9401cf7d5d578dc053774bb4e5aa25ad2abf25d6b0f61aa306","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"594249d59d16f039c16816f1aaf9933176994e296fcf81d1b8b24d5b66ae0d0a","tests/ui/wrong-type-span.rs":"6195e35ea844c0c52ba1cff5d790c3a371af6915d137d377834ad984229ef9ea","tests/ui/wrong-type-span.stderr":"cad072e40e0ecc04f375122ae41aede2f0da2a9244492b3fcf70249e59d1b128"},"package":"5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"} \ No newline at end of file +{"files":{"Cargo.toml":"0ec1e0fd36354750321a12d04a5e4d9a8d5dc6a8af753183de50da55fc10391b","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"626e7079eab0baacf0fcaf3e244f407b2014ebaeca45905d72e8fb8bed18aaea","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/ext.rs":"9881576cac3e476a4bf04f9b601cf9a53b79399fb0ca9634e8b861ac91709843","src/format.rs":"c595015418f35e6992e710441b9999f09b2afe4678b138039d670d100c0bdd86","src/ident_fragment.rs":"0b3e6c2129e55910fd2d240e1e7efba6f1796801d24352d1c0bfbceb0e8b678f","src/lib.rs":"cef1b4c031d401fb87e88a2ed51858c5f8f471e62a6261c1ef0f55ef9e1906a1","src/runtime.rs":"7f37326edaeac2c42ed806b447eeba12e36dd4b1bc25fbf52f8eb23140f3be7a","src/spanned.rs":"3ccf5120593f35787442c0a37d243e802c5262e7f8b35aed503873008ec035c5","src/to_tokens.rs":"1c76311fcc82098e630056d71fd6f3929194ee31b0840e2aa643ed7e78026e3e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test.rs":"3be80741f84a707376c230d9cf70ce9537caa359691d8d4c34968e28175e4ad7","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"90a4bdb9267535f5d2785940148338d6b7d905548051d2c9c5dcbd58f2c11d8e","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"ae7c2739554c862b331705e82781aa4687a4375210cef6ae899a4be4a4ec2d97","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"03fd560979ebcd5aa6f83858bc2c3c01ba6546c16335101275505304895c1ae9","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"d6da483c29e232ced72059bbdf05d31afb1df9e02954edaa9cfaea1ec6df72dc","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"459bdadbf1e73b9401cf7d5d578dc053774bb4e5aa25ad2abf25d6b0f61aa306","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"594249d59d16f039c16816f1aaf9933176994e296fcf81d1b8b24d5b66ae0d0a","tests/ui/wrong-type-span.rs":"6195e35ea844c0c52ba1cff5d790c3a371af6915d137d377834ad984229ef9ea","tests/ui/wrong-type-span.stderr":"cad072e40e0ecc04f375122ae41aede2f0da2a9244492b3fcf70249e59d1b128"},"package":"291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"} \ No newline at end of file diff --git a/vendor/quote/Cargo.toml b/vendor/quote/Cargo.toml index 4dbf7abee..f3222c25d 100644 --- a/vendor/quote/Cargo.toml +++ b/vendor/quote/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.56" name = "quote" -version = "1.0.33" +version = "1.0.35" authors = ["David Tolnay "] autobenches = false description = "Quasi-quoting macro quote!(...)" @@ -35,7 +35,7 @@ targets = ["x86_64-unknown-linux-gnu"] doc-scrape-examples = false [dependencies.proc-macro2] -version = "1.0.66" +version = "1.0.74" default-features = false [dev-dependencies.rustversion] diff --git a/vendor/quote/src/lib.rs b/vendor/quote/src/lib.rs index 47167d3f8..8b97abd79 100644 --- a/vendor/quote/src/lib.rs +++ b/vendor/quote/src/lib.rs @@ -92,7 +92,7 @@ //! [prettyplease]: https://github.com/dtolnay/prettyplease // Quote types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/quote/1.0.33")] +#![doc(html_root_url = "https://docs.rs/quote/1.0.35")] #![allow( clippy::doc_markdown, clippy::missing_errors_doc, @@ -428,7 +428,7 @@ pub mod spanned; /// appears suffixed as integer literals by interpolating them as [`syn::Index`] /// instead. /// -/// [`syn::Index`]: https://docs.rs/syn/1.0/syn/struct.Index.html +/// [`syn::Index`]: https://docs.rs/syn/2.0/syn/struct.Index.html /// /// ```compile_fail /// let i = 0usize..self.fields.len(); diff --git a/vendor/redox_syscall-0.3.5/.cargo-checksum.json b/vendor/redox_syscall-0.3.5/.cargo-checksum.json deleted file mode 100644 index 72e27feeb..000000000 --- a/vendor/redox_syscall-0.3.5/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"80db3d7e545f9b8a04804e634948c6e80c712f051680b2e7a39ddb848c200151","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"9161f18ba7f69b4ca51e844aee8ffb8237513a468c5c3b1f3a5f989044f895ac","src/arch/aarch64.rs":"9b4cf7da1f001ce54bfd01b7a001dbc8043c1ef89823781a2a1070e2c096a9ce","src/arch/nonredox.rs":"1055cd441f4b95c9ec428222a7796c7fac953a8a500ca08173743ea95220aab3","src/arch/riscv64.rs":"20bf9a8db779059773b113643d0cb3737fbb5d57f45ee39b8ae9d3396b6ef636","src/arch/x86.rs":"cf01f4d798e8861ad5b9429714c947e2d7c53a3cb9a13d53dc7a38e4bdad4101","src/arch/x86_64.rs":"fd80c9a412d07c85f2b942f36de364edfff7cd49f6c00c043e69becb7c76119f","src/call.rs":"141bdb2cb64dc118beadf40fc8180cd32e41841c8d7db71aed646a5a8ab9fac3","src/data.rs":"bd4545d4c2fcc59ff26ae52ad7f773a697d5ccf639a2ffc253cece6b31e94d51","src/error.rs":"ef20f3817f997a1aeb7114628407f19cb8bc13c555d4e093918f38a5d098f798","src/flag.rs":"aad91126a0bb3413cd103fc38b457aa4d1f6b949605e3ae249aea0dfec8504ff","src/io/dma.rs":"85577342547afaac0dc46740dfeb9d2e4239d8809b86748c3fcaa12f922b1c9d","src/io/io.rs":"e1d454ff47efac70fdaa709251a5a9c1c5637f931994ba3bf6a38c6db9145822","src/io/mmio.rs":"12d0fb4d4f45097bf2c14f73cb1ce21325eae193b537e9f18af73ed5281b5e63","src/io/mod.rs":"79c2fce4fd6d75f3b9169df64b7a605feff31fab2e5ed81984ae085a1d07c0c4","src/io/pio.rs":"9ee6f2229b700d1c45b4c8c6242bd99fe69634e16dcd5843d9e8d1c958047406","src/lib.rs":"25c9f35cf709e7e50336ae12f0390f968cc11515f93b6d757825a7b7725eeadb","src/number.rs":"773d9f55a98c6ae5b4cb08b396568f05f8d9b187a7609b7a1c5dd940f6ee674a","src/scheme/generate.sh":"dde4e30f4e0223fb1a24ed486a6c36e624c854dbf890862cb6866f4fa3c7a6eb","src/scheme/mod.rs":"cb622405deb0aef4ab04499ea1adfd338c9c5dd9c31a1fe9989786dbf69b49d8","src/scheme/scheme.rs":"2e27e08e3b9005a5705fadd10a6160a570322c873d1b6477f269e0beae35f046","src/scheme/scheme_block.rs":"a8d0137e106dcb605367bfc6a22b83317142996b7e410c832de0f63a423d5305","src/scheme/scheme_block_mut.rs":"b6cea44a3e79dd6c30b4280b6913a215628918978451efe11f31b0d7eddd44a5","src/scheme/scheme_mut.rs":"e77da9d5208de101c126eca9fa685f2b78a5ddc4890ad5f5f4d79ded3bbd8fbd","src/scheme/seek.rs":"94e044de47b0f00eb0c2aea3fb21001ac2b9aa1e4b20d73fd54163fe92fa63f7","src/tests.rs":"b44de69251d6bcc1cb796147a1212fffd3ac7d5796d9a0d2265db0aac8a909df"},"package":"567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"} \ No newline at end of file diff --git a/vendor/redox_syscall-0.3.5/Cargo.toml b/vendor/redox_syscall-0.3.5/Cargo.toml deleted file mode 100644 index ab14e3fe8..000000000 --- a/vendor/redox_syscall-0.3.5/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies. -# -# If you are reading this file be aware that the original Cargo.toml -# will likely look very different (and much more reasonable). -# See Cargo.toml.orig for the original contents. - -[package] -edition = "2018" -name = "redox_syscall" -version = "0.3.5" -authors = ["Jeremy Soller "] -description = "A Rust library to access raw Redox system calls" -documentation = "https://docs.rs/redox_syscall" -readme = "README.md" -license = "MIT" -repository = "https://gitlab.redox-os.org/redox-os/syscall" - -[lib] -name = "syscall" - -[dependencies.bitflags] -version = "1.1.0" - -[dependencies.core] -version = "1.0.0" -optional = true -package = "rustc-std-workspace-core" - -[features] -rustc-dep-of-std = [ - "core", - "bitflags/rustc-dep-of-std", -] diff --git a/vendor/redox_syscall-0.3.5/LICENSE b/vendor/redox_syscall-0.3.5/LICENSE deleted file mode 100644 index 1292bb7fb..000000000 --- a/vendor/redox_syscall-0.3.5/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2017 Redox OS Developers - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/redox_syscall-0.3.5/README.md b/vendor/redox_syscall-0.3.5/README.md deleted file mode 100644 index 244c90861..000000000 --- a/vendor/redox_syscall-0.3.5/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# syscall -[Redox OS](https://gitlab.redox-os.org/redox-os/redox)'s syscall API - -[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) -[![crates.io](http://meritbadge.herokuapp.com/redox_syscall)](https://crates.io/crates/redox_syscall) -[![docs.rs](https://docs.rs/redox_syscall/badge.svg)](https://docs.rs/redox_syscall) diff --git a/vendor/redox_syscall-0.3.5/src/arch/aarch64.rs b/vendor/redox_syscall-0.3.5/src/arch/aarch64.rs deleted file mode 100644 index e792427cf..000000000 --- a/vendor/redox_syscall-0.3.5/src/arch/aarch64.rs +++ /dev/null @@ -1,150 +0,0 @@ -use core::{mem, slice}; -use core::ops::{Deref, DerefMut}; - -use super::error::{Error, Result}; - -pub const PAGE_SIZE: usize = 4096; - -macro_rules! syscall { - ($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => { - $( - pub unsafe fn $name($a: usize, $($b: usize, $($c: usize, $($d: usize, $($e: usize, $($f: usize)?)?)?)?)?) -> Result { - let ret: usize; - - core::arch::asm!( - "svc 0", - in("x8") $a, - $( - in("x0") $b, - $( - in("x1") $c, - $( - in("x2") $d, - $( - in("x3") $e, - $( - in("x4") $f, - )? - )? - )? - )? - )? - lateout("x0") ret, - options(nostack), - ); - - Error::demux(ret) - } - )+ - }; -} - -syscall! { - syscall0(a,); - syscall1(a, b,); - syscall2(a, b, c,); - syscall3(a, b, c, d,); - syscall4(a, b, c, d, e,); - syscall5(a, b, c, d, e, f,); -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct IntRegisters { - pub x30: usize, - pub x29: usize, - pub x28: usize, - pub x27: usize, - pub x26: usize, - pub x25: usize, - pub x24: usize, - pub x23: usize, - pub x22: usize, - pub x21: usize, - pub x20: usize, - pub x19: usize, - pub x18: usize, - pub x17: usize, - pub x16: usize, - pub x15: usize, - pub x14: usize, - pub x13: usize, - pub x12: usize, - pub x11: usize, - pub x10: usize, - pub x9: usize, - pub x8: usize, - pub x7: usize, - pub x6: usize, - pub x5: usize, - pub x4: usize, - pub x3: usize, - pub x2: usize, - pub x1: usize, - pub x0: usize -} - -impl Deref for IntRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for IntRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct FloatRegisters { - pub fp_simd_regs: [u128; 32], - pub fpsr: u32, - pub fpcr: u32 -} - -impl Deref for FloatRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for FloatRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct EnvRegisters { - pub tpidr_el0: usize, - pub tpidrro_el0: usize, -} -impl Deref for EnvRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for EnvRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::()) - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/arch/nonredox.rs b/vendor/redox_syscall-0.3.5/src/arch/nonredox.rs deleted file mode 100644 index 65c44fcd8..000000000 --- a/vendor/redox_syscall-0.3.5/src/arch/nonredox.rs +++ /dev/null @@ -1,29 +0,0 @@ -use super::error::{Error, Result, ENOSYS}; - -// Doesn't really matter, but since we will most likely run on an x86_64 host, why not 4096? -pub const PAGE_SIZE: usize = 4096; - -pub unsafe fn syscall0(_a: usize) -> Result { - Err(Error::new(ENOSYS)) -} - -pub unsafe fn syscall1(_a: usize, _b: usize) -> Result { - Err(Error::new(ENOSYS)) -} - -pub unsafe fn syscall2(_a: usize, _b: usize, _c: usize) -> Result { - Err(Error::new(ENOSYS)) -} - -pub unsafe fn syscall3(_a: usize, _b: usize, _c: usize, _d: usize) -> Result { - Err(Error::new(ENOSYS)) -} - -pub unsafe fn syscall4(_a: usize, _b: usize, _c: usize, _d: usize, _e: usize) -> Result { - Err(Error::new(ENOSYS)) -} - -pub unsafe fn syscall5(_a: usize, _b: usize, _c: usize, _d: usize, _e: usize, _f: usize) - -> Result { - Err(Error::new(ENOSYS)) -} diff --git a/vendor/redox_syscall-0.3.5/src/arch/riscv64.rs b/vendor/redox_syscall-0.3.5/src/arch/riscv64.rs deleted file mode 100644 index 2a90260da..000000000 --- a/vendor/redox_syscall-0.3.5/src/arch/riscv64.rs +++ /dev/null @@ -1,93 +0,0 @@ -use core::{mem, slice}; -use core::ops::{Deref, DerefMut}; - -use super::error::{Error, Result}; - -macro_rules! syscall { - ($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => { - $( - pub unsafe fn $name($a: usize, $($b: usize, $($c: usize, $($d: usize, $($e: usize, $($f: usize)?)?)?)?)?) -> Result { - let ret: usize; - - asm!( - "ecall", - in("a7") $a, - $( - in("a0") $b, - $( - in("a1") $c, - $( - in("a2") $d, - $( - in("a3") $e, - $( - in("a4") $f, - )? - )? - )? - )? - )? - lateout("a0") ret, - options(nostack), - ); - - Error::demux(ret) - } - )+ - }; -} - -syscall! { - syscall0(a,); - syscall1(a, b,); - syscall2(a, b, c,); - syscall3(a, b, c, d,); - syscall4(a, b, c, d, e,); - syscall5(a, b, c, d, e, f,); -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct IntRegisters { - //TODO -} - -impl Deref for IntRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for IntRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct FloatRegisters { - //TODO -} - -impl Deref for FloatRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for FloatRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/arch/x86.rs b/vendor/redox_syscall-0.3.5/src/arch/x86.rs deleted file mode 100644 index 54d8c0a93..000000000 --- a/vendor/redox_syscall-0.3.5/src/arch/x86.rs +++ /dev/null @@ -1,184 +0,0 @@ -use core::{mem, slice}; -use core::arch::asm; -use core::ops::{Deref, DerefMut}; - -use super::error::{Error, Result}; - -pub const PAGE_SIZE: usize = 4096; - -macro_rules! syscall { - ($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => { - $( - pub unsafe fn $name(mut $a: usize, $($b: usize, $($c: usize, $($d: usize, $($e: usize, $($f: usize)?)?)?)?)?) -> Result { - asm!( - "int 0x80", - inout("eax") $a, - $( - in("ebx") $b, - $( - in("ecx") $c, - $( - in("edx") $d, - $( - in("esi") $e, - $( - in("edi") $f, - )? - )? - )? - )? - )? - options(nostack), - ); - - Error::demux($a) - } - )+ - }; -} - -syscall! { - syscall0(a,); - syscall1(a, b,); - syscall2(a, b, c,); - syscall3(a, b, c, d,); - // Must be done custom because LLVM reserves ESI - //syscall4(a, b, c, d, e,); - //syscall5(a, b, c, d, e, f,); -} - -pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) - -> Result { - asm!( - "xchg esi, {e} - int 0x80 - xchg esi, {e}", - e = in(reg) e, - inout("eax") a, - in("ebx") b, - in("ecx") c, - in("edx") d, - options(nostack), - ); - - Error::demux(a) -} - -pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) - -> Result { - asm!( - "xchg esi, {e} - int 0x80 - xchg esi, {e}", - e = in(reg) e, - inout("eax") a, - in("ebx") b, - in("ecx") c, - in("edx") d, - in("edi") f, - options(nostack), - ); - - Error::demux(a) -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct IntRegisters { - // TODO: Some of these don't get set by Redox yet. Should they? - - pub ebp: usize, - pub esi: usize, - pub edi: usize, - pub ebx: usize, - pub eax: usize, - pub ecx: usize, - pub edx: usize, - // pub orig_rax: usize, - pub eip: usize, - pub cs: usize, - pub eflags: usize, - pub esp: usize, - pub ss: usize, - // pub fs_base: usize, - // pub gs_base: usize, - // pub ds: usize, - // pub es: usize, - pub fs: usize, - // pub gs: usize -} - -impl Deref for IntRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for IntRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct FloatRegisters { - pub fcw: u16, - pub fsw: u16, - pub ftw: u8, - pub _reserved: u8, - pub fop: u16, - pub fip: u64, - pub fdp: u64, - pub mxcsr: u32, - pub mxcsr_mask: u32, - pub st_space: [u128; 8], - pub xmm_space: [u128; 16], - // TODO: YMM/ZMM -} - -impl Deref for FloatRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for FloatRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct EnvRegisters { - pub fsbase: u32, - pub gsbase: u32, -} - -impl Deref for EnvRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for EnvRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::()) - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/arch/x86_64.rs b/vendor/redox_syscall-0.3.5/src/arch/x86_64.rs deleted file mode 100644 index 2ff57bb2d..000000000 --- a/vendor/redox_syscall-0.3.5/src/arch/x86_64.rs +++ /dev/null @@ -1,157 +0,0 @@ -use core::{mem, slice}; -use core::arch::asm; -use core::ops::{Deref, DerefMut}; - -use super::error::{Error, Result}; - -pub const PAGE_SIZE: usize = 4096; - -macro_rules! syscall { - ($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => { - $( - pub unsafe fn $name(mut $a: usize, $($b: usize, $($c: usize, $($d: usize, $($e: usize, $($f: usize)?)?)?)?)?) -> Result { - asm!( - "syscall", - inout("rax") $a, - $( - in("rdi") $b, - $( - in("rsi") $c, - $( - in("rdx") $d, - $( - in("r10") $e, - $( - in("r8") $f, - )? - )? - )? - )? - )? - out("rcx") _, - out("r11") _, - options(nostack), - ); - - Error::demux($a) - } - )+ - }; -} - -syscall! { - syscall0(a,); - syscall1(a, b,); - syscall2(a, b, c,); - syscall3(a, b, c, d,); - syscall4(a, b, c, d, e,); - syscall5(a, b, c, d, e, f,); -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct IntRegisters { - // TODO: Some of these don't get set by Redox yet. Should they? - - pub r15: usize, - pub r14: usize, - pub r13: usize, - pub r12: usize, - pub rbp: usize, - pub rbx: usize, - pub r11: usize, - pub r10: usize, - pub r9: usize, - pub r8: usize, - pub rax: usize, - pub rcx: usize, - pub rdx: usize, - pub rsi: usize, - pub rdi: usize, - // pub orig_rax: usize, - pub rip: usize, - pub cs: usize, - pub rflags: usize, - pub rsp: usize, - pub ss: usize, - // pub fs_base: usize, - // pub gs_base: usize, - // pub ds: usize, - // pub es: usize, - pub fs: usize, - // pub gs: usize -} - -impl Deref for IntRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for IntRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct FloatRegisters { - pub fcw: u16, - pub fsw: u16, - pub ftw: u8, - pub _reserved: u8, - pub fop: u16, - pub fip: u64, - pub fdp: u64, - pub mxcsr: u32, - pub mxcsr_mask: u32, - pub st_space: [u128; 8], - pub xmm_space: [u128; 16], - // TODO: YMM/ZMM -} - -impl Deref for FloatRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for FloatRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) - } - } -} -#[derive(Clone, Copy, Debug, Default)] -#[repr(packed)] -pub struct EnvRegisters { - pub fsbase: u64, - pub gsbase: u64, - // TODO: PKRU? -} -impl Deref for EnvRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for EnvRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::()) - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/call.rs b/vendor/redox_syscall-0.3.5/src/call.rs deleted file mode 100644 index bc1af0dc2..000000000 --- a/vendor/redox_syscall-0.3.5/src/call.rs +++ /dev/null @@ -1,379 +0,0 @@ -use super::arch::*; -use super::data::{Map, SigAction, Stat, StatVfs, TimeSpec}; -use super::error::Result; -use super::flag::*; -use super::number::*; - -use core::{mem, ptr}; - -// Signal restorer -extern "C" fn restorer() -> ! { - sigreturn().unwrap(); - unreachable!(); -} - -/// Close a file -pub fn close(fd: usize) -> Result { - unsafe { syscall1(SYS_CLOSE, fd) } -} - -/// Get the current system time -pub fn clock_gettime(clock: usize, tp: &mut TimeSpec) -> Result { - unsafe { syscall2(SYS_CLOCK_GETTIME, clock, tp as *mut TimeSpec as usize) } -} - -/// Copy and transform a file descriptor -pub fn dup(fd: usize, buf: &[u8]) -> Result { - unsafe { syscall3(SYS_DUP, fd, buf.as_ptr() as usize, buf.len()) } -} - -/// Copy and transform a file descriptor -pub fn dup2(fd: usize, newfd: usize, buf: &[u8]) -> Result { - unsafe { syscall4(SYS_DUP2, fd, newfd, buf.as_ptr() as usize, buf.len()) } -} - -/// Exit the current process -pub fn exit(status: usize) -> Result { - unsafe { syscall1(SYS_EXIT, status) } -} - -/// Change file permissions -pub fn fchmod(fd: usize, mode: u16) -> Result { - unsafe { syscall2(SYS_FCHMOD, fd, mode as usize) } - -} - -/// Change file ownership -pub fn fchown(fd: usize, uid: u32, gid: u32) -> Result { - unsafe { syscall3(SYS_FCHOWN, fd, uid as usize, gid as usize) } - -} - -/// Change file descriptor flags -pub fn fcntl(fd: usize, cmd: usize, arg: usize) -> Result { - unsafe { syscall3(SYS_FCNTL, fd, cmd, arg) } -} - -/// Map a file into memory, but with the ability to set the address to map into, either as a hint -/// or as a requirement of the map. -/// -/// # Errors -/// `EACCES` - the file descriptor was not open for reading -/// `EBADF` - if the file descriptor was invalid -/// `ENODEV` - mmapping was not supported -/// `EINVAL` - invalid combination of flags -/// `EEXIST` - if [`MapFlags::MAP_FIXED`] was set, and the address specified was already in use. -/// -pub unsafe fn fmap(fd: usize, map: &Map) -> Result { - syscall3(SYS_FMAP, fd, map as *const Map as usize, mem::size_of::()) -} - -/// Unmap whole (or partial) continous memory-mapped files -pub unsafe fn funmap(addr: usize, len: usize) -> Result { - syscall2(SYS_FUNMAP, addr, len) -} - -/// Retrieve the canonical path of a file -pub fn fpath(fd: usize, buf: &mut [u8]) -> Result { - unsafe { syscall3(SYS_FPATH, fd, buf.as_mut_ptr() as usize, buf.len()) } -} - -/// Rename a file -pub fn frename>(fd: usize, path: T) -> Result { - unsafe { syscall3(SYS_FRENAME, fd, path.as_ref().as_ptr() as usize, path.as_ref().len()) } -} - -/// Get metadata about a file -pub fn fstat(fd: usize, stat: &mut Stat) -> Result { - unsafe { syscall3(SYS_FSTAT, fd, stat as *mut Stat as usize, mem::size_of::()) } -} - -/// Get metadata about a filesystem -pub fn fstatvfs(fd: usize, stat: &mut StatVfs) -> Result { - unsafe { syscall3(SYS_FSTATVFS, fd, stat as *mut StatVfs as usize, mem::size_of::()) } -} - -/// Sync a file descriptor to its underlying medium -pub fn fsync(fd: usize) -> Result { - unsafe { syscall1(SYS_FSYNC, fd) } -} - -/// Truncate or extend a file to a specified length -pub fn ftruncate(fd: usize, len: usize) -> Result { - unsafe { syscall2(SYS_FTRUNCATE, fd, len) } -} - -// Change modify and/or access times -pub fn futimens(fd: usize, times: &[TimeSpec]) -> Result { - unsafe { syscall3(SYS_FUTIMENS, fd, times.as_ptr() as usize, times.len() * mem::size_of::()) } -} - -/// Fast userspace mutex -pub unsafe fn futex(addr: *mut i32, op: usize, val: i32, val2: usize, addr2: *mut i32) - -> Result { - syscall5(SYS_FUTEX, addr as usize, op, (val as isize) as usize, val2, addr2 as usize) -} - -/// Get the effective group ID -pub fn getegid() -> Result { - unsafe { syscall0(SYS_GETEGID) } -} - -/// Get the effective namespace -pub fn getens() -> Result { - unsafe { syscall0(SYS_GETENS) } -} - -/// Get the effective user ID -pub fn geteuid() -> Result { - unsafe { syscall0(SYS_GETEUID) } -} - -/// Get the current group ID -pub fn getgid() -> Result { - unsafe { syscall0(SYS_GETGID) } -} - -/// Get the current namespace -pub fn getns() -> Result { - unsafe { syscall0(SYS_GETNS) } -} - -/// Get the current process ID -pub fn getpid() -> Result { - unsafe { syscall0(SYS_GETPID) } -} - -/// Get the process group ID -pub fn getpgid(pid: usize) -> Result { - unsafe { syscall1(SYS_GETPGID, pid) } -} - -/// Get the parent process ID -pub fn getppid() -> Result { - unsafe { syscall0(SYS_GETPPID) } -} - -/// Get the current user ID -pub fn getuid() -> Result { - unsafe { syscall0(SYS_GETUID) } -} - -/// Set the I/O privilege level -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -/// * `EINVAL` - `level > 3` -pub unsafe fn iopl(level: usize) -> Result { - syscall1(SYS_IOPL, level) -} - -/// Send a signal `sig` to the process identified by `pid` -pub fn kill(pid: usize, sig: usize) -> Result { - unsafe { syscall2(SYS_KILL, pid, sig) } -} - -/// Create a link to a file -pub unsafe fn link(old: *const u8, new: *const u8) -> Result { - syscall2(SYS_LINK, old as usize, new as usize) -} - -/// Seek to `offset` bytes in a file descriptor -pub fn lseek(fd: usize, offset: isize, whence: usize) -> Result { - unsafe { syscall3(SYS_LSEEK, fd, offset as usize, whence) } -} - -/// Make a new scheme namespace -pub fn mkns(schemes: &[[usize; 2]]) -> Result { - unsafe { syscall2(SYS_MKNS, schemes.as_ptr() as usize, schemes.len()) } -} - -/// Change mapping flags -pub unsafe fn mprotect(addr: usize, size: usize, flags: MapFlags) -> Result { - syscall3(SYS_MPROTECT, addr, size, flags.bits()) -} - -/// Sleep for the time specified in `req` -pub fn nanosleep(req: &TimeSpec, rem: &mut TimeSpec) -> Result { - unsafe { syscall2(SYS_NANOSLEEP, req as *const TimeSpec as usize, - rem as *mut TimeSpec as usize) } -} - -/// Open a file -pub fn open>(path: T, flags: usize) -> Result { - unsafe { syscall3(SYS_OPEN, path.as_ref().as_ptr() as usize, path.as_ref().len(), flags) } -} - -/// Allocate frames, linearly in physical memory. -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -/// * `ENOMEM` - the system has run out of available memory -pub unsafe fn physalloc(size: usize) -> Result { - syscall1(SYS_PHYSALLOC, size) -} - -/// Allocate frames, linearly in physical memory, with an extra set of flags. If the flags contain -/// [`PARTIAL_ALLOC`], this will result in `physalloc3` with `min = 1`. -/// -/// Refer to the simpler [`physalloc`] and the more complex [`physalloc3`], that this convenience -/// function is based on. -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -/// * `ENOMEM` - the system has run out of available memory -pub unsafe fn physalloc2(size: usize, flags: usize) -> Result { - let mut ret = 1usize; - physalloc3(size, flags, &mut ret) -} - -/// Allocate frames, linearly in physical memory, with an extra set of flags. If the flags contain -/// [`PARTIAL_ALLOC`], the `min` parameter specifies the number of frames that have to be allocated -/// for this operation to succeed. The return value is the offset of the first frame, and `min` is -/// overwritten with the number of frames actually allocated. -/// -/// Refer to the simpler [`physalloc`] and the simpler library function [`physalloc2`]. -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -/// * `ENOMEM` - the system has run out of available memory -/// * `EINVAL` - `min = 0` -pub unsafe fn physalloc3(size: usize, flags: usize, min: &mut usize) -> Result { - syscall3(SYS_PHYSALLOC3, size, flags, min as *mut usize as usize) -} - -/// Free physically allocated pages -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -pub unsafe fn physfree(physical_address: usize, size: usize) -> Result { - syscall2(SYS_PHYSFREE, physical_address, size) -} - -/// Map physical memory to virtual memory -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -pub unsafe fn physmap(physical_address: usize, size: usize, flags: PhysmapFlags) -> Result { - syscall3(SYS_PHYSMAP, physical_address, size, flags.bits()) -} - -/// Unmap previously mapped physical memory -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -/// * `EFAULT` - `virtual_address` has not been mapped -pub unsafe fn physunmap(virtual_address: usize) -> Result { - syscall1(SYS_PHYSUNMAP, virtual_address) -} - -/// Create a pair of file descriptors referencing the read and write ends of a pipe -pub fn pipe2(fds: &mut [usize; 2], flags: usize) -> Result { - unsafe { syscall2(SYS_PIPE2, fds.as_ptr() as usize, flags) } -} - -/// Read from a file descriptor into a buffer -pub fn read(fd: usize, buf: &mut [u8]) -> Result { - unsafe { syscall3(SYS_READ, fd, buf.as_mut_ptr() as usize, buf.len()) } -} - -/// Remove a directory -pub fn rmdir>(path: T) -> Result { - unsafe { syscall2(SYS_RMDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) } -} - -/// Set the process group ID -pub fn setpgid(pid: usize, pgid: usize) -> Result { - unsafe { syscall2(SYS_SETPGID, pid, pgid) } -} - -/// Set the current process group IDs -pub fn setregid(rgid: usize, egid: usize) -> Result { - unsafe { syscall2(SYS_SETREGID, rgid, egid) } -} - -/// Make a new scheme namespace -pub fn setrens(rns: usize, ens: usize) -> Result { - unsafe { syscall2(SYS_SETRENS, rns, ens) } -} - -/// Set the current process user IDs -pub fn setreuid(ruid: usize, euid: usize) -> Result { - unsafe { syscall2(SYS_SETREUID, ruid, euid) } -} - -/// Set up a signal handler -pub fn sigaction(sig: usize, act: Option<&SigAction>, oldact: Option<&mut SigAction>) -> Result { - unsafe { syscall4(SYS_SIGACTION, sig, - act.map(|x| x as *const _).unwrap_or_else(ptr::null) as usize, - oldact.map(|x| x as *mut _).unwrap_or_else(ptr::null_mut) as usize, - restorer as usize) } -} - -/// Get and/or set signal masks -pub fn sigprocmask(how: usize, set: Option<&[u64; 2]>, oldset: Option<&mut [u64; 2]>) -> Result { - unsafe { syscall3(SYS_SIGPROCMASK, how, - set.map(|x| x as *const _).unwrap_or_else(ptr::null) as usize, - oldset.map(|x| x as *mut _).unwrap_or_else(ptr::null_mut) as usize) } -} - -// Return from signal handler -pub fn sigreturn() -> Result { - unsafe { syscall0(SYS_SIGRETURN) } -} - -/// Set the file mode creation mask -pub fn umask(mask: usize) -> Result { - unsafe { syscall1(SYS_UMASK, mask) } -} - -/// Remove a file -pub fn unlink>(path: T) -> Result { - unsafe { syscall2(SYS_UNLINK, path.as_ref().as_ptr() as usize, path.as_ref().len()) } -} - -/// Convert a virtual address to a physical one -/// -/// # Errors -/// -/// * `EPERM` - `uid != 0` -pub unsafe fn virttophys(virtual_address: usize) -> Result { - syscall1(SYS_VIRTTOPHYS, virtual_address) -} - -/// Check if a child process has exited or received a signal -pub fn waitpid(pid: usize, status: &mut usize, options: WaitFlags) -> Result { - unsafe { syscall3(SYS_WAITPID, pid, status as *mut usize as usize, options.bits()) } -} - -/// Write a buffer to a file descriptor -/// -/// The kernel will attempt to write the bytes in `buf` to the file descriptor `fd`, returning -/// either an `Err`, explained below, or `Ok(count)` where `count` is the number of bytes which -/// were written. -/// -/// # Errors -/// -/// * `EAGAIN` - the file descriptor was opened with `O_NONBLOCK` and writing would block -/// * `EBADF` - the file descriptor is not valid or is not open for writing -/// * `EFAULT` - `buf` does not point to the process's addressible memory -/// * `EIO` - an I/O error occurred -/// * `ENOSPC` - the device containing the file descriptor has no room for data -/// * `EPIPE` - the file descriptor refers to a pipe or socket whose reading end is closed -pub fn write(fd: usize, buf: &[u8]) -> Result { - unsafe { syscall3(SYS_WRITE, fd, buf.as_ptr() as usize, buf.len()) } -} - -/// Yield the process's time slice to the kernel -/// -/// This function will return Ok(0) on success -pub fn sched_yield() -> Result { - unsafe { syscall0(SYS_YIELD) } -} diff --git a/vendor/redox_syscall-0.3.5/src/data.rs b/vendor/redox_syscall-0.3.5/src/data.rs deleted file mode 100644 index 45d2dd862..000000000 --- a/vendor/redox_syscall-0.3.5/src/data.rs +++ /dev/null @@ -1,297 +0,0 @@ -use core::ops::{Deref, DerefMut}; -use core::{mem, slice}; -use crate::flag::{EventFlags, MapFlags, PtraceFlags, SigActionFlags}; - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct Event { - pub id: usize, - pub flags: EventFlags, - pub data: usize -} - -impl Deref for Event { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const Event as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for Event { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut Event as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct ITimerSpec { - pub it_interval: TimeSpec, - pub it_value: TimeSpec, -} - -impl Deref for ITimerSpec { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const ITimerSpec as *const u8, - mem::size_of::()) - } - } -} - -impl DerefMut for ITimerSpec { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut ITimerSpec as *mut u8, - mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct OldMap { - pub offset: usize, - pub size: usize, - pub flags: MapFlags, -} - -impl Deref for OldMap { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const OldMap as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for OldMap { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut OldMap as *mut u8, mem::size_of::()) - } - } -} -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct Map { - /// The offset inside the file that is being mapped. - pub offset: usize, - - /// The size of the memory map. - pub size: usize, - - /// Contains both prot and map flags. - pub flags: MapFlags, - - /// Functions as a hint to where in the virtual address space of the running process, to place - /// the memory map. If [`MapFlags::MAP_FIXED`] is set, then this address must be the address to - /// map to. - pub address: usize, -} - -impl Deref for Map { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const Map as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for Map { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut Map as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default)] -#[repr(C)] -pub struct Packet { - pub id: u64, - pub pid: usize, - pub uid: u32, - pub gid: u32, - pub a: usize, - pub b: usize, - pub c: usize, - pub d: usize -} - -impl Deref for Packet { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const Packet as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for Packet { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut Packet as *mut u8, mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default, PartialEq)] -#[repr(C)] -pub struct SigAction { - pub sa_handler: Option, - pub sa_mask: [u64; 2], - pub sa_flags: SigActionFlags, -} - -#[allow(dead_code)] -unsafe fn _assert_size_of_function_is_sane() { - // Transmuting will complain *at compile time* if sizes differ. - // Rust forbids a fn-pointer from being 0 so to allow SIG_DFL to - // exist, we use Option which will mean 0 - // becomes None - let _ = mem::transmute::, usize>(None); -} - -#[derive(Copy, Clone, Debug, Default, PartialEq)] -#[repr(C)] -pub struct Stat { - pub st_dev: u64, - pub st_ino: u64, - pub st_mode: u16, - pub st_nlink: u32, - pub st_uid: u32, - pub st_gid: u32, - pub st_size: u64, - pub st_blksize: u32, - pub st_blocks: u64, - pub st_mtime: u64, - pub st_mtime_nsec: u32, - pub st_atime: u64, - pub st_atime_nsec: u32, - pub st_ctime: u64, - pub st_ctime_nsec: u32, -} - -impl Deref for Stat { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const Stat as *const u8, - mem::size_of::()) - } - } -} - -impl DerefMut for Stat { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut Stat as *mut u8, - mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default, PartialEq)] -#[repr(C)] -pub struct StatVfs { - pub f_bsize: u32, - pub f_blocks: u64, - pub f_bfree: u64, - pub f_bavail: u64, -} - -impl Deref for StatVfs { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const StatVfs as *const u8, - mem::size_of::()) - } - } -} - -impl DerefMut for StatVfs { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut StatVfs as *mut u8, - mem::size_of::()) - } - } -} - -#[derive(Copy, Clone, Debug, Default, PartialEq)] -#[repr(C)] -pub struct TimeSpec { - pub tv_sec: i64, - pub tv_nsec: i32, -} - -impl Deref for TimeSpec { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const TimeSpec as *const u8, - mem::size_of::()) - } - } -} - -impl DerefMut for TimeSpec { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut TimeSpec as *mut u8, - mem::size_of::()) - } - } -} - -#[derive(Clone, Copy, Debug, Default)] -#[repr(C)] -pub struct PtraceEvent { - pub cause: PtraceFlags, - pub a: usize, - pub b: usize, - pub c: usize, - pub d: usize, - pub e: usize, - pub f: usize -} - -impl Deref for PtraceEvent { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const PtraceEvent as *const u8, mem::size_of::()) - } - } -} - -impl DerefMut for PtraceEvent { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut PtraceEvent as *mut u8, mem::size_of::()) - } - } -} - -#[macro_export] -macro_rules! ptrace_event { - ($cause:expr $(, $a:expr $(, $b:expr $(, $c:expr)?)?)?) => { - $crate::data::PtraceEvent { - cause: $cause, - $(a: $a, - $(b: $b, - $(c: $c,)? - )? - )? - ..Default::default() - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/error.rs b/vendor/redox_syscall-0.3.5/src/error.rs deleted file mode 100644 index 9a4b0b5ad..000000000 --- a/vendor/redox_syscall-0.3.5/src/error.rs +++ /dev/null @@ -1,311 +0,0 @@ -use core::{fmt, result}; - -#[derive(Eq, PartialEq)] -pub struct Error { - pub errno: i32, -} - -pub type Result = result::Result; - -impl Error { - pub fn new(errno: i32) -> Error { - Error { errno: errno } - } - - pub fn mux(result: Result) -> usize { - match result { - Ok(value) => value, - Err(error) => -error.errno as usize, - } - } - - pub fn demux(value: usize) -> Result { - let errno = -(value as i32); - if errno >= 1 && errno < STR_ERROR.len() as i32 { - Err(Error::new(errno)) - } else { - Ok(value) - } - } - - pub fn text(&self) -> &'static str { - STR_ERROR.get(self.errno as usize).map(|&x| x).unwrap_or("Unknown Error") - } -} - -impl fmt::Debug for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> { - f.write_str(self.text()) - } -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> { - f.write_str(self.text()) - } -} - -pub const EPERM: i32 = 1; /* Operation not permitted */ -pub const ENOENT: i32 = 2; /* No such file or directory */ -pub const ESRCH: i32 = 3; /* No such process */ -pub const EINTR: i32 = 4; /* Interrupted system call */ -pub const EIO: i32 = 5; /* I/O error */ -pub const ENXIO: i32 = 6; /* No such device or address */ -pub const E2BIG: i32 = 7; /* Argument list too long */ -pub const ENOEXEC: i32 = 8; /* Exec format error */ -pub const EBADF: i32 = 9; /* Bad file number */ -pub const ECHILD: i32 = 10; /* No child processes */ -pub const EAGAIN: i32 = 11; /* Try again */ -pub const ENOMEM: i32 = 12; /* Out of memory */ -pub const EACCES: i32 = 13; /* Permission denied */ -pub const EFAULT: i32 = 14; /* Bad address */ -pub const ENOTBLK: i32 = 15; /* Block device required */ -pub const EBUSY: i32 = 16; /* Device or resource busy */ -pub const EEXIST: i32 = 17; /* File exists */ -pub const EXDEV: i32 = 18; /* Cross-device link */ -pub const ENODEV: i32 = 19; /* No such device */ -pub const ENOTDIR: i32 = 20; /* Not a directory */ -pub const EISDIR: i32 = 21; /* Is a directory */ -pub const EINVAL: i32 = 22; /* Invalid argument */ -pub const ENFILE: i32 = 23; /* File table overflow */ -pub const EMFILE: i32 = 24; /* Too many open files */ -pub const ENOTTY: i32 = 25; /* Not a typewriter */ -pub const ETXTBSY: i32 = 26; /* Text file busy */ -pub const EFBIG: i32 = 27; /* File too large */ -pub const ENOSPC: i32 = 28; /* No space left on device */ -pub const ESPIPE: i32 = 29; /* Illegal seek */ -pub const EROFS: i32 = 30; /* Read-only file system */ -pub const EMLINK: i32 = 31; /* Too many links */ -pub const EPIPE: i32 = 32; /* Broken pipe */ -pub const EDOM: i32 = 33; /* Math argument out of domain of func */ -pub const ERANGE: i32 = 34; /* Math result not representable */ -pub const EDEADLK: i32 = 35; /* Resource deadlock would occur */ -pub const ENAMETOOLONG: i32 = 36; /* File name too long */ -pub const ENOLCK: i32 = 37; /* No record locks available */ -pub const ENOSYS: i32 = 38; /* Function not implemented */ -pub const ENOTEMPTY: i32 = 39; /* Directory not empty */ -pub const ELOOP: i32 = 40; /* Too many symbolic links encountered */ -pub const EWOULDBLOCK: i32 = 41; /* Operation would block */ -pub const ENOMSG: i32 = 42; /* No message of desired type */ -pub const EIDRM: i32 = 43; /* Identifier removed */ -pub const ECHRNG: i32 = 44; /* Channel number out of range */ -pub const EL2NSYNC: i32 = 45; /* Level 2 not synchronized */ -pub const EL3HLT: i32 = 46; /* Level 3 halted */ -pub const EL3RST: i32 = 47; /* Level 3 reset */ -pub const ELNRNG: i32 = 48; /* Link number out of range */ -pub const EUNATCH: i32 = 49; /* Protocol driver not attached */ -pub const ENOCSI: i32 = 50; /* No CSI structure available */ -pub const EL2HLT: i32 = 51; /* Level 2 halted */ -pub const EBADE: i32 = 52; /* Invalid exchange */ -pub const EBADR: i32 = 53; /* Invalid request descriptor */ -pub const EXFULL: i32 = 54; /* Exchange full */ -pub const ENOANO: i32 = 55; /* No anode */ -pub const EBADRQC: i32 = 56; /* Invalid request code */ -pub const EBADSLT: i32 = 57; /* Invalid slot */ -pub const EDEADLOCK: i32 = 58; /* Resource deadlock would occur */ -pub const EBFONT: i32 = 59; /* Bad font file format */ -pub const ENOSTR: i32 = 60; /* Device not a stream */ -pub const ENODATA: i32 = 61; /* No data available */ -pub const ETIME: i32 = 62; /* Timer expired */ -pub const ENOSR: i32 = 63; /* Out of streams resources */ -pub const ENONET: i32 = 64; /* Machine is not on the network */ -pub const ENOPKG: i32 = 65; /* Package not installed */ -pub const EREMOTE: i32 = 66; /* Object is remote */ -pub const ENOLINK: i32 = 67; /* Link has been severed */ -pub const EADV: i32 = 68; /* Advertise error */ -pub const ESRMNT: i32 = 69; /* Srmount error */ -pub const ECOMM: i32 = 70; /* Communication error on send */ -pub const EPROTO: i32 = 71; /* Protocol error */ -pub const EMULTIHOP: i32 = 72; /* Multihop attempted */ -pub const EDOTDOT: i32 = 73; /* RFS specific error */ -pub const EBADMSG: i32 = 74; /* Not a data message */ -pub const EOVERFLOW: i32 = 75; /* Value too large for defined data type */ -pub const ENOTUNIQ: i32 = 76; /* Name not unique on network */ -pub const EBADFD: i32 = 77; /* File descriptor in bad state */ -pub const EREMCHG: i32 = 78; /* Remote address changed */ -pub const ELIBACC: i32 = 79; /* Can not access a needed shared library */ -pub const ELIBBAD: i32 = 80; /* Accessing a corrupted shared library */ -pub const ELIBSCN: i32 = 81; /* .lib section in a.out corrupted */ -pub const ELIBMAX: i32 = 82; /* Attempting to link in too many shared libraries */ -pub const ELIBEXEC: i32 = 83; /* Cannot exec a shared library directly */ -pub const EILSEQ: i32 = 84; /* Illegal byte sequence */ -pub const ERESTART: i32 = 85; /* Interrupted system call should be restarted */ -pub const ESTRPIPE: i32 = 86; /* Streams pipe error */ -pub const EUSERS: i32 = 87; /* Too many users */ -pub const ENOTSOCK: i32 = 88; /* Socket operation on non-socket */ -pub const EDESTADDRREQ: i32 = 89; /* Destination address required */ -pub const EMSGSIZE: i32 = 90; /* Message too long */ -pub const EPROTOTYPE: i32 = 91; /* Protocol wrong type for socket */ -pub const ENOPROTOOPT: i32 = 92; /* Protocol not available */ -pub const EPROTONOSUPPORT: i32 = 93; /* Protocol not supported */ -pub const ESOCKTNOSUPPORT: i32 = 94; /* Socket type not supported */ -pub const EOPNOTSUPP: i32 = 95; /* Operation not supported on transport endpoint */ -pub const EPFNOSUPPORT: i32 = 96; /* Protocol family not supported */ -pub const EAFNOSUPPORT: i32 = 97; /* Address family not supported by protocol */ -pub const EADDRINUSE: i32 = 98; /* Address already in use */ -pub const EADDRNOTAVAIL: i32 = 99; /* Cannot assign requested address */ -pub const ENETDOWN: i32 = 100; /* Network is down */ -pub const ENETUNREACH: i32 = 101; /* Network is unreachable */ -pub const ENETRESET: i32 = 102; /* Network dropped connection because of reset */ -pub const ECONNABORTED: i32 = 103; /* Software caused connection abort */ -pub const ECONNRESET: i32 = 104; /* Connection reset by peer */ -pub const ENOBUFS: i32 = 105; /* No buffer space available */ -pub const EISCONN: i32 = 106; /* Transport endpoint is already connected */ -pub const ENOTCONN: i32 = 107; /* Transport endpoint is not connected */ -pub const ESHUTDOWN: i32 = 108; /* Cannot send after transport endpoint shutdown */ -pub const ETOOMANYREFS: i32 = 109; /* Too many references: cannot splice */ -pub const ETIMEDOUT: i32 = 110; /* Connection timed out */ -pub const ECONNREFUSED: i32 = 111; /* Connection refused */ -pub const EHOSTDOWN: i32 = 112; /* Host is down */ -pub const EHOSTUNREACH: i32 = 113; /* No route to host */ -pub const EALREADY: i32 = 114; /* Operation already in progress */ -pub const EINPROGRESS: i32 = 115; /* Operation now in progress */ -pub const ESTALE: i32 = 116; /* Stale NFS file handle */ -pub const EUCLEAN: i32 = 117; /* Structure needs cleaning */ -pub const ENOTNAM: i32 = 118; /* Not a XENIX named type file */ -pub const ENAVAIL: i32 = 119; /* No XENIX semaphores available */ -pub const EISNAM: i32 = 120; /* Is a named type file */ -pub const EREMOTEIO: i32 = 121; /* Remote I/O error */ -pub const EDQUOT: i32 = 122; /* Quota exceeded */ -pub const ENOMEDIUM: i32 = 123; /* No medium found */ -pub const EMEDIUMTYPE: i32 = 124; /* Wrong medium type */ -pub const ECANCELED: i32 = 125; /* Operation Canceled */ -pub const ENOKEY: i32 = 126; /* Required key not available */ -pub const EKEYEXPIRED: i32 = 127; /* Key has expired */ -pub const EKEYREVOKED: i32 = 128; /* Key has been revoked */ -pub const EKEYREJECTED: i32 = 129; /* Key was rejected by service */ -pub const EOWNERDEAD: i32 = 130; /* Owner died */ -pub const ENOTRECOVERABLE: i32 = 131; /* State not recoverable */ - -pub static STR_ERROR: [&'static str; 132] = ["Success", - "Operation not permitted", - "No such file or directory", - "No such process", - "Interrupted system call", - "I/O error", - "No such device or address", - "Argument list too long", - "Exec format error", - "Bad file number", - "No child processes", - "Try again", - "Out of memory", - "Permission denied", - "Bad address", - "Block device required", - "Device or resource busy", - "File exists", - "Cross-device link", - "No such device", - "Not a directory", - "Is a directory", - "Invalid argument", - "File table overflow", - "Too many open files", - "Not a typewriter", - "Text file busy", - "File too large", - "No space left on device", - "Illegal seek", - "Read-only file system", - "Too many links", - "Broken pipe", - "Math argument out of domain of func", - "Math result not representable", - "Resource deadlock would occur", - "File name too long", - "No record locks available", - "Function not implemented", - "Directory not empty", - "Too many symbolic links encountered", - "Operation would block", - "No message of desired type", - "Identifier removed", - "Channel number out of range", - "Level 2 not synchronized", - "Level 3 halted", - "Level 3 reset", - "Link number out of range", - "Protocol driver not attached", - "No CSI structure available", - "Level 2 halted", - "Invalid exchange", - "Invalid request descriptor", - "Exchange full", - "No anode", - "Invalid request code", - "Invalid slot", - "Resource deadlock would occur", - "Bad font file format", - "Device not a stream", - "No data available", - "Timer expired", - "Out of streams resources", - "Machine is not on the network", - "Package not installed", - "Object is remote", - "Link has been severed", - "Advertise error", - "Srmount error", - "Communication error on send", - "Protocol error", - "Multihop attempted", - "RFS specific error", - "Not a data message", - "Value too large for defined data type", - "Name not unique on network", - "File descriptor in bad state", - "Remote address changed", - "Can not access a needed shared library", - "Accessing a corrupted shared library", - ".lib section in a.out corrupted", - "Attempting to link in too many shared libraries", - "Cannot exec a shared library directly", - "Illegal byte sequence", - "Interrupted system call should be restarted", - "Streams pipe error", - "Too many users", - "Socket operation on non-socket", - "Destination address required", - "Message too long", - "Protocol wrong type for socket", - "Protocol not available", - "Protocol not supported", - "Socket type not supported", - "Operation not supported on transport endpoint", - "Protocol family not supported", - "Address family not supported by protocol", - "Address already in use", - "Cannot assign requested address", - "Network is down", - "Network is unreachable", - "Network dropped connection because of reset", - "Software caused connection abort", - "Connection reset by peer", - "No buffer space available", - "Transport endpoint is already connected", - "Transport endpoint is not connected", - "Cannot send after transport endpoint shutdown", - "Too many references: cannot splice", - "Connection timed out", - "Connection refused", - "Host is down", - "No route to host", - "Operation already in progress", - "Operation now in progress", - "Stale NFS file handle", - "Structure needs cleaning", - "Not a XENIX named type file", - "No XENIX semaphores available", - "Is a named type file", - "Remote I/O error", - "Quota exceeded", - "No medium found", - "Wrong medium type", - "Operation Canceled", - "Required key not available", - "Key has expired", - "Key has been revoked", - "Key was rejected by service", - "Owner died", - "State not recoverable"]; diff --git a/vendor/redox_syscall-0.3.5/src/flag.rs b/vendor/redox_syscall-0.3.5/src/flag.rs deleted file mode 100644 index 341104856..000000000 --- a/vendor/redox_syscall-0.3.5/src/flag.rs +++ /dev/null @@ -1,336 +0,0 @@ -use bitflags::bitflags as inner_bitflags; -use core::{mem, ops::Deref, slice}; - -macro_rules! bitflags { - ( - $(#[$outer:meta])* - pub struct $BitFlags:ident: $T:ty { - $( - $(#[$inner:ident $($args:tt)*])* - const $Flag:ident = $value:expr; - )+ - } - ) => { - // First, use the inner bitflags - inner_bitflags! { - #[derive(Default)] - $(#[$outer])* - pub struct $BitFlags: $T { - $( - $(#[$inner $($args)*])* - const $Flag = $value; - )+ - } - } - - // Secondly, re-export all inner constants - // (`pub use self::Struct::*` doesn't work) - $( - $(#[$inner $($args)*])* - pub const $Flag: $BitFlags = $BitFlags::$Flag; - )+ - } -} - -pub const CLOCK_REALTIME: usize = 1; -pub const CLOCK_MONOTONIC: usize = 4; - -bitflags! { - pub struct EventFlags: usize { - const EVENT_NONE = 0; - const EVENT_READ = 1; - const EVENT_WRITE = 2; - } -} - -pub const F_DUPFD: usize = 0; -pub const F_GETFD: usize = 1; -pub const F_SETFD: usize = 2; -pub const F_GETFL: usize = 3; -pub const F_SETFL: usize = 4; - -pub const FUTEX_WAIT: usize = 0; -pub const FUTEX_WAKE: usize = 1; -pub const FUTEX_REQUEUE: usize = 2; -pub const FUTEX_WAIT64: usize = 3; - -bitflags! { - pub struct MapFlags: usize { - const PROT_NONE = 0x0000_0000; - const PROT_EXEC = 0x0001_0000; - const PROT_WRITE = 0x0002_0000; - const PROT_READ = 0x0004_0000; - - const MAP_SHARED = 0x0001; - const MAP_PRIVATE = 0x0002; - - /// Only accepted for mmap2(2). - const MAP_FIXED = 0x0004; - const MAP_FIXED_NOREPLACE = 0x000C; - } -} - -pub const MODE_TYPE: u16 = 0xF000; -pub const MODE_DIR: u16 = 0x4000; -pub const MODE_FILE: u16 = 0x8000; -pub const MODE_SYMLINK: u16 = 0xA000; -pub const MODE_FIFO: u16 = 0x1000; -pub const MODE_CHR: u16 = 0x2000; - -pub const MODE_PERM: u16 = 0x0FFF; -pub const MODE_SETUID: u16 = 0o4000; -pub const MODE_SETGID: u16 = 0o2000; - -pub const O_RDONLY: usize = 0x0001_0000; -pub const O_WRONLY: usize = 0x0002_0000; -pub const O_RDWR: usize = 0x0003_0000; -pub const O_NONBLOCK: usize = 0x0004_0000; -pub const O_APPEND: usize = 0x0008_0000; -pub const O_SHLOCK: usize = 0x0010_0000; -pub const O_EXLOCK: usize = 0x0020_0000; -pub const O_ASYNC: usize = 0x0040_0000; -pub const O_FSYNC: usize = 0x0080_0000; -pub const O_CLOEXEC: usize = 0x0100_0000; -pub const O_CREAT: usize = 0x0200_0000; -pub const O_TRUNC: usize = 0x0400_0000; -pub const O_EXCL: usize = 0x0800_0000; -pub const O_DIRECTORY: usize = 0x1000_0000; -pub const O_STAT: usize = 0x2000_0000; -pub const O_SYMLINK: usize = 0x4000_0000; -pub const O_NOFOLLOW: usize = 0x8000_0000; -pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; - -bitflags! { - pub struct PhysmapFlags: usize { - const PHYSMAP_WRITE = 0x0000_0001; - const PHYSMAP_WRITE_COMBINE = 0x0000_0002; - const PHYSMAP_NO_CACHE = 0x0000_0004; - } -} -bitflags! { - /// Extra flags for [`physalloc2`] or [`physalloc3`]. - /// - /// [`physalloc2`]: ../call/fn.physalloc2.html - /// [`physalloc3`]: ../call/fn.physalloc3.html - pub struct PhysallocFlags: usize { - /// Only allocate memory within the 32-bit physical memory space. This is necessary for - /// some devices may not support 64-bit memory. - const SPACE_32 = 0x0000_0001; - - /// The frame that will be allocated, is going to reside anywhere in 64-bit space. This - /// flag is redundant for the most part, except when overriding some other default. - const SPACE_64 = 0x0000_0002; - - /// Do a "partial allocation", which means that not all of the frames specified in the - /// frame count `size` actually have to be allocated. This means that if the allocator was - /// unable to find a physical memory range large enough, it can instead return whatever - /// range it decides is optimal. Thus, instead of letting one driver get an expensive - /// 128MiB physical memory range when the physical memory has become fragmented, and - /// failing, it can instead be given a more optimal range. If the device supports - /// scatter-gather lists, then the driver only has to allocate more ranges, and the device - /// will do vectored I/O. - /// - /// PARTIAL_ALLOC supports different allocation strategies, refer to - /// [`Optimal`], [`GreatestRange`]. - /// - /// [`Optimal`]: ./enum.PartialAllocStrategy.html - /// [`GreatestRange`]: ./enum.PartialAllocStrategy.html - const PARTIAL_ALLOC = 0x0000_0004; - } -} - -/// The bitmask of the partial allocation strategy. Currently four different strategies are -/// supported. If [`PARTIAL_ALLOC`] is not set, this bitmask is no longer reserved. -pub const PARTIAL_ALLOC_STRATEGY_MASK: usize = 0x0003_0000; - -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] -#[repr(usize)] -pub enum PartialAllocStrategy { - /// The allocator decides itself the size of the memory range, based on e.g. free memory ranges - /// and other processes which require large physical memory chunks. - Optimal = 0x0001_0000, - - /// The allocator returns the absolute greatest range it can find. - GreatestRange = 0x0002_0000, - - /// The allocator returns the first range that fits the minimum count, without searching extra. - Greedy = 0x0003_0000, -} -impl Default for PartialAllocStrategy { - fn default() -> Self { - Self::Optimal - } -} - -impl PartialAllocStrategy { - pub fn from_raw(raw: usize) -> Option { - match raw { - 0x0001_0000 => Some(Self::Optimal), - 0x0002_0000 => Some(Self::GreatestRange), - 0x0003_0000 => Some(Self::Greedy), - _ => None, - } - } -} - -// The top 48 bits of PTRACE_* are reserved, for now - -bitflags! { - pub struct PtraceFlags: u64 { - /// Stop before a syscall is handled. Send PTRACE_FLAG_IGNORE to not - /// handle the syscall. - const PTRACE_STOP_PRE_SYSCALL = 0x0000_0000_0000_0001; - /// Stop after a syscall is handled. - const PTRACE_STOP_POST_SYSCALL = 0x0000_0000_0000_0002; - /// Stop after exactly one instruction. TODO: This may not handle - /// fexec/signal boundaries. Should it? - const PTRACE_STOP_SINGLESTEP = 0x0000_0000_0000_0004; - /// Stop before a signal is handled. Send PTRACE_FLAG_IGNORE to not - /// handle signal. - const PTRACE_STOP_SIGNAL = 0x0000_0000_0000_0008; - /// Stop on a software breakpoint, such as the int3 instruction for - /// x86_64. - const PTRACE_STOP_BREAKPOINT = 0x0000_0000_0000_0010; - /// Stop just before exiting for good. - const PTRACE_STOP_EXIT = 0x0000_0000_0000_0020; - - const PTRACE_STOP_MASK = 0x0000_0000_0000_00FF; - - - /// Sent when a child is cloned, giving you the opportunity to trace it. - /// If you don't catch this, the child is started as normal. - const PTRACE_EVENT_CLONE = 0x0000_0000_0000_0100; - - /// Sent when current-addrspace is changed, allowing the tracer to reopen the memory file. - const PTRACE_EVENT_ADDRSPACE_SWITCH = 0x0000_0000_0000_0200; - - const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00; - - /// Special meaning, depending on the event. Usually, when fired before - /// an action, it will skip performing that action. - const PTRACE_FLAG_IGNORE = 0x0000_0000_0000_1000; - - const PTRACE_FLAG_MASK = 0x0000_0000_0000_F000; - } -} -impl Deref for PtraceFlags { - type Target = [u8]; - fn deref(&self) -> &Self::Target { - // Same as to_ne_bytes but in-place - unsafe { - slice::from_raw_parts( - &self.bits as *const _ as *const u8, - mem::size_of::() - ) - } - } -} - -pub const SEEK_SET: usize = 0; -pub const SEEK_CUR: usize = 1; -pub const SEEK_END: usize = 2; - -pub const SIGHUP: usize = 1; -pub const SIGINT: usize = 2; -pub const SIGQUIT: usize = 3; -pub const SIGILL: usize = 4; -pub const SIGTRAP: usize = 5; -pub const SIGABRT: usize = 6; -pub const SIGBUS: usize = 7; -pub const SIGFPE: usize = 8; -pub const SIGKILL: usize = 9; -pub const SIGUSR1: usize = 10; -pub const SIGSEGV: usize = 11; -pub const SIGUSR2: usize = 12; -pub const SIGPIPE: usize = 13; -pub const SIGALRM: usize = 14; -pub const SIGTERM: usize = 15; -pub const SIGSTKFLT: usize= 16; -pub const SIGCHLD: usize = 17; -pub const SIGCONT: usize = 18; -pub const SIGSTOP: usize = 19; -pub const SIGTSTP: usize = 20; -pub const SIGTTIN: usize = 21; -pub const SIGTTOU: usize = 22; -pub const SIGURG: usize = 23; -pub const SIGXCPU: usize = 24; -pub const SIGXFSZ: usize = 25; -pub const SIGVTALRM: usize= 26; -pub const SIGPROF: usize = 27; -pub const SIGWINCH: usize = 28; -pub const SIGIO: usize = 29; -pub const SIGPWR: usize = 30; -pub const SIGSYS: usize = 31; - -pub const SIG_DFL: usize = 0; -pub const SIG_IGN: usize = 1; - -pub const SIG_BLOCK: usize = 0; -pub const SIG_UNBLOCK: usize = 1; -pub const SIG_SETMASK: usize = 2; - -bitflags! { - pub struct SigActionFlags: usize { - const SA_NOCLDSTOP = 0x00000001; - const SA_NOCLDWAIT = 0x00000002; - const SA_SIGINFO = 0x00000004; - const SA_RESTORER = 0x04000000; - const SA_ONSTACK = 0x08000000; - const SA_RESTART = 0x10000000; - const SA_NODEFER = 0x40000000; - const SA_RESETHAND = 0x80000000; - } -} - -bitflags! { - pub struct WaitFlags: usize { - const WNOHANG = 0x01; - const WUNTRACED = 0x02; - const WCONTINUED = 0x08; - } -} - -pub const ADDRSPACE_OP_MMAP: usize = 0; -pub const ADDRSPACE_OP_MUNMAP: usize = 1; -pub const ADDRSPACE_OP_MPROTECT: usize = 2; -pub const ADDRSPACE_OP_TRANSFER: usize = 3; - -/// True if status indicates the child is stopped. -pub fn wifstopped(status: usize) -> bool { - (status & 0xff) == 0x7f -} - -/// If wifstopped(status), the signal that stopped the child. -pub fn wstopsig(status: usize) -> usize { - (status >> 8) & 0xff -} - -/// True if status indicates the child continued after a stop. -pub fn wifcontinued(status: usize) -> bool { - status == 0xffff -} - -/// True if STATUS indicates termination by a signal. -pub fn wifsignaled(status: usize) -> bool { - ((status & 0x7f) + 1) as i8 >= 2 -} - -/// If wifsignaled(status), the terminating signal. -pub fn wtermsig(status: usize) -> usize { - status & 0x7f -} - -/// True if status indicates normal termination. -pub fn wifexited(status: usize) -> bool { - wtermsig(status) == 0 -} - -/// If wifexited(status), the exit status. -pub fn wexitstatus(status: usize) -> usize { - (status >> 8) & 0xff -} - -/// True if status indicates a core dump was created. -pub fn wcoredump(status: usize) -> bool { - (status & 0x80) != 0 -} diff --git a/vendor/redox_syscall-0.3.5/src/io/dma.rs b/vendor/redox_syscall-0.3.5/src/io/dma.rs deleted file mode 100644 index 0613fc9fc..000000000 --- a/vendor/redox_syscall-0.3.5/src/io/dma.rs +++ /dev/null @@ -1,219 +0,0 @@ -use core::mem::{self, MaybeUninit}; -use core::ops::{Deref, DerefMut}; -use core::{ptr, slice}; - -use crate::Result; -use crate::{PartialAllocStrategy, PhysallocFlags, PhysmapFlags}; -use crate::arch::PAGE_SIZE; - -/// An RAII guard of a physical memory allocation. Currently all physically allocated memory are -/// page-aligned and take up at least 4k of space (on x86_64). -#[derive(Debug)] -pub struct PhysBox { - address: usize, - size: usize -} - -const fn round_up(x: usize) -> usize { - (x + PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE -} -fn assert_aligned(x: usize) { - assert_eq!(x % PAGE_SIZE, 0); -} - -#[cfg(target_arch = "aarch64")] -fn physmap_flags() -> PhysmapFlags { - // aarch64 currently must map DMA memory without caching to ensure coherence - crate::PHYSMAP_NO_CACHE | crate::PHYSMAP_WRITE -} - -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -fn physmap_flags() -> PhysmapFlags { - // x86 ensures cache coherence with DMA memory - crate::PHYSMAP_WRITE -} - -impl PhysBox { - /// Construct a PhysBox from an address and a size. The address must be page-aligned, and the - /// size must similarly be a multiple of the page size. - /// - /// # Safety - /// This function is unsafe because when dropping, Self has to a valid allocation. - pub unsafe fn from_raw_parts(address: usize, size: usize) -> Self { - assert_aligned(address); - assert_aligned(size); - - Self { - address, - size, - } - } - - /// Retrieve the byte address in physical memory, of this allocation. - pub fn address(&self) -> usize { - self.address - } - - /// Retrieve the size in bytes of the alloc. - pub fn size(&self) -> usize { - self.size - } - - /// Allocate physical memory that must reside in 32-bit space. - pub fn new_in_32bit_space(size: usize) -> Result { - Self::new_with_flags(size, PhysallocFlags::SPACE_32) - } - - pub fn new_with_flags(size: usize, flags: PhysallocFlags) -> Result { - assert!(!flags.contains(PhysallocFlags::PARTIAL_ALLOC)); - assert_aligned(size); - - let address = unsafe { crate::physalloc2(size, flags.bits())? }; - Ok(unsafe { Self::from_raw_parts(address, size) }) - } - - /// "Partially" allocate physical memory, in the sense that the allocation may be smaller than - /// expected, but still with a minimum limit. This is particularly useful when the physical - /// memory space is fragmented, and a device supports scatter-gather I/O. In that case, the - /// driver can optimistically request e.g. 1 alloc of 1 MiB, with the minimum of 512 KiB. If - /// that first allocation only returns half the size, the driver can do another allocation - /// and then let the device use both buffers. - pub fn new_partial_allocation(size: usize, flags: PhysallocFlags, strategy: Option, mut min: usize) -> Result { - assert_aligned(size); - debug_assert!(!(flags.contains(PhysallocFlags::PARTIAL_ALLOC) && strategy.is_none())); - - let address = unsafe { crate::physalloc3(size, flags.bits() | strategy.map_or(0, |s| s as usize), &mut min)? }; - Ok(unsafe { Self::from_raw_parts(address, size) }) - } - - pub fn new(size: usize) -> Result { - assert_aligned(size); - - let address = unsafe { crate::physalloc(size)? }; - Ok(unsafe { Self::from_raw_parts(address, size) }) - } -} - -impl Drop for PhysBox { - fn drop(&mut self) { - let _ = unsafe { crate::physfree(self.address, self.size) }; - } -} - -pub struct Dma { - phys: PhysBox, - virt: *mut T, -} - -impl Dma { - pub fn from_physbox_uninit(phys: PhysBox) -> Result>> { - let virt = unsafe { crate::physmap(phys.address, phys.size, physmap_flags())? } as *mut MaybeUninit; - - Ok(Dma { - phys, - virt, - }) - } - pub fn from_physbox_zeroed(phys: PhysBox) -> Result>> { - let this = Self::from_physbox_uninit(phys)?; - unsafe { ptr::write_bytes(this.virt as *mut MaybeUninit, 0, this.phys.size) } - Ok(this) - } - - pub fn from_physbox(phys: PhysBox, value: T) -> Result { - let this = Self::from_physbox_uninit(phys)?; - - Ok(unsafe { - ptr::write(this.virt, MaybeUninit::new(value)); - this.assume_init() - }) - } - - pub fn new(value: T) -> Result { - let phys = PhysBox::new(round_up(mem::size_of::()))?; - Self::from_physbox(phys, value) - } - pub fn zeroed() -> Result>> { - let phys = PhysBox::new(round_up(mem::size_of::()))?; - Self::from_physbox_zeroed(phys) - } -} - -impl Dma> { - pub unsafe fn assume_init(self) -> Dma { - let &Dma { phys: PhysBox { address, size }, virt } = &self; - mem::forget(self); - - Dma { - phys: PhysBox { address, size }, - virt: virt as *mut T, - } - } -} -impl Dma { - pub fn physical(&self) -> usize { - self.phys.address() - } - pub fn size(&self) -> usize { - self.phys.size() - } - pub fn phys(&self) -> &PhysBox { - &self.phys - } -} - -impl Dma<[T]> { - pub fn from_physbox_uninit_unsized(phys: PhysBox, len: usize) -> Result]>> { - let max_len = phys.size() / mem::size_of::(); - assert!(len <= max_len); - - Ok(Dma { - virt: unsafe { slice::from_raw_parts_mut(crate::physmap(phys.address, phys.size, physmap_flags())? as *mut MaybeUninit, len) } as *mut [MaybeUninit], - phys, - }) - } - pub fn from_physbox_zeroed_unsized(phys: PhysBox, len: usize) -> Result]>> { - let this = Self::from_physbox_uninit_unsized(phys, len)?; - unsafe { ptr::write_bytes(this.virt as *mut MaybeUninit, 0, this.phys.size()) } - Ok(this) - } - /// Creates a new DMA buffer with a size only known at runtime. - /// ## Safety - /// * `T` must be properly aligned. - /// * `T` must be valid as zeroed (i.e. no NonNull pointers). - pub unsafe fn zeroed_unsized(count: usize) -> Result { - let phys = PhysBox::new(round_up(mem::size_of::() * count))?; - Ok(Self::from_physbox_zeroed_unsized(phys, count)?.assume_init()) - } -} -impl Dma<[MaybeUninit]> { - pub unsafe fn assume_init(self) -> Dma<[T]> { - let &Dma { phys: PhysBox { address, size }, virt } = &self; - mem::forget(self); - - Dma { - phys: PhysBox { address, size }, - virt: virt as *mut [T], - } - } -} - -impl Deref for Dma { - type Target = T; - fn deref(&self) -> &T { - unsafe { &*self.virt } - } -} - -impl DerefMut for Dma { - fn deref_mut(&mut self) -> &mut T { - unsafe { &mut *self.virt } - } -} - -impl Drop for Dma { - fn drop(&mut self) { - unsafe { ptr::drop_in_place(self.virt) } - let _ = unsafe { crate::funmap(self.virt as *mut u8 as usize, self.phys.size) }; - } -} diff --git a/vendor/redox_syscall-0.3.5/src/io/io.rs b/vendor/redox_syscall-0.3.5/src/io/io.rs deleted file mode 100644 index 2c4acd388..000000000 --- a/vendor/redox_syscall-0.3.5/src/io/io.rs +++ /dev/null @@ -1,71 +0,0 @@ -use core::cmp::PartialEq; -use core::ops::{BitAnd, BitOr, Not}; - -pub trait Io { - type Value: Copy + PartialEq + BitAnd + BitOr + Not; - - fn read(&self) -> Self::Value; - fn write(&mut self, value: Self::Value); - - #[inline(always)] - fn readf(&self, flags: Self::Value) -> bool { - (self.read() & flags) as Self::Value == flags - } - - #[inline(always)] - fn writef(&mut self, flags: Self::Value, value: bool) { - let tmp: Self::Value = match value { - true => self.read() | flags, - false => self.read() & !flags, - }; - self.write(tmp); - } -} - -pub struct ReadOnly { - inner: I -} - -impl ReadOnly { - pub const fn new(inner: I) -> ReadOnly { - ReadOnly { - inner: inner - } - } -} - -impl ReadOnly { - #[inline(always)] - pub fn read(&self) -> I::Value { - self.inner.read() - } - - #[inline(always)] - pub fn readf(&self, flags: I::Value) -> bool { - self.inner.readf(flags) - } -} - -pub struct WriteOnly { - inner: I -} - -impl WriteOnly { - pub const fn new(inner: I) -> WriteOnly { - WriteOnly { - inner: inner - } - } -} - -impl WriteOnly { - #[inline(always)] - pub fn write(&mut self, value: I::Value) { - self.inner.write(value) - } - - #[inline(always)] - pub fn writef(&mut self, flags: I::Value, value: bool) { - self.inner.writef(flags, value) - } -} diff --git a/vendor/redox_syscall-0.3.5/src/io/mmio.rs b/vendor/redox_syscall-0.3.5/src/io/mmio.rs deleted file mode 100644 index 3966ab454..000000000 --- a/vendor/redox_syscall-0.3.5/src/io/mmio.rs +++ /dev/null @@ -1,45 +0,0 @@ -use core::ptr::{read_volatile, write_volatile, addr_of, addr_of_mut}; -use core::mem::MaybeUninit; -use core::ops::{BitAnd, BitOr, Not}; - -use super::io::Io; - -#[repr(packed)] -pub struct Mmio { - value: MaybeUninit, -} - -impl Mmio { - /// Create a new Mmio without initializing - #[deprecated = "unsound because it's possible to read even though it's uninitialized"] - pub fn new() -> Self { - unsafe { Self::uninit() } - } - pub unsafe fn zeroed() -> Self { - Self { - value: MaybeUninit::zeroed(), - } - } - pub unsafe fn uninit() -> Self { - Self { - value: MaybeUninit::uninit(), - } - } - pub const fn from(value: T) -> Self { - Self { - value: MaybeUninit::new(value), - } - } -} - -impl Io for Mmio where T: Copy + PartialEq + BitAnd + BitOr + Not { - type Value = T; - - fn read(&self) -> T { - unsafe { read_volatile(addr_of!(self.value).cast::()) } - } - - fn write(&mut self, value: T) { - unsafe { write_volatile(addr_of_mut!(self.value).cast::(), value) }; - } -} diff --git a/vendor/redox_syscall-0.3.5/src/io/mod.rs b/vendor/redox_syscall-0.3.5/src/io/mod.rs deleted file mode 100644 index a225f0650..000000000 --- a/vendor/redox_syscall-0.3.5/src/io/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -//! I/O functions - -pub use self::dma::*; -pub use self::io::*; -pub use self::mmio::*; - -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -pub use self::pio::*; - -mod dma; -mod io; -mod mmio; - -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -mod pio; diff --git a/vendor/redox_syscall-0.3.5/src/io/pio.rs b/vendor/redox_syscall-0.3.5/src/io/pio.rs deleted file mode 100644 index 8b837bcdf..000000000 --- a/vendor/redox_syscall-0.3.5/src/io/pio.rs +++ /dev/null @@ -1,90 +0,0 @@ -use core::arch::asm; -use core::marker::PhantomData; - -use super::io::Io; - -/// Generic PIO -#[derive(Copy, Clone)] -pub struct Pio { - port: u16, - value: PhantomData, -} - -impl Pio { - /// Create a PIO from a given port - pub const fn new(port: u16) -> Self { - Pio:: { - port, - value: PhantomData, - } - } -} - -/// Read/Write for byte PIO -impl Io for Pio { - type Value = u8; - - /// Read - #[inline(always)] - fn read(&self) -> u8 { - let value: u8; - unsafe { - asm!("in al, dx", in("dx") self.port, out("al") value, options(nostack, nomem, preserves_flags)); - } - value - } - - /// Write - #[inline(always)] - fn write(&mut self, value: u8) { - unsafe { - asm!("out dx, al", in("dx") self.port, in("al") value, options(nostack, nomem, preserves_flags)); - } - } -} - -/// Read/Write for word PIO -impl Io for Pio { - type Value = u16; - - /// Read - #[inline(always)] - fn read(&self) -> u16 { - let value: u16; - unsafe { - asm!("in ax, dx", in("dx") self.port, out("ax") value, options(nostack, nomem, preserves_flags)); - } - value - } - - /// Write - #[inline(always)] - fn write(&mut self, value: u16) { - unsafe { - asm!("out dx, ax", in("dx") self.port, in("ax") value, options(nostack, nomem, preserves_flags)); - } - } -} - -/// Read/Write for doubleword PIO -impl Io for Pio { - type Value = u32; - - /// Read - #[inline(always)] - fn read(&self) -> u32 { - let value: u32; - unsafe { - asm!("in eax, dx", in("dx") self.port, out("eax") value, options(nostack, nomem, preserves_flags)); - } - value - } - - /// Write - #[inline(always)] - fn write(&mut self, value: u32) { - unsafe { - asm!("out dx, eax", in("dx") self.port, in("eax") value, options(nostack, nomem, preserves_flags)); - } - } -} diff --git a/vendor/redox_syscall-0.3.5/src/lib.rs b/vendor/redox_syscall-0.3.5/src/lib.rs deleted file mode 100644 index 3f6d88479..000000000 --- a/vendor/redox_syscall-0.3.5/src/lib.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![cfg_attr(not(test), no_std)] - -#[cfg(test)] -extern crate core; - -pub use self::arch::*; -pub use self::call::*; -pub use self::data::*; -pub use self::error::*; -pub use self::flag::*; -pub use self::io::*; -pub use self::number::*; -pub use self::scheme::*; - -#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "arm"))] -#[path="arch/nonredox.rs"] -mod arch; - -#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "aarch64"))] -#[path="arch/aarch64.rs"] -mod arch; - -#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "riscv64"))] -#[path="arch/riscv64.rs"] -mod arch; - -#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "x86"))] -#[path="arch/x86.rs"] -mod arch; - -#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "x86_64"))] -#[path="arch/x86_64.rs"] -mod arch; - -#[cfg(not(any(target_os = "none", target_os = "redox")))] -#[path="arch/nonredox.rs"] -mod arch; - -/// Function definitions -pub mod call; - -/// Complex structures that are used for some system calls -pub mod data; - -/// All errors that can be generated by a system call -pub mod error; - -/// Flags used as an argument to many system calls -pub mod flag; - -/// Functions for low level hardware control -pub mod io; - -/// Call numbers used by each system call -pub mod number; - -/// A trait useful for scheme handlers -pub mod scheme; - -#[cfg(test)] -mod tests; diff --git a/vendor/redox_syscall-0.3.5/src/number.rs b/vendor/redox_syscall-0.3.5/src/number.rs deleted file mode 100644 index 2b9205a26..000000000 --- a/vendor/redox_syscall-0.3.5/src/number.rs +++ /dev/null @@ -1,73 +0,0 @@ -pub const SYS_CLASS: usize = 0xF000_0000; -pub const SYS_CLASS_PATH: usize=0x1000_0000; -pub const SYS_CLASS_FILE: usize=0x2000_0000; - -pub const SYS_ARG: usize = 0x0F00_0000; -pub const SYS_ARG_SLICE: usize =0x0100_0000; -pub const SYS_ARG_MSLICE: usize=0x0200_0000; -pub const SYS_ARG_PATH: usize = 0x0300_0000; - -pub const SYS_RET: usize = 0x00F0_0000; -pub const SYS_RET_FILE: usize = 0x0010_0000; - -pub const SYS_LINK: usize = SYS_CLASS_PATH | SYS_ARG_PATH | 9; -pub const SYS_OPEN: usize = SYS_CLASS_PATH | SYS_RET_FILE | 5; -pub const SYS_RMDIR: usize = SYS_CLASS_PATH | 84; -pub const SYS_UNLINK: usize = SYS_CLASS_PATH | 10; - -pub const SYS_CLOSE: usize = SYS_CLASS_FILE | 6; -pub const SYS_DUP: usize = SYS_CLASS_FILE | SYS_RET_FILE | 41; -pub const SYS_DUP2: usize = SYS_CLASS_FILE | SYS_RET_FILE | 63; -pub const SYS_READ: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 3; -pub const SYS_WRITE: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 4; -pub const SYS_LSEEK: usize = SYS_CLASS_FILE | 19; -pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94; -pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207; -pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55; -pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927; -pub const SYS_FMAP_OLD: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 90; -pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 900; -pub const SYS_FUNMAP_OLD: usize = SYS_CLASS_FILE | 91; -pub const SYS_FUNMAP: usize = SYS_CLASS_FILE | 92; -pub const SYS_FPATH: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 928; -pub const SYS_FRENAME: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 38; -pub const SYS_FSTAT: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 28; -pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 100; -pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118; -pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 93; -pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320; - -pub const SYS_CLOCK_GETTIME: usize = 265; -pub const SYS_EXIT: usize = 1; -pub const SYS_FUTEX: usize = 240; -pub const SYS_GETEGID: usize = 202; -pub const SYS_GETENS: usize = 951; -pub const SYS_GETEUID: usize = 201; -pub const SYS_GETGID: usize = 200; -pub const SYS_GETNS: usize = 950; -pub const SYS_GETPID: usize = 20; -pub const SYS_GETPGID: usize = 132; -pub const SYS_GETPPID: usize = 64; -pub const SYS_GETUID: usize = 199; -pub const SYS_IOPL: usize = 110; -pub const SYS_KILL: usize = 37; -pub const SYS_MPROTECT: usize = 125; -pub const SYS_MKNS: usize = 984; -pub const SYS_NANOSLEEP: usize =162; -pub const SYS_PHYSALLOC: usize =945; -pub const SYS_PHYSALLOC3: usize=9453; -pub const SYS_PHYSFREE: usize = 946; -pub const SYS_PHYSMAP: usize = 947; -pub const SYS_PHYSUNMAP: usize =948; -pub const SYS_VIRTTOPHYS: usize=949; -pub const SYS_PIPE2: usize = 331; -pub const SYS_SETPGID: usize = 57; -pub const SYS_SETREGID: usize = 204; -pub const SYS_SETRENS: usize = 952; -pub const SYS_SETREUID: usize = 203; -pub const SYS_SIGACTION: usize =67; -pub const SYS_SIGPROCMASK:usize=126; -pub const SYS_SIGRETURN: usize =119; -pub const SYS_UMASK: usize = 60; -pub const SYS_WAITPID: usize = 7; -pub const SYS_YIELD: usize = 158; diff --git a/vendor/redox_syscall-0.3.5/src/scheme/generate.sh b/vendor/redox_syscall-0.3.5/src/scheme/generate.sh deleted file mode 100755 index a877cda92..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/generate.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo "Generating SchemeMut from Scheme" -sed 's/trait Scheme/trait SchemeMut/' scheme.rs \ -| sed 's/\&self/\&mut self/g' \ -> scheme_mut.rs - -echo "Generating SchemeBlock from Scheme" -sed 's/trait Scheme/trait SchemeBlock/' scheme.rs \ -| sed 's/fn handle(\&self, packet: \&mut Packet)/fn handle(\&self, packet: \&Packet) -> Option/' \ -| sed 's/packet.a = Error::mux(res);/res.transpose().map(Error::mux)/' \ -| sed 's/\.map(|f| f\.bits())/\.map(|f| f.map(|f| f.bits()))/' \ -| sed 's/\.map(|o| o as usize)/.map(|o| o.map(|o| o as usize))/' \ -| sed 's/Ok(0)/Ok(Some(0))/g' \ -| sed 's/Result<\([^>]\+\)>/Result>/g' \ -> scheme_block.rs - -echo "Generating SchemeBlockMut from SchemeBlock" -sed 's/trait SchemeBlock/trait SchemeBlockMut/' scheme_block.rs \ -| sed 's/\&self/\&mut self/g' \ -> scheme_block_mut.rs diff --git a/vendor/redox_syscall-0.3.5/src/scheme/mod.rs b/vendor/redox_syscall-0.3.5/src/scheme/mod.rs deleted file mode 100644 index f65d1e2c0..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -use core::{slice, str}; - -pub use self::scheme::Scheme; -pub use self::scheme_mut::SchemeMut; -pub use self::scheme_block::SchemeBlock; -pub use self::scheme_block_mut::SchemeBlockMut; -pub use self::seek::*; - -unsafe fn str_from_raw_parts(ptr: *const u8, len: usize) -> Option<&'static str> { - let slice = slice::from_raw_parts(ptr, len); - str::from_utf8(slice).ok() -} - -mod scheme; -mod scheme_mut; -mod scheme_block; -mod scheme_block_mut; -mod seek; diff --git a/vendor/redox_syscall-0.3.5/src/scheme/scheme.rs b/vendor/redox_syscall-0.3.5/src/scheme/scheme.rs deleted file mode 100644 index 6bf36172c..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/scheme.rs +++ /dev/null @@ -1,206 +0,0 @@ -use core::{mem, slice}; - -use crate::data::*; -use crate::error::*; -use crate::flag::*; -use crate::number::*; -use crate::scheme::str_from_raw_parts; - -pub trait Scheme { - fn handle(&self, packet: &mut Packet) { - let res = match packet.a { - SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.open(path, packet.d, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.rmdir(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.unlink(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - - SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o as usize), - SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), - SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), - SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.bits()), - SYS_FMAP_OLD => if packet.d >= mem::size_of::() { - self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FMAP => if packet.d >= mem::size_of::() { - self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FUNMAP_OLD => self.funmap_old(packet.b), - SYS_FUNMAP => self.funmap(packet.b, packet.c), - SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { - self.frename(packet.b, path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_FSTAT => if packet.d >= mem::size_of::() { - self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSTATVFS => if packet.d >= mem::size_of::() { - self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSYNC => self.fsync(packet.b), - SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), - SYS_FUTIMENS => if packet.d >= mem::size_of::() { - self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_CLOSE => self.close(packet.b), - _ => Err(Error::new(ENOSYS)) - }; - - packet.a = Error::mux(res); - } - - /* Scheme operations */ - - #[allow(unused_variables)] - fn open(&self, path: &str, flags: usize, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn chmod(&self, path: &str, mode: u16, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn rmdir(&self, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn unlink(&self, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - /* Resource operations */ - #[allow(unused_variables)] - fn dup(&self, old_id: usize, buf: &[u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn read(&self, id: usize, buf: &mut [u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn write(&self, id: usize, buf: &[u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn seek(&self, id: usize, pos: isize, whence: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchmod(&self, id: usize, mode: u16) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchown(&self, id: usize, uid: u32, gid: u32) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fcntl(&self, id: usize, cmd: usize, arg: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fevent(&self, id: usize, flags: EventFlags) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fmap_old(&self, id: usize, map: &OldMap) -> Result { - Err(Error::new(EBADF)) - } - #[allow(unused_variables)] - fn fmap(&self, id: usize, map: &Map) -> Result { - if map.flags.contains(MapFlags::MAP_FIXED) { - return Err(Error::new(EINVAL)); - } - self.fmap_old(id, &OldMap { - offset: map.offset, - size: map.size, - flags: map.flags, - }) - } - - #[allow(unused_variables)] - fn funmap_old(&self, address: usize) -> Result { - Ok(0) - } - - #[allow(unused_variables)] - fn funmap(&self, address: usize, length: usize) -> Result { - Ok(0) - } - - #[allow(unused_variables)] - fn fpath(&self, id: usize, buf: &mut [u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn frename(&self, id: usize, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstat(&self, id: usize, stat: &mut Stat) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstatvfs(&self, id: usize, stat: &mut StatVfs) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fsync(&self, id: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn ftruncate(&self, id: usize, len: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn futimens(&self, id: usize, times: &[TimeSpec]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn close(&self, id: usize) -> Result { - Err(Error::new(EBADF)) - } -} diff --git a/vendor/redox_syscall-0.3.5/src/scheme/scheme_block.rs b/vendor/redox_syscall-0.3.5/src/scheme/scheme_block.rs deleted file mode 100644 index 3b3de4bc9..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/scheme_block.rs +++ /dev/null @@ -1,206 +0,0 @@ -use core::{mem, slice}; - -use crate::data::*; -use crate::error::*; -use crate::flag::*; -use crate::number::*; -use crate::scheme::str_from_raw_parts; - -pub trait SchemeBlock { - fn handle(&self, packet: &Packet) -> Option { - let res = match packet.a { - SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.open(path, packet.d, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.rmdir(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.unlink(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - - SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o.map(|o| o as usize)), - SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), - SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), - SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.map(|f| f.bits())), - SYS_FMAP_OLD => if packet.d >= mem::size_of::() { - self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FMAP => if packet.d >= mem::size_of::() { - self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FUNMAP_OLD => self.funmap_old(packet.b), - SYS_FUNMAP => self.funmap(packet.b, packet.c), - SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { - self.frename(packet.b, path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_FSTAT => if packet.d >= mem::size_of::() { - self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSTATVFS => if packet.d >= mem::size_of::() { - self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSYNC => self.fsync(packet.b), - SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), - SYS_FUTIMENS => if packet.d >= mem::size_of::() { - self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_CLOSE => self.close(packet.b), - _ => Err(Error::new(ENOSYS)) - }; - - res.transpose().map(Error::mux) - } - - /* Scheme operations */ - - #[allow(unused_variables)] - fn open(&self, path: &str, flags: usize, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn chmod(&self, path: &str, mode: u16, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn rmdir(&self, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn unlink(&self, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - /* Resource operations */ - #[allow(unused_variables)] - fn dup(&self, old_id: usize, buf: &[u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn read(&self, id: usize, buf: &mut [u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn write(&self, id: usize, buf: &[u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn seek(&self, id: usize, pos: isize, whence: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchmod(&self, id: usize, mode: u16) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchown(&self, id: usize, uid: u32, gid: u32) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fcntl(&self, id: usize, cmd: usize, arg: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fevent(&self, id: usize, flags: EventFlags) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fmap_old(&self, id: usize, map: &OldMap) -> Result> { - Err(Error::new(EBADF)) - } - #[allow(unused_variables)] - fn fmap(&self, id: usize, map: &Map) -> Result> { - if map.flags.contains(MapFlags::MAP_FIXED) { - return Err(Error::new(EINVAL)); - } - self.fmap_old(id, &OldMap { - offset: map.offset, - size: map.size, - flags: map.flags, - }) - } - - #[allow(unused_variables)] - fn funmap_old(&self, address: usize) -> Result> { - Ok(Some(0)) - } - - #[allow(unused_variables)] - fn funmap(&self, address: usize, length: usize) -> Result> { - Ok(Some(0)) - } - - #[allow(unused_variables)] - fn fpath(&self, id: usize, buf: &mut [u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn frename(&self, id: usize, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstat(&self, id: usize, stat: &mut Stat) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstatvfs(&self, id: usize, stat: &mut StatVfs) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fsync(&self, id: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn ftruncate(&self, id: usize, len: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn futimens(&self, id: usize, times: &[TimeSpec]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn close(&self, id: usize) -> Result> { - Err(Error::new(EBADF)) - } -} diff --git a/vendor/redox_syscall-0.3.5/src/scheme/scheme_block_mut.rs b/vendor/redox_syscall-0.3.5/src/scheme/scheme_block_mut.rs deleted file mode 100644 index 1fae3a0e5..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/scheme_block_mut.rs +++ /dev/null @@ -1,206 +0,0 @@ -use core::{mem, slice}; - -use crate::data::*; -use crate::error::*; -use crate::flag::*; -use crate::number::*; -use crate::scheme::str_from_raw_parts; - -pub trait SchemeBlockMut { - fn handle(&mut self, packet: &Packet) -> Option { - let res = match packet.a { - SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.open(path, packet.d, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.rmdir(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.unlink(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - - SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o.map(|o| o as usize)), - SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), - SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), - SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.map(|f| f.bits())), - SYS_FMAP_OLD => if packet.d >= mem::size_of::() { - self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FMAP => if packet.d >= mem::size_of::() { - self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FUNMAP_OLD => self.funmap_old(packet.b), - SYS_FUNMAP => self.funmap(packet.b, packet.c), - SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { - self.frename(packet.b, path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_FSTAT => if packet.d >= mem::size_of::() { - self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSTATVFS => if packet.d >= mem::size_of::() { - self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSYNC => self.fsync(packet.b), - SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), - SYS_FUTIMENS => if packet.d >= mem::size_of::() { - self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_CLOSE => self.close(packet.b), - _ => Err(Error::new(ENOSYS)) - }; - - res.transpose().map(Error::mux) - } - - /* Scheme operations */ - - #[allow(unused_variables)] - fn open(&mut self, path: &str, flags: usize, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn chmod(&mut self, path: &str, mode: u16, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn rmdir(&mut self, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn unlink(&mut self, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(ENOENT)) - } - - /* Resource operations */ - #[allow(unused_variables)] - fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn read(&mut self, id: usize, buf: &mut [u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn write(&mut self, id: usize, buf: &[u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn seek(&mut self, id: usize, pos: isize, whence: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchmod(&mut self, id: usize, mode: u16) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchown(&mut self, id: usize, uid: u32, gid: u32) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fcntl(&mut self, id: usize, cmd: usize, arg: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fevent(&mut self, id: usize, flags: EventFlags) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fmap_old(&mut self, id: usize, map: &OldMap) -> Result> { - Err(Error::new(EBADF)) - } - #[allow(unused_variables)] - fn fmap(&mut self, id: usize, map: &Map) -> Result> { - if map.flags.contains(MapFlags::MAP_FIXED) { - return Err(Error::new(EINVAL)); - } - self.fmap_old(id, &OldMap { - offset: map.offset, - size: map.size, - flags: map.flags, - }) - } - - #[allow(unused_variables)] - fn funmap_old(&mut self, address: usize) -> Result> { - Ok(Some(0)) - } - - #[allow(unused_variables)] - fn funmap(&mut self, address: usize, length: usize) -> Result> { - Ok(Some(0)) - } - - #[allow(unused_variables)] - fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn frename(&mut self, id: usize, path: &str, uid: u32, gid: u32) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstat(&mut self, id: usize, stat: &mut Stat) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstatvfs(&mut self, id: usize, stat: &mut StatVfs) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fsync(&mut self, id: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn ftruncate(&mut self, id: usize, len: usize) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn futimens(&mut self, id: usize, times: &[TimeSpec]) -> Result> { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn close(&mut self, id: usize) -> Result> { - Err(Error::new(EBADF)) - } -} diff --git a/vendor/redox_syscall-0.3.5/src/scheme/scheme_mut.rs b/vendor/redox_syscall-0.3.5/src/scheme/scheme_mut.rs deleted file mode 100644 index b364b62aa..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/scheme_mut.rs +++ /dev/null @@ -1,206 +0,0 @@ -use core::{mem, slice}; - -use crate::data::*; -use crate::error::*; -use crate::flag::*; -use crate::number::*; -use crate::scheme::str_from_raw_parts; - -pub trait SchemeMut { - fn handle(&mut self, packet: &mut Packet) { - let res = match packet.a { - SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.open(path, packet.d, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.rmdir(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { - self.unlink(path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - - SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o as usize), - SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), - SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), - SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.bits()), - SYS_FMAP_OLD => if packet.d >= mem::size_of::() { - self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FMAP => if packet.d >= mem::size_of::() { - self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FUNMAP_OLD => self.funmap_old(packet.b), - SYS_FUNMAP => self.funmap(packet.b, packet.c), - SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { - self.frename(packet.b, path, packet.uid, packet.gid) - } else { - Err(Error::new(EINVAL)) - }, - SYS_FSTAT => if packet.d >= mem::size_of::() { - self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSTATVFS => if packet.d >= mem::size_of::() { - self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_FSYNC => self.fsync(packet.b), - SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), - SYS_FUTIMENS => if packet.d >= mem::size_of::() { - self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) - } else { - Err(Error::new(EFAULT)) - }, - SYS_CLOSE => self.close(packet.b), - _ => Err(Error::new(ENOSYS)) - }; - - packet.a = Error::mux(res); - } - - /* Scheme operations */ - - #[allow(unused_variables)] - fn open(&mut self, path: &str, flags: usize, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn chmod(&mut self, path: &str, mode: u16, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn rmdir(&mut self, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - #[allow(unused_variables)] - fn unlink(&mut self, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - - /* Resource operations */ - #[allow(unused_variables)] - fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn read(&mut self, id: usize, buf: &mut [u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn write(&mut self, id: usize, buf: &[u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn seek(&mut self, id: usize, pos: isize, whence: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchmod(&mut self, id: usize, mode: u16) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fchown(&mut self, id: usize, uid: u32, gid: u32) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fcntl(&mut self, id: usize, cmd: usize, arg: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fevent(&mut self, id: usize, flags: EventFlags) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fmap_old(&mut self, id: usize, map: &OldMap) -> Result { - Err(Error::new(EBADF)) - } - #[allow(unused_variables)] - fn fmap(&mut self, id: usize, map: &Map) -> Result { - if map.flags.contains(MapFlags::MAP_FIXED) { - return Err(Error::new(EINVAL)); - } - self.fmap_old(id, &OldMap { - offset: map.offset, - size: map.size, - flags: map.flags, - }) - } - - #[allow(unused_variables)] - fn funmap_old(&mut self, address: usize) -> Result { - Ok(0) - } - - #[allow(unused_variables)] - fn funmap(&mut self, address: usize, length: usize) -> Result { - Ok(0) - } - - #[allow(unused_variables)] - fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn frename(&mut self, id: usize, path: &str, uid: u32, gid: u32) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstat(&mut self, id: usize, stat: &mut Stat) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fstatvfs(&mut self, id: usize, stat: &mut StatVfs) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn fsync(&mut self, id: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn ftruncate(&mut self, id: usize, len: usize) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn futimens(&mut self, id: usize, times: &[TimeSpec]) -> Result { - Err(Error::new(EBADF)) - } - - #[allow(unused_variables)] - fn close(&mut self, id: usize) -> Result { - Err(Error::new(EBADF)) - } -} diff --git a/vendor/redox_syscall-0.3.5/src/scheme/seek.rs b/vendor/redox_syscall-0.3.5/src/scheme/seek.rs deleted file mode 100644 index 09a45186a..000000000 --- a/vendor/redox_syscall-0.3.5/src/scheme/seek.rs +++ /dev/null @@ -1,33 +0,0 @@ -use core::cmp; -use core::convert::TryFrom; -use crate::error::*; -use crate::flag::*; - -/// Helper for seek calls -/// In most cases it's easier to use a usize to track the offset and buffer size internally, -/// but the seek interface uses isize. This wrapper ensures EOVERFLOW errors are returned -/// as appropriate if the value in the usize can't fit in the isize. -pub fn calc_seek_offset_usize(cur_offset: usize, pos: isize, whence: usize, buf_len: usize) -> Result { - let cur_offset = isize::try_from(cur_offset).or_else(|_| Err(Error::new(EOVERFLOW)))?; - let buf_len = isize::try_from(buf_len).or_else(|_| Err(Error::new(EOVERFLOW)))?; - calc_seek_offset_isize(cur_offset, pos, whence, buf_len) -} - -/// Helper for seek calls -/// Result is guaranteed to be positive. -/// EOVERFLOW returned if the arguments would cause an overflow. -/// EINVAL returned if the new offset is out of bounds. -pub fn calc_seek_offset_isize(cur_offset: isize, pos: isize, whence: usize, buf_len: isize) -> Result { - let new_offset = match whence { - SEEK_CUR => pos.checked_add(cur_offset), - SEEK_END => pos.checked_add(buf_len), - SEEK_SET => Some(pos), - _ => None, - }; - - match new_offset { - Some(new_offset) if new_offset < 0 => Err(Error::new(EINVAL)), - Some(new_offset) => Ok(cmp::min(new_offset, buf_len)), - None => Err(Error::new(EOVERFLOW)) - } -} \ No newline at end of file diff --git a/vendor/redox_syscall-0.3.5/src/tests.rs b/vendor/redox_syscall-0.3.5/src/tests.rs deleted file mode 100644 index fdff89b4b..000000000 --- a/vendor/redox_syscall-0.3.5/src/tests.rs +++ /dev/null @@ -1,442 +0,0 @@ -#[test] -fn clone() { - let expected_status = 42; - let pid_res = unsafe { crate::clone(crate::CloneFlags::empty()) }; - if pid_res == Ok(0) { - crate::exit(expected_status).unwrap(); - panic!("failed to exit"); - } else { - let pid = dbg!(pid_res).unwrap(); - let mut status = 0; - assert_eq!(dbg!(crate::waitpid(pid, &mut status, crate::WaitFlags::empty())), Ok(pid)); - assert_eq!(dbg!(crate::wifexited(status)), true); - assert_eq!(dbg!(crate::wexitstatus(status)), expected_status); - } -} - -//TODO: close - -#[test] -fn clock_gettime() { - let mut tp = crate::TimeSpec::default(); - assert_eq!(dbg!( - crate::clock_gettime(crate::CLOCK_MONOTONIC, &mut tp) - ), Ok(0)); - assert_ne!(dbg!(tp), crate::TimeSpec::default()); - - tp = crate::TimeSpec::default(); - assert_eq!(dbg!( - crate::clock_gettime(crate::CLOCK_REALTIME, &mut tp) - ), Ok(0)); - assert_ne!(dbg!(tp), crate::TimeSpec::default()); -} - -//TODO: dup - -//TODO: dup2 - -//TODO: exit (handled by clone?) - -//TODO: fchmod - -//TODO: fcntl - -#[test] -fn fexec() { - let name = "file:/bin/ls"; - - let fd = dbg!( - crate::open(name, crate::O_RDONLY | crate::O_CLOEXEC) - ).unwrap(); - - let args = &[ - [name.as_ptr() as usize, name.len()] - ]; - - let vars = &[]; - - let pid_res = unsafe { crate::clone(crate::CloneFlags::empty()) }; - if pid_res == Ok(0) { - crate::fexec(fd, args, vars).unwrap(); - panic!("failed to fexec"); - } else { - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - let pid = dbg!(pid_res).unwrap(); - let mut status = 0; - assert_eq!(dbg!(crate::waitpid(pid, &mut status, crate::WaitFlags::empty())), Ok(pid)); - assert_eq!(dbg!(crate::wifexited(status)), true); - assert_eq!(dbg!(crate::wexitstatus(status)), 0); - } -} - -#[test] -fn fmap() { - use std::slice; - - let fd = dbg!( - crate::open( - "file:/tmp/syscall-tests-fmap", - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - let size = 128; - - let map = unsafe { - slice::from_raw_parts_mut( - dbg!( - crate::fmap(fd, &crate::Map { - address: 0, - offset: 0, - size, - flags: crate::PROT_READ | crate::PROT_WRITE - }) - ).unwrap() as *mut u8, - 128 - ) - }; - - // Maps should be available after closing - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - for i in 0..128 { - map[i as usize] = i; - assert_eq!(map[i as usize], i); - } - - //TODO: add msync - unsafe { - assert_eq!(dbg!( - crate::funmap(map.as_mut_ptr() as usize, size) - ), Ok(0)); - } -} - -// funmap tested by fmap - -#[test] -fn fpath() { - use std::str; - - let path = "file:/tmp/syscall-tests-fpath"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - let mut buf = [0; 4096]; - let count = dbg!( - crate::fpath(fd, &mut buf) - ).unwrap(); - - assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(path)); - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); -} - -//TODO: frename - -#[test] -fn fstat() { - let path = "file:/tmp/syscall-tests-fstat"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - let mut stat = crate::Stat::default(); - assert_eq!(dbg!(crate::fstat(fd, &mut stat)), Ok(0)); - assert_ne!(dbg!(stat), crate::Stat::default()); - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); -} - -#[test] -fn fstatvfs() { - let path = "file:/tmp/syscall-tests-fstatvfs"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - let mut statvfs = crate::StatVfs::default(); - assert_eq!(dbg!(crate::fstatvfs(fd, &mut statvfs)), Ok(0)); - assert_ne!(dbg!(statvfs), crate::StatVfs::default()); - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); -} - -//TODO: fsync - -//TODO: ftruncate - -//TODO: futimens - -//TODO: futex - -#[test] -fn getegid() { - assert_eq!(crate::getegid(), Ok(0)); -} - -#[test] -fn getens() { - assert_eq!(crate::getens(), Ok(1)); -} - -#[test] -fn geteuid() { - assert_eq!(crate::geteuid(), Ok(0)); -} - -#[test] -fn getgid() { - assert_eq!(crate::getgid(), Ok(0)); -} - -#[test] -fn getns() { - assert_eq!(crate::getns(), Ok(1)); -} - -//TODO: getpid - -//TODO: getpgid - -//TODO: getppid - -#[test] -fn getuid() { - assert_eq!(crate::getuid(), Ok(0)); -} - -//TODO: iopl - -//TODO: kill - -//TODO: link (probably will not work) - -#[test] -fn lseek() { - let path = "file:/tmp/syscall-tests-lseek"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - { - let mut buf = [0; 256]; - for i in 0..buf.len() { - buf[i] = i as u8; - } - assert_eq!(dbg!(crate::write(fd, &buf)), Ok(buf.len())); - - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_CUR)), Ok(buf.len())); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_END)), Ok(buf.len())); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); - } - - { - let mut buf = [0; 256]; - assert_eq!(dbg!(crate::read(fd, &mut buf)), Ok(buf.len())); - for i in 0..buf.len() { - assert_eq!(buf[i], i as u8); - } - - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_CUR)), Ok(buf.len())); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_END)), Ok(buf.len())); - assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); - } - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); -} - -//TODO: mkns - -//TODO: mprotect - -#[test] -fn nanosleep() { - let req = crate::TimeSpec { - tv_sec: 0, - tv_nsec: 0, - }; - let mut rem = crate::TimeSpec::default(); - assert_eq!(crate::nanosleep(&req, &mut rem), Ok(0)); - assert_eq!(rem, crate::TimeSpec::default()); -} - -//TODO: open - -//TODO: physalloc - -//TODO: physfree - -//TODO: physmap - -//TODO: physunmap - -#[test] -fn pipe2() { - let mut fds = [0, 0]; - assert_eq!(dbg!(crate::pipe2(&mut fds, crate::O_CLOEXEC)), Ok(0)); - assert_ne!(dbg!(fds), [0, 0]); - - { - let mut buf = [0; 256]; - for i in 0..buf.len() { - buf[i] = i as u8; - } - assert_eq!(dbg!(crate::write(fds[1], &buf)), Ok(buf.len())); - } - - { - let mut buf = [0; 256]; - assert_eq!(dbg!(crate::read(fds[0], &mut buf)), Ok(buf.len())); - for i in 0..buf.len() { - assert_eq!(buf[i], i as u8); - } - } - - assert_eq!(dbg!(crate::close(fds[0])), Ok(0)); - assert_eq!(dbg!(crate::close(fds[1])), Ok(0)); -} - -//TODO: read - -#[test] -fn rmdir() { - let path = "file:/tmp/syscall-tests-rmdir"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_DIRECTORY | crate::O_CLOEXEC - ) - ).unwrap(); - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - assert_eq!(dbg!(crate::rmdir(path)), Ok(0)); -} - -//TODO: setpgid - -//TODO: setregid - -//TODO: setrens - -//TODO: setreuid - -//TODO: sigaction - -//TODO: sigprocmask - -//TODO: sigreturn - -#[test] -fn umask() { - let old = dbg!(crate::umask(0o244)).unwrap(); - assert_eq!(dbg!(crate::umask(old)), Ok(0o244)); -} - -#[test] -fn unlink() { - let path = "file:/tmp/syscall-tests-unlink"; - let fd = dbg!( - crate::open( - dbg!(path), - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - assert_eq!(dbg!(crate::unlink(path)), Ok(0)); -} - -//TODO: virttophys - -// waitpid tested by clone - -//TODO: write - -#[test] -fn sched_yield() { - assert_eq!(dbg!(crate::sched_yield()), Ok(0)); -} - -#[test] -fn sigaction() { - use std::{ - mem, - sync::atomic::{AtomicBool, Ordering} - }; - - static SA_HANDLER_WAS_RAN: AtomicBool = AtomicBool::new(false); - static SA_HANDLER_2_WAS_IGNORED: AtomicBool = AtomicBool::new(false); - - let child = unsafe { crate::clone(crate::CLONE_VM).unwrap() }; - - if child == 0 { - let pid = crate::getpid().unwrap(); - - extern "C" fn hello_im_a_signal_handler(signal: usize) { - assert_eq!(signal, crate::SIGUSR1); - SA_HANDLER_WAS_RAN.store(true, Ordering::SeqCst); - } - - let my_signal_handler = crate::SigAction { - sa_handler: Some(hello_im_a_signal_handler), - ..Default::default() - }; - crate::sigaction(crate::SIGUSR1, Some(&my_signal_handler), None).unwrap(); - - crate::kill(pid, crate::SIGUSR1).unwrap(); // calls handler - - let mut old_signal_handler = crate::SigAction::default(); - crate::sigaction( - crate::SIGUSR1, - Some(&crate::SigAction { - sa_handler: unsafe { mem::transmute::>(crate::SIG_IGN) }, - ..Default::default() - }), - Some(&mut old_signal_handler) - ).unwrap(); - assert_eq!(my_signal_handler, old_signal_handler); - - crate::kill(pid, crate::SIGUSR1).unwrap(); // does nothing - - SA_HANDLER_2_WAS_IGNORED.store(true, Ordering::SeqCst); - - crate::sigaction( - crate::SIGUSR1, - Some(&crate::SigAction { - sa_handler: unsafe { mem::transmute::>(crate::SIG_DFL) }, - ..Default::default() - }), - Some(&mut old_signal_handler) - ).unwrap(); - - crate::kill(pid, crate::SIGUSR1).unwrap(); // actually exits - } else { - let mut status = 0; - dbg!(crate::waitpid(child, &mut status, crate::WaitFlags::empty())).unwrap(); - - assert!(crate::wifsignaled(status)); - assert_eq!(crate::wtermsig(status), crate::SIGUSR1); - - assert!(SA_HANDLER_WAS_RAN.load(Ordering::SeqCst)); - assert!(SA_HANDLER_2_WAS_IGNORED.load(Ordering::SeqCst)); - } -} diff --git a/vendor/regex-automata/.cargo-checksum.json b/vendor/regex-automata/.cargo-checksum.json index 718faae68..af40ed886 100644 --- a/vendor/regex-automata/.cargo-checksum.json +++ b/vendor/regex-automata/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"68de160610af9bb545a752c5da0d82b581e98e0f2631e2253c8a992fc51e322b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"61db25dbf26092fc80e8db89165692e55f9fb86b14e8451ebb28303f45932254","src/dfa/accel.rs":"2a045b0f6715e913d18d2212a7804fabaadfc3bcffad9382e35574d32eb0c492","src/dfa/automaton.rs":"c14707007bbb915fd5607424b0a4c8e53fa7daf6c7c1f4e3045d51ef15f9b202","src/dfa/dense.rs":"1de3a93f33525b419e3f47ab98d364234ccd68fc30273fd362fe8161a9a37ea3","src/dfa/determinize.rs":"91b9f69d28bdd064aa86716fe0772e4145050fd458bb7869a28660b4f7b64872","src/dfa/minimize.rs":"b5cadb462b9f24cd4aa7a665e75fb813cd06858a92b8986c9c5ae7fd9a60dfab","src/dfa/mod.rs":"ab1ac378d81bb5ea40a23cf903928adae4758e30f54646afde71869234965723","src/dfa/onepass.rs":"013f09b795955aefd07936994f08df4bc5b39698797f586b85171f778162aeab","src/dfa/regex.rs":"d16f0434a0b0f1341d6d5e0a162e6afa29411a786fb37b0e98bbcc0c6ba3cfec","src/dfa/remapper.rs":"ca096abc0f8e45c43a2adf3a7743b8857714ae7411a623edea41cc3ce906a169","src/dfa/search.rs":"79b9ab2b0636177bc26d1ad6f0059ca033decf74824cb5a36f1ac19f020d2713","src/dfa/sparse.rs":"c863d92a4d919fa880dfca3d59a8b5b672c6ffa8423578b34fc0af2ae62e1d7a","src/dfa/special.rs":"c2e60de5b98e68c9c45aaffbc67a08f049831a764a1ed29d1d1db0fb68efdce5","src/dfa/start.rs":"46b1dbaf8e4518ddddda6bbe596621aae36f8ba694390483a22355d9d799be8e","src/hybrid/dfa.rs":"a6ed6d3268e4008f88c1469029a84391edfee7851df2912640763e4ba2188635","src/hybrid/error.rs":"37db2a9759721de4ca2c49e21ab74dd3d998b67c5ab0e65a62085b57ec1d7ba3","src/hybrid/id.rs":"6168aad5c81c627494ba0575a24d61fd0ae7efabaaceeadb8ff28472275e2813","src/hybrid/mod.rs":"ca21e89062bdb5a0998d5cd1bc78609af1f6b795533e5982be969c383ac0463a","src/hybrid/regex.rs":"47815d025526330291f4cd749b4dd79b1122ef208fe6f0a49715c70fc1ea47c8","src/hybrid/search.rs":"76067f3f8675013dcdf7e9c9cc4d9d33d1107fb2cbcd7adcc05cfd42177d90cc","src/lib.rs":"4e831d41057760c5f2f1274a206fa5a42f59dbca8f98ad3e782fe0fba0d6c37f","src/macros.rs":"3e4b39252bfa471fad384160a43f113ebfec7bec46a85d16f006622881dd2081","src/meta/error.rs":"710a6813314b1b11ace1b016a827067fff8b2624d47e15c7f52043bff5ab57da","src/meta/limited.rs":"98b6b2d19f67d4ce3ddb110e06045f22a040590262fde33614ab900bdd06b25b","src/meta/literal.rs":"52da98bb30995dedd22786e4728cb84e84c6093a284168bd91196b999dd0f6ec","src/meta/mod.rs":"f3b10b96fa08efaba3e4c9b81883cf40aac6e4c1f6ae55a497a534cf5805b46d","src/meta/regex.rs":"b0fab107d3f972db89568e14fec0199ba4cd8076cc5fd61c2582db42885f196e","src/meta/reverse_inner.rs":"945d6c2d4c7538e1609dbd430a096784d22abd33db58b1ba65c9c9af45a7d3c0","src/meta/stopat.rs":"acb6122e17d10a9b1b5e72d6030e6d95748227975bad0ff5cbbcc2587edfa6df","src/meta/strategy.rs":"c882c5c261de5fe58bc65251d2d407e4cb483b9b80c2bec5eba958ef90e0072d","src/meta/wrappers.rs":"3cb0717f87b7082cc75cb02148b8cde30cffbee689bdb6275abcf1416747ceb4","src/nfa/mod.rs":"1a731e217ed4053714500e84e58cc127f402e4e075f7d0e5b9aea715cd52405a","src/nfa/thompson/backtrack.rs":"041015ea153c1e485e9cf39ec60d1e51c7ab9e400ecd77cad2078af45775339b","src/nfa/thompson/builder.rs":"7adf6aba69171f6acd47fea0fec85ba589154fead83f2042a1c6fe9486aa4dbd","src/nfa/thompson/compiler.rs":"a8bb24f7f125a294cb75af9d8332821142738278d8eff354647ae08f66a597af","src/nfa/thompson/error.rs":"78488c2fdb85f819f53cc30bb11c7f96169112da5dd14c351e5cc3bcccf0e10e","src/nfa/thompson/literal_trie.rs":"c2d1d09b44da4648db797386c2410cbf63337afef8cb62e6e78cf34786892a11","src/nfa/thompson/map.rs":"4dcfc0a43bbd91ff69cc8a47486b5f7cac048f7d5cf269b63933d7f2e177a533","src/nfa/thompson/mod.rs":"0651520debd6f023ae1a2c422806aab37f8491e5bb092e20dfdc4fe4179d695c","src/nfa/thompson/nfa.rs":"410c3745c159eb17bea18256ec03ee92e1fccca630f01a24618a75fffcf86866","src/nfa/thompson/pikevm.rs":"aaf792832d1bf15fad8a8f0b2e6597170361eb3cbcb9343eb5bd242ff346d750","src/nfa/thompson/range_trie.rs":"f081e74e8c08e2268f1ce410608fefa4b14d7d1c0487dbc27d27d51ea6265e30","src/util/alphabet.rs":"94cd73ce2f4e34e0ae0a146d3efdc85478263afdfefd6dc105e0abf0ec79d82b","src/util/captures.rs":"d2a118ba509b70e9922a10ea9f78771b14a521abb0ed4029be3ef6aeea44d032","src/util/determinize/mod.rs":"5e9e1f7dd060d69521b743afc2b900b21ad7942e17397084ac6563ea5dcf2fd9","src/util/determinize/state.rs":"c30eac89137df0f0128143eeb2e0c8d7ea4bd659825fa6721b5315141a326e3a","src/util/empty.rs":"13ec7d6cbd1520db5b4c1dae294f4419fa88d39d2bfc16f4ef258473d609f91c","src/util/escape.rs":"5b2731b41a55cb50ab688132bb5640dbd51f14f141adaa864b9db7f0aa092c74","src/util/int.rs":"b7eec0a6cab0798ba66707988fce3ecfc841b93418028a7b1408c5d0f6271351","src/util/interpolate.rs":"5e4e6b6fb6e5a7603e393bf05c609735d86a7d1f54c2436e42111b4e1409b6dd","src/util/iter.rs":"58ae97b4156d7160a46b909f4635d88d10354d9d892d2fcb4c5e18e24cf38f14","src/util/lazy.rs":"e16b3ed139210ca546fc302c463ce52a5dcfa77382f07c9097400ed8cddf78c8","src/util/look.rs":"fbfcaace79d0c6ad3698c9d6c025cb952f2e00cf88a48cf690d087fa73466689","src/util/memchr.rs":"573109ce4983907083ae0b29a084a324b9b53da369b4d96f7f3a21fd5c8eb5c9","src/util/mod.rs":"6c828a493f0f88c8b515aee4f8faf91ba653eb07e8fc3c23c0524553410803f9","src/util/pool.rs":"da1fad31f2fdf15cf3a6a605ece8d6162d8f6c42770c160af4c0fbf4ef148aa5","src/util/prefilter/aho_corasick.rs":"c54fa95f4d9e7ab53e2c6463a43f8953df6a440997fc9cd528f225db0dd32582","src/util/prefilter/byteset.rs":"1c80fa432acc23223a75a5181e37c40034764dffe42410e4b77af6f24f48bd5c","src/util/prefilter/memchr.rs":"36c6fe6354b2e729db6830166dd4862e439bc48c9e59258d88e4b6c5654e20ef","src/util/prefilter/memmem.rs":"6f6ed9450b14abf3e4a33d395337e51fbaa9743a0a16aac0009f7680aa60c500","src/util/prefilter/mod.rs":"2818e2e92632aee1c46b0dc01b654e544bfbf460236be86d28a2d836e9fc189a","src/util/prefilter/teddy.rs":"ed54d26858b56e1c8c87e44afae5f63d81ab930787d79e671f3a3513f576e9cd","src/util/primitives.rs":"8a9cc19ef2e1ab183943cdc2d2f095b02252476e32b7e9fff4a06a251749b068","src/util/search.rs":"66bf320ebbe403c119a966f3dfbd53178de0ceebd2ca1922f1ddbb79aed36837","src/util/sparse_set.rs":"3d4aa30b6aa9fc875d36506487a5095dbe8ed528b89e4146a65c7e7497520a4d","src/util/start.rs":"73ebcf2550cea56f67b9048fa3dc91f3a8db9897fbd2400dd9941efb0cb4827e","src/util/syntax.rs":"720ac0d6600fad33f5967b5afe4e3de2096b857e4cda6fa16ba93b10a8230cab","src/util/unicode_data/mod.rs":"54c3e10bbc393e9881bfac3295815b160f59e69e2056bc29ee7cf0addd8e3cf7","src/util/unicode_data/perl_word.rs":"2e1a5d889598bd4e73af17d3a9f7d6b4cf2f6ab24920a5336e496bb255281e56","src/util/utf8.rs":"7a068009fdf07e693e521b1f0264725c0e6118dbe1eab55da9d0eab21785fcc1","src/util/wire.rs":"bfdf52615c516b6c07db3ce9c333ea61fdc535bd0b79560bbd7f6864ab83946e","test":"39d79ce3532c31a51c0be89a2939816fad0e4868d2b03992c202cbe64dce9f6c","tests/dfa/api.rs":"cc28e366b6bcbfcf379265acd492a92c62743c3f20e7a2b273019679aa9e1291","tests/dfa/mod.rs":"924d8fff500b9b7b140082623023e78007058a87323151cd8e361462945e4f16","tests/dfa/onepass/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/dfa/onepass/suite.rs":"6d63ec5469e6876656ae607cdbe07e6a4e17ace7836b67435763c9b1d233438a","tests/dfa/regression.rs":"ebcf2645290286aa7531eb2b7951385e5ed8167532437aeca2ad2049768fd796","tests/dfa/suite.rs":"2812aa0167ee5e93eff3f7d45096a78c5f3a2440197a513b3cf0310286640f51","tests/fuzz/dense.rs":"3e1099a0cce61e85abc0ad81bc592e85f497f159ef0e5d1d32bac1936aa6f20c","tests/fuzz/mod.rs":"043773510e02f51def43ee0c2b8b867c53ecc8638c8a9233b2ac098de9c3ac1e","tests/fuzz/sparse.rs":"ba61db4927ab28953037a4b20317399c86d01b4d774e46c020ade19029215e25","tests/fuzz/testdata/deserialize_dense_crash-9486fb7c8a93b12c12a62166b43d31640c0208a9":"8961279a8237c3e318452024dd971b1d5a26b058260c297382a74daca1b7f0d1","tests/fuzz/testdata/deserialize_dense_minimized-from-9486fb7c8a93b12c12a62166b43d31640c0208a9":"c2d52e3dea78d3f159b5b521d433358a7fee45ce20ed1545067d461f45ef66b8","tests/fuzz/testdata/deserialize_sparse_crash-0da59c0434eaf35e5a6b470fa9244bb79c72b000":"5b2d273023de3fb04037eaf2e6b4f51cced4c5a08d2e6b44e4be540774f939b9","tests/fuzz/testdata/deserialize_sparse_crash-18cfc246f2ddfc3dfc92b0c7893178c7cf65efa9":"e2e22e2f46a9a75b5c876476442276cf675fe244c5cf918789e4f6b14078fbd9","tests/fuzz/testdata/deserialize_sparse_crash-61fd8e3003bf9d99f6c1e5a8488727eefd234b98":"24a12712e1f2ba0a40b5782707908a74dd19941dc372ef525d65a7134f91988c","tests/fuzz/testdata/deserialize_sparse_crash-a1b839d899ced76d5d7d0f78f9edb7a421505838":"a97f39b2febf9c73535681f7a86201e4b06d5a1ffcf135299c96c1cabfa9f6c4","tests/fuzz/testdata/deserialize_sparse_crash-c383ae07ec5e191422eadc492117439011816570":"44fe3ef878d35e2d51c2c17ff89bbbe3a4650e09d0cbbd48625c0f5e4dd0848b","tests/fuzz/testdata/deserialize_sparse_crash-d07703ceb94b10dcd9e4acb809f2051420449e2b":"d5534be36653b4af6cb94a7c63be58869bb8c204c5c63d67a4d6c986b44bb2e1","tests/fuzz/testdata/deserialize_sparse_crash-dbb8172d3984e7e7d03f4b5f8bb86ecd1460eff9":"77b844898610560afa09f2b8de73a85a0ba9a3b8cee4ff1bbf26b8c97ad4e8a2","tests/gen/README.md":"c3bfdf2f9ced501dd5bd75d01509a34e503efb2dff2f5f7b260580dde5519ed4","tests/gen/dense/mod.rs":"5ae1cfb46212a674118ada2f66f37b25188e84643d406b95eb4665d722344262","tests/gen/dense/multi_pattern_v2.rs":"29b1e9a799adecbdbe7cd05e9748f664c2b915b10b1d2f5d36cfb6453826d1d2","tests/gen/dense/multi_pattern_v2_fwd.bigendian.dfa":"8421d5a1bfc0b6c3bdc8fc90dff591a046b0aaf8e06ef7de7cc293004a35d061","tests/gen/dense/multi_pattern_v2_fwd.littleendian.dfa":"dcf2fd5fd49f5f53cf1ec66f61623402f39401cb3aea30d6677b98bb1e9541bf","tests/gen/dense/multi_pattern_v2_rev.bigendian.dfa":"73c4f20d984e544dfa4cf05f3009d0a9b52fa84bc97b501ea0ccd179e2def4bc","tests/gen/dense/multi_pattern_v2_rev.littleendian.dfa":"74471209f05754e8e20c8a0222a5877b1b15b8b8f33cd8cac89ea65f708b4aff","tests/gen/mod.rs":"043773510e02f51def43ee0c2b8b867c53ecc8638c8a9233b2ac098de9c3ac1e","tests/gen/sparse/mod.rs":"5ae1cfb46212a674118ada2f66f37b25188e84643d406b95eb4665d722344262","tests/gen/sparse/multi_pattern_v2.rs":"e00fb2a510a215460aab84573196b1f51bb65884ff494c2382534c04f6fdbfe9","tests/gen/sparse/multi_pattern_v2_fwd.bigendian.dfa":"3287956bd2003cd69653b125f82aade95d99adbb20229bfdbb4958b8877c0a0b","tests/gen/sparse/multi_pattern_v2_fwd.littleendian.dfa":"bdf285901eaaac4596380115c5bbb20ab2f42f593d8d9e9238a00ed69863f9c9","tests/gen/sparse/multi_pattern_v2_rev.bigendian.dfa":"e466dc085dd68b2d2220932a0e4d28759edd161c1fdad652240aa3825fd85268","tests/gen/sparse/multi_pattern_v2_rev.littleendian.dfa":"80358d0c26c1cc7284065b0075f5b8804d83e673a8a8c8327f93a1c1ff455399","tests/hybrid/api.rs":"bd4862275c52f94c6f6737bf174c97e3de30f8075ca23f43c129c72a0d0afed7","tests/hybrid/mod.rs":"4856a49a4d9b5e9e079c2719a5e75c32408b37e9b76cbdea057b388a3537af6d","tests/hybrid/suite.rs":"688972275c5ef38cdc5112a1e6e54ccd2bf8290008ae2b17344c6c81e17e3a5a","tests/lib.rs":"9775b3c62fb338ea5c1bd3513a6589eff4b5c8d35c599439d9363dbf98c6f8d4","tests/meta/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/meta/suite.rs":"4c441f9df82508a5e60dd08f266183f772fc9b2b236fbf69cab87650ecf3b424","tests/nfa/mod.rs":"49055c358e38d97e42acb1602c671f97dddf24cafe089490f0e79ed208d74d9b","tests/nfa/thompson/backtrack/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/nfa/thompson/backtrack/suite.rs":"4e7baff70fc98b98b8297c6fd6d5818beb20343379e16cdb95bee46207ac4bd6","tests/nfa/thompson/mod.rs":"de9f5bcea1a8d1f03c85c55ad8c0747877d69e344fcd6c6886b0a402f0661291","tests/nfa/thompson/pikevm/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/nfa/thompson/pikevm/suite.rs":"263837ebf5b2e1906a06237982ea875386d83567e399b4ec1f669f10b1422599"},"package":"5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"} \ No newline at end of file +{"files":{"Cargo.toml":"f60dfe6afcafe69301493380fcf7bf66b83d0edec0c2817d20da43ded0554c69","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"61db25dbf26092fc80e8db89165692e55f9fb86b14e8451ebb28303f45932254","src/dfa/accel.rs":"2a045b0f6715e913d18d2212a7804fabaadfc3bcffad9382e35574d32eb0c492","src/dfa/automaton.rs":"c14707007bbb915fd5607424b0a4c8e53fa7daf6c7c1f4e3045d51ef15f9b202","src/dfa/dense.rs":"eda0e5ca69166aaeb7f8f3cdf9135ef535a97ae39aad6f3bcf9090c0a1d7d960","src/dfa/determinize.rs":"91b9f69d28bdd064aa86716fe0772e4145050fd458bb7869a28660b4f7b64872","src/dfa/minimize.rs":"b5cadb462b9f24cd4aa7a665e75fb813cd06858a92b8986c9c5ae7fd9a60dfab","src/dfa/mod.rs":"ab1ac378d81bb5ea40a23cf903928adae4758e30f54646afde71869234965723","src/dfa/onepass.rs":"013f09b795955aefd07936994f08df4bc5b39698797f586b85171f778162aeab","src/dfa/regex.rs":"d16f0434a0b0f1341d6d5e0a162e6afa29411a786fb37b0e98bbcc0c6ba3cfec","src/dfa/remapper.rs":"ca096abc0f8e45c43a2adf3a7743b8857714ae7411a623edea41cc3ce906a169","src/dfa/search.rs":"79b9ab2b0636177bc26d1ad6f0059ca033decf74824cb5a36f1ac19f020d2713","src/dfa/sparse.rs":"c863d92a4d919fa880dfca3d59a8b5b672c6ffa8423578b34fc0af2ae62e1d7a","src/dfa/special.rs":"c2e60de5b98e68c9c45aaffbc67a08f049831a764a1ed29d1d1db0fb68efdce5","src/dfa/start.rs":"46b1dbaf8e4518ddddda6bbe596621aae36f8ba694390483a22355d9d799be8e","src/hybrid/dfa.rs":"a6ed6d3268e4008f88c1469029a84391edfee7851df2912640763e4ba2188635","src/hybrid/error.rs":"37db2a9759721de4ca2c49e21ab74dd3d998b67c5ab0e65a62085b57ec1d7ba3","src/hybrid/id.rs":"6168aad5c81c627494ba0575a24d61fd0ae7efabaaceeadb8ff28472275e2813","src/hybrid/mod.rs":"ca21e89062bdb5a0998d5cd1bc78609af1f6b795533e5982be969c383ac0463a","src/hybrid/regex.rs":"47815d025526330291f4cd749b4dd79b1122ef208fe6f0a49715c70fc1ea47c8","src/hybrid/search.rs":"76067f3f8675013dcdf7e9c9cc4d9d33d1107fb2cbcd7adcc05cfd42177d90cc","src/lib.rs":"4e831d41057760c5f2f1274a206fa5a42f59dbca8f98ad3e782fe0fba0d6c37f","src/macros.rs":"3e4b39252bfa471fad384160a43f113ebfec7bec46a85d16f006622881dd2081","src/meta/error.rs":"710a6813314b1b11ace1b016a827067fff8b2624d47e15c7f52043bff5ab57da","src/meta/limited.rs":"98b6b2d19f67d4ce3ddb110e06045f22a040590262fde33614ab900bdd06b25b","src/meta/literal.rs":"52da98bb30995dedd22786e4728cb84e84c6093a284168bd91196b999dd0f6ec","src/meta/mod.rs":"f3b10b96fa08efaba3e4c9b81883cf40aac6e4c1f6ae55a497a534cf5805b46d","src/meta/regex.rs":"b0fab107d3f972db89568e14fec0199ba4cd8076cc5fd61c2582db42885f196e","src/meta/reverse_inner.rs":"945d6c2d4c7538e1609dbd430a096784d22abd33db58b1ba65c9c9af45a7d3c0","src/meta/stopat.rs":"acb6122e17d10a9b1b5e72d6030e6d95748227975bad0ff5cbbcc2587edfa6df","src/meta/strategy.rs":"c882c5c261de5fe58bc65251d2d407e4cb483b9b80c2bec5eba958ef90e0072d","src/meta/wrappers.rs":"3cb0717f87b7082cc75cb02148b8cde30cffbee689bdb6275abcf1416747ceb4","src/nfa/mod.rs":"1a731e217ed4053714500e84e58cc127f402e4e075f7d0e5b9aea715cd52405a","src/nfa/thompson/backtrack.rs":"041015ea153c1e485e9cf39ec60d1e51c7ab9e400ecd77cad2078af45775339b","src/nfa/thompson/builder.rs":"7adf6aba69171f6acd47fea0fec85ba589154fead83f2042a1c6fe9486aa4dbd","src/nfa/thompson/compiler.rs":"a8bb24f7f125a294cb75af9d8332821142738278d8eff354647ae08f66a597af","src/nfa/thompson/error.rs":"78488c2fdb85f819f53cc30bb11c7f96169112da5dd14c351e5cc3bcccf0e10e","src/nfa/thompson/literal_trie.rs":"c2d1d09b44da4648db797386c2410cbf63337afef8cb62e6e78cf34786892a11","src/nfa/thompson/map.rs":"fcd17ce7359b5179ef2e809fc9152dfa0b6c61d3d849d8c502497e1d0d8b0fa9","src/nfa/thompson/mod.rs":"0651520debd6f023ae1a2c422806aab37f8491e5bb092e20dfdc4fe4179d695c","src/nfa/thompson/nfa.rs":"410c3745c159eb17bea18256ec03ee92e1fccca630f01a24618a75fffcf86866","src/nfa/thompson/pikevm.rs":"aaf792832d1bf15fad8a8f0b2e6597170361eb3cbcb9343eb5bd242ff346d750","src/nfa/thompson/range_trie.rs":"d0ea4fc2a7085355a8bdb82a8ba4d5ce478596021a808390aaf0a4c1e4235970","src/util/alphabet.rs":"94cd73ce2f4e34e0ae0a146d3efdc85478263afdfefd6dc105e0abf0ec79d82b","src/util/captures.rs":"d2a118ba509b70e9922a10ea9f78771b14a521abb0ed4029be3ef6aeea44d032","src/util/determinize/mod.rs":"5e9e1f7dd060d69521b743afc2b900b21ad7942e17397084ac6563ea5dcf2fd9","src/util/determinize/state.rs":"c30eac89137df0f0128143eeb2e0c8d7ea4bd659825fa6721b5315141a326e3a","src/util/empty.rs":"13ec7d6cbd1520db5b4c1dae294f4419fa88d39d2bfc16f4ef258473d609f91c","src/util/escape.rs":"5b2731b41a55cb50ab688132bb5640dbd51f14f141adaa864b9db7f0aa092c74","src/util/int.rs":"b7eec0a6cab0798ba66707988fce3ecfc841b93418028a7b1408c5d0f6271351","src/util/interpolate.rs":"5e4e6b6fb6e5a7603e393bf05c609735d86a7d1f54c2436e42111b4e1409b6dd","src/util/iter.rs":"58ae97b4156d7160a46b909f4635d88d10354d9d892d2fcb4c5e18e24cf38f14","src/util/lazy.rs":"e16b3ed139210ca546fc302c463ce52a5dcfa77382f07c9097400ed8cddf78c8","src/util/look.rs":"fbfcaace79d0c6ad3698c9d6c025cb952f2e00cf88a48cf690d087fa73466689","src/util/memchr.rs":"573109ce4983907083ae0b29a084a324b9b53da369b4d96f7f3a21fd5c8eb5c9","src/util/mod.rs":"6c828a493f0f88c8b515aee4f8faf91ba653eb07e8fc3c23c0524553410803f9","src/util/pool.rs":"da1fad31f2fdf15cf3a6a605ece8d6162d8f6c42770c160af4c0fbf4ef148aa5","src/util/prefilter/aho_corasick.rs":"c54fa95f4d9e7ab53e2c6463a43f8953df6a440997fc9cd528f225db0dd32582","src/util/prefilter/byteset.rs":"1c80fa432acc23223a75a5181e37c40034764dffe42410e4b77af6f24f48bd5c","src/util/prefilter/memchr.rs":"36c6fe6354b2e729db6830166dd4862e439bc48c9e59258d88e4b6c5654e20ef","src/util/prefilter/memmem.rs":"6f6ed9450b14abf3e4a33d395337e51fbaa9743a0a16aac0009f7680aa60c500","src/util/prefilter/mod.rs":"b171a46c74678c77d659174284819939c656ccb3cc7661246fdeb47a042048f7","src/util/prefilter/teddy.rs":"ed54d26858b56e1c8c87e44afae5f63d81ab930787d79e671f3a3513f576e9cd","src/util/primitives.rs":"8a9cc19ef2e1ab183943cdc2d2f095b02252476e32b7e9fff4a06a251749b068","src/util/search.rs":"f37ff5193c7ae49356cc8f3167eeeab090a4754dfb9e5832ceb0b150f8f182fd","src/util/sparse_set.rs":"3d4aa30b6aa9fc875d36506487a5095dbe8ed528b89e4146a65c7e7497520a4d","src/util/start.rs":"73ebcf2550cea56f67b9048fa3dc91f3a8db9897fbd2400dd9941efb0cb4827e","src/util/syntax.rs":"720ac0d6600fad33f5967b5afe4e3de2096b857e4cda6fa16ba93b10a8230cab","src/util/unicode_data/mod.rs":"54c3e10bbc393e9881bfac3295815b160f59e69e2056bc29ee7cf0addd8e3cf7","src/util/unicode_data/perl_word.rs":"2e1a5d889598bd4e73af17d3a9f7d6b4cf2f6ab24920a5336e496bb255281e56","src/util/utf8.rs":"7a068009fdf07e693e521b1f0264725c0e6118dbe1eab55da9d0eab21785fcc1","src/util/wire.rs":"bfdf52615c516b6c07db3ce9c333ea61fdc535bd0b79560bbd7f6864ab83946e","test":"39d79ce3532c31a51c0be89a2939816fad0e4868d2b03992c202cbe64dce9f6c","tests/dfa/api.rs":"cc28e366b6bcbfcf379265acd492a92c62743c3f20e7a2b273019679aa9e1291","tests/dfa/mod.rs":"924d8fff500b9b7b140082623023e78007058a87323151cd8e361462945e4f16","tests/dfa/onepass/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/dfa/onepass/suite.rs":"6d63ec5469e6876656ae607cdbe07e6a4e17ace7836b67435763c9b1d233438a","tests/dfa/regression.rs":"ebcf2645290286aa7531eb2b7951385e5ed8167532437aeca2ad2049768fd796","tests/dfa/suite.rs":"2812aa0167ee5e93eff3f7d45096a78c5f3a2440197a513b3cf0310286640f51","tests/fuzz/dense.rs":"3e1099a0cce61e85abc0ad81bc592e85f497f159ef0e5d1d32bac1936aa6f20c","tests/fuzz/mod.rs":"043773510e02f51def43ee0c2b8b867c53ecc8638c8a9233b2ac098de9c3ac1e","tests/fuzz/sparse.rs":"ba61db4927ab28953037a4b20317399c86d01b4d774e46c020ade19029215e25","tests/fuzz/testdata/deserialize_dense_crash-9486fb7c8a93b12c12a62166b43d31640c0208a9":"8961279a8237c3e318452024dd971b1d5a26b058260c297382a74daca1b7f0d1","tests/fuzz/testdata/deserialize_dense_minimized-from-9486fb7c8a93b12c12a62166b43d31640c0208a9":"c2d52e3dea78d3f159b5b521d433358a7fee45ce20ed1545067d461f45ef66b8","tests/fuzz/testdata/deserialize_sparse_crash-0da59c0434eaf35e5a6b470fa9244bb79c72b000":"5b2d273023de3fb04037eaf2e6b4f51cced4c5a08d2e6b44e4be540774f939b9","tests/fuzz/testdata/deserialize_sparse_crash-18cfc246f2ddfc3dfc92b0c7893178c7cf65efa9":"e2e22e2f46a9a75b5c876476442276cf675fe244c5cf918789e4f6b14078fbd9","tests/fuzz/testdata/deserialize_sparse_crash-61fd8e3003bf9d99f6c1e5a8488727eefd234b98":"24a12712e1f2ba0a40b5782707908a74dd19941dc372ef525d65a7134f91988c","tests/fuzz/testdata/deserialize_sparse_crash-a1b839d899ced76d5d7d0f78f9edb7a421505838":"a97f39b2febf9c73535681f7a86201e4b06d5a1ffcf135299c96c1cabfa9f6c4","tests/fuzz/testdata/deserialize_sparse_crash-c383ae07ec5e191422eadc492117439011816570":"44fe3ef878d35e2d51c2c17ff89bbbe3a4650e09d0cbbd48625c0f5e4dd0848b","tests/fuzz/testdata/deserialize_sparse_crash-d07703ceb94b10dcd9e4acb809f2051420449e2b":"d5534be36653b4af6cb94a7c63be58869bb8c204c5c63d67a4d6c986b44bb2e1","tests/fuzz/testdata/deserialize_sparse_crash-dbb8172d3984e7e7d03f4b5f8bb86ecd1460eff9":"77b844898610560afa09f2b8de73a85a0ba9a3b8cee4ff1bbf26b8c97ad4e8a2","tests/gen/README.md":"c3bfdf2f9ced501dd5bd75d01509a34e503efb2dff2f5f7b260580dde5519ed4","tests/gen/dense/mod.rs":"5ae1cfb46212a674118ada2f66f37b25188e84643d406b95eb4665d722344262","tests/gen/dense/multi_pattern_v2.rs":"29b1e9a799adecbdbe7cd05e9748f664c2b915b10b1d2f5d36cfb6453826d1d2","tests/gen/dense/multi_pattern_v2_fwd.bigendian.dfa":"8421d5a1bfc0b6c3bdc8fc90dff591a046b0aaf8e06ef7de7cc293004a35d061","tests/gen/dense/multi_pattern_v2_fwd.littleendian.dfa":"dcf2fd5fd49f5f53cf1ec66f61623402f39401cb3aea30d6677b98bb1e9541bf","tests/gen/dense/multi_pattern_v2_rev.bigendian.dfa":"73c4f20d984e544dfa4cf05f3009d0a9b52fa84bc97b501ea0ccd179e2def4bc","tests/gen/dense/multi_pattern_v2_rev.littleendian.dfa":"74471209f05754e8e20c8a0222a5877b1b15b8b8f33cd8cac89ea65f708b4aff","tests/gen/mod.rs":"043773510e02f51def43ee0c2b8b867c53ecc8638c8a9233b2ac098de9c3ac1e","tests/gen/sparse/mod.rs":"5ae1cfb46212a674118ada2f66f37b25188e84643d406b95eb4665d722344262","tests/gen/sparse/multi_pattern_v2.rs":"e00fb2a510a215460aab84573196b1f51bb65884ff494c2382534c04f6fdbfe9","tests/gen/sparse/multi_pattern_v2_fwd.bigendian.dfa":"3287956bd2003cd69653b125f82aade95d99adbb20229bfdbb4958b8877c0a0b","tests/gen/sparse/multi_pattern_v2_fwd.littleendian.dfa":"bdf285901eaaac4596380115c5bbb20ab2f42f593d8d9e9238a00ed69863f9c9","tests/gen/sparse/multi_pattern_v2_rev.bigendian.dfa":"e466dc085dd68b2d2220932a0e4d28759edd161c1fdad652240aa3825fd85268","tests/gen/sparse/multi_pattern_v2_rev.littleendian.dfa":"80358d0c26c1cc7284065b0075f5b8804d83e673a8a8c8327f93a1c1ff455399","tests/hybrid/api.rs":"bd4862275c52f94c6f6737bf174c97e3de30f8075ca23f43c129c72a0d0afed7","tests/hybrid/mod.rs":"4856a49a4d9b5e9e079c2719a5e75c32408b37e9b76cbdea057b388a3537af6d","tests/hybrid/suite.rs":"688972275c5ef38cdc5112a1e6e54ccd2bf8290008ae2b17344c6c81e17e3a5a","tests/lib.rs":"9775b3c62fb338ea5c1bd3513a6589eff4b5c8d35c599439d9363dbf98c6f8d4","tests/meta/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/meta/suite.rs":"4c441f9df82508a5e60dd08f266183f772fc9b2b236fbf69cab87650ecf3b424","tests/nfa/mod.rs":"49055c358e38d97e42acb1602c671f97dddf24cafe089490f0e79ed208d74d9b","tests/nfa/thompson/backtrack/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/nfa/thompson/backtrack/suite.rs":"4e7baff70fc98b98b8297c6fd6d5818beb20343379e16cdb95bee46207ac4bd6","tests/nfa/thompson/mod.rs":"de9f5bcea1a8d1f03c85c55ad8c0747877d69e344fcd6c6886b0a402f0661291","tests/nfa/thompson/pikevm/mod.rs":"d08f4ecb8ec243be584944c9602af1ed3a48a8732dd11cd573b0d1d182171303","tests/nfa/thompson/pikevm/suite.rs":"263837ebf5b2e1906a06237982ea875386d83567e399b4ec1f669f10b1422599"},"package":"5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"} \ No newline at end of file diff --git a/vendor/regex-automata/Cargo.toml b/vendor/regex-automata/Cargo.toml index 8b7cf0aa6..89ce214a0 100644 --- a/vendor/regex-automata/Cargo.toml +++ b/vendor/regex-automata/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.65" name = "regex-automata" -version = "0.4.3" +version = "0.4.5" authors = [ "The Rust Project Developers", "Andrew Gallant ", diff --git a/vendor/regex-automata/src/dfa/dense.rs b/vendor/regex-automata/src/dfa/dense.rs index fd96bc878..6fc61dc4f 100644 --- a/vendor/regex-automata/src/dfa/dense.rs +++ b/vendor/regex-automata/src/dfa/dense.rs @@ -2340,8 +2340,8 @@ impl<'a> DFA<&'a [u32]> { // table, match states and accelerators below. If any validation fails, // then we return an error. let (dfa, nread) = unsafe { DFA::from_bytes_unchecked(slice)? }; - dfa.tt.validate(&dfa.special)?; - dfa.st.validate(&dfa.tt)?; + dfa.tt.validate(&dfa)?; + dfa.st.validate(&dfa)?; dfa.ms.validate(&dfa)?; dfa.accels.validate()?; // N.B. dfa.special doesn't have a way to do unchecked deserialization, @@ -3593,7 +3593,8 @@ impl> TransitionTable { /// /// That is, every state ID can be used to correctly index a state in this /// table. - fn validate(&self, sp: &Special) -> Result<(), DeserializeError> { + fn validate(&self, dfa: &DFA) -> Result<(), DeserializeError> { + let sp = &dfa.special; for state in self.states() { // We check that the ID itself is well formed. That is, if it's // a special state then it must actually be a quit, dead, accel, @@ -3611,6 +3612,13 @@ impl> TransitionTable { wasn't actually special", )); } + if sp.is_match_state(state.id()) + && dfa.match_len(state.id()) == 0 + { + return Err(DeserializeError::generic( + "found match state with zero pattern IDs", + )); + } } for (_, to) in state.transitions() { if !self.is_valid(to) { @@ -4127,10 +4135,8 @@ impl> StartTable { /// it against the given transition table (which must be for the same DFA). /// /// That is, every state ID can be used to correctly index a state. - fn validate( - &self, - tt: &TransitionTable, - ) -> Result<(), DeserializeError> { + fn validate(&self, dfa: &DFA) -> Result<(), DeserializeError> { + let tt = &dfa.tt; if !self.universal_start_unanchored.map_or(true, |s| tt.is_valid(s)) { return Err(DeserializeError::generic( "found invalid universal unanchored starting state ID", diff --git a/vendor/regex-automata/src/nfa/thompson/map.rs b/vendor/regex-automata/src/nfa/thompson/map.rs index c92d4c0b8..7f074a353 100644 --- a/vendor/regex-automata/src/nfa/thompson/map.rs +++ b/vendor/regex-automata/src/nfa/thompson/map.rs @@ -65,7 +65,7 @@ const INIT: u64 = 14695981039346656037; /// Specifically, one could observe the difference with std's hashmap via /// something like the following benchmark: /// -/// hyperfine "regex-cli debug thompson -qr --no-captures '\w{90} ecurB'" +/// hyperfine "regex-cli debug thompson -qr --captures none '\w{90} ecurB'" /// /// But to observe that difference, you'd have to modify the code to use /// std's hashmap. diff --git a/vendor/regex-automata/src/nfa/thompson/range_trie.rs b/vendor/regex-automata/src/nfa/thompson/range_trie.rs index 75c9b796b..cd77cc150 100644 --- a/vendor/regex-automata/src/nfa/thompson/range_trie.rs +++ b/vendor/regex-automata/src/nfa/thompson/range_trie.rs @@ -594,7 +594,7 @@ impl State { // Benchmarks suggest that binary search is just a bit faster than // straight linear search. Specifically when using the debug tool: // - // hyperfine "regex-cli debug thompson -qr --no-captures '\w{90} ecurB'" + // hyperfine "regex-cli debug thompson -qr --captures none '\w{90} ecurB'" binary_search(&self.transitions, |t| range.start <= t.range.end) } diff --git a/vendor/regex-automata/src/util/prefilter/mod.rs b/vendor/regex-automata/src/util/prefilter/mod.rs index 51fc92233..d20442a69 100644 --- a/vendor/regex-automata/src/util/prefilter/mod.rs +++ b/vendor/regex-automata/src/util/prefilter/mod.rs @@ -146,6 +146,8 @@ pub struct Prefilter { pre: Arc, #[cfg(feature = "alloc")] is_fast: bool, + #[cfg(feature = "alloc")] + max_needle_len: usize, } impl Prefilter { @@ -202,12 +204,19 @@ impl Prefilter { kind: MatchKind, needles: &[B], ) -> Option { - Choice::new(kind, needles).and_then(Prefilter::from_choice) + Choice::new(kind, needles).and_then(|choice| { + let max_needle_len = + needles.iter().map(|b| b.as_ref().len()).max().unwrap_or(0); + Prefilter::from_choice(choice, max_needle_len) + }) } /// This turns a prefilter selection into a `Prefilter`. That is, in turns /// the enum given into a trait object. - fn from_choice(choice: Choice) -> Option { + fn from_choice( + choice: Choice, + max_needle_len: usize, + ) -> Option { #[cfg(not(feature = "alloc"))] { None @@ -224,7 +233,7 @@ impl Prefilter { Choice::AhoCorasick(p) => Arc::new(p), }; let is_fast = pre.is_fast(); - Some(Prefilter { pre, is_fast }) + Some(Prefilter { pre, is_fast, max_needle_len }) } } @@ -411,6 +420,20 @@ impl Prefilter { } } + /// Return the length of the longest needle + /// in this Prefilter + #[inline] + pub fn max_needle_len(&self) -> usize { + #[cfg(not(feature = "alloc"))] + { + unreachable!() + } + #[cfg(feature = "alloc")] + { + self.max_needle_len + } + } + /// Implementations might return true here if they believe themselves to /// be "fast." The concept of "fast" is deliberately left vague, but in /// practice this usually corresponds to whether it's believed that SIMD @@ -429,7 +452,7 @@ impl Prefilter { /// *know* a prefilter will be fast without actually trying the prefilter. /// (Which of course we cannot afford to do.) #[inline] - pub(crate) fn is_fast(&self) -> bool { + pub fn is_fast(&self) -> bool { #[cfg(not(feature = "alloc"))] { unreachable!() diff --git a/vendor/regex-automata/src/util/search.rs b/vendor/regex-automata/src/util/search.rs index 39aec522b..05b1cff54 100644 --- a/vendor/regex-automata/src/util/search.rs +++ b/vendor/regex-automata/src/util/search.rs @@ -110,9 +110,14 @@ impl<'h> Input<'h> { /// Create a new search configuration for the given haystack. #[inline] pub fn new>(haystack: &'h H) -> Input<'h> { + // Perform only one call to `haystack.as_ref()` to protect from incorrect + // implementations that return different values from multiple calls. + // This is important because there's code that relies on `span` not being + // out of bounds with respect to the stored `haystack`. + let haystack = haystack.as_ref(); Input { - haystack: haystack.as_ref(), - span: Span { start: 0, end: haystack.as_ref().len() }, + haystack, + span: Span { start: 0, end: haystack.len() }, anchored: Anchored::No, earliest: false, } @@ -1966,4 +1971,23 @@ mod tests { let expected_size = 3 * core::mem::size_of::(); assert_eq!(expected_size, core::mem::size_of::()); } + + #[test] + fn incorrect_asref_guard() { + struct Bad(std::cell::Cell); + + impl AsRef<[u8]> for Bad { + fn as_ref(&self) -> &[u8] { + if self.0.replace(false) { + &[] + } else { + &[0; 1000] + } + } + } + + let bad = Bad(std::cell::Cell::new(true)); + let input = Input::new(&bad); + assert!(input.end() <= input.haystack().len()); + } } diff --git a/vendor/regex/.cargo-checksum.json b/vendor/regex/.cargo-checksum.json index 5418949a5..c8bd4de33 100644 --- a/vendor/regex/.cargo-checksum.json +++ b/vendor/regex/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"e77650ae39a200cd7cb7aea153e5fbe03e68179af0d192416a395f0cf7e573e7","Cargo.toml":"a8d510f250e770370e021f8f5a4af09504b308ceb72311f32558b17a80958e22","Cross.toml":"4a11d6c63ecc919016b59fa0fe23674eb05682fb91ffbe677a4a7077e9e684ff","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"984b116bf94decdcb0fcdeb14641b332c9fe40da63e5a256dd39eb91a2e13387","UNICODE.md":"845fca1982e82e190109a784952579fce54faea120b702b7efd61164a12f601f","bench/README.md":"0aee42206b0e5edcb400a11faa2c536f512bcc6086e5ffdda001b9bfe4d19808","record/README.md":"02e6f85f8a43f18540e4a52a75d1001494df7aceac3873e9a13e3ceba190206d","record/compile-test/2023-04-19_1.7.3.csv":"460059ba2f10456175ff92bd75d4a365b14a1843e2b46e7b285d58da59e6d3ca","record/compile-test/2023-04-20_master.csv":"6b94df278e4ed82a3fd0d4bfe92a4614714e00435e983c7649ee9f54925f906e","record/compile-test/2023-07-05.csv":"cf00b4981b8c12980113810dba40e2063a8400354ad4dab16f7c212ff0b5db74","record/compile-test/README.md":"ba2b606993edd8d705ad1677ec954862614e52b028407e1908bb5dfb07767f2d","record/old-bench-log/01-lazy-dfa/dynamic":"dec9f74b8835403c71edc0c2d93bbdde0f5a0e37d46585e416c80496d5b14497","record/old-bench-log/01-lazy-dfa/dynamic-no-lazy-dfa":"c0ce02bef9ada8cd55672f0a9c3c5fc64f71e08bfb2b45978082a140b4fc111f","record/old-bench-log/01-lazy-dfa/native":"9de61ff787e36f5c6f1eaec68b8bb0583e57b0aad23712afe8c0048988c761b8","record/old-bench-log/01-lazy-dfa/nfa":"38c0be44a00b2caef17101bc425410fec2958e4df6da25d2ba5b6664f8bccad9","record/old-bench-log/01-lazy-dfa/pcre":"3b38026c24e4ca487ff62de83cc093ccb46b918f4875663249ff84ce27636942","record/old-bench-log/02-set/dynamic":"8ef5c00f0ac42e5f008e4b6337669527b48fba38df94c50d3e683c6aac66a48c","record/old-bench-log/03-bytes/onig":"f32347a6e0f25f46ad1b0aa736c29eca47c25f90d32c8823ea0d14204859a35b","record/old-bench-log/03-bytes/pcre":"b90982575c0ad55617b2ce50c2e9853d090502bf07e1eb19edf9009d3c9f2987","record/old-bench-log/03-bytes/rust":"b1e70e5ae48a9c726d8cd8a98019c0efe5a1095563c61cf0ac75e24de32461b4","record/old-bench-log/03-bytes/rust-bytes":"fbf0e6cb8102c7ca8e59bd459bb0ae7f1feaf8103def70b8d4793c59e68e8736","record/old-bench-log/04/onig":"4e34e2ede0a806b8ee540e63e4babee38049e5a8ab3be99c4f5d8b02bbc653fd","record/old-bench-log/04/pcre1-jit":"736c4941e991ef94f76379cf2187d0ea2a41b052cf80c94d0dd0c9ea758a6491","record/old-bench-log/04/pcre2-jit":"00e7bbf7749904fca8dff9b441d15bbe670f37b427e385ddf740f7a49de3b1fb","record/old-bench-log/04/re2":"b8b8595f6b68da127b56dc7c61a9fd15548251fda1be9d2c50c2d48382e887b6","record/old-bench-log/04/rust":"c5a6b918e815294f0c4e3d37267c444d49692ff131c5a08f7462c24d0721fcec","record/old-bench-log/04/tcl":"c4d8d12b8cf48ff2017549e95e49dc95a90ea15483834cd70d2d7d7c237bbd32","record/old-bench-log/05/onig":"70a4da9aafaefa6493cd09d3a529dd5d2d9eacf390bb093681bc7be28a1f926c","record/old-bench-log/05/onig-vs-rust":"b942a79735b7330241437776c15b18f4db3eff01d3e6c35494f4a8732e74a23a","record/old-bench-log/05/pcre1":"b29b7efbe79b55ce0aaf24bbbecc376a865fa219a68d96124e3d95951cdb47f4","record/old-bench-log/05/pcre1-vs-rust":"a458e5c62f0500898e08757753c10981551649656432ec096f0c82b414ef8d82","record/old-bench-log/05/pcre2":"faa93937c3490cfdff88c32dc04e57f2ae881923b87781e5fe876535fd690770","record/old-bench-log/05/pcre2-vs-rust":"bf9faa6a679dd98e9452e52c0941d2eb84dcf0b6632c15507f8334ed7bc309da","record/old-bench-log/05/re2":"692866b28e1bc368c7a59f519b8dfe1da50a135946ce153298a0ab228a5ee59d","record/old-bench-log/05/re2-vs-rust":"55e4cb14c397574751aebe38068c429a4580a5e309857b2715047944903dca58","record/old-bench-log/05/rust":"aac6acda9f63e51613712d0a33bb7fb46dfc7adc425f76b9b71195be8c8a42e7","record/old-bench-log/05/tcl":"f03e39eccd3252162cc6099bb0426014df669d299ba0ef79e89b8401886a5172","record/old-bench-log/05/tcl-vs-rust":"ae6ac4668573bf5488cc235c5da16ad9358d07b7644207d9bcea88ba6f5514a6","record/old-bench-log/06/dphobos-dmd":"473328306be335a0320c690d9c2dbefdf7f2f5a80e4ca69443c7ed2e81bb093f","record/old-bench-log/06/dphobos-dmd-ct":"60341c736382a6db21d9889369ea4617c521acbf30d4b3bf38bcd17f4f85b9b1","record/old-bench-log/06/dphobos-ldc":"ae60c2bed84afb89ae43615f26de4cc5d0042e179089b639507378518eed3252","record/old-bench-log/06/dphobos-ldc-ct":"a157ef450793b73de3a816fab1d93a6d11e90a817082bae5e3da02a66fcc833f","record/old-bench-log/06/pcre1":"ad10fd7db732e8670dd3d4eedb05f48f547b4782495aaadff8ec25a6ea1992a0","record/old-bench-log/06/pcre2":"f789a73bd41a0bc401bdebe7f10a03a8aa587de48643d88507d16181a8fa39d3","record/old-bench-log/06/re2":"203c273a110d71f5edf722630202a6142c39d6b7a9951686adf8b9c20c5db278","record/old-bench-log/06/rust":"6a642a16cd279c99ef5a580a25fb3a63ac6239cd73df9261c02912fa08145753","record/old-bench-log/07/boost":"255bc652c4d9e9d20aa9b22d8d86e952e7ec6c8b9fcde0c3d6e38c967e04d40e","record/old-bench-log/07/dphobos-dmd":"fb3ac60037050858611145ca3e71412164688dcdec52c022787d33304e022260","record/old-bench-log/07/dphobos-dmd-ct":"40a5088441f8ffe3dae0abaf31c105cedfbe3b56c06772f075947d504976d2ed","record/old-bench-log/07/oniguruma":"ae0cd60adb15845eb9ef706111d4ee0e6ad5a58f0276b787d68bd7d637f8f7c6","record/old-bench-log/07/pcre1":"a812d065ec248249f9bb3d6d970f15c18d342f6b443265ad4b07fa91b73575cc","record/old-bench-log/07/pcre2":"88230663eccd0b382cf5be81ce1ae6cfa3fa835a65a31c1eba4369d2e8de5d27","record/old-bench-log/07/re2":"e330ef21ce44351afc3c43821d862e9c625877606569f3af0ddbadcd7b21c602","record/old-bench-log/07/rust":"d8c6bd5c46f5df9d0ac222f7be7793527a8137d273c8826b3715c67e16209aac","record/old-bench-log/07/rust-bytes":"e21d02fa2ef1e5ed7204920b33ed24c9fb620e068ed47ed6879b72e76369a27e","record/old-bench-log/07/stdcpp":"9df02d89dc8232c700b8cf8bc6f1ece3ca7af84ab52e67a660039d6c9168aed4","record/old-bench-log/07/stdcpp-libcxx":"f90849a0b5dc11dc0280ad97886e92e1d91c080403ad7a4ecd638a26fe5e8c5e","record/old-bench-log/07/tcl":"7f6e347bb507f9c00ff664d3e627c0a9cf842b416eeb2af9f3b6cccd041c58e4","record/old-bench-log/08-new-memmem/rust-after-01":"646c7d50aea9c560a35eb60116f301f4fb8d4b03fd5814d8b24adffd070332e3","record/old-bench-log/08-new-memmem/rust-after-02":"14e7fb6c6faa85a8f90617528cef79ae382aeba07c2e5c253c68445902b060ba","record/old-bench-log/08-new-memmem/rust-before-01":"7e3b58de0f502c1a1bf6d27e0e85c654b1189716f7374cec4ed4dd365b13101f","record/old-bench-log/08-new-memmem/rust-before-02":"ab6d09529eeeca7ff0da945d59701dbbcfdec5e05581bb9bf154779d12a35e53","record/old-bench-log/09-new-baseline/pcre2":"28df8e2762f267d1ea628906a6e4bbc21f99e6a445bd322c86d0ca483b21b5b3","record/old-bench-log/09-new-baseline/re2":"421437193cc3f159c178479f98bde8dbe27883ec7757b1ddd8d745862f5899ff","record/old-bench-log/09-new-baseline/rust":"6f932a769171b6cdb717c9d01e44a70762ef660c4045b9d2bb3797a9bdf65405","record/old-bench-log/09-new-baseline/rust-bytes":"9c5acd5c1eeac9acfe76d03588041f9b6d65b4351085c3510888ceeb83e8a7b5","record/old-bench-log/10-last-frontier/rust-after-literal.log":"02baef9b3b49acbbff43e81f48ea5a9287e30ff4fc298a3f3b48991d8374aabf","record/old-bench-log/10-last-frontier/rust-before-literal.log":"e5a3bcc2b9e93cf3cb27bc9e6305b3bc03215751bbeef2a70fb25577d6b42874","record/old-bench-log/10-last-frontier/rust-bytes-after-literal.log":"29834c7a5396ac61acedd07c0b7ca60716865ec3e70f35fbaa7826a2309a79d9","record/old-bench-log/10-last-frontier/rust-bytes-before-literal.log":"4e7468a3e8629814bd4af91e2a8eb42d0899d352b5dff3058b801aa637046be2","record/old-bench-log/11-regex-1.7.3/rust":"d7cc18a62070ea7a999e1ba2458f26cf94595f1af276c2b3e96cee638eccf3f0","record/old-bench-log/11-regex-1.7.3/rust-bytes":"64c7458020139bd7a03d1cb0927b741e6972377b686626563acb86fbc66414ca","record/old-bench-log/12-regex-1.8.1/rust":"a538c42e77e20956e81fb5a4e2e1e7d3fdf60da019d7e3df52d93f57367a3fbd","record/old-bench-log/12-regex-1.8.1/rust-bytes":"fbb00fdf8f039ce312f5346a67dddaa5e129280a93a90d7aaf6b5a9a71d2f212","record/old-bench-log/13-regex-1.9.0/rust":"0ef62700ba3fc24887af74b7942490c90b4cd2814b8fda200f7376e43391bfce","record/old-bench-log/13-regex-1.9.0/rust-bytes":"676d501d4667f0a945c88ebb56839176dd3a5a6b45af7708b1e870bf26d12603","record/old-bench-log/README.md":"d359f536fb4b8c1af9af3465a027c3522f62c3871aad44645a955b650d7deec0","record/old-bench-log/old/01-before":"c2ea2750fca8ac1742003fe2106e9422d49e92967d3fe0267f24b7ec830b07e3","record/old-bench-log/old/02-new-syntax-crate":"27fd8b3d35cf08d434035ff7d9f2e9e3c94a167e45ba655567c73ae96830f1d8","record/old-bench-log/old/03-new-syntax-crate":"d942a2b95c3a2d8f85f3f17934f258bdc84baa33e91986e8a6810ca8d6e9cc50","record/old-bench-log/old/04-fixed-benchmark":"0da29ef39ac07ece411c151ab479a76944946aba992547b15d90ec2d5484e85c","record/old-bench-log/old/05-thread-caching":"e364d87131e43187d6757426839789d1b6b47b3f3af21280daa9193d5ab19f64","record/old-bench-log/old/06-major-dynamic":"3bc2b8fd2714ae9f19b2e4f4219654982522daf01b5d3055b4aec0458afeaf13","record/old-bench-log/old/06-major-macro":"d5617ed23e71d5298ed4d629eee257e401c352fd1c91a2048dfeb1677527d4e7","record/old-bench-log/old/07-prefix-improvements":"9277d1392c85a38db215a9b69e3b0cd4a9901f8f1c72c706ca262e5f099b8819","record/old-bench-log/old/08-case-fixes":"f97cd3675cf5c967e4ca8841f2368e9eadf538b542bfe3035d31492afc5934bf","record/old-bench-log/old/09-before-compiler-rewrite":"b928686819dbd9aeaa6639b01b63a48428653f2f676a4e15d61cddec421e0389","record/old-bench-log/old/10-compiler-rewrite":"697b295ee377a5cb287d403593bfb8c078270b4e19e8d61d0b95b06ee7c903ab","record/old-bench-log/old/11-compiler-rewrite":"3f0ba494a0d82e7419285a9686474dc7763d4da0dd3faaa3bec3f624bbede481","record/old-bench-log/old/12-executor":"962e182f9a1cfddb8c0cd2d8c4681febef1430082c9a38e5373c9117b853e65e","record/old-bench-log/old/12-executor-bytes":"e01a1e878b44c80724e9bf09bb11210eeb8f01518ac7f0e3e7f2ee241281e500","record/old-bench-log/old/13-cache-byte-range-suffixes":"1d67d58a39f9177a79c26f3c6c2a1caaf51f085ce137711ab9ba74071c14680c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/builders.rs":"6dbff8c7ff7febe031dbef3eafe1f02a15112ff1ffd889761a21c10b0dd84f03","src/bytes.rs":"cce2b7012f5896cf82fc3086bf8128dc9efe2b69bf6917d041c1a171eabacdc0","src/error.rs":"4ac8361e900627a87a2ac78e5d475be17c455fe6850d1515bf5b874837c4ae25","src/find_byte.rs":"e17cd3b765467685946707840b92ea4e37d3c11081fbf316174a15858cd4bd99","src/lib.rs":"1be6ce04d4fce06a7e46bc006bbf536f5a7f82d97dc71e7f7489a6d2610f790b","src/pattern.rs":"5f37755a7c16902d861377645f57a20314961f86298d4b35ae6e1058ca4e9801","src/regex/bytes.rs":"0d5ae71d9963bc7492f8687508dcfdf05f9e5e01b2c10c350a281ec3ddefb062","src/regex/mod.rs":"c220b6dd7a5e1945f8e743d1dcd796c5f782c91b0c34eb9915c588174a517fe8","src/regex/string.rs":"e1f76e5f21597da6c76514b579a1fff8c061ecd134ac4ce16ab4cddc052b270d","src/regexset/bytes.rs":"6290dd81f47fb6cdbaa358be2340398a2a640320373d334e4c977bf30b5a9220","src/regexset/mod.rs":"c220b6dd7a5e1945f8e743d1dcd796c5f782c91b0c34eb9915c588174a517fe8","src/regexset/string.rs":"977bc167c48c7c99187599c5071ca197e61a56359d32a26b9dbc1b58a5ef1c4d","test":"c0122c20a2c9b7ba6e9a8aaeb2b7d9910315ef31063539949f28d9501ef3193c","testdata/README.md":"c0514501526560d7f6171eb6d982ad61b4527760cb38a4bfbe8e28036ff37b95","testdata/anchored.toml":"7a1b5cd81deed2099796a451bf764a3f9bd21f0d60c0fa46accd3a35666866f2","testdata/bytes.toml":"1d84179165fd25f3b94bd2bfbeb43fc8a162041f7bf98b717e0f85cef7fb652b","testdata/crazy.toml":"a146e2d2e23f1a57168979d9b1fc193c2ba38dca66294b61140d6d2a2958ec86","testdata/crlf.toml":"d19cf22756434d145dd20946c00af01c102a556a252070405c3c8294129d9ece","testdata/earliest.toml":"d561e643623ee1889b5b049fdcf3c7cb71b0c746d7eb822ddbd09d0acda2620b","testdata/empty.toml":"738dbe92fbd8971385a1cf3affb0e956e5b692c858b9b48439d718f10801c08e","testdata/expensive.toml":"5ce2f60209c99cdd2cdcb9d3069d1d5ca13d5e08a85e913efe57267b2f5f0e9d","testdata/flags.toml":"9a7e001808195c84f2a7d3e18bc0a82c7386e60f03a616e99af00c3f7f2c3fd4","testdata/fowler/basic.toml":"a82c7e233451cd7cfe0c3d817f3a1ab44478bb81ae62432efdd515fa8370275e","testdata/fowler/dat/README":"e53d6c37b5931cb26dc9ae4c40358eea63f7a469c4db6ca816c072a8ced6a61a","testdata/fowler/dat/basic.dat":"b1126dda59075c08f574987090273c9977790115f1e1941d0708c0b82b256905","testdata/fowler/dat/nullsubexpr.dat":"e5cd4145dffa8bc66f2d39079950b2bb7bae21a521514b83b557b92f4a871a9e","testdata/fowler/dat/repetition.dat":"2b8b2b191229a804fba49e6b888d8194bf488f7744057b550da9d95a2aa6617a","testdata/fowler/nullsubexpr.toml":"cd812e7e8fa0469253b34f0db93b5883c9d8b9740fc4f7825a38e7df880a4eed","testdata/fowler/repetition.toml":"8c09164f064b3db81309c53483863bdcec493781644de162416e9f485e772615","testdata/iter.toml":"6875460302974a5b3073a7304a865c45aba9653c54afea2c4d26e1ea248a81f7","testdata/leftmost-all.toml":"903bfbeff888b7664296f4d5aa367ce53d1dafe249ab0a3359223ae94d596396","testdata/line-terminator.toml":"02148068137b69d95587966917bdf0697bf7eb41ad6d47387f2eb30f67d04fd9","testdata/misc.toml":"32c9591655c6fb118dfefcb4de49a04820a63cb960533dfc2538cdaabf4f4047","testdata/multiline.toml":"eb07cf5427e6ddbcf61f4cc64c2d74ff41b5ef75ef857959651b20196f3cd157","testdata/no-unicode.toml":"d209da04506900fd5f69e48170cddaad0702355ac6176c3a75ab3ff96974457c","testdata/overlapping.toml":"5d96497a7233566d40b05ba22047e483fa8662e45515a9be86da45cf6c28703a","testdata/regex-lite.toml":"fecca7cc8c9cea2e1f84f846a89fd9b3ca7011c83698211a2eeda8924deb900c","testdata/regression.toml":"6006ef4fcfbfd7155ce5ce8b8427904f7261c5549396f20cb065c0294733686d","testdata/set.toml":"dfd265dc1aee80026e881616840df0236ae9abf12467d7ec0e141a52c236128c","testdata/substring.toml":"48122d9f3477ed81f95e3ad42c06e9bb25f849b66994601a75ceae0693b81866","testdata/unicode.toml":"7e4b013039b0cdd85fa73f32d15d096182fe901643d4e40c0910087a736cd46d","testdata/utf8.toml":"2eabce0582bcacb2073e08bbe7ca413f096d14d06e917b107949691e24f84b20","testdata/word-boundary-special.toml":"7d0ea2f796478d1ca2a6954430cb1cfbd04031a182f8611cb50a7c73e443ce33","testdata/word-boundary.toml":"51bc1c498ab825420340a2dd3e6623de4054937ba6d5020ff8cd14b1c1e45271","tests/fuzz/mod.rs":"7b01a803e1c0b5a45c062d493723553f263c57e269eade1475eb789694635d5c","tests/fuzz/testdata/crash-7eb3351f0965e5d6c1cb98aa8585949ef96531ff":"be4f42497ac9358eb020bf17cd8fdb9743691824e01d744504613ea2bfb2f663","tests/fuzz/testdata/crash-8760b19b25d74e3603d4c643e9c7404fdd3631f9":"19df9a1e1b5a3c0f31cc038b9f2991b161d8577b4a0c8b2fc391cdfecdb6dd85","tests/fuzz/testdata/crash-cd33b13df59ea9d74503986f9d32a270dd43cc04":"2fde1668e9e3e60943c28d97c01c90dd3d3882f48475f060ccaf961c228069e8","tests/fuzz/testdata/minimized-from-8760b19b25d74e3603d4c643e9c7404fdd3631f9":"c9e00f7a31453708560900aa51e358dd5551df494439860594be97bb1fb933ba","tests/fuzz/testdata/slow-unit-3ab758ea520027fefd3f00e1384d9aeef155739e":"4433011f7af46e855e843635cf24a49713bd5705f67176ed928f04d24eda1857","tests/fuzz/testdata/slow-unit-5345fccadf3812c53c3ccc7af5aa2741b7b2106c":"95782a847fc64e9cccdf76e9540b0d16ce80db5d05157a88b958b763f9b8479b","tests/fuzz/testdata/slow-unit-6bd643eec330166e4ada91da2d3f284268481085":"8ddff12288f6f20cc9d65db76bd8187834f64f844aad48a340d082555ad5cb56","tests/fuzz/testdata/slow-unit-93c73a43581f205f9aaffd9c17e52b34b17becd0":"eea6919a75fde163634b890e2253a0918cf0ba092357fa617f368bbfa131ba30","tests/fuzz/testdata/slow-unit-9ca9cc9929fee1fcbb847a78384effb8b98ea18a":"a806f73b900046977267acceb83b105bac7ee21ede2edc2927afe1e1f0149f00","tests/fuzz/testdata/slow-unit-b8a052f4254802edbe5f569b6ce6e9b6c927e9d6":"9540cf58241cde3bc0db8364e0ccff67ff1ff9721c85b0d2ca27354c0cbf2650","tests/lib.rs":"9bffc95568c09ac95b6a3e7ca64b6e858a0552d0c0b0fca2c447da3b9c0a45a2","tests/misc.rs":"5ac5858325451e1d70f308ca0bcead5a354d095a7473800c11065231c319c456","tests/regression.rs":"3490aac99fdbf3f0949ba1f338d5184a84b505ebd96d0b6d6145c610587aa60b","tests/regression_fuzz.rs":"57e0bcba0fdfa7797865e35ae547cd7fe1c6132b80a7bfdfb06eb053a568b00d","tests/replace.rs":"78ff9bf7f78783ad83a78041bb7ee0705c7efc85b4d12301581d0ce5b2a59325","tests/searcher.rs":"04152e5c86431deec0c196d2564a11bc4ec36f14c77e8c16a2f9d1cbc9fc574e","tests/suite_bytes.rs":"7697b04e5b181aa78b3654bd2dbe1c792d9626197573ed8c649f1da8b481817d","tests/suite_bytes_set.rs":"d970168fab57a9edc60ff26a2bb7d0cc714d4298e4ee9eadba9da44a6569f2bb","tests/suite_string.rs":"1be0cf8922171f8323f99e8ecedbbf1846d339620d0dc2fd490901cbbbd2622e","tests/suite_string_set.rs":"22743107206d913521f9adb728482aed3a9625ff7b15a83df057bbf1f7050e03"},"package":"380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"} \ No newline at end of file +{"files":{"CHANGELOG.md":"83951c87d85883eca89c05b8295fda12164b4496af8a03afed8604eb3489074e","Cargo.toml":"6a753f0cb2d88fd6fbccaadb3517d3b418a2416de2bf3036eb38b2f8648f3b37","Cross.toml":"4a11d6c63ecc919016b59fa0fe23674eb05682fb91ffbe677a4a7077e9e684ff","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"984b116bf94decdcb0fcdeb14641b332c9fe40da63e5a256dd39eb91a2e13387","UNICODE.md":"845fca1982e82e190109a784952579fce54faea120b702b7efd61164a12f601f","bench/README.md":"0aee42206b0e5edcb400a11faa2c536f512bcc6086e5ffdda001b9bfe4d19808","record/README.md":"02e6f85f8a43f18540e4a52a75d1001494df7aceac3873e9a13e3ceba190206d","record/compile-test/2023-04-19_1.7.3.csv":"460059ba2f10456175ff92bd75d4a365b14a1843e2b46e7b285d58da59e6d3ca","record/compile-test/2023-04-20_master.csv":"6b94df278e4ed82a3fd0d4bfe92a4614714e00435e983c7649ee9f54925f906e","record/compile-test/2023-07-05.csv":"cf00b4981b8c12980113810dba40e2063a8400354ad4dab16f7c212ff0b5db74","record/compile-test/README.md":"ba2b606993edd8d705ad1677ec954862614e52b028407e1908bb5dfb07767f2d","record/old-bench-log/01-lazy-dfa/dynamic":"dec9f74b8835403c71edc0c2d93bbdde0f5a0e37d46585e416c80496d5b14497","record/old-bench-log/01-lazy-dfa/dynamic-no-lazy-dfa":"c0ce02bef9ada8cd55672f0a9c3c5fc64f71e08bfb2b45978082a140b4fc111f","record/old-bench-log/01-lazy-dfa/native":"9de61ff787e36f5c6f1eaec68b8bb0583e57b0aad23712afe8c0048988c761b8","record/old-bench-log/01-lazy-dfa/nfa":"38c0be44a00b2caef17101bc425410fec2958e4df6da25d2ba5b6664f8bccad9","record/old-bench-log/01-lazy-dfa/pcre":"3b38026c24e4ca487ff62de83cc093ccb46b918f4875663249ff84ce27636942","record/old-bench-log/02-set/dynamic":"8ef5c00f0ac42e5f008e4b6337669527b48fba38df94c50d3e683c6aac66a48c","record/old-bench-log/03-bytes/onig":"f32347a6e0f25f46ad1b0aa736c29eca47c25f90d32c8823ea0d14204859a35b","record/old-bench-log/03-bytes/pcre":"b90982575c0ad55617b2ce50c2e9853d090502bf07e1eb19edf9009d3c9f2987","record/old-bench-log/03-bytes/rust":"b1e70e5ae48a9c726d8cd8a98019c0efe5a1095563c61cf0ac75e24de32461b4","record/old-bench-log/03-bytes/rust-bytes":"fbf0e6cb8102c7ca8e59bd459bb0ae7f1feaf8103def70b8d4793c59e68e8736","record/old-bench-log/04/onig":"4e34e2ede0a806b8ee540e63e4babee38049e5a8ab3be99c4f5d8b02bbc653fd","record/old-bench-log/04/pcre1-jit":"736c4941e991ef94f76379cf2187d0ea2a41b052cf80c94d0dd0c9ea758a6491","record/old-bench-log/04/pcre2-jit":"00e7bbf7749904fca8dff9b441d15bbe670f37b427e385ddf740f7a49de3b1fb","record/old-bench-log/04/re2":"b8b8595f6b68da127b56dc7c61a9fd15548251fda1be9d2c50c2d48382e887b6","record/old-bench-log/04/rust":"c5a6b918e815294f0c4e3d37267c444d49692ff131c5a08f7462c24d0721fcec","record/old-bench-log/04/tcl":"c4d8d12b8cf48ff2017549e95e49dc95a90ea15483834cd70d2d7d7c237bbd32","record/old-bench-log/05/onig":"70a4da9aafaefa6493cd09d3a529dd5d2d9eacf390bb093681bc7be28a1f926c","record/old-bench-log/05/onig-vs-rust":"b942a79735b7330241437776c15b18f4db3eff01d3e6c35494f4a8732e74a23a","record/old-bench-log/05/pcre1":"b29b7efbe79b55ce0aaf24bbbecc376a865fa219a68d96124e3d95951cdb47f4","record/old-bench-log/05/pcre1-vs-rust":"a458e5c62f0500898e08757753c10981551649656432ec096f0c82b414ef8d82","record/old-bench-log/05/pcre2":"faa93937c3490cfdff88c32dc04e57f2ae881923b87781e5fe876535fd690770","record/old-bench-log/05/pcre2-vs-rust":"bf9faa6a679dd98e9452e52c0941d2eb84dcf0b6632c15507f8334ed7bc309da","record/old-bench-log/05/re2":"692866b28e1bc368c7a59f519b8dfe1da50a135946ce153298a0ab228a5ee59d","record/old-bench-log/05/re2-vs-rust":"55e4cb14c397574751aebe38068c429a4580a5e309857b2715047944903dca58","record/old-bench-log/05/rust":"aac6acda9f63e51613712d0a33bb7fb46dfc7adc425f76b9b71195be8c8a42e7","record/old-bench-log/05/tcl":"f03e39eccd3252162cc6099bb0426014df669d299ba0ef79e89b8401886a5172","record/old-bench-log/05/tcl-vs-rust":"ae6ac4668573bf5488cc235c5da16ad9358d07b7644207d9bcea88ba6f5514a6","record/old-bench-log/06/dphobos-dmd":"473328306be335a0320c690d9c2dbefdf7f2f5a80e4ca69443c7ed2e81bb093f","record/old-bench-log/06/dphobos-dmd-ct":"60341c736382a6db21d9889369ea4617c521acbf30d4b3bf38bcd17f4f85b9b1","record/old-bench-log/06/dphobos-ldc":"ae60c2bed84afb89ae43615f26de4cc5d0042e179089b639507378518eed3252","record/old-bench-log/06/dphobos-ldc-ct":"a157ef450793b73de3a816fab1d93a6d11e90a817082bae5e3da02a66fcc833f","record/old-bench-log/06/pcre1":"ad10fd7db732e8670dd3d4eedb05f48f547b4782495aaadff8ec25a6ea1992a0","record/old-bench-log/06/pcre2":"f789a73bd41a0bc401bdebe7f10a03a8aa587de48643d88507d16181a8fa39d3","record/old-bench-log/06/re2":"203c273a110d71f5edf722630202a6142c39d6b7a9951686adf8b9c20c5db278","record/old-bench-log/06/rust":"6a642a16cd279c99ef5a580a25fb3a63ac6239cd73df9261c02912fa08145753","record/old-bench-log/07/boost":"255bc652c4d9e9d20aa9b22d8d86e952e7ec6c8b9fcde0c3d6e38c967e04d40e","record/old-bench-log/07/dphobos-dmd":"fb3ac60037050858611145ca3e71412164688dcdec52c022787d33304e022260","record/old-bench-log/07/dphobos-dmd-ct":"40a5088441f8ffe3dae0abaf31c105cedfbe3b56c06772f075947d504976d2ed","record/old-bench-log/07/oniguruma":"ae0cd60adb15845eb9ef706111d4ee0e6ad5a58f0276b787d68bd7d637f8f7c6","record/old-bench-log/07/pcre1":"a812d065ec248249f9bb3d6d970f15c18d342f6b443265ad4b07fa91b73575cc","record/old-bench-log/07/pcre2":"88230663eccd0b382cf5be81ce1ae6cfa3fa835a65a31c1eba4369d2e8de5d27","record/old-bench-log/07/re2":"e330ef21ce44351afc3c43821d862e9c625877606569f3af0ddbadcd7b21c602","record/old-bench-log/07/rust":"d8c6bd5c46f5df9d0ac222f7be7793527a8137d273c8826b3715c67e16209aac","record/old-bench-log/07/rust-bytes":"e21d02fa2ef1e5ed7204920b33ed24c9fb620e068ed47ed6879b72e76369a27e","record/old-bench-log/07/stdcpp":"9df02d89dc8232c700b8cf8bc6f1ece3ca7af84ab52e67a660039d6c9168aed4","record/old-bench-log/07/stdcpp-libcxx":"f90849a0b5dc11dc0280ad97886e92e1d91c080403ad7a4ecd638a26fe5e8c5e","record/old-bench-log/07/tcl":"7f6e347bb507f9c00ff664d3e627c0a9cf842b416eeb2af9f3b6cccd041c58e4","record/old-bench-log/08-new-memmem/rust-after-01":"646c7d50aea9c560a35eb60116f301f4fb8d4b03fd5814d8b24adffd070332e3","record/old-bench-log/08-new-memmem/rust-after-02":"14e7fb6c6faa85a8f90617528cef79ae382aeba07c2e5c253c68445902b060ba","record/old-bench-log/08-new-memmem/rust-before-01":"7e3b58de0f502c1a1bf6d27e0e85c654b1189716f7374cec4ed4dd365b13101f","record/old-bench-log/08-new-memmem/rust-before-02":"ab6d09529eeeca7ff0da945d59701dbbcfdec5e05581bb9bf154779d12a35e53","record/old-bench-log/09-new-baseline/pcre2":"28df8e2762f267d1ea628906a6e4bbc21f99e6a445bd322c86d0ca483b21b5b3","record/old-bench-log/09-new-baseline/re2":"421437193cc3f159c178479f98bde8dbe27883ec7757b1ddd8d745862f5899ff","record/old-bench-log/09-new-baseline/rust":"6f932a769171b6cdb717c9d01e44a70762ef660c4045b9d2bb3797a9bdf65405","record/old-bench-log/09-new-baseline/rust-bytes":"9c5acd5c1eeac9acfe76d03588041f9b6d65b4351085c3510888ceeb83e8a7b5","record/old-bench-log/10-last-frontier/rust-after-literal.log":"02baef9b3b49acbbff43e81f48ea5a9287e30ff4fc298a3f3b48991d8374aabf","record/old-bench-log/10-last-frontier/rust-before-literal.log":"e5a3bcc2b9e93cf3cb27bc9e6305b3bc03215751bbeef2a70fb25577d6b42874","record/old-bench-log/10-last-frontier/rust-bytes-after-literal.log":"29834c7a5396ac61acedd07c0b7ca60716865ec3e70f35fbaa7826a2309a79d9","record/old-bench-log/10-last-frontier/rust-bytes-before-literal.log":"4e7468a3e8629814bd4af91e2a8eb42d0899d352b5dff3058b801aa637046be2","record/old-bench-log/11-regex-1.7.3/rust":"d7cc18a62070ea7a999e1ba2458f26cf94595f1af276c2b3e96cee638eccf3f0","record/old-bench-log/11-regex-1.7.3/rust-bytes":"64c7458020139bd7a03d1cb0927b741e6972377b686626563acb86fbc66414ca","record/old-bench-log/12-regex-1.8.1/rust":"a538c42e77e20956e81fb5a4e2e1e7d3fdf60da019d7e3df52d93f57367a3fbd","record/old-bench-log/12-regex-1.8.1/rust-bytes":"fbb00fdf8f039ce312f5346a67dddaa5e129280a93a90d7aaf6b5a9a71d2f212","record/old-bench-log/13-regex-1.9.0/rust":"0ef62700ba3fc24887af74b7942490c90b4cd2814b8fda200f7376e43391bfce","record/old-bench-log/13-regex-1.9.0/rust-bytes":"676d501d4667f0a945c88ebb56839176dd3a5a6b45af7708b1e870bf26d12603","record/old-bench-log/README.md":"d359f536fb4b8c1af9af3465a027c3522f62c3871aad44645a955b650d7deec0","record/old-bench-log/old/01-before":"c2ea2750fca8ac1742003fe2106e9422d49e92967d3fe0267f24b7ec830b07e3","record/old-bench-log/old/02-new-syntax-crate":"27fd8b3d35cf08d434035ff7d9f2e9e3c94a167e45ba655567c73ae96830f1d8","record/old-bench-log/old/03-new-syntax-crate":"d942a2b95c3a2d8f85f3f17934f258bdc84baa33e91986e8a6810ca8d6e9cc50","record/old-bench-log/old/04-fixed-benchmark":"0da29ef39ac07ece411c151ab479a76944946aba992547b15d90ec2d5484e85c","record/old-bench-log/old/05-thread-caching":"e364d87131e43187d6757426839789d1b6b47b3f3af21280daa9193d5ab19f64","record/old-bench-log/old/06-major-dynamic":"3bc2b8fd2714ae9f19b2e4f4219654982522daf01b5d3055b4aec0458afeaf13","record/old-bench-log/old/06-major-macro":"d5617ed23e71d5298ed4d629eee257e401c352fd1c91a2048dfeb1677527d4e7","record/old-bench-log/old/07-prefix-improvements":"9277d1392c85a38db215a9b69e3b0cd4a9901f8f1c72c706ca262e5f099b8819","record/old-bench-log/old/08-case-fixes":"f97cd3675cf5c967e4ca8841f2368e9eadf538b542bfe3035d31492afc5934bf","record/old-bench-log/old/09-before-compiler-rewrite":"b928686819dbd9aeaa6639b01b63a48428653f2f676a4e15d61cddec421e0389","record/old-bench-log/old/10-compiler-rewrite":"697b295ee377a5cb287d403593bfb8c078270b4e19e8d61d0b95b06ee7c903ab","record/old-bench-log/old/11-compiler-rewrite":"3f0ba494a0d82e7419285a9686474dc7763d4da0dd3faaa3bec3f624bbede481","record/old-bench-log/old/12-executor":"962e182f9a1cfddb8c0cd2d8c4681febef1430082c9a38e5373c9117b853e65e","record/old-bench-log/old/12-executor-bytes":"e01a1e878b44c80724e9bf09bb11210eeb8f01518ac7f0e3e7f2ee241281e500","record/old-bench-log/old/13-cache-byte-range-suffixes":"1d67d58a39f9177a79c26f3c6c2a1caaf51f085ce137711ab9ba74071c14680c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/builders.rs":"6dbff8c7ff7febe031dbef3eafe1f02a15112ff1ffd889761a21c10b0dd84f03","src/bytes.rs":"cce2b7012f5896cf82fc3086bf8128dc9efe2b69bf6917d041c1a171eabacdc0","src/error.rs":"4ac8361e900627a87a2ac78e5d475be17c455fe6850d1515bf5b874837c4ae25","src/find_byte.rs":"e17cd3b765467685946707840b92ea4e37d3c11081fbf316174a15858cd4bd99","src/lib.rs":"1be6ce04d4fce06a7e46bc006bbf536f5a7f82d97dc71e7f7489a6d2610f790b","src/pattern.rs":"5f37755a7c16902d861377645f57a20314961f86298d4b35ae6e1058ca4e9801","src/regex/bytes.rs":"b97bae6e559948573eaccc93bc316885266302fd70057cf2fae5827e97825b07","src/regex/mod.rs":"c220b6dd7a5e1945f8e743d1dcd796c5f782c91b0c34eb9915c588174a517fe8","src/regex/string.rs":"edc0613e6cd6da6204549598dce089a66175b3e29baa7629466db85b51031137","src/regexset/bytes.rs":"6290dd81f47fb6cdbaa358be2340398a2a640320373d334e4c977bf30b5a9220","src/regexset/mod.rs":"c220b6dd7a5e1945f8e743d1dcd796c5f782c91b0c34eb9915c588174a517fe8","src/regexset/string.rs":"977bc167c48c7c99187599c5071ca197e61a56359d32a26b9dbc1b58a5ef1c4d","test":"c0122c20a2c9b7ba6e9a8aaeb2b7d9910315ef31063539949f28d9501ef3193c","testdata/README.md":"c0514501526560d7f6171eb6d982ad61b4527760cb38a4bfbe8e28036ff37b95","testdata/anchored.toml":"7a1b5cd81deed2099796a451bf764a3f9bd21f0d60c0fa46accd3a35666866f2","testdata/bytes.toml":"1d84179165fd25f3b94bd2bfbeb43fc8a162041f7bf98b717e0f85cef7fb652b","testdata/crazy.toml":"a146e2d2e23f1a57168979d9b1fc193c2ba38dca66294b61140d6d2a2958ec86","testdata/crlf.toml":"d19cf22756434d145dd20946c00af01c102a556a252070405c3c8294129d9ece","testdata/earliest.toml":"d561e643623ee1889b5b049fdcf3c7cb71b0c746d7eb822ddbd09d0acda2620b","testdata/empty.toml":"738dbe92fbd8971385a1cf3affb0e956e5b692c858b9b48439d718f10801c08e","testdata/expensive.toml":"5ce2f60209c99cdd2cdcb9d3069d1d5ca13d5e08a85e913efe57267b2f5f0e9d","testdata/flags.toml":"9a7e001808195c84f2a7d3e18bc0a82c7386e60f03a616e99af00c3f7f2c3fd4","testdata/fowler/basic.toml":"a82c7e233451cd7cfe0c3d817f3a1ab44478bb81ae62432efdd515fa8370275e","testdata/fowler/dat/README":"e53d6c37b5931cb26dc9ae4c40358eea63f7a469c4db6ca816c072a8ced6a61a","testdata/fowler/dat/basic.dat":"b1126dda59075c08f574987090273c9977790115f1e1941d0708c0b82b256905","testdata/fowler/dat/nullsubexpr.dat":"e5cd4145dffa8bc66f2d39079950b2bb7bae21a521514b83b557b92f4a871a9e","testdata/fowler/dat/repetition.dat":"2b8b2b191229a804fba49e6b888d8194bf488f7744057b550da9d95a2aa6617a","testdata/fowler/nullsubexpr.toml":"cd812e7e8fa0469253b34f0db93b5883c9d8b9740fc4f7825a38e7df880a4eed","testdata/fowler/repetition.toml":"8c09164f064b3db81309c53483863bdcec493781644de162416e9f485e772615","testdata/iter.toml":"6875460302974a5b3073a7304a865c45aba9653c54afea2c4d26e1ea248a81f7","testdata/leftmost-all.toml":"903bfbeff888b7664296f4d5aa367ce53d1dafe249ab0a3359223ae94d596396","testdata/line-terminator.toml":"02148068137b69d95587966917bdf0697bf7eb41ad6d47387f2eb30f67d04fd9","testdata/misc.toml":"32c9591655c6fb118dfefcb4de49a04820a63cb960533dfc2538cdaabf4f4047","testdata/multiline.toml":"eb07cf5427e6ddbcf61f4cc64c2d74ff41b5ef75ef857959651b20196f3cd157","testdata/no-unicode.toml":"d209da04506900fd5f69e48170cddaad0702355ac6176c3a75ab3ff96974457c","testdata/overlapping.toml":"5d96497a7233566d40b05ba22047e483fa8662e45515a9be86da45cf6c28703a","testdata/regex-lite.toml":"fecca7cc8c9cea2e1f84f846a89fd9b3ca7011c83698211a2eeda8924deb900c","testdata/regression.toml":"6006ef4fcfbfd7155ce5ce8b8427904f7261c5549396f20cb065c0294733686d","testdata/set.toml":"dfd265dc1aee80026e881616840df0236ae9abf12467d7ec0e141a52c236128c","testdata/substring.toml":"48122d9f3477ed81f95e3ad42c06e9bb25f849b66994601a75ceae0693b81866","testdata/unicode.toml":"7e4b013039b0cdd85fa73f32d15d096182fe901643d4e40c0910087a736cd46d","testdata/utf8.toml":"2eabce0582bcacb2073e08bbe7ca413f096d14d06e917b107949691e24f84b20","testdata/word-boundary-special.toml":"7d0ea2f796478d1ca2a6954430cb1cfbd04031a182f8611cb50a7c73e443ce33","testdata/word-boundary.toml":"51bc1c498ab825420340a2dd3e6623de4054937ba6d5020ff8cd14b1c1e45271","tests/fuzz/mod.rs":"7b01a803e1c0b5a45c062d493723553f263c57e269eade1475eb789694635d5c","tests/fuzz/testdata/crash-7eb3351f0965e5d6c1cb98aa8585949ef96531ff":"be4f42497ac9358eb020bf17cd8fdb9743691824e01d744504613ea2bfb2f663","tests/fuzz/testdata/crash-8760b19b25d74e3603d4c643e9c7404fdd3631f9":"19df9a1e1b5a3c0f31cc038b9f2991b161d8577b4a0c8b2fc391cdfecdb6dd85","tests/fuzz/testdata/crash-cd33b13df59ea9d74503986f9d32a270dd43cc04":"2fde1668e9e3e60943c28d97c01c90dd3d3882f48475f060ccaf961c228069e8","tests/fuzz/testdata/minimized-from-8760b19b25d74e3603d4c643e9c7404fdd3631f9":"c9e00f7a31453708560900aa51e358dd5551df494439860594be97bb1fb933ba","tests/fuzz/testdata/slow-unit-3ab758ea520027fefd3f00e1384d9aeef155739e":"4433011f7af46e855e843635cf24a49713bd5705f67176ed928f04d24eda1857","tests/fuzz/testdata/slow-unit-5345fccadf3812c53c3ccc7af5aa2741b7b2106c":"95782a847fc64e9cccdf76e9540b0d16ce80db5d05157a88b958b763f9b8479b","tests/fuzz/testdata/slow-unit-6bd643eec330166e4ada91da2d3f284268481085":"8ddff12288f6f20cc9d65db76bd8187834f64f844aad48a340d082555ad5cb56","tests/fuzz/testdata/slow-unit-93c73a43581f205f9aaffd9c17e52b34b17becd0":"eea6919a75fde163634b890e2253a0918cf0ba092357fa617f368bbfa131ba30","tests/fuzz/testdata/slow-unit-9ca9cc9929fee1fcbb847a78384effb8b98ea18a":"a806f73b900046977267acceb83b105bac7ee21ede2edc2927afe1e1f0149f00","tests/fuzz/testdata/slow-unit-b8a052f4254802edbe5f569b6ce6e9b6c927e9d6":"9540cf58241cde3bc0db8364e0ccff67ff1ff9721c85b0d2ca27354c0cbf2650","tests/lib.rs":"9bffc95568c09ac95b6a3e7ca64b6e858a0552d0c0b0fca2c447da3b9c0a45a2","tests/misc.rs":"5ac5858325451e1d70f308ca0bcead5a354d095a7473800c11065231c319c456","tests/regression.rs":"3490aac99fdbf3f0949ba1f338d5184a84b505ebd96d0b6d6145c610587aa60b","tests/regression_fuzz.rs":"57e0bcba0fdfa7797865e35ae547cd7fe1c6132b80a7bfdfb06eb053a568b00d","tests/replace.rs":"78ff9bf7f78783ad83a78041bb7ee0705c7efc85b4d12301581d0ce5b2a59325","tests/searcher.rs":"04152e5c86431deec0c196d2564a11bc4ec36f14c77e8c16a2f9d1cbc9fc574e","tests/suite_bytes.rs":"7697b04e5b181aa78b3654bd2dbe1c792d9626197573ed8c649f1da8b481817d","tests/suite_bytes_set.rs":"d970168fab57a9edc60ff26a2bb7d0cc714d4298e4ee9eadba9da44a6569f2bb","tests/suite_string.rs":"1be0cf8922171f8323f99e8ecedbbf1846d339620d0dc2fd490901cbbbd2622e","tests/suite_string_set.rs":"22743107206d913521f9adb728482aed3a9625ff7b15a83df057bbf1f7050e03"},"package":"b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"} \ No newline at end of file diff --git a/vendor/regex/CHANGELOG.md b/vendor/regex/CHANGELOG.md index 420e08f74..3ffd961d7 100644 --- a/vendor/regex/CHANGELOG.md +++ b/vendor/regex/CHANGELOG.md @@ -1,3 +1,16 @@ +1.10.3 (2024-01-21) +=================== +This is a new patch release that fixes the feature configuration of optional +dependencies, and fixes an unsound use of bounds check elision. + +Bug fixes: + +* [BUG #1147](https://github.com/rust-lang/regex/issues/1147): +Set `default-features=false` for the `memchr` and `aho-corasick` dependencies. +* [BUG #1154](https://github.com/rust-lang/regex/pull/1154): +Fix unsound bounds check elision. + + 1.10.2 (2023-10-16) =================== This is a new patch release that fixes a search regression where incorrect diff --git a/vendor/regex/Cargo.toml b/vendor/regex/Cargo.toml index f514d3539..dc035bc35 100644 --- a/vendor/regex/Cargo.toml +++ b/vendor/regex/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.65" name = "regex" -version = "1.10.2" +version = "1.10.3" authors = [ "The Rust Project Developers", "Andrew Gallant ", @@ -62,13 +62,15 @@ path = "tests/lib.rs" [dependencies.aho-corasick] version = "1.0.0" optional = true +default-features = false [dependencies.memchr] version = "2.6.0" optional = true +default-features = false [dependencies.regex-automata] -version = "0.4.3" +version = "0.4.4" features = [ "alloc", "syntax", diff --git a/vendor/regex/src/regex/bytes.rs b/vendor/regex/src/regex/bytes.rs index 19f5701af..ea4f7cd65 100644 --- a/vendor/regex/src/regex/bytes.rs +++ b/vendor/regex/src/regex/bytes.rs @@ -1568,10 +1568,15 @@ impl<'h> From> for core::ops::Range { /// Represents the capture groups for a single match. /// -/// Capture groups refer to parts of a regex enclosed in parentheses. They can -/// be optionally named. The purpose of capture groups is to be able to -/// reference different parts of a match based on the original pattern. For -/// example, say you want to match the individual letters in a 5-letter word: +/// Capture groups refer to parts of a regex enclosed in parentheses. They +/// can be optionally named. The purpose of capture groups is to be able to +/// reference different parts of a match based on the original pattern. In +/// essence, a `Captures` is a container of [`Match`] values for each group +/// that participated in a regex match. Each `Match` can be looked up by either +/// its capture group index or name (if it has one). +/// +/// For example, say you want to match the individual letters in a 5-letter +/// word: /// /// ```text /// (?\w)(\w)(?:\w)\w(?\w) @@ -1984,7 +1989,7 @@ impl<'h> core::ops::Index for Captures<'h> { /// The haystack substring returned can't outlive the `Captures` object if this /// method is used, because of how `Index` is defined (normally `a[i]` is part /// of `a` and can't outlive it). To work around this limitation, do that, use -/// [`Captures::get`] instead. +/// [`Captures::name`] instead. /// /// `'h` is the lifetime of the matched haystack, but the lifetime of the /// `&str` returned by this implementation is the lifetime of the `Captures` diff --git a/vendor/regex/src/regex/string.rs b/vendor/regex/src/regex/string.rs index 880d6082a..824f45c69 100644 --- a/vendor/regex/src/regex/string.rs +++ b/vendor/regex/src/regex/string.rs @@ -1573,10 +1573,15 @@ impl<'h> From> for core::ops::Range { /// Represents the capture groups for a single match. /// -/// Capture groups refer to parts of a regex enclosed in parentheses. They can -/// be optionally named. The purpose of capture groups is to be able to -/// reference different parts of a match based on the original pattern. For -/// example, say you want to match the individual letters in a 5-letter word: +/// Capture groups refer to parts of a regex enclosed in parentheses. They +/// can be optionally named. The purpose of capture groups is to be able to +/// reference different parts of a match based on the original pattern. In +/// essence, a `Captures` is a container of [`Match`] values for each group +/// that participated in a regex match. Each `Match` can be looked up by either +/// its capture group index or name (if it has one). +/// +/// For example, say you want to match the individual letters in a 5-letter +/// word: /// /// ```text /// (?\w)(\w)(?:\w)\w(?\w) @@ -1987,7 +1992,7 @@ impl<'h> core::ops::Index for Captures<'h> { /// The haystack substring returned can't outlive the `Captures` object if this /// method is used, because of how `Index` is defined (normally `a[i]` is part /// of `a` and can't outlive it). To work around this limitation, do that, use -/// [`Captures::get`] instead. +/// [`Captures::name`] instead. /// /// `'h` is the lifetime of the matched haystack, but the lifetime of the /// `&str` returned by this implementation is the lifetime of the `Captures` diff --git a/vendor/rustix/.cargo-checksum.json b/vendor/rustix/.cargo-checksum.json index 0a08ec797..56e871ee0 100644 --- a/vendor/rustix/.cargo-checksum.json +++ b/vendor/rustix/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CODE_OF_CONDUCT.md":"f210602311e3f74b32f46237fd55f4ce36d798e85e3db1432ec667f63a7ffc44","CONTRIBUTING.md":"3fd57de5c678db1c972da676a8231d2fde9820695ef1f0d53f1e55a3e81d9de0","COPYRIGHT":"377c2e7c53250cc5905c0b0532d35973392af16ffb9596a41d99d202cf3617c9","Cargo.toml":"1b9147c312c90f34e2cd309fe687860dff2bb490e3424c938c788bd4b75e8bce","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"fce34da91981eafa61d376be05f2f8d9619b2c0eb4795913f57a4eb37be9009e","SECURITY.md":"4d75afb09dd28eb5982e3a1f768ee398d90204669ceef3240a16b31dcf04148a","benches/mod.rs":"e260e67273aa0a37cffdc5cd451699335b8ee656c17275a0d0f2b4563c6018ca","build.rs":"5f93559819ca7fe233f01579d51ff5b58cb6e96ef9e7817a3358a9b410d5bbf6","src/backend/libc/c.rs":"985d441769f1f5d8ed36bce0517504e9a72aaed2ae8bc53235c45382dbe4d198","src/backend/libc/conv.rs":"b66d080db3a4c2756fe722462b543982bf88e5bc8071b9dc98d28ec2aee3dbfc","src/backend/libc/event/epoll.rs":"151fea9151a5a8f17d4d139053b38cffae30701a69ad507f71e666c3dfbca869","src/backend/libc/event/mod.rs":"7f8547c599b8263eb791890bbe4a0b22fe2676d007ffdcc3e07b2e48d1c994db","src/backend/libc/event/poll_fd.rs":"280303b4be61600fa2e25fe59f10dc4e7010942286f6fb7cca93954ab63e01d9","src/backend/libc/event/syscalls.rs":"f91bbe7d222987c89a2647817f6819dd536cbc4a685dfb794f403543c32df777","src/backend/libc/event/types.rs":"b966e0a3a018ca2ce507371be900fc73b2814cca450b784583207ad2df473f13","src/backend/libc/event/windows_syscalls.rs":"ebfac665c6676c4b803134ab8806be8aa2e96bdbc7799a19c544cd9069b35787","src/backend/libc/fs/dir.rs":"9dff590f81fa0bbbc37444c58ebf8fd4f5693bae4453ad6bfafd751c74b091b8","src/backend/libc/fs/inotify.rs":"a027a718db8bf6ff9a778c2cfa706850b466240b0a2296d72b9834c0096968e8","src/backend/libc/fs/makedev.rs":"89c679a0ef18dd41b3c6223bce0f329ad35bf6cadbf16e47b33fad3f312ba4a6","src/backend/libc/fs/mod.rs":"3d28b803011b57da6315bb747daf0117218687c0cc610358f5dafddf0b7d44d3","src/backend/libc/fs/syscalls.rs":"56a9e8367d3b41b04f1795a12cf5099d5812ab654901168d30545c8e1cba1dce","src/backend/libc/fs/types.rs":"ca25c8271e1fd2ff6c28082884ca112fd5e0523b2aa3cd289cd9a399c962a172","src/backend/libc/io/errno.rs":"d33978855c2e0e97d5e1f7a04ab10894f9f2c3e329e949f259a757f89942074e","src/backend/libc/io/mod.rs":"746647bd864e4ec7717925b6d176cebdb392b7d015070244cc48d92780351dd6","src/backend/libc/io/syscalls.rs":"cbd9e9db566597de0a709247c8ba3bd1e6ce266a128d639273353c706f0592b7","src/backend/libc/io/types.rs":"2efd39bb3df19a9db5496217284f3d2235ddb354fac81dd71861109a56bede0b","src/backend/libc/io/windows_syscalls.rs":"fab3fa099aa89cea56a6edc651dd37750e581534f4f45b04a7e425f130b08468","src/backend/libc/io_uring/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/io_uring/syscalls.rs":"5af8146d5971c833e6fd657f652c618b31f854e1b0811864fba9b658cb633e19","src/backend/libc/mm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/mm/syscalls.rs":"c04c61ad3d7f3b24d13f89144d7fa0a05658cea4763207f9250db4f9362de2fe","src/backend/libc/mm/types.rs":"55478e173b7d82e2c85934fc0dda79c29f46a305228df78f1e90c68ac9d3cfec","src/backend/libc/mod.rs":"778083f85aaca00aa5c8ec36b541e0e8a3e693660a6acf4722b4508f015c278c","src/backend/libc/mount/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/mount/syscalls.rs":"1bc87501a078616d0190d2e85de55f3f968b8cb79d49bd9eb839a350eed26089","src/backend/libc/mount/types.rs":"7e663362dc31c70d966ea9aaf035d3b1cb2f5928546b608243e16e4fcaf50857","src/backend/libc/net/addr.rs":"9bdc2febb20785bc26a820eaba52cb546c67c79cb547f08105087cd0f79d5861","src/backend/libc/net/ext.rs":"0dd64877abe1ba86b47a2ab34340e3f6cc7b53b22d0bb5e237daf6a82edd46b0","src/backend/libc/net/mod.rs":"5f0bd80a6575aba4a714443ca99af76ad15b053f1f8029aa1d9c7fa10e6d9242","src/backend/libc/net/msghdr.rs":"64825203c09cb60ac4e869cd27a44697f1efe53455c41684279d50d8f0a96701","src/backend/libc/net/read_sockaddr.rs":"b1a72b7bd56cd152ed0731f571e4d9411b2974f860fc045319dc74b5b077e569","src/backend/libc/net/send_recv.rs":"1450ca958431a5bf3a85cdeef88b387f30d5c1215de2c56d164ccda38f21b36c","src/backend/libc/net/sockopt.rs":"178a6622bab25bf1813d6c17151f48d820e238db8cbd05be3aae563902d6c53e","src/backend/libc/net/syscalls.rs":"654b820d4d1240be1c6a1c56a2cd00d4743bcdf92527054d1000fa1b7ce4594f","src/backend/libc/net/write_sockaddr.rs":"6f06f6cf6089fbc43f93f4f3830468735c92277595769867cb6c89e1fe1c299a","src/backend/libc/param/auxv.rs":"fc9476c85482b1d44190289224ccf40c96fbf3a2fe3d8554ddb42acb2e97a8ae","src/backend/libc/param/mod.rs":"5234b8f1bcb886cca6ea003d411d75eaeebe58deedd80e3441354bf46ed85d4d","src/backend/libc/pid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/pid/syscalls.rs":"49ea679b96c0741d048e82964038f9a931bc3cf3a0b59c7db3df89629b9c49e6","src/backend/libc/pipe/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/pipe/syscalls.rs":"8affde100f6a9dfc762b79d1e48be5c1039be414f8ef7d5a6acaba882a68d259","src/backend/libc/pipe/types.rs":"9f5d0e7b83afe932ea2c4cc87a52e21ad180e1986bf8342d83b8c4a977ca3bdb","src/backend/libc/prctl/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/prctl/syscalls.rs":"8a2684f444a7555098dce2b92270d81cefdae902716c6e5d59bd7b0657e8a29d","src/backend/libc/process/cpu_set.rs":"b3d36b01b53b0b6c61a20ed8a69d48eccdd90cc17f82f2926ef1e844f002d0b7","src/backend/libc/process/mod.rs":"806e26da8d1e7afae502987fcd650f4d348da147b8a2e74447affdca153e2e97","src/backend/libc/process/syscalls.rs":"9d7028bc55c5dd1fa742c13ea0904fbf95094232e7ba2871fa758a93838666de","src/backend/libc/process/types.rs":"fb2caf34b17079aa72c04aed0f9a31d534ea8e8b73a80c758b748bf5e38df52b","src/backend/libc/process/wait.rs":"0cc556aed976b4bbb3965f74fd76b8216c755fce25043b7b21ce54afa07c9773","src/backend/libc/pty/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/pty/syscalls.rs":"699a4c325fc590b8b5dabfe5a9ff386809be14dd24bf35aa6ef581b2bd75457b","src/backend/libc/rand/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/rand/syscalls.rs":"78c7201e6bcb75e9cab9486d1878861319f865de2b2c46437be68690bd17bf13","src/backend/libc/rand/types.rs":"4eb0b4cdd0a9b089d1c9f6a25ad1ca97be28a38b7b07a705ec605b773f63f880","src/backend/libc/shm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/shm/syscalls.rs":"60d797d4e85e08e6330e6b8d80094356ce377e5484952f88ae2a6e49231c268c","src/backend/libc/shm/types.rs":"2206eac8ee74951b995e1e80f10bf235cc6b04e0a099f4adefce546378838233","src/backend/libc/system/mod.rs":"38563ea68829ca5a4b1b0695ac8a5c05718e85bdc88a36dc805efdfce45d3909","src/backend/libc/system/syscalls.rs":"abe1093f3495668d8576ae55073c74976cffb04d2e1bc20583d7ec12ac848b06","src/backend/libc/system/types.rs":"6871e16aee14fe2ae03cea798c3e509ffe44778a9c0e5608fd73e2e015876d7e","src/backend/libc/termios/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/termios/syscalls.rs":"f377dfbf501fbc3cdbc9e190dd650c8141c00c1593b8c62901ecf346a0c1a7c5","src/backend/libc/thread/futex.rs":"b666828653b12634bbd7fd709acf69641b648ec40962a1d4f904c5db14d2eff5","src/backend/libc/thread/mod.rs":"fa710053974d7f16a6c49242ee6c10a3b9e1143452b9daeaed8837302a679fff","src/backend/libc/thread/syscalls.rs":"c8e84ad232ec1317be989529c24e204c51bb4e1e0212de2c1937b00bc92e5483","src/backend/libc/time/mod.rs":"38563ea68829ca5a4b1b0695ac8a5c05718e85bdc88a36dc805efdfce45d3909","src/backend/libc/time/syscalls.rs":"f82e0725c5af8a52e61ee83aad2c77694f2f7a72ac1e6eb284109a70ac6edc38","src/backend/libc/time/types.rs":"d0307994ffddd3f21f702d9ae4400750aecccfaf4a01268161dc4fd72de5c373","src/backend/libc/ugid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/ugid/syscalls.rs":"8edf91b8790add23902c9f5418da6b0723a371677f29f490e0c8af852f0f1a0c","src/backend/libc/winsock_c.rs":"3bf3884fd250eca806ffdf96da68e29c133a697810b78b333ea449e523e58562","src/backend/linux_raw/arch/aarch64.rs":"2a255c9135bc8a321c180f52b88eb2b158bc9170cd222149caeae63c24587d44","src/backend/linux_raw/arch/arm.rs":"165bccb5883d0136e55d42091183765f83d86e9d37a7cb2cec9ae8af32774db6","src/backend/linux_raw/arch/mips.rs":"24af364aa93fd4b9917639d473336490a143f0d1723b09f388e72d534160ee51","src/backend/linux_raw/arch/mips32r6.rs":"e436a2ade34f2f7c58b8924462b07a2499dfc951e1e1318d51759444fb8b658e","src/backend/linux_raw/arch/mips64.rs":"897da9ddc877963ad59464d7f81dc59df8a7e91251e6adea14cfd946e2740a1c","src/backend/linux_raw/arch/mips64r6.rs":"3c08aea13c1139fb0dfbe74ca3d0147f007c3aa2eda641afb82c46f6aa4f6cd1","src/backend/linux_raw/arch/mod.rs":"37eaeea601d39be00d170856a31a8ec6a27b0d3ac22ab3ee642ab0e45dee237d","src/backend/linux_raw/arch/powerpc64.rs":"dfb001f8636a5e46d728900b0804fe6c374e5e18a6f0e76d7d62e0c07da74477","src/backend/linux_raw/arch/riscv64.rs":"41d33242d941030f46077dc2b1bc4c7913fe7630d693a5a7eef966bcf38f9d8b","src/backend/linux_raw/arch/thumb.rs":"2fd979ab421248c0a4c592bc0cefee63edc26528f469b71b63eaed35356e42e8","src/backend/linux_raw/arch/x86.rs":"fc72f595ec75768aee248d405f4958a7ba1db65ac9fe54b277cd003eab33316e","src/backend/linux_raw/arch/x86_64.rs":"e929036a1f3cf93ba538f4523b241605cc7b5e61f84ffe6d9d5cdbcb6f73e543","src/backend/linux_raw/c.rs":"5669c25110b62dbb8a79bbceb167732693b2ff7cc82dd78cc68c1c7f3aeec6af","src/backend/linux_raw/conv.rs":"017ef1ef5044c99acf124db022c134b946c68b4c0150e61c7615947e9ce088f0","src/backend/linux_raw/event/epoll.rs":"81add72e957733b4233d3e712c0fb05f233f97d8cd96e1b886b27b9d0a8b90a0","src/backend/linux_raw/event/mod.rs":"72e46b04637e2d1d2a6b97af616144995399e489d1fe916faf835d72fc8c64cd","src/backend/linux_raw/event/poll_fd.rs":"a5773464e9e30227b4046f029a27d3daf2c7bd0045e54565cf1a8ac2a0d61e81","src/backend/linux_raw/event/syscalls.rs":"44460b0045bb9d9f48b0baeb009a6b150a2902f9b733e8f6c5a36726b8db2d41","src/backend/linux_raw/event/types.rs":"0551b18f982e233a0a06d8a9c3dbb29de0c204dcd64dd6f7e88b6c96fa9a9be8","src/backend/linux_raw/fs/dir.rs":"8fe8f139e9720208ece606af3bd8097e87e54ea9ce155f228530c8f6acd03992","src/backend/linux_raw/fs/inotify.rs":"9fc5edea36e347041a39e583cb473dd84af40c63fff3dfbb85a1a97d2833d8e5","src/backend/linux_raw/fs/makedev.rs":"c6b4505c4bcbbc2460e80f3097eb15e2c8ef38d6c6e7abd78e39c53c372139e2","src/backend/linux_raw/fs/mod.rs":"3d3a42bbf4d086f806d7d9f6e4b0a49a873dc27f4f03ffca0921f5536acc24e5","src/backend/linux_raw/fs/syscalls.rs":"53011d928f6ff77cf505d31744cc41d7d460127c15926006a2859c9e1ae0ffb3","src/backend/linux_raw/fs/types.rs":"0127ab3059d75a896cdda83b3b2005923636273c62664e342f97bb3b3867f34b","src/backend/linux_raw/io/errno.rs":"4b010bdc37ab8d8f551529540af011c728d2e9fac1fb897fc9fd0c844dad7fee","src/backend/linux_raw/io/mod.rs":"7ae2324427892cca6f5ab53858d847b165f790a72ec25f3d99fb15f0506c9f27","src/backend/linux_raw/io/syscalls.rs":"831ce424f0032e6891d46503e972313fd7a46f15cb2fbb1f87e40fb05a018e9a","src/backend/linux_raw/io/types.rs":"d0df5a62248e1ba19af0f89f86da7ba2312d97065c2814ddf6b08a4a0db23bad","src/backend/linux_raw/io_uring/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/io_uring/syscalls.rs":"0f7c9cb7ccddf5687e4b9e5b23558871a452a29ac6095a0184a06c47b9b18eb6","src/backend/linux_raw/mm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/mm/syscalls.rs":"4e469542c88ea15853d5022e7e1d4b8fc291265ca314766d60d9395dad927e19","src/backend/linux_raw/mm/types.rs":"b5bf9bf775d3771e79aa234788fa3d1f25009f3f51cd59c72efc4f5e2c7bd790","src/backend/linux_raw/mod.rs":"86f7c3b1d57e57a9e5b5dcc8ee24ded5054a917069bd9824f47952b10bca2221","src/backend/linux_raw/mount/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/mount/syscalls.rs":"3947261b5d46b9737f02dc5352c3a3a35c63c461fd75bcd8ae6619dfc0bfb54d","src/backend/linux_raw/mount/types.rs":"eacf5fa1e8142f8e10023aeca9fd44f28dd0ca4255069378a129b88ccdba7fbc","src/backend/linux_raw/net/addr.rs":"fbb6c071a8ebc2c557c7013d36d4b540c1ff6ed63103d0a8abcacd8977fbf5c8","src/backend/linux_raw/net/mod.rs":"904b2ccd4228ebcda25db0223b92fb03e4042bcc7b0a202f19410a8a5ff517a5","src/backend/linux_raw/net/msghdr.rs":"a88e8395dd5a25c103dc2172d4e7013e5104a6d70091ad78efd286ebc8284acf","src/backend/linux_raw/net/read_sockaddr.rs":"4ab5d470f03f19a928327603e1d55de8b9e21cbe4bfc6ed65d856803092b1c90","src/backend/linux_raw/net/send_recv.rs":"6d5d2aec61a3c1b4a5fef1a8a487dc8e163da8988d1237541ed008baa01128cc","src/backend/linux_raw/net/sockopt.rs":"2ea8625ecd68a799c14ed48dec2f3e01f085222b6cc36f4916b20143e08ae575","src/backend/linux_raw/net/syscalls.rs":"b231754af1c94f61d206839b45f51516e0210761bbbcc1ef68c1fe6fc8a1bbbb","src/backend/linux_raw/net/write_sockaddr.rs":"a9374256cb47b3f4d5fec308986a109ce51a521abab31590df1f66c04c07d437","src/backend/linux_raw/param/auxv.rs":"ee59d2a618a8c631516814b53655830eeb7ae33cda847d1be382419ba3cdb559","src/backend/linux_raw/param/init.rs":"6b1297dd9d02d9cf0be19a263d1e0cd084a5fbe723aa3bce2eee5f55e850bde0","src/backend/linux_raw/param/libc_auxv.rs":"d7d2c46feba6d383d17d9d25293ab40e39dfefb23533844ee7abaa917923e2b5","src/backend/linux_raw/param/mod.rs":"2e6a1a1c00351b9c88bd615aa923f71d76208df5626dd9bea03067f28f81dc31","src/backend/linux_raw/pid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/pid/syscalls.rs":"eef6aa01830ddd510b83f507da2002c03e58318b73744be2c06ebbe33c4f194f","src/backend/linux_raw/pipe/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/pipe/syscalls.rs":"366c730fc3e991bddb9f5a15b8c3917a8e6ace6d1d5a9113b2749e476faf6f83","src/backend/linux_raw/pipe/types.rs":"263f6c5621968ed2d33671cca5bdb59eef2882668d9543c2ddbbf6346308e0ff","src/backend/linux_raw/prctl/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/prctl/syscalls.rs":"a18b224307e0d27bda9b7b85c75cd6c7ddfe39f5ce52efb7bb0bf0585b757343","src/backend/linux_raw/process/cpu_set.rs":"dfdcbdf35aff6a3e08e7d38193bf18c12ca8aa64eb0dc417667be82dcc0f7c55","src/backend/linux_raw/process/mod.rs":"fb393c70a9c63ef9a6bf1fb5a2dc94f07d6b0b6987cc5231c15c607015dafd68","src/backend/linux_raw/process/syscalls.rs":"2699fcffdbc3e5f7ef598bed5a1ea33fcd161f8e9b2f57b320c31da290b4fee1","src/backend/linux_raw/process/types.rs":"6811ba822bc12a1a6336649151b4adb1f5d3365684a31c07f01953ea9547743d","src/backend/linux_raw/process/wait.rs":"921aee4b0048746087f52615a98edc2aa0fb4b53d6df44be4533098df55d1b05","src/backend/linux_raw/pty/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/pty/syscalls.rs":"ae09c4aecc0ae87b1ca58d82efc58007b9dddaae78460d615f48da19d1cd0f89","src/backend/linux_raw/rand/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/rand/syscalls.rs":"a84f70251672e92f253838bf05e989434f67373233e88d21d8835cbb792b1fe3","src/backend/linux_raw/rand/types.rs":"a21dbb1ab31eed6b59a57520be5a3c603c36d18ea74e67f7527f40835ba209a3","src/backend/linux_raw/reg.rs":"def5f88730bd625b2298c86559b5a378fce4bf6ce225204740ba087e034abce6","src/backend/linux_raw/runtime/mod.rs":"b2cae8cce3822c3c92942f06ea0b68464040dcac33c6f0f7ee392c6269993347","src/backend/linux_raw/runtime/syscalls.rs":"5ad72d57b1258be6f6265be971cf3cd4c5746902f4167069774dcce41f33cefb","src/backend/linux_raw/runtime/tls.rs":"6316060560a112c2e9cd9807cdba6e8c91414113a04a739160929ae9a67bba1f","src/backend/linux_raw/shm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/shm/syscalls.rs":"3ebf91610b02de0312e1f0f0cc5d56e12b4d93794540087b3182cbdf3cb9c8db","src/backend/linux_raw/shm/types.rs":"b831b474aba7eb97167c9289f5257776a72b39134b44e67a0ecfcef2394dcd47","src/backend/linux_raw/system/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/system/syscalls.rs":"2af6c2672a6528b404b52f501d9803a63e9f47886d3b5d2d2dc5a71cefa7327a","src/backend/linux_raw/system/types.rs":"1ceab8d738a71043473b26e97fa3fd79d588a86d4774cbc9b9e1d4f1447a016e","src/backend/linux_raw/termios/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/termios/syscalls.rs":"25a0341ded4657a3a5389250c24b3310642785d386bc51f31696f98f4f1e770f","src/backend/linux_raw/thread/futex.rs":"0aa0f9f5be6a79de81e82c9f11f1bf8831f682a4b2f6cb29669e1591636f084e","src/backend/linux_raw/thread/mod.rs":"6ad4a4b90b9234e79900b27ebbe8837e3a7a36aec532912e3e253edce5225067","src/backend/linux_raw/thread/syscalls.rs":"0e3dca63be7322e1e9c58456b28eb8548abb9f08b4436b87b139e891c01c446d","src/backend/linux_raw/time/mod.rs":"672724f55b7b7be6a7452bb1cc2d28b5f0aaa840a2856fe363acce624e1beefc","src/backend/linux_raw/time/syscalls.rs":"7dc6975bdc30e8fa02f3408b934957e65ebbca281c8c9806e5de9404845312fc","src/backend/linux_raw/time/types.rs":"5f49ee7b201976114c6555f0c5a81d3305e18e726e54edc5a5474641f3cdc278","src/backend/linux_raw/ugid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/ugid/syscalls.rs":"8c86d251db33b399a1d1cbb8e87afe650b78db84f444d3251309b7a0480b54f7","src/backend/linux_raw/vdso.rs":"056314f72c71d4b041739337ca2098afb7fe070f844327f462c293f43481b75b","src/backend/linux_raw/vdso_wrappers.rs":"0e01221cbc6f0a489e89b0cf2fa376c3826ead8491ee8510476b75e90784f39a","src/bitcast.rs":"e21c87c292c781b27256c6f5dcf9fd52dd69ed6e21016cbd67ac31a8219ebf8e","src/check_types.rs":"e52f710e1cfc12ca13a495f2b43c227b293ff295e1ce3ab332935b28a7579872","src/clockid.rs":"7237847231f9d2bd070606262a25de6351de666f95065972967a5f2aae6fef0e","src/cstr.rs":"41af2a4429fe6c67a8883f8a8f63d66c90df566abda74fd2b03bcef7b9f24218","src/event/eventfd.rs":"81cbd08f7bdf40a6ce1ca692b63da1dc8ba925282990668d9d68f1203e839fa1","src/event/kqueue.rs":"222842df22e66f41d93dacd3cba933810d9313d5ca9959fddabedda9c4312bf2","src/event/mod.rs":"7f82a5734d4ba2791054d154273cab48d1cce5ca47d680d44a1b71b96eee932c","src/event/pause.rs":"cac3317286478565298a40788c1ce13c1b71543078a6f09655419de325022f6f","src/event/poll.rs":"0ee583dbd457a573a82a06c04a2a24bd2c76e751d27a435507d55338e2871327","src/event/port.rs":"4e51ff150e5d17cbd44aa64a38b99c15e26eaaf2e350768b5dcacdfde4fa5212","src/ffi.rs":"c2b8b38c02d72749aceb715c496726caba1f1fa989ad3856d0103a2fafed89ed","src/fs/abs.rs":"99ecd74dd3447d16f142651c74397daca53aa5a21e7daf632937b0860ed63a84","src/fs/at.rs":"e2e017e48139101c882df6697f9e4842aed3dbd372c448249c61fd9486163183","src/fs/constants.rs":"23923e0fce3221bdac371fe2d05028f30a87dba4f9b4a573b69dc2d6d39320b2","src/fs/copy_file_range.rs":"d3b644374390d482b2ff749a2459458872b57d0dcf9670368739b7833509a7c2","src/fs/cwd.rs":"9f429a79ace6e17455634da09216ee0ad3d067a4541518b3193ae6a8d9ff1e26","src/fs/dir.rs":"347a52f4ca9ac6321c52e802e97ec90d1b4c62ec955c8996fc17f8f5aed69966","src/fs/fadvise.rs":"1220e2cf5cf58fc7cc950d48738050a052c504f745ca67130daa6410e248230a","src/fs/fcntl.rs":"1d1ee1e0bc962779e1cc1b8b76f39c820746240557daa9e14b47b1799120dc39","src/fs/fcntl_apple.rs":"e2f23f038083621bcdecc98d02ce1023508afaecdb2ed0fba5c8b70f955301e5","src/fs/fcopyfile.rs":"ce565f61e1fbf2e31086077c2f1d01b6bb3b048915edda87fe9a4a4f5e8ff7e4","src/fs/fd.rs":"fe53f211e91352d522ac4f3b553a9366506458e2158295a93c5e746618f7a5fe","src/fs/getpath.rs":"28f6970fc1bbc37bb35c84724b59eac436ea7407a4522e18c2bdacb1fdd2edd9","src/fs/id.rs":"1b5c8a8baf9a9bb1f895f97189cea4e5982a0d35b192afeec6340a6c6222e0cb","src/fs/ioctl.rs":"e798eb41bbc201c375bc295ad2928c2467b45b4fbbff3c82236dccbc0d6391a5","src/fs/makedev.rs":"85520b484cb7c15ab71ea1c368578ea3b7e484d82f8510db92b6ce9f7ca341ae","src/fs/memfd_create.rs":"a8bf1dced54c7592e71da896021338d5092c1693d12cc42e79bac435fab2792b","src/fs/mod.rs":"2192ea7f6f81a18d892d3526df00c43d83669f1a1734957ba94cf8269980792e","src/fs/mount.rs":"8f6ea2b997dd83c50c90291b9ada3ed77a9ce1ad701c9b0d533b5113b317be5b","src/fs/openat2.rs":"4a95c15dab533a41201b5fa25c8a212956b7571d58cad696bdaf45af8aef96db","src/fs/raw_dir.rs":"18ad797876d6230c38d4cacbed081c4028e03ace477d0520d9b226b40de942f0","src/fs/seek_from.rs":"a9efa0feb9ac789cf47667e91efee2e3f2dcde16cb3b7a928c99da640fa0e0d6","src/fs/sendfile.rs":"e3b2058741cf4b1698f34d84bb37130cf2b72806d522a16fe541e832cde136cb","src/fs/statx.rs":"f925be3d9a179a903549b3ac18038d004f4f2021e46dad4aa2757907aebefeca","src/fs/sync.rs":"a3b23543834281f347b0f873bd38154d31d404871188ac08f2b20b9196234cfd","src/fs/xattr.rs":"5e222adb52caf69d949ab3f944fb2a482dd6ca3a47200532ca6e72d44cbe8334","src/io/close.rs":"0aa3cd05a8fed8e5244f97b8b6c2e7f65ed93a4e5435c6329852bb3da7514440","src/io/dup.rs":"bbebf4633120e21c7c49ecb93576cffa7e908f8089deb260f8d97426b469a0d4","src/io/errno.rs":"58a4d20ba0924e4d514e3c876fbe08982f1623187642ae14780815e65989c8c8","src/io/fcntl.rs":"41c1b370be55aaa68144dcc8a67b2d53504a5e6d8ee1bffabac2cc64c66a4043","src/io/ioctl.rs":"3dffbda413fd380f1580e2e75c531a5f4a0487417ea1c235c23fe46b70e46bd9","src/io/is_read_write.rs":"1bfb9ee5d58e0b29b44af12fe2668c7bccc841358698dcde47f1519ff9bb73b4","src/io/mod.rs":"75f1d0646be1d4c7c08b5887d8119b0103be8c25c43ccd4e0e97015508c0bb8f","src/io/read_write.rs":"77b8058769dc0bf5a88d73acd7ce70af1a89c549b00b790e281dc20364bcb6af","src/io_uring.rs":"4e641c9aaeba14890e4a354ad8b1fda8fe617923b4d3d685da22721d66a14bdf","src/ioctl/bsd.rs":"32ba3399a0fe3f68bb458baafc2a21af9bff655865c7ea70990b7e98a26d3907","src/ioctl/linux.rs":"96df90bbc926783f387e8fe1656841d4c7a857fd4e9f41f95492f7dcece33074","src/ioctl/mod.rs":"8a5ce2e81feb7c2748df6b69ecf14b07ed1459d961f1eaa8f429face912f908c","src/ioctl/patterns.rs":"bd6e309c8b548dfe04aaffe805972582fb56a0b717c45b45447630bdf9b88433","src/lib.rs":"2d9ddb2ab94fd1649932b4e8cb490026078c0b43b513489f3067d279747f4a35","src/maybe_polyfill/no_std/io/mod.rs":"77889bb5c5a4f2e50e38379cdaa5d0fef4b0cafc3da056735df01f6deae75747","src/maybe_polyfill/no_std/mod.rs":"ec94a4aab4bc475785e469d10fd6bc95667e1d47d958e9cff3a19049d88c8c80","src/maybe_polyfill/no_std/net/ip_addr.rs":"046327ee244f758f2bc31d3be305d8cd0dfd8342aac1add8259e999b4b46c4a7","src/maybe_polyfill/no_std/net/mod.rs":"486555be5c56cf3e049e65a1ea73aa60839c6f6ca667833e88ee4f360f9606dd","src/maybe_polyfill/no_std/net/socket_addr.rs":"bfeb32d32c176cde76323abcffebfc47e9898fb8d7ce3668c602dc8451086a2d","src/maybe_polyfill/no_std/os/fd/mod.rs":"27ef0afbcb0695cbb15101070f417eb51e0ef85ae66ec967d95e80771d507c47","src/maybe_polyfill/no_std/os/fd/owned.rs":"ab86ffa2693a04f3085770faf395f95e5303001711be8b19c44a47a0ac574091","src/maybe_polyfill/no_std/os/fd/raw.rs":"f3648c7bd4a6ff94bd823ed9e0d99d398e02f24875cf9b25962736999e7c6943","src/maybe_polyfill/no_std/os/mod.rs":"27dab639a765827644005d5f2fcc7c825310606b889cc8dd83f54c9528350dc0","src/maybe_polyfill/no_std/os/windows/io/mod.rs":"5bbcc05c83fee5026dd744a994e0458469466d5be39081baa62df07753b92fd2","src/maybe_polyfill/no_std/os/windows/io/raw.rs":"4c32609a489dd938a49328b5637cb3bafb96437f2f9f269ab66d7d3cb90247f6","src/maybe_polyfill/no_std/os/windows/io/socket.rs":"c658f42f24eff44a661f2adfd24a11af80fe9897f3e2af4dc5d2c64808308d65","src/maybe_polyfill/no_std/os/windows/mod.rs":"fdb416f8f231a4e778b5f985b9ae712ece5e1a1402963ad1a5f6a8b9843795f4","src/maybe_polyfill/std/mod.rs":"7c16c86cc73e226e65ead598e4018238b22000a345040b706bf1e1b3eba115fc","src/mm/madvise.rs":"69481cd3354dbffe6cd93b234448e59de6d0fe6440bcf8b12f951f37745bc1dc","src/mm/mmap.rs":"3b0abe64a6a606ea41b06acfc1079bcde1542c17475951e5ed900b86c3e5988d","src/mm/mod.rs":"b3a6cb838986d45825b912355cedead761211a494ca6f89b2367a2d2157e340e","src/mm/msync.rs":"a9092be024ecbfa9c14edb935404513498b0da2ac6c99fc31fe4e58196a95f02","src/mm/userfaultfd.rs":"8073443bd181ff0b3ba4d0b1ae67370b4864035a0c8b4898cd709dc47c518ae7","src/mount/fsopen.rs":"160e384e9175fd98669cda1cf3590bb195c2ba7e1c724e9ea06e692595e58ba1","src/mount/mod.rs":"5f0c9df4727592695deb1cd63ae1de021b03dcd9d0d1b68e1f34d12a7136cb19","src/mount/mount_unmount.rs":"8ad11675e5d762d33fbefbed06a6a9f9e52a9b689bd06662446152614321ab77","src/mount/types.rs":"601ae3e10b7dc496fed7f3b40a80e81c6edd7bf13189d7be45c3212d4c684c39","src/net/mod.rs":"a6bc55f9e086caf46a7c00783498d73a328a66f2a991f1ec65d5f13931377b0f","src/net/send_recv/mod.rs":"7b77a70c0ad2601b5da30e8b202e34c6bfc9e10df4ce2b1a35b111522ae123a3","src/net/send_recv/msg.rs":"5e889662c076db5aa5041a75302aec04eb471c41570ffeb22b1a6c0760a3716a","src/net/socket.rs":"1296706d964d110be7cd46b61a0a06dabf382a2377907ba41badfe94807cb50f","src/net/socket_addr_any.rs":"a9af81e967a91b45e51aec4f46a068fade7035c5d19dfaf05bfdcd3b3c32e9bf","src/net/socketpair.rs":"56f4885c31d2664cd16e18a9a88792a4912fedd953cec36dba67e8581fd57921","src/net/sockopt.rs":"4f00ff76d3cd3fd2e915f51eba59827fb60885d6b0c6d37b32ca4306cb8fe836","src/net/types.rs":"d1186106a0a7dab578a9d7f36021ba4c77a50585ad155bd531ebb8553dff3366","src/net/wsa.rs":"6e546b42f50a851fc833c57cda76cfb347203ed4b0dea574a3d325bf5a2ebf80","src/param/auxv.rs":"8602af47a39bb340d319807bdecdb9be8b467101a9ed96061277b90234801913","src/param/init.rs":"a31c0e5cea61a1a999767fe74f87c0d59eeb6bce66578b842fe0e0c32be27a55","src/param/mod.rs":"25b10acd5b1da8faa6f5204e6b0379b38bfab667916e886cca64bea01a42dec2","src/path/arg.rs":"d87117157ec21f61a5e50b2779b4284fd13dd7db11b20a6bc9e475d0e4a25357","src/path/dec_int.rs":"8ff8e14442c46f8e7a9b80d73973619b4271549b9defd538479bf8c2d93aa72e","src/path/mod.rs":"6b1b949c94bcc47e0f08a3f8e8db5b61ff497d0dfd3e0655f51c01d3e4b7dfd6","src/pid.rs":"f1c486000c5b1311b2d720cee88f089c17ef9a171709673dd06e6f35f4ff98a3","src/pipe.rs":"9f269090dd0588dc8d3feba4f4a78b61891bce91d3c9b64cdbad9251b06a9e11","src/prctl.rs":"19aa584895874ea48b9bbe1bf695b81257b0281df64dfdd91e1b4bfa298661b7","src/process/chdir.rs":"911216459aa429fe9f125f1357d6900b43b0007835b85c719875d00f79a74664","src/process/chroot.rs":"2b5f6124eb19f26ad2705174f7ad50cdc0a5d15abd59ffcf55421228d82130b4","src/process/exit.rs":"48de66e5504a00cb375d8f415ce63b6225a3f5204268d40726a7d0fbba43f587","src/process/id.rs":"e4733f9e8e4b5f50e98ef7a23802e126f1f14ece8b3d7ae7446c6a66affc6bc1","src/process/ioctl.rs":"23ad0285671e8d7ca71a63c50655dbf732ccea8af11d754a0558e0236db37e76","src/process/kill.rs":"96d5ce432c19cf2b600d5248c681c117abf53ae94bbfca7e75ac533a40e3968e","src/process/membarrier.rs":"1c4c39b359d1d0e9bbe16352eedfca9278d9ef298ade8ec00e998617bbcbfed8","src/process/mod.rs":"4fda62909afcb081281bd9a8eaf770dc3dfc2111013231ae23b0a1e101582f48","src/process/pidfd.rs":"39de2dc7919eeeb53a5980622616140327671cd7e36bcf597aee1749df3a5b5b","src/process/pidfd_getfd.rs":"1faace75bdbcda57a296806dcfa5487811f8d11dad9e6199c98df72feae66724","src/process/prctl.rs":"0130d05362a17a9282f3391189095e1f4f51fb56d7a5205906a0011842df4576","src/process/priority.rs":"f135482e71ea8aa0daf92b9f238051178a4c904070fa8409622f94155df3c544","src/process/procctl.rs":"430ec397782772d5a028903c2813d3e11f7e577af144b9effd9c42629ac8d3d2","src/process/rlimit.rs":"10b79de3ced0e64059a94c879742d46a35a6176c776d8eed75031d5e6340283d","src/process/sched.rs":"ea2acde244159ff3b07038a99f365c07661e7f57c6e998af110ce937e9145d0b","src/process/sched_yield.rs":"6565faa3928b66ddc74a65e893e15edfa4b9be4f7e5f5f68527501a7f6bc3350","src/process/umask.rs":"1a0f31a842303c978e3f05ec191e2b5e96104c09c6596473b42b1fac34898a50","src/process/wait.rs":"f9c73dde2a66dfbe448501f039396dd26c5d678e4f8cb61c1f78014b7b49fcd3","src/procfs.rs":"194678c863ae682143fcefb47601ae3d0b269a48eb9f43cae7f9d7e13f687920","src/pty.rs":"652c412e7280d0344b3f9bfe376c106a7f1b42b898b7af344e6e72da268e2bf0","src/rand/getrandom.rs":"1c8166a02a74f5593bb4673ef907524df04cbc1568020a5ab2ff7f4aa1283f8b","src/rand/mod.rs":"cab59332aadd9b679f5b22cbb222d48ee028af5eb9fd4a4d43922da659b895d7","src/runtime.rs":"39e5b1449bd94b7e89a78a1a6e2ea857bcb26e1f2a5e225c0951c7abc4e15d90","src/shm.rs":"b96fe8a05ee5d4536464a8843a776d43a938abaf22c772fc35b5373d95644a8d","src/signal.rs":"a294b49d487dafaa42e534f8b1d93e87bec135087676b2ba2ef865cf2fccdaf2","src/static_assertions.rs":"504cf66f0d5b8e335be02f9ae8b0a355abc98c2c82eec0098bdf0988e662e260","src/stdio.rs":"a5de2d7d9c3c5a901f88b6acf4754687c958a2f3a93c7945c2b8fcb948d468af","src/system.rs":"4d7d1eff18094ec85a8ead70a7ccbe8ef78fd7f5705b7dfe3fa52541e9494887","src/termios/ioctl.rs":"a1ac967f7811a482f8bb53847c37c8359f518cd26da9df7b816ba678a0139623","src/termios/mod.rs":"b44b7caa60b6f458657ed58a0e0eca41bb4e6d6be4b0f042bbb8ab7056cebe4b","src/termios/tc.rs":"5a56f252dcde4a841fae47a7a6f7890d81f61385c7b512143ece9389652004ae","src/termios/tty.rs":"35a5fc2d26501e0e6dde1a755eeccf7b4f3b4702c5bac30e0953220808ef7034","src/termios/types.rs":"38167a38fb83e84f2845f86b373ecaaa3ebf6c2f91dccd07c10539201d6f5070","src/thread/clock.rs":"f49eb7271eb3e6831d9b0c3a01bfddbe4bd69dee237bbaa059884de452b29e79","src/thread/futex.rs":"985f9a0dce1e2a4892ae7f26bd1bf119ceae3f9fa6b4707e166624fc1cee76d4","src/thread/id.rs":"ad72db4fea9fccb728310bbfd01ef8c00f6cc60fa2a750f6349646a134f7009b","src/thread/libcap.rs":"4c51b7df566d38dd0f85f81ef53279a745a39f0f4e1154791fd38438e2ca7db1","src/thread/mod.rs":"98634ece0b882f123ad887017692f2a4d94a23a1dec278ed660b3497cac5cceb","src/thread/prctl.rs":"ebc89b731eb8fd1a8f82a50dbba849061476a4537bba8702b29db657d5287ffa","src/thread/setns.rs":"ea9142b1f3a5b3f329683be185f960c50e5c1636149e91fbf59e88a897fc607d","src/time/clock.rs":"e59a29f1bed8c31c3d5b6fad60f2d4fa6cab8dd8e86148bb3693a5e3a1ce735f","src/time/mod.rs":"43afee938c80d124d04d4ba190c03f4d21d1e3bfc154fff309211e4f6eabe940","src/time/timerfd.rs":"f17092b84553741aa2d2b44c6992b5d2c8c96cc2c2007fc9a2c6b2064485e53f","src/timespec.rs":"32a4d930cbc0f6dbd23153290db920671cf4ce65a4a127e176f897c1cde42d7d","src/ugid.rs":"6616c6e35b7e43aee5b150f1efae7a50711e0947943c9a96833dbe214ad9e85f","src/utils.rs":"9ae76f8a41d6cc350cdd58c9084b5c3a5a708eeecd769783debdbcbaef442182","src/weak.rs":"c7cf03bf2aeba494b1999ab32183fa8c603ab72e254c0e312a67f168877e410d"},"package":"9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a"} \ No newline at end of file +{"files":{"CODE_OF_CONDUCT.md":"f210602311e3f74b32f46237fd55f4ce36d798e85e3db1432ec667f63a7ffc44","CONTRIBUTING.md":"3fd57de5c678db1c972da676a8231d2fde9820695ef1f0d53f1e55a3e81d9de0","COPYRIGHT":"377c2e7c53250cc5905c0b0532d35973392af16ffb9596a41d99d202cf3617c9","Cargo.toml":"c7396934f91e0edb3e72539d76a8260d46d3841989e18e59ae47a254e2a8ed41","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","ORG_CODE_OF_CONDUCT.md":"a62b69bf86e605ee1bcbb2f0a12ba79e4cebb6983a7b6491949750aecc4f2178","README.md":"cec45686b62cb75ef2f0c851939b7ddcb64678c27c18c7bca18d6f5cde2446d3","SECURITY.md":"4d75afb09dd28eb5982e3a1f768ee398d90204669ceef3240a16b31dcf04148a","benches/mod.rs":"e260e67273aa0a37cffdc5cd451699335b8ee656c17275a0d0f2b4563c6018ca","build.rs":"5f93559819ca7fe233f01579d51ff5b58cb6e96ef9e7817a3358a9b410d5bbf6","src/backend/libc/c.rs":"f3ea8ee60f4b79196914ef4782b6493466e5755ef922f6ff2b7cbf9671332ff5","src/backend/libc/conv.rs":"a254fa84164286ee6be64f49b5bd5f7e2fd503ebd5ca9076dad4c2507a351dc2","src/backend/libc/event/epoll.rs":"93d3eb9e0e397afc3c44797b315ce92ff8b22f2372812b19cec9e063c55032c3","src/backend/libc/event/mod.rs":"ad30f99f7da0768c18fffac6ec71e658bfed2e44f0634f48c2e0ffe4677ec231","src/backend/libc/event/poll_fd.rs":"280303b4be61600fa2e25fe59f10dc4e7010942286f6fb7cca93954ab63e01d9","src/backend/libc/event/syscalls.rs":"f91bbe7d222987c89a2647817f6819dd536cbc4a685dfb794f403543c32df777","src/backend/libc/event/types.rs":"b966e0a3a018ca2ce507371be900fc73b2814cca450b784583207ad2df473f13","src/backend/libc/event/windows_syscalls.rs":"ebfac665c6676c4b803134ab8806be8aa2e96bdbc7799a19c544cd9069b35787","src/backend/libc/fs/dir.rs":"3c43768f9e56cb4297594c05d91a52be20029dd2b3e0b91f6b1a13f31e595fe2","src/backend/libc/fs/inotify.rs":"a027a718db8bf6ff9a778c2cfa706850b466240b0a2296d72b9834c0096968e8","src/backend/libc/fs/makedev.rs":"89c679a0ef18dd41b3c6223bce0f329ad35bf6cadbf16e47b33fad3f312ba4a6","src/backend/libc/fs/mod.rs":"3d28b803011b57da6315bb747daf0117218687c0cc610358f5dafddf0b7d44d3","src/backend/libc/fs/syscalls.rs":"a14f9554b0de295f52178cb1a5f3723cb803523b3baddd7c8401f0f03ed11f76","src/backend/libc/fs/types.rs":"8f1bd3d426b7672d9440cf3e2878e664c2fd85976d32e52afa11d64199d79e3a","src/backend/libc/io/errno.rs":"50de98470979377559520ddc35b9777c761248b9083d93d86ff4f101f80c724d","src/backend/libc/io/mod.rs":"746647bd864e4ec7717925b6d176cebdb392b7d015070244cc48d92780351dd6","src/backend/libc/io/syscalls.rs":"d77032e4d7ec41e441e06181461ffc519d7c6e6dfc720244a55399f0f870bb16","src/backend/libc/io/types.rs":"2efd39bb3df19a9db5496217284f3d2235ddb354fac81dd71861109a56bede0b","src/backend/libc/io/windows_syscalls.rs":"fab3fa099aa89cea56a6edc651dd37750e581534f4f45b04a7e425f130b08468","src/backend/libc/io_uring/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/io_uring/syscalls.rs":"5af8146d5971c833e6fd657f652c618b31f854e1b0811864fba9b658cb633e19","src/backend/libc/mm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/mm/syscalls.rs":"c04c61ad3d7f3b24d13f89144d7fa0a05658cea4763207f9250db4f9362de2fe","src/backend/libc/mm/types.rs":"55478e173b7d82e2c85934fc0dda79c29f46a305228df78f1e90c68ac9d3cfec","src/backend/libc/mod.rs":"087d2676df88510b089255053a4865e62c64172723588386fe8244d2f1a681c4","src/backend/libc/mount/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/mount/syscalls.rs":"d2d35f7ae989bb52722e28cdbd775243c5d7da9eb411e0b2b9632f2aa7c1533e","src/backend/libc/mount/types.rs":"bf1d541daa248aa023bf18aec7645f2f8c402ac4aa1df2f55b8a784057c2e113","src/backend/libc/net/addr.rs":"9bdc2febb20785bc26a820eaba52cb546c67c79cb547f08105087cd0f79d5861","src/backend/libc/net/ext.rs":"0dd64877abe1ba86b47a2ab34340e3f6cc7b53b22d0bb5e237daf6a82edd46b0","src/backend/libc/net/mod.rs":"562d23225d6dba8f095e3ca41af60dcf6cc40c2cf17bf028f90888f809e86f07","src/backend/libc/net/msghdr.rs":"6f8aba792b4adef5c5d3d4324a813a67a063a50d10437bb19bf7496666bd6de6","src/backend/libc/net/netdevice.rs":"c6c3cd11b0181a74243705438fbf0fedeb02d4201ff3ad9f45a084fbd57a9c21","src/backend/libc/net/read_sockaddr.rs":"61fc1c744b376d57a18d78d8f7ab469236c614f5fa7aeaf37a636e6a967b9066","src/backend/libc/net/send_recv.rs":"1450ca958431a5bf3a85cdeef88b387f30d5c1215de2c56d164ccda38f21b36c","src/backend/libc/net/sockopt.rs":"ef0521cfae119a363f68bf915dc2769c89c9483e733c4f29e2769b5a6a72d960","src/backend/libc/net/syscalls.rs":"1412f9deed57ac0909b0b1c3ac3e5fb7d5c31ab356212c9131e33378c342d2a5","src/backend/libc/net/write_sockaddr.rs":"bee221d0a1fedf4ddcff045faa2702c1f1e68b4d6c3f2f7b079d888e0ef9da56","src/backend/libc/param/auxv.rs":"fc9476c85482b1d44190289224ccf40c96fbf3a2fe3d8554ddb42acb2e97a8ae","src/backend/libc/param/mod.rs":"5234b8f1bcb886cca6ea003d411d75eaeebe58deedd80e3441354bf46ed85d4d","src/backend/libc/pid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/pid/syscalls.rs":"49ea679b96c0741d048e82964038f9a931bc3cf3a0b59c7db3df89629b9c49e6","src/backend/libc/pipe/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/pipe/syscalls.rs":"8affde100f6a9dfc762b79d1e48be5c1039be414f8ef7d5a6acaba882a68d259","src/backend/libc/pipe/types.rs":"9826013bc5fa18acdcbf09c650b96ce301a18ec009139ebaf79162669b1fc2c8","src/backend/libc/prctl/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/prctl/syscalls.rs":"8a2684f444a7555098dce2b92270d81cefdae902716c6e5d59bd7b0657e8a29d","src/backend/libc/process/cpu_set.rs":"b3d36b01b53b0b6c61a20ed8a69d48eccdd90cc17f82f2926ef1e844f002d0b7","src/backend/libc/process/mod.rs":"806e26da8d1e7afae502987fcd650f4d348da147b8a2e74447affdca153e2e97","src/backend/libc/process/syscalls.rs":"9d7028bc55c5dd1fa742c13ea0904fbf95094232e7ba2871fa758a93838666de","src/backend/libc/process/types.rs":"fb2caf34b17079aa72c04aed0f9a31d534ea8e8b73a80c758b748bf5e38df52b","src/backend/libc/process/wait.rs":"0cc556aed976b4bbb3965f74fd76b8216c755fce25043b7b21ce54afa07c9773","src/backend/libc/pty/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/pty/syscalls.rs":"566fc9a2cb2e38d7d7ac2405b22c0522369cae4a8f4fe18b55123ba94d3d5a95","src/backend/libc/rand/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/rand/syscalls.rs":"35ea6b6e0f8a7fb064fd5cb33a3a855cd161a6a00f93d76c861b2a2c66db85e7","src/backend/libc/rand/types.rs":"4eb0b4cdd0a9b089d1c9f6a25ad1ca97be28a38b7b07a705ec605b773f63f880","src/backend/libc/shm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/libc/shm/syscalls.rs":"60d797d4e85e08e6330e6b8d80094356ce377e5484952f88ae2a6e49231c268c","src/backend/libc/shm/types.rs":"2206eac8ee74951b995e1e80f10bf235cc6b04e0a099f4adefce546378838233","src/backend/libc/system/mod.rs":"38563ea68829ca5a4b1b0695ac8a5c05718e85bdc88a36dc805efdfce45d3909","src/backend/libc/system/syscalls.rs":"abe1093f3495668d8576ae55073c74976cffb04d2e1bc20583d7ec12ac848b06","src/backend/libc/system/types.rs":"6871e16aee14fe2ae03cea798c3e509ffe44778a9c0e5608fd73e2e015876d7e","src/backend/libc/termios/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/termios/syscalls.rs":"f377dfbf501fbc3cdbc9e190dd650c8141c00c1593b8c62901ecf346a0c1a7c5","src/backend/libc/thread/futex.rs":"b666828653b12634bbd7fd709acf69641b648ec40962a1d4f904c5db14d2eff5","src/backend/libc/thread/mod.rs":"fa710053974d7f16a6c49242ee6c10a3b9e1143452b9daeaed8837302a679fff","src/backend/libc/thread/syscalls.rs":"c8e84ad232ec1317be989529c24e204c51bb4e1e0212de2c1937b00bc92e5483","src/backend/libc/time/mod.rs":"38563ea68829ca5a4b1b0695ac8a5c05718e85bdc88a36dc805efdfce45d3909","src/backend/libc/time/syscalls.rs":"bf847e94cc156bdb553755baa88dac240db4dcaf690f303b0f205777c5a9cdfc","src/backend/libc/time/types.rs":"d0307994ffddd3f21f702d9ae4400750aecccfaf4a01268161dc4fd72de5c373","src/backend/libc/ugid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/libc/ugid/syscalls.rs":"8edf91b8790add23902c9f5418da6b0723a371677f29f490e0c8af852f0f1a0c","src/backend/libc/winsock_c.rs":"502da2ed3cd6ca99bb7ee08b0b30e25c212632885cec965f9816366c6b931ac6","src/backend/linux_raw/arch/aarch64.rs":"2a255c9135bc8a321c180f52b88eb2b158bc9170cd222149caeae63c24587d44","src/backend/linux_raw/arch/arm.rs":"165bccb5883d0136e55d42091183765f83d86e9d37a7cb2cec9ae8af32774db6","src/backend/linux_raw/arch/mips.rs":"24af364aa93fd4b9917639d473336490a143f0d1723b09f388e72d534160ee51","src/backend/linux_raw/arch/mips32r6.rs":"e436a2ade34f2f7c58b8924462b07a2499dfc951e1e1318d51759444fb8b658e","src/backend/linux_raw/arch/mips64.rs":"897da9ddc877963ad59464d7f81dc59df8a7e91251e6adea14cfd946e2740a1c","src/backend/linux_raw/arch/mips64r6.rs":"3c08aea13c1139fb0dfbe74ca3d0147f007c3aa2eda641afb82c46f6aa4f6cd1","src/backend/linux_raw/arch/mod.rs":"37eaeea601d39be00d170856a31a8ec6a27b0d3ac22ab3ee642ab0e45dee237d","src/backend/linux_raw/arch/powerpc64.rs":"dfb001f8636a5e46d728900b0804fe6c374e5e18a6f0e76d7d62e0c07da74477","src/backend/linux_raw/arch/riscv64.rs":"41d33242d941030f46077dc2b1bc4c7913fe7630d693a5a7eef966bcf38f9d8b","src/backend/linux_raw/arch/thumb.rs":"2fd979ab421248c0a4c592bc0cefee63edc26528f469b71b63eaed35356e42e8","src/backend/linux_raw/arch/x86.rs":"fc72f595ec75768aee248d405f4958a7ba1db65ac9fe54b277cd003eab33316e","src/backend/linux_raw/arch/x86_64.rs":"e929036a1f3cf93ba538f4523b241605cc7b5e61f84ffe6d9d5cdbcb6f73e543","src/backend/linux_raw/c.rs":"db66abe9b91ce0f16dd71762744013046f29542a46a577454c9ff063e9cb649c","src/backend/linux_raw/conv.rs":"017ef1ef5044c99acf124db022c134b946c68b4c0150e61c7615947e9ce088f0","src/backend/linux_raw/event/epoll.rs":"a102c2d8d7d5d07a5d846f30672153269d1762d1d846be1786b22fcf095e8721","src/backend/linux_raw/event/mod.rs":"72e46b04637e2d1d2a6b97af616144995399e489d1fe916faf835d72fc8c64cd","src/backend/linux_raw/event/poll_fd.rs":"a5773464e9e30227b4046f029a27d3daf2c7bd0045e54565cf1a8ac2a0d61e81","src/backend/linux_raw/event/syscalls.rs":"44460b0045bb9d9f48b0baeb009a6b150a2902f9b733e8f6c5a36726b8db2d41","src/backend/linux_raw/event/types.rs":"0551b18f982e233a0a06d8a9c3dbb29de0c204dcd64dd6f7e88b6c96fa9a9be8","src/backend/linux_raw/fs/dir.rs":"3107b07276f171a5837bd37a9c1e05151ca21d59ae2b85afd2c6e59e721cdcf2","src/backend/linux_raw/fs/inotify.rs":"713ec3b85f281efca19bc4f495b7537e745fbf1d8c26592c80ceec6fd2ab59b5","src/backend/linux_raw/fs/makedev.rs":"c6b4505c4bcbbc2460e80f3097eb15e2c8ef38d6c6e7abd78e39c53c372139e2","src/backend/linux_raw/fs/mod.rs":"3d3a42bbf4d086f806d7d9f6e4b0a49a873dc27f4f03ffca0921f5536acc24e5","src/backend/linux_raw/fs/syscalls.rs":"dc7475b41ef2c5e0fb860ddbbcb05a966afb2b699f4f5fc3e67945936809d71e","src/backend/linux_raw/fs/types.rs":"d3b0d24c4755d2971309b438ca4b6fce11fb36ddec8ff5557a2df924890beb52","src/backend/linux_raw/io/errno.rs":"6464c776312d478d9a7aae0e66f624ecbec5e56f1c33713a5f11f2ed5000ba9e","src/backend/linux_raw/io/mod.rs":"7ae2324427892cca6f5ab53858d847b165f790a72ec25f3d99fb15f0506c9f27","src/backend/linux_raw/io/syscalls.rs":"568e16751191c14bb37f7883b17cb577dc97e09d615d17849c0e7e10e3898f1b","src/backend/linux_raw/io/types.rs":"d0df5a62248e1ba19af0f89f86da7ba2312d97065c2814ddf6b08a4a0db23bad","src/backend/linux_raw/io_uring/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/io_uring/syscalls.rs":"0f7c9cb7ccddf5687e4b9e5b23558871a452a29ac6095a0184a06c47b9b18eb6","src/backend/linux_raw/mm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/mm/syscalls.rs":"4e469542c88ea15853d5022e7e1d4b8fc291265ca314766d60d9395dad927e19","src/backend/linux_raw/mm/types.rs":"b5bf9bf775d3771e79aa234788fa3d1f25009f3f51cd59c72efc4f5e2c7bd790","src/backend/linux_raw/mod.rs":"86f7c3b1d57e57a9e5b5dcc8ee24ded5054a917069bd9824f47952b10bca2221","src/backend/linux_raw/mount/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/mount/syscalls.rs":"8442c82814961f69c488222faabb82c44d2e7227b10faff919cbbd197bb47484","src/backend/linux_raw/mount/types.rs":"bf3dff5aad1cec9d998496230469958c836b76643f0ad17b0ea29b957357bcca","src/backend/linux_raw/net/addr.rs":"920373911f43deff1a5e54b9d01a8712e6971734f7eba7932dc813b9a30771d6","src/backend/linux_raw/net/mod.rs":"125654336638e5209940369246bc6dfb92bfbfcab871c3324ea75295c3b431d2","src/backend/linux_raw/net/msghdr.rs":"8b18974b81ee78af7a5c64733041dddaaa378a46cab8b984bff5b3b4be499751","src/backend/linux_raw/net/netdevice.rs":"bb491bf168967d034426ab2939f604933dac198382aa6308b44a30d1076f6d9e","src/backend/linux_raw/net/read_sockaddr.rs":"7cb3c8bcc80c5eee8602323cd83f36c1784927d9dd0c40ded29af6fb09c57ece","src/backend/linux_raw/net/send_recv.rs":"6d5d2aec61a3c1b4a5fef1a8a487dc8e163da8988d1237541ed008baa01128cc","src/backend/linux_raw/net/sockopt.rs":"c77326f50eeacdeaede9e8bc605ecf6703a5d5420f2f271a0bbcd3fed1273f28","src/backend/linux_raw/net/syscalls.rs":"0138662012ca89e063b3a03cf8fe17b97fbeb38a3d18c42938ae047a4a392105","src/backend/linux_raw/net/write_sockaddr.rs":"0efa4e17b4008da2cf2aada2d18acfccd31a3b49cf8ac5d608e77f3ea6627fec","src/backend/linux_raw/param/auxv.rs":"aa57b07c1ff5524dcda5cef9a484f753c7b0bcc7b9410c5dbb2ed59c39de5f68","src/backend/linux_raw/param/init.rs":"6b1297dd9d02d9cf0be19a263d1e0cd084a5fbe723aa3bce2eee5f55e850bde0","src/backend/linux_raw/param/libc_auxv.rs":"d7d2c46feba6d383d17d9d25293ab40e39dfefb23533844ee7abaa917923e2b5","src/backend/linux_raw/param/mod.rs":"2e6a1a1c00351b9c88bd615aa923f71d76208df5626dd9bea03067f28f81dc31","src/backend/linux_raw/pid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/pid/syscalls.rs":"eef6aa01830ddd510b83f507da2002c03e58318b73744be2c06ebbe33c4f194f","src/backend/linux_raw/pipe/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/pipe/syscalls.rs":"366c730fc3e991bddb9f5a15b8c3917a8e6ace6d1d5a9113b2749e476faf6f83","src/backend/linux_raw/pipe/types.rs":"cf53bcdcde5d0ee15e0e3566ceaad39fda44e69ed6f94a99fadd9be9b8be09cf","src/backend/linux_raw/prctl/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/prctl/syscalls.rs":"a18b224307e0d27bda9b7b85c75cd6c7ddfe39f5ce52efb7bb0bf0585b757343","src/backend/linux_raw/process/cpu_set.rs":"dfdcbdf35aff6a3e08e7d38193bf18c12ca8aa64eb0dc417667be82dcc0f7c55","src/backend/linux_raw/process/mod.rs":"fb393c70a9c63ef9a6bf1fb5a2dc94f07d6b0b6987cc5231c15c607015dafd68","src/backend/linux_raw/process/syscalls.rs":"be1427f2ab11ce35b2746b48351c5a0aff2b71ad2b6471a2876f88cb80c0b7f7","src/backend/linux_raw/process/types.rs":"6811ba822bc12a1a6336649151b4adb1f5d3365684a31c07f01953ea9547743d","src/backend/linux_raw/process/wait.rs":"921aee4b0048746087f52615a98edc2aa0fb4b53d6df44be4533098df55d1b05","src/backend/linux_raw/pty/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/pty/syscalls.rs":"ae09c4aecc0ae87b1ca58d82efc58007b9dddaae78460d615f48da19d1cd0f89","src/backend/linux_raw/rand/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/rand/syscalls.rs":"317cdaf243623329ee345131054e86a06a0863a9e90c5dba73e1ac3475ba6305","src/backend/linux_raw/rand/types.rs":"a21dbb1ab31eed6b59a57520be5a3c603c36d18ea74e67f7527f40835ba209a3","src/backend/linux_raw/reg.rs":"6bfb53575494f5de76d5112a7e4eb6d0c266b1af0a275aa33b9bc9e6e7a2f41c","src/backend/linux_raw/runtime/mod.rs":"b2cae8cce3822c3c92942f06ea0b68464040dcac33c6f0f7ee392c6269993347","src/backend/linux_raw/runtime/syscalls.rs":"dc7df0416919d1eef7e4919fc38836e2081903db286330d59b0119cc292155df","src/backend/linux_raw/runtime/tls.rs":"6316060560a112c2e9cd9807cdba6e8c91414113a04a739160929ae9a67bba1f","src/backend/linux_raw/shm/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/shm/syscalls.rs":"3ebf91610b02de0312e1f0f0cc5d56e12b4d93794540087b3182cbdf3cb9c8db","src/backend/linux_raw/shm/types.rs":"b831b474aba7eb97167c9289f5257776a72b39134b44e67a0ecfcef2394dcd47","src/backend/linux_raw/system/mod.rs":"8aa966faf3853d1a93d0ed91f7e5f4a53539b0287b25a5bfe489fa1d07f7cfd7","src/backend/linux_raw/system/syscalls.rs":"2af6c2672a6528b404b52f501d9803a63e9f47886d3b5d2d2dc5a71cefa7327a","src/backend/linux_raw/system/types.rs":"1ceab8d738a71043473b26e97fa3fd79d588a86d4774cbc9b9e1d4f1447a016e","src/backend/linux_raw/termios/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/termios/syscalls.rs":"25a0341ded4657a3a5389250c24b3310642785d386bc51f31696f98f4f1e770f","src/backend/linux_raw/thread/futex.rs":"0aa0f9f5be6a79de81e82c9f11f1bf8831f682a4b2f6cb29669e1591636f084e","src/backend/linux_raw/thread/mod.rs":"6ad4a4b90b9234e79900b27ebbe8837e3a7a36aec532912e3e253edce5225067","src/backend/linux_raw/thread/syscalls.rs":"0e3dca63be7322e1e9c58456b28eb8548abb9f08b4436b87b139e891c01c446d","src/backend/linux_raw/time/mod.rs":"672724f55b7b7be6a7452bb1cc2d28b5f0aaa840a2856fe363acce624e1beefc","src/backend/linux_raw/time/syscalls.rs":"7dc6975bdc30e8fa02f3408b934957e65ebbca281c8c9806e5de9404845312fc","src/backend/linux_raw/time/types.rs":"5f49ee7b201976114c6555f0c5a81d3305e18e726e54edc5a5474641f3cdc278","src/backend/linux_raw/ugid/mod.rs":"2c6478857a0751625edabd61acb841819bfba1093b1faeded15693c805d84952","src/backend/linux_raw/ugid/syscalls.rs":"8c86d251db33b399a1d1cbb8e87afe650b78db84f444d3251309b7a0480b54f7","src/backend/linux_raw/vdso.rs":"056314f72c71d4b041739337ca2098afb7fe070f844327f462c293f43481b75b","src/backend/linux_raw/vdso_wrappers.rs":"0e01221cbc6f0a489e89b0cf2fa376c3826ead8491ee8510476b75e90784f39a","src/bitcast.rs":"e21c87c292c781b27256c6f5dcf9fd52dd69ed6e21016cbd67ac31a8219ebf8e","src/buffer.rs":"8211a52e4fdd6ad74dcaddb885db25fa616898f988fc79b43af24b89c32d8421","src/check_types.rs":"e52f710e1cfc12ca13a495f2b43c227b293ff295e1ce3ab332935b28a7579872","src/clockid.rs":"bd443c60868586c1a3114afacc95193de1d8cb99b7c9d710e0b3835596c74a24","src/cstr.rs":"41af2a4429fe6c67a8883f8a8f63d66c90df566abda74fd2b03bcef7b9f24218","src/event/eventfd.rs":"81cbd08f7bdf40a6ce1ca692b63da1dc8ba925282990668d9d68f1203e839fa1","src/event/kqueue.rs":"2f776485e16fe57639ad7454886e0ae761880b122976141ac05b4b2e7d82183a","src/event/mod.rs":"77f6c7051f70d4d5873787cf744e05b64519ba61d8da42298aeed27a906031f2","src/event/pause.rs":"cac3317286478565298a40788c1ce13c1b71543078a6f09655419de325022f6f","src/event/poll.rs":"899bbee8e565110b2581594e7aa5067a426f859f0a414935e2ce3a9732b6152a","src/event/port.rs":"4e51ff150e5d17cbd44aa64a38b99c15e26eaaf2e350768b5dcacdfde4fa5212","src/ffi.rs":"c2b8b38c02d72749aceb715c496726caba1f1fa989ad3856d0103a2fafed89ed","src/fs/abs.rs":"b671489378e14b708c784c4a673e6645741a869c7d1dd1918e28e1eb1a138829","src/fs/at.rs":"13f50b86575443db8b881ce525ce2c5d2f377e528c33258729f0c06037de9499","src/fs/constants.rs":"23923e0fce3221bdac371fe2d05028f30a87dba4f9b4a573b69dc2d6d39320b2","src/fs/copy_file_range.rs":"d3b644374390d482b2ff749a2459458872b57d0dcf9670368739b7833509a7c2","src/fs/cwd.rs":"9f429a79ace6e17455634da09216ee0ad3d067a4541518b3193ae6a8d9ff1e26","src/fs/dir.rs":"347a52f4ca9ac6321c52e802e97ec90d1b4c62ec955c8996fc17f8f5aed69966","src/fs/fadvise.rs":"1220e2cf5cf58fc7cc950d48738050a052c504f745ca67130daa6410e248230a","src/fs/fcntl.rs":"1d1ee1e0bc962779e1cc1b8b76f39c820746240557daa9e14b47b1799120dc39","src/fs/fcntl_apple.rs":"e2f23f038083621bcdecc98d02ce1023508afaecdb2ed0fba5c8b70f955301e5","src/fs/fcopyfile.rs":"ce565f61e1fbf2e31086077c2f1d01b6bb3b048915edda87fe9a4a4f5e8ff7e4","src/fs/fd.rs":"fe53f211e91352d522ac4f3b553a9366506458e2158295a93c5e746618f7a5fe","src/fs/getpath.rs":"28f6970fc1bbc37bb35c84724b59eac436ea7407a4522e18c2bdacb1fdd2edd9","src/fs/id.rs":"1b5c8a8baf9a9bb1f895f97189cea4e5982a0d35b192afeec6340a6c6222e0cb","src/fs/ioctl.rs":"c7c2db229daf7c9f0109fe7f45f05fa9a6a472950a2ad408c71514e6cb7c9d7b","src/fs/makedev.rs":"85520b484cb7c15ab71ea1c368578ea3b7e484d82f8510db92b6ce9f7ca341ae","src/fs/memfd_create.rs":"a8bf1dced54c7592e71da896021338d5092c1693d12cc42e79bac435fab2792b","src/fs/mod.rs":"8ceaa8a80fa018da356ac456280f6422ef54160086a9d10cdb2f469e9068d381","src/fs/mount.rs":"8f6ea2b997dd83c50c90291b9ada3ed77a9ce1ad701c9b0d533b5113b317be5b","src/fs/openat2.rs":"4a95c15dab533a41201b5fa25c8a212956b7571d58cad696bdaf45af8aef96db","src/fs/raw_dir.rs":"18ad797876d6230c38d4cacbed081c4028e03ace477d0520d9b226b40de942f0","src/fs/seek_from.rs":"a9efa0feb9ac789cf47667e91efee2e3f2dcde16cb3b7a928c99da640fa0e0d6","src/fs/sendfile.rs":"e3b2058741cf4b1698f34d84bb37130cf2b72806d522a16fe541e832cde136cb","src/fs/statx.rs":"f925be3d9a179a903549b3ac18038d004f4f2021e46dad4aa2757907aebefeca","src/fs/sync.rs":"a3b23543834281f347b0f873bd38154d31d404871188ac08f2b20b9196234cfd","src/fs/xattr.rs":"5e222adb52caf69d949ab3f944fb2a482dd6ca3a47200532ca6e72d44cbe8334","src/io/close.rs":"2ddae17a2c9dc05fb2cefa134815699c2b3af2eef8026407b8d009cb3ceae6b8","src/io/dup.rs":"bbebf4633120e21c7c49ecb93576cffa7e908f8089deb260f8d97426b469a0d4","src/io/errno.rs":"58a4d20ba0924e4d514e3c876fbe08982f1623187642ae14780815e65989c8c8","src/io/fcntl.rs":"41c1b370be55aaa68144dcc8a67b2d53504a5e6d8ee1bffabac2cc64c66a4043","src/io/ioctl.rs":"0979246359dc2e53c84a4e1aa72044373682154656adafac6103c2ff753d9c8d","src/io/is_read_write.rs":"1bfb9ee5d58e0b29b44af12fe2668c7bccc841358698dcde47f1519ff9bb73b4","src/io/mod.rs":"75f1d0646be1d4c7c08b5887d8119b0103be8c25c43ccd4e0e97015508c0bb8f","src/io/read_write.rs":"bda0a708d86066686fd55a19a89818357a6a2ea9072e3853820314aea957868b","src/io_uring.rs":"4e641c9aaeba14890e4a354ad8b1fda8fe617923b4d3d685da22721d66a14bdf","src/ioctl/bsd.rs":"32ba3399a0fe3f68bb458baafc2a21af9bff655865c7ea70990b7e98a26d3907","src/ioctl/linux.rs":"96df90bbc926783f387e8fe1656841d4c7a857fd4e9f41f95492f7dcece33074","src/ioctl/mod.rs":"300dd73c0632ff322afc9a267f7be2a497e4681b73a3775b57cff9eb500522a5","src/ioctl/patterns.rs":"bd6e309c8b548dfe04aaffe805972582fb56a0b717c45b45447630bdf9b88433","src/lib.rs":"55f4fe027ab6e638b4613893dffc27a0c20b0bea6f185b76f401f34a480b78f9","src/maybe_polyfill/no_std/io/mod.rs":"77889bb5c5a4f2e50e38379cdaa5d0fef4b0cafc3da056735df01f6deae75747","src/maybe_polyfill/no_std/mod.rs":"ec94a4aab4bc475785e469d10fd6bc95667e1d47d958e9cff3a19049d88c8c80","src/maybe_polyfill/no_std/net/ip_addr.rs":"046327ee244f758f2bc31d3be305d8cd0dfd8342aac1add8259e999b4b46c4a7","src/maybe_polyfill/no_std/net/mod.rs":"486555be5c56cf3e049e65a1ea73aa60839c6f6ca667833e88ee4f360f9606dd","src/maybe_polyfill/no_std/net/socket_addr.rs":"bfeb32d32c176cde76323abcffebfc47e9898fb8d7ce3668c602dc8451086a2d","src/maybe_polyfill/no_std/os/fd/mod.rs":"27ef0afbcb0695cbb15101070f417eb51e0ef85ae66ec967d95e80771d507c47","src/maybe_polyfill/no_std/os/fd/owned.rs":"d82bfeadf28087cc9afd10269f09a8b4125915dc3288b6427c79f5b4c58ab751","src/maybe_polyfill/no_std/os/fd/raw.rs":"f3648c7bd4a6ff94bd823ed9e0d99d398e02f24875cf9b25962736999e7c6943","src/maybe_polyfill/no_std/os/mod.rs":"27dab639a765827644005d5f2fcc7c825310606b889cc8dd83f54c9528350dc0","src/maybe_polyfill/no_std/os/windows/io/mod.rs":"5bbcc05c83fee5026dd744a994e0458469466d5be39081baa62df07753b92fd2","src/maybe_polyfill/no_std/os/windows/io/raw.rs":"4c32609a489dd938a49328b5637cb3bafb96437f2f9f269ab66d7d3cb90247f6","src/maybe_polyfill/no_std/os/windows/io/socket.rs":"c658f42f24eff44a661f2adfd24a11af80fe9897f3e2af4dc5d2c64808308d65","src/maybe_polyfill/no_std/os/windows/mod.rs":"fdb416f8f231a4e778b5f985b9ae712ece5e1a1402963ad1a5f6a8b9843795f4","src/maybe_polyfill/std/mod.rs":"7c16c86cc73e226e65ead598e4018238b22000a345040b706bf1e1b3eba115fc","src/mm/madvise.rs":"69481cd3354dbffe6cd93b234448e59de6d0fe6440bcf8b12f951f37745bc1dc","src/mm/mmap.rs":"3b0abe64a6a606ea41b06acfc1079bcde1542c17475951e5ed900b86c3e5988d","src/mm/mod.rs":"b3a6cb838986d45825b912355cedead761211a494ca6f89b2367a2d2157e340e","src/mm/msync.rs":"a9092be024ecbfa9c14edb935404513498b0da2ac6c99fc31fe4e58196a95f02","src/mm/userfaultfd.rs":"8073443bd181ff0b3ba4d0b1ae67370b4864035a0c8b4898cd709dc47c518ae7","src/mount/fsopen.rs":"1c54a02f04ee6710e2c5053c73361eecc499c24cd72c7c7c012dc57a4621e382","src/mount/mod.rs":"5f0c9df4727592695deb1cd63ae1de021b03dcd9d0d1b68e1f34d12a7136cb19","src/mount/mount_unmount.rs":"8ad11675e5d762d33fbefbed06a6a9f9e52a9b689bd06662446152614321ab77","src/mount/types.rs":"601ae3e10b7dc496fed7f3b40a80e81c6edd7bf13189d7be45c3212d4c684c39","src/net/mod.rs":"7899807c9ad9e3fdbfd8b3ce2a1c7053d4f46dd7fa76102f620c6042c2d6314f","src/net/netdevice.rs":"c830ae729a5b7c807421ad2c78a304a513a43af7286729c4030a14f11a9698a1","src/net/send_recv/mod.rs":"b00743069268f2671570f76a4ff08b5487a344e5a6a12e62d40c2be5c25ac22d","src/net/send_recv/msg.rs":"6bb1df4baa791c0e6ec984c41148ffc832e0b09228b20b1fcffb311842eb5ecc","src/net/socket.rs":"24bc109c543a9892e0910f53ddcf583b03bccbed3bfdf4789a25dfb3fde72a4a","src/net/socket_addr_any.rs":"b5fe6f012c67d70e0e4885b9e5d6e463c282e12330a0579ea98bdf8fedbccd60","src/net/socketpair.rs":"56f4885c31d2664cd16e18a9a88792a4912fedd953cec36dba67e8581fd57921","src/net/sockopt.rs":"21d269c34992643d403d50e3071b646cd9ed05dc9bdc53fe2f795bb5df43fa60","src/net/types.rs":"ab91796e438c58136680180300047cec674315c9f264a930f90a1a34704ffedb","src/net/wsa.rs":"29856e6d0108be6b719f6ef973c5396e48ddd58ecd0c2db9ca3e2e0ba4eccb5b","src/param/auxv.rs":"8602af47a39bb340d319807bdecdb9be8b467101a9ed96061277b90234801913","src/param/init.rs":"a31c0e5cea61a1a999767fe74f87c0d59eeb6bce66578b842fe0e0c32be27a55","src/param/mod.rs":"c514216b96d9520c9ffc5662c97b24f1f36f56fe1f5f3c9f64175c8b35577288","src/path/arg.rs":"1cbee317403a5d2281a4dea663cee03c9a968042f06d55145b8c5521513d393e","src/path/dec_int.rs":"8ff8e14442c46f8e7a9b80d73973619b4271549b9defd538479bf8c2d93aa72e","src/path/mod.rs":"6b1b949c94bcc47e0f08a3f8e8db5b61ff497d0dfd3e0655f51c01d3e4b7dfd6","src/pid.rs":"f1c486000c5b1311b2d720cee88f089c17ef9a171709673dd06e6f35f4ff98a3","src/pipe.rs":"9f269090dd0588dc8d3feba4f4a78b61891bce91d3c9b64cdbad9251b06a9e11","src/prctl.rs":"19aa584895874ea48b9bbe1bf695b81257b0281df64dfdd91e1b4bfa298661b7","src/process/chdir.rs":"911216459aa429fe9f125f1357d6900b43b0007835b85c719875d00f79a74664","src/process/chroot.rs":"2b5f6124eb19f26ad2705174f7ad50cdc0a5d15abd59ffcf55421228d82130b4","src/process/exit.rs":"48de66e5504a00cb375d8f415ce63b6225a3f5204268d40726a7d0fbba43f587","src/process/id.rs":"e4733f9e8e4b5f50e98ef7a23802e126f1f14ece8b3d7ae7446c6a66affc6bc1","src/process/ioctl.rs":"23ad0285671e8d7ca71a63c50655dbf732ccea8af11d754a0558e0236db37e76","src/process/kill.rs":"96d5ce432c19cf2b600d5248c681c117abf53ae94bbfca7e75ac533a40e3968e","src/process/membarrier.rs":"1c4c39b359d1d0e9bbe16352eedfca9278d9ef298ade8ec00e998617bbcbfed8","src/process/mod.rs":"4fda62909afcb081281bd9a8eaf770dc3dfc2111013231ae23b0a1e101582f48","src/process/pidfd.rs":"39de2dc7919eeeb53a5980622616140327671cd7e36bcf597aee1749df3a5b5b","src/process/pidfd_getfd.rs":"74c778b872be0b800870e4633606461fdc8493b259031e35f8f558768d960cc2","src/process/prctl.rs":"0130d05362a17a9282f3391189095e1f4f51fb56d7a5205906a0011842df4576","src/process/priority.rs":"f135482e71ea8aa0daf92b9f238051178a4c904070fa8409622f94155df3c544","src/process/procctl.rs":"75e9f7e5c66e6563aff133ff99b3a35c80a9f0a616d318a93a65be39ebc191ea","src/process/rlimit.rs":"10b79de3ced0e64059a94c879742d46a35a6176c776d8eed75031d5e6340283d","src/process/sched.rs":"ea2acde244159ff3b07038a99f365c07661e7f57c6e998af110ce937e9145d0b","src/process/sched_yield.rs":"6565faa3928b66ddc74a65e893e15edfa4b9be4f7e5f5f68527501a7f6bc3350","src/process/umask.rs":"1a0f31a842303c978e3f05ec191e2b5e96104c09c6596473b42b1fac34898a50","src/process/wait.rs":"f9c73dde2a66dfbe448501f039396dd26c5d678e4f8cb61c1f78014b7b49fcd3","src/procfs.rs":"4d4812a8db6897dabc33269ff59bf6d7192a65be977e879613704e29a8b73505","src/pty.rs":"652c412e7280d0344b3f9bfe376c106a7f1b42b898b7af344e6e72da268e2bf0","src/rand/getrandom.rs":"0a5320eaf5dd4c6d9b1252c41ca286b40a9ce813eb469c89dba41e6258612740","src/rand/mod.rs":"e1fb7542f1958fe77673aa628bd92fef1b9addf79ba23df2398d1231cb61c148","src/runtime.rs":"958cdf1567c5758c73c197fc36d1feffb414a22a76a7a287afc84f330f2d2279","src/shm.rs":"b96fe8a05ee5d4536464a8843a776d43a938abaf22c772fc35b5373d95644a8d","src/signal.rs":"a294b49d487dafaa42e534f8b1d93e87bec135087676b2ba2ef865cf2fccdaf2","src/static_assertions.rs":"504cf66f0d5b8e335be02f9ae8b0a355abc98c2c82eec0098bdf0988e662e260","src/stdio.rs":"6f78cbc0d102eff9354fa1fdfd1b63a45ea159d0a9ac5d25ecf703383b847b55","src/system.rs":"4d7d1eff18094ec85a8ead70a7ccbe8ef78fd7f5705b7dfe3fa52541e9494887","src/termios/ioctl.rs":"a1ac967f7811a482f8bb53847c37c8359f518cd26da9df7b816ba678a0139623","src/termios/mod.rs":"b44b7caa60b6f458657ed58a0e0eca41bb4e6d6be4b0f042bbb8ab7056cebe4b","src/termios/tc.rs":"5a56f252dcde4a841fae47a7a6f7890d81f61385c7b512143ece9389652004ae","src/termios/tty.rs":"35a5fc2d26501e0e6dde1a755eeccf7b4f3b4702c5bac30e0953220808ef7034","src/termios/types.rs":"b5671eedf541754c54f680002bafed1adbabce172d09d7c4d31fdf9313ca18c8","src/thread/clock.rs":"f49eb7271eb3e6831d9b0c3a01bfddbe4bd69dee237bbaa059884de452b29e79","src/thread/futex.rs":"985f9a0dce1e2a4892ae7f26bd1bf119ceae3f9fa6b4707e166624fc1cee76d4","src/thread/id.rs":"ad72db4fea9fccb728310bbfd01ef8c00f6cc60fa2a750f6349646a134f7009b","src/thread/libcap.rs":"4c51b7df566d38dd0f85f81ef53279a745a39f0f4e1154791fd38438e2ca7db1","src/thread/mod.rs":"98634ece0b882f123ad887017692f2a4d94a23a1dec278ed660b3497cac5cceb","src/thread/prctl.rs":"ebc89b731eb8fd1a8f82a50dbba849061476a4537bba8702b29db657d5287ffa","src/thread/setns.rs":"ea9142b1f3a5b3f329683be185f960c50e5c1636149e91fbf59e88a897fc607d","src/time/clock.rs":"e59a29f1bed8c31c3d5b6fad60f2d4fa6cab8dd8e86148bb3693a5e3a1ce735f","src/time/mod.rs":"43afee938c80d124d04d4ba190c03f4d21d1e3bfc154fff309211e4f6eabe940","src/time/timerfd.rs":"f17092b84553741aa2d2b44c6992b5d2c8c96cc2c2007fc9a2c6b2064485e53f","src/timespec.rs":"32a4d930cbc0f6dbd23153290db920671cf4ce65a4a127e176f897c1cde42d7d","src/ugid.rs":"6616c6e35b7e43aee5b150f1efae7a50711e0947943c9a96833dbe214ad9e85f","src/utils.rs":"9ae76f8a41d6cc350cdd58c9084b5c3a5a708eeecd769783debdbcbaef442182","src/weak.rs":"c7cf03bf2aeba494b1999ab32183fa8c603ab72e254c0e312a67f168877e410d"},"package":"6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"} \ No newline at end of file diff --git a/vendor/rustix/Cargo.toml b/vendor/rustix/Cargo.toml index f05faec53..8184720b7 100644 --- a/vendor/rustix/Cargo.toml +++ b/vendor/rustix/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.63" name = "rustix" -version = "0.38.26" +version = "0.38.31" authors = [ "Dan Gohman ", "Jakub Konka ", @@ -27,7 +27,7 @@ include = [ "/*.md", "benches", ] -description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls" +description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls" documentation = "https://docs.rs/rustix" readme = "README.md" keywords = [ @@ -99,7 +99,7 @@ default-features = false version = "1.0" [dev-dependencies.libc] -version = "0.2.150" +version = "0.2.152" [dev-dependencies.libc_errno] version = "0.3.8" @@ -162,6 +162,7 @@ net = [ "linux-raw-sys/net", "linux-raw-sys/netlink", "linux-raw-sys/if_ether", + "linux-raw-sys/xdp", ] param = ["fs"] pipe = [] @@ -205,7 +206,7 @@ use-libc = [ use-libc-auxv = [] [target."cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))".dependencies.linux-raw-sys] -version = "0.4.11" +version = "0.4.12" features = [ "general", "ioctl", @@ -217,7 +218,7 @@ default-features = false version = "0.4" [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))".dependencies.libc] -version = "0.2.150" +version = "0.2.152" features = ["extra_traits"] optional = true default-features = false @@ -229,7 +230,7 @@ default-features = false package = "errno" [target."cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))".dependencies.linux-raw-sys] -version = "0.4.11" +version = "0.4.12" features = [ "general", "errno", @@ -240,7 +241,7 @@ features = [ default-features = false [target."cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))".dependencies.libc] -version = "0.2.150" +version = "0.2.152" features = ["extra_traits"] default-features = false diff --git a/vendor/rustix/README.md b/vendor/rustix/README.md index d1add170d..9f437b1a4 100644 --- a/vendor/rustix/README.md +++ b/vendor/rustix/README.md @@ -2,7 +2,7 @@

rustix

- Safe Rust bindings to POSIX/Unix/Linux/Winsock2 syscalls + Safe Rust bindings to POSIX/Unix/Linux/Winsock syscalls

A Bytecode Alliance project @@ -16,7 +16,7 @@ `rustix` provides efficient memory-safe and [I/O-safe] wrappers to POSIX-like, -Unix-like, Linux, and Winsock2 syscall-like APIs, with configurable backends. +Unix-like, Linux, and Winsock syscall-like APIs, with configurable backends. It uses Rust references, slices, and return values instead of raw pointers, and [I/O safety types] instead of raw file descriptors, providing memory safety, [I/O safety], and [provenance]. It uses `Result`s for reporting errors, @@ -24,9 +24,9 @@ It uses Rust references, slices, and return values instead of raw pointers, and to efficiently accept any Rust string type, and several other efficient conveniences. -`rustix` is low-level and, and while the `net` API supports Winsock2 on -Windows, the rest of the APIs do not support Windows; for higher-level and more -portable APIs built on this functionality, see the [`cap-std`], [`memfd`], +`rustix` is low-level and, and while the `net` API supports [Windows Sockets 2] +(Winsock), the rest of the APIs do not support Windows; for higher-level and +more portable APIs built on this functionality, see the [`cap-std`], [`memfd`], [`timerfd`], and [`io-streams`] crates, for example. `rustix` currently has two backends available: @@ -42,7 +42,7 @@ portable APIs built on this functionality, see the [`cap-std`], [`memfd`], provenance all the way down to the syscalls. * libc, which uses the [`libc`] crate which provides bindings to native `libc` - libraries on Unix-family platforms, and [`windows-sys`] for Winsock2 on + libraries on Unix-family platforms, and [`windows-sys`] for Winsock on Windows, and is portable to many OS's. The linux_raw backend is enabled by default on platforms which support it. To @@ -165,6 +165,7 @@ always reflect “very old” Linux versions. [any current Rust target]: https://doc.rust-lang.org/nightly/rustc/platform-support.html [kernel.org]: https://www.kernel.org/releases.html [Rust on Debian stable]: https://packages.debian.org/stable/rust/rustc +[Windows Sockets 2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-start-page-2 [`nix`]: https://crates.io/crates/nix [`unix`]: https://crates.io/crates/unix [`nc`]: https://crates.io/crates/nc diff --git a/vendor/rustix/src/backend/libc/c.rs b/vendor/rustix/src/backend/libc/c.rs index d3a1e5f4a..5af915719 100644 --- a/vendor/rustix/src/backend/libc/c.rs +++ b/vendor/rustix/src/backend/libc/c.rs @@ -166,7 +166,7 @@ pub(super) use libc::{pread64 as pread, pwrite64 as pwrite}; #[cfg(any(target_os = "linux", target_os = "hurd", target_os = "emscripten"))] pub(super) use libc::{preadv64 as preadv, pwritev64 as pwritev}; -#[cfg(all(target_os = "linux", target_env = "gnu"))] +#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))] pub(super) unsafe fn prlimit( pid: libc::pid_t, resource: libc::__rlimit_resource_t, diff --git a/vendor/rustix/src/backend/libc/conv.rs b/vendor/rustix/src/backend/libc/conv.rs index 253951002..171fc10d8 100644 --- a/vendor/rustix/src/backend/libc/conv.rs +++ b/vendor/rustix/src/backend/libc/conv.rs @@ -70,7 +70,7 @@ pub(super) fn ret_c_int(raw: c::c_int) -> io::Result { } } -#[cfg(linux_kernel)] +#[cfg(any(linux_kernel, all(target_os = "redox", feature = "event")))] #[inline] pub(super) fn ret_u32(raw: c::c_int) -> io::Result { if raw == -1 { @@ -182,7 +182,11 @@ pub(super) fn ret_send_recv(len: i32) -> io::Result { not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")), any( target_os = "android", - all(target_os = "linux", not(target_env = "musl")) + all( + target_os = "linux", + not(target_env = "musl"), + not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips"))) + ) ) ))] #[inline] @@ -201,7 +205,11 @@ pub(super) fn msg_iov_len(len: usize) -> c::size_t { )), not(any( target_os = "android", - all(target_os = "linux", not(target_env = "musl")) + all( + target_os = "linux", + not(target_env = "musl"), + not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips"))) + ) )) ))] #[inline] diff --git a/vendor/rustix/src/backend/libc/event/epoll.rs b/vendor/rustix/src/backend/libc/event/epoll.rs index ced3be103..6e2ba3c12 100644 --- a/vendor/rustix/src/backend/libc/event/epoll.rs +++ b/vendor/rustix/src/backend/libc/event/epoll.rs @@ -187,7 +187,7 @@ pub fn add( // SAFETY: We're calling `epoll_ctl` via FFI and we know how it // behaves. We use our own `Event` struct instead of libc's because // ours preserves pointer provenance instead of just using a `u64`, - // and we have tests elsehwere for layout equivalence. + // and we have tests elsewhere for layout equivalence. unsafe { let raw_fd = source.as_fd().as_raw_fd(); ret(c::epoll_ctl( @@ -197,6 +197,8 @@ pub fn add( as_mut_ptr(&mut Event { flags: event_flags, data, + #[cfg(target_os = "redox")] + _pad: 0, }) .cast(), )) @@ -219,7 +221,7 @@ pub fn modify( // SAFETY: We're calling `epoll_ctl` via FFI and we know how it // behaves. We use our own `Event` struct instead of libc's because // ours preserves pointer provenance instead of just using a `u64`, - // and we have tests elsehwere for layout equivalence. + // and we have tests elsewhere for layout equivalence. unsafe { ret(c::epoll_ctl( epoll.as_fd().as_raw_fd(), @@ -228,6 +230,8 @@ pub fn modify( as_mut_ptr(&mut Event { flags: event_flags, data, + #[cfg(target_os = "redox")] + _pad: 0, }) .cast(), )) @@ -295,13 +299,16 @@ impl<'a> Iterator for Iter<'a> { /// A record of an event that occurred. #[repr(C)] #[cfg_attr( - any( - all( - target_arch = "x86", - not(target_env = "musl"), - not(target_os = "android"), - ), - target_arch = "x86_64", + all( + linux_kernel, + any( + all( + target_arch = "x86", + not(target_env = "musl"), + not(target_os = "android"), + ), + target_arch = "x86_64", + ) ), repr(packed) )] @@ -311,6 +318,9 @@ pub struct Event { pub flags: EventFlags, /// User data. pub data: EventData, + + #[cfg(target_os = "redox")] + _pad: u64, } /// Data associated with an [`Event`]. This can either be a 64-bit integer diff --git a/vendor/rustix/src/backend/libc/event/mod.rs b/vendor/rustix/src/backend/libc/event/mod.rs index 6aed4612a..a07d06b1a 100644 --- a/vendor/rustix/src/backend/libc/event/mod.rs +++ b/vendor/rustix/src/backend/libc/event/mod.rs @@ -5,5 +5,5 @@ pub(crate) mod types; #[cfg_attr(windows, path = "windows_syscalls.rs")] pub(crate) mod syscalls; -#[cfg(linux_kernel)] +#[cfg(any(linux_kernel, target_os = "redox"))] pub mod epoll; diff --git a/vendor/rustix/src/backend/libc/fs/dir.rs b/vendor/rustix/src/backend/libc/fs/dir.rs index 82a0a908f..6c8274323 100644 --- a/vendor/rustix/src/backend/libc/fs/dir.rs +++ b/vendor/rustix/src/backend/libc/fs/dir.rs @@ -131,7 +131,7 @@ impl Dir { /// `readdir(self)`, where `None` means the end of the directory. pub fn read(&mut self) -> Option> { - // If we've seen errors, don't continue to try to read anyting further. + // If we've seen errors, don't continue to try to read anything further. if self.any_errors { return None; } diff --git a/vendor/rustix/src/backend/libc/fs/syscalls.rs b/vendor/rustix/src/backend/libc/fs/syscalls.rs index fcf069a83..b71a43e80 100644 --- a/vendor/rustix/src/backend/libc/fs/syscalls.rs +++ b/vendor/rustix/src/backend/libc/fs/syscalls.rs @@ -10,7 +10,7 @@ use crate::backend::conv::ret_usize; use crate::backend::conv::{borrowed_fd, c_str, ret, ret_c_int, ret_off_t, ret_owned_fd}; use crate::fd::{BorrowedFd, OwnedFd}; use crate::ffi::CStr; -#[cfg(apple)] +#[cfg(all(apple, feature = "alloc"))] use crate::ffi::CString; #[cfg(not(any(target_os = "espidf", target_os = "vita")))] use crate::fs::Access; @@ -73,7 +73,7 @@ use crate::io; use crate::timespec::LibcTimespec; #[cfg(not(target_os = "wasi"))] use crate::ugid::{Gid, Uid}; -#[cfg(apple)] +#[cfg(all(apple, feature = "alloc"))] use alloc::vec; use core::mem::MaybeUninit; #[cfg(apple)] @@ -802,8 +802,8 @@ pub(crate) fn utimensat( flags: AtFlags, ) -> io::Result<()> { // Old 32-bit version: libc has `utimensat` but it is not y2038 safe by - // default. But there may be a `__utimensat16` we can use. - #[cfg(fix_y2038)] + // default. But there may be a `__utimensat64` we can use. + #[cfg(all(fix_y2038, not(apple)))] { #[cfg(target_env = "gnu")] if let Some(libc_utimensat) = __utimensat64.get() { @@ -874,6 +874,10 @@ pub(crate) fn utimensat( )); } + // Convert `times`. We only need this in the child, but do it before + // calling `fork` because it might fail. + let (attrbuf_size, times, attrs) = times_to_attrlist(times)?; + // `setattrlistat` was introduced in 10.13 along with `utimensat`, so // if we don't have `utimensat`, we don't have `setattrlistat` either. // Emulate it using `fork`, and `fchdir` and [`setattrlist`]. @@ -896,8 +900,6 @@ pub(crate) fn utimensat( flags_arg |= FSOPT_NOFOLLOW; } - let (attrbuf_size, times, attrs) = times_to_attrlist(times); - if setattrlist( c_str(path), &attrs, @@ -954,7 +956,7 @@ pub(crate) fn utimensat( } } -#[cfg(fix_y2038)] +#[cfg(all(fix_y2038, not(apple)))] fn utimensat_old( dirfd: BorrowedFd<'_>, path: &CStr, @@ -1505,7 +1507,7 @@ fn libc_statvfs_to_statvfs(from: c::statvfs) -> StatVfs { pub(crate) fn futimens(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> { // Old 32-bit version: libc has `futimens` but it is not y2038 safe by // default. But there may be a `__futimens64` we can use. - #[cfg(fix_y2038)] + #[cfg(all(fix_y2038, not(apple)))] { #[cfg(target_env = "gnu")] if let Some(libc_futimens) = __futimens64.get() { @@ -1556,7 +1558,7 @@ pub(crate) fn futimens(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> } // Otherwise use `fsetattrlist`. - let (attrbuf_size, times, attrs) = times_to_attrlist(times); + let (attrbuf_size, times, attrs) = times_to_attrlist(times)?; ret(fsetattrlist( borrowed_fd(fd), @@ -1568,7 +1570,7 @@ pub(crate) fn futimens(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> } } -#[cfg(fix_y2038)] +#[cfg(all(fix_y2038, not(apple)))] fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> { let old_times = [ c::timespec { @@ -1778,6 +1780,7 @@ pub(crate) fn sendfile( /// Convert from a Linux `statx` value to rustix's `Stat`. #[cfg(all(linux_kernel, target_pointer_width = "32"))] +#[allow(deprecated)] // for `st_[amc]time` u64->i64 transition fn statx_to_stat(x: crate::fs::Statx) -> io::Result { Ok(Stat { st_dev: crate::fs::makedev(x.stx_dev_major, x.stx_dev_minor).into(), @@ -1789,23 +1792,11 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result { st_size: x.stx_size.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blksize: x.stx_blksize.into(), st_blocks: x.stx_blocks.into(), - st_atime: x - .stx_atime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_atime: bitcast!(i64::from(x.stx_atime.tv_sec)), st_atime_nsec: x.stx_atime.tv_nsec as _, - st_mtime: x - .stx_mtime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_mtime: bitcast!(i64::from(x.stx_mtime.tv_sec)), st_mtime_nsec: x.stx_mtime.tv_nsec as _, - st_ctime: x - .stx_ctime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_ctime: bitcast!(i64::from(x.stx_ctime.tv_sec)), st_ctime_nsec: x.stx_ctime.tv_nsec as _, st_ino: x.stx_ino.into(), }) @@ -1827,23 +1818,11 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result { result.st_size = x.stx_size.try_into().map_err(|_| io::Errno::OVERFLOW)?; result.st_blksize = x.stx_blksize.into(); result.st_blocks = x.stx_blocks.try_into().map_err(|_e| io::Errno::OVERFLOW)?; - result.st_atime = x - .stx_atime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?; + result.st_atime = bitcast!(i64::from(x.stx_atime.tv_sec)); result.st_atime_nsec = x.stx_atime.tv_nsec as _; - result.st_mtime = x - .stx_mtime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?; + result.st_mtime = bitcast!(i64::from(x.stx_mtime.tv_sec)); result.st_mtime_nsec = x.stx_mtime.tv_nsec as _; - result.st_ctime = x - .stx_ctime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?; + result.st_ctime = bitcast!(i64::from(x.stx_ctime.tv_sec)); result.st_ctime_nsec = x.stx_ctime.tv_nsec as _; result.st_ino = x.stx_ino.into(); @@ -1852,6 +1831,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result { /// Convert from a Linux `stat64` value to rustix's `Stat`. #[cfg(all(linux_kernel, target_pointer_width = "32"))] +#[allow(deprecated)] // for `st_[amc]time` u64->i64 transition fn stat64_to_stat(s64: c::stat64) -> io::Result { Ok(Stat { st_dev: s64.st_dev.try_into().map_err(|_| io::Errno::OVERFLOW)?, @@ -1863,17 +1843,17 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result { st_size: s64.st_size.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blksize: s64.st_blksize.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blocks: s64.st_blocks.try_into().map_err(|_| io::Errno::OVERFLOW)?, - st_atime: s64.st_atime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_atime: bitcast!(i64::from(s64.st_atime)), st_atime_nsec: s64 .st_atime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_mtime: s64.st_mtime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_mtime: bitcast!(i64::from(s64.st_mtime)), st_mtime_nsec: s64 .st_mtime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_ctime: s64.st_ctime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_ctime: bitcast!(i64::from(s64.st_ctime)), st_ctime_nsec: s64 .st_ctime_nsec .try_into() @@ -1899,17 +1879,17 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result { result.st_size = s64.st_size.try_into().map_err(|_| io::Errno::OVERFLOW)?; result.st_blksize = s64.st_blksize.try_into().map_err(|_| io::Errno::OVERFLOW)?; result.st_blocks = s64.st_blocks.try_into().map_err(|_| io::Errno::OVERFLOW)?; - result.st_atime = s64.st_atime.try_into().map_err(|_| io::Errno::OVERFLOW)?; + result.st_atime = i64::from(s64.st_atime) as _; result.st_atime_nsec = s64 .st_atime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?; - result.st_mtime = s64.st_mtime.try_into().map_err(|_| io::Errno::OVERFLOW)?; + result.st_mtime = i64::from(s64.st_mtime) as _; result.st_mtime_nsec = s64 .st_mtime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?; - result.st_ctime = s64.st_ctime.try_into().map_err(|_| io::Errno::OVERFLOW)?; + result.st_ctime = i64::from(s64.st_ctime) as _; result.st_ctime_nsec = s64 .st_ctime_nsec .try_into() @@ -2061,7 +2041,7 @@ pub(crate) unsafe fn copyfile_state_get( nonnegative_ret(copyfile_state_get(state, flag, dst)) } -#[cfg(apple)] +#[cfg(all(apple, feature = "alloc"))] pub(crate) fn getpath(fd: BorrowedFd<'_>) -> io::Result { // The use of `PATH_MAX` is generally not encouraged, but it // is inevitable in this case because macOS defines `fcntl` with @@ -2147,7 +2127,7 @@ pub(crate) fn fcntl_global_nocache(fd: BorrowedFd<'_>, value: bool) -> io::Resul /// Convert `times` from a `futimens`/`utimensat` argument into `setattrlist` /// arguments. #[cfg(apple)] -fn times_to_attrlist(times: &Timestamps) -> (c::size_t, [c::timespec; 2], Attrlist) { +fn times_to_attrlist(times: &Timestamps) -> io::Result<(c::size_t, [c::timespec; 2], Attrlist)> { // ABI details. const ATTR_CMN_MODTIME: u32 = 0x0000_0400; const ATTR_CMN_ACCTIME: u32 = 0x0000_1000; @@ -2156,7 +2136,8 @@ fn times_to_attrlist(times: &Timestamps) -> (c::size_t, [c::timespec; 2], Attrli let mut times = times.clone(); // If we have any `UTIME_NOW` elements, replace them with the current time. - if times.last_access.tv_nsec == c::UTIME_NOW || times.last_modification.tv_nsec == c::UTIME_NOW + if times.last_access.tv_nsec == c::UTIME_NOW.into() + || times.last_modification.tv_nsec == c::UTIME_NOW.into() { let now = { let mut tv = c::timeval { @@ -2172,11 +2153,17 @@ fn times_to_attrlist(times: &Timestamps) -> (c::size_t, [c::timespec; 2], Attrli tv_nsec: (tv.tv_usec * 1000) as _, } }; - if times.last_access.tv_nsec == c::UTIME_NOW { - times.last_access = now; + if times.last_access.tv_nsec == c::UTIME_NOW.into() { + times.last_access = crate::timespec::Timespec { + tv_sec: now.tv_sec.into(), + tv_nsec: now.tv_nsec as _, + }; } - if times.last_modification.tv_nsec == c::UTIME_NOW { - times.last_modification = now; + if times.last_modification.tv_nsec == c::UTIME_NOW.into() { + times.last_modification = crate::timespec::Timespec { + tv_sec: now.tv_sec.into(), + tv_nsec: now.tv_nsec as _, + }; } } @@ -2198,19 +2185,33 @@ fn times_to_attrlist(times: &Timestamps) -> (c::size_t, [c::timespec; 2], Attrli tv_nsec: 0, }; 2]; let mut times_index = 0; - if times.last_modification.tv_nsec != c::UTIME_OMIT { + if times.last_modification.tv_nsec != c::UTIME_OMIT.into() { attrs.commonattr |= ATTR_CMN_MODTIME; - return_times[times_index] = times.last_modification; + return_times[times_index] = c::timespec { + tv_sec: times + .last_modification + .tv_sec + .try_into() + .map_err(|_| io::Errno::OVERFLOW)?, + tv_nsec: times.last_modification.tv_nsec as _, + }; times_index += 1; times_size += size_of::(); } - if times.last_access.tv_nsec != c::UTIME_OMIT { + if times.last_access.tv_nsec != c::UTIME_OMIT.into() { attrs.commonattr |= ATTR_CMN_ACCTIME; - return_times[times_index] = times.last_access; + return_times[times_index] = c::timespec { + tv_sec: times + .last_access + .tv_sec + .try_into() + .map_err(|_| io::Errno::OVERFLOW)?, + tv_nsec: times.last_access.tv_nsec as _, + }; times_size += size_of::(); } - (times_size, return_times, attrs) + Ok((times_size, return_times, attrs)) } /// Support type for `Attrlist`. @@ -2272,15 +2273,24 @@ pub(crate) fn lgetxattr(path: &CStr, name: &CStr, value: &mut [u8]) -> io::Resul } #[cfg(apple)] - unsafe { - ret_usize(c::getxattr( - path.as_ptr(), - name.as_ptr(), - value_ptr.cast::(), - value.len(), - 0, - c::XATTR_NOFOLLOW, - )) + { + // Passing an empty to slice to getxattr leads to ERANGE on macOS. Pass null instead. + let ptr = if value.is_empty() { + core::ptr::null_mut() + } else { + value_ptr.cast::() + }; + + unsafe { + ret_usize(c::getxattr( + path.as_ptr(), + name.as_ptr(), + ptr, + value.len(), + 0, + c::XATTR_NOFOLLOW, + )) + } } } diff --git a/vendor/rustix/src/backend/libc/fs/types.rs b/vendor/rustix/src/backend/libc/fs/types.rs index 876757715..f318f1636 100644 --- a/vendor/rustix/src/backend/libc/fs/types.rs +++ b/vendor/rustix/src/backend/libc/fs/types.rs @@ -159,13 +159,13 @@ bitflags! { #[cfg(not(target_os = "espidf"))] impl Mode { /// Construct a `Mode` from the mode bits of the `st_mode` field of a - /// `Stat`. + /// `Mode`. #[inline] pub const fn from_raw_mode(st_mode: RawMode) -> Self { Self::from_bits_truncate(st_mode) } - /// Construct an `st_mode` value from `Stat`. + /// Construct an `st_mode` value from a `Mode`. #[inline] pub const fn as_raw_mode(self) -> RawMode { self.bits() @@ -503,7 +503,7 @@ impl FileType { } } - /// Construct an `st_mode` value from `Stat`. + /// Construct an `st_mode` value from a `FileType`. #[inline] pub const fn as_raw_mode(self) -> RawMode { match self { @@ -986,10 +986,13 @@ pub struct Stat { pub st_size: i64, pub st_blksize: u32, pub st_blocks: u64, + #[deprecated(note = "Use `rustix::fs::StatExt::atime` instead.")] pub st_atime: u64, pub st_atime_nsec: u32, + #[deprecated(note = "Use `rustix::fs::StatExt::mtime` instead.")] pub st_mtime: u64, pub st_mtime_nsec: u32, + #[deprecated(note = "Use `rustix::fs::StatExt::ctime` instead.")] pub st_ctime: u64, pub st_ctime_nsec: u32, pub st_ino: u64, diff --git a/vendor/rustix/src/backend/libc/io/errno.rs b/vendor/rustix/src/backend/libc/io/errno.rs index 731086b4f..805ea6799 100644 --- a/vendor/rustix/src/backend/libc/io/errno.rs +++ b/vendor/rustix/src/backend/libc/io/errno.rs @@ -14,7 +14,7 @@ use libc_errno::errno; /// # References /// - [POSIX] /// - [Linux] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -24,7 +24,7 @@ use libc_errno::errno; /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html /// [Linux]: https://man7.org/linux/man-pages/man3/errno.3.html -/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 +/// [Winsock]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?errno /// [NetBSD]: https://man.netbsd.org/errno.2 /// [OpenBSD]: https://man.openbsd.org/errno.2 diff --git a/vendor/rustix/src/backend/libc/io/syscalls.rs b/vendor/rustix/src/backend/libc/io/syscalls.rs index 8d5aefadc..e28e6befc 100644 --- a/vendor/rustix/src/backend/libc/io/syscalls.rs +++ b/vendor/rustix/src/backend/libc/io/syscalls.rs @@ -26,14 +26,8 @@ use { crate::io::{IoSlice, IoSliceMut}, }; -pub(crate) fn read(fd: BorrowedFd<'_>, buf: &mut [u8]) -> io::Result { - unsafe { - ret_usize(c::read( - borrowed_fd(fd), - buf.as_mut_ptr().cast(), - min(buf.len(), READ_LIMIT), - )) - } +pub(crate) unsafe fn read(fd: BorrowedFd<'_>, buf: *mut u8, len: usize) -> io::Result { + ret_usize(c::read(borrowed_fd(fd), buf.cast(), min(len, READ_LIMIT))) } pub(crate) fn write(fd: BorrowedFd<'_>, buf: &[u8]) -> io::Result { @@ -46,8 +40,13 @@ pub(crate) fn write(fd: BorrowedFd<'_>, buf: &[u8]) -> io::Result { } } -pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], offset: u64) -> io::Result { - let len = min(buf.len(), READ_LIMIT); +pub(crate) unsafe fn pread( + fd: BorrowedFd<'_>, + buf: *mut u8, + len: usize, + offset: u64, +) -> io::Result { + let len = min(len, READ_LIMIT); // Silently cast; we'll get `EINVAL` if the value is negative. let offset = offset as i64; @@ -56,14 +55,7 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], offset: u64) -> io::Resu #[cfg(any(target_os = "espidf", target_os = "vita"))] let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?; - unsafe { - ret_usize(c::pread( - borrowed_fd(fd), - buf.as_mut_ptr().cast(), - len, - offset, - )) - } + ret_usize(c::pread(borrowed_fd(fd), buf.cast(), len, offset)) } pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], offset: u64) -> io::Result { diff --git a/vendor/rustix/src/backend/libc/mod.rs b/vendor/rustix/src/backend/libc/mod.rs index 729eb2489..9ecb09f12 100644 --- a/vendor/rustix/src/backend/libc/mod.rs +++ b/vendor/rustix/src/backend/libc/mod.rs @@ -1,7 +1,7 @@ //! The libc backend. //! //! On most platforms, this uses the `libc` crate to make system calls. On -//! Windows, this uses the Winsock2 API in `windows-sys`, which can be adapted +//! Windows, this uses the Winsock API in `windows-sys`, which can be adapted //! to have a very `libc`-like interface. // Every FFI call requires an unsafe block, and there are a lot of FFI @@ -21,11 +21,11 @@ pub(crate) mod fd { }; pub(crate) use windows_sys::Win32::Networking::WinSock::SOCKET as LibcFd; - /// A version of [`AsRawFd`] for use with Winsock2 API. + /// A version of [`AsRawFd`] for use with Winsock API. /// /// [`AsRawFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsRawFd.html pub trait AsRawFd { - /// A version of [`as_raw_fd`] for use with Winsock2 API. + /// A version of [`as_raw_fd`] for use with Winsock API. /// /// [`as_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.FromRawFd.html#tymethod.as_raw_fd fn as_raw_fd(&self) -> RawFd; @@ -37,11 +37,11 @@ pub(crate) mod fd { } } - /// A version of [`IntoRawFd`] for use with Winsock2 API. + /// A version of [`IntoRawFd`] for use with Winsock API. /// /// [`IntoRawFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.IntoRawFd.html pub trait IntoRawFd { - /// A version of [`into_raw_fd`] for use with Winsock2 API. + /// A version of [`into_raw_fd`] for use with Winsock API. /// /// [`into_raw_fd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.FromRawFd.html#tymethod.into_raw_fd fn into_raw_fd(self) -> RawFd; @@ -53,11 +53,11 @@ pub(crate) mod fd { } } - /// A version of [`FromRawFd`] for use with Winsock2 API. + /// A version of [`FromRawFd`] for use with Winsock API. /// /// [`FromRawFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.FromRawFd.html pub trait FromRawFd { - /// A version of [`from_raw_fd`] for use with Winsock2 API. + /// A version of [`from_raw_fd`] for use with Winsock API. /// /// # Safety /// @@ -74,11 +74,11 @@ pub(crate) mod fd { } } - /// A version of [`AsFd`] for use with Winsock2 API. + /// A version of [`AsFd`] for use with Winsock API. /// /// [`AsFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsFd.html pub trait AsFd { - /// An `as_fd` function for Winsock2, where a `Fd` is a `Socket`. + /// An `as_fd` function for Winsock, where a `Fd` is a `Socket`. fn as_fd(&self) -> BorrowedFd; } impl AsFd for T { diff --git a/vendor/rustix/src/backend/libc/mount/syscalls.rs b/vendor/rustix/src/backend/libc/mount/syscalls.rs index 26cdb52dc..724511480 100644 --- a/vendor/rustix/src/backend/libc/mount/syscalls.rs +++ b/vendor/rustix/src/backend/libc/mount/syscalls.rs @@ -50,7 +50,7 @@ pub(crate) fn fsmount( fs_fd: BorrowedFd<'_>, flags: super::types::FsMountFlags, attr_flags: super::types::MountAttrFlags, -) -> io::Result<()> { +) -> io::Result { syscall! { fn fsmount( fs_fd: c::c_int, @@ -58,7 +58,7 @@ pub(crate) fn fsmount( attr_flags: c::c_uint ) via SYS_fsmount -> c::c_int } - unsafe { ret(fsmount(borrowed_fd(fs_fd), flags.bits(), attr_flags.bits())) } + unsafe { ret_owned_fd(fsmount(borrowed_fd(fs_fd), flags.bits(), attr_flags.bits())) } } #[cfg(linux_kernel)] diff --git a/vendor/rustix/src/backend/libc/mount/types.rs b/vendor/rustix/src/backend/libc/mount/types.rs index 238f2128e..10236866c 100644 --- a/vendor/rustix/src/backend/libc/mount/types.rs +++ b/vendor/rustix/src/backend/libc/mount/types.rs @@ -227,7 +227,7 @@ bitflags! { /// `MOVE_MOUNT__MASK` const MOVE_MOUNT_SET_GROUP = 0x0000_0100; - // TODO: add when linux 6.5 is released + // TODO: add when Linux 6.5 is released // /// `MOVE_MOUNT_BENEATH` // const MOVE_MOUNT_BENEATH = 0x0000_0200; diff --git a/vendor/rustix/src/backend/libc/net/mod.rs b/vendor/rustix/src/backend/libc/net/mod.rs index d7ab68d52..4f8e99a4d 100644 --- a/vendor/rustix/src/backend/libc/net/mod.rs +++ b/vendor/rustix/src/backend/libc/net/mod.rs @@ -8,6 +8,8 @@ pub(crate) mod ext; target_os = "wasi" )))] pub(crate) mod msghdr; +#[cfg(linux_kernel)] +pub(crate) mod netdevice; pub(crate) mod read_sockaddr; pub(crate) mod send_recv; #[cfg(not(any(target_os = "redox", target_os = "wasi")))] diff --git a/vendor/rustix/src/backend/libc/net/msghdr.rs b/vendor/rustix/src/backend/libc/net/msghdr.rs index dd9b156a5..d212c65a6 100644 --- a/vendor/rustix/src/backend/libc/net/msghdr.rs +++ b/vendor/rustix/src/backend/libc/net/msghdr.rs @@ -5,9 +5,13 @@ use crate::backend::c; use crate::backend::conv::{msg_control_len, msg_iov_len}; +#[cfg(target_os = "linux")] +use crate::backend::net::write_sockaddr::encode_sockaddr_xdp; use crate::backend::net::write_sockaddr::{encode_sockaddr_v4, encode_sockaddr_v6}; use crate::io::{self, IoSlice, IoSliceMut}; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{RecvAncillaryBuffer, SendAncillaryBuffer, SocketAddrV4, SocketAddrV6}; use crate::utils::as_ptr; @@ -124,6 +128,28 @@ pub(crate) fn with_unix_msghdr( }) } +/// Create a message header intended to send with an IPv6 address. +#[cfg(target_os = "linux")] +pub(crate) fn with_xdp_msghdr( + addr: &SocketAddrXdp, + iov: &[IoSlice<'_>], + control: &mut SendAncillaryBuffer<'_, '_, '_>, + f: impl FnOnce(c::msghdr) -> R, +) -> R { + let encoded = encode_sockaddr_xdp(addr); + + f({ + let mut h = zero_msghdr(); + h.msg_name = as_ptr(&encoded) as _; + h.msg_namelen = size_of::() as _; + h.msg_iov = iov.as_ptr() as _; + h.msg_iovlen = msg_iov_len(iov.len()); + h.msg_control = control.as_control_ptr().cast(); + h.msg_controllen = msg_control_len(control.control_len()); + h + }) +} + /// Create a zero-initialized message header struct value. #[cfg(all(unix, not(target_os = "redox")))] pub(crate) fn zero_msghdr() -> c::msghdr { diff --git a/vendor/rustix/src/backend/libc/net/netdevice.rs b/vendor/rustix/src/backend/libc/net/netdevice.rs new file mode 100644 index 000000000..2fbb55b81 --- /dev/null +++ b/vendor/rustix/src/backend/libc/net/netdevice.rs @@ -0,0 +1,52 @@ +#![allow(unsafe_code)] + +#[cfg(feature = "alloc")] +use crate::alloc::string::String; +use crate::backend::io::syscalls::ioctl; +use crate::fd::AsFd; +use crate::io; +#[cfg(feature = "alloc")] +use libc::SIOCGIFNAME; +use libc::{__c_anonymous_ifr_ifru, c_char, ifreq, IFNAMSIZ, SIOCGIFINDEX}; + +pub(crate) fn name_to_index(fd: impl AsFd, if_name: &str) -> io::Result { + let if_name_bytes = if_name.as_bytes(); + if if_name_bytes.len() >= IFNAMSIZ as usize { + return Err(io::Errno::NODEV); + } + + let mut ifreq = ifreq { + ifr_name: [0; 16], + ifr_ifru: __c_anonymous_ifr_ifru { ifru_ifindex: 0 }, + }; + + let mut if_name_c_char_iter = if_name_bytes.iter().map(|byte| *byte as c_char); + ifreq.ifr_name[..if_name_bytes.len()].fill_with(|| if_name_c_char_iter.next().unwrap()); + + unsafe { ioctl(fd.as_fd(), SIOCGIFINDEX as _, &mut ifreq as *mut ifreq as _) }?; + let index = unsafe { ifreq.ifr_ifru.ifru_ifindex }; + Ok(index as u32) +} + +#[cfg(feature = "alloc")] +pub(crate) fn index_to_name(fd: impl AsFd, index: u32) -> io::Result { + let mut ifreq = ifreq { + ifr_name: [0; 16], + ifr_ifru: __c_anonymous_ifr_ifru { + ifru_ifindex: index as _, + }, + }; + + unsafe { ioctl(fd.as_fd(), SIOCGIFNAME as _, &mut ifreq as *mut ifreq as _) }?; + + if let Some(nul_byte) = ifreq.ifr_name.iter().position(|char| *char == 0) { + let name: String = ifreq.ifr_name[..nul_byte] + .iter() + .map(|v| *v as u8 as char) + .collect(); + + Ok(name) + } else { + Err(io::Errno::INVAL) + } +} diff --git a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs index 6da7a50dd..08939d4f8 100644 --- a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs +++ b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs @@ -8,6 +8,8 @@ use crate::backend::c; #[cfg(not(windows))] use crate::ffi::CStr; use crate::io; +#[cfg(target_os = "linux")] +use crate::net::xdp::{SockaddrXdpFlags, SocketAddrXdp}; use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrV4, SocketAddrV6}; use core::mem::size_of; @@ -193,6 +195,19 @@ pub(crate) unsafe fn read_sockaddr( .map(SocketAddrAny::Unix) } } + #[cfg(target_os = "linux")] + c::AF_XDP => { + if len < size_of::() { + return Err(io::Errno::INVAL); + } + let decode = &*storage.cast::(); + Ok(SocketAddrAny::Xdp(SocketAddrXdp::new( + SockaddrXdpFlags::from_bits_retain(decode.sxdp_flags), + u32::from_be(decode.sxdp_ifindex), + u32::from_be(decode.sxdp_queue_id), + u32::from_be(decode.sxdp_shared_umem_fd), + ))) + } _ => Err(io::Errno::INVAL), } } @@ -301,6 +316,17 @@ unsafe fn inner_read_sockaddr_os( ) } } + #[cfg(target_os = "linux")] + c::AF_XDP => { + assert!(len >= size_of::()); + let decode = &*storage.cast::(); + SocketAddrAny::Xdp(SocketAddrXdp::new( + SockaddrXdpFlags::from_bits_retain(decode.sxdp_flags), + u32::from_be(decode.sxdp_ifindex), + u32::from_be(decode.sxdp_queue_id), + u32::from_be(decode.sxdp_shared_umem_fd), + )) + } other => unimplemented!("{:?}", other), } } diff --git a/vendor/rustix/src/backend/libc/net/sockopt.rs b/vendor/rustix/src/backend/libc/net/sockopt.rs index cff2ca288..42bbdada4 100644 --- a/vendor/rustix/src/backend/libc/net/sockopt.rs +++ b/vendor/rustix/src/backend/libc/net/sockopt.rs @@ -14,6 +14,8 @@ use crate::fd::BorrowedFd; use crate::ffi::CStr; use crate::io; use crate::net::sockopt::Timeout; +#[cfg(target_os = "linux")] +use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpRingOffset, XdpStatistics, XdpUmemReg}; #[cfg(not(any( apple, windows, @@ -73,6 +75,8 @@ use c::TCP_KEEPALIVE as TCP_KEEPIDLE; use c::TCP_KEEPIDLE; use core::mem::{size_of, MaybeUninit}; use core::time::Duration; +#[cfg(target_os = "linux")] +use linux_raw_sys::xdp::{xdp_mmap_offsets, xdp_statistics, xdp_statistics_v1}; #[cfg(windows)] use windows_sys::Win32::Foundation::BOOL; @@ -963,6 +967,170 @@ pub(crate) fn get_socket_peercred(fd: BorrowedFd<'_>) -> io::Result { getsockopt(fd, c::SOL_SOCKET, c::SO_PEERCRED) } +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_reg(fd: BorrowedFd<'_>, value: XdpUmemReg) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_REG, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_fill_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_FILL_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_completion_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_COMPLETION_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_tx_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_TX_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_rx_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_RX_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_mmap_offsets(fd: BorrowedFd<'_>) -> io::Result { + // The kernel will write `xdp_mmap_offsets` or `xdp_mmap_offsets_v1` to the supplied pointer, + // depending on the kernel version. Both structs only contain u64 values. + // By using the larger of both as the parameter, we can shuffle the values to the non-v1 version + // returned by `get_xdp_mmap_offsets` while keeping the return type unaffected by the kernel + // version. This works because C will layout all struct members one after the other. + + let mut optlen = core::mem::size_of::().try_into().unwrap(); + debug_assert!( + optlen as usize >= core::mem::size_of::(), + "Socket APIs don't ever use `bool` directly" + ); + let mut value = MaybeUninit::::zeroed(); + getsockopt_raw(fd, c::SOL_XDP, c::XDP_MMAP_OFFSETS, &mut value, &mut optlen)?; + + if optlen as usize == core::mem::size_of::() { + // Safety: All members of xdp_mmap_offsets are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xpd_mmap_offsets = unsafe { value.assume_init() }; + Ok(XdpMmapOffsets { + rx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.producer, + consumer: xpd_mmap_offsets.rx.consumer, + desc: xpd_mmap_offsets.rx.desc, + flags: None, + }, + tx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.flags, + consumer: xpd_mmap_offsets.tx.producer, + desc: xpd_mmap_offsets.tx.consumer, + flags: None, + }, + fr: XdpRingOffset { + producer: xpd_mmap_offsets.tx.desc, + consumer: xpd_mmap_offsets.tx.flags, + desc: xpd_mmap_offsets.fr.producer, + flags: None, + }, + cr: XdpRingOffset { + producer: xpd_mmap_offsets.fr.consumer, + consumer: xpd_mmap_offsets.fr.desc, + desc: xpd_mmap_offsets.fr.flags, + flags: None, + }, + }) + } else { + assert_eq!( + optlen as usize, + core::mem::size_of::(), + "unexpected getsockopt size" + ); + // Safety: All members of xdp_mmap_offsets are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xpd_mmap_offsets = unsafe { value.assume_init() }; + Ok(XdpMmapOffsets { + rx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.producer, + consumer: xpd_mmap_offsets.rx.consumer, + desc: xpd_mmap_offsets.rx.desc, + flags: Some(xpd_mmap_offsets.rx.flags), + }, + tx: XdpRingOffset { + producer: xpd_mmap_offsets.tx.producer, + consumer: xpd_mmap_offsets.tx.consumer, + desc: xpd_mmap_offsets.tx.desc, + flags: Some(xpd_mmap_offsets.tx.flags), + }, + fr: XdpRingOffset { + producer: xpd_mmap_offsets.fr.producer, + consumer: xpd_mmap_offsets.fr.consumer, + desc: xpd_mmap_offsets.fr.desc, + flags: Some(xpd_mmap_offsets.fr.flags), + }, + cr: XdpRingOffset { + producer: xpd_mmap_offsets.cr.producer, + consumer: xpd_mmap_offsets.cr.consumer, + desc: xpd_mmap_offsets.cr.desc, + flags: Some(xpd_mmap_offsets.cr.flags), + }, + }) + } +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_statistics(fd: BorrowedFd<'_>) -> io::Result { + let mut optlen = core::mem::size_of::().try_into().unwrap(); + debug_assert!( + optlen as usize >= core::mem::size_of::(), + "Socket APIs don't ever use `bool` directly" + ); + let mut value = MaybeUninit::::zeroed(); + getsockopt_raw(fd, c::SOL_XDP, c::XDP_STATISTICS, &mut value, &mut optlen)?; + + if optlen as usize == core::mem::size_of::() { + // Safety: All members of xdp_statistics are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xdp_statistics = unsafe { value.assume_init() }; + Ok(XdpStatistics { + rx_dropped: xdp_statistics.rx_dropped, + rx_invalid_descs: xdp_statistics.rx_dropped, + tx_invalid_descs: xdp_statistics.rx_dropped, + rx_ring_full: None, + rx_fill_ring_empty_descs: None, + tx_ring_empty_descs: None, + }) + } else { + assert_eq!( + optlen as usize, + core::mem::size_of::(), + "unexpected getsockopt size" + ); + // Safety: All members of xdp_statistics are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xdp_statistics = unsafe { value.assume_init() }; + Ok(XdpStatistics { + rx_dropped: xdp_statistics.rx_dropped, + rx_invalid_descs: xdp_statistics.rx_invalid_descs, + tx_invalid_descs: xdp_statistics.tx_invalid_descs, + rx_ring_full: Some(xdp_statistics.rx_ring_full), + rx_fill_ring_empty_descs: Some(xdp_statistics.rx_fill_ring_empty_descs), + tx_ring_empty_descs: Some(xdp_statistics.tx_ring_empty_descs), + }) + } +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_options(fd: BorrowedFd<'_>) -> io::Result { + getsockopt(fd, c::SOL_XDP, c::XDP_OPTIONS) +} + #[inline] fn to_ip_mreq(multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> c::ip_mreq { c::ip_mreq { diff --git a/vendor/rustix/src/backend/libc/net/syscalls.rs b/vendor/rustix/src/backend/libc/net/syscalls.rs index 33411c01a..3fdb7766b 100644 --- a/vendor/rustix/src/backend/libc/net/syscalls.rs +++ b/vendor/rustix/src/backend/libc/net/syscalls.rs @@ -2,10 +2,16 @@ #[cfg(unix)] use super::addr::SocketAddrUnix; +#[cfg(target_os = "linux")] +use super::msghdr::with_xdp_msghdr; +#[cfg(target_os = "linux")] +use super::write_sockaddr::encode_sockaddr_xdp; use crate::backend::c; use crate::backend::conv::{borrowed_fd, ret, ret_owned_fd, ret_send_recv, send_recv_len}; use crate::fd::{BorrowedFd, OwnedFd}; use crate::io; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6}; use crate::utils::as_ptr; use core::mem::{size_of, MaybeUninit}; @@ -31,15 +37,18 @@ use { }; #[cfg(not(any(target_os = "redox", target_os = "wasi")))] -pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::Result { - unsafe { - ret_send_recv(c::recv( - borrowed_fd(fd), - buf.as_mut_ptr().cast(), - send_recv_len(buf.len()), - bitflags_bits!(flags), - )) - } +pub(crate) unsafe fn recv( + fd: BorrowedFd<'_>, + buf: *mut u8, + len: usize, + flags: RecvFlags, +) -> io::Result { + ret_send_recv(c::recv( + borrowed_fd(fd), + buf.cast(), + send_recv_len(len), + bitflags_bits!(flags), + )) } #[cfg(not(any(target_os = "redox", target_os = "wasi")))] @@ -55,35 +64,34 @@ pub(crate) fn send(fd: BorrowedFd<'_>, buf: &[u8], flags: SendFlags) -> io::Resu } #[cfg(not(any(target_os = "redox", target_os = "wasi")))] -pub(crate) fn recvfrom( +pub(crate) unsafe fn recvfrom( fd: BorrowedFd<'_>, - buf: &mut [u8], + buf: *mut u8, + buf_len: usize, flags: RecvFlags, ) -> io::Result<(usize, Option)> { - unsafe { - let mut storage = MaybeUninit::::uninit(); - let mut len = size_of::() as c::socklen_t; + let mut storage = MaybeUninit::::uninit(); + let mut len = size_of::() as c::socklen_t; - // `recvfrom` does not write to the storage if the socket is - // connection-oriented sockets, so we initialize the family field to - // `AF_UNSPEC` so that we can detect this case. - initialize_family_to_unspec(storage.as_mut_ptr()); + // `recvfrom` does not write to the storage if the socket is + // connection-oriented sockets, so we initialize the family field to + // `AF_UNSPEC` so that we can detect this case. + initialize_family_to_unspec(storage.as_mut_ptr()); - ret_send_recv(c::recvfrom( - borrowed_fd(fd), - buf.as_mut_ptr().cast(), - send_recv_len(buf.len()), - bitflags_bits!(flags), - storage.as_mut_ptr().cast(), - &mut len, - )) - .map(|nread| { - ( - nread, - maybe_read_sockaddr_os(storage.as_ptr(), len.try_into().unwrap()), - ) - }) - } + ret_send_recv(c::recvfrom( + borrowed_fd(fd), + buf.cast(), + send_recv_len(buf_len), + bitflags_bits!(flags), + storage.as_mut_ptr().cast(), + &mut len, + )) + .map(|nread| { + ( + nread, + maybe_read_sockaddr_os(storage.as_ptr(), len.try_into().unwrap()), + ) + }) } #[cfg(not(any(target_os = "redox", target_os = "wasi")))] @@ -143,6 +151,25 @@ pub(crate) fn sendto_unix( } } +#[cfg(target_os = "linux")] +pub(crate) fn sendto_xdp( + fd: BorrowedFd<'_>, + buf: &[u8], + flags: SendFlags, + addr: &SocketAddrXdp, +) -> io::Result { + unsafe { + ret_send_recv(c::sendto( + borrowed_fd(fd), + buf.as_ptr().cast(), + send_recv_len(buf.len()), + bitflags_bits!(flags), + as_ptr(&encode_sockaddr_xdp(addr)).cast::(), + size_of::() as _, + )) + } +} + #[cfg(not(any(target_os = "redox", target_os = "wasi")))] pub(crate) fn socket( domain: AddressFamily, @@ -215,6 +242,17 @@ pub(crate) fn bind_unix(sockfd: BorrowedFd<'_>, addr: &SocketAddrUnix) -> io::Re } } +#[cfg(target_os = "linux")] +pub(crate) fn bind_xdp(sockfd: BorrowedFd<'_>, addr: &SocketAddrXdp) -> io::Result<()> { + unsafe { + ret(c::bind( + borrowed_fd(sockfd), + as_ptr(&encode_sockaddr_xdp(addr)).cast(), + size_of::() as c::socklen_t, + )) + } +} + #[cfg(not(any(target_os = "redox", target_os = "wasi")))] pub(crate) fn connect_v4(sockfd: BorrowedFd<'_>, addr: &SocketAddrV4) -> io::Result<()> { unsafe { @@ -400,6 +438,23 @@ pub(crate) fn sendmsg_unix( }) } +#[cfg(target_os = "linux")] +pub(crate) fn sendmsg_xdp( + sockfd: BorrowedFd<'_>, + addr: &SocketAddrXdp, + iov: &[IoSlice<'_>], + control: &mut SendAncillaryBuffer<'_, '_, '_>, + msg_flags: SendFlags, +) -> io::Result { + with_xdp_msghdr(addr, iov, control, |msghdr| unsafe { + ret_send_recv(c::sendmsg( + borrowed_fd(sockfd), + &msghdr, + bitflags_bits!(msg_flags), + )) + }) +} + #[cfg(not(any( apple, windows, diff --git a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs index 2eee98cb8..fdc5dbb13 100644 --- a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs +++ b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs @@ -6,6 +6,8 @@ use super::addr::SocketAddrStorage; use super::addr::SocketAddrUnix; use super::ext::{in6_addr_new, in_addr_new, sockaddr_in6_new}; use crate::backend::c; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6}; use core::mem::size_of; @@ -18,6 +20,8 @@ pub(crate) unsafe fn write_sockaddr( SocketAddrAny::V6(v6) => write_sockaddr_v6(v6, storage), #[cfg(unix)] SocketAddrAny::Unix(unix) => write_sockaddr_unix(unix, storage), + #[cfg(target_os = "linux")] + SocketAddrAny::Xdp(xdp) => write_sockaddr_xdp(xdp, storage), } } @@ -101,3 +105,21 @@ unsafe fn write_sockaddr_unix(unix: &SocketAddrUnix, storage: *mut SocketAddrSto core::ptr::write(storage.cast(), unix.unix); unix.len() } + +#[cfg(target_os = "linux")] +pub(crate) fn encode_sockaddr_xdp(xdp: &SocketAddrXdp) -> c::sockaddr_xdp { + c::sockaddr_xdp { + sxdp_family: c::AF_XDP as _, + sxdp_flags: xdp.flags().bits(), + sxdp_ifindex: xdp.interface_index(), + sxdp_queue_id: xdp.queue_id(), + sxdp_shared_umem_fd: xdp.shared_umem_fd(), + } +} + +#[cfg(target_os = "linux")] +unsafe fn write_sockaddr_xdp(xdp: &SocketAddrXdp, storage: *mut SocketAddrStorage) -> usize { + let encoded = encode_sockaddr_xdp(xdp); + core::ptr::write(storage.cast(), encoded); + size_of::() +} diff --git a/vendor/rustix/src/backend/libc/pipe/types.rs b/vendor/rustix/src/backend/libc/pipe/types.rs index d5cc73962..78fc2fcad 100644 --- a/vendor/rustix/src/backend/libc/pipe/types.rs +++ b/vendor/rustix/src/backend/libc/pipe/types.rs @@ -53,12 +53,14 @@ bitflags! { } } -/// A buffer type used with `vmsplice`. +/// A buffer type for use with [`vmsplice`]. /// /// It is guaranteed to be ABI compatible with the iovec type on Unix platforms /// and `WSABUF` on Windows. Unlike `IoSlice` and `IoSliceMut` it is /// semantically like a raw pointer, and therefore can be shared or mutated as /// needed. +/// +/// [`vmsplice`]: crate::pipe::vmsplice #[cfg(linux_kernel)] #[repr(transparent)] pub struct IoSliceRaw<'a> { diff --git a/vendor/rustix/src/backend/libc/pty/syscalls.rs b/vendor/rustix/src/backend/libc/pty/syscalls.rs index 86f3a6c46..2395efde4 100644 --- a/vendor/rustix/src/backend/libc/pty/syscalls.rs +++ b/vendor/rustix/src/backend/libc/pty/syscalls.rs @@ -58,7 +58,7 @@ pub(crate) fn ptsname(fd: BorrowedFd<'_>, mut buffer: Vec) -> io::Result io::Result { +pub(crate) unsafe fn getrandom( + buf: *mut u8, + cap: usize, + flags: GetRandomFlags, +) -> io::Result { // `getrandom` wasn't supported in glibc until 2.25. weak_or_syscall! { fn getrandom(buf: *mut c::c_void, buflen: c::size_t, flags: c::c_uint) via SYS_getrandom -> c::ssize_t } - unsafe { ret_usize(getrandom(buf.as_mut_ptr().cast(), buf.len(), flags.bits())) } + ret_usize(getrandom(buf.cast(), cap, flags.bits())) } diff --git a/vendor/rustix/src/backend/libc/time/syscalls.rs b/vendor/rustix/src/backend/libc/time/syscalls.rs index 6b1c9fd03..97eae5fd7 100644 --- a/vendor/rustix/src/backend/libc/time/syscalls.rs +++ b/vendor/rustix/src/backend/libc/time/syscalls.rs @@ -167,8 +167,8 @@ pub(crate) fn clock_gettime_dynamic(id: DynamicClockId<'_>) -> io::Result c::CLOCK_TAI, #[cfg(any( - freebsdlike, linux_kernel, + target_os = "freebsd", target_os = "fuchsia", target_os = "openbsd" ))] diff --git a/vendor/rustix/src/backend/libc/winsock_c.rs b/vendor/rustix/src/backend/libc/winsock_c.rs index 0a1554a86..ee2704ade 100644 --- a/vendor/rustix/src/backend/libc/winsock_c.rs +++ b/vendor/rustix/src/backend/libc/winsock_c.rs @@ -1,4 +1,4 @@ -//! Adapt the Winsock2 API to resemble a POSIX-style libc API. +//! Adapt the Winsock API to resemble a POSIX-style libc API. #![allow(unused_imports)] #![allow(non_camel_case_types)] diff --git a/vendor/rustix/src/backend/linux_raw/c.rs b/vendor/rustix/src/backend/linux_raw/c.rs index edc9eb862..b2cd5bdcb 100644 --- a/vendor/rustix/src/backend/linux_raw/c.rs +++ b/vendor/rustix/src/backend/linux_raw/c.rs @@ -42,6 +42,10 @@ pub(crate) use linux_raw_sys::general::{ }; pub(crate) use linux_raw_sys::ioctl::{BLKPBSZGET, BLKSSZGET, FICLONE}; +#[cfg(target_pointer_width = "32")] +pub(crate) use linux_raw_sys::ioctl::{FS_IOC32_GETFLAGS, FS_IOC32_SETFLAGS}; +#[cfg(target_pointer_width = "64")] +pub(crate) use linux_raw_sys::ioctl::{FS_IOC_GETFLAGS, FS_IOC_SETFLAGS}; #[cfg(feature = "io_uring")] pub(crate) use linux_raw_sys::{general::open_how, io_uring::*}; @@ -58,7 +62,7 @@ pub(crate) use linux_raw_sys::{ AF_ASH, AF_ATMPVC, AF_ATMSVC, AF_AX25, AF_BLUETOOTH, AF_BRIDGE, AF_CAN, AF_ECONET, AF_IEEE802154, AF_INET, AF_INET6, AF_IPX, AF_IRDA, AF_ISDN, AF_IUCV, AF_KEY, AF_LLC, AF_NETBEUI, AF_NETLINK, AF_NETROM, AF_PACKET, AF_PHONET, AF_PPPOX, AF_RDS, AF_ROSE, - AF_RXRPC, AF_SECURITY, AF_SNA, AF_TIPC, AF_UNIX, AF_UNSPEC, AF_WANPIPE, AF_X25, + AF_RXRPC, AF_SECURITY, AF_SNA, AF_TIPC, AF_UNIX, AF_UNSPEC, AF_WANPIPE, AF_X25, AF_XDP, IP6T_SO_ORIGINAL_DST, IPPROTO_FRAGMENT, IPPROTO_ICMPV6, IPPROTO_MH, IPPROTO_ROUTING, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_FREEBIND, IPV6_MULTICAST_HOPS, IPV6_MULTICAST_LOOP, IPV6_RECVTCLASS, IPV6_TCLASS, IPV6_UNICAST_HOPS, IPV6_V6ONLY, @@ -67,14 +71,25 @@ pub(crate) use linux_raw_sys::{ MSG_CMSG_CLOEXEC, MSG_CONFIRM, MSG_DONTROUTE, MSG_DONTWAIT, MSG_EOR, MSG_ERRQUEUE, MSG_MORE, MSG_NOSIGNAL, MSG_OOB, MSG_PEEK, MSG_TRUNC, MSG_WAITALL, SCM_CREDENTIALS, SCM_RIGHTS, SHUT_RD, SHUT_RDWR, SHUT_WR, SOCK_DGRAM, SOCK_RAW, SOCK_RDM, SOCK_SEQPACKET, - SOCK_STREAM, SOL_SOCKET, SO_ACCEPTCONN, SO_BROADCAST, SO_COOKIE, SO_DOMAIN, SO_ERROR, - SO_INCOMING_CPU, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_ORIGINAL_DST, SO_PASSCRED, - SO_PROTOCOL, SO_RCVBUF, SO_RCVTIMEO_NEW, SO_RCVTIMEO_NEW as SO_RCVTIMEO, SO_RCVTIMEO_OLD, - SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_SNDTIMEO_NEW, SO_SNDTIMEO_NEW as SO_SNDTIMEO, - SO_SNDTIMEO_OLD, SO_TYPE, TCP_CONGESTION, TCP_CORK, TCP_KEEPCNT, TCP_KEEPIDLE, - TCP_KEEPINTVL, TCP_NODELAY, TCP_QUICKACK, TCP_THIN_LINEAR_TIMEOUTS, TCP_USER_TIMEOUT, + SOCK_STREAM, SOL_SOCKET, SOL_XDP, SO_ACCEPTCONN, SO_BROADCAST, SO_COOKIE, SO_DOMAIN, + SO_ERROR, SO_INCOMING_CPU, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_ORIGINAL_DST, + SO_PASSCRED, SO_PROTOCOL, SO_RCVBUF, SO_RCVTIMEO_NEW, SO_RCVTIMEO_NEW as SO_RCVTIMEO, + SO_RCVTIMEO_OLD, SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_SNDTIMEO_NEW, + SO_SNDTIMEO_NEW as SO_SNDTIMEO, SO_SNDTIMEO_OLD, SO_TYPE, TCP_CONGESTION, TCP_CORK, + TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_NODELAY, TCP_QUICKACK, + TCP_THIN_LINEAR_TIMEOUTS, TCP_USER_TIMEOUT, }, netlink::*, + xdp::{ + sockaddr_xdp, xdp_desc, xdp_mmap_offsets, xdp_mmap_offsets_v1, xdp_options, + xdp_ring_offset, xdp_ring_offset_v1, xdp_statistics, xdp_statistics_v1, xdp_umem_reg, + xdp_umem_reg_v1, XDP_COPY, XDP_MMAP_OFFSETS, XDP_OPTIONS, XDP_OPTIONS_ZEROCOPY, + XDP_PGOFF_RX_RING, XDP_PGOFF_TX_RING, XDP_PKT_CONTD, XDP_RING_NEED_WAKEUP, XDP_RX_RING, + XDP_SHARED_UMEM, XDP_STATISTICS, XDP_TX_RING, XDP_UMEM_COMPLETION_RING, XDP_UMEM_FILL_RING, + XDP_UMEM_PGOFF_COMPLETION_RING, XDP_UMEM_PGOFF_FILL_RING, XDP_UMEM_REG, + XDP_UMEM_UNALIGNED_CHUNK_FLAG, XDP_USE_NEED_WAKEUP, XDP_USE_SG, XDP_ZEROCOPY, + XSK_UNALIGNED_BUF_ADDR_MASK, XSK_UNALIGNED_BUF_OFFSET_SHIFT, + }, }; // Cast away bindgen's `enum` type to make these consistent with the other diff --git a/vendor/rustix/src/backend/linux_raw/event/epoll.rs b/vendor/rustix/src/backend/linux_raw/event/epoll.rs index fb6a04c8e..3d5787b8f 100644 --- a/vendor/rustix/src/backend/linux_raw/event/epoll.rs +++ b/vendor/rustix/src/backend/linux_raw/event/epoll.rs @@ -1,4 +1,4 @@ -//! Linx `epoll` support. +//! Linux `epoll` support. //! //! # Examples //! @@ -160,8 +160,8 @@ pub fn create(flags: CreateFlags) -> io::Result { syscalls::epoll_create(flags) } -/// `epoll_ctl(self, EPOLL_CTL_ADD, data, event)`—Adds an element to an -/// epoll object. +/// `epoll_ctl(self, EPOLL_CTL_ADD, data, event)`—Adds an element to an epoll +/// object. /// /// This registers interest in any of the events set in `events` occurring on /// the file descriptor associated with `data`. diff --git a/vendor/rustix/src/backend/linux_raw/fs/dir.rs b/vendor/rustix/src/backend/linux_raw/fs/dir.rs index dbddd58f1..a8c9a5576 100644 --- a/vendor/rustix/src/backend/linux_raw/fs/dir.rs +++ b/vendor/rustix/src/backend/linux_raw/fs/dir.rs @@ -81,7 +81,7 @@ impl Dir { /// `readdir(self)`, where `None` means the end of the directory. pub fn read(&mut self) -> Option> { - // If we've seen errors, don't continue to try to read anyting further. + // If we've seen errors, don't continue to try to read anything further. if self.any_errors { return None; } diff --git a/vendor/rustix/src/backend/linux_raw/fs/inotify.rs b/vendor/rustix/src/backend/linux_raw/fs/inotify.rs index aaba71d7c..851335ba8 100644 --- a/vendor/rustix/src/backend/linux_raw/fs/inotify.rs +++ b/vendor/rustix/src/backend/linux_raw/fs/inotify.rs @@ -107,7 +107,7 @@ pub fn inotify_add_watch( path.into_with_c_str(|path| syscalls::inotify_add_watch(inot, path, flags)) } -/// `inotify_rm_watch(self, wd)`—Removes a watch from this inotify +/// `inotify_rm_watch(self, wd)`—Removes a watch from this inotify. /// /// The watch descriptor provided should have previously been returned by /// [`inotify_add_watch`] and not previously have been removed. diff --git a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs index 5f15f5c93..126549386 100644 --- a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs @@ -8,7 +8,13 @@ use crate::backend::c; use crate::backend::conv::fs::oflags_for_open_how; -#[cfg(not(feature = "linux_4_11"))] +#[cfg(any( + not(feature = "linux_4_11"), + target_arch = "aarch64", + target_arch = "riscv64", + target_arch = "mips", + target_arch = "mips32r6", +))] use crate::backend::conv::zero; use crate::backend::conv::{ by_ref, c_int, c_uint, dev_t, opt_mut, pass_usize, raw_fd, ret, ret_c_int, ret_c_uint, @@ -705,6 +711,7 @@ fn lstat_old(path: &CStr) -> io::Result { target_arch = "mips64", target_arch = "mips64r6" ))] +#[allow(deprecated)] // for `st_[amc]time` u64->i64 transition fn statx_to_stat(x: crate::fs::Statx) -> io::Result { Ok(Stat { st_dev: crate::fs::makedev(x.stx_dev_major, x.stx_dev_minor), @@ -716,23 +723,11 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result { st_size: x.stx_size.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blksize: x.stx_blksize.into(), st_blocks: x.stx_blocks.into(), - st_atime: x - .stx_atime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_atime: bitcast!(i64::from(x.stx_atime.tv_sec)), st_atime_nsec: x.stx_atime.tv_nsec.into(), - st_mtime: x - .stx_mtime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_mtime: bitcast!(i64::from(x.stx_mtime.tv_sec)), st_mtime_nsec: x.stx_mtime.tv_nsec.into(), - st_ctime: x - .stx_ctime - .tv_sec - .try_into() - .map_err(|_| io::Errno::OVERFLOW)?, + st_ctime: bitcast!(i64::from(x.stx_ctime.tv_sec)), st_ctime_nsec: x.stx_ctime.tv_nsec.into(), st_ino: x.stx_ino.into(), }) @@ -740,6 +735,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result { /// Convert from a Linux `stat64` value to rustix's `Stat`. #[cfg(target_pointer_width = "32")] +#[allow(deprecated)] // for `st_[amc]time` u64->i64 transition fn stat_to_stat(s64: linux_raw_sys::general::stat64) -> io::Result { Ok(Stat { st_dev: s64.st_dev.try_into().map_err(|_| io::Errno::OVERFLOW)?, @@ -751,17 +747,17 @@ fn stat_to_stat(s64: linux_raw_sys::general::stat64) -> io::Result { st_size: s64.st_size.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blksize: s64.st_blksize.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blocks: s64.st_blocks.try_into().map_err(|_| io::Errno::OVERFLOW)?, - st_atime: s64.st_atime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_atime: bitcast!(i64::from(s64.st_atime)), st_atime_nsec: s64 .st_atime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_mtime: s64.st_mtime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_mtime: bitcast!(i64::from(s64.st_mtime)), st_mtime_nsec: s64 .st_mtime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_ctime: s64.st_ctime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_ctime: bitcast!(i64::from(s64.st_ctime)), st_ctime_nsec: s64 .st_ctime_nsec .try_into() @@ -783,17 +779,17 @@ fn stat_to_stat(s: linux_raw_sys::general::stat) -> io::Result { st_size: s.st_size.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blksize: s.st_blksize.try_into().map_err(|_| io::Errno::OVERFLOW)?, st_blocks: s.st_blocks.try_into().map_err(|_| io::Errno::OVERFLOW)?, - st_atime: s.st_atime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_atime: bitcast!(i64::from(s.st_atime)), st_atime_nsec: s .st_atime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_mtime: s.st_mtime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_mtime: bitcast!(i64::from(s.st_mtime)), st_mtime_nsec: s .st_mtime_nsec .try_into() .map_err(|_| io::Errno::OVERFLOW)?, - st_ctime: s.st_ctime.try_into().map_err(|_| io::Errno::OVERFLOW)?, + st_ctime: bitcast!(i64::from(s.st_ctime)), st_ctime_nsec: s .st_ctime_nsec .try_into() diff --git a/vendor/rustix/src/backend/linux_raw/fs/types.rs b/vendor/rustix/src/backend/linux_raw/fs/types.rs index 71ee9f52e..c109a6ff9 100644 --- a/vendor/rustix/src/backend/linux_raw/fs/types.rs +++ b/vendor/rustix/src/backend/linux_raw/fs/types.rs @@ -127,13 +127,13 @@ bitflags! { impl Mode { /// Construct a `Mode` from the mode bits of the `st_mode` field of a - /// `Stat`. + /// `Mode`. #[inline] pub const fn from_raw_mode(st_mode: RawMode) -> Self { Self::from_bits_truncate(st_mode) } - /// Construct an `st_mode` value from `Stat`. + /// Construct an `st_mode` value from a `Mode`. #[inline] pub const fn as_raw_mode(self) -> RawMode { self.bits() @@ -355,7 +355,7 @@ impl FileType { } } - /// Construct an `st_mode` value from `Stat`. + /// Construct an `st_mode` value from a `FileType`. #[inline] pub const fn as_raw_mode(self) -> RawMode { match self { @@ -653,10 +653,13 @@ pub struct Stat { pub st_size: i64, pub st_blksize: u32, pub st_blocks: u64, + #[deprecated(note = "Use `rustix::fs::StatExt::atime` instead.")] pub st_atime: u64, pub st_atime_nsec: u32, + #[deprecated(note = "Use `rustix::fs::StatExt::mtime` instead.")] pub st_mtime: u64, pub st_mtime_nsec: u32, + #[deprecated(note = "Use `rustix::fs::StatExt::ctime` instead.")] pub st_ctime: u64, pub st_ctime_nsec: u32, pub st_ino: u64, diff --git a/vendor/rustix/src/backend/linux_raw/io/errno.rs b/vendor/rustix/src/backend/linux_raw/io/errno.rs index 6771ba2b2..bc40e9a8d 100644 --- a/vendor/rustix/src/backend/linux_raw/io/errno.rs +++ b/vendor/rustix/src/backend/linux_raw/io/errno.rs @@ -24,7 +24,7 @@ use linux_raw_sys::errno; /// # References /// - [POSIX] /// - [Linux] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -34,7 +34,7 @@ use linux_raw_sys::errno; /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html /// [Linux]: https://man7.org/linux/man-pages/man3/errno.3.html -/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 +/// [Winsock]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?errno /// [NetBSD]: https://man.netbsd.org/errno.2 /// [OpenBSD]: https://man.openbsd.org/errno.2 diff --git a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs index 62c68a22f..c38f28fce 100644 --- a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs @@ -15,7 +15,7 @@ use crate::backend::conv::loff_t_from_u64; use crate::backend::conv::zero; use crate::backend::conv::{ c_uint, pass_usize, raw_fd, ret, ret_c_int, ret_c_uint, ret_discarded_fd, ret_owned_fd, - ret_usize, slice, slice_mut, + ret_usize, slice, }; #[cfg(target_pointer_width = "32")] use crate::backend::conv::{hi, lo}; @@ -29,27 +29,28 @@ use core::cmp; use linux_raw_sys::general::{F_DUPFD_CLOEXEC, F_GETFD, F_SETFD}; #[inline] -pub(crate) fn read(fd: BorrowedFd<'_>, buf: &mut [u8]) -> io::Result { - let (buf_addr_mut, buf_len) = slice_mut(buf); - - unsafe { ret_usize(syscall!(__NR_read, fd, buf_addr_mut, buf_len)) } +pub(crate) unsafe fn read(fd: BorrowedFd<'_>, buf: *mut u8, len: usize) -> io::Result { + ret_usize(syscall!(__NR_read, fd, buf, pass_usize(len))) } #[inline] -pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result { - let (buf_addr_mut, buf_len) = slice_mut(buf); - +pub(crate) unsafe fn pread( + fd: BorrowedFd<'_>, + buf: *mut u8, + len: usize, + pos: u64, +) -> io::Result { // #[cfg(all( target_pointer_width = "32", any(target_arch = "arm", target_arch = "mips", target_arch = "mips32r6"), ))] - unsafe { + { ret_usize(syscall!( __NR_pread64, fd, - buf_addr_mut, - buf_len, + buf, + pass_usize(len), zero(), hi(pos), lo(pos) @@ -59,26 +60,24 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result< target_pointer_width = "32", not(any(target_arch = "arm", target_arch = "mips", target_arch = "mips32r6")), ))] - unsafe { + { ret_usize(syscall!( __NR_pread64, fd, - buf_addr_mut, - buf_len, + buf, + pass_usize(len), hi(pos), lo(pos) )) } #[cfg(target_pointer_width = "64")] - unsafe { - ret_usize(syscall!( - __NR_pread64, - fd, - buf_addr_mut, - buf_len, - loff_t_from_u64(pos) - )) - } + ret_usize(syscall!( + __NR_pread64, + fd, + buf, + pass_usize(len), + loff_t_from_u64(pos) + )) } #[inline] @@ -268,15 +267,15 @@ pub(crate) fn is_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)> { // Do a `recv` with `PEEK` and `DONTWAIT` for 1 byte. A 0 indicates // the read side is shut down; an `EWOULDBLOCK` indicates the read // side is still open. - // - // TODO: This code would benefit from having a better way to read into - // uninitialized memory. - let mut buf = [0]; - match crate::backend::net::syscalls::recv( - fd, - &mut buf, - RecvFlags::PEEK | RecvFlags::DONTWAIT, - ) { + let mut buf = [core::mem::MaybeUninit::::uninit()]; + match unsafe { + crate::backend::net::syscalls::recv( + fd, + buf.as_mut_ptr() as *mut u8, + 1, + RecvFlags::PEEK | RecvFlags::DONTWAIT, + ) + } { Ok(0) => read = false, Err(err) => { #[allow(unreachable_patterns)] // `EAGAIN` may equal `EWOULDBLOCK` diff --git a/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs index 77c2a181d..5cb80cc09 100644 --- a/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs @@ -51,8 +51,8 @@ pub(crate) fn fsmount( fs_fd: BorrowedFd<'_>, flags: super::types::FsMountFlags, attr_flags: super::types::MountAttrFlags, -) -> io::Result<()> { - unsafe { ret(syscall_readonly!(__NR_fsmount, fs_fd, flags, attr_flags)) } +) -> io::Result { + unsafe { ret_owned_fd(syscall_readonly!(__NR_fsmount, fs_fd, flags, attr_flags)) } } #[cfg(feature = "mount")] diff --git a/vendor/rustix/src/backend/linux_raw/mount/types.rs b/vendor/rustix/src/backend/linux_raw/mount/types.rs index 43a2f7b49..43cb8c0d5 100644 --- a/vendor/rustix/src/backend/linux_raw/mount/types.rs +++ b/vendor/rustix/src/backend/linux_raw/mount/types.rs @@ -223,7 +223,7 @@ bitflags! { /// `MOVE_MOUNT__MASK` const MOVE_MOUNT_SET_GROUP = linux_raw_sys::general::MOVE_MOUNT_SET_GROUP; - // TODO: add when linux 6.5 is released + // TODO: add when Linux 6.5 is released // /// `MOVE_MOUNT_BENEATH` // const MOVE_MOUNT_BENEATH = linux_raw_sys::general::MOVE_MOUNT_BENEATH; diff --git a/vendor/rustix/src/backend/linux_raw/net/addr.rs b/vendor/rustix/src/backend/linux_raw/net/addr.rs index e6b307a16..85ba875bf 100644 --- a/vendor/rustix/src/backend/linux_raw/net/addr.rs +++ b/vendor/rustix/src/backend/linux_raw/net/addr.rs @@ -12,6 +12,7 @@ use crate::{io, path}; use core::cmp::Ordering; use core::fmt; use core::hash::{Hash, Hasher}; +use core::slice; /// `struct sockaddr_un` #[derive(Clone)] @@ -36,7 +37,7 @@ impl SocketAddrUnix { return Err(io::Errno::NAMETOOLONG); } for (i, b) in bytes.iter().enumerate() { - unix.sun_path[i] = *b; + unix.sun_path[i] = *b as _; } let len = offsetof_sun_path() + bytes.len(); let len = len.try_into().unwrap(); @@ -48,6 +49,10 @@ impl SocketAddrUnix { pub fn new_abstract_name(name: &[u8]) -> io::Result { let mut unix = Self::init(); let id = &mut unix.sun_path[1..]; + + // SAFETY: Convert `&mut [c_char]` to `&mut [u8]`. + let id = unsafe { slice::from_raw_parts_mut(id.as_mut_ptr().cast::(), id.len()) }; + if let Some(id) = id.get_mut(..name.len()) { id.copy_from_slice(name); let len = offsetof_sun_path() + 1 + name.len(); @@ -69,9 +74,13 @@ impl SocketAddrUnix { #[inline] pub fn path(&self) -> Option<&CStr> { let len = self.len(); - if len != 0 && self.unix.sun_path[0] != b'\0' { + if len != 0 && self.unix.sun_path[0] as u8 != b'\0' { let end = len as usize - offsetof_sun_path(); let bytes = &self.unix.sun_path[..end]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = unsafe { slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()) }; + // SAFETY: `from_bytes_with_nul_unchecked` since the string is // NUL-terminated. unsafe { Some(CStr::from_bytes_with_nul_unchecked(bytes)) } @@ -84,9 +93,14 @@ impl SocketAddrUnix { #[inline] pub fn abstract_name(&self) -> Option<&[u8]> { let len = self.len(); - if len != 0 && self.unix.sun_path[0] == b'\0' { + if len != 0 && self.unix.sun_path[0] as u8 == b'\0' { let end = len as usize - offsetof_sun_path(); - Some(&self.unix.sun_path[1..end]) + let bytes = &self.unix.sun_path[1..end]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = unsafe { slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()) }; + + Some(bytes) } else { None } diff --git a/vendor/rustix/src/backend/linux_raw/net/mod.rs b/vendor/rustix/src/backend/linux_raw/net/mod.rs index f83c54621..0387d8b42 100644 --- a/vendor/rustix/src/backend/linux_raw/net/mod.rs +++ b/vendor/rustix/src/backend/linux_raw/net/mod.rs @@ -1,5 +1,7 @@ pub(crate) mod addr; pub(crate) mod msghdr; +#[cfg(linux_kernel)] +pub(crate) mod netdevice; pub(crate) mod read_sockaddr; pub(crate) mod send_recv; pub(crate) mod sockopt; diff --git a/vendor/rustix/src/backend/linux_raw/net/msghdr.rs b/vendor/rustix/src/backend/linux_raw/net/msghdr.rs index 2b88bfbbc..3ccce04c9 100644 --- a/vendor/rustix/src/backend/linux_raw/net/msghdr.rs +++ b/vendor/rustix/src/backend/linux_raw/net/msghdr.rs @@ -6,9 +6,13 @@ #![allow(unsafe_code)] use crate::backend::c; +#[cfg(target_os = "linux")] +use crate::backend::net::write_sockaddr::encode_sockaddr_xdp; use crate::backend::net::write_sockaddr::{encode_sockaddr_v4, encode_sockaddr_v6}; use crate::io::{self, IoSlice, IoSliceMut}; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{RecvAncillaryBuffer, SendAncillaryBuffer, SocketAddrV4, SocketAddrV6}; use crate::utils::as_ptr; @@ -132,6 +136,27 @@ pub(crate) fn with_unix_msghdr( }) } +/// Create a message header intended to send with an XDP address. +#[cfg(target_os = "linux")] +pub(crate) fn with_xdp_msghdr( + addr: &SocketAddrXdp, + iov: &[IoSlice<'_>], + control: &mut SendAncillaryBuffer<'_, '_, '_>, + f: impl FnOnce(c::msghdr) -> R, +) -> R { + let encoded = encode_sockaddr_xdp(addr); + + f(c::msghdr { + msg_name: as_ptr(&encoded) as _, + msg_namelen: size_of::() as _, + msg_iov: iov.as_ptr() as _, + msg_iovlen: msg_iov_len(iov.len()), + msg_control: control.as_control_ptr().cast(), + msg_controllen: msg_control_len(control.control_len()), + msg_flags: 0, + }) +} + /// Create a zero-initialized message header struct value. pub(crate) fn zero_msghdr() -> c::msghdr { c::msghdr { diff --git a/vendor/rustix/src/backend/linux_raw/net/netdevice.rs b/vendor/rustix/src/backend/linux_raw/net/netdevice.rs new file mode 100644 index 000000000..333d27c03 --- /dev/null +++ b/vendor/rustix/src/backend/linux_raw/net/netdevice.rs @@ -0,0 +1,68 @@ +#![allow(unsafe_code)] + +use crate::backend::io::syscalls::ioctl; +use crate::fd::AsFd; +use crate::io; +use core::slice; +use core::str; +use linux_raw_sys::ctypes::c_char; +use linux_raw_sys::ioctl::SIOCGIFINDEX; +#[cfg(feature = "alloc")] +use linux_raw_sys::ioctl::SIOCGIFNAME; +use linux_raw_sys::net::{ifreq, ifreq__bindgen_ty_1, ifreq__bindgen_ty_2, IFNAMSIZ}; +#[cfg(feature = "alloc")] +use {alloc::borrow::ToOwned, alloc::string::String}; + +pub(crate) fn name_to_index(fd: impl AsFd, if_name: &str) -> io::Result { + let if_name_bytes = if_name.as_bytes(); + if if_name_bytes.len() >= IFNAMSIZ as usize { + return Err(io::Errno::NODEV); + } + if if_name_bytes.contains(&0) { + return Err(io::Errno::NODEV); + } + + // SAFETY: Convert `&[u8]` to `&[c_char]`. + let if_name_bytes = unsafe { + slice::from_raw_parts(if_name_bytes.as_ptr().cast::(), if_name_bytes.len()) + }; + + let mut ifreq = ifreq { + ifr_ifrn: ifreq__bindgen_ty_1 { ifrn_name: [0; 16] }, + ifr_ifru: ifreq__bindgen_ty_2 { ifru_ivalue: 0 }, + }; + unsafe { ifreq.ifr_ifrn.ifrn_name[..if_name_bytes.len()].copy_from_slice(if_name_bytes) }; + + unsafe { ioctl(fd.as_fd(), SIOCGIFINDEX, &mut ifreq as *mut ifreq as _) }?; + let index = unsafe { ifreq.ifr_ifru.ifru_ivalue }; + Ok(index as u32) +} + +#[cfg(feature = "alloc")] +pub(crate) fn index_to_name(fd: impl AsFd, index: u32) -> io::Result { + let mut ifreq = ifreq { + ifr_ifrn: ifreq__bindgen_ty_1 { ifrn_name: [0; 16] }, + ifr_ifru: ifreq__bindgen_ty_2 { + ifru_ivalue: index as _, + }, + }; + + unsafe { ioctl(fd.as_fd(), SIOCGIFNAME, &mut ifreq as *mut ifreq as _) }?; + + if let Some(nul_byte) = unsafe { ifreq.ifr_ifrn.ifrn_name } + .iter() + .position(|ch| *ch == 0) + { + let ifrn_name = unsafe { &ifreq.ifr_ifrn.ifrn_name[..nul_byte] }; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let ifrn_name = + unsafe { slice::from_raw_parts(ifrn_name.as_ptr().cast::(), ifrn_name.len()) }; + + str::from_utf8(ifrn_name) + .map_err(|_| io::Errno::ILSEQ) + .map(ToOwned::to_owned) + } else { + Err(io::Errno::INVAL) + } +} diff --git a/vendor/rustix/src/backend/linux_raw/net/read_sockaddr.rs b/vendor/rustix/src/backend/linux_raw/net/read_sockaddr.rs index af7282c98..23e1d641d 100644 --- a/vendor/rustix/src/backend/linux_raw/net/read_sockaddr.rs +++ b/vendor/rustix/src/backend/linux_raw/net/read_sockaddr.rs @@ -4,8 +4,11 @@ use crate::backend::c; use crate::io; +#[cfg(target_os = "linux")] +use crate::net::xdp::{SockaddrXdpFlags, SocketAddrXdp}; use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6}; use core::mem::size_of; +use core::slice; // This must match the header of `sockaddr`. #[repr(C)] @@ -93,19 +96,37 @@ pub(crate) unsafe fn read_sockaddr( // // [abstract namespace]: https://man7.org/linux/man-pages/man7/unix.7.html if decode.sun_path[0] == 0 { - return SocketAddrUnix::new_abstract_name( - &decode.sun_path[1..len - offsetof_sun_path], - ) - .map(SocketAddrAny::Unix); + let bytes = &decode.sun_path[1..len - offsetof_sun_path]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()); + + return SocketAddrUnix::new_abstract_name(bytes).map(SocketAddrAny::Unix); } // Otherwise we expect a NUL-terminated filesystem path. + let bytes = &decode.sun_path[..len - 1 - offsetof_sun_path]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()); + assert_eq!(decode.sun_path[len - 1 - offsetof_sun_path], 0); - Ok(SocketAddrAny::Unix(SocketAddrUnix::new( - &decode.sun_path[..len - 1 - offsetof_sun_path], - )?)) + Ok(SocketAddrAny::Unix(SocketAddrUnix::new(bytes)?)) } } + #[cfg(target_os = "linux")] + c::AF_XDP => { + if len < size_of::() { + return Err(io::Errno::INVAL); + } + let decode = &*storage.cast::(); + Ok(SocketAddrAny::Xdp(SocketAddrXdp::new( + SockaddrXdpFlags::from_bits_retain(decode.sxdp_flags), + u32::from_be(decode.sxdp_ifindex), + u32::from_be(decode.sxdp_queue_id), + u32::from_be(decode.sxdp_shared_umem_fd), + ))) + } _ => Err(io::Errno::NOTSUP), } } @@ -165,21 +186,36 @@ pub(crate) unsafe fn read_sockaddr_os(storage: *const c::sockaddr, len: usize) - // // [abstract namespace]: https://man7.org/linux/man-pages/man7/unix.7.html if decode.sun_path[0] == 0 { - return SocketAddrAny::Unix( - SocketAddrUnix::new_abstract_name( - &decode.sun_path[1..len - offsetof_sun_path], - ) - .unwrap(), - ); + let bytes = &decode.sun_path[1..len - offsetof_sun_path]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()); + + return SocketAddrAny::Unix(SocketAddrUnix::new_abstract_name(bytes).unwrap()); } // Otherwise we expect a NUL-terminated filesystem path. assert_eq!(decode.sun_path[len - 1 - offsetof_sun_path], 0); - SocketAddrAny::Unix( - SocketAddrUnix::new(&decode.sun_path[..len - 1 - offsetof_sun_path]).unwrap(), - ) + + let bytes = &decode.sun_path[..len - 1 - offsetof_sun_path]; + + // SAFETY: Convert `&[c_char]` to `&[u8]`. + let bytes = slice::from_raw_parts(bytes.as_ptr().cast::(), bytes.len()); + + SocketAddrAny::Unix(SocketAddrUnix::new(bytes).unwrap()) } } + #[cfg(target_os = "linux")] + c::AF_XDP => { + assert!(len >= size_of::()); + let decode = &*storage.cast::(); + SocketAddrAny::Xdp(SocketAddrXdp::new( + SockaddrXdpFlags::from_bits_retain(decode.sxdp_flags), + u32::from_be(decode.sxdp_ifindex), + u32::from_be(decode.sxdp_queue_id), + u32::from_be(decode.sxdp_shared_umem_fd), + )) + } other => unimplemented!("{:?}", other), } } diff --git a/vendor/rustix/src/backend/linux_raw/net/sockopt.rs b/vendor/rustix/src/backend/linux_raw/net/sockopt.rs index 6a740bbf7..d8066032e 100644 --- a/vendor/rustix/src/backend/linux_raw/net/sockopt.rs +++ b/vendor/rustix/src/backend/linux_raw/net/sockopt.rs @@ -12,6 +12,8 @@ use crate::fd::BorrowedFd; use crate::ffi::CStr; use crate::io; use crate::net::sockopt::Timeout; +#[cfg(target_os = "linux")] +use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpRingOffset, XdpStatistics, XdpUmemReg}; use crate::net::{ AddressFamily, Ipv4Addr, Ipv6Addr, Protocol, RawProtocol, SocketAddrAny, SocketAddrStorage, SocketAddrV4, SocketAddrV6, SocketType, UCred, @@ -23,6 +25,8 @@ use alloc::string::String; use core::mem::MaybeUninit; use core::time::Duration; use linux_raw_sys::general::{__kernel_old_timeval, __kernel_sock_timeval}; +#[cfg(target_os = "linux")] +use linux_raw_sys::xdp::{xdp_mmap_offsets, xdp_statistics, xdp_statistics_v1}; #[cfg(target_arch = "x86")] use { crate::backend::conv::{slice_just_addr, x86_sys}, @@ -799,6 +803,170 @@ pub(crate) fn get_socket_peercred(fd: BorrowedFd<'_>) -> io::Result { getsockopt(fd, c::SOL_SOCKET, linux_raw_sys::net::SO_PEERCRED) } +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_reg(fd: BorrowedFd<'_>, value: XdpUmemReg) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_REG, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_fill_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_FILL_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_umem_completion_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_UMEM_COMPLETION_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_tx_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_TX_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn set_xdp_rx_ring_size(fd: BorrowedFd<'_>, value: u32) -> io::Result<()> { + setsockopt(fd, c::SOL_XDP, c::XDP_RX_RING, value) +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_mmap_offsets(fd: BorrowedFd<'_>) -> io::Result { + // The kernel will write `xdp_mmap_offsets` or `xdp_mmap_offsets_v1` to the supplied pointer, + // depending on the kernel version. Both structs only contain u64 values. + // By using the larger of both as the parameter, we can shuffle the values to the non-v1 version + // returned by `get_xdp_mmap_offsets` while keeping the return type unaffected by the kernel + // version. This works because C will layout all struct members one after the other. + + let mut optlen = core::mem::size_of::().try_into().unwrap(); + debug_assert!( + optlen as usize >= core::mem::size_of::(), + "Socket APIs don't ever use `bool` directly" + ); + let mut value = MaybeUninit::::zeroed(); + getsockopt_raw(fd, c::SOL_XDP, c::XDP_MMAP_OFFSETS, &mut value, &mut optlen)?; + + if optlen as usize == core::mem::size_of::() { + // Safety: All members of xdp_mmap_offsets are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xpd_mmap_offsets = unsafe { value.assume_init() }; + Ok(XdpMmapOffsets { + rx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.producer, + consumer: xpd_mmap_offsets.rx.consumer, + desc: xpd_mmap_offsets.rx.desc, + flags: None, + }, + tx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.flags, + consumer: xpd_mmap_offsets.tx.producer, + desc: xpd_mmap_offsets.tx.consumer, + flags: None, + }, + fr: XdpRingOffset { + producer: xpd_mmap_offsets.tx.desc, + consumer: xpd_mmap_offsets.tx.flags, + desc: xpd_mmap_offsets.fr.producer, + flags: None, + }, + cr: XdpRingOffset { + producer: xpd_mmap_offsets.fr.consumer, + consumer: xpd_mmap_offsets.fr.desc, + desc: xpd_mmap_offsets.fr.flags, + flags: None, + }, + }) + } else { + assert_eq!( + optlen as usize, + core::mem::size_of::(), + "unexpected getsockopt size" + ); + // Safety: All members of xdp_mmap_offsets are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xpd_mmap_offsets = unsafe { value.assume_init() }; + Ok(XdpMmapOffsets { + rx: XdpRingOffset { + producer: xpd_mmap_offsets.rx.producer, + consumer: xpd_mmap_offsets.rx.consumer, + desc: xpd_mmap_offsets.rx.desc, + flags: Some(xpd_mmap_offsets.rx.flags), + }, + tx: XdpRingOffset { + producer: xpd_mmap_offsets.tx.producer, + consumer: xpd_mmap_offsets.tx.consumer, + desc: xpd_mmap_offsets.tx.desc, + flags: Some(xpd_mmap_offsets.tx.flags), + }, + fr: XdpRingOffset { + producer: xpd_mmap_offsets.fr.producer, + consumer: xpd_mmap_offsets.fr.consumer, + desc: xpd_mmap_offsets.fr.desc, + flags: Some(xpd_mmap_offsets.fr.flags), + }, + cr: XdpRingOffset { + producer: xpd_mmap_offsets.cr.producer, + consumer: xpd_mmap_offsets.cr.consumer, + desc: xpd_mmap_offsets.cr.desc, + flags: Some(xpd_mmap_offsets.cr.flags), + }, + }) + } +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_statistics(fd: BorrowedFd<'_>) -> io::Result { + let mut optlen = core::mem::size_of::().try_into().unwrap(); + debug_assert!( + optlen as usize >= core::mem::size_of::(), + "Socket APIs don't ever use `bool` directly" + ); + let mut value = MaybeUninit::::zeroed(); + getsockopt_raw(fd, c::SOL_XDP, c::XDP_STATISTICS, &mut value, &mut optlen)?; + + if optlen as usize == core::mem::size_of::() { + // Safety: All members of xdp_statistics are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xdp_statistics = unsafe { value.assume_init() }; + Ok(XdpStatistics { + rx_dropped: xdp_statistics.rx_dropped, + rx_invalid_descs: xdp_statistics.rx_dropped, + tx_invalid_descs: xdp_statistics.rx_dropped, + rx_ring_full: None, + rx_fill_ring_empty_descs: None, + tx_ring_empty_descs: None, + }) + } else { + assert_eq!( + optlen as usize, + core::mem::size_of::(), + "unexpected getsockopt size" + ); + // Safety: All members of xdp_statistics are u64 and thus are correctly initialized + // by `MaybeUninit::::zeroed()` + let xdp_statistics = unsafe { value.assume_init() }; + Ok(XdpStatistics { + rx_dropped: xdp_statistics.rx_dropped, + rx_invalid_descs: xdp_statistics.rx_invalid_descs, + tx_invalid_descs: xdp_statistics.tx_invalid_descs, + rx_ring_full: Some(xdp_statistics.rx_ring_full), + rx_fill_ring_empty_descs: Some(xdp_statistics.rx_fill_ring_empty_descs), + tx_ring_empty_descs: Some(xdp_statistics.tx_ring_empty_descs), + }) + } +} + +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn get_xdp_options(fd: BorrowedFd<'_>) -> io::Result { + getsockopt(fd, c::SOL_XDP, c::XDP_OPTIONS) +} + #[inline] fn to_ip_mreq(multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> c::ip_mreq { c::ip_mreq { diff --git a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs index f513f1261..4d4427a40 100644 --- a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs @@ -5,19 +5,25 @@ //! See the `rustix::backend` module documentation for details. #![allow(unsafe_code, clippy::undocumented_unsafe_blocks)] +#[cfg(target_os = "linux")] +use super::msghdr::with_xdp_msghdr; use super::msghdr::{ with_noaddr_msghdr, with_recv_msghdr, with_unix_msghdr, with_v4_msghdr, with_v6_msghdr, }; use super::read_sockaddr::{initialize_family_to_unspec, maybe_read_sockaddr_os, read_sockaddr_os}; use super::send_recv::{RecvFlags, SendFlags}; +#[cfg(target_os = "linux")] +use super::write_sockaddr::encode_sockaddr_xdp; use super::write_sockaddr::{encode_sockaddr_v4, encode_sockaddr_v6}; use crate::backend::c; use crate::backend::conv::{ - by_mut, by_ref, c_int, c_uint, ret, ret_owned_fd, ret_usize, size_of, slice, slice_mut, + by_mut, by_ref, c_int, c_uint, pass_usize, ret, ret_owned_fd, ret_usize, size_of, slice, socklen_t, zero, }; use crate::fd::{BorrowedFd, OwnedFd}; use crate::io::{self, IoSlice, IoSliceMut}; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{ AddressFamily, Protocol, RecvAncillaryBuffer, RecvMsgReturn, SendAncillaryBuffer, Shutdown, SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6, SocketFlags, SocketType, @@ -402,6 +408,37 @@ pub(crate) fn sendmsg_unix( }) } +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn sendmsg_xdp( + sockfd: BorrowedFd<'_>, + addr: &SocketAddrXdp, + iov: &[IoSlice<'_>], + control: &mut SendAncillaryBuffer<'_, '_, '_>, + msg_flags: SendFlags, +) -> io::Result { + with_xdp_msghdr(addr, iov, control, |msghdr| { + #[cfg(not(target_arch = "x86"))] + let result = + unsafe { ret_usize(syscall!(__NR_sendmsg, sockfd, by_ref(&msghdr), msg_flags)) }; + + #[cfg(target_arch = "x86")] + let result = unsafe { + ret_usize(syscall!( + __NR_socketcall, + x86_sys(SYS_SENDMSG), + slice_just_addr::, _>(&[ + sockfd.into(), + by_ref(&msghdr), + msg_flags.into() + ]) + )) + }; + + result + }) +} + #[inline] pub(crate) fn shutdown(fd: BorrowedFd<'_>, how: Shutdown) -> io::Result<()> { #[cfg(not(target_arch = "x86"))] @@ -584,10 +621,52 @@ pub(crate) fn sendto_unix( } } +#[cfg(target_os = "linux")] #[inline] -pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::Result { - let (buf_addr_mut, buf_len) = slice_mut(buf); +pub(crate) fn sendto_xdp( + fd: BorrowedFd<'_>, + buf: &[u8], + flags: SendFlags, + addr: &SocketAddrXdp, +) -> io::Result { + let (buf_addr, buf_len) = slice(buf); + #[cfg(not(target_arch = "x86"))] + unsafe { + ret_usize(syscall_readonly!( + __NR_sendto, + fd, + buf_addr, + buf_len, + flags, + by_ref(&encode_sockaddr_xdp(addr)), + size_of::() + )) + } + #[cfg(target_arch = "x86")] + unsafe { + ret_usize(syscall_readonly!( + __NR_socketcall, + x86_sys(SYS_SENDTO), + slice_just_addr::, _>(&[ + fd.into(), + buf_addr, + buf_len, + flags.into(), + by_ref(&encode_sockaddr_xdp(addr)), + size_of::(), + ]) + )) + } +} + +#[inline] +pub(crate) unsafe fn recv( + fd: BorrowedFd<'_>, + buf: *mut u8, + len: usize, + flags: RecvFlags, +) -> io::Result { #[cfg(not(any( target_arch = "aarch64", target_arch = "mips64", @@ -596,8 +675,8 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io:: target_arch = "x86", target_arch = "x86_64", )))] - unsafe { - ret_usize(syscall!(__NR_recv, fd, buf_addr_mut, buf_len, flags)) + { + ret_usize(syscall!(__NR_recv, fd, buf, pass_usize(len), flags)) } #[cfg(any( target_arch = "aarch64", @@ -606,26 +685,26 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io:: target_arch = "riscv64", target_arch = "x86_64", ))] - unsafe { + { ret_usize(syscall!( __NR_recvfrom, fd, - buf_addr_mut, - buf_len, + buf, + pass_usize(len), flags, zero(), zero() )) } #[cfg(target_arch = "x86")] - unsafe { + { ret_usize(syscall!( __NR_socketcall, x86_sys(SYS_RECV), slice_just_addr::, _>(&[ fd.into(), - buf_addr_mut, - buf_len, + buf.into(), + pass_usize(len), flags.into(), ]) )) @@ -633,51 +712,48 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io:: } #[inline] -pub(crate) fn recvfrom( +pub(crate) unsafe fn recvfrom( fd: BorrowedFd<'_>, - buf: &mut [u8], + buf: *mut u8, + len: usize, flags: RecvFlags, ) -> io::Result<(usize, Option)> { - let (buf_addr_mut, buf_len) = slice_mut(buf); - let mut addrlen = core::mem::size_of::() as socklen_t; let mut storage = MaybeUninit::::uninit(); - unsafe { - // `recvfrom` does not write to the storage if the socket is - // connection-oriented sockets, so we initialize the family field to - // `AF_UNSPEC` so that we can detect this case. - initialize_family_to_unspec(storage.as_mut_ptr()); + // `recvfrom` does not write to the storage if the socket is + // connection-oriented sockets, so we initialize the family field to + // `AF_UNSPEC` so that we can detect this case. + initialize_family_to_unspec(storage.as_mut_ptr()); - #[cfg(not(target_arch = "x86"))] - let nread = ret_usize(syscall!( - __NR_recvfrom, - fd, - buf_addr_mut, - buf_len, - flags, - &mut storage, - by_mut(&mut addrlen) - ))?; - #[cfg(target_arch = "x86")] - let nread = ret_usize(syscall!( - __NR_socketcall, - x86_sys(SYS_RECVFROM), - slice_just_addr::, _>(&[ - fd.into(), - buf_addr_mut, - buf_len, - flags.into(), - (&mut storage).into(), - by_mut(&mut addrlen), - ]) - ))?; + #[cfg(not(target_arch = "x86"))] + let nread = ret_usize(syscall!( + __NR_recvfrom, + fd, + buf, + pass_usize(len), + flags, + &mut storage, + by_mut(&mut addrlen) + ))?; + #[cfg(target_arch = "x86")] + let nread = ret_usize(syscall!( + __NR_socketcall, + x86_sys(SYS_RECVFROM), + slice_just_addr::, _>(&[ + fd.into(), + buf.into(), + pass_usize(len), + flags.into(), + (&mut storage).into(), + by_mut(&mut addrlen), + ]) + ))?; - Ok(( - nread, - maybe_read_sockaddr_os(&storage.assume_init(), addrlen.try_into().unwrap()), - )) - } + Ok(( + nread, + maybe_read_sockaddr_os(&storage.assume_init(), addrlen.try_into().unwrap()), + )) } #[inline] @@ -829,6 +905,32 @@ pub(crate) fn bind_unix(fd: BorrowedFd<'_>, addr: &SocketAddrUnix) -> io::Result } } +#[cfg(target_os = "linux")] +#[inline] +pub(crate) fn bind_xdp(fd: BorrowedFd<'_>, addr: &SocketAddrXdp) -> io::Result<()> { + #[cfg(not(target_arch = "x86"))] + unsafe { + ret(syscall_readonly!( + __NR_bind, + fd, + by_ref(&encode_sockaddr_xdp(addr)), + size_of::() + )) + } + #[cfg(target_arch = "x86")] + unsafe { + ret(syscall_readonly!( + __NR_socketcall, + x86_sys(SYS_BIND), + slice_just_addr::, _>(&[ + fd.into(), + by_ref(&encode_sockaddr_xdp(addr)), + size_of::(), + ]) + )) + } +} + #[inline] pub(crate) fn connect_v4(fd: BorrowedFd<'_>, addr: &SocketAddrV4) -> io::Result<()> { #[cfg(not(target_arch = "x86"))] diff --git a/vendor/rustix/src/backend/linux_raw/net/write_sockaddr.rs b/vendor/rustix/src/backend/linux_raw/net/write_sockaddr.rs index 24edd4948..fb6e51edb 100644 --- a/vendor/rustix/src/backend/linux_raw/net/write_sockaddr.rs +++ b/vendor/rustix/src/backend/linux_raw/net/write_sockaddr.rs @@ -3,6 +3,8 @@ #![allow(unsafe_code)] use crate::backend::c; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; use crate::net::{SocketAddrAny, SocketAddrStorage, SocketAddrUnix, SocketAddrV4, SocketAddrV6}; use core::mem::size_of; @@ -14,6 +16,8 @@ pub(crate) unsafe fn write_sockaddr( SocketAddrAny::V4(v4) => write_sockaddr_v4(v4, storage), SocketAddrAny::V6(v6) => write_sockaddr_v6(v6, storage), SocketAddrAny::Unix(unix) => write_sockaddr_unix(unix, storage), + #[cfg(target_os = "linux")] + SocketAddrAny::Xdp(xdp) => write_sockaddr_xdp(xdp, storage), } } @@ -58,3 +62,21 @@ unsafe fn write_sockaddr_unix(unix: &SocketAddrUnix, storage: *mut SocketAddrSto core::ptr::write(storage.cast(), unix.unix); unix.len() } + +#[cfg(target_os = "linux")] +pub(crate) fn encode_sockaddr_xdp(xdp: &SocketAddrXdp) -> c::sockaddr_xdp { + c::sockaddr_xdp { + sxdp_family: c::AF_XDP as _, + sxdp_flags: xdp.flags().bits(), + sxdp_ifindex: xdp.interface_index(), + sxdp_queue_id: xdp.queue_id(), + sxdp_shared_umem_fd: xdp.shared_umem_fd(), + } +} + +#[cfg(target_os = "linux")] +unsafe fn write_sockaddr_xdp(xdp: &SocketAddrXdp, storage: *mut SocketAddrStorage) -> usize { + let encoded = encode_sockaddr_xdp(xdp); + core::ptr::write(storage.cast(), encoded); + size_of::() +} diff --git a/vendor/rustix/src/backend/linux_raw/param/auxv.rs b/vendor/rustix/src/backend/linux_raw/param/auxv.rs index b9ac27eec..796062ae6 100644 --- a/vendor/rustix/src/backend/linux_raw/param/auxv.rs +++ b/vendor/rustix/src/backend/linux_raw/param/auxv.rs @@ -5,6 +5,7 @@ //! This uses raw pointers to locate and read the kernel-provided auxv array. #![allow(unsafe_code)] +use super::super::conv::{c_int, pass_usize, ret_usize}; use crate::backend::c; use crate::fd::OwnedFd; #[cfg(feature = "param")] @@ -27,6 +28,8 @@ use linux_raw_sys::general::{ use linux_raw_sys::general::{ AT_EGID, AT_ENTRY, AT_EUID, AT_GID, AT_PHDR, AT_PHENT, AT_PHNUM, AT_RANDOM, AT_SECURE, AT_UID, }; +#[cfg(feature = "alloc")] +use {alloc::borrow::Cow, alloc::vec}; #[cfg(feature = "param")] #[inline] @@ -120,12 +123,19 @@ pub(crate) fn exe_phdrs() -> (*const c::c_void, usize, usize) { /// `AT_SYSINFO_EHDR` isn't present on all platforms in all configurations, so /// if we don't see it, this function returns a null pointer. +/// +/// And, this function returns a null pointer, rather than panicking, if the +/// auxv records can't be read. #[inline] pub(in super::super) fn sysinfo_ehdr() -> *const Elf_Ehdr { let mut ehdr = SYSINFO_EHDR.load(Relaxed); if ehdr.is_null() { - init_auxv(); + // Use `maybe_init_auxv` to to read the aux vectors if it can, but do + // nothing if it can't. If it can't, then we'll get a null pointer + // here, which our callers are prepared to deal with. + maybe_init_auxv(); + ehdr = SYSINFO_EHDR.load(Relaxed); } @@ -177,74 +187,122 @@ static ENTRY: AtomicUsize = AtomicUsize::new(0); #[cfg(feature = "runtime")] static RANDOM: AtomicPtr<[u8; 16]> = AtomicPtr::new(null_mut()); -#[cfg(feature = "alloc")] -fn pr_get_auxv() -> crate::io::Result> { - use super::super::conv::{c_int, pass_usize, ret_usize}; - const PR_GET_AUXV: c::c_int = 0x4155_5856; - let mut buffer = alloc::vec![0u8; 512]; +const PR_GET_AUXV: c::c_int = 0x4155_5856; + +/// Use Linux >= 6.4's `PR_GET_AUXV` to read the aux records, into a provided +/// statically-sized buffer. Return: +/// - `Ok(...)` if the buffer is big enough. +/// - `Err(Ok(len))` if we need a buffer of length `len`. +/// - `Err(Err(err))` if we failed with `err`. +#[cold] +fn pr_get_auxv_static(buffer: &mut [u8; 512]) -> Result<&mut [u8], crate::io::Result> { let len = unsafe { ret_usize(syscall_always_asm!( __NR_prctl, c_int(PR_GET_AUXV), - buffer.as_ptr(), + buffer.as_mut_ptr(), pass_usize(buffer.len()), pass_usize(0), pass_usize(0) - ))? + )) + .map_err(Err)? }; if len <= buffer.len() { - buffer.truncate(len); - return Ok(buffer); + return Ok(&mut buffer[..len]); } - buffer.resize(len, 0); + Err(Ok(len)) +} + +/// Use Linux >= 6.4's `PR_GET_AUXV` to read the aux records, using a provided +/// statically-sized buffer if possible, or a dynamically allocated buffer +/// otherwise. Return: +/// - Ok(...) on success. +/// - Err(err) on failure. +#[cfg(feature = "alloc")] +#[cold] +fn pr_get_auxv_dynamic(buffer: &mut [u8; 512]) -> crate::io::Result> { + // First try use the static buffer. + let len = match pr_get_auxv_static(buffer) { + Ok(buffer) => return Ok(Cow::Borrowed(buffer)), + Err(Ok(len)) => len, + Err(Err(err)) => return Err(err), + }; + + // If that indicates it needs a bigger buffer, allocate one. + let mut buffer = vec![0u8; len]; let len = unsafe { ret_usize(syscall_always_asm!( __NR_prctl, c_int(PR_GET_AUXV), - buffer.as_ptr(), + buffer.as_mut_ptr(), pass_usize(buffer.len()), pass_usize(0), pass_usize(0) ))? }; assert_eq!(len, buffer.len()); - return Ok(buffer); + Ok(Cow::Owned(buffer)) +} + +/// Read the auxv records and initialize the various static variables. Panic +/// if an error is encountered. +#[cold] +fn init_auxv() { + init_auxv_impl().unwrap(); +} + +/// Like `init_auxv`, but don't panic if an error is encountered. The caller +/// must be prepared for initialization to be skipped. +#[cold] +fn maybe_init_auxv() { + if let Ok(()) = init_auxv_impl() { + return; + } } /// If we don't have "use-explicitly-provided-auxv" or "use-libc-auxv", we /// read the aux vector via the `prctl` `PR_GET_AUXV`, with a fallback to /// /proc/self/auxv for kernels that don't support `PR_GET_AUXV`. #[cold] -fn init_auxv() { - #[cfg(feature = "alloc")] - { - match pr_get_auxv() { - Ok(buffer) => { - // SAFETY: We assume the kernel returns a valid auxv. - unsafe { - init_from_aux_iter(AuxPointer(buffer.as_ptr().cast())).unwrap(); - } - return; - } - Err(_) => { - // Fall back to /proc/self/auxv on error. - } - } - } - - // Open "/proc/self/auxv", either because we trust "/proc", or because - // we're running inside QEMU and `proc_self_auxv`'s extra checking foils - // QEMU's emulation so we need to do a plain open to get the right - // auxv records. - let file = crate::fs::open("/proc/self/auxv", OFlags::RDONLY, Mode::empty()).unwrap(); - - #[cfg(feature = "alloc")] - init_from_auxv_file(file).unwrap(); +fn init_auxv_impl() -> Result<(), ()> { + let mut buffer = [0u8; 512]; + // If we don't have "alloc", just try to read into our statically-sized + // buffer. This might fail due to the buffer being insufficient; we're + // prepared to cope, though we may do suboptimal things. #[cfg(not(feature = "alloc"))] - unsafe { - init_from_aux_iter(AuxFile(file)).unwrap(); + let result = pr_get_auxv_static(&mut buffer); + + // If we do have "alloc" then read into our statically-sized buffer if + // it fits, or fall back to a dynamically-allocated buffer. + #[cfg(feature = "alloc")] + let result = pr_get_auxv_dynamic(&mut buffer); + + if let Ok(buffer) = result { + // SAFETY: We assume the kernel returns a valid auxv. + unsafe { + init_from_aux_iter(AuxPointer(buffer.as_ptr().cast())).unwrap(); + } + return Ok(()); } + + // If `PR_GET_AUXV` is unavailable, or if we don't have "alloc" and + // the aux records don't fit in our static buffer, then fall back to trying + // to open "/proc/self/auxv". We don't use `proc_self_fd` because its extra + // checking breaks on QEMU. + if let Ok(file) = crate::fs::open("/proc/self/auxv", OFlags::RDONLY, Mode::empty()) { + #[cfg(feature = "alloc")] + init_from_auxv_file(file).unwrap(); + + #[cfg(not(feature = "alloc"))] + unsafe { + init_from_aux_iter(AuxFile(file)).unwrap(); + } + + return Ok(()); + } + + Err(()) } /// Process auxv entries from the open file `auxv`. diff --git a/vendor/rustix/src/backend/linux_raw/pipe/types.rs b/vendor/rustix/src/backend/linux_raw/pipe/types.rs index cfcb75477..2d1ed9ab9 100644 --- a/vendor/rustix/src/backend/linux_raw/pipe/types.rs +++ b/vendor/rustix/src/backend/linux_raw/pipe/types.rs @@ -22,7 +22,7 @@ bitflags! { } bitflags! { - /// `SPLICE_F_*` constants for use with [`splice`] [`vmsplice`], and + /// `SPLICE_F_*` constants for use with [`splice`], [`vmsplice`], and /// [`tee`]. #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] @@ -41,12 +41,14 @@ bitflags! { } } -/// A buffer type used with `vmsplice`. +/// A buffer type for use with [`vmsplice`]. /// /// It is guaranteed to be ABI compatible with the iovec type on Unix platforms /// and `WSABUF` on Windows. Unlike `IoSlice` and `IoSliceMut` it is /// semantically like a raw pointer, and therefore can be shared or mutated as /// needed. +/// +/// [`vmsplice`]: crate::pipe::vmsplice #[repr(transparent)] pub struct IoSliceRaw<'a> { _buf: c::iovec, diff --git a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs index 130ee4c93..bc00af9b1 100644 --- a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs @@ -28,8 +28,8 @@ use crate::utils::as_mut_ptr; use core::mem::MaybeUninit; use core::ptr::{null, null_mut}; use linux_raw_sys::general::{ - membarrier_cmd, membarrier_cmd_flag, rlimit, rlimit64, PRIO_PGRP, PRIO_PROCESS, PRIO_USER, - RLIM64_INFINITY, RLIM_INFINITY, + membarrier_cmd, membarrier_cmd_flag, rlimit64, PRIO_PGRP, PRIO_PROCESS, PRIO_USER, + RLIM64_INFINITY, }; #[cfg(feature = "fs")] use {crate::backend::conv::ret_c_uint_infallible, crate::fs::Mode}; @@ -299,52 +299,17 @@ pub(crate) fn setpriority_process(pid: Option, priority: i32) -> io::Result pub(crate) fn getrlimit(limit: Resource) -> Rlimit { let mut result = MaybeUninit::::uninit(); unsafe { - match ret(syscall!( + ret_infallible(syscall!( __NR_prlimit64, c_uint(0), limit, null::(), &mut result - )) { - Ok(()) => rlimit_from_linux(result.assume_init()), - Err(err) => { - debug_assert_eq!(err, io::Errno::NOSYS); - getrlimit_old(limit) - } - } + )); + rlimit_from_linux(result.assume_init()) } } -/// The old 32-bit-only `getrlimit` syscall, for when we lack the new -/// `prlimit64`. -unsafe fn getrlimit_old(limit: Resource) -> Rlimit { - let mut result = MaybeUninit::::uninit(); - - // On these platforms, `__NR_getrlimit` is called `__NR_ugetrlimit`. - #[cfg(any( - target_arch = "arm", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "x86", - ))] - { - ret_infallible(syscall!(__NR_ugetrlimit, limit, &mut result)); - } - - // On these platforms, it's just `__NR_getrlimit`. - #[cfg(not(any( - target_arch = "arm", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "x86", - )))] - { - ret_infallible(syscall!(__NR_getrlimit, limit, &mut result)); - } - - rlimit_from_linux_old(result.assume_init()) -} - #[inline] pub(crate) fn setrlimit(limit: Resource, new: Rlimit) -> io::Result<()> { unsafe { @@ -357,19 +322,11 @@ pub(crate) fn setrlimit(limit: Resource, new: Rlimit) -> io::Result<()> { null_mut::() )) { Ok(()) => Ok(()), - Err(io::Errno::NOSYS) => setrlimit_old(limit, new), Err(err) => Err(err), } } } -/// The old 32-bit-only `setrlimit` syscall, for when we lack the new -/// `prlimit64`. -unsafe fn setrlimit_old(limit: Resource, new: Rlimit) -> io::Result<()> { - let lim = rlimit_to_linux_old(new)?; - ret(syscall_readonly!(__NR_setrlimit, limit, by_ref(&lim))) -} - #[inline] pub(crate) fn prlimit(pid: Option, limit: Resource, new: Rlimit) -> io::Result { let lim = rlimit_to_linux(new); @@ -391,12 +348,12 @@ pub(crate) fn prlimit(pid: Option, limit: Resource, new: Rlimit) -> io::Res /// Convert a Rust [`Rlimit`] to a C `rlimit64`. #[inline] fn rlimit_from_linux(lim: rlimit64) -> Rlimit { - let current = if lim.rlim_cur as u64 == RLIM64_INFINITY as u64 { + let current = if lim.rlim_cur == RLIM64_INFINITY as _ { None } else { Some(lim.rlim_cur) }; - let maximum = if lim.rlim_max as u64 == RLIM64_INFINITY as u64 { + let maximum = if lim.rlim_max == RLIM64_INFINITY as _ { None } else { Some(lim.rlim_max) @@ -418,36 +375,6 @@ fn rlimit_to_linux(lim: Rlimit) -> rlimit64 { rlimit64 { rlim_cur, rlim_max } } -/// Like `rlimit_from_linux` but uses Linux's old 32-bit `rlimit`. -#[allow(clippy::useless_conversion)] -fn rlimit_from_linux_old(lim: rlimit) -> Rlimit { - let current = if lim.rlim_cur as u32 == RLIM_INFINITY as u32 { - None - } else { - Some(lim.rlim_cur.into()) - }; - let maximum = if lim.rlim_max as u32 == RLIM_INFINITY as u32 { - None - } else { - Some(lim.rlim_max.into()) - }; - Rlimit { current, maximum } -} - -/// Like `rlimit_to_linux` but uses Linux's old 32-bit `rlimit`. -#[allow(clippy::useless_conversion)] -fn rlimit_to_linux_old(lim: Rlimit) -> io::Result { - let rlim_cur = match lim.current { - Some(r) => r.try_into().map_err(|_e| io::Errno::INVAL)?, - None => RLIM_INFINITY as _, - }; - let rlim_max = match lim.maximum { - Some(r) => r.try_into().map_err(|_e| io::Errno::INVAL)?, - None => RLIM_INFINITY as _, - }; - Ok(rlimit { rlim_cur, rlim_max }) -} - #[inline] pub(crate) fn wait(waitopts: WaitOptions) -> io::Result> { _waitpid(!0, waitopts) diff --git a/vendor/rustix/src/backend/linux_raw/rand/syscalls.rs b/vendor/rustix/src/backend/linux_raw/rand/syscalls.rs index e744f3193..c0f497b98 100644 --- a/vendor/rustix/src/backend/linux_raw/rand/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/rand/syscalls.rs @@ -5,12 +5,15 @@ //! See the `rustix::backend` module documentation for details. #![allow(unsafe_code, clippy::undocumented_unsafe_blocks)] -use crate::backend::conv::{ret_usize, slice_mut}; +use crate::backend::conv::{pass_usize, ret_usize}; use crate::io; use crate::rand::GetRandomFlags; #[inline] -pub(crate) fn getrandom(buf: &mut [u8], flags: GetRandomFlags) -> io::Result { - let (buf_addr_mut, buf_len) = slice_mut(buf); - unsafe { ret_usize(syscall!(__NR_getrandom, buf_addr_mut, buf_len, flags)) } +pub(crate) unsafe fn getrandom( + buf: *mut u8, + cap: usize, + flags: GetRandomFlags, +) -> io::Result { + ret_usize(syscall!(__NR_getrandom, buf, pass_usize(cap), flags)) } diff --git a/vendor/rustix/src/backend/linux_raw/reg.rs b/vendor/rustix/src/backend/linux_raw/reg.rs index 10f95a5f9..f05ac5f3c 100644 --- a/vendor/rustix/src/backend/linux_raw/reg.rs +++ b/vendor/rustix/src/backend/linux_raw/reg.rs @@ -45,6 +45,7 @@ pub(super) trait FromAsm: private::Sealed { /// pointer types. They need a type to point to, so we define a custom private /// type, to prevent it from being used for anything else. #[repr(transparent)] +#[allow(dead_code)] pub(super) struct Opaque(c::c_void); // Argument numbers. diff --git a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs index 12162fd32..e00acc6fc 100644 --- a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs +++ b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs @@ -8,9 +8,11 @@ use crate::backend::c; #[cfg(target_arch = "x86")] use crate::backend::conv::by_mut; +#[cfg(target_arch = "x86_64")] +use crate::backend::conv::c_uint; use crate::backend::conv::{ - by_ref, c_int, c_uint, ret, ret_c_int, ret_c_int_infallible, ret_error, ret_infallible, - ret_void_star, size_of, zero, + by_ref, c_int, ret, ret_c_int, ret_c_int_infallible, ret_error, ret_infallible, ret_void_star, + size_of, zero, }; #[cfg(feature = "fs")] use crate::fd::BorrowedFd; @@ -30,7 +32,6 @@ use linux_raw_sys::general::__kernel_old_timespec; use linux_raw_sys::general::kernel_sigset_t; #[cfg(target_arch = "x86_64")] use linux_raw_sys::general::ARCH_SET_FS; -use linux_raw_sys::prctl::PR_SET_NAME; #[inline] pub(crate) unsafe fn fork() -> io::Result { @@ -139,18 +140,6 @@ pub(crate) mod tls { Pid::from_raw_unchecked(tid) } - #[inline] - pub(crate) unsafe fn set_thread_name(name: &CStr) -> io::Result<()> { - ret(syscall_readonly!( - __NR_prctl, - c_uint(PR_SET_NAME), - name, - zero(), - zero(), - zero() - )) - } - #[inline] pub(crate) fn exit_thread(code: c::c_int) -> ! { unsafe { syscall_noreturn!(__NR_exit, c_int(code)) } diff --git a/vendor/rustix/src/buffer.rs b/vendor/rustix/src/buffer.rs new file mode 100644 index 000000000..e4b40c739 --- /dev/null +++ b/vendor/rustix/src/buffer.rs @@ -0,0 +1,21 @@ +//! Utilities to help with buffering. + +#![allow(unsafe_code)] + +use core::mem::MaybeUninit; +use core::slice; + +/// Split an uninitialized byte slice into initialized and uninitialized parts. +/// +/// # Safety +/// +/// At least `init` bytes must be initialized. +#[inline] +pub(super) unsafe fn split_init( + buf: &mut [MaybeUninit], + init: usize, +) -> (&mut [u8], &mut [MaybeUninit]) { + let (init, uninit) = buf.split_at_mut(init); + let init = slice::from_raw_parts_mut(init.as_mut_ptr() as *mut u8, init.len()); + (init, uninit) +} diff --git a/vendor/rustix/src/clockid.rs b/vendor/rustix/src/clockid.rs index b392d6a14..1c7deeb9e 100644 --- a/vendor/rustix/src/clockid.rs +++ b/vendor/rustix/src/clockid.rs @@ -149,8 +149,8 @@ pub enum DynamicClockId<'a> { /// `CLOCK_BOOTTIME` #[cfg(any( - freebsdlike, linux_kernel, + target_os = "freebsd", target_os = "fuchsia", target_os = "openbsd" ))] diff --git a/vendor/rustix/src/event/kqueue.rs b/vendor/rustix/src/event/kqueue.rs index cd996aaea..d6b7cdecf 100644 --- a/vendor/rustix/src/event/kqueue.rs +++ b/vendor/rustix/src/event/kqueue.rs @@ -13,7 +13,7 @@ use core::mem::zeroed; use core::ptr::slice_from_raw_parts_mut; use core::time::Duration; -/// A `kqueue` event. +/// A `kqueue` event for use with [`kevent`]. #[repr(transparent)] #[derive(Copy, Clone)] pub struct Event { diff --git a/vendor/rustix/src/event/mod.rs b/vendor/rustix/src/event/mod.rs index b6b7f9971..c497febe0 100644 --- a/vendor/rustix/src/event/mod.rs +++ b/vendor/rustix/src/event/mod.rs @@ -15,7 +15,7 @@ mod poll; #[cfg(solarish)] pub mod port; -#[cfg(linux_kernel)] +#[cfg(any(linux_kernel, target_os = "redox"))] pub use crate::backend::event::epoll; #[cfg(any( linux_kernel, diff --git a/vendor/rustix/src/event/poll.rs b/vendor/rustix/src/event/poll.rs index 2ee40521f..30e6a4b10 100644 --- a/vendor/rustix/src/event/poll.rs +++ b/vendor/rustix/src/event/poll.rs @@ -9,7 +9,7 @@ pub use backend::event::poll_fd::{PollFd, PollFlags}; /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -20,7 +20,7 @@ pub use backend::event::poll_fd::{PollFd, PollFlags}; /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html /// [Linux]: https://man7.org/linux/man-pages/man2/poll.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/poll.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=poll&sektion=2 /// [NetBSD]: https://man.netbsd.org/poll.2 /// [OpenBSD]: https://man.openbsd.org/poll.2 diff --git a/vendor/rustix/src/fs/abs.rs b/vendor/rustix/src/fs/abs.rs index fb6c8c338..6e7fdf799 100644 --- a/vendor/rustix/src/fs/abs.rs +++ b/vendor/rustix/src/fs/abs.rs @@ -182,7 +182,7 @@ pub fn rmdir(path: P) -> io::Result<()> { /// POSIX leaves it implementation-defined whether `link` follows a symlink in /// `old_path`, or creates a new link to the symbolic link itself. On platforms /// which have it, [`linkat`] avoids this problem since it has an [`AtFlags`] -/// paramter and the [`AtFlags::SYMLINK_FOLLOW`] flag determines whether +/// parameter and the [`AtFlags::SYMLINK_FOLLOW`] flag determines whether /// symlinks should be followed. /// /// # References diff --git a/vendor/rustix/src/fs/at.rs b/vendor/rustix/src/fs/at.rs index 4163692d1..f1c49a93b 100644 --- a/vendor/rustix/src/fs/at.rs +++ b/vendor/rustix/src/fs/at.rs @@ -139,7 +139,7 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec) -> io::R /// significantly trickier to use; most users should use plain [`readlinkat`]. /// /// This version writes bytes into the buffer and returns two slices, one -/// containing the written bytes, and one containint the remaining +/// containing the written bytes, and one containing the remaining /// uninitialized space. If the number of written bytes is equal to the length /// of the buffer, it means the buffer wasn't big enough to hold the full /// string, and callers should try again with a bigger buffer. diff --git a/vendor/rustix/src/fs/ioctl.rs b/vendor/rustix/src/fs/ioctl.rs index 75222752f..490f183ff 100644 --- a/vendor/rustix/src/fs/ioctl.rs +++ b/vendor/rustix/src/fs/ioctl.rs @@ -9,6 +9,8 @@ use { backend::c, }; +use bitflags::bitflags; + #[cfg(all(linux_kernel, not(any(target_arch = "sparc", target_arch = "sparc64"))))] use crate::fd::{AsRawFd, BorrowedFd}; @@ -90,3 +92,74 @@ unsafe impl ioctl::Ioctl for Ficlone<'_> { Ok(()) } } + +#[cfg(linux_kernel)] +bitflags! { + /// `FS_*` constants for use with [`ioctl_getflags`][crate::io::ioctl::ioctl_getflags]. + pub struct IFlags: c::c_uint { + /// `FS_APPEND_FL` + const APPEND = linux_raw_sys::general::FS_APPEND_FL; + /// `FS_COMPR_FL` + const COMPRESSED = linux_raw_sys::general::FS_COMPR_FL; + /// `FS_DIRSYNC_FL` + const DIRSYNC = linux_raw_sys::general::FS_DIRSYNC_FL; + /// `FS_IMMUTABLE_FL` + const IMMUTABLE = linux_raw_sys::general::FS_IMMUTABLE_FL; + /// `FS_JOURNAL_DATA_FL` + const JOURNALING = linux_raw_sys::general::FS_JOURNAL_DATA_FL; + /// `FS_NOATIME_FL` + const NOATIME = linux_raw_sys::general::FS_NOATIME_FL; + /// `FS_NOCOW_FL` + const NOCOW = linux_raw_sys::general::FS_NOCOW_FL; + /// `FS_NODUMP_FL` + const NODUMP = linux_raw_sys::general::FS_NODUMP_FL; + /// `FS_NOTAIL_FL` + const NOTAIL = linux_raw_sys::general::FS_NOTAIL_FL; + /// `FS_PROJINHERIT_FL` + const PROJECT_INHERIT = linux_raw_sys::general::FS_PROJINHERIT_FL; + /// `FS_SECRM_FL` + const SECURE_REMOVAL = linux_raw_sys::general::FS_SECRM_FL; + /// `FS_SYNC_FL` + const SYNC = linux_raw_sys::general::FS_SYNC_FL; + /// `FS_TOPDIR_FL` + const TOPDIR = linux_raw_sys::general::FS_TOPDIR_FL; + /// `FS_UNRM_FL` + const UNRM = linux_raw_sys::general::FS_UNRM_FL; + } +} + +/// `ioctl(fd, FS_IOC_GETFLAGS)`—Returns the [inode flags] attributes +/// +/// [inode flags]: https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html +#[cfg(linux_kernel)] +#[inline] +#[doc(alias = "FS_IOC_GETFLAGS")] +pub fn ioctl_getflags(fd: Fd) -> io::Result { + unsafe { + #[cfg(target_pointer_width = "32")] + let ctl = ioctl::Getter::, u32>::new(); + #[cfg(target_pointer_width = "64")] + let ctl = ioctl::Getter::, u32>::new(); + + ioctl::ioctl(fd, ctl).map(IFlags::from_bits_retain) + } +} + +/// `ioctl(fd, FS_IOC_SETFLAGS)`—Modify the [inode flags] attributes +/// +/// [inode flags]: https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html +#[cfg(linux_kernel)] +#[inline] +#[doc(alias = "FS_IOC_SETFLAGS")] +pub fn ioctl_setflags(fd: Fd, flags: IFlags) -> io::Result<()> { + unsafe { + #[cfg(target_pointer_width = "32")] + let ctl = + ioctl::Setter::, u32>::new(flags.bits()); + + #[cfg(target_pointer_width = "64")] + let ctl = ioctl::Setter::, u32>::new(flags.bits()); + + ioctl::ioctl(fd, ctl) + } +} diff --git a/vendor/rustix/src/fs/mod.rs b/vendor/rustix/src/fs/mod.rs index f6d543a98..27d357012 100644 --- a/vendor/rustix/src/fs/mod.rs +++ b/vendor/rustix/src/fs/mod.rs @@ -28,7 +28,7 @@ mod fcntl_apple; #[cfg(apple)] mod fcopyfile; pub(crate) mod fd; -#[cfg(apple)] +#[cfg(all(apple, feature = "alloc"))] mod getpath; #[cfg(not(target_os = "wasi"))] // WASI doesn't have get[gpu]id. mod id; @@ -96,7 +96,7 @@ pub use fcntl_apple::*; #[cfg(apple)] pub use fcopyfile::*; pub use fd::*; -#[cfg(apple)] +#[cfg(all(apple, feature = "alloc"))] pub use getpath::getpath; #[cfg(not(target_os = "wasi"))] pub use id::*; @@ -141,3 +141,38 @@ pub use std::os::unix::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, Open #[cfg(feature = "std")] #[cfg(all(wasi_ext, target_os = "wasi"))] pub use std::os::wasi::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt}; + +/// Extension trait for accessing timestamp fields of `Stat`. +/// +/// Rustix's `Stat` type on some platforms has unsigned `st_mtime`, +/// `st_atime`, and `st_ctime` fields. This is incorrect, as Unix defines +/// these fields to be signed, with negative values representing dates before +/// the Unix epoch. Until the next semver bump, these unsigned fields are +/// deprecated, and this trait provides accessors which return their values +/// as signed integers. +#[cfg(all(unix, not(any(target_os = "aix", target_os = "nto"))))] +pub trait StatExt { + /// Return the value of the `st_atime` field, casted to the correct type. + fn atime(&self) -> i64; + /// Return the value of the `st_mtime` field, casted to the correct type. + fn mtime(&self) -> i64; + /// Return the value of the `st_ctime` field, casted to the correct type. + fn ctime(&self) -> i64; +} + +#[cfg(all(unix, not(any(target_os = "aix", target_os = "nto"))))] +#[allow(deprecated)] +impl StatExt for Stat { + #[inline] + fn atime(&self) -> i64 { + self.st_atime as i64 + } + #[inline] + fn mtime(&self) -> i64 { + self.st_mtime as i64 + } + #[inline] + fn ctime(&self) -> i64 { + self.st_ctime as i64 + } +} diff --git a/vendor/rustix/src/io/close.rs b/vendor/rustix/src/io/close.rs index aad2c20a3..474d252f4 100644 --- a/vendor/rustix/src/io/close.rs +++ b/vendor/rustix/src/io/close.rs @@ -25,7 +25,7 @@ use backend::fd::RawFd; /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -37,7 +37,7 @@ use backend::fd::RawFd; /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html /// [Linux]: https://man7.org/linux/man-pages/man2/close.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/close.2.html#//apple_ref/doc/man/2/close -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-closesocket +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-closesocket /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=close&sektion=2 /// [NetBSD]: https://man.netbsd.org/close.2 /// [OpenBSD]: https://man.openbsd.org/close.2 diff --git a/vendor/rustix/src/io/ioctl.rs b/vendor/rustix/src/io/ioctl.rs index f89160bf3..99dec067d 100644 --- a/vendor/rustix/src/io/ioctl.rs +++ b/vendor/rustix/src/io/ioctl.rs @@ -31,11 +31,11 @@ pub fn ioctl_fioclex(fd: Fd) -> io::Result<()> { /// `ioctl(fd, FIONBIO, &value)`—Enables or disables non-blocking mode. /// /// # References -/// - [Winsock2] +/// - [Winsock] /// - [NetBSD] /// - [OpenBSD] /// -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/winsock/winsock-ioctls#unix-ioctl-codes +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/winsock/winsock-ioctls#unix-ioctl-codes /// [NetBSD]: https://man.netbsd.org/ioctl.2#GENERIC%20IOCTLS /// [OpenBSD]: https://man.openbsd.org/ioctl.2#GENERIC_IOCTLS #[inline] @@ -55,13 +55,13 @@ pub fn ioctl_fionbio(fd: Fd, value: bool) -> io::Result<()> { /// /// # References /// - [Linux] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] /// /// [Linux]: https://man7.org/linux/man-pages/man2/ioctl_tty.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/winsock/winsock-ioctls#unix-ioctl-codes +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/winsock/winsock-ioctls#unix-ioctl-codes /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=ioctl&sektion=2#GENERIC%09IOCTLS /// [NetBSD]: https://man.netbsd.org/ioctl.2#GENERIC%20IOCTLS /// [OpenBSD]: https://man.openbsd.org/ioctl.2#GENERIC_IOCTLS diff --git a/vendor/rustix/src/io/read_write.rs b/vendor/rustix/src/io/read_write.rs index fe454adba..2ed9dd716 100644 --- a/vendor/rustix/src/io/read_write.rs +++ b/vendor/rustix/src/io/read_write.rs @@ -1,7 +1,11 @@ //! `read` and `write`, optionally positioned, optionally vectored +#![allow(unsafe_code)] + +use crate::buffer::split_init; use crate::{backend, io}; use backend::fd::AsFd; +use core::mem::MaybeUninit; // Declare `IoSlice` and `IoSliceMut`. #[cfg(not(windows))] @@ -34,7 +38,25 @@ pub use backend::io::types::ReadWriteFlags; /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/I_002fO-Primitives.html#index-reading-from-a-file-descriptor #[inline] pub fn read(fd: Fd, buf: &mut [u8]) -> io::Result { - backend::io::syscalls::read(fd.as_fd(), buf) + unsafe { backend::io::syscalls::read(fd.as_fd(), buf.as_mut_ptr(), buf.len()) } +} + +/// `read(fd, buf)`—Reads from a stream. +/// +/// This is equivalent to [`read`], except that it can read into uninitialized +/// memory. It returns the slice that was initialized by this function and the +/// slice that remains uninitialized. +#[inline] +pub fn read_uninit( + fd: Fd, + buf: &mut [MaybeUninit], +) -> io::Result<(&mut [u8], &mut [MaybeUninit])> { + // Get number of initialized bytes. + let length = + unsafe { backend::io::syscalls::read(fd.as_fd(), buf.as_mut_ptr() as *mut u8, buf.len()) }; + + // Split into the initialized and uninitialized portions. + Ok(unsafe { split_init(buf, length?) }) } /// `write(fd, buf)`—Writes to a stream. @@ -86,7 +108,24 @@ pub fn write(fd: Fd, buf: &[u8]) -> io::Result { /// [illumos]: https://illumos.org/man/2/pread #[inline] pub fn pread(fd: Fd, buf: &mut [u8], offset: u64) -> io::Result { - backend::io::syscalls::pread(fd.as_fd(), buf, offset) + unsafe { backend::io::syscalls::pread(fd.as_fd(), buf.as_mut_ptr(), buf.len(), offset) } +} + +/// `pread(fd, buf, offset)`—Reads from a file at a given position. +/// +/// This is equivalent to [`pread`], except that it can read into uninitialized +/// memory. It returns the slice that was initialized by this function and the +/// slice that remains uninitialized. +#[inline] +pub fn pread_uninit( + fd: Fd, + buf: &mut [MaybeUninit], + offset: u64, +) -> io::Result<(&mut [u8], &mut [MaybeUninit])> { + let length = unsafe { + backend::io::syscalls::pread(fd.as_fd(), buf.as_mut_ptr() as *mut u8, buf.len(), offset) + }; + Ok(unsafe { split_init(buf, length?) }) } /// `pwrite(fd, bufs)`—Writes to a file at a given position. diff --git a/vendor/rustix/src/ioctl/mod.rs b/vendor/rustix/src/ioctl/mod.rs index b56b82b41..494cdc829 100644 --- a/vendor/rustix/src/ioctl/mod.rs +++ b/vendor/rustix/src/ioctl/mod.rs @@ -66,7 +66,7 @@ use bsd as platform; /// /// # References /// - [Linux] -/// - [WinSock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -75,7 +75,7 @@ use bsd as platform; /// - [illumos] /// /// [Linux]: https://man7.org/linux/man-pages/man2/ioctl.2.html -/// [Winsock2]: https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-ioctlsocket +/// [Winsock]: https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-ioctlsocket /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=ioctl&sektion=2 /// [NetBSD]: https://man.netbsd.org/ioctl.2 /// [OpenBSD]: https://man.openbsd.org/ioctl.2 diff --git a/vendor/rustix/src/lib.rs b/vendor/rustix/src/lib.rs index 170e3f958..51fbdbaf7 100644 --- a/vendor/rustix/src/lib.rs +++ b/vendor/rustix/src/lib.rs @@ -1,5 +1,5 @@ //! `rustix` provides efficient memory-safe and [I/O-safe] wrappers to -//! POSIX-like, Unix-like, Linux, and Winsock2 syscall-like APIs, with +//! POSIX-like, Unix-like, Linux, and Winsock syscall-like APIs, with //! configurable backends. //! //! With rustix, you can write code like this: @@ -141,6 +141,7 @@ extern crate static_assertions; mod static_assertions; // Internal utilities. +mod buffer; #[cfg(not(windows))] #[macro_use] pub(crate) mod cstr; diff --git a/vendor/rustix/src/maybe_polyfill/no_std/os/fd/owned.rs b/vendor/rustix/src/maybe_polyfill/no_std/os/fd/owned.rs index ae9ffd673..d765c1dd6 100644 --- a/vendor/rustix/src/maybe_polyfill/no_std/os/fd/owned.rs +++ b/vendor/rustix/src/maybe_polyfill/no_std/os/fd/owned.rs @@ -112,12 +112,11 @@ impl OwnedFd { Ok(fd.into()) } + /// Creates a new `OwnedFd` instance that shares the same underlying file handle + /// as the existing `OwnedFd` instance. #[cfg(target_arch = "wasm32")] pub fn try_clone(&self) -> crate::io::Result { - Err(crate::io::const_io_error!( - crate::io::ErrorKind::Unsupported, - "operation not supported on WASI yet", - )) + Err(crate::io::Errno::NOSYS) } } @@ -150,10 +149,7 @@ impl BorrowedFd<'_> { #[cfg(any(target_arch = "wasm32", target_os = "hermit"))] #[cfg_attr(staged_api, stable(feature = "io_safety", since = "1.63.0"))] pub fn try_clone_to_owned(&self) -> crate::io::Result { - Err(crate::io::const_io_error!( - crate::io::ErrorKind::Unsupported, - "operation not supported on WASI yet", - )) + Err(crate::io::Errno::NOSYS) } } diff --git a/vendor/rustix/src/mount/fsopen.rs b/vendor/rustix/src/mount/fsopen.rs index 581f03782..54ba4011f 100644 --- a/vendor/rustix/src/mount/fsopen.rs +++ b/vendor/rustix/src/mount/fsopen.rs @@ -28,7 +28,7 @@ pub fn fsmount( fs_fd: BorrowedFd<'_>, flags: FsMountFlags, attr_flags: MountAttrFlags, -) -> io::Result<()> { +) -> io::Result { backend::mount::syscalls::fsmount(fs_fd, flags, attr_flags) } diff --git a/vendor/rustix/src/net/mod.rs b/vendor/rustix/src/net/mod.rs index 73ae2f089..7ec8bc698 100644 --- a/vendor/rustix/src/net/mod.rs +++ b/vendor/rustix/src/net/mod.rs @@ -16,6 +16,8 @@ mod types; #[cfg(windows)] mod wsa; +#[cfg(linux_kernel)] +pub mod netdevice; pub mod sockopt; pub use crate::maybe_polyfill::net::{ diff --git a/vendor/rustix/src/net/netdevice.rs b/vendor/rustix/src/net/netdevice.rs new file mode 100644 index 000000000..960c8a04f --- /dev/null +++ b/vendor/rustix/src/net/netdevice.rs @@ -0,0 +1,99 @@ +//! Low-level Linux network device access +//! +//! The methods in this module take a socket's file descriptor to communicate with +//! the kernel in their ioctl call: +//! - glibc uses an `AF_UNIX`, `AF_INET`, or `AF_INET6` socket. +//! The address family itself does not matter and glibc tries the next address family if socket creation with one fails. +//! - Android (bionic) uses an `AF_INET` socket. +//! - Both create the socket with `SOCK_DGRAM|SOCK_CLOEXEC` type/flag. +//! - The [man-pages] specify, that the ioctl calls "can be used on any socket's file descriptor regardless of the +//! family or type". +//! +//! # References +//! - [Linux] +//! +//! [man-pages]: https://man7.org/linux/man-pages/man7/netdevice.7.html +//! [Linux]: https://man7.org/linux/man-pages/man7/netdevice.7.html + +#[cfg(feature = "alloc")] +use crate::alloc::string::String; +use crate::fd::AsFd; +use crate::io; + +/// `ioctl(fd, SIOCGIFINDEX, ifreq)`—Returns the interface index for a given name. +/// +/// See the [module-level documentation] for information about `fd` usage. +/// +/// # References +/// - [Linux] +/// +/// [module-level documentation]: self +/// [Linux]: https://man7.org/linux/man-pages/man7/netdevice.7.html +#[inline] +#[doc(alias = "SIOCGIFINDEX")] +pub fn name_to_index(fd: impl AsFd, if_name: &str) -> io::Result { + crate::backend::net::netdevice::name_to_index(fd, if_name) +} + +/// `ioctl(fd, SIOCGIFNAME, ifreq)`—Returns the interface name for a given index. +/// +/// See the [module-level documentation] for information about `fd` usage. +/// +/// # References +/// - [Linux] +/// +/// [module-level documentation]: self +/// [Linux]: https://man7.org/linux/man-pages/man7/netdevice.7.html +#[inline] +#[doc(alias = "SIOCGIFNAME")] +#[cfg(feature = "alloc")] +pub fn index_to_name(fd: impl AsFd, index: u32) -> io::Result { + crate::backend::net::netdevice::index_to_name(fd, index) +} + +#[cfg(test)] +mod tests { + use crate::backend::net::netdevice::{index_to_name, name_to_index}; + use crate::net::{AddressFamily, SocketFlags, SocketType}; + + #[test] + fn test_name_to_index() { + let fd = crate::net::socket_with( + AddressFamily::INET, + SocketType::DGRAM, + SocketFlags::CLOEXEC, + None, + ) + .unwrap(); + + let loopback_index = std::fs::read_to_string("/sys/class/net/lo/ifindex") + .unwrap() + .as_str() + .split_at(1) + .0 + .parse::() + .unwrap(); + assert_eq!(Ok(loopback_index), name_to_index(fd, "lo")); + } + + #[test] + #[cfg(feature = "alloc")] + fn test_index_to_name() { + let fd = crate::net::socket_with( + AddressFamily::INET, + SocketType::DGRAM, + SocketFlags::CLOEXEC, + None, + ) + .unwrap(); + + let loopback_index = std::fs::read_to_string("/sys/class/net/lo/ifindex") + .unwrap() + .as_str() + .split_at(1) + .0 + .parse::() + .unwrap(); + assert_eq!(Ok("lo".to_owned()), index_to_name(fd, loopback_index)); + } +} diff --git a/vendor/rustix/src/net/send_recv/mod.rs b/vendor/rustix/src/net/send_recv/mod.rs index a377f65ad..1ae4fdb39 100644 --- a/vendor/rustix/src/net/send_recv/mod.rs +++ b/vendor/rustix/src/net/send_recv/mod.rs @@ -1,10 +1,16 @@ //! `recv`, `send`, and variants. +#![allow(unsafe_code)] + +use crate::buffer::split_init; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; #[cfg(unix)] use crate::net::SocketAddrUnix; use crate::net::{SocketAddr, SocketAddrAny, SocketAddrV4, SocketAddrV6}; use crate::{backend, io}; use backend::fd::{AsFd, BorrowedFd}; +use core::mem::MaybeUninit; pub use backend::net::send_recv::{RecvFlags, SendFlags}; @@ -33,7 +39,7 @@ pub use msg::*; /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -45,7 +51,7 @@ pub use msg::*; /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html /// [Linux]: https://man7.org/linux/man-pages/man2/recv.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recv.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=recv&sektion=2 /// [NetBSD]: https://man.netbsd.org/recv.2 /// [OpenBSD]: https://man.openbsd.org/recv.2 @@ -54,7 +60,25 @@ pub use msg::*; /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Receiving-Data.html #[inline] pub fn recv(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result { - backend::net::syscalls::recv(fd.as_fd(), buf, flags) + unsafe { backend::net::syscalls::recv(fd.as_fd(), buf.as_mut_ptr(), buf.len(), flags) } +} + +/// `recv(fd, buf, flags)`—Reads data from a socket. +/// +/// This is equivalent to [`recv`], except that it can read into uninitialized +/// memory. It returns the slice that was initialized by this function and the +/// slice that remains uninitialized. +#[inline] +pub fn recv_uninit( + fd: Fd, + buf: &mut [MaybeUninit], + flags: RecvFlags, +) -> io::Result<(&mut [u8], &mut [MaybeUninit])> { + let length = unsafe { + backend::net::syscalls::recv(fd.as_fd(), buf.as_mut_ptr() as *mut u8, buf.len(), flags) + }; + + Ok(unsafe { split_init(buf, length?) }) } /// `send(fd, buf, flags)`—Writes data to a socket. @@ -64,7 +88,7 @@ pub fn recv(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -108,7 +132,7 @@ pub fn send(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html /// [Linux]: https://man7.org/linux/man-pages/man2/recvfrom.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvfrom.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=recvfrom&sektion=2 /// [NetBSD]: https://man.netbsd.org/recvfrom.2 /// [OpenBSD]: https://man.openbsd.org/recvfrom.2 @@ -121,7 +145,27 @@ pub fn recvfrom( buf: &mut [u8], flags: RecvFlags, ) -> io::Result<(usize, Option)> { - backend::net::syscalls::recvfrom(fd.as_fd(), buf, flags) + unsafe { backend::net::syscalls::recvfrom(fd.as_fd(), buf.as_mut_ptr(), buf.len(), flags) } +} + +/// `recvfrom(fd, buf, flags, addr, len)`—Reads data from a socket and +/// returns the sender address. +/// +/// This is equivalent to [`recvfrom`], except that it can read into +/// uninitialized memory. It returns the slice that was initialized by this +/// function and the slice that remains uninitialized. +#[allow(clippy::type_complexity)] +#[inline] +pub fn recvfrom_uninit( + fd: Fd, + buf: &mut [MaybeUninit], + flags: RecvFlags, +) -> io::Result<(&mut [u8], &mut [MaybeUninit], Option)> { + let (length, addr) = unsafe { + backend::net::syscalls::recvfrom(fd.as_fd(), buf.as_mut_ptr() as *mut u8, buf.len(), flags)? + }; + let (init, uninit) = unsafe { split_init(buf, length) }; + Ok((init, uninit, addr)) } /// `sendto(fd, buf, flags, addr)`—Writes data to a socket to a specific IP @@ -132,7 +176,7 @@ pub fn recvfrom( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -144,7 +188,7 @@ pub fn recvfrom( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html /// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2 /// [NetBSD]: https://man.netbsd.org/sendto.2 /// [OpenBSD]: https://man.openbsd.org/sendto.2 @@ -180,7 +224,7 @@ fn _sendto( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -192,7 +236,7 @@ fn _sendto( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html /// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2 /// [NetBSD]: https://man.netbsd.org/sendto.2 /// [OpenBSD]: https://man.openbsd.org/sendto.2 @@ -219,6 +263,8 @@ fn _sendto_any( SocketAddrAny::V6(v6) => backend::net::syscalls::sendto_v6(fd, buf, flags, v6), #[cfg(unix)] SocketAddrAny::Unix(unix) => backend::net::syscalls::sendto_unix(fd, buf, flags, unix), + #[cfg(target_os = "linux")] + SocketAddrAny::Xdp(xdp) => backend::net::syscalls::sendto_xdp(fd, buf, flags, xdp), } } @@ -230,7 +276,7 @@ fn _sendto_any( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -242,7 +288,7 @@ fn _sendto_any( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html /// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2 /// [NetBSD]: https://man.netbsd.org/sendto.2 /// [OpenBSD]: https://man.openbsd.org/sendto.2 @@ -268,7 +314,7 @@ pub fn sendto_v4( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -280,7 +326,7 @@ pub fn sendto_v4( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html /// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2 /// [NetBSD]: https://man.netbsd.org/sendto.2 /// [OpenBSD]: https://man.openbsd.org/sendto.2 @@ -306,7 +352,7 @@ pub fn sendto_v6( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -318,7 +364,7 @@ pub fn sendto_v6( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html /// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2 /// [NetBSD]: https://man.netbsd.org/sendto.2 /// [OpenBSD]: https://man.openbsd.org/sendto.2 @@ -336,3 +382,22 @@ pub fn sendto_unix( ) -> io::Result { backend::net::syscalls::sendto_unix(fd.as_fd(), buf, flags, addr) } + +/// `sendto(fd, buf, flags, addr, sizeof(struct sockaddr_xdp))`—Writes data +/// to a socket to a specific XDP address. +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html +#[cfg(target_os = "linux")] +#[inline] +#[doc(alias = "sendto")] +pub fn sendto_xdp( + fd: Fd, + buf: &[u8], + flags: SendFlags, + addr: &SocketAddrXdp, +) -> io::Result { + backend::net::syscalls::sendto_xdp(fd.as_fd(), buf, flags, addr) +} diff --git a/vendor/rustix/src/net/send_recv/msg.rs b/vendor/rustix/src/net/send_recv/msg.rs index 78fb8654c..629e4656a 100644 --- a/vendor/rustix/src/net/send_recv/msg.rs +++ b/vendor/rustix/src/net/send_recv/msg.rs @@ -708,6 +708,24 @@ pub fn sendmsg_unix( backend::net::syscalls::sendmsg_unix(socket.as_fd(), addr, iov, control, flags) } +/// `sendmsg(msghdr)`—Sends a message on a socket to a specific XDP address. +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://man7.org/linux/man-pages/man2/sendmsg.2.html +#[inline] +#[cfg(target_os = "linux")] +pub fn sendmsg_xdp( + socket: impl AsFd, + addr: &super::SocketAddrXdp, + iov: &[IoSlice<'_>], + control: &mut SendAncillaryBuffer<'_, '_, '_>, + flags: SendFlags, +) -> io::Result { + backend::net::syscalls::sendmsg_xdp(socket.as_fd(), addr, iov, control, flags) +} + /// `sendmsg(msghdr)`—Sends a message on a socket to a specific address. /// /// # References @@ -748,6 +766,10 @@ pub fn sendmsg_any( Some(SocketAddrAny::Unix(addr)) => { backend::net::syscalls::sendmsg_unix(socket.as_fd(), addr, iov, control, flags) } + #[cfg(target_os = "linux")] + Some(SocketAddrAny::Xdp(addr)) => { + backend::net::syscalls::sendmsg_xdp(socket.as_fd(), addr, iov, control, flags) + } } } diff --git a/vendor/rustix/src/net/socket.rs b/vendor/rustix/src/net/socket.rs index fe7439562..bf1aa7c9f 100644 --- a/vendor/rustix/src/net/socket.rs +++ b/vendor/rustix/src/net/socket.rs @@ -3,6 +3,8 @@ use crate::net::{SocketAddr, SocketAddrAny, SocketAddrV4, SocketAddrV6}; use crate::{backend, io}; use backend::fd::{AsFd, BorrowedFd}; +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; pub use crate::net::{AddressFamily, Protocol, Shutdown, SocketFlags, SocketType}; #[cfg(unix)] pub use backend::net::addr::SocketAddrUnix; @@ -21,7 +23,7 @@ pub use backend::net::addr::SocketAddrUnix; /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -33,7 +35,7 @@ pub use backend::net::addr::SocketAddrUnix; /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html /// [Linux]: https://man7.org/linux/man-pages/man2/socket.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socket.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2 /// [NetBSD]: https://man.netbsd.org/socket.2 /// [OpenBSD]: https://man.openbsd.org/socket.2 @@ -64,7 +66,7 @@ pub fn socket( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -76,7 +78,7 @@ pub fn socket( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html /// [Linux]: https://man7.org/linux/man-pages/man2/socket.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/socket.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2 /// [NetBSD]: https://man.netbsd.org/socket.2 /// [OpenBSD]: https://man.openbsd.org/socket.2 @@ -101,7 +103,7 @@ pub fn socket_with( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -113,7 +115,7 @@ pub fn socket_with( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html /// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2 /// [NetBSD]: https://man.netbsd.org/bind.2 /// [OpenBSD]: https://man.openbsd.org/bind.2 @@ -138,7 +140,7 @@ fn _bind(sockfd: BorrowedFd<'_>, addr: &SocketAddr) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -150,7 +152,7 @@ fn _bind(sockfd: BorrowedFd<'_>, addr: &SocketAddr) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html /// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2 /// [NetBSD]: https://man.netbsd.org/bind.2 /// [OpenBSD]: https://man.openbsd.org/bind.2 @@ -168,6 +170,8 @@ fn _bind_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> { SocketAddrAny::V6(v6) => backend::net::syscalls::bind_v6(sockfd, v6), #[cfg(unix)] SocketAddrAny::Unix(unix) => backend::net::syscalls::bind_unix(sockfd, unix), + #[cfg(target_os = "linux")] + SocketAddrAny::Xdp(xdp) => backend::net::syscalls::bind_xdp(sockfd, xdp), } } @@ -179,7 +183,7 @@ fn _bind_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -191,7 +195,7 @@ fn _bind_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html /// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2 /// [NetBSD]: https://man.netbsd.org/bind.2 /// [OpenBSD]: https://man.openbsd.org/bind.2 @@ -212,7 +216,7 @@ pub fn bind_v4(sockfd: Fd, addr: &SocketAddrV4) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -224,7 +228,7 @@ pub fn bind_v4(sockfd: Fd, addr: &SocketAddrV4) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html /// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2 /// [NetBSD]: https://man.netbsd.org/bind.2 /// [OpenBSD]: https://man.openbsd.org/bind.2 @@ -245,7 +249,7 @@ pub fn bind_v6(sockfd: Fd, addr: &SocketAddrV6) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -257,7 +261,7 @@ pub fn bind_v6(sockfd: Fd, addr: &SocketAddrV6) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html /// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/bind.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-bind /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2 /// [NetBSD]: https://man.netbsd.org/bind.2 /// [OpenBSD]: https://man.openbsd.org/bind.2 @@ -271,6 +275,19 @@ pub fn bind_unix(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<()> backend::net::syscalls::bind_unix(sockfd.as_fd(), addr) } +/// `bind(sockfd, addr, sizeof(struct sockaddr_un))`—Binds a socket to a XDP address. +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://man7.org/linux/man-pages/man2/bind.2.html +#[cfg(target_os = "linux")] +#[inline] +#[doc(alias = "bind")] +pub fn bind_xdp(sockfd: Fd, addr: &SocketAddrXdp) -> io::Result<()> { + backend::net::syscalls::bind_xdp(sockfd.as_fd(), addr) +} + /// `connect(sockfd, addr)`—Initiates a connection to an IP address. /// /// On Windows, a non-blocking socket returns [`Errno::WOULDBLOCK`] if the @@ -282,7 +299,7 @@ pub fn bind_unix(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<()> /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -294,7 +311,7 @@ pub fn bind_unix(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<()> /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -320,7 +337,7 @@ fn _connect(sockfd: BorrowedFd<'_>, addr: &SocketAddr) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -332,7 +349,7 @@ fn _connect(sockfd: BorrowedFd<'_>, addr: &SocketAddr) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -350,6 +367,8 @@ fn _connect_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> SocketAddrAny::V6(v6) => backend::net::syscalls::connect_v6(sockfd, v6), #[cfg(unix)] SocketAddrAny::Unix(unix) => backend::net::syscalls::connect_unix(sockfd, unix), + #[cfg(target_os = "linux")] + SocketAddrAny::Xdp(_) => Err(io::Errno::OPNOTSUPP), } } @@ -361,7 +380,7 @@ fn _connect_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -373,7 +392,7 @@ fn _connect_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -394,7 +413,7 @@ pub fn connect_v4(sockfd: Fd, addr: &SocketAddrV4) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -406,7 +425,7 @@ pub fn connect_v4(sockfd: Fd, addr: &SocketAddrV4) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -427,7 +446,7 @@ pub fn connect_v6(sockfd: Fd, addr: &SocketAddrV6) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -439,7 +458,7 @@ pub fn connect_v6(sockfd: Fd, addr: &SocketAddrV6) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -464,7 +483,7 @@ pub fn connect_unix(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -476,7 +495,7 @@ pub fn connect_unix(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html /// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2 /// [NetBSD]: https://man.netbsd.org/connect.2 /// [OpenBSD]: https://man.openbsd.org/connect.2 @@ -498,7 +517,7 @@ pub fn connect_unspec(sockfd: Fd) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -510,7 +529,7 @@ pub fn connect_unspec(sockfd: Fd) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html /// [Linux]: https://man7.org/linux/man-pages/man2/listen.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/listen.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-listen +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-listen /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=listen&sektion=2 /// [NetBSD]: https://man.netbsd.org/listen.2 /// [OpenBSD]: https://man.openbsd.org/listen.2 @@ -535,7 +554,7 @@ pub fn listen(sockfd: Fd, backlog: i32) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -547,7 +566,7 @@ pub fn listen(sockfd: Fd, backlog: i32) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html /// [Linux]: https://man7.org/linux/man-pages/man2/accept.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/accept.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-accept +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-accept /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=accept&sektion=2 /// [NetBSD]: https://man.netbsd.org/accept.2 /// [OpenBSD]: https://man.openbsd.org/accept.2 @@ -601,7 +620,7 @@ pub fn accept_with(sockfd: Fd, flags: SocketFlags) -> io::Result(sockfd: Fd, flags: SocketFlags) -> io::Result( /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -676,7 +695,7 @@ pub fn acceptfrom_with( /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html /// [Linux]: https://man7.org/linux/man-pages/man2/shutdown.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/shutdown.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-shutdown +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-shutdown /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=shutdown&sektion=2 /// [NetBSD]: https://man.netbsd.org/shutdown.2 /// [OpenBSD]: https://man.openbsd.org/shutdown.2 @@ -694,7 +713,7 @@ pub fn shutdown(sockfd: Fd, how: Shutdown) -> io::Result<()> { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -705,7 +724,7 @@ pub fn shutdown(sockfd: Fd, how: Shutdown) -> io::Result<()> { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html /// [Linux]: https://man7.org/linux/man-pages/man2/getsockname.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockname.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockname +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockname /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=getsockname&sektion=2 /// [NetBSD]: https://man.netbsd.org/getsockname.2 /// [OpenBSD]: https://man.openbsd.org/getsockname.2 @@ -725,7 +744,7 @@ pub fn getsockname(sockfd: Fd) -> io::Result { /// - [POSIX] /// - [Linux] /// - [Apple] -/// - [Winsock2] +/// - [Winsock] /// - [FreeBSD] /// - [NetBSD] /// - [OpenBSD] @@ -737,7 +756,7 @@ pub fn getsockname(sockfd: Fd) -> io::Result { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html /// [Linux]: https://man7.org/linux/man-pages/man2/getpeername.2.html /// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpeername.2.html -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getpeername +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getpeername /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=getpeername&sektion=2 /// [NetBSD]: https://man.netbsd.org/getpeername.2 /// [OpenBSD]: https://man.openbsd.org/getpeername.2 diff --git a/vendor/rustix/src/net/socket_addr_any.rs b/vendor/rustix/src/net/socket_addr_any.rs index a649015f4..3be80a3ad 100644 --- a/vendor/rustix/src/net/socket_addr_any.rs +++ b/vendor/rustix/src/net/socket_addr_any.rs @@ -9,6 +9,8 @@ //! OS-specific socket address representations in memory. #![allow(unsafe_code)] +#[cfg(target_os = "linux")] +use crate::net::xdp::SocketAddrXdp; #[cfg(unix)] use crate::net::SocketAddrUnix; use crate::net::{AddressFamily, SocketAddr, SocketAddrV4, SocketAddrV6}; @@ -30,6 +32,9 @@ pub enum SocketAddrAny { /// `struct sockaddr_un` #[cfg(unix)] Unix(SocketAddrUnix), + /// `struct sockaddr_xdp` + #[cfg(target_os = "linux")] + Xdp(SocketAddrXdp), } impl From for SocketAddrAny { @@ -73,6 +78,8 @@ impl SocketAddrAny { Self::V6(_) => AddressFamily::INET6, #[cfg(unix)] Self::Unix(_) => AddressFamily::UNIX, + #[cfg(target_os = "linux")] + Self::Xdp(_) => AddressFamily::XDP, } } @@ -108,6 +115,8 @@ impl fmt::Debug for SocketAddrAny { Self::V6(v6) => v6.fmt(fmt), #[cfg(unix)] Self::Unix(unix) => unix.fmt(fmt), + #[cfg(target_os = "linux")] + Self::Xdp(xdp) => xdp.fmt(fmt), } } } diff --git a/vendor/rustix/src/net/sockopt.rs b/vendor/rustix/src/net/sockopt.rs index afeaf0b33..47ab1a5be 100644 --- a/vendor/rustix/src/net/sockopt.rs +++ b/vendor/rustix/src/net/sockopt.rs @@ -7,7 +7,7 @@ //! //! - [POSIX `getsockopt`] //! - [Linux `getsockopt`] -//! - [Winsock2 `getsockopt`] +//! - [Winsock `getsockopt`] //! - [Apple `getsockopt`] //! - [FreeBSD `getsockopt`] //! - [NetBSD `getsockopt`] @@ -18,7 +18,7 @@ //! //! [POSIX `getsockopt`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html //! [Linux `getsockopt`]: https://man7.org/linux/man-pages/man2/getsockopt.2.html -//! [Winsock2 `getsockopt`]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockopt +//! [Winsock `getsockopt`]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockopt //! [Apple `getsockopt`]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockopt.2.html //! [FreeBSD `getsockopt`]: https://man.freebsd.org/cgi/man.cgi?query=getsockopt&sektion=2 //! [NetBSD `getsockopt`]: https://man.netbsd.org/getsockopt.2 @@ -31,7 +31,7 @@ //! //! - [POSIX `setsockopt`] //! - [Linux `setsockopt`] -//! - [Winsock2 `setsockopt`] +//! - [Winsock `setsockopt`] //! - [Apple `setsockopt`] //! - [FreeBSD `setsockopt`] //! - [NetBSD `setsockopt`] @@ -42,7 +42,7 @@ //! //! [POSIX `setsockopt`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html //! [Linux `setsockopt`]: https://man7.org/linux/man-pages/man2/setsockopt.2.html -//! [Winsock2 `setsockopt`]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-setsockopt +//! [Winsock `setsockopt`]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-setsockopt //! [Apple `setsockopt`]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setsockopt.2.html //! [FreeBSD `setsockopt`]: https://man.freebsd.org/cgi/man.cgi?query=setsockopt&sektion=2 //! [NetBSD `setsockopt`]: https://man.netbsd.org/setsockopt.2 @@ -57,12 +57,12 @@ //! - [References for all `set_*` functions] //! - [POSIX `sys/socket.h`] //! - [Linux `socket`] -//! - [Winsock2 `SOL_SOCKET` options] +//! - [Winsock `SOL_SOCKET` options] //! - [glibc `SOL_SOCKET` Options] //! //! [POSIX `sys/socket.h`]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html //! [Linux `socket`]: https://man7.org/linux/man-pages/man7/socket.7.html -//! [Winsock2 `SOL_SOCKET` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/sol-socket-socket-options +//! [Winsock `SOL_SOCKET` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/sol-socket-socket-options //! [glibc `SOL_SOCKET` options]: https://www.gnu.org/software/libc/manual/html_node/Socket_002dLevel-Options.html //! //! # References for `get_ip_*` and `set_ip_*` functions: @@ -71,7 +71,7 @@ //! - [References for all `set_*` functions] //! - [POSIX `netinet/in.h`] //! - [Linux `ip`] -//! - [Winsock2 `IPPROTO_IP` options] +//! - [Winsock `IPPROTO_IP` options] //! - [Apple `ip`] //! - [FreeBSD `ip`] //! - [NetBSD `ip`] @@ -81,7 +81,7 @@ //! //! [POSIX `netinet/in.h`]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html //! [Linux `ip`]: https://man7.org/linux/man-pages/man7/ip.7.html -//! [Winsock2 `IPPROTO_IP` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options +//! [Winsock `IPPROTO_IP` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options //! [Apple `ip`]: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/man/man4/ip.4.auto.html //! [FreeBSD `ip`]: https://man.freebsd.org/cgi/man.cgi?query=ip&sektion=4 //! [NetBSD `ip`]: https://man.netbsd.org/ip.4 @@ -95,7 +95,7 @@ //! - [References for all `set_*` functions] //! - [POSIX `netinet/in.h`] //! - [Linux `ipv6`] -//! - [Winsock2 `IPPROTO_IPV6` options] +//! - [Winsock `IPPROTO_IPV6` options] //! - [Apple `ip6`] //! - [FreeBSD `ip6`] //! - [NetBSD `ip6`] @@ -105,7 +105,7 @@ //! //! [POSIX `netinet/in.h`]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html //! [Linux `ipv6`]: https://man7.org/linux/man-pages/man7/ipv6.7.html -//! [Winsock2 `IPPROTO_IPV6` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options +//! [Winsock `IPPROTO_IPV6` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options //! [Apple `ip6`]: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/man/man4/ip6.4.auto.html //! [FreeBSD `ip6`]: https://man.freebsd.org/cgi/man.cgi?query=ip6&sektion=4 //! [NetBSD `ip6`]: https://man.netbsd.org/ip6.4 @@ -119,7 +119,7 @@ //! - [References for all `set_*` functions] //! - [POSIX `netinet/tcp.h`] //! - [Linux `tcp`] -//! - [Winsock2 `IPPROTO_TCP` options] +//! - [Winsock `IPPROTO_TCP` options] //! - [Apple `tcp`] //! - [FreeBSD `tcp`] //! - [NetBSD `tcp`] @@ -129,7 +129,7 @@ //! //! [POSIX `netinet/tcp.h`]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_tcp.h.html //! [Linux `tcp`]: https://man7.org/linux/man-pages/man7/tcp.7.html -//! [Winsock2 `IPPROTO_TCP` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options +//! [Winsock `IPPROTO_TCP` options]: https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options //! [Apple `tcp`]: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/man/man4/tcp.4.auto.html //! [FreeBSD `tcp`]: https://man.freebsd.org/cgi/man.cgi?query=tcp&sektion=4 //! [NetBSD `tcp`]: https://man.netbsd.org/tcp.4 @@ -143,6 +143,8 @@ #![doc(alias = "getsockopt")] #![doc(alias = "setsockopt")] +#[cfg(target_os = "linux")] +use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpStatistics, XdpUmemReg}; #[cfg(not(any( apple, windows, @@ -1372,6 +1374,104 @@ pub fn get_socket_peercred(fd: Fd) -> io::Result { backend::net::sockopt::get_socket_peercred(fd.as_fd()) } +/// `setsockopt(fd, SOL_XDP, XDP_UMEM_REG, value)` +/// +/// On kernel versions only supporting v1, the flags are ignored. +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-umem-reg-setsockopt +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_UMEM_REG")] +pub fn set_xdp_umem_reg(fd: Fd, value: XdpUmemReg) -> io::Result<()> { + backend::net::sockopt::set_xdp_umem_reg(fd.as_fd(), value) +} + +/// `setsockopt(fd, SOL_XDP, XDP_UMEM_FILL_RING, value)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-rx-tx-umem-fill-umem-completion-ring-setsockopts +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_UMEM_FILL_RING")] +pub fn set_xdp_umem_fill_ring_size(fd: Fd, value: u32) -> io::Result<()> { + backend::net::sockopt::set_xdp_umem_fill_ring_size(fd.as_fd(), value) +} + +/// `setsockopt(fd, SOL_XDP, XDP_UMEM_COMPLETION_RING, value)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-rx-tx-umem-fill-umem-completion-ring-setsockopts +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_UMEM_COMPLETION_RING")] +pub fn set_xdp_umem_completion_ring_size(fd: Fd, value: u32) -> io::Result<()> { + backend::net::sockopt::set_xdp_umem_completion_ring_size(fd.as_fd(), value) +} + +/// `setsockopt(fd, SOL_XDP, XDP_TX_RING, value)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-rx-tx-umem-fill-umem-completion-ring-setsockopts +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_TX_RING")] +pub fn set_xdp_tx_ring_size(fd: Fd, value: u32) -> io::Result<()> { + backend::net::sockopt::set_xdp_tx_ring_size(fd.as_fd(), value) +} + +/// `setsockopt(fd, SOL_XDP, XDP_RX_RING, value)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-rx-tx-umem-fill-umem-completion-ring-setsockopts +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_RX_RING")] +pub fn set_xdp_rx_ring_size(fd: Fd, value: u32) -> io::Result<()> { + backend::net::sockopt::set_xdp_rx_ring_size(fd.as_fd(), value) +} + +/// `getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_MMAP_OFFSETS")] +pub fn get_xdp_mmap_offsets(fd: Fd) -> io::Result { + backend::net::sockopt::get_xdp_mmap_offsets(fd.as_fd()) +} + +/// `getsockopt(fd, SOL_XDP, XDP_STATISTICS)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-statistics-getsockopt +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_STATISTICS")] +pub fn get_xdp_statistics(fd: Fd) -> io::Result { + backend::net::sockopt::get_xdp_statistics(fd.as_fd()) +} + +/// `getsockopt(fd, SOL_XDP, XDP_OPTIONS)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://www.kernel.org/doc/html/next/networking/af_xdp.html#xdp-options-getsockopt +#[cfg(target_os = "linux")] +#[doc(alias = "XDP_OPTIONS")] +pub fn get_xdp_options(fd: Fd) -> io::Result { + backend::net::sockopt::get_xdp_options(fd.as_fd()) +} + #[test] fn test_sizes() { use c::c_int; diff --git a/vendor/rustix/src/net/types.rs b/vendor/rustix/src/net/types.rs index ad60e36cb..dc0b752ba 100644 --- a/vendor/rustix/src/net/types.rs +++ b/vendor/rustix/src/net/types.rs @@ -588,6 +588,9 @@ impl AddressFamily { /// `AF_VSOCK` #[cfg(any(apple, target_os = "emscripten", target_os = "fuchsia"))] pub const VSOCK: Self = Self(c::AF_VSOCK as _); + /// `AF_XDP` + #[cfg(target_os = "linux")] + pub const XDP: Self = Self(c::AF_XDP as _); /// Constructs a `AddressFamily` from a raw integer. #[inline] @@ -1445,6 +1448,288 @@ bitflags! { } } +/// `AF_XDP` related types and constants. +#[cfg(target_os = "linux")] +pub mod xdp { + use super::{bitflags, c}; + + bitflags! { + /// `XDP_OPTIONS_*` constants returned by [`get_xdp_options`]. + /// + /// [`get_xdp_options`]: crate::net::sockopt::get_xdp_options + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpOptionsFlags: u32 { + /// `XDP_OPTIONS_ZEROCOPY` + const XDP_OPTIONS_ZEROCOPY = bitcast!(c::XDP_OPTIONS_ZEROCOPY); + } + } + + // Constant needs to be cast because bindgen does generate a u32 but the struct expects a u16. + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L15-L44 + bitflags! { + /// `XDP_*` constants for use in [`SockaddrXdp`]. + #[repr(transparent)] + #[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug)] + pub struct SockaddrXdpFlags: u16 { + /// `XDP_SHARED_UMEM` + const XDP_SHARED_UMEM = bitcast!(c::XDP_SHARED_UMEM as u16); + /// `XDP_COPY` + const XDP_COPY = bitcast!(c::XDP_COPY as u16); + /// `XDP_COPY` + const XDP_ZEROCOPY = bitcast!(c::XDP_ZEROCOPY as u16); + /// `XDP_USE_NEED_WAKEUP` + const XDP_USE_NEED_WAKEUP = bitcast!(c::XDP_USE_NEED_WAKEUP as u16); + // requires kernel 6.6 + /// `XDP_USE_SG` + const XDP_USE_SG = bitcast!(c::XDP_USE_SG as u16); + } + } + + bitflags! { + /// `XDP_RING_*` constants for use in fill and/or Tx ring. + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpRingFlags: u32 { + /// `XDP_RING_NEED_WAKEUP` + const XDP_RING_NEED_WAKEUP = bitcast!(c::XDP_RING_NEED_WAKEUP); + } + } + + bitflags! { + /// `XDP_UMEM_*` constants for use in [`XdpUmemReg`]. + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpUmemRegFlags: u32 { + /// `XDP_UMEM_UNALIGNED_CHUNK_FLAG` + const XDP_UMEM_UNALIGNED_CHUNK_FLAG = bitcast!(c::XDP_UMEM_UNALIGNED_CHUNK_FLAG); + } + } + + /// A XDP socket address. + /// + /// Used to bind to XDP socket. + /// + /// Not ABI compatible with `struct sockaddr_xdp` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L38-L44 + #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug)] + pub struct SocketAddrXdp { + /// Flags. + sxdp_flags: SockaddrXdpFlags, + /// Interface index. + sxdp_ifindex: u32, + /// Queue ID. + sxdp_queue_id: u32, + /// Shared UMEM file descriptor. + sxdp_shared_umem_fd: u32, + } + + impl SocketAddrXdp { + /// Construct a new XDP address. + #[inline] + pub fn new( + flags: SockaddrXdpFlags, + interface_index: u32, + queue_id: u32, + share_umem_fd: u32, + ) -> Self { + Self { + sxdp_flags: flags, + sxdp_ifindex: interface_index, + sxdp_queue_id: queue_id, + sxdp_shared_umem_fd: share_umem_fd, + } + } + + /// Return flags. + #[inline] + pub fn flags(&self) -> SockaddrXdpFlags { + self.sxdp_flags + } + + /// Set flags. + #[inline] + pub fn set_flags(&mut self, flags: SockaddrXdpFlags) { + self.sxdp_flags = flags; + } + + /// Return interface index. + #[inline] + pub fn interface_index(&self) -> u32 { + self.sxdp_ifindex + } + + /// Set interface index. + #[inline] + pub fn set_interface_index(&mut self, interface_index: u32) { + self.sxdp_ifindex = interface_index; + } + + /// Return queue ID. + #[inline] + pub fn queue_id(&self) -> u32 { + self.sxdp_queue_id + } + + /// Set queue ID. + #[inline] + pub fn set_queue_id(&mut self, queue_id: u32) { + self.sxdp_queue_id = queue_id; + } + + /// Return shared UMEM file descriptor. + #[inline] + pub fn shared_umem_fd(&self) -> u32 { + self.sxdp_shared_umem_fd + } + + /// Set shared UMEM file descriptor. + #[inline] + pub fn set_shared_umem_fd(&mut self, shared_umem_fd: u32) { + self.sxdp_shared_umem_fd = shared_umem_fd; + } + } + + /// XDP ring offset. + /// + /// Used to mmap rings from kernel. + /// + /// Not ABI compatible with `struct xdp_ring_offset`. + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L49-L54 + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpRingOffset { + /// Producer offset. + pub producer: u64, + /// Consumer offset. + pub consumer: u64, + /// Descriptors offset. + pub desc: u64, + /// Flags offset. + /// + /// Is `None` if the kernel version (<5.4) does not yet support flags. + pub flags: Option, + } + + /// XDP mmap offsets. + /// + /// Not ABI compatible with `struct xdp_mmap_offsets` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L56-L61 + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpMmapOffsets { + /// Rx ring offsets. + pub rx: XdpRingOffset, + /// Tx ring offsets. + pub tx: XdpRingOffset, + /// Fill ring offsets. + pub fr: XdpRingOffset, + /// Completion ring offsets. + pub cr: XdpRingOffset, + } + + /// XDP umem registration. + /// + /// `struct xdp_umem_reg` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L73-L79 + #[repr(C)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpUmemReg { + /// Start address of UMEM. + pub addr: u64, + /// Umem length in bytes. + pub len: u64, + /// Chunk size in bytes. + pub chunk_size: u32, + /// Headroom in bytes. + pub headroom: u32, + /// Flags. + /// + /// Requires kernel version 5.4. + pub flags: XdpUmemRegFlags, + } + + /// XDP statistics. + /// + /// Not ABI compatible with `struct xdp_statistics` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L81-L88 + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpStatistics { + /// Rx dropped. + pub rx_dropped: u64, + /// Rx invalid descriptors. + pub rx_invalid_descs: u64, + /// Tx invalid descriptors. + pub tx_invalid_descs: u64, + /// Rx ring full. + /// + /// Is `None` if the kernel version (<5.9) does not yet support flags. + pub rx_ring_full: Option, + /// Rx fill ring empty descriptors. + /// + /// Is `None` if the kernel version (<5.9) does not yet support flags. + pub rx_fill_ring_empty_descs: Option, + /// Tx ring empty descriptors. + /// + /// Is `None` if the kernel version (<5.9) does not yet support flags. + pub tx_ring_empty_descs: Option, + } + + /// XDP options. + /// + /// Requires kernel version 5.3. + /// `struct xdp_options` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L90-L92 + #[repr(C)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpOptions { + /// Flags. + pub flags: XdpOptionsFlags, + } + + /// XDP rx/tx frame descriptor. + /// + /// `struct xdp_desc` + // https://github.com/torvalds/linux/blob/v6.6/include/uapi/linux/if_xdp.h#L109-L113 + #[repr(C)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct XdpDesc { + /// Offset from the start of the UMEM. + pub addr: u64, + /// Length of packet in bytes. + pub len: u32, + /// Options. + pub options: XdpDescOptions, + } + + #[cfg(target_os = "linux")] + bitflags! { + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + /// `XDP_*` constants for use in [`XdpDesc`]. + /// + /// Requires kernel version 6.6. + pub struct XdpDescOptions: u32 { + /// `XDP_PKT_CONTD` + const XDP_PKT_CONTD = bitcast!(c::XDP_PKT_CONTD); + } + } + + /// Offset for mmapping rx ring. + pub const XDP_PGOFF_RX_RING: u64 = c::XDP_PGOFF_RX_RING as u64; + /// Offset for mmapping tx ring. + pub const XDP_PGOFF_TX_RING: u64 = c::XDP_PGOFF_TX_RING as u64; + /// Offset for mmapping fill ring. + pub const XDP_UMEM_PGOFF_FILL_RING: u64 = c::XDP_UMEM_PGOFF_FILL_RING; + /// Offset for mmapping completion ring. + pub const XDP_UMEM_PGOFF_COMPLETION_RING: u64 = c::XDP_UMEM_PGOFF_COMPLETION_RING; + + /// Offset used to shift the [`XdpDesc`] addr to the right to extract the address offset in + /// unaligned mode. + pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u64 = c::XSK_UNALIGNED_BUF_OFFSET_SHIFT as u64; + /// Mask used to binary `and` the [`XdpDesc`] addr to extract the address without the offset + /// carried in the upper 16 bits of the address in unaligned mode. + pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = c::XSK_UNALIGNED_BUF_ADDR_MASK; +} + /// UNIX credentials of socket peer, for use with [`get_socket_peercred`] /// [`SendAncillaryMessage::ScmCredentials`] and /// [`RecvAncillaryMessage::ScmCredentials`]. @@ -1466,6 +1751,7 @@ pub struct UCred { #[test] fn test_sizes() { + use crate::backend::c; use c::c_int; use core::mem::transmute; @@ -1492,4 +1778,11 @@ fn test_sizes() { #[cfg(linux_kernel)] assert_eq_size!(UCred, libc::ucred); + + #[cfg(target_os = "linux")] + assert_eq_size!(super::xdp::XdpUmemReg, c::xdp_umem_reg); + #[cfg(target_os = "linux")] + assert_eq_size!(super::xdp::XdpOptions, c::xdp_options); + #[cfg(target_os = "linux")] + assert_eq_size!(super::xdp::XdpDesc, c::xdp_desc); } diff --git a/vendor/rustix/src/net/wsa.rs b/vendor/rustix/src/net/wsa.rs index 3367ca95c..0ad4db5eb 100644 --- a/vendor/rustix/src/net/wsa.rs +++ b/vendor/rustix/src/net/wsa.rs @@ -8,9 +8,9 @@ use windows_sys::Win32::Networking::WinSock::{WSACleanup, WSAGetLastError, WSASt /// using sockets APIs. The function performs the necessary initialization. /// /// # References -/// - [Winsock2] +/// - [Winsock] /// -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsastartup +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsastartup pub fn wsa_startup() -> io::Result { // Request version 2.2, which has been the latest version since far older // versions of Windows than we support here. For more information about @@ -35,9 +35,9 @@ pub fn wsa_startup() -> io::Result { /// this function releases associated resources. /// /// # References -/// - [Winsock2] +/// - [Winsock] /// -/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsacleanup +/// [Winsock]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsacleanup pub fn wsa_cleanup() -> io::Result<()> { unsafe { if WSACleanup() == 0 { diff --git a/vendor/rustix/src/param/mod.rs b/vendor/rustix/src/param/mod.rs index 905eae7e3..f0de9d41c 100644 --- a/vendor/rustix/src/param/mod.rs +++ b/vendor/rustix/src/param/mod.rs @@ -6,9 +6,9 @@ //! between different processes on the same system. mod auxv; -#[cfg(feature = "use-explicitly-provided-auxv")] +#[cfg(all(feature = "use-explicitly-provided-auxv", not(libc)))] mod init; pub use auxv::*; -#[cfg(feature = "use-explicitly-provided-auxv")] +#[cfg(all(feature = "use-explicitly-provided-auxv", not(libc)))] pub use init::init; diff --git a/vendor/rustix/src/path/arg.rs b/vendor/rustix/src/path/arg.rs index 4a4c8b30f..f71125d88 100644 --- a/vendor/rustix/src/path/arg.rs +++ b/vendor/rustix/src/path/arg.rs @@ -1063,10 +1063,12 @@ where #[cfg(not(feature = "alloc"))] { - #[cfg(libc)] + #[cfg(all(libc, not(target_os = "wasi")))] const LARGE_PATH_BUFFER_SIZE: usize = libc::PATH_MAX as usize; #[cfg(linux_raw)] const LARGE_PATH_BUFFER_SIZE: usize = linux_raw_sys::general::PATH_MAX as usize; + #[cfg(target_os = "wasi")] + const LARGE_PATH_BUFFER_SIZE: usize = 4096 as usize; // TODO: upstream this // Taken from // diff --git a/vendor/rustix/src/process/pidfd_getfd.rs b/vendor/rustix/src/process/pidfd_getfd.rs index 4c7696fb6..20e5163b9 100644 --- a/vendor/rustix/src/process/pidfd_getfd.rs +++ b/vendor/rustix/src/process/pidfd_getfd.rs @@ -40,7 +40,7 @@ bitflags::bitflags! { /// returned from `pidfd_getfd`. /// /// When `pidfd_getfd` is used to debug the target, or the target is not a Rust -/// aplication, or `pidfd_getfd` is used in any other way, then extra care +/// application, or `pidfd_getfd` is used in any other way, then extra care /// should be taken to avoid unexpected behaviour or crashes. /// /// For further details, see the references above. diff --git a/vendor/rustix/src/process/procctl.rs b/vendor/rustix/src/process/procctl.rs index f06bd72d6..bb6372299 100644 --- a/vendor/rustix/src/process/procctl.rs +++ b/vendor/rustix/src/process/procctl.rs @@ -5,8 +5,8 @@ #![allow(unsafe_code)] -use alloc::vec; -use alloc::vec::Vec; +#[cfg(feature = "alloc")] +use alloc::{vec, vec::Vec}; use core::mem::MaybeUninit; use core::ptr; @@ -342,6 +342,7 @@ pub struct PidInfo { /// - [FreeBSD: `procctl(PROC_REAP_GETPIDS,...)`] /// /// [FreeBSD: `procctl(PROC_REAP_GETPIDS,...)`]: https://man.freebsd.org/cgi/man.cgi?query=procctl&sektion=2 +#[cfg(feature = "alloc")] pub fn get_reaper_pids(process: ProcSelector) -> io::Result> { // Sadly no better way to guarantee that we get all the results than to // allocate ~8MB of memory.. diff --git a/vendor/rustix/src/procfs.rs b/vendor/rustix/src/procfs.rs index 38f091197..60a4b6c34 100644 --- a/vendor/rustix/src/procfs.rs +++ b/vendor/rustix/src/procfs.rs @@ -21,8 +21,8 @@ use crate::fd::{AsFd, BorrowedFd, OwnedFd}; use crate::ffi::CStr; use crate::fs::{ - fstat, fstatfs, major, openat, renameat, FileType, FsWord, Mode, OFlags, RawDir, Stat, CWD, - PROC_SUPER_MAGIC, + fstat, fstatfs, major, openat, renameat, seek, FileType, FsWord, Mode, OFlags, RawDir, + SeekFrom, Stat, CWD, PROC_SUPER_MAGIC, }; use crate::io; use crate::path::DecInt; @@ -488,6 +488,9 @@ fn open_and_check_file( let mut found_file = false; let mut found_dot = false; + // Position the directory iteration at the start. + seek(dir, SeekFrom::Start(0))?; + let mut buf = [MaybeUninit::uninit(); 2048]; let mut iter = RawDir::new(dir, &mut buf); while let Some(entry) = iter.next() { diff --git a/vendor/rustix/src/rand/getrandom.rs b/vendor/rustix/src/rand/getrandom.rs index 3fed0dd08..c7f117ad9 100644 --- a/vendor/rustix/src/rand/getrandom.rs +++ b/vendor/rustix/src/rand/getrandom.rs @@ -1,4 +1,8 @@ +#![allow(unsafe_code)] + +use crate::buffer::split_init; use crate::{backend, io}; +use core::mem::MaybeUninit; pub use backend::rand::types::GetRandomFlags; @@ -16,5 +20,24 @@ pub use backend::rand::types::GetRandomFlags; /// [Linux]: https://man7.org/linux/man-pages/man2/getrandom.2.html #[inline] pub fn getrandom(buf: &mut [u8], flags: GetRandomFlags) -> io::Result { - backend::rand::syscalls::getrandom(buf, flags) + unsafe { backend::rand::syscalls::getrandom(buf.as_mut_ptr(), buf.len(), flags) } +} + +/// `getrandom(buf, flags)`—Reads a sequence of random bytes. +/// +/// This is identical to [`getrandom`], except that it can read into +/// uninitialized memory. It returns the slice that was initialized by this +/// function and the slice that remains uninitialized. +#[inline] +pub fn getrandom_uninit( + buf: &mut [MaybeUninit], + flags: GetRandomFlags, +) -> io::Result<(&mut [u8], &mut [MaybeUninit])> { + // Get number of initialized bytes. + let length = unsafe { + backend::rand::syscalls::getrandom(buf.as_mut_ptr() as *mut u8, buf.len(), flags) + }; + + // Split into the initialized and uninitialized portions. + Ok(unsafe { split_init(buf, length?) }) } diff --git a/vendor/rustix/src/rand/mod.rs b/vendor/rustix/src/rand/mod.rs index e767c590d..ec4c11221 100644 --- a/vendor/rustix/src/rand/mod.rs +++ b/vendor/rustix/src/rand/mod.rs @@ -4,4 +4,4 @@ mod getrandom; #[cfg(linux_kernel)] -pub use getrandom::{getrandom, GetRandomFlags}; +pub use getrandom::{getrandom, getrandom_uninit, GetRandomFlags}; diff --git a/vendor/rustix/src/runtime.rs b/vendor/rustix/src/runtime.rs index 18315db64..bd3eed2b3 100644 --- a/vendor/rustix/src/runtime.rs +++ b/vendor/rustix/src/runtime.rs @@ -112,22 +112,6 @@ pub unsafe fn set_tid_address(data: *mut c_void) -> Pid { backend::runtime::syscalls::tls::set_tid_address(data) } -/// `prctl(PR_SET_NAME, name)` -/// -/// # References -/// - [Linux] -/// -/// # Safety -/// -/// This is a very low-level feature for implementing threading libraries. -/// See the references links above. -/// -/// [Linux]: https://man7.org/linux/man-pages/man2/prctl.2.html -#[inline] -pub unsafe fn set_thread_name(name: &CStr) -> io::Result<()> { - backend::runtime::syscalls::tls::set_thread_name(name) -} - #[cfg(linux_raw)] #[cfg(target_arch = "x86")] pub use backend::runtime::tls::UserDesc; diff --git a/vendor/rustix/src/stdio.rs b/vendor/rustix/src/stdio.rs index 278aba06c..99e118b35 100644 --- a/vendor/rustix/src/stdio.rs +++ b/vendor/rustix/src/stdio.rs @@ -146,9 +146,9 @@ pub unsafe fn take_stdin() -> OwnedFd { /// /// # Warning /// -/// This function allows reading directly from stdout without coordinating +/// This function allows writing directly to stdout without coordinating /// with the buffering performed by [`std::io::Stdout`], so it could cause -/// corrupted input. +/// corrupted output. /// /// # References /// - [POSIX] @@ -192,9 +192,9 @@ pub const fn stdout() -> BorrowedFd<'static> { /// /// # Warning /// -/// This function allows reading directly from stdout without coordinating +/// This function allows writing directly to stdout without coordinating /// with the buffering performed by [`std::io::Stdout`], so it could cause -/// corrupted input. +/// corrupted output. /// /// # References /// - [POSIX] diff --git a/vendor/rustix/src/termios/types.rs b/vendor/rustix/src/termios/types.rs index 720352442..57e9a5d20 100644 --- a/vendor/rustix/src/termios/types.rs +++ b/vendor/rustix/src/termios/types.rs @@ -85,7 +85,7 @@ impl Termios { /// Return the input communication speed. /// - /// Unlike the `c_ispeed` field in GLIBC and others, this returns the + /// Unlike the `c_ispeed` field in glibc and others, this returns the /// integer value of the speed, rather than the `B*` encoded constant /// value. #[doc(alias = "c_ispeed")] @@ -121,7 +121,7 @@ impl Termios { /// Return the output communication speed. /// - /// Unlike the `c_ospeed` field in GLIBC and others, this returns the + /// Unlike the `c_ospeed` field in glibc and others, this returns the /// arbitrary integer value of the speed, rather than the `B*` encoded /// constant value. #[inline] @@ -154,7 +154,7 @@ impl Termios { /// Set the input and output communication speeds. /// - /// Unlike the `c_ispeed` and `c_ospeed` fields in GLIBC and others, this + /// Unlike the `c_ispeed` and `c_ospeed` fields in glibc and others, this /// takes the arbitrary integer value of the speed, rather than the `B*` /// encoded constant value. Not all implementations support all integer /// values; use the constants in the [`speed`] module for likely-supported @@ -172,7 +172,7 @@ impl Termios { /// Set the input communication speed. /// - /// Unlike the `c_ispeed` field in GLIBC and others, this takes the + /// Unlike the `c_ispeed` field in glibc and others, this takes the /// arbitrary integer value of the speed, rather than the `B*` encoded /// constant value. Not all implementations support all integer values; use /// the constants in the [`speed`] module for known-supported speeds. @@ -190,7 +190,7 @@ impl Termios { /// Set the output communication speed. /// - /// Unlike the `c_ospeed` field in GLIBC and others, this takes the + /// Unlike the `c_ospeed` field in glibc and others, this takes the /// arbitrary integer value of the speed, rather than the `B*` encoded /// constant value. Not all implementations support all integer values; use /// the constants in the [`speed`] module for known-supported speeds. diff --git a/vendor/ryu/.cargo-checksum.json b/vendor/ryu/.cargo-checksum.json index a5d3a5c91..e64ba5b93 100644 --- a/vendor/ryu/.cargo-checksum.json +++ b/vendor/ryu/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"d8c23cf47b22f0772a437e1512b0b945ffcef6436de5c09d7f6a4e07e0fc04de","Cargo.toml":"caa22411e1b41329adc79e850e5406dd1875b3fd73c8cb8053806ee314dd8eb4","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-BOOST":"c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566","README.md":"df6a7a024b604ad98dd7603ad261150ef73a94a9de691bd5d2510e12a200021a","benches/bench.rs":"703521c8cb9c6959ee305776a9971d24754b6fff5c1737741be04f956a3692e8","examples/upstream_benchmark.rs":"f702d3598a8fac59134a8058ebf74ba90163b1f23ebbd6c5978a7bd8a888d357","src/buffer/mod.rs":"0db0bba7c39db07284592881e25bc1fdf5f40019376b0f83d37d706d849ffbdb","src/common.rs":"cae347e97fc30c50a964f80425e8c3e69ece2b8ab81f9b81b9baa7fcec64a001","src/d2s.rs":"83f821f17fd8d2cf72bcc47cc8c603ab24f2377db6cd0f08638031716f8dc17c","src/d2s_full_table.rs":"9b0186acbc6d65dc55c17e16125be707a2bfb920d22b35d33234b4cc38566a36","src/d2s_intrinsics.rs":"658d00a64ce2aca7f0780a1acc5939167e4a66d836b51c46de1047820992fec1","src/d2s_small_table.rs":"7b25cfbf0793d0662d83f5d92a9f880295652db9979b5acf702b313359996508","src/digit_table.rs":"02351ca54cb8cb3679f635115dd094f32fd91750e9f66103c1ee9ec3db507072","src/f2s.rs":"55320c2301680d8be3a908620cccd9d103b0cd3ad7a7d3378589e274ffc2587b","src/f2s_intrinsics.rs":"97bab98093838e30c60f5135f54f5ccb039ff7d9f35553ac8e74437743ca47e2","src/lib.rs":"8e47233142880b9dd60b4d518a5a0b2393e69d48f723346884279c7b59bbd0e1","src/parse.rs":"7f8aa7e007caf5dcb03abdc4238157724bb742d0823a3b8a01646fa1f1129154","src/pretty/exponent.rs":"6c9aa1c707c567ae338647056e37557a94e5120781ee9f6f64e9c7071ffb50d0","src/pretty/mantissa.rs":"5e8d0a6bfdfd04e599a9fc8aefd638e3288651279e870e7cd44820717c3b6438","src/pretty/mod.rs":"731798246d414ca54df739c212f1cb8e05991a0472a7a1c28771e24d7a1cf09b","src/s2d.rs":"2f572603eedaa9efbe864105999a1ceac8aa4ff4e1d2fbd96127692460194d16","src/s2f.rs":"6ae7430fba61f59aa6010d446f5c1043974b6fadb8e4c75ce2ad56f73ee48f4a","tests/common_test.rs":"275184cf366f80c11e5f33c2d53065a073e20d81bf71ca70478c89e47fb8da36","tests/d2s_table_test.rs":"54b3a7d40aa9bec03e9dc555d15fb4512ee16a16398b3098a97819fab50c81f3","tests/d2s_test.rs":"39014777edd6e3231095186174c4ef341fd9c12ecc5510765761713b6cac3bb4","tests/exhaustive.rs":"f475ed9008a2cd86ce95abb577a4b01e9fed23fc16f7e217ccffb3b834005fa0","tests/f2s_test.rs":"10940f005e73a42bb106ff498e7a6cc4665d04d82829fef8dc7d0eb36f574e6f","tests/macros/mod.rs":"8e90a674b3960f9516cb38f4eea0e0981ff902c3b33572ebdb6c5528d3ffa72c","tests/s2d_test.rs":"75c3a1044881718db65e05f25c9f6e1d005392dddb2e8dafb799668bb6a9a5c3","tests/s2f_test.rs":"1ec06646cb65229bfe866ec913901a0d8d736668f30b812fc4b00136a43f5142"},"package":"1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"} \ No newline at end of file +{"files":{"Cargo.lock":"bf05f9d2882172d0ced848ce2e28631c055b2102c2db2243aa7d4d4507624a9d","Cargo.toml":"c1299fe790cd356421da83744cf7a3c87285ae8b957af4ac8303b08b632ce11a","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-BOOST":"c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566","README.md":"86f0a92cf076f4983f99926607ea272c9650a5996fa3921fc5ca5abceb0f18db","benches/bench.rs":"703521c8cb9c6959ee305776a9971d24754b6fff5c1737741be04f956a3692e8","examples/upstream_benchmark.rs":"f702d3598a8fac59134a8058ebf74ba90163b1f23ebbd6c5978a7bd8a888d357","src/buffer/mod.rs":"e32f3fa7e994ff704796e58e115c5258e94a79a184d1608864772f2f2f5274fc","src/common.rs":"cae347e97fc30c50a964f80425e8c3e69ece2b8ab81f9b81b9baa7fcec64a001","src/d2s.rs":"83f821f17fd8d2cf72bcc47cc8c603ab24f2377db6cd0f08638031716f8dc17c","src/d2s_full_table.rs":"9b0186acbc6d65dc55c17e16125be707a2bfb920d22b35d33234b4cc38566a36","src/d2s_intrinsics.rs":"bbf15472f4299942312e80a992cbc2f47f85f17ed193f24084534434dbfb26e7","src/d2s_small_table.rs":"7b25cfbf0793d0662d83f5d92a9f880295652db9979b5acf702b313359996508","src/digit_table.rs":"02351ca54cb8cb3679f635115dd094f32fd91750e9f66103c1ee9ec3db507072","src/f2s.rs":"55320c2301680d8be3a908620cccd9d103b0cd3ad7a7d3378589e274ffc2587b","src/f2s_intrinsics.rs":"97bab98093838e30c60f5135f54f5ccb039ff7d9f35553ac8e74437743ca47e2","src/lib.rs":"560602c3cca66958b710f788aa4415b3de67293db3c41cb0b5083b59eac28c5b","src/parse.rs":"7f8aa7e007caf5dcb03abdc4238157724bb742d0823a3b8a01646fa1f1129154","src/pretty/exponent.rs":"6c9aa1c707c567ae338647056e37557a94e5120781ee9f6f64e9c7071ffb50d0","src/pretty/mantissa.rs":"5e8d0a6bfdfd04e599a9fc8aefd638e3288651279e870e7cd44820717c3b6438","src/pretty/mod.rs":"731798246d414ca54df739c212f1cb8e05991a0472a7a1c28771e24d7a1cf09b","src/s2d.rs":"2f572603eedaa9efbe864105999a1ceac8aa4ff4e1d2fbd96127692460194d16","src/s2f.rs":"6ae7430fba61f59aa6010d446f5c1043974b6fadb8e4c75ce2ad56f73ee48f4a","tests/common_test.rs":"275184cf366f80c11e5f33c2d53065a073e20d81bf71ca70478c89e47fb8da36","tests/d2s_intrinsics_test.rs":"15d11b70810bf04f33f8b185bf7f010a436a4edb47fa4648b1a036568c2c5d15","tests/d2s_table_test.rs":"54b3a7d40aa9bec03e9dc555d15fb4512ee16a16398b3098a97819fab50c81f3","tests/d2s_test.rs":"d72aaf37c76a4042ecc12b7d6faf844696016bb72bb20d142ecab3bd6c87e29f","tests/exhaustive.rs":"f475ed9008a2cd86ce95abb577a4b01e9fed23fc16f7e217ccffb3b834005fa0","tests/f2s_test.rs":"ad9e6fe46e712c488b876428c144c79bdff0349b41c57eee5506fc3c9c156624","tests/macros/mod.rs":"8e90a674b3960f9516cb38f4eea0e0981ff902c3b33572ebdb6c5528d3ffa72c","tests/s2d_test.rs":"75c3a1044881718db65e05f25c9f6e1d005392dddb2e8dafb799668bb6a9a5c3","tests/s2f_test.rs":"1ec06646cb65229bfe866ec913901a0d8d736668f30b812fc4b00136a43f5142"},"package":"f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"} \ No newline at end of file diff --git a/vendor/ryu/Cargo.lock b/vendor/ryu/Cargo.lock index 943a936d2..c52a439a8 100644 --- a/vendor/ryu/Cargo.lock +++ b/vendor/ryu/Cargo.lock @@ -21,21 +21,21 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "no-panic" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8161c7068adae143e7ff96fd09f0835b5cdf55fdf3ba3f5933bfc3ff557119f2" +checksum = "71a6d126424f5ce0bb4587ff4561421d44aeede520541cc66f1bb912506ae46a" dependencies = [ "proc-macro2", "quote", @@ -60,18 +60,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92de25114670a878b1261c79c9f8f729fb97e95bac93f6312f583c60dd6a1dfe" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5907a1b7c277254a8b15170f6e7c97cfa60ee7872a3217663bb81151e48184bb" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -117,7 +117,7 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" dependencies = [ "no-panic", "num_cpus", @@ -127,9 +127,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -138,9 +138,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "wasi" diff --git a/vendor/ryu/Cargo.toml b/vendor/ryu/Cargo.toml index ce298f4a2..a5c87c36f 100644 --- a/vendor/ryu/Cargo.toml +++ b/vendor/ryu/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.36" name = "ryu" -version = "1.0.15" +version = "1.0.16" authors = ["David Tolnay "] exclude = [ "performance.png", diff --git a/vendor/ryu/README.md b/vendor/ryu/README.md index 0abd71fe9..998ea3ef1 100644 --- a/vendor/ryu/README.md +++ b/vendor/ryu/README.md @@ -19,7 +19,7 @@ C, [https://github.com/ulfjack/ryu][upstream]. uses nothing from the Rust standard library so is usable from no_std crates.* [paper]: https://dl.acm.org/citation.cfm?id=3192369 -[upstream]: https://github.com/ulfjack/ryu/tree/abf76d252bc97300354857e64e80d4a2bf664291 +[upstream]: https://github.com/ulfjack/ryu/tree/77e767f5e056bab96e895072fc21618ecff2f44b ```toml [dependencies] diff --git a/vendor/ryu/src/buffer/mod.rs b/vendor/ryu/src/buffer/mod.rs index 27d34d974..905ee2f06 100644 --- a/vendor/ryu/src/buffer/mod.rs +++ b/vendor/ryu/src/buffer/mod.rs @@ -83,7 +83,7 @@ impl Copy for Buffer {} impl Clone for Buffer { #[inline] - #[allow(clippy::incorrect_clone_impl_on_copy_type)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 + #[allow(clippy::non_canonical_clone_impl)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 fn clone(&self) -> Self { Buffer::new() } diff --git a/vendor/ryu/src/d2s_intrinsics.rs b/vendor/ryu/src/d2s_intrinsics.rs index f244a4d03..a4e1fb11c 100644 --- a/vendor/ryu/src/d2s_intrinsics.rs +++ b/vendor/ryu/src/d2s_intrinsics.rs @@ -36,16 +36,16 @@ pub fn div100(x: u64) -> u64 { } #[cfg_attr(feature = "no-panic", inline)] -fn pow5_factor(mut value: u64) -> u32 { +pub(crate) fn pow5_factor(mut value: u64) -> u32 { + const M_INV_5: u64 = 14757395258967641293; // 5 * m_inv_5 = 1 (mod 2^64) + const N_DIV_5: u64 = 3689348814741910323; // #{ n | n = 0 (mod 2^64) } = 2^64 / 5 let mut count = 0u32; loop { debug_assert!(value != 0); - let q = div5(value); - let r = (value as u32).wrapping_sub(5u32.wrapping_mul(q as u32)); - if r != 0 { + value = value.wrapping_mul(M_INV_5); + if value > N_DIV_5 { break; } - value = q; count += 1; } count diff --git a/vendor/ryu/src/lib.rs b/vendor/ryu/src/lib.rs index e2b8b5431..cf3a73225 100644 --- a/vendor/ryu/src/lib.rs +++ b/vendor/ryu/src/lib.rs @@ -81,7 +81,7 @@ //! notation. #![no_std] -#![doc(html_root_url = "https://docs.rs/ryu/1.0.15")] +#![doc(html_root_url = "https://docs.rs/ryu/1.0.16")] #![allow( clippy::cast_lossless, clippy::cast_possible_truncation, @@ -95,6 +95,7 @@ clippy::missing_panics_doc, clippy::module_name_repetitions, clippy::must_use_candidate, + clippy::needless_doctest_main, clippy::similar_names, clippy::too_many_lines, clippy::unreadable_literal, diff --git a/vendor/ryu/tests/d2s_intrinsics_test.rs b/vendor/ryu/tests/d2s_intrinsics_test.rs new file mode 100644 index 000000000..0ac80c90b --- /dev/null +++ b/vendor/ryu/tests/d2s_intrinsics_test.rs @@ -0,0 +1,72 @@ +// Translated from C to Rust. The original C code can be found at +// https://github.com/ulfjack/ryu and carries the following license: +// +// Copyright 2018 Ulf Adams +// +// The contents of this file may be used under the terms of the Apache License, +// Version 2.0. +// +// (See accompanying file LICENSE-Apache or copy at +// http://www.apache.org/licenses/LICENSE-2.0) +// +// Alternatively, the contents of this file may be used under the terms of +// the Boost Software License, Version 1.0. +// (See accompanying file LICENSE-Boost or copy at +// https://www.boost.org/LICENSE_1_0.txt) +// +// Unless required by applicable law or agreed to in writing, this software +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. + +#![allow(dead_code)] +#![allow( + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::unreadable_literal +)] + +#[path = "../src/d2s_intrinsics.rs"] +mod d2s_intrinsics; + +use d2s_intrinsics::pow5_factor; + +#[test] +fn test_pow5_factor() { + assert_eq!(0, pow5_factor(1)); + assert_eq!(0, pow5_factor(2)); + assert_eq!(0, pow5_factor(3)); + assert_eq!(0, pow5_factor(4)); + assert_eq!(1, pow5_factor(5)); + assert_eq!(0, pow5_factor(6)); + assert_eq!(0, pow5_factor(7)); + assert_eq!(0, pow5_factor(8)); + assert_eq!(0, pow5_factor(9)); + assert_eq!(1, pow5_factor(10)); + + assert_eq!(0, pow5_factor(12)); + assert_eq!(0, pow5_factor(14)); + assert_eq!(0, pow5_factor(16)); + assert_eq!(0, pow5_factor(18)); + assert_eq!(1, pow5_factor(20)); + + assert_eq!(2, pow5_factor(5 * 5)); + assert_eq!(3, pow5_factor(5 * 5 * 5)); + assert_eq!(4, pow5_factor(5 * 5 * 5 * 5)); + assert_eq!(5, pow5_factor(5 * 5 * 5 * 5 * 5)); + assert_eq!(6, pow5_factor(5 * 5 * 5 * 5 * 5 * 5)); + assert_eq!(7, pow5_factor(5 * 5 * 5 * 5 * 5 * 5 * 5)); + assert_eq!(8, pow5_factor(5 * 5 * 5 * 5 * 5 * 5 * 5 * 5)); + assert_eq!(9, pow5_factor(5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5)); + assert_eq!(10, pow5_factor(5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5)); + + assert_eq!(0, pow5_factor(42)); + assert_eq!(1, pow5_factor(42 * 5)); + assert_eq!(2, pow5_factor(42 * 5 * 5)); + assert_eq!(3, pow5_factor(42 * 5 * 5 * 5)); + assert_eq!(4, pow5_factor(42 * 5 * 5 * 5 * 5)); + assert_eq!(5, pow5_factor(42 * 5 * 5 * 5 * 5 * 5)); + + assert_eq!(27, pow5_factor(7450580596923828125)); // 5^27, largest power of 5 < 2^64. + assert_eq!(1, pow5_factor(18446744073709551615)); // 2^64 - 1, largest multiple of 5 < 2^64. + assert_eq!(0, pow5_factor(18446744073709551614)); // 2^64 - 2, largest non-multiple of 5 < 2^64. +} diff --git a/vendor/ryu/tests/d2s_test.rs b/vendor/ryu/tests/d2s_test.rs index 368cab669..7e8eba62c 100644 --- a/vendor/ryu/tests/d2s_test.rs +++ b/vendor/ryu/tests/d2s_test.rs @@ -82,7 +82,8 @@ fn test_basic() { check!(-0.0); check!(1.0); check!(-1.0); - assert_eq!(pretty(f64::NAN), "NaN"); + assert_eq!(pretty(f64::NAN.copysign(1.0)), "NaN"); + assert_eq!(pretty(f64::NAN.copysign(-1.0)), "NaN"); assert_eq!(pretty(f64::INFINITY), "inf"); assert_eq!(pretty(f64::NEG_INFINITY), "-inf"); } diff --git a/vendor/ryu/tests/f2s_test.rs b/vendor/ryu/tests/f2s_test.rs index 927fa7e4b..d6249a3a8 100644 --- a/vendor/ryu/tests/f2s_test.rs +++ b/vendor/ryu/tests/f2s_test.rs @@ -75,7 +75,8 @@ fn test_basic() { check!(-0.0); check!(1.0); check!(-1.0); - assert_eq!(pretty(f32::NAN), "NaN"); + assert_eq!(pretty(f32::NAN.copysign(1.0)), "NaN"); + assert_eq!(pretty(f32::NAN.copysign(-1.0)), "NaN"); assert_eq!(pretty(f32::INFINITY), "inf"); assert_eq!(pretty(f32::NEG_INFINITY), "-inf"); } diff --git a/vendor/schannel/.cargo-checksum.json b/vendor/schannel/.cargo-checksum.json index cf5610f00..57282679d 100644 --- a/vendor/schannel/.cargo-checksum.json +++ b/vendor/schannel/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2a0bdfd86492b7dff4712e44ebeb9b5f3e6d436ee0973acde387265c247958b5","LICENSE.md":"aa72991ac35b4de0034da0afe943e62b48c4092fc2ba13ae47806d8e9a4ad551","README.md":"1356487328648f2e2ee621872cc0adb930d1f6929e587ceb1877ef3eb989fd44","src/alpn_list.rs":"1401fa57397540a42c3fa3b00c4bf901150b63d020a112d63ae56f17c241a98b","src/cert_chain.rs":"a09c6ca084b19a5ecd86b115454c4de7ce5e1146c747c6e25adec1af5ee4708d","src/cert_context.rs":"0d316a7d0ba2402beb10d7ba109dd7f147466ac649c6d44257c185a0e5655526","src/cert_store.rs":"b0fc57b5f1518bd2ce7796ed31287546443a1bb93c27484f1e52f1182ad926df","src/context_buffer.rs":"f6b667b55d8e6f4c1826519e9030066cd489399dca2d55bb927fe7f583f62715","src/crypt_key.rs":"1d0d8baeafbe30a2e43ff677fc8e707150306f92d13ede6692ba8d84dba9e0e4","src/crypt_prov.rs":"d79ae3ce338098e96d967462ec7123b02a66a9bbc18c31b791334a2a8bcf9321","src/ctl_context.rs":"0fabd379c98ac3325c357c0188a7eebd1036a10ce029e64b82a53e6ef19bb02e","src/key_handle.rs":"01e8b642db3759b3cb73c035a664404353a6b1d77f571b7591047a23d3163a1a","src/lib.rs":"17b4cd6e510e045d9ad56557e4e66b9a2d39a18111840ea3cc970674f106ae2e","src/ncrypt_key.rs":"25d08cdb4c9337cfe3983c4381a95536c2fc24b7aeb8df23ddf4367ad9e17943","src/schannel_cred.rs":"78a16c66da5a673b3432a6f88c2baa2489c8d783d398b4ef0ec962fb854c354d","src/security_context.rs":"dba9600184d526e6a1dd582e1fcf66658fe8dcc707b6997692e7f85078beffd3","src/test.rs":"6c9671327bfb1651d959995799319b204311d0017711333ca19364640afdc1d0","src/tls_stream.rs":"0a739e92fa0ca9ca1b21d6eb48729327acd8cadb49da9fea13c92be5f7c33dff","test/cert.der":"4712b939fbcb42a6b5101b42139a25b14f81b418facabd378746f12f85cc6544","test/cert.pem":"53c8b338be254490c71a6b13da90dc5a59ba596587c548be5673657e04824afb","test/identity.p12":"aceeb3e5516471bd5af9a44bbeffc9559c4f228f67c677d29f36a4b368e2779f","test/key.key":"e8842cd6674b5c77a83e0283cd876a91de404561dfc86d79ce525f6e55b28197","test/key.pem":"12d9105a92bf39b615ccb4820c5c1e38c61905483cd30be13f9ab99b98af64ed","test/key_invalid_header.pem":"51fa9ddc23eb52859bcf40c894e9dcc08190ffcee6e6d9785e85e5d8ece2d1e8","test/key_no_end_header.pem":"240e98a15ba0bf4bfff402dfa17d1c276e5cfa635659d56d10db71c757f86491","test/key_no_headers.pem":"56d0371fdbda5bcd73a1ba5eeeffd3f354d6782e96096666a5e1613fa42d3249","test/key_wrong_header.pem":"a32ed1557e084130fa68a797a44ce46ab4c918e587dad938054a6db2d27241bf","test/self-signed.badssl.com.cer":"ed2b3ebf8efef22414afdf44db397b8ff9cc70685e67257db3422438acacc9c5","update_test_cert.bat":"415c8c90cdc144c08960aca2b30356bf3112dcf1a88afac107fc66f5348d76bc"},"package":"0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88"} \ No newline at end of file +{"files":{"Cargo.toml":"4ecd98bf626ab7dd4c0d07feb48541f5a1d094c75160eac8acc5bc4cd44f7053","LICENSE.md":"aa72991ac35b4de0034da0afe943e62b48c4092fc2ba13ae47806d8e9a4ad551","README.md":"1356487328648f2e2ee621872cc0adb930d1f6929e587ceb1877ef3eb989fd44","src/alpn_list.rs":"1401fa57397540a42c3fa3b00c4bf901150b63d020a112d63ae56f17c241a98b","src/cert_chain.rs":"a09c6ca084b19a5ecd86b115454c4de7ce5e1146c747c6e25adec1af5ee4708d","src/cert_context.rs":"0d316a7d0ba2402beb10d7ba109dd7f147466ac649c6d44257c185a0e5655526","src/cert_store.rs":"88e9b4e8b7b8109baf2c96612965d7fe249aa6513ed75a4dd3d243298f900a29","src/context_buffer.rs":"f6b667b55d8e6f4c1826519e9030066cd489399dca2d55bb927fe7f583f62715","src/crypt_key.rs":"1d0d8baeafbe30a2e43ff677fc8e707150306f92d13ede6692ba8d84dba9e0e4","src/crypt_prov.rs":"77284f20aeac4faa3747ef156b1e4ffe0b2e994229e975392a2d624936660dc9","src/ctl_context.rs":"0fabd379c98ac3325c357c0188a7eebd1036a10ce029e64b82a53e6ef19bb02e","src/key_handle.rs":"01e8b642db3759b3cb73c035a664404353a6b1d77f571b7591047a23d3163a1a","src/lib.rs":"17b4cd6e510e045d9ad56557e4e66b9a2d39a18111840ea3cc970674f106ae2e","src/ncrypt_key.rs":"25d08cdb4c9337cfe3983c4381a95536c2fc24b7aeb8df23ddf4367ad9e17943","src/schannel_cred.rs":"78a16c66da5a673b3432a6f88c2baa2489c8d783d398b4ef0ec962fb854c354d","src/security_context.rs":"dba9600184d526e6a1dd582e1fcf66658fe8dcc707b6997692e7f85078beffd3","src/test.rs":"6c9671327bfb1651d959995799319b204311d0017711333ca19364640afdc1d0","src/tls_stream.rs":"0a739e92fa0ca9ca1b21d6eb48729327acd8cadb49da9fea13c92be5f7c33dff","test/cert.der":"4712b939fbcb42a6b5101b42139a25b14f81b418facabd378746f12f85cc6544","test/cert.pem":"53c8b338be254490c71a6b13da90dc5a59ba596587c548be5673657e04824afb","test/identity.p12":"aceeb3e5516471bd5af9a44bbeffc9559c4f228f67c677d29f36a4b368e2779f","test/key.key":"e8842cd6674b5c77a83e0283cd876a91de404561dfc86d79ce525f6e55b28197","test/key.pem":"12d9105a92bf39b615ccb4820c5c1e38c61905483cd30be13f9ab99b98af64ed","test/key_invalid_header.pem":"51fa9ddc23eb52859bcf40c894e9dcc08190ffcee6e6d9785e85e5d8ece2d1e8","test/key_no_end_header.pem":"240e98a15ba0bf4bfff402dfa17d1c276e5cfa635659d56d10db71c757f86491","test/key_no_headers.pem":"56d0371fdbda5bcd73a1ba5eeeffd3f354d6782e96096666a5e1613fa42d3249","test/key_wrong_header.pem":"a32ed1557e084130fa68a797a44ce46ab4c918e587dad938054a6db2d27241bf","test/self-signed.badssl.com.cer":"3d9bf78f767de7497609399aa6356e9adc2a47ce756ffe09b9fa33be8d7616c7","test/self-signed.badssl.com.cer.sha1":"5bb59738589ba2c65e0b079e1465e27f84b8c669e15978fdddfcdf45c8d8501c","update_test_cert.bat":"415c8c90cdc144c08960aca2b30356bf3112dcf1a88afac107fc66f5348d76bc"},"package":"fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534"} \ No newline at end of file diff --git a/vendor/schannel/Cargo.toml b/vendor/schannel/Cargo.toml index b404bb48c..0e7c6d8d5 100644 --- a/vendor/schannel/Cargo.toml +++ b/vendor/schannel/Cargo.toml @@ -11,8 +11,9 @@ [package] edition = "2018" +rust-version = "1.56.0" name = "schannel" -version = "0.1.22" +version = "0.1.23" authors = [ "Steven Fackler ", "Steffen Butzer ", @@ -34,7 +35,7 @@ repository = "https://github.com/steffengy/schannel-rs" default-target = "x86_64-pc-windows-msvc" [dependencies.windows-sys] -version = "0.48" +version = "0.52" features = [ "Win32_Foundation", "Win32_Security_Cryptography", @@ -44,7 +45,7 @@ features = [ ] [dev-dependencies.windows-sys] -version = "0.48" +version = "0.52" features = [ "Win32_System_SystemInformation", "Win32_System_Time", diff --git a/vendor/schannel/src/cert_store.rs b/vendor/schannel/src/cert_store.rs index 484eaab9e..2ba37d048 100644 --- a/vendor/schannel/src/cert_store.rs +++ b/vendor/schannel/src/cert_store.rs @@ -314,6 +314,14 @@ impl PfxImportOptions { ) } + /// If set, the private key in the archive will be exportable. + pub fn exportable_private_key( + &mut self, + exportable_private_key: bool, + ) -> &mut PfxImportOptions { + self.flag(Cryptography::CRYPT_EXPORTABLE, exportable_private_key) + } + fn flag(&mut self, flag: u32, set: bool) -> &mut PfxImportOptions { if set { self.flags |= flag; @@ -323,6 +331,11 @@ impl PfxImportOptions { self } + /// If set, the private keys are stored under the local computer and not under the current user. + pub fn machine_keyset(&mut self, machine_keyset: bool) -> &mut PfxImportOptions { + self.flag(Cryptography::CRYPT_MACHINE_KEYSET, machine_keyset) + } + /// Imports certificates from a PKCS #12 archive, returning a `CertStore` containing them. pub fn import(&self, data: &[u8]) -> io::Result { unsafe { diff --git a/vendor/schannel/src/crypt_prov.rs b/vendor/schannel/src/crypt_prov.rs index 9e5cd0ce4..5c383ba43 100644 --- a/vendor/schannel/src/crypt_prov.rs +++ b/vendor/schannel/src/crypt_prov.rs @@ -5,7 +5,7 @@ use std::ptr; use std::slice; use windows_sys::Win32::Security::Cryptography; -use windows_sys::Win32::System::Memory; +use windows_sys::Win32::Foundation; use crate::crypt_key::CryptKey; use crate::Inner; @@ -204,7 +204,7 @@ impl<'a> ImportOptions<'a> { let mut key = 0; let res = Cryptography::CryptImportKey(self.prov.0, buf, len, 0, self.flags, &mut key); - Memory::LocalFree(buf as isize); + Foundation::LocalFree(buf as *mut _); if res != 0 { Ok(CryptKey::from_inner(key)) @@ -239,7 +239,7 @@ impl<'a> ImportOptions<'a> { let pkey = pkey.PrivateKey; let res = self.import(slice::from_raw_parts(pkey.pbData, pkey.cbData as usize)); - Memory::LocalFree(buf as isize); + Foundation::LocalFree(buf as *mut _); res } } diff --git a/vendor/schannel/test/self-signed.badssl.com.cer b/vendor/schannel/test/self-signed.badssl.com.cer index a561d7e80..f61865e9c 100644 Binary files a/vendor/schannel/test/self-signed.badssl.com.cer and b/vendor/schannel/test/self-signed.badssl.com.cer differ diff --git a/vendor/schannel/test/self-signed.badssl.com.cer.sha1 b/vendor/schannel/test/self-signed.badssl.com.cer.sha1 new file mode 100644 index 000000000..90d59848f Binary files /dev/null and b/vendor/schannel/test/self-signed.badssl.com.cer.sha1 differ diff --git a/vendor/serde/.cargo-checksum.json b/vendor/serde/.cargo-checksum.json index 4abb3465d..eb8683044 100644 --- a/vendor/serde/.cargo-checksum.json +++ b/vendor/serde/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"931117d542e190ad20b9c984a357c900c39fe8d59df2c229b6e3a711622a98c8","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","build.rs":"f9ba30324b9ce085c903595fb55a5293f8c2348ff36bfe870521b935ae6d105c","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/de/format.rs":"c85071b016df643b161859682d21ce34fa0ebf2a3bdbeeea69859da48f5d934f","src/de/ignored_any.rs":"6480f2b2a83dc4764d01b2eec7309729eef2492eede2e5ee98d23a60b05198eb","src/de/impls.rs":"2857d734176a0b78a41c9358354b0b0b83c6b2d948590be072d98606a8cae9d6","src/de/mod.rs":"07cbf58cc8f45d8009558adfed7f7340ea68ad9296bb79d7c4a872ae1a635d09","src/de/seed.rs":"045d890712a04eb33ffc5a021e5d948a63c89402b8ffeea749df2171b7484f8f","src/de/size_hint.rs":"fff83dc39d30e75e8e611991f9c5399188a1aad23a6462dbca2c8b62655cfedb","src/de/value.rs":"5d8dcae3a98a2203f2c0934adb84dbf741f120f246dfc02aa6d0d10673dc39c7","src/integer128.rs":"29ef30b7d94507b34807090e68173767cdc7aff62edccd38affe69e75338dddc","src/lib.rs":"45e8ba8590fc9e78a7bd0bbfac14cdb1eeea5cb16f920997e0efc10e0b55e540","src/macros.rs":"e3486ef4a9a4ed1b27234aa1817ccb25ec0eb026ffc95e2c71c7b917f1f45629","src/private/de.rs":"6557a124fdaf61f9c7cd80163e40f4a453354e45b63a4eb55dafdfe0159f6881","src/private/doc.rs":"9ad740e9ea2eedf861b77116eda9a6fb74bc8553541cd17d1bc5791a3ef3271a","src/private/mod.rs":"b8f0c348621d91dd9da3db83d8877e70bc61ad0a2dc2d6fb57c6fc2c2cbafa26","src/private/ser.rs":"656613691bd8d40cb70a52d4ebe3ee96a993c8a1292d50822d9ca5bdad84426b","src/ser/fmt.rs":"77a5583e5c227ea1982b097ed6378af5c899d43761d71e33440262fd35944695","src/ser/impls.rs":"850619164b399c37cd373d24f5a2c83453f40b34bb978c5722d2c1ae226775b5","src/ser/impossible.rs":"e11b37689ec1395378d546fce74221ca9046d0761744301f12029102fd07e30e","src/ser/mod.rs":"e95dabf07216136440d6a2822cf37775f583d141c21d1b37ec9c55ae2a5024ab","src/std_error.rs":"25a07149e2e468747ffa5a58051c7f93d7b3c0fa0372f012a96c97ec8ab03b97"},"package":"25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"} \ No newline at end of file +{"files":{"Cargo.toml":"ec6cdb1cc534d43790f984793760065b0bbd8e79df331e404d713e705a458eb5","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"731c044fc5f98b37a89e9049c9214267db98763309cb63146b45c029640f82a3","build.rs":"f9ba30324b9ce085c903595fb55a5293f8c2348ff36bfe870521b935ae6d105c","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/de/format.rs":"c85071b016df643b161859682d21ce34fa0ebf2a3bdbeeea69859da48f5d934f","src/de/ignored_any.rs":"6480f2b2a83dc4764d01b2eec7309729eef2492eede2e5ee98d23a60b05198eb","src/de/impls.rs":"2857d734176a0b78a41c9358354b0b0b83c6b2d948590be072d98606a8cae9d6","src/de/mod.rs":"e9c99675422108c95b05b966a5cab139a0fec04f0df6e680176ea3e2fcbfb81e","src/de/seed.rs":"045d890712a04eb33ffc5a021e5d948a63c89402b8ffeea749df2171b7484f8f","src/de/size_hint.rs":"fff83dc39d30e75e8e611991f9c5399188a1aad23a6462dbca2c8b62655cfedb","src/de/value.rs":"5d8dcae3a98a2203f2c0934adb84dbf741f120f246dfc02aa6d0d10673dc39c7","src/integer128.rs":"29ef30b7d94507b34807090e68173767cdc7aff62edccd38affe69e75338dddc","src/lib.rs":"066bc82d79f37363fac0e6432c9d92edc4978c1fc68a8e5ec1212b5e24441267","src/macros.rs":"e3486ef4a9a4ed1b27234aa1817ccb25ec0eb026ffc95e2c71c7b917f1f45629","src/private/de.rs":"6557a124fdaf61f9c7cd80163e40f4a453354e45b63a4eb55dafdfe0159f6881","src/private/doc.rs":"9ad740e9ea2eedf861b77116eda9a6fb74bc8553541cd17d1bc5791a3ef3271a","src/private/mod.rs":"b8f0c348621d91dd9da3db83d8877e70bc61ad0a2dc2d6fb57c6fc2c2cbafa26","src/private/ser.rs":"656613691bd8d40cb70a52d4ebe3ee96a993c8a1292d50822d9ca5bdad84426b","src/ser/fmt.rs":"77a5583e5c227ea1982b097ed6378af5c899d43761d71e33440262fd35944695","src/ser/impls.rs":"850619164b399c37cd373d24f5a2c83453f40b34bb978c5722d2c1ae226775b5","src/ser/impossible.rs":"e11b37689ec1395378d546fce74221ca9046d0761744301f12029102fd07e30e","src/ser/mod.rs":"a7fd082203d63cbe4f0fe86d9be16bf4f3b2444653dac6bb61d82e0f4f6b4214","src/std_error.rs":"25a07149e2e468747ffa5a58051c7f93d7b3c0fa0372f012a96c97ec8ab03b97"},"package":"870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32"} \ No newline at end of file diff --git a/vendor/serde/Cargo.toml b/vendor/serde/Cargo.toml index f9f9f1a92..e49dbeab1 100644 --- a/vendor/serde/Cargo.toml +++ b/vendor/serde/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "serde" -version = "1.0.193" +version = "1.0.196" authors = [ "Erick Tryzelaar ", "David Tolnay ", @@ -74,4 +74,4 @@ std = [] unstable = [] [target."cfg(any())".dependencies.serde_derive] -version = "=1.0.193" +version = "=1.0.196" diff --git a/vendor/serde/README.md b/vendor/serde/README.md index 477fd3647..31292944a 100644 --- a/vendor/serde/README.md +++ b/vendor/serde/README.md @@ -1,11 +1,11 @@ -# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.31+]][Rust 1.31] [![serde_derive: rustc 1.56+]][Rust 1.56] +# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.31] [![serde_derive msrv]][Rust 1.56] [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster [Latest Version]: https://img.shields.io/crates/v/serde.svg [crates.io]: https://crates.io/crates/serde -[serde: rustc 1.31+]: https://img.shields.io/badge/serde-rustc_1.31+-lightgray.svg -[serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg +[serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray +[serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray [Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html [Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html diff --git a/vendor/serde/src/de/mod.rs b/vendor/serde/src/de/mod.rs index c22ed070b..6efeaaeec 100644 --- a/vendor/serde/src/de/mod.rs +++ b/vendor/serde/src/de/mod.rs @@ -64,8 +64,8 @@ //! - RefCell\ //! - Mutex\ //! - RwLock\ -//! - Rc\ *(if* features = ["rc"] *is enabled)* -//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - Rc\ *(if* features = \["rc"\] *is enabled)* +//! - Arc\ *(if* features = \["rc"\] *is enabled)* //! - **Collection types**: //! - BTreeMap\ //! - BTreeSet\ @@ -402,7 +402,7 @@ impl<'a> fmt::Display for Unexpected<'a> { Bool(b) => write!(formatter, "boolean `{}`", b), Unsigned(i) => write!(formatter, "integer `{}`", i), Signed(i) => write!(formatter, "integer `{}`", i), - Float(f) => write!(formatter, "floating point `{}`", f), + Float(f) => write!(formatter, "floating point `{}`", WithDecimalPoint(f)), Char(c) => write!(formatter, "character `{}`", c), Str(s) => write!(formatter, "string {:?}", s), Bytes(_) => write!(formatter, "byte array"), @@ -2290,3 +2290,36 @@ impl Display for OneOf { } } } + +struct WithDecimalPoint(f64); + +impl Display for WithDecimalPoint { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + struct LookForDecimalPoint<'f, 'a> { + formatter: &'f mut fmt::Formatter<'a>, + has_decimal_point: bool, + } + + impl<'f, 'a> fmt::Write for LookForDecimalPoint<'f, 'a> { + fn write_str(&mut self, fragment: &str) -> fmt::Result { + self.has_decimal_point |= fragment.contains('.'); + self.formatter.write_str(fragment) + } + + fn write_char(&mut self, ch: char) -> fmt::Result { + self.has_decimal_point |= ch == '.'; + self.formatter.write_char(ch) + } + } + + let mut writer = LookForDecimalPoint { + formatter, + has_decimal_point: false, + }; + tri!(write!(writer, "{}", self.0)); + if !writer.has_decimal_point { + tri!(formatter.write_str(".0")); + } + Ok(()) + } +} diff --git a/vendor/serde/src/lib.rs b/vendor/serde/src/lib.rs index b9fbefed4..5eb44311d 100644 --- a/vendor/serde/src/lib.rs +++ b/vendor/serde/src/lib.rs @@ -95,7 +95,7 @@ //////////////////////////////////////////////////////////////////////////////// // Serde types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/serde/1.0.193")] +#![doc(html_root_url = "https://docs.rs/serde/1.0.196")] // Support using Serde without the standard library! #![cfg_attr(not(feature = "std"), no_std)] // Show which crate feature enables conditionally compiled APIs in documentation. @@ -122,7 +122,6 @@ // things are often more readable this way clippy::cast_lossless, clippy::module_name_repetitions, - clippy::option_if_let_else, clippy::single_match_else, clippy::type_complexity, clippy::use_self, @@ -183,7 +182,7 @@ mod lib { pub use self::core::cmp::Reverse; pub use self::core::convert::{self, From, Into}; pub use self::core::default::{self, Default}; - pub use self::core::fmt::{self, Debug, Display}; + pub use self::core::fmt::{self, Debug, Display, Write as FmtWrite}; pub use self::core::marker::{self, PhantomData}; pub use self::core::num::Wrapping; pub use self::core::ops::{Bound, Range, RangeFrom, RangeInclusive, RangeTo}; diff --git a/vendor/serde/src/ser/mod.rs b/vendor/serde/src/ser/mod.rs index f1820c20a..75c45140e 100644 --- a/vendor/serde/src/ser/mod.rs +++ b/vendor/serde/src/ser/mod.rs @@ -61,8 +61,8 @@ //! - RefCell\ //! - Mutex\ //! - RwLock\ -//! - Rc\ *(if* features = ["rc"] *is enabled)* -//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - Rc\ *(if* features = \["rc"\] *is enabled)* +//! - Arc\ *(if* features = \["rc"\] *is enabled)* //! - **Collection types**: //! - BTreeMap\ //! - BTreeSet\ diff --git a/vendor/serde_derive/.cargo-checksum.json b/vendor/serde_derive/.cargo-checksum.json index fc12fe767..0f9645ec7 100644 --- a/vendor/serde_derive/.cargo-checksum.json +++ b/vendor/serde_derive/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"e1855acc71acc2ca2c973f774d5942b647b954cfcc509832e828e22d7cb96cfa","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c3ece10a36d19b4e857a770eaf74a2164d220f55fa11947065a3898c1697ecef","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/bound.rs":"1b4504ae82ec3dc287eeb4262a57380af484f483c1d6b6c8ebb121370fda135a","src/de.rs":"c221ab2b94a5d80dccff74a37f3448b3d695656552b452595dc289c73b12fb2b","src/dummy.rs":"9533dfee23f20d92ea75734c739022820c2787ded0d54f459feacdeb770ec912","src/fragment.rs":"6757cb4c3131d4300f093572efc273c4ab5a20e3e1efb54a311dcfa52d0bd6eb","src/internals/ast.rs":"7dc997e4090033bbd1d0bdd870e8bb87b096b7f66cfd02047f6b85ebdd569b12","src/internals/attr.rs":"7ec05ffad5b049ba2c91cfb9eedc5d472030682d9c8bcd81040f646525dcc7cd","src/internals/case.rs":"10c8dda2b32d8c6c6b63cf09cdc63d02375af7e95ecefe8fecb34f93b65191bb","src/internals/check.rs":"d842eb9912fd29311060b67f3bc62c438eb7b5d86093355acb4de7eee02a0ef8","src/internals/ctxt.rs":"83a4e6fbe0e439d578478883594407e03f2f340541be479bdf0b04a202633a37","src/internals/mod.rs":"ed021ca635c18132a0e5c3d90f21b7f65def0a61e946421a30200b5b9ab6ad43","src/internals/receiver.rs":"105d72145d1e6a45cdccee3694fcba599ece59194d2e070e8c5669c6f18c81da","src/internals/respan.rs":"899753859c58ce5f532a3ec4584796a52f13ed5a0533191e48c953ba5c1b52ff","src/internals/symbol.rs":"d619e88caa3c7a09b03014257f2b349ee922290062d9b97b4dd19d0e64532690","src/lib.rs":"9b755f1f68c5e18fb7be0ab32dd56dd4be2f919826fe1a9d3830c01a23662e52","src/pretend.rs":"2c79785bc42e975534d7d88c04b46377cefd3db948b63a32234707531c55b099","src/ser.rs":"e3341471cea9d7e2fb4043e5d1746862beb9a4e25196170879eeac529d460920","src/this.rs":"87818dc80cbb521b51938a653d09daf10aafc220bb10425948de82ad670fcb85"},"package":"43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"} \ No newline at end of file +{"files":{"Cargo.toml":"89681412374653ed5e3e986c9391e295891b66ef3790c3ab057a59487aa41657","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"731c044fc5f98b37a89e9049c9214267db98763309cb63146b45c029640f82a3","crates-io.md":"56e988ac4944c45f5bf5051e3827892ed8fb817853d99d9df1fff6621108e270","src/bound.rs":"6c5c20785ac95af9480f8d0de35a7e844cc36a16012f6468db148acd03cb15c2","src/de.rs":"c221ab2b94a5d80dccff74a37f3448b3d695656552b452595dc289c73b12fb2b","src/dummy.rs":"9533dfee23f20d92ea75734c739022820c2787ded0d54f459feacdeb770ec912","src/fragment.rs":"6757cb4c3131d4300f093572efc273c4ab5a20e3e1efb54a311dcfa52d0bd6eb","src/internals/ast.rs":"7dc997e4090033bbd1d0bdd870e8bb87b096b7f66cfd02047f6b85ebdd569b12","src/internals/attr.rs":"6584c0a02de0d17993877303f3cc2c1bccf235257632220421f98082d82d387a","src/internals/case.rs":"10c8dda2b32d8c6c6b63cf09cdc63d02375af7e95ecefe8fecb34f93b65191bb","src/internals/check.rs":"d842eb9912fd29311060b67f3bc62c438eb7b5d86093355acb4de7eee02a0ef8","src/internals/ctxt.rs":"83a4e6fbe0e439d578478883594407e03f2f340541be479bdf0b04a202633a37","src/internals/mod.rs":"ed021ca635c18132a0e5c3d90f21b7f65def0a61e946421a30200b5b9ab6ad43","src/internals/receiver.rs":"fe8a480669511b5edcfe71f5dd290cf72ccec54c9016ec85f2ac59dce538077f","src/internals/respan.rs":"899753859c58ce5f532a3ec4584796a52f13ed5a0533191e48c953ba5c1b52ff","src/internals/symbol.rs":"d619e88caa3c7a09b03014257f2b349ee922290062d9b97b4dd19d0e64532690","src/lib.rs":"5d3ed3e8d5d415ec9a98029949f60476aae21e6d6d71b68097eaac79c02a1c1a","src/pretend.rs":"7facc10a5b805564dd95735ae11118ec17ca6adcc49a59764e7c920e27b9fc4a","src/ser.rs":"e3341471cea9d7e2fb4043e5d1746862beb9a4e25196170879eeac529d460920","src/this.rs":"87818dc80cbb521b51938a653d09daf10aafc220bb10425948de82ad670fcb85"},"package":"33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67"} \ No newline at end of file diff --git a/vendor/serde_derive/Cargo.toml b/vendor/serde_derive/Cargo.toml index eda2a43d4..ff3681dd8 100644 --- a/vendor/serde_derive/Cargo.toml +++ b/vendor/serde_derive/Cargo.toml @@ -12,7 +12,7 @@ [package] rust-version = "1.56" name = "serde_derive" -version = "1.0.193" +version = "1.0.196" authors = [ "Erick Tryzelaar ", "David Tolnay ", @@ -43,13 +43,25 @@ name = "serde_derive" proc-macro = true [dependencies.proc-macro2] -version = "1.0" +version = "1.0.74" +features = ["proc-macro"] +default-features = false [dependencies.quote] -version = "1.0" +version = "1.0.35" +features = ["proc-macro"] +default-features = false [dependencies.syn] -version = "2.0.28" +version = "2.0.46" +features = [ + "clone-impls", + "derive", + "parsing", + "printing", + "proc-macro", +] +default-features = false [dev-dependencies.serde] version = "1" diff --git a/vendor/serde_derive/README.md b/vendor/serde_derive/README.md index 477fd3647..31292944a 100644 --- a/vendor/serde_derive/README.md +++ b/vendor/serde_derive/README.md @@ -1,11 +1,11 @@ -# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.31+]][Rust 1.31] [![serde_derive: rustc 1.56+]][Rust 1.56] +# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.31] [![serde_derive msrv]][Rust 1.56] [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster [Latest Version]: https://img.shields.io/crates/v/serde.svg [crates.io]: https://crates.io/crates/serde -[serde: rustc 1.31+]: https://img.shields.io/badge/serde-rustc_1.31+-lightgray.svg -[serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg +[serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray +[serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray [Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html [Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html diff --git a/vendor/serde_derive/src/bound.rs b/vendor/serde_derive/src/bound.rs index dd51e6898..fe8ccfff5 100644 --- a/vendor/serde_derive/src/bound.rs +++ b/vendor/serde_derive/src/bound.rs @@ -144,6 +144,7 @@ pub fn with_bound( fn visit_type(&mut self, ty: &'ast syn::Type) { match ty { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] syn::Type::Array(ty) => self.visit_type(&ty.elem), syn::Type::BareFn(ty) => { for arg in &ty.inputs { @@ -181,7 +182,6 @@ pub fn with_bound( syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } @@ -196,16 +196,13 @@ pub fn with_bound( syn::PathArguments::AngleBracketed(arguments) => { for arg in &arguments.args { match arg { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] syn::GenericArgument::Type(arg) => self.visit_type(arg), syn::GenericArgument::AssocType(arg) => self.visit_type(&arg.ty), syn::GenericArgument::Lifetime(_) | syn::GenericArgument::Const(_) | syn::GenericArgument::AssocConst(_) | syn::GenericArgument::Constraint(_) => {} - #[cfg_attr( - all(test, exhaustive), - deny(non_exhaustive_omitted_patterns) - )] _ => {} } } @@ -228,9 +225,9 @@ pub fn with_bound( fn visit_type_param_bound(&mut self, bound: &'ast syn::TypeParamBound) { match bound { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] syn::TypeParamBound::Trait(bound) => self.visit_path(&bound.path), syn::TypeParamBound::Lifetime(_) | syn::TypeParamBound::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } diff --git a/vendor/serde_derive/src/internals/attr.rs b/vendor/serde_derive/src/internals/attr.rs index 0b25c7c0d..bb9de328a 100644 --- a/vendor/serde_derive/src/internals/attr.rs +++ b/vendor/serde_derive/src/internals/attr.rs @@ -1794,6 +1794,7 @@ fn borrowable_lifetimes( fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet) { match ty { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] syn::Type::Slice(ty) => { collect_lifetimes(&ty.elem, out); } @@ -1829,7 +1830,10 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet) { syn::GenericArgument::AssocType(binding) => { collect_lifetimes(&binding.ty, out); } - _ => {} + syn::GenericArgument::Const(_) + | syn::GenericArgument::AssocConst(_) + | syn::GenericArgument::Constraint(_) + | _ => {} } } } @@ -1851,7 +1855,6 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet) { | syn::Type::Infer(_) | syn::Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } diff --git a/vendor/serde_derive/src/internals/receiver.rs b/vendor/serde_derive/src/internals/receiver.rs index 6273dfece..fa2a77d24 100644 --- a/vendor/serde_derive/src/internals/receiver.rs +++ b/vendor/serde_derive/src/internals/receiver.rs @@ -107,6 +107,7 @@ impl ReplaceReceiver<'_> { fn visit_type_mut_impl(&mut self, ty: &mut Type) { match ty { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] Type::Array(ty) => { self.visit_type_mut(&mut ty.elem); self.visit_expr_mut(&mut ty.len); @@ -147,7 +148,6 @@ impl ReplaceReceiver<'_> { Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } @@ -178,13 +178,13 @@ impl ReplaceReceiver<'_> { PathArguments::AngleBracketed(arguments) => { for arg in &mut arguments.args { match arg { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] GenericArgument::Type(arg) => self.visit_type_mut(arg), GenericArgument::AssocType(arg) => self.visit_type_mut(&mut arg.ty), GenericArgument::Lifetime(_) | GenericArgument::Const(_) | GenericArgument::AssocConst(_) | GenericArgument::Constraint(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } @@ -207,9 +207,9 @@ impl ReplaceReceiver<'_> { fn visit_type_param_bound_mut(&mut self, bound: &mut TypeParamBound) { match bound { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] TypeParamBound::Trait(bound) => self.visit_path_mut(&mut bound.path), TypeParamBound::Lifetime(_) | TypeParamBound::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } @@ -228,6 +228,7 @@ impl ReplaceReceiver<'_> { if let Some(where_clause) = &mut generics.where_clause { for predicate in &mut where_clause.predicates { match predicate { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] WherePredicate::Type(predicate) => { self.visit_type_mut(&mut predicate.bounded_ty); for bound in &mut predicate.bounds { @@ -235,7 +236,6 @@ impl ReplaceReceiver<'_> { } } WherePredicate::Lifetime(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } diff --git a/vendor/serde_derive/src/lib.rs b/vendor/serde_derive/src/lib.rs index dba48d4eb..db21f54b3 100644 --- a/vendor/serde_derive/src/lib.rs +++ b/vendor/serde_derive/src/lib.rs @@ -13,7 +13,7 @@ //! //! [https://serde.rs/derive.html]: https://serde.rs/derive.html -#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.193")] +#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.196")] // Ignored clippy lints #![allow( // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054 @@ -50,7 +50,6 @@ clippy::match_wildcard_for_single_variants, clippy::module_name_repetitions, clippy::must_use_candidate, - clippy::option_if_let_else, clippy::similar_names, clippy::single_match_else, clippy::struct_excessive_bools, diff --git a/vendor/serde_derive/src/pretend.rs b/vendor/serde_derive/src/pretend.rs index 04868753b..2c9e77936 100644 --- a/vendor/serde_derive/src/pretend.rs +++ b/vendor/serde_derive/src/pretend.rs @@ -64,14 +64,14 @@ pub fn pretend_used(cont: &Container, is_packed: bool) -> TokenStream { fn pretend_fields_used(cont: &Container, is_packed: bool) -> TokenStream { match &cont.data { Data::Enum(variants) => pretend_fields_used_enum(cont, variants), - Data::Struct(Style::Struct, fields) => { + Data::Struct(Style::Struct | Style::Tuple | Style::Newtype, fields) => { if is_packed { pretend_fields_used_struct_packed(cont, fields) } else { pretend_fields_used_struct(cont, fields) } } - Data::Struct(_, _) => quote!(), + Data::Struct(Style::Unit, _) => quote!(), } } @@ -115,13 +115,13 @@ fn pretend_fields_used_enum(cont: &Container, variants: &[Variant]) -> TokenStre let patterns = variants .iter() .filter_map(|variant| match variant.style { - Style::Struct => { + Style::Struct | Style::Tuple | Style::Newtype => { let variant_ident = &variant.ident; let members = variant.fields.iter().map(|field| &field.member); let placeholders = (0usize..).map(|i| format_ident!("__v{}", i)); Some(quote!(#type_ident::#variant_ident { #(#members: #placeholders),* })) } - _ => None, + Style::Unit => None, }) .collect::>(); diff --git a/vendor/serde_json/.cargo-checksum.json b/vendor/serde_json/.cargo-checksum.json index eae5424f1..e44ab2624 100644 --- a/vendor/serde_json/.cargo-checksum.json +++ b/vendor/serde_json/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CONTRIBUTING.md":"f5270cafba66223a7b51ffc0d286075a17bb7cd88762fc80d333d3102629f4d8","Cargo.toml":"e68bf53b10d1809f1f81b9f4a8dc4c2bfb98f18eedf150e2118e9fa13f0dede6","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e49066294ebbeca4e71e5cb8f2e43b5f7a41cd0b47eeb1bad7b24d3c136bd8c0","build.rs":"83958125f23604be59b63eb47ee06309d012b6b7411ccbe09f9a39b9eff3cc11","src/de.rs":"8cb56c5168ad52dfff97a0f3bc88c200e3ad0a9278eedaa27629120f8b6e6052","src/error.rs":"c8998e8595127d712c2d2c85f6fc69d59f9fcb567009631b5b029669542dcc75","src/features_check/error.rs":"d7359f864afbfe105a38abea9f563dc423036ebc4c956a5695a4beef144dc7ec","src/features_check/mod.rs":"2209f8d5c46b50c8a3b8dc22338dcaf0135d192e8b05d2f456cbe6a73104e958","src/io/core.rs":"60ba28f67a9acaecf8964b611efba416b13f9f2bae4befc329fdf0e037293802","src/io/mod.rs":"fd1ed5080495cab21117f6f7d3c2c9e3687cad0c69a0cd087b08a145a9e672da","src/iter.rs":"f832c469cd7999d26ba9b76baa69b257a212a7edb3dfdf9b1d1bb35e8da85fa9","src/lexical/algorithm.rs":"bd6106e5d8875c9ff1c1d57256b459a4f0992d14a0df1a5fffcd3d3cbdccee8c","src/lexical/bhcomp.rs":"b7c68d74c0055eb67ec2c1bcf27bbc28bef8f1bbc43db8eb94ba69892230add6","src/lexical/bignum.rs":"4230cde10dc8eae456a713cf90ec4e48dff4b1d0c542621ce7f00f39ade2645e","src/lexical/cached.rs":"0e127398691f8042c19cde209e7f4b0161f0f3150342430145929f711e6fdac8","src/lexical/cached_float80.rs":"0f8f74a22cb7d871322a9893bffd0255ca10bf9dffd13afb2462dd3d7f51805f","src/lexical/digit.rs":"9502805adbc3da059131d1fac0a802e17065b36cd7472606b3af24e3241d5cb8","src/lexical/errors.rs":"3d9f6de6245533bcb101dfd718cfed61d59dc293f6768cedae28aa13ace164f5","src/lexical/exponent.rs":"387e945b97dc7ba48a7091c50d228a0dde3a1c4145703d4ab9c31191a91693b0","src/lexical/float.rs":"fe356213c92a049f4bef2f58bc0e3a26866ca06b8c1d74d0f961c5b883852cad","src/lexical/large_powers.rs":"34537f5c701afce1ec2a1fd3c14950381b2e27c9ad74f002c91f3708e8da9ca5","src/lexical/large_powers32.rs":"d533037c6141e6671102aee490c9cdeaba81e667ddca781b2b99db2c455e4a1a","src/lexical/large_powers64.rs":"745dd7c0cbe499eec027ef586248881011d9df20c7efab7929c1807b59886ba1","src/lexical/math.rs":"240804aa030849495fa03a83a0ee8539d5a5c8639b825f2d69d27b7567b06fb3","src/lexical/mod.rs":"4b4c5228779c0f135a4cb018700e3bcd495da48b74421a86f6b8b304acdef924","src/lexical/num.rs":"cf705c62612e31d704f43d94a633ea1243c6befad7ef5792e2e881a7fd21e809","src/lexical/parse.rs":"c2bfac4c70a19938ced61e991f4ec606764887cf12bac1a0978b5b5318a56aac","src/lexical/rounding.rs":"697207248ba17b7f4965aedb11d276261ada5b06d9c6265d8fd6246664ff6e3c","src/lexical/shift.rs":"bc1ed053dd63d45ac9c35302f18de9f00d94027f28af4ab749c9248439de832a","src/lexical/small_powers.rs":"4608dd218b8002435db7e1ec79d2d0fef5f47ae257b93353326d52ecc80cccda","src/lib.rs":"f8a08c5c1fb7d7d62a66a6be83c94d4f7fe9d57c5bae1c8e18bfb9888c76d5f7","src/macros.rs":"516f69976f433bcc5e48c32b3e29c2e0ab7b549810827d7a9c59171cdf11c1e2","src/map.rs":"5a96fa857e54a04fdca5e3ae93dd44a56fc8acdd71dd2c57a75cef495f7eb8b2","src/number.rs":"464e576953bc3d3df228d88890dd2fe4da123479f5756e03e06c7f7633959156","src/raw.rs":"4183bd3e8b7c97605ec5bab4e7fbdb2a09e00bdc53984fbe2066674510ea74ae","src/read.rs":"6b5b6689f5728f9d2e73a1f6216a811ceb77315174334b44513199898e316f37","src/ser.rs":"ee5b6cb04c2ff7058b52cb5d0383218f484505ce0896e5c7fd5076bd9d90952e","src/value/de.rs":"69d88d0ba8a8fea15964e0c95968e53ab308b143176537bfa6368432a682a65c","src/value/from.rs":"add9687e35db3962729d986c8aa54785cadeb07b8b7121cd4075e3a37ecc73a1","src/value/index.rs":"1a0d59629ae16d6553686de8d7152abd470153f67f9a1b69741e480ba491cd67","src/value/mod.rs":"4c7af0f6de5d7e7b83e59a5062892d0a071710f73f0326886ce239d5ae05ba09","src/value/partial_eq.rs":"655fd0bf3ab1d6669444a55ab849f43bb333032de8ca8f1ee95e1068da43ee22","src/value/ser.rs":"6b065423acf88d875d30608d61210a372507c7242d6525e5ef66077296ba32f1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/debug.rs":"a8451217c1e127ad6e653ef11e0513525ee350e1e37dd575758a8ee9301b28fb","tests/lexical.rs":"8ee6e617ef62a090de49ac2a930130a6913ab5316100781543c7788f89ef99c2","tests/lexical/algorithm.rs":"da378df9ee24bfa033968d5c94e91b58e52c39bf6c825dec51c3eb7250cc5874","tests/lexical/exponent.rs":"26ea92abc654a6a88a8281552bca2f76ea1fa4c17d66a1dd6defe14f7d89b666","tests/lexical/float.rs":"0440f2d85c993bcccd925096d7f4136bf624ffd66b3c7ee565d158390685eb11","tests/lexical/math.rs":"4874be2103be5fbe8b8015354414df271ffa00fd815546fc077f15fb4d7a5a37","tests/lexical/num.rs":"6e650c40de85ed72ac06b6bf1487ba161f3824e26d827df6cfdf2bbdb8d05a05","tests/lexical/parse.rs":"a11f09bb003a3a024548008cf78bf76526ed71b00077d1989f45eb8cebc93b9c","tests/lexical/rounding.rs":"6c56e39ba534616c1b2146e8efa6eb57aed322e683bf23183cd32a61fae6447e","tests/macros/mod.rs":"93aa1d54af20bc2c55b6ae8db73c1414cda2626eb9fa7bd57b9d613a3c6e6a19","tests/map.rs":"89f604c5788bcb8dc82c82e252dc0da47257986e353c09d14e4ef3e58c455f2d","tests/regression.rs":"86731134bfb9bb693d9a4fc62393027de80a8bf031109ea6c7ea475b1ebdde8d","tests/regression/issue1004.rs":"38d7e3b6c515b881078ebd21ca8063d2ca105cd319695d29538f879e37f091b5","tests/regression/issue520.rs":"d146be3472db902b48127d65fe83aa9f698143aca9074c83cd1a9d5dd28e3ec3","tests/regression/issue795.rs":"582e2e7c68113f05a4b1d2cb556a2df7cc77f2ce8164a32c5cc58ae68abb60ec","tests/regression/issue845.rs":"66eb0eeabb744adaad42fd8e2638de22b458a04ec33863e2683b60eb3d500297","tests/regression/issue953.rs":"b2cddc761f5ca6639900c173765a8a5868528a896924e5e925db2696469208f7","tests/stream.rs":"c7d91014538ecd8f495b196d40e999ab2745f2e69fa2ff9e52521605dc6ce856","tests/test.rs":"316938d202db3b706a493917f5380edb6893cb7bac36ffa460e9ce5c281ce340","tests/ui/missing_colon.rs":"d07e0c34d98eb43465f0a0310f2c0b5d5b0d26d243b352a1c6bbe6ad3b27eda9","tests/ui/missing_colon.stderr":"3732fd8f4e57b84efc07170cda5f9c5b2b17c707e23c1659222b5a46f652a8d8","tests/ui/missing_comma.rs":"b8a9662f99c3e6dd2b6417892c37640578ce91d3a8365bf10c1f686a3227aa87","tests/ui/missing_comma.stderr":"eae626cf93c97abd105066e624ca4e8cb096784413b9d2564cf9414a8492bc4d","tests/ui/missing_value.rs":"bca25d67127fb88e7c191c7b03af5a4ce8a9abb630f3d2e6a6c1e77e213dc9a4","tests/ui/missing_value.stderr":"b0df8add5cf74e5df30eedd3ca347e4862c04a01c54d802ff45392f2032065b1","tests/ui/not_found.rs":"d0a7adb309879ff65aee115b52cc33d36f4bad353cf97c4effc34a6128c2bee3","tests/ui/not_found.stderr":"359b751c0c21fab6d460daef4d5f73a265f7769c9b578f98ea3cb6cbf2387643","tests/ui/parse_expr.rs":"32e6d51f528db3d1ab0ed1e24765b865be393565c26f77413c5aa39d601ac563","tests/ui/parse_expr.stderr":"4fcd0a014fbce31c9266bab8527d6e6b6806a0e21d9e0275ce713137856073ce","tests/ui/parse_key.rs":"18829b2af320d5cf8a0a5cd3aaf84c7e92cc874651c30e45a3acafb76c2d8b93","tests/ui/parse_key.stderr":"fcb44e060b804a4762b7291e128c41d7010ffa8ab820b8828fd13fbe6d405ca6","tests/ui/unexpected_after_array_element.rs":"a343fc3104431720bdfcf330bcc3cfcd98c8dec3e951133b495242478b0b7eb3","tests/ui/unexpected_after_array_element.stderr":"8df615998fa3057bb9ed865981a35cdbb771625337048f0ad3fba7734e607adf","tests/ui/unexpected_after_map_entry.rs":"6e3bd2def435ca610e346bbc75cdbaf61963eb2ef1885bb5f76781ba1fac37ef","tests/ui/unexpected_after_map_entry.stderr":"b1985c89075ab48b2158bd1705ed766d37854b3d4620ab257cc8bc319d224f17","tests/ui/unexpected_colon.rs":"a313cff3fed4be4c33f1eda5d0c5c98147fb835a56d36470d9f367352c1d61ef","tests/ui/unexpected_colon.stderr":"b2288742fa6a4a7eb65d2ae899bcfed8795b57bd04958da227d60928a8df26c5","tests/ui/unexpected_comma.rs":"55a8b684bde1ce905837cce719fd457d8898b61cebc27e5b420d05cb6be97256","tests/ui/unexpected_comma.stderr":"4c103ca63ff15e2ca659242cc0eae0612bf050e7580da62f1cf50de8082aa7dc"},"package":"3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"} \ No newline at end of file +{"files":{"CONTRIBUTING.md":"f5270cafba66223a7b51ffc0d286075a17bb7cd88762fc80d333d3102629f4d8","Cargo.toml":"7f3153be2daa90d2081eb91d51614ae3f893d0cc22d87275abcb150bdb636416","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e49066294ebbeca4e71e5cb8f2e43b5f7a41cd0b47eeb1bad7b24d3c136bd8c0","build.rs":"9fa36e0b1bb7026b449a20986ae2f60b3046bcbcf3bf22b5c0e372eb892eaf57","src/de.rs":"02b550b12e941f9cedfc36b5c127ec27dbc4b54d3de2fae75b7adcc08333551f","src/error.rs":"a9b5de0a82f95608b51b8e8875c7c49f94fb60b9f976fc6277aec0213926dec9","src/features_check/error.rs":"d7359f864afbfe105a38abea9f563dc423036ebc4c956a5695a4beef144dc7ec","src/features_check/mod.rs":"2209f8d5c46b50c8a3b8dc22338dcaf0135d192e8b05d2f456cbe6a73104e958","src/io/core.rs":"60ba28f67a9acaecf8964b611efba416b13f9f2bae4befc329fdf0e037293802","src/io/mod.rs":"fd1ed5080495cab21117f6f7d3c2c9e3687cad0c69a0cd087b08a145a9e672da","src/iter.rs":"f832c469cd7999d26ba9b76baa69b257a212a7edb3dfdf9b1d1bb35e8da85fa9","src/lexical/algorithm.rs":"bd6106e5d8875c9ff1c1d57256b459a4f0992d14a0df1a5fffcd3d3cbdccee8c","src/lexical/bhcomp.rs":"b7c68d74c0055eb67ec2c1bcf27bbc28bef8f1bbc43db8eb94ba69892230add6","src/lexical/bignum.rs":"4230cde10dc8eae456a713cf90ec4e48dff4b1d0c542621ce7f00f39ade2645e","src/lexical/cached.rs":"0e127398691f8042c19cde209e7f4b0161f0f3150342430145929f711e6fdac8","src/lexical/cached_float80.rs":"0f8f74a22cb7d871322a9893bffd0255ca10bf9dffd13afb2462dd3d7f51805f","src/lexical/digit.rs":"9502805adbc3da059131d1fac0a802e17065b36cd7472606b3af24e3241d5cb8","src/lexical/errors.rs":"3d9f6de6245533bcb101dfd718cfed61d59dc293f6768cedae28aa13ace164f5","src/lexical/exponent.rs":"387e945b97dc7ba48a7091c50d228a0dde3a1c4145703d4ab9c31191a91693b0","src/lexical/float.rs":"fe356213c92a049f4bef2f58bc0e3a26866ca06b8c1d74d0f961c5b883852cad","src/lexical/large_powers.rs":"34537f5c701afce1ec2a1fd3c14950381b2e27c9ad74f002c91f3708e8da9ca5","src/lexical/large_powers32.rs":"d533037c6141e6671102aee490c9cdeaba81e667ddca781b2b99db2c455e4a1a","src/lexical/large_powers64.rs":"745dd7c0cbe499eec027ef586248881011d9df20c7efab7929c1807b59886ba1","src/lexical/math.rs":"240804aa030849495fa03a83a0ee8539d5a5c8639b825f2d69d27b7567b06fb3","src/lexical/mod.rs":"4b4c5228779c0f135a4cb018700e3bcd495da48b74421a86f6b8b304acdef924","src/lexical/num.rs":"b33a205c8afa2e130ba4b4fb94a004e95d2b5744fab7473a31976b3cdb73510d","src/lexical/parse.rs":"c2bfac4c70a19938ced61e991f4ec606764887cf12bac1a0978b5b5318a56aac","src/lexical/rounding.rs":"697207248ba17b7f4965aedb11d276261ada5b06d9c6265d8fd6246664ff6e3c","src/lexical/shift.rs":"bc1ed053dd63d45ac9c35302f18de9f00d94027f28af4ab749c9248439de832a","src/lexical/small_powers.rs":"4608dd218b8002435db7e1ec79d2d0fef5f47ae257b93353326d52ecc80cccda","src/lib.rs":"ec007b017f167773807c9eb13e363d0c4d1145b990b26c7c208211ef428e64c7","src/macros.rs":"516f69976f433bcc5e48c32b3e29c2e0ab7b549810827d7a9c59171cdf11c1e2","src/map.rs":"769f5d4f596227c2a7e41fd9ffce9bc30cc1515c1ca486d36935781a96126cf2","src/number.rs":"464e576953bc3d3df228d88890dd2fe4da123479f5756e03e06c7f7633959156","src/raw.rs":"4183bd3e8b7c97605ec5bab4e7fbdb2a09e00bdc53984fbe2066674510ea74ae","src/read.rs":"6b5b6689f5728f9d2e73a1f6216a811ceb77315174334b44513199898e316f37","src/ser.rs":"ee5b6cb04c2ff7058b52cb5d0383218f484505ce0896e5c7fd5076bd9d90952e","src/value/de.rs":"69d88d0ba8a8fea15964e0c95968e53ab308b143176537bfa6368432a682a65c","src/value/from.rs":"add9687e35db3962729d986c8aa54785cadeb07b8b7121cd4075e3a37ecc73a1","src/value/index.rs":"1a0d59629ae16d6553686de8d7152abd470153f67f9a1b69741e480ba491cd67","src/value/mod.rs":"c1b08509df5ae1ffb5c5e148ac29791923c92eb9957935683739a95bef0007e9","src/value/partial_eq.rs":"655fd0bf3ab1d6669444a55ab849f43bb333032de8ca8f1ee95e1068da43ee22","src/value/ser.rs":"6b065423acf88d875d30608d61210a372507c7242d6525e5ef66077296ba32f1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/debug.rs":"a8451217c1e127ad6e653ef11e0513525ee350e1e37dd575758a8ee9301b28fb","tests/lexical.rs":"8ee6e617ef62a090de49ac2a930130a6913ab5316100781543c7788f89ef99c2","tests/lexical/algorithm.rs":"da378df9ee24bfa033968d5c94e91b58e52c39bf6c825dec51c3eb7250cc5874","tests/lexical/exponent.rs":"26ea92abc654a6a88a8281552bca2f76ea1fa4c17d66a1dd6defe14f7d89b666","tests/lexical/float.rs":"0440f2d85c993bcccd925096d7f4136bf624ffd66b3c7ee565d158390685eb11","tests/lexical/math.rs":"4874be2103be5fbe8b8015354414df271ffa00fd815546fc077f15fb4d7a5a37","tests/lexical/num.rs":"6e650c40de85ed72ac06b6bf1487ba161f3824e26d827df6cfdf2bbdb8d05a05","tests/lexical/parse.rs":"a11f09bb003a3a024548008cf78bf76526ed71b00077d1989f45eb8cebc93b9c","tests/lexical/rounding.rs":"6c56e39ba534616c1b2146e8efa6eb57aed322e683bf23183cd32a61fae6447e","tests/macros/mod.rs":"93aa1d54af20bc2c55b6ae8db73c1414cda2626eb9fa7bd57b9d613a3c6e6a19","tests/map.rs":"89f604c5788bcb8dc82c82e252dc0da47257986e353c09d14e4ef3e58c455f2d","tests/regression.rs":"86731134bfb9bb693d9a4fc62393027de80a8bf031109ea6c7ea475b1ebdde8d","tests/regression/issue1004.rs":"38d7e3b6c515b881078ebd21ca8063d2ca105cd319695d29538f879e37f091b5","tests/regression/issue520.rs":"d146be3472db902b48127d65fe83aa9f698143aca9074c83cd1a9d5dd28e3ec3","tests/regression/issue795.rs":"582e2e7c68113f05a4b1d2cb556a2df7cc77f2ce8164a32c5cc58ae68abb60ec","tests/regression/issue845.rs":"66eb0eeabb744adaad42fd8e2638de22b458a04ec33863e2683b60eb3d500297","tests/regression/issue953.rs":"b2cddc761f5ca6639900c173765a8a5868528a896924e5e925db2696469208f7","tests/stream.rs":"c7d91014538ecd8f495b196d40e999ab2745f2e69fa2ff9e52521605dc6ce856","tests/test.rs":"8a71e5ab13f016642b6f90d7fc935ed1399f2c4d74f1d6de0b64c0ca7fe7aa59","tests/ui/missing_colon.rs":"d07e0c34d98eb43465f0a0310f2c0b5d5b0d26d243b352a1c6bbe6ad3b27eda9","tests/ui/missing_colon.stderr":"3732fd8f4e57b84efc07170cda5f9c5b2b17c707e23c1659222b5a46f652a8d8","tests/ui/missing_comma.rs":"b8a9662f99c3e6dd2b6417892c37640578ce91d3a8365bf10c1f686a3227aa87","tests/ui/missing_comma.stderr":"eae626cf93c97abd105066e624ca4e8cb096784413b9d2564cf9414a8492bc4d","tests/ui/missing_value.rs":"bca25d67127fb88e7c191c7b03af5a4ce8a9abb630f3d2e6a6c1e77e213dc9a4","tests/ui/missing_value.stderr":"b0df8add5cf74e5df30eedd3ca347e4862c04a01c54d802ff45392f2032065b1","tests/ui/not_found.rs":"d0a7adb309879ff65aee115b52cc33d36f4bad353cf97c4effc34a6128c2bee3","tests/ui/not_found.stderr":"359b751c0c21fab6d460daef4d5f73a265f7769c9b578f98ea3cb6cbf2387643","tests/ui/parse_expr.rs":"32e6d51f528db3d1ab0ed1e24765b865be393565c26f77413c5aa39d601ac563","tests/ui/parse_expr.stderr":"4fcd0a014fbce31c9266bab8527d6e6b6806a0e21d9e0275ce713137856073ce","tests/ui/parse_key.rs":"18829b2af320d5cf8a0a5cd3aaf84c7e92cc874651c30e45a3acafb76c2d8b93","tests/ui/parse_key.stderr":"20cf0d2898749f3c36780fc065f5049ee809e74cb6f0ef776f43f45e01596ee3","tests/ui/unexpected_after_array_element.rs":"a343fc3104431720bdfcf330bcc3cfcd98c8dec3e951133b495242478b0b7eb3","tests/ui/unexpected_after_array_element.stderr":"8df615998fa3057bb9ed865981a35cdbb771625337048f0ad3fba7734e607adf","tests/ui/unexpected_after_map_entry.rs":"6e3bd2def435ca610e346bbc75cdbaf61963eb2ef1885bb5f76781ba1fac37ef","tests/ui/unexpected_after_map_entry.stderr":"b1985c89075ab48b2158bd1705ed766d37854b3d4620ab257cc8bc319d224f17","tests/ui/unexpected_colon.rs":"a313cff3fed4be4c33f1eda5d0c5c98147fb835a56d36470d9f367352c1d61ef","tests/ui/unexpected_colon.stderr":"b2288742fa6a4a7eb65d2ae899bcfed8795b57bd04958da227d60928a8df26c5","tests/ui/unexpected_comma.rs":"55a8b684bde1ce905837cce719fd457d8898b61cebc27e5b420d05cb6be97256","tests/ui/unexpected_comma.stderr":"4c103ca63ff15e2ca659242cc0eae0612bf050e7580da62f1cf50de8082aa7dc"},"package":"69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79"} \ No newline at end of file diff --git a/vendor/serde_json/Cargo.toml b/vendor/serde_json/Cargo.toml index bab1063d4..447641d92 100644 --- a/vendor/serde_json/Cargo.toml +++ b/vendor/serde_json/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "serde_json" -version = "1.0.108" +version = "1.0.113" authors = [ "Erick Tryzelaar ", "David Tolnay ", @@ -36,6 +36,7 @@ repository = "https://github.com/serde-rs/json" [package.metadata.docs.rs] features = [ + "preserve_order", "raw_value", "unbounded_depth", ] @@ -53,7 +54,7 @@ features = ["raw_value"] doc-scrape-examples = false [dependencies.indexmap] -version = "2" +version = "2.2.1" optional = true [dependencies.itoa] @@ -63,7 +64,7 @@ version = "1.0" version = "1.0" [dependencies.serde] -version = "1.0.166" +version = "1.0.194" default-features = false [dev-dependencies.automod] @@ -79,7 +80,7 @@ version = "1.0.18" version = "1.0.13" [dev-dependencies.serde] -version = "1.0.166" +version = "1.0.194" features = ["derive"] [dev-dependencies.serde_bytes] diff --git a/vendor/serde_json/build.rs b/vendor/serde_json/build.rs index 1a8c89828..dd09e62a3 100644 --- a/vendor/serde_json/build.rs +++ b/vendor/serde_json/build.rs @@ -7,7 +7,7 @@ fn main() { // src/lexical/math.rs for where this has an effect. let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); match target_arch.as_str() { - "aarch64" | "mips64" | "powerpc64" | "x86_64" => { + "aarch64" | "mips64" | "powerpc64" | "x86_64" | "loongarch64" => { println!("cargo:rustc-cfg=limb_width_64"); } _ => { diff --git a/vendor/serde_json/src/de.rs b/vendor/serde_json/src/de.rs index 9975b40a5..7154f84d2 100644 --- a/vendor/serde_json/src/de.rs +++ b/vendor/serde_json/src/de.rs @@ -22,6 +22,7 @@ use crate::number::NumberDeserializer; pub use crate::read::{Read, SliceRead, StrRead}; #[cfg(feature = "std")] +#[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub use crate::read::IoRead; ////////////////////////////////////////////////////////////////////////////// diff --git a/vendor/serde_json/src/error.rs b/vendor/serde_json/src/error.rs index 03555eb4c..fbf9eb14e 100644 --- a/vendor/serde_json/src/error.rs +++ b/vendor/serde_json/src/error.rs @@ -438,11 +438,20 @@ impl de::Error for Error { #[cold] fn invalid_type(unexp: de::Unexpected, exp: &dyn de::Expected) -> Self { - if let de::Unexpected::Unit = unexp { - Error::custom(format_args!("invalid type: null, expected {}", exp)) - } else { - Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp)) - } + Error::custom(format_args!( + "invalid type: {}, expected {}", + JsonUnexpected(unexp), + exp, + )) + } + + #[cold] + fn invalid_value(unexp: de::Unexpected, exp: &dyn de::Expected) -> Self { + Error::custom(format_args!( + "invalid value: {}, expected {}", + JsonUnexpected(unexp), + exp, + )) } } @@ -453,6 +462,22 @@ impl ser::Error for Error { } } +struct JsonUnexpected<'a>(de::Unexpected<'a>); + +impl<'a> Display for JsonUnexpected<'a> { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self.0 { + de::Unexpected::Unit => formatter.write_str("null"), + de::Unexpected::Float(value) => write!( + formatter, + "floating point `{}`", + ryu::Buffer::new().format(value), + ), + unexp => Display::fmt(&unexp, formatter), + } + } +} + // Parse our own error message that looks like "{} at line {} column {}" to work // around erased-serde round-tripping the error through de::Error::custom. fn make_error(mut msg: String) -> Error { diff --git a/vendor/serde_json/src/lexical/num.rs b/vendor/serde_json/src/lexical/num.rs index e47e00341..af10afd7a 100644 --- a/vendor/serde_json/src/lexical/num.rs +++ b/vendor/serde_json/src/lexical/num.rs @@ -223,7 +223,7 @@ pub trait Float: Number { const NEGATIVE_INFINITY_BITS: Self::Unsigned; /// Size of the significand (mantissa) without hidden bit. const MANTISSA_SIZE: i32; - /// Bias of the exponet + /// Bias of the exponent const EXPONENT_BIAS: i32; /// Exponent portion of a denormal float. const DENORMAL_EXPONENT: i32; diff --git a/vendor/serde_json/src/lib.rs b/vendor/serde_json/src/lib.rs index ce377458f..aa3fcfc8d 100644 --- a/vendor/serde_json/src/lib.rs +++ b/vendor/serde_json/src/lib.rs @@ -299,7 +299,7 @@ //! [macro]: crate::json //! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core -#![doc(html_root_url = "https://docs.rs/serde_json/1.0.108")] +#![doc(html_root_url = "https://docs.rs/serde_json/1.0.113")] // Ignored clippy lints #![allow( clippy::collapsible_else_if, @@ -316,6 +316,7 @@ clippy::needless_late_init, clippy::return_self_not_must_use, clippy::transmute_ptr_to_ptr, + clippy::unconditional_recursion, // https://github.com/rust-lang/rust-clippy/issues/12133 clippy::unnecessary_wraps )] // Ignored clippy_pedantic lints @@ -365,6 +366,7 @@ extern crate alloc; #[cfg(feature = "std")] +#[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[doc(inline)] pub use crate::de::from_reader; #[doc(inline)] @@ -374,6 +376,7 @@ pub use crate::error::{Error, Result}; #[doc(inline)] pub use crate::ser::{to_string, to_string_pretty, to_vec, to_vec_pretty}; #[cfg(feature = "std")] +#[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[doc(inline)] pub use crate::ser::{to_writer, to_writer_pretty, Serializer}; #[doc(inline)] diff --git a/vendor/serde_json/src/map.rs b/vendor/serde_json/src/map.rs index 675058ba1..1d74e1b2b 100644 --- a/vendor/serde_json/src/map.rs +++ b/vendor/serde_json/src/map.rs @@ -130,6 +130,12 @@ impl Map { /// /// The key may be any borrowed form of the map's key type, but the ordering /// on the borrowed form *must* match the ordering on the key type. + /// + /// If serde_json's "preserve_order" is enabled, `.remove(key)` is + /// equivalent to [`.swap_remove(key)`][Self::swap_remove], replacing this + /// entry's position with the last element. If you need to preserve the + /// relative order of the keys in the map, use + /// [`.shift_remove(key)`][Self::shift_remove] instead. #[inline] pub fn remove(&mut self, key: &Q) -> Option where @@ -137,7 +143,7 @@ impl Map { Q: ?Sized + Ord + Eq + Hash, { #[cfg(feature = "preserve_order")] - return self.map.swap_remove(key); + return self.swap_remove(key); #[cfg(not(feature = "preserve_order"))] return self.map.remove(key); } @@ -147,12 +153,86 @@ impl Map { /// /// The key may be any borrowed form of the map's key type, but the ordering /// on the borrowed form *must* match the ordering on the key type. + /// + /// If serde_json's "preserve_order" is enabled, `.remove_entry(key)` is + /// equivalent to [`.swap_remove_entry(key)`][Self::swap_remove_entry], + /// replacing this entry's position with the last element. If you need to + /// preserve the relative order of the keys in the map, use + /// [`.shift_remove_entry(key)`][Self::shift_remove_entry] instead. + #[inline] pub fn remove_entry(&mut self, key: &Q) -> Option<(String, Value)> where String: Borrow, Q: ?Sized + Ord + Eq + Hash, { - self.map.remove_entry(key) + #[cfg(feature = "preserve_order")] + return self.swap_remove_entry(key); + #[cfg(not(feature = "preserve_order"))] + return self.map.remove_entry(key); + } + + /// Removes and returns the value corresponding to the key from the map. + /// + /// Like [`Vec::swap_remove`], the entry is removed by swapping it with the + /// last element of the map and popping it off. This perturbs the position + /// of what used to be the last element! + #[cfg(feature = "preserve_order")] + #[cfg_attr(docsrs, doc(cfg(feature = "preserve_order")))] + #[inline] + pub fn swap_remove(&mut self, key: &Q) -> Option + where + String: Borrow, + Q: ?Sized + Ord + Eq + Hash, + { + self.map.swap_remove(key) + } + + /// Remove and return the key-value pair. + /// + /// Like [`Vec::swap_remove`], the entry is removed by swapping it with the + /// last element of the map and popping it off. This perturbs the position + /// of what used to be the last element! + #[cfg(feature = "preserve_order")] + #[cfg_attr(docsrs, doc(cfg(feature = "preserve_order")))] + #[inline] + pub fn swap_remove_entry(&mut self, key: &Q) -> Option<(String, Value)> + where + String: Borrow, + Q: ?Sized + Ord + Eq + Hash, + { + self.map.swap_remove_entry(key) + } + + /// Removes and returns the value corresponding to the key from the map. + /// + /// Like [`Vec::remove`], the entry is removed by shifting all of the + /// elements that follow it, preserving their relative order. This perturbs + /// the index of all of those elements! + #[cfg(feature = "preserve_order")] + #[cfg_attr(docsrs, doc(cfg(feature = "preserve_order")))] + #[inline] + pub fn shift_remove(&mut self, key: &Q) -> Option + where + String: Borrow, + Q: ?Sized + Ord + Eq + Hash, + { + self.map.shift_remove(key) + } + + /// Remove and return the key-value pair. + /// + /// Like [`Vec::remove`], the entry is removed by shifting all of the + /// elements that follow it, preserving their relative order. This perturbs + /// the index of all of those elements! + #[cfg(feature = "preserve_order")] + #[cfg_attr(docsrs, doc(cfg(feature = "preserve_order")))] + #[inline] + pub fn shift_remove_entry(&mut self, key: &Q) -> Option<(String, Value)> + where + String: Borrow, + Q: ?Sized + Ord + Eq + Hash, + { + self.map.shift_remove_entry(key) } /// Moves all elements from other into self, leaving other empty. diff --git a/vendor/serde_json/src/value/mod.rs b/vendor/serde_json/src/value/mod.rs index a565b2998..b3f51ea0d 100644 --- a/vendor/serde_json/src/value/mod.rs +++ b/vendor/serde_json/src/value/mod.rs @@ -106,6 +106,7 @@ pub use crate::map::Map; pub use crate::number::Number; #[cfg(feature = "raw_value")] +#[cfg_attr(docsrs, doc(cfg(feature = "raw_value")))] pub use crate::raw::{to_raw_value, RawValue}; /// Represents any valid JSON value. diff --git a/vendor/serde_json/tests/test.rs b/vendor/serde_json/tests/test.rs index a38435069..05b7f86fc 100644 --- a/vendor/serde_json/tests/test.rs +++ b/vendor/serde_json/tests/test.rs @@ -14,9 +14,6 @@ clippy::vec_init_then_push, clippy::zero_sized_map_values )] -#![cfg_attr(feature = "trace-macros", feature(trace_macros))] -#[cfg(feature = "trace-macros")] -trace_macros!(true); #[macro_use] mod macros; @@ -33,11 +30,12 @@ use serde_json::{ from_reader, from_slice, from_str, from_value, json, to_string, to_string_pretty, to_value, to_vec, Deserializer, Number, Value, }; -use std::collections::hash_map::DefaultHasher; use std::collections::BTreeMap; #[cfg(feature = "raw_value")] use std::collections::HashMap; use std::fmt::{self, Debug}; +use std::hash::BuildHasher; +#[cfg(feature = "raw_value")] use std::hash::{Hash, Hasher}; use std::io; use std::iter; @@ -2493,19 +2491,15 @@ fn test_value_into_deserializer() { #[test] fn hash_positive_and_negative_zero() { - fn hash(obj: impl Hash) -> u64 { - let mut hasher = DefaultHasher::new(); - obj.hash(&mut hasher); - hasher.finish() - } + let rand = std::hash::RandomState::new(); let k1 = serde_json::from_str::("0.0").unwrap(); let k2 = serde_json::from_str::("-0.0").unwrap(); if cfg!(feature = "arbitrary_precision") { assert_ne!(k1, k2); - assert_ne!(hash(k1), hash(k2)); + assert_ne!(rand.hash_one(k1), rand.hash_one(k2)); } else { assert_eq!(k1, k2); - assert_eq!(hash(k1), hash(k2)); + assert_eq!(rand.hash_one(k1), rand.hash_one(k2)); } } diff --git a/vendor/serde_json/tests/ui/parse_key.stderr b/vendor/serde_json/tests/ui/parse_key.stderr index f10c21800..15662dc50 100644 --- a/vendor/serde_json/tests/ui/parse_key.stderr +++ b/vendor/serde_json/tests/ui/parse_key.stderr @@ -2,4 +2,4 @@ error[E0609]: no field `s` on type `&'static str` --> tests/ui/parse_key.rs:4:16 | 4 | json!({ "".s : true }); - | ^ + | ^ unknown field diff --git a/vendor/serde_path_to_error/.cargo-checksum.json b/vendor/serde_path_to_error/.cargo-checksum.json index d75249436..b9cab4308 100644 --- a/vendor/serde_path_to_error/.cargo-checksum.json +++ b/vendor/serde_path_to_error/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"e8b366fa59c60489093a677ae306f9c93b4a97e5575e68c1d768e9057d55320f","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"a85a795381a723c0cc19c2a75a62b309b0a01a12618da605d6166a7a5e207201","src/de.rs":"fb9e7d1e6233e1fa8b968813329552680ee744301b2ad772ed20dd6b173bda4c","src/lib.rs":"036d23c74085d21909b4590d166c90eaa20705d898ea1f7ada582613a635ce24","src/path.rs":"e944e30a7bb8ed180470420d4cd85276e04774a4fbeebc5a1d8b81f18d94efef","src/ser.rs":"19c4df177b7ca1a3236793a19a969983d50140ab714c2d0372d025d3e353a0e4","src/wrap.rs":"9d88271729c6dc90d16328454f0432e18ce13df6c8dc4749785c5d3c7d260c09","tests/deserialize.rs":"b9f327bc0baf5e3626045e9dafe550c50e58b043661b29cc0fc1c609abf5362e","tests/serialize.rs":"dc304dcaa9b8ae89b624c3d9ecde5a195c8dac062bb00a1f791beb11f77c09b7"},"package":"4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335"} \ No newline at end of file +{"files":{"Cargo.toml":"864dbda574217fe183380028c362ea57825eb216b8886e83a87287e2f64cbdab","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"a85a795381a723c0cc19c2a75a62b309b0a01a12618da605d6166a7a5e207201","src/de.rs":"8cd9680fa3150d0b39bf0dfdf6b4279eb6dc955e077b12cbe7d812e3f6f95805","src/lib.rs":"6db5fe707b2ee09f3fb5cdc2e99956a75efa5c7b25cc9216b03ddfc446b83658","src/path.rs":"e944e30a7bb8ed180470420d4cd85276e04774a4fbeebc5a1d8b81f18d94efef","src/ser.rs":"3666ccfcfa93cc0d7eb8354542e08b2fd6a441e623cd11f15e6be7c0e533338c","src/wrap.rs":"9d88271729c6dc90d16328454f0432e18ce13df6c8dc4749785c5d3c7d260c09","tests/deserialize.rs":"b9f327bc0baf5e3626045e9dafe550c50e58b043661b29cc0fc1c609abf5362e","tests/serialize.rs":"dc304dcaa9b8ae89b624c3d9ecde5a195c8dac062bb00a1f791beb11f77c09b7"},"package":"ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c"} \ No newline at end of file diff --git a/vendor/serde_path_to_error/Cargo.toml b/vendor/serde_path_to_error/Cargo.toml index 0bd5916e3..fdacd44f6 100644 --- a/vendor/serde_path_to_error/Cargo.toml +++ b/vendor/serde_path_to_error/Cargo.toml @@ -13,9 +13,10 @@ edition = "2021" rust-version = "1.56" name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.15" authors = ["David Tolnay "] description = "Path to the element that failed to deserialize" +documentation = "https://docs.rs/serde_path_to_error" readme = "README.md" keywords = [ "serde", @@ -36,10 +37,10 @@ doc-scrape-examples = false version = "1.0" [dependencies.serde] -version = "1.0.166" +version = "1.0.194" [dev-dependencies.serde_derive] -version = "1.0.166" +version = "1.0.194" [dev-dependencies.serde_json] version = "1.0.100" diff --git a/vendor/serde_path_to_error/src/de.rs b/vendor/serde_path_to_error/src/de.rs index d1bec5441..536c7bff3 100644 --- a/vendor/serde_path_to_error/src/de.rs +++ b/vendor/serde_path_to_error/src/de.rs @@ -72,6 +72,7 @@ pub struct Deserializer<'a, 'b, D> { } impl<'a, 'b, D> Deserializer<'a, 'b, D> { + #[allow(clippy::needless_pass_by_ref_mut)] pub fn new(de: D, track: &'b mut Track) -> Self { Deserializer { de, diff --git a/vendor/serde_path_to_error/src/lib.rs b/vendor/serde_path_to_error/src/lib.rs index dca48b148..172570d38 100644 --- a/vendor/serde_path_to_error/src/lib.rs +++ b/vendor/serde_path_to_error/src/lib.rs @@ -53,7 +53,7 @@ //! } //! ``` -#![doc(html_root_url = "https://docs.rs/serde_path_to_error/0.1.14")] +#![doc(html_root_url = "https://docs.rs/serde_path_to_error/0.1.15")] #![allow( clippy::doc_link_with_quotes, // https://github.com/rust-lang/rust-clippy/issues/8961 clippy::iter_not_returning_iterator, // https://github.com/rust-lang/rust-clippy/issues/8285 @@ -133,7 +133,7 @@ pub struct Track { impl Track { /// Empty state with no error having happened yet. - pub fn new() -> Self { + pub const fn new() -> Self { Track { path: Cell::new(None), } diff --git a/vendor/serde_path_to_error/src/ser.rs b/vendor/serde_path_to_error/src/ser.rs index 87a993f29..4e4e44b56 100644 --- a/vendor/serde_path_to_error/src/ser.rs +++ b/vendor/serde_path_to_error/src/ser.rs @@ -99,6 +99,7 @@ pub struct Serializer<'a, 'b, S> { } impl<'a, 'b, S> Serializer<'a, 'b, S> { + #[allow(clippy::needless_pass_by_ref_mut)] pub fn new(ser: S, track: &'b mut Track) -> Self { Serializer { ser, diff --git a/vendor/shlex/.cargo-checksum.json b/vendor/shlex/.cargo-checksum.json index 8e529de2d..579ecbe8e 100644 --- a/vendor/shlex/.cargo-checksum.json +++ b/vendor/shlex/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"879a16b3fef6fb3251fcac516fe73414109e3b7df5eb2ec4863a7551674038a0","Cargo.toml":"13ada792f937b855f6327ab6a2d3bc80d31c7823f1337a75740a9e90135059c0","LICENSE-APACHE":"553fffcd9b1cb158bc3e9edc35da85ca5c3b3d7d2e61c883ebcfa8a65814b583","LICENSE-MIT":"4455bf75a91154108304cb283e0fea9948c14f13e20d60887cf2552449dea3b1","README.md":"082e505bba5dffc5904af5602b45d01129173e617db62c81e6c11d71c964ea71","src/bytes.rs":"c58dc1503b99fa647dc38ede3c0582917dc6980256d2ea2bc771b13cb702588c","src/lib.rs":"2ca562f0af35560042864efb8b44fbb1b1f37bf11066e31421461a13f8fc5eab"},"package":"a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"} \ No newline at end of file +{"files":{"CHANGELOG.md":"879a16b3fef6fb3251fcac516fe73414109e3b7df5eb2ec4863a7551674038a0","Cargo.toml":"d7eb8c4bce681b4dd1dfc2c98c649754390775f38f4796d491948ddbb53aa2ef","LICENSE-APACHE":"553fffcd9b1cb158bc3e9edc35da85ca5c3b3d7d2e61c883ebcfa8a65814b583","LICENSE-MIT":"4455bf75a91154108304cb283e0fea9948c14f13e20d60887cf2552449dea3b1","README.md":"082e505bba5dffc5904af5602b45d01129173e617db62c81e6c11d71c964ea71","src/bytes.rs":"eadfffcdb7846d341ba451d6118d275b9d0f14a9554984ccfcdbe9a8d77ec5ee","src/lib.rs":"44c8fb929e1443f2446d26025a9bcfca0b329811bbc309b4a6afb8ec17d7de8d","src/quoting_warning.md":"566d6509211ddcd4afbd4f1117c5234567f6b6d01f5da60acfaef011362be045"},"package":"0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"} \ No newline at end of file diff --git a/vendor/shlex/Cargo.toml b/vendor/shlex/Cargo.toml index cc556026d..2b668928d 100644 --- a/vendor/shlex/Cargo.toml +++ b/vendor/shlex/Cargo.toml @@ -10,11 +10,16 @@ # See Cargo.toml.orig for the original contents. [package] +rust-version = "1.46.0" name = "shlex" -version = "1.2.0" +version = "1.3.0" authors = [ "comex ", "Fenhl ", + "Adrian Taylor ", + "Alex Touchet ", + "Daniel Parks ", + "Garrett Berg ", ] description = "Split a string into shell words, like Python's shlex." readme = "README.md" diff --git a/vendor/shlex/src/bytes.rs b/vendor/shlex/src/bytes.rs index e3306f51b..af8daad0d 100644 --- a/vendor/shlex/src/bytes.rs +++ b/vendor/shlex/src/bytes.rs @@ -17,7 +17,7 @@ //! //! // `\x80` is invalid in UTF-8. //! let os_str = OsStr::from_bytes(b"a\x80b c"); -//! assert_eq!(quote(os_str.as_bytes()), &b"\"a\x80b c\""[..]); +//! assert_eq!(quote(os_str.as_bytes()), &b"'a\x80b c'"[..]); //! } //! ``` //! @@ -30,6 +30,10 @@ use alloc::borrow::Cow; use alloc::vec; #[cfg(test)] use alloc::borrow::ToOwned; +#[cfg(all(doc, not(doctest)))] +use crate::{self as shlex, quoting_warning}; + +use super::QuoteError; /// An iterator that takes an input byte string and splits it into the words using the same syntax as /// the POSIX shell. @@ -159,49 +163,348 @@ pub fn split(in_bytes: &[u8]) -> Option>> { if shl.had_error { None } else { Some(res) } } -/// Given a single word, return a byte string suitable to encode it as a shell argument. +/// A more configurable interface to quote strings. If you only want the default settings you can +/// use the convenience functions [`try_quote`] and [`try_join`]. /// -/// If given valid UTF-8, this will never produce invalid UTF-8. This is because it only -/// ever inserts valid ASCII characters before or after existing ASCII characters (or -/// returns two double quotes if the input was an empty string). It will never modify a -/// multibyte UTF-8 character. -pub fn quote(in_bytes: &[u8]) -> Cow<[u8]> { - if in_bytes.len() == 0 { - b"\"\""[..].into() - } else if in_bytes.iter().any(|c| match *c as char { - '|' | '&' | ';' | '<' | '>' | '(' | ')' | '$' | '`' | '\\' | '"' | '\'' | ' ' | '\t' | - '\r' | '\n' | '*' | '?' | '[' | '#' | '~' | '=' | '%' => true, - _ => false - }) { - let mut out: Vec = Vec::new(); - out.push(b'"'); - for &c in in_bytes { - match c { - b'$' | b'`' | b'"' | b'\\' => out.push(b'\\'), - _ => () - } - out.push(c); +/// The string equivalent is [`shlex::Quoter`]. +#[derive(Default, Debug, Clone)] +pub struct Quoter { + allow_nul: bool, + // TODO: more options +} + +impl Quoter { + /// Create a new [`Quoter`] with default settings. + #[inline] + pub fn new() -> Self { + Self::default() + } + + /// Set whether to allow [nul bytes](quoting_warning#nul-bytes). By default they are not + /// allowed and will result in an error of [`QuoteError::Nul`]. + #[inline] + pub fn allow_nul(mut self, allow: bool) -> Self { + self.allow_nul = allow; + self + } + + /// Convenience function that consumes an iterable of words and turns it into a single byte string, + /// quoting words when necessary. Consecutive words will be separated by a single space. + pub fn join<'a, I: IntoIterator>(&self, words: I) -> Result, QuoteError> { + Ok(words.into_iter() + .map(|word| self.quote(word)) + .collect::>, QuoteError>>()? + .join(&b' ')) + } + + /// Given a single word, return a byte string suitable to encode it as a shell argument. + /// + /// If given valid UTF-8, this will never produce invalid UTF-8. This is because it only + /// ever inserts valid ASCII characters before or after existing ASCII characters (or + /// returns two single quotes if the input was an empty string). It will never modify a + /// multibyte UTF-8 character. + pub fn quote<'a>(&self, mut in_bytes: &'a [u8]) -> Result, QuoteError> { + if in_bytes.is_empty() { + // Empty string. Special case that isn't meaningful as only part of a word. + return Ok(b"''"[..].into()); } - out.push(b'"'); - out.into() + if !self.allow_nul && in_bytes.iter().any(|&b| b == b'\0') { + return Err(QuoteError::Nul); + } + let mut out: Vec = Vec::new(); + while !in_bytes.is_empty() { + // Pick a quoting strategy for some prefix of the input. Normally this will cover the + // entire input, but in some case we might need to divide the input into multiple chunks + // that are quoted differently. + let (cur_len, strategy) = quoting_strategy(in_bytes); + if cur_len == in_bytes.len() && strategy == QuotingStrategy::Unquoted && out.is_empty() { + // Entire string can be represented unquoted. Reuse the allocation. + return Ok(in_bytes.into()); + } + let (cur_chunk, rest) = in_bytes.split_at(cur_len); + assert!(rest.len() < in_bytes.len()); // no infinite loop + in_bytes = rest; + append_quoted_chunk(&mut out, cur_chunk, strategy); + } + Ok(out.into()) + } + +} + +#[derive(PartialEq)] +enum QuotingStrategy { + /// No quotes and no backslash escapes. (If backslash escapes would be necessary, we use a + /// different strategy instead.) + Unquoted, + /// Single quoted. + SingleQuoted, + /// Double quotes, potentially with backslash escapes. + DoubleQuoted, + // TODO: add $'xxx' and "$(printf 'xxx')" styles +} + +/// Is this ASCII byte okay to emit unquoted? +const fn unquoted_ok(c: u8) -> bool { + match c as char { + // Allowed characters: + '+' | '-' | '.' | '/' | ':' | '@' | ']' | '_' | + '0'..='9' | 'A'..='Z' | 'a'..='z' + => true, + + // Non-allowed characters: + // From POSIX https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html + // "The application shall quote the following characters if they are to represent themselves:" + '|' | '&' | ';' | '<' | '>' | '(' | ')' | '$' | '`' | '\\' | '"' | '\'' | ' ' | '\t' | '\n' | + // "and the following may need to be quoted under certain circumstances[..]:" + '*' | '?' | '[' | '#' | '~' | '=' | '%' | + // Brace expansion. These ought to be in the POSIX list but aren't yet; + // see: https://www.austingroupbugs.net/view.php?id=1193 + '{' | '}' | + // Also quote comma, just to be safe in the extremely odd case that the user of this crate + // is intentionally placing a quoted string inside a brace expansion, e.g.: + // format!("echo foo{{a,b,{}}}" | shlex::quote(some_str)) + ',' | + // '\r' is allowed in a word by all real shells I tested, but is treated as a word + // separator by Python `shlex` | and might be translated to '\n' in interactive mode. + '\r' | + // '!' and '^' are treated specially in interactive mode; see quoting_warning. + '!' | '^' | + // Nul bytes and control characters. + '\x00' ..= '\x1f' | '\x7f' + => false, + '\u{80}' ..= '\u{10ffff}' => { + // This is unreachable since `unquoted_ok` is only called for 0..128. + // Non-ASCII bytes are handled separately in `quoting_strategy`. + // Can't call unreachable!() from `const fn` on old Rust, so... + unquoted_ok(c) + }, + } + // Note: The logic cited above for quoting comma might suggest that `..` should also be quoted, + // it as a special case of brace expansion). But it's not necessary. There are three cases: + // + // 1. The user wants comma-based brace expansion, but the untrusted string being `quote`d + // contains `..`, so they get something like `{foo,bar,3..5}`. + // => That's safe; both Bash and Zsh expand this to `foo bar 3..5` rather than + // `foo bar 3 4 5`. The presence of commas disables sequence expression expansion. + // + // 2. The user wants comma-based brace expansion where the contents of the braces are a + // variable number of `quote`d strings and nothing else. There happens to be exactly + // one string and it contains `..`, so they get something like `{3..5}`. + // => Then this will expand as a sequence expression, which is unintended. But I don't mind, + // because any such code is already buggy. Suppose the untrusted string *didn't* contain + // `,` or `..`, resulting in shell input like `{foo}`. Then the shell would interpret it + // as the literal string `{foo}` rather than brace-expanding it into `foo`. + // + // 3. The user wants a sequence expression and wants to supply an untrusted string as one of + // the endpoints or the increment. + // => Well, that's just silly, since the endpoints can only be numbers or single letters. +} + +/// Optimized version of `unquoted_ok`. +fn unquoted_ok_fast(c: u8) -> bool { + const UNQUOTED_OK_MASK: u128 = { + // Make a mask of all bytes in 0..<0x80 that pass. + let mut c = 0u8; + let mut mask = 0u128; + while c < 0x80 { + if unquoted_ok(c) { + mask |= 1u128 << c; + } + c += 1; + } + mask + }; + ((UNQUOTED_OK_MASK >> c) & 1) != 0 +} + +/// Is this ASCII byte okay to emit in single quotes? +fn single_quoted_ok(c: u8) -> bool { + match c { + // No single quotes in single quotes. + b'\'' => false, + // To work around a Bash bug, ^ is only allowed right after an opening single quote; see + // quoting_warning. + b'^' => false, + // Backslashes in single quotes are literal according to POSIX, but Fish treats them as an + // escape character. Ban them. Fish doesn't aim to be POSIX-compatible, but we *can* + // achieve Fish compatibility using double quotes, so we might as well. + b'\\' => false, + _ => true + } +} + +/// Is this ASCII byte okay to emit in double quotes? +fn double_quoted_ok(c: u8) -> bool { + match c { + // Work around Python `shlex` bug where parsing "\`" and "\$" doesn't strip the + // backslash, even though POSIX requires it. + b'`' | b'$' => false, + // '!' and '^' are treated specially in interactive mode; see quoting_warning. + b'!' | b'^' => false, + _ => true + } +} + +/// Given an input, return a quoting strategy that can cover some prefix of the string, along with +/// the size of that prefix. +/// +/// Precondition: input size is nonzero. (Empty strings are handled by the caller.) +/// Postcondition: returned size is nonzero. +#[cfg_attr(manual_codegen_check, inline(never))] +fn quoting_strategy(in_bytes: &[u8]) -> (usize, QuotingStrategy) { + const UNQUOTED_OK: u8 = 1; + const SINGLE_QUOTED_OK: u8 = 2; + const DOUBLE_QUOTED_OK: u8 = 4; + + let mut prev_ok = SINGLE_QUOTED_OK | DOUBLE_QUOTED_OK | UNQUOTED_OK; + let mut i = 0; + + if in_bytes[0] == b'^' { + // To work around a Bash bug, ^ is only allowed right after an opening single quote; see + // quoting_warning. + prev_ok = SINGLE_QUOTED_OK; + i = 1; + } + + while i < in_bytes.len() { + let c = in_bytes[i]; + let mut cur_ok = prev_ok; + + if c >= 0x80 { + // Normally, non-ASCII characters shouldn't require quoting, but see quoting_warning.md + // about \xa0. For now, just treat all non-ASCII characters as requiring quotes. This + // also ensures things are safe in the off-chance that you're in a legacy 8-bit locale that + // has additional characters satisfying `isblank`. + cur_ok &= !UNQUOTED_OK; + } else { + if !unquoted_ok_fast(c) { + cur_ok &= !UNQUOTED_OK; + } + if !single_quoted_ok(c){ + cur_ok &= !SINGLE_QUOTED_OK; + } + if !double_quoted_ok(c) { + cur_ok &= !DOUBLE_QUOTED_OK; + } + } + + if cur_ok == 0 { + // There are no quoting strategies that would work for both the previous characters and + // this one. So we have to end the chunk before this character. The caller will call + // `quoting_strategy` again to handle the rest of the string. + break; + } + + prev_ok = cur_ok; + i += 1; + } + + // Pick the best allowed strategy. + let strategy = if prev_ok & UNQUOTED_OK != 0 { + QuotingStrategy::Unquoted + } else if prev_ok & SINGLE_QUOTED_OK != 0 { + QuotingStrategy::SingleQuoted + } else if prev_ok & DOUBLE_QUOTED_OK != 0 { + QuotingStrategy::DoubleQuoted } else { - in_bytes.into() + unreachable!() + }; + debug_assert!(i > 0); + (i, strategy) +} + +fn append_quoted_chunk(out: &mut Vec, cur_chunk: &[u8], strategy: QuotingStrategy) { + match strategy { + QuotingStrategy::Unquoted => { + out.extend_from_slice(cur_chunk); + }, + QuotingStrategy::SingleQuoted => { + out.reserve(cur_chunk.len() + 2); + out.push(b'\''); + out.extend_from_slice(cur_chunk); + out.push(b'\''); + }, + QuotingStrategy::DoubleQuoted => { + out.reserve(cur_chunk.len() + 2); + out.push(b'"'); + for &c in cur_chunk.into_iter() { + if let b'$' | b'`' | b'"' | b'\\' = c { + // Add a preceding backslash. + // Note: We shouldn't actually get here for $ and ` because they don't pass + // `double_quoted_ok`. + out.push(b'\\'); + } + // Add the character itself. + out.push(c); + } + out.push(b'"'); + }, } } /// Convenience function that consumes an iterable of words and turns it into a single byte string, /// quoting words when necessary. Consecutive words will be separated by a single space. -pub fn join<'a, I: core::iter::IntoIterator>(words: I) -> Vec { - words.into_iter() - .map(quote) - .collect::>() - .join(&b' ') +/// +/// Uses default settings except that nul bytes are passed through, which [may be +/// dangerous](quoting_warning#nul-bytes), leading to this function being deprecated. +/// +/// Equivalent to [`Quoter::new().allow_nul(true).join(words).unwrap()`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The string equivalent is [shlex::join]. +#[deprecated(since = "1.3.0", note = "replace with `try_join(words)?` to avoid nul byte danger")] +pub fn join<'a, I: IntoIterator>(words: I) -> Vec { + Quoter::new().allow_nul(true).join(words).unwrap() +} + +/// Convenience function that consumes an iterable of words and turns it into a single byte string, +/// quoting words when necessary. Consecutive words will be separated by a single space. +/// +/// Uses default settings. The only error that can be returned is [`QuoteError::Nul`]. +/// +/// Equivalent to [`Quoter::new().join(words)`](Quoter). +/// +/// The string equivalent is [shlex::try_join]. +pub fn try_join<'a, I: IntoIterator>(words: I) -> Result, QuoteError> { + Quoter::new().join(words) +} + +/// Given a single word, return a string suitable to encode it as a shell argument. +/// +/// Uses default settings except that nul bytes are passed through, which [may be +/// dangerous](quoting_warning#nul-bytes), leading to this function being deprecated. +/// +/// Equivalent to [`Quoter::new().allow_nul(true).quote(in_bytes).unwrap()`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The string equivalent is [shlex::quote]. +#[deprecated(since = "1.3.0", note = "replace with `try_quote(str)?` to avoid nul byte danger")] +pub fn quote(in_bytes: &[u8]) -> Cow<[u8]> { + Quoter::new().allow_nul(true).quote(in_bytes).unwrap() +} + +/// Given a single word, return a string suitable to encode it as a shell argument. +/// +/// Uses default settings. The only error that can be returned is [`QuoteError::Nul`]. +/// +/// Equivalent to [`Quoter::new().quote(in_bytes)`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The string equivalent is [shlex::try_quote]. +pub fn try_quote(in_bytes: &[u8]) -> Result, QuoteError> { + Quoter::new().quote(in_bytes) } #[cfg(test)] const INVALID_UTF8: &[u8] = b"\xa1"; +#[cfg(test)] +const INVALID_UTF8_SINGLEQUOTED: &[u8] = b"'\xa1'"; #[test] +#[allow(invalid_from_utf8)] fn test_invalid_utf8() { // Check that our test string is actually invalid UTF-8. assert!(core::str::from_utf8(INVALID_UTF8).is_err()); @@ -250,19 +553,24 @@ fn test_lineno() { } #[test] +#[allow(deprecated)] fn test_quote() { + // Validate behavior with invalid UTF-8: + assert_eq!(quote(INVALID_UTF8), INVALID_UTF8_SINGLEQUOTED); + // Replicate a few tests from lib.rs. No need to replicate all of them. + assert_eq!(quote(b""), &b"''"[..]); assert_eq!(quote(b"foobar"), &b"foobar"[..]); - assert_eq!(quote(b"foo bar"), &b"\"foo bar\""[..]); - assert_eq!(quote(b"\""), &b"\"\\\"\""[..]); - assert_eq!(quote(b""), &b"\"\""[..]); - assert_eq!(quote(INVALID_UTF8), INVALID_UTF8); + assert_eq!(quote(b"foo bar"), &b"'foo bar'"[..]); + assert_eq!(quote(b"'\""), &b"\"'\\\"\""[..]); + assert_eq!(quote(b""), &b"''"[..]); } #[test] +#[allow(deprecated)] fn test_join() { + // Validate behavior with invalid UTF-8: + assert_eq!(join(vec![INVALID_UTF8]), INVALID_UTF8_SINGLEQUOTED); + // Replicate a few tests from lib.rs. No need to replicate all of them. assert_eq!(join(vec![]), &b""[..]); - assert_eq!(join(vec![&b""[..]]), &b"\"\""[..]); - assert_eq!(join(vec![&b"a"[..], &b"b"[..]]), &b"a b"[..]); - assert_eq!(join(vec![&b"foo bar"[..], &b"baz"[..]]), &b"\"foo bar\" baz"[..]); - assert_eq!(join(vec![INVALID_UTF8]), INVALID_UTF8); + assert_eq!(join(vec![&b""[..]]), b"''"); } diff --git a/vendor/shlex/src/lib.rs b/vendor/shlex/src/lib.rs index 444c1fab1..aa5c3067a 100644 --- a/vendor/shlex/src/lib.rs +++ b/vendor/shlex/src/lib.rs @@ -3,21 +3,37 @@ // the MIT license , at your option. This file may not be // copied, modified, or distributed except according to those terms. -//! Same idea as (but implementation not directly based on) the Python shlex module. However, this -//! implementation does not support any of the Python module's customization because it makes -//! parsing slower and is fairly useless. You only get the default settings of shlex.split, which -//! mimic the POSIX shell: -//! +//! Parse strings like, and escape strings for, POSIX shells. //! -//! This implementation also deviates from the Python version in not treating `\r` specially, which -//! I believe is more compliant. -//! -//! This is a string-friendly wrapper around the [bytes] module that works on the underlying byte -//! slices. The algorithms in this crate are oblivious to UTF-8 high bytes, so working directly -//! with bytes is a safe micro-optimization. +//! Same idea as (but implementation not directly based on) the Python shlex module. //! //! Disabling the `std` feature (which is enabled by default) will allow the crate to work in //! `no_std` environments, where the `alloc` crate, and a global allocator, are available. +//! +//! ## Warning +//! +//! The [`try_quote`]/[`try_join`] family of APIs does not quote control characters (because they +//! cannot be quoted portably). +//! +//! This is fully safe in noninteractive contexts, like shell scripts and `sh -c` arguments (or +//! even scripts `source`d from interactive shells). +//! +//! But if you are quoting for human consumption, you should keep in mind that ugly inputs produce +//! ugly outputs (which may not be copy-pastable). +//! +//! And if by chance you are piping the output of [`try_quote`]/[`try_join`] directly to the stdin +//! of an interactive shell, you should stop, because control characters can lead to arbitrary +//! command injection. +//! +//! For more information, and for information about more minor issues, please see [quoting_warning]. +//! +//! ## Compatibility +//! +//! This crate's quoting functionality tries to be compatible with **any POSIX-compatible shell**; +//! it's tested against `bash`, `zsh`, `dash`, Busybox `ash`, and `mksh`, plus `fish` (which is not +//! POSIX-compatible but close enough). +//! +//! It also aims to be compatible with Python `shlex` and C `wordexp`. #![cfg_attr(not(feature = "std"), no_std)] @@ -31,6 +47,9 @@ use alloc::vec; use alloc::borrow::ToOwned; pub mod bytes; +#[cfg(all(doc, not(doctest)))] +#[path = "quoting_warning.md"] +pub mod quoting_warning; /// An iterator that takes an input string and splits it into the words using the same syntax as /// the POSIX shell. @@ -76,27 +95,151 @@ pub fn split(in_str: &str) -> Option> { if shl.had_error { None } else { Some(res) } } -/// Given a single word, return a string suitable to encode it as a shell argument. -pub fn quote(in_str: &str) -> Cow { - match bytes::quote(in_str.as_bytes()) { - Cow::Borrowed(out) => { - // Safety: given valid UTF-8, bytes::quote() will always return valid UTF-8. - unsafe { core::str::from_utf8_unchecked(out) }.into() - } - Cow::Owned(out) => { - // Safety: given valid UTF-8, bytes::quote() will always return valid UTF-8. - unsafe { String::from_utf8_unchecked(out) }.into() +/// Errors from [`Quoter::quote`], [`Quoter::join`], etc. (and their [`bytes`] counterparts). +/// +/// By default, the only error that can be returned is [`QuoteError::Nul`]. If you call +/// `allow_nul(true)`, then no errors can be returned at all. Any error variants added in the +/// future will not be enabled by default; they will be enabled through corresponding non-default +/// [`Quoter`] options. +/// +/// ...In theory. In the unlikely event that additional classes of inputs are discovered that, +/// like nul bytes, are fundamentally unsafe to quote even for non-interactive shells, the risk +/// will be mitigated by adding corresponding [`QuoteError`] variants that *are* enabled by +/// default. +#[non_exhaustive] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum QuoteError { + /// The input contained a nul byte. In most cases, shells fundamentally [cannot handle strings + /// containing nul bytes](quoting_warning#nul-bytes), no matter how they are quoted. But if + /// you're sure you can handle nul bytes, you can call `allow_nul(true)` on the `Quoter` to let + /// them pass through. + Nul, +} + +impl core::fmt::Display for QuoteError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + QuoteError::Nul => f.write_str("cannot shell-quote string containing nul byte"), } } } +#[cfg(feature = "std")] +impl std::error::Error for QuoteError {} + +/// A more configurable interface to quote strings. If you only want the default settings you can +/// use the convenience functions [`try_quote`] and [`try_join`]. +/// +/// The bytes equivalent is [`bytes::Quoter`]. +#[derive(Default, Debug, Clone)] +pub struct Quoter { + inner: bytes::Quoter, +} + +impl Quoter { + /// Create a new [`Quoter`] with default settings. + #[inline] + pub fn new() -> Self { + Self::default() + } + + /// Set whether to allow [nul bytes](quoting_warning#nul-bytes). By default they are not + /// allowed and will result in an error of [`QuoteError::Nul`]. + #[inline] + pub fn allow_nul(mut self, allow: bool) -> Self { + self.inner = self.inner.allow_nul(allow); + self + } + + /// Convenience function that consumes an iterable of words and turns it into a single string, + /// quoting words when necessary. Consecutive words will be separated by a single space. + pub fn join<'a, I: IntoIterator>(&self, words: I) -> Result { + // Safety: given valid UTF-8, bytes::join() will always return valid UTF-8. + self.inner.join(words.into_iter().map(|s| s.as_bytes())) + .map(|bytes| unsafe { String::from_utf8_unchecked(bytes) }) + } + + /// Given a single word, return a string suitable to encode it as a shell argument. + pub fn quote<'a>(&self, in_str: &'a str) -> Result, QuoteError> { + Ok(match self.inner.quote(in_str.as_bytes())? { + Cow::Borrowed(out) => { + // Safety: given valid UTF-8, bytes::quote() will always return valid UTF-8. + unsafe { core::str::from_utf8_unchecked(out) }.into() + } + Cow::Owned(out) => { + // Safety: given valid UTF-8, bytes::quote() will always return valid UTF-8. + unsafe { String::from_utf8_unchecked(out) }.into() + } + }) + } +} + +impl From for Quoter { + fn from(inner: bytes::Quoter) -> Quoter { + Quoter { inner } + } +} + +impl From for bytes::Quoter { + fn from(quoter: Quoter) -> bytes::Quoter { + quoter.inner + } +} + /// Convenience function that consumes an iterable of words and turns it into a single string, /// quoting words when necessary. Consecutive words will be separated by a single space. +/// +/// Uses default settings except that nul bytes are passed through, which [may be +/// dangerous](quoting_warning#nul-bytes), leading to this function being deprecated. +/// +/// Equivalent to [`Quoter::new().allow_nul(true).join(words).unwrap()`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The bytes equivalent is [bytes::join]. +#[deprecated(since = "1.3.0", note = "replace with `try_join(words)?` to avoid nul byte danger")] pub fn join<'a, I: IntoIterator>(words: I) -> String { - words.into_iter() - .map(quote) - .collect::>() - .join(" ") + Quoter::new().allow_nul(true).join(words).unwrap() +} + +/// Convenience function that consumes an iterable of words and turns it into a single string, +/// quoting words when necessary. Consecutive words will be separated by a single space. +/// +/// Uses default settings. The only error that can be returned is [`QuoteError::Nul`]. +/// +/// Equivalent to [`Quoter::new().join(words)`](Quoter). +/// +/// The bytes equivalent is [bytes::try_join]. +pub fn try_join<'a, I: IntoIterator>(words: I) -> Result { + Quoter::new().join(words) +} + +/// Given a single word, return a string suitable to encode it as a shell argument. +/// +/// Uses default settings except that nul bytes are passed through, which [may be +/// dangerous](quoting_warning#nul-bytes), leading to this function being deprecated. +/// +/// Equivalent to [`Quoter::new().allow_nul(true).quote(in_str).unwrap()`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The bytes equivalent is [bytes::quote]. +#[deprecated(since = "1.3.0", note = "replace with `try_quote(str)?` to avoid nul byte danger")] +pub fn quote(in_str: &str) -> Cow { + Quoter::new().allow_nul(true).quote(in_str).unwrap() +} + +/// Given a single word, return a string suitable to encode it as a shell argument. +/// +/// Uses default settings. The only error that can be returned is [`QuoteError::Nul`]. +/// +/// Equivalent to [`Quoter::new().quote(in_str)`](Quoter). +/// +/// (That configuration never returns `Err`, so this function does not panic.) +/// +/// The bytes equivalent is [bytes::try_quote]. +pub fn try_quote(in_str: &str) -> Result, QuoteError> { + Quoter::new().quote(in_str) } #[cfg(test)] @@ -141,17 +284,75 @@ fn test_lineno() { } #[test] +#[cfg_attr(not(feature = "std"), allow(unreachable_code, unused_mut))] fn test_quote() { - assert_eq!(quote("foobar"), "foobar"); - assert_eq!(quote("foo bar"), "\"foo bar\""); - assert_eq!(quote("\""), "\"\\\"\""); - assert_eq!(quote(""), "\"\""); + // This is a list of (unquoted, quoted) pairs. + // But it's using a single long (raw) string literal with an ad-hoc format, just because it's + // hard to read if we have to put the test strings through Rust escaping on top of the escaping + // being tested. (Even raw string literals are noisy for short strings). + // Ad-hoc: "NL" is replaced with a literal newline; no other escape sequences. + let tests = r#" + <> => <''> + => + => <'foo bar'> + <"foo bar'"> => <"\"foo bar'\""> + <'foo bar'> => <"'foo bar'"> + <"> => <'"'> + <"'> => <"\"'"> + => <'hello!world'> + <'hello!world> => <"'hello"'!world'> + <'hello!> => <"'hello"'!'> + => <'hello ''^ world'> + => + => <'!world'"'"> + <{a, b}> => <'{a, b}'> + => <'NL'> + <^> => <'^'> + => + => <'NLx''^'> + => <'NL''^x'> + => <'NL ''^x'> + <{a,b}> => <'{a,b}'> + => <'a,b'> + + <'$> => <"'"'$'> + <"^> => <'"''^'> + "#; + let mut ok = true; + for test in tests.trim().split('\n') { + let parts: Vec = test + .replace("NL", "\n") + .split("=>") + .map(|part| part.trim().trim_start_matches('<').trim_end_matches('>').to_owned()) + .collect(); + assert!(parts.len() == 2); + let unquoted = &*parts[0]; + let quoted_expected = &*parts[1]; + let quoted_actual = try_quote(&parts[0]).unwrap(); + if quoted_expected != quoted_actual { + #[cfg(not(feature = "std"))] + panic!("FAIL: for input <{}>, expected <{}>, got <{}>", + unquoted, quoted_expected, quoted_actual); + #[cfg(feature = "std")] + println!("FAIL: for input <{}>, expected <{}>, got <{}>", + unquoted, quoted_expected, quoted_actual); + ok = false; + } + } + assert!(ok); } #[test] +#[allow(deprecated)] fn test_join() { assert_eq!(join(vec![]), ""); - assert_eq!(join(vec![""]), "\"\""); + assert_eq!(join(vec![""]), "''"); assert_eq!(join(vec!["a", "b"]), "a b"); - assert_eq!(join(vec!["foo bar", "baz"]), "\"foo bar\" baz"); + assert_eq!(join(vec!["foo bar", "baz"]), "'foo bar' baz"); +} + +#[test] +fn test_fallible() { + assert_eq!(try_join(vec!["\0"]), Err(QuoteError::Nul)); + assert_eq!(try_quote("\0"), Err(QuoteError::Nul)); } diff --git a/vendor/shlex/src/quoting_warning.md b/vendor/shlex/src/quoting_warning.md new file mode 100644 index 000000000..fab9857be --- /dev/null +++ b/vendor/shlex/src/quoting_warning.md @@ -0,0 +1,365 @@ +// vim: textwidth=99 +/* +Meta note: This file is loaded as a .rs file by rustdoc only. +*/ +/*! + +A more detailed version of the [warning at the top level](super#warning) about the `quote`/`join` +family of APIs. + +In general, passing the output of these APIs to a shell should recover the original string(s). +This page lists cases where it fails to do so. + +In noninteractive contexts, there are only minor issues. 'Noninteractive' includes shell scripts +and `sh -c` arguments, or even scripts `source`d from interactive shells. The issues are: + +- [Nul bytes](#nul-bytes) + +- [Overlong commands](#overlong-commands) + +If you are writing directly to the stdin of an interactive (`-i`) shell (i.e., if you are +pretending to be a terminal), or if you are writing to a cooked-mode pty (even if the other end is +noninteractive), then there is a **severe** security issue: + +- [Control characters](#control-characters-interactive-contexts-only) + +Finally, there are some [solved issues](#solved-issues). + +# List of issues + +## Nul bytes + +For non-interactive shells, the most problematic input is nul bytes (bytes with value 0). The +non-deprecated functions all default to returning [`QuoteError::Nul`] when encountering them, but +the deprecated [`quote`] and [`join`] functions leave them as-is. + +In Unix, nul bytes can't appear in command arguments, environment variables, or filenames. It's +not a question of proper quoting; they just can't be used at all. This is a consequence of Unix's +system calls all being designed around nul-terminated C strings. + +Shells inherit that limitation. Most of them do not accept nul bytes in strings even internally. +Even when they do, it's pretty much useless or even dangerous, since you can't pass them to +external commands. + +In some cases, you might fail to pass the nul byte to the shell in the first place. For example, +the following code uses [`join`] to tunnel a command over an SSH connection: + +```rust +std::process::Command::new("ssh") + .arg("myhost") + .arg("--") + .arg(join(my_cmd_args)) +``` + +If any argument in `my_cmd_args` contains a nul byte, then `join(my_cmd_args)` will contain a nul +byte. But `join(my_cmd_args)` is itself being passed as an argument to a command (the ssh +command), and command arguments can't contain nul bytes! So this will simply result in the +`Command` failing to launch. + +Still, there are other ways to smuggle nul bytes into a shell. How the shell reacts depends on the +shell and the method of smuggling. For example, here is Bash 5.2.21 exhibiting three different +behaviors: + +- With ANSI-C quoting, the string is truncated at the first nul byte: + ```bash + $ echo $'foo\0bar' | hexdump -C + 00000000 66 6f 6f 0a |foo.| + ``` + +- With command substitution, nul bytes are removed with a warning: + ```bash + $ echo $(printf 'foo\0bar') | hexdump -C + bash: warning: command substitution: ignored null byte in input + 00000000 66 6f 6f 62 61 72 0a |foobar.| + ``` + +- When a nul byte appears directly in a shell script, it's removed with no warning: + ```bash + $ printf 'echo "foo\0bar"' | bash | hexdump -C + 00000000 66 6f 6f 62 61 72 0a |foobar.| + ``` + +Zsh, in contrast, actually allows nul bytes internally, in shell variables and even arguments to +builtin commands. But if a variable is exported to the environment, or if an argument is used for +an external command, then the child process will see it silently truncated at the first nul. This +might actually be more dangerous, depending on the use case. + +## Overlong commands + +If you pass a long string into a shell, several things might happen: + +- It might succeed, yet the shell might have trouble actually doing anything with it. For example: + + ```bash + x=$(printf '%010000000d' 0); /bin/echo $x + bash: /bin/echo: Argument list too long + ``` + +- If you're using certain shells (e.g. Busybox Ash) *and* using a pty for communication, then the + shell will impose a line length limit, ignoring all input past the limit. + +- If you're using a pty in cooked mode, then by default, if you write so many bytes as input that + it fills the kernel's internal buffer, the kernel will simply drop those bytes, instead of + blocking waiting for the shell to empty out the buffer. In other words, random bits of input can + be lost, which is obviously insecure. + +Future versions of this crate may add an option to [`Quoter`] to check the length for you. + +## Control characters (*interactive contexts only*) + +Control characters are the bytes from `\x00` to `\x1f`, plus `\x7f`. `\x00` (the nul byte) is +discussed [above](#nul-bytes), but what about the rest? Well, many of them correspond to terminal +keyboard shortcuts. For example, when you press Ctrl-A at a shell prompt, your terminal sends the +byte `\x01`. The shell sees that byte and (if not configured differently) takes the standard +action for Ctrl-A, which is to move the cursor to the beginning of the line. + +This means that it's quite dangerous to pipe bytes to an interactive shell. For example, here is a +program that tries to tell Bash to echo an arbitrary string, 'safely': +```rust +use std::process::{Command, Stdio}; +use std::io::Write; + +let evil_string = "\x01do_something_evil; "; +let quoted = shlex::try_quote(evil_string).unwrap(); +println!("quoted string is {:?}", quoted); + +let mut bash = Command::new("bash") + .arg("-i") // force interactive mode + .stdin(Stdio::piped()) + .spawn() + .unwrap(); +let stdin = bash.stdin.as_mut().unwrap(); +write!(stdin, "echo {}\n", quoted).unwrap(); +``` + +Here's the output of the program (with irrelevant bits removed): + +```text +quoted string is "'\u{1}do_something_evil; '" +/tmp comex$ do_something_evil; 'echo ' +bash: do_something_evil: command not found +bash: echo : command not found +``` + +Even though we quoted it, Bash still ran an arbitrary command! + +This is not because the quoting was insufficient, per se. In single quotes, all input is supposed +to be treated as raw data until the closing single quote. And in fact, this would work fine +without the `"-i"` argument. + +But line input is a separate stage from shell syntax parsing. After all, if you type a single +quote on the keyboard, you wouldn't expect it to disable all your keyboard shortcuts. So a control +character always has its designated effect, no matter if it's quoted or backslash-escaped. + +Also, some control characters are interpreted by the kernel tty layer instead, like CTRL-C to send +SIGINT. These can be an issue even with noninteractive shells, but only if using a pty for +communication, as opposed to a pipe. + +To be safe, you just have to avoid sending them. + +### Why not just use hex escapes? + +In any normal programming languages, this would be no big deal. + +Any normal language has a way to escape arbitrary characters in strings by writing out their +numeric values. For example, Rust lets you write them in hexadecimal, like `"\x4f"` (or +`"\u{1d546}"` for Unicode). In this way, arbitrary strings can be represented using only 'nice' +simple characters. Any remotely suspicious character can be replaced with a numeric escape +sequence, where the escape sequence itself consists only of alphanumeric characters and some +punctuation. The result may not be the most readable[^choices], but it's quite safe from being +misinterpreted or corrupted in transit. + +Shell is not normal. It has no numeric escape sequences. + +There are a few different ways to quote characters (unquoted, unquoted-with-backslash, single +quotes, double quotes), but all of them involve writing the character itself. If the input +contains a control character, the output must contain that same character. + +### Mitigation: terminal filters + +In practice, automating interactive shells like in the above example is pretty uncommon these days. +In most cases, the only way for a programmatically generated string to make its way to the input of +an interactive shell is if a human copies and pastes it into their terminal. + +And many terminals detect when you paste a string containing control characters. iTerm2 strips +them out; gnome-terminal replaces them with alternate characters[^gr]; Kitty outright prompts for +confirmation. This mitigates the risk. + +But it's not perfect. Some other terminals don't implement this check or implement it incorrectly. +Also, these checks tend to not filter the tab character, which could trigger tab completion. In +most cases that's a non-issue, because most shells support paste bracketing, which disables tab and +some other control characters[^bracketing] within pasted text. But in some cases paste bracketing +gets disabled. + +### Future possibility: ANSI-C quoting + +I said that shell syntax has no numeric escapes, but that only applies to *portable* shell syntax. +Bash and Zsh support an obscure alternate quoting style with the syntax `$'foo'`. It's called +["ANSI-C quoting"][ansic], and inside it you can use all the escape sequences supported by C, +including hex escapes: + +```bash +$ echo $'\x41\n\x42' +A +B +``` + +But other shells don't support it — including Dash, a popular choice for `/bin/sh`, and Busybox's +Ash, frequently seen on stripped-down embedded systems. This crate's quoting functionality [tries +to be compatible](crate#compatibility) with those shells, plus all other POSIX-compatible shells. +That makes ANSI-C quoting a no-go. + +Still, future versions of this crate may provide an option to enable ANSI-C quoting, at the cost of +reduced portability. + +### Future possibility: printf + +Another option would be to invoke the `printf` command, which is required by POSIX to support octal +escapes. For example, you could 'escape' the Rust string `"\x01"` into the shell syntax `"$(printf +'\001')"`. The shell will execute the command `printf` with the first argument being literally a +backslash followed by three digits; `printf` will output the actual byte with value 1; and the +shell will substitute that back into the original command. + +The problem is that 'escaping' a string into a command substitution just feels too surprising. If +nothing else, it only works with an actual shell; [other languages' shell parsing +routines](crate#compatibility) wouldn't understand it. Neither would this crate's own parser, +though that could be fixed. + +Future versions of this crate may provide an option to use `printf` for quoting. + +### Special note: newlines + +Did you know that `\r` and `\n` are control characters? They aren't as dangerous as other control +characters (if quoted properly). But there's still an issue with them in interactive contexts. + +Namely, in some cases, interactive shells and/or the tty layer will 'helpfully' translate between +different line ending conventions. The possibilities include replacing `\r` with `\n`, replacing +`\n` with `\r\n`, and others. This can't result in command injection, but it's still a lossy +transformation which can result in a failure to round-trip (i.e. the shell sees a different string +from what was originally passed to `quote`). + +Numeric escapes would solve this as well. + +# Solved issues + +## Solved: Past vulnerability (GHSA-r7qv-8r2h-pg27 / RUSTSEC-2024-XXX) + +Versions of this crate before 1.3.0 did not quote `{`, `}`, and `\xa0`. + +See: +- +- (TODO: Add Rustsec link) + +## Solved: `!` and `^` + +There are two non-control characters which have a special meaning in interactive contexts only: `!` and +`^`. Luckily, these can be escaped adequately. + +The `!` character triggers [history expansion][he]; the `^` character can trigger a variant of +history expansion known as [Quick Substitution][qs]. Both of these characters get expanded even +inside of double-quoted strings\! + +If we're in a double-quoted string, then we can't just escape these characters with a backslash. +Only a specific set of characters can be backslash-escaped inside double quotes; the set of +supported characters depends on the shell, but it often doesn't include `!` and `^`.[^escbs] +Trying to backslash-escape an unsupported character produces a literal backslash: +```bash +$ echo "\!" +\! +``` + +However, these characters don't get expanded in single-quoted strings, so this crate just +single-quotes them. + +But there's a Bash bug where `^` actually does get partially expanded in single-quoted strings: +```bash +$ echo ' +> ^a^b +> ' + +!!:s^a^b +``` + +To work around that, this crate forces `^` to appear right after an opening single quote. For +example, the string `"^` is quoted into `'"''^'` instead of `'"^'`. This restriction is overkill, +since `^` is only meaningful right after a newline, but it's a sufficient restriction (after all, a +`^` character can't be preceded by a newline if it's forced to be preceded by a single quote), and +for now it simplifies things. + +## Solved: `\xa0` + +The byte `\xa0` may be treated as a shell word separator, specifically on Bash on macOS when using +the default UTF-8 locale, only when the input is invalid UTF-8. This crate handles the issue by +always using quotes for arguments containing this byte. + +In fact, this crate always uses quotes for arguments containing any non-ASCII bytes. This may be +changed in the future, since it's a bit unfriendly to non-English users. But for now it +minimizes risk, especially considering the large number of different legacy single-byte locales +someone might hypothetically be running their shell in. + +### Demonstration + +```bash +$ echo -e 'ls a\xa0b' | bash +ls: a: No such file or directory +ls: b: No such file or directory +``` +The normal behavior would be to output a single line, e.g.: +```bash +$ echo -e 'ls a\xa0b' | bash +ls: cannot access 'a'$'\240''b': No such file or directory +``` +(The specific quoting in the error doesn't matter.) + +### Cause + +Just for fun, here's why this behavior occurs: + +Bash decides which bytes serve as word separators based on the libc function [`isblank`][isblank]. +On macOS on UTF-8 locales, this passes for `\xa0`, corresponding to U+00A0 NO-BREAK SPACE. + +This is doubly unique compared to the other systems I tested (Linux/glibc, Linux/musl, and +Windows/MSVC). First, the other systems don't allow bytes in the range [0x80, 0xFF] to pass +isfoo functions in UTF-8 locales, even if the corresponding Unicode codepoint +does pass, as determined by the wide-character equivalent function, iswfoo. +Second, the other systems don't treat U+00A0 as blank (even using `iswblank`). + +Meanwhile, Bash checks for multi-byte sequences and forbids them from being treated as special +characters, so the proper UTF-8 encoding of U+00A0, `b"\xc2\xa0"`, is not treated as a word +separator. Treatment as a word separator only happens for `b"\xa0"` alone, which is illegal UTF-8. + +[ansic]: https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html +[he]: https://www.gnu.org/software/bash/manual/html_node/History-Interaction.html +[qs]: https://www.gnu.org/software/bash/manual/html_node/Event-Designators.html +[isblank]: https://man7.org/linux/man-pages/man3/isblank.3p.html +[nul]: #nul-bytes + +[^choices]: This can lead to tough choices over which + characters to escape and which to leave as-is, especially when Unicode gets involved and you + have to balance the risk of confusion with the benefit of properly supporting non-English + languages. +
+
+ We don't have the luxury of those choices. + +[^gr]: For example, backspace (in Unicode lingo, U+0008 BACKSPACE) turns into U+2408 SYMBOL FOR BACKSPACE. + +[^bracketing]: It typically disables almost all handling of control characters by the shell proper, + but one necessary exception is the end-of-paste sequence itself (which starts with the control + character `\x1b`). In addition, paste bracketing does not suppress handling of control + characters by the kernel tty layer, such as `\x03` sending SIGINT (which typically clears the + currently typed command, making it dangerous in a similar way to `\x01`). + +[^escbs]: For example, Dash doesn't remove the backslash from `"\!"` because it simply doesn't know + anything about `!` as a special character: it doesn't support history expansion. On the other + end of the spectrum, Zsh supports history expansion and does remove the backslash — though only + in interactive mode. Bash's behavior is weirder. It supports history expansion, and if you + write `"\!"`, the backslash does prevent history expansion from occurring — but it doesn't get + removed! + +*/ + +// `use` declarations to make auto links work: +use ::{quote, join, Shlex, Quoter, QuoteError}; + +// TODO: add more about copy-paste and human readability. diff --git a/vendor/smallvec/.cargo-checksum.json b/vendor/smallvec/.cargo-checksum.json index 563316cb8..bdb1fcd31 100644 --- a/vendor/smallvec/.cargo-checksum.json +++ b/vendor/smallvec/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"12129d19d241f8b8041854ed140f6bdfb05ec43742d0f80779e40b1b24365c79","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"d82015eae942ee5cf74ace8c3c260ee2c6b5bcbeeb87254d2c72622c747a708a","debug_metadata/README.md":"4d7f1c1b2c25ce2231ef71864d06e54323867459035b53bc9e00f66a0a44f82e","debug_metadata/smallvec.natvis":"3092ddebd8fffc3486536d7f27f8c5eae3a8a093d45cd8eeb3946ea2b0c35a15","scripts/run_miri.sh":"74a9f9adc43f986e81977b03846f7dd00122a0150bd8ec3fe4842a1a787e0f07","src/arbitrary.rs":"22e55cfbf60374945b30e6d0855129eff67cd8b878cef6fa997e1f4be67b9e3d","src/lib.rs":"fbae23a885178a0a8e1372e81e85fd9d65f4416f53ab489b1bde65854396ff48","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"11c951cb4da40e13de1f7058e023cd29e857216e1e3243111a63ae79e931dbc6","tests/debugger_visualizer.rs":"185456ad253957fc0c9e904ff8a1135397ac991c29fa3c60f75d8d81f7463022","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"} \ No newline at end of file +{"files":{"Cargo.toml":"668bb964a243127d65605bb7a0d8d3c81bcbd8f7656a5b5734766ef534b4abcb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"d82015eae942ee5cf74ace8c3c260ee2c6b5bcbeeb87254d2c72622c747a708a","debug_metadata/README.md":"4d7f1c1b2c25ce2231ef71864d06e54323867459035b53bc9e00f66a0a44f82e","debug_metadata/smallvec.natvis":"3092ddebd8fffc3486536d7f27f8c5eae3a8a093d45cd8eeb3946ea2b0c35a15","scripts/run_miri.sh":"74a9f9adc43f986e81977b03846f7dd00122a0150bd8ec3fe4842a1a787e0f07","src/arbitrary.rs":"22e55cfbf60374945b30e6d0855129eff67cd8b878cef6fa997e1f4be67b9e3d","src/lib.rs":"25fe85b6ae7b3972211bf57aeded4c7b72c47e4d843c7a4ba66908442197b5a0","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"29c6e5dad62ebfea74e5116ac4a344b127b91cfb769fe9ba8b02b53773cf7ec8","tests/debugger_visualizer.rs":"185456ad253957fc0c9e904ff8a1135397ac991c29fa3c60f75d8d81f7463022","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"} \ No newline at end of file diff --git a/vendor/smallvec/Cargo.toml b/vendor/smallvec/Cargo.toml index d85fba766..baba15315 100644 --- a/vendor/smallvec/Cargo.toml +++ b/vendor/smallvec/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "smallvec" -version = "1.11.2" +version = "1.13.1" authors = ["The Servo Project Developers"] description = "'Small vector' optimization: store up to a small number of items on the stack" documentation = "https://docs.rs/smallvec/" diff --git a/vendor/smallvec/src/lib.rs b/vendor/smallvec/src/lib.rs index f9a6c8a1a..cadb5d8b1 100644 --- a/vendor/smallvec/src/lib.rs +++ b/vendor/smallvec/src/lib.rs @@ -2384,6 +2384,20 @@ impl SmallVec<[T; N]> { data: SmallVecData::from_const(MaybeUninit::new(items)), } } + + /// Constructs a new `SmallVec` on the stack from an array without + /// copying elements. Also sets the length. The user is responsible + /// for ensuring that `len <= N`. + /// + /// This is a `const` version of [`SmallVec::from_buf_and_len_unchecked`] that is enabled by the feature `const_new`, with the limitation that it only works for arrays. + #[cfg_attr(docsrs, doc(cfg(feature = "const_new")))] + #[inline] + pub const unsafe fn from_const_with_len_unchecked(items: [T; N], len: usize) -> Self { + SmallVec { + capacity: len, + data: SmallVecData::from_const(MaybeUninit::new(items)), + } + } } #[cfg(feature = "const_generics")] diff --git a/vendor/smallvec/src/tests.rs b/vendor/smallvec/src/tests.rs index 936ad6f5e..3eab846bf 100644 --- a/vendor/smallvec/src/tests.rs +++ b/vendor/smallvec/src/tests.rs @@ -922,6 +922,12 @@ fn const_new() { assert_eq!(v.len(), 2); assert_eq!(v[0], 1); assert_eq!(v[1], 4); + let v = const_new_with_len(); + assert_eq!(v.capacity(), 4); + assert_eq!(v.len(), 3); + assert_eq!(v[0], 2); + assert_eq!(v[1], 5); + assert_eq!(v[2], 7); } #[cfg(feature = "const_new")] const fn const_new_inner() -> SmallVec<[i32; 4]> { @@ -935,6 +941,12 @@ const fn const_new_inline_sized() -> SmallVec<[i32; 4]> { const fn const_new_inline_args() -> SmallVec<[i32; 2]> { crate::smallvec_inline![1, 4] } +#[cfg(feature = "const_new")] +const fn const_new_with_len() -> SmallVec<[i32; 4]> { + unsafe { + SmallVec::<[i32; 4]>::from_const_with_len_unchecked([2, 5, 7, 0], 3) + } +} #[test] fn empty_macro() { diff --git a/vendor/socket2-0.4.10/.cargo-checksum.json b/vendor/socket2-0.4.10/.cargo-checksum.json deleted file mode 100644 index 515a00fd8..000000000 --- a/vendor/socket2-0.4.10/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"0f84ab2a54b9e7de3e3336672b8512ae454cdd464ed17ec8b411bcfe305a6659","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"b3fadb399050f2755504188e81dec8150f6a1eba86b6410a9ce9c1ea0c850287","src/lib.rs":"ee8b2687408aa92da9e35dc212d84c930910ca88fb64c21e1083f12645f50a26","src/sockaddr.rs":"da05e8851b17914deee8befbaeb9c41e1339cef28b0aba29b3ff9f97ca1c217e","src/socket.rs":"11eb76f6a91d5f1b16ab5077f34c68c14da907c5e6e6df9fb64eaaaa3e88a711","src/sockref.rs":"02de263cce039aaddaee5d6c2bb3940bdfae5697a3fc9df47d226fb3cac03cd9","src/sys/unix.rs":"d531eefd9b496412c45763c9f8340921aa203f7ffef058acf594676eed36e1cc","src/sys/windows.rs":"d271c768295c0f84e79f6286aa783ce15ab0265f150195824fdcd10003dada33"},"package":"9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"} \ No newline at end of file diff --git a/vendor/socket2-0.4.10/Cargo.toml b/vendor/socket2-0.4.10/Cargo.toml deleted file mode 100644 index ec3bc6aa7..000000000 --- a/vendor/socket2-0.4.10/Cargo.toml +++ /dev/null @@ -1,68 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies. -# -# If you are reading this file be aware that the original Cargo.toml -# will likely look very different (and much more reasonable). -# See Cargo.toml.orig for the original contents. - -[package] -edition = "2018" -name = "socket2" -version = "0.4.10" -authors = [ - "Alex Crichton ", - "Thomas de Zeeuw ", -] -include = [ - "Cargo.toml", - "LICENSE-APACHE", - "LICENSE-MIT", - "README.md", - "src/**/*.rs", -] -description = """ -Utilities for handling networking sockets with a maximal amount of configuration -possible intended. -""" -homepage = "https://github.com/rust-lang/socket2" -documentation = "https://docs.rs/socket2" -readme = "README.md" -keywords = [ - "io", - "socket", - "network", -] -categories = [ - "api-bindings", - "network-programming", -] -license = "MIT OR Apache-2.0" -repository = "https://github.com/rust-lang/socket2" - -[package.metadata.docs.rs] -all-features = true -rustdoc-args = [ - "--cfg", - "docsrs", -] - -[package.metadata.playground] -features = ["all"] - -[features] -all = [] - -[target."cfg(unix)".dependencies.libc] -version = "0.2.149" - -[target."cfg(windows)".dependencies.winapi] -version = "0.3.9" -features = [ - "handleapi", - "ws2ipdef", - "ws2tcpip", -] diff --git a/vendor/socket2-0.4.10/LICENSE-APACHE b/vendor/socket2-0.4.10/LICENSE-APACHE deleted file mode 100644 index 16fe87b06..000000000 --- a/vendor/socket2-0.4.10/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/socket2-0.4.10/LICENSE-MIT b/vendor/socket2-0.4.10/LICENSE-MIT deleted file mode 100644 index 39e0ed660..000000000 --- a/vendor/socket2-0.4.10/LICENSE-MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2014 Alex Crichton - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/vendor/socket2-0.4.10/README.md b/vendor/socket2-0.4.10/README.md deleted file mode 100644 index 77963b746..000000000 --- a/vendor/socket2-0.4.10/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# Socket2 - -Socket2 is a crate that provides utilities for creating and using sockets. - -The goal of this crate is to create and use a socket using advanced -configuration options (those that are not available in the types in the standard -library) without using any unsafe code. - -This crate provides as direct as possible access to the system's functionality -for sockets, this means little effort to provide cross-platform utilities. It is -up to the user to know how to use sockets when using this crate. *If you don't -know how to create a socket using libc/system calls then this crate is not for -you*. Most, if not all, functions directly relate to the equivalent system call -with no error handling applied, so no handling errors such as `EINTR`. As a -result using this crate can be a little wordy, but it should give you maximal -flexibility over configuration of sockets. - -See the [API documentation] for more. - -[API documentation]: https://docs.rs/socket2 - -# Two branches - -Currently Socket2 supports two versions: v0.4 and v0.3. Version 0.4 is developed -in the master branch, version 0.3 in the [v0.3.x branch]. - -[v0.3.x branch]: https://github.com/rust-lang/socket2/tree/v0.3.x - -# OS support - -Socket2 attempts to support the same OS/architectures as Rust does, see -https://doc.rust-lang.org/nightly/rustc/platform-support.html. However this is -not always possible, below is current list of support OSs. - -*If your favorite OS is not on the list consider contributing it! See [issue -#78].* - -[issue #78]: https://github.com/rust-lang/socket2/issues/78 - -### Tier 1 - -These OSs are tested with each commit in the CI and must always pass the tests. -All functions/types/etc., excluding ones behind the `all` feature, must work on -these OSs. - -* Linux -* macOS -* Windows - -### Tier 2 - -These OSs are currently build in the CI, but not tested. Not all -functions/types/etc. may work on these OSs, even ones **not** behind the `all` -feature flag. - -* Android -* FreeBSD -* Fuchsia -* iOS -* illumos -* NetBSD -* Redox -* Solaris - -# Minimum Supported Rust Version (MSRV) - -Socket2 uses 1.46.0 as MSRV. - -# License - -This project is licensed under either of - - * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or - https://www.apache.org/licenses/LICENSE-2.0) - * MIT license ([LICENSE-MIT](LICENSE-MIT) or - https://opensource.org/licenses/MIT) - -at your option. - -### Contribution - -Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in this project by you, as defined in the Apache-2.0 license, -shall be dual licensed as above, without any additional terms or conditions. diff --git a/vendor/socket2-0.4.10/src/lib.rs b/vendor/socket2-0.4.10/src/lib.rs deleted file mode 100644 index aa932a2c3..000000000 --- a/vendor/socket2-0.4.10/src/lib.rs +++ /dev/null @@ -1,487 +0,0 @@ -// Copyright 2015 The Rust Project Developers. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Utilities for creating and using sockets. -//! -//! The goal of this crate is to create and use a socket using advanced -//! configuration options (those that are not available in the types in the -//! standard library) without using any unsafe code. -//! -//! This crate provides as direct as possible access to the system's -//! functionality for sockets, this means little effort to provide -//! cross-platform utilities. It is up to the user to know how to use sockets -//! when using this crate. *If you don't know how to create a socket using -//! libc/system calls then this crate is not for you*. Most, if not all, -//! functions directly relate to the equivalent system call with no error -//! handling applied, so no handling errors such as [`EINTR`]. As a result using -//! this crate can be a little wordy, but it should give you maximal flexibility -//! over configuration of sockets. -//! -//! [`EINTR`]: std::io::ErrorKind::Interrupted -//! -//! # Examples -//! -//! ```no_run -//! # fn main() -> std::io::Result<()> { -//! use std::net::{SocketAddr, TcpListener}; -//! use socket2::{Socket, Domain, Type}; -//! -//! // Create a TCP listener bound to two addresses. -//! let socket = Socket::new(Domain::IPV6, Type::STREAM, None)?; -//! -//! socket.set_only_v6(false)?; -//! let address: SocketAddr = "[::1]:12345".parse().unwrap(); -//! socket.bind(&address.into())?; -//! socket.listen(128)?; -//! -//! let listener: TcpListener = socket.into(); -//! // ... -//! # drop(listener); -//! # Ok(()) } -//! ``` -//! -//! ## Features -//! -//! This crate has a single feature `all`, which enables all functions even ones -//! that are not available on all OSs. - -#![doc(html_root_url = "https://docs.rs/socket2/0.4")] -#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)] -// Show required OS/features on docs.rs. -#![cfg_attr(docsrs, feature(doc_cfg))] -// Disallow warnings when running tests. -#![cfg_attr(test, deny(warnings))] -// Disallow warnings in examples. -#![doc(test(attr(deny(warnings))))] - -use std::fmt; -use std::mem::MaybeUninit; -use std::net::SocketAddr; -use std::ops::{Deref, DerefMut}; -use std::time::Duration; - -/// Macro to implement `fmt::Debug` for a type, printing the constant names -/// rather than a number. -/// -/// Note this is used in the `sys` module and thus must be defined before -/// defining the modules. -macro_rules! impl_debug { - ( - // Type name for which to implement `fmt::Debug`. - $type: path, - $( - $(#[$target: meta])* - // The flag(s) to check. - // Need to specific the libc crate because Windows doesn't use - // `libc` but `winapi`. - $libc: ident :: $flag: ident - ),+ $(,)* - ) => { - impl std::fmt::Debug for $type { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let string = match self.0 { - $( - $(#[$target])* - $libc :: $flag => stringify!($flag), - )+ - n => return write!(f, "{}", n), - }; - f.write_str(string) - } - } - }; -} - -/// Macro to convert from one network type to another. -macro_rules! from { - ($from: ty, $for: ty) => { - impl From<$from> for $for { - fn from(socket: $from) -> $for { - #[cfg(unix)] - unsafe { - <$for>::from_raw_fd(socket.into_raw_fd()) - } - #[cfg(windows)] - unsafe { - <$for>::from_raw_socket(socket.into_raw_socket()) - } - } - } - }; -} - -mod sockaddr; -mod socket; -mod sockref; - -#[cfg_attr(unix, path = "sys/unix.rs")] -#[cfg_attr(windows, path = "sys/windows.rs")] -mod sys; - -#[cfg(not(any(windows, unix)))] -compile_error!("Socket2 doesn't support the compile target"); - -use sys::c_int; - -pub use sockaddr::SockAddr; -pub use socket::Socket; -pub use sockref::SockRef; - -#[cfg(not(any( - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use socket::InterfaceIndexOrAddress; - -/// Specification of the communication domain for a socket. -/// -/// This is a newtype wrapper around an integer which provides a nicer API in -/// addition to an injection point for documentation. Convenience constants such -/// as [`Domain::IPV4`], [`Domain::IPV6`], etc, are provided to avoid reaching -/// into libc for various constants. -/// -/// This type is freely interconvertible with C's `int` type, however, if a raw -/// value needs to be provided. -#[derive(Copy, Clone, Eq, PartialEq)] -pub struct Domain(c_int); - -impl Domain { - /// Domain for IPv4 communication, corresponding to `AF_INET`. - pub const IPV4: Domain = Domain(sys::AF_INET); - - /// Domain for IPv6 communication, corresponding to `AF_INET6`. - pub const IPV6: Domain = Domain(sys::AF_INET6); - - /// Returns the correct domain for `address`. - pub const fn for_address(address: SocketAddr) -> Domain { - match address { - SocketAddr::V4(_) => Domain::IPV4, - SocketAddr::V6(_) => Domain::IPV6, - } - } -} - -impl From for Domain { - fn from(d: c_int) -> Domain { - Domain(d) - } -} - -impl From for c_int { - fn from(d: Domain) -> c_int { - d.0 - } -} - -/// Specification of communication semantics on a socket. -/// -/// This is a newtype wrapper around an integer which provides a nicer API in -/// addition to an injection point for documentation. Convenience constants such -/// as [`Type::STREAM`], [`Type::DGRAM`], etc, are provided to avoid reaching -/// into libc for various constants. -/// -/// This type is freely interconvertible with C's `int` type, however, if a raw -/// value needs to be provided. -#[derive(Copy, Clone, Eq, PartialEq)] -pub struct Type(c_int); - -impl Type { - /// Type corresponding to `SOCK_STREAM`. - /// - /// Used for protocols such as TCP. - pub const STREAM: Type = Type(sys::SOCK_STREAM); - - /// Type corresponding to `SOCK_DGRAM`. - /// - /// Used for protocols such as UDP. - pub const DGRAM: Type = Type(sys::SOCK_DGRAM); - - /// Type corresponding to `SOCK_SEQPACKET`. - #[cfg(all(feature = "all", not(target_os = "espidf")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", not(target_os = "espidf")))))] - pub const SEQPACKET: Type = Type(sys::SOCK_SEQPACKET); - - /// Type corresponding to `SOCK_RAW`. - #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) - )] - pub const RAW: Type = Type(sys::SOCK_RAW); -} - -impl From for Type { - fn from(t: c_int) -> Type { - Type(t) - } -} - -impl From for c_int { - fn from(t: Type) -> c_int { - t.0 - } -} - -/// Protocol specification used for creating sockets via `Socket::new`. -/// -/// This is a newtype wrapper around an integer which provides a nicer API in -/// addition to an injection point for documentation. -/// -/// This type is freely interconvertible with C's `int` type, however, if a raw -/// value needs to be provided. -#[derive(Copy, Clone, Eq, PartialEq)] -pub struct Protocol(c_int); - -impl Protocol { - /// Protocol corresponding to `ICMPv4`. - pub const ICMPV4: Protocol = Protocol(sys::IPPROTO_ICMP); - - /// Protocol corresponding to `ICMPv6`. - pub const ICMPV6: Protocol = Protocol(sys::IPPROTO_ICMPV6); - - /// Protocol corresponding to `TCP`. - pub const TCP: Protocol = Protocol(sys::IPPROTO_TCP); - - /// Protocol corresponding to `UDP`. - pub const UDP: Protocol = Protocol(sys::IPPROTO_UDP); -} - -impl From for Protocol { - fn from(p: c_int) -> Protocol { - Protocol(p) - } -} - -impl From for c_int { - fn from(p: Protocol) -> c_int { - p.0 - } -} - -/// Flags for incoming messages. -/// -/// Flags provide additional information about incoming messages. -#[cfg(not(target_os = "redox"))] -#[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] -#[derive(Copy, Clone, Eq, PartialEq)] -pub struct RecvFlags(c_int); - -#[cfg(not(target_os = "redox"))] -impl RecvFlags { - /// Check if the message contains a truncated datagram. - /// - /// This flag is only used for datagram-based sockets, - /// not for stream sockets. - /// - /// On Unix this corresponds to the `MSG_TRUNC` flag. - /// On Windows this corresponds to the `WSAEMSGSIZE` error code. - #[cfg(not(target_os = "espidf"))] - pub const fn is_truncated(self) -> bool { - self.0 & sys::MSG_TRUNC != 0 - } -} - -/// A version of [`IoSliceMut`] that allows the buffer to be uninitialised. -/// -/// [`IoSliceMut`]: std::io::IoSliceMut -#[repr(transparent)] -pub struct MaybeUninitSlice<'a>(sys::MaybeUninitSlice<'a>); - -impl<'a> fmt::Debug for MaybeUninitSlice<'a> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Debug::fmt(self.0.as_slice(), fmt) - } -} - -impl<'a> MaybeUninitSlice<'a> { - /// Creates a new `MaybeUninitSlice` wrapping a byte slice. - /// - /// # Panics - /// - /// Panics on Windows if the slice is larger than 4GB. - pub fn new(buf: &'a mut [MaybeUninit]) -> MaybeUninitSlice<'a> { - MaybeUninitSlice(sys::MaybeUninitSlice::new(buf)) - } -} - -impl<'a> Deref for MaybeUninitSlice<'a> { - type Target = [MaybeUninit]; - - fn deref(&self) -> &[MaybeUninit] { - self.0.as_slice() - } -} - -impl<'a> DerefMut for MaybeUninitSlice<'a> { - fn deref_mut(&mut self) -> &mut [MaybeUninit] { - self.0.as_mut_slice() - } -} - -/// Configures a socket's TCP keepalive parameters. -/// -/// See [`Socket::set_tcp_keepalive`]. -#[derive(Debug, Clone)] -pub struct TcpKeepalive { - #[cfg_attr(any(target_os = "openbsd", target_os = "vita"), allow(dead_code))] - time: Option, - #[cfg(not(any( - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - interval: Option, - #[cfg(not(any( - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "windows", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - retries: Option, -} - -impl TcpKeepalive { - /// Returns a new, empty set of TCP keepalive parameters. - pub const fn new() -> TcpKeepalive { - TcpKeepalive { - time: None, - #[cfg(not(any( - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - interval: None, - #[cfg(not(any( - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "windows", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - retries: None, - } - } - - /// Set the amount of time after which TCP keepalive probes will be sent on - /// idle connections. - /// - /// This will set `TCP_KEEPALIVE` on macOS and iOS, and - /// `TCP_KEEPIDLE` on all other Unix operating systems, except - /// OpenBSD and Haiku which don't support any way to set this - /// option. On Windows, this sets the value of the `tcp_keepalive` - /// struct's `keepalivetime` field. - /// - /// Some platforms specify this value in seconds, so sub-second - /// specifications may be omitted. - pub const fn with_time(self, time: Duration) -> Self { - Self { - time: Some(time), - ..self - } - } - - /// Set the value of the `TCP_KEEPINTVL` option. On Windows, this sets the - /// value of the `tcp_keepalive` struct's `keepaliveinterval` field. - /// - /// Sets the time interval between TCP keepalive probes. - /// - /// Some platforms specify this value in seconds, so sub-second - /// specifications may be omitted. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - windows, - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - windows, - ) - ))) - )] - pub const fn with_interval(self, interval: Duration) -> Self { - Self { - interval: Some(interval), - ..self - } - } - - /// Set the value of the `TCP_KEEPCNT` option. - /// - /// Set the maximum number of TCP keepalive probes that will be sent before - /// dropping a connection, if TCP keepalive is enabled on this socket. - #[cfg(all( - feature = "all", - any( - doc, - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))) - )] - pub const fn with_retries(self, retries: u32) -> Self { - Self { - retries: Some(retries), - ..self - } - } -} diff --git a/vendor/socket2-0.4.10/src/sockaddr.rs b/vendor/socket2-0.4.10/src/sockaddr.rs deleted file mode 100644 index e72101872..000000000 --- a/vendor/socket2-0.4.10/src/sockaddr.rs +++ /dev/null @@ -1,360 +0,0 @@ -use std::mem::{self, size_of, MaybeUninit}; -use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6}; -use std::{fmt, io}; - -use crate::sys::{ - sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t, AF_INET, - AF_INET6, -}; -#[cfg(windows)] -use winapi::shared::ws2ipdef::SOCKADDR_IN6_LH_u; - -/// The address of a socket. -/// -/// `SockAddr`s may be constructed directly to and from the standard library -/// [`SocketAddr`], [`SocketAddrV4`], and [`SocketAddrV6`] types. -#[derive(Clone)] -pub struct SockAddr { - storage: sockaddr_storage, - len: socklen_t, -} - -#[allow(clippy::len_without_is_empty)] -impl SockAddr { - /// Create a `SockAddr` from the underlying storage and its length. - /// - /// # Safety - /// - /// Caller must ensure that the address family and length match the type of - /// storage address. For example if `storage.ss_family` is set to `AF_INET` - /// the `storage` must be initialised as `sockaddr_in`, setting the content - /// and length appropriately. - /// - /// # Examples - /// - /// ``` - /// # fn main() -> std::io::Result<()> { - /// # #[cfg(unix)] { - /// use std::io; - /// use std::mem; - /// use std::os::unix::io::AsRawFd; - /// - /// use socket2::{SockAddr, Socket, Domain, Type}; - /// - /// let socket = Socket::new(Domain::IPV4, Type::STREAM, None)?; - /// - /// // Initialise a `SocketAddr` byte calling `getsockname(2)`. - /// let mut addr_storage: libc::sockaddr_storage = unsafe { mem::zeroed() }; - /// let mut len = mem::size_of_val(&addr_storage) as libc::socklen_t; - /// - /// // The `getsockname(2)` system call will intiliase `storage` for - /// // us, setting `len` to the correct length. - /// let res = unsafe { - /// libc::getsockname( - /// socket.as_raw_fd(), - /// (&mut addr_storage as *mut libc::sockaddr_storage).cast(), - /// &mut len, - /// ) - /// }; - /// if res == -1 { - /// return Err(io::Error::last_os_error()); - /// } - /// - /// let address = unsafe { SockAddr::new(addr_storage, len) }; - /// # drop(address); - /// # } - /// # Ok(()) - /// # } - /// ``` - pub const unsafe fn new(storage: sockaddr_storage, len: socklen_t) -> SockAddr { - SockAddr { storage, len } - } - - /// Initialise a `SockAddr` by calling the function `init`. - /// - /// The type of the address storage and length passed to the function `init` - /// is OS/architecture specific. - /// - /// The address is zeroed before `init` is called and is thus valid to - /// dereference and read from. The length initialised to the maximum length - /// of the storage. - /// - /// # Safety - /// - /// Caller must ensure that the address family and length match the type of - /// storage address. For example if `storage.ss_family` is set to `AF_INET` - /// the `storage` must be initialised as `sockaddr_in`, setting the content - /// and length appropriately. - /// - /// # Examples - /// - /// ``` - /// # fn main() -> std::io::Result<()> { - /// # #[cfg(unix)] { - /// use std::io; - /// use std::os::unix::io::AsRawFd; - /// - /// use socket2::{SockAddr, Socket, Domain, Type}; - /// - /// let socket = Socket::new(Domain::IPV4, Type::STREAM, None)?; - /// - /// // Initialise a `SocketAddr` byte calling `getsockname(2)`. - /// let (_, address) = unsafe { - /// SockAddr::init(|addr_storage, len| { - /// // The `getsockname(2)` system call will intiliase `storage` for - /// // us, setting `len` to the correct length. - /// if libc::getsockname(socket.as_raw_fd(), addr_storage.cast(), len) == -1 { - /// Err(io::Error::last_os_error()) - /// } else { - /// Ok(()) - /// } - /// }) - /// }?; - /// # drop(address); - /// # } - /// # Ok(()) - /// # } - /// ``` - pub unsafe fn init(init: F) -> io::Result<(T, SockAddr)> - where - F: FnOnce(*mut sockaddr_storage, *mut socklen_t) -> io::Result, - { - const STORAGE_SIZE: socklen_t = size_of::() as socklen_t; - // NOTE: `SockAddr::unix` depends on the storage being zeroed before - // calling `init`. - // NOTE: calling `recvfrom` with an empty buffer also depends on the - // storage being zeroed before calling `init` as the OS might not - // initialise it. - let mut storage = MaybeUninit::::zeroed(); - let mut len = STORAGE_SIZE; - init(storage.as_mut_ptr(), &mut len).map(|res| { - debug_assert!(len <= STORAGE_SIZE, "overflown address storage"); - let addr = SockAddr { - // Safety: zeroed-out `sockaddr_storage` is valid, caller must - // ensure at least `len` bytes are valid. - storage: storage.assume_init(), - len, - }; - (res, addr) - }) - } - - /// Returns this address's family. - pub const fn family(&self) -> sa_family_t { - self.storage.ss_family - } - - /// Returns the size of this address in bytes. - pub const fn len(&self) -> socklen_t { - self.len - } - - /// Returns a raw pointer to the address. - pub const fn as_ptr(&self) -> *const sockaddr { - &self.storage as *const _ as *const _ - } - - /// Returns a raw pointer to the address storage. - #[cfg(all(unix, not(target_os = "redox")))] - pub(crate) const fn as_storage_ptr(&self) -> *const sockaddr_storage { - &self.storage - } - - /// Returns this address as a `SocketAddr` if it is in the `AF_INET` (IPv4) - /// or `AF_INET6` (IPv6) family, otherwise returns `None`. - pub fn as_socket(&self) -> Option { - if self.storage.ss_family == AF_INET as sa_family_t { - // Safety: if the ss_family field is AF_INET then storage must be a sockaddr_in. - let addr = unsafe { &*(&self.storage as *const _ as *const sockaddr_in) }; - - let ip = crate::sys::from_in_addr(addr.sin_addr); - let port = u16::from_be(addr.sin_port); - Some(SocketAddr::V4(SocketAddrV4::new(ip, port))) - } else if self.storage.ss_family == AF_INET6 as sa_family_t { - // Safety: if the ss_family field is AF_INET6 then storage must be a sockaddr_in6. - let addr = unsafe { &*(&self.storage as *const _ as *const sockaddr_in6) }; - - let ip = crate::sys::from_in6_addr(addr.sin6_addr); - let port = u16::from_be(addr.sin6_port); - Some(SocketAddr::V6(SocketAddrV6::new( - ip, - port, - addr.sin6_flowinfo, - #[cfg(unix)] - addr.sin6_scope_id, - #[cfg(windows)] - unsafe { - *addr.u.sin6_scope_id() - }, - ))) - } else { - None - } - } - - /// Returns this address as a [`SocketAddrV4`] if it is in the `AF_INET` - /// family. - pub fn as_socket_ipv4(&self) -> Option { - match self.as_socket() { - Some(SocketAddr::V4(addr)) => Some(addr), - _ => None, - } - } - - /// Returns this address as a [`SocketAddrV6`] if it is in the `AF_INET6` - /// family. - pub fn as_socket_ipv6(&self) -> Option { - match self.as_socket() { - Some(SocketAddr::V6(addr)) => Some(addr), - _ => None, - } - } -} - -impl From for SockAddr { - fn from(addr: SocketAddr) -> SockAddr { - match addr { - SocketAddr::V4(addr) => addr.into(), - SocketAddr::V6(addr) => addr.into(), - } - } -} - -impl From for SockAddr { - fn from(addr: SocketAddrV4) -> SockAddr { - let sockaddr_in = sockaddr_in { - sin_family: AF_INET as sa_family_t, - sin_port: addr.port().to_be(), - sin_addr: crate::sys::to_in_addr(addr.ip()), - sin_zero: Default::default(), - #[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - ))] - sin_len: 0, - #[cfg(target_os = "vita")] - sin_vport: addr.port().to_be(), - }; - let mut storage = MaybeUninit::::zeroed(); - // Safety: A `sockaddr_in` is memory compatible with a `sockaddr_storage` - unsafe { (storage.as_mut_ptr() as *mut sockaddr_in).write(sockaddr_in) }; - SockAddr { - storage: unsafe { storage.assume_init() }, - len: mem::size_of::() as socklen_t, - } - } -} - -impl From for SockAddr { - fn from(addr: SocketAddrV6) -> SockAddr { - #[cfg(windows)] - let u = unsafe { - let mut u = mem::zeroed::(); - *u.sin6_scope_id_mut() = addr.scope_id(); - u - }; - - let sockaddr_in6 = sockaddr_in6 { - sin6_family: AF_INET6 as sa_family_t, - sin6_port: addr.port().to_be(), - sin6_addr: crate::sys::to_in6_addr(addr.ip()), - sin6_flowinfo: addr.flowinfo(), - #[cfg(unix)] - sin6_scope_id: addr.scope_id(), - #[cfg(windows)] - u, - #[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - ))] - sin6_len: 0, - #[cfg(target_os = "vita")] - sin6_vport: addr.port().to_be(), - #[cfg(any(target_os = "solaris", target_os = "illumos"))] - __sin6_src_id: 0, - }; - let mut storage = MaybeUninit::::zeroed(); - // Safety: A `sockaddr_in6` is memory compatible with a `sockaddr_storage` - unsafe { (storage.as_mut_ptr() as *mut sockaddr_in6).write(sockaddr_in6) }; - SockAddr { - storage: unsafe { storage.assume_init() }, - len: mem::size_of::() as socklen_t, - } - } -} - -impl fmt::Debug for SockAddr { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - let mut f = fmt.debug_struct("SockAddr"); - #[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "hermit", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "vxworks", - target_os = "nto", - ))] - f.field("ss_len", &self.storage.ss_len); - f.field("ss_family", &self.storage.ss_family) - .field("len", &self.len) - .finish() - } -} - -#[test] -fn ipv4() { - use std::net::Ipv4Addr; - let std = SocketAddrV4::new(Ipv4Addr::new(1, 2, 3, 4), 9876); - let addr = SockAddr::from(std); - assert_eq!(addr.family(), AF_INET as sa_family_t); - assert_eq!(addr.len(), size_of::() as socklen_t); - assert_eq!(addr.as_socket(), Some(SocketAddr::V4(std))); - assert_eq!(addr.as_socket_ipv4(), Some(std)); - assert!(addr.as_socket_ipv6().is_none()); - - let addr = SockAddr::from(SocketAddr::from(std)); - assert_eq!(addr.family(), AF_INET as sa_family_t); - assert_eq!(addr.len(), size_of::() as socklen_t); - assert_eq!(addr.as_socket(), Some(SocketAddr::V4(std))); - assert_eq!(addr.as_socket_ipv4(), Some(std)); - assert!(addr.as_socket_ipv6().is_none()); -} - -#[test] -fn ipv6() { - use std::net::Ipv6Addr; - let std = SocketAddrV6::new(Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8), 9876, 11, 12); - let addr = SockAddr::from(std); - assert_eq!(addr.family(), AF_INET6 as sa_family_t); - assert_eq!(addr.len(), size_of::() as socklen_t); - assert_eq!(addr.as_socket(), Some(SocketAddr::V6(std))); - assert!(addr.as_socket_ipv4().is_none()); - assert_eq!(addr.as_socket_ipv6(), Some(std)); - - let addr = SockAddr::from(SocketAddr::from(std)); - assert_eq!(addr.family(), AF_INET6 as sa_family_t); - assert_eq!(addr.len(), size_of::() as socklen_t); - assert_eq!(addr.as_socket(), Some(SocketAddr::V6(std))); - assert!(addr.as_socket_ipv4().is_none()); - assert_eq!(addr.as_socket_ipv6(), Some(std)); -} diff --git a/vendor/socket2-0.4.10/src/socket.rs b/vendor/socket2-0.4.10/src/socket.rs deleted file mode 100644 index 90649d9d3..000000000 --- a/vendor/socket2-0.4.10/src/socket.rs +++ /dev/null @@ -1,1968 +0,0 @@ -// Copyright 2015 The Rust Project Developers. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::fmt; -use std::io::{self, Read, Write}; -#[cfg(not(target_os = "redox"))] -use std::io::{IoSlice, IoSliceMut}; -use std::mem::MaybeUninit; -#[cfg(not(target_os = "nto"))] -use std::net::Ipv6Addr; -use std::net::{self, Ipv4Addr, Shutdown}; -#[cfg(unix)] -use std::os::unix::io::{FromRawFd, IntoRawFd}; -#[cfg(windows)] -use std::os::windows::io::{FromRawSocket, IntoRawSocket}; -use std::time::Duration; - -use crate::sys::{self, c_int, getsockopt, setsockopt, Bool}; -use crate::{Domain, Protocol, SockAddr, TcpKeepalive, Type}; -#[cfg(not(target_os = "redox"))] -use crate::{MaybeUninitSlice, RecvFlags}; - -/// Owned wrapper around a system socket. -/// -/// This type simply wraps an instance of a file descriptor (`c_int`) on Unix -/// and an instance of `SOCKET` on Windows. This is the main type exported by -/// this crate and is intended to mirror the raw semantics of sockets on -/// platforms as closely as possible. Almost all methods correspond to -/// precisely one libc or OS API call which is essentially just a "Rustic -/// translation" of what's below. -/// -/// ## Converting to and from other types -/// -/// This type can be freely converted into the network primitives provided by -/// the standard library, such as [`TcpStream`] or [`UdpSocket`], using the -/// [`From`] trait, see the example below. -/// -/// [`TcpStream`]: std::net::TcpStream -/// [`UdpSocket`]: std::net::UdpSocket -/// -/// # Notes -/// -/// Some methods that set options on `Socket` require two system calls to set -/// there options without overwriting previously set options. We do this by -/// first getting the current settings, applying the desired changes and than -/// updating the settings. This means that the operation is **not** atomic. This -/// can lead to a data race when two threads are changing options in parallel. -/// -/// # Examples -/// ```no_run -/// # fn main() -> std::io::Result<()> { -/// use std::net::{SocketAddr, TcpListener}; -/// use socket2::{Socket, Domain, Type}; -/// -/// // create a TCP listener bound to two addresses -/// let socket = Socket::new(Domain::IPV4, Type::STREAM, None)?; -/// -/// let address: SocketAddr = "[::1]:12345".parse().unwrap(); -/// let address = address.into(); -/// socket.bind(&address)?; -/// socket.bind(&address)?; -/// socket.listen(128)?; -/// -/// let listener: TcpListener = socket.into(); -/// // ... -/// # drop(listener); -/// # Ok(()) } -/// ``` -pub struct Socket { - inner: Inner, -} - -/// Store a `TcpStream` internally to take advantage of its niche optimizations on Unix platforms. -pub(crate) type Inner = std::net::TcpStream; - -impl Socket { - /// # Safety - /// - /// The caller must ensure `raw` is a valid file descriptor/socket. NOTE: - /// this should really be marked `unsafe`, but this being an internal - /// function, often passed as mapping function, it's makes it very - /// inconvenient to mark it as `unsafe`. - pub(crate) fn from_raw(raw: sys::Socket) -> Socket { - Socket { - inner: unsafe { - // SAFETY: the caller must ensure that `raw` is a valid file - // descriptor, but when it isn't it could return I/O errors, or - // potentially close a fd it doesn't own. All of that isn't - // memory unsafe, so it's not desired but never memory unsafe or - // causes UB. - // - // However there is one exception. We use `TcpStream` to - // represent the `Socket` internally (see `Inner` type), - // `TcpStream` has a layout optimisation that doesn't allow for - // negative file descriptors (as those are always invalid). - // Violating this assumption (fd never negative) causes UB, - // something we don't want. So check for that we have this - // `assert!`. - #[cfg(unix)] - assert!(raw >= 0, "tried to create a `Socket` with an invalid fd"); - sys::socket_from_raw(raw) - }, - } - } - - pub(crate) fn as_raw(&self) -> sys::Socket { - sys::socket_as_raw(&self.inner) - } - - pub(crate) fn into_raw(self) -> sys::Socket { - sys::socket_into_raw(self.inner) - } - - /// Creates a new socket and sets common flags. - /// - /// This function corresponds to `socket(2)` on Unix and `WSASocketW` on - /// Windows. - /// - /// On Unix-like systems, the close-on-exec flag is set on the new socket. - /// Additionally, on Apple platforms `SOCK_NOSIGPIPE` is set. On Windows, - /// the socket is made non-inheritable. - /// - /// [`Socket::new_raw`] can be used if you don't want these flags to be set. - pub fn new(domain: Domain, ty: Type, protocol: Option) -> io::Result { - let ty = set_common_type(ty); - Socket::new_raw(domain, ty, protocol).and_then(set_common_flags) - } - - /// Creates a new socket ready to be configured. - /// - /// This function corresponds to `socket(2)` on Unix and `WSASocketW` on - /// Windows and simply creates a new socket, no other configuration is done. - pub fn new_raw(domain: Domain, ty: Type, protocol: Option) -> io::Result { - let protocol = protocol.map(|p| p.0).unwrap_or(0); - sys::socket(domain.0, ty.0, protocol).map(Socket::from_raw) - } - - /// Creates a pair of sockets which are connected to each other. - /// - /// This function corresponds to `socketpair(2)`. - /// - /// This function sets the same flags as in done for [`Socket::new`], - /// [`Socket::pair_raw`] can be used if you don't want to set those flags. - #[cfg(any(doc, all(feature = "all", unix)))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", unix))))] - pub fn pair( - domain: Domain, - ty: Type, - protocol: Option, - ) -> io::Result<(Socket, Socket)> { - let ty = set_common_type(ty); - let (a, b) = Socket::pair_raw(domain, ty, protocol)?; - let a = set_common_flags(a)?; - let b = set_common_flags(b)?; - Ok((a, b)) - } - - /// Creates a pair of sockets which are connected to each other. - /// - /// This function corresponds to `socketpair(2)`. - #[cfg(any(doc, all(feature = "all", unix)))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", unix))))] - pub fn pair_raw( - domain: Domain, - ty: Type, - protocol: Option, - ) -> io::Result<(Socket, Socket)> { - let protocol = protocol.map(|p| p.0).unwrap_or(0); - sys::socketpair(domain.0, ty.0, protocol) - .map(|[a, b]| (Socket::from_raw(a), Socket::from_raw(b))) - } - - /// Binds this socket to the specified address. - /// - /// This function directly corresponds to the `bind(2)` function on Windows - /// and Unix. - pub fn bind(&self, address: &SockAddr) -> io::Result<()> { - sys::bind(self.as_raw(), address) - } - - /// Initiate a connection on this socket to the specified address. - /// - /// This function directly corresponds to the `connect(2)` function on - /// Windows and Unix. - /// - /// An error will be returned if `listen` or `connect` has already been - /// called on this builder. - /// - /// # Notes - /// - /// When using a non-blocking connect (by setting the socket into - /// non-blocking mode before calling this function), socket option can't be - /// set *while connecting*. This will cause errors on Windows. Socket - /// options can be safely set before and after connecting the socket. - pub fn connect(&self, address: &SockAddr) -> io::Result<()> { - sys::connect(self.as_raw(), address) - } - - /// Initiate a connection on this socket to the specified address, only - /// only waiting for a certain period of time for the connection to be - /// established. - /// - /// Unlike many other methods on `Socket`, this does *not* correspond to a - /// single C function. It sets the socket to nonblocking mode, connects via - /// connect(2), and then waits for the connection to complete with poll(2) - /// on Unix and select on Windows. When the connection is complete, the - /// socket is set back to blocking mode. On Unix, this will loop over - /// `EINTR` errors. - /// - /// # Warnings - /// - /// The non-blocking state of the socket is overridden by this function - - /// it will be returned in blocking mode on success, and in an indeterminate - /// state on failure. - /// - /// If the connection request times out, it may still be processing in the - /// background - a second call to `connect` or `connect_timeout` may fail. - pub fn connect_timeout(&self, addr: &SockAddr, timeout: Duration) -> io::Result<()> { - self.set_nonblocking(true)?; - let res = self.connect(addr); - self.set_nonblocking(false)?; - - match res { - Ok(()) => return Ok(()), - Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {} - #[cfg(unix)] - Err(ref e) if e.raw_os_error() == Some(libc::EINPROGRESS) => {} - Err(e) => return Err(e), - } - - sys::poll_connect(self, timeout) - } - - /// Mark a socket as ready to accept incoming connection requests using - /// [`Socket::accept()`]. - /// - /// This function directly corresponds to the `listen(2)` function on - /// Windows and Unix. - /// - /// An error will be returned if `listen` or `connect` has already been - /// called on this builder. - pub fn listen(&self, backlog: c_int) -> io::Result<()> { - sys::listen(self.as_raw(), backlog) - } - - /// Accept a new incoming connection from this listener. - /// - /// This function uses `accept4(2)` on platforms that support it and - /// `accept(2)` platforms that do not. - /// - /// This function sets the same flags as in done for [`Socket::new`], - /// [`Socket::accept_raw`] can be used if you don't want to set those flags. - pub fn accept(&self) -> io::Result<(Socket, SockAddr)> { - // Use `accept4` on platforms that support it. - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", - ))] - return self._accept4(libc::SOCK_CLOEXEC); - - // Fall back to `accept` on platforms that do not support `accept4`. - #[cfg(not(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", - )))] - { - let (socket, addr) = self.accept_raw()?; - let socket = set_common_flags(socket)?; - // `set_common_flags` does not disable inheritance on Windows because `Socket::new` - // unlike `accept` is able to create the socket with inheritance disabled. - #[cfg(windows)] - socket._set_no_inherit(true)?; - Ok((socket, addr)) - } - } - - /// Accept a new incoming connection from this listener. - /// - /// This function directly corresponds to the `accept(2)` function on - /// Windows and Unix. - pub fn accept_raw(&self) -> io::Result<(Socket, SockAddr)> { - sys::accept(self.as_raw()).map(|(inner, addr)| (Socket::from_raw(inner), addr)) - } - - /// Returns the socket address of the local half of this socket. - /// - /// # Notes - /// - /// Depending on the OS this may return an error if the socket is not - /// [bound]. - /// - /// [bound]: Socket::bind - pub fn local_addr(&self) -> io::Result { - sys::getsockname(self.as_raw()) - } - - /// Returns the socket address of the remote peer of this socket. - /// - /// # Notes - /// - /// This returns an error if the socket is not [`connect`ed]. - /// - /// [`connect`ed]: Socket::connect - pub fn peer_addr(&self) -> io::Result { - sys::getpeername(self.as_raw()) - } - - /// Returns the [`Type`] of this socket by checking the `SO_TYPE` option on - /// this socket. - pub fn r#type(&self) -> io::Result { - unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_TYPE).map(Type) } - } - - /// Creates a new independently owned handle to the underlying socket. - /// - /// # Notes - /// - /// On Unix this uses `F_DUPFD_CLOEXEC` and thus sets the `FD_CLOEXEC` on - /// the returned socket. - /// - /// On Windows this uses `WSA_FLAG_NO_HANDLE_INHERIT` setting inheriting to - /// false. - /// - /// On Windows this can **not** be used function cannot be used on a - /// QOS-enabled socket, see - /// . - pub fn try_clone(&self) -> io::Result { - sys::try_clone(self.as_raw()).map(Socket::from_raw) - } - - /// Moves this TCP stream into or out of nonblocking mode. - /// - /// # Notes - /// - /// On Unix this corresponds to calling `fcntl` (un)setting `O_NONBLOCK`. - /// - /// On Windows this corresponds to calling `ioctlsocket` (un)setting - /// `FIONBIO`. - pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - sys::set_nonblocking(self.as_raw(), nonblocking) - } - - /// Shuts down the read, write, or both halves of this connection. - /// - /// This function will cause all pending and future I/O on the specified - /// portions to return immediately with an appropriate value. - pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { - sys::shutdown(self.as_raw(), how) - } - - /// Receives data on the socket from the remote address to which it is - /// connected. - /// - /// The [`connect`] method will connect this socket to a remote address. - /// This method might fail if the socket is not connected. - /// - /// [`connect`]: Socket::connect - /// - /// # Safety - /// - /// Normally casting a `&mut [u8]` to `&mut [MaybeUninit]` would be - /// unsound, as that allows us to write uninitialised bytes to the buffer. - /// However this implementation promises to not write uninitialised bytes to - /// the `buf`fer and passes it directly to `recv(2)` system call. This - /// promise ensures that this function can be called using a `buf`fer of - /// type `&mut [u8]`. - /// - /// Note that the [`io::Read::read`] implementation calls this function with - /// a `buf`fer of type `&mut [u8]`, allowing initialised buffers to be used - /// without using `unsafe`. - pub fn recv(&self, buf: &mut [MaybeUninit]) -> io::Result { - self.recv_with_flags(buf, 0) - } - - /// Receives out-of-band (OOB) data on the socket from the remote address to - /// which it is connected by setting the `MSG_OOB` flag for this call. - /// - /// For more information, see [`recv`], [`out_of_band_inline`]. - /// - /// [`recv`]: Socket::recv - /// [`out_of_band_inline`]: Socket::out_of_band_inline - pub fn recv_out_of_band(&self, buf: &mut [MaybeUninit]) -> io::Result { - self.recv_with_flags(buf, sys::MSG_OOB) - } - - /// Identical to [`recv`] but allows for specification of arbitrary flags to - /// the underlying `recv` call. - /// - /// [`recv`]: Socket::recv - pub fn recv_with_flags( - &self, - buf: &mut [MaybeUninit], - flags: sys::c_int, - ) -> io::Result { - sys::recv(self.as_raw(), buf, flags) - } - - /// Receives data on the socket from the remote address to which it is - /// connected. Unlike [`recv`] this allows passing multiple buffers. - /// - /// The [`connect`] method will connect this socket to a remote address. - /// This method might fail if the socket is not connected. - /// - /// In addition to the number of bytes read, this function returns the flags - /// for the received message. See [`RecvFlags`] for more information about - /// the returned flags. - /// - /// [`recv`]: Socket::recv - /// [`connect`]: Socket::connect - /// - /// # Safety - /// - /// Normally casting a `IoSliceMut` to `MaybeUninitSlice` would be unsound, - /// as that allows us to write uninitialised bytes to the buffer. However - /// this implementation promises to not write uninitialised bytes to the - /// `bufs` and passes it directly to `recvmsg(2)` system call. This promise - /// ensures that this function can be called using `bufs` of type `&mut - /// [IoSliceMut]`. - /// - /// Note that the [`io::Read::read_vectored`] implementation calls this - /// function with `buf`s of type `&mut [IoSliceMut]`, allowing initialised - /// buffers to be used without using `unsafe`. - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn recv_vectored( - &self, - bufs: &mut [MaybeUninitSlice<'_>], - ) -> io::Result<(usize, RecvFlags)> { - self.recv_vectored_with_flags(bufs, 0) - } - - /// Identical to [`recv_vectored`] but allows for specification of arbitrary - /// flags to the underlying `recvmsg`/`WSARecv` call. - /// - /// [`recv_vectored`]: Socket::recv_vectored - /// - /// # Safety - /// - /// `recv_from_vectored` makes the same safety guarantees regarding `bufs` - /// as [`recv_vectored`]. - /// - /// [`recv_vectored`]: Socket::recv_vectored - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn recv_vectored_with_flags( - &self, - bufs: &mut [MaybeUninitSlice<'_>], - flags: c_int, - ) -> io::Result<(usize, RecvFlags)> { - sys::recv_vectored(self.as_raw(), bufs, flags) - } - - /// Receives data on the socket from the remote adress to which it is - /// connected, without removing that data from the queue. On success, - /// returns the number of bytes peeked. - /// - /// Successive calls return the same data. This is accomplished by passing - /// `MSG_PEEK` as a flag to the underlying `recv` system call. - /// - /// # Safety - /// - /// `peek` makes the same safety guarantees regarding the `buf`fer as - /// [`recv`]. - /// - /// [`recv`]: Socket::recv - pub fn peek(&self, buf: &mut [MaybeUninit]) -> io::Result { - self.recv_with_flags(buf, sys::MSG_PEEK) - } - - /// Receives data from the socket. On success, returns the number of bytes - /// read and the address from whence the data came. - /// - /// # Safety - /// - /// `recv_from` makes the same safety guarantees regarding the `buf`fer as - /// [`recv`]. - /// - /// [`recv`]: Socket::recv - pub fn recv_from(&self, buf: &mut [MaybeUninit]) -> io::Result<(usize, SockAddr)> { - self.recv_from_with_flags(buf, 0) - } - - /// Identical to [`recv_from`] but allows for specification of arbitrary - /// flags to the underlying `recvfrom` call. - /// - /// [`recv_from`]: Socket::recv_from - pub fn recv_from_with_flags( - &self, - buf: &mut [MaybeUninit], - flags: c_int, - ) -> io::Result<(usize, SockAddr)> { - sys::recv_from(self.as_raw(), buf, flags) - } - - /// Receives data from the socket. Returns the amount of bytes read, the - /// [`RecvFlags`] and the remote address from the data is coming. Unlike - /// [`recv_from`] this allows passing multiple buffers. - /// - /// [`recv_from`]: Socket::recv_from - /// - /// # Safety - /// - /// `recv_from_vectored` makes the same safety guarantees regarding `bufs` - /// as [`recv_vectored`]. - /// - /// [`recv_vectored`]: Socket::recv_vectored - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn recv_from_vectored( - &self, - bufs: &mut [MaybeUninitSlice<'_>], - ) -> io::Result<(usize, RecvFlags, SockAddr)> { - self.recv_from_vectored_with_flags(bufs, 0) - } - - /// Identical to [`recv_from_vectored`] but allows for specification of - /// arbitrary flags to the underlying `recvmsg`/`WSARecvFrom` call. - /// - /// [`recv_from_vectored`]: Socket::recv_from_vectored - /// - /// # Safety - /// - /// `recv_from_vectored` makes the same safety guarantees regarding `bufs` - /// as [`recv_vectored`]. - /// - /// [`recv_vectored`]: Socket::recv_vectored - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn recv_from_vectored_with_flags( - &self, - bufs: &mut [MaybeUninitSlice<'_>], - flags: c_int, - ) -> io::Result<(usize, RecvFlags, SockAddr)> { - sys::recv_from_vectored(self.as_raw(), bufs, flags) - } - - /// Receives data from the socket, without removing it from the queue. - /// - /// Successive calls return the same data. This is accomplished by passing - /// `MSG_PEEK` as a flag to the underlying `recvfrom` system call. - /// - /// On success, returns the number of bytes peeked and the address from - /// whence the data came. - /// - /// # Safety - /// - /// `peek_from` makes the same safety guarantees regarding the `buf`fer as - /// [`recv`]. - /// - /// # Note: Datagram Sockets - /// For datagram sockets, the behavior of this method when `buf` is smaller than - /// the datagram at the head of the receive queue differs between Windows and - /// Unix-like platforms (Linux, macOS, BSDs, etc: colloquially termed "*nix"). - /// - /// On *nix platforms, the datagram is truncated to the length of `buf`. - /// - /// On Windows, an error corresponding to `WSAEMSGSIZE` will be returned. - /// - /// For consistency between platforms, be sure to provide a sufficiently large buffer to avoid - /// truncation; the exact size required depends on the underlying protocol. - /// - /// If you just want to know the sender of the data, try [`peek_sender`]. - /// - /// [`recv`]: Socket::recv - /// [`peek_sender`]: Socket::peek_sender - pub fn peek_from(&self, buf: &mut [MaybeUninit]) -> io::Result<(usize, SockAddr)> { - self.recv_from_with_flags(buf, sys::MSG_PEEK) - } - - /// Retrieve the sender for the data at the head of the receive queue. - /// - /// This is equivalent to calling [`peek_from`] with a zero-sized buffer, - /// but suppresses the `WSAEMSGSIZE` error on Windows. - /// - /// [`peek_from`]: Socket::peek_from - pub fn peek_sender(&self) -> io::Result { - sys::peek_sender(self.as_raw()) - } - - /// Sends data on the socket to a connected peer. - /// - /// This is typically used on TCP sockets or datagram sockets which have - /// been connected. - /// - /// On success returns the number of bytes that were sent. - pub fn send(&self, buf: &[u8]) -> io::Result { - self.send_with_flags(buf, 0) - } - - /// Identical to [`send`] but allows for specification of arbitrary flags to the underlying - /// `send` call. - /// - /// [`send`]: #method.send - pub fn send_with_flags(&self, buf: &[u8], flags: c_int) -> io::Result { - sys::send(self.as_raw(), buf, flags) - } - - /// Send data to the connected peer. Returns the amount of bytes written. - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn send_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result { - self.send_vectored_with_flags(bufs, 0) - } - - /// Identical to [`send_vectored`] but allows for specification of arbitrary - /// flags to the underlying `sendmsg`/`WSASend` call. - /// - /// [`send_vectored`]: Socket::send_vectored - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn send_vectored_with_flags( - &self, - bufs: &[IoSlice<'_>], - flags: c_int, - ) -> io::Result { - sys::send_vectored(self.as_raw(), bufs, flags) - } - - /// Sends out-of-band (OOB) data on the socket to connected peer - /// by setting the `MSG_OOB` flag for this call. - /// - /// For more information, see [`send`], [`out_of_band_inline`]. - /// - /// [`send`]: #method.send - /// [`out_of_band_inline`]: #method.out_of_band_inline - pub fn send_out_of_band(&self, buf: &[u8]) -> io::Result { - self.send_with_flags(buf, sys::MSG_OOB) - } - - /// Sends data on the socket to the given address. On success, returns the - /// number of bytes written. - /// - /// This is typically used on UDP or datagram-oriented sockets. - pub fn send_to(&self, buf: &[u8], addr: &SockAddr) -> io::Result { - self.send_to_with_flags(buf, addr, 0) - } - - /// Identical to [`send_to`] but allows for specification of arbitrary flags - /// to the underlying `sendto` call. - /// - /// [`send_to`]: Socket::send_to - pub fn send_to_with_flags( - &self, - buf: &[u8], - addr: &SockAddr, - flags: c_int, - ) -> io::Result { - sys::send_to(self.as_raw(), buf, addr, flags) - } - - /// Send data to a peer listening on `addr`. Returns the amount of bytes - /// written. - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn send_to_vectored(&self, bufs: &[IoSlice<'_>], addr: &SockAddr) -> io::Result { - self.send_to_vectored_with_flags(bufs, addr, 0) - } - - /// Identical to [`send_to_vectored`] but allows for specification of - /// arbitrary flags to the underlying `sendmsg`/`WSASendTo` call. - /// - /// [`send_to_vectored`]: Socket::send_to_vectored - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn send_to_vectored_with_flags( - &self, - bufs: &[IoSlice<'_>], - addr: &SockAddr, - flags: c_int, - ) -> io::Result { - sys::send_to_vectored(self.as_raw(), bufs, addr, flags) - } -} - -/// Set `SOCK_CLOEXEC` and `NO_HANDLE_INHERIT` on the `ty`pe on platforms that -/// support it. -#[inline(always)] -fn set_common_type(ty: Type) -> Type { - // On platforms that support it set `SOCK_CLOEXEC`. - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", - ))] - let ty = ty._cloexec(); - - // On windows set `NO_HANDLE_INHERIT`. - #[cfg(windows)] - let ty = ty._no_inherit(); - - ty -} - -/// Set `FD_CLOEXEC` and `NOSIGPIPE` on the `socket` for platforms that need it. -#[inline(always)] -#[allow(clippy::unnecessary_wraps)] -fn set_common_flags(socket: Socket) -> io::Result { - // On platforms that don't have `SOCK_CLOEXEC` use `FD_CLOEXEC`. - #[cfg(all( - unix, - not(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", - target_os = "espidf", - target_os = "vita", - )) - ))] - socket._set_cloexec(true)?; - - // On Apple platforms set `NOSIGPIPE`. - #[cfg(target_vendor = "apple")] - socket._set_nosigpipe(true)?; - - Ok(socket) -} - -/// A local interface specified by its index or an address assigned to it. -/// -/// `Index(0)` and `Address(Ipv4Addr::UNSPECIFIED)` are equivalent and indicate -/// that an appropriate interface should be selected by the system. -#[cfg(not(any( - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "redox", - target_os = "solaris", -)))] -#[derive(Debug)] -pub enum InterfaceIndexOrAddress { - /// An interface index. - Index(u32), - /// An address assigned to an interface. - Address(Ipv4Addr), -} - -/// Socket options get/set using `SOL_SOCKET`. -/// -/// Additional documentation can be found in documentation of the OS. -/// * Linux: -/// * Windows: -impl Socket { - /// Get the value of the `SO_BROADCAST` option for this socket. - /// - /// For more information about this option, see [`set_broadcast`]. - /// - /// [`set_broadcast`]: Socket::set_broadcast - pub fn broadcast(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_BROADCAST) - .map(|broadcast| broadcast != 0) - } - } - - /// Set the value of the `SO_BROADCAST` option for this socket. - /// - /// When enabled, this socket is allowed to send packets to a broadcast - /// address. - pub fn set_broadcast(&self, broadcast: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_BROADCAST, - broadcast as c_int, - ) - } - } - - /// Get the value of the `SO_ERROR` option on this socket. - /// - /// This will retrieve the stored error in the underlying socket, clearing - /// the field in the process. This can be useful for checking errors between - /// calls. - pub fn take_error(&self) -> io::Result> { - match unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_ERROR) } { - Ok(0) => Ok(None), - Ok(errno) => Ok(Some(io::Error::from_raw_os_error(errno))), - Err(err) => Err(err), - } - } - - /// Get the value of the `SO_KEEPALIVE` option on this socket. - /// - /// For more information about this option, see [`set_keepalive`]. - /// - /// [`set_keepalive`]: Socket::set_keepalive - pub fn keepalive(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_KEEPALIVE) - .map(|keepalive| keepalive != 0) - } - } - - /// Set value for the `SO_KEEPALIVE` option on this socket. - /// - /// Enable sending of keep-alive messages on connection-oriented sockets. - pub fn set_keepalive(&self, keepalive: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_KEEPALIVE, - keepalive as c_int, - ) - } - } - - /// Get the value of the `SO_LINGER` option on this socket. - /// - /// For more information about this option, see [`set_linger`]. - /// - /// [`set_linger`]: Socket::set_linger - pub fn linger(&self) -> io::Result> { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER) - .map(from_linger) - } - } - - /// Set value for the `SO_LINGER` option on this socket. - /// - /// If `linger` is not `None`, a close(2) or shutdown(2) will not return - /// until all queued messages for the socket have been successfully sent or - /// the linger timeout has been reached. Otherwise, the call returns - /// immediately and the closing is done in the background. When the socket - /// is closed as part of exit(2), it always lingers in the background. - /// - /// # Notes - /// - /// On most OSs the duration only has a precision of seconds and will be - /// silently truncated. - /// - /// On Apple platforms (e.g. macOS, iOS, etc) this uses `SO_LINGER_SEC`. - pub fn set_linger(&self, linger: Option) -> io::Result<()> { - let linger = into_linger(linger); - unsafe { setsockopt(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER, linger) } - } - - /// Get value for the `SO_OOBINLINE` option on this socket. - /// - /// For more information about this option, see [`set_out_of_band_inline`]. - /// - /// [`set_out_of_band_inline`]: Socket::set_out_of_band_inline - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn out_of_band_inline(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_OOBINLINE) - .map(|oob_inline| oob_inline != 0) - } - } - - /// Set value for the `SO_OOBINLINE` option on this socket. - /// - /// If this option is enabled, out-of-band data is directly placed into the - /// receive data stream. Otherwise, out-of-band data is passed only when the - /// `MSG_OOB` flag is set during receiving. As per RFC6093, TCP sockets - /// using the Urgent mechanism are encouraged to set this flag. - #[cfg(not(target_os = "redox"))] - #[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] - pub fn set_out_of_band_inline(&self, oob_inline: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_OOBINLINE, - oob_inline as c_int, - ) - } - } - - /// Get value for the `SO_RCVBUF` option on this socket. - /// - /// For more information about this option, see [`set_recv_buffer_size`]. - /// - /// [`set_recv_buffer_size`]: Socket::set_recv_buffer_size - pub fn recv_buffer_size(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVBUF) - .map(|size| size as usize) - } - } - - /// Set value for the `SO_RCVBUF` option on this socket. - /// - /// Changes the size of the operating system's receive buffer associated - /// with the socket. - pub fn set_recv_buffer_size(&self, size: usize) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_RCVBUF, - size as c_int, - ) - } - } - - /// Get value for the `SO_RCVTIMEO` option on this socket. - /// - /// If the returned timeout is `None`, then `read` and `recv` calls will - /// block indefinitely. - pub fn read_timeout(&self) -> io::Result> { - sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO) - } - - /// Set value for the `SO_RCVTIMEO` option on this socket. - /// - /// If `timeout` is `None`, then `read` and `recv` calls will block - /// indefinitely. - pub fn set_read_timeout(&self, duration: Option) -> io::Result<()> { - sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO, duration) - } - - /// Get the value of the `SO_REUSEADDR` option on this socket. - /// - /// For more information about this option, see [`set_reuse_address`]. - /// - /// [`set_reuse_address`]: Socket::set_reuse_address - pub fn reuse_address(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_REUSEADDR) - .map(|reuse| reuse != 0) - } - } - - /// Set value for the `SO_REUSEADDR` option on this socket. - /// - /// This indicates that futher calls to `bind` may allow reuse of local - /// addresses. For IPv4 sockets this means that a socket may bind even when - /// there's a socket already listening on this port. - pub fn set_reuse_address(&self, reuse: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_REUSEADDR, - reuse as c_int, - ) - } - } - - /// Get the value of the `SO_SNDBUF` option on this socket. - /// - /// For more information about this option, see [`set_send_buffer_size`]. - /// - /// [`set_send_buffer_size`]: Socket::set_send_buffer_size - pub fn send_buffer_size(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDBUF) - .map(|size| size as usize) - } - } - - /// Set value for the `SO_SNDBUF` option on this socket. - /// - /// Changes the size of the operating system's send buffer associated with - /// the socket. - pub fn set_send_buffer_size(&self, size: usize) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::SOL_SOCKET, - sys::SO_SNDBUF, - size as c_int, - ) - } - } - - /// Get value for the `SO_SNDTIMEO` option on this socket. - /// - /// If the returned timeout is `None`, then `write` and `send` calls will - /// block indefinitely. - pub fn write_timeout(&self) -> io::Result> { - sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO) - } - - /// Set value for the `SO_SNDTIMEO` option on this socket. - /// - /// If `timeout` is `None`, then `write` and `send` calls will block - /// indefinitely. - pub fn set_write_timeout(&self, duration: Option) -> io::Result<()> { - sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO, duration) - } -} - -fn from_linger(linger: sys::linger) -> Option { - if linger.l_onoff == 0 { - None - } else { - Some(Duration::from_secs(linger.l_linger as u64)) - } -} - -fn into_linger(duration: Option) -> sys::linger { - match duration { - Some(duration) => sys::linger { - l_onoff: 1, - l_linger: duration.as_secs() as _, - }, - None => sys::linger { - l_onoff: 0, - l_linger: 0, - }, - } -} - -/// Socket options for IPv4 sockets, get/set using `IPPROTO_IP`. -/// -/// Additional documentation can be found in documentation of the OS. -/// * Linux: -/// * Windows: -impl Socket { - /// Get the value of the `IP_HDRINCL` option on this socket. - /// - /// For more information about this option, see [`set_header_included`]. - /// - /// [`set_header_included`]: Socket::set_header_included - #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) - )] - pub fn header_included(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_HDRINCL) - .map(|included| included != 0) - } - } - - /// Set the value of the `IP_HDRINCL` option on this socket. - /// - /// If enabled, the user supplies an IP header in front of the user data. - /// Valid only for [`SOCK_RAW`] sockets; see [raw(7)] for more information. - /// When this flag is enabled, the values set by `IP_OPTIONS`, [`IP_TTL`], - /// and [`IP_TOS`] are ignored. - /// - /// [`SOCK_RAW`]: Type::RAW - /// [raw(7)]: https://man7.org/linux/man-pages/man7/raw.7.html - /// [`IP_TTL`]: Socket::set_ttl - /// [`IP_TOS`]: Socket::set_tos - #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) - )] - pub fn set_header_included(&self, included: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_HDRINCL, - included as c_int, - ) - } - } - - /// Get the value of the `IP_TRANSPARENT` option on this socket. - /// - /// For more information about this option, see [`set_ip_transparent`]. - /// - /// [`set_ip_transparent`]: Socket::set_ip_transparent - #[cfg(any(doc, all(feature = "all", target_os = "linux")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] - pub fn ip_transparent(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, libc::IP_TRANSPARENT) - .map(|transparent| transparent != 0) - } - } - - /// Set the value of the `IP_TRANSPARENT` option on this socket. - /// - /// Setting this boolean option enables transparent proxying - /// on this socket. This socket option allows the calling - /// application to bind to a nonlocal IP address and operate - /// both as a client and a server with the foreign address as - /// the local endpoint. NOTE: this requires that routing be - /// set up in a way that packets going to the foreign address - /// are routed through the TProxy box (i.e., the system - /// hosting the application that employs the IP_TRANSPARENT - /// socket option). Enabling this socket option requires - /// superuser privileges (the `CAP_NET_ADMIN` capability). - /// - /// TProxy redirection with the iptables TPROXY target also - /// requires that this option be set on the redirected socket. - #[cfg(any(doc, all(feature = "all", target_os = "linux")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] - pub fn set_ip_transparent(&self, transparent: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - libc::IP_TRANSPARENT, - transparent as c_int, - ) - } - } - - /// Join a multicast group using `IP_ADD_MEMBERSHIP` option on this socket. - /// - /// This function specifies a new multicast group for this socket to join. - /// The address must be a valid multicast address, and `interface` is the - /// address of the local interface with which the system should join the - /// multicast group. If it's [`Ipv4Addr::UNSPECIFIED`] (`INADDR_ANY`) then - /// an appropriate interface is chosen by the system. - pub fn join_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> { - let mreq = sys::IpMreq { - imr_multiaddr: sys::to_in_addr(multiaddr), - imr_interface: sys::to_in_addr(interface), - }; - unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_ADD_MEMBERSHIP, mreq) } - } - - /// Leave a multicast group using `IP_DROP_MEMBERSHIP` option on this socket. - /// - /// For more information about this option, see [`join_multicast_v4`]. - /// - /// [`join_multicast_v4`]: Socket::join_multicast_v4 - pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> { - let mreq = sys::IpMreq { - imr_multiaddr: sys::to_in_addr(multiaddr), - imr_interface: sys::to_in_addr(interface), - }; - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_DROP_MEMBERSHIP, - mreq, - ) - } - } - - /// Join a multicast group using `IP_ADD_MEMBERSHIP` option on this socket. - /// - /// This function specifies a new multicast group for this socket to join. - /// The address must be a valid multicast address, and `interface` specifies - /// the local interface with which the system should join the multicast - /// group. See [`InterfaceIndexOrAddress`]. - #[cfg(not(any( - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn join_multicast_v4_n( - &self, - multiaddr: &Ipv4Addr, - interface: &InterfaceIndexOrAddress, - ) -> io::Result<()> { - let mreqn = sys::to_mreqn(multiaddr, interface); - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_ADD_MEMBERSHIP, - mreqn, - ) - } - } - - /// Leave a multicast group using `IP_DROP_MEMBERSHIP` option on this socket. - /// - /// For more information about this option, see [`join_multicast_v4_n`]. - /// - /// [`join_multicast_v4_n`]: Socket::join_multicast_v4_n - #[cfg(not(any( - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn leave_multicast_v4_n( - &self, - multiaddr: &Ipv4Addr, - interface: &InterfaceIndexOrAddress, - ) -> io::Result<()> { - let mreqn = sys::to_mreqn(multiaddr, interface); - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_DROP_MEMBERSHIP, - mreqn, - ) - } - } - - /// Join a multicast SSM channel using `IP_ADD_SOURCE_MEMBERSHIP` option on this socket. - /// - /// This function specifies a new multicast channel for this socket to join. - /// The group must be a valid SSM group address, the source must be the address of the sender - /// and `interface` is the address of the local interface with which the system should join the - /// multicast group. If it's [`Ipv4Addr::UNSPECIFIED`] (`INADDR_ANY`) then - /// an appropriate interface is chosen by the system. - #[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "fuchsia", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn join_ssm_v4( - &self, - source: &Ipv4Addr, - group: &Ipv4Addr, - interface: &Ipv4Addr, - ) -> io::Result<()> { - let mreqs = sys::IpMreqSource { - imr_multiaddr: sys::to_in_addr(group), - imr_interface: sys::to_in_addr(interface), - imr_sourceaddr: sys::to_in_addr(source), - }; - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_ADD_SOURCE_MEMBERSHIP, - mreqs, - ) - } - } - - /// Leave a multicast group using `IP_DROP_SOURCE_MEMBERSHIP` option on this socket. - /// - /// For more information about this option, see [`join_ssm_v4`]. - /// - /// [`join_ssm_v4`]: Socket::join_ssm_v4 - #[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "fuchsia", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn leave_ssm_v4( - &self, - source: &Ipv4Addr, - group: &Ipv4Addr, - interface: &Ipv4Addr, - ) -> io::Result<()> { - let mreqs = sys::IpMreqSource { - imr_multiaddr: sys::to_in_addr(group), - imr_interface: sys::to_in_addr(interface), - imr_sourceaddr: sys::to_in_addr(source), - }; - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_DROP_SOURCE_MEMBERSHIP, - mreqs, - ) - } - } - - /// Get the value of the `IP_MULTICAST_IF` option for this socket. - /// - /// For more information about this option, see [`set_multicast_if_v4`]. - /// - /// [`set_multicast_if_v4`]: Socket::set_multicast_if_v4 - pub fn multicast_if_v4(&self) -> io::Result { - unsafe { - getsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_IF).map(sys::from_in_addr) - } - } - - /// Set the value of the `IP_MULTICAST_IF` option for this socket. - /// - /// Specifies the interface to use for routing multicast packets. - pub fn set_multicast_if_v4(&self, interface: &Ipv4Addr) -> io::Result<()> { - let interface = sys::to_in_addr(interface); - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_MULTICAST_IF, - interface, - ) - } - } - - /// Get the value of the `IP_MULTICAST_LOOP` option for this socket. - /// - /// For more information about this option, see [`set_multicast_loop_v4`]. - /// - /// [`set_multicast_loop_v4`]: Socket::set_multicast_loop_v4 - pub fn multicast_loop_v4(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_LOOP) - .map(|loop_v4| loop_v4 != 0) - } - } - - /// Set the value of the `IP_MULTICAST_LOOP` option for this socket. - /// - /// If enabled, multicast packets will be looped back to the local socket. - /// Note that this may not have any affect on IPv6 sockets. - pub fn set_multicast_loop_v4(&self, loop_v4: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_MULTICAST_LOOP, - loop_v4 as c_int, - ) - } - } - - /// Get the value of the `IP_MULTICAST_TTL` option for this socket. - /// - /// For more information about this option, see [`set_multicast_ttl_v4`]. - /// - /// [`set_multicast_ttl_v4`]: Socket::set_multicast_ttl_v4 - pub fn multicast_ttl_v4(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_TTL) - .map(|ttl| ttl as u32) - } - } - - /// Set the value of the `IP_MULTICAST_TTL` option for this socket. - /// - /// Indicates the time-to-live value of outgoing multicast packets for - /// this socket. The default value is 1 which means that multicast packets - /// don't leave the local network unless explicitly requested. - /// - /// Note that this may not have any affect on IPv6 sockets. - pub fn set_multicast_ttl_v4(&self, ttl: u32) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_MULTICAST_TTL, - ttl as c_int, - ) - } - } - - /// Get the value of the `IP_TTL` option for this socket. - /// - /// For more information about this option, see [`set_ttl`]. - /// - /// [`set_ttl`]: Socket::set_ttl - pub fn ttl(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL).map(|ttl| ttl as u32) - } - } - - /// Set the value of the `IP_TTL` option for this socket. - /// - /// This value sets the time-to-live field that is used in every packet sent - /// from this socket. - pub fn set_ttl(&self, ttl: u32) -> io::Result<()> { - unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL, ttl as c_int) } - } - - /// Set the value of the `IP_TOS` option for this socket. - /// - /// This value sets the type-of-service field that is used in every packet - /// sent from this socket. - /// - /// NOTE: - /// documents that not all versions of windows support `IP_TOS`. - #[cfg(not(any( - target_os = "fuchsia", - target_os = "redox", - target_os = "solaris", - target_os = "illumos", - )))] - pub fn set_tos(&self, tos: u32) -> io::Result<()> { - unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) } - } - - /// Get the value of the `IP_TOS` option for this socket. - /// - /// For more information about this option, see [`set_tos`]. - /// - /// NOTE: - /// documents that not all versions of windows support `IP_TOS`. - /// - /// [`set_tos`]: Socket::set_tos - #[cfg(not(any( - target_os = "fuchsia", - target_os = "redox", - target_os = "solaris", - target_os = "illumos", - )))] - pub fn tos(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32) - } - } - - /// Set the value of the `IP_RECVTOS` option for this socket. - /// - /// If enabled, the IP_TOS ancillary message is passed with - /// incoming packets. It contains a byte which specifies the - /// Type of Service/Precedence field of the packet header. - #[cfg(not(any( - target_os = "dragonfly", - target_os = "fuchsia", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "windows", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn set_recv_tos(&self, recv_tos: bool) -> io::Result<()> { - let recv_tos = if recv_tos { 1 } else { 0 }; - - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IP, - sys::IP_RECVTOS, - recv_tos as c_int, - ) - } - } - - /// Get the value of the `IP_RECVTOS` option for this socket. - /// - /// For more information about this option, see [`set_recv_tos`]. - /// - /// [`set_recv_tos`]: Socket::set_recv_tos - #[cfg(not(any( - target_os = "dragonfly", - target_os = "fuchsia", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "windows", - target_os = "nto", - target_os = "espidf", - target_os = "vita", - )))] - pub fn recv_tos(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_RECVTOS) - .map(|recv_tos| recv_tos > 0) - } - } -} - -/// Socket options for IPv6 sockets, get/set using `IPPROTO_IPV6`. -/// -/// Additional documentation can be found in documentation of the OS. -/// * Linux: -/// * Windows: -impl Socket { - /// Join a multicast group using `IPV6_ADD_MEMBERSHIP` option on this socket. - /// - /// Some OSs use `IPV6_JOIN_GROUP` for this option. - /// - /// This function specifies a new multicast group for this socket to join. - /// The address must be a valid multicast address, and `interface` is the - /// index of the interface to join/leave (or 0 to indicate any interface). - #[cfg(not(target_os = "nto"))] - pub fn join_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> { - let mreq = sys::Ipv6Mreq { - ipv6mr_multiaddr: sys::to_in6_addr(multiaddr), - // NOTE: some OSs use `c_int`, others use `c_uint`. - ipv6mr_interface: interface as _, - }; - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_ADD_MEMBERSHIP, - mreq, - ) - } - } - - /// Leave a multicast group using `IPV6_DROP_MEMBERSHIP` option on this socket. - /// - /// Some OSs use `IPV6_LEAVE_GROUP` for this option. - /// - /// For more information about this option, see [`join_multicast_v6`]. - /// - /// [`join_multicast_v6`]: Socket::join_multicast_v6 - #[cfg(not(target_os = "nto"))] - pub fn leave_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> { - let mreq = sys::Ipv6Mreq { - ipv6mr_multiaddr: sys::to_in6_addr(multiaddr), - // NOTE: some OSs use `c_int`, others use `c_uint`. - ipv6mr_interface: interface as _, - }; - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_DROP_MEMBERSHIP, - mreq, - ) - } - } - - /// Get the value of the `IPV6_MULTICAST_HOPS` option for this socket - /// - /// For more information about this option, see [`set_multicast_hops_v6`]. - /// - /// [`set_multicast_hops_v6`]: Socket::set_multicast_hops_v6 - pub fn multicast_hops_v6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_HOPS) - .map(|hops| hops as u32) - } - } - - /// Set the value of the `IPV6_MULTICAST_HOPS` option for this socket - /// - /// Indicates the number of "routers" multicast packets will transit for - /// this socket. The default value is 1 which means that multicast packets - /// don't leave the local network unless explicitly requested. - pub fn set_multicast_hops_v6(&self, hops: u32) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_MULTICAST_HOPS, - hops as c_int, - ) - } - } - - /// Get the value of the `IPV6_MULTICAST_IF` option for this socket. - /// - /// For more information about this option, see [`set_multicast_if_v6`]. - /// - /// [`set_multicast_if_v6`]: Socket::set_multicast_if_v6 - pub fn multicast_if_v6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_IF) - .map(|interface| interface as u32) - } - } - - /// Set the value of the `IPV6_MULTICAST_IF` option for this socket. - /// - /// Specifies the interface to use for routing multicast packets. Unlike - /// ipv4, this is generally required in ipv6 contexts where network routing - /// prefixes may overlap. - pub fn set_multicast_if_v6(&self, interface: u32) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_MULTICAST_IF, - interface as c_int, - ) - } - } - - /// Get the value of the `IPV6_MULTICAST_LOOP` option for this socket. - /// - /// For more information about this option, see [`set_multicast_loop_v6`]. - /// - /// [`set_multicast_loop_v6`]: Socket::set_multicast_loop_v6 - pub fn multicast_loop_v6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_LOOP) - .map(|loop_v6| loop_v6 != 0) - } - } - - /// Set the value of the `IPV6_MULTICAST_LOOP` option for this socket. - /// - /// Controls whether this socket sees the multicast packets it sends itself. - /// Note that this may not have any affect on IPv4 sockets. - pub fn set_multicast_loop_v6(&self, loop_v6: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_MULTICAST_LOOP, - loop_v6 as c_int, - ) - } - } - - /// Get the value of the `IPV6_UNICAST_HOPS` option for this socket. - /// - /// Specifies the hop limit for ipv6 unicast packets - pub fn unicast_hops_v6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_UNICAST_HOPS) - .map(|hops| hops as u32) - } - } - - /// Set the value for the `IPV6_UNICAST_HOPS` option on this socket. - /// - /// Specifies the hop limit for ipv6 unicast packets - pub fn set_unicast_hops_v6(&self, hops: u32) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_UNICAST_HOPS, - hops as c_int, - ) - } - } - - /// Get the value of the `IPV6_V6ONLY` option for this socket. - /// - /// For more information about this option, see [`set_only_v6`]. - /// - /// [`set_only_v6`]: Socket::set_only_v6 - pub fn only_v6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_V6ONLY) - .map(|only_v6| only_v6 != 0) - } - } - - /// Set the value for the `IPV6_V6ONLY` option on this socket. - /// - /// If this is set to `true` then the socket is restricted to sending and - /// receiving IPv6 packets only. In this case two IPv4 and IPv6 applications - /// can bind the same port at the same time. - /// - /// If this is set to `false` then the socket can be used to send and - /// receive packets from an IPv4-mapped IPv6 address. - pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_IPV6, - sys::IPV6_V6ONLY, - only_v6 as c_int, - ) - } - } -} - -/// Socket options for TCP sockets, get/set using `IPPROTO_TCP`. -/// -/// Additional documentation can be found in documentation of the OS. -/// * Linux: -/// * Windows: -impl Socket { - /// Get the value of the `TCP_KEEPIDLE` option on this socket. - /// - /// This returns the value of `TCP_KEEPALIVE` on macOS and iOS and `TCP_KEEPIDLE` on all other - /// supported Unix operating systems. - #[cfg(any( - doc, - all( - feature = "all", - not(any( - windows, - target_os = "haiku", - target_os = "openbsd", - target_os = "vita" - )) - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - not(any( - windows, - target_os = "haiku", - target_os = "openbsd", - target_os = "vita" - )) - ))) - )] - pub fn keepalive_time(&self) -> io::Result { - sys::keepalive_time(self.as_raw()) - } - - /// Get the value of the `TCP_KEEPINTVL` option on this socket. - /// - /// For more information about this option, see [`set_tcp_keepalive`]. - /// - /// [`set_tcp_keepalive`]: Socket::set_tcp_keepalive - #[cfg(all( - feature = "all", - any( - doc, - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))) - )] - pub fn keepalive_interval(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_KEEPINTVL) - .map(|secs| Duration::from_secs(secs as u64)) - } - } - - /// Get the value of the `TCP_KEEPCNT` option on this socket. - /// - /// For more information about this option, see [`set_tcp_keepalive`]. - /// - /// [`set_tcp_keepalive`]: Socket::set_tcp_keepalive - #[cfg(all( - feature = "all", - any( - doc, - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) - ))) - )] - pub fn keepalive_retries(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_KEEPCNT) - .map(|retries| retries as u32) - } - } - - /// Set parameters configuring TCP keepalive probes for this socket. - /// - /// The supported parameters depend on the operating system, and are - /// configured using the [`TcpKeepalive`] struct. At a minimum, all systems - /// support configuring the [keepalive time]: the time after which the OS - /// will start sending keepalive messages on an idle connection. - /// - /// [keepalive time]: TcpKeepalive::with_time - /// - /// # Notes - /// - /// * This will enable `SO_KEEPALIVE` on this socket, if it is not already - /// enabled. - /// * On some platforms, such as Windows, any keepalive parameters *not* - /// configured by the `TcpKeepalive` struct passed to this function may be - /// overwritten with their default values. Therefore, this function should - /// either only be called once per socket, or the same parameters should - /// be passed every time it is called. - /// - /// # Examples - /// - /// ``` - /// use std::time::Duration; - /// - /// use socket2::{Socket, TcpKeepalive, Domain, Type}; - /// - /// # fn main() -> std::io::Result<()> { - /// let socket = Socket::new(Domain::IPV4, Type::STREAM, None)?; - /// let keepalive = TcpKeepalive::new() - /// .with_time(Duration::from_secs(4)); - /// // Depending on the target operating system, we may also be able to - /// // configure the keepalive probe interval and/or the number of - /// // retries here as well. - /// - /// socket.set_tcp_keepalive(&keepalive)?; - /// # Ok(()) } - /// ``` - /// - pub fn set_tcp_keepalive(&self, params: &TcpKeepalive) -> io::Result<()> { - self.set_keepalive(true)?; - sys::set_tcp_keepalive(self.as_raw(), params) - } - - /// Get the value of the `TCP_NODELAY` option on this socket. - /// - /// For more information about this option, see [`set_nodelay`]. - /// - /// [`set_nodelay`]: Socket::set_nodelay - pub fn nodelay(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_NODELAY) - .map(|nodelay| nodelay != 0) - } - } - - /// Set the value of the `TCP_NODELAY` option on this socket. - /// - /// If set, this option disables the Nagle algorithm. This means that - /// segments are always sent as soon as possible, even if there is only a - /// small amount of data. When not set, data is buffered until there is a - /// sufficient amount to send out, thereby avoiding the frequent sending of - /// small packets. - pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - sys::IPPROTO_TCP, - sys::TCP_NODELAY, - nodelay as c_int, - ) - } - } -} - -impl Read for Socket { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - // Safety: the `recv` implementation promises not to write uninitialised - // bytes to the `buf`fer, so this casting is safe. - let buf = unsafe { &mut *(buf as *mut [u8] as *mut [MaybeUninit]) }; - self.recv(buf) - } - - #[cfg(not(target_os = "redox"))] - fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { - // Safety: both `IoSliceMut` and `MaybeUninitSlice` promise to have the - // same layout, that of `iovec`/`WSABUF`. Furthermore `recv_vectored` - // promises to not write unitialised bytes to the `bufs` and pass it - // directly to the `recvmsg` system call, so this is safe. - let bufs = unsafe { &mut *(bufs as *mut [IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>]) }; - self.recv_vectored(bufs).map(|(n, _)| n) - } -} - -impl<'a> Read for &'a Socket { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - // Safety: see other `Read::read` impl. - let buf = unsafe { &mut *(buf as *mut [u8] as *mut [MaybeUninit]) }; - self.recv(buf) - } - - #[cfg(not(target_os = "redox"))] - fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { - // Safety: see other `Read::read` impl. - let bufs = unsafe { &mut *(bufs as *mut [IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>]) }; - self.recv_vectored(bufs).map(|(n, _)| n) - } -} - -impl Write for Socket { - fn write(&mut self, buf: &[u8]) -> io::Result { - self.send(buf) - } - - #[cfg(not(target_os = "redox"))] - fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { - self.send_vectored(bufs) - } - - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } -} - -impl<'a> Write for &'a Socket { - fn write(&mut self, buf: &[u8]) -> io::Result { - self.send(buf) - } - - #[cfg(not(target_os = "redox"))] - fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { - self.send_vectored(bufs) - } - - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } -} - -impl fmt::Debug for Socket { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Socket") - .field("raw", &self.as_raw()) - .field("local_addr", &self.local_addr().ok()) - .field("peer_addr", &self.peer_addr().ok()) - .finish() - } -} - -from!(net::TcpStream, Socket); -from!(net::TcpListener, Socket); -from!(net::UdpSocket, Socket); -from!(Socket, net::TcpStream); -from!(Socket, net::TcpListener); -from!(Socket, net::UdpSocket); diff --git a/vendor/socket2-0.4.10/src/sockref.rs b/vendor/socket2-0.4.10/src/sockref.rs deleted file mode 100644 index 257323beb..000000000 --- a/vendor/socket2-0.4.10/src/sockref.rs +++ /dev/null @@ -1,147 +0,0 @@ -use std::fmt; -use std::marker::PhantomData; -use std::mem::ManuallyDrop; -use std::ops::Deref; -#[cfg(unix)] -use std::os::unix::io::{AsRawFd, FromRawFd}; -#[cfg(windows)] -use std::os::windows::io::{AsRawSocket, FromRawSocket}; - -use crate::Socket; - -/// A reference to a [`Socket`] that can be used to configure socket types other -/// than the `Socket` type itself. -/// -/// This allows for example a [`TcpStream`], found in the standard library, to -/// be configured using all the additional methods found in the [`Socket`] API. -/// -/// `SockRef` can be created from any socket type that implements [`AsRawFd`] -/// (Unix) or [`AsRawSocket`] (Windows) using the [`From`] implementation, but -/// the caller must ensure the file descriptor/socket is a valid. -/// -/// [`TcpStream`]: std::net::TcpStream -// Don't use intra-doc links because they won't build on every platform. -/// [`AsRawFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/trait.AsRawFd.html -/// [`AsRawSocket`]: https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsRawSocket.html -/// -/// # Examples -/// -/// Below is an example of converting a [`TcpStream`] into a [`SockRef`]. -/// -/// ``` -/// use std::net::{TcpStream, SocketAddr}; -/// -/// use socket2::SockRef; -/// -/// # fn main() -> Result<(), Box> { -/// // Create `TcpStream` from the standard library. -/// let address: SocketAddr = "127.0.0.1:1234".parse()?; -/// # let b1 = std::sync::Arc::new(std::sync::Barrier::new(2)); -/// # let b2 = b1.clone(); -/// # let handle = std::thread::spawn(move || { -/// # let listener = std::net::TcpListener::bind(address).unwrap(); -/// # b2.wait(); -/// # let (stream, _) = listener.accept().unwrap(); -/// # std::thread::sleep(std::time::Duration::from_millis(10)); -/// # drop(stream); -/// # }); -/// # b1.wait(); -/// let stream = TcpStream::connect(address)?; -/// -/// // Create a `SockRef`erence to the stream. -/// let socket_ref = SockRef::from(&stream); -/// // Use `Socket::set_nodelay` on the stream. -/// socket_ref.set_nodelay(true)?; -/// drop(socket_ref); -/// -/// assert_eq!(stream.nodelay()?, true); -/// # handle.join().unwrap(); -/// # Ok(()) -/// # } -/// ``` -/// -/// Below is an example of **incorrect usage** of `SockRef::from`, which is -/// currently possible (but not intended and will be fixed in future versions). -/// -/// ```compile_fail -/// use socket2::SockRef; -/// -/// # fn main() -> Result<(), Box> { -/// /// THIS USAGE IS NOT VALID! -/// let socket_ref = SockRef::from(&123); -/// // The above line is overseen possibility when using `SockRef::from`, it -/// // uses the `RawFd` (on Unix), which is a type alias for `c_int`/`i32`, -/// // which implements `AsRawFd`. However it may be clear that this usage is -/// // invalid as it doesn't guarantee that `123` is a valid file descriptor. -/// -/// // Using `Socket::set_nodelay` now will call it on a file descriptor we -/// // don't own! We don't even not if the file descriptor is valid or a socket. -/// socket_ref.set_nodelay(true)?; -/// drop(socket_ref); -/// # Ok(()) -/// # } -/// # DO_NOT_COMPILE -/// ``` -pub struct SockRef<'s> { - /// Because this is a reference we don't own the `Socket`, however `Socket` - /// closes itself when dropped, so we use `ManuallyDrop` to prevent it from - /// closing itself. - socket: ManuallyDrop, - /// Because we don't own the socket we need to ensure the socket remains - /// open while we have a "reference" to it, the lifetime `'s` ensures this. - _lifetime: PhantomData<&'s Socket>, -} - -impl<'s> Deref for SockRef<'s> { - type Target = Socket; - - fn deref(&self) -> &Self::Target { - &self.socket - } -} - -/// On Windows, a corresponding `From<&impl AsRawSocket>` implementation exists. -#[cfg(unix)] -#[cfg_attr(docsrs, doc(cfg(unix)))] -impl<'s, S> From<&'s S> for SockRef<'s> -where - S: AsRawFd, -{ - /// The caller must ensure `S` is actually a socket. - fn from(socket: &'s S) -> Self { - let fd = socket.as_raw_fd(); - assert!(fd >= 0); - SockRef { - socket: ManuallyDrop::new(unsafe { Socket::from_raw_fd(fd) }), - _lifetime: PhantomData, - } - } -} - -/// On Unix, a corresponding `From<&impl AsRawFd>` implementation exists. -#[cfg(windows)] -#[cfg_attr(docsrs, doc(cfg(windows)))] -impl<'s, S> From<&'s S> for SockRef<'s> -where - S: AsRawSocket, -{ - /// See the `From<&impl AsRawFd>` implementation. - fn from(socket: &'s S) -> Self { - let socket = socket.as_raw_socket(); - assert!(socket != winapi::um::winsock2::INVALID_SOCKET as _); - SockRef { - socket: ManuallyDrop::new(unsafe { Socket::from_raw_socket(socket) }), - _lifetime: PhantomData, - } - } -} - -impl fmt::Debug for SockRef<'_> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("SockRef") - .field("raw", &self.socket.as_raw()) - .field("local_addr", &self.socket.local_addr().ok()) - .field("peer_addr", &self.socket.peer_addr().ok()) - .finish() - } -} diff --git a/vendor/socket2-0.4.10/src/sys/unix.rs b/vendor/socket2-0.4.10/src/sys/unix.rs deleted file mode 100644 index ec7c3e2e4..000000000 --- a/vendor/socket2-0.4.10/src/sys/unix.rs +++ /dev/null @@ -1,2142 +0,0 @@ -// Copyright 2015 The Rust Project Developers. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::cmp::min; -#[cfg(not(target_os = "redox"))] -use std::io::IoSlice; -use std::marker::PhantomData; -use std::mem::{self, size_of, MaybeUninit}; -use std::net::Shutdown; -use std::net::{Ipv4Addr, Ipv6Addr}; -#[cfg(all(feature = "all", target_vendor = "apple"))] -use std::num::NonZeroU32; -#[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "linux", - target_vendor = "apple", - ) -))] -use std::num::NonZeroUsize; -#[cfg(feature = "all")] -use std::os::unix::ffi::OsStrExt; -#[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "linux", - target_vendor = "apple", - ) -))] -use std::os::unix::io::RawFd; -use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd}; -#[cfg(feature = "all")] -use std::os::unix::net::{UnixDatagram, UnixListener, UnixStream}; -#[cfg(feature = "all")] -use std::path::Path; -#[cfg(not(all(target_os = "redox", not(feature = "all"))))] -use std::ptr; -use std::time::{Duration, Instant}; -use std::{io, slice}; - -#[cfg(not(target_vendor = "apple"))] -use libc::ssize_t; -use libc::{c_void, in6_addr, in_addr}; - -#[cfg(not(target_os = "redox"))] -use crate::RecvFlags; -use crate::{Domain, Protocol, SockAddr, TcpKeepalive, Type}; - -pub(crate) use libc::c_int; - -// Used in `Domain`. -pub(crate) use libc::{AF_INET, AF_INET6}; -// Used in `Type`. -#[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))] -pub(crate) use libc::SOCK_RAW; -#[cfg(all(feature = "all", not(target_os = "espidf")))] -pub(crate) use libc::SOCK_SEQPACKET; -pub(crate) use libc::{SOCK_DGRAM, SOCK_STREAM}; -// Used in `Protocol`. -pub(crate) use libc::{IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_TCP, IPPROTO_UDP}; -// Used in `SockAddr`. -pub(crate) use libc::{ - sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t, -}; -// Used in `RecvFlags`. -#[cfg(not(any(target_os = "redox", target_os = "espidf")))] -pub(crate) use libc::MSG_TRUNC; -#[cfg(not(target_os = "redox"))] -pub(crate) use libc::SO_OOBINLINE; -// Used in `Socket`. -#[cfg(not(target_os = "nto"))] -pub(crate) use libc::ipv6_mreq as Ipv6Mreq; -#[cfg(all(feature = "all", not(target_os = "redox")))] -pub(crate) use libc::IP_HDRINCL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "fuchsia", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "haiku", - target_os = "nto", - target_os = "espidf", - target_os = "vita", -)))] -pub(crate) use libc::IP_RECVTOS; -#[cfg(not(any( - target_os = "fuchsia", - target_os = "redox", - target_os = "solaris", - target_os = "illumos", -)))] -pub(crate) use libc::IP_TOS; -#[cfg(not(target_vendor = "apple"))] -pub(crate) use libc::SO_LINGER; -#[cfg(target_vendor = "apple")] -pub(crate) use libc::SO_LINGER_SEC as SO_LINGER; -pub(crate) use libc::{ - ip_mreq as IpMreq, linger, IPPROTO_IP, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, - IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY, IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, - IP_MULTICAST_IF, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TTL, MSG_OOB, MSG_PEEK, SOL_SOCKET, - SO_BROADCAST, SO_ERROR, SO_KEEPALIVE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, - SO_SNDTIMEO, SO_TYPE, TCP_NODELAY, -}; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "fuchsia", - target_os = "nto", - target_os = "espidf", - target_os = "vita", -)))] -pub(crate) use libc::{ - ip_mreq_source as IpMreqSource, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, -}; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "nto", - target_vendor = "apple" -)))] -pub(crate) use libc::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP}; -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_vendor = "apple", -))] -pub(crate) use libc::{ - IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP, IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP, -}; -#[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ) -))] -pub(crate) use libc::{TCP_KEEPCNT, TCP_KEEPINTVL}; - -// See this type in the Windows file. -pub(crate) type Bool = c_int; - -#[cfg(any(target_vendor = "apple", target_os = "nto"))] -use libc::TCP_KEEPALIVE as KEEPALIVE_TIME; -#[cfg(not(any( - target_vendor = "apple", - target_os = "haiku", - target_os = "openbsd", - target_os = "nto", - target_os = "vita", -)))] -use libc::TCP_KEEPIDLE as KEEPALIVE_TIME; - -/// Helper macro to execute a system call that returns an `io::Result`. -macro_rules! syscall { - ($fn: ident ( $($arg: expr),* $(,)* ) ) => {{ - #[allow(unused_unsafe)] - let res = unsafe { libc::$fn($($arg, )*) }; - if res == -1 { - Err(std::io::Error::last_os_error()) - } else { - Ok(res) - } - }}; -} - -/// Maximum size of a buffer passed to system call like `recv` and `send`. -#[cfg(not(target_vendor = "apple"))] -const MAX_BUF_LEN: usize = ::max_value() as usize; - -// The maximum read limit on most posix-like systems is `SSIZE_MAX`, with the -// man page quoting that if the count of bytes to read is greater than -// `SSIZE_MAX` the result is "unspecified". -// -// On macOS, however, apparently the 64-bit libc is either buggy or -// intentionally showing odd behavior by rejecting any read with a size larger -// than or equal to INT_MAX. To handle both of these the read size is capped on -// both platforms. -#[cfg(target_vendor = "apple")] -const MAX_BUF_LEN: usize = ::max_value() as usize - 1; - -#[cfg(any( - all( - target_os = "linux", - any( - target_env = "gnu", - all(target_env = "uclibc", target_pointer_width = "64") - ) - ), - target_os = "android", -))] -type IovLen = usize; - -#[cfg(any( - all( - target_os = "linux", - any( - target_env = "musl", - all(target_env = "uclibc", target_pointer_width = "32") - ) - ), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "nto", - target_vendor = "apple", - target_os = "espidf", - target_os = "vita", -))] -type IovLen = c_int; - -/// Unix only API. -impl Domain { - /// Domain for Unix socket communication, corresponding to `AF_UNIX`. - #[cfg_attr(docsrs, doc(cfg(unix)))] - pub const UNIX: Domain = Domain(libc::AF_UNIX); - - /// Domain for low-level packet interface, corresponding to `AF_PACKET`. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub const PACKET: Domain = Domain(libc::AF_PACKET); - - /// Domain for low-level VSOCK interface, corresponding to `AF_VSOCK`. - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))) - )] - pub const VSOCK: Domain = Domain(libc::AF_VSOCK); -} - -impl_debug!( - Domain, - libc::AF_INET, - libc::AF_INET6, - libc::AF_UNIX, - #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] - #[cfg_attr( - docsrs, - doc(cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))) - )] - libc::AF_PACKET, - #[cfg(any(target_os = "android", target_os = "linux"))] - #[cfg_attr(docsrs, doc(cfg(any(target_os = "android", target_os = "linux"))))] - libc::AF_VSOCK, - libc::AF_UNSPEC, // = 0. -); - -/// Unix only API. -impl Type { - /// Set `SOCK_NONBLOCK` on the `Type`. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))) - )] - pub const fn nonblocking(self) -> Type { - Type(self.0 | libc::SOCK_NONBLOCK) - } - - /// Set `SOCK_CLOEXEC` on the `Type`. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))) - )] - pub const fn cloexec(self) -> Type { - self._cloexec() - } - - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ))] - pub(crate) const fn _cloexec(self) -> Type { - Type(self.0 | libc::SOCK_CLOEXEC) - } -} - -impl_debug!( - Type, - libc::SOCK_STREAM, - libc::SOCK_DGRAM, - #[cfg(not(any(target_os = "redox", target_os = "espidf")))] - libc::SOCK_RAW, - #[cfg(not(any(target_os = "redox", target_os = "haiku", target_os = "espidf")))] - libc::SOCK_RDM, - #[cfg(not(target_os = "espidf"))] - libc::SOCK_SEQPACKET, - /* TODO: add these optional bit OR-ed flags: - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ))] - libc::SOCK_NONBLOCK, - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ))] - libc::SOCK_CLOEXEC, - */ -); - -impl_debug!( - Protocol, - libc::IPPROTO_ICMP, - libc::IPPROTO_ICMPV6, - libc::IPPROTO_TCP, - libc::IPPROTO_UDP, -); - -/// Unix-only API. -#[cfg(not(target_os = "redox"))] -impl RecvFlags { - /// Check if the message terminates a record. - /// - /// Not all socket types support the notion of records. - /// For socket types that do support it (such as [`SEQPACKET`][Type::SEQPACKET]), - /// a record is terminated by sending a message with the end-of-record flag set. - /// - /// On Unix this corresponds to the MSG_EOR flag. - #[cfg(not(target_os = "espidf"))] - pub const fn is_end_of_record(self) -> bool { - self.0 & libc::MSG_EOR != 0 - } - - /// Check if the message contains out-of-band data. - /// - /// This is useful for protocols where you receive out-of-band data - /// mixed in with the normal data stream. - /// - /// On Unix this corresponds to the MSG_OOB flag. - pub const fn is_out_of_band(self) -> bool { - self.0 & libc::MSG_OOB != 0 - } -} - -#[cfg(not(target_os = "redox"))] -impl std::fmt::Debug for RecvFlags { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut s = f.debug_struct("RecvFlags"); - #[cfg(not(target_os = "espidf"))] - s.field("is_end_of_record", &self.is_end_of_record()); - s.field("is_out_of_band", &self.is_out_of_band()); - #[cfg(not(target_os = "espidf"))] - s.field("is_truncated", &self.is_truncated()); - s.finish() - } -} - -#[repr(transparent)] -pub struct MaybeUninitSlice<'a> { - vec: libc::iovec, - _lifetime: PhantomData<&'a mut [MaybeUninit]>, -} - -unsafe impl<'a> Send for MaybeUninitSlice<'a> {} - -unsafe impl<'a> Sync for MaybeUninitSlice<'a> {} - -impl<'a> MaybeUninitSlice<'a> { - pub(crate) fn new(buf: &'a mut [MaybeUninit]) -> MaybeUninitSlice<'a> { - MaybeUninitSlice { - vec: libc::iovec { - iov_base: buf.as_mut_ptr().cast(), - iov_len: buf.len(), - }, - _lifetime: PhantomData, - } - } - - pub(crate) fn as_slice(&self) -> &[MaybeUninit] { - unsafe { slice::from_raw_parts(self.vec.iov_base.cast(), self.vec.iov_len) } - } - - pub(crate) fn as_mut_slice(&mut self) -> &mut [MaybeUninit] { - unsafe { slice::from_raw_parts_mut(self.vec.iov_base.cast(), self.vec.iov_len) } - } -} - -/// Unix only API. -impl SockAddr { - /// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path. - /// - /// # Failure - /// - /// Returns an error if the path is longer than `SUN_LEN`. - #[cfg(feature = "all")] - #[cfg_attr(docsrs, doc(cfg(all(unix, feature = "all"))))] - #[allow(unused_unsafe)] // TODO: replace with `unsafe_op_in_unsafe_fn` once stable. - pub fn unix

(path: P) -> io::Result - where - P: AsRef, - { - unsafe { - SockAddr::init(|storage, len| { - // Safety: `SockAddr::init` zeros the address, which is a valid - // representation. - let storage: &mut libc::sockaddr_un = unsafe { &mut *storage.cast() }; - let len: &mut socklen_t = unsafe { &mut *len }; - - let bytes = path.as_ref().as_os_str().as_bytes(); - let too_long = match bytes.first() { - None => false, - // linux abstract namespaces aren't null-terminated - Some(&0) => bytes.len() > storage.sun_path.len(), - Some(_) => bytes.len() >= storage.sun_path.len(), - }; - if too_long { - return Err(io::Error::new( - io::ErrorKind::InvalidInput, - "path must be shorter than SUN_LEN", - )); - } - - storage.sun_family = libc::AF_UNIX as sa_family_t; - // Safety: `bytes` and `addr.sun_path` are not overlapping and - // both point to valid memory. - // `SockAddr::init` zeroes the memory, so the path is already - // null terminated. - unsafe { - ptr::copy_nonoverlapping( - bytes.as_ptr(), - storage.sun_path.as_mut_ptr() as *mut u8, - bytes.len(), - ) - }; - - let base = storage as *const _ as usize; - let path = &storage.sun_path as *const _ as usize; - let sun_path_offset = path - base; - let length = sun_path_offset - + bytes.len() - + match bytes.first() { - Some(&0) | None => 0, - Some(_) => 1, - }; - *len = length as socklen_t; - - Ok(()) - }) - } - .map(|(_, addr)| addr) - } -} - -impl SockAddr { - /// Constructs a `SockAddr` with the family `AF_VSOCK` and the provided CID/port. - /// - /// # Errors - /// - /// This function can never fail. In a future version of this library it will be made - /// infallible. - #[allow(unused_unsafe)] // TODO: replace with `unsafe_op_in_unsafe_fn` once stable. - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))) - )] - pub fn vsock(cid: u32, port: u32) -> io::Result { - unsafe { - SockAddr::init(|storage, len| { - // Safety: `SockAddr::init` zeros the address, which is a valid - // representation. - let storage: &mut libc::sockaddr_vm = unsafe { &mut *storage.cast() }; - let len: &mut socklen_t = unsafe { &mut *len }; - - storage.svm_family = libc::AF_VSOCK as sa_family_t; - storage.svm_cid = cid; - storage.svm_port = port; - - *len = mem::size_of::() as socklen_t; - - Ok(()) - }) - } - .map(|(_, addr)| addr) - } - - /// Returns this address VSOCK CID/port if it is in the `AF_VSOCK` family, - /// otherwise return `None`. - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))) - )] - pub fn vsock_address(&self) -> Option<(u32, u32)> { - if self.family() == libc::AF_VSOCK as sa_family_t { - // Safety: if the ss_family field is AF_VSOCK then storage must be a sockaddr_vm. - let addr = unsafe { &*(self.as_ptr() as *const libc::sockaddr_vm) }; - Some((addr.svm_cid, addr.svm_port)) - } else { - None - } - } -} - -pub(crate) type Socket = c_int; - -pub(crate) unsafe fn socket_from_raw(socket: Socket) -> crate::socket::Inner { - crate::socket::Inner::from_raw_fd(socket) -} - -pub(crate) fn socket_as_raw(socket: &crate::socket::Inner) -> Socket { - socket.as_raw_fd() -} - -pub(crate) fn socket_into_raw(socket: crate::socket::Inner) -> Socket { - socket.into_raw_fd() -} - -pub(crate) fn socket(family: c_int, ty: c_int, protocol: c_int) -> io::Result { - syscall!(socket(family, ty, protocol)) -} - -#[cfg(feature = "all")] -pub(crate) fn socketpair(family: c_int, ty: c_int, protocol: c_int) -> io::Result<[Socket; 2]> { - let mut fds = [0, 0]; - syscall!(socketpair(family, ty, protocol, fds.as_mut_ptr())).map(|_| fds) -} - -pub(crate) fn bind(fd: Socket, addr: &SockAddr) -> io::Result<()> { - syscall!(bind(fd, addr.as_ptr(), addr.len() as _)).map(|_| ()) -} - -pub(crate) fn connect(fd: Socket, addr: &SockAddr) -> io::Result<()> { - syscall!(connect(fd, addr.as_ptr(), addr.len())).map(|_| ()) -} - -pub(crate) fn poll_connect(socket: &crate::Socket, timeout: Duration) -> io::Result<()> { - let start = Instant::now(); - - let mut pollfd = libc::pollfd { - fd: socket.as_raw(), - events: libc::POLLIN | libc::POLLOUT, - revents: 0, - }; - - loop { - let elapsed = start.elapsed(); - if elapsed >= timeout { - return Err(io::ErrorKind::TimedOut.into()); - } - - let timeout = (timeout - elapsed).as_millis(); - let timeout = clamp(timeout, 1, c_int::max_value() as u128) as c_int; - - match syscall!(poll(&mut pollfd, 1, timeout)) { - Ok(0) => return Err(io::ErrorKind::TimedOut.into()), - Ok(_) => { - // Error or hang up indicates an error (or failure to connect). - if (pollfd.revents & libc::POLLHUP) != 0 || (pollfd.revents & libc::POLLERR) != 0 { - match socket.take_error() { - Ok(Some(err)) => return Err(err), - Ok(None) => { - return Err(io::Error::new( - io::ErrorKind::Other, - "no error set after POLLHUP", - )) - } - Err(err) => return Err(err), - } - } - return Ok(()); - } - // Got interrupted, try again. - Err(ref err) if err.kind() == io::ErrorKind::Interrupted => continue, - Err(err) => return Err(err), - } - } -} - -// TODO: use clamp from std lib, stable since 1.50. -fn clamp(value: T, min: T, max: T) -> T -where - T: Ord, -{ - if value <= min { - min - } else if value >= max { - max - } else { - value - } -} - -pub(crate) fn listen(fd: Socket, backlog: c_int) -> io::Result<()> { - syscall!(listen(fd, backlog)).map(|_| ()) -} - -pub(crate) fn accept(fd: Socket) -> io::Result<(Socket, SockAddr)> { - // Safety: `accept` initialises the `SockAddr` for us. - unsafe { SockAddr::init(|storage, len| syscall!(accept(fd, storage.cast(), len))) } -} - -pub(crate) fn getsockname(fd: Socket) -> io::Result { - // Safety: `accept` initialises the `SockAddr` for us. - unsafe { SockAddr::init(|storage, len| syscall!(getsockname(fd, storage.cast(), len))) } - .map(|(_, addr)| addr) -} - -pub(crate) fn getpeername(fd: Socket) -> io::Result { - // Safety: `accept` initialises the `SockAddr` for us. - unsafe { SockAddr::init(|storage, len| syscall!(getpeername(fd, storage.cast(), len))) } - .map(|(_, addr)| addr) -} - -pub(crate) fn try_clone(fd: Socket) -> io::Result { - syscall!(fcntl(fd, libc::F_DUPFD_CLOEXEC, 0)) -} - -#[cfg(not(target_os = "vita"))] -pub(crate) fn set_nonblocking(fd: Socket, nonblocking: bool) -> io::Result<()> { - if nonblocking { - fcntl_add(fd, libc::F_GETFL, libc::F_SETFL, libc::O_NONBLOCK) - } else { - fcntl_remove(fd, libc::F_GETFL, libc::F_SETFL, libc::O_NONBLOCK) - } -} - -#[cfg(target_os = "vita")] -pub(crate) fn set_nonblocking(fd: Socket, nonblocking: bool) -> io::Result<()> { - unsafe { - setsockopt( - fd, - libc::SOL_SOCKET, - libc::SO_NONBLOCK, - nonblocking as libc::c_int, - ) - } -} - -pub(crate) fn shutdown(fd: Socket, how: Shutdown) -> io::Result<()> { - let how = match how { - Shutdown::Write => libc::SHUT_WR, - Shutdown::Read => libc::SHUT_RD, - Shutdown::Both => libc::SHUT_RDWR, - }; - syscall!(shutdown(fd, how)).map(|_| ()) -} - -pub(crate) fn recv(fd: Socket, buf: &mut [MaybeUninit], flags: c_int) -> io::Result { - syscall!(recv( - fd, - buf.as_mut_ptr().cast(), - min(buf.len(), MAX_BUF_LEN), - flags, - )) - .map(|n| n as usize) -} - -pub(crate) fn recv_from( - fd: Socket, - buf: &mut [MaybeUninit], - flags: c_int, -) -> io::Result<(usize, SockAddr)> { - // Safety: `recvfrom` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|addr, addrlen| { - syscall!(recvfrom( - fd, - buf.as_mut_ptr().cast(), - min(buf.len(), MAX_BUF_LEN), - flags, - addr.cast(), - addrlen - )) - .map(|n| n as usize) - }) - } -} - -pub(crate) fn peek_sender(fd: Socket) -> io::Result { - // Unix-like platforms simply truncate the returned data, so this implementation is trivial. - // However, for Windows this requires suppressing the `WSAEMSGSIZE` error, - // so that requires a different approach. - // NOTE: macOS does not populate `sockaddr` if you pass a zero-sized buffer. - let (_, sender) = recv_from(fd, &mut [MaybeUninit::uninit(); 8], MSG_PEEK)?; - Ok(sender) -} - -#[cfg(not(target_os = "redox"))] -pub(crate) fn recv_vectored( - fd: Socket, - bufs: &mut [crate::MaybeUninitSlice<'_>], - flags: c_int, -) -> io::Result<(usize, RecvFlags)> { - recvmsg(fd, ptr::null_mut(), bufs, flags).map(|(n, _, recv_flags)| (n, recv_flags)) -} - -#[cfg(not(target_os = "redox"))] -pub(crate) fn recv_from_vectored( - fd: Socket, - bufs: &mut [crate::MaybeUninitSlice<'_>], - flags: c_int, -) -> io::Result<(usize, RecvFlags, SockAddr)> { - // Safety: `recvmsg` initialises the address storage and we set the length - // manually. - unsafe { - SockAddr::init(|storage, len| { - recvmsg(fd, storage, bufs, flags).map(|(n, addrlen, recv_flags)| { - // Set the correct address length. - *len = addrlen; - (n, recv_flags) - }) - }) - } - .map(|((n, recv_flags), addr)| (n, recv_flags, addr)) -} - -/// Returns the (bytes received, sending address len, `RecvFlags`). -#[cfg(not(target_os = "redox"))] -fn recvmsg( - fd: Socket, - msg_name: *mut sockaddr_storage, - bufs: &mut [crate::MaybeUninitSlice<'_>], - flags: c_int, -) -> io::Result<(usize, libc::socklen_t, RecvFlags)> { - let msg_namelen = if msg_name.is_null() { - 0 - } else { - size_of::() as libc::socklen_t - }; - // libc::msghdr contains unexported padding fields on Fuchsia. - let mut msg: libc::msghdr = unsafe { mem::zeroed() }; - msg.msg_name = msg_name.cast(); - msg.msg_namelen = msg_namelen; - msg.msg_iov = bufs.as_mut_ptr().cast(); - msg.msg_iovlen = min(bufs.len(), IovLen::MAX as usize) as IovLen; - syscall!(recvmsg(fd, &mut msg, flags)) - .map(|n| (n as usize, msg.msg_namelen, RecvFlags(msg.msg_flags))) -} - -pub(crate) fn send(fd: Socket, buf: &[u8], flags: c_int) -> io::Result { - syscall!(send( - fd, - buf.as_ptr().cast(), - min(buf.len(), MAX_BUF_LEN), - flags, - )) - .map(|n| n as usize) -} - -#[cfg(not(target_os = "redox"))] -pub(crate) fn send_vectored(fd: Socket, bufs: &[IoSlice<'_>], flags: c_int) -> io::Result { - sendmsg(fd, ptr::null(), 0, bufs, flags) -} - -pub(crate) fn send_to(fd: Socket, buf: &[u8], addr: &SockAddr, flags: c_int) -> io::Result { - syscall!(sendto( - fd, - buf.as_ptr().cast(), - min(buf.len(), MAX_BUF_LEN), - flags, - addr.as_ptr(), - addr.len(), - )) - .map(|n| n as usize) -} - -#[cfg(not(target_os = "redox"))] -pub(crate) fn send_to_vectored( - fd: Socket, - bufs: &[IoSlice<'_>], - addr: &SockAddr, - flags: c_int, -) -> io::Result { - sendmsg(fd, addr.as_storage_ptr(), addr.len(), bufs, flags) -} - -/// Returns the (bytes received, sending address len, `RecvFlags`). -#[cfg(not(target_os = "redox"))] -fn sendmsg( - fd: Socket, - msg_name: *const sockaddr_storage, - msg_namelen: socklen_t, - bufs: &[IoSlice<'_>], - flags: c_int, -) -> io::Result { - // libc::msghdr contains unexported padding fields on Fuchsia. - let mut msg: libc::msghdr = unsafe { mem::zeroed() }; - // Safety: we're creating a `*mut` pointer from a reference, which is UB - // once actually used. However the OS should not write to it in the - // `sendmsg` system call. - msg.msg_name = (msg_name as *mut sockaddr_storage).cast(); - msg.msg_namelen = msg_namelen; - // Safety: Same as above about `*const` -> `*mut`. - msg.msg_iov = bufs.as_ptr() as *mut _; - msg.msg_iovlen = min(bufs.len(), IovLen::MAX as usize) as IovLen; - syscall!(sendmsg(fd, &msg, flags)).map(|n| n as usize) -} - -/// Wrapper around `getsockopt` to deal with platform specific timeouts. -pub(crate) fn timeout_opt(fd: Socket, opt: c_int, val: c_int) -> io::Result> { - unsafe { getsockopt(fd, opt, val).map(from_timeval) } -} - -fn from_timeval(duration: libc::timeval) -> Option { - if duration.tv_sec == 0 && duration.tv_usec == 0 { - None - } else { - let sec = duration.tv_sec as u64; - let nsec = (duration.tv_usec as u32) * 1000; - Some(Duration::new(sec, nsec)) - } -} - -/// Wrapper around `setsockopt` to deal with platform specific timeouts. -pub(crate) fn set_timeout_opt( - fd: Socket, - opt: c_int, - val: c_int, - duration: Option, -) -> io::Result<()> { - let duration = into_timeval(duration); - unsafe { setsockopt(fd, opt, val, duration) } -} - -fn into_timeval(duration: Option) -> libc::timeval { - match duration { - // https://github.com/rust-lang/libc/issues/1848 - #[cfg_attr(target_env = "musl", allow(deprecated))] - Some(duration) => libc::timeval { - tv_sec: min(duration.as_secs(), libc::time_t::max_value() as u64) as libc::time_t, - tv_usec: duration.subsec_micros() as libc::suseconds_t, - }, - None => libc::timeval { - tv_sec: 0, - tv_usec: 0, - }, - } -} - -#[cfg(feature = "all")] -#[cfg(not(any(target_os = "haiku", target_os = "openbsd", target_os = "vita")))] -pub(crate) fn keepalive_time(fd: Socket) -> io::Result { - unsafe { - getsockopt::(fd, IPPROTO_TCP, KEEPALIVE_TIME) - .map(|secs| Duration::from_secs(secs as u64)) - } -} - -#[allow(unused_variables)] -pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Result<()> { - #[cfg(not(any( - target_os = "haiku", - target_os = "openbsd", - target_os = "nto", - target_os = "vita" - )))] - if let Some(time) = keepalive.time { - let secs = into_secs(time); - unsafe { setsockopt(fd, libc::IPPROTO_TCP, KEEPALIVE_TIME, secs)? } - } - - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_vendor = "apple", - ))] - { - if let Some(interval) = keepalive.interval { - let secs = into_secs(interval); - unsafe { setsockopt(fd, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, secs)? } - } - - if let Some(retries) = keepalive.retries { - unsafe { setsockopt(fd, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, retries as c_int)? } - } - } - - #[cfg(target_os = "nto")] - if let Some(time) = keepalive.time { - let secs = into_timeval(Some(time)); - unsafe { setsockopt(fd, libc::IPPROTO_TCP, KEEPALIVE_TIME, secs)? } - } - - Ok(()) -} - -#[cfg(not(any( - target_os = "haiku", - target_os = "openbsd", - target_os = "nto", - target_os = "vita" -)))] -fn into_secs(duration: Duration) -> c_int { - min(duration.as_secs(), c_int::max_value() as u64) as c_int -} - -/// Add `flag` to the current set flags of `F_GETFD`. -#[cfg(not(target_os = "vita"))] -fn fcntl_add(fd: Socket, get_cmd: c_int, set_cmd: c_int, flag: c_int) -> io::Result<()> { - let previous = syscall!(fcntl(fd, get_cmd))?; - let new = previous | flag; - if new != previous { - syscall!(fcntl(fd, set_cmd, new)).map(|_| ()) - } else { - // Flag was already set. - Ok(()) - } -} - -/// Remove `flag` to the current set flags of `F_GETFD`. -#[cfg(not(target_os = "vita"))] -fn fcntl_remove(fd: Socket, get_cmd: c_int, set_cmd: c_int, flag: c_int) -> io::Result<()> { - let previous = syscall!(fcntl(fd, get_cmd))?; - let new = previous & !flag; - if new != previous { - syscall!(fcntl(fd, set_cmd, new)).map(|_| ()) - } else { - // Flag was already set. - Ok(()) - } -} - -/// Caller must ensure `T` is the correct type for `opt` and `val`. -pub(crate) unsafe fn getsockopt(fd: Socket, opt: c_int, val: c_int) -> io::Result { - let mut payload: MaybeUninit = MaybeUninit::uninit(); - let mut len = size_of::() as libc::socklen_t; - syscall!(getsockopt( - fd, - opt, - val, - payload.as_mut_ptr().cast(), - &mut len, - )) - .map(|_| { - debug_assert_eq!(len as usize, size_of::()); - // Safety: `getsockopt` initialised `payload` for us. - payload.assume_init() - }) -} - -/// Caller must ensure `T` is the correct type for `opt` and `val`. -pub(crate) unsafe fn setsockopt( - fd: Socket, - opt: c_int, - val: c_int, - payload: T, -) -> io::Result<()> { - let payload = &payload as *const T as *const c_void; - syscall!(setsockopt( - fd, - opt, - val, - payload, - mem::size_of::() as libc::socklen_t, - )) - .map(|_| ()) -} - -pub(crate) fn to_in_addr(addr: &Ipv4Addr) -> in_addr { - // `s_addr` is stored as BE on all machines, and the array is in BE order. - // So the native endian conversion method is used so that it's never - // swapped. - in_addr { - s_addr: u32::from_ne_bytes(addr.octets()), - } -} - -pub(crate) fn from_in_addr(in_addr: in_addr) -> Ipv4Addr { - Ipv4Addr::from(in_addr.s_addr.to_ne_bytes()) -} - -pub(crate) fn to_in6_addr(addr: &Ipv6Addr) -> in6_addr { - in6_addr { - s6_addr: addr.octets(), - } -} - -pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr { - Ipv6Addr::from(addr.s6_addr) -} - -#[cfg(not(any( - target_os = "haiku", - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "nto", - target_os = "espidf", - target_os = "vita", -)))] -pub(crate) fn to_mreqn( - multiaddr: &Ipv4Addr, - interface: &crate::socket::InterfaceIndexOrAddress, -) -> libc::ip_mreqn { - match interface { - crate::socket::InterfaceIndexOrAddress::Index(interface) => libc::ip_mreqn { - imr_multiaddr: to_in_addr(multiaddr), - imr_address: to_in_addr(&Ipv4Addr::UNSPECIFIED), - imr_ifindex: *interface as _, - }, - crate::socket::InterfaceIndexOrAddress::Address(interface) => libc::ip_mreqn { - imr_multiaddr: to_in_addr(multiaddr), - imr_address: to_in_addr(interface), - imr_ifindex: 0, - }, - } -} - -/// Unix only API. -impl crate::Socket { - /// Accept a new incoming connection from this listener. - /// - /// This function directly corresponds to the `accept4(2)` function. - /// - /// This function will block the calling thread until a new connection is - /// established. When established, the corresponding `Socket` and the remote - /// peer's address will be returned. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ) - ))) - )] - pub fn accept4(&self, flags: c_int) -> io::Result<(crate::Socket, SockAddr)> { - self._accept4(flags) - } - - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" - ))] - pub(crate) fn _accept4(&self, flags: c_int) -> io::Result<(crate::Socket, SockAddr)> { - // Safety: `accept4` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, len| { - syscall!(accept4(self.as_raw(), storage.cast(), len, flags)) - .map(crate::Socket::from_raw) - }) - } - } - - /// Sets `CLOEXEC` on the socket. - /// - /// # Notes - /// - /// On supported platforms you can use [`Type::cloexec`]. - #[cfg(all(feature = "all", not(target_os = "vita")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", unix, not(target_os = "vita")))))] - pub fn set_cloexec(&self, close_on_exec: bool) -> io::Result<()> { - self._set_cloexec(close_on_exec) - } - - #[cfg(not(target_os = "vita"))] - pub(crate) fn _set_cloexec(&self, close_on_exec: bool) -> io::Result<()> { - if close_on_exec { - fcntl_add( - self.as_raw(), - libc::F_GETFD, - libc::F_SETFD, - libc::FD_CLOEXEC, - ) - } else { - fcntl_remove( - self.as_raw(), - libc::F_GETFD, - libc::F_SETFD, - libc::FD_CLOEXEC, - ) - } - } - - /// Sets `SO_NOSIGPIPE` on the socket. - #[cfg(all(feature = "all", any(doc, target_vendor = "apple")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_vendor = "apple"))))] - pub fn set_nosigpipe(&self, nosigpipe: bool) -> io::Result<()> { - self._set_nosigpipe(nosigpipe) - } - - #[cfg(target_vendor = "apple")] - pub(crate) fn _set_nosigpipe(&self, nosigpipe: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_NOSIGPIPE, - nosigpipe as c_int, - ) - } - } - - /// Gets the value of the `TCP_MAXSEG` option on this socket. - /// - /// For more information about this option, see [`set_mss`]. - /// - /// [`set_mss`]: crate::Socket::set_mss - #[cfg(all(feature = "all", not(target_os = "redox")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", unix, not(target_os = "redox")))))] - pub fn mss(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::IPPROTO_TCP, libc::TCP_MAXSEG) - .map(|mss| mss as u32) - } - } - - /// Sets the value of the `TCP_MAXSEG` option on this socket. - /// - /// The `TCP_MAXSEG` option denotes the TCP Maximum Segment Size and is only - /// available on TCP sockets. - #[cfg(all(feature = "all", not(target_os = "redox")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", unix, not(target_os = "redox")))))] - pub fn set_mss(&self, mss: u32) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_MAXSEG, - mss as c_int, - ) - } - } - - /// Returns `true` if `listen(2)` was called on this socket by checking the - /// `SO_ACCEPTCONN` option on this socket. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))) - )] - pub fn is_listener(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_ACCEPTCONN) - .map(|v| v != 0) - } - } - - /// Returns the [`Domain`] of this socket by checking the `SO_DOMAIN` option - /// on this socket. - #[cfg(all( - feature = "all", - any( - target_os = "android", - // TODO: add FreeBSD. - // target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))] - #[cfg_attr(docsrs, doc(cfg(all( - feature = "all", - any( - target_os = "android", - // TODO: add FreeBSD. - // target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))))] - pub fn domain(&self) -> io::Result { - unsafe { getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_DOMAIN).map(Domain) } - } - - /// Returns the [`Protocol`] of this socket by checking the `SO_PROTOCOL` - /// option on this socket. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - ) - ))) - )] - pub fn protocol(&self) -> io::Result> { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_PROTOCOL).map(|v| match v - { - 0 => None, - p => Some(Protocol(p)), - }) - } - } - - /// Gets the value for the `SO_MARK` option on this socket. - /// - /// This value gets the socket mark field for each packet sent through - /// this socket. - /// - /// On Linux this function requires the `CAP_NET_ADMIN` capability. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn mark(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_MARK) - .map(|mark| mark as u32) - } - } - - /// Sets the value for the `SO_MARK` option on this socket. - /// - /// This value sets the socket mark field for each packet sent through - /// this socket. Changing the mark can be used for mark-based routing - /// without netfilter or for packet filtering. - /// - /// On Linux this function requires the `CAP_NET_ADMIN` capability. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_mark(&self, mark: u32) -> io::Result<()> { - unsafe { - setsockopt::( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_MARK, - mark as c_int, - ) - } - } - - /// Get the value of the `TCP_CORK` option on this socket. - /// - /// For more information about this option, see [`set_cork`]. - /// - /// [`set_cork`]: Socket::set_cork - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn cork(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::IPPROTO_TCP, libc::TCP_CORK) - .map(|cork| cork != 0) - } - } - - /// Set the value of the `TCP_CORK` option on this socket. - /// - /// If set, don't send out partial frames. All queued partial frames are - /// sent when the option is cleared again. There is a 200 millisecond ceiling on - /// the time for which output is corked by `TCP_CORK`. If this ceiling is reached, - /// then queued data is automatically transmitted. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_cork(&self, cork: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_CORK, - cork as c_int, - ) - } - } - - /// Get the value of the `TCP_QUICKACK` option on this socket. - /// - /// For more information about this option, see [`set_quickack`]. - /// - /// [`set_quickack`]: Socket::set_quickack - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn quickack(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::IPPROTO_TCP, libc::TCP_QUICKACK) - .map(|quickack| quickack != 0) - } - } - - /// Set the value of the `TCP_QUICKACK` option on this socket. - /// - /// If set, acks are sent immediately, rather than delayed if needed in accordance to normal - /// TCP operation. This flag is not permanent, it only enables a switch to or from quickack mode. - /// Subsequent operation of the TCP protocol will once again enter/leave quickack mode depending on - /// internal protocol processing and factors such as delayed ack timeouts occurring and data transfer. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_quickack(&self, quickack: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_QUICKACK, - quickack as c_int, - ) - } - } - - /// Get the value of the `TCP_THIN_LINEAR_TIMEOUTS` option on this socket. - /// - /// For more information about this option, see [`set_thin_linear_timeouts`]. - /// - /// [`set_thin_linear_timeouts`]: Socket::set_thin_linear_timeouts - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn thin_linear_timeouts(&self) -> io::Result { - unsafe { - getsockopt::( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_THIN_LINEAR_TIMEOUTS, - ) - .map(|timeouts| timeouts != 0) - } - } - - /// Set the value of the `TCP_THIN_LINEAR_TIMEOUTS` option on this socket. - /// - /// If set, the kernel will dynamically detect a thin-stream connection if there are less than four packets in flight. - /// With less than four packets in flight the normal TCP fast retransmission will not be effective. - /// The kernel will modify the retransmission to avoid the very high latencies that thin stream suffer because of exponential backoff. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_thin_linear_timeouts(&self, timeouts: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_THIN_LINEAR_TIMEOUTS, - timeouts as c_int, - ) - } - } - - /// Gets the value for the `SO_BINDTODEVICE` option on this socket. - /// - /// This value gets the socket binded device's interface name. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn device(&self) -> io::Result>> { - // TODO: replace with `MaybeUninit::uninit_array` once stable. - let mut buf: [MaybeUninit; libc::IFNAMSIZ] = - unsafe { MaybeUninit::uninit().assume_init() }; - let mut len = buf.len() as libc::socklen_t; - syscall!(getsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_BINDTODEVICE, - buf.as_mut_ptr().cast(), - &mut len, - ))?; - if len == 0 { - Ok(None) - } else { - let buf = &buf[..len as usize - 1]; - // TODO: use `MaybeUninit::slice_assume_init_ref` once stable. - Ok(Some(unsafe { &*(buf as *const [_] as *const [u8]) }.into())) - } - } - - /// Sets the value for the `SO_BINDTODEVICE` option on this socket. - /// - /// If a socket is bound to an interface, only packets received from that - /// particular interface are processed by the socket. Note that this only - /// works for some socket types, particularly `AF_INET` sockets. - /// - /// If `interface` is `None` or an empty string it removes the binding. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn bind_device(&self, interface: Option<&[u8]>) -> io::Result<()> { - let (value, len) = if let Some(interface) = interface { - (interface.as_ptr(), interface.len()) - } else { - (ptr::null(), 0) - }; - syscall!(setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_BINDTODEVICE, - value.cast(), - len as libc::socklen_t, - )) - .map(|_| ()) - } - - /// Sets the value for the `SO_SETFIB` option on this socket. - /// - /// Bind socket to the specified forwarding table (VRF) on a FreeBSD. - #[cfg(all(feature = "all", any(target_os = "freebsd")))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", any(target_os = "freebsd")))))] - pub fn set_fib(&self, fib: u32) -> io::Result<()> { - syscall!(setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_SETFIB, - (&fib as *const u32).cast(), - mem::size_of::() as libc::socklen_t, - )) - .map(|_| ()) - } - - /// Sets the value for `IP_BOUND_IF` option on this socket. - /// - /// If a socket is bound to an interface, only packets received from that - /// particular interface are processed by the socket. - /// - /// If `interface` is `None`, the binding is removed. If the `interface` - /// index is not valid, an error is returned. - /// - /// One can use `libc::if_nametoindex` to convert an interface alias to an - /// index. - #[cfg(all(feature = "all", target_vendor = "apple"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_vendor = "apple"))))] - pub fn bind_device_by_index(&self, interface: Option) -> io::Result<()> { - let index = interface.map(NonZeroU32::get).unwrap_or(0); - unsafe { setsockopt(self.as_raw(), IPPROTO_IP, libc::IP_BOUND_IF, index) } - } - - /// Gets the value for `IP_BOUND_IF` option on this socket, i.e. the index - /// for the interface to which the socket is bound. - /// - /// Returns `None` if the socket is not bound to any interface, otherwise - /// returns an interface index. - #[cfg(all(feature = "all", target_vendor = "apple"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_vendor = "apple"))))] - pub fn device_index(&self) -> io::Result> { - let index = - unsafe { getsockopt::(self.as_raw(), IPPROTO_IP, libc::IP_BOUND_IF)? }; - Ok(NonZeroU32::new(index)) - } - - /// Get the value of the `SO_INCOMING_CPU` option on this socket. - /// - /// For more information about this option, see [`set_cpu_affinity`]. - /// - /// [`set_cpu_affinity`]: crate::Socket::set_cpu_affinity - #[cfg(all(feature = "all", target_os = "linux"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] - pub fn cpu_affinity(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_INCOMING_CPU) - .map(|cpu| cpu as usize) - } - } - - /// Set value for the `SO_INCOMING_CPU` option on this socket. - /// - /// Sets the CPU affinity of the socket. - #[cfg(all(feature = "all", target_os = "linux"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] - pub fn set_cpu_affinity(&self, cpu: usize) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_INCOMING_CPU, - cpu as c_int, - ) - } - } - - /// Get the value of the `SO_REUSEPORT` option on this socket. - /// - /// For more information about this option, see [`set_reuse_port`]. - /// - /// [`set_reuse_port`]: crate::Socket::set_reuse_port - #[cfg(all( - feature = "all", - not(any(target_os = "solaris", target_os = "illumos")) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - unix, - not(any(target_os = "solaris", target_os = "illumos")) - ))) - )] - pub fn reuse_port(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_SOCKET, libc::SO_REUSEPORT) - .map(|reuse| reuse != 0) - } - } - - /// Set value for the `SO_REUSEPORT` option on this socket. - /// - /// This indicates that further calls to `bind` may allow reuse of local - /// addresses. For IPv4 sockets this means that a socket may bind even when - /// there's a socket already listening on this port. - #[cfg(all( - feature = "all", - not(any(target_os = "solaris", target_os = "illumos")) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - unix, - not(any(target_os = "solaris", target_os = "illumos")) - ))) - )] - pub fn set_reuse_port(&self, reuse: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_REUSEPORT, - reuse as c_int, - ) - } - } - - /// Get the value of the `IP_FREEBIND` option on this socket. - /// - /// For more information about this option, see [`set_freebind`]. - /// - /// [`set_freebind`]: crate::Socket::set_freebind - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn freebind(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_IP, libc::IP_FREEBIND) - .map(|freebind| freebind != 0) - } - } - - /// Set value for the `IP_FREEBIND` option on this socket. - /// - /// If enabled, this boolean option allows binding to an IP address that is - /// nonlocal or does not (yet) exist. This permits listening on a socket, - /// without requiring the underlying network interface or the specified - /// dynamic IP address to be up at the time that the application is trying - /// to bind to it. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_freebind(&self, freebind: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_IP, - libc::IP_FREEBIND, - freebind as c_int, - ) - } - } - - /// Get the value of the `IPV6_FREEBIND` option on this socket. - /// - /// This is an IPv6 counterpart of `IP_FREEBIND` socket option on - /// Android/Linux. For more information about this option, see - /// [`set_freebind`]. - /// - /// [`set_freebind`]: crate::Socket::set_freebind - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))) - )] - pub fn freebind_ipv6(&self) -> io::Result { - unsafe { - getsockopt::(self.as_raw(), libc::SOL_IPV6, libc::IPV6_FREEBIND) - .map(|freebind| freebind != 0) - } - } - - /// Set value for the `IPV6_FREEBIND` option on this socket. - /// - /// This is an IPv6 counterpart of `IP_FREEBIND` socket option on - /// Android/Linux. For more information about this option, see - /// [`set_freebind`]. - /// - /// [`set_freebind`]: crate::Socket::set_freebind - /// - /// # Examples - /// - /// On Linux: - /// - /// ``` - /// use socket2::{Domain, Socket, Type}; - /// use std::io::{self, Error, ErrorKind}; - /// - /// fn enable_freebind(socket: &Socket) -> io::Result<()> { - /// match socket.domain()? { - /// Domain::IPV4 => socket.set_freebind(true)?, - /// Domain::IPV6 => socket.set_freebind_ipv6(true)?, - /// _ => return Err(Error::new(ErrorKind::Other, "unsupported domain")), - /// }; - /// Ok(()) - /// } - /// - /// # fn main() -> io::Result<()> { - /// # let socket = Socket::new(Domain::IPV6, Type::STREAM, None)?; - /// # enable_freebind(&socket) - /// # } - /// ``` - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - #[cfg_attr( - docsrs, - doc(cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))) - )] - pub fn set_freebind_ipv6(&self, freebind: bool) -> io::Result<()> { - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_IPV6, - libc::IPV6_FREEBIND, - freebind as c_int, - ) - } - } - - /// Copies data between a `file` and this socket using the `sendfile(2)` - /// system call. Because this copying is done within the kernel, - /// `sendfile()` is more efficient than the combination of `read(2)` and - /// `write(2)`, which would require transferring data to and from user - /// space. - /// - /// Different OSs support different kinds of `file`s, see the OS - /// documentation for what kind of files are supported. Generally *regular* - /// files are supported by all OSs. - /// - /// The `offset` is the absolute offset into the `file` to use as starting - /// point. - /// - /// Depending on the OS this function *may* change the offset of `file`. For - /// the best results reset the offset of the file before using it again. - /// - /// The `length` determines how many bytes to send, where a length of `None` - /// means it will try to send all bytes. - #[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "linux", - target_vendor = "apple", - ) - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "freebsd", - target_os = "linux", - target_vendor = "apple", - ) - ))) - )] - pub fn sendfile( - &self, - file: &F, - offset: usize, - length: Option, - ) -> io::Result - where - F: AsRawFd, - { - self._sendfile(file.as_raw_fd(), offset as _, length) - } - - #[cfg(all(feature = "all", target_vendor = "apple"))] - fn _sendfile( - &self, - file: RawFd, - offset: libc::off_t, - length: Option, - ) -> io::Result { - // On macOS `length` is value-result parameter. It determines the number - // of bytes to write and returns the number of bytes written. - let mut length = match length { - Some(n) => n.get() as libc::off_t, - // A value of `0` means send all bytes. - None => 0, - }; - syscall!(sendfile( - file, - self.as_raw(), - offset, - &mut length, - ptr::null_mut(), - 0, - )) - .map(|_| length as usize) - } - - #[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))] - fn _sendfile( - &self, - file: RawFd, - offset: libc::off_t, - length: Option, - ) -> io::Result { - let count = match length { - Some(n) => n.get() as libc::size_t, - // The maximum the Linux kernel will write in a single call. - None => 0x7ffff000, // 2,147,479,552 bytes. - }; - let mut offset = offset; - syscall!(sendfile(self.as_raw(), file, &mut offset, count)).map(|n| n as usize) - } - - #[cfg(all(feature = "all", target_os = "freebsd"))] - fn _sendfile( - &self, - file: RawFd, - offset: libc::off_t, - length: Option, - ) -> io::Result { - let nbytes = match length { - Some(n) => n.get() as libc::size_t, - // A value of `0` means send all bytes. - None => 0, - }; - let mut sbytes: libc::off_t = 0; - syscall!(sendfile( - file, - self.as_raw(), - offset, - nbytes, - ptr::null_mut(), - &mut sbytes, - 0, - )) - .map(|_| sbytes as usize) - } - - /// Set the value of the `TCP_USER_TIMEOUT` option on this socket. - /// - /// If set, this specifies the maximum amount of time that transmitted data may remain - /// unacknowledged or buffered data may remain untransmitted before TCP will forcibly close the - /// corresponding connection. - /// - /// Setting `timeout` to `None` or a zero duration causes the system default timeouts to - /// be used. If `timeout` in milliseconds is larger than `c_uint::MAX`, the timeout is clamped - /// to `c_uint::MAX`. For example, when `c_uint` is a 32-bit value, this limits the timeout to - /// approximately 49.71 days. - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn set_tcp_user_timeout(&self, timeout: Option) -> io::Result<()> { - let timeout = timeout - .map(|to| min(to.as_millis(), libc::c_uint::MAX as u128) as libc::c_uint) - .unwrap_or(0); - unsafe { - setsockopt( - self.as_raw(), - libc::IPPROTO_TCP, - libc::TCP_USER_TIMEOUT, - timeout, - ) - } - } - - /// Get the value of the `TCP_USER_TIMEOUT` option on this socket. - /// - /// For more information about this option, see [`set_tcp_user_timeout`]. - /// - /// [`set_tcp_user_timeout`]: Socket::set_tcp_user_timeout - #[cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))] - #[cfg_attr( - docsrs, - doc(cfg(all( - feature = "all", - any(target_os = "android", target_os = "fuchsia", target_os = "linux") - ))) - )] - pub fn tcp_user_timeout(&self) -> io::Result> { - unsafe { - getsockopt::(self.as_raw(), libc::IPPROTO_TCP, libc::TCP_USER_TIMEOUT) - .map(|millis| { - if millis == 0 { - None - } else { - Some(Duration::from_millis(millis as u64)) - } - }) - } - } - - /// Attach Berkeley Packet Filter(BPF) on this socket. - /// - /// BPF allows a user-space program to attach a filter onto any socket - /// and allow or disallow certain types of data to come through the socket. - /// - /// For more information about this option, see [filter](https://www.kernel.org/doc/html/v5.12/networking/filter.html) - #[cfg(all(feature = "all", any(target_os = "linux", target_os = "android")))] - pub fn attach_filter(&self, filters: &[libc::sock_filter]) -> io::Result<()> { - let prog = libc::sock_fprog { - len: filters.len() as u16, - filter: filters.as_ptr() as *mut _, - }; - - unsafe { - setsockopt( - self.as_raw(), - libc::SOL_SOCKET, - libc::SO_ATTACH_FILTER, - prog, - ) - } - } - - /// Detach Berkeley Packet Filter(BPF) from this socket. - /// - /// For more information about this option, see [`attach_filter`] - #[cfg(all(feature = "all", any(target_os = "linux", target_os = "android")))] - pub fn detach_filter(&self) -> io::Result<()> { - unsafe { setsockopt(self.as_raw(), libc::SOL_SOCKET, libc::SO_DETACH_FILTER, 0) } - } -} - -#[cfg_attr(docsrs, doc(cfg(unix)))] -impl AsRawFd for crate::Socket { - fn as_raw_fd(&self) -> c_int { - self.as_raw() - } -} - -#[cfg_attr(docsrs, doc(cfg(unix)))] -impl IntoRawFd for crate::Socket { - fn into_raw_fd(self) -> c_int { - self.into_raw() - } -} - -#[cfg_attr(docsrs, doc(cfg(unix)))] -impl FromRawFd for crate::Socket { - unsafe fn from_raw_fd(fd: c_int) -> crate::Socket { - crate::Socket::from_raw(fd) - } -} - -#[cfg(feature = "all")] -from!(UnixStream, crate::Socket); -#[cfg(feature = "all")] -from!(UnixListener, crate::Socket); -#[cfg(feature = "all")] -from!(UnixDatagram, crate::Socket); -#[cfg(feature = "all")] -from!(crate::Socket, UnixStream); -#[cfg(feature = "all")] -from!(crate::Socket, UnixListener); -#[cfg(feature = "all")] -from!(crate::Socket, UnixDatagram); - -#[test] -fn in_addr_convertion() { - let ip = Ipv4Addr::new(127, 0, 0, 1); - let raw = to_in_addr(&ip); - // NOTE: `in_addr` is packed on NetBSD and it's unsafe to borrow. - let a = raw.s_addr; - assert_eq!(a, u32::from_ne_bytes([127, 0, 0, 1])); - assert_eq!(from_in_addr(raw), ip); - - let ip = Ipv4Addr::new(127, 34, 4, 12); - let raw = to_in_addr(&ip); - let a = raw.s_addr; - assert_eq!(a, u32::from_ne_bytes([127, 34, 4, 12])); - assert_eq!(from_in_addr(raw), ip); -} - -#[test] -fn in6_addr_convertion() { - let ip = Ipv6Addr::new(0x2000, 1, 2, 3, 4, 5, 6, 7); - let raw = to_in6_addr(&ip); - let want = [32, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7]; - assert_eq!(raw.s6_addr, want); - assert_eq!(from_in6_addr(raw), ip); -} diff --git a/vendor/socket2-0.4.10/src/sys/windows.rs b/vendor/socket2-0.4.10/src/sys/windows.rs deleted file mode 100644 index 0e36a1ccf..000000000 --- a/vendor/socket2-0.4.10/src/sys/windows.rs +++ /dev/null @@ -1,882 +0,0 @@ -// Copyright 2015 The Rust Project Developers. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::cmp::min; -use std::io::{self, IoSlice}; -use std::marker::PhantomData; -use std::mem::{self, size_of, MaybeUninit}; -use std::net::{self, Ipv4Addr, Ipv6Addr, Shutdown}; -use std::os::windows::prelude::*; -use std::sync::Once; -use std::time::{Duration, Instant}; -use std::{ptr, slice}; - -use winapi::ctypes::c_long; -use winapi::shared::in6addr::*; -use winapi::shared::inaddr::*; -use winapi::shared::minwindef::DWORD; -use winapi::shared::minwindef::ULONG; -use winapi::shared::mstcpip::{tcp_keepalive, SIO_KEEPALIVE_VALS}; -use winapi::shared::ntdef::HANDLE; -use winapi::shared::ws2def; -use winapi::shared::ws2def::WSABUF; -use winapi::um::handleapi::SetHandleInformation; -use winapi::um::processthreadsapi::GetCurrentProcessId; -use winapi::um::winbase::{self, INFINITE}; -use winapi::um::winsock2::{ - self as sock, u_long, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, SD_BOTH, SD_RECEIVE, SD_SEND, - WSAPOLLFD, -}; -use winapi::um::winsock2::{SOCKET_ERROR, WSAEMSGSIZE, WSAESHUTDOWN}; - -use crate::{RecvFlags, SockAddr, TcpKeepalive, Type}; - -pub(crate) use winapi::ctypes::c_int; - -/// Fake MSG_TRUNC flag for the [`RecvFlags`] struct. -/// -/// The flag is enabled when a `WSARecv[From]` call returns `WSAEMSGSIZE`. The -/// value of the flag is defined by us. -pub(crate) const MSG_TRUNC: c_int = 0x01; - -// Used in `Domain`. -pub(crate) use winapi::shared::ws2def::{AF_INET, AF_INET6}; -// Used in `Type`. -pub(crate) use winapi::shared::ws2def::{SOCK_DGRAM, SOCK_STREAM}; -#[cfg(feature = "all")] -pub(crate) use winapi::shared::ws2def::{SOCK_RAW, SOCK_SEQPACKET}; -// Used in `Protocol`. -pub(crate) const IPPROTO_ICMP: c_int = winapi::shared::ws2def::IPPROTO_ICMP as c_int; -pub(crate) const IPPROTO_ICMPV6: c_int = winapi::shared::ws2def::IPPROTO_ICMPV6 as c_int; -pub(crate) const IPPROTO_TCP: c_int = winapi::shared::ws2def::IPPROTO_TCP as c_int; -pub(crate) const IPPROTO_UDP: c_int = winapi::shared::ws2def::IPPROTO_UDP as c_int; -// Used in `SockAddr`. -pub(crate) use winapi::shared::ws2def::{ - ADDRESS_FAMILY as sa_family_t, SOCKADDR as sockaddr, SOCKADDR_IN as sockaddr_in, - SOCKADDR_STORAGE as sockaddr_storage, -}; -pub(crate) use winapi::shared::ws2ipdef::SOCKADDR_IN6_LH as sockaddr_in6; -pub(crate) use winapi::um::ws2tcpip::socklen_t; -// Used in `Socket`. -pub(crate) use winapi::shared::ws2def::{ - IPPROTO_IP, SOL_SOCKET, SO_BROADCAST, SO_ERROR, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, - SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, SO_SNDTIMEO, SO_TYPE, TCP_NODELAY, -}; -#[cfg(feature = "all")] -pub(crate) use winapi::shared::ws2ipdef::IP_HDRINCL; -pub(crate) use winapi::shared::ws2ipdef::{ - IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_MREQ as Ipv6Mreq, IPV6_MULTICAST_HOPS, - IPV6_MULTICAST_IF, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY, IP_ADD_MEMBERSHIP, - IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, IP_MREQ as IpMreq, - IP_MREQ_SOURCE as IpMreqSource, IP_MULTICAST_IF, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TOS, - IP_TTL, -}; -pub(crate) use winapi::um::winsock2::{linger, MSG_OOB, MSG_PEEK}; -pub(crate) const IPPROTO_IPV6: c_int = winapi::shared::ws2def::IPPROTO_IPV6 as c_int; - -/// Type used in set/getsockopt to retrieve the `TCP_NODELAY` option. -/// -/// NOTE: -/// documents that options such as `TCP_NODELAY` and `SO_KEEPALIVE` expect a -/// `BOOL` (alias for `c_int`, 4 bytes), however in practice this turns out to -/// be false (or misleading) as a `BOOLEAN` (`c_uchar`, 1 byte) is returned by -/// `getsockopt`. -pub(crate) type Bool = winapi::shared::ntdef::BOOLEAN; - -/// Maximum size of a buffer passed to system call like `recv` and `send`. -const MAX_BUF_LEN: usize = ::max_value() as usize; - -/// Helper macro to execute a system call that returns an `io::Result`. -macro_rules! syscall { - ($fn: ident ( $($arg: expr),* $(,)* ), $err_test: path, $err_value: expr) => {{ - #[allow(unused_unsafe)] - let res = unsafe { sock::$fn($($arg, )*) }; - if $err_test(&res, &$err_value) { - Err(io::Error::last_os_error()) - } else { - Ok(res) - } - }}; -} - -impl_debug!( - crate::Domain, - ws2def::AF_INET, - ws2def::AF_INET6, - ws2def::AF_UNIX, - ws2def::AF_UNSPEC, // = 0. -); - -/// Windows only API. -impl Type { - /// Our custom flag to set `WSA_FLAG_NO_HANDLE_INHERIT` on socket creation. - /// Trying to mimic `Type::cloexec` on windows. - const NO_INHERIT: c_int = 1 << ((size_of::() * 8) - 1); // Last bit. - - /// Set `WSA_FLAG_NO_HANDLE_INHERIT` on the socket. - #[cfg(feature = "all")] - #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "all"))))] - pub const fn no_inherit(self) -> Type { - self._no_inherit() - } - - pub(crate) const fn _no_inherit(self) -> Type { - Type(self.0 | Type::NO_INHERIT) - } -} - -impl_debug!( - crate::Type, - ws2def::SOCK_STREAM, - ws2def::SOCK_DGRAM, - ws2def::SOCK_RAW, - ws2def::SOCK_RDM, - ws2def::SOCK_SEQPACKET, -); - -impl_debug!( - crate::Protocol, - self::IPPROTO_ICMP, - self::IPPROTO_ICMPV6, - self::IPPROTO_TCP, - self::IPPROTO_UDP, -); - -impl std::fmt::Debug for RecvFlags { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("RecvFlags") - .field("is_truncated", &self.is_truncated()) - .finish() - } -} - -#[repr(transparent)] -pub struct MaybeUninitSlice<'a> { - vec: WSABUF, - _lifetime: PhantomData<&'a mut [MaybeUninit]>, -} - -unsafe impl<'a> Send for MaybeUninitSlice<'a> {} - -unsafe impl<'a> Sync for MaybeUninitSlice<'a> {} - -impl<'a> MaybeUninitSlice<'a> { - pub fn new(buf: &'a mut [MaybeUninit]) -> MaybeUninitSlice<'a> { - assert!(buf.len() <= ULONG::MAX as usize); - MaybeUninitSlice { - vec: WSABUF { - len: buf.len() as ULONG, - buf: buf.as_mut_ptr().cast(), - }, - _lifetime: PhantomData, - } - } - - pub fn as_slice(&self) -> &[MaybeUninit] { - unsafe { slice::from_raw_parts(self.vec.buf.cast(), self.vec.len as usize) } - } - - pub fn as_mut_slice(&mut self) -> &mut [MaybeUninit] { - unsafe { slice::from_raw_parts_mut(self.vec.buf.cast(), self.vec.len as usize) } - } -} - -fn init() { - static INIT: Once = Once::new(); - - INIT.call_once(|| { - // Initialize winsock through the standard library by just creating a - // dummy socket. Whether this is successful or not we drop the result as - // libstd will be sure to have initialized winsock. - let _ = net::UdpSocket::bind("127.0.0.1:34254"); - }); -} - -pub(crate) type Socket = sock::SOCKET; - -pub(crate) unsafe fn socket_from_raw(socket: Socket) -> crate::socket::Inner { - crate::socket::Inner::from_raw_socket(socket as RawSocket) -} - -pub(crate) fn socket_as_raw(socket: &crate::socket::Inner) -> Socket { - socket.as_raw_socket() as Socket -} - -pub(crate) fn socket_into_raw(socket: crate::socket::Inner) -> Socket { - socket.into_raw_socket() as Socket -} - -pub(crate) fn socket(family: c_int, mut ty: c_int, protocol: c_int) -> io::Result { - init(); - - // Check if we set our custom flag. - let flags = if ty & Type::NO_INHERIT != 0 { - ty = ty & !Type::NO_INHERIT; - sock::WSA_FLAG_NO_HANDLE_INHERIT - } else { - 0 - }; - - syscall!( - WSASocketW( - family, - ty, - protocol, - ptr::null_mut(), - 0, - sock::WSA_FLAG_OVERLAPPED | flags, - ), - PartialEq::eq, - sock::INVALID_SOCKET - ) -} - -pub(crate) fn bind(socket: Socket, addr: &SockAddr) -> io::Result<()> { - syscall!(bind(socket, addr.as_ptr(), addr.len()), PartialEq::ne, 0).map(|_| ()) -} - -pub(crate) fn connect(socket: Socket, addr: &SockAddr) -> io::Result<()> { - syscall!(connect(socket, addr.as_ptr(), addr.len()), PartialEq::ne, 0).map(|_| ()) -} - -pub(crate) fn poll_connect(socket: &crate::Socket, timeout: Duration) -> io::Result<()> { - let start = Instant::now(); - - let mut fd_array = WSAPOLLFD { - fd: socket.as_raw(), - events: POLLRDNORM | POLLWRNORM, - revents: 0, - }; - - loop { - let elapsed = start.elapsed(); - if elapsed >= timeout { - return Err(io::ErrorKind::TimedOut.into()); - } - - let timeout = (timeout - elapsed).as_millis(); - let timeout = clamp(timeout, 1, c_int::max_value() as u128) as c_int; - - match syscall!( - WSAPoll(&mut fd_array, 1, timeout), - PartialEq::eq, - sock::SOCKET_ERROR - ) { - Ok(0) => return Err(io::ErrorKind::TimedOut.into()), - Ok(_) => { - // Error or hang up indicates an error (or failure to connect). - if (fd_array.revents & POLLERR) != 0 || (fd_array.revents & POLLHUP) != 0 { - match socket.take_error() { - Ok(Some(err)) => return Err(err), - Ok(None) => { - return Err(io::Error::new( - io::ErrorKind::Other, - "no error set after POLLHUP", - )) - } - Err(err) => return Err(err), - } - } - return Ok(()); - } - // Got interrupted, try again. - Err(ref err) if err.kind() == io::ErrorKind::Interrupted => continue, - Err(err) => return Err(err), - } - } -} - -// TODO: use clamp from std lib, stable since 1.50. -fn clamp(value: T, min: T, max: T) -> T -where - T: Ord, -{ - if value <= min { - min - } else if value >= max { - max - } else { - value - } -} - -pub(crate) fn listen(socket: Socket, backlog: c_int) -> io::Result<()> { - syscall!(listen(socket, backlog), PartialEq::ne, 0).map(|_| ()) -} - -pub(crate) fn accept(socket: Socket) -> io::Result<(Socket, SockAddr)> { - // Safety: `accept` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, len| { - syscall!( - accept(socket, storage.cast(), len), - PartialEq::eq, - sock::INVALID_SOCKET - ) - }) - } -} - -pub(crate) fn getsockname(socket: Socket) -> io::Result { - // Safety: `getsockname` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, len| { - syscall!( - getsockname(socket, storage.cast(), len), - PartialEq::eq, - sock::SOCKET_ERROR - ) - }) - } - .map(|(_, addr)| addr) -} - -pub(crate) fn getpeername(socket: Socket) -> io::Result { - // Safety: `getpeername` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, len| { - syscall!( - getpeername(socket, storage.cast(), len), - PartialEq::eq, - sock::SOCKET_ERROR - ) - }) - } - .map(|(_, addr)| addr) -} - -pub(crate) fn try_clone(socket: Socket) -> io::Result { - let mut info: MaybeUninit = MaybeUninit::uninit(); - syscall!( - WSADuplicateSocketW(socket, GetCurrentProcessId(), info.as_mut_ptr()), - PartialEq::eq, - sock::SOCKET_ERROR - )?; - // Safety: `WSADuplicateSocketW` intialised `info` for us. - let mut info = unsafe { info.assume_init() }; - - syscall!( - WSASocketW( - info.iAddressFamily, - info.iSocketType, - info.iProtocol, - &mut info, - 0, - sock::WSA_FLAG_OVERLAPPED | sock::WSA_FLAG_NO_HANDLE_INHERIT, - ), - PartialEq::eq, - sock::INVALID_SOCKET - ) -} - -pub(crate) fn set_nonblocking(socket: Socket, nonblocking: bool) -> io::Result<()> { - let mut nonblocking = nonblocking as u_long; - ioctlsocket(socket, sock::FIONBIO, &mut nonblocking) -} - -pub(crate) fn shutdown(socket: Socket, how: Shutdown) -> io::Result<()> { - let how = match how { - Shutdown::Write => SD_SEND, - Shutdown::Read => SD_RECEIVE, - Shutdown::Both => SD_BOTH, - }; - syscall!(shutdown(socket, how), PartialEq::eq, sock::SOCKET_ERROR).map(|_| ()) -} - -pub(crate) fn recv(socket: Socket, buf: &mut [MaybeUninit], flags: c_int) -> io::Result { - let res = syscall!( - recv( - socket, - buf.as_mut_ptr().cast(), - min(buf.len(), MAX_BUF_LEN) as c_int, - flags, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ); - match res { - Ok(n) => Ok(n as usize), - Err(ref err) if err.raw_os_error() == Some(sock::WSAESHUTDOWN as i32) => Ok(0), - Err(err) => Err(err), - } -} - -pub(crate) fn recv_vectored( - socket: Socket, - bufs: &mut [crate::MaybeUninitSlice<'_>], - flags: c_int, -) -> io::Result<(usize, RecvFlags)> { - let mut nread = 0; - let mut flags = flags as DWORD; - let res = syscall!( - WSARecv( - socket, - bufs.as_mut_ptr().cast(), - min(bufs.len(), DWORD::max_value() as usize) as DWORD, - &mut nread, - &mut flags, - ptr::null_mut(), - None, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ); - match res { - Ok(_) => Ok((nread as usize, RecvFlags(0))), - Err(ref err) if err.raw_os_error() == Some(sock::WSAESHUTDOWN as i32) => { - Ok((0, RecvFlags(0))) - } - Err(ref err) if err.raw_os_error() == Some(sock::WSAEMSGSIZE as i32) => { - Ok((nread as usize, RecvFlags(MSG_TRUNC))) - } - Err(err) => Err(err), - } -} - -pub(crate) fn recv_from( - socket: Socket, - buf: &mut [MaybeUninit], - flags: c_int, -) -> io::Result<(usize, SockAddr)> { - // Safety: `recvfrom` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, addrlen| { - let res = syscall!( - recvfrom( - socket, - buf.as_mut_ptr().cast(), - min(buf.len(), MAX_BUF_LEN) as c_int, - flags, - storage.cast(), - addrlen, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ); - match res { - Ok(n) => Ok(n as usize), - Err(ref err) if err.raw_os_error() == Some(sock::WSAESHUTDOWN as i32) => Ok(0), - Err(err) => Err(err), - } - }) - } -} - -pub(crate) fn peek_sender(socket: Socket) -> io::Result { - // Safety: `recvfrom` initialises the `SockAddr` for us. - let ((), sender) = unsafe { - SockAddr::init(|storage, addrlen| { - let res = syscall!( - recvfrom( - socket, - // Windows *appears* not to care if you pass a null pointer. - ptr::null_mut(), - 0, - MSG_PEEK, - storage.cast(), - addrlen, - ), - PartialEq::eq, - SOCKET_ERROR - ); - match res { - Ok(_n) => Ok(()), - Err(e) => match e.raw_os_error() { - Some(code) if code == (WSAESHUTDOWN as i32) || code == (WSAEMSGSIZE as i32) => { - Ok(()) - } - _ => Err(e), - }, - } - }) - }?; - - Ok(sender) -} - -pub(crate) fn recv_from_vectored( - socket: Socket, - bufs: &mut [crate::MaybeUninitSlice<'_>], - flags: c_int, -) -> io::Result<(usize, RecvFlags, SockAddr)> { - // Safety: `recvfrom` initialises the `SockAddr` for us. - unsafe { - SockAddr::init(|storage, addrlen| { - let mut nread = 0; - let mut flags = flags as DWORD; - let res = syscall!( - WSARecvFrom( - socket, - bufs.as_mut_ptr().cast(), - min(bufs.len(), DWORD::max_value() as usize) as DWORD, - &mut nread, - &mut flags, - storage.cast(), - addrlen, - ptr::null_mut(), - None, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ); - match res { - Ok(_) => Ok((nread as usize, RecvFlags(0))), - Err(ref err) if err.raw_os_error() == Some(sock::WSAESHUTDOWN as i32) => { - Ok((nread as usize, RecvFlags(0))) - } - Err(ref err) if err.raw_os_error() == Some(sock::WSAEMSGSIZE as i32) => { - Ok((nread as usize, RecvFlags(MSG_TRUNC))) - } - Err(err) => Err(err), - } - }) - } - .map(|((n, recv_flags), addr)| (n, recv_flags, addr)) -} - -pub(crate) fn send(socket: Socket, buf: &[u8], flags: c_int) -> io::Result { - syscall!( - send( - socket, - buf.as_ptr().cast(), - min(buf.len(), MAX_BUF_LEN) as c_int, - flags, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|n| n as usize) -} - -pub(crate) fn send_vectored( - socket: Socket, - bufs: &[IoSlice<'_>], - flags: c_int, -) -> io::Result { - let mut nsent = 0; - syscall!( - WSASend( - socket, - // FIXME: From the `WSASend` docs [1]: - // > For a Winsock application, once the WSASend function is called, - // > the system owns these buffers and the application may not - // > access them. - // - // So what we're doing is actually UB as `bufs` needs to be `&mut - // [IoSlice<'_>]`. - // - // Tracking issue: https://github.com/rust-lang/socket2-rs/issues/129. - // - // NOTE: `send_to_vectored` has the same problem. - // - // [1] https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasend - bufs.as_ptr() as *mut _, - min(bufs.len(), DWORD::max_value() as usize) as DWORD, - &mut nsent, - flags as DWORD, - std::ptr::null_mut(), - None, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| nsent as usize) -} - -pub(crate) fn send_to( - socket: Socket, - buf: &[u8], - addr: &SockAddr, - flags: c_int, -) -> io::Result { - syscall!( - sendto( - socket, - buf.as_ptr().cast(), - min(buf.len(), MAX_BUF_LEN) as c_int, - flags, - addr.as_ptr(), - addr.len(), - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|n| n as usize) -} - -pub(crate) fn send_to_vectored( - socket: Socket, - bufs: &[IoSlice<'_>], - addr: &SockAddr, - flags: c_int, -) -> io::Result { - let mut nsent = 0; - syscall!( - WSASendTo( - socket, - // FIXME: Same problem as in `send_vectored`. - bufs.as_ptr() as *mut _, - bufs.len().min(DWORD::MAX as usize) as DWORD, - &mut nsent, - flags as DWORD, - addr.as_ptr(), - addr.len(), - ptr::null_mut(), - None, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| nsent as usize) -} - -/// Wrapper around `getsockopt` to deal with platform specific timeouts. -pub(crate) fn timeout_opt(fd: Socket, lvl: c_int, name: c_int) -> io::Result> { - unsafe { getsockopt(fd, lvl, name).map(from_ms) } -} - -fn from_ms(duration: DWORD) -> Option { - if duration == 0 { - None - } else { - let secs = duration / 1000; - let nsec = (duration % 1000) * 1000000; - Some(Duration::new(secs as u64, nsec as u32)) - } -} - -/// Wrapper around `setsockopt` to deal with platform specific timeouts. -pub(crate) fn set_timeout_opt( - fd: Socket, - level: c_int, - optname: c_int, - duration: Option, -) -> io::Result<()> { - let duration = into_ms(duration); - unsafe { setsockopt(fd, level, optname, duration) } -} - -fn into_ms(duration: Option) -> DWORD { - // Note that a duration is a (u64, u32) (seconds, nanoseconds) pair, and the - // timeouts in windows APIs are typically u32 milliseconds. To translate, we - // have two pieces to take care of: - // - // * Nanosecond precision is rounded up - // * Greater than u32::MAX milliseconds (50 days) is rounded up to - // INFINITE (never time out). - duration - .map(|duration| min(duration.as_millis(), INFINITE as u128) as DWORD) - .unwrap_or(0) -} - -pub(crate) fn set_tcp_keepalive(socket: Socket, keepalive: &TcpKeepalive) -> io::Result<()> { - let mut keepalive = tcp_keepalive { - onoff: 1, - keepalivetime: into_ms(keepalive.time), - keepaliveinterval: into_ms(keepalive.interval), - }; - let mut out = 0; - syscall!( - WSAIoctl( - socket, - SIO_KEEPALIVE_VALS, - &mut keepalive as *mut _ as *mut _, - size_of::() as _, - ptr::null_mut(), - 0, - &mut out, - ptr::null_mut(), - None, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| ()) -} - -/// Caller must ensure `T` is the correct type for `level` and `optname`. -pub(crate) unsafe fn getsockopt(socket: Socket, level: c_int, optname: c_int) -> io::Result { - let mut optval: MaybeUninit = MaybeUninit::uninit(); - let mut optlen = mem::size_of::() as c_int; - syscall!( - getsockopt( - socket, - level, - optname, - optval.as_mut_ptr().cast(), - &mut optlen, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| { - debug_assert_eq!(optlen as usize, mem::size_of::()); - // Safety: `getsockopt` initialised `optval` for us. - optval.assume_init() - }) -} - -/// Caller must ensure `T` is the correct type for `level` and `optname`. -pub(crate) unsafe fn setsockopt( - socket: Socket, - level: c_int, - optname: c_int, - optval: T, -) -> io::Result<()> { - syscall!( - setsockopt( - socket, - level, - optname, - (&optval as *const T).cast(), - mem::size_of::() as c_int, - ), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| ()) -} - -fn ioctlsocket(socket: Socket, cmd: c_long, payload: &mut u_long) -> io::Result<()> { - syscall!( - ioctlsocket(socket, cmd, payload), - PartialEq::eq, - sock::SOCKET_ERROR - ) - .map(|_| ()) -} - -pub(crate) fn to_in_addr(addr: &Ipv4Addr) -> IN_ADDR { - let mut s_un: in_addr_S_un = unsafe { mem::zeroed() }; - // `S_un` is stored as BE on all machines, and the array is in BE order. So - // the native endian conversion method is used so that it's never swapped. - unsafe { *(s_un.S_addr_mut()) = u32::from_ne_bytes(addr.octets()) }; - IN_ADDR { S_un: s_un } -} - -pub(crate) fn from_in_addr(in_addr: IN_ADDR) -> Ipv4Addr { - Ipv4Addr::from(unsafe { *in_addr.S_un.S_addr() }.to_ne_bytes()) -} - -pub(crate) fn to_in6_addr(addr: &Ipv6Addr) -> in6_addr { - let mut ret_addr: in6_addr_u = unsafe { mem::zeroed() }; - unsafe { *(ret_addr.Byte_mut()) = addr.octets() }; - let mut ret: in6_addr = unsafe { mem::zeroed() }; - ret.u = ret_addr; - ret -} - -pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr { - Ipv6Addr::from(*unsafe { addr.u.Byte() }) -} - -pub(crate) fn to_mreqn( - multiaddr: &Ipv4Addr, - interface: &crate::socket::InterfaceIndexOrAddress, -) -> IpMreq { - IpMreq { - imr_multiaddr: to_in_addr(multiaddr), - // Per https://docs.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-ip_mreq#members: - // - // imr_interface - // - // The local IPv4 address of the interface or the interface index on - // which the multicast group should be joined or dropped. This value is - // in network byte order. If this member specifies an IPv4 address of - // 0.0.0.0, the default IPv4 multicast interface is used. - // - // To use an interface index of 1 would be the same as an IP address of - // 0.0.0.1. - imr_interface: match interface { - crate::socket::InterfaceIndexOrAddress::Index(interface) => { - to_in_addr(&(*interface).into()) - } - crate::socket::InterfaceIndexOrAddress::Address(interface) => to_in_addr(interface), - }, - } -} - -/// Windows only API. -impl crate::Socket { - /// Sets `HANDLE_FLAG_INHERIT` using `SetHandleInformation`. - #[cfg(feature = "all")] - #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "all"))))] - pub fn set_no_inherit(&self, no_inherit: bool) -> io::Result<()> { - self._set_no_inherit(no_inherit) - } - - pub(crate) fn _set_no_inherit(&self, no_inherit: bool) -> io::Result<()> { - // NOTE: can't use `syscall!` because it expects the function in the - // `sock::` path. - let res = unsafe { - SetHandleInformation( - self.as_raw() as HANDLE, - winbase::HANDLE_FLAG_INHERIT, - !no_inherit as _, - ) - }; - if res == 0 { - // Zero means error. - Err(io::Error::last_os_error()) - } else { - Ok(()) - } - } -} - -impl AsRawSocket for crate::Socket { - fn as_raw_socket(&self) -> RawSocket { - self.as_raw() as RawSocket - } -} - -impl IntoRawSocket for crate::Socket { - fn into_raw_socket(self) -> RawSocket { - self.into_raw() as RawSocket - } -} - -impl FromRawSocket for crate::Socket { - unsafe fn from_raw_socket(socket: RawSocket) -> crate::Socket { - crate::Socket::from_raw(socket as Socket) - } -} - -#[test] -fn in_addr_convertion() { - let ip = Ipv4Addr::new(127, 0, 0, 1); - let raw = to_in_addr(&ip); - assert_eq!(unsafe { *raw.S_un.S_addr() }, 127 << 0 | 1 << 24); - assert_eq!(from_in_addr(raw), ip); - - let ip = Ipv4Addr::new(127, 34, 4, 12); - let raw = to_in_addr(&ip); - assert_eq!( - unsafe { *raw.S_un.S_addr() }, - 127 << 0 | 34 << 8 | 4 << 16 | 12 << 24 - ); - assert_eq!(from_in_addr(raw), ip); -} - -#[test] -fn in6_addr_convertion() { - let ip = Ipv6Addr::new(0x2000, 1, 2, 3, 4, 5, 6, 7); - let raw = to_in6_addr(&ip); - let want = [ - 0x2000u16.to_be(), - 1u16.to_be(), - 2u16.to_be(), - 3u16.to_be(), - 4u16.to_be(), - 5u16.to_be(), - 6u16.to_be(), - 7u16.to_be(), - ]; - assert_eq!(unsafe { *raw.u.Word() }, want); - assert_eq!(from_in6_addr(raw), ip); -} diff --git a/vendor/syn/.cargo-checksum.json b/vendor/syn/.cargo-checksum.json index ffbe76500..9746b35b7 100644 --- a/vendor/syn/.cargo-checksum.json +++ b/vendor/syn/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f47dd3099b90161054b6b694a5e6307429c94e54f04df2683537a0cd1dfb4ee0","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6904878f9082d7d267b6d0d737ef211ff165cfd039a4d45ad88e9861f3e217f","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"c006f01aacf95f61e5d6f4064be4040896a37a9632fb3dcfd9bc2a7ab171741d","src/attr.rs":"bd5ffae18a363162f7d9c12a1b6c1d023070cbf1b060c98ebc38ef79f1de9c67","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"3ef1c3302acc4f9976484fd11c28981a5ff245cf4f3b8b888b7f065c8614881e","src/custom_keyword.rs":"b2e25cbe73d237b459140a38083ee21e4836ea444859b033f400652414630290","src/custom_punctuation.rs":"c2c344c9cdbebc66a5833eb0f9ded817ce9807dbb75b616283b2b60960d1ffb0","src/data.rs":"09ce487d27f7dd79031b390c8344fc6361d64b05064ee25dba1489cf3aa56128","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"8dbb17978f688e12bcce58232f05c0ca9ed9de1fe511440793fb958da2fc93b9","src/export.rs":"b260cc49da1da3489e7755832bc8015cfad79e84f6c74e237f65ae25a2385e56","src/expr.rs":"4260279c392b594e36cee9709f668ebccb9a7be69192e24734341e6b3189374c","src/ext.rs":"3cf2d869812e5be894aa1c48bf074da262143fb2df1c9ac1b5ee965bf2a96a1c","src/file.rs":"a4d510dd0e2756bd54983dfa747601918c801e987cbf92deab44cdca6a201aeb","src/gen/clone.rs":"46540509dc99bb849014948a0c5b02ea372d5feceae5ea391c29f226f06516eb","src/gen/debug.rs":"32b2076b755f021428a0fb268a94057e1bcb1cd400feb895946703d7919b843a","src/gen/eq.rs":"aa5455b2cc0d9846d119ce001e821872df911f65133b993e3801a42e8f635f2a","src/gen/fold.rs":"305fe1db2b5b7039e79104a6e8ead11b1ee3c009f31f2a2bbebca10e494188cd","src/gen/hash.rs":"4ca8239c681ea5fd7b16bb61bff9034bff09680c088f5a16e90e99013e55742f","src/gen/visit.rs":"cbd0ebe18da62614c66a7900ef67350a5efee261bcdfff6cffc1ea6c4e754e34","src/gen/visit_mut.rs":"1b2a260ab3a6465eed6164f6d2c0cec977f9c3ca912f6bed81f8599b4d8f5cb0","src/gen_helper.rs":"750caab67ba0ba11a95ea28cd38026485227bb4aa114cdb497472386f60fdb35","src/generics.rs":"cb1a0374c523a469d48b1db7316166559034d437fb4f6cc5661511edb8aba32c","src/group.rs":"f5911e9cf2dc2dffab546590167c48de30409cb7708aa3307d22be143df720e4","src/ident.rs":"1b2d86d2e380b1fa83aee6ed113c47f0b482a229c25be428dac921deec0b4852","src/item.rs":"00ae729a00854f15203dbcbf2251910658eb052130de243144dcbec68be37919","src/lib.rs":"254307de790ddbdad664bd7507b91443edb287f1245c09c3a550ccf8882ad92e","src/lifetime.rs":"64abfd72af5dd271b2de1a8304ca0899b90da7750df9dec2ee8102bceb08a426","src/lit.rs":"3a70ebbc81563b967d2cbf589b6980a5b202ee3379d5d401e01a4c2af124d7ae","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"64fce3fda990306cfae5f0409918946ff7c9e98ecad963932e6c1436c0b0d4c2","src/meta.rs":"9df61ebaa405ef743ba1629b39ee5e806f9ead77694a1027f192da860270c83d","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"4d6c7935de1c2762ddb20ddf8e0b3de934e5ca26143aa8ba3a7fcc09f8c91893","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"08c8f4eaedeffaac73170b59921d140f63f4a01c243993dff050b4b848d0ac1f","src/pat.rs":"4d99c5ed6a08e6adfd0f6c31438befd3f03e48982a36bb2544962d9db7805a4a","src/path.rs":"8079943ec924ad5338e4bfa16b15b8ea0d6d27092396b62667eadcd0b98f20db","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"dffaab15b9215c70d7db416e8d4c44b78c43ba2f255485e6211363f0f0fea063","src/restriction.rs":"62efbc127d7e7316dd1070c0e976872de6238b2602bba1fb35df18511b4e7199","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"0a48e375e5c9768f6f64174a91ba6a255f4b021e2fb3548d8494e617f142601b","src/spanned.rs":"1bba75d73dd4dc5be6c4e11fdd72686d340fb25b5808830bd603ddc840beabdc","src/stmt.rs":"321d445f681c46ac30644504df2a8afc333a1dde0371159e9e077a17eed16548","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"e6b2373fb0465158d267bd25eac16266bd4b492d7dbe8ae4b5405a841a1ac57d","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"1d11c614298f25a8fa42165a01d6545fc699a446d7f3f8630162c7f478b26886","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"147342055d118d8ec7c64ea6b0224e61c4ac058e7395058f379668b07fe99345","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"246ddf1d303a9dbbc380e8d0689bd851cef3c3146d09d2627175deb9203b003d","tests/debug/gen.rs":"bc638d0fcb4a007d658535b60eec09cf4dc2c4907062832cb94fe6960a0d7e01","tests/debug/mod.rs":"dd87563bbd359401790a9c4185178539929ff9fa35a6998657af82a85731fe4c","tests/macros/mod.rs":"4c84bd9e82df255258671b6a57b0f2a3e4bef2127a2e8b842a4b6f3037b7fc5c","tests/regression.rs":"e9565ea0efecb4136f099164ffcfa26e1996b0a27fb9c6659e90ad9bdd42e7b6","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/regression/issue1235.rs":"a2266b10c3f7c7af5734817ab0a3e8b309b51e7d177b63f26e67e6b744d280b0","tests/repo/mod.rs":"9ab41309422dbf26543de6f67fa975239c33c9bfdd5ff772ee6b46b716ea60cf","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"3868181f25f7470476077f80a442a7804b6b9b371ad5917f4fd18b1002714c64","tests/test_attribute.rs":"b35550a43bbd187bb330997ba36f90c65d8fc489135b1d32ef4547f145cb7612","tests/test_derive_input.rs":"c215245c4d09052661ac5b65b34e950ea47622847bdffe648d380470f12db8f2","tests/test_expr.rs":"96af622fa5dfba122a63bf68927ba7e5d818c233d85f5fb01765b3a1b5b67411","tests/test_generics.rs":"b77741aa38e6ac7e1a9082faf168e7b7b92fbabf9f3fd07306676339a67394df","tests/test_grouping.rs":"ecbe3324878b2e2be42640a3dec198620cff18731fcb95ee7e94eacd11d2fec1","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"7f0255b61d0a6921313c09aaba470beefc55f1d4e66d1e24cfac7a3f63b035d8","tests/test_iterators.rs":"f4dacb5f3a8e0473dfb0d27f05270d41e79eddb4759b1fad3e88e379b4731e17","tests/test_lit.rs":"8e30c2d7837673a742d77aef01212788bbd099182dd5c1d10ee474cfeb786c39","tests/test_meta.rs":"3e1bb60b4bd56adb1e04b0e2d867404f0d81f7bf69caf7d8a70fc7090e079e84","tests/test_parse_buffer.rs":"3ed83ea2e50f84b80c0b543aac4bfbd379610d0911c0baa1eb94bb925bda7341","tests/test_parse_stream.rs":"a7e186272c89a239cae03053b5a039cdc073cdb46fad64b178fe76fde98405d5","tests/test_pat.rs":"fe94e084ee478d41cccea4eeb3e975386a70d36ff7cbb902ba0c767d536aab6e","tests/test_path.rs":"0033e1082b576bb3217ebd4546423d6f86fde7ee7ba3aba8c57bf137d2b42f47","tests/test_precedence.rs":"d3c34f2e5ffe22f7bdacff7ab6af71b24ba8150fdcc640f3c3e28db3491a556a","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"61183de56bf70c628659b9529f794b9f138904959f919f08f3b8176ba62c76ef","tests/test_shebang.rs":"06d3acabed004767d8b3a0389bde7485a6719cad6a0d0b4ac2c7439b03586651","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"78c14995718c2f8d5a7296c8f524601c30f91a5586e1402c0775977a4f814406","tests/test_stmt.rs":"42a3707056da0ce3a01f8fb13e8b7631f9be6066627ac376e1874742419ad2cc","tests/test_token_trees.rs":"d012da9c3c861073711b006bf6ffdc073821fb9fb0a08733628cdae57124d1f5","tests/test_ty.rs":"f7f21f76e9e798669f09a95c380e26ae5959ee8ac5f3b765b1a799cc9505d075","tests/test_visibility.rs":"cf4c93997cd88821ef7f8e2dd5d1586175cce4614407cd3bdf371ecc4d8abc44","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"} \ No newline at end of file +{"files":{"Cargo.toml":"bfa0938a6819ec2386d3de70587d6738774dde0c4b9bacda780e20661d7e5602","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6904878f9082d7d267b6d0d737ef211ff165cfd039a4d45ad88e9861f3e217f","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"84dedb2d912a19ce3b8c15cda3bbcdb2994996167fe4435f71d1b5f74590299d","src/attr.rs":"2833aadc7f0e180caeae32793f41e120467a38bb0635b0a3c33546cf29584635","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"30a9fffaf1b7a4fd8ca7eed5a9cde7a13d75d0b7b92569975bee1e7083d2555e","src/custom_keyword.rs":"b2e25cbe73d237b459140a38083ee21e4836ea444859b033f400652414630290","src/custom_punctuation.rs":"c2c344c9cdbebc66a5833eb0f9ded817ce9807dbb75b616283b2b60960d1ffb0","src/data.rs":"106be8b10d62ddf4fd636cf682b72a43748b25069a32cd2ff59333b3c8478695","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"f0d80891d42459ae9d490f2c5a749b501f3d06acc6ae2429c3558fd5dea38d0d","src/export.rs":"b260cc49da1da3489e7755832bc8015cfad79e84f6c74e237f65ae25a2385e56","src/expr.rs":"e84faad2faca52feaa1e3046dbf1c12dd3f4720110017a19c9794c9a20570f22","src/ext.rs":"3cf2d869812e5be894aa1c48bf074da262143fb2df1c9ac1b5ee965bf2a96a1c","src/file.rs":"a4d510dd0e2756bd54983dfa747601918c801e987cbf92deab44cdca6a201aeb","src/gen/clone.rs":"837df226926225f7f084ad4deb98a379dc98d079270ea5ae5db2f74d3a23bcb8","src/gen/debug.rs":"9532acd0fe48ea06073519956cae063882f89ef6f3579c32d9c1b3efb115a499","src/gen/eq.rs":"86279869463047ab62e01f72e2a166a6bbcf2e2082bec3e4679f8876ceac4ae9","src/gen/fold.rs":"33ce8928a4ba1e66517890244ce61089cebf19142e03220b227f60a10ba35f7f","src/gen/hash.rs":"4f0ab10b7aaddea9f988b02fe1946d6f81b8e51f75b5a1777ab0be67ed278816","src/gen/visit.rs":"33251b48083c41640a5f5b1fe6c6658ba62cb76dac0b630efaa5e18471bd06c2","src/gen/visit_mut.rs":"ff9fafdda337c6bf2f2d4ca3ce75714fabe45a98e14d729fd5b7b392499a1cc8","src/gen_helper.rs":"750caab67ba0ba11a95ea28cd38026485227bb4aa114cdb497472386f60fdb35","src/generics.rs":"699923668dfb2e5a129dab0f1f333f2f49d52d0a79c9314b8806e72c802169f5","src/group.rs":"f5911e9cf2dc2dffab546590167c48de30409cb7708aa3307d22be143df720e4","src/ident.rs":"1b2d86d2e380b1fa83aee6ed113c47f0b482a229c25be428dac921deec0b4852","src/item.rs":"ff8e41ce833d24deefde92c5c539e8a75d91fa05b33d742cbfdab34ed5d0eeb5","src/lib.rs":"fee820320cf90d964930f5c66662bb7d7bfd785968c41cddc463201c9805ce66","src/lifetime.rs":"64abfd72af5dd271b2de1a8304ca0899b90da7750df9dec2ee8102bceb08a426","src/lit.rs":"b382c85f0b81faebdf2e97a198afb5904738955ce130f5393b548430c2a17f9b","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"e68e246752d67307f9afb5ada6c1d689ddc0b0d9a51d40ba6191427d1e1b8bdc","src/meta.rs":"603dfd4fd71d9e4a5a33cb8ba8a9a1160b78898e3f41ccd5b1be503f47edea92","src/op.rs":"09a8dece03265aa1a9cd36c73f4ed7f783e311e4166c88671cf5ba833fb51d21","src/parse.rs":"1320c3b54f8c5dff87fd06d2b27e8dcd5edbe682c6946335eba30ace989d4bce","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"6bf1498244557fcecff9247091b7c701e9b2775cd061ff936c52eeffb101278b","src/pat.rs":"dd17c1ac958469f723bb4743b301f6c0ca2929b7f9e097dade5916eee949d6c5","src/path.rs":"d90644e63e8f87b09651ea09694934bdccfeb863f270a6de617828098602f8cd","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"dffaab15b9215c70d7db416e8d4c44b78c43ba2f255485e6211363f0f0fea063","src/restriction.rs":"1aed612ed2f39ab3f8edbb72a8f2aa506e5b6eb4d9f05f1b97d9bb32369a3fc9","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"0a48e375e5c9768f6f64174a91ba6a255f4b021e2fb3548d8494e617f142601b","src/spanned.rs":"1bba75d73dd4dc5be6c4e11fdd72686d340fb25b5808830bd603ddc840beabdc","src/stmt.rs":"fe7d7fd60ad1d6841c7a3602ae7e5d0ea9fcba2aeba82eb6f85d41b5c722ee64","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"e6b2373fb0465158d267bd25eac16266bd4b492d7dbe8ae4b5405a841a1ac57d","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"e76b69ae598be6af7af0947a698fc45dbece3b479d086f8cd97a0d470e730410","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"d87b07c88cdb890d230fff55bd713e62b3571aba7edc869664213f424de06718","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"246ddf1d303a9dbbc380e8d0689bd851cef3c3146d09d2627175deb9203b003d","tests/debug/gen.rs":"daa5be1f3dc2379d5067137e0106874e0f3ed5eba7f2a8436fdada0bf33d7186","tests/debug/mod.rs":"b56136586267ae1812a937b69215dd053ada2c21717771d89dcd3ce52bcb27f5","tests/macros/mod.rs":"ac0ef6edc8d4a740c620eb73ac69e81ae442d3f73bcb37cc49845e483a296194","tests/regression.rs":"e9565ea0efecb4136f099164ffcfa26e1996b0a27fb9c6659e90ad9bdd42e7b6","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/regression/issue1235.rs":"a2266b10c3f7c7af5734817ab0a3e8b309b51e7d177b63f26e67e6b744d280b0","tests/repo/mod.rs":"d92f0f9afa0613e95ab8ed1e7ec9b4d863b6eff5b790371ed8eac86f44902bf1","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"8982f6bc4e36510f924e288247473403e72697389ce9dda4e4b5ab0a8e49259f","tests/test_attribute.rs":"b35550a43bbd187bb330997ba36f90c65d8fc489135b1d32ef4547f145cb7612","tests/test_derive_input.rs":"99c4e6e45e3322ea9e269b309059c8a00fda1dcc03aed41f6e7d8c7e0a72fa2b","tests/test_expr.rs":"f7726efc959b860aa8aca6c51bc10c466cb1957774c1dfac24c3907cd8ea99a6","tests/test_generics.rs":"2fcc8575d695b568f3724b3b33d853b8fa6d9864eb816b5e3ca82420682e6155","tests/test_grouping.rs":"ecbe3324878b2e2be42640a3dec198620cff18731fcb95ee7e94eacd11d2fec1","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"9398997f2be33c89de52eb40f8c2fce86cf4ce5810fe709d2f20916ed6e2bb47","tests/test_iterators.rs":"f4dacb5f3a8e0473dfb0d27f05270d41e79eddb4759b1fad3e88e379b4731e17","tests/test_lit.rs":"8e30c2d7837673a742d77aef01212788bbd099182dd5c1d10ee474cfeb786c39","tests/test_meta.rs":"70fd75b42d1d913f05825c9e8280a4802e81de0b2343ad876850d2b7c588f0bf","tests/test_parse_buffer.rs":"92f5e898c1a6625011497f8cc8684eac0311850566ae9ab1848444305c9bdddf","tests/test_parse_quote.rs":"5bb7ec6773c3b878b3abedf17952948e707d8990b7e131605ee03d31f9ecae5b","tests/test_parse_stream.rs":"91a7ec997ea67d3c9d3028495345d89f2f67eb01bf11af3f99a1cef42a41aa05","tests/test_pat.rs":"8467fbef7cba36e6ce105cbc1a038b13ec154505bd34c863a18cfdfeac02c0b1","tests/test_path.rs":"b202244f034e58bf17e4c39bef696b0567e0ed42a63427ed4866acd14aaa90df","tests/test_precedence.rs":"f8b57c4a10ad249d3c6984cbe5db56a0c1e1381900dbc837fdc6f0e7f19221a7","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"61345d746dc03f99ec7e9e23fa6e5fe80526175d863f12d42163f7fa11d8c5cb","tests/test_shebang.rs":"98e8a6690c04e0aad2893b747593620b51836fe704f50f5c6fe352609837138a","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"b446868d55ae820196aad03dba3aa3529b727ac0465113c6fc66706423a73350","tests/test_stmt.rs":"761946f7d020f37dcc9f3a6c4b17c8d26c30d609193ac13c0672a2833b80f6dc","tests/test_token_trees.rs":"d012da9c3c861073711b006bf6ffdc073821fb9fb0a08733628cdae57124d1f5","tests/test_ty.rs":"e0262eb0c65c06a5bd8781cf0e256d7f093182202e8160623f00de98594845d2","tests/test_visibility.rs":"cf4c93997cd88821ef7f8e2dd5d1586175cce4614407cd3bdf371ecc4d8abc44","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"} \ No newline at end of file diff --git a/vendor/syn/Cargo.toml b/vendor/syn/Cargo.toml index 56cf07e4f..a467eb813 100644 --- a/vendor/syn/Cargo.toml +++ b/vendor/syn/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "syn" -version = "2.0.39" +version = "2.0.48" authors = ["David Tolnay "] include = [ "/benches/**", @@ -75,11 +75,11 @@ required-features = [ ] [dependencies.proc-macro2] -version = "1.0.67" +version = "1.0.75" default-features = false [dependencies.quote] -version = "1.0.28" +version = "1.0.35" optional = true default-features = false @@ -104,9 +104,6 @@ version = "1" [dev-dependencies.ref-cast] version = "1" -[dev-dependencies.regex] -version = "1" - [dev-dependencies.reqwest] version = "0.11" features = ["blocking"] diff --git a/vendor/syn/benches/rust.rs b/vendor/syn/benches/rust.rs index 643976188..15536db4c 100644 --- a/vendor/syn/benches/rust.rs +++ b/vendor/syn/benches/rust.rs @@ -6,6 +6,7 @@ #![cfg_attr(not(syn_only), feature(rustc_private))] #![recursion_limit = "1024"] #![allow( + clippy::arc_with_non_send_sync, clippy::cast_lossless, clippy::let_underscore_untyped, clippy::manual_let_else, @@ -53,7 +54,7 @@ mod librustc_parse { use rustc_data_structures::sync::Lrc; use rustc_error_messages::FluentBundle; - use rustc_errors::{emitter::Emitter, translation::Translate, Diagnostic, Handler}; + use rustc_errors::{emitter::Emitter, translation::Translate, DiagCtxt, Diagnostic}; use rustc_session::parse::ParseSess; use rustc_span::source_map::{FilePathMapping, SourceMap}; use rustc_span::{edition::Edition, FileName}; @@ -78,10 +79,10 @@ mod librustc_parse { } rustc_span::create_session_if_not_set_then(Edition::Edition2018, |_| { - let cm = Lrc::new(SourceMap::new(FilePathMapping::empty())); + let source_map = Lrc::new(SourceMap::new(FilePathMapping::empty())); let emitter = Box::new(SilentEmitter); - let handler = Handler::with_emitter(emitter); - let sess = ParseSess::with_span_handler(handler, cm); + let handler = DiagCtxt::with_emitter(emitter); + let sess = ParseSess::with_dcx(handler, source_map); if let Err(diagnostic) = rustc_parse::parse_crate_from_source_str( FileName::Custom("bench".to_owned()), content.to_owned(), diff --git a/vendor/syn/src/attr.rs b/vendor/syn/src/attr.rs index 34d5515a5..b6c4675b7 100644 --- a/vendor/syn/src/attr.rs +++ b/vendor/syn/src/attr.rs @@ -616,7 +616,7 @@ impl<'a> FilterAttrs<'a> for &'a [Attribute] { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::parse::discouraged::Speculative; + use crate::parse::discouraged::Speculative as _; use crate::parse::{Parse, ParseStream, Result}; use std::fmt::{self, Display}; diff --git a/vendor/syn/src/buffer.rs b/vendor/syn/src/buffer.rs index 564ccc757..86dec46af 100644 --- a/vendor/syn/src/buffer.rs +++ b/vendor/syn/src/buffer.rs @@ -128,11 +128,11 @@ impl<'a> Cursor<'a> { // past it, unless `ptr == scope`, which means that we're at the edge of // our cursor's scope. We should only have `ptr != scope` at the exit // from None-delimited groups entered with `ignore_none`. - while let Entry::End(_) = *ptr { + while let Entry::End(_) = unsafe { &*ptr } { if ptr == scope { break; } - ptr = ptr.add(1); + ptr = unsafe { ptr.add(1) }; } Cursor { @@ -154,7 +154,7 @@ impl<'a> Cursor<'a> { /// If the cursor is looking at an `Entry::Group`, the bumped cursor will /// point at the first token in the group (with the same scope end). unsafe fn bump_ignore_group(self) -> Cursor<'a> { - Cursor::create(self.ptr.offset(1), self.scope) + unsafe { Cursor::create(self.ptr.offset(1), self.scope) } } /// While the cursor is looking at a `None`-delimited group, move it to look @@ -389,7 +389,7 @@ impl<'a> PartialEq for Cursor<'a> { impl<'a> PartialOrd for Cursor<'a> { fn partial_cmp(&self, other: &Self) -> Option { if same_buffer(*self, *other) { - Some(self.ptr.cmp(&other.ptr)) + Some(cmp_assuming_same_buffer(*self, *other)) } else { None } @@ -413,7 +413,6 @@ fn start_of_buffer(cursor: Cursor) -> *const Entry { } } -#[cfg(any(feature = "full", feature = "derive"))] pub(crate) fn cmp_assuming_same_buffer(a: Cursor, b: Cursor) -> Ordering { a.ptr.cmp(&b.ptr) } diff --git a/vendor/syn/src/data.rs b/vendor/syn/src/data.rs index 431c0857d..134b76bb4 100644 --- a/vendor/syn/src/data.rs +++ b/vendor/syn/src/data.rs @@ -156,7 +156,9 @@ ast_struct! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; + use crate::ext::IdentExt as _; + #[cfg(not(feature = "full"))] + use crate::parse::discouraged::Speculative as _; use crate::parse::{Parse, ParseStream, Result}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] @@ -174,7 +176,20 @@ pub(crate) mod parsing { }; let discriminant = if input.peek(Token![=]) { let eq_token: Token![=] = input.parse()?; + #[cfg(feature = "full")] let discriminant: Expr = input.parse()?; + #[cfg(not(feature = "full"))] + let discriminant = { + let begin = input.fork(); + let ahead = input.fork(); + let mut discriminant: Result = ahead.parse(); + if discriminant.is_ok() { + input.advance_to(&ahead); + } else if scan_lenient_discriminant(input).is_ok() { + discriminant = Ok(Expr::Verbatim(verbatim::between(&begin, input))); + } + discriminant? + }; Some((eq_token, discriminant)) } else { None @@ -188,6 +203,79 @@ pub(crate) mod parsing { } } + #[cfg(not(feature = "full"))] + pub(crate) fn scan_lenient_discriminant(input: ParseStream) -> Result<()> { + use proc_macro2::Delimiter::{self, Brace, Bracket, Parenthesis}; + + let consume = |delimiter: Delimiter| { + Result::unwrap(input.step(|cursor| match cursor.group(delimiter) { + Some((_inside, _span, rest)) => Ok((true, rest)), + None => Ok((false, *cursor)), + })) + }; + + macro_rules! consume { + [$token:tt] => { + input.parse::>().unwrap().is_some() + }; + } + + let mut initial = true; + let mut depth = 0usize; + loop { + if initial { + if consume![&] { + input.parse::>()?; + } else if consume![if] || consume![match] || consume![while] { + depth += 1; + } else if input.parse::>()?.is_some() + || (consume(Brace) || consume(Bracket) || consume(Parenthesis)) + || (consume![async] || consume![const] || consume![loop] || consume![unsafe]) + && (consume(Brace) || break) + { + initial = false; + } else if consume![let] { + while !consume![=] { + if !((consume![|] || consume![ref] || consume![mut] || consume![@]) + || (consume![!] || input.parse::>()?.is_some()) + || (consume![..=] || consume![..] || consume![&] || consume![_]) + || (consume(Brace) || consume(Bracket) || consume(Parenthesis))) + { + path::parsing::qpath(input, true)?; + } + } + } else if input.parse::>()?.is_some() && !consume![:] { + break; + } else if input.parse::().is_err() { + path::parsing::qpath(input, true)?; + initial = consume![!] || depth == 0 && input.peek(token::Brace); + } + } else if input.is_empty() || input.peek(Token![,]) { + return Ok(()); + } else if depth > 0 && consume(Brace) { + if consume![else] && !consume(Brace) { + initial = consume![if] || break; + } else { + depth -= 1; + } + } else if input.parse::().is_ok() || (consume![..] | consume![=]) { + initial = true; + } else if consume![.] { + if input.parse::>()?.is_none() + && (input.parse::()?.is_named() && consume![::]) + { + AngleBracketedGenericArguments::do_parse(None, input)?; + } + } else if consume![as] { + input.parse::()?; + } else if !(consume(Brace) || consume(Bracket) || consume(Parenthesis)) { + break; + } + } + + Err(input.error("unsupported expression")) + } + #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for FieldsNamed { fn parse(input: ParseStream) -> Result { diff --git a/vendor/syn/src/error.rs b/vendor/syn/src/error.rs index 3fe31d5ce..71247cde3 100644 --- a/vendor/syn/src/error.rs +++ b/vendor/syn/src/error.rs @@ -185,6 +185,7 @@ impl Error { /// When in doubt it's recommended to stick to `Error::new` (or /// `ParseStream::error`)! #[cfg(feature = "printing")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))] pub fn new_spanned(tokens: T, message: U) -> Self { return new_spanned(tokens.into_token_stream(), message.to_string()); @@ -403,7 +404,7 @@ impl std::error::Error for Error {} impl From for Error { fn from(err: LexError) -> Self { - Error::new(err.span(), "lex error") + Error::new(err.span(), err) } } diff --git a/vendor/syn/src/expr.rs b/vendor/syn/src/expr.rs index 22400be32..7fb0f7b4e 100644 --- a/vendor/syn/src/expr.rs +++ b/vendor/syn/src/expr.rs @@ -223,12 +223,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match expr { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // Expr::Array(expr) => {...} // Expr::Assign(expr) => {...} // ... // Expr::Yield(expr) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -357,6 +358,7 @@ ast_struct! { ast_struct! { /// A const block: `const { ... }`. + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub struct ExprConst #full { pub attrs: Vec, pub const_token: Token![const], @@ -443,6 +445,7 @@ ast_struct! { ast_struct! { /// The inferred value of a const generic argument, denoted `_`. + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub struct ExprInfer #full { pub attrs: Vec, pub underscore_token: Token![_], @@ -483,6 +486,7 @@ ast_struct! { ast_struct! { /// A macro invocation expression: `format!("{}", q)`. + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub struct ExprMacro { pub attrs: Vec, pub mac: Macro, @@ -503,8 +507,8 @@ ast_struct! { ast_struct! { /// A method call expression: `x.foo::(a, b)`. - #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] - pub struct ExprMethodCall #full { + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] + pub struct ExprMethodCall { pub attrs: Vec, pub receiver: Box, pub dot_token: Token![.], @@ -551,8 +555,8 @@ ast_struct! { ast_struct! { /// A referencing operation: `&a` or `&mut a`. - #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] - pub struct ExprReference #full { + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] + pub struct ExprReference { pub attrs: Vec, pub and_token: Token![&], pub mutability: Option, @@ -587,8 +591,8 @@ ast_struct! { /// /// The `rest` provides the value of the remaining fields as in `S { a: /// 1, b: 1, ..rest }`. - #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] - pub struct ExprStruct #full { + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] + pub struct ExprStruct { pub attrs: Vec, pub qself: Option, pub path: Path, @@ -840,10 +844,9 @@ impl IdentFragment for Index { } } -#[cfg(feature = "full")] ast_struct! { /// A field-value pair in a struct literal. - #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub struct FieldValue { pub attrs: Vec, pub member: Member, @@ -955,31 +958,10 @@ pub(crate) fn requires_terminator(expr: &Expr) -> bool { } #[cfg(feature = "parsing")] -pub(crate) mod parsing { - use super::*; - #[cfg(feature = "full")] - use crate::ext::IdentExt; - use crate::parse::discouraged::Speculative; - #[cfg(feature = "full")] - use crate::parse::ParseBuffer; - use crate::parse::{Parse, ParseStream, Result}; - use crate::path; - use std::cmp::Ordering; +mod precedence { + use super::BinOp; - mod kw { - crate::custom_keyword!(builtin); - crate::custom_keyword!(raw); - } - - // When we're parsing expressions which occur before blocks, like in an if - // statement's condition, we cannot parse a struct literal. - // - // Struct literals are ambiguous in certain positions - // https://github.com/rust-lang/rfcs/pull/92 - #[cfg(feature = "full")] - pub(crate) struct AllowStruct(bool); - - enum Precedence { + pub(crate) enum Precedence { Any, Assign, Range, @@ -996,7 +978,7 @@ pub(crate) mod parsing { } impl Precedence { - fn of(op: &BinOp) -> Self { + pub(crate) fn of(op: &BinOp) -> Self { match op { BinOp::Add(_) | BinOp::Sub(_) => Precedence::Arithmetic, BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Term, @@ -1025,6 +1007,33 @@ pub(crate) mod parsing { } } } +} + +#[cfg(feature = "parsing")] +pub(crate) mod parsing { + use super::precedence::Precedence; + use super::*; + #[cfg(feature = "full")] + use crate::ext::IdentExt as _; + use crate::parse::discouraged::Speculative as _; + #[cfg(feature = "full")] + use crate::parse::ParseBuffer; + use crate::parse::{Parse, ParseStream, Result}; + use crate::path; + use std::cmp::Ordering; + + mod kw { + crate::custom_keyword!(builtin); + crate::custom_keyword!(raw); + } + + // When we're parsing expressions which occur before blocks, like in an if + // statement's condition, we cannot parse a struct literal. + // + // Struct literals are ambiguous in certain positions + // https://github.com/rust-lang/rfcs/pull/92 + #[cfg(feature = "full")] + pub(crate) struct AllowStruct(bool); #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for Expr { @@ -1354,23 +1363,8 @@ pub(crate) mod parsing { #[cfg(feature = "full")] fn expr_attrs(input: ParseStream) -> Result> { let mut attrs = Vec::new(); - loop { - if input.peek(token::Group) { - let ahead = input.fork(); - let group = crate::group::parse_group(&ahead)?; - if !group.content.peek(Token![#]) || group.content.peek2(Token![!]) { - break; - } - let attr = group.content.call(attr::parsing::single_parse_outer)?; - if !group.content.is_empty() { - break; - } - attrs.push(attr); - } else if input.peek(Token![#]) { - attrs.push(input.call(attr::parsing::single_parse_outer)?); - } else { - break; - } + while !input.peek(token::Group) && input.peek(Token![#]) { + attrs.push(input.call(attr::parsing::single_parse_outer)?); } Ok(attrs) } @@ -1383,6 +1377,10 @@ pub(crate) mod parsing { fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { let begin = input.fork(); let attrs = input.call(expr_attrs)?; + if input.peek(token::Group) { + return trailer_expr(begin, attrs, input, allow_struct); + } + if input.peek(Token![&]) { let and_token: Token![&] = input.parse()?; let raw: Option = if input.peek(kw::raw) @@ -1416,7 +1414,14 @@ pub(crate) mod parsing { #[cfg(not(feature = "full"))] fn unary_expr(input: ParseStream) -> Result { - if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) { + if input.peek(Token![&]) { + Ok(Expr::Reference(ExprReference { + attrs: Vec::new(), + and_token: input.parse()?, + mutability: input.parse()?, + expr: Box::new(unary_expr(input)?), + })) + } else if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) { Ok(Expr::Unary(ExprUnary { attrs: Vec::new(), op: input.parse()?, @@ -1560,17 +1565,45 @@ pub(crate) mod parsing { && !input.peek2(Token![await]) { let mut dot_token: Token![.] = input.parse()?; + let float_token: Option = input.parse()?; if let Some(float_token) = float_token { if multi_index(&mut e, &mut dot_token, float_token)? { continue; } } + + let member: Member = input.parse()?; + let turbofish = if member.is_named() && input.peek(Token![::]) { + let colon2_token: Token![::] = input.parse()?; + let turbofish = + AngleBracketedGenericArguments::do_parse(Some(colon2_token), input)?; + Some(turbofish) + } else { + None + }; + + if turbofish.is_some() || input.peek(token::Paren) { + if let Member::Named(method) = member { + let content; + e = Expr::MethodCall(ExprMethodCall { + attrs: Vec::new(), + receiver: Box::new(e), + dot_token, + method, + turbofish, + paren_token: parenthesized!(content in input), + args: content.parse_terminated(Expr::parse, Token![,])?, + }); + continue; + } + } + e = Expr::Field(ExprField { attrs: Vec::new(), base: Box::new(e), dot_token, - member: input.parse()?, + member, }); } else if input.peek(token::Bracket) { let content; @@ -1592,12 +1625,8 @@ pub(crate) mod parsing { // interactions, as they are fully contained. #[cfg(feature = "full")] fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { - if input.peek(token::Group) - && !input.peek2(Token![::]) - && !input.peek2(Token![!]) - && !input.peek2(token::Brace) - { - input.call(expr_group).map(Expr::Group) + if input.peek(token::Group) { + expr_group(input, allow_struct) } else if input.peek(Lit) { input.parse().map(Expr::Lit) } else if input.peek(Token![async]) @@ -1663,39 +1692,40 @@ pub(crate) mod parsing { } else if input.peek(Token![_]) { input.parse().map(Expr::Infer) } else if input.peek(Lifetime) { - let the_label: Label = input.parse()?; - let mut expr = if input.peek(Token![while]) { - Expr::While(input.parse()?) - } else if input.peek(Token![for]) { - Expr::ForLoop(input.parse()?) - } else if input.peek(Token![loop]) { - Expr::Loop(input.parse()?) - } else if input.peek(token::Brace) { - Expr::Block(input.parse()?) - } else { - return Err(input.error("expected loop or block expression")); - }; - match &mut expr { - Expr::While(ExprWhile { label, .. }) - | Expr::ForLoop(ExprForLoop { label, .. }) - | Expr::Loop(ExprLoop { label, .. }) - | Expr::Block(ExprBlock { label, .. }) => *label = Some(the_label), - _ => unreachable!(), - } - Ok(expr) + atom_labeled(input) } else { Err(input.error("expected an expression")) } } + #[cfg(feature = "full")] + fn atom_labeled(input: ParseStream) -> Result { + let the_label: Label = input.parse()?; + let mut expr = if input.peek(Token![while]) { + Expr::While(input.parse()?) + } else if input.peek(Token![for]) { + Expr::ForLoop(input.parse()?) + } else if input.peek(Token![loop]) { + Expr::Loop(input.parse()?) + } else if input.peek(token::Brace) { + Expr::Block(input.parse()?) + } else { + return Err(input.error("expected loop or block expression")); + }; + match &mut expr { + Expr::While(ExprWhile { label, .. }) + | Expr::ForLoop(ExprForLoop { label, .. }) + | Expr::Loop(ExprLoop { label, .. }) + | Expr::Block(ExprBlock { label, .. }) => *label = Some(the_label), + _ => unreachable!(), + } + Ok(expr) + } + #[cfg(not(feature = "full"))] fn atom_expr(input: ParseStream) -> Result { - if input.peek(token::Group) - && !input.peek2(Token![::]) - && !input.peek2(Token![!]) - && !input.peek2(token::Brace) - { - input.call(expr_group).map(Expr::Group) + if input.peek(token::Group) { + expr_group(input) } else if input.peek(Lit) { input.parse().map(Expr::Lit) } else if input.peek(token::Paren) { @@ -1746,7 +1776,21 @@ pub(crate) mod parsing { #[cfg(feature = "full")] allow_struct: AllowStruct, ) -> Result { let (qself, path) = path::parsing::qpath(input, true)?; + rest_of_path_or_macro_or_struct( + qself, + path, + input, + #[cfg(feature = "full")] + allow_struct, + ) + } + fn rest_of_path_or_macro_or_struct( + qself: Option, + path: Path, + input: ParseStream, + #[cfg(feature = "full")] allow_struct: AllowStruct, + ) -> Result { if qself.is_none() && input.peek(Token![!]) && !input.peek(Token![!=]) @@ -1765,7 +1809,8 @@ pub(crate) mod parsing { })); } - #[cfg(feature = "full")] + #[cfg(not(feature = "full"))] + let allow_struct = (true,); if allow_struct.0 && input.peek(token::Brace) { return expr_struct_helper(input, qself, path).map(Expr::Struct); } @@ -1915,7 +1960,15 @@ pub(crate) mod parsing { #[cfg(feature = "full")] pub(crate) fn expr_early(input: ParseStream) -> Result { let mut attrs = input.call(expr_attrs)?; - let mut expr = if input.peek(Token![if]) { + let mut expr = if input.peek(token::Group) { + let allow_struct = AllowStruct(true); + let atom = expr_group(input, allow_struct)?; + if continue_parsing_early(&atom) { + trailer_helper(input, atom)? + } else { + atom + } + } else if input.peek(Token![if]) { Expr::If(input.parse()?) } else if input.peek(Token![while]) { Expr::While(input.parse()?) @@ -1935,15 +1988,20 @@ pub(crate) mod parsing { Expr::Const(input.parse()?) } else if input.peek(token::Brace) { Expr::Block(input.parse()?) + } else if input.peek(Lifetime) { + atom_labeled(input)? } else { let allow_struct = AllowStruct(true); - let mut expr = unary_expr(input, allow_struct)?; + unary_expr(input, allow_struct)? + }; + if continue_parsing_early(&expr) { attrs.extend(expr.replace_attrs(Vec::new())); expr.replace_attrs(attrs); + let allow_struct = AllowStruct(true); return parse_expr(input, expr, allow_struct, Precedence::Any); - }; + } if input.peek(Token![.]) && !input.peek(Token![..]) || input.peek(Token![?]) { expr = trailer_helper(input, expr)?; @@ -1960,6 +2018,25 @@ pub(crate) mod parsing { Ok(expr) } + #[cfg(feature = "full")] + fn continue_parsing_early(mut expr: &Expr) -> bool { + while let Expr::Group(group) = expr { + expr = &group.expr; + } + match expr { + Expr::If(_) + | Expr::While(_) + | Expr::ForLoop(_) + | Expr::Loop(_) + | Expr::Match(_) + | Expr::TryBlock(_) + | Expr::Unsafe(_) + | Expr::Const(_) + | Expr::Block(_) => false, + _ => true, + } + } + #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for ExprLit { fn parse(input: ParseStream) -> Result { @@ -1970,13 +2047,38 @@ pub(crate) mod parsing { } } - fn expr_group(input: ParseStream) -> Result { + fn expr_group( + input: ParseStream, + #[cfg(feature = "full")] allow_struct: AllowStruct, + ) -> Result { let group = crate::group::parse_group(input)?; - Ok(ExprGroup { + let mut inner: Expr = group.content.parse()?; + + match inner { + Expr::Path(mut expr) if expr.attrs.is_empty() => { + let grouped_len = expr.path.segments.len(); + Path::parse_rest(input, &mut expr.path, true)?; + match rest_of_path_or_macro_or_struct( + expr.qself, + expr.path, + input, + #[cfg(feature = "full")] + allow_struct, + )? { + Expr::Path(expr) if expr.path.segments.len() == grouped_len => { + inner = Expr::Path(expr); + } + extended => return Ok(extended), + } + } + _ => {} + } + + Ok(Expr::Group(ExprGroup { attrs: Vec::new(), group_token: group.token, - expr: group.content.parse()?, - }) + expr: Box::new(inner), + })) } #[cfg(feature = "full")] @@ -2040,9 +2142,9 @@ pub(crate) mod parsing { let else_token: Token![else] = input.parse()?; let lookahead = input.lookahead1(); - let else_branch = if input.peek(Token![if]) { + let else_branch = if lookahead.peek(Token![if]) { input.parse().map(Expr::If)? - } else if input.peek(token::Brace) { + } else if lookahead.peek(token::Brace) { Expr::Block(ExprBlock { attrs: Vec::new(), label: None, @@ -2517,7 +2619,6 @@ pub(crate) mod parsing { }) } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for FieldValue { fn parse(input: ParseStream) -> Result { @@ -2547,7 +2648,6 @@ pub(crate) mod parsing { } } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for ExprStruct { fn parse(input: ParseStream) -> Result { @@ -2556,7 +2656,6 @@ pub(crate) mod parsing { } } - #[cfg(feature = "full")] fn expr_struct_helper( input: ParseStream, qself: Option, @@ -2815,9 +2914,8 @@ pub(crate) mod parsing { Ok(!trailing_dot) } - #[cfg(feature = "full")] impl Member { - fn is_named(&self) -> bool { + pub(crate) fn is_named(&self) -> bool { match self { Member::Named(_) => true, Member::Unnamed(_) => false, @@ -3163,7 +3261,6 @@ pub(crate) mod printing { } } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))] impl ToTokens for ExprMethodCall { fn to_tokens(&self, tokens: &mut TokenStream) { @@ -3207,7 +3304,6 @@ pub(crate) mod printing { } } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))] impl ToTokens for ExprReference { fn to_tokens(&self, tokens: &mut TokenStream) { @@ -3241,7 +3337,6 @@ pub(crate) mod printing { } } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))] impl ToTokens for ExprStruct { fn to_tokens(&self, tokens: &mut TokenStream) { @@ -3358,7 +3453,6 @@ pub(crate) mod printing { } } - #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))] impl ToTokens for FieldValue { fn to_tokens(&self, tokens: &mut TokenStream) { diff --git a/vendor/syn/src/gen/clone.rs b/vendor/syn/src/gen/clone.rs index d275f5114..95936794a 100644 --- a/vendor/syn/src/gen/clone.rs +++ b/vendor/syn/src/gen/clone.rs @@ -266,19 +266,16 @@ impl Clone for Expr { Expr::Macro(v0) => Expr::Macro(v0.clone()), #[cfg(feature = "full")] Expr::Match(v0) => Expr::Match(v0.clone()), - #[cfg(feature = "full")] Expr::MethodCall(v0) => Expr::MethodCall(v0.clone()), Expr::Paren(v0) => Expr::Paren(v0.clone()), Expr::Path(v0) => Expr::Path(v0.clone()), #[cfg(feature = "full")] Expr::Range(v0) => Expr::Range(v0.clone()), - #[cfg(feature = "full")] Expr::Reference(v0) => Expr::Reference(v0.clone()), #[cfg(feature = "full")] Expr::Repeat(v0) => Expr::Repeat(v0.clone()), #[cfg(feature = "full")] Expr::Return(v0) => Expr::Return(v0.clone()), - #[cfg(feature = "full")] Expr::Struct(v0) => Expr::Struct(v0.clone()), #[cfg(feature = "full")] Expr::Try(v0) => Expr::Try(v0.clone()), @@ -577,7 +574,7 @@ impl Clone for ExprMatch { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprMethodCall { fn clone(&self) -> Self { @@ -626,7 +623,7 @@ impl Clone for ExprRange { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprReference { fn clone(&self) -> Self { @@ -662,7 +659,7 @@ impl Clone for ExprReturn { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprStruct { fn clone(&self) -> Self { @@ -791,7 +788,7 @@ impl Clone for FieldPat { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for FieldValue { fn clone(&self) -> Self { diff --git a/vendor/syn/src/gen/debug.rs b/vendor/syn/src/gen/debug.rs index 837fe99f4..553497ba4 100644 --- a/vendor/syn/src/gen/debug.rs +++ b/vendor/syn/src/gen/debug.rs @@ -432,19 +432,16 @@ impl Debug for Expr { Expr::Macro(v0) => v0.debug(formatter, "Macro"), #[cfg(feature = "full")] Expr::Match(v0) => v0.debug(formatter, "Match"), - #[cfg(feature = "full")] Expr::MethodCall(v0) => v0.debug(formatter, "MethodCall"), Expr::Paren(v0) => v0.debug(formatter, "Paren"), Expr::Path(v0) => v0.debug(formatter, "Path"), #[cfg(feature = "full")] Expr::Range(v0) => v0.debug(formatter, "Range"), - #[cfg(feature = "full")] Expr::Reference(v0) => v0.debug(formatter, "Reference"), #[cfg(feature = "full")] Expr::Repeat(v0) => v0.debug(formatter, "Repeat"), #[cfg(feature = "full")] Expr::Return(v0) => v0.debug(formatter, "Return"), - #[cfg(feature = "full")] Expr::Struct(v0) => v0.debug(formatter, "Struct"), #[cfg(feature = "full")] Expr::Try(v0) => v0.debug(formatter, "Try"), @@ -862,7 +859,7 @@ impl Debug for ExprMatch { self.debug(formatter, "ExprMatch") } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Debug for ExprMethodCall { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -931,7 +928,7 @@ impl Debug for ExprRange { self.debug(formatter, "ExprRange") } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Debug for ExprReference { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -982,7 +979,7 @@ impl Debug for ExprReturn { self.debug(formatter, "ExprReturn") } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Debug for ExprStruct { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1152,7 +1149,7 @@ impl Debug for FieldPat { formatter.finish() } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Debug for FieldValue { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/vendor/syn/src/gen/eq.rs b/vendor/syn/src/gen/eq.rs index a7479c300..a1fb3b45e 100644 --- a/vendor/syn/src/gen/eq.rs +++ b/vendor/syn/src/gen/eq.rs @@ -285,19 +285,16 @@ impl PartialEq for Expr { (Expr::Macro(self0), Expr::Macro(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Match(self0), Expr::Match(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::MethodCall(self0), Expr::MethodCall(other0)) => self0 == other0, (Expr::Paren(self0), Expr::Paren(other0)) => self0 == other0, (Expr::Path(self0), Expr::Path(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Range(self0), Expr::Range(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Reference(self0), Expr::Reference(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Repeat(self0), Expr::Repeat(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Return(self0), Expr::Return(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Struct(self0), Expr::Struct(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Try(self0), Expr::Try(other0)) => self0 == other0, @@ -560,10 +557,10 @@ impl PartialEq for ExprMatch { self.attrs == other.attrs && self.expr == other.expr && self.arms == other.arms } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprMethodCall {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprMethodCall { fn eq(&self, other: &Self) -> bool { @@ -603,10 +600,10 @@ impl PartialEq for ExprRange { && self.limits == other.limits && self.end == other.end } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprReference {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprReference { fn eq(&self, other: &Self) -> bool { @@ -634,10 +631,10 @@ impl PartialEq for ExprReturn { self.attrs == other.attrs && self.expr == other.expr } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprStruct {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprStruct { fn eq(&self, other: &Self) -> bool { @@ -752,10 +749,10 @@ impl PartialEq for FieldPat { && self.colon_token == other.colon_token && self.pat == other.pat } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for FieldValue {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for FieldValue { fn eq(&self, other: &Self) -> bool { diff --git a/vendor/syn/src/gen/fold.rs b/vendor/syn/src/gen/fold.rs index 8ea6c75fc..6bd058b0d 100644 --- a/vendor/syn/src/gen/fold.rs +++ b/vendor/syn/src/gen/fold.rs @@ -30,10 +30,12 @@ macro_rules! full { /// [module documentation]: self pub trait Fold { #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_angle_bracketed_generic_arguments( &mut self, i: AngleBracketedGenericArguments, @@ -41,294 +43,367 @@ pub trait Fold { fold_angle_bracketed_generic_arguments(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_assoc_const(&mut self, i: AssocConst) -> AssocConst { fold_assoc_const(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_assoc_type(&mut self, i: AssocType) -> AssocType { fold_assoc_type(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_bare_variadic(&mut self, i: BareVariadic) -> BareVariadic { fold_bare_variadic(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_constraint(&mut self, i: Constraint) -> Constraint { fold_constraint(self, i) } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_async(&mut self, i: ExprAsync) -> ExprAsync { fold_expr_async(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_await(&mut self, i: ExprAwait) -> ExprAwait { fold_expr_await(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_const(&mut self, i: ExprConst) -> ExprConst { fold_expr_const(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_infer(&mut self, i: ExprInfer) -> ExprInfer { fold_expr_infer(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_let(&mut self, i: ExprLet) -> ExprLet { fold_expr_let(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_reference(&mut self, i: ExprReference) -> ExprReference { fold_expr_reference(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_try_block(&mut self, i: ExprTryBlock) -> ExprTryBlock { fold_expr_try_block(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_field_mutability(&mut self, i: FieldMutability) -> FieldMutability { fold_field_mutability(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_file(&mut self, i: File) -> File { fold_file(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_foreign_item_macro(&mut self, i: ForeignItemMacro) -> ForeignItemMacro { fold_foreign_item_macro(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) } @@ -336,98 +411,122 @@ pub trait Fold { fold_ident(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_item_fn(&mut self, i: ImplItemFn) -> ImplItemFn { fold_impl_item_fn(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_impl_restriction(&mut self, i: ImplRestriction) -> ImplRestriction { fold_impl_restriction(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_trait_alias(&mut self, i: ItemTraitAlias) -> ItemTraitAlias { fold_item_trait_alias(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) } @@ -435,6 +534,7 @@ pub trait Fold { fold_lifetime(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_lifetime_param(&mut self, i: LifetimeParam) -> LifetimeParam { fold_lifetime_param(self, i) } @@ -463,38 +563,47 @@ pub trait Fold { fold_lit_str(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_local_init(&mut self, i: LocalInit) -> LocalInit { fold_local_init(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_meta(&mut self, i: Meta) -> Meta { fold_meta(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_meta_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_parenthesized_generic_arguments( &mut self, i: ParenthesizedGenericArguments, @@ -502,90 +611,112 @@ pub trait Fold { fold_parenthesized_generic_arguments(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_or(&mut self, i: PatOr) -> PatOr { fold_pat_or(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_paren(&mut self, i: PatParen) -> PatParen { fold_pat_paren(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_reference(&mut self, i: PatReference) -> PatReference { fold_pat_reference(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_rest(&mut self, i: PatRest) -> PatRest { fold_pat_rest(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_type(&mut self, i: PatType) -> PatType { fold_pat_type(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_receiver(&mut self, i: Receiver) -> Receiver { fold_receiver(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_signature(&mut self, i: Signature) -> Signature { fold_signature(self, i) } @@ -593,22 +724,27 @@ pub trait Fold { fold_span(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_static_mutability(&mut self, i: StaticMutability) -> StaticMutability { fold_static_mutability(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_stmt_macro(&mut self, i: StmtMacro) -> StmtMacro { fold_stmt_macro(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_trait_bound_modifier( &mut self, i: TraitBoundModifier, @@ -616,147 +752,183 @@ pub trait Fold { fold_trait_bound_modifier(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_trait_item_fn(&mut self, i: TraitItemFn) -> TraitItemFn { fold_trait_item_fn(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_group(&mut self, i: UseGroup) -> UseGroup { fold_use_group(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_name(&mut self, i: UseName) -> UseName { fold_use_name(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_rename(&mut self, i: UseRename) -> UseRename { fold_use_rename(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn fold_variadic(&mut self, i: Variadic) -> Variadic { fold_variadic(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_abi(f: &mut F, node: Abi) -> Abi where F: Fold + ?Sized, @@ -767,6 +939,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_angle_bracketed_generic_arguments( f: &mut F, node: AngleBracketedGenericArguments, @@ -782,6 +955,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_arm(f: &mut F, node: Arm) -> Arm where F: Fold + ?Sized, @@ -796,6 +970,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_assoc_const(f: &mut F, node: AssocConst) -> AssocConst where F: Fold + ?Sized, @@ -808,6 +983,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_assoc_type(f: &mut F, node: AssocType) -> AssocType where F: Fold + ?Sized, @@ -820,6 +996,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_attr_style(f: &mut F, node: AttrStyle) -> AttrStyle where F: Fold + ?Sized, @@ -830,6 +1007,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_attribute(f: &mut F, node: Attribute) -> Attribute where F: Fold + ?Sized, @@ -842,6 +1020,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_bare_fn_arg(f: &mut F, node: BareFnArg) -> BareFnArg where F: Fold + ?Sized, @@ -853,6 +1032,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_bare_variadic(f: &mut F, node: BareVariadic) -> BareVariadic where F: Fold + ?Sized, @@ -865,6 +1045,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_bin_op(f: &mut F, node: BinOp) -> BinOp where F: Fold + ?Sized, @@ -901,6 +1082,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_block(f: &mut F, node: Block) -> Block where F: Fold + ?Sized, @@ -911,6 +1093,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_bound_lifetimes(f: &mut F, node: BoundLifetimes) -> BoundLifetimes where F: Fold + ?Sized, @@ -923,6 +1106,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_const_param(f: &mut F, node: ConstParam) -> ConstParam where F: Fold + ?Sized, @@ -938,6 +1122,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_constraint(f: &mut F, node: Constraint) -> Constraint where F: Fold + ?Sized, @@ -950,6 +1135,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn fold_data(f: &mut F, node: Data) -> Data where F: Fold + ?Sized, @@ -961,6 +1147,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn fold_data_enum(f: &mut F, node: DataEnum) -> DataEnum where F: Fold + ?Sized, @@ -972,6 +1159,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn fold_data_struct(f: &mut F, node: DataStruct) -> DataStruct where F: Fold + ?Sized, @@ -983,6 +1171,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn fold_data_union(f: &mut F, node: DataUnion) -> DataUnion where F: Fold + ?Sized, @@ -993,6 +1182,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn fold_derive_input(f: &mut F, node: DeriveInput) -> DeriveInput where F: Fold + ?Sized, @@ -1006,6 +1196,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr(f: &mut F, node: Expr) -> Expr where F: Fold + ?Sized, @@ -1041,17 +1232,15 @@ where Expr::Macro(_binding_0) => Expr::Macro(f.fold_expr_macro(_binding_0)), Expr::Match(_binding_0) => Expr::Match(full!(f.fold_expr_match(_binding_0))), Expr::MethodCall(_binding_0) => { - Expr::MethodCall(full!(f.fold_expr_method_call(_binding_0))) + Expr::MethodCall(f.fold_expr_method_call(_binding_0)) } Expr::Paren(_binding_0) => Expr::Paren(f.fold_expr_paren(_binding_0)), Expr::Path(_binding_0) => Expr::Path(f.fold_expr_path(_binding_0)), Expr::Range(_binding_0) => Expr::Range(full!(f.fold_expr_range(_binding_0))), - Expr::Reference(_binding_0) => { - Expr::Reference(full!(f.fold_expr_reference(_binding_0))) - } + Expr::Reference(_binding_0) => Expr::Reference(f.fold_expr_reference(_binding_0)), Expr::Repeat(_binding_0) => Expr::Repeat(full!(f.fold_expr_repeat(_binding_0))), Expr::Return(_binding_0) => Expr::Return(full!(f.fold_expr_return(_binding_0))), - Expr::Struct(_binding_0) => Expr::Struct(full!(f.fold_expr_struct(_binding_0))), + Expr::Struct(_binding_0) => Expr::Struct(f.fold_expr_struct(_binding_0)), Expr::Try(_binding_0) => Expr::Try(full!(f.fold_expr_try(_binding_0))), Expr::TryBlock(_binding_0) => { Expr::TryBlock(full!(f.fold_expr_try_block(_binding_0))) @@ -1065,6 +1254,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_array(f: &mut F, node: ExprArray) -> ExprArray where F: Fold + ?Sized, @@ -1076,6 +1266,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_assign(f: &mut F, node: ExprAssign) -> ExprAssign where F: Fold + ?Sized, @@ -1088,6 +1279,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_async(f: &mut F, node: ExprAsync) -> ExprAsync where F: Fold + ?Sized, @@ -1100,6 +1292,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_await(f: &mut F, node: ExprAwait) -> ExprAwait where F: Fold + ?Sized, @@ -1112,6 +1305,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_binary(f: &mut F, node: ExprBinary) -> ExprBinary where F: Fold + ?Sized, @@ -1124,6 +1318,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_block(f: &mut F, node: ExprBlock) -> ExprBlock where F: Fold + ?Sized, @@ -1135,6 +1330,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_break(f: &mut F, node: ExprBreak) -> ExprBreak where F: Fold + ?Sized, @@ -1147,6 +1343,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_call(f: &mut F, node: ExprCall) -> ExprCall where F: Fold + ?Sized, @@ -1159,6 +1356,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_cast(f: &mut F, node: ExprCast) -> ExprCast where F: Fold + ?Sized, @@ -1171,6 +1369,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_closure(f: &mut F, node: ExprClosure) -> ExprClosure where F: Fold + ?Sized, @@ -1190,6 +1389,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_const(f: &mut F, node: ExprConst) -> ExprConst where F: Fold + ?Sized, @@ -1201,6 +1401,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_continue(f: &mut F, node: ExprContinue) -> ExprContinue where F: Fold + ?Sized, @@ -1212,6 +1413,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_field(f: &mut F, node: ExprField) -> ExprField where F: Fold + ?Sized, @@ -1224,6 +1426,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_for_loop(f: &mut F, node: ExprForLoop) -> ExprForLoop where F: Fold + ?Sized, @@ -1239,6 +1442,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_group(f: &mut F, node: ExprGroup) -> ExprGroup where F: Fold + ?Sized, @@ -1250,6 +1454,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_if(f: &mut F, node: ExprIf) -> ExprIf where F: Fold + ?Sized, @@ -1264,6 +1469,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_index(f: &mut F, node: ExprIndex) -> ExprIndex where F: Fold + ?Sized, @@ -1276,6 +1482,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_infer(f: &mut F, node: ExprInfer) -> ExprInfer where F: Fold + ?Sized, @@ -1286,6 +1493,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_let(f: &mut F, node: ExprLet) -> ExprLet where F: Fold + ?Sized, @@ -1299,6 +1507,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_lit(f: &mut F, node: ExprLit) -> ExprLit where F: Fold + ?Sized, @@ -1309,6 +1518,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_loop(f: &mut F, node: ExprLoop) -> ExprLoop where F: Fold + ?Sized, @@ -1321,6 +1531,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_macro(f: &mut F, node: ExprMacro) -> ExprMacro where F: Fold + ?Sized, @@ -1331,6 +1542,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_match(f: &mut F, node: ExprMatch) -> ExprMatch where F: Fold + ?Sized, @@ -1343,7 +1555,8 @@ where arms: FoldHelper::lift(node.arms, |it| f.fold_arm(it)), } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_method_call(f: &mut F, node: ExprMethodCall) -> ExprMethodCall where F: Fold + ?Sized, @@ -1360,6 +1573,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_paren(f: &mut F, node: ExprParen) -> ExprParen where F: Fold + ?Sized, @@ -1371,6 +1585,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_path(f: &mut F, node: ExprPath) -> ExprPath where F: Fold + ?Sized, @@ -1382,6 +1597,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_range(f: &mut F, node: ExprRange) -> ExprRange where F: Fold + ?Sized, @@ -1393,7 +1609,8 @@ where end: (node.end).map(|it| Box::new(f.fold_expr(*it))), } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_reference(f: &mut F, node: ExprReference) -> ExprReference where F: Fold + ?Sized, @@ -1406,6 +1623,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_repeat(f: &mut F, node: ExprRepeat) -> ExprRepeat where F: Fold + ?Sized, @@ -1419,6 +1637,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_return(f: &mut F, node: ExprReturn) -> ExprReturn where F: Fold + ?Sized, @@ -1429,7 +1648,8 @@ where expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))), } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_struct(f: &mut F, node: ExprStruct) -> ExprStruct where F: Fold + ?Sized, @@ -1445,6 +1665,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_try(f: &mut F, node: ExprTry) -> ExprTry where F: Fold + ?Sized, @@ -1456,6 +1677,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_try_block(f: &mut F, node: ExprTryBlock) -> ExprTryBlock where F: Fold + ?Sized, @@ -1467,6 +1689,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_tuple(f: &mut F, node: ExprTuple) -> ExprTuple where F: Fold + ?Sized, @@ -1478,6 +1701,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_expr_unary(f: &mut F, node: ExprUnary) -> ExprUnary where F: Fold + ?Sized, @@ -1489,6 +1713,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_unsafe(f: &mut F, node: ExprUnsafe) -> ExprUnsafe where F: Fold + ?Sized, @@ -1500,6 +1725,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_while(f: &mut F, node: ExprWhile) -> ExprWhile where F: Fold + ?Sized, @@ -1513,6 +1739,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_expr_yield(f: &mut F, node: ExprYield) -> ExprYield where F: Fold + ?Sized, @@ -1524,6 +1751,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_field(f: &mut F, node: Field) -> Field where F: Fold + ?Sized, @@ -1538,6 +1766,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_field_mutability(f: &mut F, node: FieldMutability) -> FieldMutability where F: Fold + ?Sized, @@ -1547,6 +1776,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_field_pat(f: &mut F, node: FieldPat) -> FieldPat where F: Fold + ?Sized, @@ -1558,7 +1788,8 @@ where pat: Box::new(f.fold_pat(*node.pat)), } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_field_value(f: &mut F, node: FieldValue) -> FieldValue where F: Fold + ?Sized, @@ -1571,6 +1802,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_fields(f: &mut F, node: Fields) -> Fields where F: Fold + ?Sized, @@ -1582,6 +1814,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_fields_named(f: &mut F, node: FieldsNamed) -> FieldsNamed where F: Fold + ?Sized, @@ -1592,6 +1825,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_fields_unnamed(f: &mut F, node: FieldsUnnamed) -> FieldsUnnamed where F: Fold + ?Sized, @@ -1602,6 +1836,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_file(f: &mut F, node: File) -> File where F: Fold + ?Sized, @@ -1613,6 +1848,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_fn_arg(f: &mut F, node: FnArg) -> FnArg where F: Fold + ?Sized, @@ -1623,6 +1859,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_foreign_item(f: &mut F, node: ForeignItem) -> ForeignItem where F: Fold + ?Sized, @@ -1644,6 +1881,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_foreign_item_fn(f: &mut F, node: ForeignItemFn) -> ForeignItemFn where F: Fold + ?Sized, @@ -1656,6 +1894,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_foreign_item_macro(f: &mut F, node: ForeignItemMacro) -> ForeignItemMacro where F: Fold + ?Sized, @@ -1667,6 +1906,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_foreign_item_static( f: &mut F, node: ForeignItemStatic, @@ -1686,6 +1926,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_foreign_item_type(f: &mut F, node: ForeignItemType) -> ForeignItemType where F: Fold + ?Sized, @@ -1700,6 +1941,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_generic_argument(f: &mut F, node: GenericArgument) -> GenericArgument where F: Fold + ?Sized, @@ -1726,6 +1968,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_generic_param(f: &mut F, node: GenericParam) -> GenericParam where F: Fold + ?Sized, @@ -1743,6 +1986,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_generics(f: &mut F, node: Generics) -> Generics where F: Fold + ?Sized, @@ -1764,6 +2008,7 @@ where node } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_item(f: &mut F, node: ImplItem) -> ImplItem where F: Fold + ?Sized, @@ -1781,6 +2026,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_item_const(f: &mut F, node: ImplItemConst) -> ImplItemConst where F: Fold + ?Sized, @@ -1800,6 +2046,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_item_fn(f: &mut F, node: ImplItemFn) -> ImplItemFn where F: Fold + ?Sized, @@ -1813,6 +2060,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_item_macro(f: &mut F, node: ImplItemMacro) -> ImplItemMacro where F: Fold + ?Sized, @@ -1824,6 +2072,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_item_type(f: &mut F, node: ImplItemType) -> ImplItemType where F: Fold + ?Sized, @@ -1841,6 +2090,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_impl_restriction(f: &mut F, node: ImplRestriction) -> ImplRestriction where F: Fold + ?Sized, @@ -1848,6 +2098,7 @@ where match node {} } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_index(f: &mut F, node: Index) -> Index where F: Fold + ?Sized, @@ -1858,6 +2109,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item(f: &mut F, node: Item) -> Item where F: Fold + ?Sized, @@ -1888,6 +2140,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_const(f: &mut F, node: ItemConst) -> ItemConst where F: Fold + ?Sized, @@ -1906,6 +2159,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_enum(f: &mut F, node: ItemEnum) -> ItemEnum where F: Fold + ?Sized, @@ -1921,6 +2175,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_extern_crate(f: &mut F, node: ItemExternCrate) -> ItemExternCrate where F: Fold + ?Sized, @@ -1936,6 +2191,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_fn(f: &mut F, node: ItemFn) -> ItemFn where F: Fold + ?Sized, @@ -1948,6 +2204,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_foreign_mod(f: &mut F, node: ItemForeignMod) -> ItemForeignMod where F: Fold + ?Sized, @@ -1961,6 +2218,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_impl(f: &mut F, node: ItemImpl) -> ItemImpl where F: Fold + ?Sized, @@ -1978,6 +2236,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_macro(f: &mut F, node: ItemMacro) -> ItemMacro where F: Fold + ?Sized, @@ -1990,6 +2249,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_mod(f: &mut F, node: ItemMod) -> ItemMod where F: Fold + ?Sized, @@ -2006,6 +2266,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_static(f: &mut F, node: ItemStatic) -> ItemStatic where F: Fold + ?Sized, @@ -2024,6 +2285,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_struct(f: &mut F, node: ItemStruct) -> ItemStruct where F: Fold + ?Sized, @@ -2039,6 +2301,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_trait(f: &mut F, node: ItemTrait) -> ItemTrait where F: Fold + ?Sized, @@ -2062,6 +2325,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_trait_alias(f: &mut F, node: ItemTraitAlias) -> ItemTraitAlias where F: Fold + ?Sized, @@ -2078,6 +2342,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_type(f: &mut F, node: ItemType) -> ItemType where F: Fold + ?Sized, @@ -2094,6 +2359,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_union(f: &mut F, node: ItemUnion) -> ItemUnion where F: Fold + ?Sized, @@ -2108,6 +2374,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_item_use(f: &mut F, node: ItemUse) -> ItemUse where F: Fold + ?Sized, @@ -2122,6 +2389,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_label(f: &mut F, node: Label) -> Label where F: Fold + ?Sized, @@ -2141,6 +2409,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_lifetime_param(f: &mut F, node: LifetimeParam) -> LifetimeParam where F: Fold + ?Sized, @@ -2231,6 +2500,7 @@ where node } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_local(f: &mut F, node: Local) -> Local where F: Fold + ?Sized, @@ -2244,6 +2514,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_local_init(f: &mut F, node: LocalInit) -> LocalInit where F: Fold + ?Sized, @@ -2255,6 +2526,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_macro(f: &mut F, node: Macro) -> Macro where F: Fold + ?Sized, @@ -2267,6 +2539,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_macro_delimiter(f: &mut F, node: MacroDelimiter) -> MacroDelimiter where F: Fold + ?Sized, @@ -2278,6 +2551,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_member(f: &mut F, node: Member) -> Member where F: Fold + ?Sized, @@ -2288,6 +2562,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_meta(f: &mut F, node: Meta) -> Meta where F: Fold + ?Sized, @@ -2301,6 +2576,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_meta_list(f: &mut F, node: MetaList) -> MetaList where F: Fold + ?Sized, @@ -2312,6 +2588,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_meta_name_value(f: &mut F, node: MetaNameValue) -> MetaNameValue where F: Fold + ?Sized, @@ -2323,6 +2600,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_parenthesized_generic_arguments( f: &mut F, node: ParenthesizedGenericArguments, @@ -2337,6 +2615,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat(f: &mut F, node: Pat) -> Pat where F: Fold + ?Sized, @@ -2364,6 +2643,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_ident(f: &mut F, node: PatIdent) -> PatIdent where F: Fold + ?Sized, @@ -2377,6 +2657,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_or(f: &mut F, node: PatOr) -> PatOr where F: Fold + ?Sized, @@ -2388,6 +2669,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_paren(f: &mut F, node: PatParen) -> PatParen where F: Fold + ?Sized, @@ -2399,6 +2681,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_reference(f: &mut F, node: PatReference) -> PatReference where F: Fold + ?Sized, @@ -2411,6 +2694,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_rest(f: &mut F, node: PatRest) -> PatRest where F: Fold + ?Sized, @@ -2421,6 +2705,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_slice(f: &mut F, node: PatSlice) -> PatSlice where F: Fold + ?Sized, @@ -2432,6 +2717,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_struct(f: &mut F, node: PatStruct) -> PatStruct where F: Fold + ?Sized, @@ -2446,6 +2732,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_tuple(f: &mut F, node: PatTuple) -> PatTuple where F: Fold + ?Sized, @@ -2457,6 +2744,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_tuple_struct(f: &mut F, node: PatTupleStruct) -> PatTupleStruct where F: Fold + ?Sized, @@ -2470,6 +2758,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_type(f: &mut F, node: PatType) -> PatType where F: Fold + ?Sized, @@ -2482,6 +2771,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_pat_wild(f: &mut F, node: PatWild) -> PatWild where F: Fold + ?Sized, @@ -2492,6 +2782,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_path(f: &mut F, node: Path) -> Path where F: Fold + ?Sized, @@ -2502,6 +2793,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_path_arguments(f: &mut F, node: PathArguments) -> PathArguments where F: Fold + ?Sized, @@ -2521,6 +2813,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_path_segment(f: &mut F, node: PathSegment) -> PathSegment where F: Fold + ?Sized, @@ -2531,6 +2824,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_predicate_lifetime( f: &mut F, node: PredicateLifetime, @@ -2545,6 +2839,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_predicate_type(f: &mut F, node: PredicateType) -> PredicateType where F: Fold + ?Sized, @@ -2557,6 +2852,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_qself(f: &mut F, node: QSelf) -> QSelf where F: Fold + ?Sized, @@ -2570,6 +2866,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_range_limits(f: &mut F, node: RangeLimits) -> RangeLimits where F: Fold + ?Sized, @@ -2580,6 +2877,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_receiver(f: &mut F, node: Receiver) -> Receiver where F: Fold + ?Sized, @@ -2595,6 +2893,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_return_type(f: &mut F, node: ReturnType) -> ReturnType where F: Fold + ?Sized, @@ -2607,6 +2906,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_signature(f: &mut F, node: Signature) -> Signature where F: Fold + ?Sized, @@ -2632,6 +2932,7 @@ where node } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_static_mutability(f: &mut F, node: StaticMutability) -> StaticMutability where F: Fold + ?Sized, @@ -2642,6 +2943,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_stmt(f: &mut F, node: Stmt) -> Stmt where F: Fold + ?Sized, @@ -2656,6 +2958,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_stmt_macro(f: &mut F, node: StmtMacro) -> StmtMacro where F: Fold + ?Sized, @@ -2667,6 +2970,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_trait_bound(f: &mut F, node: TraitBound) -> TraitBound where F: Fold + ?Sized, @@ -2679,6 +2983,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_trait_bound_modifier( f: &mut F, node: TraitBoundModifier, @@ -2692,6 +2997,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_trait_item(f: &mut F, node: TraitItem) -> TraitItem where F: Fold + ?Sized, @@ -2711,6 +3017,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_trait_item_const(f: &mut F, node: TraitItemConst) -> TraitItemConst where F: Fold + ?Sized, @@ -2727,6 +3034,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_trait_item_fn(f: &mut F, node: TraitItemFn) -> TraitItemFn where F: Fold + ?Sized, @@ -2739,6 +3047,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_trait_item_macro(f: &mut F, node: TraitItemMacro) -> TraitItemMacro where F: Fold + ?Sized, @@ -2750,6 +3059,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_trait_item_type(f: &mut F, node: TraitItemType) -> TraitItemType where F: Fold + ?Sized, @@ -2766,6 +3076,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type(f: &mut F, node: Type) -> Type where F: Fold + ?Sized, @@ -2793,6 +3104,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_array(f: &mut F, node: TypeArray) -> TypeArray where F: Fold + ?Sized, @@ -2805,6 +3117,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_bare_fn(f: &mut F, node: TypeBareFn) -> TypeBareFn where F: Fold + ?Sized, @@ -2821,6 +3134,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_group(f: &mut F, node: TypeGroup) -> TypeGroup where F: Fold + ?Sized, @@ -2831,6 +3145,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_impl_trait(f: &mut F, node: TypeImplTrait) -> TypeImplTrait where F: Fold + ?Sized, @@ -2841,6 +3156,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_infer(f: &mut F, node: TypeInfer) -> TypeInfer where F: Fold + ?Sized, @@ -2850,6 +3166,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_macro(f: &mut F, node: TypeMacro) -> TypeMacro where F: Fold + ?Sized, @@ -2859,6 +3176,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_never(f: &mut F, node: TypeNever) -> TypeNever where F: Fold + ?Sized, @@ -2868,6 +3186,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_param(f: &mut F, node: TypeParam) -> TypeParam where F: Fold + ?Sized, @@ -2882,6 +3201,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_param_bound(f: &mut F, node: TypeParamBound) -> TypeParamBound where F: Fold + ?Sized, @@ -2897,6 +3217,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_paren(f: &mut F, node: TypeParen) -> TypeParen where F: Fold + ?Sized, @@ -2907,6 +3228,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_path(f: &mut F, node: TypePath) -> TypePath where F: Fold + ?Sized, @@ -2917,6 +3239,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_ptr(f: &mut F, node: TypePtr) -> TypePtr where F: Fold + ?Sized, @@ -2929,6 +3252,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_reference(f: &mut F, node: TypeReference) -> TypeReference where F: Fold + ?Sized, @@ -2941,6 +3265,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_slice(f: &mut F, node: TypeSlice) -> TypeSlice where F: Fold + ?Sized, @@ -2951,6 +3276,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_trait_object(f: &mut F, node: TypeTraitObject) -> TypeTraitObject where F: Fold + ?Sized, @@ -2961,6 +3287,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_type_tuple(f: &mut F, node: TypeTuple) -> TypeTuple where F: Fold + ?Sized, @@ -2971,6 +3298,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_un_op(f: &mut F, node: UnOp) -> UnOp where F: Fold + ?Sized, @@ -2982,6 +3310,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_glob(f: &mut F, node: UseGlob) -> UseGlob where F: Fold + ?Sized, @@ -2991,6 +3320,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_group(f: &mut F, node: UseGroup) -> UseGroup where F: Fold + ?Sized, @@ -3001,6 +3331,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_name(f: &mut F, node: UseName) -> UseName where F: Fold + ?Sized, @@ -3010,6 +3341,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_path(f: &mut F, node: UsePath) -> UsePath where F: Fold + ?Sized, @@ -3021,6 +3353,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_rename(f: &mut F, node: UseRename) -> UseRename where F: Fold + ?Sized, @@ -3032,6 +3365,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_use_tree(f: &mut F, node: UseTree) -> UseTree where F: Fold + ?Sized, @@ -3045,6 +3379,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn fold_variadic(f: &mut F, node: Variadic) -> Variadic where F: Fold + ?Sized, @@ -3057,6 +3392,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_variant(f: &mut F, node: Variant) -> Variant where F: Fold + ?Sized, @@ -3069,6 +3405,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_vis_restricted(f: &mut F, node: VisRestricted) -> VisRestricted where F: Fold + ?Sized, @@ -3081,6 +3418,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_visibility(f: &mut F, node: Visibility) -> Visibility where F: Fold + ?Sized, @@ -3094,6 +3432,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_where_clause(f: &mut F, node: WhereClause) -> WhereClause where F: Fold + ?Sized, @@ -3104,6 +3443,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn fold_where_predicate(f: &mut F, node: WherePredicate) -> WherePredicate where F: Fold + ?Sized, diff --git a/vendor/syn/src/gen/hash.rs b/vendor/syn/src/gen/hash.rs index 40dfc57f3..1c753419a 100644 --- a/vendor/syn/src/gen/hash.rs +++ b/vendor/syn/src/gen/hash.rs @@ -440,7 +440,6 @@ impl Hash for Expr { state.write_u8(22u8); v0.hash(state); } - #[cfg(feature = "full")] Expr::MethodCall(v0) => { state.write_u8(23u8); v0.hash(state); @@ -458,7 +457,6 @@ impl Hash for Expr { state.write_u8(26u8); v0.hash(state); } - #[cfg(feature = "full")] Expr::Reference(v0) => { state.write_u8(27u8); v0.hash(state); @@ -473,7 +471,6 @@ impl Hash for Expr { state.write_u8(29u8); v0.hash(state); } - #[cfg(feature = "full")] Expr::Struct(v0) => { state.write_u8(30u8); v0.hash(state); @@ -798,7 +795,7 @@ impl Hash for ExprMatch { self.arms.hash(state); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Hash for ExprMethodCall { fn hash(&self, state: &mut H) @@ -848,7 +845,7 @@ impl Hash for ExprRange { self.end.hash(state); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Hash for ExprReference { fn hash(&self, state: &mut H) @@ -883,7 +880,7 @@ impl Hash for ExprReturn { self.expr.hash(state); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Hash for ExprStruct { fn hash(&self, state: &mut H) @@ -1020,7 +1017,7 @@ impl Hash for FieldPat { self.pat.hash(state); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Hash for FieldValue { fn hash(&self, state: &mut H) diff --git a/vendor/syn/src/gen/visit.rs b/vendor/syn/src/gen/visit.rs index fe81fb63c..572e0ad95 100644 --- a/vendor/syn/src/gen/visit.rs +++ b/vendor/syn/src/gen/visit.rs @@ -29,10 +29,12 @@ macro_rules! skip { /// [module documentation]: self pub trait Visit<'ast> { #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_abi(&mut self, i: &'ast Abi) { visit_abi(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_angle_bracketed_generic_arguments( &mut self, i: &'ast AngleBracketedGenericArguments, @@ -40,294 +42,367 @@ pub trait Visit<'ast> { visit_angle_bracketed_generic_arguments(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_arm(&mut self, i: &'ast Arm) { visit_arm(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_assoc_const(&mut self, i: &'ast AssocConst) { visit_assoc_const(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_assoc_type(&mut self, i: &'ast AssocType) { visit_assoc_type(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_attr_style(&mut self, i: &'ast AttrStyle) { visit_attr_style(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_attribute(&mut self, i: &'ast Attribute) { visit_attribute(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) { visit_bare_fn_arg(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bare_variadic(&mut self, i: &'ast BareVariadic) { visit_bare_variadic(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bin_op(&mut self, i: &'ast BinOp) { visit_bin_op(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_block(&mut self, i: &'ast Block) { visit_block(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) { visit_bound_lifetimes(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_const_param(&mut self, i: &'ast ConstParam) { visit_const_param(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_constraint(&mut self, i: &'ast Constraint) { visit_constraint(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data(&mut self, i: &'ast Data) { visit_data(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_enum(&mut self, i: &'ast DataEnum) { visit_data_enum(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_struct(&mut self, i: &'ast DataStruct) { visit_data_struct(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_union(&mut self, i: &'ast DataUnion) { visit_data_union(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_derive_input(&mut self, i: &'ast DeriveInput) { visit_derive_input(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr(&mut self, i: &'ast Expr) { visit_expr(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_array(&mut self, i: &'ast ExprArray) { visit_expr_array(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_assign(&mut self, i: &'ast ExprAssign) { visit_expr_assign(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_async(&mut self, i: &'ast ExprAsync) { visit_expr_async(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_await(&mut self, i: &'ast ExprAwait) { visit_expr_await(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_binary(&mut self, i: &'ast ExprBinary) { visit_expr_binary(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_block(&mut self, i: &'ast ExprBlock) { visit_expr_block(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_break(&mut self, i: &'ast ExprBreak) { visit_expr_break(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_call(&mut self, i: &'ast ExprCall) { visit_expr_call(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_cast(&mut self, i: &'ast ExprCast) { visit_expr_cast(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_closure(&mut self, i: &'ast ExprClosure) { visit_expr_closure(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_const(&mut self, i: &'ast ExprConst) { visit_expr_const(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_continue(&mut self, i: &'ast ExprContinue) { visit_expr_continue(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_field(&mut self, i: &'ast ExprField) { visit_expr_field(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) { visit_expr_for_loop(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_group(&mut self, i: &'ast ExprGroup) { visit_expr_group(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_if(&mut self, i: &'ast ExprIf) { visit_expr_if(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_index(&mut self, i: &'ast ExprIndex) { visit_expr_index(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_infer(&mut self, i: &'ast ExprInfer) { visit_expr_infer(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_let(&mut self, i: &'ast ExprLet) { visit_expr_let(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_lit(&mut self, i: &'ast ExprLit) { visit_expr_lit(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_loop(&mut self, i: &'ast ExprLoop) { visit_expr_loop(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_macro(&mut self, i: &'ast ExprMacro) { visit_expr_macro(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_match(&mut self, i: &'ast ExprMatch) { visit_expr_match(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) { visit_expr_method_call(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_paren(&mut self, i: &'ast ExprParen) { visit_expr_paren(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_path(&mut self, i: &'ast ExprPath) { visit_expr_path(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_range(&mut self, i: &'ast ExprRange) { visit_expr_range(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_reference(&mut self, i: &'ast ExprReference) { visit_expr_reference(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) { visit_expr_repeat(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_return(&mut self, i: &'ast ExprReturn) { visit_expr_return(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_struct(&mut self, i: &'ast ExprStruct) { visit_expr_struct(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_try(&mut self, i: &'ast ExprTry) { visit_expr_try(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) { visit_expr_try_block(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) { visit_expr_tuple(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_unary(&mut self, i: &'ast ExprUnary) { visit_expr_unary(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) { visit_expr_unsafe(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_while(&mut self, i: &'ast ExprWhile) { visit_expr_while(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_yield(&mut self, i: &'ast ExprYield) { visit_expr_yield(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field(&mut self, i: &'ast Field) { visit_field(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field_mutability(&mut self, i: &'ast FieldMutability) { visit_field_mutability(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_field_pat(&mut self, i: &'ast FieldPat) { visit_field_pat(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field_value(&mut self, i: &'ast FieldValue) { visit_field_value(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields(&mut self, i: &'ast Fields) { visit_fields(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields_named(&mut self, i: &'ast FieldsNamed) { visit_fields_named(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) { visit_fields_unnamed(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_file(&mut self, i: &'ast File) { visit_file(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_fn_arg(&mut self, i: &'ast FnArg) { visit_fn_arg(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item(&mut self, i: &'ast ForeignItem) { visit_foreign_item(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) { visit_foreign_item_fn(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) { visit_foreign_item_macro(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) { visit_foreign_item_static(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) { visit_foreign_item_type(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generic_argument(&mut self, i: &'ast GenericArgument) { visit_generic_argument(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generic_param(&mut self, i: &'ast GenericParam) { visit_generic_param(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generics(&mut self, i: &'ast Generics) { visit_generics(self, i); } @@ -335,98 +410,122 @@ pub trait Visit<'ast> { visit_ident(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item(&mut self, i: &'ast ImplItem) { visit_impl_item(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) { visit_impl_item_const(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_fn(&mut self, i: &'ast ImplItemFn) { visit_impl_item_fn(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) { visit_impl_item_macro(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) { visit_impl_item_type(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_restriction(&mut self, i: &'ast ImplRestriction) { visit_impl_restriction(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_index(&mut self, i: &'ast Index) { visit_index(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item(&mut self, i: &'ast Item) { visit_item(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_const(&mut self, i: &'ast ItemConst) { visit_item_const(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_enum(&mut self, i: &'ast ItemEnum) { visit_item_enum(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) { visit_item_extern_crate(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_fn(&mut self, i: &'ast ItemFn) { visit_item_fn(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) { visit_item_foreign_mod(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_impl(&mut self, i: &'ast ItemImpl) { visit_item_impl(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_macro(&mut self, i: &'ast ItemMacro) { visit_item_macro(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_mod(&mut self, i: &'ast ItemMod) { visit_item_mod(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_static(&mut self, i: &'ast ItemStatic) { visit_item_static(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_struct(&mut self, i: &'ast ItemStruct) { visit_item_struct(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_trait(&mut self, i: &'ast ItemTrait) { visit_item_trait(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) { visit_item_trait_alias(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_type(&mut self, i: &'ast ItemType) { visit_item_type(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_union(&mut self, i: &'ast ItemUnion) { visit_item_union(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_use(&mut self, i: &'ast ItemUse) { visit_item_use(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_label(&mut self, i: &'ast Label) { visit_label(self, i); } @@ -434,6 +533,7 @@ pub trait Visit<'ast> { visit_lifetime(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_lifetime_param(&mut self, i: &'ast LifetimeParam) { visit_lifetime_param(self, i); } @@ -462,38 +562,47 @@ pub trait Visit<'ast> { visit_lit_str(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_local(&mut self, i: &'ast Local) { visit_local(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_local_init(&mut self, i: &'ast LocalInit) { visit_local_init(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_macro(&mut self, i: &'ast Macro) { visit_macro(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) { visit_macro_delimiter(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_member(&mut self, i: &'ast Member) { visit_member(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta(&mut self, i: &'ast Meta) { visit_meta(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta_list(&mut self, i: &'ast MetaList) { visit_meta_list(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) { visit_meta_name_value(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_parenthesized_generic_arguments( &mut self, i: &'ast ParenthesizedGenericArguments, @@ -501,90 +610,112 @@ pub trait Visit<'ast> { visit_parenthesized_generic_arguments(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat(&mut self, i: &'ast Pat) { visit_pat(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_ident(&mut self, i: &'ast PatIdent) { visit_pat_ident(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_or(&mut self, i: &'ast PatOr) { visit_pat_or(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_paren(&mut self, i: &'ast PatParen) { visit_pat_paren(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_reference(&mut self, i: &'ast PatReference) { visit_pat_reference(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_rest(&mut self, i: &'ast PatRest) { visit_pat_rest(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_slice(&mut self, i: &'ast PatSlice) { visit_pat_slice(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_struct(&mut self, i: &'ast PatStruct) { visit_pat_struct(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_tuple(&mut self, i: &'ast PatTuple) { visit_pat_tuple(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) { visit_pat_tuple_struct(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_type(&mut self, i: &'ast PatType) { visit_pat_type(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_wild(&mut self, i: &'ast PatWild) { visit_pat_wild(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path(&mut self, i: &'ast Path) { visit_path(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path_arguments(&mut self, i: &'ast PathArguments) { visit_path_arguments(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path_segment(&mut self, i: &'ast PathSegment) { visit_path_segment(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) { visit_predicate_lifetime(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_predicate_type(&mut self, i: &'ast PredicateType) { visit_predicate_type(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_qself(&mut self, i: &'ast QSelf) { visit_qself(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_range_limits(&mut self, i: &'ast RangeLimits) { visit_range_limits(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_receiver(&mut self, i: &'ast Receiver) { visit_receiver(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_return_type(&mut self, i: &'ast ReturnType) { visit_return_type(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_signature(&mut self, i: &'ast Signature) { visit_signature(self, i); } @@ -592,167 +723,208 @@ pub trait Visit<'ast> { visit_span(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_static_mutability(&mut self, i: &'ast StaticMutability) { visit_static_mutability(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_stmt(&mut self, i: &'ast Stmt) { visit_stmt(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_stmt_macro(&mut self, i: &'ast StmtMacro) { visit_stmt_macro(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_trait_bound(&mut self, i: &'ast TraitBound) { visit_trait_bound(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) { visit_trait_bound_modifier(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item(&mut self, i: &'ast TraitItem) { visit_trait_item(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) { visit_trait_item_const(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_fn(&mut self, i: &'ast TraitItemFn) { visit_trait_item_fn(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) { visit_trait_item_macro(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) { visit_trait_item_type(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type(&mut self, i: &'ast Type) { visit_type(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_array(&mut self, i: &'ast TypeArray) { visit_type_array(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) { visit_type_bare_fn(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_group(&mut self, i: &'ast TypeGroup) { visit_type_group(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) { visit_type_impl_trait(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_infer(&mut self, i: &'ast TypeInfer) { visit_type_infer(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_macro(&mut self, i: &'ast TypeMacro) { visit_type_macro(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_never(&mut self, i: &'ast TypeNever) { visit_type_never(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_param(&mut self, i: &'ast TypeParam) { visit_type_param(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) { visit_type_param_bound(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_paren(&mut self, i: &'ast TypeParen) { visit_type_paren(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_path(&mut self, i: &'ast TypePath) { visit_type_path(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_ptr(&mut self, i: &'ast TypePtr) { visit_type_ptr(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_reference(&mut self, i: &'ast TypeReference) { visit_type_reference(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_slice(&mut self, i: &'ast TypeSlice) { visit_type_slice(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) { visit_type_trait_object(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_tuple(&mut self, i: &'ast TypeTuple) { visit_type_tuple(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_un_op(&mut self, i: &'ast UnOp) { visit_un_op(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_glob(&mut self, i: &'ast UseGlob) { visit_use_glob(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_group(&mut self, i: &'ast UseGroup) { visit_use_group(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_name(&mut self, i: &'ast UseName) { visit_use_name(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_path(&mut self, i: &'ast UsePath) { visit_use_path(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_rename(&mut self, i: &'ast UseRename) { visit_use_rename(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_tree(&mut self, i: &'ast UseTree) { visit_use_tree(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_variadic(&mut self, i: &'ast Variadic) { visit_variadic(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_variant(&mut self, i: &'ast Variant) { visit_variant(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) { visit_vis_restricted(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_visibility(&mut self, i: &'ast Visibility) { visit_visibility(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_where_clause(&mut self, i: &'ast WhereClause) { visit_where_clause(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_where_predicate(&mut self, i: &'ast WherePredicate) { visit_where_predicate(self, i); } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_abi<'ast, V>(v: &mut V, node: &'ast Abi) where V: Visit<'ast> + ?Sized, @@ -763,6 +935,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_angle_bracketed_generic_arguments<'ast, V>( v: &mut V, node: &'ast AngleBracketedGenericArguments, @@ -779,6 +952,7 @@ where skip!(node.gt_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_arm<'ast, V>(v: &mut V, node: &'ast Arm) where V: Visit<'ast> + ?Sized, @@ -796,6 +970,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_assoc_const<'ast, V>(v: &mut V, node: &'ast AssocConst) where V: Visit<'ast> + ?Sized, @@ -808,6 +983,7 @@ where v.visit_expr(&node.value); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_assoc_type<'ast, V>(v: &mut V, node: &'ast AssocType) where V: Visit<'ast> + ?Sized, @@ -820,6 +996,7 @@ where v.visit_type(&node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_attr_style<'ast, V>(v: &mut V, node: &'ast AttrStyle) where V: Visit<'ast> + ?Sized, @@ -832,6 +1009,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_attribute<'ast, V>(v: &mut V, node: &'ast Attribute) where V: Visit<'ast> + ?Sized, @@ -842,6 +1020,7 @@ where v.visit_meta(&node.meta); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bare_fn_arg<'ast, V>(v: &mut V, node: &'ast BareFnArg) where V: Visit<'ast> + ?Sized, @@ -856,6 +1035,7 @@ where v.visit_type(&node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bare_variadic<'ast, V>(v: &mut V, node: &'ast BareVariadic) where V: Visit<'ast> + ?Sized, @@ -871,6 +1051,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp) where V: Visit<'ast> + ?Sized, @@ -963,6 +1144,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_block<'ast, V>(v: &mut V, node: &'ast Block) where V: Visit<'ast> + ?Sized, @@ -973,6 +1155,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bound_lifetimes<'ast, V>(v: &mut V, node: &'ast BoundLifetimes) where V: Visit<'ast> + ?Sized, @@ -986,6 +1169,7 @@ where skip!(node.gt_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_const_param<'ast, V>(v: &mut V, node: &'ast ConstParam) where V: Visit<'ast> + ?Sized, @@ -1003,6 +1187,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_constraint<'ast, V>(v: &mut V, node: &'ast Constraint) where V: Visit<'ast> + ?Sized, @@ -1018,6 +1203,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data<'ast, V>(v: &mut V, node: &'ast Data) where V: Visit<'ast> + ?Sized, @@ -1035,6 +1221,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_enum<'ast, V>(v: &mut V, node: &'ast DataEnum) where V: Visit<'ast> + ?Sized, @@ -1047,6 +1234,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_struct<'ast, V>(v: &mut V, node: &'ast DataStruct) where V: Visit<'ast> + ?Sized, @@ -1056,6 +1244,7 @@ where skip!(node.semi_token); } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_union<'ast, V>(v: &mut V, node: &'ast DataUnion) where V: Visit<'ast> + ?Sized, @@ -1064,6 +1253,7 @@ where v.visit_fields_named(&node.fields); } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_derive_input<'ast, V>(v: &mut V, node: &'ast DeriveInput) where V: Visit<'ast> + ?Sized, @@ -1077,6 +1267,7 @@ where v.visit_data(&node.data); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr<'ast, V>(v: &mut V, node: &'ast Expr) where V: Visit<'ast> + ?Sized, @@ -1152,7 +1343,7 @@ where full!(v.visit_expr_match(_binding_0)); } Expr::MethodCall(_binding_0) => { - full!(v.visit_expr_method_call(_binding_0)); + v.visit_expr_method_call(_binding_0); } Expr::Paren(_binding_0) => { v.visit_expr_paren(_binding_0); @@ -1164,7 +1355,7 @@ where full!(v.visit_expr_range(_binding_0)); } Expr::Reference(_binding_0) => { - full!(v.visit_expr_reference(_binding_0)); + v.visit_expr_reference(_binding_0); } Expr::Repeat(_binding_0) => { full!(v.visit_expr_repeat(_binding_0)); @@ -1173,7 +1364,7 @@ where full!(v.visit_expr_return(_binding_0)); } Expr::Struct(_binding_0) => { - full!(v.visit_expr_struct(_binding_0)); + v.visit_expr_struct(_binding_0); } Expr::Try(_binding_0) => { full!(v.visit_expr_try(_binding_0)); @@ -1202,6 +1393,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_array<'ast, V>(v: &mut V, node: &'ast ExprArray) where V: Visit<'ast> + ?Sized, @@ -1216,6 +1408,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_assign<'ast, V>(v: &mut V, node: &'ast ExprAssign) where V: Visit<'ast> + ?Sized, @@ -1228,6 +1421,7 @@ where v.visit_expr(&*node.right); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_async<'ast, V>(v: &mut V, node: &'ast ExprAsync) where V: Visit<'ast> + ?Sized, @@ -1240,6 +1434,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_await<'ast, V>(v: &mut V, node: &'ast ExprAwait) where V: Visit<'ast> + ?Sized, @@ -1252,6 +1447,7 @@ where skip!(node.await_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary) where V: Visit<'ast> + ?Sized, @@ -1264,6 +1460,7 @@ where v.visit_expr(&*node.right); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_block<'ast, V>(v: &mut V, node: &'ast ExprBlock) where V: Visit<'ast> + ?Sized, @@ -1277,6 +1474,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_break<'ast, V>(v: &mut V, node: &'ast ExprBreak) where V: Visit<'ast> + ?Sized, @@ -1293,6 +1491,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_call<'ast, V>(v: &mut V, node: &'ast ExprCall) where V: Visit<'ast> + ?Sized, @@ -1308,6 +1507,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_cast<'ast, V>(v: &mut V, node: &'ast ExprCast) where V: Visit<'ast> + ?Sized, @@ -1320,6 +1520,7 @@ where v.visit_type(&*node.ty); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_closure<'ast, V>(v: &mut V, node: &'ast ExprClosure) where V: Visit<'ast> + ?Sized, @@ -1344,6 +1545,7 @@ where v.visit_expr(&*node.body); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_const<'ast, V>(v: &mut V, node: &'ast ExprConst) where V: Visit<'ast> + ?Sized, @@ -1355,6 +1557,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_continue<'ast, V>(v: &mut V, node: &'ast ExprContinue) where V: Visit<'ast> + ?Sized, @@ -1368,6 +1571,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_field<'ast, V>(v: &mut V, node: &'ast ExprField) where V: Visit<'ast> + ?Sized, @@ -1380,6 +1584,7 @@ where v.visit_member(&node.member); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_for_loop<'ast, V>(v: &mut V, node: &'ast ExprForLoop) where V: Visit<'ast> + ?Sized, @@ -1397,6 +1602,7 @@ where v.visit_block(&node.body); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_group<'ast, V>(v: &mut V, node: &'ast ExprGroup) where V: Visit<'ast> + ?Sized, @@ -1408,6 +1614,7 @@ where v.visit_expr(&*node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_if<'ast, V>(v: &mut V, node: &'ast ExprIf) where V: Visit<'ast> + ?Sized, @@ -1424,6 +1631,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_index<'ast, V>(v: &mut V, node: &'ast ExprIndex) where V: Visit<'ast> + ?Sized, @@ -1436,6 +1644,7 @@ where v.visit_expr(&*node.index); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_infer<'ast, V>(v: &mut V, node: &'ast ExprInfer) where V: Visit<'ast> + ?Sized, @@ -1446,6 +1655,7 @@ where skip!(node.underscore_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_let<'ast, V>(v: &mut V, node: &'ast ExprLet) where V: Visit<'ast> + ?Sized, @@ -1459,6 +1669,7 @@ where v.visit_expr(&*node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_lit<'ast, V>(v: &mut V, node: &'ast ExprLit) where V: Visit<'ast> + ?Sized, @@ -1469,6 +1680,7 @@ where v.visit_lit(&node.lit); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_loop<'ast, V>(v: &mut V, node: &'ast ExprLoop) where V: Visit<'ast> + ?Sized, @@ -1483,6 +1695,7 @@ where v.visit_block(&node.body); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_macro<'ast, V>(v: &mut V, node: &'ast ExprMacro) where V: Visit<'ast> + ?Sized, @@ -1493,6 +1706,7 @@ where v.visit_macro(&node.mac); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_match<'ast, V>(v: &mut V, node: &'ast ExprMatch) where V: Visit<'ast> + ?Sized, @@ -1507,7 +1721,8 @@ where v.visit_arm(it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_method_call<'ast, V>(v: &mut V, node: &'ast ExprMethodCall) where V: Visit<'ast> + ?Sized, @@ -1528,6 +1743,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_paren<'ast, V>(v: &mut V, node: &'ast ExprParen) where V: Visit<'ast> + ?Sized, @@ -1539,6 +1755,7 @@ where v.visit_expr(&*node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_path<'ast, V>(v: &mut V, node: &'ast ExprPath) where V: Visit<'ast> + ?Sized, @@ -1552,6 +1769,7 @@ where v.visit_path(&node.path); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_range<'ast, V>(v: &mut V, node: &'ast ExprRange) where V: Visit<'ast> + ?Sized, @@ -1567,7 +1785,8 @@ where v.visit_expr(&**it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_reference<'ast, V>(v: &mut V, node: &'ast ExprReference) where V: Visit<'ast> + ?Sized, @@ -1580,6 +1799,7 @@ where v.visit_expr(&*node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_repeat<'ast, V>(v: &mut V, node: &'ast ExprRepeat) where V: Visit<'ast> + ?Sized, @@ -1593,6 +1813,7 @@ where v.visit_expr(&*node.len); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_return<'ast, V>(v: &mut V, node: &'ast ExprReturn) where V: Visit<'ast> + ?Sized, @@ -1605,7 +1826,8 @@ where v.visit_expr(&**it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_struct<'ast, V>(v: &mut V, node: &'ast ExprStruct) where V: Visit<'ast> + ?Sized, @@ -1628,6 +1850,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_try<'ast, V>(v: &mut V, node: &'ast ExprTry) where V: Visit<'ast> + ?Sized, @@ -1639,6 +1862,7 @@ where skip!(node.question_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_try_block<'ast, V>(v: &mut V, node: &'ast ExprTryBlock) where V: Visit<'ast> + ?Sized, @@ -1650,6 +1874,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_tuple<'ast, V>(v: &mut V, node: &'ast ExprTuple) where V: Visit<'ast> + ?Sized, @@ -1664,6 +1889,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_unary<'ast, V>(v: &mut V, node: &'ast ExprUnary) where V: Visit<'ast> + ?Sized, @@ -1675,6 +1901,7 @@ where v.visit_expr(&*node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_unsafe<'ast, V>(v: &mut V, node: &'ast ExprUnsafe) where V: Visit<'ast> + ?Sized, @@ -1686,6 +1913,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_while<'ast, V>(v: &mut V, node: &'ast ExprWhile) where V: Visit<'ast> + ?Sized, @@ -1701,6 +1929,7 @@ where v.visit_block(&node.body); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_yield<'ast, V>(v: &mut V, node: &'ast ExprYield) where V: Visit<'ast> + ?Sized, @@ -1714,6 +1943,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field<'ast, V>(v: &mut V, node: &'ast Field) where V: Visit<'ast> + ?Sized, @@ -1730,6 +1960,7 @@ where v.visit_type(&node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field_mutability<'ast, V>(v: &mut V, node: &'ast FieldMutability) where V: Visit<'ast> + ?Sized, @@ -1739,6 +1970,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_field_pat<'ast, V>(v: &mut V, node: &'ast FieldPat) where V: Visit<'ast> + ?Sized, @@ -1750,7 +1982,8 @@ where skip!(node.colon_token); v.visit_pat(&*node.pat); } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field_value<'ast, V>(v: &mut V, node: &'ast FieldValue) where V: Visit<'ast> + ?Sized, @@ -1763,6 +1996,7 @@ where v.visit_expr(&node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields<'ast, V>(v: &mut V, node: &'ast Fields) where V: Visit<'ast> + ?Sized, @@ -1778,6 +2012,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields_named<'ast, V>(v: &mut V, node: &'ast FieldsNamed) where V: Visit<'ast> + ?Sized, @@ -1789,6 +2024,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields_unnamed<'ast, V>(v: &mut V, node: &'ast FieldsUnnamed) where V: Visit<'ast> + ?Sized, @@ -1800,6 +2036,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_file<'ast, V>(v: &mut V, node: &'ast File) where V: Visit<'ast> + ?Sized, @@ -1813,6 +2050,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_fn_arg<'ast, V>(v: &mut V, node: &'ast FnArg) where V: Visit<'ast> + ?Sized, @@ -1827,6 +2065,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item<'ast, V>(v: &mut V, node: &'ast ForeignItem) where V: Visit<'ast> + ?Sized, @@ -1850,6 +2089,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_fn<'ast, V>(v: &mut V, node: &'ast ForeignItemFn) where V: Visit<'ast> + ?Sized, @@ -1862,6 +2102,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_macro<'ast, V>(v: &mut V, node: &'ast ForeignItemMacro) where V: Visit<'ast> + ?Sized, @@ -1873,6 +2114,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_static<'ast, V>(v: &mut V, node: &'ast ForeignItemStatic) where V: Visit<'ast> + ?Sized, @@ -1889,6 +2131,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_type<'ast, V>(v: &mut V, node: &'ast ForeignItemType) where V: Visit<'ast> + ?Sized, @@ -1903,6 +2146,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generic_argument<'ast, V>(v: &mut V, node: &'ast GenericArgument) where V: Visit<'ast> + ?Sized, @@ -1929,6 +2173,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generic_param<'ast, V>(v: &mut V, node: &'ast GenericParam) where V: Visit<'ast> + ?Sized, @@ -1946,6 +2191,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generics<'ast, V>(v: &mut V, node: &'ast Generics) where V: Visit<'ast> + ?Sized, @@ -1967,6 +2213,7 @@ where v.visit_span(&node.span()); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item<'ast, V>(v: &mut V, node: &'ast ImplItem) where V: Visit<'ast> + ?Sized, @@ -1990,6 +2237,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_const<'ast, V>(v: &mut V, node: &'ast ImplItemConst) where V: Visit<'ast> + ?Sized, @@ -2009,6 +2257,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_fn<'ast, V>(v: &mut V, node: &'ast ImplItemFn) where V: Visit<'ast> + ?Sized, @@ -2022,6 +2271,7 @@ where v.visit_block(&node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_macro<'ast, V>(v: &mut V, node: &'ast ImplItemMacro) where V: Visit<'ast> + ?Sized, @@ -2033,6 +2283,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_type<'ast, V>(v: &mut V, node: &'ast ImplItemType) where V: Visit<'ast> + ?Sized, @@ -2050,6 +2301,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_restriction<'ast, V>(v: &mut V, node: &'ast ImplRestriction) where V: Visit<'ast> + ?Sized, @@ -2057,6 +2309,7 @@ where match *node {} } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_index<'ast, V>(v: &mut V, node: &'ast Index) where V: Visit<'ast> + ?Sized, @@ -2065,6 +2318,7 @@ where v.visit_span(&node.span); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item<'ast, V>(v: &mut V, node: &'ast Item) where V: Visit<'ast> + ?Sized, @@ -2121,6 +2375,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_const<'ast, V>(v: &mut V, node: &'ast ItemConst) where V: Visit<'ast> + ?Sized, @@ -2139,6 +2394,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_enum<'ast, V>(v: &mut V, node: &'ast ItemEnum) where V: Visit<'ast> + ?Sized, @@ -2157,6 +2413,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_extern_crate<'ast, V>(v: &mut V, node: &'ast ItemExternCrate) where V: Visit<'ast> + ?Sized, @@ -2175,6 +2432,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_fn<'ast, V>(v: &mut V, node: &'ast ItemFn) where V: Visit<'ast> + ?Sized, @@ -2187,6 +2445,7 @@ where v.visit_block(&*node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_foreign_mod<'ast, V>(v: &mut V, node: &'ast ItemForeignMod) where V: Visit<'ast> + ?Sized, @@ -2202,6 +2461,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_impl<'ast, V>(v: &mut V, node: &'ast ItemImpl) where V: Visit<'ast> + ?Sized, @@ -2225,6 +2485,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_macro<'ast, V>(v: &mut V, node: &'ast ItemMacro) where V: Visit<'ast> + ?Sized, @@ -2239,6 +2500,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_mod<'ast, V>(v: &mut V, node: &'ast ItemMod) where V: Visit<'ast> + ?Sized, @@ -2259,6 +2521,7 @@ where skip!(node.semi); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_static<'ast, V>(v: &mut V, node: &'ast ItemStatic) where V: Visit<'ast> + ?Sized, @@ -2277,6 +2540,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_struct<'ast, V>(v: &mut V, node: &'ast ItemStruct) where V: Visit<'ast> + ?Sized, @@ -2292,6 +2556,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_trait<'ast, V>(v: &mut V, node: &'ast ItemTrait) where V: Visit<'ast> + ?Sized, @@ -2319,6 +2584,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_trait_alias<'ast, V>(v: &mut V, node: &'ast ItemTraitAlias) where V: Visit<'ast> + ?Sized, @@ -2338,6 +2604,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_type<'ast, V>(v: &mut V, node: &'ast ItemType) where V: Visit<'ast> + ?Sized, @@ -2354,6 +2621,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_union<'ast, V>(v: &mut V, node: &'ast ItemUnion) where V: Visit<'ast> + ?Sized, @@ -2368,6 +2636,7 @@ where v.visit_fields_named(&node.fields); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_use<'ast, V>(v: &mut V, node: &'ast ItemUse) where V: Visit<'ast> + ?Sized, @@ -2382,6 +2651,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_label<'ast, V>(v: &mut V, node: &'ast Label) where V: Visit<'ast> + ?Sized, @@ -2397,6 +2667,7 @@ where v.visit_ident(&node.ident); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_lifetime_param<'ast, V>(v: &mut V, node: &'ast LifetimeParam) where V: Visit<'ast> + ?Sized, @@ -2474,6 +2745,7 @@ where V: Visit<'ast> + ?Sized, {} #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_local<'ast, V>(v: &mut V, node: &'ast Local) where V: Visit<'ast> + ?Sized, @@ -2489,6 +2761,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_local_init<'ast, V>(v: &mut V, node: &'ast LocalInit) where V: Visit<'ast> + ?Sized, @@ -2501,6 +2774,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_macro<'ast, V>(v: &mut V, node: &'ast Macro) where V: Visit<'ast> + ?Sized, @@ -2511,6 +2785,7 @@ where skip!(node.tokens); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_macro_delimiter<'ast, V>(v: &mut V, node: &'ast MacroDelimiter) where V: Visit<'ast> + ?Sized, @@ -2528,6 +2803,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_member<'ast, V>(v: &mut V, node: &'ast Member) where V: Visit<'ast> + ?Sized, @@ -2542,6 +2818,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta<'ast, V>(v: &mut V, node: &'ast Meta) where V: Visit<'ast> + ?Sized, @@ -2559,6 +2836,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta_list<'ast, V>(v: &mut V, node: &'ast MetaList) where V: Visit<'ast> + ?Sized, @@ -2568,6 +2846,7 @@ where skip!(node.tokens); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta_name_value<'ast, V>(v: &mut V, node: &'ast MetaNameValue) where V: Visit<'ast> + ?Sized, @@ -2577,6 +2856,7 @@ where v.visit_expr(&node.value); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_parenthesized_generic_arguments<'ast, V>( v: &mut V, node: &'ast ParenthesizedGenericArguments, @@ -2592,6 +2872,7 @@ where v.visit_return_type(&node.output); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat<'ast, V>(v: &mut V, node: &'ast Pat) where V: Visit<'ast> + ?Sized, @@ -2651,6 +2932,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_ident<'ast, V>(v: &mut V, node: &'ast PatIdent) where V: Visit<'ast> + ?Sized, @@ -2667,6 +2949,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_or<'ast, V>(v: &mut V, node: &'ast PatOr) where V: Visit<'ast> + ?Sized, @@ -2681,6 +2964,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_paren<'ast, V>(v: &mut V, node: &'ast PatParen) where V: Visit<'ast> + ?Sized, @@ -2692,6 +2976,7 @@ where v.visit_pat(&*node.pat); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_reference<'ast, V>(v: &mut V, node: &'ast PatReference) where V: Visit<'ast> + ?Sized, @@ -2704,6 +2989,7 @@ where v.visit_pat(&*node.pat); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_rest<'ast, V>(v: &mut V, node: &'ast PatRest) where V: Visit<'ast> + ?Sized, @@ -2714,6 +3000,7 @@ where skip!(node.dot2_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_slice<'ast, V>(v: &mut V, node: &'ast PatSlice) where V: Visit<'ast> + ?Sized, @@ -2728,6 +3015,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_struct<'ast, V>(v: &mut V, node: &'ast PatStruct) where V: Visit<'ast> + ?Sized, @@ -2749,6 +3037,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_tuple<'ast, V>(v: &mut V, node: &'ast PatTuple) where V: Visit<'ast> + ?Sized, @@ -2763,6 +3052,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_tuple_struct<'ast, V>(v: &mut V, node: &'ast PatTupleStruct) where V: Visit<'ast> + ?Sized, @@ -2781,6 +3071,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_type<'ast, V>(v: &mut V, node: &'ast PatType) where V: Visit<'ast> + ?Sized, @@ -2793,6 +3084,7 @@ where v.visit_type(&*node.ty); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_wild<'ast, V>(v: &mut V, node: &'ast PatWild) where V: Visit<'ast> + ?Sized, @@ -2803,6 +3095,7 @@ where skip!(node.underscore_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path<'ast, V>(v: &mut V, node: &'ast Path) where V: Visit<'ast> + ?Sized, @@ -2814,6 +3107,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path_arguments<'ast, V>(v: &mut V, node: &'ast PathArguments) where V: Visit<'ast> + ?Sized, @@ -2829,6 +3123,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path_segment<'ast, V>(v: &mut V, node: &'ast PathSegment) where V: Visit<'ast> + ?Sized, @@ -2837,6 +3132,7 @@ where v.visit_path_arguments(&node.arguments); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_predicate_lifetime<'ast, V>(v: &mut V, node: &'ast PredicateLifetime) where V: Visit<'ast> + ?Sized, @@ -2849,6 +3145,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_predicate_type<'ast, V>(v: &mut V, node: &'ast PredicateType) where V: Visit<'ast> + ?Sized, @@ -2864,6 +3161,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_qself<'ast, V>(v: &mut V, node: &'ast QSelf) where V: Visit<'ast> + ?Sized, @@ -2875,6 +3173,7 @@ where skip!(node.gt_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_range_limits<'ast, V>(v: &mut V, node: &'ast RangeLimits) where V: Visit<'ast> + ?Sized, @@ -2889,6 +3188,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_receiver<'ast, V>(v: &mut V, node: &'ast Receiver) where V: Visit<'ast> + ?Sized, @@ -2908,6 +3208,7 @@ where v.visit_type(&*node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_return_type<'ast, V>(v: &mut V, node: &'ast ReturnType) where V: Visit<'ast> + ?Sized, @@ -2921,6 +3222,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_signature<'ast, V>(v: &mut V, node: &'ast Signature) where V: Visit<'ast> + ?Sized, @@ -2949,6 +3251,7 @@ where V: Visit<'ast> + ?Sized, {} #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_static_mutability<'ast, V>(v: &mut V, node: &'ast StaticMutability) where V: Visit<'ast> + ?Sized, @@ -2961,6 +3264,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_stmt<'ast, V>(v: &mut V, node: &'ast Stmt) where V: Visit<'ast> + ?Sized, @@ -2982,6 +3286,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_stmt_macro<'ast, V>(v: &mut V, node: &'ast StmtMacro) where V: Visit<'ast> + ?Sized, @@ -2993,6 +3298,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_trait_bound<'ast, V>(v: &mut V, node: &'ast TraitBound) where V: Visit<'ast> + ?Sized, @@ -3005,6 +3311,7 @@ where v.visit_path(&node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_trait_bound_modifier<'ast, V>(v: &mut V, node: &'ast TraitBoundModifier) where V: Visit<'ast> + ?Sized, @@ -3017,6 +3324,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item<'ast, V>(v: &mut V, node: &'ast TraitItem) where V: Visit<'ast> + ?Sized, @@ -3040,6 +3348,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_const<'ast, V>(v: &mut V, node: &'ast TraitItemConst) where V: Visit<'ast> + ?Sized, @@ -3059,6 +3368,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_fn<'ast, V>(v: &mut V, node: &'ast TraitItemFn) where V: Visit<'ast> + ?Sized, @@ -3073,6 +3383,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_macro<'ast, V>(v: &mut V, node: &'ast TraitItemMacro) where V: Visit<'ast> + ?Sized, @@ -3084,6 +3395,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_type<'ast, V>(v: &mut V, node: &'ast TraitItemType) where V: Visit<'ast> + ?Sized, @@ -3106,6 +3418,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type<'ast, V>(v: &mut V, node: &'ast Type) where V: Visit<'ast> + ?Sized, @@ -3159,6 +3472,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_array<'ast, V>(v: &mut V, node: &'ast TypeArray) where V: Visit<'ast> + ?Sized, @@ -3169,6 +3483,7 @@ where v.visit_expr(&node.len); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_bare_fn<'ast, V>(v: &mut V, node: &'ast TypeBareFn) where V: Visit<'ast> + ?Sized, @@ -3192,6 +3507,7 @@ where v.visit_return_type(&node.output); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_group<'ast, V>(v: &mut V, node: &'ast TypeGroup) where V: Visit<'ast> + ?Sized, @@ -3200,6 +3516,7 @@ where v.visit_type(&*node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_impl_trait<'ast, V>(v: &mut V, node: &'ast TypeImplTrait) where V: Visit<'ast> + ?Sized, @@ -3211,6 +3528,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_infer<'ast, V>(v: &mut V, node: &'ast TypeInfer) where V: Visit<'ast> + ?Sized, @@ -3218,6 +3536,7 @@ where skip!(node.underscore_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_macro<'ast, V>(v: &mut V, node: &'ast TypeMacro) where V: Visit<'ast> + ?Sized, @@ -3225,6 +3544,7 @@ where v.visit_macro(&node.mac); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_never<'ast, V>(v: &mut V, node: &'ast TypeNever) where V: Visit<'ast> + ?Sized, @@ -3232,6 +3552,7 @@ where skip!(node.bang_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_param<'ast, V>(v: &mut V, node: &'ast TypeParam) where V: Visit<'ast> + ?Sized, @@ -3251,6 +3572,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_param_bound<'ast, V>(v: &mut V, node: &'ast TypeParamBound) where V: Visit<'ast> + ?Sized, @@ -3268,6 +3590,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_paren<'ast, V>(v: &mut V, node: &'ast TypeParen) where V: Visit<'ast> + ?Sized, @@ -3276,6 +3599,7 @@ where v.visit_type(&*node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_path<'ast, V>(v: &mut V, node: &'ast TypePath) where V: Visit<'ast> + ?Sized, @@ -3286,6 +3610,7 @@ where v.visit_path(&node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_ptr<'ast, V>(v: &mut V, node: &'ast TypePtr) where V: Visit<'ast> + ?Sized, @@ -3296,6 +3621,7 @@ where v.visit_type(&*node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_reference<'ast, V>(v: &mut V, node: &'ast TypeReference) where V: Visit<'ast> + ?Sized, @@ -3308,6 +3634,7 @@ where v.visit_type(&*node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_slice<'ast, V>(v: &mut V, node: &'ast TypeSlice) where V: Visit<'ast> + ?Sized, @@ -3316,6 +3643,7 @@ where v.visit_type(&*node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_trait_object<'ast, V>(v: &mut V, node: &'ast TypeTraitObject) where V: Visit<'ast> + ?Sized, @@ -3327,6 +3655,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_tuple<'ast, V>(v: &mut V, node: &'ast TypeTuple) where V: Visit<'ast> + ?Sized, @@ -3338,6 +3667,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_un_op<'ast, V>(v: &mut V, node: &'ast UnOp) where V: Visit<'ast> + ?Sized, @@ -3355,6 +3685,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_glob<'ast, V>(v: &mut V, node: &'ast UseGlob) where V: Visit<'ast> + ?Sized, @@ -3362,6 +3693,7 @@ where skip!(node.star_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_group<'ast, V>(v: &mut V, node: &'ast UseGroup) where V: Visit<'ast> + ?Sized, @@ -3373,6 +3705,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_name<'ast, V>(v: &mut V, node: &'ast UseName) where V: Visit<'ast> + ?Sized, @@ -3380,6 +3713,7 @@ where v.visit_ident(&node.ident); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_path<'ast, V>(v: &mut V, node: &'ast UsePath) where V: Visit<'ast> + ?Sized, @@ -3389,6 +3723,7 @@ where v.visit_use_tree(&*node.tree); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_rename<'ast, V>(v: &mut V, node: &'ast UseRename) where V: Visit<'ast> + ?Sized, @@ -3398,6 +3733,7 @@ where v.visit_ident(&node.rename); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_tree<'ast, V>(v: &mut V, node: &'ast UseTree) where V: Visit<'ast> + ?Sized, @@ -3421,6 +3757,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_variadic<'ast, V>(v: &mut V, node: &'ast Variadic) where V: Visit<'ast> + ?Sized, @@ -3436,6 +3773,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_variant<'ast, V>(v: &mut V, node: &'ast Variant) where V: Visit<'ast> + ?Sized, @@ -3451,6 +3789,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_vis_restricted<'ast, V>(v: &mut V, node: &'ast VisRestricted) where V: Visit<'ast> + ?Sized, @@ -3461,6 +3800,7 @@ where v.visit_path(&*node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_visibility<'ast, V>(v: &mut V, node: &'ast Visibility) where V: Visit<'ast> + ?Sized, @@ -3476,6 +3816,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_where_clause<'ast, V>(v: &mut V, node: &'ast WhereClause) where V: Visit<'ast> + ?Sized, @@ -3487,6 +3828,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_where_predicate<'ast, V>(v: &mut V, node: &'ast WherePredicate) where V: Visit<'ast> + ?Sized, diff --git a/vendor/syn/src/gen/visit_mut.rs b/vendor/syn/src/gen/visit_mut.rs index 9e7d16ff6..3e81aae41 100644 --- a/vendor/syn/src/gen/visit_mut.rs +++ b/vendor/syn/src/gen/visit_mut.rs @@ -30,10 +30,12 @@ macro_rules! skip { /// [module documentation]: self pub trait VisitMut { #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_abi_mut(&mut self, i: &mut Abi) { visit_abi_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_angle_bracketed_generic_arguments_mut( &mut self, i: &mut AngleBracketedGenericArguments, @@ -41,294 +43,367 @@ pub trait VisitMut { visit_angle_bracketed_generic_arguments_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_arm_mut(&mut self, i: &mut Arm) { visit_arm_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_assoc_const_mut(&mut self, i: &mut AssocConst) { visit_assoc_const_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_assoc_type_mut(&mut self, i: &mut AssocType) { visit_assoc_type_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_attr_style_mut(&mut self, i: &mut AttrStyle) { visit_attr_style_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_attribute_mut(&mut self, i: &mut Attribute) { visit_attribute_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bare_fn_arg_mut(&mut self, i: &mut BareFnArg) { visit_bare_fn_arg_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bare_variadic_mut(&mut self, i: &mut BareVariadic) { visit_bare_variadic_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bin_op_mut(&mut self, i: &mut BinOp) { visit_bin_op_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_block_mut(&mut self, i: &mut Block) { visit_block_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_bound_lifetimes_mut(&mut self, i: &mut BoundLifetimes) { visit_bound_lifetimes_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_const_param_mut(&mut self, i: &mut ConstParam) { visit_const_param_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_constraint_mut(&mut self, i: &mut Constraint) { visit_constraint_mut(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_mut(&mut self, i: &mut Data) { visit_data_mut(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_enum_mut(&mut self, i: &mut DataEnum) { visit_data_enum_mut(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_struct_mut(&mut self, i: &mut DataStruct) { visit_data_struct_mut(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_data_union_mut(&mut self, i: &mut DataUnion) { visit_data_union_mut(self, i); } #[cfg(feature = "derive")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] fn visit_derive_input_mut(&mut self, i: &mut DeriveInput) { visit_derive_input_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_mut(&mut self, i: &mut Expr) { visit_expr_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_array_mut(&mut self, i: &mut ExprArray) { visit_expr_array_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_assign_mut(&mut self, i: &mut ExprAssign) { visit_expr_assign_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_async_mut(&mut self, i: &mut ExprAsync) { visit_expr_async_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_await_mut(&mut self, i: &mut ExprAwait) { visit_expr_await_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_binary_mut(&mut self, i: &mut ExprBinary) { visit_expr_binary_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_block_mut(&mut self, i: &mut ExprBlock) { visit_expr_block_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_break_mut(&mut self, i: &mut ExprBreak) { visit_expr_break_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_call_mut(&mut self, i: &mut ExprCall) { visit_expr_call_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_cast_mut(&mut self, i: &mut ExprCast) { visit_expr_cast_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_closure_mut(&mut self, i: &mut ExprClosure) { visit_expr_closure_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_const_mut(&mut self, i: &mut ExprConst) { visit_expr_const_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_continue_mut(&mut self, i: &mut ExprContinue) { visit_expr_continue_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_field_mut(&mut self, i: &mut ExprField) { visit_expr_field_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_for_loop_mut(&mut self, i: &mut ExprForLoop) { visit_expr_for_loop_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_group_mut(&mut self, i: &mut ExprGroup) { visit_expr_group_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_if_mut(&mut self, i: &mut ExprIf) { visit_expr_if_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_index_mut(&mut self, i: &mut ExprIndex) { visit_expr_index_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_infer_mut(&mut self, i: &mut ExprInfer) { visit_expr_infer_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_let_mut(&mut self, i: &mut ExprLet) { visit_expr_let_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_lit_mut(&mut self, i: &mut ExprLit) { visit_expr_lit_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_loop_mut(&mut self, i: &mut ExprLoop) { visit_expr_loop_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_macro_mut(&mut self, i: &mut ExprMacro) { visit_expr_macro_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_match_mut(&mut self, i: &mut ExprMatch) { visit_expr_match_mut(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_method_call_mut(&mut self, i: &mut ExprMethodCall) { visit_expr_method_call_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_paren_mut(&mut self, i: &mut ExprParen) { visit_expr_paren_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_path_mut(&mut self, i: &mut ExprPath) { visit_expr_path_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_range_mut(&mut self, i: &mut ExprRange) { visit_expr_range_mut(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_reference_mut(&mut self, i: &mut ExprReference) { visit_expr_reference_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_repeat_mut(&mut self, i: &mut ExprRepeat) { visit_expr_repeat_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_return_mut(&mut self, i: &mut ExprReturn) { visit_expr_return_mut(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_struct_mut(&mut self, i: &mut ExprStruct) { visit_expr_struct_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_try_mut(&mut self, i: &mut ExprTry) { visit_expr_try_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_try_block_mut(&mut self, i: &mut ExprTryBlock) { visit_expr_try_block_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_tuple_mut(&mut self, i: &mut ExprTuple) { visit_expr_tuple_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_expr_unary_mut(&mut self, i: &mut ExprUnary) { visit_expr_unary_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_unsafe_mut(&mut self, i: &mut ExprUnsafe) { visit_expr_unsafe_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_while_mut(&mut self, i: &mut ExprWhile) { visit_expr_while_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_expr_yield_mut(&mut self, i: &mut ExprYield) { visit_expr_yield_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field_mut(&mut self, i: &mut Field) { visit_field_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field_mutability_mut(&mut self, i: &mut FieldMutability) { visit_field_mutability_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_field_pat_mut(&mut self, i: &mut FieldPat) { visit_field_pat_mut(self, i); } - #[cfg(feature = "full")] + #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_field_value_mut(&mut self, i: &mut FieldValue) { visit_field_value_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields_mut(&mut self, i: &mut Fields) { visit_fields_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields_named_mut(&mut self, i: &mut FieldsNamed) { visit_fields_named_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_fields_unnamed_mut(&mut self, i: &mut FieldsUnnamed) { visit_fields_unnamed_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_file_mut(&mut self, i: &mut File) { visit_file_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_fn_arg_mut(&mut self, i: &mut FnArg) { visit_fn_arg_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_mut(&mut self, i: &mut ForeignItem) { visit_foreign_item_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_fn_mut(&mut self, i: &mut ForeignItemFn) { visit_foreign_item_fn_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_macro_mut(&mut self, i: &mut ForeignItemMacro) { visit_foreign_item_macro_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_static_mut(&mut self, i: &mut ForeignItemStatic) { visit_foreign_item_static_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_foreign_item_type_mut(&mut self, i: &mut ForeignItemType) { visit_foreign_item_type_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generic_argument_mut(&mut self, i: &mut GenericArgument) { visit_generic_argument_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generic_param_mut(&mut self, i: &mut GenericParam) { visit_generic_param_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_generics_mut(&mut self, i: &mut Generics) { visit_generics_mut(self, i); } @@ -336,98 +411,122 @@ pub trait VisitMut { visit_ident_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_mut(&mut self, i: &mut ImplItem) { visit_impl_item_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_const_mut(&mut self, i: &mut ImplItemConst) { visit_impl_item_const_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_fn_mut(&mut self, i: &mut ImplItemFn) { visit_impl_item_fn_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_macro_mut(&mut self, i: &mut ImplItemMacro) { visit_impl_item_macro_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_item_type_mut(&mut self, i: &mut ImplItemType) { visit_impl_item_type_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_impl_restriction_mut(&mut self, i: &mut ImplRestriction) { visit_impl_restriction_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_index_mut(&mut self, i: &mut Index) { visit_index_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_mut(&mut self, i: &mut Item) { visit_item_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_const_mut(&mut self, i: &mut ItemConst) { visit_item_const_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_enum_mut(&mut self, i: &mut ItemEnum) { visit_item_enum_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_extern_crate_mut(&mut self, i: &mut ItemExternCrate) { visit_item_extern_crate_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_fn_mut(&mut self, i: &mut ItemFn) { visit_item_fn_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_foreign_mod_mut(&mut self, i: &mut ItemForeignMod) { visit_item_foreign_mod_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_impl_mut(&mut self, i: &mut ItemImpl) { visit_item_impl_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_macro_mut(&mut self, i: &mut ItemMacro) { visit_item_macro_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_mod_mut(&mut self, i: &mut ItemMod) { visit_item_mod_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_static_mut(&mut self, i: &mut ItemStatic) { visit_item_static_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_struct_mut(&mut self, i: &mut ItemStruct) { visit_item_struct_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_trait_mut(&mut self, i: &mut ItemTrait) { visit_item_trait_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_trait_alias_mut(&mut self, i: &mut ItemTraitAlias) { visit_item_trait_alias_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_type_mut(&mut self, i: &mut ItemType) { visit_item_type_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_union_mut(&mut self, i: &mut ItemUnion) { visit_item_union_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_item_use_mut(&mut self, i: &mut ItemUse) { visit_item_use_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_label_mut(&mut self, i: &mut Label) { visit_label_mut(self, i); } @@ -435,6 +534,7 @@ pub trait VisitMut { visit_lifetime_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_lifetime_param_mut(&mut self, i: &mut LifetimeParam) { visit_lifetime_param_mut(self, i); } @@ -463,38 +563,47 @@ pub trait VisitMut { visit_lit_str_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_local_mut(&mut self, i: &mut Local) { visit_local_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_local_init_mut(&mut self, i: &mut LocalInit) { visit_local_init_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_macro_mut(&mut self, i: &mut Macro) { visit_macro_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_macro_delimiter_mut(&mut self, i: &mut MacroDelimiter) { visit_macro_delimiter_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_member_mut(&mut self, i: &mut Member) { visit_member_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta_mut(&mut self, i: &mut Meta) { visit_meta_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta_list_mut(&mut self, i: &mut MetaList) { visit_meta_list_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_meta_name_value_mut(&mut self, i: &mut MetaNameValue) { visit_meta_name_value_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_parenthesized_generic_arguments_mut( &mut self, i: &mut ParenthesizedGenericArguments, @@ -502,90 +611,112 @@ pub trait VisitMut { visit_parenthesized_generic_arguments_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_mut(&mut self, i: &mut Pat) { visit_pat_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_ident_mut(&mut self, i: &mut PatIdent) { visit_pat_ident_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_or_mut(&mut self, i: &mut PatOr) { visit_pat_or_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_paren_mut(&mut self, i: &mut PatParen) { visit_pat_paren_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_reference_mut(&mut self, i: &mut PatReference) { visit_pat_reference_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_rest_mut(&mut self, i: &mut PatRest) { visit_pat_rest_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_slice_mut(&mut self, i: &mut PatSlice) { visit_pat_slice_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_struct_mut(&mut self, i: &mut PatStruct) { visit_pat_struct_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_tuple_mut(&mut self, i: &mut PatTuple) { visit_pat_tuple_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_tuple_struct_mut(&mut self, i: &mut PatTupleStruct) { visit_pat_tuple_struct_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_type_mut(&mut self, i: &mut PatType) { visit_pat_type_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_pat_wild_mut(&mut self, i: &mut PatWild) { visit_pat_wild_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path_mut(&mut self, i: &mut Path) { visit_path_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path_arguments_mut(&mut self, i: &mut PathArguments) { visit_path_arguments_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_path_segment_mut(&mut self, i: &mut PathSegment) { visit_path_segment_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_predicate_lifetime_mut(&mut self, i: &mut PredicateLifetime) { visit_predicate_lifetime_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_predicate_type_mut(&mut self, i: &mut PredicateType) { visit_predicate_type_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_qself_mut(&mut self, i: &mut QSelf) { visit_qself_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_range_limits_mut(&mut self, i: &mut RangeLimits) { visit_range_limits_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_receiver_mut(&mut self, i: &mut Receiver) { visit_receiver_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_return_type_mut(&mut self, i: &mut ReturnType) { visit_return_type_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_signature_mut(&mut self, i: &mut Signature) { visit_signature_mut(self, i); } @@ -593,167 +724,208 @@ pub trait VisitMut { visit_span_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_static_mutability_mut(&mut self, i: &mut StaticMutability) { visit_static_mutability_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_stmt_mut(&mut self, i: &mut Stmt) { visit_stmt_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_stmt_macro_mut(&mut self, i: &mut StmtMacro) { visit_stmt_macro_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_trait_bound_mut(&mut self, i: &mut TraitBound) { visit_trait_bound_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_trait_bound_modifier_mut(&mut self, i: &mut TraitBoundModifier) { visit_trait_bound_modifier_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_mut(&mut self, i: &mut TraitItem) { visit_trait_item_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_const_mut(&mut self, i: &mut TraitItemConst) { visit_trait_item_const_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_fn_mut(&mut self, i: &mut TraitItemFn) { visit_trait_item_fn_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_macro_mut(&mut self, i: &mut TraitItemMacro) { visit_trait_item_macro_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_trait_item_type_mut(&mut self, i: &mut TraitItemType) { visit_trait_item_type_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_mut(&mut self, i: &mut Type) { visit_type_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_array_mut(&mut self, i: &mut TypeArray) { visit_type_array_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_bare_fn_mut(&mut self, i: &mut TypeBareFn) { visit_type_bare_fn_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_group_mut(&mut self, i: &mut TypeGroup) { visit_type_group_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_impl_trait_mut(&mut self, i: &mut TypeImplTrait) { visit_type_impl_trait_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_infer_mut(&mut self, i: &mut TypeInfer) { visit_type_infer_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_macro_mut(&mut self, i: &mut TypeMacro) { visit_type_macro_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_never_mut(&mut self, i: &mut TypeNever) { visit_type_never_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_param_mut(&mut self, i: &mut TypeParam) { visit_type_param_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_param_bound_mut(&mut self, i: &mut TypeParamBound) { visit_type_param_bound_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_paren_mut(&mut self, i: &mut TypeParen) { visit_type_paren_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_path_mut(&mut self, i: &mut TypePath) { visit_type_path_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_ptr_mut(&mut self, i: &mut TypePtr) { visit_type_ptr_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_reference_mut(&mut self, i: &mut TypeReference) { visit_type_reference_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_slice_mut(&mut self, i: &mut TypeSlice) { visit_type_slice_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_trait_object_mut(&mut self, i: &mut TypeTraitObject) { visit_type_trait_object_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_type_tuple_mut(&mut self, i: &mut TypeTuple) { visit_type_tuple_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_un_op_mut(&mut self, i: &mut UnOp) { visit_un_op_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_glob_mut(&mut self, i: &mut UseGlob) { visit_use_glob_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_group_mut(&mut self, i: &mut UseGroup) { visit_use_group_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_name_mut(&mut self, i: &mut UseName) { visit_use_name_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_path_mut(&mut self, i: &mut UsePath) { visit_use_path_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_rename_mut(&mut self, i: &mut UseRename) { visit_use_rename_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_use_tree_mut(&mut self, i: &mut UseTree) { visit_use_tree_mut(self, i); } #[cfg(feature = "full")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] fn visit_variadic_mut(&mut self, i: &mut Variadic) { visit_variadic_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_variant_mut(&mut self, i: &mut Variant) { visit_variant_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_vis_restricted_mut(&mut self, i: &mut VisRestricted) { visit_vis_restricted_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_visibility_mut(&mut self, i: &mut Visibility) { visit_visibility_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_where_clause_mut(&mut self, i: &mut WhereClause) { visit_where_clause_mut(self, i); } #[cfg(any(feature = "derive", feature = "full"))] + #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] fn visit_where_predicate_mut(&mut self, i: &mut WherePredicate) { visit_where_predicate_mut(self, i); } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_abi_mut(v: &mut V, node: &mut Abi) where V: VisitMut + ?Sized, @@ -764,6 +936,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_angle_bracketed_generic_arguments_mut( v: &mut V, node: &mut AngleBracketedGenericArguments, @@ -780,6 +953,7 @@ where skip!(node.gt_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_arm_mut(v: &mut V, node: &mut Arm) where V: VisitMut + ?Sized, @@ -797,6 +971,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_assoc_const_mut(v: &mut V, node: &mut AssocConst) where V: VisitMut + ?Sized, @@ -809,6 +984,7 @@ where v.visit_expr_mut(&mut node.value); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_assoc_type_mut(v: &mut V, node: &mut AssocType) where V: VisitMut + ?Sized, @@ -821,6 +997,7 @@ where v.visit_type_mut(&mut node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_attr_style_mut(v: &mut V, node: &mut AttrStyle) where V: VisitMut + ?Sized, @@ -833,6 +1010,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_attribute_mut(v: &mut V, node: &mut Attribute) where V: VisitMut + ?Sized, @@ -843,6 +1021,7 @@ where v.visit_meta_mut(&mut node.meta); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bare_fn_arg_mut(v: &mut V, node: &mut BareFnArg) where V: VisitMut + ?Sized, @@ -857,6 +1036,7 @@ where v.visit_type_mut(&mut node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bare_variadic_mut(v: &mut V, node: &mut BareVariadic) where V: VisitMut + ?Sized, @@ -872,6 +1052,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bin_op_mut(v: &mut V, node: &mut BinOp) where V: VisitMut + ?Sized, @@ -964,6 +1145,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_block_mut(v: &mut V, node: &mut Block) where V: VisitMut + ?Sized, @@ -974,6 +1156,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_bound_lifetimes_mut(v: &mut V, node: &mut BoundLifetimes) where V: VisitMut + ?Sized, @@ -987,6 +1170,7 @@ where skip!(node.gt_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_const_param_mut(v: &mut V, node: &mut ConstParam) where V: VisitMut + ?Sized, @@ -1004,6 +1188,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_constraint_mut(v: &mut V, node: &mut Constraint) where V: VisitMut + ?Sized, @@ -1019,6 +1204,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_mut(v: &mut V, node: &mut Data) where V: VisitMut + ?Sized, @@ -1036,6 +1222,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_enum_mut(v: &mut V, node: &mut DataEnum) where V: VisitMut + ?Sized, @@ -1048,6 +1235,7 @@ where } } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_struct_mut(v: &mut V, node: &mut DataStruct) where V: VisitMut + ?Sized, @@ -1057,6 +1245,7 @@ where skip!(node.semi_token); } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_data_union_mut(v: &mut V, node: &mut DataUnion) where V: VisitMut + ?Sized, @@ -1065,6 +1254,7 @@ where v.visit_fields_named_mut(&mut node.fields); } #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub fn visit_derive_input_mut(v: &mut V, node: &mut DeriveInput) where V: VisitMut + ?Sized, @@ -1078,6 +1268,7 @@ where v.visit_data_mut(&mut node.data); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_mut(v: &mut V, node: &mut Expr) where V: VisitMut + ?Sized, @@ -1153,7 +1344,7 @@ where full!(v.visit_expr_match_mut(_binding_0)); } Expr::MethodCall(_binding_0) => { - full!(v.visit_expr_method_call_mut(_binding_0)); + v.visit_expr_method_call_mut(_binding_0); } Expr::Paren(_binding_0) => { v.visit_expr_paren_mut(_binding_0); @@ -1165,7 +1356,7 @@ where full!(v.visit_expr_range_mut(_binding_0)); } Expr::Reference(_binding_0) => { - full!(v.visit_expr_reference_mut(_binding_0)); + v.visit_expr_reference_mut(_binding_0); } Expr::Repeat(_binding_0) => { full!(v.visit_expr_repeat_mut(_binding_0)); @@ -1174,7 +1365,7 @@ where full!(v.visit_expr_return_mut(_binding_0)); } Expr::Struct(_binding_0) => { - full!(v.visit_expr_struct_mut(_binding_0)); + v.visit_expr_struct_mut(_binding_0); } Expr::Try(_binding_0) => { full!(v.visit_expr_try_mut(_binding_0)); @@ -1203,6 +1394,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_array_mut(v: &mut V, node: &mut ExprArray) where V: VisitMut + ?Sized, @@ -1217,6 +1409,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_assign_mut(v: &mut V, node: &mut ExprAssign) where V: VisitMut + ?Sized, @@ -1229,6 +1422,7 @@ where v.visit_expr_mut(&mut *node.right); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_async_mut(v: &mut V, node: &mut ExprAsync) where V: VisitMut + ?Sized, @@ -1241,6 +1435,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_await_mut(v: &mut V, node: &mut ExprAwait) where V: VisitMut + ?Sized, @@ -1253,6 +1448,7 @@ where skip!(node.await_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_binary_mut(v: &mut V, node: &mut ExprBinary) where V: VisitMut + ?Sized, @@ -1265,6 +1461,7 @@ where v.visit_expr_mut(&mut *node.right); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_block_mut(v: &mut V, node: &mut ExprBlock) where V: VisitMut + ?Sized, @@ -1278,6 +1475,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_break_mut(v: &mut V, node: &mut ExprBreak) where V: VisitMut + ?Sized, @@ -1294,6 +1492,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_call_mut(v: &mut V, node: &mut ExprCall) where V: VisitMut + ?Sized, @@ -1309,6 +1508,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_cast_mut(v: &mut V, node: &mut ExprCast) where V: VisitMut + ?Sized, @@ -1321,6 +1521,7 @@ where v.visit_type_mut(&mut *node.ty); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_closure_mut(v: &mut V, node: &mut ExprClosure) where V: VisitMut + ?Sized, @@ -1345,6 +1546,7 @@ where v.visit_expr_mut(&mut *node.body); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_const_mut(v: &mut V, node: &mut ExprConst) where V: VisitMut + ?Sized, @@ -1356,6 +1558,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_continue_mut(v: &mut V, node: &mut ExprContinue) where V: VisitMut + ?Sized, @@ -1369,6 +1572,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_field_mut(v: &mut V, node: &mut ExprField) where V: VisitMut + ?Sized, @@ -1381,6 +1585,7 @@ where v.visit_member_mut(&mut node.member); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_for_loop_mut(v: &mut V, node: &mut ExprForLoop) where V: VisitMut + ?Sized, @@ -1398,6 +1603,7 @@ where v.visit_block_mut(&mut node.body); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_group_mut(v: &mut V, node: &mut ExprGroup) where V: VisitMut + ?Sized, @@ -1409,6 +1615,7 @@ where v.visit_expr_mut(&mut *node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_if_mut(v: &mut V, node: &mut ExprIf) where V: VisitMut + ?Sized, @@ -1425,6 +1632,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_index_mut(v: &mut V, node: &mut ExprIndex) where V: VisitMut + ?Sized, @@ -1437,6 +1645,7 @@ where v.visit_expr_mut(&mut *node.index); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_infer_mut(v: &mut V, node: &mut ExprInfer) where V: VisitMut + ?Sized, @@ -1447,6 +1656,7 @@ where skip!(node.underscore_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_let_mut(v: &mut V, node: &mut ExprLet) where V: VisitMut + ?Sized, @@ -1460,6 +1670,7 @@ where v.visit_expr_mut(&mut *node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_lit_mut(v: &mut V, node: &mut ExprLit) where V: VisitMut + ?Sized, @@ -1470,6 +1681,7 @@ where v.visit_lit_mut(&mut node.lit); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_loop_mut(v: &mut V, node: &mut ExprLoop) where V: VisitMut + ?Sized, @@ -1484,6 +1696,7 @@ where v.visit_block_mut(&mut node.body); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_macro_mut(v: &mut V, node: &mut ExprMacro) where V: VisitMut + ?Sized, @@ -1494,6 +1707,7 @@ where v.visit_macro_mut(&mut node.mac); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_match_mut(v: &mut V, node: &mut ExprMatch) where V: VisitMut + ?Sized, @@ -1508,7 +1722,8 @@ where v.visit_arm_mut(it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_method_call_mut(v: &mut V, node: &mut ExprMethodCall) where V: VisitMut + ?Sized, @@ -1529,6 +1744,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_paren_mut(v: &mut V, node: &mut ExprParen) where V: VisitMut + ?Sized, @@ -1540,6 +1756,7 @@ where v.visit_expr_mut(&mut *node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_path_mut(v: &mut V, node: &mut ExprPath) where V: VisitMut + ?Sized, @@ -1553,6 +1770,7 @@ where v.visit_path_mut(&mut node.path); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_range_mut(v: &mut V, node: &mut ExprRange) where V: VisitMut + ?Sized, @@ -1568,7 +1786,8 @@ where v.visit_expr_mut(&mut **it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_reference_mut(v: &mut V, node: &mut ExprReference) where V: VisitMut + ?Sized, @@ -1581,6 +1800,7 @@ where v.visit_expr_mut(&mut *node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_repeat_mut(v: &mut V, node: &mut ExprRepeat) where V: VisitMut + ?Sized, @@ -1594,6 +1814,7 @@ where v.visit_expr_mut(&mut *node.len); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_return_mut(v: &mut V, node: &mut ExprReturn) where V: VisitMut + ?Sized, @@ -1606,7 +1827,8 @@ where v.visit_expr_mut(&mut **it); } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_struct_mut(v: &mut V, node: &mut ExprStruct) where V: VisitMut + ?Sized, @@ -1629,6 +1851,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_try_mut(v: &mut V, node: &mut ExprTry) where V: VisitMut + ?Sized, @@ -1640,6 +1863,7 @@ where skip!(node.question_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_try_block_mut(v: &mut V, node: &mut ExprTryBlock) where V: VisitMut + ?Sized, @@ -1651,6 +1875,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_tuple_mut(v: &mut V, node: &mut ExprTuple) where V: VisitMut + ?Sized, @@ -1665,6 +1890,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_expr_unary_mut(v: &mut V, node: &mut ExprUnary) where V: VisitMut + ?Sized, @@ -1676,6 +1902,7 @@ where v.visit_expr_mut(&mut *node.expr); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_unsafe_mut(v: &mut V, node: &mut ExprUnsafe) where V: VisitMut + ?Sized, @@ -1687,6 +1914,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_while_mut(v: &mut V, node: &mut ExprWhile) where V: VisitMut + ?Sized, @@ -1702,6 +1930,7 @@ where v.visit_block_mut(&mut node.body); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_expr_yield_mut(v: &mut V, node: &mut ExprYield) where V: VisitMut + ?Sized, @@ -1715,6 +1944,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field_mut(v: &mut V, node: &mut Field) where V: VisitMut + ?Sized, @@ -1731,6 +1961,7 @@ where v.visit_type_mut(&mut node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field_mutability_mut(v: &mut V, node: &mut FieldMutability) where V: VisitMut + ?Sized, @@ -1740,6 +1971,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_field_pat_mut(v: &mut V, node: &mut FieldPat) where V: VisitMut + ?Sized, @@ -1751,7 +1983,8 @@ where skip!(node.colon_token); v.visit_pat_mut(&mut *node.pat); } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_field_value_mut(v: &mut V, node: &mut FieldValue) where V: VisitMut + ?Sized, @@ -1764,6 +1997,7 @@ where v.visit_expr_mut(&mut node.expr); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields_mut(v: &mut V, node: &mut Fields) where V: VisitMut + ?Sized, @@ -1779,6 +2013,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields_named_mut(v: &mut V, node: &mut FieldsNamed) where V: VisitMut + ?Sized, @@ -1790,6 +2025,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_fields_unnamed_mut(v: &mut V, node: &mut FieldsUnnamed) where V: VisitMut + ?Sized, @@ -1801,6 +2037,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_file_mut(v: &mut V, node: &mut File) where V: VisitMut + ?Sized, @@ -1814,6 +2051,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_fn_arg_mut(v: &mut V, node: &mut FnArg) where V: VisitMut + ?Sized, @@ -1828,6 +2066,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_mut(v: &mut V, node: &mut ForeignItem) where V: VisitMut + ?Sized, @@ -1851,6 +2090,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_fn_mut(v: &mut V, node: &mut ForeignItemFn) where V: VisitMut + ?Sized, @@ -1863,6 +2103,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_macro_mut(v: &mut V, node: &mut ForeignItemMacro) where V: VisitMut + ?Sized, @@ -1874,6 +2115,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_static_mut(v: &mut V, node: &mut ForeignItemStatic) where V: VisitMut + ?Sized, @@ -1890,6 +2132,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_foreign_item_type_mut(v: &mut V, node: &mut ForeignItemType) where V: VisitMut + ?Sized, @@ -1904,6 +2147,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generic_argument_mut(v: &mut V, node: &mut GenericArgument) where V: VisitMut + ?Sized, @@ -1930,6 +2174,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generic_param_mut(v: &mut V, node: &mut GenericParam) where V: VisitMut + ?Sized, @@ -1947,6 +2192,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_generics_mut(v: &mut V, node: &mut Generics) where V: VisitMut + ?Sized, @@ -1970,6 +2216,7 @@ where node.set_span(span); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_mut(v: &mut V, node: &mut ImplItem) where V: VisitMut + ?Sized, @@ -1993,6 +2240,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_const_mut(v: &mut V, node: &mut ImplItemConst) where V: VisitMut + ?Sized, @@ -2012,6 +2260,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_fn_mut(v: &mut V, node: &mut ImplItemFn) where V: VisitMut + ?Sized, @@ -2025,6 +2274,7 @@ where v.visit_block_mut(&mut node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_macro_mut(v: &mut V, node: &mut ImplItemMacro) where V: VisitMut + ?Sized, @@ -2036,6 +2286,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_item_type_mut(v: &mut V, node: &mut ImplItemType) where V: VisitMut + ?Sized, @@ -2053,6 +2304,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_impl_restriction_mut(v: &mut V, node: &mut ImplRestriction) where V: VisitMut + ?Sized, @@ -2060,6 +2312,7 @@ where match *node {} } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_index_mut(v: &mut V, node: &mut Index) where V: VisitMut + ?Sized, @@ -2068,6 +2321,7 @@ where v.visit_span_mut(&mut node.span); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_mut(v: &mut V, node: &mut Item) where V: VisitMut + ?Sized, @@ -2124,6 +2378,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_const_mut(v: &mut V, node: &mut ItemConst) where V: VisitMut + ?Sized, @@ -2142,6 +2397,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_enum_mut(v: &mut V, node: &mut ItemEnum) where V: VisitMut + ?Sized, @@ -2160,6 +2416,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_extern_crate_mut(v: &mut V, node: &mut ItemExternCrate) where V: VisitMut + ?Sized, @@ -2178,6 +2435,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_fn_mut(v: &mut V, node: &mut ItemFn) where V: VisitMut + ?Sized, @@ -2190,6 +2448,7 @@ where v.visit_block_mut(&mut *node.block); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_foreign_mod_mut(v: &mut V, node: &mut ItemForeignMod) where V: VisitMut + ?Sized, @@ -2205,6 +2464,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_impl_mut(v: &mut V, node: &mut ItemImpl) where V: VisitMut + ?Sized, @@ -2228,6 +2488,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_macro_mut(v: &mut V, node: &mut ItemMacro) where V: VisitMut + ?Sized, @@ -2242,6 +2503,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_mod_mut(v: &mut V, node: &mut ItemMod) where V: VisitMut + ?Sized, @@ -2262,6 +2524,7 @@ where skip!(node.semi); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_static_mut(v: &mut V, node: &mut ItemStatic) where V: VisitMut + ?Sized, @@ -2280,6 +2543,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_struct_mut(v: &mut V, node: &mut ItemStruct) where V: VisitMut + ?Sized, @@ -2295,6 +2559,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_trait_mut(v: &mut V, node: &mut ItemTrait) where V: VisitMut + ?Sized, @@ -2322,6 +2587,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_trait_alias_mut(v: &mut V, node: &mut ItemTraitAlias) where V: VisitMut + ?Sized, @@ -2341,6 +2607,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_type_mut(v: &mut V, node: &mut ItemType) where V: VisitMut + ?Sized, @@ -2357,6 +2624,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_union_mut(v: &mut V, node: &mut ItemUnion) where V: VisitMut + ?Sized, @@ -2371,6 +2639,7 @@ where v.visit_fields_named_mut(&mut node.fields); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_item_use_mut(v: &mut V, node: &mut ItemUse) where V: VisitMut + ?Sized, @@ -2385,6 +2654,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_label_mut(v: &mut V, node: &mut Label) where V: VisitMut + ?Sized, @@ -2400,6 +2670,7 @@ where v.visit_ident_mut(&mut node.ident); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_lifetime_param_mut(v: &mut V, node: &mut LifetimeParam) where V: VisitMut + ?Sized, @@ -2477,6 +2748,7 @@ where V: VisitMut + ?Sized, {} #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_local_mut(v: &mut V, node: &mut Local) where V: VisitMut + ?Sized, @@ -2492,6 +2764,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_local_init_mut(v: &mut V, node: &mut LocalInit) where V: VisitMut + ?Sized, @@ -2504,6 +2777,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_macro_mut(v: &mut V, node: &mut Macro) where V: VisitMut + ?Sized, @@ -2514,6 +2788,7 @@ where skip!(node.tokens); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_macro_delimiter_mut(v: &mut V, node: &mut MacroDelimiter) where V: VisitMut + ?Sized, @@ -2531,6 +2806,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_member_mut(v: &mut V, node: &mut Member) where V: VisitMut + ?Sized, @@ -2545,6 +2821,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta_mut(v: &mut V, node: &mut Meta) where V: VisitMut + ?Sized, @@ -2562,6 +2839,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta_list_mut(v: &mut V, node: &mut MetaList) where V: VisitMut + ?Sized, @@ -2571,6 +2849,7 @@ where skip!(node.tokens); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_meta_name_value_mut(v: &mut V, node: &mut MetaNameValue) where V: VisitMut + ?Sized, @@ -2580,6 +2859,7 @@ where v.visit_expr_mut(&mut node.value); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_parenthesized_generic_arguments_mut( v: &mut V, node: &mut ParenthesizedGenericArguments, @@ -2595,6 +2875,7 @@ where v.visit_return_type_mut(&mut node.output); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_mut(v: &mut V, node: &mut Pat) where V: VisitMut + ?Sized, @@ -2654,6 +2935,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_ident_mut(v: &mut V, node: &mut PatIdent) where V: VisitMut + ?Sized, @@ -2670,6 +2952,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_or_mut(v: &mut V, node: &mut PatOr) where V: VisitMut + ?Sized, @@ -2684,6 +2967,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_paren_mut(v: &mut V, node: &mut PatParen) where V: VisitMut + ?Sized, @@ -2695,6 +2979,7 @@ where v.visit_pat_mut(&mut *node.pat); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_reference_mut(v: &mut V, node: &mut PatReference) where V: VisitMut + ?Sized, @@ -2707,6 +2992,7 @@ where v.visit_pat_mut(&mut *node.pat); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_rest_mut(v: &mut V, node: &mut PatRest) where V: VisitMut + ?Sized, @@ -2717,6 +3003,7 @@ where skip!(node.dot2_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_slice_mut(v: &mut V, node: &mut PatSlice) where V: VisitMut + ?Sized, @@ -2731,6 +3018,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_struct_mut(v: &mut V, node: &mut PatStruct) where V: VisitMut + ?Sized, @@ -2752,6 +3040,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_tuple_mut(v: &mut V, node: &mut PatTuple) where V: VisitMut + ?Sized, @@ -2766,6 +3055,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_tuple_struct_mut(v: &mut V, node: &mut PatTupleStruct) where V: VisitMut + ?Sized, @@ -2784,6 +3074,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_type_mut(v: &mut V, node: &mut PatType) where V: VisitMut + ?Sized, @@ -2796,6 +3087,7 @@ where v.visit_type_mut(&mut *node.ty); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_pat_wild_mut(v: &mut V, node: &mut PatWild) where V: VisitMut + ?Sized, @@ -2806,6 +3098,7 @@ where skip!(node.underscore_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path_mut(v: &mut V, node: &mut Path) where V: VisitMut + ?Sized, @@ -2817,6 +3110,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path_arguments_mut(v: &mut V, node: &mut PathArguments) where V: VisitMut + ?Sized, @@ -2832,6 +3126,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_path_segment_mut(v: &mut V, node: &mut PathSegment) where V: VisitMut + ?Sized, @@ -2840,6 +3135,7 @@ where v.visit_path_arguments_mut(&mut node.arguments); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_predicate_lifetime_mut(v: &mut V, node: &mut PredicateLifetime) where V: VisitMut + ?Sized, @@ -2852,6 +3148,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_predicate_type_mut(v: &mut V, node: &mut PredicateType) where V: VisitMut + ?Sized, @@ -2867,6 +3164,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_qself_mut(v: &mut V, node: &mut QSelf) where V: VisitMut + ?Sized, @@ -2878,6 +3176,7 @@ where skip!(node.gt_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_range_limits_mut(v: &mut V, node: &mut RangeLimits) where V: VisitMut + ?Sized, @@ -2892,6 +3191,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_receiver_mut(v: &mut V, node: &mut Receiver) where V: VisitMut + ?Sized, @@ -2911,6 +3211,7 @@ where v.visit_type_mut(&mut *node.ty); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_return_type_mut(v: &mut V, node: &mut ReturnType) where V: VisitMut + ?Sized, @@ -2924,6 +3225,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_signature_mut(v: &mut V, node: &mut Signature) where V: VisitMut + ?Sized, @@ -2952,6 +3254,7 @@ where V: VisitMut + ?Sized, {} #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_static_mutability_mut(v: &mut V, node: &mut StaticMutability) where V: VisitMut + ?Sized, @@ -2964,6 +3267,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_stmt_mut(v: &mut V, node: &mut Stmt) where V: VisitMut + ?Sized, @@ -2985,6 +3289,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_stmt_macro_mut(v: &mut V, node: &mut StmtMacro) where V: VisitMut + ?Sized, @@ -2996,6 +3301,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_trait_bound_mut(v: &mut V, node: &mut TraitBound) where V: VisitMut + ?Sized, @@ -3008,6 +3314,7 @@ where v.visit_path_mut(&mut node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_trait_bound_modifier_mut(v: &mut V, node: &mut TraitBoundModifier) where V: VisitMut + ?Sized, @@ -3020,6 +3327,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_mut(v: &mut V, node: &mut TraitItem) where V: VisitMut + ?Sized, @@ -3043,6 +3351,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_const_mut(v: &mut V, node: &mut TraitItemConst) where V: VisitMut + ?Sized, @@ -3062,6 +3371,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_fn_mut(v: &mut V, node: &mut TraitItemFn) where V: VisitMut + ?Sized, @@ -3076,6 +3386,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_macro_mut(v: &mut V, node: &mut TraitItemMacro) where V: VisitMut + ?Sized, @@ -3087,6 +3398,7 @@ where skip!(node.semi_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_trait_item_type_mut(v: &mut V, node: &mut TraitItemType) where V: VisitMut + ?Sized, @@ -3109,6 +3421,7 @@ where skip!(node.semi_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_mut(v: &mut V, node: &mut Type) where V: VisitMut + ?Sized, @@ -3162,6 +3475,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_array_mut(v: &mut V, node: &mut TypeArray) where V: VisitMut + ?Sized, @@ -3172,6 +3486,7 @@ where v.visit_expr_mut(&mut node.len); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_bare_fn_mut(v: &mut V, node: &mut TypeBareFn) where V: VisitMut + ?Sized, @@ -3195,6 +3510,7 @@ where v.visit_return_type_mut(&mut node.output); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_group_mut(v: &mut V, node: &mut TypeGroup) where V: VisitMut + ?Sized, @@ -3203,6 +3519,7 @@ where v.visit_type_mut(&mut *node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_impl_trait_mut(v: &mut V, node: &mut TypeImplTrait) where V: VisitMut + ?Sized, @@ -3214,6 +3531,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_infer_mut(v: &mut V, node: &mut TypeInfer) where V: VisitMut + ?Sized, @@ -3221,6 +3539,7 @@ where skip!(node.underscore_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_macro_mut(v: &mut V, node: &mut TypeMacro) where V: VisitMut + ?Sized, @@ -3228,6 +3547,7 @@ where v.visit_macro_mut(&mut node.mac); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_never_mut(v: &mut V, node: &mut TypeNever) where V: VisitMut + ?Sized, @@ -3235,6 +3555,7 @@ where skip!(node.bang_token); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_param_mut(v: &mut V, node: &mut TypeParam) where V: VisitMut + ?Sized, @@ -3254,6 +3575,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_param_bound_mut(v: &mut V, node: &mut TypeParamBound) where V: VisitMut + ?Sized, @@ -3271,6 +3593,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_paren_mut(v: &mut V, node: &mut TypeParen) where V: VisitMut + ?Sized, @@ -3279,6 +3602,7 @@ where v.visit_type_mut(&mut *node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_path_mut(v: &mut V, node: &mut TypePath) where V: VisitMut + ?Sized, @@ -3289,6 +3613,7 @@ where v.visit_path_mut(&mut node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_ptr_mut(v: &mut V, node: &mut TypePtr) where V: VisitMut + ?Sized, @@ -3299,6 +3624,7 @@ where v.visit_type_mut(&mut *node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_reference_mut(v: &mut V, node: &mut TypeReference) where V: VisitMut + ?Sized, @@ -3311,6 +3637,7 @@ where v.visit_type_mut(&mut *node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_slice_mut(v: &mut V, node: &mut TypeSlice) where V: VisitMut + ?Sized, @@ -3319,6 +3646,7 @@ where v.visit_type_mut(&mut *node.elem); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_trait_object_mut(v: &mut V, node: &mut TypeTraitObject) where V: VisitMut + ?Sized, @@ -3330,6 +3658,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_type_tuple_mut(v: &mut V, node: &mut TypeTuple) where V: VisitMut + ?Sized, @@ -3341,6 +3670,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_un_op_mut(v: &mut V, node: &mut UnOp) where V: VisitMut + ?Sized, @@ -3358,6 +3688,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_glob_mut(v: &mut V, node: &mut UseGlob) where V: VisitMut + ?Sized, @@ -3365,6 +3696,7 @@ where skip!(node.star_token); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_group_mut(v: &mut V, node: &mut UseGroup) where V: VisitMut + ?Sized, @@ -3376,6 +3708,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_name_mut(v: &mut V, node: &mut UseName) where V: VisitMut + ?Sized, @@ -3383,6 +3716,7 @@ where v.visit_ident_mut(&mut node.ident); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_path_mut(v: &mut V, node: &mut UsePath) where V: VisitMut + ?Sized, @@ -3392,6 +3726,7 @@ where v.visit_use_tree_mut(&mut *node.tree); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_rename_mut(v: &mut V, node: &mut UseRename) where V: VisitMut + ?Sized, @@ -3401,6 +3736,7 @@ where v.visit_ident_mut(&mut node.rename); } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_use_tree_mut(v: &mut V, node: &mut UseTree) where V: VisitMut + ?Sized, @@ -3424,6 +3760,7 @@ where } } #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub fn visit_variadic_mut(v: &mut V, node: &mut Variadic) where V: VisitMut + ?Sized, @@ -3439,6 +3776,7 @@ where skip!(node.comma); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_variant_mut(v: &mut V, node: &mut Variant) where V: VisitMut + ?Sized, @@ -3454,6 +3792,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_vis_restricted_mut(v: &mut V, node: &mut VisRestricted) where V: VisitMut + ?Sized, @@ -3464,6 +3803,7 @@ where v.visit_path_mut(&mut *node.path); } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_visibility_mut(v: &mut V, node: &mut Visibility) where V: VisitMut + ?Sized, @@ -3479,6 +3819,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_where_clause_mut(v: &mut V, node: &mut WhereClause) where V: VisitMut + ?Sized, @@ -3490,6 +3831,7 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] pub fn visit_where_predicate_mut(v: &mut V, node: &mut WherePredicate) where V: VisitMut + ?Sized, diff --git a/vendor/syn/src/generics.rs b/vendor/syn/src/generics.rs index 2ad913d1d..aed50e304 100644 --- a/vendor/syn/src/generics.rs +++ b/vendor/syn/src/generics.rs @@ -532,7 +532,7 @@ ast_struct! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; + use crate::ext::IdentExt as _; use crate::parse::{Parse, ParseStream, Result}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] diff --git a/vendor/syn/src/item.rs b/vendor/syn/src/item.rs index ee91f5914..4e404e266 100644 --- a/vendor/syn/src/item.rs +++ b/vendor/syn/src/item.rs @@ -70,12 +70,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match item { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // Item::Const(item) => {...} // Item::Enum(item) => {...} // ... // Item::Verbatim(item) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -510,12 +511,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match item { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // ForeignItem::Fn(item) => {...} // ForeignItem::Static(item) => {...} // ... // ForeignItem::Verbatim(item) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -604,12 +606,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match item { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // TraitItem::Const(item) => {...} // TraitItem::Fn(item) => {...} // ... // TraitItem::Verbatim(item) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -700,12 +703,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match item { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // ImplItem::Const(item) => {...} // ImplItem::Fn(item) => {...} // ... // ImplItem::Verbatim(item) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -890,8 +894,8 @@ ast_enum! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; - use crate::parse::discouraged::Speculative; + use crate::ext::IdentExt as _; + use crate::parse::discouraged::Speculative as _; use crate::parse::{Parse, ParseBuffer, ParseStream, Result}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] diff --git a/vendor/syn/src/lib.rs b/vendor/syn/src/lib.rs index a3df727a9..cb8daf6c8 100644 --- a/vendor/syn/src/lib.rs +++ b/vendor/syn/src/lib.rs @@ -249,8 +249,9 @@ //! dynamic library libproc_macro from rustc toolchain. // Syn types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/syn/2.0.39")] +#![doc(html_root_url = "https://docs.rs/syn/2.0.48")] #![cfg_attr(doc_cfg, feature(doc_cfg))] +#![deny(unsafe_op_in_unsafe_fn)] #![allow(non_camel_case_types)] #![allow( clippy::bool_to_int_with_if, @@ -260,6 +261,7 @@ clippy::cast_ptr_alignment, clippy::default_trait_access, clippy::derivable_impls, + clippy::diverging_sub_expression, clippy::doc_markdown, clippy::expl_impl_clone_on_copy, clippy::explicit_auto_deref, @@ -290,6 +292,7 @@ clippy::too_many_arguments, clippy::too_many_lines, clippy::trivially_copy_pass_by_ref, + clippy::uninhabited_references, clippy::uninlined_format_args, clippy::unnecessary_box_returns, clippy::unnecessary_unwrap, @@ -313,6 +316,7 @@ pub mod token; #[cfg(any(feature = "full", feature = "derive"))] mod attr; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue}; mod bigint; @@ -328,11 +332,13 @@ mod custom_punctuation; #[cfg(any(feature = "full", feature = "derive"))] mod data; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant}; #[cfg(any(feature = "full", feature = "derive"))] mod derive; #[cfg(feature = "derive")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))] pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput}; mod drops; @@ -343,14 +349,21 @@ pub use crate::error::{Error, Result}; #[cfg(any(feature = "full", feature = "derive"))] mod expr; #[cfg(feature = "full")] -pub use crate::expr::{Arm, FieldValue, Label, RangeLimits}; +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] +pub use crate::expr::{Arm, Label, RangeLimits}; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::expr::{ - Expr, ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBinary, ExprBlock, ExprBreak, ExprCall, - ExprCast, ExprClosure, ExprConst, ExprContinue, ExprField, ExprForLoop, ExprGroup, ExprIf, - ExprIndex, ExprInfer, ExprLet, ExprLit, ExprLoop, ExprMacro, ExprMatch, ExprMethodCall, - ExprParen, ExprPath, ExprRange, ExprReference, ExprRepeat, ExprReturn, ExprStruct, ExprTry, - ExprTryBlock, ExprTuple, ExprUnary, ExprUnsafe, ExprWhile, ExprYield, Index, Member, + Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprIndex, ExprLit, ExprMacro, ExprMethodCall, + ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue, Index, Member, +}; +#[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] +pub use crate::expr::{ + ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock, ExprBreak, ExprClosure, ExprConst, + ExprContinue, ExprForLoop, ExprGroup, ExprIf, ExprInfer, ExprLet, ExprLoop, ExprMatch, + ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple, ExprUnsafe, ExprWhile, + ExprYield, }; #[cfg(feature = "parsing")] @@ -360,17 +373,23 @@ pub mod ext; #[cfg(feature = "full")] mod file; #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub use crate::file::File; #[cfg(any(feature = "full", feature = "derive"))] mod generics; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::generics::{ BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeParam, PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, WhereClause, WherePredicate, }; #[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))] +#[cfg_attr( + doc_cfg, + doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) +)] pub use crate::generics::{ImplGenerics, Turbofish, TypeGenerics}; mod ident; @@ -380,6 +399,7 @@ pub use crate::ident::Ident; #[cfg(feature = "full")] mod item; #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub use crate::item::{ FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType, ImplItem, ImplItemConst, ImplItemFn, ImplItemMacro, ImplItemType, ImplRestriction, Item, @@ -394,10 +414,10 @@ mod lifetime; pub use crate::lifetime::Lifetime; mod lit; +#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566 +pub use crate::lit::StrStyle; #[doc(inline)] -pub use crate::lit::{ - Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr, StrStyle, -}; +pub use crate::lit::{Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr}; #[cfg(feature = "parsing")] mod lookahead; @@ -405,6 +425,7 @@ mod lookahead; #[cfg(any(feature = "full", feature = "derive"))] mod mac; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::mac::{Macro, MacroDelimiter}; #[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))] @@ -417,6 +438,7 @@ pub mod meta; #[cfg(any(feature = "full", feature = "derive"))] mod op; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::op::{BinOp, UnOp}; #[cfg(feature = "parsing")] @@ -432,11 +454,13 @@ mod parse_quote; #[cfg(feature = "full")] mod pat; #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub use crate::expr::{ ExprConst as PatConst, ExprLit as PatLit, ExprMacro as PatMacro, ExprPath as PatPath, ExprRange as PatRange, }; #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub use crate::pat::{ FieldPat, Pat, PatIdent, PatOr, PatParen, PatReference, PatRest, PatSlice, PatStruct, PatTuple, PatTupleStruct, PatType, PatWild, @@ -445,6 +469,7 @@ pub use crate::pat::{ #[cfg(any(feature = "full", feature = "derive"))] mod path; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::path::{ AngleBracketedGenericArguments, AssocConst, AssocType, Constraint, GenericArgument, ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf, @@ -458,6 +483,7 @@ pub mod punctuated; #[cfg(any(feature = "full", feature = "derive"))] mod restriction; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::restriction::{FieldMutability, VisRestricted, Visibility}; mod sealed; @@ -471,6 +497,7 @@ pub mod spanned; #[cfg(feature = "full")] mod stmt; #[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub use crate::stmt::{Block, Local, LocalInit, Stmt, StmtMacro}; mod thread; @@ -481,6 +508,7 @@ mod tt; #[cfg(any(feature = "full", feature = "derive"))] mod ty; #[cfg(any(feature = "full", feature = "derive"))] +#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))] pub use crate::ty::{ Abi, BareFnArg, BareVariadic, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup, TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference, @@ -813,8 +841,17 @@ mod gen { mod helper; } -#[cfg(any(feature = "fold", feature = "visit", feature = "visit-mut"))] -pub use crate::gen::*; +#[cfg(feature = "fold")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "fold")))] +pub use crate::gen::fold; + +#[cfg(feature = "visit")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "visit")))] +pub use crate::gen::visit; + +#[cfg(feature = "visit-mut")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "visit-mut")))] +pub use crate::gen::visit_mut; // Not public API. #[doc(hidden)] diff --git a/vendor/syn/src/lit.rs b/vendor/syn/src/lit.rs index f7426ce81..24524bb1f 100644 --- a/vendor/syn/src/lit.rs +++ b/vendor/syn/src/lit.rs @@ -784,17 +784,16 @@ pub_if_not_doc! { } } -ast_enum! { - /// The style of a string literal, either plain quoted or a raw string like - /// `r##"data"##`. - pub enum StrStyle #no_visit { - /// An ordinary string like `"data"`. - Cooked, - /// A raw string like `r##"data"##`. - /// - /// The unsigned integer is the number of `#` symbols used. - Raw(usize), - } +/// The style of a string literal, either plain quoted or a raw string like +/// `r##"data"##`. +#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566 +pub enum StrStyle { + /// An ordinary string like `"data"`. + Cooked, + /// A raw string like `r##"data"##`. + /// + /// The unsigned integer is the number of `#` symbols used. + Raw(usize), } #[cfg(feature = "parsing")] diff --git a/vendor/syn/src/macros.rs b/vendor/syn/src/macros.rs index 06ceb542d..46d283252 100644 --- a/vendor/syn/src/macros.rs +++ b/vendor/syn/src/macros.rs @@ -4,14 +4,17 @@ )] macro_rules! ast_struct { ( - [$($attrs_pub:tt)*] - struct $name:ident #full $($rest:tt)* + $(#[$attr:meta])* + $pub:ident $struct:ident $name:ident #full $body:tt ) => { + check_keyword_matches!(pub $pub); + check_keyword_matches!(struct $struct); + #[cfg(feature = "full")] - $($attrs_pub)* struct $name $($rest)* + $(#[$attr])* $pub $struct $name $body #[cfg(not(feature = "full"))] - $($attrs_pub)* struct $name { + $(#[$attr])* $pub $struct $name { _noconstruct: ::std::marker::PhantomData<::proc_macro2::Span>, } @@ -24,35 +27,26 @@ macro_rules! ast_struct { }; ( - [$($attrs_pub:tt)*] - struct $name:ident $($rest:tt)* + $(#[$attr:meta])* + $pub:ident $struct:ident $name:ident $body:tt ) => { - $($attrs_pub)* struct $name $($rest)* - }; + check_keyword_matches!(pub $pub); + check_keyword_matches!(struct $struct); - ($($t:tt)*) => { - strip_attrs_pub!(ast_struct!($($t)*)); + $(#[$attr])* $pub $struct $name $body }; } +#[cfg(any(feature = "full", feature = "derive"))] macro_rules! ast_enum { - // Drop the `#no_visit` attribute, if present. ( - [$($attrs_pub:tt)*] - enum $name:ident #no_visit $($rest:tt)* - ) => ( - ast_enum!([$($attrs_pub)*] enum $name $($rest)*); - ); + $(#[$enum_attr:meta])* + $pub:ident $enum:ident $name:ident $body:tt + ) => { + check_keyword_matches!(pub $pub); + check_keyword_matches!(enum $enum); - ( - [$($attrs_pub:tt)*] - enum $name:ident $($rest:tt)* - ) => ( - $($attrs_pub)* enum $name $($rest)* - ); - - ($($t:tt)*) => { - strip_attrs_pub!(ast_enum!($($t)*)); + $(#[$enum_attr])* $pub $enum $name $body }; } @@ -60,16 +54,19 @@ macro_rules! ast_enum_of_structs { ( $(#[$enum_attr:meta])* $pub:ident $enum:ident $name:ident $body:tt - $($remaining:tt)* ) => { - ast_enum!($(#[$enum_attr])* $pub $enum $name $body); - ast_enum_of_structs_impl!($pub $enum $name $body $($remaining)*); + check_keyword_matches!(pub $pub); + check_keyword_matches!(enum $enum); + + $(#[$enum_attr])* $pub $enum $name $body + + ast_enum_of_structs_impl!($name $body); }; } macro_rules! ast_enum_of_structs_impl { ( - $pub:ident $enum:ident $name:ident { + $name:ident { $( $(#[cfg $cfg_attr:tt])* $(#[doc $($doc_attr:tt)*])* @@ -77,9 +74,6 @@ macro_rules! ast_enum_of_structs_impl { )* } ) => { - check_keyword_matches!(pub $pub); - check_keyword_matches!(enum $enum); - $($( ast_enum_from_struct!($name::$variant, $($member)::+); )*)* @@ -154,32 +148,29 @@ macro_rules! generate_to_tokens { }; } -macro_rules! strip_attrs_pub { - ($mac:ident!($(#[$m:meta])* $pub:ident $($t:tt)*)) => { +// Rustdoc bug: does not respect the doc(hidden) on some items. +#[cfg(all(doc, feature = "parsing"))] +macro_rules! pub_if_not_doc { + ($(#[$m:meta])* $pub:ident $($item:tt)*) => { check_keyword_matches!(pub $pub); - $mac!([$(#[$m])* $pub] $($t)*); + $(#[$m])* + $pub(crate) $($item)* + }; +} + +#[cfg(all(not(doc), feature = "parsing"))] +macro_rules! pub_if_not_doc { + ($(#[$m:meta])* $pub:ident $($item:tt)*) => { + check_keyword_matches!(pub $pub); + + $(#[$m])* + $pub $($item)* }; } macro_rules! check_keyword_matches { (enum enum) => {}; (pub pub) => {}; -} - -// Rustdoc bug: does not respect the doc(hidden) on some items. -#[cfg(all(doc, feature = "parsing"))] -macro_rules! pub_if_not_doc { - ($(#[$m:meta])* pub $($item:tt)*) => { - $(#[$m])* - pub(crate) $($item)* - }; -} - -#[cfg(all(not(doc), feature = "parsing"))] -macro_rules! pub_if_not_doc { - ($(#[$m:meta])* pub $($item:tt)*) => { - $(#[$m])* - pub $($item)* - }; + (struct struct) => {}; } diff --git a/vendor/syn/src/meta.rs b/vendor/syn/src/meta.rs index f17b2802d..66a0a467b 100644 --- a/vendor/syn/src/meta.rs +++ b/vendor/syn/src/meta.rs @@ -1,6 +1,6 @@ //! Facility for interpreting structured content inside of an `Attribute`. -use crate::ext::IdentExt; +use crate::ext::IdentExt as _; use crate::lit::Lit; use crate::parse::{Error, ParseStream, Parser, Result}; use crate::path::{Path, PathSegment}; diff --git a/vendor/syn/src/op.rs b/vendor/syn/src/op.rs index bff72c8ba..c231285b9 100644 --- a/vendor/syn/src/op.rs +++ b/vendor/syn/src/op.rs @@ -81,56 +81,8 @@ pub(crate) mod parsing { use super::*; use crate::parse::{Parse, ParseStream, Result}; - fn parse_binop(input: ParseStream) -> Result { - if input.peek(Token![&&]) { - input.parse().map(BinOp::And) - } else if input.peek(Token![||]) { - input.parse().map(BinOp::Or) - } else if input.peek(Token![<<]) { - input.parse().map(BinOp::Shl) - } else if input.peek(Token![>>]) { - input.parse().map(BinOp::Shr) - } else if input.peek(Token![==]) { - input.parse().map(BinOp::Eq) - } else if input.peek(Token![<=]) { - input.parse().map(BinOp::Le) - } else if input.peek(Token![!=]) { - input.parse().map(BinOp::Ne) - } else if input.peek(Token![>=]) { - input.parse().map(BinOp::Ge) - } else if input.peek(Token![+]) { - input.parse().map(BinOp::Add) - } else if input.peek(Token![-]) { - input.parse().map(BinOp::Sub) - } else if input.peek(Token![*]) { - input.parse().map(BinOp::Mul) - } else if input.peek(Token![/]) { - input.parse().map(BinOp::Div) - } else if input.peek(Token![%]) { - input.parse().map(BinOp::Rem) - } else if input.peek(Token![^]) { - input.parse().map(BinOp::BitXor) - } else if input.peek(Token![&]) { - input.parse().map(BinOp::BitAnd) - } else if input.peek(Token![|]) { - input.parse().map(BinOp::BitOr) - } else if input.peek(Token![<]) { - input.parse().map(BinOp::Lt) - } else if input.peek(Token![>]) { - input.parse().map(BinOp::Gt) - } else { - Err(input.error("expected binary operator")) - } - } - #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for BinOp { - #[cfg(not(feature = "full"))] - fn parse(input: ParseStream) -> Result { - parse_binop(input) - } - - #[cfg(feature = "full")] fn parse(input: ParseStream) -> Result { if input.peek(Token![+=]) { input.parse().map(BinOp::AddAssign) @@ -152,8 +104,44 @@ pub(crate) mod parsing { input.parse().map(BinOp::ShlAssign) } else if input.peek(Token![>>=]) { input.parse().map(BinOp::ShrAssign) + } else if input.peek(Token![&&]) { + input.parse().map(BinOp::And) + } else if input.peek(Token![||]) { + input.parse().map(BinOp::Or) + } else if input.peek(Token![<<]) { + input.parse().map(BinOp::Shl) + } else if input.peek(Token![>>]) { + input.parse().map(BinOp::Shr) + } else if input.peek(Token![==]) { + input.parse().map(BinOp::Eq) + } else if input.peek(Token![<=]) { + input.parse().map(BinOp::Le) + } else if input.peek(Token![!=]) { + input.parse().map(BinOp::Ne) + } else if input.peek(Token![>=]) { + input.parse().map(BinOp::Ge) + } else if input.peek(Token![+]) { + input.parse().map(BinOp::Add) + } else if input.peek(Token![-]) { + input.parse().map(BinOp::Sub) + } else if input.peek(Token![*]) { + input.parse().map(BinOp::Mul) + } else if input.peek(Token![/]) { + input.parse().map(BinOp::Div) + } else if input.peek(Token![%]) { + input.parse().map(BinOp::Rem) + } else if input.peek(Token![^]) { + input.parse().map(BinOp::BitXor) + } else if input.peek(Token![&]) { + input.parse().map(BinOp::BitAnd) + } else if input.peek(Token![|]) { + input.parse().map(BinOp::BitOr) + } else if input.peek(Token![<]) { + input.parse().map(BinOp::Lt) + } else if input.peek(Token![>]) { + input.parse().map(BinOp::Gt) } else { - parse_binop(input) + Err(input.error("expected binary operator")) } } } diff --git a/vendor/syn/src/parse.rs b/vendor/syn/src/parse.rs index 50fe110b5..13f488d14 100644 --- a/vendor/syn/src/parse.rs +++ b/vendor/syn/src/parse.rs @@ -1096,6 +1096,58 @@ impl<'a> ParseBuffer<'a> { /// /// Cursors are immutable so no operations you perform against the cursor /// will affect the state of this parse stream. + /// + /// # Example + /// + /// ``` + /// use proc_macro2::TokenStream; + /// use syn::buffer::Cursor; + /// use syn::parse::{ParseStream, Result}; + /// + /// // Run a parser that returns T, but get its output as TokenStream instead of T. + /// // This works without T needing to implement ToTokens. + /// fn recognize_token_stream( + /// recognizer: fn(ParseStream) -> Result, + /// ) -> impl Fn(ParseStream) -> Result { + /// move |input| { + /// let begin = input.cursor(); + /// recognizer(input)?; + /// let end = input.cursor(); + /// Ok(tokens_between(begin, end)) + /// } + /// } + /// + /// // Collect tokens between two cursors as a TokenStream. + /// fn tokens_between(begin: Cursor, end: Cursor) -> TokenStream { + /// assert!(begin <= end); + /// + /// let mut cursor = begin; + /// let mut tokens = TokenStream::new(); + /// while cursor < end { + /// let (token, next) = cursor.token_tree().unwrap(); + /// tokens.extend(std::iter::once(token)); + /// cursor = next; + /// } + /// tokens + /// } + /// + /// fn main() { + /// use quote::quote; + /// use syn::parse::{Parse, Parser}; + /// use syn::Token; + /// + /// // Parse syn::Type as a TokenStream, surrounded by angle brackets. + /// fn example(input: ParseStream) -> Result { + /// let _langle: Token![<] = input.parse()?; + /// let ty = recognize_token_stream(syn::Type::parse)(input)?; + /// let _rangle: Token![>] = input.parse()?; + /// Ok(ty) + /// } + /// + /// let tokens = quote! { u8> }; + /// println!("{}", example.parse2(tokens).unwrap()); + /// } + /// ``` pub fn cursor(&self) -> Cursor<'a> { self.cell.get() } diff --git a/vendor/syn/src/parse_quote.rs b/vendor/syn/src/parse_quote.rs index 59e51b41e..18de47450 100644 --- a/vendor/syn/src/parse_quote.rs +++ b/vendor/syn/src/parse_quote.rs @@ -136,7 +136,7 @@ impl ParseQuote for T { use crate::punctuated::Punctuated; #[cfg(any(feature = "full", feature = "derive"))] -use crate::{attr, Attribute}; +use crate::{attr, Attribute, Field, FieldMutability, Ident, Type, Visibility}; #[cfg(feature = "full")] use crate::{Block, Pat, Stmt}; @@ -151,6 +151,36 @@ impl ParseQuote for Attribute { } } +#[cfg(any(feature = "full", feature = "derive"))] +impl ParseQuote for Field { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + + let ident: Option; + let colon_token: Option; + let is_named = input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]); + if is_named { + ident = Some(input.parse()?); + colon_token = Some(input.parse()?); + } else { + ident = None; + colon_token = None; + } + + let ty: Type = input.parse()?; + + Ok(Field { + attrs, + vis, + mutability: FieldMutability::None, + ident, + colon_token, + ty, + }) + } +} + #[cfg(feature = "full")] impl ParseQuote for Pat { fn parse(input: ParseStream) -> Result { diff --git a/vendor/syn/src/pat.rs b/vendor/syn/src/pat.rs index df7da5bbe..ce6399d9f 100644 --- a/vendor/syn/src/pat.rs +++ b/vendor/syn/src/pat.rs @@ -74,12 +74,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match pat { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // Pat::Box(pat) => {...} // Pat::Ident(pat) => {...} // ... // Pat::Wild(pat) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -117,6 +118,7 @@ ast_struct! { ast_struct! { /// A parenthesized pattern: `(A | B)`. + #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] pub struct PatParen { pub attrs: Vec, pub paren_token: token::Paren, @@ -226,8 +228,8 @@ ast_struct! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; - use crate::parse::{ParseBuffer, ParseStream, Result}; + use crate::ext::IdentExt as _; + use crate::parse::{Parse, ParseBuffer, ParseStream, Result}; use crate::path; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] @@ -354,6 +356,18 @@ pub(crate) mod parsing { } } + #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] + impl Parse for PatType { + fn parse(input: ParseStream) -> Result { + Ok(PatType { + attrs: Vec::new(), + pat: Box::new(Pat::parse_single(input)?), + colon_token: input.parse()?, + ty: input.parse()?, + }) + } + } + fn multi_pat_impl(input: ParseStream, leading_vert: Option) -> Result { let mut pat = Pat::parse_single(input)?; if leading_vert.is_some() @@ -506,15 +520,6 @@ pub(crate) mod parsing { }) } - impl Member { - fn is_unnamed(&self) -> bool { - match self { - Member::Named(_) => false, - Member::Unnamed(_) => true, - } - } - } - fn field_pat(input: ParseStream) -> Result { let begin = input.fork(); let boxed: Option = input.parse()?; @@ -528,7 +533,7 @@ pub(crate) mod parsing { }?; if boxed.is_none() && by_ref.is_none() && mutability.is_none() && input.peek(Token![:]) - || member.is_unnamed() + || !member.is_named() { return Ok(FieldPat { attrs: Vec::new(), @@ -856,6 +861,15 @@ mod printing { tokens.append_all(self.attrs.outer()); self.paren_token.surround(tokens, |tokens| { self.elems.to_tokens(tokens); + // If there is only one element, a trailing comma is needed to + // distinguish PatTuple from PatParen, unless this is `(..)` + // which is a tuple pattern even without comma. + if self.elems.len() == 1 + && !self.elems.trailing_punct() + && !matches!(self.elems[0], Pat::Rest { .. }) + { + ::default().to_tokens(tokens); + } }); } } diff --git a/vendor/syn/src/path.rs b/vendor/syn/src/path.rs index b9d96e669..975154a31 100644 --- a/vendor/syn/src/path.rs +++ b/vendor/syn/src/path.rs @@ -277,7 +277,7 @@ ast_struct! { pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; + use crate::ext::IdentExt as _; use crate::parse::{Parse, ParseStream, Result}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] @@ -424,7 +424,10 @@ pub(crate) mod parsing { Self::do_parse(Some(colon2_token), input) } - fn do_parse(colon2_token: Option, input: ParseStream) -> Result { + pub(crate) fn do_parse( + colon2_token: Option, + input: ParseStream, + ) -> Result { Ok(AngleBracketedGenericArguments { colon2_token, lt_token: input.parse()?, diff --git a/vendor/syn/src/restriction.rs b/vendor/syn/src/restriction.rs index 97c7f5ae3..e66b17f3b 100644 --- a/vendor/syn/src/restriction.rs +++ b/vendor/syn/src/restriction.rs @@ -58,8 +58,8 @@ ast_enum! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; - use crate::parse::discouraged::Speculative; + use crate::ext::IdentExt as _; + use crate::parse::discouraged::Speculative as _; use crate::parse::{Parse, ParseStream, Result}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] diff --git a/vendor/syn/src/stmt.rs b/vendor/syn/src/stmt.rs index fb67feccb..b6d0664be 100644 --- a/vendor/syn/src/stmt.rs +++ b/vendor/syn/src/stmt.rs @@ -75,7 +75,7 @@ ast_struct! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::parse::discouraged::Speculative; + use crate::parse::discouraged::Speculative as _; use crate::parse::{Parse, ParseStream, Result}; use proc_macro2::TokenStream; @@ -200,7 +200,7 @@ pub(crate) mod parsing { } } - if input.peek(Token![let]) { + if input.peek(Token![let]) && !input.peek(token::Group) { stmt_local(input, attrs).map(Stmt::Local) } else if input.peek(Token![pub]) || input.peek(Token![crate]) && !input.peek2(Token![::]) diff --git a/vendor/syn/src/ty.rs b/vendor/syn/src/ty.rs index 0f41fe4fa..3213e7f3b 100644 --- a/vendor/syn/src/ty.rs +++ b/vendor/syn/src/ty.rs @@ -64,12 +64,13 @@ ast_enum_of_structs! { // For testing exhaustiveness in downstream code, use the following idiom: // // match ty { + // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] + // // Type::Array(ty) => {...} // Type::BareFn(ty) => {...} // ... // Type::Verbatim(ty) => {...} // - // #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))] // _ => { /* some sane fallback */ } // } // @@ -264,7 +265,7 @@ ast_enum! { #[cfg(feature = "parsing")] pub(crate) mod parsing { use super::*; - use crate::ext::IdentExt; + use crate::ext::IdentExt as _; use crate::parse::{Parse, ParseStream, Result}; use crate::path; use proc_macro2::Span; diff --git a/vendor/syn/tests/common/eq.rs b/vendor/syn/tests/common/eq.rs index 8e334c330..8ecbe46a3 100644 --- a/vendor/syn/tests/common/eq.rs +++ b/vendor/syn/tests/common/eq.rs @@ -13,7 +13,6 @@ use rustc_ast::ast::Arm; use rustc_ast::ast::AssocConstraint; use rustc_ast::ast::AssocConstraintKind; use rustc_ast::ast::AssocItemKind; -use rustc_ast::ast::Async; use rustc_ast::ast::AttrArgs; use rustc_ast::ast::AttrArgsEq; use rustc_ast::ast::AttrId; @@ -27,6 +26,7 @@ use rustc_ast::ast::BindingAnnotation; use rustc_ast::ast::Block; use rustc_ast::ast::BlockCheckMode; use rustc_ast::ast::BorrowKind; +use rustc_ast::ast::BoundConstness; use rustc_ast::ast::BoundPolarity; use rustc_ast::ast::ByRef; use rustc_ast::ast::CaptureBy; @@ -34,6 +34,7 @@ use rustc_ast::ast::Closure; use rustc_ast::ast::ClosureBinder; use rustc_ast::ast::Const; use rustc_ast::ast::ConstItem; +use rustc_ast::ast::CoroutineKind; use rustc_ast::ast::Crate; use rustc_ast::ast::Defaultness; use rustc_ast::ast::DelimArgs; @@ -49,6 +50,7 @@ use rustc_ast::ast::FnDecl; use rustc_ast::ast::FnHeader; use rustc_ast::ast::FnRetTy; use rustc_ast::ast::FnSig; +use rustc_ast::ast::ForLoopKind; use rustc_ast::ast::ForeignItemKind; use rustc_ast::ast::ForeignMod; use rustc_ast::ast::FormatAlignment; @@ -109,6 +111,7 @@ use rustc_ast::ast::Param; use rustc_ast::ast::ParenthesizedArgs; use rustc_ast::ast::Pat; use rustc_ast::ast::PatField; +use rustc_ast::ast::PatFieldsRest; use rustc_ast::ast::PatKind; use rustc_ast::ast::Path; use rustc_ast::ast::PathSegment; @@ -126,7 +129,7 @@ use rustc_ast::ast::StructExpr; use rustc_ast::ast::StructRest; use rustc_ast::ast::Term; use rustc_ast::ast::Trait; -use rustc_ast::ast::TraitBoundModifier; +use rustc_ast::ast::TraitBoundModifiers; use rustc_ast::ast::TraitObjectSyntax; use rustc_ast::ast::TraitRef; use rustc_ast::ast::Ty; @@ -151,8 +154,8 @@ use rustc_ast::ast::WhereRegionPredicate; use rustc_ast::ptr::P; use rustc_ast::token::{self, CommentKind, Delimiter, Lit, Nonterminal, Token, TokenKind}; use rustc_ast::tokenstream::{ - AttrTokenStream, AttrTokenTree, AttributesData, DelimSpan, LazyAttrTokenStream, Spacing, - TokenStream, TokenTree, + AttrTokenStream, AttrTokenTree, AttributesData, DelimSpacing, DelimSpan, LazyAttrTokenStream, + Spacing, TokenStream, TokenTree, }; use rustc_data_structures::sync::Lrc; use rustc_span::source_map::Spanned; @@ -457,17 +460,18 @@ spanless_eq_struct!(AttributesData; attrs tokens); spanless_eq_struct!(BareFnTy; unsafety ext generic_params decl decl_span); spanless_eq_struct!(BindingAnnotation; 0 1); spanless_eq_struct!(Block; stmts id rules span tokens could_be_bare_literal); -spanless_eq_struct!(Closure; binder capture_clause constness asyncness movability fn_decl body !fn_decl_span !fn_arg_span); +spanless_eq_struct!(Closure; binder capture_clause constness coroutine_kind movability fn_decl body !fn_decl_span !fn_arg_span); spanless_eq_struct!(ConstItem; defaultness generics ty expr); spanless_eq_struct!(Crate; attrs items spans id is_placeholder); spanless_eq_struct!(DelimArgs; dspan delim tokens); +spanless_eq_struct!(DelimSpacing; open close); spanless_eq_struct!(EnumDef; variants); spanless_eq_struct!(Expr; id kind span attrs !tokens); spanless_eq_struct!(ExprField; attrs id span ident expr is_shorthand is_placeholder); spanless_eq_struct!(FieldDef; attrs id span vis ident ty is_placeholder); spanless_eq_struct!(Fn; defaultness generics sig body); spanless_eq_struct!(FnDecl; inputs output); -spanless_eq_struct!(FnHeader; constness asyncness unsafety ext); +spanless_eq_struct!(FnHeader; constness coroutine_kind unsafety ext); spanless_eq_struct!(FnSig; header decl span); spanless_eq_struct!(ForeignMod; unsafety abi items); spanless_eq_struct!(FormatArgPosition; index kind span); @@ -506,6 +510,7 @@ spanless_eq_struct!(StrLit; symbol suffix symbol_unescaped style span); spanless_eq_struct!(StructExpr; qself path fields rest); spanless_eq_struct!(Token; kind span); spanless_eq_struct!(Trait; unsafety is_auto generics bounds items); +spanless_eq_struct!(TraitBoundModifiers; constness polarity); spanless_eq_struct!(TraitRef; path ref_id); spanless_eq_struct!(Ty; id kind span tokens); spanless_eq_struct!(TyAlias; defaultness generics where_clauses !where_predicates_split bounds ty); @@ -520,23 +525,24 @@ spanless_eq_struct!(WhereRegionPredicate; span lifetime bounds); spanless_eq_enum!(AngleBracketedArg; Arg(0) Constraint(0)); spanless_eq_enum!(AssocConstraintKind; Equality(term) Bound(bounds)); spanless_eq_enum!(AssocItemKind; Const(0) Fn(0) Type(0) MacCall(0)); -spanless_eq_enum!(Async; Yes(span closure_id return_impl_trait_id) No); spanless_eq_enum!(AttrArgs; Empty Delimited(0) Eq(0 1)); spanless_eq_enum!(AttrArgsEq; Ast(0) Hir(0)); spanless_eq_enum!(AttrStyle; Outer Inner); -spanless_eq_enum!(AttrTokenTree; Token(0 1) Delimited(0 1 2) Attributes(0)); +spanless_eq_enum!(AttrTokenTree; Token(0 1) Delimited(0 1 2 3) Attributes(0)); spanless_eq_enum!(BinOpKind; Add Sub Mul Div Rem And Or BitXor BitAnd BitOr Shl Shr Eq Lt Le Ne Ge Gt); spanless_eq_enum!(BlockCheckMode; Default Unsafe(0)); spanless_eq_enum!(BorrowKind; Ref Raw); +spanless_eq_enum!(BoundConstness; Never Always(0) Maybe(0)); spanless_eq_enum!(BoundPolarity; Positive Negative(0) Maybe(0)); spanless_eq_enum!(ByRef; Yes No); -spanless_eq_enum!(CaptureBy; Value Ref); +spanless_eq_enum!(CaptureBy; Value(move_kw) Ref); spanless_eq_enum!(ClosureBinder; NotPresent For(span generic_params)); spanless_eq_enum!(Const; Yes(0) No); spanless_eq_enum!(Defaultness; Default(0) Final); spanless_eq_enum!(Extern; None Implicit(0) Explicit(0 1)); spanless_eq_enum!(FloatTy; F32 F64); spanless_eq_enum!(FnRetTy; Default(0) Ty(0)); +spanless_eq_enum!(ForLoopKind; For ForAwait); spanless_eq_enum!(ForeignItemKind; Static(0 1 2) Fn(0) TyAlias(0) MacCall(0)); spanless_eq_enum!(FormatAlignment; Left Right Center); spanless_eq_enum!(FormatArgPositionKind; Implicit Number Named); @@ -546,7 +552,7 @@ spanless_eq_enum!(FormatCount; Literal(0) Argument(0)); spanless_eq_enum!(FormatDebugHex; Lower Upper); spanless_eq_enum!(FormatSign; Plus Minus); spanless_eq_enum!(FormatTrait; Display Debug LowerExp UpperExp Octal Pointer Binary LowerHex UpperHex); -spanless_eq_enum!(GenBlockKind; Async Gen); +spanless_eq_enum!(GenBlockKind; Async Gen AsyncGen); spanless_eq_enum!(GenericArg; Lifetime(0) Type(0) Const(0)); spanless_eq_enum!(GenericArgs; AngleBracketed(0) Parenthesized(0)); spanless_eq_enum!(GenericBound; Trait(0 1) Outlives(0)); @@ -564,31 +570,34 @@ spanless_eq_enum!(MacStmtStyle; Semicolon Braces NoBraces); spanless_eq_enum!(ModKind; Loaded(0 1 2) Unloaded); spanless_eq_enum!(Movability; Static Movable); spanless_eq_enum!(Mutability; Mut Not); +spanless_eq_enum!(PatFieldsRest; Rest None); spanless_eq_enum!(RangeEnd; Included(0) Excluded); spanless_eq_enum!(RangeLimits; HalfOpen Closed); spanless_eq_enum!(StmtKind; Local(0) Item(0) Expr(0) Semi(0) Empty MacCall(0)); spanless_eq_enum!(StrStyle; Cooked Raw(0)); spanless_eq_enum!(StructRest; Base(0) Rest(0) None); spanless_eq_enum!(Term; Ty(0) Const(0)); -spanless_eq_enum!(TokenTree; Token(0 1) Delimited(0 1 2)); -spanless_eq_enum!(TraitBoundModifier; None Negative Maybe MaybeConst MaybeConstNegative MaybeConstMaybe); +spanless_eq_enum!(TokenTree; Token(0 1) Delimited(0 1 2 3)); spanless_eq_enum!(TraitObjectSyntax; Dyn DynStar None); spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128); spanless_eq_enum!(UnOp; Deref Not Neg); spanless_eq_enum!(Unsafe; Yes(0) No); spanless_eq_enum!(UnsafeSource; CompilerGenerated UserProvided); spanless_eq_enum!(UseTreeKind; Simple(0) Nested(0) Glob); -spanless_eq_enum!(VariantData; Struct(0 1) Tuple(0 1) Unit(0)); +spanless_eq_enum!(VariantData; Struct(fields recovered) Tuple(0 1) Unit(0)); spanless_eq_enum!(VisibilityKind; Public Restricted(path id shorthand) Inherited); spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredicate(0)); +spanless_eq_enum!(CoroutineKind; Async(span closure_id return_impl_trait_id) + Gen(span closure_id return_impl_trait_id) + AsyncGen(span closure_id return_impl_trait_id)); spanless_eq_enum!(ExprKind; Array(0) ConstBlock(0) Call(0 1) MethodCall(0) Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) Type(0 1) Let(0 1 2 3) - If(0 1 2) While(0 1 2) ForLoop(0 1 2 3) Loop(0 1 2) Match(0 1) Closure(0) - Block(0 1) Gen(0 1 2) Await(0 1) TryBlock(0) Assign(0 1 2) AssignOp(0 1 2) - Field(0 1) Index(0 1 2) Underscore Range(0 1 2) Path(0 1) AddrOf(0 1 2) - Break(0 1) Continue(0) Ret(0) InlineAsm(0) OffsetOf(0 1) MacCall(0) - Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) Yeet(0) Become(0) - IncludedBytes(0) FormatArgs(0) Err); + If(0 1 2) While(0 1 2) ForLoop(pat iter body label kind) Loop(0 1 2) + Match(0 1) Closure(0) Block(0 1) Gen(0 1 2) Await(0 1) TryBlock(0) + Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1 2) Underscore + Range(0 1 2) Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0) + InlineAsm(0) OffsetOf(0 1) MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0) + Yield(0) Yeet(0) Become(0) IncludedBytes(0) FormatArgs(0) Err); spanless_eq_enum!(InlineAsmOperand; In(reg expr) Out(reg late expr) InOut(reg late expr) SplitInOut(reg late in_expr out_expr) Const(anon_const) Sym(sym)); @@ -599,7 +608,7 @@ spanless_eq_enum!(LitKind; Str(0 1) ByteStr(0 1) CStr(0 1) Byte(0) Char(0) Int(0 1) Float(0 1) Bool(0) Err); spanless_eq_enum!(PatKind; Wild Ident(0 1 2) Struct(0 1 2 3) TupleStruct(0 1 2) Or(0) Path(0 1) Tuple(0) Box(0) Ref(0 1) Lit(0) Range(0 1 2) Slice(0) Rest - Paren(0) MacCall(0)); + Never Paren(0) MacCall(0)); spanless_eq_enum!(TyKind; Slice(0) Array(0 1) Ptr(0) Ref(0 1) BareFn(0) Never Tup(0) AnonStruct(0) AnonUnion(0) Path(0 1) TraitObject(0 1) ImplTrait(0 1) Paren(0) Typeof(0) Infer ImplicitSelf MacCall(0) Err CVarArgs); @@ -655,12 +664,15 @@ impl SpanlessEq for TokenKind { _ => false, }, (TokenKind::Interpolated(this), TokenKind::Interpolated(other)) => { - match (this.as_ref(), other.as_ref()) { - (Nonterminal::NtExpr(this), Nonterminal::NtExpr(other)) => { - SpanlessEq::eq(this, other) + let (this, this_span) = this.as_ref(); + let (other, other_span) = other.as_ref(); + SpanlessEq::eq(this_span, other_span) + && match (this, other) { + (Nonterminal::NtExpr(this), Nonterminal::NtExpr(other)) => { + SpanlessEq::eq(this, other) + } + _ => this == other, } - _ => this == other, - } } _ => self == other, } @@ -725,7 +737,7 @@ fn doc_comment<'a>( } } let stream = match trees.next() { - Some(TokenTree::Delimited(_span, Delimiter::Bracket, stream)) => stream, + Some(TokenTree::Delimited(_span, _spacing, Delimiter::Bracket, stream)) => stream, _ => return false, }; let mut trees = stream.trees(); @@ -769,7 +781,7 @@ fn is_escaped_literal_token(token: &Token, unescaped: Symbol) -> bool { Token { kind: TokenKind::Interpolated(nonterminal), span: _, - } => match nonterminal.as_ref() { + } => match &nonterminal.0 { Nonterminal::NtExpr(expr) => match &expr.kind { ExprKind::Lit(lit) => is_escaped_lit(lit, unescaped), _ => false, diff --git a/vendor/syn/tests/debug/gen.rs b/vendor/syn/tests/debug/gen.rs index 3f92598d7..1548d8b6b 100644 --- a/vendor/syn/tests/debug/gen.rs +++ b/vendor/syn/tests/debug/gen.rs @@ -301,9 +301,7 @@ impl Debug for Lite { impl Debug for Lite { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { let mut formatter = formatter.debug_struct("Block"); - if !self.value.stmts.is_empty() { - formatter.field("stmts", Lite(&self.value.stmts)); - } + formatter.field("stmts", Lite(&self.value.stmts)); formatter.finish() } } @@ -4662,3 +4660,498 @@ impl Debug for Lite { } } } +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![abstract]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![&]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![&&]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![&=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![as]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![async]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![@]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![auto]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![await]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![become]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![box]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![break]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![^]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![^=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![:]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![,]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![const]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![continue]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![crate]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![default]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![do]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![$]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![.]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![..]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![...]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![..=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![dyn]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![else]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![enum]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![==]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![extern]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![=>]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![final]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![fn]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![for]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![>=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![>]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![if]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![impl]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![in]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![<-]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![<=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![let]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![loop]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![<]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![macro]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![match]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![-]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![-=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![mod]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![move]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![mut]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![!=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![!]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![|]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![|=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![||]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![override]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![::]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![%]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![%=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![+]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![+=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![#]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![priv]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![pub]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![?]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![->]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![ref]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![return]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![Self]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![self]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![;]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![<<]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![<<=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![>>]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![>>=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![/]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![/=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![*]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![*=]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![static]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![struct]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![super]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![~]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![trait]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![try]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![type]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![typeof]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![_]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![union]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![unsafe]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![unsized]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![use]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![virtual]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![where]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![while]") + } +} +impl Debug for Lite { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Token![yield]") + } +} diff --git a/vendor/syn/tests/debug/mod.rs b/vendor/syn/tests/debug/mod.rs index caf9eed80..c9925a6d5 100644 --- a/vendor/syn/tests/debug/mod.rs +++ b/vendor/syn/tests/debug/mod.rs @@ -115,12 +115,16 @@ where impl Debug for Lite> where Lite: Debug, + Lite

: Debug, { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter - .debug_list() - .entries(self.value.iter().map(Lite)) - .finish() + let mut list = formatter.debug_list(); + for pair in self.pairs() { + let (node, punct) = pair.into_tuple(); + list.entry(Lite(node)); + list.entries(punct.map(Lite)); + } + list.finish() } } diff --git a/vendor/syn/tests/macros/mod.rs b/vendor/syn/tests/macros/mod.rs index 3bfbe0389..d27c39133 100644 --- a/vendor/syn/tests/macros/mod.rs +++ b/vendor/syn/tests/macros/mod.rs @@ -3,7 +3,8 @@ #[path = "../debug/mod.rs"] pub mod debug; -use syn::parse::{Parse, Result}; +use std::str::FromStr; +use syn::parse::Result; macro_rules! errorf { ($($tt:tt)*) => {{ @@ -35,7 +36,8 @@ macro_rules! snapshot { macro_rules! snapshot_impl { (($expr:ident) as $t:ty, @$snapshot:literal) => { - let $expr = crate::macros::Tokens::parse::<$t>($expr).unwrap(); + let tokens = crate::macros::TryIntoTokens::try_into_tokens($expr).unwrap(); + let $expr: $t = syn::parse_quote!(#tokens); let debug = crate::macros::debug::Lite(&$expr); if !cfg!(miri) { #[allow(clippy::needless_raw_string_hashes)] // https://github.com/mitsuhiko/insta/issues/389 @@ -45,7 +47,8 @@ macro_rules! snapshot_impl { } }; (($($expr:tt)*) as $t:ty, @$snapshot:literal) => {{ - let syntax_tree = crate::macros::Tokens::parse::<$t>($($expr)*).unwrap(); + let tokens = crate::macros::TryIntoTokens::try_into_tokens($($expr)*).unwrap(); + let syntax_tree: $t = syn::parse_quote!(#tokens); let debug = crate::macros::debug::Lite(&syntax_tree); if !cfg!(miri) { #[allow(clippy::needless_raw_string_hashes)] @@ -71,18 +74,19 @@ macro_rules! snapshot_impl { }; } -pub trait Tokens { - fn parse(self) -> Result; +pub trait TryIntoTokens { + fn try_into_tokens(self) -> Result; } -impl<'a> Tokens for &'a str { - fn parse(self) -> Result { - syn::parse_str(self) +impl<'a> TryIntoTokens for &'a str { + fn try_into_tokens(self) -> Result { + let tokens = proc_macro2::TokenStream::from_str(self)?; + Ok(tokens) } } -impl Tokens for proc_macro2::TokenStream { - fn parse(self) -> Result { - syn::parse2(self) +impl TryIntoTokens for proc_macro2::TokenStream { + fn try_into_tokens(self) -> Result { + Ok(self) } } diff --git a/vendor/syn/tests/repo/mod.rs b/vendor/syn/tests/repo/mod.rs index 9d5dfa2f7..6aedd2ccd 100644 --- a/vendor/syn/tests/repo/mod.rs +++ b/vendor/syn/tests/repo/mod.rs @@ -13,7 +13,7 @@ use std::path::{Path, PathBuf}; use tar::Archive; use walkdir::{DirEntry, WalkDir}; -const REVISION: &str = "a2f5f9691b6ce64c1703feaf9363710dfd7a56cf"; +const REVISION: &str = "b10cfcd65fd7f7b1ab9beb34798b2108de003452"; #[rustfmt::skip] static EXCLUDE_FILES: &[&str] = &[ @@ -49,6 +49,7 @@ static EXCLUDE_FILES: &[&str] = &[ // TODO: gen blocks and functions // https://github.com/dtolnay/syn/issues/1526 + "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs", "tests/ui/coroutine/gen_block_is_iter.rs", "tests/ui/coroutine/gen_block_iterate.rs", diff --git a/vendor/syn/tests/test_asyncness.rs b/vendor/syn/tests/test_asyncness.rs index 6bc5a1637..996893449 100644 --- a/vendor/syn/tests/test_asyncness.rs +++ b/vendor/syn/tests/test_asyncness.rs @@ -18,7 +18,9 @@ fn test_async_fn() { generics: Generics, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, } "###); } @@ -32,7 +34,9 @@ fn test_async_closure() { asyncness: Some, output: ReturnType::Default, body: Expr::Block { - block: Block, + block: Block { + stmts: [], + }, }, } "###); diff --git a/vendor/syn/tests/test_derive_input.rs b/vendor/syn/tests/test_derive_input.rs index 3ec6aecbc..c3d31eb0e 100644 --- a/vendor/syn/tests/test_derive_input.rs +++ b/vendor/syn/tests/test_derive_input.rs @@ -78,6 +78,7 @@ fn test_struct() { }, }, }, + Token![,], Field { vis: Visibility::Public, ident: Some("attrs"), @@ -157,6 +158,7 @@ fn test_union() { colon_token: Some, ty: Type::Tuple, }, + Token![,], Field { vis: Visibility::Inherited, ident: Some("value"), @@ -232,6 +234,7 @@ fn test_enum() { GenericParam::Type(TypeParam { ident: "T", }), + Token![,], GenericParam::Type(TypeParam { ident: "E", }), @@ -259,6 +262,7 @@ fn test_enum() { ], }, }, + Token![,], Variant { ident: "Err", fields: Fields::Unnamed { @@ -278,6 +282,7 @@ fn test_enum() { ], }, }, + Token![,], Variant { ident: "Surprise", fields: Fields::Unit, @@ -285,6 +290,7 @@ fn test_enum() { lit: 0isize, }), }, + Token![,], Variant { ident: "ProcMacroHack", fields: Fields::Unit, @@ -294,6 +300,7 @@ fn test_enum() { Expr::Lit { lit: 0, }, + Token![,], Expr::Lit { lit: "data", }, @@ -363,6 +370,7 @@ fn test_attr_with_mod_style_path_with_self() { PathSegment { ident: "foo", }, + Token![::], PathSegment { ident: "self", }, @@ -386,6 +394,7 @@ fn test_attr_with_mod_style_path_with_self() { PathSegment { ident: "foo", }, + Token![::], PathSegment { ident: "self", }, @@ -426,6 +435,7 @@ fn test_pub_restricted() { PathSegment { ident: "m", }, + Token![::], PathSegment { ident: "n", }, @@ -589,6 +599,7 @@ fn test_fields_on_named_struct() { }, }, }, + Token![,], Field { vis: Visibility::Public, ident: Some("bar"), @@ -603,6 +614,7 @@ fn test_fields_on_named_struct() { }, }, }, + Token![,], ], }, }, @@ -674,6 +686,7 @@ fn test_fields_on_tuple_struct() { }, }, }, + Token![,], Field { vis: Visibility::Public, ty: Type::Path { @@ -751,6 +764,7 @@ fn test_ambiguous_crate() { PathSegment { ident: "crate", }, + Token![::], PathSegment { ident: "X", }, diff --git a/vendor/syn/tests/test_expr.rs b/vendor/syn/tests/test_expr.rs index 2574ea548..daf0d63c3 100644 --- a/vendor/syn/tests/test_expr.rs +++ b/vendor/syn/tests/test_expr.rs @@ -3,9 +3,10 @@ #[macro_use] mod macros; -use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree}; -use quote::quote; -use syn::{Expr, ExprRange, Stmt}; +use proc_macro2::{Delimiter, Group}; +use quote::{quote, ToTokens as _}; +use syn::punctuated::Punctuated; +use syn::{parse_quote, token, Expr, ExprRange, ExprTuple, Stmt, Token}; #[test] fn test_expr_parse() { @@ -100,10 +101,8 @@ fn test_tuple_multi_index() { #[test] fn test_macro_variable_func() { // mimics the token stream corresponding to `$fn()` - let tokens = TokenStream::from_iter(vec![ - TokenTree::Group(Group::new(Delimiter::None, quote! { f })), - TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), - ]); + let path = Group::new(Delimiter::None, quote!(f)); + let tokens = quote!(#path()); snapshot!(tokens as Expr, @r###" Expr::Call { @@ -121,12 +120,8 @@ fn test_macro_variable_func() { } "###); - let tokens = TokenStream::from_iter(vec![ - TokenTree::Punct(Punct::new('#', Spacing::Alone)), - TokenTree::Group(Group::new(Delimiter::Bracket, quote! { outside })), - TokenTree::Group(Group::new(Delimiter::None, quote! { #[inside] f })), - TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), - ]); + let path = Group::new(Delimiter::None, quote! { #[inside] f }); + let tokens = quote!(#[outside] #path()); snapshot!(tokens as Expr, @r###" Expr::Call { @@ -172,11 +167,8 @@ fn test_macro_variable_func() { #[test] fn test_macro_variable_macro() { // mimics the token stream corresponding to `$macro!()` - let tokens = TokenStream::from_iter(vec![ - TokenTree::Group(Group::new(Delimiter::None, quote! { m })), - TokenTree::Punct(Punct::new('!', Spacing::Alone)), - TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), - ]); + let mac = Group::new(Delimiter::None, quote!(m)); + let tokens = quote!(#mac!()); snapshot!(tokens as Expr, @r###" Expr::Macro { @@ -198,10 +190,8 @@ fn test_macro_variable_macro() { #[test] fn test_macro_variable_struct() { // mimics the token stream corresponding to `$struct {}` - let tokens = TokenStream::from_iter(vec![ - TokenTree::Group(Group::new(Delimiter::None, quote! { S })), - TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())), - ]); + let s = Group::new(Delimiter::None, quote! { S }); + let tokens = quote!(#s {}); snapshot!(tokens as Expr, @r###" Expr::Struct { @@ -216,23 +206,36 @@ fn test_macro_variable_struct() { "###); } +#[test] +fn test_macro_variable_unary() { + // mimics the token stream corresponding to `$expr.method()` where expr is `&self` + let inner = Group::new(Delimiter::None, quote!(&self)); + let tokens = quote!(#inner.method()); + snapshot!(tokens as Expr, @r###" + Expr::MethodCall { + receiver: Expr::Group { + expr: Expr::Reference { + expr: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "self", + }, + ], + }, + }, + }, + }, + method: "method", + } + "###); +} + #[test] fn test_macro_variable_match_arm() { // mimics the token stream corresponding to `match v { _ => $expr }` - let tokens = TokenStream::from_iter(vec![ - TokenTree::Ident(Ident::new("match", Span::call_site())), - TokenTree::Ident(Ident::new("v", Span::call_site())), - TokenTree::Group(Group::new( - Delimiter::Brace, - TokenStream::from_iter(vec![ - TokenTree::Punct(Punct::new('_', Spacing::Alone)), - TokenTree::Punct(Punct::new('=', Spacing::Joint)), - TokenTree::Punct(Punct::new('>', Spacing::Alone)), - TokenTree::Group(Group::new(Delimiter::None, quote! { #[a] () })), - ]), - )), - ]); - + let expr = Group::new(Delimiter::None, quote! { #[a] () }); + let tokens = quote!(match v { _ => #expr }); snapshot!(tokens as Expr, @r###" Expr::Match { expr: Expr::Path { @@ -267,6 +270,40 @@ fn test_macro_variable_match_arm() { ], } "###); + + let expr = Group::new(Delimiter::None, quote!(loop {} + 1)); + let tokens = quote!(match v { _ => #expr }); + snapshot!(tokens as Expr, @r###" + Expr::Match { + expr: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "v", + }, + ], + }, + }, + arms: [ + Arm { + pat: Pat::Wild, + body: Expr::Group { + expr: Expr::Binary { + left: Expr::Loop { + body: Block { + stmts: [], + }, + }, + op: BinOp::Add, + right: Expr::Lit { + lit: 1, + }, + }, + }, + }, + ], + } + "###); } // https://github.com/dtolnay/syn/issues/1019 @@ -339,3 +376,165 @@ fn test_ambiguous_label() { syn::parse2::(stmt).unwrap_err(); } } + +#[test] +fn test_extended_interpolated_path() { + let path = Group::new(Delimiter::None, quote!(a::b)); + + let tokens = quote!(if #path {}); + snapshot!(tokens as Expr, @r###" + Expr::If { + cond: Expr::Group { + expr: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "a", + }, + Token![::], + PathSegment { + ident: "b", + }, + ], + }, + }, + }, + then_branch: Block { + stmts: [], + }, + } + "###); + + let tokens = quote!(#path {}); + snapshot!(tokens as Expr, @r###" + Expr::Struct { + path: Path { + segments: [ + PathSegment { + ident: "a", + }, + Token![::], + PathSegment { + ident: "b", + }, + ], + }, + } + "###); + + let tokens = quote!(#path :: c); + snapshot!(tokens as Expr, @r###" + Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "a", + }, + Token![::], + PathSegment { + ident: "b", + }, + Token![::], + PathSegment { + ident: "c", + }, + ], + }, + } + "###); + + let nested = Group::new(Delimiter::None, quote!(a::b || true)); + let tokens = quote!(if #nested && false {}); + snapshot!(tokens as Expr, @r###" + Expr::If { + cond: Expr::Binary { + left: Expr::Group { + expr: Expr::Binary { + left: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "a", + }, + Token![::], + PathSegment { + ident: "b", + }, + ], + }, + }, + op: BinOp::Or, + right: Expr::Lit { + lit: Lit::Bool { + value: true, + }, + }, + }, + }, + op: BinOp::And, + right: Expr::Lit { + lit: Lit::Bool { + value: false, + }, + }, + }, + then_branch: Block { + stmts: [], + }, + } + "###); +} + +#[test] +fn test_tuple_comma() { + let mut expr = ExprTuple { + attrs: Vec::new(), + paren_token: token::Paren::default(), + elems: Punctuated::new(), + }; + snapshot!(expr.to_token_stream() as Expr, @"Expr::Tuple"); + + expr.elems.push_value(parse_quote!(continue)); + // Must not parse to Expr::Paren + snapshot!(expr.to_token_stream() as Expr, @r###" + Expr::Tuple { + elems: [ + Expr::Continue, + Token![,], + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Expr, @r###" + Expr::Tuple { + elems: [ + Expr::Continue, + Token![,], + ], + } + "###); + + expr.elems.push_value(parse_quote!(continue)); + snapshot!(expr.to_token_stream() as Expr, @r###" + Expr::Tuple { + elems: [ + Expr::Continue, + Token![,], + Expr::Continue, + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Expr, @r###" + Expr::Tuple { + elems: [ + Expr::Continue, + Token![,], + Expr::Continue, + Token![,], + ], + } + "###); +} diff --git a/vendor/syn/tests/test_generics.rs b/vendor/syn/tests/test_generics.rs index 51119adc8..3faf0dba5 100644 --- a/vendor/syn/tests/test_generics.rs +++ b/vendor/syn/tests/test_generics.rs @@ -28,6 +28,7 @@ fn test_split_for_impl() { ident: "a", }, }), + Token![,], GenericParam::Lifetime(LifetimeParam { lifetime: Lifetime { ident: "b", @@ -39,6 +40,7 @@ fn test_split_for_impl() { }, ], }), + Token![,], GenericParam::Type(TypeParam { attrs: [ Attribute { @@ -227,6 +229,7 @@ fn test_fn_precedence_in_where_clause() { ], }, }), + Token![+], TypeParamBound::Trait(TraitBound { path: Path { segments: [ @@ -238,12 +241,15 @@ fn test_fn_precedence_in_where_clause() { }), ], }), + Token![,], ], }), }, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, } "###); diff --git a/vendor/syn/tests/test_item.rs b/vendor/syn/tests/test_item.rs index 9b0e1c9ff..db9e3ab51 100644 --- a/vendor/syn/tests/test_item.rs +++ b/vendor/syn/tests/test_item.rs @@ -38,7 +38,9 @@ fn test_macro_variable_attr() { generics: Generics, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, } "###); } @@ -228,6 +230,7 @@ fn test_supertraits() { ], }, }), + Token![+], ], } "###); @@ -316,11 +319,14 @@ fn test_impl_trait_trailing_plus() { ], }, }), + Token![+], ], }, ), }, - block: Block, + block: Block { + stmts: [], + }, } "###); } diff --git a/vendor/syn/tests/test_meta.rs b/vendor/syn/tests/test_meta.rs index 91a980700..d991c38e4 100644 --- a/vendor/syn/tests/test_meta.rs +++ b/vendor/syn/tests/test_meta.rs @@ -144,6 +144,7 @@ fn test_parse_path() { PathSegment { ident: "serde", }, + Token![::], PathSegment { ident: "Serialize", }, diff --git a/vendor/syn/tests/test_parse_buffer.rs b/vendor/syn/tests/test_parse_buffer.rs index f2ca59c75..2205b50b2 100644 --- a/vendor/syn/tests/test_parse_buffer.rs +++ b/vendor/syn/tests/test_parse_buffer.rs @@ -1,7 +1,8 @@ #![allow(clippy::non_ascii_literal)] use proc_macro2::{Delimiter, Group, Punct, Spacing, TokenStream, TokenTree}; -use syn::parse::{discouraged::Speculative, Parse, ParseStream, Parser, Result}; +use syn::parse::discouraged::Speculative as _; +use syn::parse::{Parse, ParseStream, Parser, Result}; use syn::{parenthesized, Token}; #[test] diff --git a/vendor/syn/tests/test_parse_quote.rs b/vendor/syn/tests/test_parse_quote.rs new file mode 100644 index 000000000..73aae709a --- /dev/null +++ b/vendor/syn/tests/test_parse_quote.rs @@ -0,0 +1,164 @@ +#[macro_use] +mod macros; + +use syn::punctuated::Punctuated; +use syn::{parse_quote, Attribute, Field, Lit, Pat, Stmt, Token}; + +#[test] +fn test_attribute() { + let attr: Attribute = parse_quote!(#[test]); + snapshot!(attr, @r###" + Attribute { + style: AttrStyle::Outer, + meta: Meta::Path { + segments: [ + PathSegment { + ident: "test", + }, + ], + }, + } + "###); + + let attr: Attribute = parse_quote!(#![no_std]); + snapshot!(attr, @r###" + Attribute { + style: AttrStyle::Inner, + meta: Meta::Path { + segments: [ + PathSegment { + ident: "no_std", + }, + ], + }, + } + "###); +} + +#[test] +fn test_field() { + let field: Field = parse_quote!(pub enabled: bool); + snapshot!(field, @r###" + Field { + vis: Visibility::Public, + ident: Some("enabled"), + colon_token: Some, + ty: Type::Path { + path: Path { + segments: [ + PathSegment { + ident: "bool", + }, + ], + }, + }, + } + "###); + + let field: Field = parse_quote!(primitive::bool); + snapshot!(field, @r###" + Field { + vis: Visibility::Inherited, + ty: Type::Path { + path: Path { + segments: [ + PathSegment { + ident: "primitive", + }, + Token![::], + PathSegment { + ident: "bool", + }, + ], + }, + }, + } + "###); +} + +#[test] +fn test_pat() { + let pat: Pat = parse_quote!(Some(false) | None); + snapshot!(&pat, @r###" + Pat::Or { + cases: [ + Pat::TupleStruct { + path: Path { + segments: [ + PathSegment { + ident: "Some", + }, + ], + }, + elems: [ + Pat::Lit(ExprLit { + lit: Lit::Bool { + value: false, + }, + }), + ], + }, + Token![|], + Pat::Ident { + ident: "None", + }, + ], + } + "###); + + let boxed_pat: Box = parse_quote!(Some(false) | None); + assert_eq!(*boxed_pat, pat); +} + +#[test] +fn test_punctuated() { + let punctuated: Punctuated = parse_quote!(true | true); + snapshot!(punctuated, @r###" + [ + Lit::Bool { + value: true, + }, + Token![|], + Lit::Bool { + value: true, + }, + ] + "###); + + let punctuated: Punctuated = parse_quote!(true | true |); + snapshot!(punctuated, @r###" + [ + Lit::Bool { + value: true, + }, + Token![|], + Lit::Bool { + value: true, + }, + Token![|], + ] + "###); +} + +#[test] +fn test_vec_stmt() { + let stmts: Vec = parse_quote! { + let _; + true + }; + snapshot!(stmts, @r###" + [ + Stmt::Local { + pat: Pat::Wild, + }, + Stmt::Expr( + Expr::Lit { + lit: Lit::Bool { + value: true, + }, + }, + None, + ), + ] + "###); +} diff --git a/vendor/syn/tests/test_parse_stream.rs b/vendor/syn/tests/test_parse_stream.rs index 2265dfe87..6e4a5a505 100644 --- a/vendor/syn/tests/test_parse_stream.rs +++ b/vendor/syn/tests/test_parse_stream.rs @@ -1,6 +1,6 @@ #![allow(clippy::let_underscore_untyped)] -use syn::ext::IdentExt; +use syn::ext::IdentExt as _; use syn::parse::ParseStream; use syn::{Ident, Token}; diff --git a/vendor/syn/tests/test_pat.rs b/vendor/syn/tests/test_pat.rs index cab7aa7f6..7b5f8b025 100644 --- a/vendor/syn/tests/test_pat.rs +++ b/vendor/syn/tests/test_pat.rs @@ -4,9 +4,10 @@ mod macros; use proc_macro2::{Delimiter, Group, TokenStream, TokenTree}; -use quote::quote; +use quote::{quote, ToTokens as _}; use syn::parse::Parser; -use syn::{Item, Pat, Stmt}; +use syn::punctuated::Punctuated; +use syn::{parse_quote, token, Item, Pat, PatTuple, Stmt, Token}; #[test] fn test_pat_ident() { @@ -95,3 +96,57 @@ fn test_ranges() { Pat::parse_single.parse_str("[_, (..=hi), _]").unwrap(); Pat::parse_single.parse_str("[_, lo..=hi, _]").unwrap(); } + +#[test] +fn test_tuple_comma() { + let mut expr = PatTuple { + attrs: Vec::new(), + paren_token: token::Paren::default(), + elems: Punctuated::new(), + }; + snapshot!(expr.to_token_stream() as Pat, @"Pat::Tuple"); + + expr.elems.push_value(parse_quote!(_)); + // Must not parse to Pat::Paren + snapshot!(expr.to_token_stream() as Pat, @r###" + Pat::Tuple { + elems: [ + Pat::Wild, + Token![,], + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Pat, @r###" + Pat::Tuple { + elems: [ + Pat::Wild, + Token![,], + ], + } + "###); + + expr.elems.push_value(parse_quote!(_)); + snapshot!(expr.to_token_stream() as Pat, @r###" + Pat::Tuple { + elems: [ + Pat::Wild, + Token![,], + Pat::Wild, + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Pat, @r###" + Pat::Tuple { + elems: [ + Pat::Wild, + Token![,], + Pat::Wild, + Token![,], + ], + } + "###); +} diff --git a/vendor/syn/tests/test_path.rs b/vendor/syn/tests/test_path.rs index 6aded74e6..2873441ab 100644 --- a/vendor/syn/tests/test_path.rs +++ b/vendor/syn/tests/test_path.rs @@ -24,6 +24,7 @@ fn parse_interpolated_leading_component() { PathSegment { ident: "first", }, + Token![::], PathSegment { ident: "rest", }, @@ -39,6 +40,7 @@ fn parse_interpolated_leading_component() { PathSegment { ident: "first", }, + Token![::], PathSegment { ident: "rest", }, diff --git a/vendor/syn/tests/test_precedence.rs b/vendor/syn/tests/test_precedence.rs index bf0510bb3..026bece50 100644 --- a/vendor/syn/tests/test_precedence.rs +++ b/vendor/syn/tests/test_precedence.rs @@ -1,8 +1,25 @@ +//! This test does the following for every file in the rust-lang/rust repo: +//! +//! 1. Parse the file using syn into a syn::File. +//! 2. Extract every syn::Expr from the file. +//! 3. Print each expr to a string of source code. +//! 4. Parse the source code using librustc_parse into a rustc_ast::Expr. +//! 5. For both the syn::Expr and rustc_ast::Expr, crawl the syntax tree to +//! insert parentheses surrounding every subexpression. +//! 6. Serialize the fully parenthesized syn::Expr to a string of source code. +//! 7. Parse the fully parenthesized source code using librustc_parse. +//! 8. Compare the rustc_ast::Expr resulting from parenthesizing using rustc +//! data structures vs syn data structures, ignoring spans. If they agree, +//! rustc's parser and syn's parser have identical handling of expression +//! precedence. + #![cfg(not(syn_disable_nightly_tests))] #![cfg(not(miri))] #![recursion_limit = "1024"] #![feature(rustc_private)] #![allow( + clippy::blocks_in_conditions, + clippy::doc_markdown, clippy::explicit_deref_methods, clippy::let_underscore_untyped, clippy::manual_assert, @@ -13,18 +30,6 @@ clippy::uninlined_format_args )] -//! The tests in this module do the following: -//! -//! 1. Parse a given expression in both `syn` and `librustc`. -//! 2. Fold over the expression adding brackets around each subexpression (with -//! some complications - see the `syn_brackets` and `librustc_brackets` -//! methods). -//! 3. Serialize the `syn` expression back into a string, and re-parse it with -//! `librustc`. -//! 4. Respan all of the expressions, replacing the spans with the default -//! spans. -//! 5. Compare the expressions with one another, if they are not equal fail. - extern crate rustc_ast; extern crate rustc_ast_pretty; extern crate rustc_data_structures; @@ -35,8 +40,7 @@ extern crate thin_vec; use crate::common::eq::SpanlessEq; use crate::common::parse; -use quote::quote; -use regex::Regex; +use quote::ToTokens; use rustc_ast::ast; use rustc_ast::ptr::P; use rustc_ast_pretty::pprust; @@ -66,12 +70,8 @@ fn test_rustc_precedence() { let passed = AtomicUsize::new(0); let failed = AtomicUsize::new(0); - // 2018 edition is hard - let edition_regex = Regex::new(r"\b(async|try)[!(]").unwrap(); - repo::for_each_rust_file(|path| { let content = fs::read_to_string(path).unwrap(); - let content = edition_regex.replace_all(&content, "_$0"); let (l_passed, l_failed) = match syn::parse_file(&content) { Ok(file) => { @@ -117,41 +117,65 @@ fn test_expressions(path: &Path, edition: Edition, exprs: Vec) -> (us rustc_span::create_session_if_not_set_then(edition, |_| { for expr in exprs { - let raw = quote!(#expr).to_string(); - - let librustc_ast = if let Some(e) = librustc_parse_and_rewrite(&raw) { - e - } else { - failed += 1; - errorf!("\nFAIL {} - librustc failed to parse raw\n", path.display()); - continue; - }; - - let syn_expr = syn_brackets(expr); - let syn_ast = if let Some(e) = parse::librustc_expr("e!(#syn_expr).to_string()) { + let source_code = expr.to_token_stream().to_string(); + let librustc_ast = if let Some(e) = librustc_parse_and_rewrite(&source_code) { e } else { failed += 1; errorf!( - "\nFAIL {} - librustc failed to parse bracketed\n", + "\nFAIL {} - librustc failed to parse original\n", path.display(), ); continue; }; - if SpanlessEq::eq(&syn_ast, &librustc_ast) { - passed += 1; + let syn_parenthesized_code = + syn_parenthesize(expr.clone()).to_token_stream().to_string(); + let syn_ast = if let Some(e) = parse::librustc_expr(&syn_parenthesized_code) { + e } else { failed += 1; - let syn_program = pprust::expr_to_string(&syn_ast); - let librustc_program = pprust::expr_to_string(&librustc_ast); + errorf!( + "\nFAIL {} - librustc failed to parse parenthesized\n", + path.display(), + ); + continue; + }; + + if !SpanlessEq::eq(&syn_ast, &librustc_ast) { + failed += 1; + let syn_pretty = pprust::expr_to_string(&syn_ast); + let librustc_pretty = pprust::expr_to_string(&librustc_ast); errorf!( "\nFAIL {}\n{}\nsyn != rustc\n{}\n", path.display(), - syn_program, - librustc_program, + syn_pretty, + librustc_pretty, ); + continue; } + + let expr_invisible = make_parens_invisible(expr); + let Ok(reparsed_expr_invisible) = syn::parse2(expr_invisible.to_token_stream()) else { + failed += 1; + errorf!( + "\nFAIL {} - syn failed to parse invisible delimiters\n{}\n", + path.display(), + source_code, + ); + continue; + }; + if expr_invisible != reparsed_expr_invisible { + failed += 1; + errorf!( + "\nFAIL {} - mismatch after parsing invisible delimiters\n{}\n", + path.display(), + source_code, + ); + continue; + } + + passed += 1; } }); @@ -159,19 +183,14 @@ fn test_expressions(path: &Path, edition: Edition, exprs: Vec) -> (us } fn librustc_parse_and_rewrite(input: &str) -> Option> { - parse::librustc_expr(input).and_then(librustc_brackets) + parse::librustc_expr(input).map(librustc_parenthesize) } -/// Wrap every expression which is not already wrapped in parens with parens, to -/// reveal the precedence of the parsed expressions, and produce a stringified -/// form of the resulting expression. -/// -/// This method operates on librustc objects. -fn librustc_brackets(mut librustc_expr: P) -> Option> { +fn librustc_parenthesize(mut librustc_expr: P) -> P { use rustc_ast::ast::{ - AssocItem, AssocItemKind, Attribute, BinOpKind, Block, BorrowKind, Expr, ExprField, - ExprKind, GenericArg, GenericBound, ItemKind, Local, LocalKind, Pat, Stmt, StmtKind, - StructExpr, StructRest, TraitBoundModifier, Ty, + AssocItem, AssocItemKind, Attribute, BinOpKind, Block, BorrowKind, BoundConstness, Expr, + ExprField, ExprKind, GenericArg, GenericBound, ItemKind, Local, LocalKind, Pat, Stmt, + StmtKind, StructExpr, StructRest, TraitBoundModifiers, Ty, }; use rustc_ast::mut_visit::{ noop_flat_map_assoc_item, noop_visit_generic_arg, noop_visit_item_kind, noop_visit_local, @@ -184,9 +203,7 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { use std::ops::DerefMut; use thin_vec::ThinVec; - struct BracketsVisitor { - failed: bool, - } + struct FullyParenthesize; fn contains_let_chain(expr: &Expr) -> bool { match &expr.kind { @@ -250,7 +267,7 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { } } - impl MutVisitor for BracketsVisitor { + impl MutVisitor for FullyParenthesize { fn visit_expr(&mut self, e: &mut P) { noop_visit_expr(e, self); match e.kind { @@ -288,7 +305,10 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { match bound { GenericBound::Trait( _, - TraitBoundModifier::MaybeConst | TraitBoundModifier::MaybeConstMaybe, + TraitBoundModifiers { + constness: BoundConstness::Maybe(_), + .. + }, ) => {} _ => noop_visit_param_bound(bound, self), } @@ -358,23 +378,16 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { } } - let mut folder = BracketsVisitor { failed: false }; + let mut folder = FullyParenthesize; folder.visit_expr(&mut librustc_expr); - if folder.failed { - None - } else { - Some(librustc_expr) - } + librustc_expr } -/// Wrap every expression which is not already wrapped in parens with parens, to -/// reveal the precedence of the parsed expressions, and produce a stringified -/// form of the resulting expression. -fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr { +fn syn_parenthesize(syn_expr: syn::Expr) -> syn::Expr { use syn::fold::{fold_expr, fold_generic_argument, Fold}; use syn::{token, BinOp, Expr, ExprParen, GenericArgument, MetaNameValue, Pat, Stmt, Type}; - struct ParenthesizeEveryExpr; + struct FullyParenthesize; fn parenthesize(expr: Expr) -> Expr { Expr::Paren(ExprParen { @@ -404,7 +417,7 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr { } } - impl Fold for ParenthesizeEveryExpr { + impl Fold for FullyParenthesize { fn fold_expr(&mut self, expr: Expr) -> Expr { let needs_paren = needs_paren(&expr); let folded = fold_expr(self, expr); @@ -452,10 +465,48 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr { } } - let mut folder = ParenthesizeEveryExpr; + let mut folder = FullyParenthesize; folder.fold_expr(syn_expr) } +fn make_parens_invisible(expr: syn::Expr) -> syn::Expr { + use syn::fold::{fold_expr, fold_stmt, Fold}; + use syn::{token, Expr, ExprGroup, ExprParen, Stmt}; + + struct MakeParensInvisible; + + impl Fold for MakeParensInvisible { + fn fold_expr(&mut self, mut expr: Expr) -> Expr { + if let Expr::Paren(paren) = expr { + expr = Expr::Group(ExprGroup { + attrs: paren.attrs, + group_token: token::Group(paren.paren_token.span.join()), + expr: paren.expr, + }); + } + fold_expr(self, expr) + } + + fn fold_stmt(&mut self, stmt: Stmt) -> Stmt { + if let Stmt::Expr(expr @ (Expr::Binary(_) | Expr::Cast(_)), None) = stmt { + Stmt::Expr( + Expr::Paren(ExprParen { + attrs: Vec::new(), + paren_token: token::Paren::default(), + expr: Box::new(fold_expr(self, expr)), + }), + None, + ) + } else { + fold_stmt(self, stmt) + } + } + } + + let mut folder = MakeParensInvisible; + folder.fold_expr(expr) +} + /// Walk through a crate collecting all expressions we can find in it. fn collect_exprs(file: syn::File) -> Vec { use syn::fold::Fold; diff --git a/vendor/syn/tests/test_round_trip.rs b/vendor/syn/tests/test_round_trip.rs index c0af30d29..a673fffa7 100644 --- a/vendor/syn/tests/test_round_trip.rs +++ b/vendor/syn/tests/test_round_trip.rs @@ -3,6 +3,7 @@ #![recursion_limit = "1024"] #![feature(rustc_private)] #![allow( + clippy::blocks_in_conditions, clippy::manual_assert, clippy::manual_let_else, clippy::match_like_matches_macro, @@ -164,7 +165,7 @@ fn translate_message(diagnostic: &Diagnostic) -> Cow<'static, str> { }; } - let message = &diagnostic.message[0].0; + let message = &diagnostic.messages[0].0; let args = translation::to_fluent_args(diagnostic.args()); let (identifier, attr) = match message { diff --git a/vendor/syn/tests/test_shebang.rs b/vendor/syn/tests/test_shebang.rs index 4c2a20457..843916180 100644 --- a/vendor/syn/tests/test_shebang.rs +++ b/vendor/syn/tests/test_shebang.rs @@ -18,7 +18,9 @@ fn test_basic() { generics: Generics, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, }, ], } @@ -55,7 +57,9 @@ fn test_comment() { generics: Generics, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, }, ], } diff --git a/vendor/syn/tests/test_size.rs b/vendor/syn/tests/test_size.rs index 943fcd354..d64a3ab6e 100644 --- a/vendor/syn/tests/test_size.rs +++ b/vendor/syn/tests/test_size.rs @@ -29,8 +29,8 @@ fn test_pat_size() { assert_eq!(mem::size_of::(), 184); } -#[rustversion::attr(before(2022-09-09), ignore)] +#[rustversion::attr(before(2023-12-20), ignore)] #[test] fn test_lit_size() { - assert_eq!(mem::size_of::(), 32); + assert_eq!(mem::size_of::(), 24); } diff --git a/vendor/syn/tests/test_stmt.rs b/vendor/syn/tests/test_stmt.rs index bc57685df..61890a40e 100644 --- a/vendor/syn/tests/test_stmt.rs +++ b/vendor/syn/tests/test_stmt.rs @@ -8,8 +8,9 @@ mod macros; use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; -use quote::quote; -use syn::Stmt; +use quote::{quote, ToTokens as _}; +use syn::parse::Parser as _; +use syn::{Block, Stmt}; #[test] fn test_raw_operator() { @@ -67,7 +68,6 @@ fn test_none_group() { TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())), ]), ))]); - snapshot!(tokens as Stmt, @r###" Stmt::Item(Item::Fn { vis: Visibility::Inherited, @@ -77,9 +77,37 @@ fn test_none_group() { generics: Generics, output: ReturnType::Default, }, - block: Block, + block: Block { + stmts: [], + }, }) "###); + + let tokens = Group::new(Delimiter::None, quote!(let None = None)).to_token_stream(); + let stmts = Block::parse_within.parse2(tokens).unwrap(); + snapshot!(stmts, @r###" + [ + Stmt::Expr( + Expr::Group { + expr: Expr::Let { + pat: Pat::Ident { + ident: "None", + }, + expr: Expr::Path { + path: Path { + segments: [ + PathSegment { + ident: "None", + }, + ], + }, + }, + }, + }, + None, + ), + ] + "###); } #[test] @@ -234,3 +262,61 @@ fn test_macros() { }) "###); } + +#[test] +fn test_early_parse_loop() { + // The following is an Expr::Loop followed by Expr::Tuple. It is not an + // Expr::Call. + let tokens = quote! { + loop {} + () + }; + + let stmts = Block::parse_within.parse2(tokens).unwrap(); + + snapshot!(stmts, @r###" + [ + Stmt::Expr( + Expr::Loop { + body: Block { + stmts: [], + }, + }, + None, + ), + Stmt::Expr( + Expr::Tuple, + None, + ), + ] + "###); + + let tokens = quote! { + 'a: loop {} + () + }; + + let stmts = Block::parse_within.parse2(tokens).unwrap(); + + snapshot!(stmts, @r###" + [ + Stmt::Expr( + Expr::Loop { + label: Some(Label { + name: Lifetime { + ident: "a", + }, + }), + body: Block { + stmts: [], + }, + }, + None, + ), + Stmt::Expr( + Expr::Tuple, + None, + ), + ] + "###); +} diff --git a/vendor/syn/tests/test_ty.rs b/vendor/syn/tests/test_ty.rs index a400a7612..06453934f 100644 --- a/vendor/syn/tests/test_ty.rs +++ b/vendor/syn/tests/test_ty.rs @@ -4,8 +4,9 @@ mod macros; use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree}; -use quote::quote; -use syn::Type; +use quote::{quote, ToTokens as _}; +use syn::punctuated::Punctuated; +use syn::{parse_quote, token, Token, Type, TypeTuple}; #[test] fn test_mut_self() { @@ -170,6 +171,7 @@ fn test_group_colons() { ], }, }, + Token![::], PathSegment { ident: "Item", }, @@ -245,6 +247,7 @@ fn test_trait_object() { ], }, }), + Token![+], TypeParamBound::Lifetime { ident: "static", }, @@ -260,6 +263,7 @@ fn test_trait_object() { TypeParamBound::Lifetime { ident: "a", }, + Token![+], TypeParamBound::Trait(TraitBound { path: Path { segments: [ @@ -294,6 +298,7 @@ fn test_trailing_plus() { ], }, }), + Token![+], ], } "###); @@ -313,6 +318,7 @@ fn test_trailing_plus() { ], }, }), + Token![+], ], } "###); @@ -331,6 +337,60 @@ fn test_trailing_plus() { ], }, }), + Token![+], + ], + } + "###); +} + +#[test] +fn test_tuple_comma() { + let mut expr = TypeTuple { + paren_token: token::Paren::default(), + elems: Punctuated::new(), + }; + snapshot!(expr.to_token_stream() as Type, @"Type::Tuple"); + + expr.elems.push_value(parse_quote!(_)); + // Must not parse to Type::Paren + snapshot!(expr.to_token_stream() as Type, @r###" + Type::Tuple { + elems: [ + Type::Infer, + Token![,], + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Type, @r###" + Type::Tuple { + elems: [ + Type::Infer, + Token![,], + ], + } + "###); + + expr.elems.push_value(parse_quote!(_)); + snapshot!(expr.to_token_stream() as Type, @r###" + Type::Tuple { + elems: [ + Type::Infer, + Token![,], + Type::Infer, + ], + } + "###); + + expr.elems.push_punct(::default()); + snapshot!(expr.to_token_stream() as Type, @r###" + Type::Tuple { + elems: [ + Type::Infer, + Token![,], + Type::Infer, + Token![,], ], } "###); diff --git a/vendor/tempfile/.cargo-checksum.json b/vendor/tempfile/.cargo-checksum.json index d84bde0df..bc37aae9a 100644 --- a/vendor/tempfile/.cargo-checksum.json +++ b/vendor/tempfile/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"2533d89b7047ced43fd0f0aa410c9bf1f4d8388308585eae28a3d49cb71dbcb0","Cargo.toml":"93b08b8882c3b42e51a152031f1d53d0006b0c5ef79a9a5211acd7242ae416a2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"8b427f5bc501764575e52ba4f9d95673cf8f6d80a86d0d06599852e1a9a20a36","README.md":"972f1c35ec653943e067fd2c3d09e78f593b2e9e1eafd5b9668bf3653513de3e","deny.toml":"cb4c35327cbf8a20a6b19ac3fdf2c47b665da1662c90e3eae8a3825f9b72596e","src/dir.rs":"3b515f42feb934ba83ba56d506116e5e932c6b863b764fd61d26994eff28700a","src/error.rs":"cc7d8eace0fff11cb342158d2885d5637bfb14b24ef30755e808554772039c5f","src/file/imp/mod.rs":"f6da9fcd93f11889670a251fdd8231b5f4614e5a971b7b183f52b44af68568d5","src/file/imp/other.rs":"501cd1b444a5821127ea831fc8018706148f2d9f47c478f502b069963a42a2c7","src/file/imp/unix.rs":"0fa63a8b831947fdc7307e889d129adef6f47b19965b963a5e25d70cb3106e62","src/file/imp/windows.rs":"fa4211087c36290064de9a41b5e533e4e8c24a10fb8f8908835a67e00555c06e","src/file/mod.rs":"3a51ab219e0adab18324cab072fed01b0805781d6f15e79ca8b8a36543683bcc","src/lib.rs":"6303e7470c680ad785f32eb717de2e512b88c2c5da0e1684e3704471fabd7398","src/spooled.rs":"de848218bb7c0733d9c46e337564137673c95f5a6cf9f6bb28baf218b2503247","src/util.rs":"63737b9180cb769c1fcac56f1fa928221ae41a8917872d3e878d0a915e877710","tests/namedtempfile.rs":"87dd6a8bba2fdd77418ec2b50b8aec5e26d05a2f780182b4e9ff464b3404d47c","tests/spooled.rs":"a97e96404dc5136421ac027b965070c0d5b44c93d06d456e12dc85f81755d064","tests/tempdir.rs":"f5a86f56df6bb60aa5dfa136ce75f8d0f29c2e87546dccfe1fb680d209be525e","tests/tempfile.rs":"9a2f8142151a6aa2fd047aa3749f9982ece4b080a3ace0d3c58d6bdb3f883c81"},"package":"7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"} \ No newline at end of file +{"files":{"CHANGELOG.md":"6ca436fe5f63922174c061cb402e9b5a1e455b66a3b5677d1c191c04962b5832","Cargo.toml":"c79c844a01b8c7aec169d6506a3c588edacdfcdc835d2577b14dc064b342ac75","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"8b427f5bc501764575e52ba4f9d95673cf8f6d80a86d0d06599852e1a9a20a36","README.md":"972f1c35ec653943e067fd2c3d09e78f593b2e9e1eafd5b9668bf3653513de3e","deny.toml":"cb4c35327cbf8a20a6b19ac3fdf2c47b665da1662c90e3eae8a3825f9b72596e","src/dir.rs":"3b515f42feb934ba83ba56d506116e5e932c6b863b764fd61d26994eff28700a","src/error.rs":"cc7d8eace0fff11cb342158d2885d5637bfb14b24ef30755e808554772039c5f","src/file/imp/mod.rs":"f6da9fcd93f11889670a251fdd8231b5f4614e5a971b7b183f52b44af68568d5","src/file/imp/other.rs":"501cd1b444a5821127ea831fc8018706148f2d9f47c478f502b069963a42a2c7","src/file/imp/unix.rs":"0fa63a8b831947fdc7307e889d129adef6f47b19965b963a5e25d70cb3106e62","src/file/imp/windows.rs":"fa4211087c36290064de9a41b5e533e4e8c24a10fb8f8908835a67e00555c06e","src/file/mod.rs":"3a51ab219e0adab18324cab072fed01b0805781d6f15e79ca8b8a36543683bcc","src/lib.rs":"6303e7470c680ad785f32eb717de2e512b88c2c5da0e1684e3704471fabd7398","src/spooled.rs":"de848218bb7c0733d9c46e337564137673c95f5a6cf9f6bb28baf218b2503247","src/util.rs":"63737b9180cb769c1fcac56f1fa928221ae41a8917872d3e878d0a915e877710","tests/namedtempfile.rs":"87dd6a8bba2fdd77418ec2b50b8aec5e26d05a2f780182b4e9ff464b3404d47c","tests/spooled.rs":"a97e96404dc5136421ac027b965070c0d5b44c93d06d456e12dc85f81755d064","tests/tempdir.rs":"f5a86f56df6bb60aa5dfa136ce75f8d0f29c2e87546dccfe1fb680d209be525e","tests/tempfile.rs":"9a2f8142151a6aa2fd047aa3749f9982ece4b080a3ace0d3c58d6bdb3f883c81"},"package":"01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"} \ No newline at end of file diff --git a/vendor/tempfile/CHANGELOG.md b/vendor/tempfile/CHANGELOG.md index 33868ab49..e8894b3dc 100644 --- a/vendor/tempfile/CHANGELOG.md +++ b/vendor/tempfile/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 3.9.0 + +- Updates windows-sys to 0.52 +- Updates minimum rustix version to 0.38.25 + ## 3.8.1 - Update rustix to fix a potential panic on `persist_noclobber` on android. diff --git a/vendor/tempfile/Cargo.toml b/vendor/tempfile/Cargo.toml index 84ea8010d..4c2c2e5b6 100644 --- a/vendor/tempfile/Cargo.toml +++ b/vendor/tempfile/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.63" name = "tempfile" -version = "3.8.1" +version = "3.9.0" authors = [ "Steven Allen ", "The Rust Project Developers", @@ -45,14 +45,14 @@ version = "0.3" nightly = [] [target."cfg(any(unix, target_os = \"wasi\"))".dependencies.rustix] -version = "0.38.21" +version = "0.38.26" features = ["fs"] [target."cfg(target_os = \"redox\")".dependencies.redox_syscall] version = "0.4" [target."cfg(windows)".dependencies.windows-sys] -version = "0.48" +version = "0.52" features = [ "Win32_Storage_FileSystem", "Win32_Foundation", diff --git a/vendor/termcolor/.cargo-checksum.json b/vendor/termcolor/.cargo-checksum.json index 85ded2a12..347620f12 100644 --- a/vendor/termcolor/.cargo-checksum.json +++ b/vendor/termcolor/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"99e42d9c2cccfe0c7ba563ec3d1eef0ceb1a0a7b1e73722b51b98fb388ab5b39","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"b07f32791ef31fdc347d1d4a62a0bf0979ab825a361ca9079f31908a0b78ea96","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/lib.rs":"82d177e0cd4be591e6af29fc422dc996fde5c8ef4c75cdabdd2b12884956fad2"},"package":"ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449"} \ No newline at end of file +{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"572fae34cf0bee9ca39a1398501c17fed5e98a2de908136cabbaba98cf97208e","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"b07f32791ef31fdc347d1d4a62a0bf0979ab825a361ca9079f31908a0b78ea96","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/lib.rs":"155112a5bc22f4640911dff4a167721ade0b739eb1eda4d108727044dcfd9918"},"package":"06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"} \ No newline at end of file diff --git a/vendor/termcolor/Cargo.toml b/vendor/termcolor/Cargo.toml index cdd65b344..f90eacae7 100644 --- a/vendor/termcolor/Cargo.toml +++ b/vendor/termcolor/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "termcolor" -version = "1.4.0" +version = "1.4.1" authors = ["Andrew Gallant "] description = """ A simple cross platform library for writing colored text to a terminal. diff --git a/vendor/termcolor/src/lib.rs b/vendor/termcolor/src/lib.rs index 640e2124a..9e6371fcb 100644 --- a/vendor/termcolor/src/lib.rs +++ b/vendor/termcolor/src/lib.rs @@ -1143,7 +1143,7 @@ impl BufferWriter { } let mut stream = self.stream.wrap(self.stream.get_ref().lock()); if let Some(ref sep) = self.separator { - if self.printed.load(Ordering::SeqCst) { + if self.printed.load(Ordering::Relaxed) { stream.write_all(sep)?; stream.write_all(b"\n")?; } @@ -1163,7 +1163,7 @@ impl BufferWriter { b.print(&mut *console, &mut stream)?; } } - self.printed.store(true, Ordering::SeqCst); + self.printed.store(true, Ordering::Relaxed); Ok(()) } } diff --git a/vendor/thiserror-impl/.cargo-checksum.json b/vendor/thiserror-impl/.cargo-checksum.json index 434947736..f091d556d 100644 --- a/vendor/thiserror-impl/.cargo-checksum.json +++ b/vendor/thiserror-impl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3f5057552ccac72bba0665fbc5c5cca35a8cb5e6751eec516b1052212ce8e27d","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"c7601e8394f5ee304365c520181f0dbeaa807ddaa71ce4a8618ea1a70f81b3b2","src/attr.rs":"ad5319f053a18ec3841300b2ae553ffa005749ba7099fe4b318126223e4dcbdf","src/expand.rs":"222c77246df56d96dddf4441ba0327579ebba89c65f0123aaab0505c51bd84a3","src/fmt.rs":"d63d39120c18712596f9f2a1715821148c2becd4d8bad5bc1b307210a84dbe98","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"a17484d590d702ea79172ef84a94de4a96b439d1a5fdac69d24417f25461af04","src/prop.rs":"5ba613e38430831259f20b258f33d57dcb783fbaeeb49e5faffa7b2a7be99e67","src/span.rs":"430460a4fa0d1fa9c627c1ddd575d2b101778fea84217591e1a93a5f6a2a0132","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"} \ No newline at end of file +{"files":{"Cargo.toml":"b387bf85702168709e2619d65e68e1860dca1021ddd91346a09ec8bd1cc80471","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"e2fbc32e91cd462757107c1f8ab2f888f08c865ac71270583f9e11b83e3c32ca","src/attr.rs":"ad5319f053a18ec3841300b2ae553ffa005749ba7099fe4b318126223e4dcbdf","src/expand.rs":"9469753e0949556848183084e0f22521c6300d38ca0de196441446c50f350d3c","src/fmt.rs":"d63d39120c18712596f9f2a1715821148c2becd4d8bad5bc1b307210a84dbe98","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"5eea86c771e643328ad9bc3b881cce4bf9d50adae1b33e0d07645bdd9044003d","src/prop.rs":"5ba613e38430831259f20b258f33d57dcb783fbaeeb49e5faffa7b2a7be99e67","src/span.rs":"430460a4fa0d1fa9c627c1ddd575d2b101778fea84217591e1a93a5f6a2a0132","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"} \ No newline at end of file diff --git a/vendor/thiserror-impl/Cargo.toml b/vendor/thiserror-impl/Cargo.toml index 50d361cba..fffdf5c3a 100644 --- a/vendor/thiserror-impl/Cargo.toml +++ b/vendor/thiserror-impl/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" authors = ["David Tolnay "] description = "Implementation detail of the `thiserror` crate" license = "MIT OR Apache-2.0" @@ -27,10 +27,10 @@ targets = ["x86_64-unknown-linux-gnu"] proc-macro = true [dependencies.proc-macro2] -version = "1.0.63" +version = "1.0.74" [dependencies.quote] -version = "1.0.29" +version = "1.0.35" [dependencies.syn] -version = "2.0.23" +version = "2.0.46" diff --git a/vendor/thiserror-impl/src/ast.rs b/vendor/thiserror-impl/src/ast.rs index 2aa7246c8..9e0692898 100644 --- a/vendor/thiserror-impl/src/ast.rs +++ b/vendor/thiserror-impl/src/ast.rs @@ -12,7 +12,6 @@ pub enum Input<'a> { } pub struct Struct<'a> { - pub original: &'a DeriveInput, pub attrs: Attrs<'a>, pub ident: Ident, pub generics: &'a Generics, @@ -20,7 +19,6 @@ pub struct Struct<'a> { } pub struct Enum<'a> { - pub original: &'a DeriveInput, pub attrs: Attrs<'a>, pub ident: Ident, pub generics: &'a Generics, @@ -65,7 +63,6 @@ impl<'a> Struct<'a> { display.expand_shorthand(&fields); } Ok(Struct { - original: node, attrs, ident: node.ident.clone(), generics: &node.generics, @@ -96,7 +93,6 @@ impl<'a> Enum<'a> { }) .collect::>()?; Ok(Enum { - original: node, attrs, ident: node.ident.clone(), generics: &node.generics, diff --git a/vendor/thiserror-impl/src/expand.rs b/vendor/thiserror-impl/src/expand.rs index 9124ca3a9..1b44513a2 100644 --- a/vendor/thiserror-impl/src/expand.rs +++ b/vendor/thiserror-impl/src/expand.rs @@ -5,12 +5,20 @@ use crate::span::MemberSpan; use proc_macro2::TokenStream; use quote::{format_ident, quote, quote_spanned, ToTokens}; use std::collections::BTreeSet as Set; -use syn::{ - Data, DeriveInput, GenericArgument, Member, PathArguments, Result, Token, Type, Visibility, -}; +use syn::{DeriveInput, GenericArgument, Member, PathArguments, Result, Token, Type}; -pub fn derive(node: &DeriveInput) -> Result { - let input = Input::from_syn(node)?; +pub fn derive(input: &DeriveInput) -> TokenStream { + match try_expand(input) { + Ok(expanded) => expanded, + // If there are invalid attributes in the input, expand to an Error impl + // anyway to minimize spurious knock-on errors in other code that uses + // this type as an Error. + Err(error) => fallback(input, error), + } +} + +fn try_expand(input: &DeriveInput) -> Result { + let input = Input::from_syn(input)?; input.validate()?; Ok(match input { Input::Struct(input) => impl_struct(input), @@ -18,6 +26,32 @@ pub fn derive(node: &DeriveInput) -> Result { }) } +fn fallback(input: &DeriveInput, error: syn::Error) -> TokenStream { + let ty = &input.ident; + let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); + + let error = error.to_compile_error(); + + quote! { + #error + + #[allow(unused_qualifications)] + impl #impl_generics std::error::Error for #ty #ty_generics #where_clause + where + // Work around trivial bounds being unstable. + // https://github.com/rust-lang/rust/issues/48214 + for<'workaround> #ty #ty_generics: ::core::fmt::Debug, + {} + + #[allow(unused_qualifications)] + impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause { + fn fmt(&self, __formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::unreachable!() + } + } + } +} + fn impl_struct(input: Struct) -> TokenStream { let ty = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); @@ -55,7 +89,7 @@ fn impl_struct(input: Struct) -> TokenStream { let source_method = source_body.map(|body| { quote! { fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> { - use thiserror::__private::AsDynError; + use thiserror::__private::AsDynError as _; #body } } @@ -91,7 +125,7 @@ fn impl_struct(input: Struct) -> TokenStream { }) }; quote! { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::ThiserrorProvide as _; #source_provide #self_provide } @@ -168,7 +202,6 @@ fn impl_struct(input: Struct) -> TokenStream { } }); - let error_trait = spanned_error_trait(input.original); if input.generics.type_params().next().is_some() { let self_token = ::default(); error_inferred_bounds.insert(self_token, Trait::Debug); @@ -178,7 +211,7 @@ fn impl_struct(input: Struct) -> TokenStream { quote! { #[allow(unused_qualifications)] - impl #impl_generics #error_trait for #ty #ty_generics #error_where_clause { + impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause { #source_method #provide_method } @@ -233,7 +266,7 @@ fn impl_enum(input: Enum) -> TokenStream { }); Some(quote! { fn source(&self) -> ::core::option::Option<&(dyn std::error::Error + 'static)> { - use thiserror::__private::AsDynError; + use thiserror::__private::AsDynError as _; #[allow(deprecated)] match self { #(#arms)* @@ -283,7 +316,7 @@ fn impl_enum(input: Enum) -> TokenStream { #source: #varsource, .. } => { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::ThiserrorProvide as _; #source_provide #self_provide } @@ -307,7 +340,7 @@ fn impl_enum(input: Enum) -> TokenStream { }; quote! { #ty::#ident {#backtrace: #varsource, ..} => { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::ThiserrorProvide as _; #source_provide } } @@ -425,7 +458,6 @@ fn impl_enum(input: Enum) -> TokenStream { }) }); - let error_trait = spanned_error_trait(input.original); if input.generics.type_params().next().is_some() { let self_token = ::default(); error_inferred_bounds.insert(self_token, Trait::Debug); @@ -435,7 +467,7 @@ fn impl_enum(input: Enum) -> TokenStream { quote! { #[allow(unused_qualifications)] - impl #impl_generics #error_trait for #ty #ty_generics #error_where_clause { + impl #impl_generics std::error::Error for #ty #ty_generics #error_where_clause { #source_method #provide_method } @@ -528,21 +560,3 @@ fn type_parameter_of_option(ty: &Type) -> Option<&Type> { _ => None, } } - -fn spanned_error_trait(input: &DeriveInput) -> TokenStream { - let vis_span = match &input.vis { - Visibility::Public(vis) => Some(vis.span), - Visibility::Restricted(vis) => Some(vis.pub_token.span), - Visibility::Inherited => None, - }; - let data_span = match &input.data { - Data::Struct(data) => data.struct_token.span, - Data::Enum(data) => data.enum_token.span, - Data::Union(data) => data.union_token.span, - }; - let first_span = vis_span.unwrap_or(data_span); - let last_span = input.ident.span(); - let path = quote_spanned!(first_span=> std::error::); - let error = quote_spanned!(last_span=> Error); - quote!(#path #error) -} diff --git a/vendor/thiserror-impl/src/lib.rs b/vendor/thiserror-impl/src/lib.rs index cc86dc49e..58f4bb5b5 100644 --- a/vendor/thiserror-impl/src/lib.rs +++ b/vendor/thiserror-impl/src/lib.rs @@ -1,5 +1,5 @@ #![allow( - clippy::blocks_in_if_conditions, + clippy::blocks_in_conditions, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::manual_find, @@ -8,9 +8,9 @@ clippy::map_unwrap_or, clippy::module_name_repetitions, clippy::needless_pass_by_value, - clippy::option_if_let_else, clippy::range_plus_one, clippy::single_match_else, + clippy::struct_field_names, clippy::too_many_lines, clippy::wrong_self_convention )] @@ -32,7 +32,5 @@ use syn::{parse_macro_input, DeriveInput}; #[proc_macro_derive(Error, attributes(backtrace, error, from, source))] pub fn derive_error(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand::derive(&input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand::derive(&input).into() } diff --git a/vendor/thiserror/.cargo-checksum.json b/vendor/thiserror/.cargo-checksum.json index 4132e4795..cee7027f7 100644 --- a/vendor/thiserror/.cargo-checksum.json +++ b/vendor/thiserror/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"a6c11176591c171057bebc4f6281352b49114559205d604c288b5d9ecfac4646","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c5a937767d49503e1fc5eae1b924f57f15decd8583720a3c652483e348a64","build.rs":"e3b1264d1b235d030636d858308caceadf75704c572f87be364751c909a1f496","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"cf3c98abb2b9e06afa3c4aba0df14938417c3e330315863437561cbb3573888b","src/display.rs":"0adeeeb524c6bee06de179d54e82a43dc12d2c5b7f69f6fd268ba4611ebf5233","src/lib.rs":"5b2a5f5f00db8854c407527d30204114edc8ffd6f457d59f66ba433d93a302bc","src/provide.rs":"8007e22953bacfcc57bb7d12a03fbeb0acece5d2ec889cf55522a4e071d26df3","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"a8f038490fb881463c0e8c36557617c47cf2d181f16c00525d4d139c7964fade","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"28e0f938fe0f6354529c35722eff04830451e27718145c27522c9acf7f8a6639","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"6d6d686b7f31e063c76647b24df347acfceba6897ce3a5f54b2851cde387579b","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"adc61f0d5fe8d53796848d44fb0373be5eab19a1eeb6a7172bc6f0dd7b91199c","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"ac30d929c019d6c54d1c1792b09e43c18dc0e4123b82051ff9e5db5e63c15e43","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/from-backtrace-backtrace.rs":"0caac64486c0eb9c076553c0502d468fbc477602a9a2595165a1dcd95524e5ff","tests/ui/from-backtrace-backtrace.stderr":"e24156ae0828878f3282341732b6e032eaa8cb4b4db366a6b5437ed0731d40a7","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"9e2161baf5f66ab22370322f2e66e7633bf04b1ec07ef656e904b984bcc45d09","tests/ui/source-enum-not-error.rs":"3add5e7b4503d964bcae0848904822e1473c1d08c5a146c2df5347314ce1b8df","tests/ui/source-enum-not-error.stderr":"c093580558a259489eef92728d19aeca3b6c27ec17c39a02a75f0a924b095675","tests/ui/source-enum-unnamed-field-not-error.rs":"a98989e908b84a8e6e6dceef02af7bdd1098a444d229950f67ed4f54d55c62e7","tests/ui/source-enum-unnamed-field-not-error.stderr":"45b520f44e6fd10792d7f48e8ca7bc89850aa039278cba7c9f6ea11aa6378494","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"66fb5fa85d59f11d8b5f7ec99469a843c51943b0010e554bdf56376a0614a2ca","tests/ui/source-struct-unnamed-field-not-error.rs":"eee605a9aafbb093666393e25cef4f7d7b8e90d518b9fadbdbed9685c66ccfcd","tests/ui/source-struct-unnamed-field-not-error.stderr":"38e4bd380ff1637c179b277ea1beb0a1ce688d191e5a9502ee69ab752e9ba70f","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-not-error.rs":"f6315993e68bc71d6d4d39afa4d059695308ef785f92cc0d1df3e9ff55be2a9a","tests/ui/transparent-enum-not-error.stderr":"e485c39f861ab66a6a41f0a423b1b13ba277968210284148883b350b5d629ccc","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-enum-unnamed-field-not-error.rs":"0c720567e9e0f87921055dfa9f607661725377633445e01a4b5048c7a7a50a85","tests/ui/transparent-enum-unnamed-field-not-error.stderr":"6b8ba244eba94006039d10f35bdd7526136bcff4751b13313ab12283d5bdc24c","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-not-error.rs":"fd814d3141c9182b1267b558d9daef8dd6e8b6462e1ad42b197f3a1c0703dce2","tests/ui/transparent-struct-not-error.stderr":"bb8b856515b34711c046f195b4267d2bb21309c5d3ac0a39d6660c55dadafb41","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/transparent-struct-unnamed-field-not-error.rs":"fbff5874be44a5dcc347693d7929537256b187dfec467ed72c9968c095228d8d","tests/ui/transparent-struct-unnamed-field-not-error.stderr":"684d4ed4325f2e7fb95c84a6d231585b2be313990c41222fda66b99a84e7b884","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"} \ No newline at end of file +{"files":{"Cargo.toml":"d78abe9a046d804b1c51260cefe516c36dfbb9994edfe47175bbd838cd46f68f","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c5a937767d49503e1fc5eae1b924f57f15decd8583720a3c652483e348a64","build.rs":"532f6ac494cdddfad3267067a46969a8052b02c1bd94567361f7103ab0dc8c28","build/probe.rs":"3245569a228727091f335db44c7c2f729729b2dfac9f46c1143eb179439f223d","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"cf3c98abb2b9e06afa3c4aba0df14938417c3e330315863437561cbb3573888b","src/display.rs":"0adeeeb524c6bee06de179d54e82a43dc12d2c5b7f69f6fd268ba4611ebf5233","src/lib.rs":"074676e9bbe9402ebe3f41dedcaa289774e47e075d10e2f523d2dcbd8f648f79","src/provide.rs":"8007e22953bacfcc57bb7d12a03fbeb0acece5d2ec889cf55522a4e071d26df3","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"a8f038490fb881463c0e8c36557617c47cf2d181f16c00525d4d139c7964fade","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"28e0f938fe0f6354529c35722eff04830451e27718145c27522c9acf7f8a6639","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"d35b11040ebc547467f52571051854e3e094d52b8e229fa3d44700d5f40959a2","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"adc61f0d5fe8d53796848d44fb0373be5eab19a1eeb6a7172bc6f0dd7b91199c","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"ac30d929c019d6c54d1c1792b09e43c18dc0e4123b82051ff9e5db5e63c15e43","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/fallback-impl-with-display.rs":"141a8efbabe3fdac584bec8a61e6cceb58a34a70b825f6277037bf9d591150eb","tests/ui/fallback-impl-with-display.stderr":"1b3dad712b97598fbee70125471de1a8106eb161d42ce1f790ae07be8c8984ba","tests/ui/from-backtrace-backtrace.rs":"0caac64486c0eb9c076553c0502d468fbc477602a9a2595165a1dcd95524e5ff","tests/ui/from-backtrace-backtrace.stderr":"e24156ae0828878f3282341732b6e032eaa8cb4b4db366a6b5437ed0731d40a7","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/invalid-input-impl-anyway.rs":"6de91f71ddf038dffa3b9da33763a2ec3a5aa0047528e19ba998d5efe3aada5b","tests/ui/invalid-input-impl-anyway.stderr":"fa2725053cd87fc37f87546b377e6e5eed95c45e2a960863303b21a1935fdddb","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-display.rs":"c1fd1bc0ec0fb103d7f7b128837f717d49485662839899d570b3c983f1332888","tests/ui/missing-display.stderr":"a8de0f1559da9320ee99ef334937d532d9e9f40a32ed7f8ce56fb465628bff96","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"9e2161baf5f66ab22370322f2e66e7633bf04b1ec07ef656e904b984bcc45d09","tests/ui/source-enum-not-error.rs":"3add5e7b4503d964bcae0848904822e1473c1d08c5a146c2df5347314ce1b8df","tests/ui/source-enum-not-error.stderr":"c093580558a259489eef92728d19aeca3b6c27ec17c39a02a75f0a924b095675","tests/ui/source-enum-unnamed-field-not-error.rs":"a98989e908b84a8e6e6dceef02af7bdd1098a444d229950f67ed4f54d55c62e7","tests/ui/source-enum-unnamed-field-not-error.stderr":"45b520f44e6fd10792d7f48e8ca7bc89850aa039278cba7c9f6ea11aa6378494","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"66fb5fa85d59f11d8b5f7ec99469a843c51943b0010e554bdf56376a0614a2ca","tests/ui/source-struct-unnamed-field-not-error.rs":"eee605a9aafbb093666393e25cef4f7d7b8e90d518b9fadbdbed9685c66ccfcd","tests/ui/source-struct-unnamed-field-not-error.stderr":"38e4bd380ff1637c179b277ea1beb0a1ce688d191e5a9502ee69ab752e9ba70f","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-not-error.rs":"f6315993e68bc71d6d4d39afa4d059695308ef785f92cc0d1df3e9ff55be2a9a","tests/ui/transparent-enum-not-error.stderr":"e485c39f861ab66a6a41f0a423b1b13ba277968210284148883b350b5d629ccc","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-enum-unnamed-field-not-error.rs":"0c720567e9e0f87921055dfa9f607661725377633445e01a4b5048c7a7a50a85","tests/ui/transparent-enum-unnamed-field-not-error.stderr":"6b8ba244eba94006039d10f35bdd7526136bcff4751b13313ab12283d5bdc24c","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-not-error.rs":"fd814d3141c9182b1267b558d9daef8dd6e8b6462e1ad42b197f3a1c0703dce2","tests/ui/transparent-struct-not-error.stderr":"bb8b856515b34711c046f195b4267d2bb21309c5d3ac0a39d6660c55dadafb41","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/transparent-struct-unnamed-field-not-error.rs":"fbff5874be44a5dcc347693d7929537256b187dfec467ed72c9968c095228d8d","tests/ui/transparent-struct-unnamed-field-not-error.stderr":"684d4ed4325f2e7fb95c84a6d231585b2be313990c41222fda66b99a84e7b884","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"} \ No newline at end of file diff --git a/vendor/thiserror/Cargo.toml b/vendor/thiserror/Cargo.toml index db21f8f9d..787176124 100644 --- a/vendor/thiserror/Cargo.toml +++ b/vendor/thiserror/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "thiserror" -version = "1.0.50" +version = "1.0.56" authors = ["David Tolnay "] description = "derive(Error)" documentation = "https://docs.rs/thiserror" @@ -32,7 +32,7 @@ rustdoc-args = ["--generate-link-to-definition"] targets = ["x86_64-unknown-linux-gnu"] [dependencies.thiserror-impl] -version = "=1.0.50" +version = "=1.0.56" [dev-dependencies.anyhow] version = "1.0.73" diff --git a/vendor/thiserror/build.rs b/vendor/thiserror/build.rs index 8bf19e198..0b995d8ea 100644 --- a/vendor/thiserror/build.rs +++ b/vendor/thiserror/build.rs @@ -1,50 +1,56 @@ -#![allow(clippy::needless_raw_string_hashes)] - use std::env; -use std::fs; +use std::ffi::OsString; use std::path::Path; -use std::process::{Command, ExitStatus, Stdio}; -use std::str; - -// This code exercises the surface area that we expect of the Error generic -// member access API. If the current toolchain is able to compile it, then -// thiserror is able to provide backtrace support. -const PROBE: &str = r#" - #![feature(error_generic_member_access)] - - use std::error::{Error, Request}; - use std::fmt::{self, Debug, Display}; - - struct MyError(Thing); - struct Thing; - - impl Debug for MyError { - fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { - unimplemented!() - } - } - - impl Display for MyError { - fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { - unimplemented!() - } - } - - impl Error for MyError { - fn provide<'a>(&'a self, request: &mut Request<'a>) { - request.provide_ref(&self.0); - } - } -"#; +use std::process::{self, Command, Stdio}; fn main() { - match compile_probe() { - Some(status) if status.success() => println!("cargo:rustc-cfg=error_generic_member_access"), - _ => {} + println!("cargo:rerun-if-changed=build/probe.rs"); + + let error_generic_member_access; + let consider_rustc_bootstrap; + if compile_probe(false) { + // This is a nightly or dev compiler, so it supports unstable features + // regardless of RUSTC_BOOTSTRAP. No need to rerun build script if + // RUSTC_BOOTSTRAP is changed. + error_generic_member_access = true; + consider_rustc_bootstrap = false; + } else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") { + if compile_probe(true) { + // This is a stable or beta compiler for which the user has set + // RUSTC_BOOTSTRAP to turn on unstable features. Rerun build script + // if they change it. + error_generic_member_access = true; + consider_rustc_bootstrap = true; + } else if rustc_bootstrap == "1" { + // This compiler does not support the generic member access API in + // the form that thiserror expects. No need to pay attention to + // RUSTC_BOOTSTRAP. + error_generic_member_access = false; + consider_rustc_bootstrap = false; + } else { + // This is a stable or beta compiler for which RUSTC_BOOTSTRAP is + // set to restrict the use of unstable features by this crate. + error_generic_member_access = false; + consider_rustc_bootstrap = true; + } + } else { + // Without RUSTC_BOOTSTRAP, this compiler does not support the generic + // member access API in the form that thiserror expects, but try again + // if the user turns on unstable features. + error_generic_member_access = false; + consider_rustc_bootstrap = true; + } + + if error_generic_member_access { + println!("cargo:rustc-cfg=error_generic_member_access"); + } + + if consider_rustc_bootstrap { + println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP"); } } -fn compile_probe() -> Option { +fn compile_probe(rustc_bootstrap: bool) -> bool { if env::var_os("RUSTC_STAGE").is_some() { // We are running inside rustc bootstrap. This is a highly non-standard // environment with issues such as: @@ -53,13 +59,12 @@ fn compile_probe() -> Option { // https://github.com/rust-lang/rust/issues/114839 // // Let's just not use nightly features here. - return None; + return false; } - let rustc = env::var_os("RUSTC")?; - let out_dir = env::var_os("OUT_DIR")?; - let probefile = Path::new(&out_dir).join("probe.rs"); - fs::write(&probefile, PROBE).ok()?; + let rustc = cargo_env_var("RUSTC"); + let out_dir = cargo_env_var("OUT_DIR"); + let probefile = Path::new("build").join("probe.rs"); // Make sure to pick up Cargo rustc configuration. let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") { @@ -71,11 +76,15 @@ fn compile_probe() -> Option { Command::new(rustc) }; + if !rustc_bootstrap { + cmd.env_remove("RUSTC_BOOTSTRAP"); + } + cmd.stderr(Stdio::null()) .arg("--edition=2018") - .arg("--crate-name=thiserror_build") + .arg("--crate-name=thiserror") .arg("--crate-type=lib") - .arg("--emit=metadata") + .arg("--emit=dep-info,metadata") .arg("--out-dir") .arg(out_dir) .arg(probefile); @@ -93,5 +102,18 @@ fn compile_probe() -> Option { } } - cmd.status().ok() + match cmd.status() { + Ok(status) => status.success(), + Err(_) => false, + } +} + +fn cargo_env_var(key: &str) -> OsString { + env::var_os(key).unwrap_or_else(|| { + eprintln!( + "Environment variable ${} is not set during execution of build script", + key, + ); + process::exit(1); + }) } diff --git a/vendor/thiserror/build/probe.rs b/vendor/thiserror/build/probe.rs new file mode 100644 index 000000000..0dce6f5b3 --- /dev/null +++ b/vendor/thiserror/build/probe.rs @@ -0,0 +1,32 @@ +// This code exercises the surface area that we expect of the Error generic +// member access API. If the current toolchain is able to compile it, then +// thiserror is able to provide backtrace support. + +#![feature(error_generic_member_access)] + +use std::error::{Error, Request}; +use std::fmt::{self, Debug, Display}; + +struct MyError(Thing); +struct Thing; + +impl Debug for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +impl Display for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +impl Error for MyError { + fn provide<'a>(&'a self, request: &mut Request<'a>) { + request.provide_ref(&self.0); + } +} + +// Include in sccache cache key. +const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP"); diff --git a/vendor/thiserror/src/lib.rs b/vendor/thiserror/src/lib.rs index 974063639..73e6e2173 100644 --- a/vendor/thiserror/src/lib.rs +++ b/vendor/thiserror/src/lib.rs @@ -228,7 +228,7 @@ //! //! [`anyhow`]: https://github.com/dtolnay/anyhow -#![doc(html_root_url = "https://docs.rs/thiserror/1.0.50")] +#![doc(html_root_url = "https://docs.rs/thiserror/1.0.56")] #![allow( clippy::module_name_repetitions, clippy::needless_lifetimes, @@ -237,6 +237,9 @@ )] #![cfg_attr(error_generic_member_access, feature(error_generic_member_access))] +#[cfg(all(thiserror_nightly_testing, not(error_generic_member_access)))] +compile_error!("Build script probe failed to compile."); + mod aserror; mod display; #[cfg(error_generic_member_access)] diff --git a/vendor/thiserror/tests/test_expr.rs b/vendor/thiserror/tests/test_expr.rs index 8db097bac..028f34ee2 100644 --- a/vendor/thiserror/tests/test_expr.rs +++ b/vendor/thiserror/tests/test_expr.rs @@ -1,8 +1,4 @@ -#![allow( - clippy::iter_cloned_collect, - clippy::option_if_let_else, - clippy::uninlined_format_args -)] +#![allow(clippy::iter_cloned_collect, clippy::uninlined_format_args)] use std::fmt::Display; use thiserror::Error; diff --git a/vendor/thiserror/tests/ui/fallback-impl-with-display.rs b/vendor/thiserror/tests/ui/fallback-impl-with-display.rs new file mode 100644 index 000000000..334118731 --- /dev/null +++ b/vendor/thiserror/tests/ui/fallback-impl-with-display.rs @@ -0,0 +1,14 @@ +use std::fmt::{self, Display}; +use thiserror::Error; + +#[derive(Error, Debug)] +#[error] +pub struct MyError; + +impl Display for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +fn main() {} diff --git a/vendor/thiserror/tests/ui/fallback-impl-with-display.stderr b/vendor/thiserror/tests/ui/fallback-impl-with-display.stderr new file mode 100644 index 000000000..6bd373073 --- /dev/null +++ b/vendor/thiserror/tests/ui/fallback-impl-with-display.stderr @@ -0,0 +1,16 @@ +error: expected attribute arguments in parentheses: #[error(...)] + --> tests/ui/fallback-impl-with-display.rs:5:3 + | +5 | #[error] + | ^^^^^ + +error[E0119]: conflicting implementations of trait `std::fmt::Display` for type `MyError` + --> tests/ui/fallback-impl-with-display.rs:4:10 + | +4 | #[derive(Error, Debug)] + | ^^^^^ conflicting implementation for `MyError` +... +8 | impl Display for MyError { + | ------------------------ first implementation here + | + = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/vendor/thiserror/tests/ui/invalid-input-impl-anyway.rs b/vendor/thiserror/tests/ui/invalid-input-impl-anyway.rs new file mode 100644 index 000000000..0a0bcbee8 --- /dev/null +++ b/vendor/thiserror/tests/ui/invalid-input-impl-anyway.rs @@ -0,0 +1,11 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +#[error] +pub struct MyError; + +fn main() { + // No error on the following line. Thiserror emits an Error impl despite the + // bad attribute. + _ = &MyError as &dyn std::error::Error; +} diff --git a/vendor/thiserror/tests/ui/invalid-input-impl-anyway.stderr b/vendor/thiserror/tests/ui/invalid-input-impl-anyway.stderr new file mode 100644 index 000000000..b98c31e9c --- /dev/null +++ b/vendor/thiserror/tests/ui/invalid-input-impl-anyway.stderr @@ -0,0 +1,5 @@ +error: expected attribute arguments in parentheses: #[error(...)] + --> tests/ui/invalid-input-impl-anyway.rs:4:3 + | +4 | #[error] + | ^^^^^ diff --git a/vendor/thiserror/tests/ui/missing-display.rs b/vendor/thiserror/tests/ui/missing-display.rs new file mode 100644 index 000000000..31e23fe68 --- /dev/null +++ b/vendor/thiserror/tests/ui/missing-display.rs @@ -0,0 +1,9 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum MyError { + First, + Second, +} + +fn main() {} diff --git a/vendor/thiserror/tests/ui/missing-display.stderr b/vendor/thiserror/tests/ui/missing-display.stderr new file mode 100644 index 000000000..48c9ded9f --- /dev/null +++ b/vendor/thiserror/tests/ui/missing-display.stderr @@ -0,0 +1,13 @@ +error[E0277]: `MyError` doesn't implement `std::fmt::Display` + --> tests/ui/missing-display.rs:4:10 + | +4 | pub enum MyError { + | ^^^^^^^ `MyError` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `MyError` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `std::error::Error` + --> $RUST/core/src/error.rs + | + | pub trait Error: Debug + Display { + | ^^^^^^^ required by this bound in `Error` diff --git a/vendor/time-macros/.cargo-checksum.json b/vendor/time-macros/.cargo-checksum.json index 43b384c37..a44e6d735 100644 --- a/vendor/time-macros/.cargo-checksum.json +++ b/vendor/time-macros/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"cdd214eacd21423c9f1ba430604c12f7b0551843f8fd4386908cb1be7de2121f","LICENSE-Apache":"b8929fea28678da67251fb2daf9438f67503814211051861612441806d8edb05","LICENSE-MIT":"04620bf27e4a643dd47bf27652320c205acdb776c1f9f24bb8c3bfaba10804c5","src/date.rs":"680dbeb4be6b8ba7be04d492047295be62b4c23d81ae2ab9494f3918e15cd590","src/datetime.rs":"5c7f6e07dc2f0dcfcd86216664df53bc008dbc86f346df57a9ff57f52fe43bc6","src/error.rs":"b3dea92631092068dd73e57e1cbf548f7ae85762826dcdea7fd6454bf357a50a","src/format_description/ast.rs":"8ba87e3249766b89c42b040f623d3134aeec46b78208fdfee825ed0eeeb4591a","src/format_description/format_item.rs":"3b3d017166802d14cbb30d1b02619fc6cf3d0a1683ca5d3d52fc771790bed4ee","src/format_description/lexer.rs":"e7db7b6431f00c81b8d15a162088a1622ecd65bfb58d4e642c3c93a8dd5ae4ad","src/format_description/mod.rs":"f48c0ff590bc74529f06a98f60a6af5814bc30d1456bf0b81ac334c0b3f41bba","src/format_description/public/component.rs":"5d86912e247724957f7183d70745ced20a7408ed90c24bb47da73a0e26550899","src/format_description/public/mod.rs":"5260592b310ea9e30808d30c92ea94c7bf1bdb171250a1342279e927d2528d73","src/format_description/public/modifier.rs":"e1d8fdababcaee2e181a7acb3a938baf309f5a0e2d3877585cf678fcc12f212a","src/helpers/mod.rs":"a8f8ed59a72b239d7a530357d212873f2e75ea924ec19a6d5d6e24a2baa8100c","src/helpers/string.rs":"3af2d0c701ca978c705922a272e76506dbdf0f376d44ed9ae7283086c67852ba","src/lib.rs":"ae001dd70bc5a07ad62aeba90a58b3a24830667db4bc92b0fda82ccc57422d34","src/offset.rs":"dd33a76a8ca22145817dc424549f125d786de535c540cb5a93bad48bd4edcc78","src/quote.rs":"d3003dafa3073825f188851a974846099681cc81145070affb033469cbc7bb31","src/serde_format_description.rs":"db5fb2dc94e01c5114cab3484e68334516d53c4642f31dae0d66f1183253a17c","src/time.rs":"299ddb54e44fb88e514592db5335f06352ebdd0dbf064752790657db85f4c13c","src/to_tokens.rs":"afb067f4d95d19c1b7a650cbcf60ae155b5a9619c89825867997f39ce163ac94"},"package":"4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"} \ No newline at end of file +{"files":{"Cargo.toml":"f27dd2e2477b3acea11773c84d6763db3b62e02f786af81504471c2d3414e9c6","LICENSE-Apache":"edd65bdd88957a205c47d53fa499eed8865a70320f0f03f6391668cb304ea376","LICENSE-MIT":"231c837c45eb53f108fb48929e488965bc4fcc14e9ea21d35f50e6b99d98685b","src/date.rs":"be197c8a2ed37e8b3123a798a91697b0e61cf9b60e7b1898a0e1b458fe8e3ef1","src/datetime.rs":"5c7f6e07dc2f0dcfcd86216664df53bc008dbc86f346df57a9ff57f52fe43bc6","src/error.rs":"b3dea92631092068dd73e57e1cbf548f7ae85762826dcdea7fd6454bf357a50a","src/format_description/ast.rs":"8ba87e3249766b89c42b040f623d3134aeec46b78208fdfee825ed0eeeb4591a","src/format_description/format_item.rs":"3b3d017166802d14cbb30d1b02619fc6cf3d0a1683ca5d3d52fc771790bed4ee","src/format_description/lexer.rs":"e7db7b6431f00c81b8d15a162088a1622ecd65bfb58d4e642c3c93a8dd5ae4ad","src/format_description/mod.rs":"f48c0ff590bc74529f06a98f60a6af5814bc30d1456bf0b81ac334c0b3f41bba","src/format_description/public/component.rs":"5d86912e247724957f7183d70745ced20a7408ed90c24bb47da73a0e26550899","src/format_description/public/mod.rs":"5260592b310ea9e30808d30c92ea94c7bf1bdb171250a1342279e927d2528d73","src/format_description/public/modifier.rs":"e1d8fdababcaee2e181a7acb3a938baf309f5a0e2d3877585cf678fcc12f212a","src/helpers/mod.rs":"af47d6c053ffd1113788c5d7591d46fa7d879dc0c5cb2c6c02f9c05462499c4f","src/helpers/string.rs":"3af2d0c701ca978c705922a272e76506dbdf0f376d44ed9ae7283086c67852ba","src/lib.rs":"ae001dd70bc5a07ad62aeba90a58b3a24830667db4bc92b0fda82ccc57422d34","src/offset.rs":"aed29d0da9fc65a7dc77314e0346dfdc6fdaf663f17adf9edf00933e8f8e605f","src/quote.rs":"d3003dafa3073825f188851a974846099681cc81145070affb033469cbc7bb31","src/serde_format_description.rs":"db5fb2dc94e01c5114cab3484e68334516d53c4642f31dae0d66f1183253a17c","src/time.rs":"299ddb54e44fb88e514592db5335f06352ebdd0dbf064752790657db85f4c13c","src/to_tokens.rs":"afb067f4d95d19c1b7a650cbcf60ae155b5a9619c89825867997f39ce163ac94"},"package":"7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"} \ No newline at end of file diff --git a/vendor/time-macros/Cargo.toml b/vendor/time-macros/Cargo.toml index 536941717..173839153 100644 --- a/vendor/time-macros/Cargo.toml +++ b/vendor/time-macros/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.67.0" name = "time-macros" -version = "0.2.15" +version = "0.2.17" authors = [ "Jacob Pratt ", "Time contributors", @@ -38,6 +38,9 @@ rustdoc-args = ["--generate-link-to-definition"] [lib] proc-macro = true +[dependencies.num-conv] +version = "0.1.0" + [dependencies.time-core] version = "=0.1.2" @@ -46,3 +49,88 @@ formatting = [] large-dates = [] parsing = [] serde = [] + +[lints.clippy] +all = "warn" +alloc-instead-of-core = "deny" +dbg-macro = "warn" +decimal-literal-representation = "warn" +explicit-auto-deref = "warn" +get-unwrap = "warn" +manual-let-else = "warn" +missing-docs-in-private-items = "warn" +missing-enforced-import-renames = "warn" +nursery = "warn" +obfuscated-if-else = "warn" +print-stdout = "warn" +semicolon-outside-block = "warn" +std-instead-of-core = "deny" +todo = "warn" +undocumented-unsafe-blocks = "deny" +unimplemented = "warn" +uninlined-format-args = "warn" +unnested-or-patterns = "warn" +unwrap-in-result = "warn" +unwrap-used = "warn" +use-debug = "warn" + +[lints.clippy.option-if-let-else] +level = "allow" +priority = 1 + +[lints.clippy.redundant-pub-crate] +level = "allow" +priority = 1 + +[lints.rust] +ambiguous-glob-reexports = "deny" +clashing-extern-declarations = "deny" +const-item-mutation = "deny" +deref-nullptr = "deny" +drop-bounds = "deny" +future-incompatible = "deny" +hidden-glob-reexports = "deny" +improper-ctypes = "deny" +improper-ctypes-definitions = "deny" +invalid-from-utf8 = "deny" +invalid-macro-export-arguments = "deny" +invalid-nan-comparisons = "deny" +invalid-reference-casting = "deny" +invalid-value = "deny" +keyword-idents = "warn" +let-underscore = "warn" +macro-use-extern-crate = "warn" +meta-variable-misuse = "warn" +missing-abi = "warn" +missing-copy-implementations = "warn" +missing-debug-implementations = "warn" +missing-docs = "warn" +named-arguments-used-positionally = "deny" +non-ascii-idents = "deny" +noop-method-call = "warn" +opaque-hidden-inferred-bound = "deny" +overlapping-range-endpoints = "deny" +single-use-lifetimes = "warn" +suspicious-double-ref-op = "deny" +temporary-cstring-as-ptr = "deny" +trivial-casts = "warn" +trivial-numeric-casts = "warn" +unconditional-recursion = "deny" +unnameable-test-items = "deny" +unreachable-pub = "warn" +unsafe-op-in-unsafe-fn = "deny" +unstable-syntax-pre-expansion = "deny" +unused = "warn" +unused-import-braces = "warn" +unused-lifetimes = "warn" +unused-qualifications = "warn" +unused-tuple-struct-fields = "warn" +variant-size-differences = "warn" + +[lints.rust.unstable-name-collisions] +level = "warn" +priority = 1 + +[lints.rustdoc] +private-doc-tests = "warn" +unescaped-backticks = "warn" diff --git a/vendor/time-macros/LICENSE-Apache b/vendor/time-macros/LICENSE-Apache index 7646f21e3..c763a0c9d 100644 --- a/vendor/time-macros/LICENSE-Apache +++ b/vendor/time-macros/LICENSE-Apache @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Jacob Pratt et al. + Copyright 2024 Jacob Pratt et al. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/time-macros/LICENSE-MIT b/vendor/time-macros/LICENSE-MIT index a11a75573..5cc097f1c 100644 --- a/vendor/time-macros/LICENSE-MIT +++ b/vendor/time-macros/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2022 Jacob Pratt et al. +Copyright (c) 2024 Jacob Pratt et al. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/time-macros/src/date.rs b/vendor/time-macros/src/date.rs index fa16ccb8d..03cbf11ae 100644 --- a/vendor/time-macros/src/date.rs +++ b/vendor/time-macros/src/date.rs @@ -1,5 +1,6 @@ use std::iter::Peekable; +use num_conv::Truncate; use proc_macro::{token_stream, TokenTree}; use time_core::util::{days_in_year, weeks_in_year}; @@ -93,7 +94,7 @@ pub(crate) fn parse(chars: &mut Peekable) -> Result days_in_year_month(year, month) { return Err(Error::InvalidComponent { name: "day", diff --git a/vendor/time-macros/src/helpers/mod.rs b/vendor/time-macros/src/helpers/mod.rs index 56300b3e6..0cca2002d 100644 --- a/vendor/time-macros/src/helpers/mod.rs +++ b/vendor/time-macros/src/helpers/mod.rs @@ -4,6 +4,7 @@ mod string; use std::iter::Peekable; use std::str::FromStr; +use num_conv::prelude::*; use proc_macro::{token_stream, Span, TokenTree}; use time_core::util::{days_in_year, is_leap_year}; @@ -92,15 +93,17 @@ fn jan_weekday(year: i32, ordinal: i32) -> u8 { } let adj_year = year - 1; - ((ordinal + adj_year + div_floor!(adj_year, 4) - div_floor!(adj_year, 100) + (ordinal + adj_year + div_floor!(adj_year, 4) - div_floor!(adj_year, 100) + div_floor!(adj_year, 400) + 6) - .rem_euclid(7)) as _ + .rem_euclid(7) + .cast_unsigned() + .truncate() } pub(crate) fn days_in_year_month(year: i32, month: u8) -> u8 { - [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month as usize - 1] - + (month == 2 && is_leap_year(year)) as u8 + [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month.extend::() - 1] + + u8::from(month == 2 && is_leap_year(year)) } pub(crate) fn ywd_to_yo(year: i32, week: u8, iso_weekday_number: u8) -> (i32, u16) { @@ -120,8 +123,9 @@ pub(crate) fn ywd_to_yo(year: i32, week: u8, iso_weekday_number: u8) -> (i32, u1 } pub(crate) fn ymd_to_yo(year: i32, month: u8, day: u8) -> (i32, u16) { - let ordinal = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334][month as usize - 1] - + (month > 2 && is_leap_year(year)) as u16; + let ordinal = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] + [month.extend::() - 1] + + u16::from(month > 2 && is_leap_year(year)); (year, ordinal + u16::from(day)) } diff --git a/vendor/time-macros/src/offset.rs b/vendor/time-macros/src/offset.rs index b9a3c610a..04dd37f13 100644 --- a/vendor/time-macros/src/offset.rs +++ b/vendor/time-macros/src/offset.rs @@ -1,5 +1,6 @@ use std::iter::Peekable; +use num_conv::prelude::*; use proc_macro::{token_stream, Span, TokenTree}; use time_core::convert::*; @@ -52,21 +53,21 @@ pub(crate) fn parse(chars: &mut Peekable) -> Result= 24 { + if hours > 25 { Err(Error::InvalidComponent { name: "hour", value: hours.to_string(), span_start: Some(hours_span), span_end: Some(hours_span), }) - } else if minutes >= Minute::per(Hour) as _ { + } else if minutes >= Minute::per(Hour).cast_signed() { Err(Error::InvalidComponent { name: "minute", value: minutes.to_string(), span_start: Some(minutes_span), span_end: Some(minutes_span), }) - } else if seconds >= Second::per(Minute) as _ { + } else if seconds >= Second::per(Minute).cast_signed() { Err(Error::InvalidComponent { name: "second", value: seconds.to_string(), diff --git a/vendor/time/.cargo-checksum.json b/vendor/time/.cargo-checksum.json index 410f8fb92..abd479e77 100644 --- a/vendor/time/.cargo-checksum.json +++ b/vendor/time/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f05ee952cdbcdad4120053c1c990b0771102b1cf2a27cbb43af5d6384384afbc","LICENSE-Apache":"b8929fea28678da67251fb2daf9438f67503814211051861612441806d8edb05","LICENSE-MIT":"04620bf27e4a643dd47bf27652320c205acdb776c1f9f24bb8c3bfaba10804c5","README.md":"36c735ebe90cdc962dec7e240607a052088697d0cefd555f093746039b0943cd","src/date.rs":"e7416c75800456e626f9c85b51775d5101d3bc89ca095b370cd8791f41e4f240","src/date_time.rs":"fbc24c3b047ba56f7d5fc33ce8914f6f6ee70c495ce5336fa21dd20bbdecbcb6","src/duration.rs":"a191b4a0e86e83b3108a707341b7c55c6df875ab5ae2fb41a7674a98d2e19c41","src/error/component_range.rs":"26a1aa4ea2d0f9887efcbe9584d5aa14b1e5d37525a52dc9f18e1e282599625d","src/error/conversion_range.rs":"972abb765370070de01e2fc2e1bb1e80808a069e6213577d7beaca02e1d707c3","src/error/different_variant.rs":"107bef7b3addd7108b36a2da8389f611d4482f34a5b63429841141e05c8cb30c","src/error/format.rs":"d87846c2ac62dec421402ea21e5d2a8d73add6658df4ac914067a4b43cb0ef20","src/error/indeterminate_offset.rs":"1f52f9ea107847fa781399cfcc8046451d70155fb497486c80b2138f82782941","src/error/invalid_format_description.rs":"cf617348b55d9c3273060fa2d99bd4eda215452270025f2b6caef6ef9f387af5","src/error/invalid_variant.rs":"b653a3e6e902f06cb9f2e0366c4da84b92e8bdb03164c2f8cb15fe66415706e4","src/error/mod.rs":"a30edbd2cdc701d0327291ef1201aa1531ab8bb1a1318945085ab71f8918bb16","src/error/parse.rs":"a3f23c10cab2e4ce159c5b3d5774d54214bd0098b70a59c48a2407777cdee9e5","src/error/parse_from_description.rs":"2de1f5b5af3d9bb358cee1c66a2721a78ee99f0ee5e0c06f159e62de7a294a5f","src/error/try_from_parsed.rs":"8c227be52653a1d33af01a8024c0fc56f1f9803f08ef01487a7eaa5833adbb57","src/ext.rs":"3f4a1a0fc601b06c3b068c3bf4060d427131501084b3e52e092ca0de432490b7","src/format_description/borrowed_format_item.rs":"afab66e65a84895751d3557fc5b8a3a5e63f9c483a6a534aa4f86fd2a5145f0b","src/format_description/component.rs":"b65c0ca896ea6ec8dbfc7570c69849c88cbba6031a2847dcfdce06d721a59397","src/format_description/mod.rs":"955a227e9bb13e3085a43457bf8028085db92c0266b6573ddf1e12df3b937c0f","src/format_description/modifier.rs":"450e6fc64353f80304c2b616bf3e8c58f1ae02e0a2875e946cf0ea27e87a4e10","src/format_description/owned_format_item.rs":"419f5354bf504562c9225dfe90b61eee9bc959211a86a327197b4f54283da775","src/format_description/parse/ast.rs":"f96b423629e265d85f4068c7590a27405cb5b4275bf9f547e674f337b281a58e","src/format_description/parse/format_item.rs":"959e8f3112fd774fb71f541216e960ff64ceb84767700c77997d80fb9dddc6e5","src/format_description/parse/lexer.rs":"c10105640a618e1e850eb6e4fd888c47d881b3f85bde691fdf204199a693e127","src/format_description/parse/mod.rs":"210cd68a37b5cbbc6a6e3b3d5161f03ad94b2902bb01899d0c02d0278f420c8c","src/format_description/well_known/iso8601.rs":"e2ed825acffbd66d8798c899c14d32e3f73fea95e8cff324199081034a5b7a2f","src/format_description/well_known/iso8601/adt_hack.rs":"8f1d5f4a0959070ab96343868086adfa6fa3f5a5823f50a111c824b4a9bcd39b","src/format_description/well_known/rfc2822.rs":"36c23394724ae12250d4193cab26887a6ff8f82ca441ea6b0d03c4f1c928b3dd","src/format_description/well_known/rfc3339.rs":"1a6318dffd3ebb6ac7cf96eae3d9b1eb44b1089cf4284fa6a7e935c6fcf1b43c","src/formatting/formattable.rs":"81c99395d5366ab16d0251af705ce0a7a68d77119cb7d563ea2cf096a5b7da33","src/formatting/iso8601.rs":"5b17b9b39747af50e06d2c93615b293b132cd189524af42811a0ddeb18b27166","src/formatting/mod.rs":"48f2894e390432d0d99a4ba07bd9f5b409995089bd3edb14497976dddfdd4f82","src/instant.rs":"72ea1cba450d8cdc12a7600e54d51e5ad63de38039b74daaf01f1a077111eb10","src/internal_macros.rs":"b8767d91b5b1c5a8a2221eec2876b5361451dce90cea2cb842a7112b91e8e7b5","src/lib.rs":"954277e5cb6b846d2eee77ff85993aa668904382280476eb63f6d53eeb030b72","src/macros.rs":"eb9e02a1f97bb8befab7bc27c937136817e4f65e0b3e040a81394ae938980558","src/month.rs":"cee05aaad0088a38f0bec22dc913590c18d3bc74208aa72394512424677ffd25","src/offset_date_time.rs":"b29c929042a99e3d63ef112a80799c5b60e703514c0bcf215f46e309f540a2c1","src/parsing/combinator/mod.rs":"b342fbd95dd986309d81e8910363920ba6db00958b459f6d97f57da3ae3e550d","src/parsing/combinator/rfc/iso8601.rs":"13289a0d58de273327830a3001167a8964edc5045486301efdf3ddc2e4079c32","src/parsing/combinator/rfc/mod.rs":"f30b75d248f5ae92c27646d504703f5489185afb76c998cc4375437b3d15c822","src/parsing/combinator/rfc/rfc2234.rs":"08e2813c6d40c0dae881875fe0417ae06886c73679256587e33186e46b3c3bae","src/parsing/combinator/rfc/rfc2822.rs":"2aff3a6a2778bc806031cff92ad2f43f0874620b5d484b5b39ee2d2507212f06","src/parsing/component.rs":"616cd06d429ac9efa8313277ed6096347fcec07cc89e3a46f0742abdd4662674","src/parsing/iso8601.rs":"07b2aacb8d24e865d5816c329eff0f8f1b55ad2bda743d0b0f7c724b2f7ec64a","src/parsing/mod.rs":"37082ac824c6c3f4900766a0a3140dc7aa46b3f85cb6098f11da7da333e421b0","src/parsing/parsable.rs":"01b10814c1036113fb4f3da3a8568e64b2f46a68436f5245c3026255fbc49f78","src/parsing/parsed.rs":"9f3825d50a6d62d282193881b4434812dc66b3a4b654a478cd7a53c002ac1f36","src/parsing/shim.rs":"46efc374bc3129e28936a850143fff8e42aafe10c69ebbb904195aaeca26adc9","src/primitive_date_time.rs":"296c62a0e8359eb0a30b379b498e29907e9729113482146ce7ea5ed5ff23591d","src/quickcheck.rs":"56146c3de1f303e9df46ae6e929b1396618ee39f0f30da5e43a3f9ae6dfd2fd8","src/rand.rs":"dcedb2473e240c46de00aa4b156d66cb755da9d5fd04adaedb3682cb6a12218f","src/serde/iso8601.rs":"997bbf4fe4018f8fdc9335ac863b543fb24a58b2dee394615505a24311331516","src/serde/mod.rs":"3f7647ac257e87cfbc4820332be43dd575fc082c74f322343662b189fb5c7619","src/serde/rfc2822.rs":"fe97aa1311037a362eb477fe8c6729b3b85ff2d0afab7148f10f64d109081f90","src/serde/rfc3339.rs":"9835c8b8fb24b53657769b81a71188fe4261e5869917779e1702b3a0aa854654","src/serde/timestamp.rs":"30971ad5d1fef11e396eee48d476b828ed4e99f6eac587383b864dd95c120fe4","src/serde/visitor.rs":"973ba2826134d09b109ef7c09a80c48ab724bd9051706bfde85e1ba930e00134","src/sys/local_offset_at/imp.rs":"4b6e57f02566364270ac9b7e1540290a5658a296f7e911f988264d103e420326","src/sys/local_offset_at/mod.rs":"95b042824b414b3021eda2bcf0821afc529bfd8d4cfcad0b893edb197e48461b","src/sys/local_offset_at/unix.rs":"ce02c86c4b4588ef3ebfa56bc82ff09e83677fc7679e61843b0bd80c4308fcbc","src/sys/local_offset_at/wasm_js.rs":"95baec44baaa4be78925fcbab1551e45b1884e59bdb448692ccdd6b251645c2c","src/sys/local_offset_at/windows.rs":"180d88935d4621a0b3b76d6b0c4bf429f47c234a8d1cea5b58d1f1a5a8c3397d","src/sys/mod.rs":"0a43797e55e986233a71f1cc4b3a21997da42bc15db7d912373296cd535e49bc","src/tests.rs":"3e4b8f398772712ace2c6928f09582740e90df23fa01961f0af490d2f1247120","src/time.rs":"02e022b8b0137ea1cec53f8776121b7beb1030522b4a65c3ffa234807a18e797","src/utc_offset.rs":"af14cea10bc48e16d5c6f7b8208fd3a2aedb338c390e67ba0c099616524ace3a","src/util.rs":"1fff6c7d712a4d2665cca55db9c142185cc13afa20f925912cb85abbcc366938","src/weekday.rs":"76ed201232f03077474c05e53f34b0403ead637c40a5228b9b61b342048f2917"},"package":"c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"} \ No newline at end of file +{"files":{"Cargo.toml":"6bffc488f406ac4e3a244550d70628979356cac9a71afb804f13df4e96f5540a","LICENSE-Apache":"edd65bdd88957a205c47d53fa499eed8865a70320f0f03f6391668cb304ea376","LICENSE-MIT":"231c837c45eb53f108fb48929e488965bc4fcc14e9ea21d35f50e6b99d98685b","README.md":"36c735ebe90cdc962dec7e240607a052088697d0cefd555f093746039b0943cd","src/date.rs":"401b875f41ef86035ab863e35170ef8f8e05e5ed225be4ae3d15ba2915348f3e","src/duration.rs":"cf6e8b6192fc17538ca7e9a790bdd60747b74db1d78138126a8a6db4dc7c7959","src/error/component_range.rs":"26a1aa4ea2d0f9887efcbe9584d5aa14b1e5d37525a52dc9f18e1e282599625d","src/error/conversion_range.rs":"972abb765370070de01e2fc2e1bb1e80808a069e6213577d7beaca02e1d707c3","src/error/different_variant.rs":"107bef7b3addd7108b36a2da8389f611d4482f34a5b63429841141e05c8cb30c","src/error/format.rs":"d87846c2ac62dec421402ea21e5d2a8d73add6658df4ac914067a4b43cb0ef20","src/error/indeterminate_offset.rs":"1f52f9ea107847fa781399cfcc8046451d70155fb497486c80b2138f82782941","src/error/invalid_format_description.rs":"cf617348b55d9c3273060fa2d99bd4eda215452270025f2b6caef6ef9f387af5","src/error/invalid_variant.rs":"b653a3e6e902f06cb9f2e0366c4da84b92e8bdb03164c2f8cb15fe66415706e4","src/error/mod.rs":"a30edbd2cdc701d0327291ef1201aa1531ab8bb1a1318945085ab71f8918bb16","src/error/parse.rs":"a3f23c10cab2e4ce159c5b3d5774d54214bd0098b70a59c48a2407777cdee9e5","src/error/parse_from_description.rs":"2de1f5b5af3d9bb358cee1c66a2721a78ee99f0ee5e0c06f159e62de7a294a5f","src/error/try_from_parsed.rs":"8c227be52653a1d33af01a8024c0fc56f1f9803f08ef01487a7eaa5833adbb57","src/ext.rs":"fd8cfb4765d403c58719251d3bd7d774e7da6b7c6f8bb6baa9582fbb47069080","src/format_description/borrowed_format_item.rs":"afab66e65a84895751d3557fc5b8a3a5e63f9c483a6a534aa4f86fd2a5145f0b","src/format_description/component.rs":"b65c0ca896ea6ec8dbfc7570c69849c88cbba6031a2847dcfdce06d721a59397","src/format_description/mod.rs":"955a227e9bb13e3085a43457bf8028085db92c0266b6573ddf1e12df3b937c0f","src/format_description/modifier.rs":"450e6fc64353f80304c2b616bf3e8c58f1ae02e0a2875e946cf0ea27e87a4e10","src/format_description/owned_format_item.rs":"419f5354bf504562c9225dfe90b61eee9bc959211a86a327197b4f54283da775","src/format_description/parse/ast.rs":"f96b423629e265d85f4068c7590a27405cb5b4275bf9f547e674f337b281a58e","src/format_description/parse/format_item.rs":"959e8f3112fd774fb71f541216e960ff64ceb84767700c77997d80fb9dddc6e5","src/format_description/parse/lexer.rs":"c10105640a618e1e850eb6e4fd888c47d881b3f85bde691fdf204199a693e127","src/format_description/parse/mod.rs":"210cd68a37b5cbbc6a6e3b3d5161f03ad94b2902bb01899d0c02d0278f420c8c","src/format_description/well_known/iso8601.rs":"30b2f495044ab4e1f3ff6a317a8b4ca2ffb46b7cc23428eca8b685c0f16518cc","src/format_description/well_known/iso8601/adt_hack.rs":"8f1d5f4a0959070ab96343868086adfa6fa3f5a5823f50a111c824b4a9bcd39b","src/format_description/well_known/rfc2822.rs":"36c23394724ae12250d4193cab26887a6ff8f82ca441ea6b0d03c4f1c928b3dd","src/format_description/well_known/rfc3339.rs":"1a6318dffd3ebb6ac7cf96eae3d9b1eb44b1089cf4284fa6a7e935c6fcf1b43c","src/formatting/formattable.rs":"62bec03f033563ad11571eca7b2b2395c1667534d639cb860e571f343ebbe949","src/formatting/iso8601.rs":"1d265461a515406c1253350b5eb870b5416f9ce76cdf96a8fbfb7c4b57dcb623","src/formatting/mod.rs":"115af930b598ed77a9b55ba8f7d89befefb1f21cec960ebd2c315188a25ba07d","src/instant.rs":"fed0be520dd9870d7557630641bf3cb19f87af77d0f058efeba06d42b8b07c8a","src/internal_macros.rs":"cf2479614cc66f3b9c533f5f5c4584fe90136c7ad4d0c2137d5aa386ffa5319f","src/lib.rs":"969a6836b72c463a77f80e7c5ac3ba43ce0f75a0ba949357fdb71c24a836612c","src/macros.rs":"eb9e02a1f97bb8befab7bc27c937136817e4f65e0b3e040a81394ae938980558","src/month.rs":"cee05aaad0088a38f0bec22dc913590c18d3bc74208aa72394512424677ffd25","src/offset_date_time.rs":"a92ebc487fc131645fcaa09d2c69d8a3f6a0a32e9d77102269cc2560a5389864","src/parsing/combinator/mod.rs":"e49d14f7d0c38a847d9f5f2e63d466464641d365f1d39c48d1a455ebe6632ec5","src/parsing/combinator/rfc/iso8601.rs":"8b819a8e3ef4b160b1bce94cad6534e3c0acbeef98cfc494606815468781c19a","src/parsing/combinator/rfc/mod.rs":"f30b75d248f5ae92c27646d504703f5489185afb76c998cc4375437b3d15c822","src/parsing/combinator/rfc/rfc2234.rs":"08e2813c6d40c0dae881875fe0417ae06886c73679256587e33186e46b3c3bae","src/parsing/combinator/rfc/rfc2822.rs":"2aff3a6a2778bc806031cff92ad2f43f0874620b5d484b5b39ee2d2507212f06","src/parsing/component.rs":"32d69c4f86e3a2e90dffbd74af8b19ea25dbeaa6f60aa89637f3988d64fd7967","src/parsing/iso8601.rs":"aea052f94c8a6510d3fb9802d07c1ecba30656a9b1e4393487783abeb5b2db18","src/parsing/mod.rs":"7d790f512710dc33b9f6f51e4237c04812aafd7d68710df01d02d755062568d7","src/parsing/parsable.rs":"bd829536812e4fa0459dffd7a8c4b65bd7610633b43d5aef574f46611b2a1ca0","src/parsing/parsed.rs":"83000fac537444b61487df164db4ca19cae46a8154c9792fbcaace627a06f110","src/parsing/shim.rs":"46efc374bc3129e28936a850143fff8e42aafe10c69ebbb904195aaeca26adc9","src/primitive_date_time.rs":"e9ead2eb93445b5d6a24f32e858c75067ecf7493f6cdf2bd2511a0b9e2f99419","src/quickcheck.rs":"09baaccea54f77cc60d1c43a726275d15db42e1c8b4ec157d4417d3cded36762","src/rand.rs":"dcedb2473e240c46de00aa4b156d66cb755da9d5fd04adaedb3682cb6a12218f","src/serde/iso8601.rs":"997bbf4fe4018f8fdc9335ac863b543fb24a58b2dee394615505a24311331516","src/serde/mod.rs":"161812a20a48145068c9430c1856a3d538ba0e9d58758907199ba02546f66c49","src/serde/rfc2822.rs":"fe97aa1311037a362eb477fe8c6729b3b85ff2d0afab7148f10f64d109081f90","src/serde/rfc3339.rs":"9835c8b8fb24b53657769b81a71188fe4261e5869917779e1702b3a0aa854654","src/serde/timestamp/microseconds.rs":"7b8a0f6e455ddb6c50ed4a8473ea68cf9aacb31af36ccc058b68fa3bb5f3246d","src/serde/timestamp/milliseconds.rs":"df995f05f340f0429697269aa152a39b0beca45e1b4d8e60f4a6bb27f09a4d88","src/serde/timestamp/mod.rs":"20ddd158fe5e491f9f7e74ef074d2bb10c8b02b1fcd399c0429fd796d799aa01","src/serde/timestamp/nanoseconds.rs":"a46b1e60e8b19792a26ebdab33cba53db95cb13e3c4d9675a17b1491e9fb2940","src/serde/visitor.rs":"973ba2826134d09b109ef7c09a80c48ab724bd9051706bfde85e1ba930e00134","src/sys/local_offset_at/imp.rs":"4b6e57f02566364270ac9b7e1540290a5658a296f7e911f988264d103e420326","src/sys/local_offset_at/mod.rs":"95b042824b414b3021eda2bcf0821afc529bfd8d4cfcad0b893edb197e48461b","src/sys/local_offset_at/unix.rs":"ce02c86c4b4588ef3ebfa56bc82ff09e83677fc7679e61843b0bd80c4308fcbc","src/sys/local_offset_at/wasm_js.rs":"285f68684f4340742ac3a6c949fc2fabca6ee319386d5b438cc1c3cc29740bdd","src/sys/local_offset_at/windows.rs":"82dc1832bd3754e076a66fa989df8565c449d3ff3367024da601c1681d3db928","src/sys/mod.rs":"0a43797e55e986233a71f1cc4b3a21997da42bc15db7d912373296cd535e49bc","src/tests.rs":"3e4b8f398772712ace2c6928f09582740e90df23fa01961f0af490d2f1247120","src/time.rs":"3b4b428c9018eef02ab7b3b665a70d2fb14c62c11822ee08ac9cdcb1bdee832c","src/utc_offset.rs":"73e6cd2a699d776226b02e54b611032c8295b4ff46268fb307bb6a847c381c78","src/util.rs":"1fff6c7d712a4d2665cca55db9c142185cc13afa20f925912cb85abbcc366938","src/weekday.rs":"76ed201232f03077474c05e53f34b0403ead637c40a5228b9b61b342048f2917"},"package":"fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd"} \ No newline at end of file diff --git a/vendor/time/Cargo.toml b/vendor/time/Cargo.toml index 112b9d9b3..f63c0c835 100644 --- a/vendor/time/Cargo.toml +++ b/vendor/time/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.67.0" name = "time" -version = "0.3.30" +version = "0.3.32" authors = [ "Jacob Pratt ", "Time contributors", @@ -71,6 +71,9 @@ default-features = false version = "1.0.1" optional = true +[dependencies.num-conv] +version = "0.1.0" + [dependencies.powerfmt] version = "0.2.0" default-features = false @@ -94,9 +97,12 @@ default-features = false version = "=0.1.2" [dependencies.time-macros] -version = "=0.2.15" +version = "=0.2.17" optional = true +[dev-dependencies.num-conv] +version = "0.1.0" + [dev-dependencies.quickcheck_macros] version = "1.0.0" @@ -123,7 +129,7 @@ version = "1.0.68" version = "1.0.126" [dev-dependencies.time-macros] -version = "=0.2.15" +version = "=0.2.17" [features] alloc = ["serde?/alloc"] @@ -189,3 +195,88 @@ optional = true [target."cfg(target_family = \"unix\")".dependencies.num_threads] version = "0.1.2" optional = true + +[lints.clippy] +all = "warn" +alloc-instead-of-core = "deny" +dbg-macro = "warn" +decimal-literal-representation = "warn" +explicit-auto-deref = "warn" +get-unwrap = "warn" +manual-let-else = "warn" +missing-docs-in-private-items = "warn" +missing-enforced-import-renames = "warn" +nursery = "warn" +obfuscated-if-else = "warn" +print-stdout = "warn" +semicolon-outside-block = "warn" +std-instead-of-core = "deny" +todo = "warn" +undocumented-unsafe-blocks = "deny" +unimplemented = "warn" +uninlined-format-args = "warn" +unnested-or-patterns = "warn" +unwrap-in-result = "warn" +unwrap-used = "warn" +use-debug = "warn" + +[lints.clippy.option-if-let-else] +level = "allow" +priority = 1 + +[lints.clippy.redundant-pub-crate] +level = "allow" +priority = 1 + +[lints.rust] +ambiguous-glob-reexports = "deny" +clashing-extern-declarations = "deny" +const-item-mutation = "deny" +deref-nullptr = "deny" +drop-bounds = "deny" +future-incompatible = "deny" +hidden-glob-reexports = "deny" +improper-ctypes = "deny" +improper-ctypes-definitions = "deny" +invalid-from-utf8 = "deny" +invalid-macro-export-arguments = "deny" +invalid-nan-comparisons = "deny" +invalid-reference-casting = "deny" +invalid-value = "deny" +keyword-idents = "warn" +let-underscore = "warn" +macro-use-extern-crate = "warn" +meta-variable-misuse = "warn" +missing-abi = "warn" +missing-copy-implementations = "warn" +missing-debug-implementations = "warn" +missing-docs = "warn" +named-arguments-used-positionally = "deny" +non-ascii-idents = "deny" +noop-method-call = "warn" +opaque-hidden-inferred-bound = "deny" +overlapping-range-endpoints = "deny" +single-use-lifetimes = "warn" +suspicious-double-ref-op = "deny" +temporary-cstring-as-ptr = "deny" +trivial-casts = "warn" +trivial-numeric-casts = "warn" +unconditional-recursion = "deny" +unnameable-test-items = "deny" +unreachable-pub = "warn" +unsafe-op-in-unsafe-fn = "deny" +unstable-syntax-pre-expansion = "deny" +unused = "warn" +unused-import-braces = "warn" +unused-lifetimes = "warn" +unused-qualifications = "warn" +unused-tuple-struct-fields = "warn" +variant-size-differences = "warn" + +[lints.rust.unstable-name-collisions] +level = "warn" +priority = 1 + +[lints.rustdoc] +private-doc-tests = "warn" +unescaped-backticks = "warn" diff --git a/vendor/time/LICENSE-Apache b/vendor/time/LICENSE-Apache index 7646f21e3..c763a0c9d 100644 --- a/vendor/time/LICENSE-Apache +++ b/vendor/time/LICENSE-Apache @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Jacob Pratt et al. + Copyright 2024 Jacob Pratt et al. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/time/LICENSE-MIT b/vendor/time/LICENSE-MIT index a11a75573..5cc097f1c 100644 --- a/vendor/time/LICENSE-MIT +++ b/vendor/time/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2022 Jacob Pratt et al. +Copyright (c) 2024 Jacob Pratt et al. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/time/src/date.rs b/vendor/time/src/date.rs index 5e62dfabc..71dfc32a0 100644 --- a/vendor/time/src/date.rs +++ b/vendor/time/src/date.rs @@ -8,6 +8,7 @@ use core::{cmp, fmt}; use std::io; use deranged::RangedI32; +use num_conv::prelude::*; use powerfmt::ext::FormatterExt; use powerfmt::smart_display::{self, FormatterOptions, Metadata, SmartDisplay}; @@ -1149,6 +1150,34 @@ impl Date { ) }) } + + /// Replace the day of the year. + /// + /// ```rust + /// # use time_macros::date; + /// assert_eq!(date!(2022 - 049).replace_ordinal(1), Ok(date!(2022 - 001))); + /// assert!(date!(2022 - 049).replace_ordinal(0).is_err()); // 0 isn't a valid ordinal + /// assert!(date!(2022 - 049).replace_ordinal(366).is_err()); // 2022 isn't a leap year + /// ```` + #[must_use = "This method does not mutate the original `Date`."] + pub const fn replace_ordinal(self, ordinal: u16) -> Result { + match ordinal { + 1..=365 => {} + 366 if is_leap_year(self.year()) => {} + _ => { + return Err(crate::error::ComponentRange { + name: "ordinal", + minimum: 1, + maximum: days_in_year(self.year()) as _, + value: ordinal as _, + conditional_range: true, + }); + } + } + + // Safety: `ordinal` is in range. + Ok(unsafe { Self::__from_ordinal_date_unchecked(self.year(), ordinal) }) + } // endregion replacement } @@ -1337,10 +1366,10 @@ impl SmartDisplay for Date { false }; - let formatted_width = year_width as usize + let formatted_width = year_width.extend::() + smart_display::padded_width_of!( "-", - month as u8 => width(2), + u8::from(month) => width(2), "-", day => width(2), ); @@ -1352,7 +1381,7 @@ impl SmartDisplay for Date { year_width, display_sign, year, - month: month as u8, + month: u8::from(month), day, }, ) @@ -1370,7 +1399,7 @@ impl SmartDisplay for Date { month, day, } = *metadata; - let year_width = year_width as usize; + let year_width = year_width.extend(); if display_sign { f.pad_with_width( @@ -1403,6 +1432,9 @@ impl fmt::Debug for Date { impl Add for Date { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, duration: Duration) -> Self::Output { self.checked_add(duration) .expect("overflow adding duration to date") @@ -1412,6 +1444,9 @@ impl Add for Date { impl Add for Date { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, duration: StdDuration) -> Self::Output { self.checked_add_std(duration) .expect("overflow adding duration to date") @@ -1423,6 +1458,9 @@ impl_add_assign!(Date: Duration, StdDuration); impl Sub for Date { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, duration: Duration) -> Self::Output { self.checked_sub(duration) .expect("overflow subtracting duration from date") @@ -1432,6 +1470,9 @@ impl Sub for Date { impl Sub for Date { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, duration: StdDuration) -> Self::Output { self.checked_sub_std(duration) .expect("overflow subtracting duration from date") @@ -1444,7 +1485,7 @@ impl Sub for Date { type Output = Duration; fn sub(self, other: Self) -> Self::Output { - Duration::days((self.to_julian_day() - other.to_julian_day()) as _) + Duration::days((self.to_julian_day() - other.to_julian_day()).extend()) } } // endregion trait impls diff --git a/vendor/time/src/date_time.rs b/vendor/time/src/date_time.rs deleted file mode 100644 index 27f07cec8..000000000 --- a/vendor/time/src/date_time.rs +++ /dev/null @@ -1,1248 +0,0 @@ -//! The [`DateTime`] struct and its associated `impl`s. - -// TODO(jhpratt) Document everything before making public. -#![allow(clippy::missing_docs_in_private_items)] -// This is intentional, as the struct will likely be exposed at some point. -#![allow(unreachable_pub)] - -use core::cmp::Ordering; -use core::fmt; -use core::hash::{Hash, Hasher}; -use core::mem::size_of; -use core::ops::{Add, AddAssign, Sub, SubAssign}; -use core::time::Duration as StdDuration; -#[cfg(feature = "formatting")] -use std::io; -#[cfg(feature = "std")] -use std::time::SystemTime; - -use deranged::RangedI64; -use powerfmt::ext::FormatterExt; -use powerfmt::smart_display::{self, FormatterOptions, Metadata, SmartDisplay}; - -use crate::convert::*; -use crate::date::{MAX_YEAR, MIN_YEAR}; -#[cfg(feature = "formatting")] -use crate::formatting::Formattable; -use crate::internal_macros::{ - bug, cascade, const_try, const_try_opt, div_floor, ensure_ranged, expect_opt, impl_add_assign, - impl_sub_assign, -}; -#[cfg(feature = "parsing")] -use crate::parsing::{Parsable, Parsed}; -use crate::{error, util, Date, Duration, Month, Time, UtcOffset, Weekday}; - -#[allow(missing_debug_implementations, missing_copy_implementations)] -pub(crate) mod offset_kind { - pub enum None {} - pub enum Fixed {} -} - -pub(crate) use sealed::MaybeOffset; -use sealed::*; -mod sealed { - use super::*; - - /// A type that is guaranteed to be either `()` or [`UtcOffset`]. - /// - /// **Do not** add any additional implementations of this trait. - #[allow(unreachable_pub)] // intentional - pub trait MaybeOffsetType {} - impl MaybeOffsetType for () {} - impl MaybeOffsetType for UtcOffset {} - - pub trait MaybeOffset: Sized { - /// The offset type as it is stored in memory. - #[cfg(feature = "quickcheck")] - type MemoryOffsetType: Copy + MaybeOffsetType + quickcheck::Arbitrary; - #[cfg(not(feature = "quickcheck"))] - type MemoryOffsetType: Copy + MaybeOffsetType; - - /// The offset type as it should be thought about. - /// - /// For example, a `DateTime` has a logical offset type of [`UtcOffset`], but does not - /// actually store an offset in memory. - type LogicalOffsetType: Copy + MaybeOffsetType; - - /// Required to be `Self`. Used for bound equality. - type Self_; - - /// True if and only if `Self::LogicalOffsetType` is `UtcOffset`. - const HAS_LOGICAL_OFFSET: bool = - size_of::() == size_of::(); - /// True if and only if `Self::MemoryOffsetType` is `UtcOffset`. - const HAS_MEMORY_OFFSET: bool = - size_of::() == size_of::(); - - /// `Some` if and only if the logical UTC offset is statically known. - // TODO(jhpratt) When const trait impls are stable, this can be removed in favor of - // `.as_offset_opt()`. - const STATIC_OFFSET: Option; - - #[cfg(feature = "parsing")] - fn try_from_parsed(parsed: Parsed) -> Result; - } - - // Traits to indicate whether a `MaybeOffset` has a logical offset type of `UtcOffset` or not. - - pub trait HasLogicalOffset: MaybeOffset {} - impl> HasLogicalOffset for T {} - - pub trait NoLogicalOffset: MaybeOffset {} - impl> NoLogicalOffset for T {} - - // Traits to indicate whether a `MaybeOffset` has a memory offset type of `UtcOffset` or not. - - pub trait HasMemoryOffset: MaybeOffset {} - impl> HasMemoryOffset for T {} - - pub trait NoMemoryOffset: MaybeOffset {} - impl> NoMemoryOffset for T {} - - // Traits to indicate backing type being implemented. - - pub trait IsOffsetKindNone: - MaybeOffset - { - } - impl IsOffsetKindNone for offset_kind::None {} - - pub trait IsOffsetKindFixed: - MaybeOffset< - Self_ = offset_kind::Fixed, - MemoryOffsetType = UtcOffset, - LogicalOffsetType = UtcOffset, - > - { - } - impl IsOffsetKindFixed for offset_kind::Fixed {} -} - -impl MaybeOffset for offset_kind::None { - type MemoryOffsetType = (); - type LogicalOffsetType = (); - - type Self_ = Self; - - const STATIC_OFFSET: Option = None; - - #[cfg(feature = "parsing")] - fn try_from_parsed(_: Parsed) -> Result<(), error::TryFromParsed> { - Ok(()) - } -} - -impl MaybeOffset for offset_kind::Fixed { - type MemoryOffsetType = UtcOffset; - type LogicalOffsetType = UtcOffset; - - type Self_ = Self; - - const STATIC_OFFSET: Option = None; - - #[cfg(feature = "parsing")] - fn try_from_parsed(parsed: Parsed) -> Result { - parsed.try_into() - } -} - -// region: const trait method hacks -// TODO(jhpratt) When const trait impls are stable, these methods can be removed in favor of methods -// in `MaybeOffset`, which would then be made `const`. -const fn maybe_offset_as_offset_opt( - offset: O::MemoryOffsetType, -) -> Option { - if O::STATIC_OFFSET.is_some() { - O::STATIC_OFFSET - } else if O::HAS_MEMORY_OFFSET { - #[repr(C)] // needed to guarantee they align at the start - union Convert { - input: O::MemoryOffsetType, - output: UtcOffset, - } - - // Safety: `O::HAS_OFFSET` indicates that `O::Offset` is `UtcOffset`. This code effectively - // performs a transmute from `O::Offset` to `UtcOffset`, which we know is the same type. - Some(unsafe { Convert:: { input: offset }.output }) - } else { - None - } -} - -const fn maybe_offset_as_offset( - offset: O::MemoryOffsetType, -) -> UtcOffset { - match maybe_offset_as_offset_opt::(offset) { - Some(offset) => offset, - None => bug!("`MaybeOffset::as_offset` called on a type without an offset in memory"), - } -} - -pub(crate) const fn maybe_offset_from_offset( - offset: UtcOffset, -) -> O::MemoryOffsetType { - #[repr(C)] // needed to guarantee the types align at the start - union Convert { - input: UtcOffset, - output: O::MemoryOffsetType, - } - - // Safety: It is statically known that there are only two possibilities due to the trait bound - // of `O::MemoryOffsetType`, which ultimately relies on `MaybeOffsetType`. The two possibilities - // are: - // 1. UtcOffset -> UtcOffset - // 2. UtcOffset -> () - // (1) is valid because it is an identity conversion, which is always valid. (2) is valid - // because `()` is a 1-ZST, so converting to it is always valid. - unsafe { Convert:: { input: offset }.output } -} -// endregion const trait methods hacks - -/// The Julian day of the Unix epoch. -// Safety: `ordinal` is not zero. -#[allow(clippy::undocumented_unsafe_blocks)] -const UNIX_EPOCH_JULIAN_DAY: i32 = - unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }.to_julian_day(); - -pub struct DateTime { - pub(crate) date: Date, - pub(crate) time: Time, - pub(crate) offset: O::MemoryOffsetType, -} - -// Manual impl to remove extraneous bounds. -impl Clone for DateTime { - fn clone(&self) -> Self { - *self - } -} - -// Manual impl to remove extraneous bounds. -impl Copy for DateTime {} - -// region: constructors -impl DateTime { - pub const MIN: Self = Self { - date: Date::MIN, - time: Time::MIN, - offset: (), - }; - - pub const MAX: Self = Self { - date: Date::MAX, - time: Time::MAX, - offset: (), - }; -} - -impl DateTime { - pub const UNIX_EPOCH: Self = Self { - // Safety: `ordinal` is not zero. - date: unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }, - time: Time::MIDNIGHT, - offset: UtcOffset::UTC, - }; -} - -impl DateTime { - pub const fn new(date: Date, time: Time) -> Self - where - O: IsOffsetKindNone, - { - Self { - date, - time, - offset: (), - } - } - - pub const fn from_unix_timestamp(timestamp: i64) -> Result - where - O: HasLogicalOffset, - { - type Timestamp = RangedI64< - { Date::MIN.midnight().assume_utc().unix_timestamp() }, - { Date::MAX.with_time(Time::MAX).assume_utc().unix_timestamp() }, - >; - ensure_ranged!(Timestamp: timestamp); - - // Use the unchecked method here, as the input validity has already been verified. - let date = Date::from_julian_day_unchecked( - UNIX_EPOCH_JULIAN_DAY + div_floor!(timestamp, Second::per(Day) as i64) as i32, - ); - - let seconds_within_day = timestamp.rem_euclid(Second::per(Day) as _); - // Safety: All values are in range. - let time = unsafe { - Time::__from_hms_nanos_unchecked( - (seconds_within_day / Second::per(Hour) as i64) as _, - ((seconds_within_day % Second::per(Hour) as i64) / Minute::per(Hour) as i64) as _, - (seconds_within_day % Second::per(Minute) as i64) as _, - 0, - ) - }; - - Ok(Self { - date, - time, - offset: maybe_offset_from_offset::(UtcOffset::UTC), - }) - } - - pub const fn from_unix_timestamp_nanos(timestamp: i128) -> Result - where - O: HasLogicalOffset, - { - let datetime = const_try!(Self::from_unix_timestamp(div_floor!( - timestamp, - Nanosecond::per(Second) as i128 - ) as i64)); - - Ok(Self { - date: datetime.date, - // Safety: `nanosecond` is in range due to `rem_euclid`. - time: unsafe { - Time::__from_hms_nanos_unchecked( - datetime.hour(), - datetime.minute(), - datetime.second(), - timestamp.rem_euclid(Nanosecond::per(Second) as _) as u32, - ) - }, - offset: maybe_offset_from_offset::(UtcOffset::UTC), - }) - } - // endregion constructors - - // region: now - // The return type will likely be loosened once `ZonedDateTime` is implemented. This is not a - // breaking change calls are currently limited to only `OffsetDateTime`. - #[cfg(feature = "std")] - pub fn now_utc() -> DateTime - where - O: IsOffsetKindFixed, - { - #[cfg(all( - target_family = "wasm", - not(any(target_os = "emscripten", target_os = "wasi")), - feature = "wasm-bindgen" - ))] - { - js_sys::Date::new_0().into() - } - - #[cfg(not(all( - target_family = "wasm", - not(any(target_os = "emscripten", target_os = "wasi")), - feature = "wasm-bindgen" - )))] - SystemTime::now().into() - } - - // The return type will likely be loosened once `ZonedDateTime` is implemented. This is not a - // breaking change calls are currently limited to only `OffsetDateTime`. - #[cfg(feature = "local-offset")] - pub fn now_local() -> Result, error::IndeterminateOffset> - where - O: IsOffsetKindFixed, - { - let t = DateTime::::now_utc(); - Ok(t.to_offset(UtcOffset::local_offset_at(crate::OffsetDateTime(t))?)) - } - // endregion now - - // region: getters - // region: component getters - pub const fn date(self) -> Date { - self.date - } - - pub const fn time(self) -> Time { - self.time - } - - pub const fn offset(self) -> UtcOffset - where - O: HasLogicalOffset, - { - maybe_offset_as_offset::(self.offset) - } - // endregion component getters - - // region: date getters - pub const fn year(self) -> i32 { - self.date.year() - } - - pub const fn month(self) -> Month { - self.date.month() - } - - pub const fn day(self) -> u8 { - self.date.day() - } - - pub const fn ordinal(self) -> u16 { - self.date.ordinal() - } - - pub const fn iso_week(self) -> u8 { - self.date.iso_week() - } - - pub const fn sunday_based_week(self) -> u8 { - self.date.sunday_based_week() - } - - pub const fn monday_based_week(self) -> u8 { - self.date.monday_based_week() - } - - pub const fn to_calendar_date(self) -> (i32, Month, u8) { - self.date.to_calendar_date() - } - - pub const fn to_ordinal_date(self) -> (i32, u16) { - self.date.to_ordinal_date() - } - - pub const fn to_iso_week_date(self) -> (i32, u8, Weekday) { - self.date.to_iso_week_date() - } - - pub const fn weekday(self) -> Weekday { - self.date.weekday() - } - - pub const fn to_julian_day(self) -> i32 { - self.date.to_julian_day() - } - // endregion date getters - - // region: time getters - pub const fn as_hms(self) -> (u8, u8, u8) { - self.time.as_hms() - } - - pub const fn as_hms_milli(self) -> (u8, u8, u8, u16) { - self.time.as_hms_milli() - } - - pub const fn as_hms_micro(self) -> (u8, u8, u8, u32) { - self.time.as_hms_micro() - } - - pub const fn as_hms_nano(self) -> (u8, u8, u8, u32) { - self.time.as_hms_nano() - } - - pub const fn hour(self) -> u8 { - self.time.hour() - } - - pub const fn minute(self) -> u8 { - self.time.minute() - } - - pub const fn second(self) -> u8 { - self.time.second() - } - - pub const fn millisecond(self) -> u16 { - self.time.millisecond() - } - - pub const fn microsecond(self) -> u32 { - self.time.microsecond() - } - - pub const fn nanosecond(self) -> u32 { - self.time.nanosecond() - } - // endregion time getters - - // region: unix timestamp getters - pub const fn unix_timestamp(self) -> i64 - where - O: HasLogicalOffset, - { - let offset = maybe_offset_as_offset::(self.offset).whole_seconds() as i64; - - let days = - (self.to_julian_day() as i64 - UNIX_EPOCH_JULIAN_DAY as i64) * Second::per(Day) as i64; - let hours = self.hour() as i64 * Second::per(Hour) as i64; - let minutes = self.minute() as i64 * Second::per(Minute) as i64; - let seconds = self.second() as i64; - days + hours + minutes + seconds - offset - } - - pub const fn unix_timestamp_nanos(self) -> i128 - where - O: HasLogicalOffset, - { - self.unix_timestamp() as i128 * Nanosecond::per(Second) as i128 + self.nanosecond() as i128 - } - // endregion unix timestamp getters - // endregion: getters - - // region: attach offset - pub const fn assume_offset(self, offset: UtcOffset) -> DateTime - where - O: NoLogicalOffset, - { - DateTime { - date: self.date, - time: self.time, - offset, - } - } - - pub const fn assume_utc(self) -> DateTime - where - O: NoLogicalOffset, - { - self.assume_offset(UtcOffset::UTC) - } - // endregion attach offset - - // region: to offset - pub const fn to_offset(self, offset: UtcOffset) -> DateTime - where - O: HasLogicalOffset, - { - expect_opt!( - self.checked_to_offset(offset), - "local datetime out of valid range" - ) - } - - pub const fn checked_to_offset(self, offset: UtcOffset) -> Option> - where - O: HasLogicalOffset, - { - let self_offset = maybe_offset_as_offset::(self.offset); - - if self_offset.whole_hours() == offset.whole_hours() - && self_offset.minutes_past_hour() == offset.minutes_past_hour() - && self_offset.seconds_past_minute() == offset.seconds_past_minute() - { - return Some(DateTime { - date: self.date, - time: self.time, - offset, - }); - } - - let (year, ordinal, time) = self.to_offset_raw(offset); - - if year > MAX_YEAR || year < MIN_YEAR { - return None; - } - - Some(DateTime { - // Safety: `ordinal` is not zero. - date: unsafe { Date::__from_ordinal_date_unchecked(year, ordinal) }, - time, - offset, - }) - } - - /// Equivalent to `.to_offset(UtcOffset::UTC)`, but returning the year, ordinal, and time. This - /// avoids constructing an invalid [`Date`] if the new value is out of range. - pub(crate) const fn to_offset_raw(self, offset: UtcOffset) -> (i32, u16, Time) { - let Some(from) = maybe_offset_as_offset_opt::(self.offset) else { - // No adjustment is needed because there is no offset. - return (self.year(), self.ordinal(), self.time); - }; - let to = offset; - - // Fast path for when no conversion is necessary. - if from.whole_hours() == to.whole_hours() - && from.minutes_past_hour() == to.minutes_past_hour() - && from.seconds_past_minute() == to.seconds_past_minute() - { - return (self.year(), self.ordinal(), self.time()); - } - - let mut second = self.second() as i16 - from.seconds_past_minute() as i16 - + to.seconds_past_minute() as i16; - let mut minute = - self.minute() as i16 - from.minutes_past_hour() as i16 + to.minutes_past_hour() as i16; - let mut hour = self.hour() as i8 - from.whole_hours() + to.whole_hours(); - let (mut year, ordinal) = self.to_ordinal_date(); - let mut ordinal = ordinal as i16; - - // Cascade the values twice. This is needed because the values are adjusted twice above. - cascade!(second in 0..Second::per(Minute) as i16 => minute); - cascade!(second in 0..Second::per(Minute) as i16 => minute); - cascade!(minute in 0..Minute::per(Hour) as i16 => hour); - cascade!(minute in 0..Minute::per(Hour) as i16 => hour); - cascade!(hour in 0..Hour::per(Day) as i8 => ordinal); - cascade!(hour in 0..Hour::per(Day) as i8 => ordinal); - cascade!(ordinal => year); - - debug_assert!(ordinal > 0); - debug_assert!(ordinal <= crate::util::days_in_year(year) as i16); - - ( - year, - ordinal as _, - // Safety: The cascades above ensure the values are in range. - unsafe { - Time::__from_hms_nanos_unchecked( - hour as _, - minute as _, - second as _, - self.nanosecond(), - ) - }, - ) - } - // endregion to offset - - // region: checked arithmetic - pub const fn checked_add(self, duration: Duration) -> Option { - let (date_adjustment, time) = self.time.adjusting_add(duration); - let date = const_try_opt!(self.date.checked_add(duration)); - - Some(Self { - date: match date_adjustment { - util::DateAdjustment::Previous => const_try_opt!(date.previous_day()), - util::DateAdjustment::Next => const_try_opt!(date.next_day()), - util::DateAdjustment::None => date, - }, - time, - offset: self.offset, - }) - } - - pub const fn checked_sub(self, duration: Duration) -> Option { - let (date_adjustment, time) = self.time.adjusting_sub(duration); - let date = const_try_opt!(self.date.checked_sub(duration)); - - Some(Self { - date: match date_adjustment { - util::DateAdjustment::Previous => const_try_opt!(date.previous_day()), - util::DateAdjustment::Next => const_try_opt!(date.next_day()), - util::DateAdjustment::None => date, - }, - time, - offset: self.offset, - }) - } - // endregion checked arithmetic - - // region: saturating arithmetic - pub const fn saturating_add(self, duration: Duration) -> Self { - if let Some(datetime) = self.checked_add(duration) { - datetime - } else if duration.is_negative() { - Self { - date: Date::MIN, - time: Time::MIN, - offset: self.offset, - } - } else { - Self { - date: Date::MAX, - time: Time::MAX, - offset: self.offset, - } - } - } - - pub const fn saturating_sub(self, duration: Duration) -> Self { - if let Some(datetime) = self.checked_sub(duration) { - datetime - } else if duration.is_negative() { - Self { - date: Date::MAX, - time: Time::MAX, - offset: self.offset, - } - } else { - Self { - date: Date::MIN, - time: Time::MIN, - offset: self.offset, - } - } - } - // endregion saturating arithmetic - - // region: replacement - #[must_use = "this does not modify the original value"] - pub const fn replace_time(self, time: Time) -> Self { - Self { - date: self.date, - time, - offset: self.offset, - } - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_date(self, date: Date) -> Self { - Self { - date, - time: self.time, - offset: self.offset, - } - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_date_time(self, date_time: DateTime) -> Self - where - O: HasLogicalOffset, - { - Self { - date: date_time.date, - time: date_time.time, - offset: self.offset, - } - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_year(self, year: i32) -> Result { - Ok(Self { - date: const_try!(self.date.replace_year(year)), - time: self.time, - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_month(self, month: Month) -> Result { - Ok(Self { - date: const_try!(self.date.replace_month(month)), - time: self.time, - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_day(self, day: u8) -> Result { - Ok(Self { - date: const_try!(self.date.replace_day(day)), - time: self.time, - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_hour(self, hour: u8) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_hour(hour)), - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_minute(self, minute: u8) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_minute(minute)), - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_second(self, second: u8) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_second(second)), - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_millisecond( - self, - millisecond: u16, - ) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_millisecond(millisecond)), - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_microsecond( - self, - microsecond: u32, - ) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_microsecond(microsecond)), - offset: self.offset, - }) - } - - #[must_use = "this does not modify the original value"] - pub const fn replace_nanosecond(self, nanosecond: u32) -> Result { - Ok(Self { - date: self.date, - time: const_try!(self.time.replace_nanosecond(nanosecond)), - offset: self.offset, - }) - } - - // Don't gate this on just having an offset, as `ZonedDateTime` cannot be set to an arbitrary - // offset. - #[must_use = "this does not modify the original value"] - pub const fn replace_offset(self, offset: UtcOffset) -> DateTime - where - O: IsOffsetKindFixed, - { - DateTime { - date: self.date, - time: self.time, - offset, - } - } - - // endregion replacement - - // region: formatting & parsing - #[cfg(feature = "formatting")] - pub fn format_into( - self, - output: &mut impl io::Write, - format: &(impl Formattable + ?Sized), - ) -> Result { - format.format_into( - output, - Some(self.date), - Some(self.time), - maybe_offset_as_offset_opt::(self.offset), - ) - } - - #[cfg(feature = "formatting")] - pub fn format(self, format: &(impl Formattable + ?Sized)) -> Result { - format.format( - Some(self.date), - Some(self.time), - maybe_offset_as_offset_opt::(self.offset), - ) - } - - #[cfg(feature = "parsing")] - pub fn parse( - input: &str, - description: &(impl Parsable + ?Sized), - ) -> Result { - description.parse_date_time(input.as_bytes()) - } - - /// A helper method to check if the `OffsetDateTime` is a valid representation of a leap second. - /// Leap seconds, when parsed, are represented as the preceding nanosecond. However, leap - /// seconds can only occur as the last second of a month UTC. - #[cfg(feature = "parsing")] - pub(crate) const fn is_valid_leap_second_stand_in(self) -> bool { - // Leap seconds aren't allowed if there is no offset. - if !O::HAS_LOGICAL_OFFSET { - return false; - } - - // This comparison doesn't need to be adjusted for the stored offset, so check it first for - // speed. - if self.nanosecond() != 999_999_999 { - return false; - } - - let (year, ordinal, time) = self.to_offset_raw(UtcOffset::UTC); - let Ok(date) = Date::from_ordinal_date(year, ordinal) else { - return false; - }; - - time.hour() == 23 - && time.minute() == 59 - && time.second() == 59 - && date.day() == util::days_in_year_month(year, date.month()) - } - - // endregion formatting & parsing - - // region: deprecated time getters - - // All the way at the bottom as it's low priority. These methods only exist for when - // `OffsetDateTime` is made an alias of `DateTime`. Consider hiding these methods from - // documentation in the future. - - #[doc(hidden)] - #[allow(dead_code)] // while functionally private - #[deprecated(since = "0.3.18", note = "use `as_hms` instead")] - pub const fn to_hms(self) -> (u8, u8, u8) - where - O: IsOffsetKindFixed, - { - self.time.as_hms() - } - - #[doc(hidden)] - #[allow(dead_code)] // while functionally private - #[deprecated(since = "0.3.18", note = "use `as_hms_milli` instead")] - pub const fn to_hms_milli(self) -> (u8, u8, u8, u16) - where - O: IsOffsetKindFixed, - { - self.time.as_hms_milli() - } - - #[doc(hidden)] - #[allow(dead_code)] // while functionally private - #[deprecated(since = "0.3.18", note = "use `as_hms_micro` instead")] - pub const fn to_hms_micro(self) -> (u8, u8, u8, u32) - where - O: IsOffsetKindFixed, - { - self.time.as_hms_micro() - } - - #[doc(hidden)] - #[allow(dead_code)] // while functionally private - #[deprecated(since = "0.3.18", note = "use `as_hms_nano` instead")] - pub const fn to_hms_nano(self) -> (u8, u8, u8, u32) - where - O: IsOffsetKindFixed, - { - self.time.as_hms_nano() - } - // endregion deprecated time getters -} - -// region: trait impls -mod private { - use super::*; - - #[non_exhaustive] - #[derive(Debug, Clone, Copy)] - pub struct DateTimeMetadata { - pub(super) maybe_offset: Option, - } -} -pub(crate) use private::DateTimeMetadata; - -impl SmartDisplay for DateTime { - type Metadata = DateTimeMetadata; - - fn metadata(&self, _: FormatterOptions) -> Metadata { - let maybe_offset = maybe_offset_as_offset_opt::(self.offset); - let width = match maybe_offset { - Some(offset) => smart_display::padded_width_of!(self.date, " ", self.time, " ", offset), - None => smart_display::padded_width_of!(self.date, " ", self.time), - }; - Metadata::new(width, self, DateTimeMetadata { maybe_offset }) - } - - fn fmt_with_metadata( - &self, - f: &mut fmt::Formatter<'_>, - metadata: Metadata, - ) -> fmt::Result { - match metadata.maybe_offset { - Some(offset) => f.pad_with_width( - metadata.unpadded_width(), - format_args!("{} {} {offset}", self.date, self.time), - ), - None => f.pad_with_width( - metadata.unpadded_width(), - format_args!("{} {}", self.date, self.time), - ), - } - } -} - -impl fmt::Display for DateTime { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - SmartDisplay::fmt(self, f) - } -} - -impl fmt::Debug for DateTime { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(self, f) - } -} - -impl PartialEq for DateTime { - fn eq(&self, rhs: &Self) -> bool { - if O::HAS_LOGICAL_OFFSET { - self.to_offset_raw(UtcOffset::UTC) == rhs.to_offset_raw(UtcOffset::UTC) - } else { - (self.date, self.time) == (rhs.date, rhs.time) - } - } -} - -impl Eq for DateTime {} - -impl PartialOrd for DateTime { - fn partial_cmp(&self, rhs: &Self) -> Option { - Some(self.cmp(rhs)) - } -} - -impl Ord for DateTime { - fn cmp(&self, rhs: &Self) -> Ordering { - if O::HAS_LOGICAL_OFFSET { - self.to_offset_raw(UtcOffset::UTC) - .cmp(&rhs.to_offset_raw(UtcOffset::UTC)) - } else { - (self.date, self.time).cmp(&(rhs.date, rhs.time)) - } - } -} - -impl Hash for DateTime { - fn hash(&self, hasher: &mut H) { - if O::HAS_LOGICAL_OFFSET { - self.to_offset_raw(UtcOffset::UTC).hash(hasher); - } else { - (self.date, self.time).hash(hasher); - } - } -} - -impl Add for DateTime { - type Output = Self; - - fn add(self, duration: Duration) -> Self { - self.checked_add(duration) - .expect("resulting value is out of range") - } -} - -impl Add for DateTime { - type Output = Self; - - fn add(self, duration: StdDuration) -> Self::Output { - let (is_next_day, time) = self.time.adjusting_add_std(duration); - - Self { - date: if is_next_day { - (self.date + duration) - .next_day() - .expect("resulting value is out of range") - } else { - self.date + duration - }, - time, - offset: self.offset, - } - } -} - -impl AddAssign for DateTime { - fn add_assign(&mut self, rhs: Duration) { - *self = *self + rhs; - } -} - -impl AddAssign for DateTime { - fn add_assign(&mut self, rhs: StdDuration) { - *self = *self + rhs; - } -} - -impl Sub for DateTime { - type Output = Self; - - fn sub(self, duration: Duration) -> Self { - self.checked_sub(duration) - .expect("resulting value is out of range") - } -} - -impl Sub for DateTime { - type Output = Self; - - fn sub(self, duration: StdDuration) -> Self::Output { - let (is_previous_day, time) = self.time.adjusting_sub_std(duration); - - Self { - date: if is_previous_day { - (self.date - duration) - .previous_day() - .expect("resulting value is out of range") - } else { - self.date - duration - }, - time, - offset: self.offset, - } - } -} - -impl SubAssign for DateTime { - fn sub_assign(&mut self, rhs: Duration) { - *self = *self - rhs; - } -} - -impl SubAssign for DateTime { - fn sub_assign(&mut self, rhs: StdDuration) { - *self = *self - rhs; - } -} - -impl Sub for DateTime { - type Output = Duration; - - fn sub(self, rhs: Self) -> Self::Output { - let base = (self.date - rhs.date) + (self.time - rhs.time); - - match ( - maybe_offset_as_offset_opt::(self.offset), - maybe_offset_as_offset_opt::(rhs.offset), - ) { - (Some(self_offset), Some(rhs_offset)) => { - let adjustment = Duration::seconds( - (self_offset.whole_seconds() - rhs_offset.whole_seconds()) as i64, - ); - base - adjustment - } - (left, right) => { - debug_assert!( - left.is_none() && right.is_none(), - "offset type should not be different for the same type" - ); - base - } - } - } -} - -#[cfg(feature = "std")] -impl Add for SystemTime { - type Output = Self; - - fn add(self, duration: Duration) -> Self::Output { - if duration.is_zero() { - self - } else if duration.is_positive() { - self + duration.unsigned_abs() - } else { - debug_assert!(duration.is_negative()); - self - duration.unsigned_abs() - } - } -} - -impl_add_assign!(SystemTime: #[cfg(feature = "std")] Duration); - -#[cfg(feature = "std")] -impl Sub for SystemTime { - type Output = Self; - - fn sub(self, duration: Duration) -> Self::Output { - (DateTime::from(self) - duration).into() - } -} - -impl_sub_assign!(SystemTime: #[cfg(feature = "std")] Duration); - -#[cfg(feature = "std")] -impl Sub for DateTime { - type Output = Duration; - - fn sub(self, rhs: SystemTime) -> Self::Output { - self - Self::from(rhs) - } -} - -#[cfg(feature = "std")] -impl Sub> for SystemTime { - type Output = Duration; - - fn sub(self, rhs: DateTime) -> Self::Output { - DateTime::::from(self) - rhs - } -} - -#[cfg(feature = "std")] -impl PartialEq for DateTime { - fn eq(&self, rhs: &SystemTime) -> bool { - self == &Self::from(*rhs) - } -} - -#[cfg(feature = "std")] -impl PartialEq> for SystemTime { - fn eq(&self, rhs: &DateTime) -> bool { - &DateTime::::from(*self) == rhs - } -} - -#[cfg(feature = "std")] -impl PartialOrd for DateTime { - fn partial_cmp(&self, other: &SystemTime) -> Option { - self.partial_cmp(&Self::from(*other)) - } -} - -#[cfg(feature = "std")] -impl PartialOrd> for SystemTime { - fn partial_cmp(&self, other: &DateTime) -> Option { - DateTime::::from(*self).partial_cmp(other) - } -} - -#[cfg(feature = "std")] -impl From for DateTime { - fn from(system_time: SystemTime) -> Self { - match system_time.duration_since(SystemTime::UNIX_EPOCH) { - Ok(duration) => Self::UNIX_EPOCH + duration, - Err(err) => Self::UNIX_EPOCH - err.duration(), - } - } -} - -#[allow(clippy::fallible_impl_from)] // caused by `debug_assert!` -#[cfg(feature = "std")] -impl From> for SystemTime { - fn from(datetime: DateTime) -> Self { - let duration = datetime - DateTime::::UNIX_EPOCH; - - if duration.is_zero() { - Self::UNIX_EPOCH - } else if duration.is_positive() { - Self::UNIX_EPOCH + duration.unsigned_abs() - } else { - debug_assert!(duration.is_negative()); - Self::UNIX_EPOCH - duration.unsigned_abs() - } - } -} - -#[allow(clippy::fallible_impl_from)] -#[cfg(all( - target_family = "wasm", - not(any(target_os = "emscripten", target_os = "wasi")), - feature = "wasm-bindgen" -))] -impl From for DateTime { - fn from(js_date: js_sys::Date) -> Self { - // get_time() returns milliseconds - let timestamp_nanos = (js_date.get_time() * Nanosecond::per(Millisecond) as f64) as i128; - Self::from_unix_timestamp_nanos(timestamp_nanos) - .expect("invalid timestamp: Timestamp cannot fit in range") - } -} - -#[cfg(all( - target_family = "wasm", - not(any(target_os = "emscripten", target_os = "wasi")), - feature = "wasm-bindgen" -))] -impl From> for js_sys::Date { - fn from(datetime: DateTime) -> Self { - // new Date() takes milliseconds - let timestamp = - (datetime.unix_timestamp_nanos() / Nanosecond::per(Millisecond) as i128) as f64; - js_sys::Date::new(×tamp.into()) - } -} -// endregion trait impls diff --git a/vendor/time/src/duration.rs b/vendor/time/src/duration.rs index 4b4134f9e..1aeb9674a 100644 --- a/vendor/time/src/duration.rs +++ b/vendor/time/src/duration.rs @@ -7,6 +7,7 @@ use core::ops::{Add, AddAssign, Div, Mul, Neg, Sub, SubAssign}; use core::time::Duration as StdDuration; use deranged::RangedI32; +use num_conv::prelude::*; use crate::convert::*; use crate::error; @@ -380,6 +381,10 @@ impl Duration { /// assert_eq!(Duration::new(-1, 0), (-1).seconds()); /// assert_eq!(Duration::new(1, 2_000_000_000), 3.seconds()); /// ``` + /// + /// # Panics + /// + /// This may panic if an overflow occurs. pub const fn new(mut seconds: i64, mut nanoseconds: i32) -> Self { seconds = expect_opt!( seconds.checked_add(nanoseconds as i64 / Nanosecond::per(Second) as i64), @@ -431,6 +436,10 @@ impl Duration { /// # use time::{Duration, ext::NumericalDuration}; /// assert_eq!(Duration::weeks(1), 604_800.seconds()); /// ``` + /// + /// # Panics + /// + /// This may panic if an overflow occurs. pub const fn weeks(weeks: i64) -> Self { Self::seconds(expect_opt!( weeks.checked_mul(Second::per(Week) as _), @@ -445,6 +454,10 @@ impl Duration { /// # use time::{Duration, ext::NumericalDuration}; /// assert_eq!(Duration::days(1), 86_400.seconds()); /// ``` + /// + /// # Panics + /// + /// This may panic if an overflow occurs. pub const fn days(days: i64) -> Self { Self::seconds(expect_opt!( days.checked_mul(Second::per(Day) as _), @@ -459,6 +472,10 @@ impl Duration { /// # use time::{Duration, ext::NumericalDuration}; /// assert_eq!(Duration::hours(1), 3_600.seconds()); /// ``` + /// + /// # Panics + /// + /// This may panic if an overflow occurs. pub const fn hours(hours: i64) -> Self { Self::seconds(expect_opt!( hours.checked_mul(Second::per(Hour) as _), @@ -473,6 +490,10 @@ impl Duration { /// # use time::{Duration, ext::NumericalDuration}; /// assert_eq!(Duration::minutes(1), 60.seconds()); /// ``` + /// + /// # Panics + /// + /// This may panic if an overflow occurs. pub const fn minutes(minutes: i64) -> Self { Self::seconds(expect_opt!( minutes.checked_mul(Second::per(Minute) as _), @@ -1127,6 +1148,10 @@ impl Duration { /// Runs a closure, returning the duration of time it took to run. The return value of the /// closure is provided in the second part of the tuple. #[cfg(feature = "std")] + #[deprecated( + since = "0.3.32", + note = "extremely limited use case, not intended for benchmarking" + )] pub fn time_fn(f: impl FnOnce() -> T) -> (Self, T) { let start = Instant::now(); let return_value = f(); @@ -1205,23 +1230,26 @@ impl fmt::Display for Duration { let seconds = self.seconds.unsigned_abs(); let nanoseconds = self.nanoseconds.get().unsigned_abs(); - item!("d", seconds / Second::per(Day) as u64)?; + item!("d", seconds / Second::per(Day).extend::())?; item!( "h", - seconds / Second::per(Hour) as u64 % Hour::per(Day) as u64 + seconds / Second::per(Hour).extend::() % Hour::per(Day).extend::() )?; item!( "m", - seconds / Second::per(Minute) as u64 % Minute::per(Hour) as u64 + seconds / Second::per(Minute).extend::() % Minute::per(Hour).extend::() )?; - item!("s", seconds % Second::per(Minute) as u64)?; + item!("s", seconds % Second::per(Minute).extend::())?; item!("ms", nanoseconds / Nanosecond::per(Millisecond))?; item!( "µs", - nanoseconds / Nanosecond::per(Microsecond) as u32 - % Microsecond::per(Millisecond) as u32 + nanoseconds / Nanosecond::per(Microsecond).extend::() + % Microsecond::per(Millisecond).extend::() + )?; + item!( + "ns", + nanoseconds % Nanosecond::per(Microsecond).extend::() )?; - item!("ns", nanoseconds % Nanosecond::per(Microsecond) as u32)?; } Ok(()) @@ -1237,7 +1265,7 @@ impl TryFrom for Duration { .as_secs() .try_into() .map_err(|_| error::ConversionRange)?, - original.subsec_nanos() as _, + original.subsec_nanos().cast_signed(), )) } } @@ -1263,6 +1291,9 @@ impl TryFrom for StdDuration { impl Add for Duration { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, rhs: Self) -> Self::Output { self.checked_add(rhs) .expect("overflow when adding durations") @@ -1272,6 +1303,9 @@ impl Add for Duration { impl Add for Duration { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, std_duration: StdDuration) -> Self::Output { self + Self::try_from(std_duration) .expect("overflow converting `std::time::Duration` to `time::Duration`") @@ -1289,6 +1323,9 @@ impl Add for StdDuration { impl_add_assign!(Duration: Self, StdDuration); impl AddAssign for StdDuration { + /// # Panics + /// + /// This may panic if the resulting addition cannot be represented. fn add_assign(&mut self, rhs: Duration) { *self = (*self + rhs).try_into().expect( "Cannot represent a resulting duration in std. Try `let x = x + rhs;`, which will \ @@ -1308,6 +1345,9 @@ impl Neg for Duration { impl Sub for Duration { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: Self) -> Self::Output { self.checked_sub(rhs) .expect("overflow when subtracting durations") @@ -1317,6 +1357,9 @@ impl Sub for Duration { impl Sub for Duration { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: StdDuration) -> Self::Output { self - Self::try_from(rhs) .expect("overflow converting `std::time::Duration` to `time::Duration`") @@ -1326,6 +1369,9 @@ impl Sub for Duration { impl Sub for StdDuration { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: Duration) -> Self::Output { Duration::try_from(self) .expect("overflow converting `std::time::Duration` to `time::Duration`") @@ -1336,6 +1382,9 @@ impl Sub for StdDuration { impl_sub_assign!(Duration: Self, StdDuration); impl SubAssign for StdDuration { + /// # Panics + /// + /// This may panic if the resulting subtraction can not be represented. fn sub_assign(&mut self, rhs: Duration) { *self = (*self - rhs).try_into().expect( "Cannot represent a resulting duration in std. Try `let x = x - rhs;`, which will \ @@ -1353,7 +1402,7 @@ macro_rules! duration_mul_div_int { fn mul(self, rhs: $type) -> Self::Output { Self::nanoseconds_i128( self.whole_nanoseconds() - .checked_mul(rhs as _) + .checked_mul(rhs.cast_signed().extend::()) .expect("overflow when multiplying duration") ) } @@ -1371,7 +1420,9 @@ macro_rules! duration_mul_div_int { type Output = Self; fn div(self, rhs: $type) -> Self::Output { - Self::nanoseconds_i128(self.whole_nanoseconds() / rhs as i128) + Self::nanoseconds_i128( + self.whole_nanoseconds() / rhs.cast_signed().extend::() + ) } } )+}; @@ -1468,14 +1519,18 @@ impl PartialEq for StdDuration { impl PartialOrd for Duration { fn partial_cmp(&self, rhs: &StdDuration) -> Option { - if rhs.as_secs() > i64::MAX as _ { + if rhs.as_secs() > i64::MAX.cast_unsigned() { return Some(Ordering::Less); } Some( self.seconds - .cmp(&(rhs.as_secs() as _)) - .then_with(|| self.nanoseconds.get().cmp(&(rhs.subsec_nanos() as _))), + .cmp(&rhs.as_secs().cast_signed()) + .then_with(|| { + self.nanoseconds + .get() + .cmp(&rhs.subsec_nanos().cast_signed()) + }), ) } } diff --git a/vendor/time/src/ext.rs b/vendor/time/src/ext.rs index 1b89d4155..00089a0d5 100644 --- a/vendor/time/src/ext.rs +++ b/vendor/time/src/ext.rs @@ -2,6 +2,8 @@ use core::time::Duration as StdDuration; +use num_conv::prelude::*; + use crate::convert::*; use crate::Duration; @@ -219,71 +221,107 @@ impl NumericalStdDuration for u64 { StdDuration::from_secs(self) } + /// # Panics + /// + /// This may panic if an overflow occurs. fn std_minutes(self) -> StdDuration { StdDuration::from_secs( - self.checked_mul(Second::per(Minute) as Self) + self.checked_mul(Second::per(Minute).extend()) .expect("overflow constructing `time::Duration`"), ) } + /// # Panics + /// + /// This may panic if an overflow occurs. fn std_hours(self) -> StdDuration { StdDuration::from_secs( - self.checked_mul(Second::per(Hour) as Self) + self.checked_mul(Second::per(Hour).extend()) .expect("overflow constructing `time::Duration`"), ) } + /// # Panics + /// + /// This may panic if an overflow occurs. fn std_days(self) -> StdDuration { StdDuration::from_secs( - self.checked_mul(Second::per(Day) as Self) + self.checked_mul(Second::per(Day).extend()) .expect("overflow constructing `time::Duration`"), ) } + /// # Panics + /// + /// This may panic if an overflow occurs. fn std_weeks(self) -> StdDuration { StdDuration::from_secs( - self.checked_mul(Second::per(Week) as Self) + self.checked_mul(Second::per(Week).extend()) .expect("overflow constructing `time::Duration`"), ) } } impl NumericalStdDuration for f64 { + /// # Panics + /// + /// This will panic if self is negative. fn std_nanoseconds(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos(self as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_microseconds(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Microsecond) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_milliseconds(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Millisecond) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_seconds(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Second) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_minutes(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Minute) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_hours(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Hour) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_days(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Day) as Self) as _) } + /// # Panics + /// + /// This will panic if self is negative. fn std_weeks(self) -> StdDuration { assert!(self >= 0.); StdDuration::from_nanos((self * Nanosecond::per(Week) as Self) as _) @@ -307,7 +345,7 @@ macro_rules! impl_digit_count { $(impl DigitCount for $t { fn num_digits(self) -> u8 { match self.checked_ilog10() { - Some(n) => (n as u8) + 1, + Some(n) => n.truncate::() + 1, None => 1, } } diff --git a/vendor/time/src/format_description/well_known/iso8601.rs b/vendor/time/src/format_description/well_known/iso8601.rs index 756f034ef..6b8ff2ab6 100644 --- a/vendor/time/src/format_description/well_known/iso8601.rs +++ b/vendor/time/src/format_description/well_known/iso8601.rs @@ -4,7 +4,7 @@ mod adt_hack; use core::num::NonZeroU8; -#[doc(hidden)] +#[doc(hidden, no_inline)] pub use self::adt_hack::DoNotRelyOnWhatThisIs; pub use self::adt_hack::EncodedConfig; diff --git a/vendor/time/src/formatting/formattable.rs b/vendor/time/src/formatting/formattable.rs index cad1d482d..769b827fd 100644 --- a/vendor/time/src/formatting/formattable.rs +++ b/vendor/time/src/formatting/formattable.rs @@ -3,6 +3,8 @@ use core::ops::Deref; use std::io; +use num_conv::prelude::*; + use crate::format_description::well_known::iso8601::EncodedConfig; use crate::format_description::well_known::{Iso8601, Rfc2822, Rfc3339}; use crate::format_description::{FormatItem, OwnedFormatItem}; @@ -175,14 +177,17 @@ impl sealed::Sealed for Rfc2822 { bytes += write( output, - &WEEKDAY_NAMES[date.weekday().number_days_from_monday() as usize][..3], + &WEEKDAY_NAMES[date.weekday().number_days_from_monday().extend::()][..3], )?; bytes += write(output, b", ")?; bytes += format_number_pad_zero::<2>(output, day)?; bytes += write(output, b" ")?; - bytes += write(output, &MONTH_NAMES[month as usize - 1][..3])?; + bytes += write( + output, + &MONTH_NAMES[u8::from(month).extend::() - 1][..3], + )?; bytes += write(output, b" ")?; - bytes += format_number_pad_zero::<4>(output, year as u32)?; + bytes += format_number_pad_zero::<4>(output, year.cast_unsigned())?; bytes += write(output, b" ")?; bytes += format_number_pad_zero::<2>(output, time.hour())?; bytes += write(output, b":")?; @@ -217,13 +222,16 @@ impl sealed::Sealed for Rfc3339 { if !(0..10_000).contains(&year) { return Err(error::Format::InvalidComponent("year")); } + if offset.whole_hours().unsigned_abs() > 23 { + return Err(error::Format::InvalidComponent("offset_hour")); + } if offset.seconds_past_minute() != 0 { return Err(error::Format::InvalidComponent("offset_second")); } - bytes += format_number_pad_zero::<4>(output, year as u32)?; + bytes += format_number_pad_zero::<4>(output, year.cast_unsigned())?; bytes += write(output, b"-")?; - bytes += format_number_pad_zero::<2>(output, date.month() as u8)?; + bytes += format_number_pad_zero::<2>(output, u8::from(date.month()))?; bytes += write(output, b"-")?; bytes += format_number_pad_zero::<2>(output, date.day())?; bytes += write(output, b"T")?; diff --git a/vendor/time/src/formatting/iso8601.rs b/vendor/time/src/formatting/iso8601.rs index 67bc66b21..ee49d7d89 100644 --- a/vendor/time/src/formatting/iso8601.rs +++ b/vendor/time/src/formatting/iso8601.rs @@ -2,6 +2,8 @@ use std::io; +use num_conv::prelude::*; + use crate::convert::*; use crate::format_description::well_known::iso8601::{ DateKind, EncodedConfig, OffsetPrecision, TimePrecision, @@ -26,10 +28,10 @@ pub(super) fn format_date( } else if !(0..=9999).contains(&year) { return Err(error::Format::InvalidComponent("year")); } else { - bytes += format_number_pad_zero::<4>(output, year as u32)?; + bytes += format_number_pad_zero::<4>(output, year.cast_unsigned())?; } bytes += write_if(output, Iso8601::::USE_SEPARATORS, b"-")?; - bytes += format_number_pad_zero::<2>(output, month as u8)?; + bytes += format_number_pad_zero::<2>(output, u8::from(month))?; bytes += write_if(output, Iso8601::::USE_SEPARATORS, b"-")?; bytes += format_number_pad_zero::<2>(output, day)?; } @@ -41,7 +43,7 @@ pub(super) fn format_date( } else if !(0..=9999).contains(&year) { return Err(error::Format::InvalidComponent("year")); } else { - bytes += format_number_pad_zero::<4>(output, year as u32)?; + bytes += format_number_pad_zero::<4>(output, year.cast_unsigned())?; } bytes += write_if_else(output, Iso8601::::USE_SEPARATORS, b"-W", b"W")?; bytes += format_number_pad_zero::<2>(output, week)?; @@ -56,7 +58,7 @@ pub(super) fn format_date( } else if !(0..=9999).contains(&year) { return Err(error::Format::InvalidComponent("year")); } else { - bytes += format_number_pad_zero::<4>(output, year as u32)?; + bytes += format_number_pad_zero::<4>(output, year.cast_unsigned())?; } bytes += write_if(output, Iso8601::::USE_SEPARATORS, b"-")?; bytes += format_number_pad_zero::<3>(output, day)?; diff --git a/vendor/time/src/formatting/mod.rs b/vendor/time/src/formatting/mod.rs index 77a52305b..b57c15222 100644 --- a/vendor/time/src/formatting/mod.rs +++ b/vendor/time/src/formatting/mod.rs @@ -5,6 +5,8 @@ mod iso8601; use core::num::NonZeroU8; use std::io; +use num_conv::prelude::*; + pub use self::formattable::Formattable; use crate::convert::*; use crate::ext::DigitCount; @@ -71,14 +73,14 @@ pub(crate) fn format_float( ) -> io::Result { match digits_after_decimal { Some(digits_after_decimal) => { - let digits_after_decimal = digits_after_decimal.get() as usize; - let width = digits_before_decimal as usize + 1 + digits_after_decimal; + let digits_after_decimal = digits_after_decimal.get().extend(); + let width = digits_before_decimal.extend::() + 1 + digits_after_decimal; write!(output, "{value:0>width$.digits_after_decimal$}")?; Ok(width) } None => { let value = value.trunc() as u64; - let width = digits_before_decimal as usize; + let width = digits_before_decimal.extend(); write!(output, "{value:0>width$}")?; Ok(width) } @@ -207,9 +209,17 @@ fn fmt_month( }: modifier::Month, ) -> Result { match repr { - modifier::MonthRepr::Numerical => format_number::<2>(output, date.month() as u8, padding), - modifier::MonthRepr::Long => write(output, MONTH_NAMES[date.month() as usize - 1]), - modifier::MonthRepr::Short => write(output, &MONTH_NAMES[date.month() as usize - 1][..3]), + modifier::MonthRepr::Numerical => { + format_number::<2>(output, u8::from(date.month()), padding) + } + modifier::MonthRepr::Long => write( + output, + MONTH_NAMES[u8::from(date.month()).extend::() - 1], + ), + modifier::MonthRepr::Short => write( + output, + &MONTH_NAMES[u8::from(date.month()).extend::() - 1][..3], + ), } } @@ -235,20 +245,20 @@ fn fmt_weekday( match repr { modifier::WeekdayRepr::Short => write( output, - &WEEKDAY_NAMES[date.weekday().number_days_from_monday() as usize][..3], + &WEEKDAY_NAMES[date.weekday().number_days_from_monday().extend::()][..3], ), modifier::WeekdayRepr::Long => write( output, - WEEKDAY_NAMES[date.weekday().number_days_from_monday() as usize], + WEEKDAY_NAMES[date.weekday().number_days_from_monday().extend::()], ), modifier::WeekdayRepr::Sunday => format_number::<1>( output, - date.weekday().number_days_from_sunday() + one_indexed as u8, + date.weekday().number_days_from_sunday() + u8::from(one_indexed), modifier::Padding::None, ), modifier::WeekdayRepr::Monday => format_number::<1>( output, - date.weekday().number_days_from_monday() + one_indexed as u8, + date.weekday().number_days_from_monday() + u8::from(one_indexed), modifier::Padding::None, ), } @@ -447,10 +457,7 @@ fn fmt_unix_timestamp( sign_is_mandatory, }: modifier::UnixTimestamp, ) -> Result { - let date_time = date - .with_time(time) - .assume_offset(offset) - .to_offset(UtcOffset::UTC); + let date_time = OffsetDateTime::new_in_offset(date, time, offset).to_offset(UtcOffset::UTC); if date_time < OffsetDateTime::UNIX_EPOCH { write(output, b"-")?; @@ -464,13 +471,15 @@ fn fmt_unix_timestamp( } modifier::UnixTimestampPrecision::Millisecond => format_number_pad_none( output, - (date_time.unix_timestamp_nanos() / Nanosecond::per(Millisecond) as i128) - .unsigned_abs(), + (date_time.unix_timestamp_nanos() + / Nanosecond::per(Millisecond).cast_signed().extend::()) + .unsigned_abs(), ), modifier::UnixTimestampPrecision::Microsecond => format_number_pad_none( output, - (date_time.unix_timestamp_nanos() / Nanosecond::per(Microsecond) as i128) - .unsigned_abs(), + (date_time.unix_timestamp_nanos() + / Nanosecond::per(Microsecond).cast_signed().extend::()) + .unsigned_abs(), ), modifier::UnixTimestampPrecision::Nanosecond => { format_number_pad_none(output, date_time.unix_timestamp_nanos().unsigned_abs()) diff --git a/vendor/time/src/instant.rs b/vendor/time/src/instant.rs index 706c759c4..0ebda4c3e 100644 --- a/vendor/time/src/instant.rs +++ b/vendor/time/src/instant.rs @@ -129,6 +129,9 @@ impl From for StdInstant { impl Sub for Instant { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, other: Self) -> Self::Output { match self.0.cmp(&other.0) { Ordering::Equal => Duration::ZERO, diff --git a/vendor/time/src/internal_macros.rs b/vendor/time/src/internal_macros.rs index 857138983..e210573ec 100644 --- a/vendor/time/src/internal_macros.rs +++ b/vendor/time/src/internal_macros.rs @@ -184,6 +184,7 @@ macro_rules! expect_opt { } /// `unreachable!()`, but better. +#[cfg(any(feature = "formatting", feature = "parsing"))] macro_rules! bug { () => { compile_error!("provide an error message to help fix a possible bug") }; ($descr:literal $($rest:tt)?) => { @@ -191,7 +192,9 @@ macro_rules! bug { } } +#[cfg(any(feature = "formatting", feature = "parsing"))] +pub(crate) use bug; pub(crate) use { - __impl_assign, bug, cascade, const_try, const_try_opt, div_floor, ensure_ranged, expect_opt, + __impl_assign, cascade, const_try, const_try_opt, div_floor, ensure_ranged, expect_opt, impl_add_assign, impl_div_assign, impl_mul_assign, impl_sub_assign, }; diff --git a/vendor/time/src/lib.rs b/vendor/time/src/lib.rs index 110c28648..5a9e08046 100644 --- a/vendor/time/src/lib.rs +++ b/vendor/time/src/lib.rs @@ -52,14 +52,6 @@ //! Libraries should never enable this feature, as the decision of what format to use should be up //! to the user. //! -//! - `serde-well-known` (_implicitly enables `serde-human-readable`_) -//! -//! _This feature flag is deprecated and will be removed in a future breaking release. Use the -//! `serde-human-readable` feature instead._ -//! -//! Enables support for serializing and deserializing well-known formats using serde's -//! [`#[with]` attribute](https://serde.rs/field-attrs.html#with). -//! //! - `rand` //! //! Enables [rand](https://docs.rs/rand) support for all types. @@ -86,7 +78,6 @@ extern crate alloc; mod date; -mod date_time; mod duration; pub mod error; pub mod ext; @@ -122,7 +113,6 @@ mod weekday; pub use time_core::convert; pub use crate::date::Date; -use crate::date_time::DateTime; pub use crate::duration::Duration; pub use crate::error::Error; #[cfg(feature = "std")] diff --git a/vendor/time/src/offset_date_time.rs b/vendor/time/src/offset_date_time.rs index 79d91a61b..1c495cb38 100644 --- a/vendor/time/src/offset_date_time.rs +++ b/vendor/time/src/offset_date_time.rs @@ -1,6 +1,5 @@ //! The [`OffsetDateTime`] struct and its associated `impl`s. -#[cfg(feature = "std")] use core::cmp::Ordering; #[cfg(feature = "std")] use core::convert::From; @@ -13,24 +12,63 @@ use std::io; #[cfg(feature = "std")] use std::time::SystemTime; -use powerfmt::smart_display::{FormatterOptions, Metadata, SmartDisplay}; +use deranged::RangedI64; +use num_conv::prelude::*; +use powerfmt::ext::FormatterExt as _; +use powerfmt::smart_display::{self, FormatterOptions, Metadata, SmartDisplay}; +use time_core::convert::{Day, Hour, Minute, Nanosecond, Second}; -use crate::date_time::{offset_kind, DateTimeMetadata}; +use crate::date::{MAX_YEAR, MIN_YEAR}; #[cfg(feature = "formatting")] use crate::formatting::Formattable; -use crate::internal_macros::{const_try, const_try_opt}; +use crate::internal_macros::{ + cascade, const_try, const_try_opt, div_floor, ensure_ranged, expect_opt, +}; #[cfg(feature = "parsing")] use crate::parsing::Parsable; -use crate::{error, Date, DateTime, Duration, Month, PrimitiveDateTime, Time, UtcOffset, Weekday}; +#[cfg(feature = "parsing")] +use crate::util; +use crate::{error, Date, Duration, Month, PrimitiveDateTime, Time, UtcOffset, Weekday}; -/// The actual type doing all the work. -type Inner = DateTime; +/// The Julian day of the Unix epoch. +// Safety: `ordinal` is not zero. +#[allow(clippy::undocumented_unsafe_blocks)] +const UNIX_EPOCH_JULIAN_DAY: i32 = + unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }.to_julian_day(); /// A [`PrimitiveDateTime`] with a [`UtcOffset`]. /// /// All comparisons are performed using the UTC time. -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct OffsetDateTime(pub(crate) Inner); +#[derive(Clone, Copy, Eq)] +pub struct OffsetDateTime { + local_date_time: PrimitiveDateTime, + offset: UtcOffset, +} + +impl PartialEq for OffsetDateTime { + fn eq(&self, other: &Self) -> bool { + self.to_offset_raw(UtcOffset::UTC) == other.to_offset_raw(UtcOffset::UTC) + } +} + +impl PartialOrd for OffsetDateTime { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for OffsetDateTime { + fn cmp(&self, other: &Self) -> Ordering { + self.to_offset_raw(UtcOffset::UTC) + .cmp(&other.to_offset_raw(UtcOffset::UTC)) + } +} + +impl Hash for OffsetDateTime { + fn hash(&self, state: &mut H) { + self.to_offset_raw(UtcOffset::UTC).hash(state); + } +} impl OffsetDateTime { /// Midnight, 1 January, 1970 (UTC). @@ -40,7 +78,12 @@ impl OffsetDateTime { /// # use time_macros::datetime; /// assert_eq!(OffsetDateTime::UNIX_EPOCH, datetime!(1970-01-01 0:00 UTC),); /// ``` - pub const UNIX_EPOCH: Self = Self(Inner::UNIX_EPOCH); + pub const UNIX_EPOCH: Self = Self::new_in_offset( + // Safety: `ordinal` is not zero. + unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }, + Time::MIDNIGHT, + UtcOffset::UTC, + ); // region: now /// Create a new `OffsetDateTime` with the current date and time in UTC. @@ -53,7 +96,21 @@ impl OffsetDateTime { /// ``` #[cfg(feature = "std")] pub fn now_utc() -> Self { - Self(Inner::now_utc()) + #[cfg(all( + target_family = "wasm", + not(any(target_os = "emscripten", target_os = "wasi")), + feature = "wasm-bindgen" + ))] + { + js_sys::Date::new_0().into() + } + + #[cfg(not(all( + target_family = "wasm", + not(any(target_os = "emscripten", target_os = "wasi")), + feature = "wasm-bindgen" + )))] + SystemTime::now().into() } /// Attempt to create a new `OffsetDateTime` with the current date and time in the local offset. @@ -67,10 +124,47 @@ impl OffsetDateTime { /// ``` #[cfg(feature = "local-offset")] pub fn now_local() -> Result { - Inner::now_local().map(Self) + let t = Self::now_utc(); + Ok(t.to_offset(UtcOffset::local_offset_at(t)?)) } // endregion now + /// Create a new `OffsetDateTime` with the given [`Date`], [`Time`], and [`UtcOffset`]. + /// + /// ``` + /// # use time::{Date, Month, OffsetDateTime, Time, UtcOffset}; + /// # use time_macros::datetime; + /// let dt = OffsetDateTime::new_in_offset( + /// Date::from_calendar_date(2024, Month::January, 1)?, + /// Time::from_hms_nano(12, 59, 59, 500_000_000)?, + /// UtcOffset::from_hms(-5, 0, 0)?, + /// ); + /// assert_eq!(dt, datetime!(2024-01-01 12:59:59.5 -5)); + /// # Ok::<_, time::error::Error>(()) + /// ``` + pub const fn new_in_offset(date: Date, time: Time, offset: UtcOffset) -> Self { + Self { + local_date_time: date.with_time(time), + offset, + } + } + + /// Create a new `OffsetDateTime` with the given [`Date`] and [`Time`] in the UTC timezone. + /// + /// ``` + /// # use time::{Date, Month, OffsetDateTime, Time}; + /// # use time_macros::datetime; + /// let dt = OffsetDateTime::new_utc( + /// Date::from_calendar_date(2024, Month::January, 1)?, + /// Time::from_hms_nano(12, 59, 59, 500_000_000)?, + /// ); + /// assert_eq!(dt, datetime!(2024-01-01 12:59:59.5 UTC)); + /// # Ok::<_, time::error::Error>(()) + /// ``` + pub const fn new_utc(date: Date, time: Time) -> Self { + PrimitiveDateTime::new(date, time).assume_utc() + } + /// Convert the `OffsetDateTime` from the current [`UtcOffset`] to the provided [`UtcOffset`]. /// /// ```rust @@ -97,7 +191,10 @@ impl OffsetDateTime { /// /// This method panics if the local date-time in the new offset is outside the supported range. pub const fn to_offset(self, offset: UtcOffset) -> Self { - Self(self.0.to_offset(offset)) + expect_opt!( + self.checked_to_offset(offset), + "local datetime out of valid range" + ) } /// Convert the `OffsetDateTime` from the current [`UtcOffset`] to the provided [`UtcOffset`], @@ -121,7 +218,74 @@ impl OffsetDateTime { /// ); /// ``` pub const fn checked_to_offset(self, offset: UtcOffset) -> Option { - Some(Self(const_try_opt!(self.0.checked_to_offset(offset)))) + if self.offset.whole_hours() == offset.whole_hours() + && self.offset.minutes_past_hour() == offset.minutes_past_hour() + && self.offset.seconds_past_minute() == offset.seconds_past_minute() + { + return Some(self.replace_offset(offset)); + } + + let (year, ordinal, time) = self.to_offset_raw(offset); + + if year > MAX_YEAR || year < MIN_YEAR { + return None; + } + + Some(Self::new_in_offset( + // Safety: `ordinal` is not zero. + unsafe { Date::__from_ordinal_date_unchecked(year, ordinal) }, + time, + offset, + )) + } + + /// Equivalent to `.to_offset(UtcOffset::UTC)`, but returning the year, ordinal, and time. This + /// avoids constructing an invalid [`Date`] if the new value is out of range. + pub(crate) const fn to_offset_raw(self, offset: UtcOffset) -> (i32, u16, Time) { + let from = self.offset; + let to = offset; + + // Fast path for when no conversion is necessary. + if from.whole_hours() == to.whole_hours() + && from.minutes_past_hour() == to.minutes_past_hour() + && from.seconds_past_minute() == to.seconds_past_minute() + { + return (self.year(), self.ordinal(), self.time()); + } + + let mut second = self.second() as i16 - from.seconds_past_minute() as i16 + + to.seconds_past_minute() as i16; + let mut minute = + self.minute() as i16 - from.minutes_past_hour() as i16 + to.minutes_past_hour() as i16; + let mut hour = self.hour() as i8 - from.whole_hours() + to.whole_hours(); + let (mut year, ordinal) = self.to_ordinal_date(); + let mut ordinal = ordinal as i16; + + // Cascade the values twice. This is needed because the values are adjusted twice above. + cascade!(second in 0..Second::per(Minute) as i16 => minute); + cascade!(second in 0..Second::per(Minute) as i16 => minute); + cascade!(minute in 0..Minute::per(Hour) as i16 => hour); + cascade!(minute in 0..Minute::per(Hour) as i16 => hour); + cascade!(hour in 0..Hour::per(Day) as i8 => ordinal); + cascade!(hour in 0..Hour::per(Day) as i8 => ordinal); + cascade!(ordinal => year); + + debug_assert!(ordinal > 0); + debug_assert!(ordinal <= crate::util::days_in_year(year) as i16); + + ( + year, + ordinal as _, + // Safety: The cascades above ensure the values are in range. + unsafe { + Time::__from_hms_nanos_unchecked( + hour as _, + minute as _, + second as _, + self.nanosecond(), + ) + }, + ) } // region: constructors @@ -154,7 +318,34 @@ impl OffsetDateTime { /// # Ok::<_, time::Error>(()) /// ``` pub const fn from_unix_timestamp(timestamp: i64) -> Result { - Ok(Self(const_try!(Inner::from_unix_timestamp(timestamp)))) + type Timestamp = RangedI64< + { + OffsetDateTime::new_in_offset(Date::MIN, Time::MIDNIGHT, UtcOffset::UTC) + .unix_timestamp() + }, + { + OffsetDateTime::new_in_offset(Date::MAX, Time::MAX, UtcOffset::UTC).unix_timestamp() + }, + >; + ensure_ranged!(Timestamp: timestamp); + + // Use the unchecked method here, as the input validity has already been verified. + let date = Date::from_julian_day_unchecked( + UNIX_EPOCH_JULIAN_DAY + div_floor!(timestamp, Second::per(Day) as i64) as i32, + ); + + let seconds_within_day = timestamp.rem_euclid(Second::per(Day) as _); + // Safety: All values are in range. + let time = unsafe { + Time::__from_hms_nanos_unchecked( + (seconds_within_day / Second::per(Hour) as i64) as _, + ((seconds_within_day % Second::per(Hour) as i64) / Minute::per(Hour) as i64) as _, + (seconds_within_day % Second::per(Minute) as i64) as _, + 0, + ) + }; + + Ok(Self::new_in_offset(date, time, UtcOffset::UTC)) } /// Construct an `OffsetDateTime` from the provided Unix timestamp (in nanoseconds). Calling @@ -173,9 +364,24 @@ impl OffsetDateTime { /// ); /// ``` pub const fn from_unix_timestamp_nanos(timestamp: i128) -> Result { - Ok(Self(const_try!(Inner::from_unix_timestamp_nanos( - timestamp - )))) + let datetime = const_try!(Self::from_unix_timestamp(div_floor!( + timestamp, + Nanosecond::per(Second) as i128 + ) as i64)); + + Ok(Self::new_in_offset( + datetime.date(), + // Safety: `nanosecond` is in range due to `rem_euclid`. + unsafe { + Time::__from_hms_nanos_unchecked( + datetime.hour(), + datetime.minute(), + datetime.second(), + timestamp.rem_euclid(Nanosecond::per(Second) as _) as u32, + ) + }, + UtcOffset::UTC, + )) } // endregion constructors @@ -188,7 +394,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2019-01-01 0:00 +1).offset(), offset!(+1)); /// ``` pub const fn offset(self) -> UtcOffset { - self.0.offset() + self.offset } /// Get the [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time). @@ -199,7 +405,13 @@ impl OffsetDateTime { /// assert_eq!(datetime!(1970-01-01 0:00 -1).unix_timestamp(), 3_600); /// ``` pub const fn unix_timestamp(self) -> i64 { - self.0.unix_timestamp() + let days = + (self.to_julian_day() as i64 - UNIX_EPOCH_JULIAN_DAY as i64) * Second::per(Day) as i64; + let hours = self.hour() as i64 * Second::per(Hour) as i64; + let minutes = self.minute() as i64 * Second::per(Minute) as i64; + let seconds = self.second() as i64; + let offset_seconds = self.offset.whole_seconds() as i64; + days + hours + minutes + seconds - offset_seconds } /// Get the Unix timestamp in nanoseconds. @@ -213,7 +425,12 @@ impl OffsetDateTime { /// ); /// ``` pub const fn unix_timestamp_nanos(self) -> i128 { - self.0.unix_timestamp_nanos() + self.unix_timestamp() as i128 * Nanosecond::per(Second) as i128 + self.nanosecond() as i128 + } + + /// Get the [`PrimitiveDateTime`] in the stored offset. + const fn date_time(self) -> PrimitiveDateTime { + self.local_date_time } /// Get the [`Date`] in the stored offset. @@ -229,7 +446,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn date(self) -> Date { - self.0.date() + self.date_time().date() } /// Get the [`Time`] in the stored offset. @@ -245,7 +462,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn time(self) -> Time { - self.0.time() + self.date_time().time() } // region: date getters @@ -263,7 +480,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2020-01-01 0:00 UTC).year(), 2020); /// ``` pub const fn year(self) -> i32 { - self.0.year() + self.date().year() } /// Get the month of the date in the stored offset. @@ -280,7 +497,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn month(self) -> Month { - self.0.month() + self.date().month() } /// Get the day of the date in the stored offset. @@ -298,7 +515,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn day(self) -> u8 { - self.0.day() + self.date().day() } /// Get the day of the year of the date in the stored offset. @@ -316,7 +533,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn ordinal(self) -> u16 { - self.0.ordinal() + self.date().ordinal() } /// Get the ISO week number of the date in the stored offset. @@ -331,7 +548,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2021-01-01 0:00 UTC).iso_week(), 53); /// ``` pub const fn iso_week(self) -> u8 { - self.0.iso_week() + self.date().iso_week() } /// Get the week number where week 1 begins on the first Sunday. @@ -346,7 +563,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2021-01-01 0:00 UTC).sunday_based_week(), 0); /// ``` pub const fn sunday_based_week(self) -> u8 { - self.0.sunday_based_week() + self.date().sunday_based_week() } /// Get the week number where week 1 begins on the first Monday. @@ -361,7 +578,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2021-01-01 0:00 UTC).monday_based_week(), 0); /// ``` pub const fn monday_based_week(self) -> u8 { - self.0.monday_based_week() + self.date().monday_based_week() } /// Get the year, month, and day. @@ -375,7 +592,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_calendar_date(self) -> (i32, Month, u8) { - self.0.to_calendar_date() + self.date().to_calendar_date() } /// Get the year and ordinal day number. @@ -388,7 +605,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_ordinal_date(self) -> (i32, u16) { - self.0.to_ordinal_date() + self.date().to_ordinal_date() } /// Get the ISO 8601 year, week number, and weekday. @@ -418,7 +635,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_iso_week_date(self) -> (i32, u8, Weekday) { - self.0.to_iso_week_date() + self.date().to_iso_week_date() } /// Get the weekday of the date in the stored offset. @@ -431,7 +648,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2019-03-01 0:00 UTC).weekday(), Friday); /// ``` pub const fn weekday(self) -> Weekday { - self.0.weekday() + self.date().weekday() } /// Get the Julian day for the date. The time is not taken into account for this calculation. @@ -447,7 +664,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2019-12-31 0:00 UTC).to_julian_day(), 2_458_849); /// ``` pub const fn to_julian_day(self) -> i32 { - self.0.to_julian_day() + self.date().to_julian_day() } // endregion date getters @@ -460,7 +677,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2020-01-01 23:59:59 UTC).to_hms(), (23, 59, 59)); /// ``` pub const fn to_hms(self) -> (u8, u8, u8) { - self.0.as_hms() + self.time().as_hms() } /// Get the clock hour, minute, second, and millisecond. @@ -477,7 +694,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_hms_milli(self) -> (u8, u8, u8, u16) { - self.0.as_hms_milli() + self.time().as_hms_milli() } /// Get the clock hour, minute, second, and microsecond. @@ -494,7 +711,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_hms_micro(self) -> (u8, u8, u8, u32) { - self.0.as_hms_micro() + self.time().as_hms_micro() } /// Get the clock hour, minute, second, and nanosecond. @@ -511,7 +728,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn to_hms_nano(self) -> (u8, u8, u8, u32) { - self.0.as_hms_nano() + self.time().as_hms_nano() } /// Get the clock hour in the stored offset. @@ -529,7 +746,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn hour(self) -> u8 { - self.0.hour() + self.time().hour() } /// Get the minute within the hour in the stored offset. @@ -547,7 +764,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn minute(self) -> u8 { - self.0.minute() + self.time().minute() } /// Get the second within the minute in the stored offset. @@ -565,7 +782,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn second(self) -> u8 { - self.0.second() + self.time().second() } // Because a `UtcOffset` is limited in resolution to one second, any subsecond value will not @@ -581,7 +798,7 @@ impl OffsetDateTime { /// assert_eq!(datetime!(2019-01-01 23:59:59.999 UTC).millisecond(), 999); /// ``` pub const fn millisecond(self) -> u16 { - self.0.millisecond() + self.time().millisecond() } /// Get the microseconds within the second in the stored offset. @@ -597,7 +814,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn microsecond(self) -> u32 { - self.0.microsecond() + self.time().microsecond() } /// Get the nanoseconds within the second in the stored offset. @@ -613,7 +830,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn nanosecond(self) -> u32 { - self.0.nanosecond() + self.time().nanosecond() } // endregion time getters // endregion getters @@ -636,7 +853,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn checked_add(self, duration: Duration) -> Option { - Some(Self(const_try_opt!(self.0.checked_add(duration)))) + Some(const_try_opt!(self.date_time().checked_add(duration)).assume_offset(self.offset())) } /// Computes `self - duration`, returning `None` if an overflow occurred. @@ -656,7 +873,7 @@ impl OffsetDateTime { /// ); /// ``` pub const fn checked_sub(self, duration: Duration) -> Option { - Some(Self(const_try_opt!(self.0.checked_sub(duration)))) + Some(const_try_opt!(self.date_time().checked_sub(duration)).assume_offset(self.offset())) } // endregion: checked arithmetic @@ -707,7 +924,13 @@ impl OffsetDateTime { /// ); /// ``` pub const fn saturating_add(self, duration: Duration) -> Self { - Self(self.0.saturating_add(duration)) + if let Some(datetime) = self.checked_add(duration) { + datetime + } else if duration.is_negative() { + PrimitiveDateTime::MIN.assume_offset(self.offset()) + } else { + PrimitiveDateTime::MAX.assume_offset(self.offset()) + } } /// Computes `self - duration`, saturating value on overflow. @@ -756,7 +979,13 @@ impl OffsetDateTime { /// ); /// ``` pub const fn saturating_sub(self, duration: Duration) -> Self { - Self(self.0.saturating_sub(duration)) + if let Some(datetime) = self.checked_sub(duration) { + datetime + } else if duration.is_negative() { + PrimitiveDateTime::MAX.assume_offset(self.offset()) + } else { + PrimitiveDateTime::MIN.assume_offset(self.offset()) + } } // endregion: saturating arithmetic } @@ -784,7 +1013,7 @@ impl OffsetDateTime { /// ``` #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_time(self, time: Time) -> Self { - Self(self.0.replace_time(time)) + Self::new_in_offset(self.date(), time, self.offset()) } /// Replace the date, which is assumed to be in the stored offset. The time and offset @@ -803,7 +1032,7 @@ impl OffsetDateTime { /// ``` #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_date(self, date: Date) -> Self { - Self(self.0.replace_date(date)) + Self::new_in_offset(date, self.time(), self.offset()) } /// Replace the date and time, which are assumed to be in the stored offset. The offset @@ -822,7 +1051,7 @@ impl OffsetDateTime { /// ``` #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_date_time(self, date_time: PrimitiveDateTime) -> Self { - Self(self.0.replace_date_time(date_time.0)) + date_time.assume_offset(self.offset()) } /// Replace the offset. The date and time components remain unchanged. @@ -836,7 +1065,7 @@ impl OffsetDateTime { /// ``` #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_offset(self, offset: UtcOffset) -> Self { - Self(self.0.replace_offset(offset)) + self.date_time().assume_offset(offset) } /// Replace the year. The month and day will be unchanged. @@ -850,8 +1079,9 @@ impl OffsetDateTime { /// assert!(datetime!(2022 - 02 - 18 12:00 +01).replace_year(-1_000_000_000).is_err()); // -1_000_000_000 isn't a valid year /// assert!(datetime!(2022 - 02 - 18 12:00 +01).replace_year(1_000_000_000).is_err()); // 1_000_000_000 isn't a valid year /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_year(self, year: i32) -> Result { - Ok(Self(const_try!(self.0.replace_year(year)))) + Ok(const_try!(self.date_time().replace_year(year)).assume_offset(self.offset())) } /// Replace the month of the year. @@ -865,8 +1095,9 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 01 - 30 12:00 +01).replace_month(Month::February).is_err()); // 30 isn't a valid day in February /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_month(self, month: Month) -> Result { - Ok(Self(const_try!(self.0.replace_month(month)))) + Ok(const_try!(self.date_time().replace_month(month)).assume_offset(self.offset())) } /// Replace the day of the month. @@ -880,8 +1111,22 @@ impl OffsetDateTime { /// assert!(datetime!(2022 - 02 - 18 12:00 +01).replace_day(0).is_err()); // 00 isn't a valid day /// assert!(datetime!(2022 - 02 - 18 12:00 +01).replace_day(30).is_err()); // 30 isn't a valid day in February /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_day(self, day: u8) -> Result { - Ok(Self(const_try!(self.0.replace_day(day)))) + Ok(const_try!(self.date_time().replace_day(day)).assume_offset(self.offset())) + } + + /// Replace the day of the year. + /// + /// ```rust + /// # use time_macros::datetime; + /// assert_eq!(datetime!(2022-049 12:00 +01).replace_ordinal(1), Ok(datetime!(2022-001 12:00 +01))); + /// assert!(datetime!(2022-049 12:00 +01).replace_ordinal(0).is_err()); // 0 isn't a valid ordinal + /// assert!(datetime!(2022-049 12:00 +01).replace_ordinal(366).is_err()); // 2022 isn't a leap year + /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] + pub const fn replace_ordinal(self, ordinal: u16) -> Result { + Ok(const_try!(self.date_time().replace_ordinal(ordinal)).assume_offset(self.offset())) } /// Replace the clock hour. @@ -894,8 +1139,9 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_hour(24).is_err()); // 24 isn't a valid hour /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_hour(self, hour: u8) -> Result { - Ok(Self(const_try!(self.0.replace_hour(hour)))) + Ok(const_try!(self.date_time().replace_hour(hour)).assume_offset(self.offset())) } /// Replace the minutes within the hour. @@ -908,8 +1154,9 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_minute(60).is_err()); // 60 isn't a valid minute /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_minute(self, minute: u8) -> Result { - Ok(Self(const_try!(self.0.replace_minute(minute)))) + Ok(const_try!(self.date_time().replace_minute(minute)).assume_offset(self.offset())) } /// Replace the seconds within the minute. @@ -922,8 +1169,9 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_second(60).is_err()); // 60 isn't a valid second /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_second(self, second: u8) -> Result { - Ok(Self(const_try!(self.0.replace_second(second)))) + Ok(const_try!(self.date_time().replace_second(second)).assume_offset(self.offset())) } /// Replace the milliseconds within the second. @@ -936,11 +1184,15 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_millisecond(1_000).is_err()); // 1_000 isn't a valid millisecond /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_millisecond( self, millisecond: u16, ) -> Result { - Ok(Self(const_try!(self.0.replace_millisecond(millisecond)))) + Ok( + const_try!(self.date_time().replace_millisecond(millisecond)) + .assume_offset(self.offset()), + ) } /// Replace the microseconds within the second. @@ -953,11 +1205,15 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_microsecond(1_000_000).is_err()); // 1_000_000 isn't a valid microsecond /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_microsecond( self, microsecond: u32, ) -> Result { - Ok(Self(const_try!(self.0.replace_microsecond(microsecond)))) + Ok( + const_try!(self.date_time().replace_microsecond(microsecond)) + .assume_offset(self.offset()), + ) } /// Replace the nanoseconds within the second. @@ -970,8 +1226,12 @@ impl OffsetDateTime { /// ); /// assert!(datetime!(2022 - 02 - 18 01:02:03.004_005_006 +01).replace_nanosecond(1_000_000_000).is_err()); // 1_000_000_000 isn't a valid nanosecond /// ``` + #[must_use = "This method does not mutate the original `OffsetDateTime`."] pub const fn replace_nanosecond(self, nanosecond: u32) -> Result { - Ok(Self(const_try!(self.0.replace_nanosecond(nanosecond)))) + Ok( + const_try!(self.date_time().replace_nanosecond(nanosecond)) + .assume_offset(self.offset()), + ) } } // endregion replacement @@ -986,7 +1246,12 @@ impl OffsetDateTime { output: &mut impl io::Write, format: &(impl Formattable + ?Sized), ) -> Result { - self.0.format_into(output, format) + format.format_into( + output, + Some(self.date()), + Some(self.time()), + Some(self.offset()), + ) } /// Format the `OffsetDateTime` using the provided [format @@ -1006,7 +1271,7 @@ impl OffsetDateTime { /// # Ok::<_, time::Error>(()) /// ``` pub fn format(self, format: &(impl Formattable + ?Sized)) -> Result { - self.0.format(format) + format.format(Some(self.date()), Some(self.time()), Some(self.offset())) } } @@ -1032,15 +1297,39 @@ impl OffsetDateTime { input: &str, description: &(impl Parsable + ?Sized), ) -> Result { - Inner::parse(input, description).map(Self) + description.parse_offset_date_time(input.as_bytes()) + } + + /// A helper method to check if the `OffsetDateTime` is a valid representation of a leap second. + /// Leap seconds, when parsed, are represented as the preceding nanosecond. However, leap + /// seconds can only occur as the last second of a month UTC. + #[cfg(feature = "parsing")] + pub(crate) const fn is_valid_leap_second_stand_in(self) -> bool { + // This comparison doesn't need to be adjusted for the stored offset, so check it first for + // speed. + if self.nanosecond() != 999_999_999 { + return false; + } + + let (year, ordinal, time) = self.to_offset_raw(UtcOffset::UTC); + let Ok(date) = Date::from_ordinal_date(year, ordinal) else { + return false; + }; + + time.hour() == 23 + && time.minute() == 59 + && time.second() == 59 + && date.day() == util::days_in_year_month(year, date.month()) } } impl SmartDisplay for OffsetDateTime { - type Metadata = DateTimeMetadata; + type Metadata = (); - fn metadata(&self, f: FormatterOptions) -> Metadata { - self.0.metadata(f).reuse() + fn metadata(&self, _: FormatterOptions) -> Metadata { + let width = + smart_display::padded_width_of!(self.date(), " ", self.time(), " ", self.offset()); + Metadata::new(width, self, ()) } fn fmt_with_metadata( @@ -1048,7 +1337,10 @@ impl SmartDisplay for OffsetDateTime { f: &mut fmt::Formatter<'_>, metadata: Metadata, ) -> fmt::Result { - self.0.fmt_with_metadata(f, metadata.reuse()) + f.pad_with_width( + metadata.unpadded_width(), + format_args!("{} {} {}", self.date(), self.time(), self.offset()), + ) } } @@ -1069,64 +1361,121 @@ impl fmt::Debug for OffsetDateTime { impl Add for OffsetDateTime { type Output = Self; - fn add(self, rhs: Duration) -> Self::Output { - Self(self.0.add(rhs)) + /// # Panics + /// + /// This may panic if an overflow occurs. + fn add(self, duration: Duration) -> Self::Output { + self.checked_add(duration) + .expect("resulting value is out of range") } } impl Add for OffsetDateTime { type Output = Self; - fn add(self, rhs: StdDuration) -> Self::Output { - Self(self.0.add(rhs)) + /// # Panics + /// + /// This may panic if an overflow occurs. + fn add(self, duration: StdDuration) -> Self::Output { + let (is_next_day, time) = self.time().adjusting_add_std(duration); + + Self::new_in_offset( + if is_next_day { + (self.date() + duration) + .next_day() + .expect("resulting value is out of range") + } else { + self.date() + duration + }, + time, + self.offset, + ) } } impl AddAssign for OffsetDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn add_assign(&mut self, rhs: Duration) { - self.0.add_assign(rhs); + *self = *self + rhs; } } impl AddAssign for OffsetDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn add_assign(&mut self, rhs: StdDuration) { - self.0.add_assign(rhs); + *self = *self + rhs; } } impl Sub for OffsetDateTime { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: Duration) -> Self::Output { - Self(self.0.sub(rhs)) + self.checked_sub(rhs) + .expect("resulting value is out of range") } } impl Sub for OffsetDateTime { type Output = Self; - fn sub(self, rhs: StdDuration) -> Self::Output { - Self(self.0.sub(rhs)) + /// # Panics + /// + /// This may panic if an overflow occurs. + fn sub(self, duration: StdDuration) -> Self::Output { + let (is_previous_day, time) = self.time().adjusting_sub_std(duration); + + Self::new_in_offset( + if is_previous_day { + (self.date() - duration) + .previous_day() + .expect("resulting value is out of range") + } else { + self.date() - duration + }, + time, + self.offset, + ) } } impl SubAssign for OffsetDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub_assign(&mut self, rhs: Duration) { - self.0.sub_assign(rhs); + *self = *self - rhs; } } impl SubAssign for OffsetDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub_assign(&mut self, rhs: StdDuration) { - self.0.sub_assign(rhs); + *self = *self - rhs; } } impl Sub for OffsetDateTime { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: Self) -> Self::Output { - self.0.sub(rhs.0) + let base = self.date_time() - rhs.date_time(); + let adjustment = Duration::seconds( + (self.offset.whole_seconds() - rhs.offset.whole_seconds()).extend::(), + ); + base - adjustment } } @@ -1134,8 +1483,11 @@ impl Sub for OffsetDateTime { impl Sub for OffsetDateTime { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: SystemTime) -> Self::Output { - self.0.sub(rhs) + self - Self::from(rhs) } } @@ -1143,50 +1495,94 @@ impl Sub for OffsetDateTime { impl Sub for SystemTime { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: OffsetDateTime) -> Self::Output { - self.sub(rhs.0) + OffsetDateTime::from(self) - rhs } } +#[cfg(feature = "std")] +impl Add for SystemTime { + type Output = Self; + + fn add(self, duration: Duration) -> Self::Output { + if duration.is_zero() { + self + } else if duration.is_positive() { + self + duration.unsigned_abs() + } else { + debug_assert!(duration.is_negative()); + self - duration.unsigned_abs() + } + } +} + +crate::internal_macros::impl_add_assign!(SystemTime: #[cfg(feature = "std")] Duration); + +#[cfg(feature = "std")] +impl Sub for SystemTime { + type Output = Self; + + fn sub(self, duration: Duration) -> Self::Output { + (OffsetDateTime::from(self) - duration).into() + } +} + +crate::internal_macros::impl_sub_assign!(SystemTime: #[cfg(feature = "std")] Duration); + #[cfg(feature = "std")] impl PartialEq for OffsetDateTime { fn eq(&self, rhs: &SystemTime) -> bool { - self.0.eq(rhs) + self == &Self::from(*rhs) } } #[cfg(feature = "std")] impl PartialEq for SystemTime { fn eq(&self, rhs: &OffsetDateTime) -> bool { - self.eq(&rhs.0) + &OffsetDateTime::from(*self) == rhs } } #[cfg(feature = "std")] impl PartialOrd for OffsetDateTime { fn partial_cmp(&self, other: &SystemTime) -> Option { - self.0.partial_cmp(other) + self.partial_cmp(&Self::from(*other)) } } #[cfg(feature = "std")] impl PartialOrd for SystemTime { fn partial_cmp(&self, other: &OffsetDateTime) -> Option { - self.partial_cmp(&other.0) + OffsetDateTime::from(*self).partial_cmp(other) } } #[cfg(feature = "std")] impl From for OffsetDateTime { fn from(system_time: SystemTime) -> Self { - Self(Inner::from(system_time)) + match system_time.duration_since(SystemTime::UNIX_EPOCH) { + Ok(duration) => Self::UNIX_EPOCH + duration, + Err(err) => Self::UNIX_EPOCH - err.duration(), + } } } #[cfg(feature = "std")] impl From for SystemTime { fn from(datetime: OffsetDateTime) -> Self { - datetime.0.into() + let duration = datetime - OffsetDateTime::UNIX_EPOCH; + + if duration.is_zero() { + Self::UNIX_EPOCH + } else if duration.is_positive() { + Self::UNIX_EPOCH + duration.unsigned_abs() + } else { + debug_assert!(duration.is_negative()); + Self::UNIX_EPOCH - duration.unsigned_abs() + } } } @@ -1196,8 +1592,14 @@ impl From for SystemTime { feature = "wasm-bindgen" ))] impl From for OffsetDateTime { + /// # Panics + /// + /// This may panic if the timestamp can not be represented. fn from(js_date: js_sys::Date) -> Self { - Self(Inner::from(js_date)) + // get_time() returns milliseconds + let timestamp_nanos = (js_date.get_time() * Nanosecond::per(Millisecond) as f64) as i128; + Self::from_unix_timestamp_nanos(timestamp_nanos) + .expect("invalid timestamp: Timestamp cannot fit in range") } } @@ -1208,8 +1610,11 @@ impl From for OffsetDateTime { ))] impl From for js_sys::Date { fn from(datetime: OffsetDateTime) -> Self { - datetime.0.into() + // new Date() takes milliseconds + let timestamp = (datetime.unix_timestamp_nanos() + / Nanosecond::per(Millisecond).cast_signed().extend::()) + as f64; + js_sys::Date::new(×tamp.into()) } } - // endregion trait impls diff --git a/vendor/time/src/parsing/combinator/mod.rs b/vendor/time/src/parsing/combinator/mod.rs index 3b4bc7a81..e3e1df76c 100644 --- a/vendor/time/src/parsing/combinator/mod.rs +++ b/vendor/time/src/parsing/combinator/mod.rs @@ -2,6 +2,8 @@ pub(crate) mod rfc; +use num_conv::prelude::*; + use crate::format_description::modifier::Padding; use crate::parsing::shim::{Integer, IntegerParseBytes}; use crate::parsing::ParsedItem; @@ -135,7 +137,7 @@ pub(crate) fn n_to_m_digits_padded<'a, const N: u8, const M: u8, T: Integer>( None => break, } } - let pad_width = (orig_input.len() - input.len()) as u8; + let pad_width = (orig_input.len() - input.len()).truncate::(); orig_input = input; for _ in 0..(N - pad_width) { diff --git a/vendor/time/src/parsing/combinator/rfc/iso8601.rs b/vendor/time/src/parsing/combinator/rfc/iso8601.rs index 613a9057f..91eea2dc2 100644 --- a/vendor/time/src/parsing/combinator/rfc/iso8601.rs +++ b/vendor/time/src/parsing/combinator/rfc/iso8601.rs @@ -4,6 +4,8 @@ use core::num::{NonZeroU16, NonZeroU8}; +use num_conv::prelude::*; + use crate::parsing::combinator::{any_digit, ascii_char, exactly_n_digits, first_match, sign}; use crate::parsing::ParsedItem; use crate::{Month, Weekday}; @@ -62,10 +64,10 @@ impl ExtendedKind { pub(crate) fn year(input: &[u8]) -> Option> { Some(match sign(input) { Some(ParsedItem(input, sign)) => exactly_n_digits::<6, u32>(input)?.map(|val| { - let val = val as i32; + let val = val.cast_signed(); if sign == b'-' { -val } else { val } }), - None => exactly_n_digits::<4, u32>(input)?.map(|val| val as _), + None => exactly_n_digits::<4, u32>(input)?.map(|val| val.cast_signed()), }) } diff --git a/vendor/time/src/parsing/component.rs b/vendor/time/src/parsing/component.rs index 42d15e9f6..e2a7e7c0d 100644 --- a/vendor/time/src/parsing/component.rs +++ b/vendor/time/src/parsing/component.rs @@ -2,6 +2,8 @@ use core::num::{NonZeroU16, NonZeroU8}; +use num_conv::prelude::*; + use crate::convert::*; use crate::format_description::modifier; #[cfg(feature = "large-dates")] @@ -25,14 +27,14 @@ pub(crate) fn parse_year(input: &[u8], modifiers: modifier::Year) -> Option(modifiers.padding)(input)?; match sign { - Some(b'-') => Some(ParsedItem(input, -(year as i32))), + Some(b'-') => Some(ParsedItem(input, -year.cast_signed())), None if modifiers.sign_is_mandatory || year >= 10_000 => None, - _ => Some(ParsedItem(input, year as i32)), + _ => Some(ParsedItem(input, year.cast_signed())), } } - modifier::YearRepr::LastTwo => { - Some(exactly_n_digits_padded::<2, u32>(modifiers.padding)(input)?.map(|v| v as i32)) - } + modifier::YearRepr::LastTwo => Some( + exactly_n_digits_padded::<2, u32>(modifiers.padding)(input)?.map(|v| v.cast_signed()), + ), } } @@ -243,11 +245,11 @@ pub(crate) fn parse_subsecond( Nine => exactly_n_digits::<9, _>(input)?, OneOrMore => { let ParsedItem(mut input, mut value) = - any_digit(input)?.map(|v| (v - b'0') as u32 * 100_000_000); + any_digit(input)?.map(|v| (v - b'0').extend::() * 100_000_000); let mut multiplier = 10_000_000; while let Some(ParsedItem(new_input, digit)) = any_digit(input) { - value += (digit - b'0') as u32 * multiplier; + value += (digit - b'0').extend::() * multiplier; input = new_input; multiplier /= 10; } @@ -269,9 +271,9 @@ pub(crate) fn parse_offset_hour( let ParsedItem(input, sign) = opt(sign)(input); let ParsedItem(input, hour) = exactly_n_digits_padded::<2, u8>(modifiers.padding)(input)?; match sign { - Some(b'-') => Some(ParsedItem(input, (-(hour as i8), true))), + Some(b'-') => Some(ParsedItem(input, (-hour.cast_signed(), true))), None if modifiers.sign_is_mandatory => None, - _ => Some(ParsedItem(input, (hour as i8, false))), + _ => Some(ParsedItem(input, (hour.cast_signed(), false))), } } @@ -282,7 +284,7 @@ pub(crate) fn parse_offset_minute( ) -> Option> { Some( exactly_n_digits_padded::<2, u8>(modifiers.padding)(input)? - .map(|offset_minute| offset_minute as _), + .map(|offset_minute| offset_minute.cast_signed()), ) } @@ -293,7 +295,7 @@ pub(crate) fn parse_offset_second( ) -> Option> { Some( exactly_n_digits_padded::<2, u8>(modifiers.padding)(input)? - .map(|offset_second| offset_second as _), + .map(|offset_second| offset_second.cast_signed()), ) } // endregion offset components @@ -304,7 +306,7 @@ pub(crate) fn parse_ignore( modifiers: modifier::Ignore, ) -> Option> { let modifier::Ignore { count } = modifiers; - let input = input.get((count.get() as usize)..)?; + let input = input.get((count.get().extend())..)?; Some(ParsedItem(input, ())) } @@ -315,20 +317,19 @@ pub(crate) fn parse_unix_timestamp( ) -> Option> { let ParsedItem(input, sign) = opt(sign)(input); let ParsedItem(input, nano_timestamp) = match modifiers.precision { - modifier::UnixTimestampPrecision::Second => { - n_to_m_digits::<1, 14, u128>(input)?.map(|val| val * Nanosecond::per(Second) as u128) - } + modifier::UnixTimestampPrecision::Second => n_to_m_digits::<1, 14, u128>(input)? + .map(|val| val * Nanosecond::per(Second).extend::()), modifier::UnixTimestampPrecision::Millisecond => n_to_m_digits::<1, 17, u128>(input)? - .map(|val| val * Nanosecond::per(Millisecond) as u128), + .map(|val| val * Nanosecond::per(Millisecond).extend::()), modifier::UnixTimestampPrecision::Microsecond => n_to_m_digits::<1, 20, u128>(input)? - .map(|val| val * Nanosecond::per(Microsecond) as u128), + .map(|val| val * Nanosecond::per(Microsecond).extend::()), modifier::UnixTimestampPrecision::Nanosecond => n_to_m_digits::<1, 23, _>(input)?, }; match sign { - Some(b'-') => Some(ParsedItem(input, -(nano_timestamp as i128))), + Some(b'-') => Some(ParsedItem(input, -nano_timestamp.cast_signed())), None if modifiers.sign_is_mandatory => None, - _ => Some(ParsedItem(input, nano_timestamp as _)), + _ => Some(ParsedItem(input, nano_timestamp.cast_signed())), } } diff --git a/vendor/time/src/parsing/iso8601.rs b/vendor/time/src/parsing/iso8601.rs index 048fc9584..67458f0a9 100644 --- a/vendor/time/src/parsing/iso8601.rs +++ b/vendor/time/src/parsing/iso8601.rs @@ -1,5 +1,7 @@ //! Parse parts of an ISO 8601-formatted value. +use num_conv::prelude::*; + use crate::convert::*; use crate::error; use crate::error::ParseFromDescription::{InvalidComponent, InvalidLiteral}; @@ -255,9 +257,9 @@ impl Iso8601 { .and_then(|parsed_item| { parsed_item.consume_value(|hour| { parsed.set_offset_hour(if sign == b'-' { - -(hour as i8) + -hour.cast_signed() } else { - hour as _ + hour.cast_signed() }) }) }) @@ -277,9 +279,9 @@ impl Iso8601 { input = new_input; parsed .set_offset_minute_signed(if sign == b'-' { - -(min as i8) + -min.cast_signed() } else { - min as _ + min.cast_signed() }) .ok_or(InvalidComponent("offset minute"))?; } diff --git a/vendor/time/src/parsing/mod.rs b/vendor/time/src/parsing/mod.rs index 4a2aa829f..e65cfd566 100644 --- a/vendor/time/src/parsing/mod.rs +++ b/vendor/time/src/parsing/mod.rs @@ -31,6 +31,13 @@ impl<'a, T> ParsedItem<'a, T> { f(self.1)?; Some(self.0) } + + /// Filter the value with the provided function. If the function returns `false`, the value + /// is discarded and `None` is returned. Otherwise, the value is preserved and `Some(self)` is + /// returned. + pub(crate) fn filter(self, f: impl FnOnce(&T) -> bool) -> Option> { + f(&self.1).then_some(self) + } } impl<'a> ParsedItem<'a, ()> { diff --git a/vendor/time/src/parsing/parsable.rs b/vendor/time/src/parsing/parsable.rs index 30fda4db2..bed178283 100644 --- a/vendor/time/src/parsing/parsable.rs +++ b/vendor/time/src/parsing/parsable.rs @@ -2,7 +2,8 @@ use core::ops::Deref; -use crate::date_time::{maybe_offset_from_offset, MaybeOffset}; +use num_conv::prelude::*; + use crate::error::TryFromParsed; use crate::format_description::well_known::iso8601::EncodedConfig; use crate::format_description::well_known::{Iso8601, Rfc2822, Rfc3339}; @@ -11,10 +12,11 @@ use crate::format_description::FormatItem; use crate::format_description::OwnedFormatItem; use crate::internal_macros::bug; use crate::parsing::{Parsed, ParsedItem}; -use crate::{error, Date, DateTime, Month, Time, UtcOffset, Weekday}; +use crate::{error, Date, Month, OffsetDateTime, Time, UtcOffset, Weekday}; /// A type that can be parsed. #[cfg_attr(__time_03_docs, doc(notable_trait))] +#[doc(alias = "Parseable")] pub trait Parsable: sealed::Sealed {} impl Parsable for FormatItem<'_> {} impl Parsable for [FormatItem<'_>] {} @@ -32,6 +34,7 @@ impl Parsable for T where T::Target: Parsable {} mod sealed { #[allow(clippy::wildcard_imports)] use super::*; + use crate::{OffsetDateTime, PrimitiveDateTime}; /// Parse the item using a format description and an input. pub trait Sealed { @@ -74,11 +77,16 @@ mod sealed { Ok(self.parse(input)?.try_into()?) } - /// Parse a [`DateTime`] from the format description. - fn parse_date_time( + /// Parse a [`PrimitiveDateTime`] from the format description. + fn parse_primitive_date_time( &self, input: &[u8], - ) -> Result, error::Parse> { + ) -> Result { + Ok(self.parse(input)?.try_into()?) + } + + /// Parse a [`OffsetDateTime`] from the format description. + fn parse_offset_date_time(&self, input: &[u8]) -> Result { Ok(self.parse(input)?.try_into()?) } } @@ -202,7 +210,9 @@ impl sealed::Sealed for Rfc2822 { Some(item) => { let input = item .flat_map(|year| if year >= 1900 { Some(year) } else { None }) - .and_then(|item| item.consume_value(|value| parsed.set_year(value as _))) + .and_then(|item| { + item.consume_value(|value| parsed.set_year(value.cast_signed())) + }) .ok_or(InvalidComponent("year"))?; fws(input).ok_or(InvalidLiteral)?.into_inner() } @@ -210,7 +220,7 @@ impl sealed::Sealed for Rfc2822 { let input = exactly_n_digits::<2, u32>(input) .and_then(|item| { item.map(|year| if year < 50 { year + 2000 } else { year + 1900 }) - .map(|year| year as _) + .map(|year| year.cast_signed()) .consume_value(|value| parsed.set_year(value)) }) .ok_or(InvalidComponent("year"))?; @@ -283,9 +293,9 @@ impl sealed::Sealed for Rfc2822 { .and_then(|item| { item.map(|offset_hour| { if offset_sign == b'-' { - -(offset_hour as i8) + -offset_hour.cast_signed() } else { - offset_hour as _ + offset_hour.cast_signed() } }) .consume_value(|value| parsed.set_offset_hour(value)) @@ -293,14 +303,14 @@ impl sealed::Sealed for Rfc2822 { .ok_or(InvalidComponent("offset hour"))?; let input = exactly_n_digits::<2, u8>(input) .and_then(|item| { - item.consume_value(|value| parsed.set_offset_minute_signed(value as _)) + item.consume_value(|value| parsed.set_offset_minute_signed(value.cast_signed())) }) .ok_or(InvalidComponent("offset minute"))?; Ok(input) } - fn parse_date_time(&self, input: &[u8]) -> Result, error::Parse> { + fn parse_offset_date_time(&self, input: &[u8]) -> Result { use crate::error::ParseFromDescription::{InvalidComponent, InvalidLiteral}; use crate::parsing::combinator::rfc::rfc2822::{cfws, fws}; use crate::parsing::combinator::{ @@ -420,16 +430,16 @@ impl sealed::Sealed for Rfc2822 { .map(|item| { item.map(|offset_hour| { if offset_sign == b'-' { - -(offset_hour as i8) + -offset_hour.cast_signed() } else { - offset_hour as _ + offset_hour.cast_signed() } }) }) .ok_or(InvalidComponent("offset hour"))?; let ParsedItem(input, offset_minute) = exactly_n_digits::<2, u8>(input).ok_or(InvalidComponent("offset minute"))?; - (input, offset_hour, offset_minute as i8) + (input, offset_hour, offset_minute.cast_signed()) }; if !input.is_empty() { @@ -439,9 +449,7 @@ impl sealed::Sealed for Rfc2822 { } let mut nanosecond = 0; - let leap_second_input = if !O::HAS_LOGICAL_OFFSET { - false - } else if second == 60 { + let leap_second_input = if second == 60 { second = 59; nanosecond = 999_999_999; true @@ -450,14 +458,10 @@ impl sealed::Sealed for Rfc2822 { }; let dt = (|| { - let date = Date::from_calendar_date(year as _, month, day)?; + let date = Date::from_calendar_date(year.cast_signed(), month, day)?; let time = Time::from_hms_nano(hour, minute, second, nanosecond)?; let offset = UtcOffset::from_hms(offset_hour, offset_minute, 0)?; - Ok(DateTime { - date, - time, - offset: maybe_offset_from_offset::(offset), - }) + Ok(OffsetDateTime::new_in_offset(date, time, offset)) })() .map_err(TryFromParsed::ComponentRange)?; @@ -492,7 +496,7 @@ impl sealed::Sealed for Rfc3339 { let colon = ascii_char::; let input = exactly_n_digits::<4, u32>(input) - .and_then(|item| item.consume_value(|value| parsed.set_year(value as _))) + .and_then(|item| item.consume_value(|value| parsed.set_year(value.cast_signed()))) .ok_or(InvalidComponent("year"))?; let input = dash(input).ok_or(InvalidLiteral)?.into_inner(); let input = exactly_n_digits::<2, _>(input) @@ -520,11 +524,11 @@ impl sealed::Sealed for Rfc3339 { let input = if let Some(ParsedItem(input, ())) = ascii_char::(input) { let ParsedItem(mut input, mut value) = any_digit(input) .ok_or(InvalidComponent("subsecond"))? - .map(|v| (v - b'0') as u32 * 100_000_000); + .map(|v| (v - b'0').extend::() * 100_000_000); let mut multiplier = 10_000_000; while let Some(ParsedItem(new_input, digit)) = any_digit(input) { - value += (digit - b'0') as u32 * multiplier; + value += (digit - b'0').extend::() * multiplier; input = new_input; multiplier /= 10; } @@ -556,14 +560,15 @@ impl sealed::Sealed for Rfc3339 { let ParsedItem(input, offset_sign) = sign(input).ok_or(InvalidComponent("offset hour"))?; let input = exactly_n_digits::<2, u8>(input) .and_then(|item| { - item.map(|offset_hour| { - if offset_sign == b'-' { - -(offset_hour as i8) - } else { - offset_hour as _ - } - }) - .consume_value(|value| parsed.set_offset_hour(value)) + item.filter(|&offset_hour| offset_hour <= 23)? + .map(|offset_hour| { + if offset_sign == b'-' { + -offset_hour.cast_signed() + } else { + offset_hour.cast_signed() + } + }) + .consume_value(|value| parsed.set_offset_hour(value)) }) .ok_or(InvalidComponent("offset hour"))?; let input = colon(input).ok_or(InvalidLiteral)?.into_inner(); @@ -571,9 +576,9 @@ impl sealed::Sealed for Rfc3339 { .and_then(|item| { item.map(|offset_minute| { if offset_sign == b'-' { - -(offset_minute as i8) + -offset_minute.cast_signed() } else { - offset_minute as _ + offset_minute.cast_signed() } }) .consume_value(|value| parsed.set_offset_minute_signed(value)) @@ -583,7 +588,7 @@ impl sealed::Sealed for Rfc3339 { Ok(input) } - fn parse_date_time(&self, input: &[u8]) -> Result, error::Parse> { + fn parse_offset_date_time(&self, input: &[u8]) -> Result { use crate::error::ParseFromDescription::{InvalidComponent, InvalidLiteral}; use crate::parsing::combinator::{ any_digit, ascii_char, ascii_char_ignore_case, exactly_n_digits, sign, @@ -615,11 +620,11 @@ impl sealed::Sealed for Rfc3339 { if let Some(ParsedItem(input, ())) = ascii_char::(input) { let ParsedItem(mut input, mut value) = any_digit(input) .ok_or(InvalidComponent("subsecond"))? - .map(|v| (v - b'0') as u32 * 100_000_000); + .map(|v| (v - b'0').extend::() * 100_000_000); let mut multiplier = 10_000_000; while let Some(ParsedItem(new_input, digit)) = any_digit(input) { - value += (digit - b'0') as u32 * multiplier; + value += (digit - b'0').extend::() * multiplier; input = new_input; multiplier /= 10; } @@ -634,21 +639,22 @@ impl sealed::Sealed for Rfc3339 { } else { let ParsedItem(input, offset_sign) = sign(input).ok_or(InvalidComponent("offset hour"))?; - let ParsedItem(input, offset_hour) = - exactly_n_digits::<2, u8>(input).ok_or(InvalidComponent("offset hour"))?; + let ParsedItem(input, offset_hour) = exactly_n_digits::<2, u8>(input) + .and_then(|parsed| parsed.filter(|&offset_hour| offset_hour <= 23)) + .ok_or(InvalidComponent("offset hour"))?; let input = colon(input).ok_or(InvalidLiteral)?.into_inner(); let ParsedItem(input, offset_minute) = exactly_n_digits::<2, u8>(input).ok_or(InvalidComponent("offset minute"))?; UtcOffset::from_hms( if offset_sign == b'-' { - -(offset_hour as i8) + -offset_hour.cast_signed() } else { - offset_hour as _ + offset_hour.cast_signed() }, if offset_sign == b'-' { - -(offset_minute as i8) + -offset_minute.cast_signed() } else { - offset_minute as _ + offset_minute.cast_signed() }, 0, ) @@ -684,12 +690,11 @@ impl sealed::Sealed for Rfc3339 { }; let date = Month::from_number(month) - .and_then(|month| Date::from_calendar_date(year as _, month, day)) + .and_then(|month| Date::from_calendar_date(year.cast_signed(), month, day)) .map_err(TryFromParsed::ComponentRange)?; let time = Time::from_hms_nano(hour, minute, second, nanosecond) .map_err(TryFromParsed::ComponentRange)?; - let offset = maybe_offset_from_offset::(offset); - let dt = DateTime { date, time, offset }; + let dt = OffsetDateTime::new_in_offset(date, time, offset); if leap_second_input && !dt.is_valid_leap_second_stand_in() { return Err(error::Parse::TryFromParsed(TryFromParsed::ComponentRange( diff --git a/vendor/time/src/parsing/parsed.rs b/vendor/time/src/parsing/parsed.rs index f31087fe2..e6451c197 100644 --- a/vendor/time/src/parsing/parsed.rs +++ b/vendor/time/src/parsing/parsed.rs @@ -6,15 +6,15 @@ use deranged::{ OptionRangedI128, OptionRangedI32, OptionRangedI8, OptionRangedU16, OptionRangedU32, OptionRangedU8, RangedI128, RangedI32, RangedI8, RangedU16, RangedU32, RangedU8, }; +use num_conv::prelude::*; use crate::convert::{Day, Hour, Minute, Nanosecond, Second}; use crate::date::{MAX_YEAR, MIN_YEAR}; -use crate::date_time::{maybe_offset_from_offset, offset_kind, DateTime, MaybeOffset}; use crate::error::TryFromParsed::InsufficientInformation; #[cfg(feature = "alloc")] use crate::format_description::OwnedFormatItem; use crate::format_description::{modifier, Component, FormatItem}; -use crate::internal_macros::const_try_opt; +use crate::internal_macros::{bug, const_try_opt}; use crate::parsing::component::{ parse_day, parse_end, parse_hour, parse_ignore, parse_minute, parse_month, parse_offset_hour, parse_offset_minute, parse_offset_second, parse_ordinal, parse_period, parse_second, @@ -159,13 +159,13 @@ pub struct Parsed { offset_second: OptionRangedI8<{ -((Second::per(Minute) - 1) as i8) }, { (Second::per(Minute) - 1) as _ }>, /// The Unix timestamp in nanoseconds. - // unix_timestamp_nanos: MaybeUninit, unix_timestamp_nanos: OptionRangedI128< - { Date::MIN.midnight().assume_utc().unix_timestamp_nanos() }, { - Date::MAX - .with_time(Time::MAX) - .assume_utc() + OffsetDateTime::new_in_offset(Date::MIN, Time::MIDNIGHT, UtcOffset::UTC) + .unix_timestamp_nanos() + }, + { + OffsetDateTime::new_in_offset(Date::MAX, Time::MAX, UtcOffset::UTC) .unix_timestamp_nanos() }, >, @@ -290,9 +290,13 @@ impl Parsed { parse_year(input, modifiers).ok_or(InvalidComponent("year"))?; match (modifiers.iso_week_based, modifiers.repr) { (false, modifier::YearRepr::Full) => self.set_year(value), - (false, modifier::YearRepr::LastTwo) => self.set_year_last_two(value as _), + (false, modifier::YearRepr::LastTwo) => { + self.set_year_last_two(value.cast_unsigned().truncate()) + } (true, modifier::YearRepr::Full) => self.set_iso_year(value), - (true, modifier::YearRepr::LastTwo) => self.set_iso_year_last_two(value as _), + (true, modifier::YearRepr::LastTwo) => { + self.set_iso_year_last_two(value.cast_unsigned().truncate()) + } } .ok_or(InvalidComponent("year"))?; Ok(remaining) @@ -533,10 +537,10 @@ impl Parsed { note = "use `parsed.set_offset_minute_signed()` instead" )] pub fn set_offset_minute(&mut self, value: u8) -> Option<()> { - if value > i8::MAX as u8 { + if value > i8::MAX.cast_unsigned() { None } else { - self.set_offset_minute_signed(value as _) + self.set_offset_minute_signed(value.cast_signed()) } } @@ -547,10 +551,10 @@ impl Parsed { note = "use `parsed.set_offset_second_signed()` instead" )] pub fn set_offset_second(&mut self, value: u8) -> Option<()> { - if value > i8::MAX as u8 { + if value > i8::MAX.cast_unsigned() { None } else { - self.set_offset_second_signed(value as _) + self.set_offset_second_signed(value.cast_signed()) } } } @@ -761,15 +765,17 @@ impl TryFrom for Date { )?), (year, sunday_week_number, weekday) => Ok(Self::from_ordinal_date( year, - (sunday_week_number as i16 * 7 + weekday.number_days_from_sunday() as i16 + (sunday_week_number.cast_signed().extend::() * 7 + + weekday.number_days_from_sunday().cast_signed().extend::() - adjustment(year) - + 1) as u16, + + 1).cast_unsigned(), )?), (year, monday_week_number, weekday) => Ok(Self::from_ordinal_date( year, - (monday_week_number as i16 * 7 + weekday.number_days_from_monday() as i16 + (monday_week_number.cast_signed().extend::() * 7 + + weekday.number_days_from_monday().cast_signed().extend::() - adjustment(year) - + 1) as u16, + + 1).cast_unsigned(), )?), _ => Err(InsufficientInformation), } @@ -835,61 +841,45 @@ impl TryFrom for UtcOffset { } impl TryFrom for PrimitiveDateTime { - type Error = as TryFrom>::Error; + type Error = error::TryFromParsed; fn try_from(parsed: Parsed) -> Result { - parsed.try_into().map(Self) + Ok(Self::new(parsed.try_into()?, parsed.try_into()?)) } } impl TryFrom for OffsetDateTime { - type Error = as TryFrom>::Error; - - fn try_from(parsed: Parsed) -> Result { - parsed.try_into().map(Self) - } -} - -impl TryFrom for DateTime { type Error = error::TryFromParsed; - #[allow(clippy::unwrap_in_result)] // We know the values are valid. fn try_from(mut parsed: Parsed) -> Result { - if O::HAS_LOGICAL_OFFSET { - if let Some(timestamp) = parsed.unix_timestamp_nanos() { - let DateTime { date, time, offset } = - DateTime::::from_unix_timestamp_nanos(timestamp)?; - - let mut value = Self { - date, - time, - offset: maybe_offset_from_offset::(offset), - }; - if let Some(subsecond) = parsed.subsecond() { - value = value.replace_nanosecond(subsecond)?; - } - return Ok(value); + if let Some(timestamp) = parsed.unix_timestamp_nanos() { + let mut value = Self::from_unix_timestamp_nanos(timestamp)?; + if let Some(subsecond) = parsed.subsecond() { + value = value.replace_nanosecond(subsecond)?; } + return Ok(value); } // Some well-known formats explicitly allow leap seconds. We don't currently support them, // so treat it as the nearest preceding moment that can be represented. Because leap seconds // always fall at the end of a month UTC, reject any that are at other times. let leap_second_input = if parsed.leap_second_allowed && parsed.second() == Some(60) { - parsed.set_second(59).expect("59 is a valid second"); - parsed - .set_subsecond(999_999_999) - .expect("999_999_999 is a valid subsecond"); + if parsed.set_second(59).is_none() { + bug!("59 is a valid second"); + } + if parsed.set_subsecond(999_999_999).is_none() { + bug!("999_999_999 is a valid subsecond"); + } true } else { false }; - let dt = Self { - date: Date::try_from(parsed)?, - time: Time::try_from(parsed)?, - offset: O::try_from_parsed(parsed)?, - }; + let dt = Self::new_in_offset( + Date::try_from(parsed)?, + Time::try_from(parsed)?, + UtcOffset::try_from(parsed)?, + ); if leap_second_input && !dt.is_valid_leap_second_stand_in() { return Err(error::TryFromParsed::ComponentRange( diff --git a/vendor/time/src/primitive_date_time.rs b/vendor/time/src/primitive_date_time.rs index 83a94610f..74eff7a51 100644 --- a/vendor/time/src/primitive_date_time.rs +++ b/vendor/time/src/primitive_date_time.rs @@ -6,22 +6,22 @@ use core::time::Duration as StdDuration; #[cfg(feature = "formatting")] use std::io; -use powerfmt::smart_display::{FormatterOptions, Metadata, SmartDisplay}; +use powerfmt::ext::FormatterExt as _; +use powerfmt::smart_display::{self, FormatterOptions, Metadata, SmartDisplay}; -use crate::date_time::{offset_kind, DateTimeMetadata}; #[cfg(feature = "formatting")] use crate::formatting::Formattable; use crate::internal_macros::{const_try, const_try_opt}; #[cfg(feature = "parsing")] use crate::parsing::Parsable; -use crate::{error, Date, DateTime, Duration, Month, OffsetDateTime, Time, UtcOffset, Weekday}; - -/// The actual type doing all the work. -type Inner = DateTime; +use crate::{error, util, Date, Duration, Month, OffsetDateTime, Time, UtcOffset, Weekday}; /// Combined date and time. #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub struct PrimitiveDateTime(#[allow(clippy::missing_docs_in_private_items)] pub(crate) Inner); +pub struct PrimitiveDateTime { + date: Date, + time: Time, +} impl PrimitiveDateTime { /// The smallest value that can be represented by `PrimitiveDateTime`. @@ -51,7 +51,10 @@ impl PrimitiveDateTime { doc = "assert_eq!(PrimitiveDateTime::MIN, datetime!(-9999-01-01 0:00));" )] /// ``` - pub const MIN: Self = Self(Inner::MIN); + pub const MIN: Self = Self { + date: Date::MIN, + time: Time::MIDNIGHT, + }; /// The largest value that can be represented by `PrimitiveDateTime`. /// @@ -80,7 +83,10 @@ impl PrimitiveDateTime { doc = "assert_eq!(PrimitiveDateTime::MAX, datetime!(+9999-12-31 23:59:59.999_999_999));" )] /// ``` - pub const MAX: Self = Self(Inner::MAX); + pub const MAX: Self = Self { + date: Date::MAX, + time: Time::MAX, + }; /// Create a new `PrimitiveDateTime` from the provided [`Date`] and [`Time`]. /// @@ -93,7 +99,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn new(date: Date, time: Time) -> Self { - Self(Inner::new(date, time)) + Self { date, time } } // region: component getters @@ -104,7 +110,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 0:00).date(), date!(2019-01-01)); /// ``` pub const fn date(self) -> Date { - self.0.date() + self.date } /// Get the [`Time`] component of the `PrimitiveDateTime`. @@ -114,7 +120,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 0:00).time(), time!(0:00)); /// ``` pub const fn time(self) -> Time { - self.0.time() + self.time } // endregion component getters @@ -128,7 +134,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2020-01-01 0:00).year(), 2020); /// ``` pub const fn year(self) -> i32 { - self.0.year() + self.date().year() } /// Get the month of the date. @@ -140,7 +146,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-12-31 0:00).month(), Month::December); /// ``` pub const fn month(self) -> Month { - self.0.month() + self.date().month() } /// Get the day of the date. @@ -153,7 +159,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-12-31 0:00).day(), 31); /// ``` pub const fn day(self) -> u8 { - self.0.day() + self.date().day() } /// Get the day of the year. @@ -166,7 +172,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-12-31 0:00).ordinal(), 365); /// ``` pub const fn ordinal(self) -> u16 { - self.0.ordinal() + self.date().ordinal() } /// Get the ISO week number. @@ -182,7 +188,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2021-01-01 0:00).iso_week(), 53); /// ``` pub const fn iso_week(self) -> u8 { - self.0.iso_week() + self.date().iso_week() } /// Get the week number where week 1 begins on the first Sunday. @@ -197,7 +203,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2021-01-01 0:00).sunday_based_week(), 0); /// ``` pub const fn sunday_based_week(self) -> u8 { - self.0.sunday_based_week() + self.date().sunday_based_week() } /// Get the week number where week 1 begins on the first Monday. @@ -212,7 +218,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2021-01-01 0:00).monday_based_week(), 0); /// ``` pub const fn monday_based_week(self) -> u8 { - self.0.monday_based_week() + self.date().monday_based_week() } /// Get the year, month, and day. @@ -226,7 +232,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn to_calendar_date(self) -> (i32, Month, u8) { - self.0.to_calendar_date() + self.date().to_calendar_date() } /// Get the year and ordinal day number. @@ -236,7 +242,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 0:00).to_ordinal_date(), (2019, 1)); /// ``` pub const fn to_ordinal_date(self) -> (i32, u16) { - self.0.to_ordinal_date() + self.date().to_ordinal_date() } /// Get the ISO 8601 year, week number, and weekday. @@ -266,7 +272,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn to_iso_week_date(self) -> (i32, u8, Weekday) { - self.0.to_iso_week_date() + self.date().to_iso_week_date() } /// Get the weekday. @@ -288,7 +294,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-12-01 0:00).weekday(), Sunday); /// ``` pub const fn weekday(self) -> Weekday { - self.0.weekday() + self.date().weekday() } /// Get the Julian day for the date. The time is not taken into account for this calculation. @@ -304,7 +310,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-12-31 0:00).to_julian_day(), 2_458_849); /// ``` pub const fn to_julian_day(self) -> i32 { - self.0.to_julian_day() + self.date().to_julian_day() } // endregion date getters @@ -317,7 +323,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2020-01-01 23:59:59).as_hms(), (23, 59, 59)); /// ``` pub const fn as_hms(self) -> (u8, u8, u8) { - self.0.as_hms() + self.time().as_hms() } /// Get the clock hour, minute, second, and millisecond. @@ -331,7 +337,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn as_hms_milli(self) -> (u8, u8, u8, u16) { - self.0.as_hms_milli() + self.time().as_hms_milli() } /// Get the clock hour, minute, second, and microsecond. @@ -345,7 +351,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn as_hms_micro(self) -> (u8, u8, u8, u32) { - self.0.as_hms_micro() + self.time().as_hms_micro() } /// Get the clock hour, minute, second, and nanosecond. @@ -359,7 +365,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn as_hms_nano(self) -> (u8, u8, u8, u32) { - self.0.as_hms_nano() + self.time().as_hms_nano() } /// Get the clock hour. @@ -372,7 +378,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 23:59:59).hour(), 23); /// ``` pub const fn hour(self) -> u8 { - self.0.hour() + self.time().hour() } /// Get the minute within the hour. @@ -385,7 +391,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 23:59:59).minute(), 59); /// ``` pub const fn minute(self) -> u8 { - self.0.minute() + self.time().minute() } /// Get the second within the minute. @@ -398,7 +404,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 23:59:59).second(), 59); /// ``` pub const fn second(self) -> u8 { - self.0.second() + self.time().second() } /// Get the milliseconds within the second. @@ -411,7 +417,7 @@ impl PrimitiveDateTime { /// assert_eq!(datetime!(2019-01-01 23:59:59.999).millisecond(), 999); /// ``` pub const fn millisecond(self) -> u16 { - self.0.millisecond() + self.time().millisecond() } /// Get the microseconds within the second. @@ -427,7 +433,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn microsecond(self) -> u32 { - self.0.microsecond() + self.time().microsecond() } /// Get the nanoseconds within the second. @@ -443,7 +449,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn nanosecond(self) -> u32 { - self.0.nanosecond() + self.time().nanosecond() } // endregion time getters @@ -467,7 +473,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn assume_offset(self, offset: UtcOffset) -> OffsetDateTime { - OffsetDateTime(self.0.assume_offset(offset)) + OffsetDateTime::new_in_offset(self.date, self.time, offset) } /// Assuming that the existing `PrimitiveDateTime` represents a moment in UTC, return an @@ -481,7 +487,7 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn assume_utc(self) -> OffsetDateTime { - OffsetDateTime(self.0.assume_utc()) + self.assume_offset(UtcOffset::UTC) } // endregion attach offset @@ -503,7 +509,17 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn checked_add(self, duration: Duration) -> Option { - Some(Self(const_try_opt!(self.0.checked_add(duration)))) + let (date_adjustment, time) = self.time.adjusting_add(duration); + let date = const_try_opt!(self.date.checked_add(duration)); + + Some(Self { + date: match date_adjustment { + util::DateAdjustment::Previous => const_try_opt!(date.previous_day()), + util::DateAdjustment::Next => const_try_opt!(date.next_day()), + util::DateAdjustment::None => date, + }, + time, + }) } /// Computes `self - duration`, returning `None` if an overflow occurred. @@ -523,7 +539,17 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn checked_sub(self, duration: Duration) -> Option { - Some(Self(const_try_opt!(self.0.checked_sub(duration)))) + let (date_adjustment, time) = self.time.adjusting_sub(duration); + let date = const_try_opt!(self.date.checked_sub(duration)); + + Some(Self { + date: match date_adjustment { + util::DateAdjustment::Previous => const_try_opt!(date.previous_day()), + util::DateAdjustment::Next => const_try_opt!(date.next_day()), + util::DateAdjustment::None => date, + }, + time, + }) } // endregion: checked arithmetic @@ -549,7 +575,13 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn saturating_add(self, duration: Duration) -> Self { - Self(self.0.saturating_add(duration)) + if let Some(datetime) = self.checked_add(duration) { + datetime + } else if duration.is_negative() { + Self::MIN + } else { + Self::MAX + } } /// Computes `self - duration`, saturating value on overflow. @@ -573,7 +605,13 @@ impl PrimitiveDateTime { /// ); /// ``` pub const fn saturating_sub(self, duration: Duration) -> Self { - Self(self.0.saturating_sub(duration)) + if let Some(datetime) = self.checked_sub(duration) { + datetime + } else if duration.is_negative() { + Self::MAX + } else { + Self::MIN + } } // endregion: saturating arithmetic } @@ -592,7 +630,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_time(self, time: Time) -> Self { - Self(self.0.replace_time(time)) + Self { + date: self.date, + time, + } } /// Replace the date, preserving the time. @@ -606,7 +647,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_date(self, date: Date) -> Self { - Self(self.0.replace_date(date)) + Self { + date, + time: self.time, + } } /// Replace the year. The month and day will be unchanged. @@ -622,7 +666,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_year(self, year: i32) -> Result { - Ok(Self(const_try!(self.0.replace_year(year)))) + Ok(Self { + date: const_try!(self.date.replace_year(year)), + time: self.time, + }) } /// Replace the month of the year. @@ -638,7 +685,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_month(self, month: Month) -> Result { - Ok(Self(const_try!(self.0.replace_month(month)))) + Ok(Self { + date: const_try!(self.date.replace_month(month)), + time: self.time, + }) } /// Replace the day of the month. @@ -654,7 +704,26 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_day(self, day: u8) -> Result { - Ok(Self(const_try!(self.0.replace_day(day)))) + Ok(Self { + date: const_try!(self.date.replace_day(day)), + time: self.time, + }) + } + + /// Replace the day of the year. + /// + /// ```rust + /// # use time_macros::datetime; + /// assert_eq!(datetime!(2022-049 12:00).replace_ordinal(1), Ok(datetime!(2022-001 12:00))); + /// assert!(datetime!(2022-049 12:00).replace_ordinal(0).is_err()); // 0 isn't a valid ordinal + /// assert!(datetime!(2022-049 12:00).replace_ordinal(366).is_err()); // 2022 isn't a leap year + /// ```` + #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] + pub const fn replace_ordinal(self, ordinal: u16) -> Result { + Ok(Self { + date: const_try!(self.date.replace_ordinal(ordinal)), + time: self.time, + }) } /// Replace the clock hour. @@ -669,7 +738,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_hour(self, hour: u8) -> Result { - Ok(Self(const_try!(self.0.replace_hour(hour)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_hour(hour)), + }) } /// Replace the minutes within the hour. @@ -684,7 +756,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_minute(self, minute: u8) -> Result { - Ok(Self(const_try!(self.0.replace_minute(minute)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_minute(minute)), + }) } /// Replace the seconds within the minute. @@ -699,7 +774,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_second(self, second: u8) -> Result { - Ok(Self(const_try!(self.0.replace_second(second)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_second(second)), + }) } /// Replace the milliseconds within the second. @@ -717,7 +795,10 @@ impl PrimitiveDateTime { self, millisecond: u16, ) -> Result { - Ok(Self(const_try!(self.0.replace_millisecond(millisecond)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_millisecond(millisecond)), + }) } /// Replace the microseconds within the second. @@ -735,7 +816,10 @@ impl PrimitiveDateTime { self, microsecond: u32, ) -> Result { - Ok(Self(const_try!(self.0.replace_microsecond(microsecond)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_microsecond(microsecond)), + }) } /// Replace the nanoseconds within the second. @@ -750,7 +834,10 @@ impl PrimitiveDateTime { /// ``` #[must_use = "This method does not mutate the original `PrimitiveDateTime`."] pub const fn replace_nanosecond(self, nanosecond: u32) -> Result { - Ok(Self(const_try!(self.0.replace_nanosecond(nanosecond)))) + Ok(Self { + date: self.date, + time: const_try!(self.time.replace_nanosecond(nanosecond)), + }) } } // endregion replacement @@ -765,7 +852,7 @@ impl PrimitiveDateTime { output: &mut impl io::Write, format: &(impl Formattable + ?Sized), ) -> Result { - self.0.format_into(output, format) + format.format_into(output, Some(self.date), Some(self.time), None) } /// Format the `PrimitiveDateTime` using the provided [format @@ -782,7 +869,7 @@ impl PrimitiveDateTime { /// # Ok::<_, time::Error>(()) /// ``` pub fn format(self, format: &(impl Formattable + ?Sized)) -> Result { - self.0.format(format) + format.format(Some(self.date), Some(self.time), None) } } @@ -805,15 +892,16 @@ impl PrimitiveDateTime { input: &str, description: &(impl Parsable + ?Sized), ) -> Result { - Inner::parse(input, description).map(Self) + description.parse_primitive_date_time(input.as_bytes()) } } impl SmartDisplay for PrimitiveDateTime { - type Metadata = DateTimeMetadata; + type Metadata = (); - fn metadata(&self, f: FormatterOptions) -> Metadata { - self.0.metadata(f).reuse() + fn metadata(&self, _: FormatterOptions) -> Metadata { + let width = smart_display::padded_width_of!(self.date, " ", self.time); + Metadata::new(width, self, ()) } fn fmt_with_metadata( @@ -821,7 +909,10 @@ impl SmartDisplay for PrimitiveDateTime { f: &mut fmt::Formatter<'_>, metadata: Metadata, ) -> fmt::Result { - self.0.fmt_with_metadata(f, metadata.reuse()) + f.pad_with_width( + metadata.unpadded_width(), + format_args!("{} {}", self.date, self.time), + ) } } @@ -842,64 +933,115 @@ impl fmt::Debug for PrimitiveDateTime { impl Add for PrimitiveDateTime { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, duration: Duration) -> Self::Output { - Self(self.0.add(duration)) + self.checked_add(duration) + .expect("resulting value is out of range") } } impl Add for PrimitiveDateTime { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn add(self, duration: StdDuration) -> Self::Output { - Self(self.0.add(duration)) + let (is_next_day, time) = self.time.adjusting_add_std(duration); + + Self { + date: if is_next_day { + (self.date + duration) + .next_day() + .expect("resulting value is out of range") + } else { + self.date + duration + }, + time, + } } } impl AddAssign for PrimitiveDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn add_assign(&mut self, duration: Duration) { - self.0.add_assign(duration); + *self = *self + duration; } } impl AddAssign for PrimitiveDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn add_assign(&mut self, duration: StdDuration) { - self.0.add_assign(duration); + *self = *self + duration; } } impl Sub for PrimitiveDateTime { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, duration: Duration) -> Self::Output { - Self(self.0.sub(duration)) + self.checked_sub(duration) + .expect("resulting value is out of range") } } impl Sub for PrimitiveDateTime { type Output = Self; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, duration: StdDuration) -> Self::Output { - Self(self.0.sub(duration)) + let (is_previous_day, time) = self.time.adjusting_sub_std(duration); + + Self { + date: if is_previous_day { + (self.date - duration) + .previous_day() + .expect("resulting value is out of range") + } else { + self.date - duration + }, + time, + } } } impl SubAssign for PrimitiveDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub_assign(&mut self, duration: Duration) { - self.0.sub_assign(duration); + *self = *self - duration; } } impl SubAssign for PrimitiveDateTime { + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub_assign(&mut self, duration: StdDuration) { - self.0.sub_assign(duration); + *self = *self - duration; } } impl Sub for PrimitiveDateTime { type Output = Duration; + /// # Panics + /// + /// This may panic if an overflow occurs. fn sub(self, rhs: Self) -> Self::Output { - self.0.sub(rhs.0) + (self.date - rhs.date) + (self.time - rhs.time) } } // endregion trait impls diff --git a/vendor/time/src/quickcheck.rs b/vendor/time/src/quickcheck.rs index 02cc62282..312a09e19 100644 --- a/vendor/time/src/quickcheck.rs +++ b/vendor/time/src/quickcheck.rs @@ -38,7 +38,6 @@ use alloc::boxed::Box; use quickcheck::{empty_shrinker, single_shrinker, Arbitrary, Gen}; -use crate::date_time::{DateTime, MaybeOffset}; use crate::{Date, Duration, Month, OffsetDateTime, PrimitiveDateTime, Time, UtcOffset, Weekday}; /// Obtain an arbitrary value between the minimum and maximum inclusive. @@ -116,11 +115,15 @@ impl Arbitrary for Time { impl Arbitrary for PrimitiveDateTime { fn arbitrary(g: &mut Gen) -> Self { - Self(<_>::arbitrary(g)) + Self::new(<_>::arbitrary(g), <_>::arbitrary(g)) } fn shrink(&self) -> Box> { - Box::new(self.0.shrink().map(Self)) + Box::new( + (self.date(), self.time()) + .shrink() + .map(|(date, time)| Self::new(date, time)), + ) } } @@ -140,28 +143,14 @@ impl Arbitrary for UtcOffset { impl Arbitrary for OffsetDateTime { fn arbitrary(g: &mut Gen) -> Self { - Self(<_>::arbitrary(g)) - } - - fn shrink(&self) -> Box> { - Box::new(self.0.shrink().map(Self)) - } -} - -impl Arbitrary for DateTime { - fn arbitrary(g: &mut Gen) -> Self { - Self { - date: <_>::arbitrary(g), - time: <_>::arbitrary(g), - offset: <_>::arbitrary(g), - } + Self::new_in_offset(<_>::arbitrary(g), <_>::arbitrary(g), <_>::arbitrary(g)) } fn shrink(&self) -> Box> { Box::new( - (self.date, self.time, self.offset) + (self.date(), self.time(), self.offset()) .shrink() - .map(|(date, time, offset)| Self { date, time, offset }), + .map(|(date, time, offset)| Self::new_in_offset(date, time, offset)), ) } } diff --git a/vendor/time/src/serde/mod.rs b/vendor/time/src/serde/mod.rs index f94cf0445..baffb4e50 100644 --- a/vendor/time/src/serde/mod.rs +++ b/vendor/time/src/serde/mod.rs @@ -483,7 +483,7 @@ impl Serialize for Month { return self.to_string().serialize(serializer); } - (*self as u8).serialize(serializer) + u8::from(*self).serialize(serializer) } } diff --git a/vendor/time/src/serde/timestamp/microseconds.rs b/vendor/time/src/serde/timestamp/microseconds.rs new file mode 100644 index 000000000..65c603ec3 --- /dev/null +++ b/vendor/time/src/serde/timestamp/microseconds.rs @@ -0,0 +1,63 @@ +//! Treat an [`OffsetDateTime`] as a [Unix timestamp] with microseconds for +//! the purposes of serde. +//! +//! Use this module in combination with serde's [`#[with]`][with] attribute. +//! +//! When deserializing, the offset is assumed to be UTC. +//! +//! [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +//! [with]: https://serde.rs/field-attrs.html#with + +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; + +use crate::OffsetDateTime; + +/// Serialize an `OffsetDateTime` as its Unix timestamp with microseconds +pub fn serialize( + datetime: &OffsetDateTime, + serializer: S, +) -> Result { + let timestamp = datetime.unix_timestamp_nanos() / 1_000; + timestamp.serialize(serializer) +} + +/// Deserialize an `OffsetDateTime` from its Unix timestamp with microseconds +pub fn deserialize<'a, D: Deserializer<'a>>(deserializer: D) -> Result { + let value: i128 = <_>::deserialize(deserializer)?; + OffsetDateTime::from_unix_timestamp_nanos(value * 1_000) + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) +} + +/// Treat an `Option` as a [Unix timestamp] with microseconds +/// for the purposes of serde. +/// +/// Use this module in combination with serde's [`#[with]`][with] attribute. +/// +/// When deserializing, the offset is assumed to be UTC. +/// +/// [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +/// [with]: https://serde.rs/field-attrs.html#with +pub mod option { + #[allow(clippy::wildcard_imports)] + use super::*; + + /// Serialize an `Option` as its Unix timestamp with microseconds + pub fn serialize( + option: &Option, + serializer: S, + ) -> Result { + option + .map(|timestamp| timestamp.unix_timestamp_nanos() / 1_000) + .serialize(serializer) + } + + /// Deserialize an `Option` from its Unix timestamp with microseconds + pub fn deserialize<'a, D: Deserializer<'a>>( + deserializer: D, + ) -> Result, D::Error> { + Option::deserialize(deserializer)? + .map(|value: i128| OffsetDateTime::from_unix_timestamp_nanos(value * 1_000)) + .transpose() + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) + } +} diff --git a/vendor/time/src/serde/timestamp/milliseconds.rs b/vendor/time/src/serde/timestamp/milliseconds.rs new file mode 100644 index 000000000..e571b6c9e --- /dev/null +++ b/vendor/time/src/serde/timestamp/milliseconds.rs @@ -0,0 +1,63 @@ +//! Treat an [`OffsetDateTime`] as a [Unix timestamp] with milliseconds for +//! the purposes of serde. +//! +//! Use this module in combination with serde's [`#[with]`][with] attribute. +//! +//! When deserializing, the offset is assumed to be UTC. +//! +//! [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +//! [with]: https://serde.rs/field-attrs.html#with + +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; + +use crate::OffsetDateTime; + +/// Serialize an `OffsetDateTime` as its Unix timestamp with milliseconds +pub fn serialize( + datetime: &OffsetDateTime, + serializer: S, +) -> Result { + let timestamp = datetime.unix_timestamp_nanos() / 1_000_000; + timestamp.serialize(serializer) +} + +/// Deserialize an `OffsetDateTime` from its Unix timestamp with milliseconds +pub fn deserialize<'a, D: Deserializer<'a>>(deserializer: D) -> Result { + let value: i128 = <_>::deserialize(deserializer)?; + OffsetDateTime::from_unix_timestamp_nanos(value * 1_000_000) + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) +} + +/// Treat an `Option` as a [Unix timestamp] with milliseconds +/// for the purposes of serde. +/// +/// Use this module in combination with serde's [`#[with]`][with] attribute. +/// +/// When deserializing, the offset is assumed to be UTC. +/// +/// [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +/// [with]: https://serde.rs/field-attrs.html#with +pub mod option { + #[allow(clippy::wildcard_imports)] + use super::*; + + /// Serialize an `Option` as its Unix timestamp with milliseconds + pub fn serialize( + option: &Option, + serializer: S, + ) -> Result { + option + .map(|timestamp| timestamp.unix_timestamp_nanos() / 1_000_000) + .serialize(serializer) + } + + /// Deserialize an `Option` from its Unix timestamp with milliseconds + pub fn deserialize<'a, D: Deserializer<'a>>( + deserializer: D, + ) -> Result, D::Error> { + Option::deserialize(deserializer)? + .map(|value: i128| OffsetDateTime::from_unix_timestamp_nanos(value * 1_000_000)) + .transpose() + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) + } +} diff --git a/vendor/time/src/serde/timestamp.rs b/vendor/time/src/serde/timestamp/mod.rs similarity index 97% rename from vendor/time/src/serde/timestamp.rs rename to vendor/time/src/serde/timestamp/mod.rs index d86e6b933..6dd0db03c 100644 --- a/vendor/time/src/serde/timestamp.rs +++ b/vendor/time/src/serde/timestamp/mod.rs @@ -7,6 +7,10 @@ //! [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time //! [with]: https://serde.rs/field-attrs.html#with +pub mod microseconds; +pub mod milliseconds; +pub mod nanoseconds; + use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use crate::OffsetDateTime; diff --git a/vendor/time/src/serde/timestamp/nanoseconds.rs b/vendor/time/src/serde/timestamp/nanoseconds.rs new file mode 100644 index 000000000..c71d1e7cd --- /dev/null +++ b/vendor/time/src/serde/timestamp/nanoseconds.rs @@ -0,0 +1,61 @@ +//! Treat an [`OffsetDateTime`] as a [Unix timestamp] with nanoseconds for +//! the purposes of serde. +//! +//! Use this module in combination with serde's [`#[with]`][with] attribute. +//! +//! When deserializing, the offset is assumed to be UTC. +//! +//! [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +//! [with]: https://serde.rs/field-attrs.html#with + +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; + +use crate::OffsetDateTime; + +/// Serialize an `OffsetDateTime` as its Unix timestamp with nanoseconds +pub fn serialize( + datetime: &OffsetDateTime, + serializer: S, +) -> Result { + datetime.unix_timestamp_nanos().serialize(serializer) +} + +/// Deserialize an `OffsetDateTime` from its Unix timestamp with nanoseconds +pub fn deserialize<'a, D: Deserializer<'a>>(deserializer: D) -> Result { + OffsetDateTime::from_unix_timestamp_nanos(<_>::deserialize(deserializer)?) + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) +} + +/// Treat an `Option` as a [Unix timestamp] with nanoseconds +/// for the purposes of serde. +/// +/// Use this module in combination with serde's [`#[with]`][with] attribute. +/// +/// When deserializing, the offset is assumed to be UTC. +/// +/// [Unix timestamp]: https://en.wikipedia.org/wiki/Unix_time +/// [with]: https://serde.rs/field-attrs.html#with +pub mod option { + #[allow(clippy::wildcard_imports)] + use super::*; + + /// Serialize an `Option` as its Unix timestamp with nanoseconds + pub fn serialize( + option: &Option, + serializer: S, + ) -> Result { + option + .map(OffsetDateTime::unix_timestamp_nanos) + .serialize(serializer) + } + + /// Deserialize an `Option` from its Unix timestamp with nanoseconds + pub fn deserialize<'a, D: Deserializer<'a>>( + deserializer: D, + ) -> Result, D::Error> { + Option::deserialize(deserializer)? + .map(OffsetDateTime::from_unix_timestamp_nanos) + .transpose() + .map_err(|err| de::Error::invalid_value(de::Unexpected::Signed(err.value), &err)) + } +} diff --git a/vendor/time/src/sys/local_offset_at/wasm_js.rs b/vendor/time/src/sys/local_offset_at/wasm_js.rs index a0b59ac86..3fb02e2f4 100644 --- a/vendor/time/src/sys/local_offset_at/wasm_js.rs +++ b/vendor/time/src/sys/local_offset_at/wasm_js.rs @@ -7,7 +7,8 @@ pub(super) fn local_offset_at(datetime: OffsetDateTime) -> Option { // The number of minutes returned by getTimezoneOffset() is positive if the local time zone // is behind UTC, and negative if the local time zone is ahead of UTC. For example, // for UTC+10, -600 will be returned. - let timezone_offset = (js_date.get_timezone_offset() as i32) * -(Minute::per(Hour) as i32); + let timezone_offset = + (js_date.get_timezone_offset() as i32) * -Minute::per(Hour).cast_signed().extend::(); UtcOffset::from_whole_seconds(timezone_offset).ok() } diff --git a/vendor/time/src/sys/local_offset_at/windows.rs b/vendor/time/src/sys/local_offset_at/windows.rs index 7fb41e02a..f37551af7 100644 --- a/vendor/time/src/sys/local_offset_at/windows.rs +++ b/vendor/time/src/sys/local_offset_at/windows.rs @@ -2,6 +2,8 @@ use core::mem::MaybeUninit; +use num_conv::prelude::*; + use crate::convert::*; use crate::{OffsetDateTime, UtcOffset}; @@ -58,20 +60,22 @@ fn systemtime_to_filetime(systime: &SystemTime) -> Option { fn filetime_to_secs(filetime: &FileTime) -> i64 { /// FILETIME represents 100-nanosecond intervals const FT_TO_SECS: i64 = Nanosecond::per(Second) as i64 / 100; - ((filetime.dwHighDateTime as i64) << 32 | filetime.dwLowDateTime as i64) / FT_TO_SECS + (filetime.dwHighDateTime.cast_signed().extend::() << 32 + | filetime.dwLowDateTime.cast_signed().extend::()) + / FT_TO_SECS } /// Convert an [`OffsetDateTime`] to a `SYSTEMTIME`. fn offset_to_systemtime(datetime: OffsetDateTime) -> SystemTime { let (_, month, day_of_month) = datetime.to_offset(UtcOffset::UTC).date().to_calendar_date(); SystemTime { - wYear: datetime.year() as _, - wMonth: month as _, - wDay: day_of_month as _, + wYear: datetime.year().cast_unsigned().truncate(), + wMonth: u8::from(month).extend(), + wDay: day_of_month.extend(), wDayOfWeek: 0, // ignored - wHour: datetime.hour() as _, - wMinute: datetime.minute() as _, - wSecond: datetime.second() as _, + wHour: datetime.hour().extend(), + wMinute: datetime.minute().extend(), + wSecond: datetime.second().extend(), wMilliseconds: datetime.millisecond(), } } diff --git a/vendor/time/src/time.rs b/vendor/time/src/time.rs index 90abc01fc..6b6e3186f 100644 --- a/vendor/time/src/time.rs +++ b/vendor/time/src/time.rs @@ -7,6 +7,7 @@ use core::time::Duration as StdDuration; use std::io; use deranged::{RangedU32, RangedU8}; +use num_conv::prelude::*; use powerfmt::ext::FormatterExt; use powerfmt::smart_display::{self, FormatterOptions, Metadata, SmartDisplay}; @@ -800,7 +801,7 @@ impl SmartDisplay for Time { formatted_width, self, TimeMetadata { - subsecond_width: subsecond_width as _, + subsecond_width: subsecond_width.truncate(), subsecond_value, }, ) @@ -811,7 +812,7 @@ impl SmartDisplay for Time { f: &mut fmt::Formatter<'_>, metadata: Metadata, ) -> fmt::Result { - let subsecond_width = metadata.subsecond_width as usize; + let subsecond_width = metadata.subsecond_width.extend(); let subsecond_value = metadata.subsecond_value; f.pad_with_width( @@ -921,24 +922,25 @@ impl Sub for Time { /// assert_eq!(time!(0:00) - time!(23:00), (-23).hours()); /// ``` fn sub(self, rhs: Self) -> Self::Output { - let hour_diff = (self.hour.get() as i8) - (rhs.hour.get() as i8); - let minute_diff = (self.minute.get() as i8) - (rhs.minute.get() as i8); - let second_diff = (self.second.get() as i8) - (rhs.second.get() as i8); - let nanosecond_diff = (self.nanosecond.get() as i32) - (rhs.nanosecond.get() as i32); + let hour_diff = self.hour.get().cast_signed() - rhs.hour.get().cast_signed(); + let minute_diff = self.minute.get().cast_signed() - rhs.minute.get().cast_signed(); + let second_diff = self.second.get().cast_signed() - rhs.second.get().cast_signed(); + let nanosecond_diff = + self.nanosecond.get().cast_signed() - rhs.nanosecond.get().cast_signed(); - let seconds = hour_diff as i64 * Second::per(Hour) as i64 - + minute_diff as i64 * Second::per(Minute) as i64 - + second_diff as i64; + let seconds = hour_diff.extend::() * Second::per(Hour).cast_signed().extend::() + + minute_diff.extend::() * Second::per(Minute).cast_signed().extend::() + + second_diff.extend::(); let (seconds, nanoseconds) = if seconds > 0 && nanosecond_diff < 0 { ( seconds - 1, - nanosecond_diff + Nanosecond::per(Second) as i32, + nanosecond_diff + Nanosecond::per(Second).cast_signed(), ) } else if seconds < 0 && nanosecond_diff > 0 { ( seconds + 1, - nanosecond_diff - Nanosecond::per(Second) as i32, + nanosecond_diff - Nanosecond::per(Second).cast_signed(), ) } else { (seconds, nanosecond_diff) diff --git a/vendor/time/src/utc_offset.rs b/vendor/time/src/utc_offset.rs index f4e6eaa2b..b43ca78f6 100644 --- a/vendor/time/src/utc_offset.rs +++ b/vendor/time/src/utc_offset.rs @@ -22,15 +22,28 @@ use crate::sys::local_offset_at; use crate::OffsetDateTime; /// The type of the `hours` field of `UtcOffset`. -type Hours = RangedI8<{ -(Hour::per(Day) as i8 - 1) }, { Hour::per(Day) as i8 - 1 }>; +type Hours = RangedI8<-25, 25>; /// The type of the `minutes` field of `UtcOffset`. type Minutes = RangedI8<{ -(Minute::per(Hour) as i8 - 1) }, { Minute::per(Hour) as i8 - 1 }>; /// The type of the `seconds` field of `UtcOffset`. type Seconds = RangedI8<{ -(Second::per(Minute) as i8 - 1) }, { Second::per(Minute) as i8 - 1 }>; +/// The type capable of storing the range of whole seconds that a `UtcOffset` can encompass. +type WholeSeconds = RangedI32< + { + Hours::MIN.get() as i32 * Second::per(Hour) as i32 + + Minutes::MIN.get() as i32 * Second::per(Minute) as i32 + + Seconds::MIN.get() as i32 + }, + { + Hours::MAX.get() as i32 * Second::per(Hour) as i32 + + Minutes::MAX.get() as i32 * Second::per(Minute) as i32 + + Seconds::MAX.get() as i32 + }, +>; /// An offset from UTC. /// -/// This struct can store values up to ±23:59:59. If you need support outside this range, please +/// This struct can store values up to ±25:59:59. If you need support outside this range, please /// file an issue with your use case. // All three components _must_ have the same sign. #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -51,9 +64,7 @@ impl UtcOffset { /// # use time_macros::offset; /// assert_eq!(UtcOffset::UTC, offset!(UTC)); /// ``` - #[allow(clippy::undocumented_unsafe_blocks)] // rust-lang/rust-clippy#11246 - // Safety: All values are in range. - pub const UTC: Self = unsafe { Self::__from_hms_unchecked(0, 0, 0) }; + pub const UTC: Self = Self::from_whole_seconds_ranged(WholeSeconds::new_static::<0>()); // region: constructors /// Create a `UtcOffset` representing an offset of the hours, minutes, and seconds provided, the @@ -62,7 +73,7 @@ impl UtcOffset { /// /// # Safety /// - /// - Hours must be in the range `-23..=23`. + /// - Hours must be in the range `-25..=25`. /// - Minutes must be in the range `-59..=59`. /// - Seconds must be in the range `-59..=59`. /// @@ -169,28 +180,31 @@ impl UtcOffset { /// # Ok::<_, time::Error>(()) /// ``` pub const fn from_whole_seconds(seconds: i32) -> Result { - type WholeSeconds = RangedI32< - { - Hours::MIN.get() as i32 * Second::per(Hour) as i32 - + Minutes::MIN.get() as i32 * Second::per(Minute) as i32 - + Seconds::MIN.get() as i32 - }, - { - Hours::MAX.get() as i32 * Second::per(Hour) as i32 - + Minutes::MAX.get() as i32 * Second::per(Minute) as i32 - + Seconds::MAX.get() as i32 - }, - >; - ensure_ranged!(WholeSeconds: seconds); + Ok(Self::from_whole_seconds_ranged( + ensure_ranged!(WholeSeconds: seconds), + )) + } - // Safety: The value was checked to be in range. - Ok(unsafe { + /// Create a `UtcOffset` representing an offset by the number of seconds provided. + // ignore because the function is crate-private + /// ```rust,ignore + /// # use time::UtcOffset; + /// # use deranged::RangedI32; + /// assert_eq!( + /// UtcOffset::from_whole_seconds_ranged(RangedI32::new_static::<3_723>()).as_hms(), + /// (1, 2, 3) + /// ); + /// # Ok::<_, time::Error>(()) + /// ``` + pub(crate) const fn from_whole_seconds_ranged(seconds: WholeSeconds) -> Self { + // Safety: The type of `seconds` guarantees that all values are in range. + unsafe { Self::__from_hms_unchecked( - (seconds / Second::per(Hour) as i32) as _, - ((seconds % Second::per(Hour) as i32) / Minute::per(Hour) as i32) as _, - (seconds % Second::per(Minute) as i32) as _, + (seconds.get() / Second::per(Hour) as i32) as _, + ((seconds.get() % Second::per(Hour) as i32) / Minute::per(Hour) as i32) as _, + (seconds.get() % Second::per(Minute) as i32) as _, ) - }) + } } // endregion constructors diff --git a/vendor/tokio-openssl/.cargo-checksum.json b/vendor/tokio-openssl/.cargo-checksum.json index c30117f35..59956113e 100644 --- a/vendor/tokio-openssl/.cargo-checksum.json +++ b/vendor/tokio-openssl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"7b35e3a70dd895396d1288c83407d5e8beafde9d89f7f058c0bf7cf3d2a7511e","LICENSE-APACHE":"fa8d251b0b25b4f8f16f4136e37ad7e87b5f7bdf20c8552660bca63faf667c01","LICENSE-MIT":"16aa2017defc4c4de48a8493a3b885b9ed12b2c7f78872c9470e9cf48f062026","README.md":"0c3b23fb4b96fc140d40374876f2b46309ee3a9d81bf242426bb6dd674d25493","build.rs":"dca00fb9f1515324cf1c8e6c5f586e9055b268548a503ab0da7ad08e3a76ef4d","src/lib.rs":"643906c9168e8d9fd36f076c652cb98d30def9fef035db453a7c9cb5df9df02a","src/test.rs":"8c948de990ca015b7e60cf508876c1dbe73cde4b89a52e5b1a43b1cc714b554b","tests/cert.pem":"f7040bb94526c75fe3983cab6e2c80051a615022e4bda47ec809c4b70707b60a","tests/key.pem":"6c0c20d31fe3aea273d43b299d546dcc0f0100dfacfa259ef3e03e8edaa4a22f"},"package":"c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a"} \ No newline at end of file +{"files":{"Cargo.toml":"6fcce3f90077683f63284e7f409c10f43b86415c33de1cb465041f54dd357f55","LICENSE-APACHE":"fa8d251b0b25b4f8f16f4136e37ad7e87b5f7bdf20c8552660bca63faf667c01","LICENSE-MIT":"16aa2017defc4c4de48a8493a3b885b9ed12b2c7f78872c9470e9cf48f062026","README.md":"e93c73c71c81b76d133147ab8428f8a138f5a269cad80f21353a096591f03344","build.rs":"c4cf217351b0ef37e6f221997a9cad3b8f1c0ead8977bf931c957e6ba17758e4","src/lib.rs":"7936e990d8caa4ad73274bc9ed9ee2253232817124638aaadfc063cf759d59b7","src/test.rs":"8c948de990ca015b7e60cf508876c1dbe73cde4b89a52e5b1a43b1cc714b554b","tests/cert.pem":"f7040bb94526c75fe3983cab6e2c80051a615022e4bda47ec809c4b70707b60a","tests/key.pem":"6c0c20d31fe3aea273d43b299d546dcc0f0100dfacfa259ef3e03e8edaa4a22f"},"package":"6ffab79df67727f6acf57f1ff743091873c24c579b1e2ce4d8f53e47ded4d63d"} \ No newline at end of file diff --git a/vendor/tokio-openssl/Cargo.toml b/vendor/tokio-openssl/Cargo.toml index a476adc09..3a27e9cfb 100644 --- a/vendor/tokio-openssl/Cargo.toml +++ b/vendor/tokio-openssl/Cargo.toml @@ -12,23 +12,28 @@ [package] edition = "2018" name = "tokio-openssl" -version = "0.6.3" +version = "0.6.4" authors = ["Alex Crichton "] -description = "An implementation of SSL streams for Tokio backed by OpenSSL\n" +description = """ +An implementation of SSL streams for Tokio backed by OpenSSL +""" +readme = "README.md" license = "MIT/Apache-2.0" -repository = "https://github.com/sfackler/tokio-openssl" +repository = "https://github.com/tokio-rs/tokio-openssl" + [dependencies.futures-util] version = "0.3" default-features = false [dependencies.openssl] -version = "0.10.32" +version = "0.10.61" [dependencies.openssl-sys] version = "0.9" [dependencies.tokio] version = "1.0" + [dev-dependencies.tokio] version = "1.0" features = ["full"] diff --git a/vendor/tokio-openssl/README.md b/vendor/tokio-openssl/README.md index b99ad8b01..93255d1f5 100644 --- a/vendor/tokio-openssl/README.md +++ b/vendor/tokio-openssl/README.md @@ -20,5 +20,5 @@ at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be -dual licensed as above, without any additional terms or conditions. +for inclusion in tokio-openssl by you, as defined in the Apache-2.0 license, +shall be dual licensed as above, without any additional terms or conditions. diff --git a/vendor/tokio-openssl/build.rs b/vendor/tokio-openssl/build.rs index d3def6db0..71e3670c7 100644 --- a/vendor/tokio-openssl/build.rs +++ b/vendor/tokio-openssl/build.rs @@ -1,3 +1,4 @@ +#![allow(clippy::unusual_byte_groupings)] use std::env; fn main() { diff --git a/vendor/tokio-openssl/src/lib.rs b/vendor/tokio-openssl/src/lib.rs index 267638e49..b4e201193 100644 --- a/vendor/tokio-openssl/src/lib.rs +++ b/vendor/tokio-openssl/src/lib.rs @@ -11,7 +11,6 @@ use openssl::ssl::{self, ErrorCode, ShutdownResult, Ssl, SslRef}; use std::fmt; use std::io::{self, Read, Write}; use std::pin::Pin; -use std::slice; use std::task::{Context, Poll}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; @@ -229,17 +228,11 @@ where buf: &mut ReadBuf<'_>, ) -> Poll> { self.with_context(ctx, |s| { - // This isn't really "proper", but rust-openssl doesn't currently expose a suitable interface even though - // OpenSSL itself doesn't require the buffer to be initialized. So this is good enough for now. - let slice = unsafe { - let buf = buf.unfilled_mut(); - slice::from_raw_parts_mut(buf.as_mut_ptr().cast::(), buf.len()) - }; - match cvt(s.read(slice))? { + // SAFETY: read_uninit does not de-initialize the buffer. + match cvt(s.read_uninit(unsafe { buf.unfilled_mut() }))? { Poll::Ready(nread) => { - unsafe { - buf.assume_init(nread); - } + // SAFETY: read_uninit guarantees that nread bytes have been initialized. + unsafe { buf.assume_init(nread) }; buf.advance(nread); Poll::Ready(Ok(())) } diff --git a/vendor/tokio/.cargo-checksum.json b/vendor/tokio/.cargo-checksum.json index ddec9a728..1ed9ff49b 100644 --- a/vendor/tokio/.cargo-checksum.json +++ b/vendor/tokio/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"8ee0db5cc8c2b6ba876236c494376d0371f3d92da28c2d465b07e2d385fa162b","Cargo.toml":"cf34d675b10b7eb3d776b0b738216b3c9cab3453ac2919c177b8652973593320","LICENSE":"1a594f153f129c2de7b15f3262394bdca3dcc2da40058e3ea435c8473eb1f3a0","README.md":"6785c4fd2d7c475f982ce1ee6211e7da4f8539f8e82afc9e9f83ab96f5285fa7","docs/reactor-refactor.md":"24d4f3ec6d8828bb96afe0084df9e7739bbdf1995283dbd2cd76740311485b75","external-types.toml":"d808de4bbff94d5ea56f1b1783497b0c6cd107534853aca8c79ee8404d8c2399","src/blocking.rs":"8e62b2cdc512fedbca4b4c4f983629af035afea4ee7e918bb1a3e9851c8e034e","src/doc/mod.rs":"1b16b82b57052817b74a71058770e6f4a78c854e5471c1fe669cf7f992d64dcd","src/doc/os.rs":"9de68b5ad2ba2783d76f7b92a572e238705ebeea0893a10f21c755ea884a58fa","src/fs/canonicalize.rs":"f79eccf4f2c78a92ca8ece154c0ad36a97562168257cc2f50d39e7de00e1a237","src/fs/copy.rs":"d19ff4baffa10bfd3ec722cf4c52bf15825802c4e6c0eb5c375dd37effc072a1","src/fs/create_dir.rs":"4fd26d27b97ded25bc9a0fb8456ed2550bdce8fee3958ec712db0af36ed42ae6","src/fs/create_dir_all.rs":"8d31882b086be3f70dc3095f0f7c46d8289ea8423be76bf9cb446955357ae67f","src/fs/dir_builder.rs":"5e726ee92b953d686d0504baec463ec844978df90d075dbb78d1ff2b65111932","src/fs/file.rs":"8b97da980de0feb82588de01bc350da462c7fd169c2cf645f28cce5df47fb079","src/fs/file/tests.rs":"014b0bd871a58d42d8b97cf2d860f83693294f935c808f1406f4b26e5d09afa2","src/fs/hard_link.rs":"aa54bea5685a1d49b22675e516891773706a27e95688cd2e70890bfd232f34c1","src/fs/metadata.rs":"1eb0f7b53f2afb53714dc2148da03c2dcb93a5d49611615d5ea5245584c9bf7b","src/fs/mocks.rs":"040c47fed2757d3c1913109d397d6443450826db1920f19c7147a0c96893559c","src/fs/mod.rs":"8743addab538366cbe90b43cb233c54e1be524c173b9e659fda4fe9fd78060b2","src/fs/open_options.rs":"e4ea393c4c9fb11503a7db3c7700b8352c83e376b514c61dd694ad969a01213f","src/fs/open_options/mock_open_options.rs":"60ebc4bea76d742ead8fc5b5f4079450eb2450ecfed5f83d7d89cfe148f4ca54","src/fs/read.rs":"df8b7f73766973f89989197a95d94025ae52d1f741da2a54a3ca1000dae6f2ab","src/fs/read_dir.rs":"0d15441ee8243cc43cd97889ef733de73cb161c07e04d418f56f415efe0187cb","src/fs/read_link.rs":"910a34ccae4604c3ea60044fc1a75fc6598e912ae008459e667398301440217e","src/fs/read_to_string.rs":"9e5b2d476a6084e32a92c5421a8abc9d4f335f4ec677beec4bf8bfa109d7d106","src/fs/remove_dir.rs":"314303525fb2a78bc2ebd51f5ebe725a8d59a8e646d2e594a1dcbcfb711b3a11","src/fs/remove_dir_all.rs":"b85abd05c7ab64ee8dc6cf5663a11e713aa51b357759ef660ef3cae3365ccc42","src/fs/remove_file.rs":"283d7ef67b53668810daed6aad23cc90466d359423f97ab01c1ae58c111feb12","src/fs/rename.rs":"0a9d11d546fcfa500018ec6dd188c9060aaa1daf1eccec63ab219d62764c5ae6","src/fs/set_permissions.rs":"8adccafa475dcfc1bc3989af73374d90683c1be4953ef812e5fd606f968d7b7a","src/fs/symlink.rs":"e9c5a3ef23c8c12800b8932a557cfd5a81ba9b2f3939fce8d2dd827ef207f7c2","src/fs/symlink_dir.rs":"66a6655f5306854a7b6ed3748598bbe737055da9635bded715a04c3abfacda7c","src/fs/symlink_file.rs":"ec5816344f8c0b79c4d84e0ef2a987d753c719afd3bbc0d0a739224477a9edd2","src/fs/symlink_metadata.rs":"f5ce1e05f137da995e3e0d9582bae0a5f7ef4251285c64e912b0eedbb068b395","src/fs/try_exists.rs":"c666196690c4d45991374b03b27f0838b33e98d0be2838638d4de4ff856894b7","src/fs/write.rs":"1ffb734d31748bd879ad398b0fe99bdec569782b42677022957db2cae95c4d2d","src/future/block_on.rs":"30bad79b005a1ba7f696bec5639a5886b1f653a152b8948ae5fcd287c05ab8db","src/future/maybe_done.rs":"d811a5eda6477fbbd156b2f8a7e2c22bdcf707983a25deabc4c1d5e85f649ea0","src/future/mod.rs":"980c251669bc73dd64a1f0df898c3081429c61d68ab7fcb2440ea251074f7011","src/future/poll_fn.rs":"b3c0eaeb442991d3fe27f53f2c2849f5f40b0f974035036c26661bcdaffa09df","src/future/trace.rs":"c42712a8d372922eba7e05cd21382fe5df5eec02cbcc870062100b59ab99654f","src/future/try_join.rs":"0ea5a069b17a34bbc091acbd74b9d51794a55a85dfa63fe2404d5ee91a4f0038","src/fuzz.rs":"db998767c729f35320b1d489f43f4d7788e989c8d16c0793188a2868207d8e25","src/io/async_buf_read.rs":"85abdad3d480c038a2da14127d0a6fa0d992256bf5cdc5503fa4854c081c2ca3","src/io/async_fd.rs":"b2264dc2d9c61c07211a7f1fcd4e10f372a1359643ba3fc133b5e0af6ed5d9a0","src/io/async_read.rs":"f52c8d2f4a283c0dc8d06dc974484749973125b0b691bc0c3d100972ac67cb92","src/io/async_seek.rs":"a9a0df389ff2be3d79208ec475fcfede46a86f6ea0b822b1a4ce8273ec714b0b","src/io/async_write.rs":"198ed6a475b6f093fd2ff15e618d816d7e33cb8bc28d2e2299533e5df0bd78d6","src/io/blocking.rs":"88c5bcd7c0775042e05df253aba119be6de47e539d819e646b093bf962ed0aa3","src/io/bsd/poll_aio.rs":"45e818a201c8dce93f612c7856ba4259724d2c9fcf341001eb9833f821f16f3f","src/io/interest.rs":"abfd389ed62f3c55fe540c22e21823c427502b9daf235bfe474e62f92f2dfe45","src/io/mod.rs":"d9b04c6badbd9317e6f02f182d7457de3429f70ca74306f6895de73828c37b2f","src/io/poll_evented.rs":"d3946956bf3795297e67fdfe783b4cc19e4a4310c23db2a8abbc12afa6123faa","src/io/read_buf.rs":"14f82f701d5056d1d5581c70aec98f7c6d287899df45e4b2e82388e7c97cca57","src/io/ready.rs":"85fc7a192552607acf6623e1f083b4e12447067bfa57fd667fb2c6e9fce7a4d8","src/io/seek.rs":"e9e346fc926c3360601b80a8319a25fd0567dd6f77fab666694e9787deaef633","src/io/split.rs":"5b1be9d1bfae72e483d02fc3b341ff13829c1fa67b9d7ec1481769aae91ed27c","src/io/stderr.rs":"6490414b47ea05a7dfd0001f864f9cd6dd236f70d8ae9acdac5d3590b2b04495","src/io/stdin.rs":"7c734283ca48e13db2bc4185c5f4ad811b497094598e3c0226a85f46ecbdd843","src/io/stdio_common.rs":"80bbca6dffc4367670e01fb8b1ae46fc0ecf775718ce2b09d261dde046e023a2","src/io/stdout.rs":"9121ce7c88e83659a1984dfce781e259d40fcd90b254f28dc03a452e7fe9cb92","src/io/util/async_buf_read_ext.rs":"1c3d29de3508ff659dcc44eedc8da80988458b2ff3622247e453ff6f3fad48f9","src/io/util/async_read_ext.rs":"5c2a884c8793bb727de725298de87048545ae69c56378d8d6e196f1726583fd5","src/io/util/async_seek_ext.rs":"0535ec6139be7ea68becafc0d374aaf9d996ce9cbe5dca0b8e70b133a661c1ea","src/io/util/async_write_ext.rs":"b5ae408708110d8f45af4cd54e0182a36b28c57fa7f97e89787ef1df85ea85d3","src/io/util/buf_reader.rs":"670a58f404e5689daf1f2b3070b0b9e95fef96ad19f0e8487f294e8a2afe558d","src/io/util/buf_stream.rs":"c2087f024e12c39355f301b67780e392ca4b227006eeea2e73a1a51ac9581e6f","src/io/util/buf_writer.rs":"0925e9b884c585ad99d2891e382305ae6460657be5e96daad6c354753b22c354","src/io/util/chain.rs":"5cd8df2cc7bbcd18ca2336a78507fa8009c0a9e595f81730a8c16cadb8f731a2","src/io/util/copy.rs":"391e733e7886b88fd62714cce692736bcfa37dbfa543ab23267f98e1a2a8740a","src/io/util/copy_bidirectional.rs":"89a5fb3f77e9863c9496c02afc2613fce039f47a1b2322e6221dccda8323f80f","src/io/util/copy_buf.rs":"9d83771a6edcc6d0d32f066072e375634e21a13517968ec9b21a4edddbcc2605","src/io/util/empty.rs":"32cbcfa8bc033e7ae1cd62505a84125750d1abccd0c37b2a433c5eb80db0f0f6","src/io/util/fill_buf.rs":"223725d828071e923f25d2d49a0f6e470c411a6d9ba225700f2dd8d5793601bb","src/io/util/flush.rs":"fe3b4ff226e294843b8cbea9dc4e02d581582b78ddaafce137c96e290699c718","src/io/util/lines.rs":"1d9f9b99567111c911e72a4caa2abb19b277f2cdd0ca3268ac5ca6df5276259f","src/io/util/mem.rs":"0b4aed07c02a2225b688a167e6645023eb028b86afeee4bd4eed71294c1fb32f","src/io/util/mod.rs":"6a9012d78fe2bed8240e7a628e9421cbef45433551522624065fdcbb329f3594","src/io/util/read.rs":"58988c3fbcf5ede633dc224d7df5a372495c4485757dec9bdbd825138bb7f5d4","src/io/util/read_buf.rs":"a87be2d115c09a6782ec8cadeafc92fb1fbe534580e71540087c3298a03bfca2","src/io/util/read_exact.rs":"4a8650fd7a885963a0fef2bec24c17046c5624e4dd7fe229ab3f33c4a92fc66c","src/io/util/read_int.rs":"49da230796335df584832cd7deb8370b4d1e0350d743046389a9d9ae17dbd94f","src/io/util/read_line.rs":"9cdb2d778b81bc50098a6851981ed9f541bd0c7896c0763b811971b5a598b7e8","src/io/util/read_to_end.rs":"3e28b65b04cf6d3da12c496a938ec498722af3be4952fa8b603230dfa90ed0c7","src/io/util/read_to_string.rs":"fafb5463b013cc8f76def3a505dbebd179afc95bde0e2ca9388e428265788924","src/io/util/read_until.rs":"d9a932dfb5ef3d0d5e8faa72a2b3b9d1765c85599f3bc77741f69e7fe9c0d037","src/io/util/repeat.rs":"d4effcd81338831eb373cf2db972a99218b8379b91066940a732edcf4524c7c2","src/io/util/shutdown.rs":"971454342b4636fbd68e123d59d87017d81f72afb410c385846069b11def8efe","src/io/util/sink.rs":"0dcb794e48ca9b1c28e5f9f2051073ea0951a54c9c7dfc903ce9e5489d3d8cd7","src/io/util/split.rs":"03a59adccda29608886e38a1f484fbd4d6a6019180c4cfa851372d250796aa5a","src/io/util/take.rs":"b8d992c7eba17da642bdbc36dc124c6167e33720165b08867b7503ff15c281e3","src/io/util/vec_with_initialized.rs":"f8673705967021b5a3cb819d672df89ec81eb5baabb48de7bb598d53352b62f8","src/io/util/write.rs":"20d14ee545ab1f67732915522e97808d1ddde13d151505c1289b596be519f7c8","src/io/util/write_all.rs":"906ff3fb24c6a979b104598f9a8229421bcaf2a4218c28069504b34a218241f6","src/io/util/write_all_buf.rs":"5911bf673ef89097938f4e2e38d9012865b28a0ce5ebb217ebe0e2507de6c1e3","src/io/util/write_buf.rs":"ab51d6174de24cbb729ce77dbaeea27e16059b8253e4830d8243ec5f08a08a8c","src/io/util/write_int.rs":"f321e69b0c7c01728b079e9fdeedb96c26475667e8b259d0c5f4a83d060990d1","src/io/util/write_vectored.rs":"7a335a9f796daa048fa9708dc44d32d2567b36461a6d88f07893eb31f304b69d","src/lib.rs":"28bbf0952b3de36f4e205c2fd1b687a5b9ddcbc08a7616fec18802a81fd1b698","src/loom/mocked.rs":"5b85e97fcee3be1b0443b5608c7fe909b040bac463c94b817ed6b42bfd8031c3","src/loom/mod.rs":"b14b9333a7a21bd125a4ae82f01e5ea9c9ed2f78d7d1ad49a13d9b176f1fe8ab","src/loom/std/atomic_u16.rs":"5aba33a798e8a95129e3fd039e4412322e25880003ba782031df9faac3dc93e1","src/loom/std/atomic_u32.rs":"7fbaa448621371cbb9b8dd882701236b41bed599d69eeeb0a1e25b2a9a4645ad","src/loom/std/atomic_u64.rs":"2d98d1608058f3248d79b1e9c96118627fef6362ccfefa77047be2e5617d7571","src/loom/std/atomic_u64_as_mutex.rs":"1a6b9f8417e968a78dcddd8c7c320c447b9f27d5f84245cae86c3ef68425c749","src/loom/std/atomic_u64_native.rs":"559e6fd21e678b904f5a905f2756a4a8e32ca68a8c7a9b4344af86979373cfa0","src/loom/std/atomic_u64_static_const_new.rs":"a1c0e7d2ea28904ae76227baa7da5da33b68257f4c1a7a456f8d3171529bd934","src/loom/std/atomic_u64_static_once_cell.rs":"92a25654dd8232f6c02c8ec58d4f706030db442fb2a5ba07f1aec09149559725","src/loom/std/atomic_usize.rs":"698c0a65ea4d1ad05d49770cef2614cee643794be4b6208ee071a3e381201349","src/loom/std/barrier.rs":"1539e5773ad0ab1936e8a9a6cf5c20bc697915abde15b3e0898615194eb37fb0","src/loom/std/mod.rs":"22da677018c512c613226a991115c35cef6b02da6ce43fb9ce0530f3eacf2117","src/loom/std/mutex.rs":"ce413b7819207a93d93984811476b4902e39ad172e8dd87fc3376c2398c7044e","src/loom/std/parking_lot.rs":"16b82f1580b4cf5949a9cb9ebfa2c11d98d91f97b2b2f7b6f90a213dd736985b","src/loom/std/unsafe_cell.rs":"789497164c351a563293d82edb82180576471b92ee3aec77de1a92a47423e390","src/macros/addr_of.rs":"cbd020a07ffba2b1c608856081499645cf606cb45444dc53d94457381a94bc33","src/macros/cfg.rs":"377b9afe24981c9b1f461d95619bd5ccb2560544c43515648d99576655cee078","src/macros/join.rs":"076dbeed1cbbb292e39012d18c0d1c97848bce48c4609b23f327025989b34a8e","src/macros/loom.rs":"bee8a86b0b96697cc21e4b5e9f1a3403c1f9dbc8c4e591a2ea91f51c2469d3d0","src/macros/mod.rs":"913b1382779ceedbd13606e429f59b9c7ad929324f121452f47773c232c3303f","src/macros/pin.rs":"294e5644061e41801dcee5494b7334439e09af0b6219ce164090feb624864631","src/macros/ready.rs":"6efd4c866c4718c3a9a7b5564b435e2d13e9c1ae91fd98b1313d5e7c182942d6","src/macros/select.rs":"4d9588dd514cf9f25b8c3c76ab08ad141d8f7ed1acdd856c6418946edd08f055","src/macros/support.rs":"da976befe4ba4d29e96f0de24cafe6e1f7f97364274e240556a01f2af77314de","src/macros/thread_local.rs":"c03b4bd975825f89feb0a138aaa5e3413ee8dbd6959a3d25ebdef8780126464c","src/macros/trace.rs":"33befd4533a3b2b4b22e246033f2bea8930174a7da58adaa57dbf20931275bcd","src/macros/try_join.rs":"2233cb76a6ce35d020ebbb8a0b0d713f01c0b6fd20fd878442bcca688c97ed6a","src/net/addr.rs":"0ed3d72ef6679e3ad76c6830143713c611d357ca4ece88c3ee5ceb2787217224","src/net/lookup_host.rs":"c7a21d735225e316253d822f6b11a17107e6a8db004f947a54d8bc12ec782baf","src/net/mod.rs":"301307d5a5f8c783418646ef9f7712414226a73061a691b468e0e3ebb7eb4df9","src/net/tcp/listener.rs":"70695e0ed0b0eb5919bbea25d8ab5222e9f4c802f779a4b7cf0debdadd0e5a99","src/net/tcp/mod.rs":"347182e4f0381896bf3b7ab578c4564f1730ae25a108076ec65b8e855683fbf6","src/net/tcp/socket.rs":"c81d0650c58d5955e3eadf55f4a9d338863a7446a31b5facc7a863ff1a5c0c70","src/net/tcp/split.rs":"75d1f6c4afa23397164a30c4409a73c8d3df022c780aa4f91fabfa90549cc606","src/net/tcp/split_owned.rs":"0c5a9f48e7e49c257c25e138f74c0c5d3402edf447a860cbfc1a36439d997295","src/net/tcp/stream.rs":"29c358a09ca7506cc4881c233b594a61ea857168fed6e109db4f2c035ca9e978","src/net/udp.rs":"d47a5638169666490a44c40b253f3959a4d44a17783735a25430be2e576295b7","src/net/unix/datagram/mod.rs":"fc48924e5d1e551405b0708a2d122473cdafeeee802a5722f64b4cf41a1c01da","src/net/unix/datagram/socket.rs":"e7200ad149111a1b1e18603793d5a4eeb7c3034aabc72463e7120735973f6a93","src/net/unix/listener.rs":"41f2aaa74c4a3e4193a30a021fb8e685b9d45ea048d11fa0472ff3c1cda4fdb1","src/net/unix/mod.rs":"72008ca5352432de2203321244da5377afe5779ac15f5f6a577998c037e7e4ae","src/net/unix/pipe.rs":"e59a389a74017e8a6abbadc694f32d381cc347e467e77c211bd246e9c299aa43","src/net/unix/socketaddr.rs":"66bf18321a81baeb394a7094567632b113e44e12d2643109b6a97c89d919bf3a","src/net/unix/split.rs":"3f0b9c74481a536920d8fa8109cfb8553307c6694139ad9bd60cacdf97e7688c","src/net/unix/split_owned.rs":"5eccba5c1d589af4e5b52d17410c2290c289db5583676cf016de93ccabdace9e","src/net/unix/stream.rs":"538eea9c8e8375796af24cf6927d7acf72d1eec6cc76a8f9346b7bf104087bd7","src/net/unix/ucred.rs":"2c4d0cbcc12d5a0f73b958b3fd7e15900d1555ffe347393bbe4eca7c6a40ef5d","src/net/windows/mod.rs":"a1525f35c1acb92b15bec788a625b76acb42f9424f392074db697102ce79760d","src/net/windows/named_pipe.rs":"f59b2f22d373698d5859a8f20f2aff1190e6b77733844b7f5a50f9fd28b81093","src/process/kill.rs":"2f98bd1bd28ab37bedc34ab7b737760407ab5315420538acbd18da31d2662d94","src/process/mod.rs":"3712af791fc87b30aa294bf8b8c9440f7a47401977c7c8e478b25a50cc5957e6","src/process/unix/mod.rs":"08b861e59f3d3605cbf8a300db710dd95f894f5a944976d312ee739317ebfff1","src/process/unix/orphan.rs":"57bd954838f9b044cbee983922aea3f79736504761436c7dda3135314c5ea600","src/process/unix/reap.rs":"62868319849b8482d8d927dcd00cc8a74b9af61fd47494b39bd41fe2f4dcf0b6","src/process/windows.rs":"7a47feef09bd00c701bacf6239dc146def081869d0ccaf4172220c9bcccb9bdc","src/runtime/blocking/mod.rs":"3a1e04d2fc5590c7c0a19c85ecbd893108f9a81b197162378c525133c3bbc7aa","src/runtime/blocking/pool.rs":"0a39028bd216e21c90156ecea4045962d4a7dd4e8f2403641c0d1440d06eb275","src/runtime/blocking/schedule.rs":"8768ca9cdefc1b765f8915cdda096f7e5596e12c8181a5d90ba4a6b6cadd36bf","src/runtime/blocking/shutdown.rs":"6eaf2a1418b885bcc1ce3f257b99382de9c16f848ed53d9e00dc97389bb6b816","src/runtime/blocking/task.rs":"08571bce8a99dd6296ba7099c1f6da8c832d13a8c43db22044c683470147d7d4","src/runtime/builder.rs":"390afcdd4b24df53709834853217c91239eaf43d89cc2be32e48e22d6523f27c","src/runtime/config.rs":"0184fae982b428993a92e1651f5c0918fd2f62a1113b67dabc444304e700d1ad","src/runtime/context.rs":"fa5278a91f67983916867d5a1f7265f30c7c65e036b43ddcd57c5ca036194db5","src/runtime/context/blocking.rs":"794f0d70c018c17618aefc7f4fabdacb883d649861b49fdc17cff67e77580689","src/runtime/context/current.rs":"977d1ca823c051c3e5004b05c8d460c79f6515d06934240a7ab46d26b8c11f2a","src/runtime/context/runtime.rs":"df7b8deca59426ac39d6950b518172ff7a7ef306c1681187a4d3b1f22168984d","src/runtime/context/runtime_mt.rs":"911b95f39dbed005a02fde0394bd74c02e14e5b9f5c98bf49511f6c68ac5dac8","src/runtime/context/scoped.rs":"16bfa1da16baa831cc926c41df869b99bfbc6d96cf39a04aa4914a9e4b19a2f0","src/runtime/coop.rs":"53fbdc277be98691d7a1fc82afd668dc33ddb3932430c39162fe360be3c85343","src/runtime/driver.rs":"944e2a878398d49c696386f40d224457f2fed6e5421ae0c69c8353aa60c30c1b","src/runtime/dump.rs":"de53e25c28c362cc8bd4f321d23a7c5c8a3956ed3a2ffa4acd4d62f6397ab9fd","src/runtime/handle.rs":"8de608204894ee6ec7a784cd63ee82d0d973a81b006d814892aa461566c7cd53","src/runtime/id.rs":"c43d92101ffcba10a4eb7a876910ee4944b1f921a89f7e44d5889776bdb2e19d","src/runtime/io/driver.rs":"1b356835c4e05e47e70beb64645ec2587f33ae24318d6bf45e04d0ab0b44cf08","src/runtime/io/driver/signal.rs":"2e53479e68f48bf39c8cce92f0d12422bf4c68d931e741aae8daed854cd3f6ac","src/runtime/io/metrics.rs":"e711c65da155ef73e567125c0c9db33b2f511982a0c0a6b4f3b37c2d87c791a6","src/runtime/io/mod.rs":"270fead37871b8ee185e2e6e7adccb564bc8f2a0a02d693657afa76748e8ad1d","src/runtime/io/registration.rs":"7f9256af455e3d3a9b4db4cbb18ef14b3cb67740540af8df473931bd69db6411","src/runtime/io/registration_set.rs":"df44009a88c17b6a122ba6d2c8c5bde11af2222b3b8d0003a3d990990efcdde4","src/runtime/io/scheduled_io.rs":"30b6173e5e085ff86612e973373f961946a0010abbfd03e8a3f4aeb55169393e","src/runtime/metrics/batch.rs":"68fd84f0ccf135b10e2ef44c71c481129ca608005751c76deeae820d81534f2b","src/runtime/metrics/histogram.rs":"1d85cc2e6e1ef02b2cc4f2c627d5405d603742b995dd3ff23909a3a2fbedc8bb","src/runtime/metrics/io.rs":"960f44573cd16e2ec43ed872f235ece09db9f4c87e217002ae0d180e20ce9838","src/runtime/metrics/mock.rs":"d18d2ebbea8e4e191ab3ee77e2604a49e1597d1f6e858a2500bfa7e438176e76","src/runtime/metrics/mod.rs":"6c690fffe34bac1267eb3dc0ed93481874795d2fd2fe9f495859fab0866fb814","src/runtime/metrics/runtime.rs":"b244501ae29d1b5adfeb201e28ea88261cd2104c8bc3e89867898acdeaad523f","src/runtime/metrics/scheduler.rs":"997ba0339af84ef878881fdb6f35d8f6b39dc81e8f0b5cafce94476d50675c91","src/runtime/metrics/worker.rs":"84725f923fa65825a74841f6b3df06e100a838da61942f1113814496f896cef4","src/runtime/mod.rs":"5509476a72103a3939fc9fb037b352644462ec246748bc35a265a30c2e7781d1","src/runtime/park.rs":"9ee7e57790bc56629bda64db14fe60ad8781ee21357633809afffe7cf2954302","src/runtime/process.rs":"b6bd15937ae2ab45ebd46cb06981244e8e5e75ea0c47e6d8d294a00ba9003f0e","src/runtime/runtime.rs":"14819c5c2306a4dd46c8f1c8094370dacb06a66035a54c8e52b8f69dc8bba70b","src/runtime/scheduler/block_in_place.rs":"38b87ad398cae4e48bfd2afd9e2e9a0af1ee34c379c781d749d38cfe5fe8bd29","src/runtime/scheduler/current_thread/mod.rs":"b77159caf68bfff9f0b078911ef5e642cdc6bf41f47346b4bb6d65f3959e3249","src/runtime/scheduler/defer.rs":"0441413021f8267253bf9bb69b8879d3e52738886215851749b9497fbb137df8","src/runtime/scheduler/inject.rs":"fea0cf9dba0e72efaea4671a1693fa5bc68aef376d9773407855551951810426","src/runtime/scheduler/inject/metrics.rs":"26ee4f9d34c9d670eb75ee8d02a6e268952a1ef698ab3213d71873a97ea2c851","src/runtime/scheduler/inject/pop.rs":"335b42278217a3020ec1419d070132f8f5a0ce832c504dc7806c42821848be83","src/runtime/scheduler/inject/rt_multi_thread.rs":"d31776b467009c63f7797fd8caf3a2b1a78023e96e41d1f49d01bc4bda65cc26","src/runtime/scheduler/inject/shared.rs":"6fdc9c11674c2e83c37721ac0c30f0e7d23f8af8e4c4a4ec5f18e276b80e05b2","src/runtime/scheduler/inject/synced.rs":"b69a737bcba7cd27c660081c57c03b3672502e2c358beece0d4d8c9815e8af92","src/runtime/scheduler/lock.rs":"2aa5a50067dcc79d66ca39d1e4982c28f55bdcec43ddd7bc91414de5f794019c","src/runtime/scheduler/mod.rs":"490de0ab477f35548cb17ba74ca5fbe9d67f7c0153a4a902b8364c28e3644498","src/runtime/scheduler/multi_thread/counters.rs":"e5a6a1a1d01a50890dabbeb7998c7b64a954ed94bbb7cf9505ff917ed63633f6","src/runtime/scheduler/multi_thread/handle.rs":"d10a984c2bd999c2d9ecd3e690052971cbc733cad4d77c808254decdf916f0ea","src/runtime/scheduler/multi_thread/handle/metrics.rs":"d5858d459700380a372821c2a5f03255f96e58e2fdfe8367e6cf355fb29c7b72","src/runtime/scheduler/multi_thread/handle/taskdump.rs":"20768dab2f9683ecb10849fd3a4a2862a0f9942fba97d6ac29c8bf5ba7017c62","src/runtime/scheduler/multi_thread/idle.rs":"c2be2afa82ddbbe36eb6e231c8a01cd7c233d9c6e197d2feae32200098e974e9","src/runtime/scheduler/multi_thread/mod.rs":"2fae4c9f66b57d15f63c485ee6ebe724f1d41de126e641418ed6ec40c8fb3e0a","src/runtime/scheduler/multi_thread/overflow.rs":"c70ff49356fa6948f9dc53a19014a5dbf7f6bf52d4c00d9c2e20b0d23b7b3bf0","src/runtime/scheduler/multi_thread/park.rs":"07372fa7e719628f5b61c0ccc8506a2a4234e1793c9f8f8e2a58041fb89af431","src/runtime/scheduler/multi_thread/queue.rs":"0ee6e025102750e5cbe6c52f21f07399b597055de9d518f9bde7c061b808b9d2","src/runtime/scheduler/multi_thread/stats.rs":"a423bc706b141d808764911ccb9079d0232e55126e5c7919672013b0ec32a5db","src/runtime/scheduler/multi_thread/trace.rs":"f8ac6b0db76c45057c0061908d5acd63eb1463c397984bfd9a80f4bbc2748f30","src/runtime/scheduler/multi_thread/trace_mock.rs":"3ce6a3d19b53b608cba34fda213e498691ed55ce4a542806f9080bd2dbdb054a","src/runtime/scheduler/multi_thread/worker.rs":"02fe676534ff77385231ba1203390bbdf40cfa0068ce4dd307cd72df54166fe7","src/runtime/scheduler/multi_thread/worker/metrics.rs":"14e15c7315e1e1a6829b67beda6a858570b70eb9ecf9f0f3d7530881ff7799ea","src/runtime/scheduler/multi_thread/worker/taskdump.rs":"ea2bd932ef0a3b999fd8a16e15f9e7dfe8c30f3589569b7f7ab334a63ad3bede","src/runtime/scheduler/multi_thread/worker/taskdump_mock.rs":"f8664a755109ddc87f7ab82c4815cb12eb37c0bee3a1808907ac10534b9867c4","src/runtime/scheduler/multi_thread_alt/counters.rs":"6d65b0741d5ab6afaaf7ebe31419fdbb953752bd83fac679f2ffa897ccedde86","src/runtime/scheduler/multi_thread_alt/handle.rs":"282c992c4c483c0f4f9145c0548b383010fb26261479e8d7c12813bc2766756f","src/runtime/scheduler/multi_thread_alt/handle/metrics.rs":"d5858d459700380a372821c2a5f03255f96e58e2fdfe8367e6cf355fb29c7b72","src/runtime/scheduler/multi_thread_alt/handle/taskdump.rs":"20768dab2f9683ecb10849fd3a4a2862a0f9942fba97d6ac29c8bf5ba7017c62","src/runtime/scheduler/multi_thread_alt/idle.rs":"23b34e1fe1540ba9d501f79ca590a4ddf99ff6683abb5155f4f1a435ed5360fb","src/runtime/scheduler/multi_thread_alt/mod.rs":"fabc12c49c4121da7914c6bfe301c70dc36a942149dc82187e29c75a0b8782e9","src/runtime/scheduler/multi_thread_alt/overflow.rs":"c70ff49356fa6948f9dc53a19014a5dbf7f6bf52d4c00d9c2e20b0d23b7b3bf0","src/runtime/scheduler/multi_thread_alt/park.rs":"86aa7fb6f52b16237e9465fe572ff61c7aa13e5fe9654ce52dab435e23df9781","src/runtime/scheduler/multi_thread_alt/queue.rs":"d07287b15a147346cdbada6cbfb04633d380b7315d9de4c700f3bc8443cf2c00","src/runtime/scheduler/multi_thread_alt/stats.rs":"2764574e25b9276fe529ae41c24e1e56593262540771788294f38f26f1d3e633","src/runtime/scheduler/multi_thread_alt/trace.rs":"e54f7dcea7603c861e7afbfefe7441766f8fb3c0f5ed1bcfd76a3bf0b89ac692","src/runtime/scheduler/multi_thread_alt/trace_mock.rs":"3ce6a3d19b53b608cba34fda213e498691ed55ce4a542806f9080bd2dbdb054a","src/runtime/scheduler/multi_thread_alt/worker.rs":"c45d70bf5182d0f60f8725acb16d1b9015e05a7b038f03d970b48e6e721974ce","src/runtime/scheduler/multi_thread_alt/worker/metrics.rs":"14e15c7315e1e1a6829b67beda6a858570b70eb9ecf9f0f3d7530881ff7799ea","src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs":"9f1c93258038a3b32af9215ad7b1b54767b2d6dcb4ad503d90e5779225bcdf13","src/runtime/scheduler/multi_thread_alt/worker/taskdump_mock.rs":"f8664a755109ddc87f7ab82c4815cb12eb37c0bee3a1808907ac10534b9867c4","src/runtime/signal/mod.rs":"2292d907e87a730bae0b41d0b4b39ccae7489baa1cad5974abdbfc876d826067","src/runtime/task/abort.rs":"81004b45834ab44f1b673b31379d37c68c5ce8acb7d223ea58207f412745d3d5","src/runtime/task/core.rs":"58f8b07dc40f414a18edf91f151fe002e190fb71c2217272748adc429da8554e","src/runtime/task/error.rs":"0367095439c51ce94f53b13aa64404e13e85b114f77cdcd7315d4cb3d4fb9344","src/runtime/task/harness.rs":"1e6ea44979d0bcf96226979f73e87967bfb3e46286cb21770809989719d047ec","src/runtime/task/id.rs":"4cade5f2c02e5d3a0c516625aa8def2da110db3b83d13a6d9e26f2a1ad8b31c5","src/runtime/task/join.rs":"db92ae97f715e36bc77fb6d8d668479472f5454406aaf4c1191623e59a893989","src/runtime/task/list.rs":"86f1aabae9b130dc41c2d5d52b5b61801539be6e3e09d52a06705af357e07cb1","src/runtime/task/mod.rs":"d1e6cdefc5520ba2b06c36c5e0b92f7049e94cc7c0bd2268eda860d3f8e99b99","src/runtime/task/raw.rs":"315b01ce90af46690474c8715a5f69458a1dd4f9a95d55d51f822777d050874d","src/runtime/task/state.rs":"831aa8d87ca67482c60b3a91894146fb6652a57e32c5241b6e4d5fe69dae1ede","src/runtime/task/trace/mod.rs":"a92eb57080db5c9f1d564b5208fa5761f6df14fd9df691151648b1066cbf2d60","src/runtime/task/trace/symbol.rs":"bde671f445b351d388e5fcb80e8cb8be4424a4fac4b8ec3aee356eb86082b422","src/runtime/task/trace/tree.rs":"b8f9aa018147d539841e5716394086709fec6a8d0f95f6b2fc011ed131063dd6","src/runtime/task/waker.rs":"39fbfa7c33406aac935d2ff8d022af6d3f9619ac7edae62d24b1ca97268e6499","src/runtime/tests/inject.rs":"97b68f6c22f6861b2a1649a8f919bae3310d6fddeae107aee4dcbf00de526cdc","src/runtime/tests/loom_blocking.rs":"fb4bf871ae59cd567ae4a2cb568d7cba31ad92579bea17c598d273a3a749f74a","src/runtime/tests/loom_current_thread.rs":"f9a8b7e0d0b829eaee01d155005800c7a907ec7f92acdbc0678e9149aa95ce1d","src/runtime/tests/loom_current_thread/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_join_set.rs":"d6612a19c695907a8bb41b24df3b404cb521cae6f30226f2449dc32f18700b69","src/runtime/tests/loom_local.rs":"69cf7fa67da9e3efe3eee722791f811efb395dcf821780051e62842654de09e3","src/runtime/tests/loom_multi_thread.rs":"6e45d9197e3ab26270cfc4c8c48f1fa3a0d508e7d8d4c0cecb3663a83fbe80eb","src/runtime/tests/loom_multi_thread/queue.rs":"54ae93457aaa96dafa25c683b13b8133994ead7eaa135539468868c94a2e623c","src/runtime/tests/loom_multi_thread/shutdown.rs":"2f48626eb0a4135d480aa5bf72e514c4abf39aa17711c96d3829f93c03758557","src/runtime/tests/loom_multi_thread/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_multi_thread_alt.rs":"8e06356844ef57004f0f9fa3ed4c596e6b173c01b9529022b252fd27bc3bc8a8","src/runtime/tests/loom_multi_thread_alt/queue.rs":"54ae93457aaa96dafa25c683b13b8133994ead7eaa135539468868c94a2e623c","src/runtime/tests/loom_multi_thread_alt/shutdown.rs":"2f48626eb0a4135d480aa5bf72e514c4abf39aa17711c96d3829f93c03758557","src/runtime/tests/loom_multi_thread_alt/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_oneshot.rs":"cb0cb66e1014708a10a2236c2dbbac9441b6a6e36a49c419fa3a51af62b054ce","src/runtime/tests/mod.rs":"1d8d0b89fda125b00eaf782bc95fb1211d1d14b391b7089f08815ed8c41f7ebc","src/runtime/tests/queue.rs":"56ea2b3c8f3a1a01091c3e624259b03a57ab555e52ee77931ad9edaf5d6db329","src/runtime/tests/task.rs":"a9e7e18447eb1c43f0590580c2001c206eaa48e542502a04bc8dd4817de3962d","src/runtime/tests/task_combinations.rs":"65e82d0c3652f272f34eaca226179f85116b3da1e613f2ed72d783402f772838","src/runtime/thread_id.rs":"ad85f1057b2c61838620f1323fa8a710e140bf448fb2aa1d9d1f87a7fad5f01d","src/runtime/time/entry.rs":"be227fd9175ebd71f82348dfca53ea8002bf78fcb23ff242e29c5f40f4f62e72","src/runtime/time/handle.rs":"1ecbebdc070477d61b782b2f4d3a5b9b5cc06dbe447188f23eef3257fd16ea8b","src/runtime/time/mod.rs":"e1164ed6c41fe122c474b300e9e89a6d946fa7dced44c07e75934b5e906e7112","src/runtime/time/source.rs":"c03f9eb4d229a582826164031541f028e26b95c75fd02fabfde3668cc81b5e8a","src/runtime/time/tests/mod.rs":"fd656b75bd4e7737b517b1e84949d84f5af72c8b52ee68777555c724bb1bf7cb","src/runtime/time/wheel/level.rs":"974a230b26f6d4fc9f4046741f1e8ef90acd2d53132f135515bc37914afc276e","src/runtime/time/wheel/mod.rs":"1104133c6d50ea708c5733f7bf05b2ad1f027608a7495d18e649c9b97f31204c","src/signal/ctrl_c.rs":"3e1d98df851b9ea1418f607c260434e906ada4e3d6c14cdfa5c81a0c4d55cdd3","src/signal/mod.rs":"0546a954681bdad6d0cbb6129522e800fb08c12aac7da640483020aee969691e","src/signal/registry.rs":"aa24596f5b535a8de86d8e40aa0d3e1e15eabe2f6c45b9bc8ac243b9530d5fea","src/signal/reusable_box.rs":"3d3b710b1794d9f8f5463e9ca380ece60c426b58786a5cb5f40add627da01aeb","src/signal/unix.rs":"548d0dde2a5ee979b433af9e02e28edbbb83a1fb2301a3dd09619bbad84f1202","src/signal/windows.rs":"826a2a16fc9ff37ecaf7eef88f09d8b5f57adb6095dc10b981a4c0bb67b70a2d","src/signal/windows/stub.rs":"a6d3b11aa3a7247f7a8365c3241857bcde48d8c390d569e6bc9529c9b1f8ecd1","src/signal/windows/sys.rs":"3e4882762ac424cb3b3caf71d5a69f571fbe14e6b298889ccb227c58b213c257","src/sync/barrier.rs":"45a8ca0fec02e6a6fa77cfeeb09e3a142f931d413c00962aa0d0036ff8ff37bb","src/sync/batch_semaphore.rs":"dd1b80d27c0f1269af804a342bea1a9ac8bef99d93f2d621eee8042ed239ba0c","src/sync/broadcast.rs":"a72182285cbfb7c055017685f186afc6250978b949b800982d2db3781f41d234","src/sync/mod.rs":"080f05653cabfb3423b0c96d04581764f3c4f97d813b0d09151d2e346e160480","src/sync/mpsc/block.rs":"c10deca84b96374cc6ff49aa0ee59d8ab923134ee74bd3abc514c6330be16c1a","src/sync/mpsc/bounded.rs":"6778f28fc2aa8644c423de024e1581b02fe2cc3c29d2a374535b764b0f1bdf44","src/sync/mpsc/chan.rs":"077116b7e24d8a2f583ea2aa0af2f11f7d8dbf33e7b9c2f2ac6ad4237a5875c3","src/sync/mpsc/error.rs":"c11e21843f2cb734446a5b1cf3537b212481cc012f27e93b34848586919928d9","src/sync/mpsc/list.rs":"70c3dec2b251b20e64ba9bd7f3ae2d74c1f5b173885f5e8dcb80059e6cc69700","src/sync/mpsc/mod.rs":"3699ff2b4c5315f0a1cde40a1d3a45bc312febe1cb612cd68c6176ed7590bf1f","src/sync/mpsc/unbounded.rs":"6a7ee99558e62537bbc369e86752ebf0da09b7e0b0869e468c499f9c6c02dcf9","src/sync/mutex.rs":"c0e9bd5a872c679f6e41ff9ee69999303708e1ec5673c784c9c1f4e3edbd8441","src/sync/notify.rs":"ae51b1244dfb6fac0825c3f446d2441e75b07e24d43f6db4c1be107764ecf8a3","src/sync/once_cell.rs":"45549067ea02478c8452bf55d9dc699a41b33339804cab1e7f8f981df0220f5e","src/sync/oneshot.rs":"f45f32a07236713936249a9f08e181b5dc8c70ca5383340592007d29087acf77","src/sync/rwlock.rs":"c463130615337f2ad8ca20bcc430fb65a96f3f8f8daa1162597c2e6c129db8c8","src/sync/rwlock/owned_read_guard.rs":"135d81271f0028263ce99c3246cd335a08912b50a43f125b3e8f7739ca353cfb","src/sync/rwlock/owned_write_guard.rs":"ef56443fac210bc3d0c2b66beda8436154c2ab726f1dc208758b54b2b087762d","src/sync/rwlock/owned_write_guard_mapped.rs":"3038187dc3a791a89505621230d3edd8629287ec11490ff37f2c624b593c5325","src/sync/rwlock/read_guard.rs":"0f7e52adacad0fb1529a453eb14f8207a8caabd8f5fca4aeb2031a9e9b0981f1","src/sync/rwlock/write_guard.rs":"f3855cdd09940c86a9bd10b91d3ebb37b2219b60c727a3bed377404ef2483c35","src/sync/rwlock/write_guard_mapped.rs":"8c839c4ac4b73faa1c1fc697753e23fce113ba6e576d2abc022ddadb98a34af4","src/sync/semaphore.rs":"0a2419897bd15b552cddb3956a053c31405b5a49f4592b9e6b4873416c3b87ce","src/sync/task/atomic_waker.rs":"1e93bee50e2a8c2156246f312e3ab5d610037071b8f91452e2386e1ab9e1a20d","src/sync/task/mod.rs":"f5e38105c7f8a942c0e49b973bad0a8c2a1df81deea19f3c5228edc4896c1725","src/sync/tests/atomic_waker.rs":"f44940a14a294cf21f1d1362036b02eada710d5f07c9e2f7ed1b78ae647af553","src/sync/tests/loom_atomic_waker.rs":"984b52699c47383b9b62e6c4ff93fd458bbe64cb4ca836463adbaf94d27c38ee","src/sync/tests/loom_broadcast.rs":"b2c6f138707fc389ee7d91109bc38093af9060b3465e68d3543cb652e0070406","src/sync/tests/loom_list.rs":"54321d0a1a21e65ddd7e958b751480bb35b93d9d4ca11a218043e684e0d6bfff","src/sync/tests/loom_mpsc.rs":"4883352b9d75a81c878609613545ae14910eca4f2e7f3718053dfdb792aa0760","src/sync/tests/loom_notify.rs":"cd401c73084df551043b7d96b9f2c51e9c1929a9038eb899381bd4ecafe04ec8","src/sync/tests/loom_oneshot.rs":"c3596c15692b16e7cb8cd6957362adb3a98b3d7f16c4a4262f19a3a27f262b03","src/sync/tests/loom_rwlock.rs":"80ec00bdcac838806d4d9f711cb154e02f22913ba68711855c39ca92028d3e4e","src/sync/tests/loom_semaphore_batch.rs":"c6f69b8d5b2e6842287ed34638a9045095d9f94c86ba6bb84c1224bbe10026ff","src/sync/tests/loom_watch.rs":"d451c914e94c5a672abec3232e58aff6218581f0c0b1802434ddbe771b1be6a1","src/sync/tests/mod.rs":"1ef2026ac3dfbb70a437b8be441deca4b7b5e72638b71daf753b89808cd3c9ee","src/sync/tests/notify.rs":"23600377d3eb041c2dcb3702b63109475302b22827c30e90c1e8754a18f306cb","src/sync/tests/semaphore_batch.rs":"1f928cefc34b332d0b7c86a3b4d29d2b9ea37ba57dcf5eabc7bb62138f4a51e6","src/sync/watch.rs":"1b4f22de4af424307bf187b13f69b859dd52fa12b9514fcf10f71585d9aab054","src/task/blocking.rs":"96ad214e99e2120a05c938f61c2bcfd0ac8bd20619dda12d93318d4f0ab7f41c","src/task/builder.rs":"6704158d8adb0e1a1a2b1b66548fb295c6c1e32b7387e6f3c9c6ebde9a0c084c","src/task/consume_budget.rs":"f1000b9628938a5964f70793506f51579849284a4acb10d5e9c70080c5caea47","src/task/join_set.rs":"e178485ba52bdeeaf0f9320e150637770db8313cbbfd442440dd61a98fb5c402","src/task/local.rs":"78239d52b8dee9bc52a878036b39495709f3cbb06bcb4bbcbfaeff64336ffb40","src/task/mod.rs":"68c4e77221655cc3cd208e20fd9f8b3035d5f6176e30a90c5ec67423f8ff8ec4","src/task/spawn.rs":"e86d2ef3615955c35423dca8b3af9e3eadc5cc3e641916354500128680172e43","src/task/task_local.rs":"c5c0aacba358da219057c67e9040030b5171ed384b5135d3a56027376a24379a","src/task/unconstrained.rs":"8e75239ae694f296136fbacadb232ae0a255b0b2013e1eb0390bfbb82af36692","src/task/yield_now.rs":"b0f6a01df2cb47292fd202ecf685f591ffcc397c48fd9e2879bae381eaf894a8","src/time/clock.rs":"885dad6d0c72a78a6e16fbe3d32804c3014e0bf7a1823f5f9207e0ed89143a08","src/time/error.rs":"dad4d124c6102e21d589e5d022a4fe99a00eb68c5980c755cba3cc5d043110ac","src/time/instant.rs":"164ee00dabfa6bb9fe4c9854f937ee92ae454eeaaeaa7a447e09434ea95bf722","src/time/interval.rs":"25d386d253d372a374aad3017148bf03c3ced0332009a0e2590593ff76a87932","src/time/mod.rs":"c790bbe9356ceb56fd20e762c9002906aa4eee1d1d297fa0c520130f72d3be3a","src/time/sleep.rs":"efe8acc41a198bef1a8232af502856c3bc9354bf340f550dfd0af4fcdb488cbf","src/time/timeout.rs":"67f5396cad468dac3381b323734739914052a0f72c3df018eeab14a855f6c8d8","src/util/atomic_cell.rs":"b1a2a0b1c0f891cd1064ac19004a2c20e5a5b2693dce3d84af7304796d049ecb","src/util/bit.rs":"a5c16c671e58ac19a46621efa3cb02eac21fdebfbf97529fc0f2aa708250f738","src/util/cacheline.rs":"204079442ea5db45488f327a48a3ef13a93702c8f77640511e5ed4398dca4390","src/util/error.rs":"de1a0d662e9359da3e19739125b1450f571abadf30e34f50f085b23d8da28d80","src/util/idle_notified_set.rs":"b3a5bdd080362ae0625c0550adb1a49afaa78781b07e65f83f669f2cc157fac4","src/util/linked_list.rs":"82208a202d84614754f412ee538d2d666e3db87f84b88b5158e18cc9872e3129","src/util/markers.rs":"fb9b674d9a48c97b411db8a3264fa2781026a0eafa74cf276cd47d8ad62cbf02","src/util/memchr.rs":"8cb5e0a0da9b7d94d29a994dd4e725e547ce31f87b5bf24a1a9b53b0ae65cc08","src/util/mod.rs":"9b659eef0a411f5ad5f75fae5a4122463450c99c036a46771f79744ad1cdfc76","src/util/once_cell.rs":"bafbbff82e595a0b8f41f3d5273dcfcacd282c51a24f14666105391a456c5db7","src/util/rand.rs":"c36ca3d9e971e857b132f29ce3ce0ca3fb7c82a4f413354e7acc91cb6e8ee285","src/util/rand/rt.rs":"9790a2b6d822edbffde723f38b75ded408dba6954d711f285bd17924322b246b","src/util/rand/rt_unstable.rs":"bdb69915fe12a9e0b8f2ab4d72466663b7a3e87e671343a0a623028690f4e452","src/util/rc_cell.rs":"362a7a7b776389688299628a4678378fa02f88fbc6ed7f9fe006054d9b62643a","src/util/sync_wrapper.rs":"8f1ab76280171c33c0bafaec9c1cb1d48cfb0d19a1ab2b768cdf7d7e40f07d00","src/util/trace.rs":"eb32f5d2e3d7b1d73bbc185dd22893ecd1cbbef61365abd22dbe19c3893a0c2a","src/util/try_lock.rs":"c4ee49e1751ee0a7df1a8cbd4f8d36ea1d7355e3ac584fdb8697a94cd7a7a8f8","src/util/wake.rs":"4bc0560915862a61b2fb2fcda0bc27b08b1012195b87a35dff801ffc5f8d63d4","src/util/wake_list.rs":"c3443e695fd0b5c41c06d66cab96549064e9b645043559d01f82f365dcc4ff6a","tests/_require_full.rs":"1f58c8125018bd88b9f21647cee3d957b716bcce70f9144af1de58ee6712908f","tests/async_send_sync.rs":"69166867e7a32f5a6f44a4d7f69ae22063fa08f2d77a1ddcb760e0cb1006c014","tests/buffered.rs":"ad2fc9e69437dc8815888286e2ef457215e770b5da13b1e6123559bd18f7199c","tests/dump.rs":"fd5bc91090912351c89afd6d91109b7c389d255479bb7c8355a7b69f78474dd1","tests/duplex_stream.rs":"680a6052e9a7ab6c0684f17f922243c24691dfe9e83dd099217d439b61d50838","tests/fs.rs":"e2d21101b603216c65df87259cf604f3832b8ed4d39a81aa3a3e90972611a700","tests/fs_canonicalize_dir.rs":"f08d79322e814eeb09fc6548d1a7daf301322a5397b3283360daa31470e90e16","tests/fs_copy.rs":"c71fbf6780d3b484940a590992901127670a4a27ebfb75a0cb92d17ef9e6f860","tests/fs_dir.rs":"4f29f2979a869ed12498cd9c5a2869b02d94ccea8c1a845cf9587d6c7bd0476d","tests/fs_file.rs":"e05bc4f2d49ebd77d96be87b79fca05cda9bb5a5ce209cff18b8d6bb51a23d17","tests/fs_link.rs":"52da287ce88ac500b3e46b5a00549d56044c75b908a7771b63c29b2de2f95828","tests/fs_open_options.rs":"f13c92227bbf089850f018f8b3ed5b527c4ef32d5305dc1bd751122abb30ebf1","tests/fs_open_options_windows.rs":"eae02a644078164bab7bd1c1a5a2ebc85f90adb110c955eb4bf01a34e9321aac","tests/fs_remove_dir_all.rs":"463ada6fbd6455070eec5d84684d76dbe9a245c82698b6e2264674ea0343cc5e","tests/fs_remove_file.rs":"614e41551c81276b7f700ac3b6a31bdc426772c881033d822cfc3759a3468a93","tests/fs_rename.rs":"c5397d389b2aefef31e2f4bc5f7e4b4a2c9c1e3109945de9f93dffc98bf0ae00","tests/fs_symlink_dir_windows.rs":"bec061561203ccdce24a0f5754690fe4d38030036055a667f46b6f452a9d31ec","tests/fs_symlink_file_windows.rs":"02ba203872a6ddd20c8e65471d77d544d85d6dfb4fd572b3f7782d73be01aafe","tests/fs_try_exists.rs":"198e5b1d81c140307ddff8deee3a79ecec044d61b2225139da3c38b2fa1e1b9a","tests/io_async_fd.rs":"d81406132f230cc362cfe5165f5fa14b937fd373eb669a714e45b4256c2177f1","tests/io_async_read.rs":"a590efe9bb01986f067118640a3b55f6760186e554f8e8f2404231d4e96f61b9","tests/io_buf_reader.rs":"f5a322dea6fe9f40c18a085a865919c1bbfe8653203b37d1e18b77d259c6211d","tests/io_buf_writer.rs":"3bdabe9ac26f3189929ab3e8957150f5262d5b426fd3cb6c4761a45014b1c1fa","tests/io_chain.rs":"f5d3ddc9f6e8152ceb08b5dda2ca3168b174f1f67ff28a4c5983bcbad69d8af6","tests/io_copy.rs":"0683dee400710c1696a6634ecee64c39e7027344e66bfdd6b2a78de8ca913555","tests/io_copy_bidirectional.rs":"3a207b2390ef8562b547cf2c897e1e89d4dc31a41f2b353a1356b20704bc42cf","tests/io_driver.rs":"887d25bbab98334fad891c8f8ff2cb7aec0f10d01e2993cdd0cbc4c6e406df88","tests/io_driver_drop.rs":"a0126f26fdc2693129f6941a897b5648bf9593123de355119d2e38683b15f1cc","tests/io_fill_buf.rs":"930ce8ab5562c2013f4a75cdf717e41a7f8f3cbad6bae7bde68f0cfa3f2fd80a","tests/io_lines.rs":"f5b1599ffff44819e269519ff0a08635ea1c5d7c541293e63ee33d98f25f0e3b","tests/io_mem_stream.rs":"7b20d86c02c8a868cfa3aa4d228519090d156fdd9a8a19a3be263f264fc9d33c","tests/io_panic.rs":"488749c11fa901c86b235f8043b7b6879ca6762de48b8be4b7656c20fa293dcf","tests/io_poll_aio.rs":"165f80ebc81e8ccb4d335c9b9a89d960f097de9b17e92bc964effa3c76ce5f98","tests/io_read.rs":"c0ed5738a4b2d9623b2e0a67cab0fb19bc50015f62ced524b5d9069c57e10f05","tests/io_read_buf.rs":"6dc454751af0e9cccb44fdfb12b9f0311fa8afa482886aa56e3e15d49ae1e06c","tests/io_read_exact.rs":"b6387dbeb0baceb7a1f74a9a3a8b4a654894465368be27c3bbf4352b79fc4314","tests/io_read_line.rs":"8296624b4f5e162c79024f3beab2f561f4195a244cfd4c53e4d06282f56a31bf","tests/io_read_to_end.rs":"722e2922a40080d391a83b4903f47823779740090624a98ac30e9f164b20a3bb","tests/io_read_to_string.rs":"c9ebfee5cb262d822119c2881ea1cc0c73598b13c517c297663e35bb120a089d","tests/io_read_until.rs":"b6c0df9e4852766910ec68affcd92fbfbc280018b7f9c16cf5f4830f9b8389f0","tests/io_split.rs":"fcd232f797503596b2f8a6b0c4fe6df146108456a670f7f101e4c4eeed52fffb","tests/io_take.rs":"06e91faae76440228df71383650f86752e7b749b193f1729071a7e8fc516e01b","tests/io_util_empty.rs":"32dff601a78e46e12339bf1577463c7ce1070d71d78a2fb33318112a111dc120","tests/io_write.rs":"98668a8c8feae0f85714df1dfecfcd94fba4ba347bdc3d8aaa4ea8b175055c69","tests/io_write_all.rs":"e171af1ecab45a439b384c3bae7198959c3f5e2e998967dbd9296760b52951b7","tests/io_write_all_buf.rs":"2c037f07ac464eaa4e0b87e4e4968b28a0f2f1b1d1e218546c9d5dac7a75d145","tests/io_write_buf.rs":"331d3b54c7664386bb87585f39910d1fe31bfbdfa012a2dc2120e535dcdac329","tests/io_write_int.rs":"3f4b50345f7d7d558e71ac7f2a8c1c4b7b771dad09fe2e1fbf9a17d4fb93c001","tests/join_handle_panic.rs":"c52d004091c9246967e5a734d5b76b3c57dd4569e13a41648e094e1b82e9839b","tests/macros_join.rs":"4411683c1fe79419457e758650ce89ed76f28041a890cd05db9143034b63719c","tests/macros_pin.rs":"f8fe8ade470196dc09b061b0cdd71ef25e114a201d5eb500e0f8232b436012cb","tests/macros_rename_test.rs":"94715e8014bc4c67cebe830f3d800c4cb0937bc6245de4b5410e5729bb2c7f9a","tests/macros_select.rs":"7f5ad6e104c95a30b465aafae1211384c07228c61d15f64efb4cfe55111bbc22","tests/macros_test.rs":"7bdcb1fb36b09e0666c05c264e9dbf87eafb236db580c4ff0595d30bcaa68377","tests/macros_try_join.rs":"79a2e9c784e7249fb4bfe73c41d2efa88206fec36a8449e6fb7ecf95f50d8d4f","tests/net_bind_resource.rs":"ba0dcc301ee170fba82cbbfbf0172b665b9914c0004270d8a420d5cd948eda84","tests/net_lookup_host.rs":"69831a012b36346e25c3ffe0dee2dc31d0faeb294a9deadb46118c2561b617b2","tests/net_named_pipe.rs":"dfb791caa5a4ed1bae0605da27ef599abd8cbe745c2fa95a31853bd46465b042","tests/net_panic.rs":"dbfab24cf5d251875505ea49a5c92d34d981ad8b182b6c492f3c7cc4fa92faa7","tests/net_unix_pipe.rs":"6b6956dd7d584fa18309fc8c86a74f5270c9fc2faed2f5c3b722c11e93419abe","tests/no_rt.rs":"7ff583bbcd848d2721088dbfc45d0d70f978f8101275cc9bd220ac6d392f17d6","tests/process_arg0.rs":"785d801cf281230e3208512820e7d71b4d8362b8cf33fc72235da370e10983a8","tests/process_issue_2174.rs":"66c56d8dfda4e1723928da713dddea8d15774d6730398effadf0ec28f4c6f1e1","tests/process_issue_42.rs":"26043f8246b00046137551f7a9f638652c70f527f10b4d91e4286643120ca41d","tests/process_kill_on_drop.rs":"9b4bf8a73769fb268ef3687141e8df6122814855d3bbc4e63295c66b0ee6cff7","tests/process_raw_handle.rs":"aaf0dc242ce69f1a8c614e04515c41584f7e213f84ebf23238521eb881e0a6de","tests/process_smoke.rs":"4b55f2aa526b773be55e718abd54ab23851848c4cb28274af587d3bc8ab48f75","tests/rt_basic.rs":"2eb193a4a4555cb8aa636fa3437b4cdf12f64a888e20afe642b1b3872242ec3f","tests/rt_common.rs":"96ad95ac71a645b01602be7a6f1be11261a33b5aedecdcbfd21b54ec7ac3bee1","tests/rt_handle.rs":"b79c799d7a7d7684a0eff042cff92d50b582527ec4919e1fe8a2cd021006d665","tests/rt_handle_block_on.rs":"067205bfb6ce2c7b48301be4bc7d368c26b98ed1e0d17f58e64fa5c528205570","tests/rt_metrics.rs":"043c22f70d3754377c2c7d9b9377ed12b5bc2ab4daba5ec5d6ba2fcd1d95f66b","tests/rt_panic.rs":"8539ab9740dbd2b8d0a561b48c60970182d1db8dd881c8c493ebbb7a0a1b209a","tests/rt_threaded.rs":"1c56f40ee5e0ec7da0a8e546d91535f59e7cd7d035f8c7408530b6d74b0392b0","tests/rt_threaded_alt.rs":"eaf1fc504ad333c74ffde01475c1a087e1f566ec1bc840427ce09c83d1037a76","tests/rt_time_start_paused.rs":"76549719f16e9cbdd9a84b9d97929ed7c8ca95b8d4d715608eb99f950cdda7a3","tests/signal_ctrl_c.rs":"9b53065781b37f3db5f7c67938239b0f3b0ebbc5938c14a5b730ad7ec07415d2","tests/signal_drop_recv.rs":"d1ec97213d9c6fd9fb25ea8c2b015c9e9ee1a62fe0853fc558bc8801e5a3a841","tests/signal_drop_rt.rs":"f968c1154262a4427b5aad2d9fb36d3b7d47084312d0b5527a8eb3d589381d8b","tests/signal_drop_signal.rs":"041940550863250f359630dc67ef133874d809ddaf0a6c1238cee1565a19efec","tests/signal_multi_rt.rs":"a1c50c25f4707fda7665da61b3317dd61fc32c63c61db2bbdb56065bd9c591ce","tests/signal_no_rt.rs":"6978c2ca34a0244fd312d760ad416d961e7e27681e4bb936dfd583aefe6aaf1a","tests/signal_notify_both.rs":"bf0b9def20f530d146ee865305833d8e9bee07a0515e66573d7ff30e2c631123","tests/signal_panic.rs":"0b26845bbc7f388346e0fe3af98a2257dbfd0eb84168368994a0857e06a42398","tests/signal_twice.rs":"bce33093eed151955d13c334d6d8a5bc5ca67cf5b37c246e435a24c15bc166a0","tests/signal_usr1.rs":"86ad07594b09d35e71011d1e12a1fa2c477bfbc4a2a36df1421b6594a0930074","tests/support/io_vec.rs":"9b3001e120138ead4a63720019c669ff00f8455a74dea2fb231633b3b58c9b09","tests/support/leaked_buffers.rs":"85ddbce3ff6b0c5cc8cb30449dd37e5bfedc94f8357e741ec88ff04462bc60c3","tests/support/mpsc_stream.rs":"00d48122fa2ccbf1fe0b110ce3cf22590eda54b3ddec0134b1f9376eb1169645","tests/support/panic.rs":"7bcaf8ea2d249b5c1acb3c1b769cbe479834630dc71b3ce1114b8b46277f44da","tests/support/signal.rs":"83531afa2e8e71cfd90cd4e1fc821490ffa824f0f9f0c9c4a027c08fed6b8712","tests/sync_barrier.rs":"f166e526d12f840de404ef58a375e475dc7434292b2f23d557214749d0e6c372","tests/sync_broadcast.rs":"ce41987e3c5b7856684608528a2db19806073e41bf9a6a341f0a8c6ec4bbc4b8","tests/sync_errors.rs":"7a49ec77f4c967b3c76c946789f43c51e0a820a67e947ed42e30ef65ec9242e9","tests/sync_mpsc.rs":"655e7856bff0d5412a2365477d7c2dbc8e86c62598c6b7aa8acc68ba567334f7","tests/sync_mpsc_weak.rs":"5b8335b663cfccae9a08fcec4a3a73a890abd36d2f58adbd845d4745af4fafaa","tests/sync_mutex.rs":"432591e4893b4c64a58116463b6c16a2eb23fd42eee42af96d93b9d03728608a","tests/sync_mutex_owned.rs":"2664c35f66161825cf8e0ca863347735cf4d1252a208577e5084dc1935a18596","tests/sync_notify.rs":"9786acc38aecc651704b5e5b194c3a45a06a3ea032464145a5f17af2062399bf","tests/sync_once_cell.rs":"d4a792f554acbfcd66f2c794cda44f180a330d8bc488823af984196fe2c91d74","tests/sync_oneshot.rs":"6e3542ed15fc8e08bb422e0ad001cb422035c06305511b156e9645f2322abe4c","tests/sync_panic.rs":"50dc8e6e59caa4b956ef1fbf32d65f43e11a492bcb75c0e43fb1c925f3764f7e","tests/sync_rwlock.rs":"47094f85a9d6db9d3011d09f8db014f692cdc3239449bbf2d54575c4923e8dc5","tests/sync_semaphore.rs":"63a61b02ac674cee92e963a2e92f058fdda22dd95f05a087136524042bb8bc8f","tests/sync_semaphore_owned.rs":"5688e32fb6f9d6ad95dc6859fb5c5682e4e75e59dab9d2f0c02b9360d455e4d2","tests/sync_watch.rs":"5df73545149e505f423dd04c75c8dc8c645681eec66888d76a498013a2034205","tests/task_abort.rs":"55d30e73fd237e226a7b3027a71967654a7374cad92bc248afe056c4e70d56da","tests/task_blocking.rs":"22fe313b6872687f6170c0a052c294d1aa4fe7f5b84b145bd243ac6cca1d7fda","tests/task_builder.rs":"784830b868e9fd7b0d9413cbd7719eea7606c62dffaaf59986ed3e7902e9a3e5","tests/task_id.rs":"98caa8b1874e3cf65d06bbbf2a0dde936c397aba25e5f4859ecc96a8774c446c","tests/task_join_set.rs":"060eed473a3f930a31f6bdec16b053944681b86fce005974cca4f0780a08a2ff","tests/task_local.rs":"fee94e54f2043dbbdcf36e6fe1787e7e2fcb814affbb9c370831a58281791755","tests/task_local_set.rs":"4964c6e88889f5a7107ab06632dd0679192d1e42a38f85f6342a2af955d35a67","tests/task_panic.rs":"c2631bf2d04f04263ad95d03df2970b7d21ffdda2cab4f8ecbf5e5f3d47ce129","tests/task_yield_now.rs":"dbd0f342129b2d06edc0daee360731e5adcb2e3a19f8d658a2cb510490d7fa25","tests/tcp_accept.rs":"e25e52fe4087638b05fc74e1be5311e015a723043d4de7b8e8867ae4bb999f9d","tests/tcp_connect.rs":"03abbf5cb0e163de534feeafb8498357231bfb3a38844e20a5e459d241dd204f","tests/tcp_echo.rs":"7dce84fa8c5ad0014846c3d0eaec1df8ad779fdfcc44441d068e32b408ba3716","tests/tcp_into_split.rs":"8248df254d9a7653c151eede9846994f1543ef902757ec2a196eaee1b0522936","tests/tcp_into_std.rs":"b2daa51b870dfb83c72958ed900ba863578e7d6c9339a591e97612a5f4d670b9","tests/tcp_peek.rs":"aeecf794f845e5396df9901780089289e285c10b65b9fd9a8ece669e808d535e","tests/tcp_shutdown.rs":"82eec393777a05f4a6ebe460e74d1dbab6b80d55b1289573932a891677c345f7","tests/tcp_socket.rs":"185f1a0121f5f22d9ccb5969fd36e64d12c563efd2d1964e2becbd73128677d9","tests/tcp_split.rs":"5210f66e120f90f6c5110b28859cb1582713885f2986ebf1600c6321095e85f0","tests/tcp_stream.rs":"08c0986f8ded0a517df2935eb6f76d31456ef699082d7dc140260bbc8f91c9d0","tests/test_clock.rs":"d5c9bf7bb5d926e2b29b43e47b5bb051b0f761bfe44d5fef349ed442ea7b416f","tests/time_interval.rs":"1a7d364332bf6ba8bc3cd19b2b0a79d08348a3969aefd8a5039d959bdcbb3436","tests/time_panic.rs":"091c4c251ca508a70a3a6b5da7f886ad54c6a1bd4a3a29e56006b20470cc468f","tests/time_pause.rs":"2b2f6d0a83c4a5e7d2dd237e3cfd7e6f41998305c8e66d0b457e0c78d5409cb8","tests/time_rt.rs":"7467d08a4d681eba4d2207e8254e8f5cbf3755c0dbd40e9bea51e6838993b11e","tests/time_sleep.rs":"69bfed71e9b9e174fa447d36406666ea91c01994c9a700f82d0a0ae0b9bf8b73","tests/time_timeout.rs":"31d4955a4009b24aa0a506335607b6aa0e6b21cbc533650739642c4334b888d9","tests/udp.rs":"153ab04ca9d14b63967fea25e46855959931aa786bb375f1c39bcb36cc9d8c66","tests/uds_cred.rs":"146c6e9bdbb82a268f178b03575f94a40db81ef67a740dd16ead5b9e4a447f1b","tests/uds_datagram.rs":"f8d886adc6c3947960991392cd8540a0b4a7f7b0110a24d10805237b385b49f0","tests/uds_split.rs":"79d54d6ce35e5d15138299091871ecbdb6492ae6863fe406021fd7359f1ed7fd","tests/uds_stream.rs":"287b7d5e297df3e326488d98f9645ebfcf8be0205ba6a8e5ddaadac58240e113","tests/unwindsafe.rs":"e833431d40708f39b8bf54b809b635d77d9895f46f3c42aa14d3e9108415279d"},"package":"d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"} \ No newline at end of file +{"files":{"CHANGELOG.md":"166e7d6c435812bd3e52bb9ce74f0c7c782d8ab19d3d632cf7eef363dcb41286","Cargo.toml":"7c29d9153ecd7396f63996ad0a2f7e897f74b322e7bd34444755132ccab93706","LICENSE":"1a594f153f129c2de7b15f3262394bdca3dcc2da40058e3ea435c8473eb1f3a0","README.md":"a3ef61a5bb229db000ef38fc87178874bfb4344808f8f3cf6d83be38b82e2e13","docs/reactor-refactor.md":"24d4f3ec6d8828bb96afe0084df9e7739bbdf1995283dbd2cd76740311485b75","src/blocking.rs":"8e62b2cdc512fedbca4b4c4f983629af035afea4ee7e918bb1a3e9851c8e034e","src/doc/mod.rs":"3bcb0ee6cfb9900e73dace56581e4b18b34256544758c2fd6cd597b382059627","src/doc/os.rs":"6e11b38bbd5a1cb4a6a0858e6eb689ee5b7a175a255c774c10cf4aa58f734e51","src/fs/canonicalize.rs":"f79eccf4f2c78a92ca8ece154c0ad36a97562168257cc2f50d39e7de00e1a237","src/fs/copy.rs":"d19ff4baffa10bfd3ec722cf4c52bf15825802c4e6c0eb5c375dd37effc072a1","src/fs/create_dir.rs":"4fd26d27b97ded25bc9a0fb8456ed2550bdce8fee3958ec712db0af36ed42ae6","src/fs/create_dir_all.rs":"8d31882b086be3f70dc3095f0f7c46d8289ea8423be76bf9cb446955357ae67f","src/fs/dir_builder.rs":"5e726ee92b953d686d0504baec463ec844978df90d075dbb78d1ff2b65111932","src/fs/file.rs":"8b97da980de0feb82588de01bc350da462c7fd169c2cf645f28cce5df47fb079","src/fs/file/tests.rs":"014b0bd871a58d42d8b97cf2d860f83693294f935c808f1406f4b26e5d09afa2","src/fs/hard_link.rs":"aa54bea5685a1d49b22675e516891773706a27e95688cd2e70890bfd232f34c1","src/fs/metadata.rs":"1eb0f7b53f2afb53714dc2148da03c2dcb93a5d49611615d5ea5245584c9bf7b","src/fs/mocks.rs":"040c47fed2757d3c1913109d397d6443450826db1920f19c7147a0c96893559c","src/fs/mod.rs":"8743addab538366cbe90b43cb233c54e1be524c173b9e659fda4fe9fd78060b2","src/fs/open_options.rs":"e4ea393c4c9fb11503a7db3c7700b8352c83e376b514c61dd694ad969a01213f","src/fs/open_options/mock_open_options.rs":"0a5f0ffdb5a67bec7fbaeef122c1676f1ac6fac38004038ed9ca8f97483eaac5","src/fs/read.rs":"df8b7f73766973f89989197a95d94025ae52d1f741da2a54a3ca1000dae6f2ab","src/fs/read_dir.rs":"0d15441ee8243cc43cd97889ef733de73cb161c07e04d418f56f415efe0187cb","src/fs/read_link.rs":"910a34ccae4604c3ea60044fc1a75fc6598e912ae008459e667398301440217e","src/fs/read_to_string.rs":"9e5b2d476a6084e32a92c5421a8abc9d4f335f4ec677beec4bf8bfa109d7d106","src/fs/remove_dir.rs":"314303525fb2a78bc2ebd51f5ebe725a8d59a8e646d2e594a1dcbcfb711b3a11","src/fs/remove_dir_all.rs":"b85abd05c7ab64ee8dc6cf5663a11e713aa51b357759ef660ef3cae3365ccc42","src/fs/remove_file.rs":"283d7ef67b53668810daed6aad23cc90466d359423f97ab01c1ae58c111feb12","src/fs/rename.rs":"0a9d11d546fcfa500018ec6dd188c9060aaa1daf1eccec63ab219d62764c5ae6","src/fs/set_permissions.rs":"8adccafa475dcfc1bc3989af73374d90683c1be4953ef812e5fd606f968d7b7a","src/fs/symlink.rs":"e9c5a3ef23c8c12800b8932a557cfd5a81ba9b2f3939fce8d2dd827ef207f7c2","src/fs/symlink_dir.rs":"66a6655f5306854a7b6ed3748598bbe737055da9635bded715a04c3abfacda7c","src/fs/symlink_file.rs":"ec5816344f8c0b79c4d84e0ef2a987d753c719afd3bbc0d0a739224477a9edd2","src/fs/symlink_metadata.rs":"f5ce1e05f137da995e3e0d9582bae0a5f7ef4251285c64e912b0eedbb068b395","src/fs/try_exists.rs":"c666196690c4d45991374b03b27f0838b33e98d0be2838638d4de4ff856894b7","src/fs/write.rs":"1ffb734d31748bd879ad398b0fe99bdec569782b42677022957db2cae95c4d2d","src/future/block_on.rs":"30bad79b005a1ba7f696bec5639a5886b1f653a152b8948ae5fcd287c05ab8db","src/future/maybe_done.rs":"a4acf492dbb43ffb4388e1a51cc109bbc3c90f5e706ff917cdcec6043719c7b0","src/future/mod.rs":"5ab5c512d648f564f4803202ae762faf662b75cab17dba1597fd049483ebc2a7","src/future/poll_fn.rs":"b3c0eaeb442991d3fe27f53f2c2849f5f40b0f974035036c26661bcdaffa09df","src/future/trace.rs":"c42712a8d372922eba7e05cd21382fe5df5eec02cbcc870062100b59ab99654f","src/future/try_join.rs":"0ea5a069b17a34bbc091acbd74b9d51794a55a85dfa63fe2404d5ee91a4f0038","src/fuzz.rs":"db998767c729f35320b1d489f43f4d7788e989c8d16c0793188a2868207d8e25","src/io/async_buf_read.rs":"85abdad3d480c038a2da14127d0a6fa0d992256bf5cdc5503fa4854c081c2ca3","src/io/async_fd.rs":"79f1d25395fda10a5261b7e7c315e1e5d805ded293013a309593ff71be97cbd7","src/io/async_read.rs":"f52c8d2f4a283c0dc8d06dc974484749973125b0b691bc0c3d100972ac67cb92","src/io/async_seek.rs":"a9a0df389ff2be3d79208ec475fcfede46a86f6ea0b822b1a4ce8273ec714b0b","src/io/async_write.rs":"198ed6a475b6f093fd2ff15e618d816d7e33cb8bc28d2e2299533e5df0bd78d6","src/io/blocking.rs":"88c5bcd7c0775042e05df253aba119be6de47e539d819e646b093bf962ed0aa3","src/io/bsd/poll_aio.rs":"77226bf0f4423d6fbbebc28728027f6507bed5422d6667fdb3134dd822354796","src/io/interest.rs":"a359b014993e626ff47a797484472b2faeab4c0a6ddf1a5ea40c6fcc0d3c38a8","src/io/join.rs":"2ec664be19e60ae028ef34c0804079333f9213ca15ed1a0e88fcaaba0ebe0090","src/io/mod.rs":"8d1ccca67ab115d8da7fbe326d7d822fbefcef9a694f678c0cb601a130d72b95","src/io/poll_evented.rs":"7fe57671d56add4ec598c5165ea3cabe42304b48168c88d541d86097f0d0dcf1","src/io/read_buf.rs":"14f82f701d5056d1d5581c70aec98f7c6d287899df45e4b2e82388e7c97cca57","src/io/ready.rs":"85fc7a192552607acf6623e1f083b4e12447067bfa57fd667fb2c6e9fce7a4d8","src/io/seek.rs":"e9e346fc926c3360601b80a8319a25fd0567dd6f77fab666694e9787deaef633","src/io/split.rs":"5b1be9d1bfae72e483d02fc3b341ff13829c1fa67b9d7ec1481769aae91ed27c","src/io/stderr.rs":"6490414b47ea05a7dfd0001f864f9cd6dd236f70d8ae9acdac5d3590b2b04495","src/io/stdin.rs":"7c734283ca48e13db2bc4185c5f4ad811b497094598e3c0226a85f46ecbdd843","src/io/stdio_common.rs":"29938a0ff60cd3efdae05844cbaa89032e535ace3c60aee9b181816295fdeed5","src/io/stdout.rs":"9121ce7c88e83659a1984dfce781e259d40fcd90b254f28dc03a452e7fe9cb92","src/io/util/async_buf_read_ext.rs":"34a97ea63bae2b973bc9953e6c5f77ca13d37260b3af0171b2af7fc827afe1c7","src/io/util/async_read_ext.rs":"2a6a4990b0f079f1ba5b09cc6ef7b3b4808712c0dea878dd032c4a2a5431757b","src/io/util/async_seek_ext.rs":"0535ec6139be7ea68becafc0d374aaf9d996ce9cbe5dca0b8e70b133a661c1ea","src/io/util/async_write_ext.rs":"68d9a21e05ded6d73f401e505e0661f5076ac623e93af9bd9138801d0bd8a6d9","src/io/util/buf_reader.rs":"82f68996a5daf8b7a871b73b7f17594e479108e896a47a8e9bd139b6863f0288","src/io/util/buf_stream.rs":"c2087f024e12c39355f301b67780e392ca4b227006eeea2e73a1a51ac9581e6f","src/io/util/buf_writer.rs":"28305339f3877436c4610326fec4bcb9a38f40804fd2c0aade902acf48ee3f52","src/io/util/chain.rs":"e0e9d41abe0d260c78b908cc53390d5796d296e76a470ebc73f5e7d7c220fd7a","src/io/util/copy.rs":"595c0a5264422e402c6c48a8e14e8da0d0ff0396148709b15c589e4ae8c885f6","src/io/util/copy_bidirectional.rs":"89a5fb3f77e9863c9496c02afc2613fce039f47a1b2322e6221dccda8323f80f","src/io/util/copy_buf.rs":"9d83771a6edcc6d0d32f066072e375634e21a13517968ec9b21a4edddbcc2605","src/io/util/empty.rs":"aa38c0858fe9c97384b63c9d952b7e6cb2c6c926360ac0bcaff2a4419ce2cd07","src/io/util/fill_buf.rs":"223725d828071e923f25d2d49a0f6e470c411a6d9ba225700f2dd8d5793601bb","src/io/util/flush.rs":"e3384731406fbbfd5745631b9c60bee706802fb1d0c94bfbb79c53fbf41e7a75","src/io/util/lines.rs":"1d9f9b99567111c911e72a4caa2abb19b277f2cdd0ca3268ac5ca6df5276259f","src/io/util/mem.rs":"0b4aed07c02a2225b688a167e6645023eb028b86afeee4bd4eed71294c1fb32f","src/io/util/mod.rs":"fd0eed6387bf892104aad58a6f1e7fe3c63b38127e03303509e52126c83f54e1","src/io/util/read.rs":"58988c3fbcf5ede633dc224d7df5a372495c4485757dec9bdbd825138bb7f5d4","src/io/util/read_buf.rs":"d507fa1b23eafd7d8af25722a9a0d38f19a0abed796dafed1c10da4ac4d54179","src/io/util/read_exact.rs":"c3f3e478deac3762aa0ab769f1b9def6678349770c65f70b41666c6509fbc987","src/io/util/read_int.rs":"49da230796335df584832cd7deb8370b4d1e0350d743046389a9d9ae17dbd94f","src/io/util/read_line.rs":"67c0a70d82dc5aa2ae6bb4a75699c3e04eb22cce3933f84eace542fb56c83b5a","src/io/util/read_to_end.rs":"3e28b65b04cf6d3da12c496a938ec498722af3be4952fa8b603230dfa90ed0c7","src/io/util/read_to_string.rs":"fafb5463b013cc8f76def3a505dbebd179afc95bde0e2ca9388e428265788924","src/io/util/read_until.rs":"d9a932dfb5ef3d0d5e8faa72a2b3b9d1765c85599f3bc77741f69e7fe9c0d037","src/io/util/repeat.rs":"ad8a30978868794c54dabff34ce2bd2cc4a90a06daa222a7aa10ffc8c90272b7","src/io/util/shutdown.rs":"dbf7e47a06b8cc436b9210ea185b92efd5e5359eb4469f678b75e888664a064b","src/io/util/sink.rs":"716f2733e67c6f84da70c162ec75a3a5b4367d9d02c37599a2c9c9c79ef69334","src/io/util/split.rs":"03a59adccda29608886e38a1f484fbd4d6a6019180c4cfa851372d250796aa5a","src/io/util/take.rs":"b8d992c7eba17da642bdbc36dc124c6167e33720165b08867b7503ff15c281e3","src/io/util/vec_with_initialized.rs":"f8673705967021b5a3cb819d672df89ec81eb5baabb48de7bb598d53352b62f8","src/io/util/write.rs":"20d14ee545ab1f67732915522e97808d1ddde13d151505c1289b596be519f7c8","src/io/util/write_all.rs":"906ff3fb24c6a979b104598f9a8229421bcaf2a4218c28069504b34a218241f6","src/io/util/write_all_buf.rs":"5911bf673ef89097938f4e2e38d9012865b28a0ce5ebb217ebe0e2507de6c1e3","src/io/util/write_buf.rs":"ab51d6174de24cbb729ce77dbaeea27e16059b8253e4830d8243ec5f08a08a8c","src/io/util/write_int.rs":"f321e69b0c7c01728b079e9fdeedb96c26475667e8b259d0c5f4a83d060990d1","src/io/util/write_vectored.rs":"7a335a9f796daa048fa9708dc44d32d2567b36461a6d88f07893eb31f304b69d","src/lib.rs":"851d5b87df88d016982aac1e8970c30c055841368a0cccf57e59e17d6f7afee6","src/loom/mocked.rs":"5b85e97fcee3be1b0443b5608c7fe909b040bac463c94b817ed6b42bfd8031c3","src/loom/mod.rs":"b14b9333a7a21bd125a4ae82f01e5ea9c9ed2f78d7d1ad49a13d9b176f1fe8ab","src/loom/std/atomic_u16.rs":"72b9f99ea1bb17573775e0b394fd4f956f76793237947f34122d9759beb4d9f9","src/loom/std/atomic_u32.rs":"b6b1f2f40ac54008141b74cf333a22f15329f3af9aa9699e81cf2ed5b927a0c1","src/loom/std/atomic_u64.rs":"dcc9507a2be40d89c10d7386e7bc2b27b2a946bb3509136fa6e9355d7ccf98f4","src/loom/std/atomic_u64_as_mutex.rs":"1a6b9f8417e968a78dcddd8c7c320c447b9f27d5f84245cae86c3ef68425c749","src/loom/std/atomic_u64_native.rs":"559e6fd21e678b904f5a905f2756a4a8e32ca68a8c7a9b4344af86979373cfa0","src/loom/std/atomic_u64_static_const_new.rs":"a1c0e7d2ea28904ae76227baa7da5da33b68257f4c1a7a456f8d3171529bd934","src/loom/std/atomic_u64_static_once_cell.rs":"92a25654dd8232f6c02c8ec58d4f706030db442fb2a5ba07f1aec09149559725","src/loom/std/atomic_usize.rs":"393135edba454efaa13c7d8a2950236b1334f0fb2e6148a564cfd679a8f6dfad","src/loom/std/barrier.rs":"1539e5773ad0ab1936e8a9a6cf5c20bc697915abde15b3e0898615194eb37fb0","src/loom/std/mod.rs":"22da677018c512c613226a991115c35cef6b02da6ce43fb9ce0530f3eacf2117","src/loom/std/mutex.rs":"ce413b7819207a93d93984811476b4902e39ad172e8dd87fc3376c2398c7044e","src/loom/std/parking_lot.rs":"16b82f1580b4cf5949a9cb9ebfa2c11d98d91f97b2b2f7b6f90a213dd736985b","src/loom/std/unsafe_cell.rs":"789497164c351a563293d82edb82180576471b92ee3aec77de1a92a47423e390","src/macros/addr_of.rs":"cbd020a07ffba2b1c608856081499645cf606cb45444dc53d94457381a94bc33","src/macros/cfg.rs":"e7ec63462a1ecad270942681a4f6dedccb7f775746e1f4265d25f747b1bfcebb","src/macros/join.rs":"076dbeed1cbbb292e39012d18c0d1c97848bce48c4609b23f327025989b34a8e","src/macros/loom.rs":"bee8a86b0b96697cc21e4b5e9f1a3403c1f9dbc8c4e591a2ea91f51c2469d3d0","src/macros/mod.rs":"913b1382779ceedbd13606e429f59b9c7ad929324f121452f47773c232c3303f","src/macros/pin.rs":"294e5644061e41801dcee5494b7334439e09af0b6219ce164090feb624864631","src/macros/ready.rs":"6efd4c866c4718c3a9a7b5564b435e2d13e9c1ae91fd98b1313d5e7c182942d6","src/macros/select.rs":"4d9588dd514cf9f25b8c3c76ab08ad141d8f7ed1acdd856c6418946edd08f055","src/macros/support.rs":"da976befe4ba4d29e96f0de24cafe6e1f7f97364274e240556a01f2af77314de","src/macros/thread_local.rs":"c03b4bd975825f89feb0a138aaa5e3413ee8dbd6959a3d25ebdef8780126464c","src/macros/trace.rs":"33befd4533a3b2b4b22e246033f2bea8930174a7da58adaa57dbf20931275bcd","src/macros/try_join.rs":"2a6df220508e9a7a7fa9ba35f62bb017f5afbb9ddd396578957a656f4bc3c743","src/net/addr.rs":"0ed3d72ef6679e3ad76c6830143713c611d357ca4ece88c3ee5ceb2787217224","src/net/lookup_host.rs":"c7a21d735225e316253d822f6b11a17107e6a8db004f947a54d8bc12ec782baf","src/net/mod.rs":"9ca8e3d453a686c78d39ba7d7b904bb97fb95556717a803f7eb5ba8db0c8033f","src/net/tcp/listener.rs":"1727b4358a5acfb6b0bd36cf53a4781f053e90bfd1019640685d5321d7b4dd60","src/net/tcp/mod.rs":"347182e4f0381896bf3b7ab578c4564f1730ae25a108076ec65b8e855683fbf6","src/net/tcp/socket.rs":"43133d6b80dff0dd1e356e9ba0f66dfb9568734559afd1166356c544a4029c73","src/net/tcp/split.rs":"75d1f6c4afa23397164a30c4409a73c8d3df022c780aa4f91fabfa90549cc606","src/net/tcp/split_owned.rs":"0c5a9f48e7e49c257c25e138f74c0c5d3402edf447a860cbfc1a36439d997295","src/net/tcp/stream.rs":"910495d4714f53e3c56a85fea35e9ffe4eeb3f8166ca1de9db123ca483403334","src/net/udp.rs":"010c217ee47cef7827c64b7a709816ba04d86322c60d1fb95e7b83458fdf4ed4","src/net/unix/datagram/mod.rs":"fc48924e5d1e551405b0708a2d122473cdafeeee802a5722f64b4cf41a1c01da","src/net/unix/datagram/socket.rs":"b340994b954bbd4d714a86e3a925ca60f43d7b28d40e5f2001b79268d6103462","src/net/unix/listener.rs":"50241aeb704b89b0a28e59c5e49795ce884d2376c81b9b7b6b9bd1fe90bd53cd","src/net/unix/mod.rs":"f87f6b67aa9bbc984e2cef7a4bcea65549b2f9016126d417facfdb59f171f1d8","src/net/unix/pipe.rs":"cb1faf285ae484fc38ffda007e02154acb6afe375e445e5595e6abc97e80140d","src/net/unix/socket.rs":"88bce80c004001e7297f7bb79bb1c2357ac01574b5d16a45c7ab0b2f5dfbb710","src/net/unix/socketaddr.rs":"66bf18321a81baeb394a7094567632b113e44e12d2643109b6a97c89d919bf3a","src/net/unix/split.rs":"3f0b9c74481a536920d8fa8109cfb8553307c6694139ad9bd60cacdf97e7688c","src/net/unix/split_owned.rs":"5eccba5c1d589af4e5b52d17410c2290c289db5583676cf016de93ccabdace9e","src/net/unix/stream.rs":"f4dc57514317593cc9daf641cea9f7450f72440a3543d1ad4c7d64473aa76279","src/net/unix/ucred.rs":"f246f0246560735f4735e3bc6dabc6cb4f347e6897cc12c168229f0eb5ae2c33","src/net/windows/mod.rs":"a1525f35c1acb92b15bec788a625b76acb42f9424f392074db697102ce79760d","src/net/windows/named_pipe.rs":"dfbc9e868f5def58463dd6044a6b664f0aa4d01d044f118ff78c919f9af941b8","src/process/kill.rs":"2f98bd1bd28ab37bedc34ab7b737760407ab5315420538acbd18da31d2662d94","src/process/mod.rs":"98493201338af621d0e328209d5fcc228e9cefc5dcec08c86bb96488a7592f6d","src/process/unix/mod.rs":"487ebf569301560e6ef48037ef26876673ff36b1453b5a0ee2eb9b0a560b647e","src/process/unix/orphan.rs":"57bd954838f9b044cbee983922aea3f79736504761436c7dda3135314c5ea600","src/process/unix/pidfd_reaper.rs":"536e52567a33ed423f156d112299964cba2a7e8e82f30880a8a9525f23b17e0c","src/process/unix/reap.rs":"62868319849b8482d8d927dcd00cc8a74b9af61fd47494b39bd41fe2f4dcf0b6","src/process/windows.rs":"7a47feef09bd00c701bacf6239dc146def081869d0ccaf4172220c9bcccb9bdc","src/runtime/blocking/mod.rs":"3a1e04d2fc5590c7c0a19c85ecbd893108f9a81b197162378c525133c3bbc7aa","src/runtime/blocking/pool.rs":"f01600c31c2ccd6d4a4c08d87cb83008c2981d048d398ef144eba057ea05f402","src/runtime/blocking/schedule.rs":"8768ca9cdefc1b765f8915cdda096f7e5596e12c8181a5d90ba4a6b6cadd36bf","src/runtime/blocking/shutdown.rs":"6eaf2a1418b885bcc1ce3f257b99382de9c16f848ed53d9e00dc97389bb6b816","src/runtime/blocking/task.rs":"08571bce8a99dd6296ba7099c1f6da8c832d13a8c43db22044c683470147d7d4","src/runtime/builder.rs":"c4342286d97a72f958ec6c35fe2b428cf667c8c680b98c6e19edc197bcca9b1b","src/runtime/config.rs":"0184fae982b428993a92e1651f5c0918fd2f62a1113b67dabc444304e700d1ad","src/runtime/context.rs":"cf0b5c191109fb695d2539f9501e25646cd4eb31263a53493881c49b88d88e7d","src/runtime/context/blocking.rs":"794f0d70c018c17618aefc7f4fabdacb883d649861b49fdc17cff67e77580689","src/runtime/context/current.rs":"977d1ca823c051c3e5004b05c8d460c79f6515d06934240a7ab46d26b8c11f2a","src/runtime/context/runtime.rs":"df7b8deca59426ac39d6950b518172ff7a7ef306c1681187a4d3b1f22168984d","src/runtime/context/runtime_mt.rs":"911b95f39dbed005a02fde0394bd74c02e14e5b9f5c98bf49511f6c68ac5dac8","src/runtime/context/scoped.rs":"16bfa1da16baa831cc926c41df869b99bfbc6d96cf39a04aa4914a9e4b19a2f0","src/runtime/coop.rs":"53fbdc277be98691d7a1fc82afd668dc33ddb3932430c39162fe360be3c85343","src/runtime/driver.rs":"944e2a878398d49c696386f40d224457f2fed6e5421ae0c69c8353aa60c30c1b","src/runtime/dump.rs":"de53e25c28c362cc8bd4f321d23a7c5c8a3956ed3a2ffa4acd4d62f6397ab9fd","src/runtime/handle.rs":"972587fdcaf2732b70422173fd4b0b38deb19f53ec010ae7b3b7a2c4666bd5e5","src/runtime/id.rs":"67c7a10d618e3fe12be58bb9ad40e2f269908e0e088db6c9139b2123f468289e","src/runtime/io/driver.rs":"84e40880461569ffd3babb74781a84b77a34c4cdd762bee0116acd2adf627406","src/runtime/io/driver/signal.rs":"2e53479e68f48bf39c8cce92f0d12422bf4c68d931e741aae8daed854cd3f6ac","src/runtime/io/metrics.rs":"e711c65da155ef73e567125c0c9db33b2f511982a0c0a6b4f3b37c2d87c791a6","src/runtime/io/mod.rs":"270fead37871b8ee185e2e6e7adccb564bc8f2a0a02d693657afa76748e8ad1d","src/runtime/io/registration.rs":"bc4166df0d5726f6eaa6e59c04479c56ee010c99184169933e206f88763239a2","src/runtime/io/registration_set.rs":"df44009a88c17b6a122ba6d2c8c5bde11af2222b3b8d0003a3d990990efcdde4","src/runtime/io/scheduled_io.rs":"a8a1a63797852a5952817274eeb81b592f6ca9657651df1e941972e852b56280","src/runtime/metrics/batch.rs":"68fd84f0ccf135b10e2ef44c71c481129ca608005751c76deeae820d81534f2b","src/runtime/metrics/histogram.rs":"1d85cc2e6e1ef02b2cc4f2c627d5405d603742b995dd3ff23909a3a2fbedc8bb","src/runtime/metrics/io.rs":"960f44573cd16e2ec43ed872f235ece09db9f4c87e217002ae0d180e20ce9838","src/runtime/metrics/mock.rs":"d18d2ebbea8e4e191ab3ee77e2604a49e1597d1f6e858a2500bfa7e438176e76","src/runtime/metrics/mod.rs":"6c690fffe34bac1267eb3dc0ed93481874795d2fd2fe9f495859fab0866fb814","src/runtime/metrics/runtime.rs":"b244501ae29d1b5adfeb201e28ea88261cd2104c8bc3e89867898acdeaad523f","src/runtime/metrics/scheduler.rs":"997ba0339af84ef878881fdb6f35d8f6b39dc81e8f0b5cafce94476d50675c91","src/runtime/metrics/worker.rs":"84725f923fa65825a74841f6b3df06e100a838da61942f1113814496f896cef4","src/runtime/mod.rs":"0038c56166dc4256be597a94343c8f57fd91f1881e23af3d0502df2ec398414a","src/runtime/park.rs":"f32a9752e9d7b11e38ad15e36faa6b82b2d3150e74ee40b7c1064d5da31b5730","src/runtime/process.rs":"b6bd15937ae2ab45ebd46cb06981244e8e5e75ea0c47e6d8d294a00ba9003f0e","src/runtime/runtime.rs":"c596d5ad40f781445a81a5c6e3e93c7a5f97605bdfe41caf7a9f4d9520fdc8bc","src/runtime/scheduler/block_in_place.rs":"38b87ad398cae4e48bfd2afd9e2e9a0af1ee34c379c781d749d38cfe5fe8bd29","src/runtime/scheduler/current_thread/mod.rs":"9f194a9e4b1ded60dcd60160fa345dd70c1bb7d1a43fc0b76f284b3fd63ace22","src/runtime/scheduler/defer.rs":"0441413021f8267253bf9bb69b8879d3e52738886215851749b9497fbb137df8","src/runtime/scheduler/inject.rs":"fea0cf9dba0e72efaea4671a1693fa5bc68aef376d9773407855551951810426","src/runtime/scheduler/inject/metrics.rs":"26ee4f9d34c9d670eb75ee8d02a6e268952a1ef698ab3213d71873a97ea2c851","src/runtime/scheduler/inject/pop.rs":"335b42278217a3020ec1419d070132f8f5a0ce832c504dc7806c42821848be83","src/runtime/scheduler/inject/rt_multi_thread.rs":"d31776b467009c63f7797fd8caf3a2b1a78023e96e41d1f49d01bc4bda65cc26","src/runtime/scheduler/inject/shared.rs":"6fdc9c11674c2e83c37721ac0c30f0e7d23f8af8e4c4a4ec5f18e276b80e05b2","src/runtime/scheduler/inject/synced.rs":"b69a737bcba7cd27c660081c57c03b3672502e2c358beece0d4d8c9815e8af92","src/runtime/scheduler/lock.rs":"2aa5a50067dcc79d66ca39d1e4982c28f55bdcec43ddd7bc91414de5f794019c","src/runtime/scheduler/mod.rs":"490de0ab477f35548cb17ba74ca5fbe9d67f7c0153a4a902b8364c28e3644498","src/runtime/scheduler/multi_thread/counters.rs":"e5a6a1a1d01a50890dabbeb7998c7b64a954ed94bbb7cf9505ff917ed63633f6","src/runtime/scheduler/multi_thread/handle.rs":"d10a984c2bd999c2d9ecd3e690052971cbc733cad4d77c808254decdf916f0ea","src/runtime/scheduler/multi_thread/handle/metrics.rs":"d5858d459700380a372821c2a5f03255f96e58e2fdfe8367e6cf355fb29c7b72","src/runtime/scheduler/multi_thread/handle/taskdump.rs":"20768dab2f9683ecb10849fd3a4a2862a0f9942fba97d6ac29c8bf5ba7017c62","src/runtime/scheduler/multi_thread/idle.rs":"c2be2afa82ddbbe36eb6e231c8a01cd7c233d9c6e197d2feae32200098e974e9","src/runtime/scheduler/multi_thread/mod.rs":"2fae4c9f66b57d15f63c485ee6ebe724f1d41de126e641418ed6ec40c8fb3e0a","src/runtime/scheduler/multi_thread/overflow.rs":"c70ff49356fa6948f9dc53a19014a5dbf7f6bf52d4c00d9c2e20b0d23b7b3bf0","src/runtime/scheduler/multi_thread/park.rs":"1e5bf3893d960f0ec5bb8ccbfe957f9a61ef570d0a23c02369ba4f0cfaf4c84a","src/runtime/scheduler/multi_thread/queue.rs":"f784530c8981f55c8bce160d9aa47bf68cd10f1e6b1358d679470478bda30e64","src/runtime/scheduler/multi_thread/stats.rs":"03f0a8905908270761452700eb24149b06568f393350b9bebe24b21bad2d1ac2","src/runtime/scheduler/multi_thread/trace.rs":"f8ac6b0db76c45057c0061908d5acd63eb1463c397984bfd9a80f4bbc2748f30","src/runtime/scheduler/multi_thread/trace_mock.rs":"3ce6a3d19b53b608cba34fda213e498691ed55ce4a542806f9080bd2dbdb054a","src/runtime/scheduler/multi_thread/worker.rs":"1195a14cd00163c4cf7b7f3f9724799505272546a75b994f3c727511bbbd713e","src/runtime/scheduler/multi_thread/worker/metrics.rs":"14e15c7315e1e1a6829b67beda6a858570b70eb9ecf9f0f3d7530881ff7799ea","src/runtime/scheduler/multi_thread/worker/taskdump.rs":"ea2bd932ef0a3b999fd8a16e15f9e7dfe8c30f3589569b7f7ab334a63ad3bede","src/runtime/scheduler/multi_thread/worker/taskdump_mock.rs":"f8664a755109ddc87f7ab82c4815cb12eb37c0bee3a1808907ac10534b9867c4","src/runtime/scheduler/multi_thread_alt/counters.rs":"6d65b0741d5ab6afaaf7ebe31419fdbb953752bd83fac679f2ffa897ccedde86","src/runtime/scheduler/multi_thread_alt/handle.rs":"282c992c4c483c0f4f9145c0548b383010fb26261479e8d7c12813bc2766756f","src/runtime/scheduler/multi_thread_alt/handle/metrics.rs":"d5858d459700380a372821c2a5f03255f96e58e2fdfe8367e6cf355fb29c7b72","src/runtime/scheduler/multi_thread_alt/handle/taskdump.rs":"20768dab2f9683ecb10849fd3a4a2862a0f9942fba97d6ac29c8bf5ba7017c62","src/runtime/scheduler/multi_thread_alt/idle.rs":"23b34e1fe1540ba9d501f79ca590a4ddf99ff6683abb5155f4f1a435ed5360fb","src/runtime/scheduler/multi_thread_alt/mod.rs":"fabc12c49c4121da7914c6bfe301c70dc36a942149dc82187e29c75a0b8782e9","src/runtime/scheduler/multi_thread_alt/overflow.rs":"c70ff49356fa6948f9dc53a19014a5dbf7f6bf52d4c00d9c2e20b0d23b7b3bf0","src/runtime/scheduler/multi_thread_alt/park.rs":"86aa7fb6f52b16237e9465fe572ff61c7aa13e5fe9654ce52dab435e23df9781","src/runtime/scheduler/multi_thread_alt/queue.rs":"e199789d4bb32ca1647f1e339ea625966583bb6a188566b920039403a8cab026","src/runtime/scheduler/multi_thread_alt/stats.rs":"0a5a914c3f42daf391fd2d2a322793f7e6e024607a9953488b0a2ef996ffc90e","src/runtime/scheduler/multi_thread_alt/trace.rs":"e54f7dcea7603c861e7afbfefe7441766f8fb3c0f5ed1bcfd76a3bf0b89ac692","src/runtime/scheduler/multi_thread_alt/trace_mock.rs":"3ce6a3d19b53b608cba34fda213e498691ed55ce4a542806f9080bd2dbdb054a","src/runtime/scheduler/multi_thread_alt/worker.rs":"f4462280ca3d65ec9cbad329ecb2e6a9a99bc062fb999515f3d126963d4d8e68","src/runtime/scheduler/multi_thread_alt/worker/metrics.rs":"14e15c7315e1e1a6829b67beda6a858570b70eb9ecf9f0f3d7530881ff7799ea","src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs":"9f1c93258038a3b32af9215ad7b1b54767b2d6dcb4ad503d90e5779225bcdf13","src/runtime/scheduler/multi_thread_alt/worker/taskdump_mock.rs":"f8664a755109ddc87f7ab82c4815cb12eb37c0bee3a1808907ac10534b9867c4","src/runtime/signal/mod.rs":"2292d907e87a730bae0b41d0b4b39ccae7489baa1cad5974abdbfc876d826067","src/runtime/task/abort.rs":"3755dcdb68670052a4f660b5a8271ce9f59cb81c152d6e3c851413992000d4aa","src/runtime/task/core.rs":"9d565ec4b6d0f7ddd54c0a4c9c05274aa380c55803251a2f27d6707153d12e49","src/runtime/task/error.rs":"71aacf9e7ae41fa07d97a4a6ba9aa408c931e74257e93e7d025283e98535e51e","src/runtime/task/harness.rs":"fb817270b5f75370aa44fea8ce3f9295647769f60d5a334a17f68e7fc4575310","src/runtime/task/id.rs":"934de35be760e460e2b2cd762d236ab839b5190f999e0739fdb946428a522e60","src/runtime/task/join.rs":"71d6f7e31d836b7412ee4bb2b39c28f6c4865e8401ade56bc437cffb0dc5eff9","src/runtime/task/list.rs":"ed450ad3134ec1bc648b727cdb5075364fb3f70b7f35781c4b2469d03a80e01c","src/runtime/task/mod.rs":"bd5948808aee1a07192471fb2aeb3eb91b578d3338b9699b5caa63d0b7209c00","src/runtime/task/raw.rs":"315b01ce90af46690474c8715a5f69458a1dd4f9a95d55d51f822777d050874d","src/runtime/task/state.rs":"9107fa0281b8563bd82b6b749ff7f40c473e1c10333fdd3a1c2d6a37d4e77549","src/runtime/task/trace/mod.rs":"3be8057bd4fffc3c6324664cffc30549a99907aef0f5b5dd23576f9339b3cd87","src/runtime/task/trace/symbol.rs":"bde671f445b351d388e5fcb80e8cb8be4424a4fac4b8ec3aee356eb86082b422","src/runtime/task/trace/tree.rs":"b8f9aa018147d539841e5716394086709fec6a8d0f95f6b2fc011ed131063dd6","src/runtime/task/waker.rs":"39fbfa7c33406aac935d2ff8d022af6d3f9619ac7edae62d24b1ca97268e6499","src/runtime/tests/inject.rs":"97b68f6c22f6861b2a1649a8f919bae3310d6fddeae107aee4dcbf00de526cdc","src/runtime/tests/loom_blocking.rs":"fb4bf871ae59cd567ae4a2cb568d7cba31ad92579bea17c598d273a3a749f74a","src/runtime/tests/loom_current_thread.rs":"f9a8b7e0d0b829eaee01d155005800c7a907ec7f92acdbc0678e9149aa95ce1d","src/runtime/tests/loom_current_thread/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_join_set.rs":"d6612a19c695907a8bb41b24df3b404cb521cae6f30226f2449dc32f18700b69","src/runtime/tests/loom_local.rs":"aea174d4d14a8a7b7d7f0f63fc6bf87319672adf0057bd19bc69bf0f60522bf8","src/runtime/tests/loom_multi_thread.rs":"6e45d9197e3ab26270cfc4c8c48f1fa3a0d508e7d8d4c0cecb3663a83fbe80eb","src/runtime/tests/loom_multi_thread/queue.rs":"54ae93457aaa96dafa25c683b13b8133994ead7eaa135539468868c94a2e623c","src/runtime/tests/loom_multi_thread/shutdown.rs":"2f48626eb0a4135d480aa5bf72e514c4abf39aa17711c96d3829f93c03758557","src/runtime/tests/loom_multi_thread/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_multi_thread_alt.rs":"8e06356844ef57004f0f9fa3ed4c596e6b173c01b9529022b252fd27bc3bc8a8","src/runtime/tests/loom_multi_thread_alt/queue.rs":"54ae93457aaa96dafa25c683b13b8133994ead7eaa135539468868c94a2e623c","src/runtime/tests/loom_multi_thread_alt/shutdown.rs":"2f48626eb0a4135d480aa5bf72e514c4abf39aa17711c96d3829f93c03758557","src/runtime/tests/loom_multi_thread_alt/yield_now.rs":"fac610e464660c196a35ce15a46c9ebf537d3f3475cfc633e58c76c25eb558fe","src/runtime/tests/loom_oneshot.rs":"cb0cb66e1014708a10a2236c2dbbac9441b6a6e36a49c419fa3a51af62b054ce","src/runtime/tests/mod.rs":"1d8d0b89fda125b00eaf782bc95fb1211d1d14b391b7089f08815ed8c41f7ebc","src/runtime/tests/queue.rs":"56ea2b3c8f3a1a01091c3e624259b03a57ab555e52ee77931ad9edaf5d6db329","src/runtime/tests/task.rs":"0498f74c0bcd553f79026372d3a9884ebd6f6fa3d99be02a66809465b1632a3a","src/runtime/tests/task_combinations.rs":"78779e18bbf781475ebafcc073a3597c8debe83405f643ff763ec4132ebab1d2","src/runtime/thread_id.rs":"ad85f1057b2c61838620f1323fa8a710e140bf448fb2aa1d9d1f87a7fad5f01d","src/runtime/time/entry.rs":"9fdae18399e0cb677690813ba35228b10a2079124ce9acf9a30a5f497fbe5aa2","src/runtime/time/handle.rs":"1ecbebdc070477d61b782b2f4d3a5b9b5cc06dbe447188f23eef3257fd16ea8b","src/runtime/time/mod.rs":"e1164ed6c41fe122c474b300e9e89a6d946fa7dced44c07e75934b5e906e7112","src/runtime/time/source.rs":"762f1558363a5170269403ac588d43ba234c4e09260d86e60161936dc34599ae","src/runtime/time/tests/mod.rs":"fd656b75bd4e7737b517b1e84949d84f5af72c8b52ee68777555c724bb1bf7cb","src/runtime/time/wheel/level.rs":"e3d4fa5bd5f169e5799f01448e90d22c24f97b9c91fb32daa044ca31cbda1a74","src/runtime/time/wheel/mod.rs":"1104133c6d50ea708c5733f7bf05b2ad1f027608a7495d18e649c9b97f31204c","src/signal/ctrl_c.rs":"9b2a47659fe106805036a664310040c07d98c061d7104270d9a641025cc875f0","src/signal/mod.rs":"8430cc6511d63565df3342069bd4d7abc1baa57a3ff394ee01a578dbcf99f03a","src/signal/registry.rs":"955bf70ee0de97f0c061f693cc319e7ba1db187e620b1e3a4ea1d9b7d48d86c5","src/signal/reusable_box.rs":"3d3b710b1794d9f8f5463e9ca380ece60c426b58786a5cb5f40add627da01aeb","src/signal/unix.rs":"938b8a7ccaa17acc789bac7fc8e2e3c0602a54e9a6efd2f801feeb4b46249707","src/signal/windows.rs":"316ed160bd4cce6b6249f1897836841bec829bfaa134d170b37b78f633872e73","src/signal/windows/stub.rs":"a6d3b11aa3a7247f7a8365c3241857bcde48d8c390d569e6bc9529c9b1f8ecd1","src/signal/windows/sys.rs":"3e4882762ac424cb3b3caf71d5a69f571fbe14e6b298889ccb227c58b213c257","src/sync/barrier.rs":"9ec4abbdd667f2d13f1cdbc6b2f1964e83f6d17991eb287f6cf5453952e19d2b","src/sync/batch_semaphore.rs":"e65a50b073eeec7614b608351f47035e0b7f851b62c6646f89b2b3b1e0b2c360","src/sync/broadcast.rs":"f465e140c8988266a67325304ba2e208e0fb5d6ba317cb64155ed879dfe9aa1f","src/sync/mod.rs":"080f05653cabfb3423b0c96d04581764f3c4f97d813b0d09151d2e346e160480","src/sync/mpsc/block.rs":"c10deca84b96374cc6ff49aa0ee59d8ab923134ee74bd3abc514c6330be16c1a","src/sync/mpsc/bounded.rs":"afac3f7658f2d87ae55bca0ce25261d09d9a196aea8c54841bf511a9a4891720","src/sync/mpsc/chan.rs":"077116b7e24d8a2f583ea2aa0af2f11f7d8dbf33e7b9c2f2ac6ad4237a5875c3","src/sync/mpsc/error.rs":"d95c1f5ef322fb894ea23bc6b9ef86d42d5e8cf6c6916d58ead67e3b61142a05","src/sync/mpsc/list.rs":"70c3dec2b251b20e64ba9bd7f3ae2d74c1f5b173885f5e8dcb80059e6cc69700","src/sync/mpsc/mod.rs":"648279d5d7b152acc675a3c69494e0be7d1206f11d6d2ba58ea1cb5be6d27d82","src/sync/mpsc/unbounded.rs":"9ff9139e103a70b38217cae1835194b402f77988eef77fbb7708ba295ffa4c1d","src/sync/mutex.rs":"ec8b6ac54e1f788b2dc0e1d073366595723f004782fcf5043372f6cba16f8b7e","src/sync/notify.rs":"ae51b1244dfb6fac0825c3f446d2441e75b07e24d43f6db4c1be107764ecf8a3","src/sync/once_cell.rs":"45549067ea02478c8452bf55d9dc699a41b33339804cab1e7f8f981df0220f5e","src/sync/oneshot.rs":"5bf608e10fc240f91989be27316a54c7986e1290cb3795bf60f8b6cf319647a2","src/sync/rwlock.rs":"e3646c226a3bd968447f7a455c922cf632e4944b28d46deb7abc3b9cf51e649a","src/sync/rwlock/owned_read_guard.rs":"135d81271f0028263ce99c3246cd335a08912b50a43f125b3e8f7739ca353cfb","src/sync/rwlock/owned_write_guard.rs":"ef56443fac210bc3d0c2b66beda8436154c2ab726f1dc208758b54b2b087762d","src/sync/rwlock/owned_write_guard_mapped.rs":"3038187dc3a791a89505621230d3edd8629287ec11490ff37f2c624b593c5325","src/sync/rwlock/read_guard.rs":"0f7e52adacad0fb1529a453eb14f8207a8caabd8f5fca4aeb2031a9e9b0981f1","src/sync/rwlock/write_guard.rs":"f3855cdd09940c86a9bd10b91d3ebb37b2219b60c727a3bed377404ef2483c35","src/sync/rwlock/write_guard_mapped.rs":"8c839c4ac4b73faa1c1fc697753e23fce113ba6e576d2abc022ddadb98a34af4","src/sync/semaphore.rs":"ec5f47eecc0d953d7291349ffe05d2a7043db206b467df9ef596630eb255898a","src/sync/task/atomic_waker.rs":"1e93bee50e2a8c2156246f312e3ab5d610037071b8f91452e2386e1ab9e1a20d","src/sync/task/mod.rs":"f5e38105c7f8a942c0e49b973bad0a8c2a1df81deea19f3c5228edc4896c1725","src/sync/tests/atomic_waker.rs":"f44940a14a294cf21f1d1362036b02eada710d5f07c9e2f7ed1b78ae647af553","src/sync/tests/loom_atomic_waker.rs":"984b52699c47383b9b62e6c4ff93fd458bbe64cb4ca836463adbaf94d27c38ee","src/sync/tests/loom_broadcast.rs":"b2c6f138707fc389ee7d91109bc38093af9060b3465e68d3543cb652e0070406","src/sync/tests/loom_list.rs":"54321d0a1a21e65ddd7e958b751480bb35b93d9d4ca11a218043e684e0d6bfff","src/sync/tests/loom_mpsc.rs":"4883352b9d75a81c878609613545ae14910eca4f2e7f3718053dfdb792aa0760","src/sync/tests/loom_notify.rs":"cd401c73084df551043b7d96b9f2c51e9c1929a9038eb899381bd4ecafe04ec8","src/sync/tests/loom_oneshot.rs":"c3596c15692b16e7cb8cd6957362adb3a98b3d7f16c4a4262f19a3a27f262b03","src/sync/tests/loom_rwlock.rs":"80ec00bdcac838806d4d9f711cb154e02f22913ba68711855c39ca92028d3e4e","src/sync/tests/loom_semaphore_batch.rs":"c6f69b8d5b2e6842287ed34638a9045095d9f94c86ba6bb84c1224bbe10026ff","src/sync/tests/loom_watch.rs":"d451c914e94c5a672abec3232e58aff6218581f0c0b1802434ddbe771b1be6a1","src/sync/tests/mod.rs":"1ef2026ac3dfbb70a437b8be441deca4b7b5e72638b71daf753b89808cd3c9ee","src/sync/tests/notify.rs":"23600377d3eb041c2dcb3702b63109475302b22827c30e90c1e8754a18f306cb","src/sync/tests/semaphore_batch.rs":"1f928cefc34b332d0b7c86a3b4d29d2b9ea37ba57dcf5eabc7bb62138f4a51e6","src/sync/watch.rs":"e46e80b054364a8abeab4b26a3e1a1c99b55a47c63f48fc2a37095bd90cb75cc","src/task/blocking.rs":"96ad214e99e2120a05c938f61c2bcfd0ac8bd20619dda12d93318d4f0ab7f41c","src/task/builder.rs":"6704158d8adb0e1a1a2b1b66548fb295c6c1e32b7387e6f3c9c6ebde9a0c084c","src/task/consume_budget.rs":"f1000b9628938a5964f70793506f51579849284a4acb10d5e9c70080c5caea47","src/task/join_set.rs":"7c5d785bb76790171507b80a23cdf3d28c242dc9273576b4c948973cef397406","src/task/local.rs":"60ec3d58ba33580c7cc20ab48419345fc6cc0bf3b733acedb6a52e01f8b3ad59","src/task/mod.rs":"4e4ea5e9e9b1a9183e21c65c31f141b06fbd30506cca3f1c7b3bb7243b41c0fc","src/task/spawn.rs":"e86d2ef3615955c35423dca8b3af9e3eadc5cc3e641916354500128680172e43","src/task/task_local.rs":"c5c0aacba358da219057c67e9040030b5171ed384b5135d3a56027376a24379a","src/task/unconstrained.rs":"8e75239ae694f296136fbacadb232ae0a255b0b2013e1eb0390bfbb82af36692","src/task/yield_now.rs":"b0f6a01df2cb47292fd202ecf685f591ffcc397c48fd9e2879bae381eaf894a8","src/time/clock.rs":"885dad6d0c72a78a6e16fbe3d32804c3014e0bf7a1823f5f9207e0ed89143a08","src/time/error.rs":"dad4d124c6102e21d589e5d022a4fe99a00eb68c5980c755cba3cc5d043110ac","src/time/instant.rs":"164ee00dabfa6bb9fe4c9854f937ee92ae454eeaaeaa7a447e09434ea95bf722","src/time/interval.rs":"5e27d820464ef6acf3abbcd76e4ada56838bf7567218d5ecfa56323cb0db3333","src/time/mod.rs":"c790bbe9356ceb56fd20e762c9002906aa4eee1d1d297fa0c520130f72d3be3a","src/time/sleep.rs":"efe8acc41a198bef1a8232af502856c3bc9354bf340f550dfd0af4fcdb488cbf","src/time/timeout.rs":"67f5396cad468dac3381b323734739914052a0f72c3df018eeab14a855f6c8d8","src/util/atomic_cell.rs":"b1a2a0b1c0f891cd1064ac19004a2c20e5a5b2693dce3d84af7304796d049ecb","src/util/bit.rs":"a5c16c671e58ac19a46621efa3cb02eac21fdebfbf97529fc0f2aa708250f738","src/util/cacheline.rs":"204079442ea5db45488f327a48a3ef13a93702c8f77640511e5ed4398dca4390","src/util/error.rs":"de1a0d662e9359da3e19739125b1450f571abadf30e34f50f085b23d8da28d80","src/util/idle_notified_set.rs":"941983f6e8db72ea7a50e400c500e1e5cc85a07dc1a540af525b054cf17091bf","src/util/linked_list.rs":"b4e7f78b9ff2637391bee2d13608874d6ec77b268eff38c1d4730c38caf5a257","src/util/markers.rs":"fb9b674d9a48c97b411db8a3264fa2781026a0eafa74cf276cd47d8ad62cbf02","src/util/memchr.rs":"8cb5e0a0da9b7d94d29a994dd4e725e547ce31f87b5bf24a1a9b53b0ae65cc08","src/util/mod.rs":"21c100fcbcb25354169c1c8ecef1ef71844eae4c183b9ec4f5354b865fc394a7","src/util/once_cell.rs":"bafbbff82e595a0b8f41f3d5273dcfcacd282c51a24f14666105391a456c5db7","src/util/rand.rs":"d37c69d14920db88778aab1bb53805b6e8431454c6a4689207fea0348b23f990","src/util/rand/rt.rs":"9790a2b6d822edbffde723f38b75ded408dba6954d711f285bd17924322b246b","src/util/rand/rt_unstable.rs":"bdb69915fe12a9e0b8f2ab4d72466663b7a3e87e671343a0a623028690f4e452","src/util/rc_cell.rs":"362a7a7b776389688299628a4678378fa02f88fbc6ed7f9fe006054d9b62643a","src/util/sharded_list.rs":"5336c71f97e2fb291e0e9bcb6bad82a6c0e921c9969eef6e6bb56a0f77cd711c","src/util/sync_wrapper.rs":"8f1ab76280171c33c0bafaec9c1cb1d48cfb0d19a1ab2b768cdf7d7e40f07d00","src/util/trace.rs":"508633a89447d0f9a2a1f1f149e255ea50c55a5c790133dd1bd34363d4b0f775","src/util/try_lock.rs":"c4ee49e1751ee0a7df1a8cbd4f8d36ea1d7355e3ac584fdb8697a94cd7a7a8f8","src/util/wake.rs":"4bc0560915862a61b2fb2fcda0bc27b08b1012195b87a35dff801ffc5f8d63d4","src/util/wake_list.rs":"12b3ff862468fdbb8c60ea536d86e6578936df87d7cb734999737307a5c3bdd3","tests/_require_full.rs":"1f58c8125018bd88b9f21647cee3d957b716bcce70f9144af1de58ee6712908f","tests/async_send_sync.rs":"69166867e7a32f5a6f44a4d7f69ae22063fa08f2d77a1ddcb760e0cb1006c014","tests/buffered.rs":"ad2fc9e69437dc8815888286e2ef457215e770b5da13b1e6123559bd18f7199c","tests/coop_budget.rs":"865b1b84f9741469a7df8e3b511f74496e4546cc8122eb468e581b12729390e3","tests/dump.rs":"9dea7e8b5cdfee4450e22ad9b27c35b2229ff42bd2dec8f98e307ff48b19ebed","tests/duplex_stream.rs":"680a6052e9a7ab6c0684f17f922243c24691dfe9e83dd099217d439b61d50838","tests/fs.rs":"e2d21101b603216c65df87259cf604f3832b8ed4d39a81aa3a3e90972611a700","tests/fs_canonicalize_dir.rs":"f08d79322e814eeb09fc6548d1a7daf301322a5397b3283360daa31470e90e16","tests/fs_copy.rs":"c71fbf6780d3b484940a590992901127670a4a27ebfb75a0cb92d17ef9e6f860","tests/fs_dir.rs":"4f29f2979a869ed12498cd9c5a2869b02d94ccea8c1a845cf9587d6c7bd0476d","tests/fs_file.rs":"e05bc4f2d49ebd77d96be87b79fca05cda9bb5a5ce209cff18b8d6bb51a23d17","tests/fs_link.rs":"52da287ce88ac500b3e46b5a00549d56044c75b908a7771b63c29b2de2f95828","tests/fs_open_options.rs":"f13c92227bbf089850f018f8b3ed5b527c4ef32d5305dc1bd751122abb30ebf1","tests/fs_open_options_windows.rs":"eae02a644078164bab7bd1c1a5a2ebc85f90adb110c955eb4bf01a34e9321aac","tests/fs_remove_dir_all.rs":"463ada6fbd6455070eec5d84684d76dbe9a245c82698b6e2264674ea0343cc5e","tests/fs_remove_file.rs":"614e41551c81276b7f700ac3b6a31bdc426772c881033d822cfc3759a3468a93","tests/fs_rename.rs":"c5397d389b2aefef31e2f4bc5f7e4b4a2c9c1e3109945de9f93dffc98bf0ae00","tests/fs_symlink_dir_windows.rs":"bec061561203ccdce24a0f5754690fe4d38030036055a667f46b6f452a9d31ec","tests/fs_symlink_file_windows.rs":"02ba203872a6ddd20c8e65471d77d544d85d6dfb4fd572b3f7782d73be01aafe","tests/fs_try_exists.rs":"198e5b1d81c140307ddff8deee3a79ecec044d61b2225139da3c38b2fa1e1b9a","tests/io_async_fd.rs":"349327a392634c86bb7e067f40183752f7eddac4ae4a21d95da59cfceac87e33","tests/io_async_read.rs":"a590efe9bb01986f067118640a3b55f6760186e554f8e8f2404231d4e96f61b9","tests/io_buf_reader.rs":"f5a322dea6fe9f40c18a085a865919c1bbfe8653203b37d1e18b77d259c6211d","tests/io_buf_writer.rs":"3bdabe9ac26f3189929ab3e8957150f5262d5b426fd3cb6c4761a45014b1c1fa","tests/io_chain.rs":"f5d3ddc9f6e8152ceb08b5dda2ca3168b174f1f67ff28a4c5983bcbad69d8af6","tests/io_copy.rs":"c7d7b2bd562c710932fe861d9610c5d73a98950e62aeae77cc2d35d8800c427c","tests/io_copy_bidirectional.rs":"334201f5e0e55260a02d822a6c0b27a16d40e603706dcb53dab8ee9f4feb3578","tests/io_driver.rs":"887d25bbab98334fad891c8f8ff2cb7aec0f10d01e2993cdd0cbc4c6e406df88","tests/io_driver_drop.rs":"a0126f26fdc2693129f6941a897b5648bf9593123de355119d2e38683b15f1cc","tests/io_fill_buf.rs":"930ce8ab5562c2013f4a75cdf717e41a7f8f3cbad6bae7bde68f0cfa3f2fd80a","tests/io_join.rs":"86d6c3c500cbb62c02447fd30661b97069f7c3f1ee4d9b9dc79a9b4428ce36b3","tests/io_lines.rs":"f5b1599ffff44819e269519ff0a08635ea1c5d7c541293e63ee33d98f25f0e3b","tests/io_mem_stream.rs":"7b20d86c02c8a868cfa3aa4d228519090d156fdd9a8a19a3be263f264fc9d33c","tests/io_panic.rs":"d80021ec4cda7b1ba984b23e2b4ce1000af8e7d10fb8b6c84b6569adb7830156","tests/io_poll_aio.rs":"3a227442af88ce5b47cf5927130480aa703a119d10c3fa769e37cec02e014de9","tests/io_read.rs":"c0ed5738a4b2d9623b2e0a67cab0fb19bc50015f62ced524b5d9069c57e10f05","tests/io_read_buf.rs":"6dc454751af0e9cccb44fdfb12b9f0311fa8afa482886aa56e3e15d49ae1e06c","tests/io_read_exact.rs":"b6387dbeb0baceb7a1f74a9a3a8b4a654894465368be27c3bbf4352b79fc4314","tests/io_read_line.rs":"8296624b4f5e162c79024f3beab2f561f4195a244cfd4c53e4d06282f56a31bf","tests/io_read_to_end.rs":"722e2922a40080d391a83b4903f47823779740090624a98ac30e9f164b20a3bb","tests/io_read_to_string.rs":"c9ebfee5cb262d822119c2881ea1cc0c73598b13c517c297663e35bb120a089d","tests/io_read_until.rs":"b6c0df9e4852766910ec68affcd92fbfbc280018b7f9c16cf5f4830f9b8389f0","tests/io_repeat.rs":"df6ddfbb8310a8b53bcb872f34bf3d066808e515b8b22356de251b900b91f602","tests/io_sink.rs":"98d78179d21101c365f15f19fc0690651712438b0997c63eb932b94dd6200eae","tests/io_split.rs":"fcd232f797503596b2f8a6b0c4fe6df146108456a670f7f101e4c4eeed52fffb","tests/io_take.rs":"06e91faae76440228df71383650f86752e7b749b193f1729071a7e8fc516e01b","tests/io_util_empty.rs":"32dff601a78e46e12339bf1577463c7ce1070d71d78a2fb33318112a111dc120","tests/io_write.rs":"98668a8c8feae0f85714df1dfecfcd94fba4ba347bdc3d8aaa4ea8b175055c69","tests/io_write_all.rs":"e171af1ecab45a439b384c3bae7198959c3f5e2e998967dbd9296760b52951b7","tests/io_write_all_buf.rs":"2c037f07ac464eaa4e0b87e4e4968b28a0f2f1b1d1e218546c9d5dac7a75d145","tests/io_write_buf.rs":"331d3b54c7664386bb87585f39910d1fe31bfbdfa012a2dc2120e535dcdac329","tests/io_write_int.rs":"3f4b50345f7d7d558e71ac7f2a8c1c4b7b771dad09fe2e1fbf9a17d4fb93c001","tests/join_handle_panic.rs":"3cfa1437f51802ebeea8ac9bf2f5793d3e6bf2057d1878611af02ef2f236cc12","tests/macros_join.rs":"4411683c1fe79419457e758650ce89ed76f28041a890cd05db9143034b63719c","tests/macros_pin.rs":"f8fe8ade470196dc09b061b0cdd71ef25e114a201d5eb500e0f8232b436012cb","tests/macros_rename_test.rs":"94715e8014bc4c67cebe830f3d800c4cb0937bc6245de4b5410e5729bb2c7f9a","tests/macros_select.rs":"7f5ad6e104c95a30b465aafae1211384c07228c61d15f64efb4cfe55111bbc22","tests/macros_test.rs":"a1da1f8db387213b97adb0b68e64b30d3538b77dc378d22b8c863e582c69bd12","tests/macros_try_join.rs":"8e4210a51bd4db24cefa6d6f5dfdd7ebc743ac018b448a55a1e2960a09fa3b2d","tests/net_bind_resource.rs":"ba0dcc301ee170fba82cbbfbf0172b665b9914c0004270d8a420d5cd948eda84","tests/net_lookup_host.rs":"69831a012b36346e25c3ffe0dee2dc31d0faeb294a9deadb46118c2561b617b2","tests/net_named_pipe.rs":"f7998290a77e4e9b27e3a64165fab2de4edbd5ceb46091178bcbb4a3c873d925","tests/net_panic.rs":"aef4333efd168a9f73dfbcdb35f565cffa9a9d4b34103d56a15c3da9369f9d27","tests/net_unix_pipe.rs":"5cc4a1f60072c1e4858454a3640405ae9f00faad1a5e94e4aed6d413ffb30513","tests/no_rt.rs":"7ff583bbcd848d2721088dbfc45d0d70f978f8101275cc9bd220ac6d392f17d6","tests/process_arg0.rs":"785d801cf281230e3208512820e7d71b4d8362b8cf33fc72235da370e10983a8","tests/process_change_of_runtime.rs":"52eb29999cd4937dfe3090d75fdb5bfc9b9652a506fbfb661530bb81fc80011d","tests/process_issue_2174.rs":"052843034083549764bc4401f06f692962878d6a9f462cef482dd2c1b7692e68","tests/process_issue_42.rs":"26043f8246b00046137551f7a9f638652c70f527f10b4d91e4286643120ca41d","tests/process_kill_on_drop.rs":"9b4bf8a73769fb268ef3687141e8df6122814855d3bbc4e63295c66b0ee6cff7","tests/process_raw_handle.rs":"aaf0dc242ce69f1a8c614e04515c41584f7e213f84ebf23238521eb881e0a6de","tests/process_smoke.rs":"4b55f2aa526b773be55e718abd54ab23851848c4cb28274af587d3bc8ab48f75","tests/rt_basic.rs":"20f78629acf1cf04d6a3bd17edc78348abe6b76065874888ada5fd229cd92575","tests/rt_common.rs":"b5eb69a3b90d51e024f80c0067bb07aa56d5d46a4f54d3c0d87207f21a9d386e","tests/rt_handle.rs":"bbd70fc57d317fae5c5422f7d459c1a27bcf6fd857a468f4105a745b3867cbad","tests/rt_handle_block_on.rs":"dba2e23acfca2cec81fdc83ca153c087144ceeec43f9fc4f0e23f428336d5f4a","tests/rt_metrics.rs":"81594015e10faf05a97b6ecc2a8fc748682322ae9574621f556ae07edb75b313","tests/rt_panic.rs":"f70887e3590119d5b75218848fca8b91cde5609e4a32225fd3b308ee0817033c","tests/rt_threaded.rs":"1c56f40ee5e0ec7da0a8e546d91535f59e7cd7d035f8c7408530b6d74b0392b0","tests/rt_threaded_alt.rs":"eaf1fc504ad333c74ffde01475c1a087e1f566ec1bc840427ce09c83d1037a76","tests/rt_time_start_paused.rs":"7f19f066e32815d540175b61791d8dc97718a368ec51ff24605c9e42d7e2b807","tests/signal_ctrl_c.rs":"9b53065781b37f3db5f7c67938239b0f3b0ebbc5938c14a5b730ad7ec07415d2","tests/signal_drop_recv.rs":"d1ec97213d9c6fd9fb25ea8c2b015c9e9ee1a62fe0853fc558bc8801e5a3a841","tests/signal_drop_rt.rs":"f968c1154262a4427b5aad2d9fb36d3b7d47084312d0b5527a8eb3d589381d8b","tests/signal_drop_signal.rs":"041940550863250f359630dc67ef133874d809ddaf0a6c1238cee1565a19efec","tests/signal_multi_rt.rs":"a1c50c25f4707fda7665da61b3317dd61fc32c63c61db2bbdb56065bd9c591ce","tests/signal_no_rt.rs":"6978c2ca34a0244fd312d760ad416d961e7e27681e4bb936dfd583aefe6aaf1a","tests/signal_notify_both.rs":"bf0b9def20f530d146ee865305833d8e9bee07a0515e66573d7ff30e2c631123","tests/signal_panic.rs":"5bd4bbf5a88e553e4b2d622307d94d14c7c3293934fadf00e3135d0eb1eeb74f","tests/signal_twice.rs":"bce33093eed151955d13c334d6d8a5bc5ca67cf5b37c246e435a24c15bc166a0","tests/signal_usr1.rs":"86ad07594b09d35e71011d1e12a1fa2c477bfbc4a2a36df1421b6594a0930074","tests/support/io_vec.rs":"9b3001e120138ead4a63720019c669ff00f8455a74dea2fb231633b3b58c9b09","tests/support/leaked_buffers.rs":"85ddbce3ff6b0c5cc8cb30449dd37e5bfedc94f8357e741ec88ff04462bc60c3","tests/support/mpsc_stream.rs":"00d48122fa2ccbf1fe0b110ce3cf22590eda54b3ddec0134b1f9376eb1169645","tests/support/panic.rs":"7bcaf8ea2d249b5c1acb3c1b769cbe479834630dc71b3ce1114b8b46277f44da","tests/support/signal.rs":"83531afa2e8e71cfd90cd4e1fc821490ffa824f0f9f0c9c4a027c08fed6b8712","tests/sync_barrier.rs":"f166e526d12f840de404ef58a375e475dc7434292b2f23d557214749d0e6c372","tests/sync_broadcast.rs":"ce41987e3c5b7856684608528a2db19806073e41bf9a6a341f0a8c6ec4bbc4b8","tests/sync_errors.rs":"7a49ec77f4c967b3c76c946789f43c51e0a820a67e947ed42e30ef65ec9242e9","tests/sync_mpsc.rs":"ac8592e5e116bd9ffaea3c291885cb901beca3bdfe29cbf5e9bcfee35aacab20","tests/sync_mpsc_weak.rs":"5b8335b663cfccae9a08fcec4a3a73a890abd36d2f58adbd845d4745af4fafaa","tests/sync_mutex.rs":"432591e4893b4c64a58116463b6c16a2eb23fd42eee42af96d93b9d03728608a","tests/sync_mutex_owned.rs":"2664c35f66161825cf8e0ca863347735cf4d1252a208577e5084dc1935a18596","tests/sync_notify.rs":"9786acc38aecc651704b5e5b194c3a45a06a3ea032464145a5f17af2062399bf","tests/sync_once_cell.rs":"d4a792f554acbfcd66f2c794cda44f180a330d8bc488823af984196fe2c91d74","tests/sync_oneshot.rs":"6e3542ed15fc8e08bb422e0ad001cb422035c06305511b156e9645f2322abe4c","tests/sync_panic.rs":"ddb1636b9a7374ca521d1a1c449c3f7f89ad48d321e6e9c56f1f3f72382cce72","tests/sync_rwlock.rs":"47094f85a9d6db9d3011d09f8db014f692cdc3239449bbf2d54575c4923e8dc5","tests/sync_semaphore.rs":"63a61b02ac674cee92e963a2e92f058fdda22dd95f05a087136524042bb8bc8f","tests/sync_semaphore_owned.rs":"5688e32fb6f9d6ad95dc6859fb5c5682e4e75e59dab9d2f0c02b9360d455e4d2","tests/sync_watch.rs":"2705c9ee38e78332e4f09ad8dce2487beeeef596d3d5e5b89fb20b2ef13580d7","tests/task_abort.rs":"55d30e73fd237e226a7b3027a71967654a7374cad92bc248afe056c4e70d56da","tests/task_blocking.rs":"22fe313b6872687f6170c0a052c294d1aa4fe7f5b84b145bd243ac6cca1d7fda","tests/task_builder.rs":"784830b868e9fd7b0d9413cbd7719eea7606c62dffaaf59986ed3e7902e9a3e5","tests/task_id.rs":"9833f86821fd57d16758ff3d840cd56fa1f9282fe074405ddd28a29357998d70","tests/task_join_set.rs":"302ab1f5b6d949b430dc1af59dbc7f5b0fa279d85bb454876e8c5babe16ffe3e","tests/task_local.rs":"e0313e6bdcd230df0012615e11716882f361256ebe565283b4ab366090a0142a","tests/task_local_set.rs":"4964c6e88889f5a7107ab06632dd0679192d1e42a38f85f6342a2af955d35a67","tests/task_panic.rs":"733d26ba7fe392ee0dcebb78eccb6c83ef566af0acc958558423e6c994fb77fd","tests/task_yield_now.rs":"dbd0f342129b2d06edc0daee360731e5adcb2e3a19f8d658a2cb510490d7fa25","tests/tcp_accept.rs":"e25e52fe4087638b05fc74e1be5311e015a723043d4de7b8e8867ae4bb999f9d","tests/tcp_connect.rs":"03abbf5cb0e163de534feeafb8498357231bfb3a38844e20a5e459d241dd204f","tests/tcp_echo.rs":"7dce84fa8c5ad0014846c3d0eaec1df8ad779fdfcc44441d068e32b408ba3716","tests/tcp_into_split.rs":"21bd670969e62f2d66c29c0ba37f37f8bd82837ac6f911b9cc23ccb1101d5d88","tests/tcp_into_std.rs":"b2daa51b870dfb83c72958ed900ba863578e7d6c9339a591e97612a5f4d670b9","tests/tcp_peek.rs":"aeecf794f845e5396df9901780089289e285c10b65b9fd9a8ece669e808d535e","tests/tcp_shutdown.rs":"82eec393777a05f4a6ebe460e74d1dbab6b80d55b1289573932a891677c345f7","tests/tcp_socket.rs":"185f1a0121f5f22d9ccb5969fd36e64d12c563efd2d1964e2becbd73128677d9","tests/tcp_split.rs":"5210f66e120f90f6c5110b28859cb1582713885f2986ebf1600c6321095e85f0","tests/tcp_stream.rs":"08c0986f8ded0a517df2935eb6f76d31456ef699082d7dc140260bbc8f91c9d0","tests/test_clock.rs":"d5c9bf7bb5d926e2b29b43e47b5bb051b0f761bfe44d5fef349ed442ea7b416f","tests/time_interval.rs":"1a7d364332bf6ba8bc3cd19b2b0a79d08348a3969aefd8a5039d959bdcbb3436","tests/time_panic.rs":"6df845dbe6b9647980ea834a216db8291a19b95b6a443b5a5cee0a8b5c10c927","tests/time_pause.rs":"804c1ff5cc2a76c8bd406fb0ef3db35f8fa0d8e6ad8e55fda80ed07fb6ec7cce","tests/time_rt.rs":"7467d08a4d681eba4d2207e8254e8f5cbf3755c0dbd40e9bea51e6838993b11e","tests/time_sleep.rs":"69bfed71e9b9e174fa447d36406666ea91c01994c9a700f82d0a0ae0b9bf8b73","tests/time_timeout.rs":"31d4955a4009b24aa0a506335607b6aa0e6b21cbc533650739642c4334b888d9","tests/udp.rs":"153ab04ca9d14b63967fea25e46855959931aa786bb375f1c39bcb36cc9d8c66","tests/uds_cred.rs":"146c6e9bdbb82a268f178b03575f94a40db81ef67a740dd16ead5b9e4a447f1b","tests/uds_datagram.rs":"f8d886adc6c3947960991392cd8540a0b4a7f7b0110a24d10805237b385b49f0","tests/uds_socket.rs":"da779fb0f2a3811f9e8514f9e151967ccc426a2d1d11ab14db85677d03f8a04c","tests/uds_split.rs":"79d54d6ce35e5d15138299091871ecbdb6492ae6863fe406021fd7359f1ed7fd","tests/uds_stream.rs":"287b7d5e297df3e326488d98f9645ebfcf8be0205ba6a8e5ddaadac58240e113","tests/unwindsafe.rs":"e833431d40708f39b8bf54b809b635d77d9895f46f3c42aa14d3e9108415279d"},"package":"61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"} \ No newline at end of file diff --git a/vendor/tokio/CHANGELOG.md b/vendor/tokio/CHANGELOG.md index e21d1c1d4..9d122cdb7 100644 --- a/vendor/tokio/CHANGELOG.md +++ b/vendor/tokio/CHANGELOG.md @@ -1,3 +1,118 @@ +# 1.36.0 (February 2nd, 2024) + +### Added + +- io: add `tokio::io::Join` ([#6220]) +- io: implement `AsyncWrite` for `Empty` ([#6235]) +- net: add support for anonymous unix pipes ([#6127]) +- net: add `UnixSocket` ([#6290]) +- net: expose keepalive option on `TcpSocket` ([#6311]) +- sync: add `{Receiver,UnboundedReceiver}::poll_recv_many` ([#6236]) +- sync: add `Sender::{try_,}reserve_many` ([#6205]) +- sync: add `watch::Receiver::mark_unchanged` ([#6252]) +- task: add `JoinSet::try_join_next` ([#6280]) +- time: add `FutureExt::timeout` ([#6276]) + +### Changed + +- io: make `copy` cooperative ([#6265]) +- io: make `repeat` and `sink` cooperative ([#6254]) +- io: simplify check for empty slice ([#6293]) +- rt: improve robustness of `wake_in_drop_after_panic` test ([#6238]) +- process: use pidfd on Linux when available ([#6152]) +- sync: use AtomicBool in broadcast channel future ([#6298]) + +### Fixed + +- chore: typographic improvements ([#6262]) +- runtime: remove obsolete comment ([#6303]) +- task: fix typo ([#6261]) + +### Documented + +- io: clarify `clear_ready` docs ([#6304]) +- net: document that `*Fd` traits on `TcpSocket` are unix-only ([#6294]) +- sync: document FIFO behavior of `tokio::sync::Mutex` ([#6279]) + +[#6220]: https://github.com/tokio-rs/tokio/pull/6220 +[#6235]: https://github.com/tokio-rs/tokio/pull/6235 +[#6127]: https://github.com/tokio-rs/tokio/pull/6127 +[#6290]: https://github.com/tokio-rs/tokio/pull/6290 +[#6311]: https://github.com/tokio-rs/tokio/pull/6311 +[#6236]: https://github.com/tokio-rs/tokio/pull/6236 +[#6205]: https://github.com/tokio-rs/tokio/pull/6205 +[#6252]: https://github.com/tokio-rs/tokio/pull/6252 +[#6280]: https://github.com/tokio-rs/tokio/pull/6280 +[#6276]: https://github.com/tokio-rs/tokio/pull/6276 +[#6265]: https://github.com/tokio-rs/tokio/pull/6265 +[#6254]: https://github.com/tokio-rs/tokio/pull/6254 +[#6293]: https://github.com/tokio-rs/tokio/pull/6293 +[#6238]: https://github.com/tokio-rs/tokio/pull/6238 +[#6152]: https://github.com/tokio-rs/tokio/pull/6152 +[#6298]: https://github.com/tokio-rs/tokio/pull/6298 +[#6262]: https://github.com/tokio-rs/tokio/pull/6262 +[#6303]: https://github.com/tokio-rs/tokio/pull/6303 +[#6261]: https://github.com/tokio-rs/tokio/pull/6261 +[#6304]: https://github.com/tokio-rs/tokio/pull/6304 +[#6294]: https://github.com/tokio-rs/tokio/pull/6294 +[#6279]: https://github.com/tokio-rs/tokio/pull/6279 + +# 1.35.1 (December 19, 2023) + +This is a forward part of a change that was backported to 1.25.3. + +### Fixed + +- io: add budgeting to `tokio::runtime::io::registration::async_io` ([#6221]) + +[#6221]: https://github.com/tokio-rs/tokio/pull/6221 + +# 1.35.0 (December 8th, 2023) + +### Added + +- net: add Apple watchOS support ([#6176]) + +### Changed + +- io: drop the `Sized` requirements from `AsyncReadExt.read_buf` ([#6169]) +- runtime: make `Runtime` unwind safe ([#6189]) +- runtime: reduce the lock contention in task spawn ([#6001]) +- tokio: update nix dependency to 0.27.1 ([#6190]) + +### Fixed + +- chore: make `--cfg docsrs` work without net feature ([#6166]) +- chore: use relaxed load for `unsync_load` on miri ([#6179]) +- runtime: handle missing context on wake ([#6148]) +- taskdump: fix taskdump cargo config example ([#6150]) +- taskdump: skip notified tasks during taskdumps ([#6194]) +- tracing: avoid creating resource spans with current parent, use a None parent instead ([#6107]) +- tracing: make task span explicit root ([#6158]) + +### Documented + +- io: flush in `AsyncWriteExt` examples ([#6149]) +- runtime: document fairness guarantees and current behavior ([#6145]) +- task: document cancel safety of `LocalSet::run_until` ([#6147]) + +[#6001]: https://github.com/tokio-rs/tokio/pull/6001 +[#6107]: https://github.com/tokio-rs/tokio/pull/6107 +[#6144]: https://github.com/tokio-rs/tokio/pull/6144 +[#6145]: https://github.com/tokio-rs/tokio/pull/6145 +[#6147]: https://github.com/tokio-rs/tokio/pull/6147 +[#6148]: https://github.com/tokio-rs/tokio/pull/6148 +[#6149]: https://github.com/tokio-rs/tokio/pull/6149 +[#6150]: https://github.com/tokio-rs/tokio/pull/6150 +[#6158]: https://github.com/tokio-rs/tokio/pull/6158 +[#6166]: https://github.com/tokio-rs/tokio/pull/6166 +[#6169]: https://github.com/tokio-rs/tokio/pull/6169 +[#6176]: https://github.com/tokio-rs/tokio/pull/6176 +[#6179]: https://github.com/tokio-rs/tokio/pull/6179 +[#6189]: https://github.com/tokio-rs/tokio/pull/6189 +[#6190]: https://github.com/tokio-rs/tokio/pull/6190 +[#6194]: https://github.com/tokio-rs/tokio/pull/6194 + # 1.34.0 (November 19th, 2023) ### Fixed @@ -107,6 +222,16 @@ [#6056]: https://github.com/tokio-rs/tokio/pull/6056 [#6058]: https://github.com/tokio-rs/tokio/pull/6058 +# 1.32.1 (December 19, 2023) + +This is a forward part of a change that was backported to 1.25.3. + +### Fixed + +- io: add budgeting to `tokio::runtime::io::registration::async_io` ([#6221]) + +[#6221]: https://github.com/tokio-rs/tokio/pull/6221 + # 1.32.0 (August 16, 2023) ### Fixed @@ -469,6 +594,13 @@ This release bumps the MSRV of Tokio to 1.56. ([#5559]) [#5513]: https://github.com/tokio-rs/tokio/pull/5513 [#5517]: https://github.com/tokio-rs/tokio/pull/5517 +# 1.25.3 (December 17th, 2023) + +### Fixed +- io: add budgeting to `tokio::runtime::io::registration::async_io` ([#6221]) + +[#6221]: https://github.com/tokio-rs/tokio/pull/6221 + # 1.25.2 (September 22, 2023) Forward ports 1.20.6 changes. @@ -1547,7 +1679,9 @@ Fixes a missed edge case from 1.8.1. ### Fixed -- runtime: drop canceled future on next poll (#3965) +- runtime: drop canceled future on next poll ([#3965]) + +[#3965]: https://github.com/tokio-rs/tokio/pull/3965 # 1.8.1 (July 6, 2021) @@ -1568,7 +1702,7 @@ Forward ports 1.5.1 fixes. - net: add ready/try methods to `NamedPipe{Client,Server}` ([#3866], [#3899]) - sync: add `watch::Receiver::borrow_and_update` ([#3813]) - sync: implement `From` for `OnceCell` ([#3877]) -- time: allow users to specify Interval behaviour when delayed ([#3721]) +- time: allow users to specify Interval behavior when delayed ([#3721]) ### Added (unstable) @@ -1582,7 +1716,7 @@ Forward ports 1.5.1 fixes. - doc: document cancellation safety ([#3900]) - time: add wait alias to sleep ([#3897]) -- time: document auto-advancing behaviour of runtime ([#3763]) +- time: document auto-advancing behavior of runtime ([#3763]) [#3163]: https://github.com/tokio-rs/tokio/pull/3163 [#3721]: https://github.com/tokio-rs/tokio/pull/3721 @@ -1829,7 +1963,7 @@ a kernel bug. ([#3803]) - doc: doc aliases for pre-1.0 function names ([#3523]) - io: fix typos ([#3541]) -- io: note the EOF behaviour of `read_until` ([#3536]) +- io: note the EOF behavior of `read_until` ([#3536]) - io: update `AsyncRead::poll_read` doc ([#3557]) - net: update `UdpSocket` splitting doc ([#3517]) - runtime: add link to `LocalSet` on `new_current_thread` ([#3508]) diff --git a/vendor/tokio/Cargo.toml b/vendor/tokio/Cargo.toml index 55cde4a0b..a0d178198 100644 --- a/vendor/tokio/Cargo.toml +++ b/vendor/tokio/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.63" name = "tokio" -version = "1.34.0" +version = "1.36.0" authors = ["Tokio Contributors "] description = """ An event-driven, non-blocking I/O platform for writing asynchronous I/O @@ -34,6 +34,13 @@ categories = [ license = "MIT" repository = "https://github.com/tokio-rs/tokio" +[package.metadata.cargo_check_external_types] +allowed_external_types = [ + "bytes::buf::buf_impl::Buf", + "bytes::buf::buf_mut::BufMut", + "tokio_macros::*", +] + [package.metadata.docs.rs] all-features = true rustc-args = [ @@ -187,7 +194,7 @@ version = "0.5.5" version = "3.1.0" [target."cfg(target_os = \"freebsd\")".dev-dependencies.mio-aio] -version = "0.7.0" +version = "0.8.0" features = ["tokio"] [target."cfg(tokio_taskdump)".dependencies.backtrace] @@ -211,7 +218,7 @@ optional = true version = "0.2.149" [target."cfg(unix)".dev-dependencies.nix] -version = "0.26" +version = "0.27.1" features = [ "fs", "socket", diff --git a/vendor/tokio/README.md b/vendor/tokio/README.md index d73ff594c..ec947925d 100644 --- a/vendor/tokio/README.md +++ b/vendor/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.34.0", features = ["full"] } +tokio = { version = "1.36.0", features = ["full"] } ``` Then, on your main.rs: diff --git a/vendor/tokio/external-types.toml b/vendor/tokio/external-types.toml deleted file mode 100644 index a5bde8ed1..000000000 --- a/vendor/tokio/external-types.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This config file is for the `cargo-check-external-types` tool that is run in CI. - -# The following are types that are allowed to be exposed in Tokio's public API. -# The standard library is allowed by default. -allowed_external_types = [ - "bytes::buf::buf_impl::Buf", - "bytes::buf::buf_mut::BufMut", - - "tokio_macros::*", -] - diff --git a/vendor/tokio/src/doc/mod.rs b/vendor/tokio/src/doc/mod.rs index 8f11de207..0279630c9 100644 --- a/vendor/tokio/src/doc/mod.rs +++ b/vendor/tokio/src/doc/mod.rs @@ -20,6 +20,7 @@ #[derive(Debug)] pub enum NotDefinedHere {} +#[cfg(feature = "net")] impl mio::event::Source for NotDefinedHere { fn register( &mut self, @@ -42,4 +43,5 @@ impl mio::event::Source for NotDefinedHere { } } +#[cfg(feature = "net")] pub mod os; diff --git a/vendor/tokio/src/doc/os.rs b/vendor/tokio/src/doc/os.rs index cded8b97c..337f8969a 100644 --- a/vendor/tokio/src/doc/os.rs +++ b/vendor/tokio/src/doc/os.rs @@ -1,67 +1,67 @@ -//! See [std::os](https://doc.rust-lang.org/std/os/index.html). +//! See [`std::os`](https://doc.rust-lang.org/std/os/index.html). /// Platform-specific extensions to `std` for Windows. /// -/// See [std::os::windows](https://doc.rust-lang.org/std/os/windows/index.html). +/// See [`std::os::windows`](https://doc.rust-lang.org/std/os/windows/index.html). pub mod windows { /// Windows-specific extensions to general I/O primitives. /// - /// See [std::os::windows::io](https://doc.rust-lang.org/std/os/windows/io/index.html). + /// See [`std::os::windows::io`](https://doc.rust-lang.org/std/os/windows/io/index.html). pub mod io { - /// See [std::os::windows::io::RawHandle](https://doc.rust-lang.org/std/os/windows/io/type.RawHandle.html) + /// See [`std::os::windows::io::RawHandle`](https://doc.rust-lang.org/std/os/windows/io/type.RawHandle.html) pub type RawHandle = crate::doc::NotDefinedHere; - /// See [std::os::windows::io::OwnedHandle](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) + /// See [`std::os::windows::io::OwnedHandle`](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) pub type OwnedHandle = crate::doc::NotDefinedHere; - /// See [std::os::windows::io::AsRawHandle](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawHandle.html) + /// See [`std::os::windows::io::AsRawHandle`](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawHandle.html) pub trait AsRawHandle { - /// See [std::os::windows::io::AsRawHandle::as_raw_handle](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawHandle.html#tymethod.as_raw_handle) + /// See [`std::os::windows::io::AsRawHandle::as_raw_handle`](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawHandle.html#tymethod.as_raw_handle) fn as_raw_handle(&self) -> RawHandle; } - /// See [std::os::windows::io::FromRawHandle](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawHandle.html) + /// See [`std::os::windows::io::FromRawHandle`](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawHandle.html) pub trait FromRawHandle { - /// See [std::os::windows::io::FromRawHandle::from_raw_handle](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawHandle.html#tymethod.from_raw_handle) + /// See [`std::os::windows::io::FromRawHandle::from_raw_handle`](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawHandle.html#tymethod.from_raw_handle) unsafe fn from_raw_handle(handle: RawHandle) -> Self; } - /// See [std::os::windows::io::RawSocket](https://doc.rust-lang.org/std/os/windows/io/type.RawSocket.html) + /// See [`std::os::windows::io::RawSocket`](https://doc.rust-lang.org/std/os/windows/io/type.RawSocket.html) pub type RawSocket = crate::doc::NotDefinedHere; - /// See [std::os::windows::io::AsRawSocket](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawSocket.html) + /// See [`std::os::windows::io::AsRawSocket`](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawSocket.html) pub trait AsRawSocket { - /// See [std::os::windows::io::AsRawSocket::as_raw_socket](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawSocket.html#tymethod.as_raw_socket) + /// See [`std::os::windows::io::AsRawSocket::as_raw_socket`](https://doc.rust-lang.org/std/os/windows/io/trait.AsRawSocket.html#tymethod.as_raw_socket) fn as_raw_socket(&self) -> RawSocket; } - /// See [std::os::windows::io::FromRawSocket](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawSocket.html) + /// See [`std::os::windows::io::FromRawSocket`](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawSocket.html) pub trait FromRawSocket { - /// See [std::os::windows::io::FromRawSocket::from_raw_socket](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawSocket.html#tymethod.from_raw_socket) + /// See [`std::os::windows::io::FromRawSocket::from_raw_socket`](https://doc.rust-lang.org/std/os/windows/io/trait.FromRawSocket.html#tymethod.from_raw_socket) unsafe fn from_raw_socket(sock: RawSocket) -> Self; } - /// See [std::os::windows::io::IntoRawSocket](https://doc.rust-lang.org/std/os/windows/io/trait.IntoRawSocket.html) + /// See [`std::os::windows::io::IntoRawSocket`](https://doc.rust-lang.org/std/os/windows/io/trait.IntoRawSocket.html) pub trait IntoRawSocket { - /// See [std::os::windows::io::IntoRawSocket::into_raw_socket](https://doc.rust-lang.org/std/os/windows/io/trait.IntoRawSocket.html#tymethod.into_raw_socket) + /// See [`std::os::windows::io::IntoRawSocket::into_raw_socket`](https://doc.rust-lang.org/std/os/windows/io/trait.IntoRawSocket.html#tymethod.into_raw_socket) fn into_raw_socket(self) -> RawSocket; } - /// See [std::os::windows::io::BorrowedHandle](https://doc.rust-lang.org/std/os/windows/io/struct.BorrowedHandle.html) + /// See [`std::os::windows::io::BorrowedHandle`](https://doc.rust-lang.org/std/os/windows/io/struct.BorrowedHandle.html) pub type BorrowedHandle<'handle> = crate::doc::NotDefinedHere; - /// See [std::os::windows::io::AsHandle](https://doc.rust-lang.org/std/os/windows/io/trait.AsHandle.html) + /// See [`std::os::windows::io::AsHandle`](https://doc.rust-lang.org/std/os/windows/io/trait.AsHandle.html) pub trait AsHandle { - /// See [std::os::windows::io::AsHandle::as_handle](https://doc.rust-lang.org/std/os/windows/io/trait.AsHandle.html#tymethod.as_handle) + /// See [`std::os::windows::io::AsHandle::as_handle`](https://doc.rust-lang.org/std/os/windows/io/trait.AsHandle.html#tymethod.as_handle) fn as_handle(&self) -> BorrowedHandle<'_>; } - /// See [std::os::windows::io::BorrowedSocket](https://doc.rust-lang.org/std/os/windows/io/struct.BorrowedSocket.html) + /// See [`std::os::windows::io::BorrowedSocket`](https://doc.rust-lang.org/std/os/windows/io/struct.BorrowedSocket.html) pub type BorrowedSocket<'socket> = crate::doc::NotDefinedHere; - /// See [std::os::windows::io::AsSocket](https://doc.rust-lang.org/std/os/windows/io/trait.AsSocket.html) + /// See [`std::os::windows::io::AsSocket`](https://doc.rust-lang.org/std/os/windows/io/trait.AsSocket.html) pub trait AsSocket { - /// See [std::os::windows::io::AsSocket::as_socket](https://doc.rust-lang.org/std/os/windows/io/trait.AsSocket.html#tymethod.as_socket) + /// See [`std::os::windows::io::AsSocket::as_socket`](https://doc.rust-lang.org/std/os/windows/io/trait.AsSocket.html#tymethod.as_socket) fn as_socket(&self) -> BorrowedSocket<'_>; } } diff --git a/vendor/tokio/src/fs/open_options/mock_open_options.rs b/vendor/tokio/src/fs/open_options/mock_open_options.rs index 17b4a4864..2fbdd282a 100644 --- a/vendor/tokio/src/fs/open_options/mock_open_options.rs +++ b/vendor/tokio/src/fs/open_options/mock_open_options.rs @@ -1,5 +1,5 @@ #![allow(unreachable_pub)] -//! Mock version of std::fs::OpenOptions; +//! Mock version of `std::fs::OpenOptions`; use mockall::mock; use crate::fs::mocks::MockFile; diff --git a/vendor/tokio/src/future/maybe_done.rs b/vendor/tokio/src/future/maybe_done.rs index d5e6fa4be..506b4f26c 100644 --- a/vendor/tokio/src/future/maybe_done.rs +++ b/vendor/tokio/src/future/maybe_done.rs @@ -1,28 +1,29 @@ //! Definition of the [`MaybeDone`] combinator. +use pin_project_lite::pin_project; use std::future::Future; -use std::mem; use std::pin::Pin; use std::task::{Context, Poll}; -/// A future that may have completed. -#[derive(Debug)] -pub enum MaybeDone { - /// A not-yet-completed future. - Future(Fut), - /// The output of the completed future. - Done(Fut::Output), - /// The empty variant after the result of a [`MaybeDone`] has been - /// taken using the [`take_output`](MaybeDone::take_output) method. - Gone, +pin_project! { + /// A future that may have completed. + #[derive(Debug)] + #[project = MaybeDoneProj] + #[project_replace = MaybeDoneProjReplace] + pub enum MaybeDone { + /// A not-yet-completed future. + Future { #[pin] future: Fut }, + /// The output of the completed future. + Done { output: Fut::Output }, + /// The empty variant after the result of a [`MaybeDone`] has been + /// taken using the [`take_output`](MaybeDone::take_output) method. + Gone, + } } -// Safe because we never generate `Pin<&mut Fut::Output>` -impl Unpin for MaybeDone {} - /// Wraps a future into a `MaybeDone`. pub fn maybe_done(future: Fut) -> MaybeDone { - MaybeDone::Future(future) + MaybeDone::Future { future } } impl MaybeDone { @@ -31,12 +32,9 @@ impl MaybeDone { /// future has been completed and [`take_output`](MaybeDone::take_output) /// has not yet been called. pub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output> { - unsafe { - let this = self.get_unchecked_mut(); - match this { - MaybeDone::Done(res) => Some(res), - _ => None, - } + match self.project() { + MaybeDoneProj::Done { output } => Some(output), + _ => None, } } @@ -44,17 +42,14 @@ impl MaybeDone { /// towards completion. #[inline] pub fn take_output(self: Pin<&mut Self>) -> Option { - unsafe { - let this = self.get_unchecked_mut(); - match this { - MaybeDone::Done(_) => {} - MaybeDone::Future(_) | MaybeDone::Gone => return None, - }; - if let MaybeDone::Done(output) = mem::replace(this, MaybeDone::Gone) { - Some(output) - } else { - unreachable!() - } + match *self { + MaybeDone::Done { .. } => {} + MaybeDone::Future { .. } | MaybeDone::Gone => return None, + }; + if let MaybeDoneProjReplace::Done { output } = self.project_replace(MaybeDone::Gone) { + Some(output) + } else { + unreachable!() } } } @@ -63,14 +58,12 @@ impl Future for MaybeDone { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let res = unsafe { - match self.as_mut().get_unchecked_mut() { - MaybeDone::Future(a) => ready!(Pin::new_unchecked(a).poll(cx)), - MaybeDone::Done(_) => return Poll::Ready(()), - MaybeDone::Gone => panic!("MaybeDone polled after value taken"), - } + let output = match self.as_mut().project() { + MaybeDoneProj::Future { future } => ready!(future.poll(cx)), + MaybeDoneProj::Done { .. } => return Poll::Ready(()), + MaybeDoneProj::Gone => panic!("MaybeDone polled after value taken"), }; - self.set(MaybeDone::Done(res)); + self.set(MaybeDone::Done { output }); Poll::Ready(()) } } diff --git a/vendor/tokio/src/future/mod.rs b/vendor/tokio/src/future/mod.rs index 7c883eb3c..12b6bbc49 100644 --- a/vendor/tokio/src/future/mod.rs +++ b/vendor/tokio/src/future/mod.rs @@ -6,6 +6,7 @@ pub(crate) mod maybe_done; mod poll_fn; +#[allow(unused_imports)] pub use poll_fn::poll_fn; cfg_process! { diff --git a/vendor/tokio/src/io/async_fd.rs b/vendor/tokio/src/io/async_fd.rs index b27c60bf6..aaf175841 100644 --- a/vendor/tokio/src/io/async_fd.rs +++ b/vendor/tokio/src/io/async_fd.rs @@ -826,6 +826,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> { /// _actually observes_ that the file descriptor is _not_ ready. Do not call /// it simply because, for example, a read succeeded; it should be called /// when a read is observed to block. + /// + /// This method only clears readiness events that happened before the creation of this guard. + /// In other words, if the IO resource becomes ready between the creation of the guard and + /// this call to `clear_ready`, then the readiness is not actually cleared. pub fn clear_ready(&mut self) { if let Some(event) = self.event.take() { self.async_fd.registration.clear_readiness(event); @@ -846,6 +850,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> { /// block. For example when a read blocks when using a combined interest, /// only clear `Ready::READABLE`. /// + /// This method only clears readiness events that happened before the creation of this guard. + /// In other words, if the IO resource becomes ready between the creation of the guard and + /// this call to `clear_ready`, then the readiness is not actually cleared. + /// /// # Examples /// /// Concurrently read and write to a [`std::net::TcpStream`] on the same task without @@ -1042,6 +1050,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> { /// _actually observes_ that the file descriptor is _not_ ready. Do not call /// it simply because, for example, a read succeeded; it should be called /// when a read is observed to block. + /// + /// This method only clears readiness events that happened before the creation of this guard. + /// In other words, if the IO resource becomes ready between the creation of the guard and + /// this call to `clear_ready`, then the readiness is not actually cleared. pub fn clear_ready(&mut self) { if let Some(event) = self.event.take() { self.async_fd.registration.clear_readiness(event); @@ -1062,6 +1074,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> { /// block. For example when a read blocks when using a combined interest, /// only clear `Ready::READABLE`. /// + /// This method only clears readiness events that happened before the creation of this guard. + /// In other words, if the IO resource becomes ready between the creation of the guard and + /// this call to `clear_ready`, then the readiness is not actually cleared. + /// /// # Examples /// /// Concurrently read and write to a [`std::net::TcpStream`] on the same task without diff --git a/vendor/tokio/src/io/bsd/poll_aio.rs b/vendor/tokio/src/io/bsd/poll_aio.rs index 6ac9e2880..708ca7484 100644 --- a/vendor/tokio/src/io/bsd/poll_aio.rs +++ b/vendor/tokio/src/io/bsd/poll_aio.rs @@ -164,7 +164,7 @@ impl Aio { /// is scheduled to receive a wakeup when the underlying operation /// completes. Note that on multiple calls to `poll_ready`, only the `Waker` from the /// `Context` passed to the most recent call is scheduled to receive a wakeup. - pub fn poll_ready<'a>(&'a self, cx: &mut Context<'_>) -> Poll> { + pub fn poll_ready(&self, cx: &mut Context<'_>) -> Poll> { let ev = ready!(self.registration.poll_read_ready(cx))?; Poll::Ready(Ok(AioEvent(ev))) } diff --git a/vendor/tokio/src/io/interest.rs b/vendor/tokio/src/io/interest.rs index e8cc0c42d..a15b28cf7 100644 --- a/vendor/tokio/src/io/interest.rs +++ b/vendor/tokio/src/io/interest.rs @@ -40,11 +40,11 @@ impl Interest { #[cfg(not(target_os = "freebsd"))] pub const AIO: Interest = Interest(READABLE); - /// Interest for POSIX AIO lio_listio events. + /// Interest for POSIX AIO `lio_listio` events. #[cfg(target_os = "freebsd")] pub const LIO: Interest = Interest(LIO); - /// Interest for POSIX AIO lio_listio events. + /// Interest for POSIX AIO `lio_listio` events. #[cfg(not(target_os = "freebsd"))] pub const LIO: Interest = Interest(READABLE); } diff --git a/vendor/tokio/src/io/join.rs b/vendor/tokio/src/io/join.rs new file mode 100644 index 000000000..dbc7043b6 --- /dev/null +++ b/vendor/tokio/src/io/join.rs @@ -0,0 +1,117 @@ +//! Join two values implementing `AsyncRead` and `AsyncWrite` into a single one. + +use crate::io::{AsyncRead, AsyncWrite, ReadBuf}; + +use std::io; +use std::pin::Pin; +use std::task::{Context, Poll}; + +/// Join two values implementing `AsyncRead` and `AsyncWrite` into a +/// single handle. +pub fn join(reader: R, writer: W) -> Join +where + R: AsyncRead, + W: AsyncWrite, +{ + Join { reader, writer } +} + +pin_project_lite::pin_project! { + /// Joins two values implementing `AsyncRead` and `AsyncWrite` into a + /// single handle. + #[derive(Debug)] + pub struct Join { + #[pin] + reader: R, + #[pin] + writer: W, + } +} + +impl Join +where + R: AsyncRead, + W: AsyncWrite, +{ + /// Splits this `Join` back into its `AsyncRead` and `AsyncWrite` + /// components. + pub fn into_inner(self) -> (R, W) { + (self.reader, self.writer) + } + + /// Returns a reference to the inner reader. + pub fn reader(&self) -> &R { + &self.reader + } + + /// Returns a reference to the inner writer. + pub fn writer(&self) -> &W { + &self.writer + } + + /// Returns a mutable reference to the inner reader. + pub fn reader_mut(&mut self) -> &mut R { + &mut self.reader + } + + /// Returns a mutable reference to the inner writer. + pub fn writer_mut(&mut self) -> &mut W { + &mut self.writer + } + + /// Returns a pinned mutable reference to the inner reader. + pub fn reader_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R> { + self.project().reader + } + + /// Returns a pinned mutable reference to the inner writer. + pub fn writer_pin_mut(self: Pin<&mut Self>) -> Pin<&mut W> { + self.project().writer + } +} + +impl AsyncRead for Join +where + R: AsyncRead, +{ + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &mut ReadBuf<'_>, + ) -> Poll> { + self.project().reader.poll_read(cx, buf) + } +} + +impl AsyncWrite for Join +where + W: AsyncWrite, +{ + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + self.project().writer.poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().writer.poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().writer.poll_shutdown(cx) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[io::IoSlice<'_>], + ) -> Poll> { + self.project().writer.poll_write_vectored(cx, bufs) + } + + fn is_write_vectored(&self) -> bool { + self.writer.is_write_vectored() + } +} diff --git a/vendor/tokio/src/io/mod.rs b/vendor/tokio/src/io/mod.rs index 0fd6cc2c5..5e903c048 100644 --- a/vendor/tokio/src/io/mod.rs +++ b/vendor/tokio/src/io/mod.rs @@ -4,7 +4,7 @@ //! defines two traits, [`AsyncRead`] and [`AsyncWrite`], which are asynchronous //! versions of the [`Read`] and [`Write`] traits in the standard library. //! -//! # AsyncRead and AsyncWrite +//! # `AsyncRead` and `AsyncWrite` //! //! Like the standard library's [`Read`] and [`Write`] traits, [`AsyncRead`] and //! [`AsyncWrite`] provide the most general interface for reading and writing @@ -122,7 +122,7 @@ //! [`BufReader`]: crate::io::BufReader //! [`BufWriter`]: crate::io::BufWriter //! -//! ## Implementing AsyncRead and AsyncWrite +//! ## Implementing `AsyncRead` and `AsyncWrite` //! //! Because they are traits, we can implement [`AsyncRead`] and [`AsyncWrite`] for //! our own types, as well. Note that these traits must only be implemented for @@ -265,6 +265,8 @@ cfg_io_std! { cfg_io_util! { mod split; pub use split::{split, ReadHalf, WriteHalf}; + mod join; + pub use join::{join, Join}; pub(crate) mod seek; pub(crate) mod util; diff --git a/vendor/tokio/src/io/poll_evented.rs b/vendor/tokio/src/io/poll_evented.rs index cb5bffd54..3952a31e7 100644 --- a/vendor/tokio/src/io/poll_evented.rs +++ b/vendor/tokio/src/io/poll_evented.rs @@ -47,7 +47,7 @@ cfg_io_driver! { /// This clears the readiness state until a new readiness event is received. /// /// This allows the caller to implement additional functions. For example, - /// [`TcpListener`] implements poll_accept by using [`poll_read_ready`] and + /// [`TcpListener`] implements `poll_accept` by using [`poll_read_ready`] and /// [`clear_readiness`]. /// /// ## Platform-specific events @@ -136,6 +136,25 @@ impl PollEvented { self.registration.deregister(&mut inner)?; Ok(inner) } + + #[cfg(all(feature = "process", target_os = "linux"))] + pub(crate) fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll> { + self.registration + .poll_read_ready(cx) + .map_err(io::Error::from) + .map_ok(|_| ()) + } + + /// Re-register under new runtime with `interest`. + #[cfg(all(feature = "process", target_os = "linux"))] + pub(crate) fn reregister(&mut self, interest: Interest) -> io::Result<()> { + let io = self.io.as_mut().unwrap(); // As io shouldn't ever be None, just unwrap here. + let _ = self.registration.deregister(io); + self.registration = + Registration::new_with_interest_and_handle(io, interest, scheduler::Handle::current())?; + + Ok(()) + } } feature! { diff --git a/vendor/tokio/src/io/stdio_common.rs b/vendor/tokio/src/io/stdio_common.rs index 792b3a400..c32b889e5 100644 --- a/vendor/tokio/src/io/stdio_common.rs +++ b/vendor/tokio/src/io/stdio_common.rs @@ -4,7 +4,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; /// # Windows /// [`AsyncWrite`] adapter that finds last char boundary in given buffer and does not write the rest, -/// if buffer contents seems to be utf8. Otherwise it only trims buffer down to `MAX_BUF`. +/// if buffer contents seems to be `utf8`. Otherwise it only trims buffer down to `MAX_BUF`. /// That's why, wrapped writer will always receive well-formed utf-8 bytes. /// # Other platforms /// Passes data to `inner` as is. diff --git a/vendor/tokio/src/io/util/async_buf_read_ext.rs b/vendor/tokio/src/io/util/async_buf_read_ext.rs index 2aee39258..92500f7f8 100644 --- a/vendor/tokio/src/io/util/async_buf_read_ext.rs +++ b/vendor/tokio/src/io/util/async_buf_read_ext.rs @@ -302,7 +302,7 @@ cfg_io_util! { /// /// The stream returned from this function will yield instances of /// [`io::Result`]`<`[`Option`]`<`[`String`]`>>`. Each string returned will *not* have a newline - /// byte (the 0xA byte) or CRLF (0xD, 0xA bytes) at the end. + /// byte (the 0xA byte) or `CRLF` (0xD, 0xA bytes) at the end. /// /// [`io::Result`]: std::io::Result /// [`Option`]: core::option::Option diff --git a/vendor/tokio/src/io/util/async_read_ext.rs b/vendor/tokio/src/io/util/async_read_ext.rs index 7588f822f..11bd42448 100644 --- a/vendor/tokio/src/io/util/async_read_ext.rs +++ b/vendor/tokio/src/io/util/async_read_ext.rs @@ -245,8 +245,8 @@ cfg_io_util! { /// ``` fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B> where - Self: Sized + Unpin, - B: BufMut, + Self: Unpin, + B: BufMut + ?Sized, { read_buf(self, buf) } diff --git a/vendor/tokio/src/io/util/async_write_ext.rs b/vendor/tokio/src/io/util/async_write_ext.rs index a9812d57e..2760e9129 100644 --- a/vendor/tokio/src/io/util/async_write_ext.rs +++ b/vendor/tokio/src/io/util/async_write_ext.rs @@ -117,6 +117,7 @@ cfg_io_util! { /// /// // Writes some prefix of the byte string, not necessarily all of it. /// file.write(b"some bytes").await?; + /// file.flush().await?; /// Ok(()) /// } /// ``` @@ -162,6 +163,7 @@ cfg_io_util! { /// ]; /// /// file.write_vectored(&bufs).await?; + /// file.flush().await?; /// /// Ok(()) /// } @@ -244,6 +246,7 @@ cfg_io_util! { /// // all of it. /// file.write_buf(&mut buffer).await?; /// } + /// file.flush().await?; /// /// Ok(()) /// } @@ -307,6 +310,7 @@ cfg_io_util! { /// let mut buffer = Cursor::new(b"data to write"); /// /// file.write_all_buf(&mut buffer).await?; + /// file.flush().await?; /// Ok(()) /// } /// ``` @@ -356,6 +360,7 @@ cfg_io_util! { /// let mut file = File::create("foo.txt").await?; /// /// file.write_all(b"some bytes").await?; + /// file.flush().await?; /// Ok(()) /// } /// ``` diff --git a/vendor/tokio/src/io/util/buf_reader.rs b/vendor/tokio/src/io/util/buf_reader.rs index 60879c0fd..d9307202c 100644 --- a/vendor/tokio/src/io/util/buf_reader.rs +++ b/vendor/tokio/src/io/util/buf_reader.rs @@ -145,13 +145,13 @@ impl AsyncBufRead for BufReader { #[derive(Debug, Clone, Copy)] pub(super) enum SeekState { - /// start_seek has not been called. + /// `start_seek` has not been called. Init, - /// start_seek has been called, but poll_complete has not yet been called. + /// `start_seek` has been called, but `poll_complete` has not yet been called. Start(SeekFrom), - /// Waiting for completion of the first poll_complete in the `n.checked_sub(remainder).is_none()` branch. + /// Waiting for completion of the first `poll_complete` in the `n.checked_sub(remainder).is_none()` branch. PendingOverflowed(i64), - /// Waiting for completion of poll_complete. + /// Waiting for completion of `poll_complete`. Pending, } diff --git a/vendor/tokio/src/io/util/buf_writer.rs b/vendor/tokio/src/io/util/buf_writer.rs index 8f398fecd..2971a8e05 100644 --- a/vendor/tokio/src/io/util/buf_writer.rs +++ b/vendor/tokio/src/io/util/buf_writer.rs @@ -212,11 +212,11 @@ impl AsyncWrite for BufWriter { #[derive(Debug, Clone, Copy)] pub(super) enum SeekState { - /// start_seek has not been called. + /// `start_seek` has not been called. Init, - /// start_seek has been called, but poll_complete has not yet been called. + /// `start_seek` has been called, but `poll_complete` has not yet been called. Start(SeekFrom), - /// Waiting for completion of poll_complete. + /// Waiting for completion of `poll_complete`. Pending, } diff --git a/vendor/tokio/src/io/util/chain.rs b/vendor/tokio/src/io/util/chain.rs index 84f37fc7d..f96f42f4a 100644 --- a/vendor/tokio/src/io/util/chain.rs +++ b/vendor/tokio/src/io/util/chain.rs @@ -114,7 +114,7 @@ where if !*me.done_first { match ready!(me.first.poll_fill_buf(cx)?) { - buf if buf.is_empty() => { + [] => { *me.done_first = true; } buf => return Poll::Ready(Ok(buf)), diff --git a/vendor/tokio/src/io/util/copy.rs b/vendor/tokio/src/io/util/copy.rs index 8bd0bff7f..56310c86f 100644 --- a/vendor/tokio/src/io/util/copy.rs +++ b/vendor/tokio/src/io/util/copy.rs @@ -82,6 +82,19 @@ impl CopyBuffer { R: AsyncRead + ?Sized, W: AsyncWrite + ?Sized, { + ready!(crate::trace::trace_leaf(cx)); + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + // Keep track of task budget + let coop = ready!(crate::runtime::coop::poll_proceed(cx)); loop { // If our buffer is empty, then we need to read some data to // continue. @@ -90,13 +103,49 @@ impl CopyBuffer { self.cap = 0; match self.poll_fill_buf(cx, reader.as_mut()) { - Poll::Ready(Ok(())) => (), - Poll::Ready(Err(err)) => return Poll::Ready(Err(err)), + Poll::Ready(Ok(())) => { + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + coop.made_progress(); + } + Poll::Ready(Err(err)) => { + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + coop.made_progress(); + return Poll::Ready(Err(err)); + } Poll::Pending => { // Try flushing when the reader has no progress to avoid deadlock // when the reader depends on buffered writer. if self.need_flush { ready!(writer.as_mut().poll_flush(cx))?; + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + coop.made_progress(); self.need_flush = false; } @@ -108,6 +157,17 @@ impl CopyBuffer { // If our buffer has some data, let's write it out! while self.pos < self.cap { let i = ready!(self.poll_write_buf(cx, reader.as_mut(), writer.as_mut()))?; + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + coop.made_progress(); if i == 0 { return Poll::Ready(Err(io::Error::new( io::ErrorKind::WriteZero, @@ -132,6 +192,17 @@ impl CopyBuffer { // data and finish the transfer. if self.pos == self.cap && self.read_done { ready!(writer.as_mut().poll_flush(cx))?; + #[cfg(any( + feature = "fs", + feature = "io-std", + feature = "net", + feature = "process", + feature = "rt", + feature = "signal", + feature = "sync", + feature = "time", + ))] + coop.made_progress(); return Poll::Ready(Ok(self.amt)); } } diff --git a/vendor/tokio/src/io/util/empty.rs b/vendor/tokio/src/io/util/empty.rs index b96fabbaa..289725ce4 100644 --- a/vendor/tokio/src/io/util/empty.rs +++ b/vendor/tokio/src/io/util/empty.rs @@ -1,4 +1,5 @@ -use crate::io::{AsyncBufRead, AsyncRead, ReadBuf}; +use crate::io::util::poll_proceed_and_make_progress; +use crate::io::{AsyncBufRead, AsyncRead, AsyncWrite, ReadBuf}; use std::fmt; use std::io; @@ -6,7 +7,8 @@ use std::pin::Pin; use std::task::{Context, Poll}; cfg_io_util! { - /// An async reader which is always at EOF. + /// `Empty` ignores any data written via [`AsyncWrite`], and will always be empty + /// (returning zero bytes) when read via [`AsyncRead`]. /// /// This struct is generally created by calling [`empty`]. Please see /// the documentation of [`empty()`][`empty`] for more details. @@ -19,9 +21,12 @@ cfg_io_util! { _p: (), } - /// Creates a new empty async reader. + /// Creates a value that is always at EOF for reads, and ignores all data written. /// - /// All reads from the returned reader will return `Poll::Ready(Ok(0))`. + /// All writes on the returned instance will return `Poll::Ready(Ok(buf.len()))` + /// and the contents of the buffer will not be inspected. + /// + /// All reads from the returned instance will return `Poll::Ready(Ok(0))`. /// /// This is an asynchronous version of [`std::io::empty`][std]. /// @@ -41,6 +46,19 @@ cfg_io_util! { /// assert!(buffer.is_empty()); /// } /// ``` + /// + /// A convoluted way of getting the length of a buffer: + /// + /// ``` + /// use tokio::io::{self, AsyncWriteExt}; + /// + /// #[tokio::main] + /// async fn main() { + /// let buffer = vec![1, 2, 3, 5, 8]; + /// let num_bytes = io::empty().write(&buffer).await.unwrap(); + /// assert_eq!(num_bytes, 5); + /// } + /// ``` pub fn empty() -> Empty { Empty { _p: () } } @@ -71,26 +89,56 @@ impl AsyncBufRead for Empty { fn consume(self: Pin<&mut Self>, _: usize) {} } +impl AsyncWrite for Empty { + #[inline] + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); + Poll::Ready(Ok(buf.len())) + } + + #[inline] + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); + Poll::Ready(Ok(())) + } + + #[inline] + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); + Poll::Ready(Ok(())) + } + + #[inline] + fn is_write_vectored(&self) -> bool { + true + } + + #[inline] + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[io::IoSlice<'_>], + ) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); + let num_bytes = bufs.iter().map(|b| b.len()).sum(); + Poll::Ready(Ok(num_bytes)) + } +} + impl fmt::Debug for Empty { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.pad("Empty { .. }") } } -cfg_coop! { - fn poll_proceed_and_make_progress(cx: &mut Context<'_>) -> Poll<()> { - let coop = ready!(crate::runtime::coop::poll_proceed(cx)); - coop.made_progress(); - Poll::Ready(()) - } -} - -cfg_not_coop! { - fn poll_proceed_and_make_progress(_: &mut Context<'_>) -> Poll<()> { - Poll::Ready(()) - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/vendor/tokio/src/io/util/flush.rs b/vendor/tokio/src/io/util/flush.rs index 88d60b868..42e06bcbb 100644 --- a/vendor/tokio/src/io/util/flush.rs +++ b/vendor/tokio/src/io/util/flush.rs @@ -11,6 +11,7 @@ pin_project! { /// A future used to fully flush an I/O object. /// /// Created by the [`AsyncWriteExt::flush`][flush] function. + /// /// [flush]: crate::io::AsyncWriteExt::flush #[derive(Debug)] #[must_use = "futures do nothing unless you `.await` or poll them"] diff --git a/vendor/tokio/src/io/util/mod.rs b/vendor/tokio/src/io/util/mod.rs index 21199d0be..47b951f2b 100644 --- a/vendor/tokio/src/io/util/mod.rs +++ b/vendor/tokio/src/io/util/mod.rs @@ -85,6 +85,20 @@ cfg_io_util! { // used by `BufReader` and `BufWriter` // https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/io.rs#L1 const DEFAULT_BUF_SIZE: usize = 8 * 1024; + + cfg_coop! { + fn poll_proceed_and_make_progress(cx: &mut std::task::Context<'_>) -> std::task::Poll<()> { + let coop = ready!(crate::runtime::coop::poll_proceed(cx)); + coop.made_progress(); + std::task::Poll::Ready(()) + } + } + + cfg_not_coop! { + fn poll_proceed_and_make_progress(_: &mut std::task::Context<'_>) -> std::task::Poll<()> { + std::task::Poll::Ready(()) + } + } } cfg_not_io_util! { diff --git a/vendor/tokio/src/io/util/read_buf.rs b/vendor/tokio/src/io/util/read_buf.rs index 8ec57c0d6..750497c9e 100644 --- a/vendor/tokio/src/io/util/read_buf.rs +++ b/vendor/tokio/src/io/util/read_buf.rs @@ -10,8 +10,8 @@ use std::task::{Context, Poll}; pub(crate) fn read_buf<'a, R, B>(reader: &'a mut R, buf: &'a mut B) -> ReadBuf<'a, R, B> where - R: AsyncRead + Unpin, - B: BufMut, + R: AsyncRead + Unpin + ?Sized, + B: BufMut + ?Sized, { ReadBuf { reader, @@ -24,7 +24,7 @@ pin_project! { /// Future returned by [`read_buf`](crate::io::AsyncReadExt::read_buf). #[derive(Debug)] #[must_use = "futures do nothing unless you `.await` or poll them"] - pub struct ReadBuf<'a, R, B> { + pub struct ReadBuf<'a, R: ?Sized, B: ?Sized> { reader: &'a mut R, buf: &'a mut B, #[pin] @@ -34,8 +34,8 @@ pin_project! { impl Future for ReadBuf<'_, R, B> where - R: AsyncRead + Unpin, - B: BufMut, + R: AsyncRead + Unpin + ?Sized, + B: BufMut + ?Sized, { type Output = io::Result; diff --git a/vendor/tokio/src/io/util/read_exact.rs b/vendor/tokio/src/io/util/read_exact.rs index dbdd58bae..217315dcb 100644 --- a/vendor/tokio/src/io/util/read_exact.rs +++ b/vendor/tokio/src/io/util/read_exact.rs @@ -12,7 +12,7 @@ use std::task::{Context, Poll}; /// a buffer. /// /// Created by the [`AsyncReadExt::read_exact`][read_exact]. -/// [read_exact]: [crate::io::AsyncReadExt::read_exact] +/// [`read_exact`]: [`crate::io::AsyncReadExt::read_exact`] pub(crate) fn read_exact<'a, A>(reader: &'a mut A, buf: &'a mut [u8]) -> ReadExact<'a, A> where A: AsyncRead + Unpin + ?Sized, diff --git a/vendor/tokio/src/io/util/read_line.rs b/vendor/tokio/src/io/util/read_line.rs index e641f5153..eacc7d596 100644 --- a/vendor/tokio/src/io/util/read_line.rs +++ b/vendor/tokio/src/io/util/read_line.rs @@ -51,7 +51,7 @@ fn put_back_original_data(output: &mut String, mut vector: Vec, num_bytes_re /// This handles the various failure cases and puts the string back into `output`. /// -/// The `truncate_on_io_error` bool is necessary because `read_to_string` and `read_line` +/// The `truncate_on_io_error` `bool` is necessary because `read_to_string` and `read_line` /// disagree on what should happen when an IO error occurs. pub(super) fn finish_string_read( io_res: io::Result, diff --git a/vendor/tokio/src/io/util/repeat.rs b/vendor/tokio/src/io/util/repeat.rs index 1142765df..4a3ac78e4 100644 --- a/vendor/tokio/src/io/util/repeat.rs +++ b/vendor/tokio/src/io/util/repeat.rs @@ -1,3 +1,4 @@ +use crate::io::util::poll_proceed_and_make_progress; use crate::io::{AsyncRead, ReadBuf}; use std::io; @@ -50,9 +51,11 @@ impl AsyncRead for Repeat { #[inline] fn poll_read( self: Pin<&mut Self>, - _: &mut Context<'_>, + cx: &mut Context<'_>, buf: &mut ReadBuf<'_>, ) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); // TODO: could be faster, but should we unsafe it? while buf.remaining() != 0 { buf.put_slice(&[self.byte]); diff --git a/vendor/tokio/src/io/util/shutdown.rs b/vendor/tokio/src/io/util/shutdown.rs index 6d30b004b..fcd20dc40 100644 --- a/vendor/tokio/src/io/util/shutdown.rs +++ b/vendor/tokio/src/io/util/shutdown.rs @@ -11,7 +11,7 @@ pin_project! { /// A future used to shutdown an I/O object. /// /// Created by the [`AsyncWriteExt::shutdown`][shutdown] function. - /// [shutdown]: crate::io::AsyncWriteExt::shutdown + /// [shutdown]: [`crate::io::AsyncWriteExt::shutdown`] #[must_use = "futures do nothing unless you `.await` or poll them"] #[derive(Debug)] pub struct Shutdown<'a, A: ?Sized> { diff --git a/vendor/tokio/src/io/util/sink.rs b/vendor/tokio/src/io/util/sink.rs index 05ee773fa..1c0102d4b 100644 --- a/vendor/tokio/src/io/util/sink.rs +++ b/vendor/tokio/src/io/util/sink.rs @@ -1,3 +1,4 @@ +use crate::io::util::poll_proceed_and_make_progress; use crate::io::AsyncWrite; use std::fmt; @@ -53,19 +54,25 @@ impl AsyncWrite for Sink { #[inline] fn poll_write( self: Pin<&mut Self>, - _: &mut Context<'_>, + cx: &mut Context<'_>, buf: &[u8], ) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); Poll::Ready(Ok(buf.len())) } #[inline] - fn poll_flush(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); Poll::Ready(Ok(())) } #[inline] - fn poll_shutdown(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll> { + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + ready!(crate::trace::trace_leaf(cx)); + ready!(poll_proceed_and_make_progress(cx)); Poll::Ready(Ok(())) } } diff --git a/vendor/tokio/src/lib.rs b/vendor/tokio/src/lib.rs index 21d19bac9..3f0350988 100644 --- a/vendor/tokio/src/lib.rs +++ b/vendor/tokio/src/lib.rs @@ -2,8 +2,7 @@ clippy::cognitive_complexity, clippy::large_enum_variant, clippy::module_inception, - clippy::needless_doctest_main, - clippy::declare_interior_mutable_const + clippy::needless_doctest_main )] #![warn( missing_debug_implementations, @@ -32,8 +31,8 @@ //! * APIs for [performing asynchronous I/O][io], including [TCP and UDP][net] sockets, //! [filesystem][fs] operations, and [process] and [signal] management. //! * A [runtime] for executing asynchronous code, including a task scheduler, -//! an I/O driver backed by the operating system's event queue (epoll, kqueue, -//! IOCP, etc...), and a high performance timer. +//! an I/O driver backed by the operating system's event queue (`epoll`, `kqueue`, +//! `IOCP`, etc...), and a high performance timer. //! //! Guide level documentation is found on the [website]. //! @@ -331,11 +330,11 @@ //! - `signal`: Enables all `tokio::signal` types. //! - `fs`: Enables `tokio::fs` types. //! - `test-util`: Enables testing based infrastructure for the Tokio runtime. -//! - `parking_lot`: As a potential optimization, use the _parking_lot_ crate's +//! - `parking_lot`: As a potential optimization, use the `_parking_lot_` crate's //! synchronization primitives internally. Also, this //! dependency is necessary to construct some of our primitives -//! in a const context. MSRV may increase according to the -//! _parking_lot_ release in use. +//! in a `const` context. `MSRV` may increase according to the +//! `_parking_lot_` release in use. //! //! _Note: `AsyncRead` and `AsyncWrite` traits do not require any features and are //! always available._ @@ -410,9 +409,9 @@ //! //! [mio-supported]: https://crates.io/crates/mio#platforms //! -//! ### WASM support +//! ### `WASM` support //! -//! Tokio has some limited support for the WASM platform. Without the +//! Tokio has some limited support for the `WASM` platform. Without the //! `tokio_unstable` flag, the following features are supported: //! //! * `sync` @@ -424,22 +423,22 @@ //! Enabling any other feature (including `full`) will cause a compilation //! failure. //! -//! The `time` module will only work on WASM platforms that have support for -//! timers (e.g. wasm32-wasi). The timing functions will panic if used on a WASM +//! The `time` module will only work on `WASM` platforms that have support for +//! timers (e.g. wasm32-wasi). The timing functions will panic if used on a `WASM` //! platform that does not support timers. //! //! Note also that if the runtime becomes indefinitely idle, it will panic //! immediately instead of blocking forever. On platforms that don't support //! time, this means that the runtime can never be idle in any way. //! -//! ### Unstable WASM support +//! ### Unstable `WASM` support //! -//! Tokio also has unstable support for some additional WASM features. This +//! Tokio also has unstable support for some additional `WASM` features. This //! requires the use of the `tokio_unstable` flag. //! //! Using this flag enables the use of `tokio::net` on the wasm32-wasi target. -//! However, not all methods are available on the networking types as WASI -//! currently does not support the creation of new sockets from within WASM. +//! However, not all methods are available on the networking types as `WASI` +//! currently does not support the creation of new sockets from within `WASM`. //! Because of this, sockets must currently be created via the `FromRawFd` //! trait. @@ -597,7 +596,7 @@ mod util; /// reach `std` on a stable compiler in time for the 1.0 release of Tokio. For /// this reason, the team has decided to move all `Stream` based utilities to /// the [`tokio-stream`] crate. While this is not ideal, once `Stream` has made -/// it into the standard library and the MSRV period has passed, we will implement +/// it into the standard library and the `MSRV` period has passed, we will implement /// stream for our different types. /// /// While this may seem unfortunate, not all is lost as you can get much of the @@ -690,6 +689,6 @@ cfg_macros! { #[cfg(test)] fn is_unpin() {} -/// fuzz test (fuzz_linked_list) +/// fuzz test (`fuzz_linked_list`) #[cfg(fuzzing)] pub mod fuzz; diff --git a/vendor/tokio/src/loom/std/atomic_u16.rs b/vendor/tokio/src/loom/std/atomic_u16.rs index c9e105c19..dfc31f642 100644 --- a/vendor/tokio/src/loom/std/atomic_u16.rs +++ b/vendor/tokio/src/loom/std/atomic_u16.rs @@ -23,7 +23,8 @@ impl AtomicU16 { /// All mutations must have happened before the unsynchronized load. /// Additionally, there must be no concurrent mutations. pub(crate) unsafe fn unsync_load(&self) -> u16 { - core::ptr::read(self.inner.get() as *const u16) + // See + self.load(std::sync::atomic::Ordering::Relaxed) } } diff --git a/vendor/tokio/src/loom/std/atomic_u32.rs b/vendor/tokio/src/loom/std/atomic_u32.rs index ee0d2d380..944001769 100644 --- a/vendor/tokio/src/loom/std/atomic_u32.rs +++ b/vendor/tokio/src/loom/std/atomic_u32.rs @@ -23,7 +23,8 @@ impl AtomicU32 { /// All mutations must have happened before the unsynchronized load. /// Additionally, there must be no concurrent mutations. pub(crate) unsafe fn unsync_load(&self) -> u32 { - core::ptr::read(self.inner.get() as *const u32) + // See + self.load(std::sync::atomic::Ordering::Relaxed) } } diff --git a/vendor/tokio/src/loom/std/atomic_u64.rs b/vendor/tokio/src/loom/std/atomic_u64.rs index ce391be3e..ff6002114 100644 --- a/vendor/tokio/src/loom/std/atomic_u64.rs +++ b/vendor/tokio/src/loom/std/atomic_u64.rs @@ -1,4 +1,4 @@ -//! Implementation of an atomic u64 cell. On 64 bit platforms, this is a +//! Implementation of an atomic `u64` cell. On 64 bit platforms, this is a //! re-export of `AtomicU64`. On 32 bit platforms, this is implemented using a //! `Mutex`. diff --git a/vendor/tokio/src/loom/std/atomic_usize.rs b/vendor/tokio/src/loom/std/atomic_usize.rs index c5503a2c1..64605c76d 100644 --- a/vendor/tokio/src/loom/std/atomic_usize.rs +++ b/vendor/tokio/src/loom/std/atomic_usize.rs @@ -23,7 +23,8 @@ impl AtomicUsize { /// All mutations must have happened before the unsynchronized load. /// Additionally, there must be no concurrent mutations. pub(crate) unsafe fn unsync_load(&self) -> usize { - core::ptr::read(self.inner.get() as *const usize) + // See + self.load(std::sync::atomic::Ordering::Relaxed) } pub(crate) fn with_mut(&mut self, f: impl FnOnce(&mut usize) -> R) -> R { diff --git a/vendor/tokio/src/macros/cfg.rs b/vendor/tokio/src/macros/cfg.rs index 443cc14b3..d2f7b42bf 100644 --- a/vendor/tokio/src/macros/cfg.rs +++ b/vendor/tokio/src/macros/cfg.rs @@ -25,6 +25,18 @@ macro_rules! cfg_windows { } } +/// Enables Unix-specific code. +/// Use this macro instead of `cfg(unix)` to generate docs properly. +macro_rules! cfg_unix { + ($($item:item)*) => { + $( + #[cfg(any(all(doc, docsrs), unix))] + #[cfg_attr(docsrs, doc(cfg(unix)))] + $item + )* + } +} + /// Enables unstable Windows-specific code. /// Use this macro instead of `cfg(windows)` to generate docs properly. macro_rules! cfg_unstable_windows { @@ -37,7 +49,7 @@ macro_rules! cfg_unstable_windows { } } -/// Enables enter::block_on. +/// Enables `enter::block_on`. macro_rules! cfg_block_on { ($($item:item)*) => { $( diff --git a/vendor/tokio/src/macros/try_join.rs b/vendor/tokio/src/macros/try_join.rs index 7b1237092..a72cdb4a8 100644 --- a/vendor/tokio/src/macros/try_join.rs +++ b/vendor/tokio/src/macros/try_join.rs @@ -30,7 +30,7 @@ /// /// # Examples /// -/// Basic try_join with two branches. +/// Basic `try_join` with two branches. /// /// ``` /// async fn do_stuff_async() -> Result<(), &'static str> { diff --git a/vendor/tokio/src/net/mod.rs b/vendor/tokio/src/net/mod.rs index 2d317a8a2..abc270bd0 100644 --- a/vendor/tokio/src/net/mod.rs +++ b/vendor/tokio/src/net/mod.rs @@ -49,6 +49,7 @@ cfg_net_unix! { pub use unix::datagram::socket::UnixDatagram; pub use unix::listener::UnixListener; pub use unix::stream::UnixStream; + pub use unix::socket::UnixSocket; } cfg_net_windows! { diff --git a/vendor/tokio/src/net/tcp/listener.rs b/vendor/tokio/src/net/tcp/listener.rs index f1befac26..3f6592abe 100644 --- a/vendor/tokio/src/net/tcp/listener.rs +++ b/vendor/tokio/src/net/tcp/listener.rs @@ -58,7 +58,7 @@ cfg_net! { impl TcpListener { cfg_not_wasi! { - /// Creates a new TcpListener, which will be bound to the specified address. + /// Creates a new `TcpListener`, which will be bound to the specified address. /// /// The returned listener is ready for accepting connections. /// diff --git a/vendor/tokio/src/net/tcp/socket.rs b/vendor/tokio/src/net/tcp/socket.rs index aa9639a64..c528a14fe 100644 --- a/vendor/tokio/src/net/tcp/socket.rs +++ b/vendor/tokio/src/net/tcp/socket.rs @@ -185,6 +185,16 @@ impl TcpSocket { Ok(TcpSocket { inner }) } + /// Sets value for the `SO_KEEPALIVE` option on this socket. + pub fn set_keepalive(&self, keepalive: bool) -> io::Result<()> { + self.inner.set_keepalive(keepalive) + } + + /// Gets the value of the `SO_KEEPALIVE` option on this socket. + pub fn keepalive(&self) -> io::Result { + self.inner.keepalive() + } + /// Allows the socket to bind to an in-use address. /// /// Behavior is platform specific. Refer to the target platform's @@ -777,38 +787,36 @@ impl fmt::Debug for TcpSocket { } } -#[cfg(unix)] -impl AsRawFd for TcpSocket { - fn as_raw_fd(&self) -> RawFd { - self.inner.as_raw_fd() +cfg_unix! { + impl AsRawFd for TcpSocket { + fn as_raw_fd(&self) -> RawFd { + self.inner.as_raw_fd() + } } -} -#[cfg(unix)] -impl AsFd for TcpSocket { - fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } + impl AsFd for TcpSocket { + fn as_fd(&self) -> BorrowedFd<'_> { + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } + } } -} -#[cfg(unix)] -impl FromRawFd for TcpSocket { - /// Converts a `RawFd` to a `TcpSocket`. - /// - /// # Notes - /// - /// The caller is responsible for ensuring that the socket is in - /// non-blocking mode. - unsafe fn from_raw_fd(fd: RawFd) -> TcpSocket { - let inner = socket2::Socket::from_raw_fd(fd); - TcpSocket { inner } + impl FromRawFd for TcpSocket { + /// Converts a `RawFd` to a `TcpSocket`. + /// + /// # Notes + /// + /// The caller is responsible for ensuring that the socket is in + /// non-blocking mode. + unsafe fn from_raw_fd(fd: RawFd) -> TcpSocket { + let inner = socket2::Socket::from_raw_fd(fd); + TcpSocket { inner } + } } -} -#[cfg(unix)] -impl IntoRawFd for TcpSocket { - fn into_raw_fd(self) -> RawFd { - self.inner.into_raw_fd() + impl IntoRawFd for TcpSocket { + fn into_raw_fd(self) -> RawFd { + self.inner.into_raw_fd() + } } } diff --git a/vendor/tokio/src/net/tcp/stream.rs b/vendor/tokio/src/net/tcp/stream.rs index 9b604b339..e20473e5c 100644 --- a/vendor/tokio/src/net/tcp/stream.rs +++ b/vendor/tokio/src/net/tcp/stream.rs @@ -1060,7 +1060,7 @@ impl TcpStream { /// returns the number of bytes peeked. /// /// Successive calls return the same data. This is accomplished by passing - /// `MSG_PEEK` as a flag to the underlying recv system call. + /// `MSG_PEEK` as a flag to the underlying `recv` system call. /// /// # Examples /// @@ -1178,13 +1178,13 @@ impl TcpStream { socket2::SockRef::from(self).linger() } - /// Sets the linger duration of this socket by setting the SO_LINGER option. + /// Sets the linger duration of this socket by setting the `SO_LINGER` option. /// /// This option controls the action taken when a stream has unsent messages and the stream is - /// closed. If SO_LINGER is set, the system shall block the process until it can transmit the + /// closed. If `SO_LINGER` is set, the system shall block the process until it can transmit the /// data or until the time expires. /// - /// If SO_LINGER is not specified, and the stream is closed, the system handles the call in a + /// If `SO_LINGER` is not specified, and the stream is closed, the system handles the call in a /// way that allows the process to continue as quickly as possible. /// /// # Examples diff --git a/vendor/tokio/src/net/udp.rs b/vendor/tokio/src/net/udp.rs index 74ea41d83..4e2c140a8 100644 --- a/vendor/tokio/src/net/udp.rs +++ b/vendor/tokio/src/net/udp.rs @@ -180,7 +180,7 @@ impl UdpSocket { /// This function is intended to be used to wrap a UDP socket from the /// standard library in the Tokio equivalent. /// - /// This can be used in conjunction with socket2's `Socket` interface to + /// This can be used in conjunction with `socket2`'s `Socket` interface to /// configure a socket before it's handed off, such as setting options like /// `reuse_address` or binding to multiple addresses. /// @@ -313,7 +313,7 @@ impl UdpSocket { } /// Connects the UDP socket setting the default destination for send() and - /// limiting packets that are read via recv from the address specified in + /// limiting packets that are read via `recv` from the address specified in /// `addr`. /// /// # Example @@ -358,7 +358,7 @@ impl UdpSocket { /// Waits for any of the requested ready states. /// /// This function is usually paired with `try_recv()` or `try_send()`. It - /// can be used to concurrently recv / send to the same socket on a single + /// can be used to concurrently `recv` / `send` to the same socket on a single /// task without splitting the socket. /// /// The function may complete without the socket being ready. This is a @@ -786,7 +786,7 @@ impl UdpSocket { /// The [`connect`] method will connect this socket to a remote address. This method /// resolves to an error if the socket is not connected. /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup. /// @@ -825,7 +825,7 @@ impl UdpSocket { /// address to which it is connected. On success, returns the number of /// bytes read. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -881,7 +881,7 @@ impl UdpSocket { /// Tries to receive data from the stream into the provided buffer, advancing the /// buffer's internal cursor, returning how many bytes were read. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -949,7 +949,7 @@ impl UdpSocket { /// to which it is connected, advancing the buffer's internal cursor, /// returning how many bytes were read. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -996,7 +996,7 @@ impl UdpSocket { /// Tries to receive a single datagram message on the socket. On success, /// returns the number of bytes read and the origin. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -1071,7 +1071,7 @@ impl UdpSocket { /// Receives a single datagram message on the socket, advancing the /// buffer's internal cursor, returning how many bytes were read and the origin. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -1311,7 +1311,7 @@ impl UdpSocket { /// Attempts to receive a single datagram on the socket. /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup. /// @@ -1360,7 +1360,7 @@ impl UdpSocket { /// Tries to receive a single datagram message on the socket. On success, /// returns the number of bytes read and the origin. /// - /// This method must be called with valid byte array buf of sufficient size + /// This method must be called with valid byte array `buf` of sufficient size /// to hold the message bytes. If a message is too long to fit in the /// supplied buffer, excess bytes may be discarded. /// @@ -1507,7 +1507,7 @@ impl UdpSocket { /// /// On Windows, if the data is larger than the buffer specified, the buffer /// is filled with the first part of the data, and `peek_from` returns the error - /// WSAEMSGSIZE(10040). The excess data is lost. + /// `WSAEMSGSIZE(10040)`. The excess data is lost. /// Make sure to always use a sufficiently large buffer to hold the /// maximum UDP packet size, which can be up to 65536 bytes in size. /// @@ -1555,13 +1555,13 @@ impl UdpSocket { /// /// # Notes /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup /// /// On Windows, if the data is larger than the buffer specified, the buffer /// is filled with the first part of the data, and peek returns the error - /// WSAEMSGSIZE(10040). The excess data is lost. + /// `WSAEMSGSIZE(10040)`. The excess data is lost. /// Make sure to always use a sufficiently large buffer to hold the /// maximum UDP packet size, which can be up to 65536 bytes in size. /// @@ -1623,7 +1623,7 @@ impl UdpSocket { /// /// On Windows, if the data is larger than the buffer specified, the buffer /// is filled with the first part of the data, and peek returns the error - /// WSAEMSGSIZE(10040). The excess data is lost. + /// `WSAEMSGSIZE(10040)`. The excess data is lost. /// Make sure to always use a sufficiently large buffer to hold the /// maximum UDP packet size, which can be up to 65536 bytes in size. /// @@ -1674,7 +1674,7 @@ impl UdpSocket { /// /// # Notes /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup. /// diff --git a/vendor/tokio/src/net/unix/datagram/socket.rs b/vendor/tokio/src/net/unix/datagram/socket.rs index d92ad5940..0da20f81f 100644 --- a/vendor/tokio/src/net/unix/datagram/socket.rs +++ b/vendor/tokio/src/net/unix/datagram/socket.rs @@ -96,10 +96,20 @@ cfg_net_unix! { } impl UnixDatagram { + pub(crate) fn from_mio(sys: mio::net::UnixDatagram) -> io::Result { + let datagram = UnixDatagram::new(sys)?; + + if let Some(e) = datagram.io.take_error()? { + return Err(e); + } + + Ok(datagram) + } + /// Waits for any of the requested ready states. /// /// This function is usually paired with `try_recv()` or `try_send()`. It - /// can be used to concurrently recv / send to the same socket on a single + /// can be used to concurrently `recv` / `send` to the same socket on a single /// task without splitting the socket. /// /// The function may complete without the socket being ready. This is a @@ -425,12 +435,12 @@ impl UnixDatagram { /// Creates new [`UnixDatagram`] from a [`std::os::unix::net::UnixDatagram`]. /// - /// This function is intended to be used to wrap a UnixDatagram from the + /// This function is intended to be used to wrap a `UnixDatagram` from the /// standard library in the Tokio equivalent. /// /// # Notes /// - /// The caller is responsible for ensuring that the socker is in + /// The caller is responsible for ensuring that the socket is in /// non-blocking mode. Otherwise all I/O operations on the socket /// will block the thread, which will cause unexpected behavior. /// Non-blocking mode can be set using [`set_nonblocking`]. @@ -1131,7 +1141,7 @@ impl UnixDatagram { /// Attempts to receive a single datagram on the specified address. /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup. /// @@ -1234,7 +1244,7 @@ impl UnixDatagram { /// The [`connect`] method will connect this socket to a remote address. This method /// resolves to an error if the socket is not connected. /// - /// Note that on multiple calls to a `poll_*` method in the recv direction, only the + /// Note that on multiple calls to a `poll_*` method in the `recv` direction, only the /// `Waker` from the `Context` passed to the most recent call will be scheduled to /// receive a wakeup. /// diff --git a/vendor/tokio/src/net/unix/listener.rs b/vendor/tokio/src/net/unix/listener.rs index a7e9115ea..79b554ee1 100644 --- a/vendor/tokio/src/net/unix/listener.rs +++ b/vendor/tokio/src/net/unix/listener.rs @@ -50,6 +50,11 @@ cfg_net_unix! { } impl UnixListener { + pub(crate) fn new(listener: mio::net::UnixListener) -> io::Result { + let io = PollEvented::new(listener)?; + Ok(UnixListener { io }) + } + /// Creates a new `UnixListener` bound to the specified path. /// /// # Panics @@ -72,7 +77,7 @@ impl UnixListener { /// Creates new [`UnixListener`] from a [`std::os::unix::net::UnixListener`]. /// - /// This function is intended to be used to wrap a UnixListener from the + /// This function is intended to be used to wrap a `UnixListener` from the /// standard library in the Tokio equivalent. /// /// # Notes diff --git a/vendor/tokio/src/net/unix/mod.rs b/vendor/tokio/src/net/unix/mod.rs index a49b70af3..a94fc7b27 100644 --- a/vendor/tokio/src/net/unix/mod.rs +++ b/vendor/tokio/src/net/unix/mod.rs @@ -7,6 +7,8 @@ pub mod datagram; pub(crate) mod listener; +pub(crate) mod socket; + mod split; pub use split::{ReadHalf, WriteHalf}; diff --git a/vendor/tokio/src/net/unix/pipe.rs b/vendor/tokio/src/net/unix/pipe.rs index 0b2508a92..7c279134d 100644 --- a/vendor/tokio/src/net/unix/pipe.rs +++ b/vendor/tokio/src/net/unix/pipe.rs @@ -6,8 +6,8 @@ use crate::io::{AsyncRead, AsyncWrite, PollEvented, ReadBuf, Ready}; use mio::unix::pipe as mio_pipe; use std::fs::File; use std::io::{self, Read, Write}; -use std::os::unix::fs::{FileTypeExt, OpenOptionsExt}; -use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd}; +use std::os::unix::fs::OpenOptionsExt; +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}; use std::path::Path; use std::pin::Pin; use std::task::{Context, Poll}; @@ -16,6 +16,59 @@ cfg_io_util! { use bytes::BufMut; } +/// Creates a new anonymous Unix pipe. +/// +/// This function will open a new pipe and associate both pipe ends with the default +/// event loop. +/// +/// If you need to create a pipe for communication with a spawned process, you can +/// use [`Stdio::piped()`] instead. +/// +/// [`Stdio::piped()`]: std::process::Stdio::piped +/// +/// # Errors +/// +/// If creating a pipe fails, this function will return with the related OS error. +/// +/// # Examples +/// +/// Create a pipe and pass the writing end to a spawned process. +/// +/// ```no_run +/// use tokio::net::unix::pipe; +/// use tokio::process::Command; +/// # use tokio::io::AsyncReadExt; +/// # use std::error::Error; +/// +/// # async fn dox() -> Result<(), Box> { +/// let (tx, mut rx) = pipe::pipe()?; +/// let mut buffer = String::new(); +/// +/// let status = Command::new("echo") +/// .arg("Hello, world!") +/// .stdout(tx.into_blocking_fd()?) +/// .status(); +/// rx.read_to_string(&mut buffer).await?; +/// +/// assert!(status.await?.success()); +/// assert_eq!(buffer, "Hello, world!\n"); +/// # Ok(()) +/// # } +/// ``` +/// +/// # Panics +/// +/// This function panics if it is not called from within a runtime with +/// IO enabled. +/// +/// The runtime is usually set implicitly when this function is called +/// from a future driven by a tokio runtime, otherwise runtime can be set +/// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. +pub fn pipe() -> io::Result<(Sender, Receiver)> { + let (tx, rx) = mio_pipe::new()?; + Ok((Sender::from_mio(tx)?, Receiver::from_mio(rx)?)) +} + /// Options and flags which can be used to configure how a FIFO file is opened. /// /// This builder allows configuring how to create a pipe end from a FIFO file. @@ -218,7 +271,7 @@ impl OpenOptions { let file = options.open(path)?; - if !self.unchecked && !is_fifo(&file)? { + if !self.unchecked && !is_pipe(file.as_fd())? { return Err(io::Error::new(io::ErrorKind::InvalidInput, "not a pipe")); } @@ -338,15 +391,40 @@ impl Sender { /// The runtime is usually set implicitly when this function is called /// from a future driven by a tokio runtime, otherwise runtime can be set /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. - pub fn from_file(mut file: File) -> io::Result { - if !is_fifo(&file)? { + pub fn from_file(file: File) -> io::Result { + Sender::from_owned_fd(file.into()) + } + + /// Creates a new `Sender` from an [`OwnedFd`]. + /// + /// This function is intended to construct a pipe from an [`OwnedFd`] representing + /// an anonymous pipe or a special FIFO file. It will check if the file descriptor + /// is a pipe and has write access, set it in non-blocking mode and perform the + /// conversion. + /// + /// # Errors + /// + /// Fails with `io::ErrorKind::InvalidInput` if the file descriptor is not a pipe + /// or it does not have write access. Also fails with any standard OS error if it + /// occurs. + /// + /// # Panics + /// + /// This function panics if it is not called from within a runtime with + /// IO enabled. + /// + /// The runtime is usually set implicitly when this function is called + /// from a future driven by a tokio runtime, otherwise runtime can be set + /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. + pub fn from_owned_fd(owned_fd: OwnedFd) -> io::Result { + if !is_pipe(owned_fd.as_fd())? { return Err(io::Error::new(io::ErrorKind::InvalidInput, "not a pipe")); } - let flags = get_file_flags(&file)?; + let flags = get_file_flags(owned_fd.as_fd())?; if has_write_access(flags) { - set_nonblocking(&mut file, flags)?; - Sender::from_file_unchecked(file) + set_nonblocking(owned_fd.as_fd(), flags)?; + Sender::from_owned_fd_unchecked(owned_fd) } else { Err(io::Error::new( io::ErrorKind::InvalidInput, @@ -394,8 +472,28 @@ impl Sender { /// from a future driven by a tokio runtime, otherwise runtime can be set /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. pub fn from_file_unchecked(file: File) -> io::Result { - let raw_fd = file.into_raw_fd(); - let mio_tx = unsafe { mio_pipe::Sender::from_raw_fd(raw_fd) }; + Sender::from_owned_fd_unchecked(file.into()) + } + + /// Creates a new `Sender` from an [`OwnedFd`] without checking pipe properties. + /// + /// This function is intended to construct a pipe from an [`OwnedFd`] representing + /// an anonymous pipe or a special FIFO file. The conversion assumes nothing about + /// the underlying pipe; it is left up to the user to make sure that the file + /// descriptor represents the writing end of a pipe and the pipe is set in + /// non-blocking mode. + /// + /// # Panics + /// + /// This function panics if it is not called from within a runtime with + /// IO enabled. + /// + /// The runtime is usually set implicitly when this function is called + /// from a future driven by a tokio runtime, otherwise runtime can be set + /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. + pub fn from_owned_fd_unchecked(owned_fd: OwnedFd) -> io::Result { + // Safety: OwnedFd represents a valid, open file descriptor. + let mio_tx = unsafe { mio_pipe::Sender::from_raw_fd(owned_fd.into_raw_fd()) }; Sender::from_mio(mio_tx) } @@ -623,6 +721,31 @@ impl Sender { .registration() .try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf)) } + + /// Converts the pipe into an [`OwnedFd`] in blocking mode. + /// + /// This function will deregister this pipe end from the event loop, set + /// it in blocking mode and perform the conversion. + pub fn into_blocking_fd(self) -> io::Result { + let fd = self.into_nonblocking_fd()?; + set_blocking(&fd)?; + Ok(fd) + } + + /// Converts the pipe into an [`OwnedFd`] in nonblocking mode. + /// + /// This function will deregister this pipe end from the event loop and + /// perform the conversion. The returned file descriptor will be in nonblocking + /// mode. + pub fn into_nonblocking_fd(self) -> io::Result { + let mio_pipe = self.io.into_inner()?; + + // Safety: the pipe is now deregistered from the event loop + // and we are the only owner of this pipe end. + let owned_fd = unsafe { OwnedFd::from_raw_fd(mio_pipe.into_raw_fd()) }; + + Ok(owned_fd) + } } impl AsyncWrite for Sender { @@ -764,15 +887,40 @@ impl Receiver { /// The runtime is usually set implicitly when this function is called /// from a future driven by a tokio runtime, otherwise runtime can be set /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. - pub fn from_file(mut file: File) -> io::Result { - if !is_fifo(&file)? { + pub fn from_file(file: File) -> io::Result { + Receiver::from_owned_fd(file.into()) + } + + /// Creates a new `Receiver` from an [`OwnedFd`]. + /// + /// This function is intended to construct a pipe from an [`OwnedFd`] representing + /// an anonymous pipe or a special FIFO file. It will check if the file descriptor + /// is a pipe and has read access, set it in non-blocking mode and perform the + /// conversion. + /// + /// # Errors + /// + /// Fails with `io::ErrorKind::InvalidInput` if the file descriptor is not a pipe + /// or it does not have read access. Also fails with any standard OS error if it + /// occurs. + /// + /// # Panics + /// + /// This function panics if it is not called from within a runtime with + /// IO enabled. + /// + /// The runtime is usually set implicitly when this function is called + /// from a future driven by a tokio runtime, otherwise runtime can be set + /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. + pub fn from_owned_fd(owned_fd: OwnedFd) -> io::Result { + if !is_pipe(owned_fd.as_fd())? { return Err(io::Error::new(io::ErrorKind::InvalidInput, "not a pipe")); } - let flags = get_file_flags(&file)?; + let flags = get_file_flags(owned_fd.as_fd())?; if has_read_access(flags) { - set_nonblocking(&mut file, flags)?; - Receiver::from_file_unchecked(file) + set_nonblocking(owned_fd.as_fd(), flags)?; + Receiver::from_owned_fd_unchecked(owned_fd) } else { Err(io::Error::new( io::ErrorKind::InvalidInput, @@ -820,8 +968,28 @@ impl Receiver { /// from a future driven by a tokio runtime, otherwise runtime can be set /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. pub fn from_file_unchecked(file: File) -> io::Result { - let raw_fd = file.into_raw_fd(); - let mio_rx = unsafe { mio_pipe::Receiver::from_raw_fd(raw_fd) }; + Receiver::from_owned_fd_unchecked(file.into()) + } + + /// Creates a new `Receiver` from an [`OwnedFd`] without checking pipe properties. + /// + /// This function is intended to construct a pipe from an [`OwnedFd`] representing + /// an anonymous pipe or a special FIFO file. The conversion assumes nothing about + /// the underlying pipe; it is left up to the user to make sure that the file + /// descriptor represents the reading end of a pipe and the pipe is set in + /// non-blocking mode. + /// + /// # Panics + /// + /// This function panics if it is not called from within a runtime with + /// IO enabled. + /// + /// The runtime is usually set implicitly when this function is called + /// from a future driven by a tokio runtime, otherwise runtime can be set + /// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function. + pub fn from_owned_fd_unchecked(owned_fd: OwnedFd) -> io::Result { + // Safety: OwnedFd represents a valid, open file descriptor. + let mio_rx = unsafe { mio_pipe::Receiver::from_raw_fd(owned_fd.into_raw_fd()) }; Receiver::from_mio(mio_rx) } @@ -1146,6 +1314,31 @@ impl Receiver { }) } } + + /// Converts the pipe into an [`OwnedFd`] in blocking mode. + /// + /// This function will deregister this pipe end from the event loop, set + /// it in blocking mode and perform the conversion. + pub fn into_blocking_fd(self) -> io::Result { + let fd = self.into_nonblocking_fd()?; + set_blocking(&fd)?; + Ok(fd) + } + + /// Converts the pipe into an [`OwnedFd`] in nonblocking mode. + /// + /// This function will deregister this pipe end from the event loop and + /// perform the conversion. Returned file descriptor will be in nonblocking + /// mode. + pub fn into_nonblocking_fd(self) -> io::Result { + let mio_pipe = self.io.into_inner()?; + + // Safety: the pipe is now deregistered from the event loop + // and we are the only owner of this pipe end. + let owned_fd = unsafe { OwnedFd::from_raw_fd(mio_pipe.into_raw_fd()) }; + + Ok(owned_fd) + } } impl AsyncRead for Receiver { @@ -1172,15 +1365,27 @@ impl AsFd for Receiver { } } -/// Checks if file is a FIFO -fn is_fifo(file: &File) -> io::Result { - Ok(file.metadata()?.file_type().is_fifo()) +/// Checks if the file descriptor is a pipe or a FIFO. +fn is_pipe(fd: BorrowedFd<'_>) -> io::Result { + // Safety: `libc::stat` is C-like struct used for syscalls and all-zero + // byte pattern forms a valid value. + let mut stat: libc::stat = unsafe { std::mem::zeroed() }; + + // Safety: it's safe to call `fstat` with a valid, open file descriptor + // and a valid pointer to a `stat` struct. + let r = unsafe { libc::fstat(fd.as_raw_fd(), &mut stat) }; + + if r == -1 { + Err(io::Error::last_os_error()) + } else { + Ok((stat.st_mode as libc::mode_t & libc::S_IFMT) == libc::S_IFIFO) + } } /// Gets file descriptor's flags by fcntl. -fn get_file_flags(file: &File) -> io::Result { - let fd = file.as_raw_fd(); - let flags = unsafe { libc::fcntl(fd, libc::F_GETFL) }; +fn get_file_flags(fd: BorrowedFd<'_>) -> io::Result { + // Safety: it's safe to use `fcntl` to read flags of a valid, open file descriptor. + let flags = unsafe { libc::fcntl(fd.as_raw_fd(), libc::F_GETFL) }; if flags < 0 { Err(io::Error::last_os_error()) } else { @@ -1200,14 +1405,14 @@ fn has_write_access(flags: libc::c_int) -> bool { mode == libc::O_WRONLY || mode == libc::O_RDWR } -/// Sets file's flags with `O_NONBLOCK` by fcntl. -fn set_nonblocking(file: &mut File, current_flags: libc::c_int) -> io::Result<()> { - let fd = file.as_raw_fd(); - +/// Sets file descriptor's flags with `O_NONBLOCK` by fcntl. +fn set_nonblocking(fd: BorrowedFd<'_>, current_flags: libc::c_int) -> io::Result<()> { let flags = current_flags | libc::O_NONBLOCK; if flags != current_flags { - let ret = unsafe { libc::fcntl(fd, libc::F_SETFL, flags) }; + // Safety: it's safe to use `fcntl` to set the `O_NONBLOCK` flag of a valid, + // open file descriptor. + let ret = unsafe { libc::fcntl(fd.as_raw_fd(), libc::F_SETFL, flags) }; if ret < 0 { return Err(io::Error::last_os_error()); } @@ -1215,3 +1420,23 @@ fn set_nonblocking(file: &mut File, current_flags: libc::c_int) -> io::Result<() Ok(()) } + +/// Removes `O_NONBLOCK` from fd's flags. +fn set_blocking(fd: &T) -> io::Result<()> { + // Safety: it's safe to use `fcntl` to read flags of a valid, open file descriptor. + let previous = unsafe { libc::fcntl(fd.as_raw_fd(), libc::F_GETFL) }; + if previous == -1 { + return Err(io::Error::last_os_error()); + } + + let new = previous & !libc::O_NONBLOCK; + + // Safety: it's safe to use `fcntl` to unset the `O_NONBLOCK` flag of a valid, + // open file descriptor. + let r = unsafe { libc::fcntl(fd.as_raw_fd(), libc::F_SETFL, new) }; + if r == -1 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } +} diff --git a/vendor/tokio/src/net/unix/socket.rs b/vendor/tokio/src/net/unix/socket.rs new file mode 100644 index 000000000..cb383b09a --- /dev/null +++ b/vendor/tokio/src/net/unix/socket.rs @@ -0,0 +1,271 @@ +use std::io; +use std::path::Path; + +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd}; + +use crate::net::{UnixDatagram, UnixListener, UnixStream}; + +cfg_net_unix! { + /// A Unix socket that has not yet been converted to a [`UnixStream`], [`UnixDatagram`], or + /// [`UnixListener`]. + /// + /// `UnixSocket` wraps an operating system socket and enables the caller to + /// configure the socket before establishing a connection or accepting + /// inbound connections. The caller is able to set socket option and explicitly + /// bind the socket with a socket address. + /// + /// The underlying socket is closed when the `UnixSocket` value is dropped. + /// + /// `UnixSocket` should only be used directly if the default configuration used + /// by [`UnixStream::connect`], [`UnixDatagram::bind`], and [`UnixListener::bind`] + /// does not meet the required use case. + /// + /// Calling `UnixStream::connect(path)` effectively performs the same function as: + /// + /// ```no_run + /// use tokio::net::UnixSocket; + /// use std::error::Error; + /// + /// #[tokio::main] + /// async fn main() -> Result<(), Box> { + /// let dir = tempfile::tempdir().unwrap(); + /// let path = dir.path().join("bind_path"); + /// let socket = UnixSocket::new_stream()?; + /// + /// let stream = socket.connect(path).await?; + /// + /// Ok(()) + /// } + /// ``` + /// + /// Calling `UnixDatagram::bind(path)` effectively performs the same function as: + /// + /// ```no_run + /// use tokio::net::UnixSocket; + /// use std::error::Error; + /// + /// #[tokio::main] + /// async fn main() -> Result<(), Box> { + /// let dir = tempfile::tempdir().unwrap(); + /// let path = dir.path().join("bind_path"); + /// let socket = UnixSocket::new_datagram()?; + /// socket.bind(path)?; + /// + /// let datagram = socket.datagram()?; + /// + /// Ok(()) + /// } + /// ``` + /// + /// Calling `UnixListener::bind(path)` effectively performs the same function as: + /// + /// ```no_run + /// use tokio::net::UnixSocket; + /// use std::error::Error; + /// + /// #[tokio::main] + /// async fn main() -> Result<(), Box> { + /// let dir = tempfile::tempdir().unwrap(); + /// let path = dir.path().join("bind_path"); + /// let socket = UnixSocket::new_stream()?; + /// socket.bind(path)?; + /// + /// let listener = socket.listen(1024)?; + /// + /// Ok(()) + /// } + /// ``` + /// + /// Setting socket options not explicitly provided by `UnixSocket` may be done by + /// accessing the [`RawFd`]/[`RawSocket`] using [`AsRawFd`]/[`AsRawSocket`] and + /// setting the option with a crate like [`socket2`]. + /// + /// [`RawFd`]: std::os::fd::RawFd + /// [`RawSocket`]: https://doc.rust-lang.org/std/os/windows/io/type.RawSocket.html + /// [`AsRawFd`]: std::os::fd::AsRawFd + /// [`AsRawSocket`]: https://doc.rust-lang.org/std/os/windows/io/trait.AsRawSocket.html + /// [`socket2`]: https://docs.rs/socket2/ + #[derive(Debug)] + pub struct UnixSocket { + inner: socket2::Socket, + } +} + +impl UnixSocket { + fn ty(&self) -> socket2::Type { + self.inner.r#type().unwrap() + } + + /// Creates a new Unix datagram socket. + /// + /// Calls `socket(2)` with `AF_UNIX` and `SOCK_DGRAM`. + /// + /// # Returns + /// + /// On success, the newly created [`UnixSocket`] is returned. If an error is + /// encountered, it is returned instead. + pub fn new_datagram() -> io::Result { + UnixSocket::new(socket2::Type::DGRAM) + } + + /// Creates a new Unix stream socket. + /// + /// Calls `socket(2)` with `AF_UNIX` and `SOCK_STREAM`. + /// + /// # Returns + /// + /// On success, the newly created [`UnixSocket`] is returned. If an error is + /// encountered, it is returned instead. + pub fn new_stream() -> io::Result { + UnixSocket::new(socket2::Type::STREAM) + } + + fn new(ty: socket2::Type) -> io::Result { + #[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd" + ))] + let ty = ty.nonblocking(); + let inner = socket2::Socket::new(socket2::Domain::UNIX, ty, None)?; + #[cfg(not(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd" + )))] + inner.set_nonblocking(true)?; + Ok(UnixSocket { inner }) + } + + /// Binds the socket to the given address. + /// + /// This calls the `bind(2)` operating-system function. + pub fn bind(&self, path: impl AsRef) -> io::Result<()> { + let addr = socket2::SockAddr::unix(path)?; + self.inner.bind(&addr) + } + + /// Converts the socket into a `UnixListener`. + /// + /// `backlog` defines the maximum number of pending connections are queued + /// by the operating system at any given time. Connection are removed from + /// the queue with [`UnixListener::accept`]. When the queue is full, the + /// operating-system will start rejecting connections. + /// + /// Calling this function on a socket created by [`new_datagram`] will return an error. + /// + /// This calls the `listen(2)` operating-system function, marking the socket + /// as a passive socket. + /// + /// [`new_datagram`]: `UnixSocket::new_datagram` + pub fn listen(self, backlog: u32) -> io::Result { + if self.ty() == socket2::Type::DGRAM { + return Err(io::Error::new( + io::ErrorKind::Other, + "listen cannot be called on a datagram socket", + )); + } + + self.inner.listen(backlog as i32)?; + let mio = { + use std::os::unix::io::{FromRawFd, IntoRawFd}; + + let raw_fd = self.inner.into_raw_fd(); + unsafe { mio::net::UnixListener::from_raw_fd(raw_fd) } + }; + + UnixListener::new(mio) + } + + /// Establishes a Unix connection with a peer at the specified socket address. + /// + /// The `UnixSocket` is consumed. Once the connection is established, a + /// connected [`UnixStream`] is returned. If the connection fails, the + /// encountered error is returned. + /// + /// Calling this function on a socket created by [`new_datagram`] will return an error. + /// + /// This calls the `connect(2)` operating-system function. + /// + /// [`new_datagram`]: `UnixSocket::new_datagram` + pub async fn connect(self, path: impl AsRef) -> io::Result { + if self.ty() == socket2::Type::DGRAM { + return Err(io::Error::new( + io::ErrorKind::Other, + "connect cannot be called on a datagram socket", + )); + } + + let addr = socket2::SockAddr::unix(path)?; + if let Err(err) = self.inner.connect(&addr) { + if err.raw_os_error() != Some(libc::EINPROGRESS) { + return Err(err); + } + } + let mio = { + use std::os::unix::io::{FromRawFd, IntoRawFd}; + + let raw_fd = self.inner.into_raw_fd(); + unsafe { mio::net::UnixStream::from_raw_fd(raw_fd) } + }; + + UnixStream::connect_mio(mio).await + } + + /// Converts the socket into a [`UnixDatagram`]. + /// + /// Calling this function on a socket created by [`new_stream`] will return an error. + /// + /// [`new_stream`]: `UnixSocket::new_stream` + pub fn datagram(self) -> io::Result { + if self.ty() == socket2::Type::STREAM { + return Err(io::Error::new( + io::ErrorKind::Other, + "datagram cannot be called on a stream socket", + )); + } + let mio = { + use std::os::unix::io::{FromRawFd, IntoRawFd}; + + let raw_fd = self.inner.into_raw_fd(); + unsafe { mio::net::UnixDatagram::from_raw_fd(raw_fd) } + }; + + UnixDatagram::from_mio(mio) + } +} + +impl AsRawFd for UnixSocket { + fn as_raw_fd(&self) -> RawFd { + self.inner.as_raw_fd() + } +} + +impl AsFd for UnixSocket { + fn as_fd(&self) -> BorrowedFd<'_> { + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } + } +} + +impl FromRawFd for UnixSocket { + unsafe fn from_raw_fd(fd: RawFd) -> UnixSocket { + let inner = socket2::Socket::from_raw_fd(fd); + UnixSocket { inner } + } +} + +impl IntoRawFd for UnixSocket { + fn into_raw_fd(self) -> RawFd { + self.inner.into_raw_fd() + } +} diff --git a/vendor/tokio/src/net/unix/stream.rs b/vendor/tokio/src/net/unix/stream.rs index 4821260ff..60d581396 100644 --- a/vendor/tokio/src/net/unix/stream.rs +++ b/vendor/tokio/src/net/unix/stream.rs @@ -39,6 +39,24 @@ cfg_net_unix! { } impl UnixStream { + pub(crate) async fn connect_mio(sys: mio::net::UnixStream) -> io::Result { + let stream = UnixStream::new(sys)?; + + // Once we've connected, wait for the stream to be writable as + // that's when the actual connection has been initiated. Once we're + // writable we check for `take_socket_error` to see if the connect + // actually hit an error or not. + // + // If all that succeeded then we ship everything on up. + poll_fn(|cx| stream.io.registration().poll_write_ready(cx)).await?; + + if let Some(e) = stream.io.take_error()? { + return Err(e); + } + + Ok(stream) + } + /// Connects to the socket named by `path`. /// /// This function will create a new Unix socket and connect to the path @@ -744,7 +762,7 @@ impl UnixStream { /// Creates new [`UnixStream`] from a [`std::os::unix::net::UnixStream`]. /// - /// This function is intended to be used to wrap a UnixStream from the + /// This function is intended to be used to wrap a `UnixStream` from the /// standard library in the Tokio equivalent. /// /// # Notes diff --git a/vendor/tokio/src/net/unix/ucred.rs b/vendor/tokio/src/net/unix/ucred.rs index dcd4deddf..cb0ee5194 100644 --- a/vendor/tokio/src/net/unix/ucred.rs +++ b/vendor/tokio/src/net/unix/ucred.rs @@ -45,7 +45,12 @@ pub(crate) use self::impl_netbsd::get_peer_cred; #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] pub(crate) use self::impl_bsd::get_peer_cred; -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos" +))] pub(crate) use self::impl_macos::get_peer_cred; #[cfg(any(target_os = "solaris", target_os = "illumos"))] @@ -187,7 +192,12 @@ pub(crate) mod impl_bsd { } } -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos" +))] pub(crate) mod impl_macos { use crate::net::unix::{self, UnixStream}; diff --git a/vendor/tokio/src/net/windows/named_pipe.rs b/vendor/tokio/src/net/windows/named_pipe.rs index a03e1d0ac..98e63f0c4 100644 --- a/vendor/tokio/src/net/windows/named_pipe.rs +++ b/vendor/tokio/src/net/windows/named_pipe.rs @@ -2059,7 +2059,7 @@ impl ServerOptions { /// /// ``` /// use std::{io, os::windows::prelude::AsRawHandle, ptr}; - // + /// /// use tokio::net::windows::named_pipe::ServerOptions; /// use windows_sys::{ /// Win32::Foundation::ERROR_SUCCESS, @@ -2094,7 +2094,7 @@ impl ServerOptions { /// /// ``` /// use std::{io, os::windows::prelude::AsRawHandle, ptr}; - // + /// /// use tokio::net::windows::named_pipe::ServerOptions; /// use windows_sys::{ /// Win32::Foundation::ERROR_ACCESS_DENIED, diff --git a/vendor/tokio/src/process/mod.rs b/vendor/tokio/src/process/mod.rs index 60c343047..0fad67cd0 100644 --- a/vendor/tokio/src/process/mod.rs +++ b/vendor/tokio/src/process/mod.rs @@ -739,15 +739,15 @@ impl Command { } /// Sets the process group ID (PGID) of the child process. Equivalent to a - /// setpgid call in the child process, but may be more efficient. + /// `setpgid` call in the child process, but may be more efficient. /// /// Process groups determine which processes receive signals. /// /// **Note**: This is an [unstable API][unstable] but will be stabilised once - /// tokio's MSRV is sufficiently new. See [the documentation on + /// tokio's `MSRV` is sufficiently new. See [the documentation on /// unstable features][unstable] for details about using unstable features. /// - /// If you want similar behaviour without using this unstable feature you can + /// If you want similar behavior without using this unstable feature you can /// create a [`std::process::Command`] and convert that into a /// [`tokio::process::Command`] using the `From` trait. /// @@ -1109,7 +1109,7 @@ impl Child { /// Attempts to force the child to exit, but does not wait for the request /// to take effect. /// - /// On Unix platforms, this is the equivalent to sending a SIGKILL. Note + /// On Unix platforms, this is the equivalent to sending a `SIGKILL`. Note /// that on Unix platforms it is possible for a zombie process to remain /// after a kill is sent; to avoid this, the caller should ensure that either /// `child.wait().await` or `child.try_wait()` is invoked successfully. @@ -1125,12 +1125,12 @@ impl Child { /// Forces the child to exit. /// - /// This is equivalent to sending a SIGKILL on unix platforms. + /// This is equivalent to sending a `SIGKILL` on unix platforms. /// /// If the child has to be killed remotely, it is possible to do it using - /// a combination of the select! macro and a oneshot channel. In the following + /// a combination of the select! macro and a `oneshot` channel. In the following /// example, the child will run until completion unless a message is sent on - /// the oneshot channel. If that happens, the child is killed immediately + /// the `oneshot` channel. If that happens, the child is killed immediately /// using the `.kill()` method. /// /// ```no_run diff --git a/vendor/tokio/src/process/unix/mod.rs b/vendor/tokio/src/process/unix/mod.rs index 5b55b7a52..c9d1035f5 100644 --- a/vendor/tokio/src/process/unix/mod.rs +++ b/vendor/tokio/src/process/unix/mod.rs @@ -27,6 +27,9 @@ use orphan::{OrphanQueue, OrphanQueueImpl, Wait}; mod reap; use reap::Reaper; +#[cfg(all(target_os = "linux", feature = "rt"))] +mod pidfd_reaper; + use crate::io::{AsyncRead, AsyncWrite, PollEvented, ReadBuf}; use crate::process::kill::Kill; use crate::process::SpawnedChild; @@ -100,15 +103,15 @@ impl OrphanQueue for GlobalOrphanQueue { } #[must_use = "futures do nothing unless polled"] -pub(crate) struct Child { - inner: Reaper, +pub(crate) enum Child { + SignalReaper(Reaper), + #[cfg(all(target_os = "linux", feature = "rt"))] + PidfdReaper(pidfd_reaper::PidfdReaper), } impl fmt::Debug for Child { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("Child") - .field("pid", &self.inner.id()) - .finish() + fmt.debug_struct("Child").field("pid", &self.id()).finish() } } @@ -118,12 +121,24 @@ pub(crate) fn spawn_child(cmd: &mut std::process::Command) -> io::Result { + return Ok(SpawnedChild { + child: Child::PidfdReaper(pidfd_reaper), + stdin, + stdout, + stderr, + }) + } + Err((Some(err), _child)) => return Err(err), + Err((None, child_returned)) => child = child_returned, + } + let signal = signal(SignalKind::child())?; Ok(SpawnedChild { - child: Child { - inner: Reaper::new(child, GlobalOrphanQueue, signal), - }, + child: Child::SignalReaper(Reaper::new(child, GlobalOrphanQueue, signal)), stdin, stdout, stderr, @@ -132,25 +147,41 @@ pub(crate) fn spawn_child(cmd: &mut std::process::Command) -> io::Result u32 { - self.inner.id() + match self { + Self::SignalReaper(signal_reaper) => signal_reaper.id(), + #[cfg(all(target_os = "linux", feature = "rt"))] + Self::PidfdReaper(pidfd_reaper) => pidfd_reaper.id(), + } + } + + fn std_child(&mut self) -> &mut StdChild { + match self { + Self::SignalReaper(signal_reaper) => signal_reaper.inner_mut(), + #[cfg(all(target_os = "linux", feature = "rt"))] + Self::PidfdReaper(pidfd_reaper) => pidfd_reaper.inner_mut(), + } } pub(crate) fn try_wait(&mut self) -> io::Result> { - self.inner.inner_mut().try_wait() + self.std_child().try_wait() } } impl Kill for Child { fn kill(&mut self) -> io::Result<()> { - self.inner.kill() + self.std_child().kill() } } impl Future for Child { type Output = io::Result; - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - Pin::new(&mut self.inner).poll(cx) + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + match Pin::into_inner(self) { + Self::SignalReaper(signal_reaper) => Pin::new(signal_reaper).poll(cx), + #[cfg(all(target_os = "linux", feature = "rt"))] + Self::PidfdReaper(pidfd_reaper) => Pin::new(pidfd_reaper).poll(cx), + } } } diff --git a/vendor/tokio/src/process/unix/pidfd_reaper.rs b/vendor/tokio/src/process/unix/pidfd_reaper.rs new file mode 100644 index 000000000..45d23471f --- /dev/null +++ b/vendor/tokio/src/process/unix/pidfd_reaper.rs @@ -0,0 +1,317 @@ +use crate::{ + io::{interest::Interest, PollEvented}, + process::{ + imp::{orphan::Wait, OrphanQueue}, + kill::Kill, + }, + util::error::RUNTIME_SHUTTING_DOWN_ERROR, +}; + +use libc::{syscall, SYS_pidfd_open, ENOSYS, PIDFD_NONBLOCK}; +use mio::{event::Source, unix::SourceFd}; +use std::{ + fs::File, + future::Future, + io, + marker::Unpin, + ops::Deref, + os::unix::io::{AsRawFd, FromRawFd, RawFd}, + pin::Pin, + process::ExitStatus, + sync::atomic::{AtomicBool, Ordering::Relaxed}, + task::{Context, Poll}, +}; + +#[derive(Debug)] +struct Pidfd { + fd: File, +} + +impl Pidfd { + fn open(pid: u32) -> Option { + // Store false (0) to reduce executable size + static NO_PIDFD_SUPPORT: AtomicBool = AtomicBool::new(false); + + if NO_PIDFD_SUPPORT.load(Relaxed) { + return None; + } + + // Safety: The following function calls invovkes syscall pidfd_open, + // which takes two parameter: pidfd_open(fd: c_int, flag: c_int) + let fd = unsafe { syscall(SYS_pidfd_open, pid, PIDFD_NONBLOCK) }; + if fd == -1 { + let errno = io::Error::last_os_error().raw_os_error().unwrap(); + + if errno == ENOSYS { + NO_PIDFD_SUPPORT.store(true, Relaxed) + } + + None + } else { + // Safety: pidfd_open returns -1 on error or a valid fd with ownership. + Some(Pidfd { + fd: unsafe { File::from_raw_fd(fd as i32) }, + }) + } + } +} + +impl AsRawFd for Pidfd { + fn as_raw_fd(&self) -> RawFd { + self.fd.as_raw_fd() + } +} + +impl Source for Pidfd { + fn register( + &mut self, + registry: &mio::Registry, + token: mio::Token, + interest: mio::Interest, + ) -> io::Result<()> { + SourceFd(&self.as_raw_fd()).register(registry, token, interest) + } + + fn reregister( + &mut self, + registry: &mio::Registry, + token: mio::Token, + interest: mio::Interest, + ) -> io::Result<()> { + SourceFd(&self.as_raw_fd()).reregister(registry, token, interest) + } + + fn deregister(&mut self, registry: &mio::Registry) -> io::Result<()> { + SourceFd(&self.as_raw_fd()).deregister(registry) + } +} + +#[derive(Debug)] +struct PidfdReaperInner +where + W: Unpin, +{ + inner: W, + pidfd: PollEvented, +} + +#[allow(deprecated)] +fn is_rt_shutdown_err(err: &io::Error) -> bool { + if let Some(inner) = err.get_ref() { + // Using `Error::description()` is more efficient than `format!("{inner}")`, + // so we use it here even if it is deprecated. + err.kind() == io::ErrorKind::Other + && inner.source().is_none() + && inner.description() == RUNTIME_SHUTTING_DOWN_ERROR + } else { + false + } +} + +impl Future for PidfdReaperInner +where + W: Wait + Unpin, +{ + type Output = io::Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let this = Pin::into_inner(self); + + match ready!(this.pidfd.poll_read_ready(cx)) { + Err(err) if is_rt_shutdown_err(&err) => { + this.pidfd.reregister(Interest::READABLE)?; + ready!(this.pidfd.poll_read_ready(cx))? + } + res => res?, + } + Poll::Ready(Ok(this + .inner + .try_wait()? + .expect("pidfd is ready to read, the process should have exited"))) + } +} + +#[derive(Debug)] +pub(crate) struct PidfdReaper +where + W: Wait + Unpin, + Q: OrphanQueue + Unpin, +{ + inner: Option>, + orphan_queue: Q, +} + +impl Deref for PidfdReaper +where + W: Wait + Unpin, + Q: OrphanQueue + Unpin, +{ + type Target = W; + + fn deref(&self) -> &Self::Target { + &self.inner.as_ref().expect("inner has gone away").inner + } +} + +impl PidfdReaper +where + W: Wait + Unpin, + Q: OrphanQueue + Unpin, +{ + pub(crate) fn new(inner: W, orphan_queue: Q) -> Result, W)> { + if let Some(pidfd) = Pidfd::open(inner.id()) { + match PollEvented::new_with_interest(pidfd, Interest::READABLE) { + Ok(pidfd) => Ok(Self { + inner: Some(PidfdReaperInner { pidfd, inner }), + orphan_queue, + }), + Err(io_error) => Err((Some(io_error), inner)), + } + } else { + Err((None, inner)) + } + } + + pub(crate) fn inner_mut(&mut self) -> &mut W { + &mut self.inner.as_mut().expect("inner has gone away").inner + } +} + +impl Future for PidfdReaper +where + W: Wait + Unpin, + Q: OrphanQueue + Unpin, +{ + type Output = io::Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + Pin::new( + Pin::into_inner(self) + .inner + .as_mut() + .expect("inner has gone away"), + ) + .poll(cx) + } +} + +impl Kill for PidfdReaper +where + W: Wait + Unpin + Kill, + Q: OrphanQueue + Unpin, +{ + fn kill(&mut self) -> io::Result<()> { + self.inner_mut().kill() + } +} + +impl Drop for PidfdReaper +where + W: Wait + Unpin, + Q: OrphanQueue + Unpin, +{ + fn drop(&mut self) { + let mut orphan = self.inner.take().expect("inner has gone away").inner; + if let Ok(Some(_)) = orphan.try_wait() { + return; + } + + self.orphan_queue.push_orphan(orphan); + } +} + +#[cfg(all(test, not(loom), not(miri)))] +mod test { + use super::*; + use crate::{ + process::unix::orphan::test::MockQueue, + runtime::{Builder as RuntimeBuilder, Runtime}, + }; + use std::process::{Command, Output}; + + fn create_runtime() -> Runtime { + RuntimeBuilder::new_current_thread() + .enable_io() + .build() + .unwrap() + } + + fn run_test(fut: impl Future) { + create_runtime().block_on(fut) + } + + fn is_pidfd_available() -> bool { + let Output { stdout, status, .. } = Command::new("uname").arg("-r").output().unwrap(); + assert!(status.success()); + let stdout = String::from_utf8_lossy(&stdout); + + let mut kernel_version_iter = stdout.split_once('-').unwrap().0.split('.'); + let major: u32 = kernel_version_iter.next().unwrap().parse().unwrap(); + let minor: u32 = kernel_version_iter.next().unwrap().parse().unwrap(); + + major >= 6 || (major == 5 && minor >= 10) + } + + #[test] + fn test_pidfd_reaper_poll() { + if !is_pidfd_available() { + eprintln!("pidfd is not available on this linux kernel, skip this test"); + return; + } + + let queue = MockQueue::new(); + + run_test(async { + let child = Command::new("true").spawn().unwrap(); + let pidfd_reaper = PidfdReaper::new(child, &queue).unwrap(); + + let exit_status = pidfd_reaper.await.unwrap(); + assert!(exit_status.success()); + }); + + assert!(queue.all_enqueued.borrow().is_empty()); + } + + #[test] + fn test_pidfd_reaper_kill() { + if !is_pidfd_available() { + eprintln!("pidfd is not available on this linux kernel, skip this test"); + return; + } + + let queue = MockQueue::new(); + + run_test(async { + let child = Command::new("sleep").arg("1800").spawn().unwrap(); + let mut pidfd_reaper = PidfdReaper::new(child, &queue).unwrap(); + + pidfd_reaper.kill().unwrap(); + + let exit_status = pidfd_reaper.await.unwrap(); + assert!(!exit_status.success()); + }); + + assert!(queue.all_enqueued.borrow().is_empty()); + } + + #[test] + fn test_pidfd_reaper_drop() { + if !is_pidfd_available() { + eprintln!("pidfd is not available on this linux kernel, skip this test"); + return; + } + + let queue = MockQueue::new(); + + let mut child = Command::new("sleep").arg("1800").spawn().unwrap(); + + run_test(async { + let _pidfd_reaper = PidfdReaper::new(&mut child, &queue).unwrap(); + }); + + assert_eq!(queue.all_enqueued.borrow().len(), 1); + + child.kill().unwrap(); + child.wait().unwrap(); + } +} diff --git a/vendor/tokio/src/runtime/blocking/pool.rs b/vendor/tokio/src/runtime/blocking/pool.rs index 3b6de8d79..c74aea765 100644 --- a/vendor/tokio/src/runtime/blocking/pool.rs +++ b/vendor/tokio/src/runtime/blocking/pool.rs @@ -105,16 +105,16 @@ struct Shared { num_notify: u32, shutdown: bool, shutdown_tx: Option, - /// Prior to shutdown, we clean up JoinHandles by having each timed-out + /// Prior to shutdown, we clean up `JoinHandles` by having each timed-out /// thread join on the previous timed-out thread. This is not strictly /// necessary but helps avoid Valgrind false positives, see /// /// for more information. last_exiting_thread: Option>, - /// This holds the JoinHandles for all running threads; on shutdown, the thread + /// This holds the `JoinHandles` for all running threads; on shutdown, the thread /// calling shutdown handles joining on these. worker_threads: HashMap>, - /// This is a counter used to iterate worker_threads in a consistent order (for loom's + /// This is a counter used to iterate `worker_threads` in a consistent order (for loom's /// benefit). worker_thread_index: usize, } diff --git a/vendor/tokio/src/runtime/builder.rs b/vendor/tokio/src/runtime/builder.rs index fabafd103..e20a3c495 100644 --- a/vendor/tokio/src/runtime/builder.rs +++ b/vendor/tokio/src/runtime/builder.rs @@ -78,7 +78,7 @@ pub struct Builder { /// To run after each thread is unparked. pub(super) after_unpark: Option, - /// Customizable keep alive timeout for BlockingPool + /// Customizable keep alive timeout for `BlockingPool` pub(super) keep_alive: Option, /// How many ticks before pulling a task from the global/remote queue? @@ -723,7 +723,7 @@ impl Builder { /// Sets a custom timeout for a thread in the blocking pool. /// /// By default, the timeout for a thread is set to 10 seconds. This can - /// be overridden using .thread_keep_alive(). + /// be overridden using `.thread_keep_alive()`. /// /// # Example /// @@ -746,10 +746,8 @@ impl Builder { /// /// A scheduler "tick" roughly corresponds to one `poll` invocation on a task. /// - /// By default the global queue interval is: - /// - /// * `31` for the current-thread scheduler. - /// * `61` for the multithreaded scheduler. + /// By default the global queue interval is 31 for the current-thread scheduler. Please see + /// [the module documentation] for the default behavior of the multi-thread scheduler. /// /// Schedulers have a local queue of already-claimed tasks, and a global queue of incoming /// tasks. Setting the interval to a smaller value increases the fairness of the scheduler, @@ -758,6 +756,8 @@ impl Builder { /// or await on further I/O. Conversely, a higher value prioritizes existing work, and /// is a good choice when most tasks quickly complete polling. /// + /// [the module documentation]: crate::runtime#multi-threaded-runtime-behavior-at-the-time-of-writing + /// /// # Examples /// /// ``` @@ -1279,7 +1279,6 @@ cfg_rt_multi_thread! { use crate::runtime::scheduler::MultiThreadAlt; let core_threads = self.worker_threads.unwrap_or_else(num_cpus); - let (driver, driver_handle) = driver::Driver::new(self.get_cfg())?; // Create the blocking pool diff --git a/vendor/tokio/src/runtime/context.rs b/vendor/tokio/src/runtime/context.rs index c49c08932..62e4fc947 100644 --- a/vendor/tokio/src/runtime/context.rs +++ b/vendor/tokio/src/runtime/context.rs @@ -61,7 +61,7 @@ struct Context { rng: Cell>, /// Tracks the amount of "work" a task may still do before yielding back to - /// the sheduler + /// the scheduler budget: Cell, #[cfg(all( @@ -178,7 +178,9 @@ cfg_rt! { #[track_caller] pub(super) fn with_scheduler(f: impl FnOnce(Option<&scheduler::Context>) -> R) -> R { - CONTEXT.with(|c| c.scheduler.with(f)) + let mut f = Some(f); + CONTEXT.try_with(|c| c.scheduler.with(f.take().unwrap())) + .unwrap_or_else(|_| (f.take().unwrap())(None)) } cfg_taskdump! { diff --git a/vendor/tokio/src/runtime/handle.rs b/vendor/tokio/src/runtime/handle.rs index 91be19ed8..7e7e5636c 100644 --- a/vendor/tokio/src/runtime/handle.rs +++ b/vendor/tokio/src/runtime/handle.rs @@ -463,7 +463,7 @@ cfg_taskdump! { /// ## Debug Info Must Be Available /// /// To produce task traces, the application must **not** be compiled - /// with split debuginfo. On Linux, including debuginfo within the + /// with `split debuginfo`. On Linux, including `debuginfo` within the /// application binary is the (correct) default. You can further ensure /// this behavior with the following directive in your `Cargo.toml`: /// @@ -475,7 +475,7 @@ cfg_taskdump! { /// ## Unstable Features /// /// This functionality is **unstable**, and requires both the - /// `tokio_unstable` and `tokio_taskdump` cfg flags to be set. + /// `tokio_unstable` and `tokio_taskdump` `cfg` flags to be set. /// /// You can do this by setting the `RUSTFLAGS` environment variable /// before invoking `cargo`; e.g.: @@ -487,7 +487,7 @@ cfg_taskdump! { /// `.cargo/config.toml`: /// ```text /// [build] - /// rustflags = ["--cfg tokio_unstable", "--cfg tokio_taskdump"] + /// rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"] /// ``` /// /// [cargo-config]: @@ -495,7 +495,7 @@ cfg_taskdump! { /// /// ## Platform Requirements /// - /// Task dumps are supported on Linux atop aarch64, x86 and x86_64. + /// Task dumps are supported on Linux atop `aarch64`, `x86` and `x86_64`. /// /// ## Current Thread Runtime Requirements /// diff --git a/vendor/tokio/src/runtime/id.rs b/vendor/tokio/src/runtime/id.rs index 58551d499..8c6df7fce 100644 --- a/vendor/tokio/src/runtime/id.rs +++ b/vendor/tokio/src/runtime/id.rs @@ -1,5 +1,5 @@ use std::fmt; -use std::num::NonZeroU64; +use std::num::{NonZeroU32, NonZeroU64}; /// An opaque ID that uniquely identifies a runtime relative to all other currently /// running runtimes. @@ -39,6 +39,12 @@ impl From for Id { } } +impl From for Id { + fn from(value: NonZeroU32) -> Self { + Id(value.into()) + } +} + impl fmt::Display for Id { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) diff --git a/vendor/tokio/src/runtime/io/driver.rs b/vendor/tokio/src/runtime/io/driver.rs index c34a2ac06..bece3560b 100644 --- a/vendor/tokio/src/runtime/io/driver.rs +++ b/vendor/tokio/src/runtime/io/driver.rs @@ -40,7 +40,7 @@ pub(crate) struct Handle { synced: Mutex, /// Used to wake up the reactor from a call to `turn`. - /// Not supported on Wasi due to lack of threading support. + /// Not supported on `Wasi` due to lack of threading support. #[cfg(not(target_os = "wasi"))] waker: mio::Waker, diff --git a/vendor/tokio/src/runtime/io/registration.rs b/vendor/tokio/src/runtime/io/registration.rs index 759589863..dc5961086 100644 --- a/vendor/tokio/src/runtime/io/registration.rs +++ b/vendor/tokio/src/runtime/io/registration.rs @@ -219,11 +219,16 @@ impl Registration { loop { let event = self.readiness(interest).await?; + let coop = crate::future::poll_fn(crate::runtime::coop::poll_proceed).await; + match f() { Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { self.clear_readiness(event); } - x => return x, + x => { + coop.made_progress(); + return x; + } } } } diff --git a/vendor/tokio/src/runtime/io/scheduled_io.rs b/vendor/tokio/src/runtime/io/scheduled_io.rs index c214beff0..527bb9808 100644 --- a/vendor/tokio/src/runtime/io/scheduled_io.rs +++ b/vendor/tokio/src/runtime/io/scheduled_io.rs @@ -114,10 +114,10 @@ struct Waiters { /// List of all current waiters. list: WaitList, - /// Waker used for AsyncRead. + /// Waker used for `AsyncRead`. reader: Option, - /// Waker used for AsyncWrite. + /// Waker used for `AsyncWrite`. writer: Option, } @@ -191,7 +191,7 @@ impl ScheduledIo { mio::Token(self as *const _ as usize) } - /// Invoked when the IO driver is shut down; forces this ScheduledIo into a + /// Invoked when the IO driver is shut down; forces this `ScheduledIo` into a /// permanently shutdown state. pub(super) fn shutdown(&self) { let mask = SHUTDOWN.pack(1, 0); diff --git a/vendor/tokio/src/runtime/mod.rs b/vendor/tokio/src/runtime/mod.rs index e3369cb22..3d333960f 100644 --- a/vendor/tokio/src/runtime/mod.rs +++ b/vendor/tokio/src/runtime/mod.rs @@ -172,6 +172,146 @@ //! [`Builder::enable_io`]: crate::runtime::Builder::enable_io //! [`Builder::enable_time`]: crate::runtime::Builder::enable_time //! [`Builder::enable_all`]: crate::runtime::Builder::enable_all +//! +//! # Detailed runtime behavior +//! +//! This section gives more details into how the Tokio runtime will schedule +//! tasks for execution. +//! +//! At its most basic level, a runtime has a collection of tasks that need to be +//! scheduled. It will repeatedly remove a task from that collection and +//! schedule it (by calling [`poll`]). When the collection is empty, the thread +//! will go to sleep until a task is added to the collection. +//! +//! However, the above is not sufficient to guarantee a well-behaved runtime. +//! For example, the runtime might have a single task that is always ready to be +//! scheduled, and schedule that task every time. This is a problem because it +//! starves other tasks by not scheduling them. To solve this, Tokio provides +//! the following fairness guarantee: +//! +//! > If the total number of tasks does not grow without bound, and no task is +//! > [blocking the thread], then it is guaranteed that tasks are scheduled +//! > fairly. +//! +//! Or, more formally: +//! +//! > Under the following two assumptions: +//! > +//! > * There is some number `MAX_TASKS` such that the total number of tasks on +//! > the runtime at any specific point in time never exceeds `MAX_TASKS`. +//! > * There is some number `MAX_SCHEDULE` such that calling [`poll`] on any +//! > task spawned on the runtime returns within `MAX_SCHEDULE` time units. +//! > +//! > Then, there is some number `MAX_DELAY` such that when a task is woken, it +//! > will be scheduled by the runtime within `MAX_DELAY` time units. +//! +//! (Here, `MAX_TASKS` and `MAX_SCHEDULE` can be any number and the user of +//! the runtime may choose them. The `MAX_DELAY` number is controlled by the +//! runtime, and depends on the value of `MAX_TASKS` and `MAX_SCHEDULE`.) +//! +//! Other than the above fairness guarantee, there is no guarantee about the +//! order in which tasks are scheduled. There is also no guarantee that the +//! runtime is equally fair to all tasks. For example, if the runtime has two +//! tasks A and B that are both ready, then the runtime may schedule A five +//! times before it schedules B. This is the case even if A yields using +//! [`yield_now`]. All that is guaranteed is that it will schedule B eventually. +//! +//! Normally, tasks are scheduled only if they have been woken by calling +//! [`wake`] on their waker. However, this is not guaranteed, and Tokio may +//! schedule tasks that have not been woken under some circumstances. This is +//! called a spurious wakeup. +//! +//! ## IO and timers +//! +//! Beyond just scheduling tasks, the runtime must also manage IO resources and +//! timers. It does this by periodically checking whether there are any IO +//! resources or timers that are ready, and waking the relevant task so that +//! it will be scheduled. +//! +//! These checks are performed periodically between scheduling tasks. Under the +//! same assumptions as the previous fairness guarantee, Tokio guarantees that +//! it will wake tasks with an IO or timer event within some maximum number of +//! time units. +//! +//! ## Current thread runtime (behavior at the time of writing) +//! +//! This section describes how the [current thread runtime] behaves today. This +//! behavior may change in future versions of Tokio. +//! +//! The current thread runtime maintains two FIFO queues of tasks that are ready +//! to be scheduled: the global queue and the local queue. The runtime will prefer +//! to choose the next task to schedule from the local queue, and will only pick a +//! task from the global queue if the local queue is empty, or if it has picked +//! a task from the local queue 31 times in a row. The number 31 can be +//! changed using the [`global_queue_interval`] setting. +//! +//! The runtime will check for new IO or timer events whenever there are no +//! tasks ready to be scheduled, or when it has scheduled 61 tasks in a row. The +//! number 61 may be changed using the [`event_interval`] setting. +//! +//! When a task is woken from within a task running on the runtime, then the +//! woken task is added directly to the local queue. Otherwise, the task is +//! added to the global queue. The current thread runtime does not use [the lifo +//! slot optimization]. +//! +//! ## Multi threaded runtime (behavior at the time of writing) +//! +//! This section describes how the [multi thread runtime] behaves today. This +//! behavior may change in future versions of Tokio. +//! +//! A multi thread runtime has a fixed number of worker threads, which are all +//! created on startup. The multi thread runtime maintains one global queue, and +//! a local queue for each worker thread. The local queue of a worker thread can +//! fit at most 256 tasks. If more than 256 tasks are added to the local queue, +//! then half of them are moved to the global queue to make space. +//! +//! The runtime will prefer to choose the next task to schedule from the local +//! queue, and will only pick a task from the global queue if the local queue is +//! empty, or if it has picked a task from the local queue +//! [`global_queue_interval`] times in a row. If the value of +//! [`global_queue_interval`] is not explicitly set using the runtime builder, +//! then the runtime will dynamically compute it using a heuristic that targets +//! 10ms intervals between each check of the global queue (based on the +//! [`worker_mean_poll_time`] metric). +//! +//! If both the local queue and global queue is empty, then the worker thread +//! will attempt to steal tasks from the local queue of another worker thread. +//! Stealing is done by moving half of the tasks in one local queue to another +//! local queue. +//! +//! The runtime will check for new IO or timer events whenever there are no +//! tasks ready to be scheduled, or when it has scheduled 61 tasks in a row. The +//! number 61 may be changed using the [`event_interval`] setting. +//! +//! The multi thread runtime uses [the lifo slot optimization]: Whenever a task +//! wakes up another task, the other task is added to the worker thread's lifo +//! slot instead of being added to a queue. If there was already a task in the +//! lifo slot when this happened, then the lifo slot is replaced, and the task +//! that used to be in the lifo slot is placed in the thread's local queue. +//! When the runtime finishes scheduling a task, it will schedule the task in +//! the lifo slot immediately, if any. When the lifo slot is used, the [coop +//! budget] is not reset. Furthermore, if a worker thread uses the lifo slot +//! three times in a row, it is temporarily disabled until the worker thread has +//! scheduled a task that didn't come from the lifo slot. The lifo slot can be +//! disabled using the [`disable_lifo_slot`] setting. The lifo slot is separate +//! from the local queue, so other worker threads cannot steal the task in the +//! lifo slot. +//! +//! When a task is woken from a thread that is not a worker thread, then the +//! task is placed in the global queue. +//! +//! [`poll`]: std::future::Future::poll +//! [`wake`]: std::task::Waker::wake +//! [`yield_now`]: crate::task::yield_now +//! [blocking the thread]: https://ryhl.io/blog/async-what-is-blocking/ +//! [current thread runtime]: crate::runtime::Builder::new_current_thread +//! [multi thread runtime]: crate::runtime::Builder::new_multi_thread +//! [`global_queue_interval`]: crate::runtime::Builder::global_queue_interval +//! [`event_interval`]: crate::runtime::Builder::event_interval +//! [`disable_lifo_slot`]: crate::runtime::Builder::disable_lifo_slot +//! [the lifo slot optimization]: crate::runtime::Builder::disable_lifo_slot +//! [coop budget]: crate::task#cooperative-scheduling +//! [`worker_mean_poll_time`]: crate::runtime::RuntimeMetrics::worker_mean_poll_time // At the top due to macros #[cfg(test)] diff --git a/vendor/tokio/src/runtime/park.rs b/vendor/tokio/src/runtime/park.rs index 6f41e2c6a..2fa0f501c 100644 --- a/vendor/tokio/src/runtime/park.rs +++ b/vendor/tokio/src/runtime/park.rs @@ -81,7 +81,6 @@ impl ParkThread { // ==== impl Inner ==== impl Inner { - /// Parks the current thread for at most `dur`. fn park(&self) { // If we were previously notified then we consume this notification and // return quickly. @@ -129,6 +128,7 @@ impl Inner { } } + /// Parks the current thread for at most `dur`. fn park_timeout(&self, dur: Duration) { // Like `park` above we have a fast path for an already-notified thread, // and afterwards we start coordinating for a sleep. Return quickly. @@ -272,7 +272,6 @@ impl CachedParkThread { use std::task::Context; use std::task::Poll::Ready; - // `get_unpark()` should not return a Result let waker = self.waker()?; let mut cx = Context::from_waker(&waker); diff --git a/vendor/tokio/src/runtime/runtime.rs b/vendor/tokio/src/runtime/runtime.rs index b7dfb5c93..a8a954280 100644 --- a/vendor/tokio/src/runtime/runtime.rs +++ b/vendor/tokio/src/runtime/runtime.rs @@ -480,6 +480,10 @@ impl Drop for Runtime { } } +impl std::panic::UnwindSafe for Runtime {} + +impl std::panic::RefUnwindSafe for Runtime {} + cfg_metrics! { impl Runtime { /// TODO diff --git a/vendor/tokio/src/runtime/scheduler/current_thread/mod.rs b/vendor/tokio/src/runtime/scheduler/current_thread/mod.rs index bc5b65ad3..55a439701 100644 --- a/vendor/tokio/src/runtime/scheduler/current_thread/mod.rs +++ b/vendor/tokio/src/runtime/scheduler/current_thread/mod.rs @@ -132,7 +132,7 @@ impl CurrentThread { let handle = Arc::new(Handle { shared: Shared { inject: Inject::new(), - owned: OwnedTasks::new(), + owned: OwnedTasks::new(1), woken: AtomicBool::new(false), config, scheduler_metrics: SchedulerMetrics::new(), @@ -248,7 +248,7 @@ fn shutdown2(mut core: Box, handle: &Handle) -> Box { // Drain the OwnedTasks collection. This call also closes the // collection, ensuring that no tasks are ever pushed after this // call returns. - handle.shared.owned.close_and_shutdown_all(); + handle.shared.owned.close_and_shutdown_all(0); // Drain local queue // We already shut down every task, so we just need to drop the task. @@ -351,9 +351,6 @@ impl Context { let mut driver = core.driver.take().expect("driver missing"); if let Some(f) = &handle.shared.config.before_park { - // Incorrect lint, the closures are actually different types so `f` - // cannot be passed as an argument to `enter`. - #[allow(clippy::redundant_closure)] let (c, ()) = self.enter(core, || f()); core = c; } @@ -374,9 +371,6 @@ impl Context { } if let Some(f) = &handle.shared.config.after_unpark { - // Incorrect lint, the closures are actually different types so `f` - // cannot be passed as an argument to `enter`. - #[allow(clippy::redundant_closure)] let (c, ()) = self.enter(core, || f()); core = c; } @@ -614,7 +608,7 @@ impl Schedule for Arc { // If `None`, the runtime is shutting down, so there is no need to signal shutdown if let Some(core) = core.as_mut() { core.unhandled_panic = true; - self.shared.owned.close_and_shutdown_all(); + self.shared.owned.close_and_shutdown_all(0); } } _ => unreachable!("runtime core not set in CURRENT thread-local"), diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread/park.rs b/vendor/tokio/src/runtime/scheduler/multi_thread/park.rs index 87be200a1..bc3693873 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread/park.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread/park.rs @@ -22,10 +22,10 @@ struct Inner { /// Avoids entering the park if possible state: AtomicUsize, - /// Used to coordinate access to the driver / condvar + /// Used to coordinate access to the driver / `condvar` mutex: Mutex<()>, - /// Condvar to block on if the driver is unavailable. + /// `Condvar` to block on if the driver is unavailable. condvar: Condvar, /// Resource (I/O, time, ...) driver diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread/queue.rs b/vendor/tokio/src/runtime/scheduler/multi_thread/queue.rs index e3a3105bb..352232898 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread/queue.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread/queue.rs @@ -36,8 +36,8 @@ pub(crate) struct Steal(Arc>); pub(crate) struct Inner { /// Concurrently updated by many threads. /// - /// Contains two `UnsignedShort` values. The LSB byte is the "real" head of - /// the queue. The `UnsignedShort` in the MSB is set by a stealer in process + /// Contains two `UnsignedShort` values. The `LSB` byte is the "real" head of + /// the queue. The `UnsignedShort` in the `MSB` is set by a stealer in process /// of stealing values. It represents the first value being stolen in the /// batch. The `UnsignedShort` indices are intentionally wider than strictly /// required for buffer indexing in order to provide ABA mitigation and make diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread/stats.rs b/vendor/tokio/src/runtime/scheduler/multi_thread/stats.rs index 3b8c5020e..30c108c9d 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread/stats.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread/stats.rs @@ -22,7 +22,7 @@ pub(crate) struct Stats { /// Exponentially-weighted moving average of time spent polling scheduled a /// task. /// - /// Tracked in nanoseconds, stored as a f64 since that is what we use with + /// Tracked in nanoseconds, stored as a `f64` since that is what we use with /// the EWMA calculations task_poll_time_ewma: f64, } diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs b/vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs index 4a09f4a74..9998870ab 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs @@ -9,19 +9,19 @@ //! Shutting down the runtime involves the following steps: //! //! 1. The Shared::close method is called. This closes the inject queue and -//! OwnedTasks instance and wakes up all worker threads. +//! `OwnedTasks` instance and wakes up all worker threads. //! //! 2. Each worker thread observes the close signal next time it runs //! Core::maintenance by checking whether the inject queue is closed. -//! The Core::is_shutdown flag is set to true. +//! The `Core::is_shutdown` flag is set to true. //! //! 3. The worker thread calls `pre_shutdown` in parallel. Here, the worker -//! will keep removing tasks from OwnedTasks until it is empty. No new -//! tasks can be pushed to the OwnedTasks during or after this step as it +//! will keep removing tasks from `OwnedTasks` until it is empty. No new +//! tasks can be pushed to the `OwnedTasks` during or after this step as it //! was closed in step 1. //! //! 5. The workers call Shared::shutdown to enter the single-threaded phase of -//! shutdown. These calls will push their core to Shared::shutdown_cores, +//! shutdown. These calls will push their core to `Shared::shutdown_cores`, //! and the last thread to push its core will finish the shutdown procedure. //! //! 6. The local run queue of each core is emptied, then the inject queue is @@ -35,22 +35,22 @@ //! //! When spawning tasks during shutdown, there are two cases: //! -//! * The spawner observes the OwnedTasks being open, and the inject queue is +//! * The spawner observes the `OwnedTasks` being open, and the inject queue is //! closed. -//! * The spawner observes the OwnedTasks being closed and doesn't check the +//! * The spawner observes the `OwnedTasks` being closed and doesn't check the //! inject queue. //! -//! The first case can only happen if the OwnedTasks::bind call happens before +//! The first case can only happen if the `OwnedTasks::bind` call happens before //! or during step 1 of shutdown. In this case, the runtime will clean up the //! task in step 3 of shutdown. //! //! In the latter case, the task was not spawned and the task is immediately //! cancelled by the spawner. //! -//! The correctness of shutdown requires both the inject queue and OwnedTasks +//! The correctness of shutdown requires both the inject queue and `OwnedTasks` //! collection to have a closed bit. With a close bit on only the inject queue, //! spawning could run in to a situation where a task is successfully bound long -//! after the runtime has shut down. With a close bit on only the OwnedTasks, +//! after the runtime has shut down. With a close bit on only the `OwnedTasks`, //! the first spawning situation could result in the notification being pushed //! to the inject queue after step 6 of shutdown, which would leave a task in //! the inject queue indefinitely. This would be a ref-count cycle and a memory @@ -184,7 +184,7 @@ pub(crate) struct Shared { /// Only held to trigger some code on drop. This is used to get internal /// runtime metrics that can be useful when doing performance /// investigations. This does nothing (empty struct, no drop impl) unless - /// the `tokio_internal_mt_counters` cfg flag is set. + /// the `tokio_internal_mt_counters` `cfg` flag is set. _counters: Counters, } @@ -234,7 +234,7 @@ type Task = task::Task>; type Notified = task::Notified>; /// Value picked out of thin-air. Running the LIFO slot a handful of times -/// seemms sufficient to benefit from locality. More than 3 times probably is +/// seems sufficient to benefit from locality. More than 3 times probably is /// overweighing. The value can be tuned in the future with data that shows /// improvements. const MAX_LIFO_POLLS_PER_TICK: usize = 3; @@ -287,7 +287,7 @@ pub(super) fn create( remotes: remotes.into_boxed_slice(), inject, idle, - owned: OwnedTasks::new(), + owned: OwnedTasks::new(size), synced: Mutex::new(Synced { idle: idle_synced, inject: inject_synced, @@ -548,7 +548,6 @@ impl Context { } core.pre_shutdown(&self.worker); - // Signal shutdown self.worker.handle.shutdown_core(core); Err(()) @@ -678,7 +677,7 @@ impl Context { /// Also important to notice that, before parking, the worker thread will try to take /// ownership of the Driver (IO/Time) and dispatch any events that might have fired. /// Whenever a worker thread executes the Driver loop, all waken tasks are scheduled - /// in its own local queue until the queue saturates (ntasks > LOCAL_QUEUE_CAPACITY). + /// in its own local queue until the queue saturates (ntasks > `LOCAL_QUEUE_CAPACITY`). /// When the local queue is saturated, the overflow tasks are added to the injection queue /// from where other workers can pick them up. /// Also, we rely on the workstealing algorithm to spread the tasks amongst workers @@ -789,7 +788,7 @@ impl Core { ); // Take at least one task since the first task is returned directly - // and nto pushed onto the local queue. + // and not pushed onto the local queue. let n = usize::max(1, n); let mut synced = worker.handle.shared.synced.lock(); @@ -955,8 +954,16 @@ impl Core { /// Signals all tasks to shut down, and waits for them to complete. Must run /// before we enter the single-threaded phase of shutdown processing. fn pre_shutdown(&mut self, worker: &Worker) { + // Start from a random inner list + let start = self + .rand + .fastrand_n(worker.handle.shared.owned.get_shard_size() as u32); // Signal to all tasks to shut down. - worker.handle.shared.owned.close_and_shutdown_all(); + worker + .handle + .shared + .owned + .close_and_shutdown_all(start as usize); self.stats .submit(&worker.handle.shared.worker_metrics[worker.index]); diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/queue.rs b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/queue.rs index 004715dae..2694d27cb 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/queue.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/queue.rs @@ -37,8 +37,8 @@ pub(crate) struct Steal(Arc>); pub(crate) struct Inner { /// Concurrently updated by many threads. /// - /// Contains two `UnsignedShort` values. The LSB byte is the "real" head of - /// the queue. The `UnsignedShort` in the MSB is set by a stealer in process + /// Contains two `UnsignedShort` values. The `LSB` byte is the "real" head of + /// the queue. The `UnsignedShort` in the `MSB` is set by a stealer in process /// of stealing values. It represents the first value being stolen in the /// batch. The `UnsignedShort` indices are intentionally wider than strictly /// required for buffer indexing in order to provide ABA mitigation and make diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/stats.rs b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/stats.rs index 228e79771..7118e4915 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/stats.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/stats.rs @@ -13,7 +13,7 @@ pub(crate) struct Stats { /// Exponentially-weighted moving average of time spent polling scheduled a /// task. /// - /// Tracked in nanoseconds, stored as a f64 since that is what we use with + /// Tracked in nanoseconds, stored as a `f64` since that is what we use with /// the EWMA calculations task_poll_time_ewma: f64, } diff --git a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/worker.rs b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/worker.rs index 66865f597..54c6b0ed7 100644 --- a/vendor/tokio/src/runtime/scheduler/multi_thread_alt/worker.rs +++ b/vendor/tokio/src/runtime/scheduler/multi_thread_alt/worker.rs @@ -9,19 +9,19 @@ //! Shutting down the runtime involves the following steps: //! //! 1. The Shared::close method is called. This closes the inject queue and -//! OwnedTasks instance and wakes up all worker threads. +//! `OwnedTasks` instance and wakes up all worker threads. //! //! 2. Each worker thread observes the close signal next time it runs //! Core::maintenance by checking whether the inject queue is closed. -//! The Core::is_shutdown flag is set to true. +//! The `Core::is_shutdown` flag is set to true. //! //! 3. The worker thread calls `pre_shutdown` in parallel. Here, the worker -//! will keep removing tasks from OwnedTasks until it is empty. No new -//! tasks can be pushed to the OwnedTasks during or after this step as it +//! will keep removing tasks from `OwnedTasks` until it is empty. No new +//! tasks can be pushed to the `OwnedTasks` during or after this step as it //! was closed in step 1. //! //! 5. The workers call Shared::shutdown to enter the single-threaded phase of -//! shutdown. These calls will push their core to Shared::shutdown_cores, +//! shutdown. These calls will push their core to `Shared::shutdown_cores`, //! and the last thread to push its core will finish the shutdown procedure. //! //! 6. The local run queue of each core is emptied, then the inject queue is @@ -35,22 +35,22 @@ //! //! When spawning tasks during shutdown, there are two cases: //! -//! * The spawner observes the OwnedTasks being open, and the inject queue is +//! * The spawner observes the `OwnedTasks` being open, and the inject queue is //! closed. -//! * The spawner observes the OwnedTasks being closed and doesn't check the +//! * The spawner observes the `OwnedTasks` being closed and doesn't check the //! inject queue. //! -//! The first case can only happen if the OwnedTasks::bind call happens before +//! The first case can only happen if the `OwnedTasks::bind` call happens before //! or during step 1 of shutdown. In this case, the runtime will clean up the //! task in step 3 of shutdown. //! //! In the latter case, the task was not spawned and the task is immediately //! cancelled by the spawner. //! -//! The correctness of shutdown requires both the inject queue and OwnedTasks +//! The correctness of shutdown requires both the inject queue and `OwnedTasks` //! collection to have a closed bit. With a close bit on only the inject queue, //! spawning could run in to a situation where a task is successfully bound long -//! after the runtime has shut down. With a close bit on only the OwnedTasks, +//! after the runtime has shut down. With a close bit on only the `OwnedTasks`, //! the first spawning situation could result in the notification being pushed //! to the inject queue after step 6 of shutdown, which would leave a task in //! the inject queue indefinitely. This would be a ref-count cycle and a memory @@ -157,7 +157,7 @@ pub(crate) struct Shared { driver: AtomicCell, /// Condition variables used to unblock worker threads. Each worker thread - /// has its own condvar it waits on. + /// has its own `condvar` it waits on. pub(super) condvars: Vec, /// The number of cores that have observed the trace signal. @@ -174,7 +174,7 @@ pub(crate) struct Shared { /// Only held to trigger some code on drop. This is used to get internal /// runtime metrics that can be useful when doing performance /// investigations. This does nothing (empty struct, no drop impl) unless - /// the `tokio_internal_mt_counters` cfg flag is set. + /// the `tokio_internal_mt_counters` `cfg` flag is set. _counters: Counters, } @@ -248,7 +248,7 @@ type Task = task::Task>; type Notified = task::Notified>; /// Value picked out of thin-air. Running the LIFO slot a handful of times -/// seemms sufficient to benefit from locality. More than 3 times probably is +/// seems sufficient to benefit from locality. More than 3 times probably is /// overweighing. The value can be tuned in the future with data that shows /// improvements. const MAX_LIFO_POLLS_PER_TICK: usize = 3; @@ -307,7 +307,7 @@ pub(super) fn create( remotes: remotes.into_boxed_slice(), inject, idle, - owned: OwnedTasks::new(), + owned: OwnedTasks::new(num_cores), synced: Mutex::new(Synced { assigned_cores: (0..num_workers).map(|_| None).collect(), shutdown_cores: Vec::with_capacity(num_cores), @@ -1460,7 +1460,9 @@ impl Shared { } pub(super) fn shutdown_core(&self, handle: &Handle, mut core: Box) { - self.owned.close_and_shutdown_all(); + // Start from a random inner list + let start = core.rand.fastrand_n(self.owned.get_shard_size() as u32); + self.owned.close_and_shutdown_all(start as usize); core.stats.submit(&self.worker_metrics[core.index]); diff --git a/vendor/tokio/src/runtime/task/abort.rs b/vendor/tokio/src/runtime/task/abort.rs index 6edca1004..410f0a467 100644 --- a/vendor/tokio/src/runtime/task/abort.rs +++ b/vendor/tokio/src/runtime/task/abort.rs @@ -31,8 +31,11 @@ impl AbortHandle { /// If the task was already cancelled, such as by [`JoinHandle::abort`], /// this method will do nothing. /// + /// See also [the module level docs] for more information on cancellation. + /// /// [cancelled]: method@super::error::JoinError::is_cancelled /// [`JoinHandle::abort`]: method@super::JoinHandle::abort + /// [the module level docs]: crate::task#cancellation pub fn abort(&self) { self.raw.remote_abort(); } diff --git a/vendor/tokio/src/runtime/task/core.rs b/vendor/tokio/src/runtime/task/core.rs index 1903a01aa..108b06bc8 100644 --- a/vendor/tokio/src/runtime/task/core.rs +++ b/vendor/tokio/src/runtime/task/core.rs @@ -28,7 +28,7 @@ use std::task::{Context, Poll, Waker}; /// be referenced by both *mut Cell and *mut Header. /// /// Any changes to the layout of this struct _must_ also be reflected in the -/// const fns in raw.rs. +/// `const` fns in raw.rs. /// // # This struct should be cache padded to avoid false sharing. The cache padding rules are copied // from crossbeam-utils/src/cache_padded.rs @@ -132,7 +132,7 @@ pub(super) struct CoreStage { /// Holds the future or output, depending on the stage of execution. /// /// Any changes to the layout of this struct _must_ also be reflected in the -/// const fns in raw.rs. +/// `const` fns in raw.rs. #[repr(C)] pub(super) struct Core { /// Scheduler used to drive this future. @@ -157,10 +157,10 @@ pub(crate) struct Header { /// Table of function pointers for executing actions on the task. pub(super) vtable: &'static Vtable, - /// This integer contains the id of the OwnedTasks or LocalOwnedTasks that - /// this task is stored in. If the task is not in any list, should be the - /// id of the list that it was previously in, or `None` if it has never been - /// in any list. + /// This integer contains the id of the `OwnedTasks` or `LocalOwnedTasks` + /// that this task is stored in. If the task is not in any list, should be + /// the id of the list that it was previously in, or `None` if it has never + /// been in any list. /// /// Once a task has been bound to a list, it can never be bound to another /// list, even if removed from the first list. diff --git a/vendor/tokio/src/runtime/task/error.rs b/vendor/tokio/src/runtime/task/error.rs index f7ead77b7..d0d731322 100644 --- a/vendor/tokio/src/runtime/task/error.rs +++ b/vendor/tokio/src/runtime/task/error.rs @@ -33,6 +33,10 @@ impl JoinError { } /// Returns true if the error was caused by the task being cancelled. + /// + /// See [the module level docs] for more information on cancellation. + /// + /// [the module level docs]: crate::task#cancellation pub fn is_cancelled(&self) -> bool { matches!(&self.repr, Repr::Cancelled) } diff --git a/vendor/tokio/src/runtime/task/harness.rs b/vendor/tokio/src/runtime/task/harness.rs index 8bfd57e6f..cf19eea83 100644 --- a/vendor/tokio/src/runtime/task/harness.rs +++ b/vendor/tokio/src/runtime/task/harness.rs @@ -183,7 +183,7 @@ where /// If the return value is Complete, the caller is given ownership of a /// single ref-count, which should be passed on to `complete`. /// - /// If the return value is Dealloc, then this call consumed the last + /// If the return value is `Dealloc`, then this call consumed the last /// ref-count and the caller should call `dealloc`. /// /// Otherwise the ref-count is consumed and the caller should not access diff --git a/vendor/tokio/src/runtime/task/id.rs b/vendor/tokio/src/runtime/task/id.rs index 2b0d95c02..82c8a7e7e 100644 --- a/vendor/tokio/src/runtime/task/id.rs +++ b/vendor/tokio/src/runtime/task/id.rs @@ -24,7 +24,7 @@ use std::fmt; #[cfg_attr(docsrs, doc(cfg(all(feature = "rt", tokio_unstable))))] #[cfg_attr(not(tokio_unstable), allow(unreachable_pub))] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] -pub struct Id(u64); +pub struct Id(pub(crate) u64); /// Returns the [`Id`] of the currently running task. /// @@ -74,11 +74,22 @@ impl fmt::Display for Id { impl Id { pub(crate) fn next() -> Self { - use crate::loom::sync::atomic::{Ordering::Relaxed, StaticAtomicU64}; + use crate::loom::sync::atomic::Ordering::Relaxed; + use crate::loom::sync::atomic::StaticAtomicU64; - static NEXT_ID: StaticAtomicU64 = StaticAtomicU64::new(1); + #[cfg(all(test, loom))] + { + crate::loom::lazy_static! { + static ref NEXT_ID: StaticAtomicU64 = StaticAtomicU64::new(1); + } + Self(NEXT_ID.fetch_add(1, Relaxed)) + } - Self(NEXT_ID.fetch_add(1, Relaxed)) + #[cfg(not(all(test, loom)))] + { + static NEXT_ID: StaticAtomicU64 = StaticAtomicU64::new(1); + Self(NEXT_ID.fetch_add(1, Relaxed)) + } } pub(crate) fn as_u64(&self) -> u64 { diff --git a/vendor/tokio/src/runtime/task/join.rs b/vendor/tokio/src/runtime/task/join.rs index ee3925884..19289cf58 100644 --- a/vendor/tokio/src/runtime/task/join.rs +++ b/vendor/tokio/src/runtime/task/join.rs @@ -58,7 +58,7 @@ cfg_rt! { /// ``` /// /// The generic parameter `T` in `JoinHandle` is the return type of the spawned task. - /// If the return value is an i32, the join handle has type `JoinHandle`: + /// If the return value is an `i32`, the join handle has type `JoinHandle`: /// /// ``` /// use tokio::task; @@ -179,6 +179,8 @@ impl JoinHandle { /// already completed at the time it was cancelled, but most likely it /// will fail with a [cancelled] `JoinError`. /// + /// See also [the module level docs] for more information on cancellation. + /// /// ```rust /// use tokio::time; /// @@ -205,7 +207,9 @@ impl JoinHandle { /// } /// # } /// ``` + /// /// [cancelled]: method@super::error::JoinError::is_cancelled + /// [the module level docs]: crate::task#cancellation pub fn abort(&self) { self.raw.remote_abort(); } diff --git a/vendor/tokio/src/runtime/task/list.rs b/vendor/tokio/src/runtime/task/list.rs index 3a1fcce2e..41a5fb439 100644 --- a/vendor/tokio/src/runtime/task/list.rs +++ b/vendor/tokio/src/runtime/task/list.rs @@ -8,10 +8,11 @@ use crate::future::Future; use crate::loom::cell::UnsafeCell; -use crate::loom::sync::Mutex; use crate::runtime::task::{JoinHandle, LocalNotified, Notified, Schedule, Task}; -use crate::util::linked_list::{CountedLinkedList, Link, LinkedList}; +use crate::util::linked_list::{Link, LinkedList}; +use crate::util::sharded_list; +use crate::loom::sync::atomic::{AtomicBool, Ordering}; use std::marker::PhantomData; use std::num::NonZeroU64; @@ -25,7 +26,7 @@ use std::num::NonZeroU64; // mixed up runtimes happen to have the same id. cfg_has_atomic_u64! { - use std::sync::atomic::{AtomicU64, Ordering}; + use std::sync::atomic::AtomicU64; static NEXT_OWNED_TASKS_ID: AtomicU64 = AtomicU64::new(1); @@ -40,7 +41,7 @@ cfg_has_atomic_u64! { } cfg_not_has_atomic_u64! { - use std::sync::atomic::{AtomicU32, Ordering}; + use std::sync::atomic::AtomicU32; static NEXT_OWNED_TASKS_ID: AtomicU32 = AtomicU32::new(1); @@ -55,36 +56,36 @@ cfg_not_has_atomic_u64! { } pub(crate) struct OwnedTasks { - inner: Mutex>, + list: List, pub(crate) id: NonZeroU64, + closed: AtomicBool, } -struct CountedOwnedTasksInner { - list: CountedLinkedList, as Link>::Target>, - closed: bool, -} + +type List = sharded_list::ShardedList, as Link>::Target>; + pub(crate) struct LocalOwnedTasks { inner: UnsafeCell>, pub(crate) id: NonZeroU64, _not_send_or_sync: PhantomData<*const ()>, } + struct OwnedTasksInner { list: LinkedList, as Link>::Target>, closed: bool, } impl OwnedTasks { - pub(crate) fn new() -> Self { + pub(crate) fn new(num_cores: usize) -> Self { + let shard_size = Self::gen_shared_list_size(num_cores); Self { - inner: Mutex::new(CountedOwnedTasksInner { - list: CountedLinkedList::new(), - closed: false, - }), + list: List::new(shard_size), + closed: AtomicBool::new(false), id: get_next_id(), } } - /// Binds the provided task to this OwnedTasks instance. This fails if the - /// OwnedTasks has been closed. + /// Binds the provided task to this `OwnedTasks` instance. This fails if the + /// `OwnedTasks` has been closed. pub(crate) fn bind( &self, task: T, @@ -112,24 +113,23 @@ impl OwnedTasks { task.header().set_owner_id(self.id); } - let mut lock = self.inner.lock(); - if lock.closed { - drop(lock); - drop(notified); + let shard = self.list.lock_shard(&task); + // Check the closed flag in the lock for ensuring all that tasks + // will shut down after the OwnedTasks has been closed. + if self.closed.load(Ordering::Acquire) { + drop(shard); task.shutdown(); - None - } else { - lock.list.push_front(task); - Some(notified) + return None; } + shard.push(task); + Some(notified) } - /// Asserts that the given task is owned by this OwnedTasks and convert it to - /// a LocalNotified, giving the thread permission to poll this task. + /// Asserts that the given task is owned by this `OwnedTasks` and convert it to + /// a `LocalNotified`, giving the thread permission to poll this task. #[inline] pub(crate) fn assert_owner(&self, task: Notified) -> LocalNotified { debug_assert_eq!(task.header().get_owner_id(), Some(self.id)); - // safety: All tasks bound to this OwnedTasks are Send, so it is safe // to poll it on this thread no matter what thread we are on. LocalNotified { @@ -140,34 +140,34 @@ impl OwnedTasks { /// Shuts down all tasks in the collection. This call also closes the /// collection, preventing new items from being added. - pub(crate) fn close_and_shutdown_all(&self) + /// + /// The parameter start determines which shard this method will start at. + /// Using different values for each worker thread reduces contention. + pub(crate) fn close_and_shutdown_all(&self, start: usize) where S: Schedule, { - // The first iteration of the loop was unrolled so it can set the - // closed bool. - let first_task = { - let mut lock = self.inner.lock(); - lock.closed = true; - lock.list.pop_back() - }; - match first_task { - Some(task) => task.shutdown(), - None => return, - } - - loop { - let task = match self.inner.lock().list.pop_back() { - Some(task) => task, - None => return, - }; - - task.shutdown(); + self.closed.store(true, Ordering::Release); + for i in start..self.get_shard_size() + start { + loop { + let task = self.list.pop_back(i); + match task { + Some(task) => { + task.shutdown(); + } + None => break, + } + } } } + #[inline] + pub(crate) fn get_shard_size(&self) -> usize { + self.list.shard_size() + } + pub(crate) fn active_tasks_count(&self) -> usize { - self.inner.lock().list.count() + self.list.len() } pub(crate) fn remove(&self, task: &Task) -> Option> { @@ -179,11 +179,27 @@ impl OwnedTasks { // safety: We just checked that the provided task is not in some other // linked list. - unsafe { self.inner.lock().list.remove(task.header_ptr()) } + unsafe { self.list.remove(task.header_ptr()) } } pub(crate) fn is_empty(&self) -> bool { - self.inner.lock().list.is_empty() + self.list.is_empty() + } + + /// Generates the size of the sharded list based on the number of worker threads. + /// + /// The sharded lock design can effectively alleviate + /// lock contention performance problems caused by high concurrency. + /// + /// However, as the number of shards increases, the memory continuity between + /// nodes in the intrusive linked list will diminish. Furthermore, + /// the construction time of the sharded list will also increase with a higher number of shards. + /// + /// Due to the above reasons, we set a maximum value for the shared list size, + /// denoted as `MAX_SHARED_LIST_SIZE`. + fn gen_shared_list_size(num_cores: usize) -> usize { + const MAX_SHARED_LIST_SIZE: usize = 1 << 16; + usize::min(MAX_SHARED_LIST_SIZE, num_cores.next_power_of_two() * 4) } } @@ -192,9 +208,9 @@ cfg_taskdump! { /// Locks the tasks, and calls `f` on an iterator over them. pub(crate) fn for_each(&self, f: F) where - F: FnMut(&Task) + F: FnMut(&Task), { - self.inner.lock().list.for_each(f) + self.list.for_each(f); } } } @@ -268,8 +284,8 @@ impl LocalOwnedTasks { unsafe { inner.list.remove(task.header_ptr()) }) } - /// Asserts that the given task is owned by this LocalOwnedTasks and convert - /// it to a LocalNotified, giving the thread permission to poll this task. + /// Asserts that the given task is owned by this `LocalOwnedTasks` and convert + /// it to a `LocalNotified`, giving the thread permission to poll this task. #[inline] pub(crate) fn assert_owner(&self, task: Notified) -> LocalNotified { assert_eq!(task.header().get_owner_id(), Some(self.id)); diff --git a/vendor/tokio/src/runtime/task/mod.rs b/vendor/tokio/src/runtime/task/mod.rs index d7fde0fe6..6b05f4d7d 100644 --- a/vendor/tokio/src/runtime/task/mod.rs +++ b/vendor/tokio/src/runtime/task/mod.rs @@ -2,52 +2,52 @@ //! //! The task module contains the code that manages spawned tasks and provides a //! safe API for the rest of the runtime to use. Each task in a runtime is -//! stored in an OwnedTasks or LocalOwnedTasks object. +//! stored in an `OwnedTasks` or `LocalOwnedTasks` object. //! //! # Task reference types //! //! A task is usually referenced by multiple handles, and there are several //! types of handles. //! -//! * OwnedTask - tasks stored in an OwnedTasks or LocalOwnedTasks are of this +//! * `OwnedTask` - tasks stored in an `OwnedTasks` or `LocalOwnedTasks` are of this //! reference type. //! -//! * JoinHandle - each task has a JoinHandle that allows access to the output +//! * `JoinHandle` - each task has a `JoinHandle` that allows access to the output //! of the task. //! -//! * Waker - every waker for a task has this reference type. There can be any +//! * `Waker` - every waker for a task has this reference type. There can be any //! number of waker references. //! -//! * Notified - tracks whether the task is notified. +//! * `Notified` - tracks whether the task is notified. //! -//! * Unowned - this task reference type is used for tasks not stored in any +//! * `Unowned` - this task reference type is used for tasks not stored in any //! runtime. Mainly used for blocking tasks, but also in tests. //! //! The task uses a reference count to keep track of how many active references -//! exist. The Unowned reference type takes up two ref-counts. All other +//! exist. The `Unowned` reference type takes up two ref-counts. All other //! reference types take up a single ref-count. //! //! Besides the waker type, each task has at most one of each reference type. //! //! # State //! -//! The task stores its state in an atomic usize with various bitfields for the +//! The task stores its state in an atomic `usize` with various bitfields for the //! necessary information. The state has the following bitfields: //! -//! * RUNNING - Tracks whether the task is currently being polled or cancelled. +//! * `RUNNING` - Tracks whether the task is currently being polled or cancelled. //! This bit functions as a lock around the task. //! -//! * COMPLETE - Is one once the future has fully completed and has been +//! * `COMPLETE` - Is one once the future has fully completed and has been //! dropped. Never unset once set. Never set together with RUNNING. //! -//! * NOTIFIED - Tracks whether a Notified object currently exists. +//! * `NOTIFIED` - Tracks whether a Notified object currently exists. //! -//! * CANCELLED - Is set to one for tasks that should be cancelled as soon as +//! * `CANCELLED` - Is set to one for tasks that should be cancelled as soon as //! possible. May take any value for completed tasks. //! -//! * JOIN_INTEREST - Is set to one if there exists a JoinHandle. +//! * `JOIN_INTEREST` - Is set to one if there exists a `JoinHandle`. //! -//! * JOIN_WAKER - Acts as an access control bit for the join handle waker. The +//! * `JOIN_WAKER` - Acts as an access control bit for the join handle waker. The //! protocol for its usage is described below. //! //! The rest of the bits are used for the ref-count. @@ -59,7 +59,7 @@ //! //! * The state field is accessed with atomic instructions. //! -//! * The OwnedTask reference has exclusive access to the `owned` field. +//! * The `OwnedTask` reference has exclusive access to the `owned` field. //! //! * The Notified reference has exclusive access to the `queue_next` field. //! @@ -67,42 +67,42 @@ //! is otherwise immutable and anyone can access the field immutably without //! synchronization. //! -//! * If COMPLETE is one, then the JoinHandle has exclusive access to the +//! * If COMPLETE is one, then the `JoinHandle` has exclusive access to the //! stage field. If COMPLETE is zero, then the RUNNING bitfield functions as //! a lock for the stage field, and it can be accessed only by the thread //! that set RUNNING to one. //! //! * The waker field may be concurrently accessed by different threads: in one //! thread the runtime may complete a task and *read* the waker field to -//! invoke the waker, and in another thread the task's JoinHandle may be -//! polled, and if the task hasn't yet completed, the JoinHandle may *write* -//! a waker to the waker field. The JOIN_WAKER bit ensures safe access by +//! invoke the waker, and in another thread the task's `JoinHandle` may be +//! polled, and if the task hasn't yet completed, the `JoinHandle` may *write* +//! a waker to the waker field. The `JOIN_WAKER` bit ensures safe access by //! multiple threads to the waker field using the following rules: //! -//! 1. JOIN_WAKER is initialized to zero. +//! 1. `JOIN_WAKER` is initialized to zero. //! -//! 2. If JOIN_WAKER is zero, then the JoinHandle has exclusive (mutable) +//! 2. If `JOIN_WAKER` is zero, then the `JoinHandle` has exclusive (mutable) //! access to the waker field. //! -//! 3. If JOIN_WAKER is one, then the JoinHandle has shared (read-only) +//! 3. If `JOIN_WAKER` is one, then the `JoinHandle` has shared (read-only) //! access to the waker field. //! -//! 4. If JOIN_WAKER is one and COMPLETE is one, then the runtime has shared +//! 4. If `JOIN_WAKER` is one and COMPLETE is one, then the runtime has shared //! (read-only) access to the waker field. //! -//! 5. If the JoinHandle needs to write to the waker field, then the -//! JoinHandle needs to (i) successfully set JOIN_WAKER to zero if it is +//! 5. If the `JoinHandle` needs to write to the waker field, then the +//! `JoinHandle` needs to (i) successfully set `JOIN_WAKER` to zero if it is //! not already zero to gain exclusive access to the waker field per rule -//! 2, (ii) write a waker, and (iii) successfully set JOIN_WAKER to one. +//! 2, (ii) write a waker, and (iii) successfully set `JOIN_WAKER` to one. //! -//! 6. The JoinHandle can change JOIN_WAKER only if COMPLETE is zero (i.e. +//! 6. The `JoinHandle` can change `JOIN_WAKER` only if COMPLETE is zero (i.e. //! the task hasn't yet completed). //! //! Rule 6 implies that the steps (i) or (iii) of rule 5 may fail due to a //! race. If step (i) fails, then the attempt to write a waker is aborted. If //! step (iii) fails because COMPLETE is set to one by another thread after //! step (i), then the waker field is cleared. Once COMPLETE is one (i.e. -//! task has completed), the JoinHandle will not modify JOIN_WAKER. After the +//! task has completed), the `JoinHandle` will not modify `JOIN_WAKER`. After the //! runtime sets COMPLETE to one, it invokes the waker if there is one. //! //! All other fields are immutable and can be accessed immutably without @@ -119,18 +119,18 @@ //! the RUNNING field, so exclusive access is ensured. //! //! When the task completes, exclusive access to the output is transferred to -//! the JoinHandle. If the JoinHandle is already dropped when the transition to +//! the `JoinHandle`. If the `JoinHandle` is already dropped when the transition to //! complete happens, the thread performing that transition retains exclusive //! access to the output and should immediately drop it. //! //! ## Non-Send futures //! -//! If a future is not Send, then it is bound to a LocalOwnedTasks. The future -//! will only ever be polled or dropped given a LocalNotified or inside a call -//! to LocalOwnedTasks::shutdown_all. In either case, it is guaranteed that the +//! If a future is not Send, then it is bound to a `LocalOwnedTasks`. The future +//! will only ever be polled or dropped given a `LocalNotified` or inside a call +//! to `LocalOwnedTasks::shutdown_all`. In either case, it is guaranteed that the //! future is on the right thread. //! -//! If the task is never removed from the LocalOwnedTasks, then it is leaked, so +//! If the task is never removed from the `LocalOwnedTasks`, then it is leaked, so //! there is no risk that the task is dropped on some other thread when the last //! ref-count drops. //! @@ -138,21 +138,21 @@ //! //! When a task completes, the output is placed in the stage of the task. Then, //! a transition that sets COMPLETE to true is performed, and the value of -//! JOIN_INTEREST when this transition happens is read. +//! `JOIN_INTEREST` when this transition happens is read. //! -//! If JOIN_INTEREST is zero when the transition to COMPLETE happens, then the +//! If `JOIN_INTEREST` is zero when the transition to COMPLETE happens, then the //! output is immediately dropped. //! -//! If JOIN_INTEREST is one when the transition to COMPLETE happens, then the -//! JoinHandle is responsible for cleaning up the output. If the output is not +//! If `JOIN_INTEREST` is one when the transition to COMPLETE happens, then the +//! `JoinHandle` is responsible for cleaning up the output. If the output is not //! Send, then this happens: //! //! 1. The output is created on the thread that the future was polled on. Since //! only non-Send futures can have non-Send output, the future was polled on //! the thread that the future was spawned from. //! 2. Since `JoinHandle` is not Send if Output is not Send, the -//! JoinHandle is also on the thread that the future was spawned from. -//! 3. Thus, the JoinHandle will not move the output across threads when it +//! `JoinHandle` is also on the thread that the future was spawned from. +//! 3. Thus, the `JoinHandle` will not move the output across threads when it //! takes or drops the output. //! //! ## Recursive poll/shutdown @@ -208,6 +208,7 @@ cfg_taskdump! { use crate::future::Future; use crate::util::linked_list; +use crate::util::sharded_list; use std::marker::PhantomData; use std::ptr::NonNull; @@ -240,7 +241,7 @@ pub(crate) struct LocalNotified { _not_send: PhantomData<*const ()>, } -/// A task that is not owned by any OwnedTasks. Used for blocking tasks. +/// A task that is not owned by any `OwnedTasks`. Used for blocking tasks. /// This type holds two ref-counts. pub(crate) struct UnownedTask { raw: RawTask, @@ -279,7 +280,7 @@ pub(crate) trait Schedule: Sync + Sized + 'static { cfg_rt! { /// This is the constructor for a new task. Three references to the task are - /// created. The first task reference is usually put into an OwnedTasks + /// created. The first task reference is usually put into an `OwnedTasks` /// immediately. The Notified is sent to the scheduler as an ordinary /// notification. fn new_task( @@ -363,10 +364,17 @@ impl Task { } cfg_taskdump! { - pub(super) fn notify_for_tracing(&self) -> Notified { - self.as_raw().state().transition_to_notified_for_tracing(); - // SAFETY: `transition_to_notified_for_tracing` increments the refcount. - unsafe { Notified(Task::new(self.raw)) } + /// Notify the task for task dumping. + /// + /// Returns `None` if the task has already been notified. + pub(super) fn notify_for_tracing(&self) -> Option> { + if self.as_raw().state().transition_to_notified_for_tracing() { + // SAFETY: `transition_to_notified_for_tracing` increments the + // refcount. + Some(unsafe { Notified(Task::new(self.raw)) }) + } else { + None + } } } } @@ -503,3 +511,16 @@ unsafe impl linked_list::Link for Task { self::core::Trailer::addr_of_owned(Header::get_trailer(target)) } } + +/// # Safety +/// +/// The id of a task is never changed after creation of the task, so the return value of +/// `get_shard_id` will not change. (The cast may throw away the upper 32 bits of the task id, but +/// the shard id still won't change from call to call.) +unsafe impl sharded_list::ShardedListItem for Task { + unsafe fn get_shard_id(target: NonNull) -> usize { + // SAFETY: The caller guarantees that `target` points at a valid task. + let task_id = unsafe { Header::get_id(target) }; + task_id.0 as usize + } +} diff --git a/vendor/tokio/src/runtime/task/state.rs b/vendor/tokio/src/runtime/task/state.rs index 64cfb4b5d..9f1a8ec5a 100644 --- a/vendor/tokio/src/runtime/task/state.rs +++ b/vendor/tokio/src/runtime/task/state.rs @@ -29,15 +29,12 @@ const LIFECYCLE_MASK: usize = 0b11; const NOTIFIED: usize = 0b100; /// The join handle is still around. -#[allow(clippy::unusual_byte_groupings)] // https://github.com/rust-lang/rust-clippy/issues/6556 const JOIN_INTEREST: usize = 0b1_000; /// A join handle waker has been set. -#[allow(clippy::unusual_byte_groupings)] // https://github.com/rust-lang/rust-clippy/issues/6556 const JOIN_WAKER: usize = 0b10_000; /// The task has been forcibly cancelled. -#[allow(clippy::unusual_byte_groupings)] // https://github.com/rust-lang/rust-clippy/issues/6556 const CANCELLED: usize = 0b100_000; /// All bits. @@ -56,9 +53,9 @@ const REF_ONE: usize = 1 << REF_COUNT_SHIFT; /// /// A task is initialized with three references: /// -/// * A reference that will be stored in an OwnedTasks or LocalOwnedTasks. +/// * A reference that will be stored in an `OwnedTasks` or `LocalOwnedTasks`. /// * A reference that will be sent to the scheduler as an ordinary notification. -/// * A reference for the JoinHandle. +/// * A reference for the `JoinHandle`. /// /// As the task starts with a `JoinHandle`, `JOIN_INTEREST` is set. /// As the task starts with a `Notified`, `NOTIFIED` is set. @@ -270,7 +267,11 @@ impl State { }) } - /// Transitions the state to `NOTIFIED`, unconditionally increasing the ref count. + /// Transitions the state to `NOTIFIED`, unconditionally increasing the ref + /// count. + /// + /// Returns `true` if the notified bit was transitioned from `0` to `1`; + /// otherwise `false.` #[cfg(all( tokio_unstable, tokio_taskdump, @@ -278,12 +279,16 @@ impl State { target_os = "linux", any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64") ))] - pub(super) fn transition_to_notified_for_tracing(&self) { + pub(super) fn transition_to_notified_for_tracing(&self) -> bool { self.fetch_update_action(|mut snapshot| { - snapshot.set_notified(); - snapshot.ref_inc(); - ((), Some(snapshot)) - }); + if snapshot.is_notified() { + (false, None) + } else { + snapshot.set_notified(); + snapshot.ref_inc(); + (true, Some(snapshot)) + } + }) } /// Sets the cancelled bit and transitions the state to `NOTIFIED` if idle. diff --git a/vendor/tokio/src/runtime/task/trace/mod.rs b/vendor/tokio/src/runtime/task/trace/mod.rs index 185d682a4..7c9acc035 100644 --- a/vendor/tokio/src/runtime/task/trace/mod.rs +++ b/vendor/tokio/src/runtime/task/trace/mod.rs @@ -265,21 +265,26 @@ impl Future for Root { } } -/// Trace and poll all tasks of the current_thread runtime. +/// Trace and poll all tasks of the `current_thread` runtime. pub(in crate::runtime) fn trace_current_thread( owned: &OwnedTasks>, local: &mut VecDeque>>, injection: &Inject>, ) -> Vec { // clear the local and injection queues - local.clear(); + + let mut dequeued = Vec::new(); + + while let Some(task) = local.pop_back() { + dequeued.push(task); + } while let Some(task) = injection.pop() { - drop(task); + dequeued.push(task); } // precondition: We have drained the tasks from the injection queue. - trace_owned(owned) + trace_owned(owned, dequeued) } cfg_rt_multi_thread! { @@ -288,7 +293,7 @@ cfg_rt_multi_thread! { use crate::runtime::scheduler::multi_thread::Synced; use crate::runtime::scheduler::inject::Shared; - /// Trace and poll all tasks of the current_thread runtime. + /// Trace and poll all tasks of the `current_thread` runtime. /// /// ## Safety /// @@ -299,22 +304,24 @@ cfg_rt_multi_thread! { synced: &Mutex, injection: &Shared>, ) -> Vec { + let mut dequeued = Vec::new(); + // clear the local queue while let Some(notified) = local.pop() { - drop(notified); + dequeued.push(notified); } // clear the injection queue let mut synced = synced.lock(); while let Some(notified) = injection.pop(&mut synced.inject) { - drop(notified); + dequeued.push(notified); } drop(synced); // precondition: we have drained the tasks from the local and injection // queues. - trace_owned(owned) + trace_owned(owned, dequeued) } } @@ -324,14 +331,20 @@ cfg_rt_multi_thread! { /// /// This helper presumes exclusive access to each task. The tasks must not exist /// in any other queue. -fn trace_owned(owned: &OwnedTasks) -> Vec { - // notify each task - let mut tasks = vec![]; +fn trace_owned(owned: &OwnedTasks, dequeued: Vec>) -> Vec { + let mut tasks = dequeued; + // Notify and trace all un-notified tasks. The dequeued tasks are already + // notified and so do not need to be re-notified. owned.for_each(|task| { - // notify the task (and thus make it poll-able) and stash it - tasks.push(task.notify_for_tracing()); - // we do not poll it here since we hold a lock on `owned` and the task - // may complete and need to remove itself from `owned`. + // Notify the task (and thus make it poll-able) and stash it. This fails + // if the task is already notified. In these cases, we skip tracing the + // task. + if let Some(notified) = task.notify_for_tracing() { + tasks.push(notified); + } + // We do not poll tasks here, since we hold a lock on `owned` and the + // task may complete and need to remove itself from `owned`. Polling + // such a task here would result in a deadlock. }); tasks diff --git a/vendor/tokio/src/runtime/tests/loom_local.rs b/vendor/tokio/src/runtime/tests/loom_local.rs index d9a07a45f..89d025b81 100644 --- a/vendor/tokio/src/runtime/tests/loom_local.rs +++ b/vendor/tokio/src/runtime/tests/loom_local.rs @@ -9,7 +9,7 @@ use std::task::Poll; /// to the runtime itself. This means that if they are not properly removed at /// runtime shutdown, this will cause a memory leak. /// -/// This test verifies that waking something during shutdown of a LocalSet does +/// This test verifies that waking something during shutdown of a `LocalSet` does /// not result in tasks lingering in the queue once shutdown is complete. This /// is verified using loom's leak finder. #[test] diff --git a/vendor/tokio/src/runtime/tests/task.rs b/vendor/tokio/src/runtime/tests/task.rs index 0485bba7a..a0604505c 100644 --- a/vendor/tokio/src/runtime/tests/task.rs +++ b/vendor/tokio/src/runtime/tests/task.rs @@ -241,7 +241,7 @@ fn with(f: impl FnOnce(Runtime)) { let _reset = Reset; let rt = Runtime(Arc::new(Inner { - owned: OwnedTasks::new(), + owned: OwnedTasks::new(16), core: Mutex::new(Core { queue: VecDeque::new(), }), @@ -308,14 +308,13 @@ impl Runtime { fn shutdown(&self) { let mut core = self.0.core.try_lock().unwrap(); - self.0.owned.close_and_shutdown_all(); + self.0.owned.close_and_shutdown_all(0); while let Some(task) = core.queue.pop_back() { drop(task); } drop(core); - assert!(self.0.owned.is_empty()); } } diff --git a/vendor/tokio/src/runtime/tests/task_combinations.rs b/vendor/tokio/src/runtime/tests/task_combinations.rs index ca13c8c95..0f99ed662 100644 --- a/vendor/tokio/src/runtime/tests/task_combinations.rs +++ b/vendor/tokio/src/runtime/tests/task_combinations.rs @@ -64,8 +64,8 @@ enum CombiAbortSource { AbortHandle, } -#[cfg(panic = "unwind")] #[test] +#[cfg_attr(panic = "abort", ignore)] fn test_combinations() { let mut rt = &[ CombiRuntime::CurrentThread, diff --git a/vendor/tokio/src/runtime/time/entry.rs b/vendor/tokio/src/runtime/time/entry.rs index 634ed2031..0998b5301 100644 --- a/vendor/tokio/src/runtime/time/entry.rs +++ b/vendor/tokio/src/runtime/time/entry.rs @@ -11,10 +11,10 @@ //! 2) a held driver lock. //! //! It follows from this that any changes made while holding BOTH 1 and 2 will -//! be reliably visible, regardless of ordering. This is because of the acq/rel +//! be reliably visible, regardless of ordering. This is because of the `acq/rel` //! fences on the driver lock ensuring ordering with 2, and rust mutable //! reference rules for 1 (a mutable reference to an object can't be passed -//! between threads without an acq/rel barrier, and same-thread we have local +//! between threads without an `acq/rel` barrier, and same-thread we have local //! happens-before ordering). //! //! # State field @@ -81,12 +81,12 @@ pub(super) const MAX_SAFE_MILLIS_DURATION: u64 = u64::MAX - 2; /// time (if registered), or otherwise the result of the timer completing, as /// well as the registered waker. /// -/// Generally, the StateCell is only permitted to be accessed from two contexts: -/// Either a thread holding the corresponding &mut TimerEntry, or a thread -/// holding the timer driver lock. The write actions on the StateCell amount to -/// passing "ownership" of the StateCell between these contexts; moving a timer -/// from the TimerEntry to the driver requires _both_ holding the &mut -/// TimerEntry and the driver lock, while moving it back (firing the timer) +/// Generally, the `StateCell` is only permitted to be accessed from two contexts: +/// Either a thread holding the corresponding `&mut TimerEntry`, or a thread +/// holding the timer driver lock. The write actions on the `StateCell` amount to +/// passing "ownership" of the `StateCell` between these contexts; moving a timer +/// from the `TimerEntry` to the driver requires _both_ holding the `&mut +/// TimerEntry` and the driver lock, while moving it back (firing the timer) /// requires only the driver lock. pub(super) struct StateCell { /// Holds either the scheduled expiration time for this timer, or (if the @@ -164,7 +164,7 @@ impl StateCell { /// Marks this timer as being moved to the pending list, if its scheduled /// time is not after `not_after`. /// - /// If the timer is scheduled for a time after not_after, returns an Err + /// If the timer is scheduled for a time after `not_after`, returns an Err /// containing the current scheduled time. /// /// SAFETY: Must hold the driver lock. @@ -314,15 +314,15 @@ pub(crate) struct TimerEntry { unsafe impl Send for TimerEntry {} unsafe impl Sync for TimerEntry {} -/// An TimerHandle is the (non-enforced) "unique" pointer from the driver to the -/// timer entry. Generally, at most one TimerHandle exists for a timer at a time +/// An `TimerHandle` is the (non-enforced) "unique" pointer from the driver to the +/// timer entry. Generally, at most one `TimerHandle` exists for a timer at a time /// (enforced by the timer state machine). /// -/// SAFETY: An TimerHandle is essentially a raw pointer, and the usual caveats -/// of pointer safety apply. In particular, TimerHandle does not itself enforce -/// that the timer does still exist; however, normally an TimerHandle is created +/// SAFETY: An `TimerHandle` is essentially a raw pointer, and the usual caveats +/// of pointer safety apply. In particular, `TimerHandle` does not itself enforce +/// that the timer does still exist; however, normally an `TimerHandle` is created /// immediately before registering the timer, and is consumed when firing the -/// timer, to help minimize mistakes. Still, because TimerHandle cannot enforce +/// timer, to help minimize mistakes. Still, because `TimerHandle` cannot enforce /// memory safety, all operations are unsafe. #[derive(Debug)] pub(crate) struct TimerHandle { @@ -437,7 +437,7 @@ impl TimerShared { self.state.extend_expiration(t) } - /// Returns a TimerHandle for this timer. + /// Returns a `TimerHandle` for this timer. pub(super) fn handle(&self) -> TimerHandle { TimerHandle { inner: NonNull::from(self), diff --git a/vendor/tokio/src/runtime/time/source.rs b/vendor/tokio/src/runtime/time/source.rs index 4647bc412..c709dc538 100644 --- a/vendor/tokio/src/runtime/time/source.rs +++ b/vendor/tokio/src/runtime/time/source.rs @@ -1,7 +1,7 @@ use super::MAX_SAFE_MILLIS_DURATION; use crate::time::{Clock, Duration, Instant}; -/// A structure which handles conversion from Instants to u64 timestamps. +/// A structure which handles conversion from Instants to `u64` timestamps. #[derive(Debug)] pub(crate) struct TimeSource { start_time: Instant, diff --git a/vendor/tokio/src/runtime/time/wheel/level.rs b/vendor/tokio/src/runtime/time/wheel/level.rs index 7e48ff5c5..a828c0067 100644 --- a/vendor/tokio/src/runtime/time/wheel/level.rs +++ b/vendor/tokio/src/runtime/time/wheel/level.rs @@ -15,7 +15,7 @@ pub(crate) struct Level { /// The least-significant bit represents slot zero. occupied: u64, - /// Slots. We access these via the EntryInner `current_list` as well, so this needs to be an UnsafeCell. + /// Slots. We access these via the EntryInner `current_list` as well, so this needs to be an `UnsafeCell`. slot: [EntryList; LEVEL_MULT], } @@ -267,7 +267,7 @@ mod test { for level in 1..5 { for pos in level..64 { let a = pos * 64_usize.pow(level as u32); - assert_eq!(pos as usize, slot_for(a as u64, level)); + assert_eq!(pos, slot_for(a as u64, level)); } } } diff --git a/vendor/tokio/src/signal/ctrl_c.rs b/vendor/tokio/src/signal/ctrl_c.rs index b26ab7ead..e1e92fa99 100644 --- a/vendor/tokio/src/signal/ctrl_c.rs +++ b/vendor/tokio/src/signal/ctrl_c.rs @@ -23,10 +23,10 @@ use std::io; /// the entire process**. /// /// For example, Unix systems will terminate a process by default when it -/// receives a signal generated by "CTRL+C" on the terminal. But, when a +/// receives a signal generated by `"CTRL+C"` on the terminal. But, when a /// `ctrl_c` stream is created to listen for this signal, the time it arrives, /// it will be translated to a stream event, and the process will continue to -/// execute. **Even if this `Signal` instance is dropped, subsequent SIGINT +/// execute. **Even if this `Signal` instance is dropped, subsequent `SIGINT` /// deliveries will end up captured by Tokio, and the default platform behavior /// will NOT be reset**. /// diff --git a/vendor/tokio/src/signal/mod.rs b/vendor/tokio/src/signal/mod.rs index ab47e8af2..59f71db0e 100644 --- a/vendor/tokio/src/signal/mod.rs +++ b/vendor/tokio/src/signal/mod.rs @@ -23,7 +23,7 @@ //! } //! ``` //! -//! Wait for SIGHUP on Unix +//! Wait for `SIGHUP` on Unix //! //! ```rust,no_run //! # #[cfg(unix)] { diff --git a/vendor/tokio/src/signal/registry.rs b/vendor/tokio/src/signal/registry.rs index 022ad082b..3fff8df93 100644 --- a/vendor/tokio/src/signal/registry.rs +++ b/vendor/tokio/src/signal/registry.rs @@ -1,5 +1,3 @@ -#![allow(clippy::unit_arg)] - use crate::signal::os::{OsExtraData, OsStorage}; use crate::sync::watch; use crate::util::once_cell::OnceCell; @@ -28,7 +26,7 @@ impl Default for EventInfo { } } -/// An interface for retrieving the `EventInfo` for a particular eventId. +/// An interface for retrieving the `EventInfo` for a particular `eventId`. pub(crate) trait Storage { /// Gets the `EventInfo` for `id` if it exists. fn event_info(&self, id: EventId) -> Option<&EventInfo>; @@ -61,7 +59,7 @@ pub(crate) trait Init { /// Manages and distributes event notifications to any registered listeners. /// /// Generic over the underlying storage to allow for domain specific -/// optimizations (e.g. eventIds may or may not be contiguous). +/// optimizations (e.g. `eventIds` may or may not be contiguous). #[derive(Debug)] pub(crate) struct Registry { storage: S, diff --git a/vendor/tokio/src/signal/unix.rs b/vendor/tokio/src/signal/unix.rs index d3d7fd4ab..52a9cbaac 100644 --- a/vendor/tokio/src/signal/unix.rs +++ b/vendor/tokio/src/signal/unix.rs @@ -97,7 +97,7 @@ impl SignalKind { self.0 } - /// Represents the SIGALRM signal. + /// Represents the `SIGALRM` signal. /// /// On Unix systems this signal is sent when a real-time timer has expired. /// By default, the process is terminated by this signal. @@ -105,7 +105,7 @@ impl SignalKind { Self(libc::SIGALRM) } - /// Represents the SIGCHLD signal. + /// Represents the `SIGCHLD` signal. /// /// On Unix systems this signal is sent when the status of a child process /// has changed. By default, this signal is ignored. @@ -113,7 +113,7 @@ impl SignalKind { Self(libc::SIGCHLD) } - /// Represents the SIGHUP signal. + /// Represents the `SIGHUP` signal. /// /// On Unix systems this signal is sent when the terminal is disconnected. /// By default, the process is terminated by this signal. @@ -121,7 +121,7 @@ impl SignalKind { Self(libc::SIGHUP) } - /// Represents the SIGINFO signal. + /// Represents the `SIGINFO` signal. /// /// On Unix systems this signal is sent to request a status update from the /// process. By default, this signal is ignored. @@ -136,7 +136,7 @@ impl SignalKind { Self(libc::SIGINFO) } - /// Represents the SIGINT signal. + /// Represents the `SIGINT` signal. /// /// On Unix systems this signal is sent to interrupt a program. /// By default, the process is terminated by this signal. @@ -144,7 +144,7 @@ impl SignalKind { Self(libc::SIGINT) } - /// Represents the SIGIO signal. + /// Represents the `SIGIO` signal. /// /// On Unix systems this signal is sent when I/O operations are possible /// on some file descriptor. By default, this signal is ignored. @@ -152,7 +152,7 @@ impl SignalKind { Self(libc::SIGIO) } - /// Represents the SIGPIPE signal. + /// Represents the `SIGPIPE` signal. /// /// On Unix systems this signal is sent when the process attempts to write /// to a pipe which has no reader. By default, the process is terminated by @@ -161,7 +161,7 @@ impl SignalKind { Self(libc::SIGPIPE) } - /// Represents the SIGQUIT signal. + /// Represents the `SIGQUIT` signal. /// /// On Unix systems this signal is sent to issue a shutdown of the /// process, after which the OS will dump the process core. @@ -170,7 +170,7 @@ impl SignalKind { Self(libc::SIGQUIT) } - /// Represents the SIGTERM signal. + /// Represents the `SIGTERM` signal. /// /// On Unix systems this signal is sent to issue a shutdown of the /// process. By default, the process is terminated by this signal. @@ -178,7 +178,7 @@ impl SignalKind { Self(libc::SIGTERM) } - /// Represents the SIGUSR1 signal. + /// Represents the `SIGUSR1` signal. /// /// On Unix systems this is a user defined signal. /// By default, the process is terminated by this signal. @@ -186,7 +186,7 @@ impl SignalKind { Self(libc::SIGUSR1) } - /// Represents the SIGUSR2 signal. + /// Represents the `SIGUSR2` signal. /// /// On Unix systems this is a user defined signal. /// By default, the process is terminated by this signal. @@ -194,7 +194,7 @@ impl SignalKind { Self(libc::SIGUSR2) } - /// Represents the SIGWINCH signal. + /// Represents the `SIGWINCH` signal. /// /// On Unix systems this signal is sent when the terminal window is resized. /// By default, this signal is ignored. @@ -330,10 +330,10 @@ fn signal_enable(signal: SignalKind, handle: &Handle) -> io::Result<()> { /// entire process**. /// /// For example, Unix systems will terminate a process by default when it -/// receives SIGINT. But, when a `Signal` instance is created to listen for -/// this signal, the next SIGINT that arrives will be translated to a stream +/// receives `SIGINT`. But, when a `Signal` instance is created to listen for +/// this signal, the next `SIGINT` that arrives will be translated to a stream /// event, and the process will continue to execute. **Even if this `Signal` -/// instance is dropped, subsequent SIGINT deliveries will end up captured by +/// instance is dropped, subsequent `SIGINT` deliveries will end up captured by /// Tokio, and the default platform behavior will NOT be reset**. /// /// Thus, applications should take care to ensure the expected signal behavior @@ -341,7 +341,7 @@ fn signal_enable(signal: SignalKind, handle: &Handle) -> io::Result<()> { /// /// # Examples /// -/// Wait for SIGHUP +/// Wait for `SIGHUP` /// /// ```rust,no_run /// use tokio::signal::unix::{signal, SignalKind}; @@ -424,7 +424,7 @@ impl Signal { /// /// # Examples /// - /// Wait for SIGHUP + /// Wait for `SIGHUP` /// /// ```rust,no_run /// use tokio::signal::unix::{signal, SignalKind}; diff --git a/vendor/tokio/src/signal/windows.rs b/vendor/tokio/src/signal/windows.rs index 2f70f98b1..d8af9b4c9 100644 --- a/vendor/tokio/src/signal/windows.rs +++ b/vendor/tokio/src/signal/windows.rs @@ -3,7 +3,7 @@ //! This module is only defined on Windows and allows receiving "ctrl-c", //! "ctrl-break", "ctrl-logoff", "ctrl-shutdown", and "ctrl-close" //! notifications. These events are listened for via the `SetConsoleCtrlHandler` -//! function which receives the corresponding windows_sys event type. +//! function which receives the corresponding `windows_sys` event type. #![cfg(any(windows, docsrs))] #![cfg_attr(docsrs, doc(cfg(all(windows, feature = "signal"))))] @@ -257,8 +257,8 @@ pub fn ctrl_close() -> io::Result { }) } -/// Represents a listener which receives "ctrl-close" notitifications sent to the process -/// via 'SetConsoleCtrlHandler'. +/// Represents a listener which receives "ctrl-close" notifications sent to the process +/// via `SetConsoleCtrlHandler`. /// /// A notification to this process notifies *all* listeners listening for /// this event. Moreover, the notifications **are coalesced** if they aren't processed @@ -354,8 +354,8 @@ pub fn ctrl_shutdown() -> io::Result { }) } -/// Represents a listener which receives "ctrl-shutdown" notitifications sent to the process -/// via 'SetConsoleCtrlHandler'. +/// Represents a listener which receives "ctrl-shutdown" notifications sent to the process +/// via `SetConsoleCtrlHandler`. /// /// A notification to this process notifies *all* listeners listening for /// this event. Moreover, the notifications **are coalesced** if they aren't processed @@ -451,8 +451,8 @@ pub fn ctrl_logoff() -> io::Result { }) } -/// Represents a listener which receives "ctrl-logoff" notitifications sent to the process -/// via 'SetConsoleCtrlHandler'. +/// Represents a listener which receives "ctrl-logoff" notifications sent to the process +/// via `SetConsoleCtrlHandler`. /// /// A notification to this process notifies *all* listeners listening for /// this event. Moreover, the notifications **are coalesced** if they aren't processed diff --git a/vendor/tokio/src/sync/barrier.rs b/vendor/tokio/src/sync/barrier.rs index 29b6d4e48..a1f87c44a 100644 --- a/vendor/tokio/src/sync/barrier.rs +++ b/vendor/tokio/src/sync/barrier.rs @@ -74,6 +74,7 @@ impl Barrier { let resource_span = { let location = std::panic::Location::caller(); let resource_span = tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "Barrier", kind = "Sync", diff --git a/vendor/tokio/src/sync/batch_semaphore.rs b/vendor/tokio/src/sync/batch_semaphore.rs index 35de9a574..aa23dea7d 100644 --- a/vendor/tokio/src/sync/batch_semaphore.rs +++ b/vendor/tokio/src/sync/batch_semaphore.rs @@ -71,7 +71,7 @@ pub struct AcquireError(()); pub(crate) struct Acquire<'a> { node: Waiter, semaphore: &'a Semaphore, - num_permits: u32, + num_permits: usize, queued: bool, } @@ -262,13 +262,13 @@ impl Semaphore { self.permits.load(Acquire) & Self::CLOSED == Self::CLOSED } - pub(crate) fn try_acquire(&self, num_permits: u32) -> Result<(), TryAcquireError> { + pub(crate) fn try_acquire(&self, num_permits: usize) -> Result<(), TryAcquireError> { assert!( - num_permits as usize <= Self::MAX_PERMITS, + num_permits <= Self::MAX_PERMITS, "a semaphore may not have more than MAX_PERMITS permits ({})", Self::MAX_PERMITS ); - let num_permits = (num_permits as usize) << Self::PERMIT_SHIFT; + let num_permits = num_permits << Self::PERMIT_SHIFT; let mut curr = self.permits.load(Acquire); loop { // Has the semaphore closed? @@ -293,7 +293,7 @@ impl Semaphore { } } - pub(crate) fn acquire(&self, num_permits: u32) -> Acquire<'_> { + pub(crate) fn acquire(&self, num_permits: usize) -> Acquire<'_> { Acquire::new(self, num_permits) } @@ -371,7 +371,7 @@ impl Semaphore { fn poll_acquire( &self, cx: &mut Context<'_>, - num_permits: u32, + num_permits: usize, node: Pin<&mut Waiter>, queued: bool, ) -> Poll> { @@ -380,7 +380,7 @@ impl Semaphore { let needed = if queued { node.state.load(Acquire) << Self::PERMIT_SHIFT } else { - (num_permits as usize) << Self::PERMIT_SHIFT + num_permits << Self::PERMIT_SHIFT }; let mut lock = None; @@ -506,12 +506,12 @@ impl fmt::Debug for Semaphore { impl Waiter { fn new( - num_permits: u32, + num_permits: usize, #[cfg(all(tokio_unstable, feature = "tracing"))] ctx: trace::AsyncOpTracingCtx, ) -> Self { Waiter { waker: UnsafeCell::new(None), - state: AtomicUsize::new(num_permits as usize), + state: AtomicUsize::new(num_permits), pointers: linked_list::Pointers::new(), #[cfg(all(tokio_unstable, feature = "tracing"))] ctx, @@ -591,7 +591,7 @@ impl Future for Acquire<'_> { } impl<'a> Acquire<'a> { - fn new(semaphore: &'a Semaphore, num_permits: u32) -> Self { + fn new(semaphore: &'a Semaphore, num_permits: usize) -> Self { #[cfg(any(not(tokio_unstable), not(feature = "tracing")))] return Self { node: Waiter::new(num_permits), @@ -635,14 +635,14 @@ impl<'a> Acquire<'a> { }); } - fn project(self: Pin<&mut Self>) -> (Pin<&mut Waiter>, &Semaphore, u32, &mut bool) { + fn project(self: Pin<&mut Self>) -> (Pin<&mut Waiter>, &Semaphore, usize, &mut bool) { fn is_unpin() {} unsafe { // Safety: all fields other than `node` are `Unpin` is_unpin::<&Semaphore>(); is_unpin::<&mut bool>(); - is_unpin::(); + is_unpin::(); let this = self.get_unchecked_mut(); ( @@ -673,7 +673,7 @@ impl Drop for Acquire<'_> { // Safety: we have locked the wait list. unsafe { waiters.queue.remove(node) }; - let acquired_permits = self.num_permits as usize - self.node.state.load(Acquire); + let acquired_permits = self.num_permits - self.node.state.load(Acquire); if acquired_permits > 0 { self.semaphore.add_permits_locked(acquired_permits, waiters); } diff --git a/vendor/tokio/src/sync/broadcast.rs b/vendor/tokio/src/sync/broadcast.rs index 6de579a15..499e5296d 100644 --- a/vendor/tokio/src/sync/broadcast.rs +++ b/vendor/tokio/src/sync/broadcast.rs @@ -117,7 +117,7 @@ //! ``` use crate::loom::cell::UnsafeCell; -use crate::loom::sync::atomic::AtomicUsize; +use crate::loom::sync::atomic::{AtomicBool, AtomicUsize}; use crate::loom::sync::{Arc, Mutex, MutexGuard, RwLock, RwLockReadGuard}; use crate::util::linked_list::{self, GuardedLinkedList, LinkedList}; use crate::util::WakeList; @@ -127,7 +127,7 @@ use std::future::Future; use std::marker::PhantomPinned; use std::pin::Pin; use std::ptr::NonNull; -use std::sync::atomic::Ordering::SeqCst; +use std::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst}; use std::task::{Context, Poll, Waker}; use std::usize; @@ -215,7 +215,7 @@ pub mod error { use std::fmt; - /// Error returned by from the [`send`] function on a [`Sender`]. + /// Error returned by the [`send`] function on a [`Sender`]. /// /// A **send** operation can only fail if there are no active receivers, /// implying that the message could never be received. The error contains the @@ -354,7 +354,7 @@ struct Slot { /// An entry in the wait queue. struct Waiter { /// True if queued. - queued: bool, + queued: AtomicBool, /// Task waiting on the broadcast channel. waker: Option, @@ -369,7 +369,7 @@ struct Waiter { impl Waiter { fn new() -> Self { Self { - queued: false, + queued: AtomicBool::new(false), waker: None, pointers: linked_list::Pointers::new(), _p: PhantomPinned, @@ -897,15 +897,22 @@ impl Shared { 'outer: loop { while wakers.can_push() { match list.pop_back_locked(&mut tail) { - Some(mut waiter) => { - // Safety: `tail` lock is still held. - let waiter = unsafe { waiter.as_mut() }; + Some(waiter) => { + unsafe { + // Safety: accessing `waker` is safe because + // the tail lock is held. + if let Some(waker) = (*waiter.as_ptr()).waker.take() { + wakers.push(waker); + } - assert!(waiter.queued); - waiter.queued = false; - - if let Some(waker) = waiter.waker.take() { - wakers.push(waker); + // Safety: `queued` is atomic. + let queued = &(*waiter.as_ptr()).queued; + // `Relaxed` suffices because the tail lock is held. + assert!(queued.load(Relaxed)); + // `Release` is needed to synchronize with `Recv::drop`. + // It is critical to set this variable **after** waker + // is extracted, otherwise we may data race with `Recv::drop`. + queued.store(false, Release); } } None => { @@ -1104,8 +1111,13 @@ impl Receiver { } } - if !(*ptr).queued { - (*ptr).queued = true; + // If the waiter is not already queued, enqueue it. + // `Relaxed` order suffices: we have synchronized with + // all writers through the tail lock that we hold. + if !(*ptr).queued.load(Relaxed) { + // `Relaxed` order suffices: all the readers will + // synchronize with this write through the tail lock. + (*ptr).queued.store(true, Relaxed); tail.waiters.push_front(NonNull::new_unchecked(&mut *ptr)); } }); @@ -1357,7 +1369,7 @@ impl<'a, T> Recv<'a, T> { Recv { receiver, waiter: UnsafeCell::new(Waiter { - queued: false, + queued: AtomicBool::new(false), waker: None, pointers: linked_list::Pointers::new(), _p: PhantomPinned, @@ -1402,22 +1414,37 @@ where impl<'a, T> Drop for Recv<'a, T> { fn drop(&mut self) { - // Acquire the tail lock. This is required for safety before accessing - // the waiter node. - let mut tail = self.receiver.shared.tail.lock(); - - // safety: tail lock is held - let queued = self.waiter.with(|ptr| unsafe { (*ptr).queued }); + // Safety: `waiter.queued` is atomic. + // Acquire ordering is required to synchronize with + // `Shared::notify_rx` before we drop the object. + let queued = self + .waiter + .with(|ptr| unsafe { (*ptr).queued.load(Acquire) }); + // If the waiter is queued, we need to unlink it from the waiters list. + // If not, no further synchronization is required, since the waiter + // is not in the list and, as such, is not shared with any other threads. if queued { - // Remove the node - // - // safety: tail lock is held and the wait node is verified to be in - // the list. - unsafe { - self.waiter.with_mut(|ptr| { - tail.waiters.remove((&mut *ptr).into()); - }); + // Acquire the tail lock. This is required for safety before accessing + // the waiter node. + let mut tail = self.receiver.shared.tail.lock(); + + // Safety: tail lock is held. + // `Relaxed` order suffices because we hold the tail lock. + let queued = self + .waiter + .with_mut(|ptr| unsafe { (*ptr).queued.load(Relaxed) }); + + if queued { + // Remove the node + // + // safety: tail lock is held and the wait node is verified to be in + // the list. + unsafe { + self.waiter.with_mut(|ptr| { + tail.waiters.remove((&mut *ptr).into()); + }); + } } } } diff --git a/vendor/tokio/src/sync/mpsc/bounded.rs b/vendor/tokio/src/sync/mpsc/bounded.rs index 4aa8b6377..a1e0a82d9 100644 --- a/vendor/tokio/src/sync/mpsc/bounded.rs +++ b/vendor/tokio/src/sync/mpsc/bounded.rs @@ -68,6 +68,18 @@ pub struct Permit<'a, T> { chan: &'a chan::Tx, } +/// An [`Iterator`] of [`Permit`] that can be used to hold `n` slots in the channel. +/// +/// `PermitIterator` values are returned by [`Sender::reserve_many()`] and [`Sender::try_reserve_many()`] +/// and are used to guarantee channel capacity before generating `n` messages to send. +/// +/// [`Sender::reserve_many()`]: Sender::reserve_many +/// [`Sender::try_reserve_many()`]: Sender::try_reserve_many +pub struct PermitIterator<'a, T> { + chan: &'a chan::Tx, + n: usize, +} + /// Owned permit to send one value into the channel. /// /// This is identical to the [`Permit`] type, except that it moves the sender @@ -464,8 +476,8 @@ impl Receiver { /// When the method returns `Poll::Pending`, the `Waker` in the provided /// `Context` is scheduled to receive a wakeup when a message is sent on any /// receiver, or when the channel is closed. Note that on multiple calls to - /// `poll_recv`, only the `Waker` from the `Context` passed to the most - /// recent call is scheduled to receive a wakeup. + /// `poll_recv` or `poll_recv_many`, only the `Waker` from the `Context` + /// passed to the most recent call is scheduled to receive a wakeup. /// /// If this method returns `Poll::Pending` due to a spurious failure, then /// the `Waker` will be notified when the situation causing the spurious @@ -475,6 +487,83 @@ impl Receiver { pub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll> { self.chan.recv(cx) } + + /// Polls to receive multiple messages on this channel, extending the provided buffer. + /// + /// This method returns: + /// * `Poll::Pending` if no messages are available but the channel is not closed, or if a + /// spurious failure happens. + /// * `Poll::Ready(count)` where `count` is the number of messages successfully received and + /// stored in `buffer`. This can be less than, or equal to, `limit`. + /// * `Poll::Ready(0)` if `limit` is set to zero or when the channel is closed. + /// + /// When the method returns `Poll::Pending`, the `Waker` in the provided + /// `Context` is scheduled to receive a wakeup when a message is sent on any + /// receiver, or when the channel is closed. Note that on multiple calls to + /// `poll_recv` or `poll_recv_many`, only the `Waker` from the `Context` + /// passed to the most recent call is scheduled to receive a wakeup. + /// + /// Note that this method does not guarantee that exactly `limit` messages + /// are received. Rather, if at least one message is available, it returns + /// as many messages as it can up to the given limit. This method returns + /// zero only if the channel is closed (or if `limit` is zero). + /// + /// # Examples + /// + /// ``` + /// use std::task::{Context, Poll}; + /// use std::pin::Pin; + /// use tokio::sync::mpsc; + /// use futures::Future; + /// + /// struct MyReceiverFuture<'a> { + /// receiver: mpsc::Receiver, + /// buffer: &'a mut Vec, + /// limit: usize, + /// } + /// + /// impl<'a> Future for MyReceiverFuture<'a> { + /// type Output = usize; // Number of messages received + /// + /// fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + /// let MyReceiverFuture { receiver, buffer, limit } = &mut *self; + /// + /// // Now `receiver` and `buffer` are mutable references, and `limit` is copied + /// match receiver.poll_recv_many(cx, *buffer, *limit) { + /// Poll::Pending => Poll::Pending, + /// Poll::Ready(count) => Poll::Ready(count), + /// } + /// } + /// } + /// + /// #[tokio::main] + /// async fn main() { + /// let (tx, rx) = mpsc::channel(32); + /// let mut buffer = Vec::new(); + /// + /// let my_receiver_future = MyReceiverFuture { + /// receiver: rx, + /// buffer: &mut buffer, + /// limit: 3, + /// }; + /// + /// for i in 0..10 { + /// tx.send(i).await.unwrap(); + /// } + /// + /// let count = my_receiver_future.await; + /// assert_eq!(count, 3); + /// assert_eq!(buffer, vec![0,1,2]) + /// } + /// ``` + pub fn poll_recv_many( + &mut self, + cx: &mut Context<'_>, + buffer: &mut Vec, + limit: usize, + ) -> Poll { + self.chan.recv_many(cx, buffer, limit) + } } impl fmt::Debug for Receiver { @@ -849,10 +938,74 @@ impl Sender { /// } /// ``` pub async fn reserve(&self) -> Result, SendError<()>> { - self.reserve_inner().await?; + self.reserve_inner(1).await?; Ok(Permit { chan: &self.chan }) } + /// Waits for channel capacity. Once capacity to send `n` messages is + /// available, it is reserved for the caller. + /// + /// If the channel is full or if there are fewer than `n` permits available, the function waits + /// for the number of unreceived messages to become `n` less than the channel capacity. + /// Capacity to send `n` message is then reserved for the caller. + /// + /// A [`PermitIterator`] is returned to track the reserved capacity. + /// You can call this [`Iterator`] until it is exhausted to + /// get a [`Permit`] and then call [`Permit::send`]. This function is similar to + /// [`try_reserve_many`] except it awaits for the slots to become available. + /// + /// If the channel is closed, the function returns a [`SendError`]. + /// + /// Dropping [`PermitIterator`] without consuming it entirely releases the remaining + /// permits back to the channel. + /// + /// [`PermitIterator`]: PermitIterator + /// [`Permit`]: Permit + /// [`send`]: Permit::send + /// [`try_reserve_many`]: Sender::try_reserve_many + /// + /// # Cancel safety + /// + /// This channel uses a queue to ensure that calls to `send` and `reserve_many` + /// complete in the order they were requested. Cancelling a call to + /// `reserve_many` makes you lose your place in the queue. + /// + /// # Examples + /// + /// ``` + /// use tokio::sync::mpsc; + /// + /// #[tokio::main] + /// async fn main() { + /// let (tx, mut rx) = mpsc::channel(2); + /// + /// // Reserve capacity + /// let mut permit = tx.reserve_many(2).await.unwrap(); + /// + /// // Trying to send directly on the `tx` will fail due to no + /// // available capacity. + /// assert!(tx.try_send(123).is_err()); + /// + /// // Sending with the permit iterator succeeds + /// permit.next().unwrap().send(456); + /// permit.next().unwrap().send(457); + /// + /// // The iterator should now be exhausted + /// assert!(permit.next().is_none()); + /// + /// // The value sent on the permit is received + /// assert_eq!(rx.recv().await.unwrap(), 456); + /// assert_eq!(rx.recv().await.unwrap(), 457); + /// } + /// ``` + pub async fn reserve_many(&self, n: usize) -> Result, SendError<()>> { + self.reserve_inner(n).await?; + Ok(PermitIterator { + chan: &self.chan, + n, + }) + } + /// Waits for channel capacity, moving the `Sender` and returning an owned /// permit. Once capacity to send one message is available, it is reserved /// for the caller. @@ -934,16 +1087,19 @@ impl Sender { /// [`send`]: OwnedPermit::send /// [`Arc::clone`]: std::sync::Arc::clone pub async fn reserve_owned(self) -> Result, SendError<()>> { - self.reserve_inner().await?; + self.reserve_inner(1).await?; Ok(OwnedPermit { chan: Some(self.chan), }) } - async fn reserve_inner(&self) -> Result<(), SendError<()>> { + async fn reserve_inner(&self, n: usize) -> Result<(), SendError<()>> { crate::trace::async_trace_leaf().await; - match self.chan.semaphore().semaphore.acquire(1).await { + if n > self.max_capacity() { + return Err(SendError(())); + } + match self.chan.semaphore().semaphore.acquire(n).await { Ok(()) => Ok(()), Err(_) => Err(SendError(())), } @@ -1002,6 +1158,91 @@ impl Sender { Ok(Permit { chan: &self.chan }) } + /// Tries to acquire `n` slots in the channel without waiting for the slot to become + /// available. + /// + /// A [`PermitIterator`] is returned to track the reserved capacity. + /// You can call this [`Iterator`] until it is exhausted to + /// get a [`Permit`] and then call [`Permit::send`]. This function is similar to + /// [`reserve_many`] except it does not await for the slots to become available. + /// + /// If there are fewer than `n` permits available on the channel, then + /// this function will return a [`TrySendError::Full`]. If the channel is closed + /// this function will return a [`TrySendError::Closed`]. + /// + /// Dropping [`PermitIterator`] without consuming it entirely releases the remaining + /// permits back to the channel. + /// + /// [`PermitIterator`]: PermitIterator + /// [`send`]: Permit::send + /// [`reserve_many`]: Sender::reserve_many + /// + /// # Examples + /// + /// ``` + /// use tokio::sync::mpsc; + /// + /// #[tokio::main] + /// async fn main() { + /// let (tx, mut rx) = mpsc::channel(2); + /// + /// // Reserve capacity + /// let mut permit = tx.try_reserve_many(2).unwrap(); + /// + /// // Trying to send directly on the `tx` will fail due to no + /// // available capacity. + /// assert!(tx.try_send(123).is_err()); + /// + /// // Trying to reserve an additional slot on the `tx` will + /// // fail because there is no capacity. + /// assert!(tx.try_reserve().is_err()); + /// + /// // Sending with the permit iterator succeeds + /// permit.next().unwrap().send(456); + /// permit.next().unwrap().send(457); + /// + /// // The iterator should now be exhausted + /// assert!(permit.next().is_none()); + /// + /// // The value sent on the permit is received + /// assert_eq!(rx.recv().await.unwrap(), 456); + /// assert_eq!(rx.recv().await.unwrap(), 457); + /// + /// // Trying to call try_reserve_many with 0 will return an empty iterator + /// let mut permit = tx.try_reserve_many(0).unwrap(); + /// assert!(permit.next().is_none()); + /// + /// // Trying to call try_reserve_many with a number greater than the channel + /// // capacity will return an error + /// let permit = tx.try_reserve_many(3); + /// assert!(permit.is_err()); + /// + /// // Trying to call try_reserve_many on a closed channel will return an error + /// drop(rx); + /// let permit = tx.try_reserve_many(1); + /// assert!(permit.is_err()); + /// + /// let permit = tx.try_reserve_many(0); + /// assert!(permit.is_err()); + /// } + /// ``` + pub fn try_reserve_many(&self, n: usize) -> Result, TrySendError<()>> { + if n > self.max_capacity() { + return Err(TrySendError::Full(())); + } + + match self.chan.semaphore().semaphore.try_acquire(n) { + Ok(()) => {} + Err(TryAcquireError::Closed) => return Err(TrySendError::Closed(())), + Err(TryAcquireError::NoPermits) => return Err(TrySendError::Full(())), + } + + Ok(PermitIterator { + chan: &self.chan, + n, + }) + } + /// Tries to acquire a slot in the channel without waiting for the slot to become /// available, returning an owned permit. /// @@ -1278,6 +1519,58 @@ impl fmt::Debug for Permit<'_, T> { } } +// ===== impl PermitIterator ===== + +impl<'a, T> Iterator for PermitIterator<'a, T> { + type Item = Permit<'a, T>; + + fn next(&mut self) -> Option { + if self.n == 0 { + return None; + } + + self.n -= 1; + Some(Permit { chan: self.chan }) + } + + fn size_hint(&self) -> (usize, Option) { + let n = self.n; + (n, Some(n)) + } +} +impl ExactSizeIterator for PermitIterator<'_, T> {} +impl std::iter::FusedIterator for PermitIterator<'_, T> {} + +impl Drop for PermitIterator<'_, T> { + fn drop(&mut self) { + use chan::Semaphore; + + if self.n == 0 { + return; + } + + let semaphore = self.chan.semaphore(); + + // Add the remaining permits back to the semaphore + semaphore.add_permits(self.n); + + // If this is the last sender for this channel, wake the receiver so + // that it can be notified that the channel is closed. + if semaphore.is_closed() && semaphore.is_idle() { + self.chan.wake_rx(); + } + } +} + +impl fmt::Debug for PermitIterator<'_, T> { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt.debug_struct("PermitIterator") + .field("chan", &self.chan) + .field("capacity", &self.n) + .finish() + } +} + // ===== impl Permit ===== impl OwnedPermit { diff --git a/vendor/tokio/src/sync/mpsc/error.rs b/vendor/tokio/src/sync/mpsc/error.rs index e41885664..2fc24b38d 100644 --- a/vendor/tokio/src/sync/mpsc/error.rs +++ b/vendor/tokio/src/sync/mpsc/error.rs @@ -24,7 +24,7 @@ impl Error for SendError {} // ===== TrySendError ===== /// This enumeration is the list of the possible error outcomes for the -/// [try_send](super::Sender::try_send) method. +/// [`try_send`](super::Sender::try_send) method. #[derive(PartialEq, Eq, Clone, Copy)] pub enum TrySendError { /// The data could not be sent on the channel because the channel is diff --git a/vendor/tokio/src/sync/mpsc/mod.rs b/vendor/tokio/src/sync/mpsc/mod.rs index b2af084b2..052620be1 100644 --- a/vendor/tokio/src/sync/mpsc/mod.rs +++ b/vendor/tokio/src/sync/mpsc/mod.rs @@ -95,7 +95,9 @@ pub(super) mod block; mod bounded; -pub use self::bounded::{channel, OwnedPermit, Permit, Receiver, Sender, WeakSender}; +pub use self::bounded::{ + channel, OwnedPermit, Permit, PermitIterator, Receiver, Sender, WeakSender, +}; mod chan; diff --git a/vendor/tokio/src/sync/mpsc/unbounded.rs b/vendor/tokio/src/sync/mpsc/unbounded.rs index d996b8564..7dff942ee 100644 --- a/vendor/tokio/src/sync/mpsc/unbounded.rs +++ b/vendor/tokio/src/sync/mpsc/unbounded.rs @@ -343,8 +343,8 @@ impl UnboundedReceiver { /// When the method returns `Poll::Pending`, the `Waker` in the provided /// `Context` is scheduled to receive a wakeup when a message is sent on any /// receiver, or when the channel is closed. Note that on multiple calls to - /// `poll_recv`, only the `Waker` from the `Context` passed to the most - /// recent call is scheduled to receive a wakeup. + /// `poll_recv` or `poll_recv_many`, only the `Waker` from the `Context` + /// passed to the most recent call is scheduled to receive a wakeup. /// /// If this method returns `Poll::Pending` due to a spurious failure, then /// the `Waker` will be notified when the situation causing the spurious @@ -354,6 +354,83 @@ impl UnboundedReceiver { pub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll> { self.chan.recv(cx) } + + /// Polls to receive multiple messages on this channel, extending the provided buffer. + /// + /// This method returns: + /// * `Poll::Pending` if no messages are available but the channel is not closed, or if a + /// spurious failure happens. + /// * `Poll::Ready(count)` where `count` is the number of messages successfully received and + /// stored in `buffer`. This can be less than, or equal to, `limit`. + /// * `Poll::Ready(0)` if `limit` is set to zero or when the channel is closed. + /// + /// When the method returns `Poll::Pending`, the `Waker` in the provided + /// `Context` is scheduled to receive a wakeup when a message is sent on any + /// receiver, or when the channel is closed. Note that on multiple calls to + /// `poll_recv` or `poll_recv_many`, only the `Waker` from the `Context` + /// passed to the most recent call is scheduled to receive a wakeup. + /// + /// Note that this method does not guarantee that exactly `limit` messages + /// are received. Rather, if at least one message is available, it returns + /// as many messages as it can up to the given limit. This method returns + /// zero only if the channel is closed (or if `limit` is zero). + /// + /// # Examples + /// + /// ``` + /// use std::task::{Context, Poll}; + /// use std::pin::Pin; + /// use tokio::sync::mpsc; + /// use futures::Future; + /// + /// struct MyReceiverFuture<'a> { + /// receiver: mpsc::UnboundedReceiver, + /// buffer: &'a mut Vec, + /// limit: usize, + /// } + /// + /// impl<'a> Future for MyReceiverFuture<'a> { + /// type Output = usize; // Number of messages received + /// + /// fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + /// let MyReceiverFuture { receiver, buffer, limit } = &mut *self; + /// + /// // Now `receiver` and `buffer` are mutable references, and `limit` is copied + /// match receiver.poll_recv_many(cx, *buffer, *limit) { + /// Poll::Pending => Poll::Pending, + /// Poll::Ready(count) => Poll::Ready(count), + /// } + /// } + /// } + /// + /// #[tokio::main] + /// async fn main() { + /// let (tx, rx) = mpsc::unbounded_channel::(); + /// let mut buffer = Vec::new(); + /// + /// let my_receiver_future = MyReceiverFuture { + /// receiver: rx, + /// buffer: &mut buffer, + /// limit: 3, + /// }; + /// + /// for i in 0..10 { + /// tx.send(i).expect("Unable to send integer"); + /// } + /// + /// let count = my_receiver_future.await; + /// assert_eq!(count, 3); + /// assert_eq!(buffer, vec![0,1,2]) + /// } + /// ``` + pub fn poll_recv_many( + &mut self, + cx: &mut Context<'_>, + buffer: &mut Vec, + limit: usize, + ) -> Poll { + self.chan.recv_many(cx, buffer, limit) + } } impl UnboundedSender { diff --git a/vendor/tokio/src/sync/mutex.rs b/vendor/tokio/src/sync/mutex.rs index d420431f8..30f0bdece 100644 --- a/vendor/tokio/src/sync/mutex.rs +++ b/vendor/tokio/src/sync/mutex.rs @@ -17,6 +17,10 @@ use std::{fmt, mem, ptr}; /// differences: [`lock`] is an async method so does not block, and the lock /// guard is designed to be held across `.await` points. /// +/// Tokio's Mutex operates on a guaranteed FIFO basis. +/// This means that the order in which tasks call the [`lock`] method is +/// the exact order in which they will acquire the lock. +/// /// # Which kind of mutex should you use? /// /// Contrary to popular belief, it is ok and often preferred to use the ordinary @@ -340,6 +344,7 @@ impl Mutex { let location = std::panic::Location::caller(); tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "Mutex", kind = "Sync", @@ -403,6 +408,10 @@ impl Mutex { /// been acquired. When the lock has been acquired, function returns a /// [`MutexGuard`]. /// + /// If the mutex is available to be acquired immediately, then this call + /// will typically not yield to the runtime. However, this is not guaranteed + /// under all circumstances. + /// /// # Cancel safety /// /// This method uses a queue to fairly distribute locks in the order they @@ -570,6 +579,10 @@ impl Mutex { /// been acquired. When the lock has been acquired, this returns an /// [`OwnedMutexGuard`]. /// + /// If the mutex is available to be acquired immediately, then this call + /// will typically not yield to the runtime. However, this is not guaranteed + /// under all circumstances. + /// /// This method is identical to [`Mutex::lock`], except that the returned /// guard references the `Mutex` with an [`Arc`] rather than by borrowing /// it. Therefore, the `Mutex` must be wrapped in an `Arc` to call this diff --git a/vendor/tokio/src/sync/oneshot.rs b/vendor/tokio/src/sync/oneshot.rs index 26bf9f39f..9e8c3fcb7 100644 --- a/vendor/tokio/src/sync/oneshot.rs +++ b/vendor/tokio/src/sync/oneshot.rs @@ -59,7 +59,7 @@ //! } //! ``` //! -//! To use a oneshot channel in a `tokio::select!` loop, add `&mut` in front of +//! To use a `oneshot` channel in a `tokio::select!` loop, add `&mut` in front of //! the channel. //! //! ``` @@ -330,7 +330,7 @@ pub struct Receiver { } pub mod error { - //! Oneshot error types. + //! `Oneshot` error types. use std::fmt; @@ -473,6 +473,7 @@ pub fn channel() -> (Sender, Receiver) { let location = std::panic::Location::caller(); let resource_span = tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "Sender|Receiver", kind = "Sync", @@ -554,8 +555,8 @@ impl Sender { /// Attempts to send a value on this channel, returning it back if it could /// not be sent. /// - /// This method consumes `self` as only one value may ever be sent on a oneshot - /// channel. It is not marked async because sending a message to an oneshot + /// This method consumes `self` as only one value may ever be sent on a `oneshot` + /// channel. It is not marked async because sending a message to an `oneshot` /// channel never requires any form of waiting. Because of this, the `send` /// method can be used in both synchronous and asynchronous code without /// problems. @@ -749,7 +750,7 @@ impl Sender { state.is_closed() } - /// Checks whether the oneshot channel has been closed, and if not, schedules the + /// Checks whether the `oneshot` channel has been closed, and if not, schedules the /// `Waker` in the provided `Context` to receive a notification when the channel is /// closed. /// diff --git a/vendor/tokio/src/sync/rwlock.rs b/vendor/tokio/src/sync/rwlock.rs index 37d7f65fe..37cf73c59 100644 --- a/vendor/tokio/src/sync/rwlock.rs +++ b/vendor/tokio/src/sync/rwlock.rs @@ -209,6 +209,7 @@ impl RwLock { let resource_span = { let location = std::panic::Location::caller(); let resource_span = tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "RwLock", kind = "Sync", @@ -282,6 +283,7 @@ impl RwLock { let location = std::panic::Location::caller(); let resource_span = tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "RwLock", kind = "Sync", @@ -770,7 +772,7 @@ impl RwLock { /// ``` pub async fn write(&self) -> RwLockWriteGuard<'_, T> { let acquire_fut = async { - self.s.acquire(self.mr).await.unwrap_or_else(|_| { + self.s.acquire(self.mr as usize).await.unwrap_or_else(|_| { // The semaphore was closed. but, we never explicitly close it, and we have a // handle to it through the Arc, which means that this can never happen. unreachable!() @@ -905,7 +907,7 @@ impl RwLock { let resource_span = self.resource_span.clone(); let acquire_fut = async { - self.s.acquire(self.mr).await.unwrap_or_else(|_| { + self.s.acquire(self.mr as usize).await.unwrap_or_else(|_| { // The semaphore was closed. but, we never explicitly close it, and we have a // handle to it through the Arc, which means that this can never happen. unreachable!() @@ -969,7 +971,7 @@ impl RwLock { /// } /// ``` pub fn try_write(&self) -> Result, TryLockError> { - match self.s.try_acquire(self.mr) { + match self.s.try_acquire(self.mr as usize) { Ok(permit) => permit, Err(TryAcquireError::NoPermits) => return Err(TryLockError(())), Err(TryAcquireError::Closed) => unreachable!(), @@ -1027,7 +1029,7 @@ impl RwLock { /// } /// ``` pub fn try_write_owned(self: Arc) -> Result, TryLockError> { - match self.s.try_acquire(self.mr) { + match self.s.try_acquire(self.mr as usize) { Ok(permit) => permit, Err(TryAcquireError::NoPermits) => return Err(TryLockError(())), Err(TryAcquireError::Closed) => unreachable!(), diff --git a/vendor/tokio/src/sync/semaphore.rs b/vendor/tokio/src/sync/semaphore.rs index 61896c9d5..25e413437 100644 --- a/vendor/tokio/src/sync/semaphore.rs +++ b/vendor/tokio/src/sync/semaphore.rs @@ -400,6 +400,7 @@ impl Semaphore { let location = std::panic::Location::caller(); tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "Semaphore", kind = "Sync", @@ -564,7 +565,7 @@ impl Semaphore { pub async fn acquire_many(&self, n: u32) -> Result, AcquireError> { #[cfg(all(tokio_unstable, feature = "tracing"))] trace::async_op( - || self.ll_sem.acquire(n), + || self.ll_sem.acquire(n as usize), self.resource_span.clone(), "Semaphore::acquire_many", "poll", @@ -573,7 +574,7 @@ impl Semaphore { .await?; #[cfg(not(all(tokio_unstable, feature = "tracing")))] - self.ll_sem.acquire(n).await?; + self.ll_sem.acquire(n as usize).await?; Ok(SemaphorePermit { sem: self, @@ -645,7 +646,7 @@ impl Semaphore { /// [`TryAcquireError::NoPermits`]: crate::sync::TryAcquireError::NoPermits /// [`SemaphorePermit`]: crate::sync::SemaphorePermit pub fn try_acquire_many(&self, n: u32) -> Result, TryAcquireError> { - match self.ll_sem.try_acquire(n) { + match self.ll_sem.try_acquire(n as usize) { Ok(()) => Ok(SemaphorePermit { sem: self, permits: n, @@ -763,14 +764,14 @@ impl Semaphore { ) -> Result { #[cfg(all(tokio_unstable, feature = "tracing"))] let inner = trace::async_op( - || self.ll_sem.acquire(n), + || self.ll_sem.acquire(n as usize), self.resource_span.clone(), "Semaphore::acquire_many_owned", "poll", true, ); #[cfg(not(all(tokio_unstable, feature = "tracing")))] - let inner = self.ll_sem.acquire(n); + let inner = self.ll_sem.acquire(n as usize); inner.await?; Ok(OwnedSemaphorePermit { @@ -854,7 +855,7 @@ impl Semaphore { self: Arc, n: u32, ) -> Result { - match self.ll_sem.try_acquire(n) { + match self.ll_sem.try_acquire(n as usize) { Ok(()) => Ok(OwnedSemaphorePermit { sem: self, permits: n, diff --git a/vendor/tokio/src/sync/watch.rs b/vendor/tokio/src/sync/watch.rs index 587aa795a..3979b0720 100644 --- a/vendor/tokio/src/sync/watch.rs +++ b/vendor/tokio/src/sync/watch.rs @@ -669,6 +669,17 @@ impl Receiver { self.version.decrement(); } + /// Marks the state as unchanged. + /// + /// The current value will be considered seen by the receiver. + /// + /// This is useful if you are not interested in the current value + /// visible in the receiver. + pub fn mark_unchanged(&mut self) { + let current_version = self.shared.state.load().version(); + self.version = current_version; + } + /// Waits for a change notification, then marks the newest value as seen. /// /// If the newest value in the channel has not yet been marked seen when diff --git a/vendor/tokio/src/task/join_set.rs b/vendor/tokio/src/task/join_set.rs index 4eb15a24d..7aace14d8 100644 --- a/vendor/tokio/src/task/join_set.rs +++ b/vendor/tokio/src/task/join_set.rs @@ -12,7 +12,7 @@ use std::task::{Context, Poll}; use crate::runtime::Handle; #[cfg(tokio_unstable)] use crate::task::Id; -use crate::task::{AbortHandle, JoinError, JoinHandle, LocalSet}; +use crate::task::{unconstrained, AbortHandle, JoinError, JoinHandle, LocalSet}; use crate::util::IdleNotifiedSet; /// A collection of tasks spawned on a Tokio runtime. @@ -306,6 +306,59 @@ impl JoinSet { crate::future::poll_fn(|cx| self.poll_join_next_with_id(cx)).await } + /// Tries to join one of the tasks in the set that has completed and return its output. + /// + /// Returns `None` if the set is empty. + pub fn try_join_next(&mut self) -> Option> { + // Loop over all notified `JoinHandle`s to find one that's ready, or until none are left. + loop { + let mut entry = self.inner.try_pop_notified()?; + + let res = entry.with_value_and_context(|jh, ctx| { + // Since this function is not async and cannot be forced to yield, we should + // disable budgeting when we want to check for the `JoinHandle` readiness. + Pin::new(&mut unconstrained(jh)).poll(ctx) + }); + + if let Poll::Ready(res) = res { + let _entry = entry.remove(); + + return Some(res); + } + } + } + + /// Tries to join one of the tasks in the set that has completed and return its output, + /// along with the [task ID] of the completed task. + /// + /// Returns `None` if the set is empty. + /// + /// When this method returns an error, then the id of the task that failed can be accessed + /// using the [`JoinError::id`] method. + /// + /// [task ID]: crate::task::Id + /// [`JoinError::id`]: fn@crate::task::JoinError::id + #[cfg(tokio_unstable)] + #[cfg_attr(docsrs, doc(cfg(tokio_unstable)))] + pub fn try_join_next_with_id(&mut self) -> Option> { + // Loop over all notified `JoinHandle`s to find one that's ready, or until none are left. + loop { + let mut entry = self.inner.try_pop_notified()?; + + let res = entry.with_value_and_context(|jh, ctx| { + // Since this function is not async and cannot be forced to yield, we should + // disable budgeting when we want to check for the `JoinHandle` readiness. + Pin::new(&mut unconstrained(jh)).poll(ctx) + }); + + if let Poll::Ready(res) = res { + let entry = entry.remove(); + + return Some(res.map(|output| (entry.id(), output))); + } + } + } + /// Aborts all tasks and waits for them to finish shutting down. /// /// Calling this method is equivalent to calling [`abort_all`] and then calling [`join_next`] in diff --git a/vendor/tokio/src/task/local.rs b/vendor/tokio/src/task/local.rs index 9caaca629..a40708d08 100644 --- a/vendor/tokio/src/task/local.rs +++ b/vendor/tokio/src/task/local.rs @@ -237,7 +237,7 @@ struct Context { unhandled_panic: Cell, } -/// LocalSet state shared between threads. +/// `LocalSet` state shared between threads. struct Shared { /// # Safety /// @@ -290,7 +290,7 @@ struct LocalData { impl LocalData { /// Should be called except when we call `LocalSet::enter`. - /// Especially when we poll a LocalSet. + /// Especially when we poll a `LocalSet`. #[must_use = "dropping this guard will reset the entered state"] fn enter(&self, ctx: Rc) -> LocalDataEnterGuard<'_> { let ctx = self.ctx.replace(Some(ctx)); @@ -392,7 +392,7 @@ const MAX_TASKS_PER_TICK: usize = 61; /// How often it check the remote queue first. const REMOTE_FIRST_INTERVAL: u8 = 31; -/// Context guard for LocalSet +/// Context guard for `LocalSet` pub struct LocalEnterGuard { ctx: Option>, @@ -526,7 +526,7 @@ impl LocalSet { /// This runs the given future on the runtime, blocking until it is /// complete, and yielding its resolved result. Any tasks or timers which /// the future spawns internally will be executed on the runtime. The future - /// may also call [`spawn_local`] to spawn_local additional local futures on the + /// may also call [`spawn_local`] to `spawn_local` additional local futures on the /// current thread. /// /// This method should not be called from an asynchronous context. @@ -602,6 +602,10 @@ impl LocalSet { /// will remain on the local set, and will be driven on subsequent calls to /// `run_until` or when [awaiting the local set] itself. /// + /// # Cancel safety + /// + /// This method is cancel safe when `future` is cancel safe. + /// /// # Examples /// /// ```rust @@ -1165,7 +1169,7 @@ mod tests { // Does a `LocalSet` running on a current-thread runtime...basically work? // // This duplicates a test in `tests/task_local_set.rs`, but because this is - // a lib test, it wil run under Miri, so this is necessary to catch stacked + // a lib test, it will run under Miri, so this is necessary to catch stacked // borrows violations in the `LocalSet` implementation. #[test] fn local_current_thread_scheduler() { diff --git a/vendor/tokio/src/task/mod.rs b/vendor/tokio/src/task/mod.rs index 9b7537018..806b9aebe 100644 --- a/vendor/tokio/src/task/mod.rs +++ b/vendor/tokio/src/task/mod.rs @@ -5,8 +5,8 @@ //! A _task_ is a light weight, non-blocking unit of execution. A task is similar //! to an OS thread, but rather than being managed by the OS scheduler, they are //! managed by the [Tokio runtime][rt]. Another name for this general pattern is -//! [green threads]. If you are familiar with [Go's goroutines], [Kotlin's -//! coroutines], or [Erlang's processes], you can think of Tokio's tasks as +//! [green threads]. If you are familiar with [`Go's goroutines`], [`Kotlin's +//! coroutines`], or [`Erlang's processes`], you can think of Tokio's tasks as //! something similar. //! //! Key points about tasks include: @@ -112,6 +112,46 @@ //! [thread_join]: std::thread::JoinHandle //! [`JoinError`]: crate::task::JoinError //! +//! #### Cancellation +//! +//! Spawned tasks may be cancelled using the [`JoinHandle::abort`] or +//! [`AbortHandle::abort`] methods. When one of these methods are called, the +//! task is signalled to shut down next time it yields at an `.await` point. If +//! the task is already idle, then it will be shut down as soon as possible +//! without running again before being shut down. Additionally, shutting down a +//! Tokio runtime (e.g. by returning from `#[tokio::main]`) immediately cancels +//! all tasks on it. +//! +//! When tasks are shut down, it will stop running at whichever `.await` it has +//! yielded at. All local variables are destroyed by running their destructor. +//! Once shutdown has completed, awaiting the [`JoinHandle`] will fail with a +//! [cancelled error](crate::task::JoinError::is_cancelled). +//! +//! Note that aborting a task does not guarantee that it fails with a cancelled +//! error, since it may complete normally first. For example, if the task does +//! not yield to the runtime at any point between the call to `abort` and the +//! end of the task, then the [`JoinHandle`] will instead report that the task +//! exited normally. +//! +//! Be aware that calls to [`JoinHandle::abort`] just schedule the task for +//! cancellation, and will return before the cancellation has completed. To wait +//! for cancellation to complete, wait for the task to finish by awaiting the +//! [`JoinHandle`]. Similarly, the [`JoinHandle::is_finished`] method does not +//! return `true` until the cancellation has finished. +//! +//! Calling [`JoinHandle::abort`] multiple times has the same effect as calling +//! it once. +//! +//! Tokio also provides an [`AbortHandle`], which is like the [`JoinHandle`], +//! except that it does not provide a mechanism to wait for the task to finish. +//! Each task can only have one [`JoinHandle`], but it can have more than one +//! [`AbortHandle`]. +//! +//! [`JoinHandle::abort`]: crate::task::JoinHandle::abort +//! [`AbortHandle::abort`]: crate::task::AbortHandle::abort +//! [`AbortHandle`]: crate::task::AbortHandle +//! [`JoinHandle::is_finished`]: crate::task::JoinHandle::is_finished +//! //! ### Blocking and Yielding //! //! As we discussed above, code running in asynchronous tasks should not perform @@ -127,7 +167,7 @@ //! blocking operations there. This includes destructors of objects destroyed in //! async code. //! -//! #### spawn_blocking +//! #### `spawn_blocking` //! //! The `task::spawn_blocking` function is similar to the `task::spawn` function //! discussed in the previous section, but rather than spawning an @@ -162,7 +202,7 @@ //! # } //! ``` //! -//! #### block_in_place +//! #### `block_in_place` //! //! When using the [multi-threaded runtime][rt-multi-thread], the [`task::block_in_place`] //! function is also available. Like `task::spawn_blocking`, this function @@ -187,7 +227,7 @@ //! # } //! ``` //! -//! #### yield_now +//! #### `yield_now` //! //! In addition, this module provides a [`task::yield_now`] async function //! that is analogous to the standard library's [`thread::yield_now`]. Calling @@ -243,7 +283,7 @@ //! //! #### unconstrained //! -//! If necessary, [`task::unconstrained`] lets you opt a future out of of Tokio's cooperative +//! If necessary, [`task::unconstrained`] lets you opt a future out of Tokio's cooperative //! scheduling. When a future is wrapped with `unconstrained`, it will never be forced to yield to //! Tokio. For example: //! diff --git a/vendor/tokio/src/time/interval.rs b/vendor/tokio/src/time/interval.rs index 768fa2fef..dee28793a 100644 --- a/vendor/tokio/src/time/interval.rs +++ b/vendor/tokio/src/time/interval.rs @@ -122,6 +122,7 @@ fn internal_interval_at( let location = location.expect("should have location if tracing"); tracing::trace_span!( + parent: None, "runtime.resource", concrete_type = "Interval", kind = "timer", diff --git a/vendor/tokio/src/util/idle_notified_set.rs b/vendor/tokio/src/util/idle_notified_set.rs index 430f2e756..8fe13095a 100644 --- a/vendor/tokio/src/util/idle_notified_set.rs +++ b/vendor/tokio/src/util/idle_notified_set.rs @@ -42,8 +42,8 @@ pub(crate) struct EntryInOneOfTheLists<'a, T> { type Lists = Mutex>; -/// The linked lists hold strong references to the ListEntry items, and the -/// ListEntry items also hold a strong reference back to the Lists object, but +/// The linked lists hold strong references to the `ListEntry` items, and the +/// `ListEntry` items also hold a strong reference back to the Lists object, but /// the destructor of the `IdleNotifiedSet` will clear the two lists, so once /// that object is destroyed, no ref-cycles will remain. struct ListsInner { @@ -203,6 +203,34 @@ impl IdleNotifiedSet { Some(EntryInOneOfTheLists { entry, set: self }) } + /// Tries to pop an entry from the notified list to poll it. The entry is moved to + /// the idle list atomically. + pub(crate) fn try_pop_notified(&mut self) -> Option> { + // We don't decrement the length because this call moves the entry to + // the idle list rather than removing it. + if self.length == 0 { + // Fast path. + return None; + } + + let mut lock = self.lists.lock(); + + // Pop the entry, returning None if empty. + let entry = lock.notified.pop_back()?; + + lock.idle.push_front(entry.clone()); + + // Safety: We are holding the lock. + entry.my_list.with_mut(|ptr| unsafe { + *ptr = List::Idle; + }); + + drop(lock); + + // Safety: We just put the entry in the idle list, so it is in one of the lists. + Some(EntryInOneOfTheLists { entry, set: self }) + } + /// Call a function on every element in this list. pub(crate) fn for_each(&mut self, mut func: F) { fn get_ptrs(list: &mut LinkedList, ptrs: &mut Vec<*mut T>) { diff --git a/vendor/tokio/src/util/linked_list.rs b/vendor/tokio/src/util/linked_list.rs index cda7e3398..0ed2b6164 100644 --- a/vendor/tokio/src/util/linked_list.rs +++ b/vendor/tokio/src/util/linked_list.rs @@ -228,53 +228,6 @@ impl fmt::Debug for LinkedList { } } -// ===== impl CountedLinkedList ==== - -// Delegates operations to the base LinkedList implementation, and adds a counter to the elements -// in the list. -pub(crate) struct CountedLinkedList { - list: LinkedList, - count: usize, -} - -impl CountedLinkedList { - pub(crate) fn new() -> CountedLinkedList { - CountedLinkedList { - list: LinkedList::new(), - count: 0, - } - } - - pub(crate) fn push_front(&mut self, val: L::Handle) { - self.list.push_front(val); - self.count += 1; - } - - pub(crate) fn pop_back(&mut self) -> Option { - let val = self.list.pop_back(); - if val.is_some() { - self.count -= 1; - } - val - } - - pub(crate) fn is_empty(&self) -> bool { - self.list.is_empty() - } - - pub(crate) unsafe fn remove(&mut self, node: NonNull) -> Option { - let val = self.list.remove(node); - if val.is_some() { - self.count -= 1; - } - val - } - - pub(crate) fn count(&self) -> usize { - self.count - } -} - #[cfg(any( feature = "fs", feature = "rt", @@ -342,22 +295,11 @@ cfg_io_driver_impl! { } cfg_taskdump! { - impl CountedLinkedList { - pub(crate) fn for_each(&mut self, f: F) - where - F: FnMut(&T::Handle), - { - self.list.for_each(f) - } - } - impl LinkedList { pub(crate) fn for_each(&mut self, mut f: F) where F: FnMut(&T::Handle), { - use std::mem::ManuallyDrop; - let mut next = self.head; while let Some(curr) = next { @@ -796,26 +738,6 @@ pub(crate) mod tests { } } - #[test] - fn count() { - let mut list = CountedLinkedList::<&Entry, <&Entry as Link>::Target>::new(); - assert_eq!(0, list.count()); - - let a = entry(5); - let b = entry(7); - list.push_front(a.as_ref()); - list.push_front(b.as_ref()); - assert_eq!(2, list.count()); - - list.pop_back(); - assert_eq!(1, list.count()); - - unsafe { - list.remove(ptr(&b)); - } - assert_eq!(0, list.count()); - } - /// This is a fuzz test. You run it by entering `cargo fuzz run fuzz_linked_list` in CLI in `/tokio/` module. #[cfg(fuzzing)] pub fn fuzz_linked_list(ops: &[u8]) { diff --git a/vendor/tokio/src/util/mod.rs b/vendor/tokio/src/util/mod.rs index 7d4cd5f9c..abdb70406 100644 --- a/vendor/tokio/src/util/mod.rs +++ b/vendor/tokio/src/util/mod.rs @@ -42,6 +42,10 @@ pub(crate) use wake_list::WakeList; ))] pub(crate) mod linked_list; +cfg_rt! { + pub(crate) mod sharded_list; +} + #[cfg(any(feature = "rt", feature = "macros"))] pub(crate) mod rand; diff --git a/vendor/tokio/src/util/rand.rs b/vendor/tokio/src/util/rand.rs index d96c8d37e..67c45693c 100644 --- a/vendor/tokio/src/util/rand.rs +++ b/vendor/tokio/src/util/rand.rs @@ -20,9 +20,9 @@ pub struct RngSeed { /// Fast random number generate. /// -/// Implement xorshift64+: 2 32-bit xorshift sequences added together. +/// Implement `xorshift64+`: 2 32-bit `xorshift` sequences added together. /// Shift triplet `[17,7,16]` was calculated as indicated in Marsaglia's -/// Xorshift paper: +/// `Xorshift` paper: /// This generator passes the SmallCrush suite, part of TestU01 framework: /// #[derive(Clone, Copy, Debug)] diff --git a/vendor/tokio/src/util/sharded_list.rs b/vendor/tokio/src/util/sharded_list.rs new file mode 100644 index 000000000..4da0bcdf7 --- /dev/null +++ b/vendor/tokio/src/util/sharded_list.rs @@ -0,0 +1,149 @@ +use std::ptr::NonNull; +use std::sync::atomic::Ordering; + +use crate::loom::sync::{Mutex, MutexGuard}; +use std::sync::atomic::AtomicUsize; + +use super::linked_list::{Link, LinkedList}; + +/// An intrusive linked list supporting highly concurrent updates. +/// +/// It currently relies on `LinkedList`, so it is the caller's +/// responsibility to ensure the list is empty before dropping it. +/// +/// Note: Due to its inner sharded design, the order of nodes cannot be guaranteed. +pub(crate) struct ShardedList { + lists: Box<[Mutex>]>, + count: AtomicUsize, + shard_mask: usize, +} + +/// Determines which linked list an item should be stored in. +/// +/// # Safety +/// +/// Implementations must guarantee that the id of an item does not change from +/// call to call. +pub(crate) unsafe trait ShardedListItem: Link { + /// # Safety + /// The provided pointer must point at a valid list item. + unsafe fn get_shard_id(target: NonNull) -> usize; +} + +impl ShardedList { + /// Creates a new and empty sharded linked list with the specified size. + pub(crate) fn new(sharded_size: usize) -> Self { + assert!(sharded_size.is_power_of_two()); + + let shard_mask = sharded_size - 1; + let mut lists = Vec::with_capacity(sharded_size); + for _ in 0..sharded_size { + lists.push(Mutex::new(LinkedList::::new())) + } + Self { + lists: lists.into_boxed_slice(), + count: AtomicUsize::new(0), + shard_mask, + } + } +} + +/// Used to get the lock of shard. +pub(crate) struct ShardGuard<'a, L, T> { + lock: MutexGuard<'a, LinkedList>, + count: &'a AtomicUsize, + id: usize, +} + +impl ShardedList { + /// Removes the last element from a list specified by `shard_id` and returns it, or None if it is + /// empty. + pub(crate) fn pop_back(&self, shard_id: usize) -> Option { + let mut lock = self.shard_inner(shard_id); + let node = lock.pop_back(); + if node.is_some() { + self.count.fetch_sub(1, Ordering::Relaxed); + } + node + } + + /// Removes the specified node from the list. + /// + /// # Safety + /// + /// The caller **must** ensure that exactly one of the following is true: + /// - `node` is currently contained by `self`, + /// - `node` is not contained by any list, + /// - `node` is currently contained by some other `GuardedLinkedList`. + pub(crate) unsafe fn remove(&self, node: NonNull) -> Option { + let id = L::get_shard_id(node); + let mut lock = self.shard_inner(id); + // SAFETY: Since the shard id cannot change, it's not possible for this node + // to be in any other list of the same sharded list. + let node = unsafe { lock.remove(node) }; + if node.is_some() { + self.count.fetch_sub(1, Ordering::Relaxed); + } + node + } + + /// Gets the lock of `ShardedList`, makes us have the write permission. + pub(crate) fn lock_shard(&self, val: &L::Handle) -> ShardGuard<'_, L, L::Target> { + let id = unsafe { L::get_shard_id(L::as_raw(val)) }; + ShardGuard { + lock: self.shard_inner(id), + count: &self.count, + id, + } + } + + /// Gets the count of elements in this list. + pub(crate) fn len(&self) -> usize { + self.count.load(Ordering::Relaxed) + } + + /// Returns whether the linked list does not contain any node. + pub(crate) fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Gets the shard size of this `SharedList`. + /// + /// Used to help us to decide the parameter `shard_id` of the `pop_back` method. + pub(crate) fn shard_size(&self) -> usize { + self.shard_mask + 1 + } + + #[inline] + fn shard_inner(&self, id: usize) -> MutexGuard<'_, LinkedList::Target>> { + // Safety: This modulo operation ensures that the index is not out of bounds. + unsafe { self.lists.get_unchecked(id & self.shard_mask).lock() } + } +} + +impl<'a, L: ShardedListItem> ShardGuard<'a, L, L::Target> { + /// Push a value to this shard. + pub(crate) fn push(mut self, val: L::Handle) { + let id = unsafe { L::get_shard_id(L::as_raw(&val)) }; + assert_eq!(id, self.id); + self.lock.push_front(val); + self.count.fetch_add(1, Ordering::Relaxed); + } +} + +cfg_taskdump! { + impl ShardedList { + pub(crate) fn for_each(&self, mut f: F) + where + F: FnMut(&L::Handle), + { + let mut guards = Vec::with_capacity(self.lists.len()); + for list in self.lists.iter() { + guards.push(list.lock()); + } + for g in &mut guards { + g.for_each(&mut f); + } + } + } +} diff --git a/vendor/tokio/src/util/trace.rs b/vendor/tokio/src/util/trace.rs index be5602dcb..e1827686c 100644 --- a/vendor/tokio/src/util/trace.rs +++ b/vendor/tokio/src/util/trace.rs @@ -16,6 +16,7 @@ cfg_trace! { let location = std::panic::Location::caller(); tracing::trace_span!( target: "tokio::task", + parent: None, "runtime.spawn", %kind, task.name = %name.unwrap_or_default(), diff --git a/vendor/tokio/src/util/wake_list.rs b/vendor/tokio/src/util/wake_list.rs index aa569dd17..c5f432b0b 100644 --- a/vendor/tokio/src/util/wake_list.rs +++ b/vendor/tokio/src/util/wake_list.rs @@ -4,6 +4,11 @@ use std::task::Waker; const NUM_WAKERS: usize = 32; +/// A list of wakers to be woken. +/// +/// # Invariants +/// +/// The first `curr` elements of `inner` are initialized. pub(crate) struct WakeList { inner: [MaybeUninit; NUM_WAKERS], curr: usize, @@ -11,14 +16,10 @@ pub(crate) struct WakeList { impl WakeList { pub(crate) fn new() -> Self { + const UNINIT_WAKER: MaybeUninit = MaybeUninit::uninit(); + Self { - inner: unsafe { - // safety: Create an uninitialized array of `MaybeUninit`. The - // `assume_init` is safe because the type we are claiming to - // have initialized here is a bunch of `MaybeUninit`s, which do - // not require initialization. - MaybeUninit::uninit().assume_init() - }, + inner: [UNINIT_WAKER; NUM_WAKERS], curr: 0, } } @@ -39,6 +40,8 @@ impl WakeList { assert!(self.curr <= NUM_WAKERS); while self.curr > 0 { self.curr -= 1; + // SAFETY: The first `curr` elements of `WakeList` are initialized, so by decrementing + // `curr`, we can take ownership of the last item. let waker = unsafe { ptr::read(self.inner[self.curr].as_mut_ptr()) }; waker.wake(); } @@ -47,7 +50,9 @@ impl WakeList { impl Drop for WakeList { fn drop(&mut self) { - let slice = ptr::slice_from_raw_parts_mut(self.inner.as_mut_ptr() as *mut Waker, self.curr); + let slice = + ptr::slice_from_raw_parts_mut(self.inner.as_mut_ptr().cast::(), self.curr); + // SAFETY: The first `curr` elements are initialized, so we can drop them. unsafe { ptr::drop_in_place(slice) }; } } diff --git a/vendor/tokio/tests/coop_budget.rs b/vendor/tokio/tests/coop_budget.rs new file mode 100644 index 000000000..0c4cc7e64 --- /dev/null +++ b/vendor/tokio/tests/coop_budget.rs @@ -0,0 +1,77 @@ +#![warn(rust_2018_idioms)] +#![cfg(all(feature = "full", target_os = "linux"))] + +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; +use tokio::net::UdpSocket; + +/// Ensure that UDP sockets have functional budgeting +/// +/// # Design +/// Two sockets communicate by spamming packets from one to the other. +/// +/// In Linux, this packet will be slammed through the entire network stack and into the receiver's buffer during the +/// send system call because we are using the loopback interface. +/// This happens because the softirq chain invoked on send when using the loopback interface covers virtually the +/// entirety of the lifecycle of a packet within the kernel network stack. +/// +/// As a result, neither socket will ever encounter an EWOULDBLOCK, and the only way for these to yield during the loop +/// is through budgeting. +/// +/// A second task runs in the background and increments a counter before yielding, allowing us to know how many times sockets yielded. +/// Since we are both sending and receiving, that should happen once per 64 packets, because budgets are of size 128 +/// and there are two budget events per packet, a send and a recv. +#[tokio::test] +async fn coop_budget_udp_send_recv() { + const BUDGET: usize = 128; + const N_ITERATIONS: usize = 1024; + + const PACKET: &[u8] = b"Hello, world"; + const PACKET_LEN: usize = 12; + + assert_eq!( + PACKET_LEN, + PACKET.len(), + "Defect in test, programmer can't do math" + ); + + // bind each socket to a dynamic port, forcing IPv4 addressing on the localhost interface + let tx = UdpSocket::bind("127.0.0.1:0").await.unwrap(); + let rx = UdpSocket::bind("127.0.0.1:0").await.unwrap(); + + tx.connect(rx.local_addr().unwrap()).await.unwrap(); + rx.connect(tx.local_addr().unwrap()).await.unwrap(); + + let tracker = Arc::new(AtomicUsize::default()); + + let tracker_clone = Arc::clone(&tracker); + + tokio::task::yield_now().await; + + tokio::spawn(async move { + loop { + tracker_clone.fetch_add(1, Ordering::SeqCst); + + tokio::task::yield_now().await; + } + }); + + for _ in 0..N_ITERATIONS { + tx.send(PACKET).await.unwrap(); + + let mut tmp = [0; PACKET_LEN]; + + // ensure that we aren't somehow accumulating other + assert_eq!( + PACKET_LEN, + rx.recv(&mut tmp).await.unwrap(), + "Defect in test case, received unexpected result from socket" + ); + assert_eq!( + PACKET, &tmp, + "Defect in test case, received unexpected result from socket" + ); + } + + assert_eq!(N_ITERATIONS / (BUDGET / 2), tracker.load(Ordering::SeqCst)); +} diff --git a/vendor/tokio/tests/dump.rs b/vendor/tokio/tests/dump.rs index 4da0c9e8e..ecb4495b3 100644 --- a/vendor/tokio/tests/dump.rs +++ b/vendor/tokio/tests/dump.rs @@ -147,6 +147,7 @@ mod future_completes_during_trace { async fn dump() { let handle = Handle::current(); let _dump = handle.dump().await; + tokio::task::yield_now().await; } rt.block_on(async { @@ -154,3 +155,43 @@ mod future_completes_during_trace { }); } } + +/// Regression test for #6051. +/// +/// This test ensures that tasks notified outside of a worker will not be +/// traced, since doing so will un-set their notified bit prior to them being +/// run and panic. +#[test] +fn notified_during_tracing() { + let rt = runtime::Builder::new_multi_thread() + .enable_all() + .worker_threads(3) + .build() + .unwrap(); + + let timeout = async { + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + }; + + let timer = rt.spawn(async { + loop { + tokio::time::sleep(tokio::time::Duration::from_nanos(1)).await; + } + }); + + let dump = async { + loop { + let handle = Handle::current(); + let _dump = handle.dump().await; + } + }; + + rt.block_on(async { + tokio::select!( + biased; + _ = timeout => {}, + _ = timer => {}, + _ = dump => {}, + ); + }); +} diff --git a/vendor/tokio/tests/io_async_fd.rs b/vendor/tokio/tests/io_async_fd.rs index 943b023ec..1fb203a65 100644 --- a/vendor/tokio/tests/io_async_fd.rs +++ b/vendor/tokio/tests/io_async_fd.rs @@ -1,7 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(all(unix, feature = "full"))] -use std::os::unix::io::{AsRawFd, RawFd}; +use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, @@ -132,7 +132,14 @@ fn socketpair() -> (FileDescriptor, FileDescriptor) { SockFlag::empty(), ) .expect("socketpair"); - let fds = (FileDescriptor { fd: fd_a }, FileDescriptor { fd: fd_b }); + let fds = ( + FileDescriptor { + fd: fd_a.into_raw_fd(), + }, + FileDescriptor { + fd: fd_b.into_raw_fd(), + }, + ); set_nonblocking(fds.0.fd); set_nonblocking(fds.1.fd); @@ -818,7 +825,7 @@ async fn await_error_readiness_invalid_address() { msg.msg_iovlen = 1; if unsafe { libc::sendmsg(socket_fd, &msg, 0) } == -1 { - Err(std::io::Error::last_os_error()).unwrap() + panic!("{:?}", std::io::Error::last_os_error()) } }); diff --git a/vendor/tokio/tests/io_copy.rs b/vendor/tokio/tests/io_copy.rs index 005e17011..82d92a968 100644 --- a/vendor/tokio/tests/io_copy.rs +++ b/vendor/tokio/tests/io_copy.rs @@ -85,3 +85,18 @@ async fn proxy() { assert_eq!(n, 1024); } + +#[tokio::test] +async fn copy_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + let mut reader: &[u8] = b"hello"; + let mut writer: Vec = vec![]; + let _ = io::copy(&mut reader, &mut writer).await; + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} diff --git a/vendor/tokio/tests/io_copy_bidirectional.rs b/vendor/tokio/tests/io_copy_bidirectional.rs index 10eba3166..3cdce32d0 100644 --- a/vendor/tokio/tests/io_copy_bidirectional.rs +++ b/vendor/tokio/tests/io_copy_bidirectional.rs @@ -138,3 +138,28 @@ async fn immediate_exit_on_read_error() { assert!(copy_bidirectional(&mut a, &mut b).await.is_err()); } + +#[tokio::test] +async fn copy_bidirectional_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + let payload = b"here, take this"; + + let mut a = tokio_test::io::Builder::new() + .read(payload) + .write(payload) + .build(); + + let mut b = tokio_test::io::Builder::new() + .read(payload) + .write(payload) + .build(); + + let _ = copy_bidirectional(&mut a, &mut b).await; + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} diff --git a/vendor/tokio/tests/io_join.rs b/vendor/tokio/tests/io_join.rs new file mode 100644 index 000000000..69b093933 --- /dev/null +++ b/vendor/tokio/tests/io_join.rs @@ -0,0 +1,83 @@ +#![warn(rust_2018_idioms)] +#![cfg(feature = "full")] + +use tokio::io::{join, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, Join, ReadBuf}; + +use std::io; +use std::pin::Pin; +use std::task::{Context, Poll}; + +struct R; + +impl AsyncRead for R { + fn poll_read( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &mut ReadBuf<'_>, + ) -> Poll> { + buf.put_slice(&[b'z']); + Poll::Ready(Ok(())) + } +} + +struct W; + +impl AsyncWrite for W { + fn poll_write( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _buf: &[u8], + ) -> Poll> { + Poll::Ready(Ok(1)) + } + + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _bufs: &[io::IoSlice<'_>], + ) -> Poll> { + Poll::Ready(Ok(2)) + } + + fn is_write_vectored(&self) -> bool { + true + } +} + +#[test] +fn is_send_and_sync() { + fn assert_bound() {} + + assert_bound::>(); +} + +#[test] +fn method_delegation() { + let mut rw = join(R, W); + let mut buf = [0; 1]; + + tokio_test::block_on(async move { + assert_eq!(1, rw.read(&mut buf).await.unwrap()); + assert_eq!(b'z', buf[0]); + + assert_eq!(1, rw.write(&[b'x']).await.unwrap()); + assert_eq!( + 2, + rw.write_vectored(&[io::IoSlice::new(&[b'x'])]) + .await + .unwrap() + ); + assert!(rw.is_write_vectored()); + + assert!(rw.flush().await.is_ok()); + assert!(rw.shutdown().await.is_ok()); + }); +} diff --git a/vendor/tokio/tests/io_panic.rs b/vendor/tokio/tests/io_panic.rs index 89e504f46..b2cbad275 100644 --- a/vendor/tokio/tests/io_panic.rs +++ b/vendor/tokio/tests/io_panic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support panic recovery +#![cfg(panic = "unwind")] use std::task::{Context, Poll}; use std::{error::Error, pin::Pin}; @@ -54,7 +55,6 @@ mod unix { } } -#[cfg(panic = "unwind")] #[test] fn read_buf_initialize_unfilled_to_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -70,7 +70,6 @@ fn read_buf_initialize_unfilled_to_panic_caller() -> Result<(), Box> Ok(()) } -#[cfg(panic = "unwind")] #[test] fn read_buf_advance_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -86,7 +85,6 @@ fn read_buf_advance_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn read_buf_set_filled_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -102,7 +100,6 @@ fn read_buf_set_filled_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn read_buf_put_slice_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -120,7 +117,6 @@ fn read_buf_put_slice_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn unsplit_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { diff --git a/vendor/tokio/tests/io_poll_aio.rs b/vendor/tokio/tests/io_poll_aio.rs index f044af5cc..e83859f5c 100644 --- a/vendor/tokio/tests/io_poll_aio.rs +++ b/vendor/tokio/tests/io_poll_aio.rs @@ -1,12 +1,12 @@ #![warn(rust_2018_idioms)] #![cfg(all(target_os = "freebsd", feature = "net"))] -use mio_aio::{AioCb, AioFsyncMode, LioCb}; +use mio_aio::{AioFsyncMode, SourceApi}; use std::{ future::Future, - mem, + io, mem, os::unix::io::{AsRawFd, RawFd}, - pin::Pin, + pin::{pin, Pin}, task::{Context, Poll}, }; use tempfile::tempfile; @@ -16,9 +16,10 @@ use tokio_test::assert_pending; mod aio { use super::*; - /// Adapts mio_aio::AioCb (which implements mio::event::Source) to AioSource - struct WrappedAioCb<'a>(AioCb<'a>); - impl<'a> AioSource for WrappedAioCb<'a> { + #[derive(Debug)] + struct TokioSource(mio_aio::Source); + + impl AioSource for TokioSource { fn register(&mut self, kq: RawFd, token: usize) { self.0.register_raw(kq, token) } @@ -28,12 +29,22 @@ mod aio { } /// A very crude implementation of an AIO-based future - struct FsyncFut(Aio>); + struct FsyncFut(Aio); + + impl FsyncFut { + pub fn submit(self: Pin<&mut Self>) -> io::Result<()> { + let p = unsafe { self.map_unchecked_mut(|s| &mut s.0 .0) }; + match p.submit() { + Ok(()) => Ok(()), + Err(e) => Err(io::Error::from_raw_os_error(e as i32)), + } + } + } impl Future for FsyncFut { - type Output = std::io::Result<()>; + type Output = io::Result<()>; - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let poll_result = self.0.poll_ready(cx); match poll_result { Poll::Pending => Poll::Pending, @@ -41,10 +52,11 @@ mod aio { Poll::Ready(Ok(_ev)) => { // At this point, we could clear readiness. But there's no // point, since we're about to drop the Aio. - let result = (*self.0).0.aio_return(); + let p = unsafe { self.map_unchecked_mut(|s| &mut s.0 .0) }; + let result = p.aio_return(); match result { - Ok(_) => Poll::Ready(Ok(())), - Err(e) => Poll::Ready(Err(e.into())), + Ok(r) => Poll::Ready(Ok(r)), + Err(e) => Poll::Ready(Err(io::Error::from_raw_os_error(e as i32))), } } } @@ -57,6 +69,16 @@ mod aio { /// registration actually works, under the hood. struct LlSource(Pin>); + impl LlSource { + fn fsync(mut self: Pin<&mut Self>) { + let r = unsafe { + let p = self.0.as_mut().get_unchecked_mut(); + libc::aio_fsync(libc::O_SYNC, p) + }; + assert_eq!(0, r); + } + } + impl AioSource for LlSource { fn register(&mut self, kq: RawFd, token: usize) { let mut sev: libc::sigevent = unsafe { mem::MaybeUninit::zeroed().assume_init() }; @@ -77,62 +99,15 @@ mod aio { struct LlFut(Aio); + impl LlFut { + pub fn fsync(self: Pin<&mut Self>) { + let p = unsafe { self.map_unchecked_mut(|s| &mut *(s.0)) }; + p.fsync(); + } + } + impl Future for LlFut { - type Output = std::io::Result<()>; - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let poll_result = self.0.poll_ready(cx); - match poll_result { - Poll::Pending => Poll::Pending, - Poll::Ready(Err(e)) => Poll::Ready(Err(e)), - Poll::Ready(Ok(_ev)) => { - let r = unsafe { libc::aio_return(self.0 .0.as_mut().get_unchecked_mut()) }; - assert_eq!(0, r); - Poll::Ready(Ok(())) - } - } - } - } - - /// A very simple object that can implement AioSource and can be reused. - /// - /// mio_aio normally assumes that each AioCb will be consumed on completion. - /// This somewhat contrived example shows how an Aio object can be reused - /// anyway. - struct ReusableFsyncSource { - aiocb: Pin>>, - fd: RawFd, - token: usize, - } - impl ReusableFsyncSource { - fn fsync(&mut self) { - self.aiocb.register_raw(self.fd, self.token); - self.aiocb.fsync(AioFsyncMode::O_SYNC).unwrap(); - } - fn new(aiocb: AioCb<'static>) -> Self { - ReusableFsyncSource { - aiocb: Box::pin(aiocb), - fd: 0, - token: 0, - } - } - fn reset(&mut self, aiocb: AioCb<'static>) { - self.aiocb = Box::pin(aiocb); - } - } - impl AioSource for ReusableFsyncSource { - fn register(&mut self, kq: RawFd, token: usize) { - self.fd = kq; - self.token = token; - } - fn deregister(&mut self) { - self.fd = 0; - } - } - - struct ReusableFsyncFut<'a>(&'a mut Aio); - impl<'a> Future for ReusableFsyncFut<'a> { - type Output = std::io::Result<()>; + type Output = std::io::Result; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let poll_result = self.0.poll_ready(cx); @@ -140,16 +115,16 @@ mod aio { Poll::Pending => Poll::Pending, Poll::Ready(Err(e)) => Poll::Ready(Err(e)), Poll::Ready(Ok(ev)) => { - // Since this future uses a reusable Aio, we must clear - // its readiness here. That makes the future - // non-idempotent; the caller can't poll it repeatedly after - // it has already returned Ready. But that's ok; most - // futures behave this way. + // Clearing readiness makes the future non-idempotent; the + // caller can't poll it repeatedly after it has already + // returned Ready. But that's ok; most futures behave this + // way. self.0.clear_ready(ev); - let result = (*self.0).aiocb.aio_return(); - match result { - Ok(_) => Poll::Ready(Ok(())), - Err(e) => Poll::Ready(Err(e.into())), + let r = unsafe { libc::aio_return(self.0 .0.as_mut().get_unchecked_mut()) }; + if r >= 0 { + Poll::Ready(Ok(r as usize)) + } else { + Poll::Ready(Err(io::Error::last_os_error())) } } } @@ -160,11 +135,11 @@ mod aio { async fn fsync() { let f = tempfile().unwrap(); let fd = f.as_raw_fd(); - let aiocb = AioCb::from_fd(fd, 0); - let source = WrappedAioCb(aiocb); - let mut poll_aio = Aio::new_for_aio(source).unwrap(); - (*poll_aio).0.fsync(AioFsyncMode::O_SYNC).unwrap(); - let fut = FsyncFut(poll_aio); + let mode = AioFsyncMode::O_SYNC; + let source = TokioSource(mio_aio::Fsync::fsync(fd, mode, 0)); + let poll_aio = Aio::new_for_aio(source).unwrap(); + let mut fut = pin!(FsyncFut(poll_aio)); + fut.as_mut().submit().unwrap(); fut.await.unwrap(); } @@ -177,7 +152,7 @@ mod aio { let source = LlSource(Box::pin(aiocb)); let mut poll_aio = Aio::new_for_aio(source).unwrap(); let r = unsafe { - let p = (*poll_aio).0.as_mut().get_unchecked_mut(); + let p = poll_aio.0.as_mut().get_unchecked_mut(); libc::aio_fsync(libc::O_SYNC, p) }; assert_eq!(0, r); @@ -190,144 +165,140 @@ mod aio { async fn reuse() { let f = tempfile().unwrap(); let fd = f.as_raw_fd(); - let aiocb0 = AioCb::from_fd(fd, 0); - let source = ReusableFsyncSource::new(aiocb0); - let mut poll_aio = Aio::new_for_aio(source).unwrap(); - poll_aio.fsync(); - let fut0 = ReusableFsyncFut(&mut poll_aio); - fut0.await.unwrap(); + let mut aiocb: libc::aiocb = unsafe { mem::MaybeUninit::zeroed().assume_init() }; + aiocb.aio_fildes = fd; + let source = LlSource(Box::pin(aiocb)); + let poll_aio = Aio::new_for_aio(source).unwrap(); - let aiocb1 = AioCb::from_fd(fd, 0); - poll_aio.reset(aiocb1); + // Send the operation to the kernel the first time + let mut fut = LlFut(poll_aio); + { + let mut pfut = Pin::new(&mut fut); + pfut.as_mut().fsync(); + pfut.as_mut().await.unwrap(); + } + + // Check that readiness was cleared let mut ctx = Context::from_waker(futures::task::noop_waker_ref()); - assert_pending!(poll_aio.poll_ready(&mut ctx)); - poll_aio.fsync(); - let fut1 = ReusableFsyncFut(&mut poll_aio); - fut1.await.unwrap(); + assert_pending!(fut.0.poll_ready(&mut ctx)); + + // and reuse the future and its Aio object + { + let mut pfut = Pin::new(&mut fut); + pfut.as_mut().fsync(); + pfut.as_mut().await.unwrap(); + } } } mod lio { use super::*; - struct WrappedLioCb<'a>(LioCb<'a>); - impl<'a> AioSource for WrappedLioCb<'a> { - fn register(&mut self, kq: RawFd, token: usize) { - self.0.register_raw(kq, token) + /// Low-level source based on lio_listio + /// + /// An example demonstrating using AIO with `Interest::Lio`. mio_aio 0.8 + /// doesn't include any bindings for lio_listio, so we've got to go + /// low-level. + struct LioSource<'a> { + aiocb: Pin<&'a mut [&'a mut libc::aiocb; 1]>, + sev: libc::sigevent, + } + + impl<'a> LioSource<'a> { + fn new(aiocb: Pin<&'a mut [&'a mut libc::aiocb; 1]>) -> Self { + LioSource { + aiocb, + sev: unsafe { mem::zeroed() }, + } } - fn deregister(&mut self) { - self.0.deregister_raw() + + fn submit(mut self: Pin<&mut Self>) { + let p: *const *mut libc::aiocb = + unsafe { self.aiocb.as_mut().get_unchecked_mut() } as *const _ as *const *mut _; + let r = unsafe { libc::lio_listio(libc::LIO_NOWAIT, p, 1, &mut self.sev) }; + assert_eq!(r, 0); } } - /// A very crude lio_listio-based Future - struct LioFut(Option>>); + impl<'a> AioSource for LioSource<'a> { + fn register(&mut self, kq: RawFd, token: usize) { + let mut sev: libc::sigevent = unsafe { mem::MaybeUninit::zeroed().assume_init() }; + sev.sigev_notify = libc::SIGEV_KEVENT; + sev.sigev_signo = kq; + sev.sigev_value = libc::sigval { + sival_ptr: token as *mut libc::c_void, + }; + self.sev = sev; + } - impl Future for LioFut { - type Output = std::io::Result>; - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let poll_result = self.0.as_mut().unwrap().poll_ready(cx); - match poll_result { - Poll::Pending => Poll::Pending, - Poll::Ready(Err(e)) => Poll::Ready(Err(e)), - Poll::Ready(Ok(_ev)) => { - // At this point, we could clear readiness. But there's no - // point, since we're about to drop the Aio. - let r = self.0.take().unwrap().into_inner().0.into_results(|iter| { - iter.map(|lr| lr.result.unwrap()).collect::>() - }); - Poll::Ready(Ok(r)) - } + fn deregister(&mut self) { + unsafe { + self.sev = mem::zeroed(); } } } - /// Minimal example demonstrating reuse of an Aio object with lio - /// readiness. mio_aio::LioCb actually does something similar under the - /// hood. - struct ReusableLioSource { - liocb: Option>, - fd: RawFd, - token: usize, - } - impl ReusableLioSource { - fn new(liocb: LioCb<'static>) -> Self { - ReusableLioSource { - liocb: Some(liocb), - fd: 0, - token: 0, - } - } - fn reset(&mut self, liocb: LioCb<'static>) { - self.liocb = Some(liocb); - } - fn submit(&mut self) { - self.liocb - .as_mut() - .unwrap() - .register_raw(self.fd, self.token); - self.liocb.as_mut().unwrap().submit().unwrap(); - } - } - impl AioSource for ReusableLioSource { - fn register(&mut self, kq: RawFd, token: usize) { - self.fd = kq; - self.token = token; - } - fn deregister(&mut self) { - self.fd = 0; - } - } - struct ReusableLioFut<'a>(&'a mut Aio); - impl<'a> Future for ReusableLioFut<'a> { - type Output = std::io::Result>; + struct LioFut<'a>(Aio>); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + impl<'a> LioFut<'a> { + pub fn submit(self: Pin<&mut Self>) { + let p = unsafe { self.map_unchecked_mut(|s| &mut *(s.0)) }; + p.submit(); + } + } + + impl<'a> Future for LioFut<'a> { + type Output = std::io::Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let poll_result = self.0.poll_ready(cx); match poll_result { Poll::Pending => Poll::Pending, Poll::Ready(Err(e)) => Poll::Ready(Err(e)), Poll::Ready(Ok(ev)) => { - // Since this future uses a reusable Aio, we must clear - // its readiness here. That makes the future - // non-idempotent; the caller can't poll it repeatedly after - // it has already returned Ready. But that's ok; most - // futures behave this way. + // Clearing readiness makes the future non-idempotent; the + // caller can't poll it repeatedly after it has already + // returned Ready. But that's ok; most futures behave this + // way. Clearing readiness is especially useful for + // lio_listio, because sometimes some operations will be + // ready but not all. self.0.clear_ready(ev); - let r = (*self.0).liocb.take().unwrap().into_results(|iter| { - iter.map(|lr| lr.result.unwrap()).collect::>() - }); - Poll::Ready(Ok(r)) + let r = unsafe { + let p1 = self.get_unchecked_mut(); + let p2: &mut [&mut libc::aiocb; 1] = + p1.0.aiocb.as_mut().get_unchecked_mut(); + let p3: &mut libc::aiocb = p2[0]; + libc::aio_return(p3) + }; + if r >= 0 { + Poll::Ready(Ok(r as usize)) + } else { + Poll::Ready(Err(io::Error::last_os_error())) + } } } } } - /// An lio_listio operation with one write element + /// An lio_listio operation with one fsync element #[tokio::test] async fn onewrite() { const WBUF: &[u8] = b"abcdef"; let f = tempfile().unwrap(); - let mut builder = mio_aio::LioCbBuilder::with_capacity(1); - builder = builder.emplace_slice( - f.as_raw_fd(), - 0, - &WBUF[..], - 0, - mio_aio::LioOpcode::LIO_WRITE, - ); - let liocb = builder.finish(); - let source = WrappedLioCb(liocb); - let mut poll_aio = Aio::new_for_lio(source).unwrap(); + let mut aiocb: libc::aiocb = unsafe { mem::zeroed() }; + aiocb.aio_fildes = f.as_raw_fd(); + aiocb.aio_lio_opcode = libc::LIO_WRITE; + aiocb.aio_nbytes = WBUF.len(); + aiocb.aio_buf = WBUF.as_ptr() as *mut _; + let aiocb = pin!([&mut aiocb]); + let source = LioSource::new(aiocb); + let poll_aio = Aio::new_for_lio(source).unwrap(); // Send the operation to the kernel - (*poll_aio).0.submit().unwrap(); - let fut = LioFut(Some(poll_aio)); - let v = fut.await.unwrap(); - assert_eq!(v.len(), 1); - assert_eq!(v[0] as usize, WBUF.len()); + let mut fut = pin!(LioFut(poll_aio)); + fut.as_mut().submit(); + fut.await.unwrap(); } /// A suitably crafted future type can reuse an Aio object @@ -336,40 +307,32 @@ mod lio { const WBUF: &[u8] = b"abcdef"; let f = tempfile().unwrap(); - let mut builder0 = mio_aio::LioCbBuilder::with_capacity(1); - builder0 = builder0.emplace_slice( - f.as_raw_fd(), - 0, - &WBUF[..], - 0, - mio_aio::LioOpcode::LIO_WRITE, - ); - let liocb0 = builder0.finish(); - let source = ReusableLioSource::new(liocb0); - let mut poll_aio = Aio::new_for_aio(source).unwrap(); - poll_aio.submit(); - let fut0 = ReusableLioFut(&mut poll_aio); - let v = fut0.await.unwrap(); - assert_eq!(v.len(), 1); - assert_eq!(v[0] as usize, WBUF.len()); + let mut aiocb: libc::aiocb = unsafe { mem::zeroed() }; + aiocb.aio_fildes = f.as_raw_fd(); + aiocb.aio_lio_opcode = libc::LIO_WRITE; + aiocb.aio_nbytes = WBUF.len(); + aiocb.aio_buf = WBUF.as_ptr() as *mut _; + let aiocb = pin!([&mut aiocb]); + let source = LioSource::new(aiocb); + let poll_aio = Aio::new_for_lio(source).unwrap(); - // Now reuse the same Aio - let mut builder1 = mio_aio::LioCbBuilder::with_capacity(1); - builder1 = builder1.emplace_slice( - f.as_raw_fd(), - 0, - &WBUF[..], - 0, - mio_aio::LioOpcode::LIO_WRITE, - ); - let liocb1 = builder1.finish(); - poll_aio.reset(liocb1); + // Send the operation to the kernel the first time + let mut fut = LioFut(poll_aio); + { + let mut pfut = Pin::new(&mut fut); + pfut.as_mut().submit(); + pfut.as_mut().await.unwrap(); + } + + // Check that readiness was cleared let mut ctx = Context::from_waker(futures::task::noop_waker_ref()); - assert_pending!(poll_aio.poll_ready(&mut ctx)); - poll_aio.submit(); - let fut1 = ReusableLioFut(&mut poll_aio); - let v = fut1.await.unwrap(); - assert_eq!(v.len(), 1); - assert_eq!(v[0] as usize, WBUF.len()); + assert_pending!(fut.0.poll_ready(&mut ctx)); + + // and reuse the future and its Aio object + { + let mut pfut = Pin::new(&mut fut); + pfut.as_mut().submit(); + pfut.as_mut().await.unwrap(); + } } } diff --git a/vendor/tokio/tests/io_repeat.rs b/vendor/tokio/tests/io_repeat.rs new file mode 100644 index 000000000..b3745877c --- /dev/null +++ b/vendor/tokio/tests/io_repeat.rs @@ -0,0 +1,18 @@ +#![warn(rust_2018_idioms)] +#![cfg(feature = "full")] + +use tokio::io::AsyncReadExt; + +#[tokio::test] +async fn repeat_poll_read_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + let mut buf = [0u8; 4096]; + tokio::io::repeat(0b101).read_exact(&mut buf).await.unwrap(); + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} diff --git a/vendor/tokio/tests/io_sink.rs b/vendor/tokio/tests/io_sink.rs new file mode 100644 index 000000000..fb085c515 --- /dev/null +++ b/vendor/tokio/tests/io_sink.rs @@ -0,0 +1,44 @@ +#![warn(rust_2018_idioms)] +#![cfg(feature = "full")] + +use tokio::io::AsyncWriteExt; + +#[tokio::test] +async fn sink_poll_write_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + let buf = vec![1, 2, 3]; + tokio::io::sink().write_all(&buf).await.unwrap(); + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} + +#[tokio::test] +async fn sink_poll_flush_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + tokio::io::sink().flush().await.unwrap(); + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} + +#[tokio::test] +async fn sink_poll_shutdown_is_cooperative() { + tokio::select! { + biased; + _ = async { + loop { + tokio::io::sink().shutdown().await.unwrap(); + } + } => {}, + _ = tokio::task::yield_now() => {} + } +} diff --git a/vendor/tokio/tests/join_handle_panic.rs b/vendor/tokio/tests/join_handle_panic.rs index 94a1b6112..248d5702f 100644 --- a/vendor/tokio/tests/join_handle_panic.rs +++ b/vendor/tokio/tests/join_handle_panic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support panic recovery +#![cfg(panic = "unwind")] struct PanicsOnDrop; @@ -9,7 +10,6 @@ impl Drop for PanicsOnDrop { } } -#[cfg(panic = "unwind")] #[tokio::test] async fn test_panics_do_not_propagate_when_dropping_join_handle() { let join_handle = tokio::spawn(async move { PanicsOnDrop }); diff --git a/vendor/tokio/tests/macros_test.rs b/vendor/tokio/tests/macros_test.rs index b5095e36e..69ee30b36 100644 --- a/vendor/tokio/tests/macros_test.rs +++ b/vendor/tokio/tests/macros_test.rs @@ -25,10 +25,16 @@ async fn unused_braces_test() { assert_eq!(1 + 1, 2) } fn trait_method() { trait A { fn f(self); + + fn g(self); } impl A for () { #[tokio::main] - async fn f(self) {} + async fn f(self) { + self.g() + } + + fn g(self) {} } ().f() } diff --git a/vendor/tokio/tests/macros_try_join.rs b/vendor/tokio/tests/macros_try_join.rs index c8ed00bcd..76958f167 100644 --- a/vendor/tokio/tests/macros_try_join.rs +++ b/vendor/tokio/tests/macros_try_join.rs @@ -45,8 +45,7 @@ async fn two_await() { let (tx1, rx1) = oneshot::channel::<&str>(); let (tx2, rx2) = oneshot::channel::(); - let mut join = - task::spawn(async { tokio::try_join!(async { rx1.await }, async { rx2.await }) }); + let mut join = task::spawn(async { tokio::try_join!(rx1, rx2) }); assert_pending!(join.poll()); @@ -67,11 +66,7 @@ async fn err_abort_early() { let (tx2, rx2) = oneshot::channel::(); let (_tx3, rx3) = oneshot::channel::(); - let mut join = task::spawn(async { - tokio::try_join!(async { rx1.await }, async { rx2.await }, async { - rx3.await - }) - }); + let mut join = task::spawn(async { tokio::try_join!(rx1, rx2, rx3) }); assert_pending!(join.poll()); diff --git a/vendor/tokio/tests/net_named_pipe.rs b/vendor/tokio/tests/net_named_pipe.rs index 02eda48e5..48b9da829 100644 --- a/vendor/tokio/tests/net_named_pipe.rs +++ b/vendor/tokio/tests/net_named_pipe.rs @@ -1,5 +1,5 @@ #![cfg(feature = "full")] -#![cfg(all(windows))] +#![cfg(windows)] use std::io; use std::time::Duration; @@ -92,7 +92,7 @@ async fn test_named_pipe_multi_client() -> io::Result<()> { // `io::ErrorKind::NotFound`. server = ServerOptions::new().create(PIPE_NAME)?; - let _ = tokio::spawn(async move { + tokio::spawn(async move { let mut buf = String::new(); inner.read_line(&mut buf).await?; inner.write_all(b"pong\n").await?; @@ -170,7 +170,7 @@ async fn test_named_pipe_multi_client_ready() -> io::Result<()> { // `io::ErrorKind::NotFound`. server = ServerOptions::new().create(PIPE_NAME)?; - let _ = tokio::spawn(async move { + tokio::spawn(async move { let server = inner_server; { diff --git a/vendor/tokio/tests/net_panic.rs b/vendor/tokio/tests/net_panic.rs index a7ce0afc0..9d6e87d9a 100644 --- a/vendor/tokio/tests/net_panic.rs +++ b/vendor/tokio/tests/net_panic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] +#![cfg(panic = "unwind")] use std::error::Error; use tokio::net::{TcpListener, TcpStream}; @@ -10,7 +11,6 @@ mod support { } use support::panic::test_panic; -#[cfg(panic = "unwind")] #[test] fn udp_socket_from_std_panic_caller() -> Result<(), Box> { use std::net::SocketAddr; @@ -33,7 +33,6 @@ fn udp_socket_from_std_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn tcp_listener_from_std_panic_caller() -> Result<(), Box> { let std_listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); @@ -52,7 +51,6 @@ fn tcp_listener_from_std_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn tcp_stream_from_std_panic_caller() -> Result<(), Box> { let std_listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); @@ -101,7 +99,7 @@ fn unix_listener_from_std_panic_caller() -> Result<(), Box> { let dir = tempfile::tempdir().unwrap(); let sock_path = dir.path().join("socket"); - let std_listener = std::os::unix::net::UnixListener::bind(&sock_path).unwrap(); + let std_listener = std::os::unix::net::UnixListener::bind(sock_path).unwrap(); let panic_location_file = test_panic(|| { let rt = runtime_without_io(); @@ -150,7 +148,7 @@ fn unix_datagram_from_std_panic_caller() -> Result<(), Box> { // Bind the socket to a filesystem path // /let socket_path = tmp.path().join("socket"); - let std_socket = StdUDS::bind(&sock_path).unwrap(); + let std_socket = StdUDS::bind(sock_path).unwrap(); std_socket.set_nonblocking(true).unwrap(); let panic_location_file = test_panic(move || { @@ -166,7 +164,6 @@ fn unix_datagram_from_std_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] #[cfg(windows)] fn server_options_max_instances_panic_caller() -> Result<(), Box> { diff --git a/vendor/tokio/tests/net_unix_pipe.rs b/vendor/tokio/tests/net_unix_pipe.rs index c96d6e70f..6706880ed 100644 --- a/vendor/tokio/tests/net_unix_pipe.rs +++ b/vendor/tokio/tests/net_unix_pipe.rs @@ -427,3 +427,108 @@ async fn try_read_buf() -> std::io::Result<()> { Ok(()) } + +#[tokio::test] +async fn anon_pipe_simple_send() -> io::Result<()> { + const DATA: &[u8] = b"this is some data to write to the pipe"; + + let (mut writer, mut reader) = pipe::pipe()?; + + // Create a reading task which should wait for data from the pipe. + let mut read_fut = task::spawn(async move { + let mut buf = vec![0; DATA.len()]; + reader.read_exact(&mut buf).await?; + Ok::<_, io::Error>(buf) + }); + assert_pending!(read_fut.poll()); + + writer.write_all(DATA).await?; + + // Let the IO driver poll events for the reader. + while !read_fut.is_woken() { + tokio::task::yield_now().await; + } + + // Reading task should be ready now. + let read_data = assert_ready_ok!(read_fut.poll()); + assert_eq!(&read_data, DATA); + + Ok(()) +} + +#[tokio::test] +async fn anon_pipe_spawn_echo() -> std::io::Result<()> { + use tokio::process::Command; + + const DATA: &str = "this is some data to write to the pipe"; + + let (tx, mut rx) = pipe::pipe()?; + + let status = Command::new("echo") + .arg("-n") + .arg(DATA) + .stdout(tx.into_blocking_fd()?) + .status(); + + let mut buf = vec![0; DATA.len()]; + rx.read_exact(&mut buf).await?; + assert_eq!(String::from_utf8(buf).unwrap(), DATA); + + let exit_code = status.await?; + assert!(exit_code.success()); + + // Check if the pipe is closed. + buf = Vec::new(); + let total = assert_ok!(rx.try_read(&mut buf)); + assert_eq!(total, 0); + + Ok(()) +} + +#[tokio::test] +#[cfg(target_os = "linux")] +async fn anon_pipe_from_owned_fd() -> std::io::Result<()> { + use nix::fcntl::OFlag; + use std::os::unix::io::{FromRawFd, OwnedFd}; + + const DATA: &[u8] = b"this is some data to write to the pipe"; + + let fds = nix::unistd::pipe2(OFlag::O_CLOEXEC | OFlag::O_NONBLOCK)?; + let (rx_fd, tx_fd) = unsafe { (OwnedFd::from_raw_fd(fds.0), OwnedFd::from_raw_fd(fds.1)) }; + + let mut rx = pipe::Receiver::from_owned_fd(rx_fd)?; + let mut tx = pipe::Sender::from_owned_fd(tx_fd)?; + + let mut buf = vec![0; DATA.len()]; + tx.write_all(DATA).await?; + rx.read_exact(&mut buf).await?; + assert_eq!(buf, DATA); + + Ok(()) +} + +#[tokio::test] +async fn anon_pipe_into_nonblocking_fd() -> std::io::Result<()> { + let (tx, rx) = pipe::pipe()?; + + let tx_fd = tx.into_nonblocking_fd()?; + let rx_fd = rx.into_nonblocking_fd()?; + + assert!(is_nonblocking(&tx_fd)?); + assert!(is_nonblocking(&rx_fd)?); + + Ok(()) +} + +#[tokio::test] +async fn anon_pipe_into_blocking_fd() -> std::io::Result<()> { + let (tx, rx) = pipe::pipe()?; + + let tx_fd = tx.into_blocking_fd()?; + let rx_fd = rx.into_blocking_fd()?; + + assert!(!is_nonblocking(&tx_fd)?); + assert!(!is_nonblocking(&rx_fd)?); + + Ok(()) +} diff --git a/vendor/tokio/tests/process_change_of_runtime.rs b/vendor/tokio/tests/process_change_of_runtime.rs new file mode 100644 index 000000000..94efe35b1 --- /dev/null +++ b/vendor/tokio/tests/process_change_of_runtime.rs @@ -0,0 +1,34 @@ +#![cfg(feature = "process")] +#![warn(rust_2018_idioms)] +// This tests test the behavior of `process::Command::spawn` when it is used +// outside runtime, and when `process::Child::wait ` is used in a different +// runtime from which `process::Command::spawn` is used. +#![cfg(all(unix, not(target_os = "freebsd")))] + +use std::process::Stdio; +use tokio::{process::Command, runtime::Runtime}; + +#[test] +fn process_spawned_and_wait_in_different_runtime() { + let mut child = Runtime::new().unwrap().block_on(async { + Command::new("true") + .stdin(Stdio::piped()) + .stdout(Stdio::null()) + .spawn() + .unwrap() + }); + Runtime::new().unwrap().block_on(async { + let _ = child.wait().await.unwrap(); + }); +} + +#[test] +#[should_panic( + expected = "there is no reactor running, must be called from the context of a Tokio 1.x runtime" +)] +fn process_spawned_outside_runtime() { + let _ = Command::new("true") + .stdin(Stdio::piped()) + .stdout(Stdio::null()) + .spawn(); +} diff --git a/vendor/tokio/tests/process_issue_2174.rs b/vendor/tokio/tests/process_issue_2174.rs index 5ee9dc0a4..2f8c73a58 100644 --- a/vendor/tokio/tests/process_issue_2174.rs +++ b/vendor/tokio/tests/process_issue_2174.rs @@ -17,6 +17,7 @@ use tokio::time; use tokio_test::assert_err; #[tokio::test] +#[cfg_attr(panic = "abort", ignore)] async fn issue_2174() { let mut child = Command::new("sleep") .arg("2") diff --git a/vendor/tokio/tests/rt_basic.rs b/vendor/tokio/tests/rt_basic.rs index 789c0475d..47bf2dfdc 100644 --- a/vendor/tokio/tests/rt_basic.rs +++ b/vendor/tokio/tests/rt_basic.rs @@ -181,25 +181,35 @@ fn drop_tasks_in_context() { #[cfg_attr(target_os = "wasi", ignore = "Wasi does not support panic recovery")] #[should_panic(expected = "boom")] fn wake_in_drop_after_panic() { - let (tx, rx) = oneshot::channel::<()>(); - struct WakeOnDrop(Option>); impl Drop for WakeOnDrop { fn drop(&mut self) { - self.0.take().unwrap().send(()).unwrap(); + let _ = self.0.take().unwrap().send(()); } } let rt = rt(); + let (tx1, rx1) = oneshot::channel::<()>(); + let (tx2, rx2) = oneshot::channel::<()>(); + + // Spawn two tasks. We don't know the order in which they are dropped, so we + // make both tasks identical. When the first task is dropped, we wake up the + // second task. This ensures that we trigger a wakeup on a live task while + // handling the "boom" panic, no matter the order in which the tasks are + // dropped. rt.spawn(async move { - let _wake_on_drop = WakeOnDrop(Some(tx)); - // wait forever - futures::future::pending::<()>().await; + let _wake_on_drop = WakeOnDrop(Some(tx2)); + let _ = rx1.await; + unreachable!() }); - let _join = rt.spawn(async move { rx.await }); + rt.spawn(async move { + let _wake_on_drop = WakeOnDrop(Some(tx1)); + let _ = rx2.await; + unreachable!() + }); rt.block_on(async { tokio::task::yield_now().await; diff --git a/vendor/tokio/tests/rt_common.rs b/vendor/tokio/tests/rt_common.rs index abca8dd66..11c44a8d1 100644 --- a/vendor/tokio/tests/rt_common.rs +++ b/vendor/tokio/tests/rt_common.rs @@ -1366,4 +1366,66 @@ rt_test! { th.join().unwrap(); } } + + #[test] + #[cfg_attr(target_family = "wasm", ignore)] + fn wake_by_ref_from_thread_local() { + wake_from_thread_local(true); + } + + #[test] + #[cfg_attr(target_family = "wasm", ignore)] + fn wake_by_val_from_thread_local() { + wake_from_thread_local(false); + } + + fn wake_from_thread_local(by_ref: bool) { + use std::cell::RefCell; + use std::sync::mpsc::{channel, Sender}; + use std::task::Waker; + + struct TLData { + by_ref: bool, + waker: Option, + done: Sender, + } + + impl Drop for TLData { + fn drop(&mut self) { + if self.by_ref { + self.waker.take().unwrap().wake_by_ref(); + } else { + self.waker.take().unwrap().wake(); + } + let _ = self.done.send(true); + } + } + + std::thread_local! { + static TL_DATA: RefCell> = RefCell::new(None); + }; + + let (send, recv) = channel(); + + std::thread::spawn(move || { + let rt = rt(); + rt.block_on(rt.spawn(poll_fn(move |cx| { + let waker = cx.waker().clone(); + let send = send.clone(); + TL_DATA.with(|tl| { + tl.replace(Some(TLData { + by_ref, + waker: Some(waker), + done: send, + })); + }); + Poll::Ready(()) + }))) + .unwrap(); + }) + .join() + .unwrap(); + + assert!(recv.recv().unwrap()); + } } diff --git a/vendor/tokio/tests/rt_handle.rs b/vendor/tokio/tests/rt_handle.rs index a571b98ea..92fa777e3 100644 --- a/vendor/tokio/tests/rt_handle.rs +++ b/vendor/tokio/tests/rt_handle.rs @@ -3,8 +3,8 @@ use tokio::runtime::Runtime; -#[cfg(panic = "unwind")] #[test] +#[cfg_attr(panic = "abort", ignore)] fn basic_enter() { let rt1 = rt(); let rt2 = rt(); @@ -16,9 +16,9 @@ fn basic_enter() { drop(enter1); } -#[cfg(panic = "unwind")] #[test] #[should_panic] +#[cfg_attr(panic = "abort", ignore)] fn interleave_enter_different_rt() { let rt1 = rt(); let rt2 = rt(); @@ -30,9 +30,9 @@ fn interleave_enter_different_rt() { drop(enter2); } -#[cfg(panic = "unwind")] #[test] #[should_panic] +#[cfg_attr(panic = "abort", ignore)] fn interleave_enter_same_rt() { let rt1 = rt(); @@ -44,9 +44,9 @@ fn interleave_enter_same_rt() { drop(enter3); } -#[cfg(panic = "unwind")] #[test] #[cfg(not(target_os = "wasi"))] +#[cfg_attr(panic = "abort", ignore)] fn interleave_then_enter() { let _ = std::panic::catch_unwind(|| { let rt1 = rt(); diff --git a/vendor/tokio/tests/rt_handle_block_on.rs b/vendor/tokio/tests/rt_handle_block_on.rs index 54b9002c0..95365ec52 100644 --- a/vendor/tokio/tests/rt_handle_block_on.rs +++ b/vendor/tokio/tests/rt_handle_block_on.rs @@ -3,7 +3,7 @@ // All io tests that deal with shutdown is currently ignored because there are known bugs in with // shutting down the io driver while concurrently registering new resources. See -// https://github.com/tokio-rs/tokio/pull/3569#pullrequestreview-612703467 fo more details. +// https://github.com/tokio-rs/tokio/pull/3569#pullrequestreview-612703467 for more details. // // When this has been fixed we want to re-enable these tests. diff --git a/vendor/tokio/tests/rt_metrics.rs b/vendor/tokio/tests/rt_metrics.rs index 42faab37f..38bc18f7b 100644 --- a/vendor/tokio/tests/rt_metrics.rs +++ b/vendor/tokio/tests/rt_metrics.rs @@ -471,14 +471,17 @@ fn worker_overflow_count() { // First, we need to block the other worker until all tasks have // been spawned. - tokio::spawn(async move { - tx1.send(()).unwrap(); - rx2.recv().unwrap(); + // + // We spawn from outside the runtime to ensure that the other worker + // will pick it up: + // + tokio::task::spawn_blocking(|| { + tokio::spawn(async move { + tx1.send(()).unwrap(); + rx2.recv().unwrap(); + }); }); - // Bump the next-run spawn - tokio::spawn(async {}); - rx1.recv().unwrap(); // Spawn many tasks diff --git a/vendor/tokio/tests/rt_panic.rs b/vendor/tokio/tests/rt_panic.rs index 5b5ee48a9..ecaf977c8 100644 --- a/vendor/tokio/tests/rt_panic.rs +++ b/vendor/tokio/tests/rt_panic.rs @@ -1,6 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] #![cfg(not(target_os = "wasi"))] // Wasi doesn't support panic recovery +#![cfg(panic = "unwind")] use futures::future; use std::error::Error; @@ -11,7 +12,6 @@ mod support { } use support::panic::test_panic; -#[cfg(panic = "unwind")] #[test] fn current_handle_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -24,7 +24,6 @@ fn current_handle_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn into_panic_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(move || { @@ -47,7 +46,6 @@ fn into_panic_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn builder_worker_threads_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -60,7 +58,6 @@ fn builder_worker_threads_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn builder_max_blocking_threads_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { diff --git a/vendor/tokio/tests/rt_time_start_paused.rs b/vendor/tokio/tests/rt_time_start_paused.rs index 283f4748a..1765d625e 100644 --- a/vendor/tokio/tests/rt_time_start_paused.rs +++ b/vendor/tokio/tests/rt_time_start_paused.rs @@ -1,4 +1,4 @@ -#![cfg(all(feature = "full"))] +#![cfg(feature = "full")] use tokio::time::{Duration, Instant}; diff --git a/vendor/tokio/tests/signal_panic.rs b/vendor/tokio/tests/signal_panic.rs index ce1ec3e4a..6b662e54b 100644 --- a/vendor/tokio/tests/signal_panic.rs +++ b/vendor/tokio/tests/signal_panic.rs @@ -1,6 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] #![cfg(unix)] +#![cfg(panic = "unwind")] use std::error::Error; use tokio::runtime::Builder; diff --git a/vendor/tokio/tests/sync_mpsc.rs b/vendor/tokio/tests/sync_mpsc.rs index a5c15a4cf..1b581ce98 100644 --- a/vendor/tokio/tests/sync_mpsc.rs +++ b/vendor/tokio/tests/sync_mpsc.rs @@ -522,6 +522,79 @@ async fn try_send_fail_with_try_recv() { assert_eq!(rx.try_recv(), Err(TryRecvError::Disconnected)); } +#[maybe_tokio_test] +async fn reserve_many_above_cap() { + const MAX_PERMITS: usize = tokio::sync::Semaphore::MAX_PERMITS; + let (tx, _rx) = mpsc::channel::<()>(1); + + assert_err!(tx.reserve_many(2).await); + assert_err!(tx.reserve_many(MAX_PERMITS + 1).await); + assert_err!(tx.reserve_many(usize::MAX).await); +} + +#[test] +fn try_reserve_many_zero() { + let (tx, rx) = mpsc::channel::<()>(1); + + // Succeeds when not closed. + assert!(assert_ok!(tx.try_reserve_many(0)).next().is_none()); + + // Even when channel is full. + tx.try_send(()).unwrap(); + assert!(assert_ok!(tx.try_reserve_many(0)).next().is_none()); + + drop(rx); + + // Closed error when closed. + assert_eq!( + assert_err!(tx.try_reserve_many(0)), + TrySendError::Closed(()) + ); +} + +#[maybe_tokio_test] +async fn reserve_many_zero() { + let (tx, rx) = mpsc::channel::<()>(1); + + // Succeeds when not closed. + assert!(assert_ok!(tx.reserve_many(0).await).next().is_none()); + + // Even when channel is full. + tx.send(()).await.unwrap(); + assert!(assert_ok!(tx.reserve_many(0).await).next().is_none()); + + drop(rx); + + // Closed error when closed. + assert_err!(tx.reserve_many(0).await); +} + +#[maybe_tokio_test] +async fn try_reserve_many_edge_cases() { + const MAX_PERMITS: usize = tokio::sync::Semaphore::MAX_PERMITS; + + let (tx, rx) = mpsc::channel::<()>(1); + + let mut permit = assert_ok!(tx.try_reserve_many(0)); + assert!(permit.next().is_none()); + + let permit = tx.try_reserve_many(MAX_PERMITS + 1); + match assert_err!(permit) { + TrySendError::Full(..) => {} + _ => panic!(), + } + + let permit = tx.try_reserve_many(usize::MAX); + match assert_err!(permit) { + TrySendError::Full(..) => {} + _ => panic!(), + } + + // Dropping the receiver should close the channel + drop(rx); + assert_err!(tx.reserve_many(0).await); +} + #[maybe_tokio_test] async fn try_reserve_fails() { let (tx, mut rx) = mpsc::channel(1); @@ -545,6 +618,87 @@ async fn try_reserve_fails() { let _permit = tx.try_reserve().unwrap(); } +#[maybe_tokio_test] +async fn reserve_many_and_send() { + let (tx, mut rx) = mpsc::channel(100); + for i in 0..100 { + for permit in assert_ok!(tx.reserve_many(i).await) { + permit.send("foo"); + assert_eq!(rx.recv().await, Some("foo")); + } + assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); + } +} +#[maybe_tokio_test] +async fn try_reserve_many_and_send() { + let (tx, mut rx) = mpsc::channel(100); + for i in 0..100 { + for permit in assert_ok!(tx.try_reserve_many(i)) { + permit.send("foo"); + assert_eq!(rx.recv().await, Some("foo")); + } + assert_eq!(rx.try_recv(), Err(TryRecvError::Empty)); + } +} + +#[maybe_tokio_test] +async fn reserve_many_on_closed_channel() { + let (tx, rx) = mpsc::channel::<()>(100); + drop(rx); + assert_err!(tx.reserve_many(10).await); +} + +#[maybe_tokio_test] +async fn try_reserve_many_on_closed_channel() { + let (tx, rx) = mpsc::channel::(100); + drop(rx); + match assert_err!(tx.try_reserve_many(10)) { + TrySendError::Closed(()) => {} + _ => panic!(), + }; +} + +#[maybe_tokio_test] +async fn try_reserve_many_full() { + // Reserve n capacity and send k messages + for n in 1..100 { + for k in 0..n { + let (tx, mut rx) = mpsc::channel::(n); + let permits = assert_ok!(tx.try_reserve_many(n)); + + assert_eq!(permits.len(), n); + assert_eq!(tx.capacity(), 0); + + match assert_err!(tx.try_reserve_many(1)) { + TrySendError::Full(..) => {} + _ => panic!(), + }; + + for permit in permits.take(k) { + permit.send(0); + } + // We only used k permits on the n reserved + assert_eq!(tx.capacity(), n - k); + + // We can reserve more permits + assert_ok!(tx.try_reserve_many(1)); + + // But not more than the current capacity + match assert_err!(tx.try_reserve_many(n - k + 1)) { + TrySendError::Full(..) => {} + _ => panic!(), + }; + + for _i in 0..k { + assert_eq!(rx.recv().await, Some(0)); + } + + // Now that we've received everything, capacity should be back to n + assert_eq!(tx.capacity(), n); + } + } +} + #[tokio::test] #[cfg(feature = "full")] async fn drop_permit_releases_permit() { @@ -564,6 +718,30 @@ async fn drop_permit_releases_permit() { assert_ready_ok!(reserve2.poll()); } +#[maybe_tokio_test] +async fn drop_permit_iterator_releases_permits() { + // poll_ready reserves capacity, ensure that the capacity is released if tx + // is dropped w/o sending a value. + for n in 1..100 { + let (tx1, _rx) = mpsc::channel::(n); + let tx2 = tx1.clone(); + + let permits = assert_ok!(tx1.reserve_many(n).await); + + let mut reserve2 = tokio_test::task::spawn(tx2.reserve_many(n)); + assert_pending!(reserve2.poll()); + + drop(permits); + + assert!(reserve2.is_woken()); + + let permits = assert_ready_ok!(reserve2.poll()); + drop(permits); + + assert_eq!(tx1.capacity(), n); + } +} + #[maybe_tokio_test] async fn dropping_rx_closes_channel() { let (tx, rx) = mpsc::channel(100); @@ -573,6 +751,7 @@ async fn dropping_rx_closes_channel() { drop(rx); assert_err!(tx.reserve().await); + assert_err!(tx.reserve_many(10).await); assert_eq!(1, Arc::strong_count(&msg)); } diff --git a/vendor/tokio/tests/sync_panic.rs b/vendor/tokio/tests/sync_panic.rs index ae261f993..41bf08500 100644 --- a/vendor/tokio/tests/sync_panic.rs +++ b/vendor/tokio/tests/sync_panic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] +#![cfg(panic = "unwind")] use std::{error::Error, sync::Arc}; use tokio::{ @@ -12,7 +13,6 @@ mod support { } use support::panic::test_panic; -#[cfg(panic = "unwind")] #[test] fn broadcast_channel_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -25,7 +25,6 @@ fn broadcast_channel_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn mutex_blocking_lock_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -42,7 +41,6 @@ fn mutex_blocking_lock_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn oneshot_blocking_recv_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -59,7 +57,6 @@ fn oneshot_blocking_recv_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn rwlock_with_max_readers_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -72,7 +69,6 @@ fn rwlock_with_max_readers_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn rwlock_blocking_read_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -89,7 +85,6 @@ fn rwlock_blocking_read_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn rwlock_blocking_write_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -106,7 +101,6 @@ fn rwlock_blocking_write_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn mpsc_bounded_channel_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -119,7 +113,6 @@ fn mpsc_bounded_channel_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn mpsc_bounded_receiver_blocking_recv_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -136,7 +129,6 @@ fn mpsc_bounded_receiver_blocking_recv_panic_caller() -> Result<(), Box Result<(), Box> { let panic_location_file = test_panic(|| { @@ -153,7 +145,6 @@ fn mpsc_bounded_sender_blocking_send_panic_caller() -> Result<(), Box Ok(()) } -#[cfg(panic = "unwind")] #[test] fn mpsc_unbounded_receiver_blocking_recv_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -170,7 +161,6 @@ fn mpsc_unbounded_receiver_blocking_recv_panic_caller() -> Result<(), Box Result<(), Box> { let panic_location_file = test_panic(|| { @@ -187,7 +177,6 @@ fn semaphore_merge_unrelated_owned_permits() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn semaphore_merge_unrelated_permits() -> Result<(), Box> { let panic_location_file = test_panic(|| { diff --git a/vendor/tokio/tests/sync_watch.rs b/vendor/tokio/tests/sync_watch.rs index 70cc110b9..a5b229f7d 100644 --- a/vendor/tokio/tests/sync_watch.rs +++ b/vendor/tokio/tests/sync_watch.rs @@ -102,6 +102,39 @@ fn rx_mark_changed() { assert_eq!(*rx.borrow(), "two"); } +#[test] +fn rx_mark_unchanged() { + let (tx, mut rx) = watch::channel("one"); + + let mut rx2 = rx.clone(); + + { + assert!(!rx.has_changed().unwrap()); + + rx.mark_changed(); + assert!(rx.has_changed().unwrap()); + + rx.mark_unchanged(); + assert!(!rx.has_changed().unwrap()); + + let mut t = spawn(rx.changed()); + assert_pending!(t.poll()); + } + + { + assert!(!rx2.has_changed().unwrap()); + + tx.send("two").unwrap(); + assert!(rx2.has_changed().unwrap()); + + rx2.mark_unchanged(); + assert!(!rx2.has_changed().unwrap()); + assert_eq!(*rx2.borrow_and_update(), "two"); + } + + assert_eq!(*rx.borrow(), "two"); +} + #[test] fn multi_rx() { let (tx, mut rx1) = watch::channel("one"); diff --git a/vendor/tokio/tests/task_id.rs b/vendor/tokio/tests/task_id.rs index e10f24be9..95e48f490 100644 --- a/vendor/tokio/tests/task_id.rs +++ b/vendor/tokio/tests/task_id.rs @@ -1,5 +1,4 @@ #![warn(rust_2018_idioms)] -#![allow(clippy::declare_interior_mutable_const)] #![cfg(all(feature = "full", tokio_unstable))] #[cfg(not(target_os = "wasi"))] diff --git a/vendor/tokio/tests/task_join_set.rs b/vendor/tokio/tests/task_join_set.rs index d236aa1fc..8a42be17b 100644 --- a/vendor/tokio/tests/task_join_set.rs +++ b/vendor/tokio/tests/task_join_set.rs @@ -23,7 +23,7 @@ async fn test_with_sleep() { set.detach_all(); assert_eq!(set.len(), 0); - assert!(matches!(set.join_next().await, None)); + assert!(set.join_next().await.is_none()); for i in 0..10 { set.spawn(async move { @@ -41,7 +41,7 @@ async fn test_with_sleep() { for was_seen in &seen { assert!(was_seen); } - assert!(matches!(set.join_next().await, None)); + assert!(set.join_next().await.is_none()); // Do it again. for i in 0..10 { @@ -59,7 +59,7 @@ async fn test_with_sleep() { for was_seen in &seen { assert!(was_seen); } - assert!(matches!(set.join_next().await, None)); + assert!(set.join_next().await.is_none()); } #[tokio::test] @@ -227,3 +227,80 @@ async fn join_set_coop() { assert!(coop_count >= 1); assert_eq!(count, TASK_NUM); } + +#[tokio::test(flavor = "current_thread")] +async fn try_join_next() { + const TASK_NUM: u32 = 1000; + + let (send, recv) = tokio::sync::watch::channel(()); + + let mut set = JoinSet::new(); + + for _ in 0..TASK_NUM { + let mut recv = recv.clone(); + set.spawn(async move { recv.changed().await.unwrap() }); + } + drop(recv); + + assert!(set.try_join_next().is_none()); + + send.send_replace(()); + send.closed().await; + + let mut count = 0; + loop { + match set.try_join_next() { + Some(Ok(())) => { + count += 1; + } + Some(Err(err)) => panic!("failed: {}", err), + None => { + break; + } + } + } + + assert_eq!(count, TASK_NUM); +} + +#[cfg(tokio_unstable)] +#[tokio::test(flavor = "current_thread")] +async fn try_join_next_with_id() { + const TASK_NUM: u32 = 1000; + + let (send, recv) = tokio::sync::watch::channel(()); + + let mut set = JoinSet::new(); + let mut spawned = std::collections::HashSet::with_capacity(TASK_NUM as usize); + + for _ in 0..TASK_NUM { + let mut recv = recv.clone(); + let handle = set.spawn(async move { recv.changed().await.unwrap() }); + + spawned.insert(handle.id()); + } + drop(recv); + + assert!(set.try_join_next_with_id().is_none()); + + send.send_replace(()); + send.closed().await; + + let mut count = 0; + let mut joined = std::collections::HashSet::with_capacity(TASK_NUM as usize); + loop { + match set.try_join_next_with_id() { + Some(Ok((id, ()))) => { + count += 1; + joined.insert(id); + } + Some(Err(err)) => panic!("failed: {}", err), + None => { + break; + } + } + } + + assert_eq!(count, TASK_NUM); + assert_eq!(joined, spawned); +} diff --git a/vendor/tokio/tests/task_local.rs b/vendor/tokio/tests/task_local.rs index a9ffaa15a..fbc885c35 100644 --- a/vendor/tokio/tests/task_local.rs +++ b/vendor/tokio/tests/task_local.rs @@ -1,5 +1,5 @@ #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads -#![allow(clippy::declare_interior_mutable_const)] + use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; diff --git a/vendor/tokio/tests/task_panic.rs b/vendor/tokio/tests/task_panic.rs index 47f3d6f0f..8b4de2ada 100644 --- a/vendor/tokio/tests/task_panic.rs +++ b/vendor/tokio/tests/task_panic.rs @@ -1,6 +1,6 @@ #![warn(rust_2018_idioms)] -#![allow(clippy::declare_interior_mutable_const)] #![cfg(all(feature = "full", not(target_os = "wasi")))] +#![cfg(panic = "unwind")] use futures::future; use std::error::Error; @@ -12,7 +12,6 @@ mod support { } use support::panic::test_panic; -#[cfg(panic = "unwind")] #[test] fn block_in_place_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -28,13 +27,12 @@ fn block_in_place_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn local_set_spawn_local_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { let _local = task::LocalSet::new(); - let _ = task::spawn_local(async {}); + task::spawn_local(async {}); }); // The panic location should be in this file @@ -43,7 +41,6 @@ fn local_set_spawn_local_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn local_set_block_on_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -61,7 +58,6 @@ fn local_set_block_on_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn spawn_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -74,7 +70,6 @@ fn spawn_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn local_key_sync_scope_panic_caller() -> Result<(), Box> { tokio::task_local! { @@ -95,7 +90,6 @@ fn local_key_sync_scope_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn local_key_with_panic_caller() -> Result<(), Box> { tokio::task_local! { @@ -112,7 +106,6 @@ fn local_key_with_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn local_key_get_panic_caller() -> Result<(), Box> { tokio::task_local! { diff --git a/vendor/tokio/tests/tcp_into_split.rs b/vendor/tokio/tests/tcp_into_split.rs index 2a030691f..df8efadb5 100644 --- a/vendor/tokio/tests/tcp_into_split.rs +++ b/vendor/tokio/tests/tcp_into_split.rs @@ -38,7 +38,7 @@ async fn split() -> Result<()> { Ok(()) }, async { - let mut read_buf = vec![0u8; 32]; + let mut read_buf = [0u8; 32]; let peek_len1 = read_half.peek(&mut read_buf[..]).await?; let peek_len2 = read_half.peek(&mut read_buf[..]).await?; assert_eq!(peek_len1, peek_len2); diff --git a/vendor/tokio/tests/time_panic.rs b/vendor/tokio/tests/time_panic.rs index 2b8e09573..8a997f045 100644 --- a/vendor/tokio/tests/time_panic.rs +++ b/vendor/tokio/tests/time_panic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support panic recovery +#![cfg(panic = "unwind")] use futures::future; use std::error::Error; @@ -12,7 +13,6 @@ mod support { } use support::panic::test_panic; -#[cfg(panic = "unwind")] #[test] fn pause_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -30,7 +30,6 @@ fn pause_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn resume_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -47,7 +46,6 @@ fn resume_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn interval_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -60,7 +58,6 @@ fn interval_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn interval_at_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { @@ -73,14 +70,13 @@ fn interval_at_panic_caller() -> Result<(), Box> { Ok(()) } -#[cfg(panic = "unwind")] #[test] fn timeout_panic_caller() -> Result<(), Box> { let panic_location_file = test_panic(|| { // Runtime without `enable_time` so it has no current timer set. let rt = Builder::new_current_thread().build().unwrap(); rt.block_on(async { - let _ = timeout(Duration::from_millis(5), future::pending::<()>()); + let _timeout = timeout(Duration::from_millis(5), future::pending::<()>()); }); }); diff --git a/vendor/tokio/tests/time_pause.rs b/vendor/tokio/tests/time_pause.rs index 2750fc5c8..a14f7e22c 100644 --- a/vendor/tokio/tests/time_pause.rs +++ b/vendor/tokio/tests/time_pause.rs @@ -36,7 +36,7 @@ async fn pause_time_in_main_threads() { tokio::time::pause(); } -#[cfg(panic = "unwind")] +#[cfg_attr(panic = "abort", ignore)] #[cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn pause_time_in_spawn_threads() { diff --git a/vendor/tokio/tests/uds_socket.rs b/vendor/tokio/tests/uds_socket.rs new file mode 100644 index 000000000..5261ffe5d --- /dev/null +++ b/vendor/tokio/tests/uds_socket.rs @@ -0,0 +1,118 @@ +#![warn(rust_2018_idioms)] +#![cfg(feature = "full")] +#![cfg(unix)] + +use futures::future::try_join; +use std::io; +use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + net::UnixSocket, +}; + +#[tokio::test] +async fn datagram_echo_server() -> io::Result<()> { + let dir = tempfile::tempdir().unwrap(); + let server_path = dir.path().join("server.sock"); + let client_path = dir.path().join("client.sock"); + + let server_socket = { + let socket = UnixSocket::new_datagram()?; + socket.bind(&server_path)?; + socket.datagram()? + }; + + tokio::spawn(async move { + let mut recv_buf = vec![0u8; 1024]; + loop { + let (len, peer_addr) = server_socket.recv_from(&mut recv_buf[..]).await?; + if let Some(path) = peer_addr.as_pathname() { + server_socket.send_to(&recv_buf[..len], path).await?; + } + } + + #[allow(unreachable_code)] + Ok::<(), io::Error>(()) + }); + + { + let socket = UnixSocket::new_datagram()?; + socket.bind(&client_path).unwrap(); + let socket = socket.datagram()?; + + socket.connect(server_path)?; + socket.send(b"ECHO").await?; + + let mut recv_buf = [0u8; 16]; + let len = socket.recv(&mut recv_buf[..]).await?; + assert_eq!(&recv_buf[..len], b"ECHO"); + } + + Ok(()) +} + +#[tokio::test] +async fn listen_and_stream() -> std::io::Result<()> { + let dir = tempfile::Builder::new().tempdir().unwrap(); + let sock_path = dir.path().join("connect.sock"); + let peer_path = dir.path().join("peer.sock"); + + let listener = { + let sock = UnixSocket::new_stream()?; + sock.bind(&sock_path)?; + sock.listen(1024)? + }; + + let accept = listener.accept(); + let connect = { + let sock = UnixSocket::new_stream()?; + sock.bind(&peer_path)?; + sock.connect(&sock_path) + }; + + let ((mut server, _), mut client) = try_join(accept, connect).await?; + + assert_eq!( + server.peer_addr().unwrap().as_pathname().unwrap(), + &peer_path + ); + + // Write to the client. + client.write_all(b"hello").await?; + drop(client); + + // Read from the server. + let mut buf = vec![]; + server.read_to_end(&mut buf).await?; + assert_eq!(&buf, b"hello"); + let len = server.read(&mut buf).await?; + assert_eq!(len, 0); + Ok(()) +} + +#[tokio::test] +async fn assert_usage() -> std::io::Result<()> { + let datagram_socket = UnixSocket::new_datagram()?; + let result = datagram_socket + .connect(std::path::PathBuf::new().join("invalid.sock")) + .await; + assert_eq!( + result.unwrap_err().to_string(), + "connect cannot be called on a datagram socket" + ); + + let datagram_socket = UnixSocket::new_datagram()?; + let result = datagram_socket.listen(1024); + assert_eq!( + result.unwrap_err().to_string(), + "listen cannot be called on a datagram socket" + ); + + let stream_socket = UnixSocket::new_stream()?; + let result = stream_socket.datagram(); + assert_eq!( + result.unwrap_err().to_string(), + "datagram cannot be called on a stream socket" + ); + + Ok(()) +} diff --git a/vendor/try-lock/.cargo-checksum.json b/vendor/try-lock/.cargo-checksum.json index 0afb2c606..80ab156ad 100644 --- a/vendor/try-lock/.cargo-checksum.json +++ b/vendor/try-lock/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"fb6a5cac265146347b3fe5d8dbc01c6366e8411b11939e3befe23d14a7c13514","LICENSE":"69127cd697ac8e4da8d4a206ae067bbeb2aef41618c4be521509772110c4f202","README.md":"976bf116dd8794213bd242a61f819811a5c5a0fd4372acdbd21308863c05cfb6","src/lib.rs":"ececfc64a1b584fa42a5aa2d2d88f7c8d230ab96f70a038137411c7134763dc4"},"package":"3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"} \ No newline at end of file +{"files":{"Cargo.toml":"b929e378a4dd54a76870264bb0b25d059c8a12ec1dda78a8017d7dbba96260fc","LICENSE":"c816a0749cdc6bf062a5111c159723de51b2bfac66a1dac2655abd9e6b1583eb","README.md":"976bf116dd8794213bd242a61f819811a5c5a0fd4372acdbd21308863c05cfb6","src/lib.rs":"4f8e19b938527c5543e3180901a11ec31f8933d5ac918790456d2f4027a12f6f"},"package":"e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"} \ No newline at end of file diff --git a/vendor/try-lock/Cargo.toml b/vendor/try-lock/Cargo.toml index dab6cacc4..ef2f8dda3 100644 --- a/vendor/try-lock/Cargo.toml +++ b/vendor/try-lock/Cargo.toml @@ -11,7 +11,7 @@ [package] name = "try-lock" -version = "0.2.4" +version = "0.2.5" authors = ["Sean McArthur "] description = "A lightweight atomic lock." homepage = "https://github.com/seanmonstar/try-lock" diff --git a/vendor/try-lock/LICENSE b/vendor/try-lock/LICENSE index 5cddb267a..ef65989e7 100644 --- a/vendor/try-lock/LICENSE +++ b/vendor/try-lock/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018 Sean McArthur +Copyright (c) 2018-2023 Sean McArthur Copyright (c) 2016 Alex Crichton Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/try-lock/src/lib.rs b/vendor/try-lock/src/lib.rs index 80a240efe..281199676 100644 --- a/vendor/try-lock/src/lib.rs +++ b/vendor/try-lock/src/lib.rs @@ -1,4 +1,3 @@ -#![doc(html_root_url = "https://docs.rs/try-lock/0.2.3")] #![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(warnings)] @@ -69,7 +68,7 @@ pub struct TryLock { impl TryLock { /// Create a `TryLock` around the value. #[inline] - pub fn new(val: T) -> TryLock { + pub const fn new(val: T) -> TryLock { TryLock { is_locked: AtomicBool::new(false), value: UnsafeCell::new(val), @@ -179,15 +178,7 @@ impl TryLock { #[inline] pub fn into_inner(self) -> T { debug_assert!(!self.is_locked.load(Ordering::Relaxed), "TryLock was mem::forgotten"); - // Since the compiler can statically determine this is the only owner, - // it's safe to take the value out. In fact, in newer versions of Rust, - // `UnsafeCell::into_inner` has been marked safe. - // - // To support older version (1.21), the unsafe block is still here. - #[allow(unused_unsafe)] - unsafe { - self.value.into_inner() - } + self.value.into_inner() } } diff --git a/vendor/unicode-bidi/.cargo-checksum.json b/vendor/unicode-bidi/.cargo-checksum.json index 5a4e0d965..3628dc8f6 100644 --- a/vendor/unicode-bidi/.cargo-checksum.json +++ b/vendor/unicode-bidi/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"AUTHORS":"1ff3a7c8519b29544bb28ba9b1e7502df0cb764051fb9a1172e60006aa2b8dcc","COPYRIGHT":"edb20b474f6cbd4f4db066b54a9e0f687d0009d309412a63431189b59b8e2a07","Cargo.toml":"6abc8483d33ece6e5f450e7bbce8110a2bc7c1eca7e34858aac7d5ccd3d6b0bb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"81d3dc6d894a68894d982760b0a907f9dcbb0da179a8063ed9de1d2257518957","src/char_data/mod.rs":"0622df8ce4b4de60aea7e4787635d3187f79f7a3f9001e3d209f58fd07d03887","src/char_data/tables.rs":"50faf4eef73c831a38b735309ff3415e9f65992a0474ff5c055138f91c91ee16","src/data_source.rs":"36fa0785e51c549c1f72f09040cfe515b848d1b23fb30d469770a6b4b17b49df","src/deprecated.rs":"46c5a8bb1e6aa6193eec8269891d4cbbb5fd92214eb55eac7ea5e7ca193386aa","src/explicit.rs":"53428d618aef86c6790d195eb9477f09decc396772581427241d34139f886517","src/format_chars.rs":"678399fec3f4bfaf4093f38cfdb8956288313386dc3511dab9fb58164e8dc01b","src/implicit.rs":"454f35f0803ae7d1d7fdb2d1fb0cd675dd83c5dd92a8d31445847a5a2a16b6bf","src/level.rs":"921fb7b8960f6cc703a51936075302db513927b8c5d5d760536b6ff70ddab0dd","src/lib.rs":"9e1d78e80264c9ef85aa9300eb52e5b08766584913895fa7df1f01f2cbf565c8","src/prepare.rs":"7aa46ba8d0448a34be704cc3a1f49bc52ddfce62fa66af65618c2ac94cb88a4e"},"package":"92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"} \ No newline at end of file +{"files":{"AUTHORS":"1ff3a7c8519b29544bb28ba9b1e7502df0cb764051fb9a1172e60006aa2b8dcc","COPYRIGHT":"edb20b474f6cbd4f4db066b54a9e0f687d0009d309412a63431189b59b8e2a07","Cargo.toml":"9cd0be282dbaeacf5d1fdf07096114c7b3f16f275755f30a0d2e873ab1fbc150","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"81d3dc6d894a68894d982760b0a907f9dcbb0da179a8063ed9de1d2257518957","src/char_data/mod.rs":"0622df8ce4b4de60aea7e4787635d3187f79f7a3f9001e3d209f58fd07d03887","src/char_data/tables.rs":"50faf4eef73c831a38b735309ff3415e9f65992a0474ff5c055138f91c91ee16","src/data_source.rs":"36fa0785e51c549c1f72f09040cfe515b848d1b23fb30d469770a6b4b17b49df","src/deprecated.rs":"46c5a8bb1e6aa6193eec8269891d4cbbb5fd92214eb55eac7ea5e7ca193386aa","src/explicit.rs":"afa7599674fc8daad2939e5987ec5d937ed9fdbb78b8492b1e137db88d0a3af7","src/format_chars.rs":"678399fec3f4bfaf4093f38cfdb8956288313386dc3511dab9fb58164e8dc01b","src/implicit.rs":"e96484178d1bab97439b2c0cf4b3a8d6ee18459b9de64499aa07607aa304be0c","src/level.rs":"921fb7b8960f6cc703a51936075302db513927b8c5d5d760536b6ff70ddab0dd","src/lib.rs":"ca09c7dedc56ec139fa92fec26c3983346a3b6456992acdfbfe18b324174e0d8","src/prepare.rs":"c4aaad603f5c1be5c4364265aac7590335dc234288a4151e0f30bcefe532e14d","src/utf16.rs":"30d31c4d8c814315b48b56a2dfb755b8b442dde23f76429c6df1af754999fe3b"},"package":"08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"} \ No newline at end of file diff --git a/vendor/unicode-bidi/Cargo.toml b/vendor/unicode-bidi/Cargo.toml index 81aee5c08..29be4e5a7 100644 --- a/vendor/unicode-bidi/Cargo.toml +++ b/vendor/unicode-bidi/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" authors = ["The Servo Project Developers"] exclude = [ "benches/**", diff --git a/vendor/unicode-bidi/src/explicit.rs b/vendor/unicode-bidi/src/explicit.rs index a9b13e89c..d4ad897b5 100644 --- a/vendor/unicode-bidi/src/explicit.rs +++ b/vendor/unicode-bidi/src/explicit.rs @@ -18,14 +18,15 @@ use super::char_data::{ BidiClass::{self, *}, }; use super::level::Level; +use super::TextSource; /// Compute explicit embedding levels for one paragraph of text (X1-X8). /// /// `processing_classes[i]` must contain the `BidiClass` of the char at byte index `i`, /// for each char in `text`. #[cfg_attr(feature = "flame_it", flamer::flame)] -pub fn compute( - text: &str, +pub fn compute<'a, T: TextSource<'a> + ?Sized>( + text: &'a T, para_level: Level, original_classes: &[BidiClass], levels: &mut [Level], @@ -41,7 +42,7 @@ pub fn compute( let mut overflow_embedding_count = 0u32; let mut valid_isolate_count = 0u32; - for (i, c) in text.char_indices() { + for (i, len) in text.indices_lengths() { match original_classes[i] { // Rules X2-X5c RLE | LRE | RLO | LRO | RLI | LRI | FSI => { @@ -167,7 +168,7 @@ pub fn compute( } // Handle multi-byte characters. - for j in 1..c.len_utf8() { + for j in 1..len { levels[i + j] = levels[i]; processing_classes[i + j] = processing_classes[i]; } diff --git a/vendor/unicode-bidi/src/implicit.rs b/vendor/unicode-bidi/src/implicit.rs index 294af7cbd..0311053c0 100644 --- a/vendor/unicode-bidi/src/implicit.rs +++ b/vendor/unicode-bidi/src/implicit.rs @@ -14,15 +14,15 @@ use core::cmp::max; use super::char_data::BidiClass::{self, *}; use super::level::Level; -use super::prepare::{not_removed_by_x9, removed_by_x9, IsolatingRunSequence}; -use super::BidiDataSource; +use super::prepare::{not_removed_by_x9, IsolatingRunSequence}; +use super::{BidiDataSource, TextSource}; /// 3.3.4 Resolving Weak Types /// /// #[cfg_attr(feature = "flame_it", flamer::flame)] -pub fn resolve_weak( - text: &str, +pub fn resolve_weak<'a, T: TextSource<'a> + ?Sized>( + text: &'a T, sequence: &IsolatingRunSequence, processing_classes: &mut [BidiClass], ) { @@ -120,9 +120,9 @@ pub fn resolve_weak( // See https://github.com/servo/unicode-bidi/issues/86 for improving this. // We want to make sure we check the correct next character by skipping past the rest // of this one. - if let Some(ch) = text.get(i..).and_then(|s| s.chars().next()) { + if let Some((_, char_len)) = text.char_at(i) { let mut next_class = sequence - .iter_forwards_from(i + ch.len_utf8(), run_index) + .iter_forwards_from(i + char_len, run_index) .map(|j| processing_classes[j]) // .find(not_removed_by_x9) @@ -156,7 +156,7 @@ pub fn resolve_weak( } *class = ON; } - for idx in sequence.iter_forwards_from(i + ch.len_utf8(), run_index) { + for idx in sequence.iter_forwards_from(i + char_len, run_index) { let class = &mut processing_classes[idx]; if *class != BN { break; @@ -248,8 +248,8 @@ pub fn resolve_weak( /// /// #[cfg_attr(feature = "flame_it", flamer::flame)] -pub fn resolve_neutral( - text: &str, +pub fn resolve_neutral<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>( + text: &'a T, data_source: &D, sequence: &IsolatingRunSequence, levels: &[Level], @@ -288,12 +288,13 @@ pub fn resolve_neutral( let mut found_not_e = false; let mut class_to_set = None; - let start_len_utf8 = text[pair.start..].chars().next().unwrap().len_utf8(); + let start_char_len = + T::char_len(text.subrange(pair.start..pair.end).chars().next().unwrap()); // > Inspect the bidirectional types of the characters enclosed within the bracket pair. // // `pair` is [start, end) so we will end up processing the opening character but not the closing one. // - for enclosed_i in sequence.iter_forwards_from(pair.start + start_len_utf8, pair.start_run) { + for enclosed_i in sequence.iter_forwards_from(pair.start + start_char_len, pair.start_run) { if enclosed_i >= pair.end { #[cfg(feature = "std")] debug_assert!( @@ -362,11 +363,12 @@ pub fn resolve_neutral( if let Some(class_to_set) = class_to_set { // Update all processing classes corresponding to the start and end elements, as requested. // We should include all bytes of the character, not the first one. - let end_len_utf8 = text[pair.end..].chars().next().unwrap().len_utf8(); - for class in &mut processing_classes[pair.start..pair.start + start_len_utf8] { + let end_char_len = + T::char_len(text.subrange(pair.end..text.len()).chars().next().unwrap()); + for class in &mut processing_classes[pair.start..pair.start + start_char_len] { *class = class_to_set; } - for class in &mut processing_classes[pair.end..pair.end + end_len_utf8] { + for class in &mut processing_classes[pair.end..pair.end + end_char_len] { *class = class_to_set; } // @@ -382,7 +384,7 @@ pub fn resolve_neutral( // This rule deals with sequences of NSMs, so we can just update them all at once, we don't need to worry // about character boundaries. We do need to be careful to skip the full set of bytes for the parentheses characters. - let nsm_start = pair.start + start_len_utf8; + let nsm_start = pair.start + start_char_len; for idx in sequence.iter_forwards_from(nsm_start, pair.start_run) { let class = original_classes[idx]; if class == BidiClass::NSM || processing_classes[idx] == BN { @@ -391,7 +393,7 @@ pub fn resolve_neutral( break; } } - let nsm_end = pair.end + end_len_utf8; + let nsm_end = pair.end + end_char_len; for idx in sequence.iter_forwards_from(nsm_end, pair.end_run) { let class = original_classes[idx]; if class == BidiClass::NSM || processing_classes[idx] == BN { @@ -477,8 +479,8 @@ struct BracketPair { /// text source. /// /// -fn identify_bracket_pairs( - text: &str, +fn identify_bracket_pairs<'a, T: TextSource<'a> + ?Sized, D: BidiDataSource>( + text: &'a T, data_source: &D, run_sequence: &IsolatingRunSequence, original_classes: &[BidiClass], @@ -487,27 +489,14 @@ fn identify_bracket_pairs( let mut stack = vec![]; for (run_index, level_run) in run_sequence.runs.iter().enumerate() { - let slice = if let Some(slice) = text.get(level_run.clone()) { - slice - } else { - #[cfg(feature = "std")] - std::debug_assert!( - false, - "Found broken indices in level run: found indices {}..{} for string of length {}", - level_run.start, - level_run.end, - text.len() - ); - return ret; - }; - - for (i, ch) in slice.char_indices() { + for (i, ch) in text.subrange(level_run.clone()).char_indices() { let actual_index = level_run.start + i; + // All paren characters are ON. // From BidiBrackets.txt: // > The Unicode property value stability policy guarantees that characters // > which have bpt=o or bpt=c also have bc=ON and Bidi_M=Y - if original_classes[level_run.start + i] != BidiClass::ON { + if original_classes[actual_index] != BidiClass::ON { continue; } diff --git a/vendor/unicode-bidi/src/lib.rs b/vendor/unicode-bidi/src/lib.rs index 28178bb51..1072b67fe 100644 --- a/vendor/unicode-bidi/src/lib.rs +++ b/vendor/unicode-bidi/src/lib.rs @@ -76,6 +76,7 @@ pub mod data_source; pub mod deprecated; pub mod format_chars; pub mod level; +pub mod utf16; mod char_data; mod explicit; @@ -93,13 +94,69 @@ pub use crate::char_data::{bidi_class, HardcodedBidiData}; use alloc::borrow::Cow; use alloc::string::String; use alloc::vec::Vec; +use core::char; use core::cmp; use core::iter::repeat; use core::ops::Range; +use core::str::CharIndices; use crate::format_chars as chars; use crate::BidiClass::*; +/// Trait that abstracts over a text source for use by the bidi algorithms. +/// We implement this for str (UTF-8) and for [u16] (UTF-16, native-endian). +/// (For internal unicode-bidi use; API may be unstable.) +/// This trait is sealed and cannot be implemented for types outside this crate. +pub trait TextSource<'text>: private::Sealed { + type CharIter: Iterator; + type CharIndexIter: Iterator; + type IndexLenIter: Iterator; + + /// Return the length of the text in code units. + #[doc(hidden)] + fn len(&self) -> usize; + + /// Get the character at a given code unit index, along with its length in code units. + /// Returns None if index is out of range, or points inside a multi-code-unit character. + /// Returns REPLACEMENT_CHARACTER for any unpaired surrogates in UTF-16. + #[doc(hidden)] + fn char_at(&self, index: usize) -> Option<(char, usize)>; + + /// Return a subrange of the text, indexed by code units. + /// (We don't implement all of the Index trait, just the minimum we use.) + #[doc(hidden)] + fn subrange(&self, range: Range) -> &Self; + + /// An iterator over the text returning Unicode characters, + /// REPLACEMENT_CHAR for invalid code units. + #[doc(hidden)] + fn chars(&'text self) -> Self::CharIter; + + /// An iterator over the text returning (index, char) tuples, + /// where index is the starting code-unit index of the character, + /// and char is its Unicode value (or REPLACEMENT_CHAR if invalid). + #[doc(hidden)] + fn char_indices(&'text self) -> Self::CharIndexIter; + + /// An iterator over the text returning (index, length) tuples, + /// where index is the starting code-unit index of the character, + /// and length is its length in code units. + #[doc(hidden)] + fn indices_lengths(&'text self) -> Self::IndexLenIter; + + /// Number of code units the given character uses. + #[doc(hidden)] + fn char_len(ch: char) -> usize; +} + +mod private { + pub trait Sealed {} + + // Implement for str and [u16] only. + impl Sealed for str {} + impl Sealed for [u16] {} +} + #[derive(PartialEq, Debug)] pub enum Direction { Ltr, @@ -108,7 +165,7 @@ pub enum Direction { } /// Bidi information about a single paragraph -#[derive(Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct ParagraphInfo { /// The paragraphs boundaries within the text, as byte indices. /// @@ -175,100 +232,192 @@ impl<'text> InitialInfo<'text> { text: &'a str, default_para_level: Option, ) -> InitialInfo<'a> { - let mut original_classes = Vec::with_capacity(text.len()); + InitialInfoExt::new_with_data_source(data_source, text, default_para_level).base + } +} - // The stack contains the starting byte index for each nested isolate we're inside. - let mut isolate_stack = Vec::new(); - let mut paragraphs = Vec::new(); +/// Extended version of InitialInfo (not public API). +#[derive(PartialEq, Debug)] +struct InitialInfoExt<'text> { + /// The base InitialInfo for the text, recording its paragraphs and bidi classes. + base: InitialInfo<'text>, - let mut para_start = 0; - let mut para_level = default_para_level; + /// Parallel to base.paragraphs, records whether each paragraph is "pure LTR" that + /// requires no further bidi processing (i.e. there are no RTL characters or bidi + /// control codes present). + pure_ltr: Vec, +} + +impl<'text> InitialInfoExt<'text> { + /// Find the paragraphs and BidiClasses in a string of text, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`InitialInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature) + /// + /// + /// + /// Also sets the class for each First Strong Isolate initiator (FSI) to LRI or RLI if a strong + /// character is found before the matching PDI. If no strong character is found, the class will + /// remain FSI, and it's up to later stages to treat these as LRI when needed. + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a str, + default_para_level: Option, + ) -> InitialInfoExt<'a> { + let mut paragraphs = Vec::::new(); + let mut pure_ltr = Vec::::new(); + let (original_classes, _, _) = compute_initial_info( + data_source, + text, + default_para_level, + Some((&mut paragraphs, &mut pure_ltr)), + ); + + InitialInfoExt { + base: InitialInfo { + text, + original_classes, + paragraphs, + }, + pure_ltr, + } + } +} + +/// Implementation of initial-info computation for both BidiInfo and ParagraphBidiInfo. +/// To treat the text as (potentially) multiple paragraphs, the caller should pass the +/// pair of optional outparam arrays to receive the ParagraphInfo and pure-ltr flags +/// for each paragraph. Passing None for split_paragraphs will ignore any paragraph- +/// separator characters in the text, treating it just as a single paragraph. +/// Returns the array of BidiClass values for each code unit of the text, along with +/// the embedding level and pure-ltr flag for the *last* (or only) paragraph. +fn compute_initial_info<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>( + data_source: &D, + text: &'a T, + default_para_level: Option, + mut split_paragraphs: Option<(&mut Vec, &mut Vec)>, +) -> (Vec, Level, bool) { + let mut original_classes = Vec::with_capacity(text.len()); + + // The stack contains the starting code unit index for each nested isolate we're inside. + let mut isolate_stack = Vec::new(); + + debug_assert!( + if let Some((ref paragraphs, ref pure_ltr)) = split_paragraphs { + paragraphs.is_empty() && pure_ltr.is_empty() + } else { + true + } + ); + + let mut para_start = 0; + let mut para_level = default_para_level; + + // Per-paragraph flag: can subsequent processing be skipped? Set to false if any + // RTL characters or bidi control characters are encountered in the paragraph. + let mut is_pure_ltr = true; + + #[cfg(feature = "flame_it")] + flame::start("compute_initial_info(): iter text.char_indices()"); + + for (i, c) in text.char_indices() { + let class = data_source.bidi_class(c); #[cfg(feature = "flame_it")] - flame::start("InitialInfo::new(): iter text.char_indices()"); + flame::start("original_classes.extend()"); - for (i, c) in text.char_indices() { - let class = data_source.bidi_class(c); + let len = T::char_len(c); + original_classes.extend(repeat(class).take(len)); - #[cfg(feature = "flame_it")] - flame::start("original_classes.extend()"); + #[cfg(feature = "flame_it")] + flame::end("original_classes.extend()"); - original_classes.extend(repeat(class).take(c.len_utf8())); - - #[cfg(feature = "flame_it")] - flame::end("original_classes.extend()"); - - match class { - B => { + match class { + B => { + if let Some((ref mut paragraphs, ref mut pure_ltr)) = split_paragraphs { // P1. Split the text into separate paragraphs. The paragraph separator is kept // with the previous paragraph. - let para_end = i + c.len_utf8(); + let para_end = i + len; paragraphs.push(ParagraphInfo { range: para_start..para_end, // P3. If no character is found in p2, set the paragraph level to zero. level: para_level.unwrap_or(LTR_LEVEL), }); + pure_ltr.push(is_pure_ltr); // Reset state for the start of the next paragraph. para_start = para_end; // TODO: Support defaulting to direction of previous paragraph // // para_level = default_para_level; + is_pure_ltr = true; isolate_stack.clear(); } + } - L | R | AL => { - match isolate_stack.last() { - Some(&start) => { - if original_classes[start] == FSI { - // X5c. If the first strong character between FSI and its matching - // PDI is R or AL, treat it as RLI. Otherwise, treat it as LRI. - for j in 0..chars::FSI.len_utf8() { - original_classes[start + j] = - if class == L { LRI } else { RLI }; - } - } - } - - None => { - if para_level.is_none() { - // P2. Find the first character of type L, AL, or R, while skipping - // any characters between an isolate initiator and its matching - // PDI. - para_level = Some(if class != L { RTL_LEVEL } else { LTR_LEVEL }); + L | R | AL => { + if class != L { + is_pure_ltr = false; + } + match isolate_stack.last() { + Some(&start) => { + if original_classes[start] == FSI { + // X5c. If the first strong character between FSI and its matching + // PDI is R or AL, treat it as RLI. Otherwise, treat it as LRI. + for j in 0..T::char_len(chars::FSI) { + original_classes[start + j] = if class == L { LRI } else { RLI }; } } } - } - RLI | LRI | FSI => { - isolate_stack.push(i); + None => { + if para_level.is_none() { + // P2. Find the first character of type L, AL, or R, while skipping + // any characters between an isolate initiator and its matching + // PDI. + para_level = Some(if class != L { RTL_LEVEL } else { LTR_LEVEL }); + } + } } - - PDI => { - isolate_stack.pop(); - } - - _ => {} } + + AN | LRE | RLE | LRO | RLO => { + is_pure_ltr = false; + } + + RLI | LRI | FSI => { + is_pure_ltr = false; + isolate_stack.push(i); + } + + PDI => { + isolate_stack.pop(); + } + + _ => {} } + } + + if let Some((paragraphs, pure_ltr)) = split_paragraphs { if para_start < text.len() { paragraphs.push(ParagraphInfo { range: para_start..text.len(), level: para_level.unwrap_or(LTR_LEVEL), }); + pure_ltr.push(is_pure_ltr); } - assert_eq!(original_classes.len(), text.len()); - - #[cfg(feature = "flame_it")] - flame::end("InitialInfo::new(): iter text.char_indices()"); - - InitialInfo { - text, - original_classes, - paragraphs, - } + debug_assert_eq!(paragraphs.len(), pure_ltr.len()); } + debug_assert_eq!(original_classes.len(), text.len()); + + #[cfg(feature = "flame_it")] + flame::end("compute_initial_info(): iter text.char_indices()"); + + ( + original_classes, + para_level.unwrap_or(LTR_LEVEL), + is_pure_ltr, + ) } /// Bidi information of the text. @@ -307,6 +456,7 @@ impl<'text> BidiInfo<'text> { /// TODO: Support auto-RTL base direction #[cfg_attr(feature = "flame_it", flamer::flame)] #[cfg(feature = "hardcoded-data")] + #[inline] pub fn new(text: &str, default_para_level: Option) -> BidiInfo<'_> { Self::new_with_data_source(&HardcodedBidiData, text, default_para_level) } @@ -325,67 +475,80 @@ impl<'text> BidiInfo<'text> { text: &'a str, default_para_level: Option, ) -> BidiInfo<'a> { - let InitialInfo { - original_classes, - paragraphs, - .. - } = InitialInfo::new_with_data_source(data_source, text, default_para_level); + let InitialInfoExt { base, pure_ltr, .. } = + InitialInfoExt::new_with_data_source(data_source, text, default_para_level); let mut levels = Vec::::with_capacity(text.len()); - let mut processing_classes = original_classes.clone(); + let mut processing_classes = base.original_classes.clone(); - for para in ¶graphs { + for (para, is_pure_ltr) in base.paragraphs.iter().zip(pure_ltr.iter()) { let text = &text[para.range.clone()]; - let original_classes = &original_classes[para.range.clone()]; - let processing_classes = &mut processing_classes[para.range.clone()]; + let original_classes = &base.original_classes[para.range.clone()]; - let new_len = levels.len() + para.range.len(); - levels.resize(new_len, para.level); - let levels = &mut levels[para.range.clone()]; - - explicit::compute( + compute_bidi_info_for_para( + data_source, + para, + *is_pure_ltr, text, - para.level, original_classes, - levels, - processing_classes, + &mut processing_classes, + &mut levels, ); - - let sequences = prepare::isolating_run_sequences(para.level, original_classes, levels); - for sequence in &sequences { - implicit::resolve_weak(text, sequence, processing_classes); - implicit::resolve_neutral( - text, - data_source, - sequence, - levels, - original_classes, - processing_classes, - ); - } - implicit::resolve_levels(processing_classes, levels); - - assign_levels_to_removed_chars(para.level, original_classes, levels); } BidiInfo { text, - original_classes, - paragraphs, + original_classes: base.original_classes, + paragraphs: base.paragraphs, levels, } } - /// Re-order a line based on resolved levels and return only the embedding levels, one `Level` - /// per *byte*. + /// Produce the levels for this paragraph as needed for reordering, one level per *byte* + /// in the paragraph. The returned vector includes bytes that are not included + /// in the `line`, but will not adjust them. + /// + /// This runs [Rule L1], you can run + /// [Rule L2] by calling [`Self::reorder_visual()`]. + /// If doing so, you may prefer to use [`Self::reordered_levels_per_char()`] instead + /// to avoid non-byte indices. + /// + /// For an all-in-one reordering solution, consider using [`Self::reorder_visual()`]. + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 #[cfg_attr(feature = "flame_it", flamer::flame)] pub fn reordered_levels(&self, para: &ParagraphInfo, line: Range) -> Vec { - let (levels, _) = self.visual_runs(para, line); + assert!(line.start <= self.levels.len()); + assert!(line.end <= self.levels.len()); + + let mut levels = self.levels.clone(); + let line_classes = &self.original_classes[line.clone()]; + let line_levels = &mut levels[line.clone()]; + + reorder_levels( + line_classes, + line_levels, + self.text.subrange(line), + para.level, + ); + levels } - /// Re-order a line based on resolved levels and return only the embedding levels, one `Level` - /// per *character*. + /// Produce the levels for this paragraph as needed for reordering, one level per *character* + /// in the paragraph. The returned vector includes characters that are not included + /// in the `line`, but will not adjust them. + /// + /// This runs [Rule L1], you can run + /// [Rule L2] by calling [`Self::reorder_visual()`]. + /// If doing so, you may prefer to use [`Self::reordered_levels_per_char()`] instead + /// to avoid non-byte indices. + /// + /// For an all-in-one reordering solution, consider using [`Self::reorder_visual()`]. + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 #[cfg_attr(feature = "flame_it", flamer::flame)] pub fn reordered_levels_per_char( &self, @@ -397,24 +560,18 @@ impl<'text> BidiInfo<'text> { } /// Re-order a line based on resolved levels and return the line in display order. + /// + /// This does not apply [Rule L3] or [Rule L4] around combining characters or mirroring. + /// + /// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 + /// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 #[cfg_attr(feature = "flame_it", flamer::flame)] pub fn reorder_line(&self, para: &ParagraphInfo, line: Range) -> Cow<'text, str> { - let (levels, runs) = self.visual_runs(para, line.clone()); - - // If all isolating run sequences are LTR, no reordering is needed - if runs.iter().all(|run| levels[run.start].is_ltr()) { + if !level::has_rtl(&self.levels[line.clone()]) { return self.text[line].into(); } - - let mut result = String::with_capacity(line.len()); - for run in runs { - if levels[run.start].is_rtl() { - result.extend(self.text[run].chars().rev()); - } else { - result.push_str(&self.text[run]); - } - } - result.into() + let (levels, runs) = self.visual_runs(para, line.clone()); + reorder_line(self.text, line, levels, runs) } /// Reorders pre-calculated levels of a sequence of characters. @@ -452,216 +609,45 @@ impl<'text> BidiInfo<'text> { /// assert_eq!(levels.len(), index_map.len()); /// assert_eq!(index_map, [0, 1, 2, 6, 7, 5, 4, 3]); /// ``` + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] pub fn reorder_visual(levels: &[Level]) -> Vec { - // Gets the next range of characters after start_index with a level greater - // than or equal to `max` - fn next_range(levels: &[level::Level], mut start_index: usize, max: Level) -> Range { - if levels.is_empty() || start_index >= levels.len() { - return start_index..start_index; - } - while let Some(l) = levels.get(start_index) { - if *l >= max { - break; - } - start_index += 1; - } - - if levels.get(start_index).is_none() { - // If at the end of the array, adding one will - // produce an out-of-range end element - return start_index..start_index; - } - - let mut end_index = start_index + 1; - while let Some(l) = levels.get(end_index) { - if *l < max { - return start_index..end_index; - } - end_index += 1; - } - - start_index..end_index - } - - // This implementation is similar to the L2 implementation in `visual_runs()` - // but it cannot benefit from a precalculated LevelRun vector so needs to be different. - - if levels.is_empty() { - return vec![]; - } - - // Get the min and max levels - let (mut min, mut max) = levels - .iter() - .fold((levels[0], levels[0]), |(min, max), &l| { - (cmp::min(min, l), cmp::max(max, l)) - }); - - // Initialize an index map - let mut result: Vec = (0..levels.len()).collect(); - - if min == max && min.is_ltr() { - // Everything is LTR and at the same level, do nothing - return result; - } - - // Stop at the lowest *odd* level, since everything below that - // is LTR and does not need further reordering - min = min.new_lowest_ge_rtl().expect("Level error"); - - // For each max level, take all contiguous chunks of - // levels ≥ max and reverse them - // - // We can do this check with the original levels instead of checking reorderings because all - // prior reorderings will have been for contiguous chunks of levels >> max, which will - // be a subset of these chunks anyway. - while min <= max { - let mut range = 0..0; - loop { - range = next_range(levels, range.end, max); - result[range.clone()].reverse(); - - if range.end >= levels.len() { - break; - } - } - - max.lower(1).expect("Level error"); - } - - result + reorder_visual(levels) } /// Find the level runs within a line and return them in visual order. /// /// `line` is a range of bytes indices within `levels`. /// + /// The first return value is a vector of levels used by the reordering algorithm, + /// i.e. the result of [Rule L1]. The second return value is a vector of level runs, + /// the result of [Rule L2], showing the visual order that each level run (a run of text with the + /// same level) should be displayed. Within each run, the display order can be checked + /// against the Level vector. + /// + /// This does not handle [Rule L3] (combining characters) or [Rule L4] (mirroring), + /// as that should be handled by the engine using this API. + /// + /// Conceptually, this is the same as running [`Self::reordered_levels()`] followed by + /// [`Self::reorder_visual()`], however it returns the result as a list of level runs instead + /// of producing a level map, since one may wish to deal with the fact that this is operating on + /// byte rather than character indices. + /// /// + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 + /// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 + /// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] pub fn visual_runs( &self, para: &ParagraphInfo, line: Range, ) -> (Vec, Vec) { - assert!(line.start <= self.levels.len()); - assert!(line.end <= self.levels.len()); - - let mut levels = self.levels.clone(); - let line_classes = &self.original_classes[line.clone()]; - let line_levels = &mut levels[line.clone()]; - - // Reset some whitespace chars to paragraph level. - // - let line_str: &str = &self.text[line.clone()]; - let mut reset_from: Option = Some(0); - let mut reset_to: Option = None; - let mut prev_level = para.level; - for (i, c) in line_str.char_indices() { - match line_classes[i] { - // Segment separator, Paragraph separator - B | S => { - assert_eq!(reset_to, None); - reset_to = Some(i + c.len_utf8()); - if reset_from == None { - reset_from = Some(i); - } - } - // Whitespace, isolate formatting - WS | FSI | LRI | RLI | PDI => { - if reset_from == None { - reset_from = Some(i); - } - } - // - // same as above + set the level - RLE | LRE | RLO | LRO | PDF | BN => { - if reset_from == None { - reset_from = Some(i); - } - // also set the level to previous - line_levels[i] = prev_level; - } - _ => { - reset_from = None; - } - } - if let (Some(from), Some(to)) = (reset_from, reset_to) { - for level in &mut line_levels[from..to] { - *level = para.level; - } - reset_from = None; - reset_to = None; - } - prev_level = line_levels[i]; - } - if let Some(from) = reset_from { - for level in &mut line_levels[from..] { - *level = para.level; - } - } - - // Find consecutive level runs. - let mut runs = Vec::new(); - let mut start = line.start; - let mut run_level = levels[start]; - let mut min_level = run_level; - let mut max_level = run_level; - - for (i, &new_level) in levels.iter().enumerate().take(line.end).skip(start + 1) { - if new_level != run_level { - // End of the previous run, start of a new one. - runs.push(start..i); - start = i; - run_level = new_level; - min_level = cmp::min(run_level, min_level); - max_level = cmp::max(run_level, max_level); - } - } - runs.push(start..line.end); - - let run_count = runs.len(); - - // Re-order the odd runs. - // - - // Stop at the lowest *odd* level. - min_level = min_level.new_lowest_ge_rtl().expect("Level error"); - - // This loop goes through contiguous chunks of level runs that have a level - // ≥ max_level and reverses their contents, reducing max_level by 1 each time. - // - // It can do this check with the original levels instead of checking reorderings because all - // prior reorderings will have been for contiguous chunks of levels >> max, which will - // be a subset of these chunks anyway. - while max_level >= min_level { - // Look for the start of a sequence of consecutive runs of max_level or higher. - let mut seq_start = 0; - while seq_start < run_count { - if self.levels[runs[seq_start].start] < max_level { - seq_start += 1; - continue; - } - - // Found the start of a sequence. Now find the end. - let mut seq_end = seq_start + 1; - while seq_end < run_count { - if self.levels[runs[seq_end].start] < max_level { - break; - } - seq_end += 1; - } - - // Reverse the runs within this sequence. - runs[seq_start..seq_end].reverse(); - - seq_start = seq_end; - } - max_level - .lower(1) - .expect("Lowering embedding level below zero"); - } - - (levels, runs) + let levels = self.reordered_levels(para, line.clone()); + visual_runs_for_line(levels, &line) } /// If processed text has any computed RTL levels @@ -673,6 +659,508 @@ impl<'text> BidiInfo<'text> { } } +/// Bidi information of text treated as a single paragraph. +/// +/// The `original_classes` and `levels` vectors are indexed by byte offsets into the text. If a +/// character is multiple bytes wide, then its class and level will appear multiple times in these +/// vectors. +#[derive(Debug, PartialEq)] +pub struct ParagraphBidiInfo<'text> { + /// The text + pub text: &'text str, + + /// The BidiClass of the character at each byte in the text. + pub original_classes: Vec, + + /// The directional embedding level of each byte in the text. + pub levels: Vec, + + /// The paragraph embedding level. + pub paragraph_level: Level, + + /// Whether the paragraph is purely LTR. + pub is_pure_ltr: bool, +} + +impl<'text> ParagraphBidiInfo<'text> { + /// Determine the bidi embedding level. + /// + /// + /// The `hardcoded-data` Cargo feature (enabled by default) must be enabled to use this. + /// + /// TODO: In early steps, check for special cases that allow later steps to be skipped. like + /// text that is entirely LTR. See the `nsBidi` class from Gecko for comparison. + /// + /// TODO: Support auto-RTL base direction + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[cfg(feature = "hardcoded-data")] + #[inline] + pub fn new(text: &str, default_para_level: Option) -> ParagraphBidiInfo<'_> { + Self::new_with_data_source(&HardcodedBidiData, text, default_para_level) + } + + /// Determine the bidi embedding level, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`BidiInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature). + /// + /// (This is the single-paragraph equivalent of BidiInfo::new_with_data_source, + /// and should be kept in sync with it. + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a str, + default_para_level: Option, + ) -> ParagraphBidiInfo<'a> { + // Here we could create a ParagraphInitialInfo struct to parallel the one + // used by BidiInfo, but there doesn't seem any compelling reason for it. + let (original_classes, paragraph_level, is_pure_ltr) = + compute_initial_info(data_source, text, default_para_level, None); + + let mut levels = Vec::::with_capacity(text.len()); + let mut processing_classes = original_classes.clone(); + + let para_info = ParagraphInfo { + range: Range { + start: 0, + end: text.len(), + }, + level: paragraph_level, + }; + + compute_bidi_info_for_para( + data_source, + ¶_info, + is_pure_ltr, + text, + &original_classes, + &mut processing_classes, + &mut levels, + ); + + ParagraphBidiInfo { + text, + original_classes, + levels, + paragraph_level, + is_pure_ltr, + } + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *byte* + /// in the paragraph. The returned vector includes bytes that are not included + /// in the `line`, but will not adjust them. + /// + /// See BidiInfo::reordered_levels for details. + /// + /// (This should be kept in sync with BidiInfo::reordered_levels.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels(&self, line: Range) -> Vec { + assert!(line.start <= self.levels.len()); + assert!(line.end <= self.levels.len()); + + let mut levels = self.levels.clone(); + let line_classes = &self.original_classes[line.clone()]; + let line_levels = &mut levels[line.clone()]; + + reorder_levels( + line_classes, + line_levels, + self.text.subrange(line), + self.paragraph_level, + ); + + levels + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *character* + /// in the paragraph. The returned vector includes characters that are not included + /// in the `line`, but will not adjust them. + /// + /// See BidiInfo::reordered_levels_per_char for details. + /// + /// (This should be kept in sync with BidiInfo::reordered_levels_per_char.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels_per_char(&self, line: Range) -> Vec { + let levels = self.reordered_levels(line); + self.text.char_indices().map(|(i, _)| levels[i]).collect() + } + + /// Re-order a line based on resolved levels and return the line in display order. + /// + /// See BidiInfo::reorder_line for details. + /// + /// (This should be kept in sync with BidiInfo::reorder_line.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reorder_line(&self, line: Range) -> Cow<'text, str> { + if !level::has_rtl(&self.levels[line.clone()]) { + return self.text[line].into(); + } + + let (levels, runs) = self.visual_runs(line.clone()); + + reorder_line(self.text, line, levels, runs) + } + + /// Reorders pre-calculated levels of a sequence of characters. + /// + /// See BidiInfo::reorder_visual for details. + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn reorder_visual(levels: &[Level]) -> Vec { + reorder_visual(levels) + } + + /// Find the level runs within a line and return them in visual order. + /// + /// `line` is a range of bytes indices within `levels`. + /// + /// See BidiInfo::visual_runs for details. + /// + /// (This should be kept in sync with BidiInfo::visual_runs.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn visual_runs(&self, line: Range) -> (Vec, Vec) { + let levels = self.reordered_levels(line.clone()); + visual_runs_for_line(levels, &line) + } + + /// If processed text has any computed RTL levels + /// + /// This information is usually used to skip re-ordering of text when no RTL level is present + #[inline] + pub fn has_rtl(&self) -> bool { + !self.is_pure_ltr + } + + /// Return the paragraph's Direction (Ltr, Rtl, or Mixed) based on its levels. + #[inline] + pub fn direction(&self) -> Direction { + para_direction(&self.levels) + } +} + +/// Return a line of the text in display order based on resolved levels. +/// +/// `text` the full text passed to the `BidiInfo` or `ParagraphBidiInfo` for analysis +/// `line` a range of byte indices within `text` corresponding to one line +/// `levels` array of `Level` values, with `line`'s levels reordered into visual order +/// `runs` array of `LevelRun`s in visual order +/// +/// (`levels` and `runs` are the result of calling `BidiInfo::visual_runs()` or +/// `ParagraphBidiInfo::visual_runs()` for the line of interest.) +/// +/// Returns: the reordered text of the line. +/// +/// This does not apply [Rule L3] or [Rule L4] around combining characters or mirroring. +/// +/// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 +/// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 +fn reorder_line<'text>( + text: &'text str, + line: Range, + levels: Vec, + runs: Vec, +) -> Cow<'text, str> { + // If all isolating run sequences are LTR, no reordering is needed + if runs.iter().all(|run| levels[run.start].is_ltr()) { + return text[line].into(); + } + + let mut result = String::with_capacity(line.len()); + for run in runs { + if levels[run.start].is_rtl() { + result.extend(text[run].chars().rev()); + } else { + result.push_str(&text[run]); + } + } + result.into() +} + +/// Find the level runs within a line and return them in visual order. +/// +/// `line` is a range of code-unit indices within `levels`. +/// +/// The first return value is a vector of levels used by the reordering algorithm, +/// i.e. the result of [Rule L1]. The second return value is a vector of level runs, +/// the result of [Rule L2], showing the visual order that each level run (a run of text with the +/// same level) should be displayed. Within each run, the display order can be checked +/// against the Level vector. +/// +/// This does not handle [Rule L3] (combining characters) or [Rule L4] (mirroring), +/// as that should be handled by the engine using this API. +/// +/// Conceptually, this is the same as running [`reordered_levels()`] followed by +/// [`reorder_visual()`], however it returns the result as a list of level runs instead +/// of producing a level map, since one may wish to deal with the fact that this is operating on +/// byte rather than character indices. +/// +/// +/// +/// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 +/// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 +/// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 +/// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 +fn visual_runs_for_line(levels: Vec, line: &Range) -> (Vec, Vec) { + // Find consecutive level runs. + let mut runs = Vec::new(); + let mut start = line.start; + let mut run_level = levels[start]; + let mut min_level = run_level; + let mut max_level = run_level; + + for (i, &new_level) in levels.iter().enumerate().take(line.end).skip(start + 1) { + if new_level != run_level { + // End of the previous run, start of a new one. + runs.push(start..i); + start = i; + run_level = new_level; + min_level = cmp::min(run_level, min_level); + max_level = cmp::max(run_level, max_level); + } + } + runs.push(start..line.end); + + let run_count = runs.len(); + + // Re-order the odd runs. + // + + // Stop at the lowest *odd* level. + min_level = min_level.new_lowest_ge_rtl().expect("Level error"); + // This loop goes through contiguous chunks of level runs that have a level + // ≥ max_level and reverses their contents, reducing max_level by 1 each time. + while max_level >= min_level { + // Look for the start of a sequence of consecutive runs of max_level or higher. + let mut seq_start = 0; + while seq_start < run_count { + if levels[runs[seq_start].start] < max_level { + seq_start += 1; + continue; + } + + // Found the start of a sequence. Now find the end. + let mut seq_end = seq_start + 1; + while seq_end < run_count { + if levels[runs[seq_end].start] < max_level { + break; + } + seq_end += 1; + } + // Reverse the runs within this sequence. + runs[seq_start..seq_end].reverse(); + + seq_start = seq_end; + } + max_level + .lower(1) + .expect("Lowering embedding level below zero"); + } + (levels, runs) +} + +/// Reorders pre-calculated levels of a sequence of characters. +/// +/// NOTE: This is a convenience method that does not use a `Paragraph` object. It is +/// intended to be used when an application has determined the levels of the objects (character sequences) +/// and just needs to have them reordered. +/// +/// the index map will result in `indexMap[visualIndex]==logicalIndex`. +/// +/// This only runs [Rule L2](http://www.unicode.org/reports/tr9/#L2) as it does not have +/// information about the actual text. +/// +/// Furthermore, if `levels` is an array that is aligned with code units, bytes within a codepoint may be +/// reversed. You may need to fix up the map to deal with this. Alternatively, only pass in arrays where each `Level` +/// is for a single code point. +fn reorder_visual(levels: &[Level]) -> Vec { + // Gets the next range of characters after start_index with a level greater + // than or equal to `max` + fn next_range(levels: &[level::Level], mut start_index: usize, max: Level) -> Range { + if levels.is_empty() || start_index >= levels.len() { + return start_index..start_index; + } + while let Some(l) = levels.get(start_index) { + if *l >= max { + break; + } + start_index += 1; + } + + if levels.get(start_index).is_none() { + // If at the end of the array, adding one will + // produce an out-of-range end element + return start_index..start_index; + } + + let mut end_index = start_index + 1; + while let Some(l) = levels.get(end_index) { + if *l < max { + return start_index..end_index; + } + end_index += 1; + } + + start_index..end_index + } + + // This implementation is similar to the L2 implementation in `visual_runs()` + // but it cannot benefit from a precalculated LevelRun vector so needs to be different. + + if levels.is_empty() { + return vec![]; + } + + // Get the min and max levels + let (mut min, mut max) = levels + .iter() + .fold((levels[0], levels[0]), |(min, max), &l| { + (cmp::min(min, l), cmp::max(max, l)) + }); + + // Initialize an index map + let mut result: Vec = (0..levels.len()).collect(); + + if min == max && min.is_ltr() { + // Everything is LTR and at the same level, do nothing + return result; + } + + // Stop at the lowest *odd* level, since everything below that + // is LTR and does not need further reordering + min = min.new_lowest_ge_rtl().expect("Level error"); + + // For each max level, take all contiguous chunks of + // levels ≥ max and reverse them + // + // We can do this check with the original levels instead of checking reorderings because all + // prior reorderings will have been for contiguous chunks of levels >> max, which will + // be a subset of these chunks anyway. + while min <= max { + let mut range = 0..0; + loop { + range = next_range(levels, range.end, max); + result[range.clone()].reverse(); + + if range.end >= levels.len() { + break; + } + } + + max.lower(1).expect("Level error"); + } + + result +} + +/// The core of BidiInfo initialization, factored out into a function that both +/// the utf-8 and utf-16 versions of BidiInfo can use. +fn compute_bidi_info_for_para<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>( + data_source: &D, + para: &ParagraphInfo, + is_pure_ltr: bool, + text: &'a T, + original_classes: &[BidiClass], + processing_classes: &mut [BidiClass], + levels: &mut Vec, +) { + let new_len = levels.len() + para.range.len(); + levels.resize(new_len, para.level); + if para.level == LTR_LEVEL && is_pure_ltr { + return; + } + + let processing_classes = &mut processing_classes[para.range.clone()]; + let levels = &mut levels[para.range.clone()]; + + explicit::compute( + text, + para.level, + original_classes, + levels, + processing_classes, + ); + + let sequences = prepare::isolating_run_sequences(para.level, original_classes, levels); + for sequence in &sequences { + implicit::resolve_weak(text, sequence, processing_classes); + implicit::resolve_neutral( + text, + data_source, + sequence, + levels, + original_classes, + processing_classes, + ); + } + implicit::resolve_levels(processing_classes, levels); + + assign_levels_to_removed_chars(para.level, original_classes, levels); +} + +/// Produce the levels for this paragraph as needed for reordering, one level per *code unit* +/// in the paragraph. The returned vector includes code units that are not included +/// in the `line`, but will not adjust them. +/// +/// This runs [Rule L1] +/// +/// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 +fn reorder_levels<'a, T: TextSource<'a> + ?Sized>( + line_classes: &[BidiClass], + line_levels: &mut [Level], + line_text: &'a T, + para_level: Level, +) { + // Reset some whitespace chars to paragraph level. + // + let mut reset_from: Option = Some(0); + let mut reset_to: Option = None; + let mut prev_level = para_level; + for (i, c) in line_text.char_indices() { + match line_classes[i] { + // Segment separator, Paragraph separator + B | S => { + assert_eq!(reset_to, None); + reset_to = Some(i + T::char_len(c)); + if reset_from == None { + reset_from = Some(i); + } + } + // Whitespace, isolate formatting + WS | FSI | LRI | RLI | PDI => { + if reset_from == None { + reset_from = Some(i); + } + } + // + // same as above + set the level + RLE | LRE | RLO | LRO | PDF | BN => { + if reset_from == None { + reset_from = Some(i); + } + // also set the level to previous + line_levels[i] = prev_level; + } + _ => { + reset_from = None; + } + } + if let (Some(from), Some(to)) = (reset_from, reset_to) { + for level in &mut line_levels[from..to] { + *level = para_level; + } + reset_from = None; + reset_to = None; + } + prev_level = line_levels[i]; + } + if let Some(from) = reset_from { + for level in &mut line_levels[from..] { + *level = para_level; + } + } +} + /// Contains a reference of `BidiInfo` and one of its `paragraphs`. /// And it supports all operation in the `Paragraph` that needs also its /// `BidiInfo` such as `direction`. @@ -683,42 +1171,53 @@ pub struct Paragraph<'a, 'text> { } impl<'a, 'text> Paragraph<'a, 'text> { + #[inline] pub fn new(info: &'a BidiInfo<'text>, para: &'a ParagraphInfo) -> Paragraph<'a, 'text> { Paragraph { info, para } } /// Returns if the paragraph is Left direction, right direction or mixed. + #[inline] pub fn direction(&self) -> Direction { - let mut ltr = false; - let mut rtl = false; - for i in self.para.range.clone() { - if self.info.levels[i].is_ltr() { - ltr = true; - } - - if self.info.levels[i].is_rtl() { - rtl = true; - } - } - - if ltr && rtl { - return Direction::Mixed; - } - - if ltr { - return Direction::Ltr; - } - - Direction::Rtl + para_direction(&self.info.levels[self.para.range.clone()]) } /// Returns the `Level` of a certain character in the paragraph. + #[inline] pub fn level_at(&self, pos: usize) -> Level { let actual_position = self.para.range.start + pos; self.info.levels[actual_position] } } +/// Return the directionality of the paragraph (Left, Right or Mixed) from its levels. +#[cfg_attr(feature = "flame_it", flamer::flame)] +fn para_direction(levels: &[Level]) -> Direction { + let mut ltr = false; + let mut rtl = false; + for level in levels { + if level.is_ltr() { + ltr = true; + if rtl { + return Direction::Mixed; + } + } + + if level.is_rtl() { + rtl = true; + if ltr { + return Direction::Mixed; + } + } + } + + if ltr { + return Direction::Ltr; + } + + Direction::Rtl +} + /// Assign levels to characters removed by rule X9. /// /// The levels assigned to these characters are not specified by the algorithm. This function @@ -732,46 +1231,256 @@ fn assign_levels_to_removed_chars(para_level: Level, classes: &[BidiClass], leve } } +/// Get the base direction of the text provided according to the Unicode Bidirectional Algorithm. +/// +/// See rules P2 and P3. +/// +/// The base direction is derived from the first character in the string with bidi character type +/// L, R, or AL. If the first such character has type L, Direction::Ltr is returned. If the first +/// such character has type R or AL, Direction::Rtl is returned. +/// +/// If the string does not contain any character of these types (outside of embedded isolate runs), +/// then Direction::Mixed is returned (but should be considered as meaning "neutral" or "unknown", +/// not in fact mixed directions). +/// +/// This is a lightweight function for use when only the base direction is needed and no further +/// bidi processing of the text is needed. +/// +/// If the text contains paragraph separators, this function considers only the first paragraph. +#[cfg(feature = "hardcoded-data")] +#[inline] +pub fn get_base_direction<'a, T: TextSource<'a> + ?Sized>(text: &'a T) -> Direction { + get_base_direction_with_data_source(&HardcodedBidiData, text) +} + +/// Get the base direction of the text provided according to the Unicode Bidirectional Algorithm, +/// considering the full text if the first paragraph is all-neutral. +/// +/// This is the same as get_base_direction except that it does not stop at the first block +/// separator, but just resets the embedding level and continues to look for a strongly- +/// directional character. So the result will be the base direction of the first paragraph +/// that is not purely neutral characters. +#[cfg(feature = "hardcoded-data")] +#[inline] +pub fn get_base_direction_full<'a, T: TextSource<'a> + ?Sized>(text: &'a T) -> Direction { + get_base_direction_full_with_data_source(&HardcodedBidiData, text) +} + +#[inline] +pub fn get_base_direction_with_data_source<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>( + data_source: &D, + text: &'a T, +) -> Direction { + get_base_direction_impl(data_source, text, false) +} + +#[inline] +pub fn get_base_direction_full_with_data_source< + 'a, + D: BidiDataSource, + T: TextSource<'a> + ?Sized, +>( + data_source: &D, + text: &'a T, +) -> Direction { + get_base_direction_impl(data_source, text, true) +} + +fn get_base_direction_impl<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>( + data_source: &D, + text: &'a T, + use_full_text: bool, +) -> Direction { + let mut isolate_level = 0; + for c in text.chars() { + match data_source.bidi_class(c) { + LRI | RLI | FSI => isolate_level = isolate_level + 1, + PDI if isolate_level > 0 => isolate_level = isolate_level - 1, + L if isolate_level == 0 => return Direction::Ltr, + R | AL if isolate_level == 0 => return Direction::Rtl, + B if !use_full_text => break, + B if use_full_text => isolate_level = 0, + _ => (), + } + } + // If no strong char was found, return Mixed. Normally this will be treated as Ltr by callers + // (see rule P3), but we don't map this to Ltr here so that a caller that wants to apply other + // heuristics to an all-neutral paragraph can tell the difference. + Direction::Mixed +} + +/// Implementation of TextSource for UTF-8 text (a string slice). +impl<'text> TextSource<'text> for str { + type CharIter = core::str::Chars<'text>; + type CharIndexIter = core::str::CharIndices<'text>; + type IndexLenIter = Utf8IndexLenIter<'text>; + + #[inline] + fn len(&self) -> usize { + (self as &str).len() + } + #[inline] + fn char_at(&self, index: usize) -> Option<(char, usize)> { + if let Some(slice) = self.get(index..) { + if let Some(ch) = slice.chars().next() { + return Some((ch, ch.len_utf8())); + } + } + None + } + #[inline] + fn subrange(&self, range: Range) -> &Self { + &(self as &str)[range] + } + #[inline] + fn chars(&'text self) -> Self::CharIter { + (self as &str).chars() + } + #[inline] + fn char_indices(&'text self) -> Self::CharIndexIter { + (self as &str).char_indices() + } + #[inline] + fn indices_lengths(&'text self) -> Self::IndexLenIter { + Utf8IndexLenIter::new(&self) + } + #[inline] + fn char_len(ch: char) -> usize { + ch.len_utf8() + } +} + +/// Iterator over (UTF-8) string slices returning (index, char_len) tuple. +#[derive(Debug)] +pub struct Utf8IndexLenIter<'text> { + iter: CharIndices<'text>, +} + +impl<'text> Utf8IndexLenIter<'text> { + #[inline] + pub fn new(text: &'text str) -> Self { + Utf8IndexLenIter { + iter: text.char_indices(), + } + } +} + +impl Iterator for Utf8IndexLenIter<'_> { + type Item = (usize, usize); + + #[inline] + fn next(&mut self) -> Option { + if let Some((pos, ch)) = self.iter.next() { + return Some((pos, ch.len_utf8())); + } + None + } +} + +#[cfg(test)] +fn to_utf16(s: &str) -> Vec { + s.encode_utf16().collect() +} + #[cfg(test)] #[cfg(feature = "hardcoded-data")] mod tests { use super::*; + use utf16::{ + BidiInfo as BidiInfoU16, InitialInfo as InitialInfoU16, Paragraph as ParagraphU16, + ParagraphBidiInfo as ParagraphBidiInfoU16, + }; + + #[test] + fn test_utf16_text_source() { + let text: &[u16] = + &[0x41, 0xD801, 0xDC01, 0x20, 0xD800, 0x20, 0xDFFF, 0x20, 0xDC00, 0xD800]; + assert_eq!(text.char_at(0), Some(('A', 1))); + assert_eq!(text.char_at(1), Some(('\u{10401}', 2))); + assert_eq!(text.char_at(2), None); + assert_eq!(text.char_at(3), Some((' ', 1))); + assert_eq!(text.char_at(4), Some((char::REPLACEMENT_CHARACTER, 1))); + assert_eq!(text.char_at(5), Some((' ', 1))); + assert_eq!(text.char_at(6), Some((char::REPLACEMENT_CHARACTER, 1))); + assert_eq!(text.char_at(7), Some((' ', 1))); + assert_eq!(text.char_at(8), Some((char::REPLACEMENT_CHARACTER, 1))); + assert_eq!(text.char_at(9), Some((char::REPLACEMENT_CHARACTER, 1))); + assert_eq!(text.char_at(10), None); + } + + #[test] + fn test_utf16_char_iter() { + let text: &[u16] = + &[0x41, 0xD801, 0xDC01, 0x20, 0xD800, 0x20, 0xDFFF, 0x20, 0xDC00, 0xD800]; + assert_eq!(text.len(), 10); + assert_eq!(text.chars().count(), 9); + let mut chars = text.chars(); + assert_eq!(chars.next(), Some('A')); + assert_eq!(chars.next(), Some('\u{10401}')); + assert_eq!(chars.next(), Some(' ')); + assert_eq!(chars.next(), Some('\u{FFFD}')); + assert_eq!(chars.next(), Some(' ')); + assert_eq!(chars.next(), Some('\u{FFFD}')); + assert_eq!(chars.next(), Some(' ')); + assert_eq!(chars.next(), Some('\u{FFFD}')); + assert_eq!(chars.next(), Some('\u{FFFD}')); + assert_eq!(chars.next(), None); + } + #[test] fn test_initial_text_info() { - let text = "a1"; - assert_eq!( - InitialInfo::new(text, None), - InitialInfo { - text, - original_classes: vec![L, EN], - paragraphs: vec![ParagraphInfo { + let tests = vec![ + ( + // text + "a1", + // expected bidi classes per utf-8 byte + vec![L, EN], + // expected paragraph-info for utf-8 + vec![ParagraphInfo { range: 0..2, level: LTR_LEVEL, - },], - } - ); - - let text = "غ א"; - assert_eq!( - InitialInfo::new(text, None), - InitialInfo { - text, - original_classes: vec![AL, AL, WS, R, R], - paragraphs: vec![ParagraphInfo { + }], + // expected bidi classes per utf-16 code unit + vec![L, EN], + // expected paragraph-info for utf-16 + vec![ParagraphInfo { + range: 0..2, + level: LTR_LEVEL, + }], + ), + ( + // Arabic, space, Hebrew + "\u{0639} \u{05D0}", + vec![AL, AL, WS, R, R], + vec![ParagraphInfo { range: 0..5, level: RTL_LEVEL, - },], - } - ); - - let text = "a\u{2029}b"; - assert_eq!( - InitialInfo::new(text, None), - InitialInfo { - text, - original_classes: vec![L, B, B, B, L], - paragraphs: vec![ + }], + vec![AL, WS, R], + vec![ParagraphInfo { + range: 0..3, + level: RTL_LEVEL, + }], + ), + ( + // SMP characters from Kharoshthi, Cuneiform, Adlam: + "\u{10A00}\u{12000}\u{1E900}", + vec![R, R, R, R, L, L, L, L, R, R, R, R], + vec![ParagraphInfo { + range: 0..12, + level: RTL_LEVEL, + }], + vec![R, R, L, L, R, R], + vec![ParagraphInfo { + range: 0..6, + level: RTL_LEVEL, + }], + ), + ( + "a\u{2029}b", + vec![L, B, B, B, L], + vec![ ParagraphInfo { range: 0..4, level: LTR_LEVEL, @@ -781,114 +1490,168 @@ mod tests { level: LTR_LEVEL, }, ], - } - ); - - let text = format!("{}א{}a", chars::FSI, chars::PDI); - assert_eq!( - InitialInfo::new(&text, None), - InitialInfo { - text: &text, - original_classes: vec![RLI, RLI, RLI, R, R, PDI, PDI, PDI, L], - paragraphs: vec![ParagraphInfo { + vec![L, B, L], + vec![ + ParagraphInfo { + range: 0..2, + level: LTR_LEVEL, + }, + ParagraphInfo { + range: 2..3, + level: LTR_LEVEL, + }, + ], + ), + ( + "\u{2068}א\u{2069}a", // U+2068 FSI, U+2069 PDI + vec![RLI, RLI, RLI, R, R, PDI, PDI, PDI, L], + vec![ParagraphInfo { range: 0..9, level: LTR_LEVEL, - },], - } - ); + }], + vec![RLI, R, PDI, L], + vec![ParagraphInfo { + range: 0..4, + level: LTR_LEVEL, + }], + ), + ]; + + for t in tests { + assert_eq!( + InitialInfo::new(t.0, None), + InitialInfo { + text: t.0, + original_classes: t.1, + paragraphs: t.2, + } + ); + let text = &to_utf16(t.0); + assert_eq!( + InitialInfoU16::new(text, None), + InitialInfoU16 { + text, + original_classes: t.3, + paragraphs: t.4, + } + ); + } } #[test] #[cfg(feature = "hardcoded-data")] fn test_process_text() { - let text = "abc123"; - assert_eq!( - BidiInfo::new(text, Some(LTR_LEVEL)), - BidiInfo { - text, - levels: Level::vec(&[0, 0, 0, 0, 0, 0]), - original_classes: vec![L, L, L, EN, EN, EN], - paragraphs: vec![ParagraphInfo { + let tests = vec![ + ( + // text + "abc123", + // base level + Some(LTR_LEVEL), + // levels + Level::vec(&[0, 0, 0, 0, 0, 0]), + // original_classes + vec![L, L, L, EN, EN, EN], + // paragraphs + vec![ParagraphInfo { range: 0..6, level: LTR_LEVEL, - },], - } - ); - - let text = "abc אבג"; - assert_eq!( - BidiInfo::new(text, Some(LTR_LEVEL)), - BidiInfo { - text, - levels: Level::vec(&[0, 0, 0, 0, 1, 1, 1, 1, 1, 1]), - original_classes: vec![L, L, L, WS, R, R, R, R, R, R], - paragraphs: vec![ParagraphInfo { + }], + // levels_u16 + Level::vec(&[0, 0, 0, 0, 0, 0]), + // original_classes_u16 + vec![L, L, L, EN, EN, EN], + // paragraphs_u16 + vec![ParagraphInfo { + range: 0..6, + level: LTR_LEVEL, + }], + ), + ( + "abc \u{05D0}\u{05D1}\u{05D2}", + Some(LTR_LEVEL), + Level::vec(&[0, 0, 0, 0, 1, 1, 1, 1, 1, 1]), + vec![L, L, L, WS, R, R, R, R, R, R], + vec![ParagraphInfo { range: 0..10, level: LTR_LEVEL, - },], - } - ); - assert_eq!( - BidiInfo::new(text, Some(RTL_LEVEL)), - BidiInfo { - text, - levels: Level::vec(&[2, 2, 2, 1, 1, 1, 1, 1, 1, 1]), - original_classes: vec![L, L, L, WS, R, R, R, R, R, R], - paragraphs: vec![ParagraphInfo { + }], + Level::vec(&[0, 0, 0, 0, 1, 1, 1]), + vec![L, L, L, WS, R, R, R], + vec![ParagraphInfo { + range: 0..7, + level: LTR_LEVEL, + }], + ), + ( + "abc \u{05D0}\u{05D1}\u{05D2}", + Some(RTL_LEVEL), + Level::vec(&[2, 2, 2, 1, 1, 1, 1, 1, 1, 1]), + vec![L, L, L, WS, R, R, R, R, R, R], + vec![ParagraphInfo { range: 0..10, level: RTL_LEVEL, - },], - } - ); - - let text = "אבג abc"; - assert_eq!( - BidiInfo::new(text, Some(LTR_LEVEL)), - BidiInfo { - text, - levels: Level::vec(&[1, 1, 1, 1, 1, 1, 0, 0, 0, 0]), - original_classes: vec![R, R, R, R, R, R, WS, L, L, L], - paragraphs: vec![ParagraphInfo { + }], + Level::vec(&[2, 2, 2, 1, 1, 1, 1]), + vec![L, L, L, WS, R, R, R], + vec![ParagraphInfo { + range: 0..7, + level: RTL_LEVEL, + }], + ), + ( + "\u{05D0}\u{05D1}\u{05D2} abc", + Some(LTR_LEVEL), + Level::vec(&[1, 1, 1, 1, 1, 1, 0, 0, 0, 0]), + vec![R, R, R, R, R, R, WS, L, L, L], + vec![ParagraphInfo { range: 0..10, level: LTR_LEVEL, - },], - } - ); - assert_eq!( - BidiInfo::new(text, None), - BidiInfo { - text, - levels: Level::vec(&[1, 1, 1, 1, 1, 1, 1, 2, 2, 2]), - original_classes: vec![R, R, R, R, R, R, WS, L, L, L], - paragraphs: vec![ParagraphInfo { + }], + Level::vec(&[1, 1, 1, 0, 0, 0, 0]), + vec![R, R, R, WS, L, L, L], + vec![ParagraphInfo { + range: 0..7, + level: LTR_LEVEL, + }], + ), + ( + "\u{05D0}\u{05D1}\u{05D2} abc", + None, + Level::vec(&[1, 1, 1, 1, 1, 1, 1, 2, 2, 2]), + vec![R, R, R, R, R, R, WS, L, L, L], + vec![ParagraphInfo { range: 0..10, level: RTL_LEVEL, - },], - } - ); - - let text = "غ2ظ א2ג"; - assert_eq!( - BidiInfo::new(text, Some(LTR_LEVEL)), - BidiInfo { - text, - levels: Level::vec(&[1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1]), - original_classes: vec![AL, AL, EN, AL, AL, WS, R, R, EN, R, R], - paragraphs: vec![ParagraphInfo { + }], + Level::vec(&[1, 1, 1, 1, 2, 2, 2]), + vec![R, R, R, WS, L, L, L], + vec![ParagraphInfo { + range: 0..7, + level: RTL_LEVEL, + }], + ), + ( + "\u{063A}2\u{0638} \u{05D0}2\u{05D2}", + Some(LTR_LEVEL), + Level::vec(&[1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1]), + vec![AL, AL, EN, AL, AL, WS, R, R, EN, R, R], + vec![ParagraphInfo { range: 0..11, level: LTR_LEVEL, - },], - } - ); - - let text = "a א.\nג"; - assert_eq!( - BidiInfo::new(text, None), - BidiInfo { - text, - original_classes: vec![L, WS, R, R, CS, B, R, R], - levels: Level::vec(&[0, 0, 1, 1, 0, 0, 1, 1]), - paragraphs: vec![ + }], + Level::vec(&[1, 2, 1, 1, 1, 2, 1]), + vec![AL, EN, AL, WS, R, EN, R], + vec![ParagraphInfo { + range: 0..7, + level: LTR_LEVEL, + }], + ), + ( + "a א.\nג", + None, + Level::vec(&[0, 0, 1, 1, 0, 0, 1, 1]), + vec![L, WS, R, R, CS, B, R, R], + vec![ ParagraphInfo { range: 0..6, level: LTR_LEVEL, @@ -898,37 +1661,201 @@ mod tests { level: RTL_LEVEL, }, ], - } - ); + Level::vec(&[0, 0, 1, 0, 0, 1]), + vec![L, WS, R, CS, B, R], + vec![ + ParagraphInfo { + range: 0..5, + level: LTR_LEVEL, + }, + ParagraphInfo { + range: 5..6, + level: RTL_LEVEL, + }, + ], + ), + // BidiTest:69635 (AL ET EN) + ( + "\u{060B}\u{20CF}\u{06F9}", + None, + Level::vec(&[1, 1, 1, 1, 1, 2, 2]), + vec![AL, AL, ET, ET, ET, EN, EN], + vec![ParagraphInfo { + range: 0..7, + level: RTL_LEVEL, + }], + Level::vec(&[1, 1, 2]), + vec![AL, ET, EN], + vec![ParagraphInfo { + range: 0..3, + level: RTL_LEVEL, + }], + ), + ]; - // BidiTest:69635 (AL ET EN) - let bidi_info = BidiInfo::new("\u{060B}\u{20CF}\u{06F9}", None); - assert_eq!(bidi_info.original_classes, vec![AL, AL, ET, ET, ET, EN, EN]); + for t in tests { + assert_eq!( + BidiInfo::new(t.0, t.1), + BidiInfo { + text: t.0, + levels: t.2.clone(), + original_classes: t.3.clone(), + paragraphs: t.4.clone(), + } + ); + // If it was a single paragraph, also test ParagraphBidiInfo. + if t.4.len() == 1 { + assert_eq!( + ParagraphBidiInfo::new(t.0, t.1), + ParagraphBidiInfo { + text: t.0, + original_classes: t.3, + levels: t.2.clone(), + paragraph_level: t.4[0].level, + is_pure_ltr: !level::has_rtl(&t.2), + } + ) + } + let text = &to_utf16(t.0); + assert_eq!( + BidiInfoU16::new(text, t.1), + BidiInfoU16 { + text, + levels: t.5.clone(), + original_classes: t.6.clone(), + paragraphs: t.7.clone(), + } + ); + if t.7.len() == 1 { + assert_eq!( + ParagraphBidiInfoU16::new(text, t.1), + ParagraphBidiInfoU16 { + text: text, + original_classes: t.6.clone(), + levels: t.5.clone(), + paragraph_level: t.7[0].level, + is_pure_ltr: !level::has_rtl(&t.5), + } + ) + } + } + } + + #[test] + #[cfg(feature = "hardcoded-data")] + fn test_paragraph_bidi_info() { + // Passing text that includes a paragraph break to the ParagraphBidiInfo API: + // this is a misuse of the API by the client, but our behavior is safe & + // consistent. The embedded paragraph break acts like a separator (tab) would. + let tests = vec![ + ( + "a א.\nג", + None, + // utf-8 results: + vec![L, WS, R, R, CS, B, R, R], + Level::vec(&[0, 0, 1, 1, 1, 1, 1, 1]), + // utf-16 results: + vec![L, WS, R, CS, B, R], + Level::vec(&[0, 0, 1, 1, 1, 1]), + // paragraph level; is_pure_ltr + LTR_LEVEL, + false, + ), + ( + "\u{5d1} a.\nb.", + None, + // utf-8 results: + vec![R, R, WS, L, CS, B, L, CS], + Level::vec(&[1, 1, 1, 2, 2, 2, 2, 1]), + // utf-16 results: + vec![R, WS, L, CS, B, L, CS], + Level::vec(&[1, 1, 2, 2, 2, 2, 1]), + // paragraph level; is_pure_ltr + RTL_LEVEL, + false, + ), + ( + "a א.\tג", + None, + // utf-8 results: + vec![L, WS, R, R, CS, S, R, R], + Level::vec(&[0, 0, 1, 1, 1, 1, 1, 1]), + // utf-16 results: + vec![L, WS, R, CS, S, R], + Level::vec(&[0, 0, 1, 1, 1, 1]), + // paragraph level; is_pure_ltr + LTR_LEVEL, + false, + ), + ( + "\u{5d1} a.\tb.", + None, + // utf-8 results: + vec![R, R, WS, L, CS, S, L, CS], + Level::vec(&[1, 1, 1, 2, 2, 2, 2, 1]), + // utf-16 results: + vec![R, WS, L, CS, S, L, CS], + Level::vec(&[1, 1, 2, 2, 2, 2, 1]), + // paragraph level; is_pure_ltr + RTL_LEVEL, + false, + ), + ]; + + for t in tests { + assert_eq!( + ParagraphBidiInfo::new(t.0, t.1), + ParagraphBidiInfo { + text: t.0, + original_classes: t.2, + levels: t.3, + paragraph_level: t.6, + is_pure_ltr: t.7, + } + ); + let text = &to_utf16(t.0); + assert_eq!( + ParagraphBidiInfoU16::new(text, t.1), + ParagraphBidiInfoU16 { + text: text, + original_classes: t.4, + levels: t.5, + paragraph_level: t.6, + is_pure_ltr: t.7, + } + ); + } } #[test] #[cfg(feature = "hardcoded-data")] fn test_bidi_info_has_rtl() { - // ASCII only - assert_eq!(BidiInfo::new("123", None).has_rtl(), false); - assert_eq!(BidiInfo::new("123", Some(LTR_LEVEL)).has_rtl(), false); - assert_eq!(BidiInfo::new("123", Some(RTL_LEVEL)).has_rtl(), false); - assert_eq!(BidiInfo::new("abc", None).has_rtl(), false); - assert_eq!(BidiInfo::new("abc", Some(LTR_LEVEL)).has_rtl(), false); - assert_eq!(BidiInfo::new("abc", Some(RTL_LEVEL)).has_rtl(), false); - assert_eq!(BidiInfo::new("abc 123", None).has_rtl(), false); - assert_eq!(BidiInfo::new("abc\n123", None).has_rtl(), false); + let tests = vec![ + // ASCII only + ("123", None, false), + ("123", Some(LTR_LEVEL), false), + ("123", Some(RTL_LEVEL), false), + ("abc", None, false), + ("abc", Some(LTR_LEVEL), false), + ("abc", Some(RTL_LEVEL), false), + ("abc 123", None, false), + ("abc\n123", None, false), + // With Hebrew + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2}", None, true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2}", Some(LTR_LEVEL), true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2}", Some(RTL_LEVEL), true), + ("abc \u{05D0}\u{05D1}\u{05BC}\u{05D2}", None, true), + ("abc\n\u{05D0}\u{05D1}\u{05BC}\u{05D2}", None, true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2} abc", None, true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2}\nabc", None, true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2} 123", None, true), + ("\u{05D0}\u{05D1}\u{05BC}\u{05D2}\n123", None, true), + ]; - // With Hebrew - assert_eq!(BidiInfo::new("אבּג", None).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג", Some(LTR_LEVEL)).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג", Some(RTL_LEVEL)).has_rtl(), true); - assert_eq!(BidiInfo::new("abc אבּג", None).has_rtl(), true); - assert_eq!(BidiInfo::new("abc\nאבּג", None).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג abc", None).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג\nabc", None).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג 123", None).has_rtl(), true); - assert_eq!(BidiInfo::new("אבּג\n123", None).has_rtl(), true); + for t in tests { + assert_eq!(BidiInfo::new(t.0, t.1).has_rtl(), t.2); + assert_eq!(BidiInfoU16::new(&to_utf16(t.0), t.1).has_rtl(), t.2); + } } #[cfg(feature = "hardcoded-data")] @@ -941,76 +1868,70 @@ mod tests { .collect() } + #[cfg(feature = "hardcoded-data")] + fn reorder_paras_u16(text: &[u16]) -> Vec> { + let bidi_info = BidiInfoU16::new(text, None); + bidi_info + .paragraphs + .iter() + .map(|para| bidi_info.reorder_line(para, para.range.clone())) + .collect() + } + #[test] #[cfg(feature = "hardcoded-data")] fn test_reorder_line() { - // Bidi_Class: L L L B L L L B L L L - assert_eq!( - reorder_paras("abc\ndef\nghi"), - vec!["abc\n", "def\n", "ghi"] - ); + let tests = vec![ + // Bidi_Class: L L L B L L L B L L L + ("abc\ndef\nghi", vec!["abc\n", "def\n", "ghi"]), + // Bidi_Class: L L EN B L L EN B L L EN + ("ab1\nde2\ngh3", vec!["ab1\n", "de2\n", "gh3"]), + // Bidi_Class: L L L B AL AL AL + ("abc\nابج", vec!["abc\n", "جبا"]), + // Bidi_Class: AL AL AL B L L L + ( + "\u{0627}\u{0628}\u{062C}\nabc", + vec!["\n\u{062C}\u{0628}\u{0627}", "abc"], + ), + ("1.-2", vec!["1.-2"]), + ("1-.2", vec!["1-.2"]), + ("abc אבג", vec!["abc גבא"]), + // Numbers being weak LTR characters, cannot reorder strong RTL + ("123 \u{05D0}\u{05D1}\u{05D2}", vec!["גבא 123"]), + ("abc\u{202A}def", vec!["abc\u{202A}def"]), + ( + "abc\u{202A}def\u{202C}ghi", + vec!["abc\u{202A}def\u{202C}ghi"], + ), + ( + "abc\u{2066}def\u{2069}ghi", + vec!["abc\u{2066}def\u{2069}ghi"], + ), + // Testing for RLE Character + ("\u{202B}abc אבג\u{202C}", vec!["\u{202b}גבא abc\u{202c}"]), + // Testing neutral characters + ("\u{05D0}בג? אבג", vec!["גבא ?גבא"]), + // Testing neutral characters with special case + ("A אבג?", vec!["A גבא?"]), + // Testing neutral characters with Implicit RTL Marker + ("A אבג?\u{200F}", vec!["A \u{200F}?גבא"]), + ("\u{05D0}בג abc", vec!["abc גבא"]), + ("abc\u{2067}.-\u{2069}ghi", vec!["abc\u{2067}-.\u{2069}ghi"]), + ( + "Hello, \u{2068}\u{202E}world\u{202C}\u{2069}!", + vec!["Hello, \u{2068}\u{202E}\u{202C}dlrow\u{2069}!"], + ), + // With mirrorable characters in RTL run + ("\u{05D0}(ב)ג.", vec![".ג)ב(א"]), + // With mirrorable characters on level boundary + ("\u{05D0}ב(גד[&ef].)gh", vec!["gh).]ef&[דג(בא"]), + ]; - // Bidi_Class: L L EN B L L EN B L L EN - assert_eq!( - reorder_paras("ab1\nde2\ngh3"), - vec!["ab1\n", "de2\n", "gh3"] - ); - - // Bidi_Class: L L L B AL AL AL - assert_eq!(reorder_paras("abc\nابج"), vec!["abc\n", "جبا"]); - - // Bidi_Class: AL AL AL B L L L - assert_eq!(reorder_paras("ابج\nabc"), vec!["\nجبا", "abc"]); - - assert_eq!(reorder_paras("1.-2"), vec!["1.-2"]); - assert_eq!(reorder_paras("1-.2"), vec!["1-.2"]); - assert_eq!(reorder_paras("abc אבג"), vec!["abc גבא"]); - - // Numbers being weak LTR characters, cannot reorder strong RTL - assert_eq!(reorder_paras("123 אבג"), vec!["גבא 123"]); - - assert_eq!(reorder_paras("abc\u{202A}def"), vec!["abc\u{202A}def"]); - - assert_eq!( - reorder_paras("abc\u{202A}def\u{202C}ghi"), - vec!["abc\u{202A}def\u{202C}ghi"] - ); - - assert_eq!( - reorder_paras("abc\u{2066}def\u{2069}ghi"), - vec!["abc\u{2066}def\u{2069}ghi"] - ); - - // Testing for RLE Character - assert_eq!( - reorder_paras("\u{202B}abc אבג\u{202C}"), - vec!["\u{202B}\u{202C}גבא abc"] - ); - - // Testing neutral characters - assert_eq!(reorder_paras("אבג? אבג"), vec!["גבא ?גבא"]); - - // Testing neutral characters with special case - assert_eq!(reorder_paras("A אבג?"), vec!["A גבא?"]); - - // Testing neutral characters with Implicit RTL Marker - assert_eq!(reorder_paras("A אבג?\u{200F}"), vec!["A \u{200F}?גבא"]); - assert_eq!(reorder_paras("אבג abc"), vec!["abc גבא"]); - assert_eq!( - reorder_paras("abc\u{2067}.-\u{2069}ghi"), - vec!["abc\u{2067}-.\u{2069}ghi"] - ); - - assert_eq!( - reorder_paras("Hello, \u{2068}\u{202E}world\u{202C}\u{2069}!"), - vec!["Hello, \u{2068}\u{202E}\u{202C}dlrow\u{2069}!"] - ); - - // With mirrorable characters in RTL run - assert_eq!(reorder_paras("א(ב)ג."), vec![".ג)ב(א"]); - - // With mirrorable characters on level boundry - assert_eq!(reorder_paras("אב(גד[&ef].)gh"), vec!["gh).]ef&[דג(בא"]); + for t in tests { + assert_eq!(reorder_paras(t.0), t.1); + let expect_utf16 = t.1.iter().map(|v| to_utf16(v)).collect::>(); + assert_eq!(reorder_paras_u16(&to_utf16(t.0)), expect_utf16); + } } fn reordered_levels_for_paras(text: &str) -> Vec> { @@ -1031,47 +1952,83 @@ mod tests { .collect() } + fn reordered_levels_for_paras_u16(text: &[u16]) -> Vec> { + let bidi_info = BidiInfoU16::new(text, None); + bidi_info + .paragraphs + .iter() + .map(|para| bidi_info.reordered_levels(para, para.range.clone())) + .collect() + } + + fn reordered_levels_per_char_for_paras_u16(text: &[u16]) -> Vec> { + let bidi_info = BidiInfoU16::new(text, None); + bidi_info + .paragraphs + .iter() + .map(|para| bidi_info.reordered_levels_per_char(para, para.range.clone())) + .collect() + } + #[test] #[cfg(feature = "hardcoded-data")] fn test_reordered_levels() { - // BidiTest:946 (LRI PDI) - let text = "\u{2067}\u{2069}"; - assert_eq!( - reordered_levels_for_paras(text), - vec![Level::vec(&[0, 0, 0, 0, 0, 0])] - ); - assert_eq!( - reordered_levels_per_char_for_paras(text), - vec![Level::vec(&[0, 0])] - ); + let tests = vec![ + // BidiTest:946 (LRI PDI) + ( + "\u{2067}\u{2069}", + vec![Level::vec(&[0, 0, 0, 0, 0, 0])], + vec![Level::vec(&[0, 0])], + vec![Level::vec(&[0, 0])], + ), + // BidiTest:69635 (AL ET EN) + ( + "\u{060B}\u{20CF}\u{06F9}", + vec![Level::vec(&[1, 1, 1, 1, 1, 2, 2])], + vec![Level::vec(&[1, 1, 2])], + vec![Level::vec(&[1, 1, 2])], + ), + ]; + + for t in tests { + assert_eq!(reordered_levels_for_paras(t.0), t.1); + assert_eq!(reordered_levels_per_char_for_paras(t.0), t.2); + let text = &to_utf16(t.0); + assert_eq!(reordered_levels_for_paras_u16(text), t.3); + assert_eq!(reordered_levels_per_char_for_paras_u16(text), t.2); + } + + let tests = vec![ + // BidiTest:291284 (AN RLI PDF R) + ( + "\u{0605}\u{2067}\u{202C}\u{0590}", + vec![&["2", "2", "0", "0", "0", "x", "x", "x", "1", "1"]], + vec![&["2", "0", "x", "1"]], + vec![&["2", "0", "x", "1"]], + ), + ]; + + for t in tests { + assert_eq!(reordered_levels_for_paras(t.0), t.1); + assert_eq!(reordered_levels_per_char_for_paras(t.0), t.2); + let text = &to_utf16(t.0); + assert_eq!(reordered_levels_for_paras_u16(text), t.3); + assert_eq!(reordered_levels_per_char_for_paras_u16(text), t.2); + } let text = "aa טֶ"; let bidi_info = BidiInfo::new(text, None); assert_eq!( bidi_info.reordered_levels(&bidi_info.paragraphs[0], 3..7), Level::vec(&[0, 0, 0, 1, 1, 1, 1]), - ) + ); - /* TODO - /// BidiTest:69635 (AL ET EN) - let text = "\u{060B}\u{20CF}\u{06F9}"; + let text = &to_utf16(text); + let bidi_info = BidiInfoU16::new(text, None); assert_eq!( - reordered_levels_for_paras(text), - vec![Level::vec(&[1, 1, 1, 1, 1, 2, 2])] + bidi_info.reordered_levels(&bidi_info.paragraphs[0], 1..4), + Level::vec(&[0, 0, 0, 1, 1]), ); - assert_eq!( - reordered_levels_per_char_for_paras(text), - vec![Level::vec(&[1, 1, 2])] - ); - */ - - /* TODO - // BidiTest:291284 (AN RLI PDF R) - assert_eq!( - reordered_levels_per_char_for_paras("\u{0605}\u{2067}\u{202C}\u{0590}"), - vec![&["2", "0", "x", "1"]] - ); - */ } #[test] @@ -1091,6 +2048,19 @@ mod tests { // should not be part of any paragraph. assert_eq!(bidi_info.paragraphs[0].len(), text.len() + 1); assert_eq!(bidi_info.paragraphs[1].len(), text2.len()); + + let text = &to_utf16(text); + let bidi_info = BidiInfoU16::new(text, None); + assert_eq!(bidi_info.paragraphs.len(), 1); + assert_eq!(bidi_info.paragraphs[0].len(), text.len()); + + let text2 = &to_utf16(text2); + let whole_text = &to_utf16(&whole_text); + let bidi_info = BidiInfoU16::new(&whole_text, None); + assert_eq!(bidi_info.paragraphs.len(), 2); + + assert_eq!(bidi_info.paragraphs[0].len(), text.len() + 1); + assert_eq!(bidi_info.paragraphs[1].len(), text2.len()); } #[test] @@ -1106,6 +2076,16 @@ mod tests { assert_eq!(p_ltr.direction(), Direction::Ltr); assert_eq!(p_rtl.direction(), Direction::Rtl); assert_eq!(p_mixed.direction(), Direction::Mixed); + + let all_paragraphs = &to_utf16(&all_paragraphs); + let bidi_info = BidiInfoU16::new(&all_paragraphs, None); + assert_eq!(bidi_info.paragraphs.len(), 3); + let p_ltr = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[0]); + let p_rtl = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[1]); + let p_mixed = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[2]); + assert_eq!(p_ltr.direction(), Direction::Ltr); + assert_eq!(p_rtl.direction(), Direction::Rtl); + assert_eq!(p_mixed.direction(), Direction::Mixed); } #[test] @@ -1114,28 +2094,33 @@ mod tests { let empty = ""; let bidi_info = BidiInfo::new(empty, Option::from(RTL_LEVEL)); assert_eq!(bidi_info.paragraphs.len(), 0); - // The paragraph separator will take the value of the default direction - // which is left to right. - let empty = "\n"; - let bidi_info = BidiInfo::new(empty, None); - assert_eq!(bidi_info.paragraphs.len(), 1); - let p = Paragraph::new(&bidi_info, &bidi_info.paragraphs[0]); - assert_eq!(p.direction(), Direction::Ltr); - // The paragraph separator will take the value of the given initial direction - // which is left to right. - let empty = "\n"; - let bidi_info = BidiInfo::new(empty, Option::from(LTR_LEVEL)); - assert_eq!(bidi_info.paragraphs.len(), 1); - let p = Paragraph::new(&bidi_info, &bidi_info.paragraphs[0]); - assert_eq!(p.direction(), Direction::Ltr); - // The paragraph separator will take the value of the given initial direction - // which is right to left. - let empty = "\n"; - let bidi_info = BidiInfo::new(empty, Option::from(RTL_LEVEL)); - assert_eq!(bidi_info.paragraphs.len(), 1); - let p = Paragraph::new(&bidi_info, &bidi_info.paragraphs[0]); - assert_eq!(p.direction(), Direction::Rtl); + let empty = &to_utf16(empty); + let bidi_info = BidiInfoU16::new(empty, Option::from(RTL_LEVEL)); + assert_eq!(bidi_info.paragraphs.len(), 0); + + let tests = vec![ + // The paragraph separator will take the value of the default direction + // which is left to right. + ("\n", None, Direction::Ltr), + // The paragraph separator will take the value of the given initial direction + // which is left to right. + ("\n", Option::from(LTR_LEVEL), Direction::Ltr), + // The paragraph separator will take the value of the given initial direction + // which is right to left. + ("\n", Option::from(RTL_LEVEL), Direction::Rtl), + ]; + + for t in tests { + let bidi_info = BidiInfo::new(t.0, t.1); + assert_eq!(bidi_info.paragraphs.len(), 1); + let p = Paragraph::new(&bidi_info, &bidi_info.paragraphs[0]); + assert_eq!(p.direction(), t.2); + let text = &to_utf16(t.0); + let bidi_info = BidiInfoU16::new(text, t.1); + let p = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[0]); + assert_eq!(p.direction(), t.2); + } } #[test] @@ -1156,6 +2141,61 @@ mod tests { assert_eq!(p_mixed.info.levels.len(), 54); assert_eq!(p_mixed.para.range.start, 28); assert_eq!(p_mixed.level_at(ltr_text.len()), RTL_LEVEL); + + let all_paragraphs = &to_utf16(&all_paragraphs); + let bidi_info = BidiInfoU16::new(&all_paragraphs, None); + assert_eq!(bidi_info.paragraphs.len(), 3); + + let p_ltr = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[0]); + let p_rtl = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[1]); + let p_mixed = ParagraphU16::new(&bidi_info, &bidi_info.paragraphs[2]); + + assert_eq!(p_ltr.level_at(0), LTR_LEVEL); + assert_eq!(p_rtl.level_at(0), RTL_LEVEL); + assert_eq!(p_mixed.level_at(0), LTR_LEVEL); + assert_eq!(p_mixed.info.levels.len(), 40); + assert_eq!(p_mixed.para.range.start, 21); + assert_eq!(p_mixed.level_at(ltr_text.len()), RTL_LEVEL); + } + + #[test] + fn test_get_base_direction() { + let tests = vec![ + ("", Direction::Mixed), // return Mixed if no strong character found + ("123[]-+\u{2019}\u{2060}\u{00bf}?", Direction::Mixed), + ("3.14\npi", Direction::Mixed), // only first paragraph is considered + ("[123 'abc']", Direction::Ltr), + ("[123 '\u{0628}' abc", Direction::Rtl), + ("[123 '\u{2066}abc\u{2069}'\u{0628}]", Direction::Rtl), // embedded isolate is ignored + ("[123 '\u{2066}abc\u{2068}'\u{0628}]", Direction::Mixed), + ]; + + for t in tests { + assert_eq!(get_base_direction(t.0), t.1); + let text = &to_utf16(t.0); + assert_eq!(get_base_direction(text.as_slice()), t.1); + } + } + + #[test] + fn test_get_base_direction_full() { + let tests = vec![ + ("", Direction::Mixed), // return Mixed if no strong character found + ("123[]-+\u{2019}\u{2060}\u{00bf}?", Direction::Mixed), + ("3.14\npi", Direction::Ltr), // direction taken from the second paragraph + ("3.14\n\u{05D0}", Direction::Rtl), // direction taken from the second paragraph + ("[123 'abc']", Direction::Ltr), + ("[123 '\u{0628}' abc", Direction::Rtl), + ("[123 '\u{2066}abc\u{2069}'\u{0628}]", Direction::Rtl), // embedded isolate is ignored + ("[123 '\u{2066}abc\u{2068}'\u{0628}]", Direction::Mixed), + ("[123 '\u{2066}abc\u{2068}'\n\u{0628}]", Direction::Rtl), // \n resets embedding level + ]; + + for t in tests { + assert_eq!(get_base_direction_full(t.0), t.1); + let text = &to_utf16(t.0); + assert_eq!(get_base_direction_full(text.as_slice()), t.1); + } } } diff --git a/vendor/unicode-bidi/src/prepare.rs b/vendor/unicode-bidi/src/prepare.rs index 21675e6d1..9234e1aa6 100644 --- a/vendor/unicode-bidi/src/prepare.rs +++ b/vendor/unicode-bidi/src/prepare.rs @@ -59,7 +59,17 @@ pub fn isolating_run_sequences( assert!(!stack.is_empty()); let start_class = original_classes[run.start]; - let end_class = original_classes[run.end - 1]; + // > In rule X10, [..] skip over any BNs when [..]. + // > Do the same when determining if the last character of the sequence is an isolate initiator. + // + // + let end_class = original_classes[run.start..run.end] + .iter() + .copied() + .rev() + .filter(not_removed_by_x9) + .next() + .unwrap_or(start_class); let mut sequence = if start_class == PDI && stack.len() > 1 { // Continue a previous sequence interrupted by an isolate. @@ -166,15 +176,6 @@ pub fn isolating_run_sequences( } impl IsolatingRunSequence { - /// Returns the full range of text represented by this isolating run sequence - pub(crate) fn text_range(&self) -> Range { - if let (Some(start), Some(end)) = (self.runs.first(), self.runs.last()) { - start.start..end.end - } else { - return 0..0; - } - } - /// Given a text-relative position `pos` and an index of the level run it is in, /// produce an iterator of all characters after and pos (`pos..`) that are in this /// run sequence diff --git a/vendor/unicode-bidi/src/utf16.rs b/vendor/unicode-bidi/src/utf16.rs new file mode 100644 index 000000000..dcd9baf2b --- /dev/null +++ b/vendor/unicode-bidi/src/utf16.rs @@ -0,0 +1,791 @@ +// Copyright 2023 The Mozilla Foundation. See the +// COPYRIGHT file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use super::TextSource; + +use alloc::borrow::Cow; +use alloc::vec::Vec; +use core::char; +use core::ops::Range; + +use crate::{ + compute_bidi_info_for_para, compute_initial_info, level, para_direction, reorder_levels, + reorder_visual, visual_runs_for_line, +}; +use crate::{BidiClass, BidiDataSource, Direction, Level, LevelRun, ParagraphInfo}; + +#[cfg(feature = "hardcoded-data")] +use crate::HardcodedBidiData; + +/// Initial bidi information of the text (UTF-16 version). +/// +/// Contains the text paragraphs and `BidiClass` of its characters. +#[derive(PartialEq, Debug)] +pub struct InitialInfo<'text> { + /// The text + pub text: &'text [u16], + + /// The BidiClass of the character at each code unit in the text. + /// If a character is multiple code units, its class will appear multiple times in the vector. + pub original_classes: Vec, + + /// The boundaries and level of each paragraph within the text. + pub paragraphs: Vec, +} + +impl<'text> InitialInfo<'text> { + /// Find the paragraphs and BidiClasses in a string of text. + /// + /// + /// + /// Also sets the class for each First Strong Isolate initiator (FSI) to LRI or RLI if a strong + /// character is found before the matching PDI. If no strong character is found, the class will + /// remain FSI, and it's up to later stages to treat these as LRI when needed. + /// + /// The `hardcoded-data` Cargo feature (enabled by default) must be enabled to use this. + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[cfg(feature = "hardcoded-data")] + pub fn new(text: &[u16], default_para_level: Option) -> InitialInfo<'_> { + Self::new_with_data_source(&HardcodedBidiData, text, default_para_level) + } + + /// Find the paragraphs and BidiClasses in a string of text, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`InitialInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature) + /// + /// + /// + /// Also sets the class for each First Strong Isolate initiator (FSI) to LRI or RLI if a strong + /// character is found before the matching PDI. If no strong character is found, the class will + /// remain FSI, and it's up to later stages to treat these as LRI when needed. + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a [u16], + default_para_level: Option, + ) -> InitialInfo<'a> { + InitialInfoExt::new_with_data_source(data_source, text, default_para_level).base + } +} + +/// Extended version of InitialInfo (not public API). +#[derive(PartialEq, Debug)] +struct InitialInfoExt<'text> { + /// The base InitialInfo for the text, recording its paragraphs and bidi classes. + base: InitialInfo<'text>, + + /// Parallel to base.paragraphs, records whether each paragraph is "pure LTR" that + /// requires no further bidi processing (i.e. there are no RTL characters or bidi + /// control codes present). + pure_ltr: Vec, +} + +impl<'text> InitialInfoExt<'text> { + /// Find the paragraphs and BidiClasses in a string of text, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`InitialInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature) + /// + /// + /// + /// Also sets the class for each First Strong Isolate initiator (FSI) to LRI or RLI if a strong + /// character is found before the matching PDI. If no strong character is found, the class will + /// remain FSI, and it's up to later stages to treat these as LRI when needed. + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a [u16], + default_para_level: Option, + ) -> InitialInfoExt<'a> { + let mut paragraphs = Vec::::new(); + let mut pure_ltr = Vec::::new(); + let (original_classes, _, _) = compute_initial_info( + data_source, + text, + default_para_level, + Some((&mut paragraphs, &mut pure_ltr)), + ); + + InitialInfoExt { + base: InitialInfo { + text, + original_classes, + paragraphs, + }, + pure_ltr, + } + } +} + +/// Bidi information of the text (UTF-16 version). +/// +/// The `original_classes` and `levels` vectors are indexed by code unit offsets into the text. If a +/// character is multiple code units wide, then its class and level will appear multiple times in these +/// vectors. +// TODO: Impl `struct StringProperty { values: Vec }` and use instead of Vec +#[derive(Debug, PartialEq)] +pub struct BidiInfo<'text> { + /// The text + pub text: &'text [u16], + + /// The BidiClass of the character at each byte in the text. + pub original_classes: Vec, + + /// The directional embedding level of each byte in the text. + pub levels: Vec, + + /// The boundaries and paragraph embedding level of each paragraph within the text. + /// + /// TODO: Use SmallVec or similar to avoid overhead when there are only one or two paragraphs? + /// Or just don't include the first paragraph, which always starts at 0? + pub paragraphs: Vec, +} + +impl<'text> BidiInfo<'text> { + /// Split the text into paragraphs and determine the bidi embedding levels for each paragraph. + /// + /// + /// The `hardcoded-data` Cargo feature (enabled by default) must be enabled to use this. + /// + /// TODO: In early steps, check for special cases that allow later steps to be skipped. like + /// text that is entirely LTR. See the `nsBidi` class from Gecko for comparison. + /// + /// TODO: Support auto-RTL base direction + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[cfg(feature = "hardcoded-data")] + #[inline] + pub fn new(text: &[u16], default_para_level: Option) -> BidiInfo<'_> { + Self::new_with_data_source(&HardcodedBidiData, text, default_para_level) + } + + /// Split the text into paragraphs and determine the bidi embedding levels for each paragraph, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`BidiInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature). + /// + /// TODO: In early steps, check for special cases that allow later steps to be skipped. like + /// text that is entirely LTR. See the `nsBidi` class from Gecko for comparison. + /// + /// TODO: Support auto-RTL base direction + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a [u16], + default_para_level: Option, + ) -> BidiInfo<'a> { + let InitialInfoExt { base, pure_ltr, .. } = + InitialInfoExt::new_with_data_source(data_source, text, default_para_level); + + let mut levels = Vec::::with_capacity(text.len()); + let mut processing_classes = base.original_classes.clone(); + + for (para, is_pure_ltr) in base.paragraphs.iter().zip(pure_ltr.iter()) { + let text = &text[para.range.clone()]; + let original_classes = &base.original_classes[para.range.clone()]; + + compute_bidi_info_for_para( + data_source, + para, + *is_pure_ltr, + text, + original_classes, + &mut processing_classes, + &mut levels, + ); + } + + BidiInfo { + text, + original_classes: base.original_classes, + paragraphs: base.paragraphs, + levels, + } + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *byte* + /// in the paragraph. The returned vector includes bytes that are not included + /// in the `line`, but will not adjust them. + /// + /// This runs [Rule L1], you can run + /// [Rule L2] by calling [`Self::reorder_visual()`]. + /// If doing so, you may prefer to use [`Self::reordered_levels_per_char()`] instead + /// to avoid non-byte indices. + /// + /// For an all-in-one reordering solution, consider using [`Self::reorder_visual()`]. + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels(&self, para: &ParagraphInfo, line: Range) -> Vec { + assert!(line.start <= self.levels.len()); + assert!(line.end <= self.levels.len()); + + let mut levels = self.levels.clone(); + let line_classes = &self.original_classes[line.clone()]; + let line_levels = &mut levels[line.clone()]; + let line_str: &[u16] = &self.text[line.clone()]; + + reorder_levels(line_classes, line_levels, line_str, para.level); + + levels + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *character* + /// in the paragraph. The returned vector includes characters that are not included + /// in the `line`, but will not adjust them. + /// + /// This runs [Rule L1], you can run + /// [Rule L2] by calling [`Self::reorder_visual()`]. + /// If doing so, you may prefer to use [`Self::reordered_levels_per_char()`] instead + /// to avoid non-byte indices. + /// + /// For an all-in-one reordering solution, consider using [`Self::reorder_visual()`]. + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels_per_char( + &self, + para: &ParagraphInfo, + line: Range, + ) -> Vec { + let levels = self.reordered_levels(para, line); + self.text.char_indices().map(|(i, _)| levels[i]).collect() + } + + /// Re-order a line based on resolved levels and return the line in display order. + /// + /// This does not apply [Rule L3] or [Rule L4] around combining characters or mirroring. + /// + /// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 + /// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reorder_line(&self, para: &ParagraphInfo, line: Range) -> Cow<'text, [u16]> { + if !level::has_rtl(&self.levels[line.clone()]) { + return self.text[line].into(); + } + let (levels, runs) = self.visual_runs(para, line.clone()); + reorder_line(self.text, line, levels, runs) + } + + /// Reorders pre-calculated levels of a sequence of characters. + /// + /// NOTE: This is a convenience method that does not use a `Paragraph` object. It is + /// intended to be used when an application has determined the levels of the objects (character sequences) + /// and just needs to have them reordered. + /// + /// the index map will result in `indexMap[visualIndex]==logicalIndex`. + /// + /// This only runs [Rule L2](http://www.unicode.org/reports/tr9/#L2) as it does not have + /// information about the actual text. + /// + /// Furthermore, if `levels` is an array that is aligned with code units, bytes within a codepoint may be + /// reversed. You may need to fix up the map to deal with this. Alternatively, only pass in arrays where each `Level` + /// is for a single code point. + /// + /// + /// # # Example + /// ``` + /// use unicode_bidi::BidiInfo; + /// use unicode_bidi::Level; + /// + /// let l0 = Level::from(0); + /// let l1 = Level::from(1); + /// let l2 = Level::from(2); + /// + /// let levels = vec![l0, l0, l0, l0]; + /// let index_map = BidiInfo::reorder_visual(&levels); + /// assert_eq!(levels.len(), index_map.len()); + /// assert_eq!(index_map, [0, 1, 2, 3]); + /// + /// let levels: Vec = vec![l0, l0, l0, l1, l1, l1, l2, l2]; + /// let index_map = BidiInfo::reorder_visual(&levels); + /// assert_eq!(levels.len(), index_map.len()); + /// assert_eq!(index_map, [0, 1, 2, 6, 7, 5, 4, 3]); + /// ``` + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn reorder_visual(levels: &[Level]) -> Vec { + reorder_visual(levels) + } + + /// Find the level runs within a line and return them in visual order. + /// + /// `line` is a range of bytes indices within `levels`. + /// + /// The first return value is a vector of levels used by the reordering algorithm, + /// i.e. the result of [Rule L1]. The second return value is a vector of level runs, + /// the result of [Rule L2], showing the visual order that each level run (a run of text with the + /// same level) should be displayed. Within each run, the display order can be checked + /// against the Level vector. + /// + /// This does not handle [Rule L3] (combining characters) or [Rule L4] (mirroring), + /// as that should be handled by the engine using this API. + /// + /// Conceptually, this is the same as running [`Self::reordered_levels()`] followed by + /// [`Self::reorder_visual()`], however it returns the result as a list of level runs instead + /// of producing a level map, since one may wish to deal with the fact that this is operating on + /// byte rather than character indices. + /// + /// + /// + /// [Rule L1]: https://www.unicode.org/reports/tr9/#L1 + /// [Rule L2]: https://www.unicode.org/reports/tr9/#L2 + /// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 + /// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn visual_runs( + &self, + para: &ParagraphInfo, + line: Range, + ) -> (Vec, Vec) { + let levels = self.reordered_levels(para, line.clone()); + visual_runs_for_line(levels, &line) + } + + /// If processed text has any computed RTL levels + /// + /// This information is usually used to skip re-ordering of text when no RTL level is present + #[inline] + pub fn has_rtl(&self) -> bool { + level::has_rtl(&self.levels) + } +} + +/// Bidi information of text treated as a single paragraph. +/// +/// The `original_classes` and `levels` vectors are indexed by code unit offsets into the text. If a +/// character is multiple code units wide, then its class and level will appear multiple times in these +/// vectors. +#[derive(Debug, PartialEq)] +pub struct ParagraphBidiInfo<'text> { + /// The text + pub text: &'text [u16], + + /// The BidiClass of the character at each byte in the text. + pub original_classes: Vec, + + /// The directional embedding level of each byte in the text. + pub levels: Vec, + + /// The paragraph embedding level. + pub paragraph_level: Level, + + /// Whether the paragraph is purely LTR. + pub is_pure_ltr: bool, +} + +impl<'text> ParagraphBidiInfo<'text> { + /// Determine the bidi embedding level. + /// + /// + /// The `hardcoded-data` Cargo feature (enabled by default) must be enabled to use this. + /// + /// TODO: In early steps, check for special cases that allow later steps to be skipped. like + /// text that is entirely LTR. See the `nsBidi` class from Gecko for comparison. + /// + /// TODO: Support auto-RTL base direction + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[cfg(feature = "hardcoded-data")] + #[inline] + pub fn new(text: &[u16], default_para_level: Option) -> ParagraphBidiInfo<'_> { + Self::new_with_data_source(&HardcodedBidiData, text, default_para_level) + } + + /// Determine the bidi embedding level, with a custom [`BidiDataSource`] + /// for Bidi data. If you just wish to use the hardcoded Bidi data, please use [`BidiInfo::new()`] + /// instead (enabled with tbe default `hardcoded-data` Cargo feature). + /// + /// (This is the single-paragraph equivalent of BidiInfo::new_with_data_source, + /// and should be kept in sync with it. + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn new_with_data_source<'a, D: BidiDataSource>( + data_source: &D, + text: &'a [u16], + default_para_level: Option, + ) -> ParagraphBidiInfo<'a> { + // Here we could create a ParagraphInitialInfo struct to parallel the one + // used by BidiInfo, but there doesn't seem any compelling reason for it. + let (original_classes, paragraph_level, is_pure_ltr) = + compute_initial_info(data_source, text, default_para_level, None); + + let mut levels = Vec::::with_capacity(text.len()); + let mut processing_classes = original_classes.clone(); + + let para_info = ParagraphInfo { + range: Range { + start: 0, + end: text.len(), + }, + level: paragraph_level, + }; + + compute_bidi_info_for_para( + data_source, + ¶_info, + is_pure_ltr, + text, + &original_classes, + &mut processing_classes, + &mut levels, + ); + + ParagraphBidiInfo { + text, + original_classes, + levels, + paragraph_level, + is_pure_ltr, + } + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *code unit* + /// in the paragraph. The returned vector includes code units that are not included + /// in the `line`, but will not adjust them. + /// + /// See BidiInfo::reordered_levels for details. + /// + /// (This should be kept in sync with BidiInfo::reordered_levels.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels(&self, line: Range) -> Vec { + assert!(line.start <= self.levels.len()); + assert!(line.end <= self.levels.len()); + + let mut levels = self.levels.clone(); + let line_classes = &self.original_classes[line.clone()]; + let line_levels = &mut levels[line.clone()]; + + reorder_levels( + line_classes, + line_levels, + self.text.subrange(line), + self.paragraph_level, + ); + + levels + } + + /// Produce the levels for this paragraph as needed for reordering, one level per *character* + /// in the paragraph. The returned vector includes characters that are not included + /// in the `line`, but will not adjust them. + /// + /// See BidiInfo::reordered_levels_per_char for details. + /// + /// (This should be kept in sync with BidiInfo::reordered_levels_per_char.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reordered_levels_per_char(&self, line: Range) -> Vec { + let levels = self.reordered_levels(line); + self.text.char_indices().map(|(i, _)| levels[i]).collect() + } + + /// Re-order a line based on resolved levels and return the line in display order. + /// + /// See BidiInfo::reorder_line for details. + /// + /// (This should be kept in sync with BidiInfo::reorder_line.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + pub fn reorder_line(&self, line: Range) -> Cow<'text, [u16]> { + if !level::has_rtl(&self.levels[line.clone()]) { + return self.text[line].into(); + } + let (levels, runs) = self.visual_runs(line.clone()); + reorder_line(self.text, line, levels, runs) + } + + /// Reorders pre-calculated levels of a sequence of characters. + /// + /// See BidiInfo::reorder_visual for details. + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn reorder_visual(levels: &[Level]) -> Vec { + reorder_visual(levels) + } + + /// Find the level runs within a line and return them in visual order. + /// + /// `line` is a range of code-unit indices within `levels`. + /// + /// See `BidiInfo::visual_runs` for details. + /// + /// (This should be kept in sync with BidiInfo::visual_runs.) + #[cfg_attr(feature = "flame_it", flamer::flame)] + #[inline] + pub fn visual_runs(&self, line: Range) -> (Vec, Vec) { + let levels = self.reordered_levels(line.clone()); + visual_runs_for_line(levels, &line) + } + + /// If processed text has any computed RTL levels + /// + /// This information is usually used to skip re-ordering of text when no RTL level is present + #[inline] + pub fn has_rtl(&self) -> bool { + !self.is_pure_ltr + } + + /// Return the paragraph's Direction (Ltr, Rtl, or Mixed) based on its levels. + #[inline] + pub fn direction(&self) -> Direction { + para_direction(&self.levels) + } +} + +/// Return a line of the text in display order based on resolved levels. +/// +/// `text` the full text passed to the `BidiInfo` or `ParagraphBidiInfo` for analysis +/// `line` a range of byte indices within `text` corresponding to one line +/// `levels` array of `Level` values, with `line`'s levels reordered into visual order +/// `runs` array of `LevelRun`s in visual order +/// +/// (`levels` and `runs` are the result of calling `BidiInfo::visual_runs()` or +/// `ParagraphBidiInfo::visual_runs()` for the line of interest.) +/// +/// Returns: the reordered text of the line. +/// +/// This does not apply [Rule L3] or [Rule L4] around combining characters or mirroring. +/// +/// [Rule L3]: https://www.unicode.org/reports/tr9/#L3 +/// [Rule L4]: https://www.unicode.org/reports/tr9/#L4 +fn reorder_line<'text>( + text: &'text [u16], + line: Range, + levels: Vec, + runs: Vec, +) -> Cow<'text, [u16]> { + // If all isolating run sequences are LTR, no reordering is needed + if runs.iter().all(|run| levels[run.start].is_ltr()) { + return text[line].into(); + } + + let mut result = Vec::::with_capacity(line.len()); + for run in runs { + if levels[run.start].is_rtl() { + let mut buf = [0; 2]; + for c in text[run].chars().rev() { + result.extend(c.encode_utf16(&mut buf).iter()); + } + } else { + result.extend(text[run].iter()); + } + } + result.into() +} + +/// Contains a reference of `BidiInfo` and one of its `paragraphs`. +/// And it supports all operation in the `Paragraph` that needs also its +/// `BidiInfo` such as `direction`. +#[derive(Debug)] +pub struct Paragraph<'a, 'text> { + pub info: &'a BidiInfo<'text>, + pub para: &'a ParagraphInfo, +} + +impl<'a, 'text> Paragraph<'a, 'text> { + #[inline] + pub fn new(info: &'a BidiInfo<'text>, para: &'a ParagraphInfo) -> Paragraph<'a, 'text> { + Paragraph { info, para } + } + + /// Returns if the paragraph is Left direction, right direction or mixed. + #[inline] + pub fn direction(&self) -> Direction { + para_direction(&self.info.levels[self.para.range.clone()]) + } + + /// Returns the `Level` of a certain character in the paragraph. + #[inline] + pub fn level_at(&self, pos: usize) -> Level { + let actual_position = self.para.range.start + pos; + self.info.levels[actual_position] + } +} + +/// Implementation of TextSource for UTF-16 text in a [u16] array. +/// Note that there could be unpaired surrogates present! + +// Convenience functions to check whether a UTF16 code unit is a surrogate. +#[inline] +fn is_high_surrogate(code: u16) -> bool { + (code & 0xFC00) == 0xD800 +} +#[inline] +fn is_low_surrogate(code: u16) -> bool { + (code & 0xFC00) == 0xDC00 +} + +impl<'text> TextSource<'text> for [u16] { + type CharIter = Utf16CharIter<'text>; + type CharIndexIter = Utf16CharIndexIter<'text>; + type IndexLenIter = Utf16IndexLenIter<'text>; + + #[inline] + fn len(&self) -> usize { + (self as &[u16]).len() + } + fn char_at(&self, index: usize) -> Option<(char, usize)> { + if index >= self.len() { + return None; + } + // Get the indicated code unit and try simply converting it to a char; + // this will fail if it is half of a surrogate pair. + let c = self[index]; + if let Some(ch) = char::from_u32(c.into()) { + return Some((ch, 1)); + } + // If it's a low surrogate, and was immediately preceded by a high surrogate, + // then we're in the middle of a (valid) character, and should return None. + if is_low_surrogate(c) && index > 0 && is_high_surrogate(self[index - 1]) { + return None; + } + // Otherwise, try to decode, returning REPLACEMENT_CHARACTER for errors. + if let Some(ch) = char::decode_utf16(self[index..].iter().cloned()).next() { + if let Ok(ch) = ch { + // This must be a surrogate pair, otherwise char::from_u32() above should + // have succeeded! + debug_assert!(ch.len_utf16() == 2, "BMP should have already been handled"); + return Some((ch, ch.len_utf16())); + } + } else { + debug_assert!( + false, + "Why did decode_utf16 return None when we're not at the end?" + ); + return None; + } + // Failed to decode UTF-16: we must have encountered an unpaired surrogate. + // Return REPLACEMENT_CHARACTER (not None), to continue processing the following text + // and keep indexing correct. + Some((char::REPLACEMENT_CHARACTER, 1)) + } + #[inline] + fn subrange(&self, range: Range) -> &Self { + &(self as &[u16])[range] + } + #[inline] + fn chars(&'text self) -> Self::CharIter { + Utf16CharIter::new(&self) + } + #[inline] + fn char_indices(&'text self) -> Self::CharIndexIter { + Utf16CharIndexIter::new(&self) + } + #[inline] + fn indices_lengths(&'text self) -> Self::IndexLenIter { + Utf16IndexLenIter::new(&self) + } + #[inline] + fn char_len(ch: char) -> usize { + ch.len_utf16() + } +} + +/// Iterator over UTF-16 text in a [u16] slice, returning (index, char_len) tuple. +#[derive(Debug)] +pub struct Utf16IndexLenIter<'text> { + text: &'text [u16], + cur_pos: usize, +} + +impl<'text> Utf16IndexLenIter<'text> { + #[inline] + pub fn new(text: &'text [u16]) -> Self { + Utf16IndexLenIter { text, cur_pos: 0 } + } +} + +impl Iterator for Utf16IndexLenIter<'_> { + type Item = (usize, usize); + + #[inline] + fn next(&mut self) -> Option { + if let Some((_, char_len)) = self.text.char_at(self.cur_pos) { + let result = (self.cur_pos, char_len); + self.cur_pos += char_len; + return Some(result); + } + None + } +} + +/// Iterator over UTF-16 text in a [u16] slice, returning (index, char) tuple. +#[derive(Debug)] +pub struct Utf16CharIndexIter<'text> { + text: &'text [u16], + cur_pos: usize, +} + +impl<'text> Utf16CharIndexIter<'text> { + pub fn new(text: &'text [u16]) -> Self { + Utf16CharIndexIter { text, cur_pos: 0 } + } +} + +impl Iterator for Utf16CharIndexIter<'_> { + type Item = (usize, char); + + fn next(&mut self) -> Option { + if let Some((ch, char_len)) = self.text.char_at(self.cur_pos) { + let result = (self.cur_pos, ch); + self.cur_pos += char_len; + return Some(result); + } + None + } +} + +/// Iterator over UTF-16 text in a [u16] slice, returning Unicode chars. +/// (Unlike the other iterators above, this also supports reverse iteration.) +#[derive(Debug)] +pub struct Utf16CharIter<'text> { + text: &'text [u16], + cur_pos: usize, + end_pos: usize, +} + +impl<'text> Utf16CharIter<'text> { + pub fn new(text: &'text [u16]) -> Self { + Utf16CharIter { + text, + cur_pos: 0, + end_pos: text.len(), + } + } +} + +impl Iterator for Utf16CharIter<'_> { + type Item = char; + + fn next(&mut self) -> Option { + if let Some((ch, char_len)) = self.text.char_at(self.cur_pos) { + self.cur_pos += char_len; + return Some(ch); + } + None + } +} + +impl DoubleEndedIterator for Utf16CharIter<'_> { + fn next_back(&mut self) -> Option { + if self.end_pos <= self.cur_pos { + return None; + } + self.end_pos -= 1; + if let Some(ch) = char::from_u32(self.text[self.end_pos] as u32) { + return Some(ch); + } + if self.end_pos > self.cur_pos { + if let Some((ch, char_len)) = self.text.char_at(self.end_pos - 1) { + if char_len == 2 { + self.end_pos -= 1; + return Some(ch); + } + } + } + Some(char::REPLACEMENT_CHARACTER) + } +} diff --git a/vendor/wasm-bindgen-backend/.cargo-checksum.json b/vendor/wasm-bindgen-backend/.cargo-checksum.json index 5bfe08391..2a9a83718 100644 --- a/vendor/wasm-bindgen-backend/.cargo-checksum.json +++ b/vendor/wasm-bindgen-backend/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"44a5e3d86443c6e093226483b305e8795d529e24ef5d59c676fc48ae1b21a5dd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/ast.rs":"880a7260126a5d77ba1ad748b199c9a2ff2da806a8f849e1160495f5d2d62203","src/codegen.rs":"785225aea704dc0aa6d60b75c6beb61970a12b5e8a2eef6206163e6ac4d426b7","src/encode.rs":"1350ccc927d7afdc1379a41127ce890dd50350a7773660b73f37d505a6229c16","src/error.rs":"18e23656cf81d363dae25b6340a725b8135badd91a2702a83cd80e19821e99ba","src/lib.rs":"14ade320b537315ec4c575f9f3c7a35ff4e9385114c4c26a35b2ee270a897cb4","src/util.rs":"7f305ad4c71e9d11ac9c5e9ab452d3c885dcfe8141084411892f042ccc54ba5e"},"package":"1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826"} \ No newline at end of file +{"files":{"Cargo.toml":"1acf14d90c6951b23befb4a6ede125ed9a3e9964d3b1423a917a0b10276e5cd5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/ast.rs":"880a7260126a5d77ba1ad748b199c9a2ff2da806a8f849e1160495f5d2d62203","src/codegen.rs":"1250afc06bee817a2b62287388502ea6028c44936e1dd2e43c038231f773b0f4","src/encode.rs":"1350ccc927d7afdc1379a41127ce890dd50350a7773660b73f37d505a6229c16","src/error.rs":"18e23656cf81d363dae25b6340a725b8135badd91a2702a83cd80e19821e99ba","src/lib.rs":"14ade320b537315ec4c575f9f3c7a35ff4e9385114c4c26a35b2ee270a897cb4","src/util.rs":"7f305ad4c71e9d11ac9c5e9ab452d3c885dcfe8141084411892f042ccc54ba5e"},"package":"fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd"} \ No newline at end of file diff --git a/vendor/wasm-bindgen-backend/Cargo.toml b/vendor/wasm-bindgen-backend/Cargo.toml index 5e7a6efa0..3b90fcf61 100644 --- a/vendor/wasm-bindgen-backend/Cargo.toml +++ b/vendor/wasm-bindgen-backend/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.57" name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" authors = ["The wasm-bindgen Developers"] description = """ Backend code generation of the wasm-bindgen tool @@ -44,7 +44,7 @@ version = "2.0" features = ["full"] [dependencies.wasm-bindgen-shared] -version = "=0.2.89" +version = "=0.2.90" [features] extra-traits = ["syn/extra-traits"] diff --git a/vendor/wasm-bindgen-backend/src/codegen.rs b/vendor/wasm-bindgen-backend/src/codegen.rs index bfedcfbc2..bbcbc9cea 100644 --- a/vendor/wasm-bindgen-backend/src/codegen.rs +++ b/vendor/wasm-bindgen-backend/src/codegen.rs @@ -389,7 +389,14 @@ impl ToTokens for ast::StructField { }; let maybe_assert_copy = respan(maybe_assert_copy, ty); - let mut val = quote_spanned!(self.rust_name.span()=> (*js).borrow().#rust_name); + // Split this out so that it isn't affected by `quote_spanned!`. + // + // If we don't do this, it might end up being unable to reference `js` + // properly because it doesn't have the same span. + // + // See https://github.com/rustwasm/wasm-bindgen/pull/3725. + let js_token = quote! { js }; + let mut val = quote_spanned!(self.rust_name.span()=> (*#js_token).borrow().#rust_name); if let Some(span) = self.getter_with_clone { val = quote_spanned!(span=> <#ty as Clone>::clone(&#val) ); } diff --git a/vendor/wasm-bindgen-macro-support/.cargo-checksum.json b/vendor/wasm-bindgen-macro-support/.cargo-checksum.json index bf059fcde..c1bd1a8f3 100644 --- a/vendor/wasm-bindgen-macro-support/.cargo-checksum.json +++ b/vendor/wasm-bindgen-macro-support/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"cbb480d7ae0165bcd0043502e847fe6e2d178ce2e60c01ae350626fc712a12d4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/lib.rs":"4f212183a9d5a2682d6156f7b011f789fa23002099268940af090336f067d6fa","src/parser.rs":"b31546dcb5783705352c190d2e1c5a74bcd307c0da6da76c4f8aea35185f5a3c"},"package":"f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"} \ No newline at end of file +{"files":{"Cargo.toml":"05fd389578e96cd3a9e607ad436e71ba953bf217497d34be13cc175ca6188054","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/lib.rs":"4f212183a9d5a2682d6156f7b011f789fa23002099268940af090336f067d6fa","src/parser.rs":"fd20829217eef34dd57a196f05fe6ae91f8625fef7ee34c218fc2590734d6028"},"package":"bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"} \ No newline at end of file diff --git a/vendor/wasm-bindgen-macro-support/Cargo.toml b/vendor/wasm-bindgen-macro-support/Cargo.toml index 5b4c47cfd..84d6eaa27 100644 --- a/vendor/wasm-bindgen-macro-support/Cargo.toml +++ b/vendor/wasm-bindgen-macro-support/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.57" name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" authors = ["The wasm-bindgen Developers"] description = """ The part of the implementation of the `#[wasm_bindgen]` attribute that is not in the shared backend crate @@ -38,10 +38,10 @@ features = [ ] [dependencies.wasm-bindgen-backend] -version = "=0.2.89" +version = "=0.2.90" [dependencies.wasm-bindgen-shared] -version = "=0.2.89" +version = "=0.2.90" [features] extra-traits = ["syn/extra-traits"] diff --git a/vendor/wasm-bindgen-macro-support/src/parser.rs b/vendor/wasm-bindgen-macro-support/src/parser.rs index 73b9c2166..39ab459f8 100644 --- a/vendor/wasm-bindgen-macro-support/src/parser.rs +++ b/vendor/wasm-bindgen-macro-support/src/parser.rs @@ -525,7 +525,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option String { ``` Additionally the design here with minimal intervention in Rust should allow us -to easily take advantage of the upcoming [host bindings][host] proposal. Ideally +to easily take advantage of the upcoming [component model][component-model] proposal. Ideally you'd simply upgrade `wasm-bindgen`-the-crate as well as your toolchain and -you're immediately getting raw access to host bindings! (this is still a bit of +you're immediately getting raw access to component model! (this is still a bit of a ways off though...) -[host]: https://github.com/WebAssembly/host-bindings +[component-model]: https://github.com/WebAssembly/component-model diff --git a/vendor/wasm-bindgen/guide/src/introduction.md b/vendor/wasm-bindgen/guide/src/introduction.md index 2cda7eeb0..a2f1592b9 100644 --- a/vendor/wasm-bindgen/guide/src/introduction.md +++ b/vendor/wasm-bindgen/guide/src/introduction.md @@ -7,8 +7,8 @@ ecosystem][rustwasm]. If you're not familiar already with `wasm-bindgen` it's recommended to start by reading the [Game of Life tutorial][gol]. If you're curious about `wasm-pack`, you can find that [documentation here][wasm-pack]. -The `wasm-bindgen` tool is sort of half polyfill for features like the [host -bindings proposal][host] and half features for empowering high-level +The `wasm-bindgen` tool is sort of half polyfill for features like the +[component model proposal][component-model] and half features for empowering high-level interactions between JS and wasm-compiled code (currently mostly from Rust). More specifically this project allows JS/wasm to communicate with strings, JS objects, classes, etc, as opposed to purely integers and floats. Using @@ -33,7 +33,7 @@ With the addition of [`wasm-pack`][wasm-pack] you can run the gamut from running the web locally, publishing it as part of a larger application, or even publishing Rust-compiled-to-WebAssembly on NPM! -[host]: https://github.com/WebAssembly/host-bindings +[component-model]: https://github.com/WebAssembly/component-model [dom-ex]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/dom [console-log]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/console_log [perf-ex]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/performance diff --git a/vendor/wasm-bindgen/guide/src/reference/attributes/on-js-imports/final.md b/vendor/wasm-bindgen/guide/src/reference/attributes/on-js-imports/final.md index e62620b2f..a3e65b04c 100644 --- a/vendor/wasm-bindgen/guide/src/reference/attributes/on-js-imports/final.md +++ b/vendor/wasm-bindgen/guide/src/reference/attributes/on-js-imports/final.md @@ -9,15 +9,15 @@ prototype chain of an object. Note that `final` is not suitable for accessing data descriptor properties of JS objects; to accomplish this, use the `structural` attribute. -[host-bindings]: https://github.com/WebAssembly/host-bindings +[component-model]: https://github.com/WebAssembly/component-model [reference-types]: https://github.com/WebAssembly/reference-types The `final` attribute is intended to be purely related to performance. It ideally has no user-visible effect, and `structural` imports (the default) should be able to transparently switch to `final` eventually. -The eventual performance aspect is that with the [host bindings -proposal][host-bindings] then `wasm-bindgen` will need to generate far fewer JS +The eventual performance aspect is that with the [component model +proposal][component-model] then `wasm-bindgen` will need to generate far fewer JS function shims to import than it does today. For example, consider this import today: @@ -74,8 +74,8 @@ function with `getObject(arg0)` as the receiver. But wait, there's still a JS function shim here even with `final`! That's true, and this is simply a fact of future WebAssembly proposals not being implemented -yet. The semantics, though, match the future [host bindings -proposal][host-bindings] because the method being called is determined exactly +yet. The semantics, though, match the future [component model +proposal][component-model] because the method being called is determined exactly once, and it's located on the prototype chain rather than being resolved at runtime when the function is called. @@ -106,14 +106,14 @@ export function __wbg_bar_a81456386e6b526f(arg0, arg1, arg2) { } ``` -Getting better! Next up we need the host bindings proposal. Note that the +Getting better! Next up we need the component model proposal. Note that the proposal is undergoing some changes right now so it's tough to link to reference documentation, but it suffices to say that it'll empower us with at least two different features. -First, host bindings promises to provide the concept of "argument conversions". +First, component model promises to provide the concept of "argument conversions". The `arg1` and `arg2` values here are actually a pointer and a length to a utf-8 -encoded string, and with host bindings we'll be able to annotate that this +encoded string, and with component model we'll be able to annotate that this import should take those two arguments and convert them to a JS string (that is, the *host* should do this, the WebAssembly engine). Using that feature we can further trim this down to: @@ -126,10 +126,10 @@ export function __wbg_bar_a81456386e6b526f(arg0, varg1) { } ``` -And finally, the second promise of the host bindings proposal is that we can +And finally, the second promise of the component model proposal is that we can flag a function call to indicate the first argument is the `this` binding of the function call. Today the `this` value of all called imported functions is -`undefined`, and this flag (configured with host bindings) will indicate the +`undefined`, and this flag (configured with component model) will indicate the first argument here is actually the `this`. With that in mind we can further transform this to: @@ -138,8 +138,8 @@ With that in mind we can further transform this to: export const __wbg_bar_a81456386e6b526f = Foo.prototype.bar; ``` -and voila! We, with [reference types][reference-types] and [host -bindings][host-bindings], now have no JS function shim at all necessary to call +and voila! We, with [reference types][reference-types] and [component +model][component-model], now have no JS function shim at all necessary to call the imported function. Additionally future wasm proposals to the ES module system may also mean that don't even need the `export const ...` here too. diff --git a/vendor/wasm-bindgen/tests/wasm/classes.js b/vendor/wasm-bindgen/tests/wasm/classes.js index 8e503c658..49bd44722 100644 --- a/vendor/wasm-bindgen/tests/wasm/classes.js +++ b/vendor/wasm-bindgen/tests/wasm/classes.js @@ -241,3 +241,10 @@ exports.js_test_inspectable_classes_can_override_generated_methods = () => { assert.strictEqual(overridden_inspectable.toString(), 'string was overwritten'); overridden_inspectable.free(); }; + +exports.js_test_class_defined_in_macro = () => { + const macroClass = new wasm.InsideMacro(); + assert.strictEqual(macroClass.a, 3); + macroClass.a = 5; + assert.strictEqual(macroClass.a, 5); +}; diff --git a/vendor/wasm-bindgen/tests/wasm/classes.rs b/vendor/wasm-bindgen/tests/wasm/classes.rs index 9321ff92d..6058c0a59 100644 --- a/vendor/wasm-bindgen/tests/wasm/classes.rs +++ b/vendor/wasm-bindgen/tests/wasm/classes.rs @@ -34,6 +34,7 @@ extern "C" { fn js_test_option_classes(); fn js_test_inspectable_classes(); fn js_test_inspectable_classes_can_override_generated_methods(); + fn js_test_class_defined_in_macro(); } #[wasm_bindgen_test] @@ -608,3 +609,27 @@ impl OverriddenInspectable { String::from("string was overwritten") } } + +macro_rules! make_struct { + ($field:ident) => { + #[wasm_bindgen] + pub struct InsideMacro { + pub $field: u32, + } + }; +} + +make_struct!(a); + +#[wasm_bindgen] +impl InsideMacro { + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { a: 3 } + } +} + +#[wasm_bindgen_test] +fn class_defined_in_macro() { + js_test_class_defined_in_macro(); +} diff --git a/vendor/web-sys/.cargo-checksum.json b/vendor/web-sys/.cargo-checksum.json index b077474b6..34571fb70 100644 --- a/vendor/web-sys/.cargo-checksum.json +++ b/vendor/web-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"088524bbe57805488cbf9acac808fb12a8262e8266e3aedaffd8376389ac2f6a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"8c3d4c072113f0b5baed2713ea41684cbbafff8bd02fd7a5571d3d0757b739bf","src/features/gen_AbortController.rs":"e93623bf39fc0511d7108c542e729d0d6dc4137b3c4182d9a5f0577c02af4e0f","src/features/gen_AbortSignal.rs":"2540fc31634caac12a37f5ae7ef79c82bcddb87496d1d05fa244c282ab4183be","src/features/gen_AddEventListenerOptions.rs":"79d1838fdf9c7ecae11c104531f3628e572f38eb1d0d9c78b7ccb8045680263f","src/features/gen_AesCbcParams.rs":"b8031b752d0a5ec33db88d2bfb7a057bc4f9bd6685cd9d7f0886b19820e0e685","src/features/gen_AesCtrParams.rs":"3f26a558e16b224911576e611973a17378d9b9a1516d62e45752ca7542800be9","src/features/gen_AesDerivedKeyParams.rs":"60d1af3927b2001c3eceb7e8305179bfbd05576f64e43d22984d07212103435b","src/features/gen_AesGcmParams.rs":"28148dccdc668504580fe3e7007aa1c36f9397649dd80f6b91b554419f635bd3","src/features/gen_AesKeyAlgorithm.rs":"330a337116a187da4244a588a8f4672e96185f26cc87d8bc55996047e7d3fb04","src/features/gen_AesKeyGenParams.rs":"4b6abfe93ae32b6e0b268d2634440f0c910acb0a5d7b645b860844aab5879e91","src/features/gen_Algorithm.rs":"6971b54561e2ac3b910b01c06671f9d44b95a1873c36a476d9fc18447f3994a7","src/features/gen_AlignSetting.rs":"48fd57daac22fdebd11b151ad67e009a7df7b1b40f240e29d1e8acbbef2093e6","src/features/gen_AllowedBluetoothDevice.rs":"73b7c21b3b5705eaf4148910de28cdacf7cf66123e47f8b856d3270395a7e6aa","src/features/gen_AllowedUsbDevice.rs":"abbbff27e31b6d35cd22c279140608cf9a1e00cb9ad9a49b0444da7077cc2522","src/features/gen_AlphaOption.rs":"13c34968e30b6a2efc69a7efcbcbef75f0df1f6042e2b0b2c1f0ba8eca40c6c2","src/features/gen_AnalyserNode.rs":"96a3842731aadea282699276c27902be59e21c3bf8fd622815240e8f52fb919b","src/features/gen_AnalyserOptions.rs":"3eca2be4f0a8fed62a7fcc32a4a21c4cd65a9f8a24035c5f576d9e27c420afa1","src/features/gen_AngleInstancedArrays.rs":"09fed73d98060b7f17fd16a2be385b4171bc7b42ce20a5094b4c69cb73d4fef9","src/features/gen_Animation.rs":"558aa77beb07e8dbdf43c5fa0f34768e2fc98369e81e755a0cc0955f1942346c","src/features/gen_AnimationEffect.rs":"38f6b41f392476aa5ebb33e737ef04047ebb4b695a82c621fdedbdd75cf1696b","src/features/gen_AnimationEvent.rs":"e0283b83a782ab911191caee377f50fc6043cc50ecfb516b5d71bfb8046af2cb","src/features/gen_AnimationEventInit.rs":"487bf61e0ad7ac83a7b3a7f956058daa55bd11dd422d70b8d2dccaee22deb768","src/features/gen_AnimationPlayState.rs":"ff0ca3274d65f1eb12c62c2fd5b8e873bda54a9f094272ce11078c1c645403bd","src/features/gen_AnimationPlaybackEvent.rs":"4313d4a2f3b80094b214eb5800200e72894e63bf4f37845bc72fa76ade04f33c","src/features/gen_AnimationPlaybackEventInit.rs":"8f48b01b6093f99ce2c0150419570c6a7dfd010ff13f199d89335f49416909e7","src/features/gen_AnimationPropertyDetails.rs":"29e47cdf6b61666ada2e30b5db53e6d81915b7075bfdd786346a3f776612f291","src/features/gen_AnimationPropertyValueDetails.rs":"1cb568581080fd4a18cd7081f92a47bc329fab230e9fcb6c4eab6d34f7fcde0b","src/features/gen_AnimationTimeline.rs":"8c53820df95fdf79146ffdc682b2b97ec95fe54ce73b6f93f73ddfe9f34f79cd","src/features/gen_AssignedNodesOptions.rs":"365536e63fb1b9a1be0ca67106aeb6367267c1fdab0ac5c144362cf8f2a13482","src/features/gen_AttestationConveyancePreference.rs":"4d3db99abeb3e9859b133644ff3e687ea6c2ff89e19c6d73a3c28dc736a7f28a","src/features/gen_Attr.rs":"f271648a8cfdf15af9793511c348be635b0e406044aef2af71b5a241b8ecdae9","src/features/gen_AttributeNameValue.rs":"073c9f4db5c3af4544360832dc2dcd5f6915060478bbfd9f3d62336f1c608aca","src/features/gen_AudioBuffer.rs":"64fcbe25f39baad00d5905bce4610c01e536deb007a3ec44c3acbb7dc73d4397","src/features/gen_AudioBufferOptions.rs":"4935887e4e96d33ccb39e74fdc7ce5f0309e79c4f772bd079aa3c00f67641420","src/features/gen_AudioBufferSourceNode.rs":"ec7a01ea15d3d4f65a557045d24df11accf0fb3aac43233e5e4ee15d29b114e2","src/features/gen_AudioBufferSourceOptions.rs":"c9f4ab5d2d0532bc0478b1baa7bddfee0d5cc66f004f85951bdf0c244aecf032","src/features/gen_AudioConfiguration.rs":"1153391354ef7ad9b0d16ff2bcb56f5c96cc598ce286e9a5e91b864122edb689","src/features/gen_AudioContext.rs":"71ebf333adabb96aa99d55e679946814d16741d178ab51b6917efcb6cd4d4a99","src/features/gen_AudioContextLatencyCategory.rs":"2390689a056318f2bbf060ee67501858c0ba9f8d82f0af5ae01f202264ae5d00","src/features/gen_AudioContextOptions.rs":"8c613322037bde7df6226102f1e8b525965ba6f05bab5bc3c2cfe8c4708b0d75","src/features/gen_AudioContextState.rs":"82df1d0270b9e46f1b2a098e43a64408355bf31525e41e1b4e5672b1ef3d864d","src/features/gen_AudioData.rs":"98814aee5ddd1a74dccc7d24efebdcec2b8e87b3217f4e13f62fa07cfd0e1e90","src/features/gen_AudioDataCopyToOptions.rs":"c234528888483f5365124f5b8735e93b3e7a62df99d0811caa77b1908a5bcdf3","src/features/gen_AudioDataInit.rs":"0e1a321016c9a4c6a69472dfa3c2f3d890049e97d46482820cc4b91f5d3adb09","src/features/gen_AudioDecoder.rs":"23f2314cd850dff151fb9195188ef99ee6bc0be260173374821c0b5c1550604c","src/features/gen_AudioDecoderConfig.rs":"8dee543d4d8ebf1bd0d6071d646a1007f49e39121dc55b0ecaa48d312ed2b77b","src/features/gen_AudioDecoderInit.rs":"d8481a22e424969cc18c79cace2f8d9786128f482c8d4a5ea58b92bd96d0a498","src/features/gen_AudioDecoderSupport.rs":"9659f0b764bf91c662a97be008c3f91316b106ecbe055774167e022bc8b5c156","src/features/gen_AudioDestinationNode.rs":"f37dc515a38e8a9b4b5d14d72c96020533c14a3006721eac9273850bf9994def","src/features/gen_AudioEncoder.rs":"b8a6751dff88a6186802111212985ebeabe8c01983a852f6ffde6ec0cec0f1b1","src/features/gen_AudioEncoderConfig.rs":"93822a5969626e3186dbc215dac0de0416bca01cec4356d8df3368727bf48608","src/features/gen_AudioEncoderInit.rs":"a4e8e568d1daef238d40689f0533980c6898808c19a556c5550f5f4bee19c70a","src/features/gen_AudioEncoderSupport.rs":"43b468a08b42995f2a25ba363ed88cf22ac420186d25d038f7d0f8dbafb1fa37","src/features/gen_AudioListener.rs":"83e6c0132513831ede1933a6c14593f4140e35b59b279da7a6d02d2a5e3b83df","src/features/gen_AudioNode.rs":"57a84b0c8ff147c19ea273f0ccce95202c94b1ba3bb806199b414c8ea3c2b7d3","src/features/gen_AudioNodeOptions.rs":"733205b3811aaae5ef87a0097e72190dacc1cbaa5f37fb04270bb2ee14692d86","src/features/gen_AudioParam.rs":"75b13e6ef26607b749cbc4b4694424bff45a9065debfd34ee7203675152529eb","src/features/gen_AudioParamMap.rs":"091328e5ce3248b34520aa5d700de7d135c1f31d77ee50bf7b61cb3e34c45fb0","src/features/gen_AudioProcessingEvent.rs":"f5534edece040a7fa43dc9fcebec75f6882e833a3580039c6fe95693ab84e1a3","src/features/gen_AudioSampleFormat.rs":"4ee3d125206c2114f653222973683daee264439f0c457c83586af59c2fc1d926","src/features/gen_AudioScheduledSourceNode.rs":"f3d2661edba2d426da34126b5d8ba2dec36d9969fcaf2f0b7f00bd9b1855b158","src/features/gen_AudioSinkInfo.rs":"945fd255af6df9b7931344ab080829896459e5cde3742136c73a130cbb0b1ca3","src/features/gen_AudioSinkOptions.rs":"eafcfb9ef502a810e5f9097e78b5afb4fb6366841a80dad416b32e2119e4ef83","src/features/gen_AudioSinkType.rs":"71445dbe9c69a87a4fb93806d088905daae78281eea431ade19d79d0425d56b2","src/features/gen_AudioStreamTrack.rs":"83ef9e410255564263683b2c09273a2ed83e4ab7bd1d562c2009e6fc57cffbfa","src/features/gen_AudioTrack.rs":"64b31ed517e28b1f8049e5087f2cff321c4aa84d209de30e2dfe310e4b42e989","src/features/gen_AudioTrackList.rs":"da5d6cff9f3a83231fc164a4cf1daecb9a84623056ee5165701bece3e2d59067","src/features/gen_AudioWorklet.rs":"e78246281bc7e0c5df102022f61dcff558f23e2aef770e126f756ecca14c717f","src/features/gen_AudioWorkletGlobalScope.rs":"1a21260d0c8c6c97f60b2dd703a1df4723611b017f3af74c680bad02fa2a7769","src/features/gen_AudioWorkletNode.rs":"7c2ed263240c9164b35a3347704b625d5c5c0e463f56044da9d66b70869fbf1f","src/features/gen_AudioWorkletNodeOptions.rs":"1e40b79c52e10b3c595aef5a258d6c91ae596adc1f981f91d94e89d22e94da31","src/features/gen_AudioWorkletProcessor.rs":"ab0df7d00d4ca8b69c3f32a05d200bf1574d9a2874083ff414fdfb569ba67744","src/features/gen_AuthenticationExtensionsClientInputs.rs":"c55069c8ed2152a223c700afce71a4e7fbf5c8fa9f28379968662cb8a2bc0265","src/features/gen_AuthenticationExtensionsClientOutputs.rs":"5f552aa22770d0c69a597b0b4e94bb29dae353d742d1e2f4ca0a34b641c89265","src/features/gen_AuthenticatorAssertionResponse.rs":"6214681778015bb0aaf52990fd487089aa8daced4279197993ac779bf35a48d5","src/features/gen_AuthenticatorAttachment.rs":"e1e59a560c9a232f98823ed981c17106951a848ea2a53adbaf88a8ebfacd7495","src/features/gen_AuthenticatorAttestationResponse.rs":"872fd2bf7bab942d562826d6a435958f42c174a013f4f4005706cbbb9a8d1286","src/features/gen_AuthenticatorResponse.rs":"a21b9521fecd8514058109706ef6bb9115c1ab46658d181b152ca068da2723e4","src/features/gen_AuthenticatorSelectionCriteria.rs":"e82d483047fbb2da43a0c842b8bdedb372485eae7c6f69b6491d6bc6ce71bc6f","src/features/gen_AuthenticatorTransport.rs":"b729e2f5274c438d9f079d7b5ff6a10a8003d1afd91124cd05596ea8302b1fc1","src/features/gen_AutoKeyword.rs":"4a25ca00cbbb01bb4d929a8cb4ede84c1c7e0189ba8d08cf5a399afdec285194","src/features/gen_AutocompleteInfo.rs":"bde29b49864d60241502dc9aed2f874b41dfdd8463a2f770a74c305704b16d60","src/features/gen_BarProp.rs":"6755b9acba54f5cffe7f3ef49fdca90431da4471f58dcf133fb041f72a412a58","src/features/gen_BaseAudioContext.rs":"fc5abb2e1f1df21426b9eaa4db8d13e9d4a381aa2a0322111a844fb1adfef427","src/features/gen_BaseComputedKeyframe.rs":"1b2ec6cb68ab3d9ac00b5300e394b0dbed3d00ebc39959b3f7b2af69fc09739c","src/features/gen_BaseKeyframe.rs":"eddc814f28053391332bb3f3654ee9bfef47bb5d1280ca99bb78311a62599d25","src/features/gen_BasePropertyIndexedKeyframe.rs":"3bc3659dd22321348b318c032e2db2151a4ef65cc9b8ac8fdef372f81c13ac5c","src/features/gen_BasicCardRequest.rs":"e79c4871053b14446134c4bd5314b392479d53f9ec16b155e14a9f11d692b70d","src/features/gen_BasicCardResponse.rs":"48e4a18a505c2dfa3481613ee58ffa09d99504314c900903dd62fd27ccc56f82","src/features/gen_BasicCardType.rs":"d49e9147cb92bb6669f54bba3c45855e11d3857b6f193f847f87dc07149f3519","src/features/gen_BatteryManager.rs":"dfa8b5732f83aa78b56b3d6f4386784447d8fb7a6d4443a9bc8e6acdd4335536","src/features/gen_BeforeUnloadEvent.rs":"e68501edd489f6e31193ae54290fbf1865a8bc8936d5544e71b4a4ebef3fba5d","src/features/gen_BinaryType.rs":"360427cdc9b055f54add20fcc12fceaa2ebbf0f1822a4c2b34797cca86a444cc","src/features/gen_BiquadFilterNode.rs":"5c858c3a00024c64b4be5cf87546097fef6d05ce8ffdbf7329e7dc111851f301","src/features/gen_BiquadFilterOptions.rs":"02fcaea7715f34576972e104c8f00d893de5847f5e94a2e375994d38d50465a5","src/features/gen_BiquadFilterType.rs":"795510f7935f68f2350bf816ead5628db823bad9a24ad3dac1f1c0db2f6d3bd9","src/features/gen_Blob.rs":"ffd40c12401320c7cc23dfaa93bd7213cb3c132621b313c29ef0395dc158b9a5","src/features/gen_BlobEvent.rs":"baff7dcbbe67e52bec86cb306d49f871ae2fc95c8242878472568f72d5cdabe9","src/features/gen_BlobEventInit.rs":"21c7fdbf19d082605038d68872c23ce8e7dc3e79ee628a6c38661c123f2cb283","src/features/gen_BlobPropertyBag.rs":"f801cf6225e048372b2e4881940e84079c6867f1fef83beb035d12c0991ff79f","src/features/gen_BlockParsingOptions.rs":"ef1d9e0063ff23388ff6100b52456150d1442aadf2c7d74a6210fefe7f394b65","src/features/gen_Bluetooth.rs":"ce3891a2593a55eca37135466c0457c64caca2260f1969e595188a98b711acf6","src/features/gen_BluetoothAdvertisingEvent.rs":"7a8ec7c52c6f29771e38e3b5b849fc7aea4365a9d2863820c8e331ee3501e1a1","src/features/gen_BluetoothAdvertisingEventInit.rs":"6231f227bebe4b9ec6dc66a79fdfdf4a7c87210e5aa4fd52da815dc70e4a3e9b","src/features/gen_BluetoothCharacteristicProperties.rs":"ff5aef6e0939619728b1845689a8a4f578f90bc8e39f65e10b8dbf1652c39b43","src/features/gen_BluetoothDataFilterInit.rs":"b53193470d13c7376c4cb5967708e8888154e846a8ba260c6c25c4bea9c47e56","src/features/gen_BluetoothDevice.rs":"64528244f6197a62210498ec5bc58427230f501bb592995d6d4b1d006b8bdfd7","src/features/gen_BluetoothLeScanFilterInit.rs":"c3c9c0f1e43ff1fbee480cd239b542a1d1af4320888a5a55b58d541707d819f3","src/features/gen_BluetoothManufacturerDataMap.rs":"eef5c40f060cf6656ec698f84663597fe7c933e654908efa98b0e107fc048d32","src/features/gen_BluetoothPermissionDescriptor.rs":"4b53775dfdabad424ac54b34cccdef70fb358de7e632b4a0368045164291713b","src/features/gen_BluetoothPermissionResult.rs":"b894d5889b8ea549d61a0f96380c31b3e74a33a71061782a2788b6fe7a0205ee","src/features/gen_BluetoothPermissionStorage.rs":"ceb60f3464549d52af8c234588059c213f4715a735778457cd17ae7ee91b3f4c","src/features/gen_BluetoothRemoteGattCharacteristic.rs":"fb5203a6a107831b9a8a780aaaf7839c9ae252e81e43370f4a321f64c8120587","src/features/gen_BluetoothRemoteGattDescriptor.rs":"9b652f6b71ab1a685a70921bb6d8e47ccbada02680452c52c7afdaab8d7afe60","src/features/gen_BluetoothRemoteGattServer.rs":"1e840a8036db44e7d65ab2b0ee4fd4ba5609fd8902c0a9e8a48cd212a5e412b5","src/features/gen_BluetoothRemoteGattService.rs":"328010445712ff840a8b7d76d0ef04b5ae8bd453ad76b1bd0175916af786a5f5","src/features/gen_BluetoothServiceDataMap.rs":"526e5ba1d91cf7210121401a701ca49da9f3da6bba8fcd77e5d49e4c16b8ff75","src/features/gen_BluetoothUuid.rs":"92701eea940a85d225227c957554b117118d814a76a527f2a8887d6cf14b23d9","src/features/gen_BoxQuadOptions.rs":"dbed98f4fa5cdab046b41a78d3d61278beb4426b67a7070aa10c0896a7cb944f","src/features/gen_BroadcastChannel.rs":"a12dab1d0324304202e709a265d11e4a32998be75debbc261824ee1635a4ace9","src/features/gen_BrowserElementDownloadOptions.rs":"b43a6b9e970fc010cf273e57b2043ca9a470d4f81373fbd70c6d818a383acfe8","src/features/gen_BrowserElementExecuteScriptOptions.rs":"652c3bd7317b096f3a39e911678017cef7bae83d2f2f9445f2f1d29d1908e5eb","src/features/gen_BrowserFeedWriter.rs":"e4cfd730cb527f6b06c9e2b437ffa7e39262933b96cd6745b964b37649df389f","src/features/gen_BrowserFindCaseSensitivity.rs":"8c11b091b1b4044140d209a1e04ae65ca5af7787909423158a0176f13a25fa1e","src/features/gen_BrowserFindDirection.rs":"e36f007317d046e1eb84965e858e8b147af8809e1b588c801bd8e664b65e3c5d","src/features/gen_ByteLengthQueuingStrategy.rs":"2e96362f6f82a53ec24ce0547632513a2609f7d3dc6aa40979ddff5991976cec","src/features/gen_Cache.rs":"afb56d598487c61488d4232f3f606914c0d0870a325ecb3a6bd318bc98ae57f1","src/features/gen_CacheBatchOperation.rs":"df4885199844d3e305d9659a8efd3d5109b3bb07d8041c90d2394ccb804b130e","src/features/gen_CacheQueryOptions.rs":"8c4eb4b3df6aae66c88d1fff9b696bdef252d2615b2105d079aabf49c9ab6a5d","src/features/gen_CacheStorage.rs":"79a77de4068d05ea348665a42454cb83b5764ea9be917d7ddb5a3f94011324d5","src/features/gen_CacheStorageNamespace.rs":"48cc76a716c3cba09cd6bb91176c28887c6df089595d69bd914f9d8902d2db35","src/features/gen_CanvasCaptureMediaStream.rs":"fb045b40794ef5e2a3da6de0e9862aa351a7c92dfbec58e556be2bda78f1d6c8","src/features/gen_CanvasCaptureMediaStreamTrack.rs":"41907d63731bcea426a7cee6c27eee166032af245c101497d339f3e1b47b160d","src/features/gen_CanvasGradient.rs":"7f845aafd61f217457d3ed03b7758b92b5b82479739d29ee536390974809f8d7","src/features/gen_CanvasPattern.rs":"5f1424f7207fd8a764db62db3a4c52550bcb014dc1aeb1719a82a6d80d3a7937","src/features/gen_CanvasRenderingContext2d.rs":"008ecdb8fe84131b13a24db7b6b7036d8f2fd48f4eb402762f5a74361d6d3bee","src/features/gen_CanvasWindingRule.rs":"77cefc02d417772b8130f5c91f2c50426b13e8a81e93f1196469c36102794219","src/features/gen_CaretChangedReason.rs":"7006fee015c9e687f00f49ab5eac5bcfd7d88b4ea02f29c17c21cc6accb596da","src/features/gen_CaretPosition.rs":"4eb685d65afe75026cde61b8b4cd15cc94f1cdc60a2d5a397480553c58602e69","src/features/gen_CaretStateChangedEventInit.rs":"915bee887e5f3f83b0d56c69de9f0a2a8391a13a4198efe550b2df2fe8e7b6fd","src/features/gen_CdataSection.rs":"c89ea5eae00ec9d19a0332151ac366cbf7593d4e08b60a2230841261864f482e","src/features/gen_ChannelCountMode.rs":"ba87a770bdca27571c0019675136b01e9ce4187723288f6c4ac9d8680bad655b","src/features/gen_ChannelInterpretation.rs":"7ef32012ee4319177e411323a3d39e816064a3bf2c76ff7f56277c098b8dfc0c","src/features/gen_ChannelMergerNode.rs":"82259412fa3828d5a2638200830a0c9f86678cc8caa6056c66978308c9e646f0","src/features/gen_ChannelMergerOptions.rs":"f858902ce95b422a98f04038e2d3b10af13bba2a70c65907113f16ce5337eeaf","src/features/gen_ChannelSplitterNode.rs":"081c8908514f789625656331e8fb8fdfb04b0c0f909c0f9d3e432563a1ba8e6f","src/features/gen_ChannelSplitterOptions.rs":"14812d057a886ad8c2a10bd69f894821cab2a9b3d0ee4346fe91e29b3b9d4290","src/features/gen_CharacterData.rs":"d4ad3ad16304937bce684d14ed780036671ec6692e1c467cafc1a8a4fcae5b42","src/features/gen_CheckerboardReason.rs":"515ad8e54c013ff3306a521539e8a4f1b049d3bedd1288e60d01087b770b9149","src/features/gen_CheckerboardReport.rs":"ec2bd96a6337ab90d9e738250d487de483a643e6892350d4cf84de4c4ed70329","src/features/gen_CheckerboardReportService.rs":"41b2b85859e7c4488b1700b8045ad578652ca74a9ff92bab8baa94e7ff8546c0","src/features/gen_ChromeFilePropertyBag.rs":"474e9a1438748cde81565ab04aa62aec31717d480b3fb226bb6feb8afcb75aa4","src/features/gen_ChromeWorker.rs":"7bff8a9a179983aa26a17b0194e54dfd82564074a7caac5c2f24379d8cc8289e","src/features/gen_Client.rs":"93f391c9a7f68bd9010dbfe14c2d6ce99411b499e1b802e0782c7189824a38ee","src/features/gen_ClientQueryOptions.rs":"b097377303c9e31942a8b2e2c89e66dab1006a8e35d4a225424e5e52f029d05b","src/features/gen_ClientRectsAndTexts.rs":"60c91c3247b1c57a7fc9e268a0fd9eac3d092b25dc44cc0fc28230a920ed0baa","src/features/gen_ClientType.rs":"a993d26987688f0f0adcccdc6f7e454b0f6825109c5f48fddbb88d04f847ce20","src/features/gen_Clients.rs":"53c51c3f2f6cbad020b33bd45d4af75d2bb0889a9be7425084a5a8c1d031054f","src/features/gen_Clipboard.rs":"a609ade26f2c3b90b4dda6b8890240be5d1d4c903d7311f41650785a8256da17","src/features/gen_ClipboardEvent.rs":"8e57b7c0c0b8d8118f94b475dd9f8c81ed28f36e7a29a69f7fb3d3edd61f7534","src/features/gen_ClipboardEventInit.rs":"69b0d180e2bbd98d3d2f63ccc6c4227ea625bff92adcd0faba36454ced9d9ca4","src/features/gen_ClipboardItem.rs":"0757c396862782e5dfd879918067140ada2360c6310f38b2573029c1514a00f4","src/features/gen_ClipboardItemOptions.rs":"19f35a28d4cb0fcfe21cb4ce0e4edc304ba58f35f0e8b1187f212abf83c11733","src/features/gen_ClipboardPermissionDescriptor.rs":"a72fb823f1700c60d74c9ec4743fb4d15cad86fe7fe5da1a047ddcd3fa45085d","src/features/gen_CloseEvent.rs":"2cba52c53ac7b6fb8e6f152f30d54fb8f9009684ce63b286250a942cac971841","src/features/gen_CloseEventInit.rs":"5947b5d0cbc86c0d70402152279dcd8f58f3696a0728f47a8494a0862aa0a3c0","src/features/gen_CodecState.rs":"289686512c0bb6f188b29ac9a71d628f5f96440277c82fea4699f3330a3360ac","src/features/gen_CollectedClientData.rs":"970a7a54b138df25c3fc95c4cb1710454c915ab9491c2f327fe5a5c1ceae7bc3","src/features/gen_ColorSpaceConversion.rs":"653730d79a912aac1f87998a7d7b39aaff83ba7bd7e376d14db00b8e4ccb3baf","src/features/gen_Comment.rs":"f36ddc1c763d44f3b7cd406d740482c7e0d51d9ad1f4123634be59831fc50d11","src/features/gen_CompositeOperation.rs":"cf9aa8f73ad59136702222d1b2dd5573335bb82961eaddbb0a4825b411713502","src/features/gen_CompositionEvent.rs":"bc37f7c7e4e1c632f446e75bf1328fc17013910aaa3708f03f6c5f2db3290548","src/features/gen_CompositionEventInit.rs":"22942ad98f52bcf41b958c95fe342684fdbe2917762871a231dc2d4ce8b0b1fc","src/features/gen_ComputedEffectTiming.rs":"6d092206ff79ffd1c30c251352e8deee8e62e0a08261896b182533a43f822429","src/features/gen_ConnStatusDict.rs":"7c2957024814773a23d01696e4ae963d22cfca1f63769479154ccea94215e206","src/features/gen_ConnectionType.rs":"e6e56569fa7541ce4f9aaab8083d543fd447467cb36ef456d85f32bd8d33c6cf","src/features/gen_ConsoleCounter.rs":"f8cf2341830b026c9ccd8fabd672aeb94e0bfeacb2a86ee39694661ed9368106","src/features/gen_ConsoleCounterError.rs":"08ec0e5d232a4dc77bcb1ac20f687d83c58e4704af03867ee930ff34d0478f14","src/features/gen_ConsoleEvent.rs":"87c19f73e208ad7f203a275518afcb2914114af93edb6d812ed0e08f901530c3","src/features/gen_ConsoleInstance.rs":"0956be3c5df0f3e97ea12b38eca5d83ea8c78bed5425ee16b18c76257c525bed","src/features/gen_ConsoleInstanceOptions.rs":"033a7f39009e0a91135cd6de63c78aa79754d78f63f872fe232bdfe35b42f16d","src/features/gen_ConsoleLevel.rs":"20931320bf448747a668bcef04b60f8c738633bffc2b613a1edc86072ce362ae","src/features/gen_ConsoleLogLevel.rs":"6cd7165ba98b61d84a94f196848d086f20db9c3b42e14186dfdde203f8bf0e6e","src/features/gen_ConsoleProfileEvent.rs":"1224b2be97747c23a6dcea63101a9b84920cfbc8ea5422380b18e8521fe58803","src/features/gen_ConsoleStackEntry.rs":"4a5a7e43e97e4bad51857335f580145e672721e2b848d361ff059aeb8d2ccd6d","src/features/gen_ConsoleTimerError.rs":"2b3bf42e30dc6448c5505a3832e1484e8d2bac3b58d7aae6e476bc3cf19452be","src/features/gen_ConsoleTimerLogOrEnd.rs":"43a8f05640bbe3fd0eb676afa8a40b48ed553c3db3911b3346ca616526123a31","src/features/gen_ConsoleTimerStart.rs":"4e67dc757ea324a22f0afd7d3f96ef7e516caa3b1d1e98a0ea6a3fa41999ef34","src/features/gen_ConstantSourceNode.rs":"6b5ef2fba89a757c9a774822c1754c97175c5bb8f2e45e3565934e45f955a09d","src/features/gen_ConstantSourceOptions.rs":"1b5abb3723b7c2ad41cf5e17c523ff912b4e38788b544d783801c4a1c9854dd1","src/features/gen_ConstrainBooleanParameters.rs":"de495d0f1e4bd0876df16bf96919cffc2441046b0befe9b20fe4dcf8146288e0","src/features/gen_ConstrainDomStringParameters.rs":"6f8e175cd33ff62e139a1e92e1b87d99df6ed0f317c82242ffcdbaef52a3f328","src/features/gen_ConstrainDoubleRange.rs":"b76545b90b74d7ef55cd0464591edb3c48df577154a274dd295b3c839251133e","src/features/gen_ConstrainLongRange.rs":"ee730a6268f4c41a757c42071c7d22b66fe5fc53c6d838c9633bc2891ffb30d3","src/features/gen_ContextAttributes2d.rs":"26c39bd07490b7703b178b824cb9d758c8e00953dc7bf32cb0e99cb03556ce7d","src/features/gen_ConvertCoordinateOptions.rs":"a0739f9825f6f86ca8d3912b496d34782c87bf426f9b32d69729da088b8f7982","src/features/gen_ConvolverNode.rs":"0170e943dda5e557e97885e778510d3ed4578b554c3bb6043d3b9d667a0e6611","src/features/gen_ConvolverOptions.rs":"c20e1230aa3541ea7a5c4fb3de7bf419aac46dc82ba2d7b52430acd9c5d467b5","src/features/gen_Coordinates.rs":"0362a23495b736e4c86708866453eb3f168cd39d71586f21b9780105fcc5909f","src/features/gen_CountQueuingStrategy.rs":"7fe3325ab3de5ef6ea38a53f957adbf8d580bd2f3438827b5e6ac3741e95e332","src/features/gen_Credential.rs":"ddded70cc2575c15db40e12cbfe35f3ab4deb94fb52681ab81066f0756f58e31","src/features/gen_CredentialCreationOptions.rs":"5939e418096b553695091984984f62d26a4a3459055c811f191d68af40b6b1b5","src/features/gen_CredentialRequestOptions.rs":"ab6f8540008e0d76c81ff7e6b196ea8ac9ed7a40b8c75cef4765604c6774ee92","src/features/gen_CredentialsContainer.rs":"ec133a72849d444c7ac8e2be04e2dd7384ad04b2a7d4c7927b4d9eafd8bb8f6b","src/features/gen_Crypto.rs":"6ae1152ebfc6c06a5aeda4275dd6f983012359b8b91049bfc6d5dbcf0b42db83","src/features/gen_CryptoKey.rs":"8142c9721bbabc6e2cfff06fdfedc8179958ef85854c5d9d3a8141d1cbbadd6c","src/features/gen_CryptoKeyPair.rs":"b84360bb0ac394381377f49c9e14ff98524d353a3d6fcd39deea40a88e659ba9","src/features/gen_CssAnimation.rs":"b89ea2db873081e7bf3443894352e759112daa9bffa97eb0a8009a38ff59157b","src/features/gen_CssBoxType.rs":"5bfbf9397cc00ae6e3dc0e5ba06d76c04e8052d43eeb0ec8be98032501cb580f","src/features/gen_CssConditionRule.rs":"b9b1179b25f4a94aeca592d0a831c2a7ccb34c7f079b37f3d02819be3407ec8f","src/features/gen_CssCounterStyleRule.rs":"ad0be1c8ec0f863e54050912a973a9d0c2a6cb5cfb8909f18d7103c7a3177074","src/features/gen_CssFontFaceRule.rs":"76abaea1622a7d541349c1baeee1827c2395c10b1795372040d3013f1d52cf4a","src/features/gen_CssFontFeatureValuesRule.rs":"331d61d8c583836e465b5f13b353b36e63cb9ba8a1d657c11603e742711a1a32","src/features/gen_CssGroupingRule.rs":"1b21020cc17aa74947c9771310279ba0de5dd990d9bb961716fff228cdf5657c","src/features/gen_CssImportRule.rs":"daf9172224e2d3397d4c34d6a09bba433d6c4f39a9be60f70daecd4193fbf0fe","src/features/gen_CssKeyframeRule.rs":"4638a3a964704f3bf5e8fde66d5f963a36edfb9ec7c31b979f42379af2385117","src/features/gen_CssKeyframesRule.rs":"116b9e591c9788a8f4e531f1980cc47832c7aa06a0b0961f071927cad5e4df11","src/features/gen_CssMediaRule.rs":"4d59f3424ce083f75db3524513b32c4e5e8e0a29cba796b53ed23e04af579cf9","src/features/gen_CssNamespaceRule.rs":"94cf7c7e1cebd8df2fca2187f7bd8a80dcd85c595c413ae19c2ba1576c2e20b6","src/features/gen_CssPageRule.rs":"ded12ddc5fe551ddda61d2d0890bf5bfbb0b8b36a6601c68cbac52a557060b03","src/features/gen_CssPseudoElement.rs":"bb0aa5e33a7a8a675ea4bcfbc9c0d2e1f3fa1843d86b8a91a7abece3db778b0f","src/features/gen_CssRule.rs":"aa74335aff29a73628c67b14f46e29c42141d6a3f36bd27623f9d3a368983228","src/features/gen_CssRuleList.rs":"08b0d5eaaa7e09523b6e79ed67d780c3f3474b351773b14806684b8878a494da","src/features/gen_CssStyleDeclaration.rs":"b3348d841df8b4fdfa3207ef5201ec0becea52c2e7d1c00c14daf1d736c2e72a","src/features/gen_CssStyleRule.rs":"b1127dd913947876d45822a862ff2df12a1e5595ed3eccf99b9283d8a6d7f671","src/features/gen_CssStyleSheet.rs":"bf41ce72b272720972cdbf3be536dc64ee950c57c59e131d7d975c94aceb824d","src/features/gen_CssStyleSheetParsingMode.rs":"cbd3b161f205a443cd9b9bc0f31a6c9d213c902f128d8623bd7aafc2e5c33774","src/features/gen_CssSupportsRule.rs":"b0784a3832bef9af1882cde3b8d129224403d184fb08423a2f8049ead2adc75f","src/features/gen_CssTransition.rs":"9b666bdc016c13028ac30f6e3e6780ee725f4123f6cfab306da831fe0bb2dd2d","src/features/gen_CustomElementRegistry.rs":"18e18fe08ee429e769558f7fcb3e851a57477ebb930a33c9aae8bdbc69c41c99","src/features/gen_CustomEvent.rs":"99c225a5f332bf497b5afa9ca60f105db36c2b57efc270c688c23e47bc0d1e37","src/features/gen_CustomEventInit.rs":"32b95effd707c2c65e35262d3191dd2876d1f0d82a7402e80c53fce1f0766dca","src/features/gen_DataTransfer.rs":"cc93e717e1f2e66f03c5eab713952c6a91a160b868d1081f59c935eaa156cf58","src/features/gen_DataTransferItem.rs":"12a6c4119689328bb5594dcf40a9b63172f4d329d55b23e59eebdae8aa0da4dd","src/features/gen_DataTransferItemList.rs":"26dc140d5c0df3d4438f0b6da9675cae9d61dd3919b7b1919c0ccad7ec19bdd1","src/features/gen_DateTimeValue.rs":"bc1fdfea44288c74fa6d1a5218f4c19a88337aa8cddc5b25fc11869207fce13f","src/features/gen_DecoderDoctorNotification.rs":"ffba0a97060386071dfb0ea01f4526dd1fff5f3965867ca184abee5d26103058","src/features/gen_DecoderDoctorNotificationType.rs":"b55fe8e4f0ea8d2a0a580d38666c391482d0e3078e67b244c4cfc3989a260803","src/features/gen_DedicatedWorkerGlobalScope.rs":"96578a5e8a269aeb63dcd60b058bf3f8458c4107238e3c6defc2d45712a15c09","src/features/gen_DelayNode.rs":"35e7e6af363c85304df5c05229455184529fd469813a2168aa247e3e2e694762","src/features/gen_DelayOptions.rs":"f67ec541ada14d02161ec9c5f3e28e5a5b9668408482edf50cdf44c28a6cc0a2","src/features/gen_DeviceAcceleration.rs":"48470403673a9872fac1e5e81a8a343835c72f868d82cba5089c2a5687f2c84f","src/features/gen_DeviceAccelerationInit.rs":"6348af9f56b1b2d6614a72f29d46b00cbc7ad29c0214fd3c4ab3d202b2ece98e","src/features/gen_DeviceLightEvent.rs":"e4cee15b6ee3ebbc3f09327ebeb7fcddf06796527117b6fffa956f76207f5699","src/features/gen_DeviceLightEventInit.rs":"5b77688eab5ede129325063739cf9d0ad9407e3b8120cb9a153e558e4bd754e4","src/features/gen_DeviceMotionEvent.rs":"50a2fd97f8e767af589afb363491e2b46f094e81c5b7efb896235bdfc0d4bf45","src/features/gen_DeviceMotionEventInit.rs":"fce3c65c5622a420c3b44ceb0bdca2c2e118a9831b25055b3b6978f800a6063f","src/features/gen_DeviceOrientationEvent.rs":"6bf6c75bbb520c40ad55403e33693860f7c20c4cb460ae63beb4740ffe3a0629","src/features/gen_DeviceOrientationEventInit.rs":"416305d0f2453dffccb35a7e109d9eb881ffb93648853660b76d2ba4aa5609a1","src/features/gen_DeviceProximityEvent.rs":"1f9774f313c0b6238dbf07db99f3778d93954d18886327888e1a004bad2bc4b9","src/features/gen_DeviceProximityEventInit.rs":"3fbe9c34993d917d3be67316ccfa158e37d9f143eaf9f54d42b799c3ad568eac","src/features/gen_DeviceRotationRate.rs":"fda4720a54efe410fc043c97777d19f634fee56d11abb39ed7f48cbf159f4138","src/features/gen_DeviceRotationRateInit.rs":"74b18b8db0a0c4a727c857e6c2ef183022207c9d7d0718300a0a3cfa334fd754","src/features/gen_DhKeyDeriveParams.rs":"ab98a6ac96801c2ed04c112c5895c10386884264d772a7afad0fc5faf2bac62c","src/features/gen_DirectionSetting.rs":"649103ca0104b17d42175eb2c720ae880a4c49ded179cf2e9173b328d85c227d","src/features/gen_Directory.rs":"676d19ae092ab20787c82f7702d4f806121f6097200058cebb32a129be6e625d","src/features/gen_DisplayMediaStreamConstraints.rs":"fff2a7f9ac235c24f1619490397512c562bf6336bf37772977bd78169efdd880","src/features/gen_DisplayNameOptions.rs":"aeb36164ea21c53dedb81ccda9eed723fa8bf119809c9538b170c60c85b3a2e5","src/features/gen_DisplayNameResult.rs":"ed1f6b757bac7a916ca368beaab808242fc547241e805af37463bb5d067e811c","src/features/gen_DistanceModelType.rs":"3ec072394e165022bb428e7f5fe33814a69ec6fbc7ca8c121c346d01effe01e9","src/features/gen_DnsCacheDict.rs":"2321572217ce877b8939699154afe6c433b616cc9e16f4db654772b96e69575a","src/features/gen_DnsCacheEntry.rs":"0ad82465778a66cbe76f7fa75ffdbc9927c3306e56a99ca775ae26f9abd4ed3b","src/features/gen_DnsLookupDict.rs":"664d17117289dd5e44ea8d96f37f2b9277764997d895e610289040099cad8632","src/features/gen_Document.rs":"1e8cac11133b93d2c7202e2b8a24f7409821f2c4e33d724cf817726c5e338714","src/features/gen_DocumentFragment.rs":"178cd4cd3f1c86333f5a7e649ee04fcb7c6878b6ad6d5f59ad7bfd0c640b53bf","src/features/gen_DocumentTimeline.rs":"9a4b1d746cca866634bd781e5143668412c64b9c1392ab0c59bb7d84dbff9600","src/features/gen_DocumentTimelineOptions.rs":"3508efbe9cc4eded432663564f5c71e7d6cf2a03ab390cd2f8461d2204028503","src/features/gen_DocumentType.rs":"825c05808ab210957d9d379921747ab64b29de6194f72f0d69db180df9d19ae4","src/features/gen_DomError.rs":"057483b827b45aee89a26e894bd0b25caca44c39f74e715922d1cfddf4c7edf4","src/features/gen_DomException.rs":"2943c46f0da528e820356299996c48d0f248c0d9a59ab839e3957fb64a997353","src/features/gen_DomImplementation.rs":"a4657e003af5d78010a8d98ea9a68fc76f8c48baa01c2921070d82c9e48be0bf","src/features/gen_DomMatrix.rs":"289889707479f48ee01b3b18a4e43aec2dd497b11934f429aa93efe414b401c6","src/features/gen_DomMatrix2dInit.rs":"06efb39fada6e987cdf6c9a36b1241a27c7818725468026e9afb49f79835ba09","src/features/gen_DomMatrixInit.rs":"6e72dc38f6532cd5bdb5dfe6df9f24346850676479a3682302f2c13f464b05f0","src/features/gen_DomMatrixReadOnly.rs":"cbb55db46ec4ed483c63f862d79771afbe2a9560f81bcfcf351c151428725bda","src/features/gen_DomParser.rs":"e299ad75f73114da571f37b63d8be9b8e630c2fd95b7c6b4d5cb452e3726829b","src/features/gen_DomPoint.rs":"0a95d76ff8982a4aefdb100f8e17db39738888e4d78dba08dc24c6eb75af090f","src/features/gen_DomPointInit.rs":"3a75ca23258f4a1f2b052af176288b9cd62cb8a19291121f298976921cfe8691","src/features/gen_DomPointReadOnly.rs":"fd0d3f9d0d6f9fb0256a098832c5f3d638602a29a89e93c562896afba0848570","src/features/gen_DomQuad.rs":"685e12bca5354f41ef1e62e464d431909a0720b78e61348db679d7e1164a513b","src/features/gen_DomQuadInit.rs":"6ed79540ef5b5a8fdb5feb315923f7a6a0267d1cfa2d3d1e14d0957634cdee01","src/features/gen_DomQuadJson.rs":"ad845059c6f4438aeb32a951ef984f552dd59d6605999a18734c3d62d06b37f6","src/features/gen_DomRect.rs":"cc892a305c0639a7b2ce180aff2708ddc8cef4499ef74b19d2da29bca3051b0d","src/features/gen_DomRectInit.rs":"548c703eb5e17bb5a3a4f90308000a49bbb53be144640d2bd5c5b99b09a9a294","src/features/gen_DomRectList.rs":"cfa519f05431bb9e63e5ae7755fc3a617b45a06790c5d2ca00319e8abf4c22be","src/features/gen_DomRectReadOnly.rs":"fb836db1f8b8f2fa09432f2a2fe4650e35c04452fc3148106699b5d71c4690fd","src/features/gen_DomRequest.rs":"c2dec73a76f48fa9d4a575be70efec82249a7c549a3bfb970e4e4159f5caea13","src/features/gen_DomRequestReadyState.rs":"a4361128dac131bcc2512bbf6db9c08b4312e8db72c3684cffbea6af0c43d9a6","src/features/gen_DomStringList.rs":"c3e70df285cff62a10c2faf605ca531a19ad8698ad91aa919354d4b16928764a","src/features/gen_DomStringMap.rs":"4cf80b49e99e25d079ba9f5c858814bd8f421308a4cf6b718955bebaecd703f6","src/features/gen_DomTokenList.rs":"2f2cf348621da9a4ed46139c2957a2e9d322e2684300f661c4abf1d37729feb2","src/features/gen_DomWindowResizeEventDetail.rs":"af3edf71ae8aadc285412d7dab07f39d4301f6ec6f59c4cd784db27cf9db0ace","src/features/gen_DragEvent.rs":"113aa5d3cc60f084030d7c16183b254f304a80771e299d6a651a905b711afeae","src/features/gen_DragEventInit.rs":"4abfd006af8326be3c039e4a59468463209496409e211cc5307c50f11efb6b80","src/features/gen_DynamicsCompressorNode.rs":"b83933de65bc45fac94351f30d80339f7ff2cb744a349b9536cf900142bf6a6d","src/features/gen_DynamicsCompressorOptions.rs":"12c66c386cce94f5e4da5ab59eb58fde276d1b23dc757c3cbfec468d2f2b216b","src/features/gen_EcKeyAlgorithm.rs":"177be560f40286e9e395cc85c269b6f5e72f9eb8da77a8275dac3c926deb2ae4","src/features/gen_EcKeyGenParams.rs":"c4fa44046626fec17e23bb004fff61d7b3cfed569e0f6f9bff71784e287757f0","src/features/gen_EcKeyImportParams.rs":"46383e050ccaeebf9e5d4428bf9b99d59bcfd3cf00105bd903c5b580dcd974c2","src/features/gen_EcdhKeyDeriveParams.rs":"dd4c6c2a2c41ee5bf5db62f3d289cc463a81311705873afe74461de9d46f0624","src/features/gen_EcdsaParams.rs":"16d7483506778864fb59a39e738c0d2dc1f7404729d6e2ccef9d3321570c0f82","src/features/gen_EffectTiming.rs":"72de93b3e0c941d917ee59877e142f40d3caaa6ab1221f548d2616af33f10c93","src/features/gen_Element.rs":"7db96bde4b8390e31eadae63cdec1ff4a9ca9e41b08d05e6cf8c4fcb1cb75836","src/features/gen_ElementCreationOptions.rs":"a29ce5f412c9a6b78a5fcda91cc4a4fbcf593722858974de3312180b86860bc9","src/features/gen_ElementDefinitionOptions.rs":"7f208f69134710ce8d926d21f3c99f8f221ed8544b542fdf6adbb07b0d00b29b","src/features/gen_EncodedAudioChunk.rs":"ee6e56d4310a6aba4fe95aef09773a4bc6bedbe8d3d07cc8e4ede154004cb714","src/features/gen_EncodedAudioChunkInit.rs":"a0b944f3a8b357256f4de1e948ef7ec705096d84e35151127e5deb5ce6c0397f","src/features/gen_EncodedAudioChunkMetadata.rs":"87b5da25e9dae9190b3ec489228ac739454fc88311e4ee9cfbb94c703f35113d","src/features/gen_EncodedAudioChunkType.rs":"31eb58ee6fe36c12caccaba0e5bc7418d20d5a05edacfcb64724442da0e5ac10","src/features/gen_EncodedVideoChunk.rs":"86f447488b37213b2746f7f2fc769b467b089351c75d6aef7fabf42b31230613","src/features/gen_EncodedVideoChunkInit.rs":"de3734ad8d7ed72b1119004e0619b5d831431e27fbe46a3dcbb0ef88c1777a69","src/features/gen_EncodedVideoChunkMetadata.rs":"c17c23a1bf0c458d6f583a4a531f4e42442eab0d76efe2e0db1340bc918f51b3","src/features/gen_EncodedVideoChunkType.rs":"d11b01b86f834ec32df5bca56c0aec69ac1304ab60709a361b1888c590a7509e","src/features/gen_EndingTypes.rs":"4c6e006e9da24e8070dcf6bb55ef945b4712828518b13bb1a696327aecaec301","src/features/gen_ErrorCallback.rs":"b2806dffe62b1824ed365f42c1b557ce57cbf2b27dce5053da9aa050bf2fe809","src/features/gen_ErrorEvent.rs":"91a80f8834192f299cedcb599aa184d2b8b41bdb1aeb9733c89eac82610830a4","src/features/gen_ErrorEventInit.rs":"bde9d396b2a365c286fcdf4f5f5e4c7554aa268334998696317cdd699f7167f6","src/features/gen_Event.rs":"c69549e7e14ef25d63cf5ecf8eab9996030118001dba8d277ab83436fe78af68","src/features/gen_EventInit.rs":"d89b8b3f8fa593c62c80184c382dd23d0ab174466262bd350933c13e13212db2","src/features/gen_EventListener.rs":"276d66f93e624e13bfb7e9deeee6eb513138a86263312d022174748050149d26","src/features/gen_EventListenerOptions.rs":"5eb262af294477ad4bde966a3aca2a001eece6619e385ce434cae41705043991","src/features/gen_EventModifierInit.rs":"98be7e2b2bac7ceda61caac73c016cb117c347e82f9e3fafb0135a36e003578f","src/features/gen_EventSource.rs":"98f5a34580e048afcbd9c314967fa130255a559bb151bc9bde375f4c24c1aacf","src/features/gen_EventSourceInit.rs":"271e499ec5ed43abf57f5cdae7c0a0b9e824ee63fb46bc5e7dff23bd65d3a0ad","src/features/gen_EventTarget.rs":"bbc16c538a25e3b8f6c1d65d6f4f9ead60ddcdb735e2435d5e2716eabe293b08","src/features/gen_Exception.rs":"7b88818a827612d04260d40289d96fefa7e4699dee9d77c8ac336dfa3c1ed478","src/features/gen_ExtBlendMinmax.rs":"3d33ddb26d68e21d2c2d484bce57122cac8ccd48788b215b5237fe5d638401fa","src/features/gen_ExtColorBufferFloat.rs":"8a567f81fa8d802cc82353f2a89ff74776882cbb1528cf200a9c4bd40fd4fb51","src/features/gen_ExtColorBufferHalfFloat.rs":"fce64d861eea29a2b3d02f8e218a5fa688d5853ad4ab4392d7236232cd332973","src/features/gen_ExtDisjointTimerQuery.rs":"517e487e7140eb059e3dda794bb2879fba8622edca87f1b9769b85823fa58d62","src/features/gen_ExtFragDepth.rs":"ec85d616c9821582115294004b2bee5ec04a1da9e31a13b7a6a9764a0a9985d7","src/features/gen_ExtSRgb.rs":"64437a88c9752f13d183274d67bd38e911de8fff4929df0609146f85c599cef0","src/features/gen_ExtShaderTextureLod.rs":"cd5657c8fa8fa8207c5801c7a4fb6d8cd1daebe8e87302e297c2b68eae1adc89","src/features/gen_ExtTextureFilterAnisotropic.rs":"d5717d45b4d1d007c2b2bed01dc4967abd21b06f9491f785fcd24dd34998b0bf","src/features/gen_ExtTextureNorm16.rs":"08b0da1131e769343cdd199b93d11b93f988ad2a8de39b592001f96772e17d07","src/features/gen_ExtendableEvent.rs":"d6bda62e5673870d29b9e5aa0874ae785446608c2222c6502bdecd522277f319","src/features/gen_ExtendableEventInit.rs":"33f3851c7ec7155359e10474b6c42f84225296a4e00a4ef16d94ac849a433558","src/features/gen_ExtendableMessageEvent.rs":"aa0700e0bcef80386a01f39b8081263b2ac65f7f967c7c295b8ff4c51fe8ee6b","src/features/gen_ExtendableMessageEventInit.rs":"29af87519be542bbe00b2d050de63d4f307379803ea4cbb6f0f4568aaa09ebbe","src/features/gen_External.rs":"c55bbe708bfd8467ce3e1a3802ca220a17f19a8bad00d67318db6067a16275b3","src/features/gen_FakePluginMimeEntry.rs":"d78635795534b757a5e262b821768ff85091cf12dd2a31565a444ed0ce2a99ca","src/features/gen_FakePluginTagInit.rs":"de7e9dc14a56ac5e8cf852274bf0e3f3d25922f4775125feb5d60fa972fc6b59","src/features/gen_FetchEvent.rs":"5b5c72d24ebec33b68fe97ea6fcf0f164f9ff6c8f35e63362b82035b598c63c5","src/features/gen_FetchEventInit.rs":"f27b3ffba3f76f37ff5b96ee18a0936b7b473ded57aece3fd361414994967563","src/features/gen_FetchObserver.rs":"e960853c635dfc01fd6eb26dfe21fd2a1ae6339db0910c331614478addce5a34","src/features/gen_FetchReadableStreamReadDataArray.rs":"6c92b2d6696b6517d19fe2b04a994589a6b7cb80c559c5f1f587aa3a84167011","src/features/gen_FetchReadableStreamReadDataDone.rs":"188b586dde52b31fed24644727fcb8cf759d6cb4da94e5629dc04904ed7944d9","src/features/gen_FetchState.rs":"b13ae496c9fcd00a581fe77e0edfffec399e6c89f90595974802c48bae9194ba","src/features/gen_File.rs":"a5f9f275a8f5d144811a20736269574249441008216a13cf09dab3e04166f85c","src/features/gen_FileCallback.rs":"0a6c4f7542435d35b398dd95fc92bb7e6c2da80d5bc519d62fcb25963638e09e","src/features/gen_FileList.rs":"f367e2c1a50e9fc9764895b9595c5b85507629ec4a4be1559a2333145119e27d","src/features/gen_FilePropertyBag.rs":"eb5ead802fa347c3c4f38c682f315419da92b22729a02c46e07ecce739aa661e","src/features/gen_FileReader.rs":"315b24c09854e27d0f52ede62808a3f38550ded3b13ea07f1427d0dec66d3d1f","src/features/gen_FileReaderSync.rs":"80fc86cf5f7a4de841c1b722485dfe049a64c4b626f173ff155d8f7cb68aa2ea","src/features/gen_FileSystem.rs":"67d07f22fbcc968a84cfcc0ce2551b853f763099c694a8440f5a152636b2e0c0","src/features/gen_FileSystemCreateWritableOptions.rs":"01bd51b67834a652a1d9668e39a273f4811bd7d1f5b9d229ef7e8ce6217d51ab","src/features/gen_FileSystemDirectoryEntry.rs":"2ccf85bc8967c0011e3d3091b5892c3d8b62b00074e30a898d80a576dda80dbe","src/features/gen_FileSystemDirectoryHandle.rs":"5ce3ac98efa3aa03291216828721b6d2af24123c39f9cacdf019d15f5c4e8014","src/features/gen_FileSystemDirectoryReader.rs":"95cef0146fa97a5849149c3fdc61deeb93a52fd1072374a8ffcd1765ca09dcd4","src/features/gen_FileSystemEntriesCallback.rs":"43a42c15dbc945ed207d9bb1a24aef56201b0d858ee9cb6fc406a6661fcc54c0","src/features/gen_FileSystemEntry.rs":"ad7dcb8ec02764dcc512a281b864fa656eed478ff3c2d82264a7985c639898a2","src/features/gen_FileSystemEntryCallback.rs":"0189ed3e10897cf299d1bc3860aa4299ea67fa2dd049f03ab9cf4aca2938873f","src/features/gen_FileSystemFileEntry.rs":"0910958118b84c620e1c75956c7e1dd216cbbb602d3feb48ecddeef3bc48bf04","src/features/gen_FileSystemFileHandle.rs":"c43402e5445709243c554a4a4a941b3f9b24f1894b7f454f4b0c2de5391d444e","src/features/gen_FileSystemFlags.rs":"8301d22b9be2033d054db5f9e0770c6b6b15c05ae58bf5bee52c44170b57b264","src/features/gen_FileSystemGetDirectoryOptions.rs":"b278869606f3b8d58e319bba37ec1b0702f30c8b2172dbdff4fa741096b762c9","src/features/gen_FileSystemGetFileOptions.rs":"597350e0b4038236985cdd45587887132edfc8c195681eb6cdbdc40865fa5188","src/features/gen_FileSystemHandle.rs":"d8d5ad7312c7becf77ce388e554c8d0d2855de7f34ff466a90d3204e13586c06","src/features/gen_FileSystemHandleKind.rs":"b1cb4170870a265bd5bfca4e6b466704d9d3cfe9964642abf72c58e506a8ca7f","src/features/gen_FileSystemReadWriteOptions.rs":"83b0c6a5862a6cd0c1cf307c3235d72817adb1c53cb29197d7cd77b9ff455b04","src/features/gen_FileSystemRemoveOptions.rs":"a0acba8ec4eab6504e20270dec83a499ff20be3583e1850407e6f775ea7fbc64","src/features/gen_FileSystemSyncAccessHandle.rs":"ccafc8962000a26eb90fe7523e812ec064b5dee852d0b5dca8a6d1d4ceb9a79d","src/features/gen_FileSystemWritableFileStream.rs":"df5aa99c9abad6e332de3616538c54dda67af6b768e59bb845558c428d99315d","src/features/gen_FillMode.rs":"c11fcbcbef200567dd1396b3a5ae5d9192b404099a7b680b4659f43f849d3f1c","src/features/gen_FlashClassification.rs":"6fcf08e25b200ee8b009c054cb28555219a3679eb81afe8b40623459ab4e23dc","src/features/gen_FlexLineGrowthState.rs":"a02c51ba4f3b75bc4fbb3b800847b9fe8bcbbd5ac002872bed1032fac6397d61","src/features/gen_FlowControlType.rs":"2e6e1c5bd30c509be52fa0f4edb8cca64f1505babce2b9f06f6d69a0c46dfb7f","src/features/gen_FocusEvent.rs":"5da4678e0fe2bae579ffd3e0bcc3c6855b584c8cfb2c872a4177dd616da11be4","src/features/gen_FocusEventInit.rs":"c6111234853d90f32ef3a97a679c8f77854d7a54600fec360bdd504cac0dee01","src/features/gen_FontData.rs":"7be19547cdbc2bf3b4a1b1477dd7b6f8a01052a5930db9745e049cd75fff8906","src/features/gen_FontFace.rs":"2ceb8cdb69d8db4ce0f70c2ff4a0dc02acfe85bc89718c84a007088e4ce4d556","src/features/gen_FontFaceDescriptors.rs":"a1bc1e1e100fde83df256eb57650e720ddd1f1283c6023cc14562b3830388109","src/features/gen_FontFaceLoadStatus.rs":"774541eee9cb1ac54327545245725e7a6f36649badc73296f1c5d911d618e777","src/features/gen_FontFaceSet.rs":"82f694b3342e6d86ed49ab1effebd46c4ff60defffca1821e2951c23f56b6e11","src/features/gen_FontFaceSetIterator.rs":"cfe74b4ff73094fbf47181c7df85fdee436d8110156b3916c6cfa8bdc803583b","src/features/gen_FontFaceSetIteratorResult.rs":"308391d77fc56fb3000fe50834211092023475aaf382e2485ee8a506891c1cff","src/features/gen_FontFaceSetLoadEvent.rs":"92b1f195a9812f0f0a51d235910922d7e1fd244c8e3f32618f3741406eb820b5","src/features/gen_FontFaceSetLoadEventInit.rs":"631e75351c1d1c93498f1a244dd9f878b8b351c6822b52544276358245f538cc","src/features/gen_FontFaceSetLoadStatus.rs":"15420c2ae2408330077de678d17f1305790c6a89e88174e37e670667ff029451","src/features/gen_FormData.rs":"dcca0bde2ef2fe625dd72ffe2a2f31e8173274fe3b50675f315cb1c8c896315b","src/features/gen_FrameType.rs":"f30491c7e8a2af1ba10ebbede3f8fe4c06b998214046f92e9547616c7a23aad8","src/features/gen_FuzzingFunctions.rs":"6fc5f1f2597d10a50dd51cef5ad9d03af2b09e7487b23b6eaf38a963ae88ec96","src/features/gen_GainNode.rs":"78df91a76125f922d00ed74567ec2a23526c282200eddca886beaf574e0d5a65","src/features/gen_GainOptions.rs":"70579b376d820aac09f994b60f44ce131d45ea3e7249f140a83911729eed414a","src/features/gen_Gamepad.rs":"63a888551ca8b0cb48d1e8cd5a37da5b1a55cd8207f9aa115ad6b6d48d2ddfe4","src/features/gen_GamepadAxisMoveEvent.rs":"408a83e749cd25c7fbf4bbb7f8e1341da092d3dae36ef86752f866dd53ff02dc","src/features/gen_GamepadAxisMoveEventInit.rs":"a6a0bd810ff691e092b247381b61fd503f901aa7dc291b1b6e6117764cfb7c82","src/features/gen_GamepadButton.rs":"9f32885dfaf7c3ea57cce536c06748698f42e19b768a5df587447621209cba49","src/features/gen_GamepadButtonEvent.rs":"720fac3c9c1ba591ea8078ac2f7f38f270a74fd94e3f66d1cd08bd3a05a348db","src/features/gen_GamepadButtonEventInit.rs":"51c41e942c1f4eaf48d7980f64013dc22d044f8a70b2f941be161140a14b95eb","src/features/gen_GamepadEvent.rs":"60a3445576670ca75b8f30d8dfdca926499d10c563dc8f897f8e680f6f82cee6","src/features/gen_GamepadEventInit.rs":"94145a7ad65b58df31f2027176ad6146e7c7749e71563f5c9ed54f674aeed214","src/features/gen_GamepadHand.rs":"eb082eaf4802c715ec0476df54596b120c858287ef565f091adb63e3db1f6f17","src/features/gen_GamepadHapticActuator.rs":"9b9210126f2d63b9d9d677e7dccd51b44dc0f59e01476c866cbab98cde40e37d","src/features/gen_GamepadHapticActuatorType.rs":"02f6360ae91f4f951c8bbff2b5a510b2b417dde3488defe5b77a0aed153460c5","src/features/gen_GamepadMappingType.rs":"42f605b364f3f6b3433ced7954c94c9267ce0b524e33ea39138051a79f890a52","src/features/gen_GamepadPose.rs":"413e86dc66864ea730e66caed3131c344c4c309efdc8fd9d3696d05545225570","src/features/gen_GamepadServiceTest.rs":"a3ca974f7aeb433a1ec6fbbda88999e77e05f6dbdd6cc84496f2200a45e334c7","src/features/gen_Geolocation.rs":"ca7fb5519d00bec15a86bb9debafd95a466ec2ac8a9a606662025ede5b7698c4","src/features/gen_GetAnimationsOptions.rs":"f64fe73afe11796d4e775b587fb3e62bb0bfa51cc9d5e42ae73a91f3b34b3906","src/features/gen_GetRootNodeOptions.rs":"6805661462b5996e3f827a3fe89ba7ac26c0b732cd914bb7704807cb07092af6","src/features/gen_GetUserMediaRequest.rs":"4a843d325bfe1a9e772dc03eb7a381d325e08d5cfd70d45e461742aa87bf751e","src/features/gen_Gpu.rs":"5dd645434fbd64fe9186164b96e04cc6464c2cb414b9bde5caac1cf646d83485","src/features/gen_GpuAdapter.rs":"20e4d231b2f4b374ec468396df76440461bcf31709751cf03e577b3efbd44bcb","src/features/gen_GpuAdapterInfo.rs":"13443ad87ba0c2b3db07ffdd3ddef41a2035db6c088e107288714092704ed8dc","src/features/gen_GpuAddressMode.rs":"e13013c2fa7c6fadf7756d7867d9965a8bbd1399a911a3c088327792c1982993","src/features/gen_GpuAutoLayoutMode.rs":"67de5388b4849a7379f63ae4ae431a0c9b6b9757ddbef41386d394e9beb402a6","src/features/gen_GpuBindGroup.rs":"cc035884d63d097a331ffe8aa5e7c7a416ed4046410f00474e2be4644327916e","src/features/gen_GpuBindGroupDescriptor.rs":"e117eaf2d2df71299860dd55527e5926979b46064119e5989f8e25131c51624f","src/features/gen_GpuBindGroupEntry.rs":"5b9add12bb0b8520c04f941e109aec5bc6677f6890ec9b77486e4f0cf58ebad4","src/features/gen_GpuBindGroupLayout.rs":"ab2fafd2b39a645f6c99926fe089eb329298f745bcc617e1b29d4045abe2783e","src/features/gen_GpuBindGroupLayoutDescriptor.rs":"1b65053927c07b23da12e9928abc386ee78d6951d51e098cf70fe08c40572242","src/features/gen_GpuBindGroupLayoutEntry.rs":"62d3bb4fd18b9c4dc5c997d1432931e8a8f2499efde1c803019459708be4b45f","src/features/gen_GpuBlendComponent.rs":"e42ee14b444f2f5d93ab295f99970943f103346c8979bd6ff2e98cd46315bea1","src/features/gen_GpuBlendFactor.rs":"6ee1de70f87ec03a4c5b55c3bd772bebcb9801785354d8f35b10bc0bf983d636","src/features/gen_GpuBlendOperation.rs":"162a802a824e214dd016baa3d33d6d6ee18909eb6881461f10161e08cc3b01df","src/features/gen_GpuBlendState.rs":"dafaf1689cdf28ee4827ac2cdd1782b02a4e8f65fa8352fa6d7397a31ee29d79","src/features/gen_GpuBuffer.rs":"e0fa2e0be21fc9b1e7a3eca2de45fecca2daabc797c2b13964a7f8421731d44b","src/features/gen_GpuBufferBinding.rs":"e45719ef72c49572eccff6913adeefb2746c90da817f1f64aac7fe768f5715e9","src/features/gen_GpuBufferBindingLayout.rs":"18ebba6213b24c56385bd113ee7952c11ae3f682c7d3d3fdcf6f76f3199b3df1","src/features/gen_GpuBufferBindingType.rs":"5d9d6c44815cec2507552502d9f25c0bf02f393b4de10e387362aeb018e68769","src/features/gen_GpuBufferDescriptor.rs":"37153a7281527d3acbfa1d78af69c1b711eec16b867912439650fa95a736cf34","src/features/gen_GpuBufferMapState.rs":"99fc3692c738dd44aa2d2c23521de18ea86a3802ae095145da34991764f3ac77","src/features/gen_GpuCanvasAlphaMode.rs":"683a3fb1b61c3458a35c1bc0f30fd3279a7bd7642bd6071a4b0392dcc111e166","src/features/gen_GpuCanvasConfiguration.rs":"00449e2d7cca9088a723ad2bc558bb151c76d4b61d55d48bb1237a4a57a445d1","src/features/gen_GpuCanvasContext.rs":"5e4b7367dd92ef55b664f8444a8d7ba0ec3b8029209dcdea08a71f6a5db6d6bb","src/features/gen_GpuColorDict.rs":"b3f9a501c8d0dbb5477883c198a6823965b009cf931e4bee14aaeb0dc4ff066a","src/features/gen_GpuColorTargetState.rs":"84f19302a9854ee39e22c0be252f2d2799e9ff91a3e1accae0383e7703b6b455","src/features/gen_GpuCommandBuffer.rs":"ebde68d23162df2754525b23e3101003cc40f8e8d8928db9a5f74bddc1b265bf","src/features/gen_GpuCommandBufferDescriptor.rs":"d42dbeb32f018dd0913ef5e73efbc94db6cd7f6371064445548142ca8fdd0e69","src/features/gen_GpuCommandEncoder.rs":"a3e9aeb2dacc58ca91cf1349ee63bfbbc318c69b712383737278f0ce8e1cf487","src/features/gen_GpuCommandEncoderDescriptor.rs":"27ec41838a82791790625563468ff6b43028178a630d57203daea90977db1b0b","src/features/gen_GpuCompareFunction.rs":"ae884092c51c53235232329e46a39bf221f333833dd1e4b33374d3b29172df87","src/features/gen_GpuCompilationInfo.rs":"d5e6b09c9bafd4fe18691c85eb940d99e174f075db6d7e9fd4e66a54641a2772","src/features/gen_GpuCompilationMessage.rs":"8a660d5d68b6d9d639dc827dba68e35375c45f65b3cd03e2d4830a5233f08b75","src/features/gen_GpuCompilationMessageType.rs":"d19626971ee46cda6d599d9def14e6dc9144cf1142f199e97b9dcc8ad9f9ea8e","src/features/gen_GpuComputePassDescriptor.rs":"c4c58c0568712e42460e0f1fd207d3b3ed174a68915cd857af4f7ab47973263f","src/features/gen_GpuComputePassEncoder.rs":"a057ef0e52e085a615c225fd492319b3fc6af16244a393a6eba8dafdd345a89f","src/features/gen_GpuComputePassTimestampWrites.rs":"32744795b5884d72e26906bece9763dd2645ecff6e6d396d7de07c1651f42d7e","src/features/gen_GpuComputePipeline.rs":"35d0b270eed79bfe89d56f94403aca4454deafc7c9401ce2a73658e31a94a97f","src/features/gen_GpuComputePipelineDescriptor.rs":"f340eae850047c4f02a67520e1a4741d84b05bad66d0643854959be71e2fd4f8","src/features/gen_GpuCullMode.rs":"0335fd26ac547a60a7ee427154942ed65bfa3ddcce733f1f3eda85c184bc94d0","src/features/gen_GpuDepthStencilState.rs":"072e14563d03ede4936ec119647ebf30128ccfb6ed8c1861ab51204e7c2dd217","src/features/gen_GpuDevice.rs":"3a28fd474d0d8dc825a098e62caeed36e9fcfbaa7fedab8a0d26f11c63cee100","src/features/gen_GpuDeviceDescriptor.rs":"42bad52b1dc7565a2be54fc22c79941bf5fac6fe39d8bb259f82fa0983321678","src/features/gen_GpuDeviceLostInfo.rs":"4044f832c75148eea000d42b02b97bda03e9f095f3749dba7580a60e4b6dab50","src/features/gen_GpuDeviceLostReason.rs":"4a5e4246017f02fdb06a72cda4743fee924d5509f436823a9ecfd353f76d5e98","src/features/gen_GpuError.rs":"2b9d1993c7c9dc4d77e500bd4138b9f6e6495d857be41d6c9a97b074bdfa37da","src/features/gen_GpuErrorFilter.rs":"1531b2cdc97697671778c52adbb7a6ab61e1cf5f41750fbe225bff1abe5715b2","src/features/gen_GpuExtent3dDict.rs":"76a00e0474745d0931300ee066937348426dbc8e84d209df8771fa7be768def7","src/features/gen_GpuExternalTexture.rs":"763cc288af77099f446afd57b2a581baea90009aeb9e8075dc8c48edd81b7a2e","src/features/gen_GpuExternalTextureBindingLayout.rs":"ba217c9513d1319e2f5e20f852ca9454690753e1de99b81d82220882029159a9","src/features/gen_GpuExternalTextureDescriptor.rs":"944540070d479681bc9977681153e46c33d6ec20f74fa01de6d83e2aa02a887b","src/features/gen_GpuFeatureName.rs":"da038e8e94f6ee6bb2e0a20bfe65e9dfaa5cb88d42522a7e0cf62acff8f580d1","src/features/gen_GpuFilterMode.rs":"7f5b9498b678268fe6d263733a4dce9c983211397b0d3906f8039d014ae3f425","src/features/gen_GpuFragmentState.rs":"f9a4839958b58ed5e5e0d52977aef65127e417cbe3850d745daa597e0af36e02","src/features/gen_GpuFrontFace.rs":"c18309fd830fe1396ca7b8e023f03947133fb2fb88796024a0072c92d7c4f0f6","src/features/gen_GpuImageCopyBuffer.rs":"9d8cd1a580efc3071b80b023a735d513d8f6fcf2d45b866b94dc8e1ab458a58c","src/features/gen_GpuImageCopyExternalImage.rs":"0a5436c8b8c49d0e30371e2bed42964027fe832ea2c49c3c1d05520c7b4572e3","src/features/gen_GpuImageCopyTexture.rs":"28e25edac3971461d1bdc25e139b8959156c1ef734aba9a16190df4f39486390","src/features/gen_GpuImageCopyTextureTagged.rs":"e8676b0dc16d2ff702a4adc897cfe97f5fecdcda911b88cc27488aa40480ce28","src/features/gen_GpuImageDataLayout.rs":"811e6a39934dc42a960c3df9aa456fb36ecc274e066d0b402bb9c3a9da10b04d","src/features/gen_GpuIndexFormat.rs":"b8f8f7e39bad3da7e8c5ee2d1f93759537e19494febb77d350ab4d9d63cda121","src/features/gen_GpuInternalError.rs":"ef6cb85e9ca40ac51c188854a581cfe480cf0c3357b6b404f0bab6b690f82556","src/features/gen_GpuLoadOp.rs":"dcdb0a1f37f80a7a3e32680e275f7cca5aafcdaec828bcb827b1600a80d1b4a6","src/features/gen_GpuMipmapFilterMode.rs":"91766a86ecf0191ad3475fa864ade484d0925cb365a0efb97386024012c32058","src/features/gen_GpuMultisampleState.rs":"cd851a499ea4454b5d6759f6efc2baf1082a345d1dc42219b5b49755425855ab","src/features/gen_GpuObjectDescriptorBase.rs":"a6faccafc7c6aa16c74516dff2718dec5aa8a285916ca42c50ecd888aa7f6554","src/features/gen_GpuOrigin2dDict.rs":"a303f5de1e1614129e48d59d18c6ec90b56cd9a5f8ed28bc321438fb17e23b62","src/features/gen_GpuOrigin3dDict.rs":"4f6e09ea0abe2c22bcc485d75eefb07aef073aba3d63b3cccc5a66e24d1d8518","src/features/gen_GpuOutOfMemoryError.rs":"7cc6aafba18c0a166e69b9276eef73100025a2dbb655ba410659de3ecfe5c709","src/features/gen_GpuPipelineDescriptorBase.rs":"da99e10bbf7823145b7f7db46a7b00d1150978e15ff85324898b15706fdfc770","src/features/gen_GpuPipelineError.rs":"afad36b096807c6219bd34753a37161d5f8744133577d6200f3ecd61e04c429c","src/features/gen_GpuPipelineErrorInit.rs":"14943eb9c3625e3dec25000cc5d33db3e03ac178da4d92faac77fbd8fc67439d","src/features/gen_GpuPipelineErrorReason.rs":"7246206cea6ac7141b118676f4cc04a62cac5e5b1d5d78b15fc569ae358ac0f8","src/features/gen_GpuPipelineLayout.rs":"b9fca87d6a3050c1b52de8b1d48a278e8a2f88b8aa6d78faf0161058cf3fc475","src/features/gen_GpuPipelineLayoutDescriptor.rs":"28e441a79f89543f82d69f596be1d9ca76eed5e1ace26b71b53ef00c0b176748","src/features/gen_GpuPowerPreference.rs":"d6a0a0b4bca9d4745242389e030bba3f5cbf65d50a54ad13002e7915358072c1","src/features/gen_GpuPrimitiveState.rs":"db064cf5d19ed6eb90aad57322a27b51d5f56304544c4d8aec7f09414107d250","src/features/gen_GpuPrimitiveTopology.rs":"1a2206072fadf23ba9d2e3c920a5ac19d5db3170279d2fbd17204f2f980fba97","src/features/gen_GpuProgrammableStage.rs":"771c9c1d0afe40f37319355d560c4eb083e70047056b3cbda257ab8deeccc243","src/features/gen_GpuQuerySet.rs":"4b704964ddd3b1e8d17dd809edc60280352a02deea6f1863e7fa5e56305f4182","src/features/gen_GpuQuerySetDescriptor.rs":"14d6418dad5adcdab57dd30431b2ded285eff338ae39e383bbf4e06cdb4c31ec","src/features/gen_GpuQueryType.rs":"98c94d3a56175db7bd89c9b7715079d89e143a40512d04d55c6839db27e0ccf8","src/features/gen_GpuQueue.rs":"a10ab6a8240707f221899f8704da9a39fb8cb569e66d6192d3bb1a2cad2430fa","src/features/gen_GpuQueueDescriptor.rs":"e0108c52a24cddececb81904e915caba77a243f89c1fa762c87e885fd5d93ace","src/features/gen_GpuRenderBundle.rs":"00219dc42abfd22d17329a839766cb116cc3a4d1d745e6152572fd3b7a6311ce","src/features/gen_GpuRenderBundleDescriptor.rs":"27e33a9fa17c770353165d789261da75a6b461c2bb5da625e48c7ae514405fb6","src/features/gen_GpuRenderBundleEncoder.rs":"ebc0f7b749bb08b11918a9ddbe5f8d8eac9f9b8385378ae3cb948a03df77ed05","src/features/gen_GpuRenderBundleEncoderDescriptor.rs":"15d2ca9bac6eb66faec79fab72c6d2fdde768afcf7d84ba4ecd2330821a0dc90","src/features/gen_GpuRenderPassColorAttachment.rs":"0a6ad5a9ca0775911f5131424d8f357ed9883cd2024b73bdbda91114261fd9a7","src/features/gen_GpuRenderPassDepthStencilAttachment.rs":"a6eb37d4d0552efc483677e1c1e382e90758f5b1da95bd7ec3ae5ccc9cd953e1","src/features/gen_GpuRenderPassDescriptor.rs":"31e1a70766f1a2eb71c20805eb13cb89061e9878732111893e651e256e914844","src/features/gen_GpuRenderPassEncoder.rs":"771cd4bb6982bdb00a56c29db377f8f7efb9745df23d0db22b195dabcb957646","src/features/gen_GpuRenderPassLayout.rs":"8e95ba950cac29f9b89da468f2f91befb2f6dd17fd7c88f50821e26999e02af3","src/features/gen_GpuRenderPassTimestampWrites.rs":"e0a99c8a3ca4fa59a3b5e8f66fc2e372d23ebf7d72360d053fac106df007b82a","src/features/gen_GpuRenderPipeline.rs":"dba9317d7a6e537b3369482eca5d3afeb5bd4a78b4ea7079491412cdee0ef9e6","src/features/gen_GpuRenderPipelineDescriptor.rs":"0876f2539a24890adb7b446defe7f473f9b38aa0779ea95fcd906563a0069aef","src/features/gen_GpuRequestAdapterOptions.rs":"e13cae983270d10417985ff78aadef756acc23b1d10ef8d4016f3082972b7fa2","src/features/gen_GpuSampler.rs":"f56303ee2a10f4e292b6d5b992d64c0de2916e0494d4f7c25ec1c5be98eb662b","src/features/gen_GpuSamplerBindingLayout.rs":"4ae13e6382365646167e98745d870b55e0aa04897094771e7dab98ba896f9f40","src/features/gen_GpuSamplerBindingType.rs":"939f124ebf9776a3e31629734261b5edf9184cdd2d2e8d4112ea30f6f2d28933","src/features/gen_GpuSamplerDescriptor.rs":"758bfb0e2735fce4530b1013f23da3dd39b77880ab1e43704e8f60df3a782c53","src/features/gen_GpuShaderModule.rs":"ed50beb55088b0bf82cce02ee6dc72f970239b65f5595c40401a8334c293c898","src/features/gen_GpuShaderModuleCompilationHint.rs":"9adc46d7ac66ad9032693c2a460839b4d9d997ab6074a759cc060fdd41eb5350","src/features/gen_GpuShaderModuleDescriptor.rs":"ab77ef1aa2a952f0bad8aa17ec4b1221d5a8d69b72313d13c88974a998bcf01d","src/features/gen_GpuStencilFaceState.rs":"784df7232fbaf550645f789fd71fbd40403751e691736f7fd65b23462e736eb5","src/features/gen_GpuStencilOperation.rs":"43baf569c35a6b30cc803c6b614e72b8482334e32a6d6b005e38655ccfd77582","src/features/gen_GpuStorageTextureAccess.rs":"79aa5278e993860e38bc0b9d3b097afec4186cb55711d1e7ff60bfeef6b4e0aa","src/features/gen_GpuStorageTextureBindingLayout.rs":"2730278d222bbcfd7d38e872f852f40bbae7d5ce9eacf3d93622a52588bb351d","src/features/gen_GpuStoreOp.rs":"68c36797d8f88ab54b825fbc4774dc1c5efa0771885c200c622f917e3e5f5df7","src/features/gen_GpuSupportedFeatures.rs":"52ead8045b8bf682c850df012e84c714613892295fa83bdbd367619445767a9b","src/features/gen_GpuSupportedLimits.rs":"b2e5ec2e45b81209bba90017ef9f9517aa25bd338fd705caa6f22345c80993b1","src/features/gen_GpuTexture.rs":"cace9e0e3d374e2cd58f9bbaea62a993cc0821557f769dc96b2457a02bbb643c","src/features/gen_GpuTextureAspect.rs":"f03afcc204529ef5dfbbbef4ed477b089618db2e764be2d64207292943ef9b77","src/features/gen_GpuTextureBindingLayout.rs":"d0fe7163e7d4c930855a10b9028c222f2fc940f5ba9b83155a86ce212fc0c57d","src/features/gen_GpuTextureDescriptor.rs":"c7e3b6c6c0be88d6c40f95ae252fd7d68d45db41480ffd6df30e124ca4562318","src/features/gen_GpuTextureDimension.rs":"37e3e95e71d6ae16c962006332a126a92ee9f486b7a47a24beadfc1bb1977c47","src/features/gen_GpuTextureFormat.rs":"09d69200a7e72b5c626dd32850ec27f3e590fd4f2311a96d4a04a2a60039d17e","src/features/gen_GpuTextureSampleType.rs":"dc5ab7959447f17e8f83df7701f7d0eac8e5d48ec9390050d80af3e93df5395e","src/features/gen_GpuTextureView.rs":"e181951d20e3c7d2919e024e6c6378be73c316f8269fb17d6b0ac76f8787e4ce","src/features/gen_GpuTextureViewDescriptor.rs":"d7e4593be10c80e5ed4f487e8e9453d8c31256c732639e250a27fa9d7f7668dc","src/features/gen_GpuTextureViewDimension.rs":"8ec612991126bfbf21bf587c6f3ea793f221164c172b614dcd2b7cca258477d7","src/features/gen_GpuUncapturedErrorEvent.rs":"88237729113102e181624689dc72c4bbd5592cf5b7796f44e3d2f7f6ab5ee561","src/features/gen_GpuUncapturedErrorEventInit.rs":"7b3c4c9c2c6ae780812be13f8a7fed73b9c4804831c0e727994f3043ecd747fc","src/features/gen_GpuValidationError.rs":"dc089848896be7542697adb41798712d54acc5160a62b9f4b556035bfa03ada4","src/features/gen_GpuVertexAttribute.rs":"e41905128f66129370945a07954a462498df717684e10048fb3827bb80b68fd3","src/features/gen_GpuVertexBufferLayout.rs":"ae1cf5d75b20068093510a08b994bc370b7773c7db97e529591f8740afd0a736","src/features/gen_GpuVertexFormat.rs":"f6116ff44da029b3c66f003bcbf784f3749cbd27d7cb4cd4e75d9267f13a07c9","src/features/gen_GpuVertexState.rs":"757631d10f84781e3e84881f8bdf3c34ea6ee5b36895589a0dd15f552a1ce891","src/features/gen_GpuVertexStepMode.rs":"99dcbb225e5c54a22f069324f093d93ece87b9b41ad3189cbea4d47b8c42e3dc","src/features/gen_GridDeclaration.rs":"a942ed3527761891d2121f604d39e561e2bd1b9914192a6d9825b1da3f7f2e5b","src/features/gen_GridTrackState.rs":"77bbe32dca9db9cf6f41e11ccae3b4c8cddab29e9e5803e138dbfcbe0aefb617","src/features/gen_GroupedHistoryEventInit.rs":"66b51e5f9b024816f433d7ca26a64bf165b2efa81139e14b2a26442614fecb58","src/features/gen_HalfOpenInfoDict.rs":"3823284d2f782df3c57ae2544ebb4b28208286b642260e85eae69a8f4fa19e5c","src/features/gen_HardwareAcceleration.rs":"54d07989b181bcca65cfbb8964e858071d76ef8fa1919086171068f428d18c1b","src/features/gen_HashChangeEvent.rs":"5fde6b9a4f01e9be49dda9d06ff81a8bdfd9f862daf670c9aefad15858d3cc50","src/features/gen_HashChangeEventInit.rs":"33ff84fa68dbed2ea3868eb75b6c7cfa85a08e18b966e8aaaa1113e70293cb96","src/features/gen_Headers.rs":"485c6b7c8a8204459e8ba8bf44009e6f9c8acac9486500cb9fe75223e6b8ccff","src/features/gen_HeadersGuardEnum.rs":"6a8a61a6e44189e04d54fe8331b0df06201e300f9eee455ee3d8facf687646d1","src/features/gen_Hid.rs":"965c3a628ab672d2298d109cf9fa178c8f51ce0f30d808cb56553eea5066d2e0","src/features/gen_HidCollectionInfo.rs":"020efb44b3724973ea942e3bb710e08e2cdf52fabec0e0f20e6be15c4e3f648a","src/features/gen_HidConnectionEvent.rs":"bfcb0ccf600042c8ce71ef44abb3ddda629322f5bf733d76b73942669708f712","src/features/gen_HidConnectionEventInit.rs":"03ccb86693e55e9180c4ca7dfb697329bf2d453ed03445a637c249cc4b3a6b26","src/features/gen_HidDevice.rs":"eb1917662310ce5578883a5b26391854232c0af15bb6b7647cf99cf83a8ceb2f","src/features/gen_HidDeviceFilter.rs":"533e1fcba38867965419688d840e84410ccbedadb82e636750249a1099179b93","src/features/gen_HidDeviceRequestOptions.rs":"336e3a9f62a55234b62e495f8fc37fa1496bb5107a075821f5924424a5082c4b","src/features/gen_HidInputReportEvent.rs":"be5cb14be47298cb46da934f9017cfbfca1b172623f74ea9ce010e5d09aa18f6","src/features/gen_HidInputReportEventInit.rs":"ee200ff68209e4a451fcd234d88c9f85006ed19f4c7bbbe1cd4a3a11fd9964a4","src/features/gen_HidReportInfo.rs":"7be1d891dc1b2065ebc6f1e6a31b25cb2887c22fdfc65f76089fd44e92833aa2","src/features/gen_HidReportItem.rs":"2e70b39ce19615bfcc01b21f8c4ab1a1f5e4941421f23df3ac9118c3876deb05","src/features/gen_HidUnitSystem.rs":"ea74caeda4f1bf1bb06b57a7292a206de93817fbd4cc5f86d1f8ef683193818e","src/features/gen_HiddenPluginEventInit.rs":"f2a1e3308a6906c1a18c66231ad83d85f3ef341d384395caf281f7adca444f1d","src/features/gen_History.rs":"27557ca309e231f48b7aa0df096fa9a0726f0d4eceacf931905cd5e1020f7f41","src/features/gen_HitRegionOptions.rs":"88e2ff04ad6115779c6964c1d78cbdafd012805074d9e67bc302602408a13d32","src/features/gen_HkdfParams.rs":"435c7321a16e005c310bbd1ffa4614e0079bb2138b7a6d329c8b2ee3a2970bf2","src/features/gen_HmacDerivedKeyParams.rs":"d52167f6df1a20eb429a50e6b3c689cd6183032bc1495e7b0f4c9e302996057f","src/features/gen_HmacImportParams.rs":"94ae53089b1ea815b9ef5f6dcd453c066633ef7986ef177e1930ed9e4ad60495","src/features/gen_HmacKeyAlgorithm.rs":"7e02c562e9ef98270c73381e80c35bb409824bca912cb0b6cedf1d845d625593","src/features/gen_HmacKeyGenParams.rs":"dde8081898659225981574c9e44888dd4ea2ee6362ef7d2c83fb5eba705d423c","src/features/gen_HtmlAllCollection.rs":"732035fdd73e68eb6c83a6c6c1ed7e99b3243952cf0e928ce930602ec37ccdf2","src/features/gen_HtmlAnchorElement.rs":"d40a7c1ef409f0cb887a5147a39fdb446b5348844372d415c57d0660c852f80a","src/features/gen_HtmlAreaElement.rs":"cc41394f2baea9096b7fc4ec02305a213ccc863b9f8bb40ba9dffeb968d1e557","src/features/gen_HtmlAudioElement.rs":"389ba0e9fb5d9036801527277ead68523902d0a611beeb2b76a38e0d38f82b64","src/features/gen_HtmlBaseElement.rs":"b5058f145b7e6a4c5a8fcc4b49bc4330f4f8b379272311977462bf3a43c22239","src/features/gen_HtmlBodyElement.rs":"944ef769bb6b7030c5f33157bb0e105cb3b7cc6d7ab7a0f822894ed2ceec1868","src/features/gen_HtmlBrElement.rs":"a65868d07fbde4369d2c7010ad38fa0b954451ef4d8e7ef7a8eb6b632b98a301","src/features/gen_HtmlButtonElement.rs":"9be1c30d74f63f66ddb5eaef33122bda8ca5729ea92c518bb98de12117ed19d4","src/features/gen_HtmlCanvasElement.rs":"f380540660d6fa89a3a9b4b8af5dbd84481d957df6e4fb9967f931f1c9acf496","src/features/gen_HtmlCollection.rs":"eaa09d495d0d4de7986c1da947304e0de1c55f85668cf86d477497f4d8c19c75","src/features/gen_HtmlDListElement.rs":"65bfda76102c550b833b1273d85bffa98a90fb0c596a7fab0ef6d74ed6a5d22e","src/features/gen_HtmlDataElement.rs":"d51275c036418a3a2fca5823a5e3e1a9700547564a436271b1d353323024a41d","src/features/gen_HtmlDataListElement.rs":"fc3318381e9388e665aac14b178781e8b42734188334b77b18004f1b597824d6","src/features/gen_HtmlDetailsElement.rs":"fa18eda62df9418e6590424986b5ce60a52e5dbf0473dcd9fdf16ffa35c70ee5","src/features/gen_HtmlDialogElement.rs":"cc293effa7fd55e81bd0765afc85b7b6e85953530abe20556ee5a82ee9e41a4d","src/features/gen_HtmlDirectoryElement.rs":"67933af6473132c846bee0af29c4e2114a25a20942bdad8b461adae42bca8cd3","src/features/gen_HtmlDivElement.rs":"c5b1854f65474101920cf703317f3a77944a67acfdc01e5abdcca419f847b87a","src/features/gen_HtmlDocument.rs":"89d90a3f212e44fb0fe9ad29fc68778c51799ace09385774255a67fc27d0603b","src/features/gen_HtmlElement.rs":"7c14ba74faa1c563ad456ce4ced9f8e2ef93cfd765977254a625d69785b18ed6","src/features/gen_HtmlEmbedElement.rs":"1e49161377c73cf0eee807c19f771796d3941e05d94486318eff5f5b5c2c9278","src/features/gen_HtmlFieldSetElement.rs":"b401bc970f5efba17bb9a9d299e01095ae07cd6392f58fb0e9bffaf6e2ccbc5b","src/features/gen_HtmlFontElement.rs":"b04021bfec01ba921439e8686842e931e46e0c89a40a420019cbd34c90adc69e","src/features/gen_HtmlFormControlsCollection.rs":"40f0a540fbaa612fc2fc530e69a8490203a8ddd3d210813bc17027d75388d807","src/features/gen_HtmlFormElement.rs":"29a1ab71a778ebf262d60959d080c8fd129cac06f737cd1e6bec1d7c1ebb744c","src/features/gen_HtmlFrameElement.rs":"4edcf8e8f1f12b5776d6d97a3c816add14a63fa06af8941770fa632d9bf6333e","src/features/gen_HtmlFrameSetElement.rs":"c8d7299b4c6557db9e9b64ce49634a5bade44e3ee75bd9dc3106145dd4702803","src/features/gen_HtmlHeadElement.rs":"de547b4ab913d3f5b4b3e328dc32a4a5066d5df01b3dd6b2da1354e6f3b91eed","src/features/gen_HtmlHeadingElement.rs":"50fcc67d0fe4331c86829126c2b906d3d8be429e238bc91cb6f17ce1b250520b","src/features/gen_HtmlHrElement.rs":"7d5a00798236fe8551b0ad5723bd691d7fe12c7e6359944e85c16fab497eed2b","src/features/gen_HtmlHtmlElement.rs":"c11daca541d585dd385ffc97638e425e41593c52f75aa7afdeeb9d86a1cfe62f","src/features/gen_HtmlIFrameElement.rs":"ac60704a6cbf90abd657a05af103bbd3266a1650d42d4c905326a235a02aa56e","src/features/gen_HtmlImageElement.rs":"03c7b7344ce3f0fe0a0dc3436ae54a2af65217537f1ee71f4988e87b562469f0","src/features/gen_HtmlInputElement.rs":"272df6f26279bbda113c93ef8d1287dcfad3ecec27eefdcf65408325a496237b","src/features/gen_HtmlLabelElement.rs":"c5efbb7a17bd6a11471676e02ebab61cc4863add2a3ccaf64fbb9aee6a83c19c","src/features/gen_HtmlLegendElement.rs":"9ef4eb3475fdca5cd1ffa48abc5fd5527621fb6bde21d30da07e2d03b924308d","src/features/gen_HtmlLiElement.rs":"76f7fe36ea62acd79edaca8579e3674efcbb5f8bf0fd2e9be5017ad4033e9d75","src/features/gen_HtmlLinkElement.rs":"30b7838586da4307ff950ff81431cb9b4f91229f39f7f11cc6390025f24f122c","src/features/gen_HtmlMapElement.rs":"cf0fd627448f7c8e04ed8158b140e1fd08deca8e5f1b56afa1ea3f550699ce3f","src/features/gen_HtmlMediaElement.rs":"b6d400513d4e80fc74f7c3040512c2a86fbc059be591908cb2502a0455d3001c","src/features/gen_HtmlMenuElement.rs":"661f93c7eeacdd9c71cd8b2ddba6eb2b7e91bba341eddb06f8bc3fea41fd9e5d","src/features/gen_HtmlMenuItemElement.rs":"99deb45d5cd9415c15c4ca7aa6f0e441ddf2c32ca97a726561e0c6161396731c","src/features/gen_HtmlMetaElement.rs":"13e2ff234fd5fd1e07a8316151f39df94cabf2cfeefe107406e077ca82e0c8fc","src/features/gen_HtmlMeterElement.rs":"61c5d39c7b3725abb7103496edb60debb0b2424c6a4c0caae163215a0035c4cc","src/features/gen_HtmlModElement.rs":"3965784883a43c0748eadf46ee6bd2ca2528f5825090090785ab91824454a2d4","src/features/gen_HtmlOListElement.rs":"0f83a837cda5a32b9254e18c820117cab1fb7713c8eddcf7af2b37564f24ab67","src/features/gen_HtmlObjectElement.rs":"de25c9178e054da99ecaeb7b06f4b46c41f1322dbeff140ef3f2798faeee7a44","src/features/gen_HtmlOptGroupElement.rs":"7d719556ee6b56056f4df81a4c261f0584b1e11251bb38c281a47433b5b6bd5c","src/features/gen_HtmlOptionElement.rs":"cff5ef91f5f79fd3a337f4a22ac67a2e5e55cfb595aa48eebb4a564cece76fc3","src/features/gen_HtmlOptionsCollection.rs":"06733f03f54656052593317688d0e9a4b8decdf45313196e624b65d5e62ad609","src/features/gen_HtmlOutputElement.rs":"f550ca628e914049cedcca85919acf3dc2fd89e344940495ab48ceb849dac495","src/features/gen_HtmlParagraphElement.rs":"8bb5b4f122da3770627b6d7f090684fa2d75cb00b402dd596e0889e605cfd416","src/features/gen_HtmlParamElement.rs":"6d12aee274fdda40d3c17111134a579e0363cb2a6959119ee814f0e15d67f31c","src/features/gen_HtmlPictureElement.rs":"4f42fc44befcca293155ef2eb79e3304792465ac947e0f52fdd44975f94cd089","src/features/gen_HtmlPreElement.rs":"cf473395d54a28c31fcd64cd16fb453ca00a71c16311031985b89d50e3b48688","src/features/gen_HtmlProgressElement.rs":"496811708e97d76c0d666bce11735b67399e8190bef3324b05f3550c22935793","src/features/gen_HtmlQuoteElement.rs":"139fa0b1b42c9bee42ba21834b131ba581747cdbf8fc2bf0aedea142d467fdc7","src/features/gen_HtmlScriptElement.rs":"f4bc613e502fd9e03a1e153a5ba3e0a5ad4e64866ab963df2d6d67e5e9ecf98e","src/features/gen_HtmlSelectElement.rs":"287c7019281f25b7a1e45348fe2f30fb4c30be5926d1b4e05d410b0230e8a9c6","src/features/gen_HtmlSlotElement.rs":"203cbf4e9e73efbda58aeef842c7b0af3f8192efa7f3bda82caaea6876ac3cd0","src/features/gen_HtmlSourceElement.rs":"61e13038fa55dff87b903e476a5a6e560ba689e709a34f862a0f423a919cf091","src/features/gen_HtmlSpanElement.rs":"81c461118e16e8d6bb157d82a6526d4f7184679b2a439aa9aec6d658601bbe8e","src/features/gen_HtmlStyleElement.rs":"d40395cbeb374546a1386c50164989c0d854166c57525feb49317f2cf46ad61f","src/features/gen_HtmlTableCaptionElement.rs":"c51ab3614e86d2c539a9aa32e213a0c2a80a5e7d37dc6a05d365cf351176d7fa","src/features/gen_HtmlTableCellElement.rs":"73e2184282d517ac5c6658376494f74b9c07c1d2a6b0222f046f4ee1864f6f3f","src/features/gen_HtmlTableColElement.rs":"a7ed4a49ed8cd27f9ea3dbbd637fd2537028e890fd04f05f9d852f38270d9a33","src/features/gen_HtmlTableElement.rs":"d8f5e7755ef0fab11b566fa996945155b22513f484d5fe04dc77522b0f35b8c4","src/features/gen_HtmlTableRowElement.rs":"0d846683ae2f5062c50b2f125fbff9865f36054c8b8e539cbcf2acd27c006e58","src/features/gen_HtmlTableSectionElement.rs":"95d7c706ee659a6a08556fae177cdab3226dbb801f4969b13c43f8af4b1ceee4","src/features/gen_HtmlTemplateElement.rs":"0716a08a04a04c0c822f775d5405de5acfdf424bc8c94bbc2f713e9800c37c4a","src/features/gen_HtmlTextAreaElement.rs":"e55ef968e33e81a90e06a0733c84ee86d7668fc5ec38b60bac3318f55dd40550","src/features/gen_HtmlTimeElement.rs":"6dc2e9250662f4cb939f41475b5d4a1ae5f06a7d0a8407202c4df04d06d93a3c","src/features/gen_HtmlTitleElement.rs":"37d41524d8eebffae96103f5ee9864ac059581ecb464c59fe4f2e399060a641d","src/features/gen_HtmlTrackElement.rs":"b02617fb305cfed86a5ff3ad85967aa953bb74fb648bec26b2b9b10ff785b6be","src/features/gen_HtmlUListElement.rs":"e8ac1b5b4dcfd972a25be89b2c2a20f83997185c555b4d6312623d6da43091dc","src/features/gen_HtmlUnknownElement.rs":"07638b73cf26d18ca06054e008e98139c9514952af8bb0aa51f42616af6f03a2","src/features/gen_HtmlVideoElement.rs":"5e0b904dd1a7ed12e39f22dbd9e425628e48871911c9c5856594325afb1a93f7","src/features/gen_HttpConnDict.rs":"c36d787428c7a179b466d7d382a9102e869de9fa219d89e6900ddaf9e410146f","src/features/gen_HttpConnInfo.rs":"38a8cb2d6936236bcec0927b8f122f80620b29ab04aa3d17d7daf04ef64fb11c","src/features/gen_HttpConnectionElement.rs":"4ccccaae6c1c1ad8912d39e728066584895f6fd4f71c90393fbff2796250bb27","src/features/gen_IdbCursor.rs":"b7225239cce75e3cef1acc45a12df7178db3ff2b5d61aca433a9cc2f6fe36117","src/features/gen_IdbCursorDirection.rs":"bb8cf78ac731568a46e037c5715726aa48e6d778bb8d9646413adf47d0b69b58","src/features/gen_IdbCursorWithValue.rs":"50253f6159b4b36f21cfbf879cd2e6bca67eb8772ec37b720cd41bf22338a2ed","src/features/gen_IdbDatabase.rs":"5ce06ea852dcb24aab4f234e30d135bda2e0631c94151cb60d2c05a45b25da0b","src/features/gen_IdbFactory.rs":"e0280903cfa90c3a3801548b1b9dda09e53ba0f065bfd6635d3d7f3742a3b951","src/features/gen_IdbFileHandle.rs":"8f44e93a211bc011aea4126c477147d84c78392a55f8af369ac0fd91584f2e24","src/features/gen_IdbFileMetadataParameters.rs":"9d0dd14568018acfd13065d4373b5e5a8fb8bc2b2cb24bacea3f0cfab57089ca","src/features/gen_IdbFileRequest.rs":"67d821f3ebbd4b2080170b78e5c2750fd45b2bb1b2031da85af05652beda2de6","src/features/gen_IdbIndex.rs":"fcc238853cccf19b360322c6ce44bf3b9725bcdc78692b2b9494828bd4e1cc10","src/features/gen_IdbIndexParameters.rs":"a67f9122268ef1b349c59731bee911938688daa1d248a41ccbdb07dba7c6b243","src/features/gen_IdbKeyRange.rs":"1b76bf16c7dd6ab7f0ffee60a4299463b866d141f4f35bce724152c4ff1bfd02","src/features/gen_IdbLocaleAwareKeyRange.rs":"3744fc47c0a153a439b9f66c240ef47b7716f5a82759f3df055c8433b64abbf7","src/features/gen_IdbMutableFile.rs":"f476de5cb5667af8bef87810569095a49bef07c01125bd7b9a29f243781f9721","src/features/gen_IdbObjectStore.rs":"31b3ec6dae12a22fce7977f7ada58efa56918119d443679176e4941eff64bc0b","src/features/gen_IdbObjectStoreParameters.rs":"ebdcc3ecf2756db4bf54b43e6bc8803a32878a64f4fe089e93c8e723db13ba06","src/features/gen_IdbOpenDbOptions.rs":"2958fe7296da309a69bb9f65aa6fa45a4888abd5d5f0c50dacf690ca93c8f0e3","src/features/gen_IdbOpenDbRequest.rs":"e3488ce9f475ee4e8067ee0a9d55a0ecb86e4f67bdbe16f664533732dc448110","src/features/gen_IdbRequest.rs":"0e0d5898aa5c080813ab7a2d4fd2ff1fae36872f430c26f1eabea2fa6c44e730","src/features/gen_IdbRequestReadyState.rs":"bc5cc2f6cbbf23657b07dfa028a7ce05299cd97af9e7e4f62df881ac0588057e","src/features/gen_IdbTransaction.rs":"9264431a68eee286b2ce3aaab00f61676d80ff8b0f2450e449e9a752001701b2","src/features/gen_IdbTransactionMode.rs":"3ce2f3471e6524a620de9d7ec7dcbf72c61b24b9ed08fabfb0d2e8b31518f760","src/features/gen_IdbVersionChangeEvent.rs":"084d04b86e512cb73dae07dd49175223010c5aca56aa98d19e38e578266deff6","src/features/gen_IdbVersionChangeEventInit.rs":"3ad89faa7d1f19d60d87ae90fd062f13d6fc44431645a6d186aaf15b760d7f81","src/features/gen_IdleDeadline.rs":"89a03c647c79b7349c492c0cee9fb49a661406f4d034202e9771b38a9ee9689c","src/features/gen_IdleRequestOptions.rs":"1055449c08f3bbc8fb8e679a98f626476ac9e839d3e3fff02a6433e51866a777","src/features/gen_IirFilterNode.rs":"53d59e86f2fd7813cc0db67e4c48623a3f8ebd2d156948aac909db0b3d5d3770","src/features/gen_IirFilterOptions.rs":"4cc46216d1064cd47c31e7728829ab5fd767a875c2410d8a9fae9cc0eda9ff86","src/features/gen_ImageBitmap.rs":"022c4abe3d64042ff803f6b787b9b3903a24591579caff5c64108dced4bffe04","src/features/gen_ImageBitmapOptions.rs":"09aa8f5c855847aa89b18768e8aa486bbc462f253a6660a2918ee02c49483517","src/features/gen_ImageBitmapRenderingContext.rs":"bad9ddad928684e6b9c9ccd566f3ca3b3e5eb8ca103b3c565336bd50bf3a0b94","src/features/gen_ImageCapture.rs":"c65fe0f67725151a287e65037d9a963261ad3dc41baddc02d107e4f073dd848e","src/features/gen_ImageCaptureError.rs":"8acd5474ce459bdfbf9d488c22b80f774ade266aeb00b80d9962eb294527e0a5","src/features/gen_ImageCaptureErrorEvent.rs":"fb371751af82b831daaf76539c3eafa4172ecd4fee6172179560f89859c5a72e","src/features/gen_ImageCaptureErrorEventInit.rs":"4d7b0f216f37b655b9c3e92067df4e4f5fa6c3f4ff5b8a913b992248d3120d64","src/features/gen_ImageData.rs":"a5eee95529f1ed339e6a9cb0b9df84b09485e07c9847609fa46e1027ef805b9f","src/features/gen_ImageDecodeOptions.rs":"8329e462c4b301f11a2202d24b3a30a8c2cc583dc5e21acac1dfa4c9b3248ec6","src/features/gen_ImageDecodeResult.rs":"8e90ff31eac6bc0da7a7c85182cdc95809460ca9fb5a26d652b4429952c55488","src/features/gen_ImageDecoder.rs":"f1e8fb7f099be85cee04f9ebc5f652b556283d106edc67190c6acfe341aaef32","src/features/gen_ImageDecoderInit.rs":"90c02e7a32111c85d1cd1d64384a913827c777b2342369457e111b3996c45ea4","src/features/gen_ImageEncodeOptions.rs":"059a6ffb3fb9641cc49c52e45b1f29efb4033c44d644119973226f0e9b567d81","src/features/gen_ImageOrientation.rs":"adb817e9d779e6c0e2296cee0b24f0a61eedbf18048dec994a9e190e37f310b9","src/features/gen_ImageTrack.rs":"00a81b5d0d1cb5b2b8354d53e0db9586e33eb4a29d83986757d297e7f1710170","src/features/gen_ImageTrackList.rs":"c902ea20b280043324705f4572bd87d5eff736042e27289fe57c88f7658b3f9c","src/features/gen_InputEvent.rs":"fe1ca48d4216ac081b05f370a4fb59412167881772681255a8662969a448d16d","src/features/gen_InputEventInit.rs":"8827e904851cd4a6edf199878ca1c2b0075f7d2e26136d302a552d194f09428e","src/features/gen_InstallTriggerData.rs":"4fb96c80f51d1003f1a0d7b37c510471e9840671be8f6290c19654a974d67711","src/features/gen_IntersectionObserver.rs":"41f84dca9ac99992d1f2357e22581759fa5f547fc351da51fc4cc1bcfa9dd4c5","src/features/gen_IntersectionObserverEntry.rs":"aac59aff87f217fe9f82bdf236d19fe14637bd750ea97abe9cb67f62d477c0da","src/features/gen_IntersectionObserverEntryInit.rs":"32aa88e9432dab2721d95942487db32c067d80839f3e8ce5ec864ef21f25e41c","src/features/gen_IntersectionObserverInit.rs":"29ece5a314cef886b6dfc43d8da44fe39957016d434e9cdb7e68054a32a771e2","src/features/gen_IntlUtils.rs":"b82515769688e2658088f0db010bbe1799ea97574cf474c1b4461739a29954d6","src/features/gen_IsInputPendingOptions.rs":"db0f12c5b44378a198c9a0d5c1a265faeb2f55da06b92027b9a7800e2e5b0968","src/features/gen_IterableKeyAndValueResult.rs":"0eb491f60d38321e3e177137fb3542c86d05e559787aeb28ff9574177a754c1e","src/features/gen_IterableKeyOrValueResult.rs":"76e258910b94c2ad3ead3cef57e71076cea1d8657f381647f88dd1567253396f","src/features/gen_IterationCompositeOperation.rs":"1605e2a347bafdf986f414b55eb7c4d952221e22c3fe70b4e2b66c67b89cb9b2","src/features/gen_JsonWebKey.rs":"262d26564826372c56fc05606f31deb02bdae80066a8b0d03b27eb47867ab087","src/features/gen_KeyAlgorithm.rs":"b5918361a6f3d7d95d061f34bbc88d8335f5a02b8afe6fd474e4f7799d352ba4","src/features/gen_KeyEvent.rs":"fe7fdc8ed4f6a1c42a253ecaa0f0c54adae784f5897449186ddd254bf3c1db57","src/features/gen_KeyIdsInitData.rs":"5ba5481ae5c66a80eee9d7ea7f011c96a3eff46de94a5698128c06e3cc99a732","src/features/gen_KeyboardEvent.rs":"a8d98415bf8cf0cb370905aaf9037bb5e652287afefbed3aed23835f78b37137","src/features/gen_KeyboardEventInit.rs":"732c8260d18e6adc8994e7985165c0a7254b6fd98d363f9d23bd5d71727451dd","src/features/gen_KeyframeAnimationOptions.rs":"3dd594aa284bc9af2a814184781cdd7b4b42aa26413dc2cef50c6a515e8207d9","src/features/gen_KeyframeEffect.rs":"4c034d8a43b789e5a96870c583590020e2b8f43691153161b69f450506603144","src/features/gen_KeyframeEffectOptions.rs":"a522f591d54e94eb96c93481195bc6af6608a7c291057b21f177159adf4afbdf","src/features/gen_L10nElement.rs":"52b36bedaa697c21a1432d0eff505f10351fc8af572d07ef9c83ac300ea20d3e","src/features/gen_L10nValue.rs":"0061ec05934fc6a0bb6a9c3fa62a200e7243634e1b69e779773fb9ec0a9d0698","src/features/gen_LatencyMode.rs":"7083401598c5c401090ab1e69c1e56ff96550b4979cdcb2c062cae848306da5c","src/features/gen_LifecycleCallbacks.rs":"12629bbdc68a7a5ba26a6651c5b4d25f582ac7c836dcb775e38fd23d33c58fc4","src/features/gen_LineAlignSetting.rs":"bf80f5841646addf3c610ec64e2d5737a6ee180d8e8d7e723d75a3e420fd4b11","src/features/gen_ListBoxObject.rs":"14121136a4ee24950d9f1981aa06598b87070814613a5329c89dc5f1f2bf9229","src/features/gen_LocalMediaStream.rs":"61c9b7885c405d13a1cfb222f822e2660bad651d8a980b43adc551248b371d50","src/features/gen_LocaleInfo.rs":"f347ea211290173b51e3769011e445e52dbdb24f28292f94847efe85b919598f","src/features/gen_Location.rs":"eb8642a1eecff6cb24b5fdc7e37fb83d653738f0a014f98dc86aa2e69e69f33f","src/features/gen_Lock.rs":"5ac3b05db9c1494c289d1441e1fef915058196d281634a6b2f58621048e56caf","src/features/gen_LockInfo.rs":"5dc97339fed5cbe644649e3c4175ec9cf71716a50bb39f31c6f3be5723a7761f","src/features/gen_LockManager.rs":"dddbe59a5a4c1100df9c8866232b9d1acdf76abd220089865c08aa784899d330","src/features/gen_LockManagerSnapshot.rs":"ba605fb1f54856b85376f3d05bc80a6fe2f7a8def71b84844199ea86751715b9","src/features/gen_LockMode.rs":"fa7959f09a6d678e0ab112d038b601c16265313e15fff141d4e73e044ef65805","src/features/gen_LockOptions.rs":"cb9d6042b0dcc28ef379ff6828f514f6479e3c56bab405742917cdf06fdf09ea","src/features/gen_MediaCapabilities.rs":"89f333315590997ecfbf2b5c89648cbb345a8e042e9d4db24974b97c281bd3e7","src/features/gen_MediaCapabilitiesInfo.rs":"5b2972776a759304fa9ed9c67b12300dc6754b25d2d3d3d8c44db7d9d625343a","src/features/gen_MediaConfiguration.rs":"fdfb570542dcdb07a1afd47700e40e0bda99dece3f143d8e28e12f0b42f674d1","src/features/gen_MediaDecodingConfiguration.rs":"e1cc32e1733eebbfc1fbc466887a01e77b1893637436cf6b4c62b899202052dd","src/features/gen_MediaDecodingType.rs":"90c03bb22598f18d7af1c9edf4aaf68264b6b13fcfe86bdb58cf1b76ea7e7838","src/features/gen_MediaDeviceInfo.rs":"1e880c4f3f646c750cd5a6c3e0cd7dac58cf2f50f5a4d24a7829e01bf3ef943c","src/features/gen_MediaDeviceKind.rs":"af669e2fabffee518b5eb3c1d3a94eebb27f778c17029fbc372b4d9e7ca88a97","src/features/gen_MediaDevices.rs":"4fc0991c6c0bd0f0d6d4e5be51e0555ba14b811321d14bc1e8ab77e76c88054e","src/features/gen_MediaElementAudioSourceNode.rs":"1e5062752c181c02fb0974c78004b22916f84118e13ae9abd38eeae71edb04ca","src/features/gen_MediaElementAudioSourceOptions.rs":"859086849e7611e2535e34752a9133dfe6498420ca2330cbcf0280574f25fa6a","src/features/gen_MediaEncodingConfiguration.rs":"47b1612887cf606fe20bbd1cc7e424ef674ca4b4eb0d1dcf3776eb55ae554d45","src/features/gen_MediaEncodingType.rs":"4df0d9c6b90674d65762bc724409a13abfbbbe9249820fc6eb872e9e0d978904","src/features/gen_MediaEncryptedEvent.rs":"43272922cf3d95954422ff5f6ada0fa79c2ffab6888714ffb6fe471c193fa870","src/features/gen_MediaError.rs":"09543dfa52c52415cf92bfca54460517fed15822c47fca65c876257f8417b96a","src/features/gen_MediaImage.rs":"e50ceb9ea29a337348436710c111e191434b323795ed65e9d997d20b62c1caed","src/features/gen_MediaKeyError.rs":"05ec34968e1777d16555b1d0b6aef536b255f9ec23509348e1591c7d9b20b778","src/features/gen_MediaKeyMessageEvent.rs":"1ff46fa351e669d69d8dd1aea5030a3015f83ee812db48a3e947ec4c9c6aeef0","src/features/gen_MediaKeyMessageEventInit.rs":"25894c5cb1478ddd4ede797ef176f45ca30a1926db695e5dfcce0db4a3462d43","src/features/gen_MediaKeyMessageType.rs":"7d7768714bf346d1e278637576f82fff41b731f3426f9e87a5f977cb5e6513af","src/features/gen_MediaKeyNeededEventInit.rs":"5d41a45f976a5c083173a8c545c4f78b65e1e0508f35908ac033ff3319add16c","src/features/gen_MediaKeySession.rs":"171a9e8f6900321f29457ebb1817d86171ebe9e25745b21da0632b53ee380f89","src/features/gen_MediaKeySessionType.rs":"ccaa595c59ec9822876cc7f19733e4235fc8ed8757c805e2ec62b9123a3db3c2","src/features/gen_MediaKeyStatus.rs":"84b494af1ff0f280212c4cd7a3870003b2b3dd6d81effc4c1b0d726f557776f0","src/features/gen_MediaKeyStatusMap.rs":"6b9998312edca6fd61c12bd07e2f4e7c401796ce6c61c6889d8671a75cfba394","src/features/gen_MediaKeySystemAccess.rs":"5fe55a3799a819ab9d66de3eaeaf1abde00c748d80d875d6567a4f4dde8f0ba6","src/features/gen_MediaKeySystemConfiguration.rs":"10885228b1f2aefe3334c8b81eccaf7ba279cd2d0c06fbf118c317357ac7d166","src/features/gen_MediaKeySystemMediaCapability.rs":"4eeac88eb0383412c65843d9dbb644b41cfdda2b25f90ddf2bef88cc287eb710","src/features/gen_MediaKeySystemStatus.rs":"9e8c4583447028582c00728ac99541b9c218ce2bda3fa9611bf994376bc57977","src/features/gen_MediaKeys.rs":"08cc712c57c3ed89e998528dfb7841a4e13b8e61c7c5c5dea9e23fc95638a1c4","src/features/gen_MediaKeysPolicy.rs":"d4ce8a419a9782082b3cb1f8af23980a26e01823549bf793be0c3e812aa8793a","src/features/gen_MediaKeysRequirement.rs":"a27c91277d6aa7d31f5a2ac6413c69ee5fccbb2fe2f537dddffee54134659ce4","src/features/gen_MediaList.rs":"e51ed7accb171549dfb19ea4e6f57340b299e7086145b9e0317492873c4b5fd2","src/features/gen_MediaMetadata.rs":"7455a490ededea4abf0141e3ea01d7711a7fdd5d23694bdc602c6f9db27d8654","src/features/gen_MediaMetadataInit.rs":"1a5c5a1a560b5ad58afe4308738c17961ce08c26c6ec414971fd18b7f7a2e5a1","src/features/gen_MediaPositionState.rs":"2c8d26750606a49914559b9734e79d0720526a20675750d6564b567ee7494c81","src/features/gen_MediaQueryList.rs":"4d7ade5b006b5d0a41b6c946c94a05fd8094f013e994e6b50a707b19525b0a0d","src/features/gen_MediaQueryListEvent.rs":"9ab20240a365f26915fdc7665deb978d1f07220234389bf698eb5787a7d8c009","src/features/gen_MediaQueryListEventInit.rs":"9970860bfc187bfd10e46b49ad1031ab4adc5b356813ea082e252e495ad92278","src/features/gen_MediaRecorder.rs":"a4e3068d22914e97cfe54e5be7c29f3c54b40c666202c945b9b2ca93d5eed6e2","src/features/gen_MediaRecorderErrorEvent.rs":"95f0bf371c23e551403897ef9772567504fd8d06a93f877ecbd5f2de27ac6805","src/features/gen_MediaRecorderErrorEventInit.rs":"1edcd8f5df871d7c8e36290766af52babc8d556ad55d2c90d3238b357acb4c59","src/features/gen_MediaRecorderOptions.rs":"dd66440960657c159296907a1c5dbf3a95ff12e5f663f723207c232904cad00a","src/features/gen_MediaSession.rs":"b2db222fefcb3ab85f24eda34d109dc04641f485dfcb11280221731ff7a0fb59","src/features/gen_MediaSessionAction.rs":"6041db37063bcabea7ccfafeea270d8cb47d5696af29c0cbcbede84733564daf","src/features/gen_MediaSessionActionDetails.rs":"ee83122df5e28263c4922e83a20c51d820db4ad5ec64e97749844ad4b41f7d57","src/features/gen_MediaSessionPlaybackState.rs":"d4a2b569ad5d9230f7f3660565b01e4aaa0a98f31815a1dfe7af0dc19e1e51f8","src/features/gen_MediaSource.rs":"ebec12077e7e6d7b76a4d757f6c4c63a757ace8f891102eed25360166236b1d9","src/features/gen_MediaSourceEndOfStreamError.rs":"7c3cf43ba95fdf0eac8d1a2cb2909a0531391d8ea847d07eced4b2a1f9aac51b","src/features/gen_MediaSourceEnum.rs":"aecde33a8d44c7502b014a7b024b1dfbec2025744f63183821e1c3e1d34e76a7","src/features/gen_MediaSourceReadyState.rs":"af7a2b78f877d8d7df0c6a4a63d4ca93fbe34223e9e2beff88fef7248fd14265","src/features/gen_MediaStream.rs":"2fd8ec437b476b9205f92935729a67ea8fea80d20e24b3db383cb6aba882fd37","src/features/gen_MediaStreamAudioDestinationNode.rs":"2cb00c542aea26fbdec4802b58a5b9ce35a66ede609747b32e820f4e1046f7e8","src/features/gen_MediaStreamAudioSourceNode.rs":"3e6b82f03890d82976b5d48db7145e63981f2cfb9f7a86cb685cdda58e33a239","src/features/gen_MediaStreamAudioSourceOptions.rs":"c76437e54686f61e8f6dd38c214438fe83651d5ab24b6e08794e31a9cc22d408","src/features/gen_MediaStreamConstraints.rs":"47b764c64ff2a0d86affe91f2d6402d7ae2f549557b156c77ce83671a708c88b","src/features/gen_MediaStreamError.rs":"b3c74e1c82f9535ec3d3f26a51d30d76397b97bd0fa284bf32d05139c3225776","src/features/gen_MediaStreamEvent.rs":"f4a4dc8ff06b45bb361b16226463a68923efff5978ca690c57b8ec3605102217","src/features/gen_MediaStreamEventInit.rs":"89f183eef87e1085acab6dc5709dfb2c32a1f645e42e63aad72bf94fdaf475d9","src/features/gen_MediaStreamTrack.rs":"90e2db66267317d10cd0e0c15618840dbd80d0a3c0e5a0d529b0bae8d1ff1ea6","src/features/gen_MediaStreamTrackEvent.rs":"a507298ab5131eba7f2f7f7779d5bb7952471f6698b36694c0b3e4eb58ba7a39","src/features/gen_MediaStreamTrackEventInit.rs":"77ea734f6a29d7b75514aae744b3f70bcc99f2d997987cbb3d621df4075e0a0d","src/features/gen_MediaStreamTrackGenerator.rs":"3b60bac5e3c8591f777e95262a3221d8b8a5c19754313cc545e247f0242f4bbe","src/features/gen_MediaStreamTrackGeneratorInit.rs":"eb27053c0fbf3dddfb444719ccdd2c2e7f8c6cb0896d3e674e7d89dbb9886291","src/features/gen_MediaStreamTrackProcessor.rs":"5e6a539b0b12950393155d72e9cc28a33a6b870cd58a13d24289dcf035267543","src/features/gen_MediaStreamTrackProcessorInit.rs":"0e6012ac528458506cc4217637b1b9fcc0b76cfa77f60608ee2d457d708023f7","src/features/gen_MediaStreamTrackState.rs":"60e233672eb80152c8a8267cb1ea5132d2a959b8df34d3d1d774fcbaccdfafce","src/features/gen_MediaTrackConstraintSet.rs":"14bb6b6101a96c46dff452b2bdd57e0bb4ce15966468a639287ca4ec4cc9d544","src/features/gen_MediaTrackConstraints.rs":"fabf0db4431c4e89918f7222deced3f7bba2c75c463585bddc7f845780d16e1b","src/features/gen_MediaTrackSettings.rs":"95e90d19d850979248cbb233acc7114b55616f96b13945905ddb7ca277378f30","src/features/gen_MediaTrackSupportedConstraints.rs":"92706f730b947f543d1dd44df38117d6651a1005989f1c14d532d03ce98a6ef5","src/features/gen_MemoryAttribution.rs":"fd1b71d59dc2752912de6ce9b9ded52f1f92b4a6ccc160ec4737815144596254","src/features/gen_MemoryAttributionContainer.rs":"db0a80811f32cb91e8cffb1a9bf48927a8d7e8b095ae1b15dd0236729421d909","src/features/gen_MemoryBreakdownEntry.rs":"19a2a702a6b5736e13110ab3e1c1d95a3d0e5fc303f2e05864c9a4827b410263","src/features/gen_MemoryMeasurement.rs":"3da484aac77ee2d3ae7470a386066441e5272eced1e98ae9818b08aae3445fcd","src/features/gen_MessageChannel.rs":"90ddcd571426733c187e984c52d35c87b6bf7b45541cbb2d82d6ca15aa161a24","src/features/gen_MessageEvent.rs":"528d440ef5fd62da17fa117c462f216ac50c231fceb3c3ade4003fe5760d71bd","src/features/gen_MessageEventInit.rs":"605b686753e887758d4e49853c7985dcc5127b7995e2dd1898d7368a025e8eac","src/features/gen_MessagePort.rs":"e72a8d3fe4c2397cb775ffb1cb87a700b69c75764400c54b297393ac37176e64","src/features/gen_MidiAccess.rs":"f1ec878192a8f25cdcb82727ade4e8f8835827ea6ce858ea7d39752921565992","src/features/gen_MidiConnectionEvent.rs":"d9d3ea88634d34cecf4c7f28f659835fa798b0fc82df227c66ec23fd6e74e3d8","src/features/gen_MidiConnectionEventInit.rs":"f2ee2c440c27b215be4e98c8a0b9e8f3bcbe43807822b1e731c207468643fdf1","src/features/gen_MidiInput.rs":"862d9f6df4e4f1043a55b1b963401c172eeb0caec6e2b97f8b232795ac6cd2ce","src/features/gen_MidiInputMap.rs":"823aea47c8adecda0ed24a6be25392766df70a3f47c099e4603b64e8c7e11fdb","src/features/gen_MidiMessageEvent.rs":"892d8a7b6f0ded04996ca7ebf1fb0619225bc7251131a6fa0c48350e837099fc","src/features/gen_MidiMessageEventInit.rs":"dbd78e2942103dac7e291ebf425e1c13cec0085c7ce13140ded7d6869c12edef","src/features/gen_MidiOptions.rs":"56e6c0c0390b89d5d4065523b49065a38348ca0c1d17f3c810e3c9bd5ddffce4","src/features/gen_MidiOutput.rs":"158b148c24bdac164e491651d132ebabc67fa42b8629b6f621c093b4e1fd4d69","src/features/gen_MidiOutputMap.rs":"b49b063c30fae4b72e70340807a00e5829f5f16d3b6b24edab9bd959798484ec","src/features/gen_MidiPort.rs":"296134c2822c1558df115d3c05b01ff379aad1f481a478f61642dd9ad4fa4316","src/features/gen_MidiPortConnectionState.rs":"e305dc46eb590a8e76c098c27f24adcd2dd6e181973a1af45c6e4b49df8438be","src/features/gen_MidiPortDeviceState.rs":"684964649c442af5c3f393ee4f7ea17c456654da50fbc3e77581216f74f00f57","src/features/gen_MidiPortType.rs":"f030980b943fce327115f2a21e378ffe77f787b097f6fa174ae99ac671868ff6","src/features/gen_MimeType.rs":"ea39e0116eeeb796baef5cd592a2c50c1774f99a6725c79184a8ee8f59fa0826","src/features/gen_MimeTypeArray.rs":"70f8ddd7face2e7b9d2f7613a606dc01ee47a6a3fbab4fb88989b250e8e9a24d","src/features/gen_MouseEvent.rs":"744067e6edae947f5ee8e0cbd34e57d72e7cd83f95121099f665d80640ee3a8c","src/features/gen_MouseEventInit.rs":"5cc092e6cc4a00008397c907b52195f33828acfffaa9772e819d581c42f2108b","src/features/gen_MouseScrollEvent.rs":"e8807f52b667c9a6d60827879004ec5ffc444c4ce4c10f5f724254088d0f122d","src/features/gen_MozDebug.rs":"a12b0881b7d709edd5fb635c89291c33401b5cd88ae523899dff9e5aacdb7841","src/features/gen_MutationEvent.rs":"798c8e4989c3493231fe9f548876c5993633b57dbb76ffc137ac97a1a9bdaad2","src/features/gen_MutationObserver.rs":"2b5bd53b741a7c150933d6dc963f70f19fc16413d16fc697e8e8b7143669046c","src/features/gen_MutationObserverInit.rs":"cbf90586c194ad02ddbf6d1d41d42a816967359c5f40fe8fd6cfc8cb75793f87","src/features/gen_MutationObservingInfo.rs":"edc536bfca7579b4652c38f255d96f55710442c440c2a99c87beeb4dcac067a2","src/features/gen_MutationRecord.rs":"87eac3e462dea50aa5d5e56375fe471febe89c7298b73b46aeeef78cfd258e8e","src/features/gen_NamedNodeMap.rs":"7e88eba9b250d2d7b9db3ae1d2d4be06610e67e4a5558378392eace26a598c6b","src/features/gen_NativeOsFileReadOptions.rs":"7ced578bb2c58a2a19ac890df800f8e5277e2913ece4e1abd155d94ba0e7ff50","src/features/gen_NativeOsFileWriteAtomicOptions.rs":"7cc1298a7b93e33e5cde28a47201d9225642ee77287ae396f3477ea0f000c2f8","src/features/gen_NavigationType.rs":"4f073deaf31b99f07a359f12c5366c3eb5a7e9f1a0be88e6d7ad2339b8ff07d8","src/features/gen_Navigator.rs":"1b63086cbfc07f6adfbef979125436d45bbc9df44792e7682899d72c4892abbe","src/features/gen_NavigatorAutomationInformation.rs":"e8c68b8079b3c6445388c90c5bcef54d89f95797b8826c5152bda8085cf7b9ea","src/features/gen_NetworkCommandOptions.rs":"08c2127b883d50e836a8743db57c43cb8e750c026d03dc0665dc33a7c0b1cd7a","src/features/gen_NetworkInformation.rs":"b103ea140d1f72f1fff507af635d3e7ae6f45f67ee83ec55499a0699a941ccc1","src/features/gen_NetworkResultOptions.rs":"fa47520ff00b7c8c09acc50e98b41dc98aaf1bfc8e8fc8a2d47476d6f1b3b0b0","src/features/gen_Node.rs":"f4c652f29c11156b6a64122c9827031b56a2e1bb05c6a1c969971751a6959a86","src/features/gen_NodeFilter.rs":"dbe8533d61602514245543d158609cf4cb2a5c09f00e4f195e6f533b720b25aa","src/features/gen_NodeIterator.rs":"e57962ba4674006f9c5538595e7f48e005b9b8b53cfabf29b10fe2541fd7b712","src/features/gen_NodeList.rs":"7250441e6abc77a92ef9a497076ba14b69ab600faec4b793719d9b790099a386","src/features/gen_Notification.rs":"0dda9037a797bbb5607ddea4fd0935c6c03890593e72128b69865d28ad17099b","src/features/gen_NotificationAction.rs":"8d576fd07fc6e9fcbf71c5b4d9e5d2d17e3b9c8cb210b38745a5faafc1408809","src/features/gen_NotificationDirection.rs":"bbb2c98b4e2b3918fca611e264ee1b6f38e08ac3379f86c99cd033475035eba1","src/features/gen_NotificationEvent.rs":"639da39dbfbf90b480376ceb07fa4024e9271cdbb28562a101ce0936986570a2","src/features/gen_NotificationEventInit.rs":"6db00374683490e1c1c0078c43cb9cfbaac9722e50b0d6492061583c4eed5892","src/features/gen_NotificationOptions.rs":"0e9b925662258eaafee7855a96a4a86b0c13fce6e27965208e1395c39d2cfb5e","src/features/gen_NotificationPermission.rs":"370230c16c6e6d81a8ae195d724f938d58dd3db674e71d5003ca6a525b632085","src/features/gen_ObserverCallback.rs":"98c111a515dc2ee5c38980d6e2f185b83dfaf271247ff61c563402e23023a40b","src/features/gen_OesElementIndexUint.rs":"b79e186b250b5979ed2d7e1ee062e47e3b75bb97977d8a46912304e626ac0e7a","src/features/gen_OesStandardDerivatives.rs":"e6e0f9278eb8991e6b556b8c47e1b7ded706450d700448d0c6a34cee75db64ef","src/features/gen_OesTextureFloat.rs":"fbb7c8a7c73b7faa65b15b06564c006f11a2ca855f05eebbc76b65f03e03ca56","src/features/gen_OesTextureFloatLinear.rs":"afd9775c76e873186775a5b980861e95c62bb1868422a6a237aae83178dfbaf3","src/features/gen_OesTextureHalfFloat.rs":"9fc4e416bd233c7aac695bad24aaa00ce68b7061492137b8883fdba11087c107","src/features/gen_OesTextureHalfFloatLinear.rs":"83bd642b12ffefd083f3f6f5be1ff63dd9015c7870004c30c7db19a5aefc198f","src/features/gen_OesVertexArrayObject.rs":"a84b2d5d3a3cedfd3db726a146f971a1510e116b840227980501435e00369ef5","src/features/gen_OfflineAudioCompletionEvent.rs":"10b44cd8425f1ab180690dfc95ab6186eab9dddc849f3aa5413118ebb5da8d23","src/features/gen_OfflineAudioCompletionEventInit.rs":"b336618b9cbf21bbb8bfc77c47739e2aba2fccdfb861a7c22b935dc6d0fae782","src/features/gen_OfflineAudioContext.rs":"a7f6d8a14652b744702a765c22a75a0e141b94a2f42ee3f5a7ed0cb2eff5f3cb","src/features/gen_OfflineAudioContextOptions.rs":"6560aaae0e68aac843c7e2f11da58d1816af99f6ec56b191c3fcc0be41aa33d7","src/features/gen_OfflineResourceList.rs":"a088dff292704be1502f70a93471a12f20f67b820c02ea8e795a459d4b1d29e1","src/features/gen_OffscreenCanvas.rs":"9f504626aa1d26c14d1f3a77c06967710a96b53e74ea2dc04705794226fcbc2e","src/features/gen_OffscreenCanvasRenderingContext2d.rs":"a62fab40a13068aaa555bb066ace036ccfd919825a4111d8785d92341acb9c83","src/features/gen_OpenWindowEventDetail.rs":"e6887d57f05beb441c26254597042b22d19b4aa73914cf883dc3f8f0ccaeb4c8","src/features/gen_OptionalEffectTiming.rs":"0605622c435ea32e6d7e5367204ab5c6cc0634347f7ecff21bd85499c9eea841","src/features/gen_OrientationLockType.rs":"987eb55f23b9152b38b3ddf5049cb619ac7e2a962406ff572ff906c7928926ca","src/features/gen_OrientationType.rs":"813f5e9c8bb9a3601fc42e811880e4ca5509e0f7beeb51b1aa2ce0a9db6d68a6","src/features/gen_OscillatorNode.rs":"9027efc4b3169bdd57ce02668f0f6820aea9c747409f94e45e852df395eec4f7","src/features/gen_OscillatorOptions.rs":"817d49de786fb96ce890b226030372e882fda2a2f495363e5ebde81af9248ead","src/features/gen_OscillatorType.rs":"cd13084dab02a8dd042278ecfb7a8083cb70c626487aa63efd9a3a9e3b52aeba","src/features/gen_OverSampleType.rs":"18b92d95d3f5bcf97eec28e1d166a32df0493819d9dfad17e390cb7a0b2d5d67","src/features/gen_OvrMultiview2.rs":"b00ba8a8cc917da69991575a82d57ddda8b8fd135d29866bb8bc224e0aff31a9","src/features/gen_PageTransitionEvent.rs":"4f62637150ec2064aa5e837acb133a1c76d5c4cc6ea189522e6936259a2ae617","src/features/gen_PageTransitionEventInit.rs":"8b28a033279508f968febff92288902395b8685b9a23f6ea6e032f75b8f083b8","src/features/gen_PaintRequest.rs":"468944d82440e982c1fd8cfecb0fbc4d01b7e46f9e814de2ca09e70ac34047b4","src/features/gen_PaintRequestList.rs":"221972c7b627191d511b4684ef0a9342c1fa628ceacb859ce2e730f5e08796c9","src/features/gen_PaintWorkletGlobalScope.rs":"97e2a518a38109028c4828e3275445220c2165432e0085d2ab07f3a5f138d6dc","src/features/gen_PannerNode.rs":"9c82ffeb28bfb9a0af06f2ba94cfd8ce2aa047aced00594efcac97c0ab3b7beb","src/features/gen_PannerOptions.rs":"851bff8a54867fea4fae6cbe2bfb10d2c4d55a0e944ff91022dc336a856573b3","src/features/gen_PanningModelType.rs":"8b96b1cba3ab177741cd0d9aa8df232f4f10252397c464c13c0447fd29c587a4","src/features/gen_ParityType.rs":"5503e75a17f074cff994f47d27ae099ffd0d6dfb0fc27d15b2658627d54bc7fd","src/features/gen_Path2d.rs":"dceb735e674d929b14df0741fa09a8068d67f479ebb0db1a06dce9ec8cb6240e","src/features/gen_PaymentAddress.rs":"ac27dc10089e7f75b9d6b65cee0861bacc3361fd2862cb692305a4c675263963","src/features/gen_PaymentComplete.rs":"548a78e5bff05cb7c5486c76f118668f803ff2fdb7ff5ef259ca055df4427d77","src/features/gen_PaymentMethodChangeEvent.rs":"377b87f796766558db63a4eaf4843e0da5d63db9fe7d1de7040dd1663cebcf1f","src/features/gen_PaymentMethodChangeEventInit.rs":"632fe554c7dc3aabbff3b798a10a301391646e65b7f74b71b8710eb11c652b6b","src/features/gen_PaymentRequestUpdateEvent.rs":"7f0be72ab066d5569a76742f91540d4a59f364b12bfda984b678aa320caf3cee","src/features/gen_PaymentRequestUpdateEventInit.rs":"5c8f74a7de44b948f488559b1eac3a475c5560d44f5860f1e1bd2623639faebf","src/features/gen_PaymentResponse.rs":"574c68d8eaf164900d5475d1b6f5540d91f83d5364c2de251963f1b2af0bf86b","src/features/gen_Pbkdf2Params.rs":"1cd849475909f52c086eb79bdb0dbdc0dca5dea14e3c1947010a50ba1d0306a7","src/features/gen_PcImplIceConnectionState.rs":"f21f4dba3ed64c75e7dba65c6c87fa1685199756db83a8e6dfe9224790194b9a","src/features/gen_PcImplIceGatheringState.rs":"9873ef4688dcb5faa86b3904a70fb7a4eda61cac459078f8478eccda872916bc","src/features/gen_PcImplSignalingState.rs":"3e9beb92e4645127636245971f65bf5f005f4bbdfc3be8a3c15534d268f29bcb","src/features/gen_PcObserverStateType.rs":"b2339607bccd0848877ea3791a3aee9d09204ee2301386616574e1d6b0c2331e","src/features/gen_Performance.rs":"283abbecd1e76771b074bd17d3c919be63be061966156b18300a02004b629c8b","src/features/gen_PerformanceEntry.rs":"a1d163527b2b5d298583bff0d7e0f5e298916e0555ed813f2e7133c4584c8e23","src/features/gen_PerformanceEntryEventInit.rs":"d9047a79b9e1cb6959e72b7b4aafc944d8d59ca3ecb4492138fed4a8781ce916","src/features/gen_PerformanceEntryFilterOptions.rs":"44f4de8afaceaaef77f89b621b3f4a24a9bc228a50fcd5b2d2f7f95ed6bc9e59","src/features/gen_PerformanceMark.rs":"2f3e720d6d239308bf8e8b9f61d8152e396f8186966172aeb9e1fb99cd130985","src/features/gen_PerformanceMeasure.rs":"0b9b93749e026e4cca74dd846736b9ded62576c949ab2394bdca5dd7e8e55f8d","src/features/gen_PerformanceNavigation.rs":"52ab7aa8f5efdb05beec5851fed95bcecccc0dcdd63642e96481d9081995163e","src/features/gen_PerformanceNavigationTiming.rs":"b1d6f3e10062eb31dbbdf5a29e45880c023dcf606fada4a3081d48919aef8c60","src/features/gen_PerformanceObserver.rs":"03a36768e8249bb5ef2e9e83a34d437bde27dd8e80bd37445e5d275314f083f5","src/features/gen_PerformanceObserverEntryList.rs":"4249028e2d94f43c3e7747e0c858cdaa28ea34772a97e899dabb9f85997bee13","src/features/gen_PerformanceObserverInit.rs":"285151558ed8673ffc8ce88b3854d445314e421c25908828c1616f4bc512cb43","src/features/gen_PerformanceResourceTiming.rs":"c0421e1066301834b469409cba32d237189cb8b81ca8570636606eab5f921407","src/features/gen_PerformanceServerTiming.rs":"9434899f4267e553ff7d179ff107fbc15fb1d77608c95b7d09262a2f62b10dde","src/features/gen_PerformanceTiming.rs":"a971a00e12bd305bbd32df2303255566e0b7117c2c01d6d2e2adbf4c1c03a508","src/features/gen_PeriodicWave.rs":"30d36fb6ceafb9c793437e93834186eeacea1db3922a29566a8d16807e739252","src/features/gen_PeriodicWaveConstraints.rs":"928e9ebccca8e1d1027cce6127081f7638c567c7cc3daf5b372955ff16e7b0d9","src/features/gen_PeriodicWaveOptions.rs":"5c513b1940315ad451f370a5e0fbf5ef37a12c75b864077230bc93d0c60ecc50","src/features/gen_PermissionDescriptor.rs":"d93c5644beef31854913da0143c8c6a38c2483ba1ac99392006bfce329e58b08","src/features/gen_PermissionName.rs":"be40252fbf78fdbe45ce98e71b3b23dfc2a383b6a53e4e503cf1bdc09d590fcd","src/features/gen_PermissionState.rs":"0e0a343cbebd9a2ceb3f53a7cf0cb5493603c16828386f75b7cbddb1489bd92a","src/features/gen_PermissionStatus.rs":"176cca45428a2f5ae25fce1fd16cfdd01ab5eca4a0e5fd90a4df714203ab095c","src/features/gen_Permissions.rs":"6fc71866f8623537d120756ace620835a0f6a4a241d5c94e80e0c65227e4d3ee","src/features/gen_PlaneLayout.rs":"2a95302c76a647fcd4f90f589bfd6951961f3a0611273d56697ac39211773128","src/features/gen_PlaybackDirection.rs":"e0b8abb2584692a3187149bd80297e1dfb3b8ac32d25095a0f725e24b1170d97","src/features/gen_Plugin.rs":"6c5f4bf8064f03b3962b8ab53764578aa54301b6a9e54e882877f2402a0ace7f","src/features/gen_PluginArray.rs":"7c26114770e7592c76775a47b1cabe83d9f6fa213629af5cedf8a55301a56ac3","src/features/gen_PluginCrashedEventInit.rs":"3f79e6878be161ebd739fc4b970989e341c837f5370489caf5381f536a26f88a","src/features/gen_PointerEvent.rs":"d31532d290fa9f704df400a5ab53402d1393dd5b3d38cf06a61a6099a787b792","src/features/gen_PointerEventInit.rs":"06abbb28f5d9ac0d6fb5d0fff4404cc0185efbd5f2053d0ed83a6a9b6a701d4a","src/features/gen_PopStateEvent.rs":"6a869c0e72500867b831494685588227a5184dd4983bc701ad2776c6cabdd3b5","src/features/gen_PopStateEventInit.rs":"5a9d1d850140190a21674ffe068013670e0aabfdaa6ebbde5db517bed38b4906","src/features/gen_PopupBlockedEvent.rs":"facbd804ced0cf6d1e6066c8d53922ad04e18bfdef31d9cdda98f75777837d69","src/features/gen_PopupBlockedEventInit.rs":"22ea049599a7e2d8d229020a341db6838bcb031c4a570dd62e011e6d9483d0ac","src/features/gen_Position.rs":"22b05f3161d8a4586af0155dc2538958a85a033ceb2bc4167c0ccaca2e5ad42d","src/features/gen_PositionAlignSetting.rs":"f2ed593481eea26584252438e2ddaa81abf9c26be3c3737089cfd2025086c7f0","src/features/gen_PositionError.rs":"914ecd97c1a73b7021cfb66859d54d49cf2f3384e9c76c1686a368da0db89d33","src/features/gen_PositionOptions.rs":"18a5db98b28bada8181a151ff4987a226cf167ca5cbf760316e45d03cdfadeed","src/features/gen_PremultiplyAlpha.rs":"b4ecca471612e50f211b2426fc847654e882ffa0f8cdf54a4fc73d304ede3263","src/features/gen_Presentation.rs":"ad1bd472499d90d4f0d840bb9b9a3d0e5e03c9cca8742563a7a0a2f35792088e","src/features/gen_PresentationAvailability.rs":"576d8fb2f584bd1be20357ef59bdbc7ebd5bb67e4ae213155d81d99225fb7078","src/features/gen_PresentationConnection.rs":"41494b748e7a8c460c5fc0acfc5f611a6cff530952fb8a1d967ab84324090094","src/features/gen_PresentationConnectionAvailableEvent.rs":"62f1a09dcc701743892036fe82218b9b8c4e7ac4d5ea5b4f9dac885048d9c9af","src/features/gen_PresentationConnectionAvailableEventInit.rs":"550c60a21acf8216994f9be051c0601a40d855558eb5c8b779ae1f76496eee9b","src/features/gen_PresentationConnectionBinaryType.rs":"14940054e35a841e6c7170b0703038e5e3212d16d4d6a97173a039a42045b8fa","src/features/gen_PresentationConnectionCloseEvent.rs":"398ea414813de4c7b1b34eb6210c418fc16042194dacd4e5d6bc8e19a53c8f0b","src/features/gen_PresentationConnectionCloseEventInit.rs":"2860b758ca8d4b006087fd190bcc79e334c7660722ceca3b86c9d45f179210c1","src/features/gen_PresentationConnectionClosedReason.rs":"3706f631259dd21ef64bdd79e713adeb7cf54be30a7b64b9cce12025a86f8ddd","src/features/gen_PresentationConnectionList.rs":"e91af0d1d53f6e81647e8313e9a155e8c49dbfc3f114fe5745fcb7e92c4d42f6","src/features/gen_PresentationConnectionState.rs":"2c871eaebe3c1f42511a22fdd29b6a3900c5775dfa1dca9e66f5822c83daafb5","src/features/gen_PresentationReceiver.rs":"4c1f36c12ccd9f41690a4da56ba7eb5296eaf1283701bc50161e07b67f650873","src/features/gen_PresentationRequest.rs":"01ef29504c91c603da3c4dda13a2c187340d1bd98450b42d68b0ed9b9daf86bd","src/features/gen_PresentationStyle.rs":"e523c50092eb5a2a2c97f98256d4fdb27d5377c839eec77f34c1154c75ecaab7","src/features/gen_ProcessingInstruction.rs":"a86e2e63800a8653878cf2231d6c9706190ca8a55582870d4b66f954ae460079","src/features/gen_ProfileTimelineLayerRect.rs":"1e91a879278972b86b5b1098330a108a46b0dfb6b2402fcd32cb0bba191ab5a0","src/features/gen_ProfileTimelineMarker.rs":"2abd3a0748bf43bd905cb8a49c3bae2f209b2022d687653a63478801200dae6b","src/features/gen_ProfileTimelineMessagePortOperationType.rs":"4a53015df740b672d2cb19d2a1899b35afacffeb1fd4882cc615ed5805f0625d","src/features/gen_ProfileTimelineStackFrame.rs":"dcdee283aef92f1d74ebdbaef54d6508435908a8b3e799ee4db0b0325937c92c","src/features/gen_ProfileTimelineWorkerOperationType.rs":"5d0d6d70abbc4424173fbd7d0508cd22fe01643aa36e30b3b1307f0c6fad89a3","src/features/gen_ProgressEvent.rs":"03aac3fcf3474a971dd894c9199e1c2365366058dd2edc0600a39572a8d8465b","src/features/gen_ProgressEventInit.rs":"717f4b38ff20a831eb4eaf9d9f8750d7abbb98bfc8ba50839a8cf9b7da281228","src/features/gen_PromiseNativeHandler.rs":"8356d5714486363489424575d2c0dbee0979d1956d9938cc918f5649d4a1e787","src/features/gen_PromiseRejectionEvent.rs":"f29fbae4edfc7b6d1bc1cd8cd47c6fd78ee81096a0fd62f60b10a22a248f132f","src/features/gen_PromiseRejectionEventInit.rs":"f701975d52a6c3b141f35db14b09355750bce3a3671e5ec299232d4c533d2766","src/features/gen_PublicKeyCredential.rs":"8da8c49929461f8ebe7dcce985c35527a58a43af04b0752ec17ca3d17368be45","src/features/gen_PublicKeyCredentialCreationOptions.rs":"2b4acbf0ef649b9d5e32b256986b307b736152dd9fd2085ca0efcdc700dd1b39","src/features/gen_PublicKeyCredentialDescriptor.rs":"57d11266052dee2a252e9efc9d81ba33d5a473c6988475a572024456f4cf96f8","src/features/gen_PublicKeyCredentialEntity.rs":"1766727b3a576ca112b8d915d05e05f75286cddaae3b3f5f7157dc9831cbdc95","src/features/gen_PublicKeyCredentialParameters.rs":"2ccf923d69f50963112f9767b36ec4d7af3ceb8569fa08e824f77581e68c62b4","src/features/gen_PublicKeyCredentialRequestOptions.rs":"a5df863158fbc34d36cb0a09b2523721fc6793ae8396e542f3644c4ba9162a18","src/features/gen_PublicKeyCredentialRpEntity.rs":"8a0c751c4989bc5643ab860127cd7b291724817a241bc742d6467b70a95964e8","src/features/gen_PublicKeyCredentialType.rs":"2fa53e1f9c1559b9d2b97a457a0e73bcf570fe29ba6ca9f81fc66c5d345fd979","src/features/gen_PublicKeyCredentialUserEntity.rs":"a525f6bbdcba70642addee41a154be60f95f69a9fc2a1af5814d954e2e9f0118","src/features/gen_PushEncryptionKeyName.rs":"e254e739e6d569331f53e3dc40a6e58bebebc761bc5ab038655c573117956091","src/features/gen_PushEvent.rs":"8cfd0ae71613f5bd823694f0b3fb7fb61a761ff9e1df51fb6913a86e661216aa","src/features/gen_PushEventInit.rs":"250374814cfdf7fe00e1766aac880a960e634ecf7c2c2865e91954e9c4343a3f","src/features/gen_PushManager.rs":"6f76c893923e46d40dabf22a67172e705de0f619eb240bb35db90384d9705767","src/features/gen_PushMessageData.rs":"58a06eac3d005600f0cc5326daf329869984768050790cb0480b50f697a04a52","src/features/gen_PushPermissionState.rs":"1a85b221aee9e0b8c1f65c0c27904d4731987e3178179a765f97c520e26338e6","src/features/gen_PushSubscription.rs":"22299648dae11e856bf5ec693c1a82f66efa1472ddabec3bcdefecf548ac58b8","src/features/gen_PushSubscriptionInit.rs":"8740069503123507bce03d98cb5b13f3a1ac948316937c82820510c78189710f","src/features/gen_PushSubscriptionJson.rs":"671fe8b739679d6d3c7b18cbce539a7895245ee94de95e0fbfb23784d20c16be","src/features/gen_PushSubscriptionKeys.rs":"48e59f1022c8eb962ef005f635d08af31970656451e50075b51ac97e836d1af1","src/features/gen_PushSubscriptionOptions.rs":"63ff5dc5bb6505069023d155fc3bd66a82c4e0611e87f3723e5b24ccc7cc8a96","src/features/gen_PushSubscriptionOptionsInit.rs":"541c793b4953ca71ef227d4dc1c5bd4b3dce0d81e2dc0b77d9d5e71cff86795b","src/features/gen_QueryOptions.rs":"fb85859efd590209034c2867f37d25a0a0e8e2a792787f7c6156d86a2acf2f88","src/features/gen_QueuingStrategy.rs":"ea65bfa44cfc1064f83ee4257a766dc272c19cd4cacd3d20c602dced9b86f17d","src/features/gen_QueuingStrategyInit.rs":"ea721a5fafdd5c4cff8645996883dc6abf472e82e82a26c23307820400ccc475","src/features/gen_RadioNodeList.rs":"c3b52e570b2be848e9abe2b5d8d388cf079f1cb722016238badbc4846744263f","src/features/gen_Range.rs":"97deebd332acb3fd5b81e0a3659585c986b6dae5ecbab880b2c7d37d61e126f3","src/features/gen_RcwnPerfStats.rs":"1564dc28218d0a8d0c35dee07ba294c4639e9c36a8b6294e986ed21d5985a68c","src/features/gen_RcwnStatus.rs":"e56f4d42fa9b945d2a15313539344d4fa43f284cdde1d814cf39b95836ba738d","src/features/gen_ReadableByteStreamController.rs":"63357ae3f1107fef75f06966818b23cf9b5bf533507016f8bd668f2147140139","src/features/gen_ReadableStream.rs":"d81d7e0c98763e2b76eaf69db01b942f63aa3dbd3e0ec1c7e8a52e03ef1a274b","src/features/gen_ReadableStreamByobReader.rs":"929983b3aa28116302008cfd482bde089a2cc5922e7d828a7cbda42f3fac6e39","src/features/gen_ReadableStreamByobRequest.rs":"be032efc76bc085f64c6c8da2421fa2a070511d73575a8375ebb3c2a62bd2210","src/features/gen_ReadableStreamDefaultController.rs":"c9e0a9534b4c3cb7eaffeeff6591e3dff1d08be37e4d2a5afc1e82e0c4441339","src/features/gen_ReadableStreamDefaultReader.rs":"307cf5a9bf7ac899cda243b83638b2c7c4fbf6f9c13bf46fe81937fad2748c4c","src/features/gen_ReadableStreamGetReaderOptions.rs":"82f86603f9fcffc28268bdab3ffe909e2df90758a748b2dab986359092ff13b8","src/features/gen_ReadableStreamIteratorOptions.rs":"f5cd4f0ecf984c864f08d440c147a1e43f60700c2c405d2a3130bce61ce90ea0","src/features/gen_ReadableStreamReadResult.rs":"023dd762284715277ccc6215f88c482fc565c64657d1fe9e82d8e8e9560b0b0d","src/features/gen_ReadableStreamReaderMode.rs":"5efb5ba3ea0165f005155812cf4e1f8dca54415641cd809051d6415071d98a5b","src/features/gen_ReadableStreamType.rs":"1707c86a4020cb6fd279bb4c301a5bba3e80d92c7f968385d006ce3da1b8fcec","src/features/gen_ReadableWritablePair.rs":"6a2a06652e1a76fa1bc98c2c178b9217dceb604d818cedd23cf78a548fb479b4","src/features/gen_RecordingState.rs":"59bcd7668a8a907ba8d8aca501307621b75dceac84ab48ac8ce369038013ffa7","src/features/gen_ReferrerPolicy.rs":"fe559985a5f95f4df07f795997803e5f38fc3ea8cefec1d4980507d9b751f543","src/features/gen_RegisterRequest.rs":"08ef80b5d59057a2c09c8635df67fc6ab3de705ca1c0df9113af11f559b1a6ea","src/features/gen_RegisterResponse.rs":"6aa1680fa9441e94f5aaedba2a2e898f19c900b27495be8d8e4a8ffef1c029d3","src/features/gen_RegisteredKey.rs":"afa0868446b436f3e965ebec4bbc2fd682ca03f02212ac04e388fc1e3552d100","src/features/gen_RegistrationOptions.rs":"50423d9e062f53cbf3cacff8b6c7e2e7c0294ec637460033bf0df8b7360d5acc","src/features/gen_Request.rs":"455f7f3f0b6196d0995c7a22ddc7beae8eb3dc81761cf628292be3b71fe1603d","src/features/gen_RequestCache.rs":"363a9ea076467fad178082d6bed1b1c8821504a6f7109c55a0d40f6a5463fbe0","src/features/gen_RequestCredentials.rs":"a0fe65006fd67d6301524516ff5245d3658236f053ff2e6f69bc0c893ad70ebc","src/features/gen_RequestDestination.rs":"386d65ea0616c6f420c2a3f5355a62b9215a32fbb4742901b22f1e3265303853","src/features/gen_RequestDeviceOptions.rs":"f100c954d5053549b87d2e9181a1d52fe8650b93443928bddc9bb04c4c6113a6","src/features/gen_RequestInit.rs":"948d94a7a3f054e40eebd950c8ec4f96314e56725983535b6f3e7e8f32003939","src/features/gen_RequestMediaKeySystemAccessNotification.rs":"2f0e81d8f5a5f33e8e20fa2a67e6a1d8b204f8c684719af74c3d4f6e888c4b28","src/features/gen_RequestMode.rs":"0c169faa398e0e293221483dcd70dc15c5d897c4eee41154408a10c20517e84b","src/features/gen_RequestRedirect.rs":"4fab9367c3971695cac584b7376556fb8d35981b83109654b56e710806623001","src/features/gen_ResizeObserver.rs":"ba8fc29f629a2d93cf7fb91becdfd855ae4c6a494b8c1277579215ecd3c57b1e","src/features/gen_ResizeObserverBoxOptions.rs":"bc8619f5f63e3a16a9fd1fd08802bafc84d25d52dfe03d6ba2bdb88fe073a01d","src/features/gen_ResizeObserverEntry.rs":"20ae515d7a87f08d2369186fd3ef53f25c4afc2bb8eac83ad622aee307e389b1","src/features/gen_ResizeObserverOptions.rs":"c42e7248293249a8b46392fca45a9e1b04b2de84d47dbd13513593abdcc2d511","src/features/gen_ResizeObserverSize.rs":"52218e9d399492173e9f0e838cf17be98757e879e24e1b5d993c890620ea6876","src/features/gen_ResizeQuality.rs":"8c54391b672c020ba27eea4230ccb7312bbc0d380a240d9549b4588018b6adf3","src/features/gen_Response.rs":"0ab5ce1296c20f27eed30acd365b6faca05482bf4692cf5691f544d2d0244f72","src/features/gen_ResponseInit.rs":"4e60fee530dcf2bf3599b0502c99d3cd2bd83a935834fa2b27e37cbb3c77453b","src/features/gen_ResponseType.rs":"51c6035f110f10c607883a8ac31339dc705ed399b8644491621b9a7666f6b126","src/features/gen_RsaHashedImportParams.rs":"017e6a7f87bfe596bf4611601accf61e363406371de4b120690459bb449f33f0","src/features/gen_RsaOaepParams.rs":"dd9c8bb93855735f25075776c0da87cf749c7663939bfde4ca4d6eb47f13283c","src/features/gen_RsaOtherPrimesInfo.rs":"ce02b9add52345646a9e2e132b42c6cd78ad15b22167e3be1e00c07ccac6ab9c","src/features/gen_RsaPssParams.rs":"e233ba0b96680990ee9357ba6010a41b3d8d6e903d2636c6fa6237f6ac9dc57e","src/features/gen_RtcAnswerOptions.rs":"d6bc1dfbbdf8ab522cb519cea6f15f89ab3ae78e6151ac9a0d8952166609bfd0","src/features/gen_RtcBundlePolicy.rs":"3804c950ca1b58436b500f27dfcee7180915b74f1195376245b769ac40b00e31","src/features/gen_RtcCertificate.rs":"d20076174be0444464705eb7353fabc442ec76038012ed5501cf83b0cf987fc1","src/features/gen_RtcCertificateExpiration.rs":"775ba7d98fcf288e99966343e3a5a12a68ca7ef37e68c516546d4768b6bc3028","src/features/gen_RtcCodecStats.rs":"1802b839068f833e6d10dee6805e2aa67e0225ee8793ad7b824150de3fc314e1","src/features/gen_RtcConfiguration.rs":"7c26dcec23e49b1a7182146b02ae9754ab3245d19dbd0fa060ecba6dcc38458e","src/features/gen_RtcDataChannel.rs":"c49d0135047fbf89156c8f482975e50d95f13718c2245dca08ea65d10f6cd566","src/features/gen_RtcDataChannelEvent.rs":"f61afb174a7ab9d8d2b46fae5cff465e24aa97c88270449dab529ce589b7cf2d","src/features/gen_RtcDataChannelEventInit.rs":"539ea363b1c0830ef9ae8b8448ef5992ccfceb9a8c9bd0c9b01b61c1d9eca4a0","src/features/gen_RtcDataChannelInit.rs":"034033b9f9eb6a014476d4b2ddd572e862aba79384eb91a8f5d15e97c56a828a","src/features/gen_RtcDataChannelState.rs":"c0ef0db7587582bc75007dec7799ed972690c05dfd0cfa630cd51e33576c1252","src/features/gen_RtcDataChannelType.rs":"dc9bd626c4dc24d25db20590c6246cc7b618217ba7010d57ef89dcac9326b9d7","src/features/gen_RtcDegradationPreference.rs":"c10f9ef8d77b10f82ef6032dcbcc5e12c97379f728c763b39d1080de6a7fa5b2","src/features/gen_RtcFecParameters.rs":"5617fa794bd604d58edb29ee1f1062b792ad149506ac2fea71dc22e3086bcaa7","src/features/gen_RtcIceCandidate.rs":"b1fe834d7c70542d7b4247f9c46e758584a744e29bc2608f2ab0caceecf99f04","src/features/gen_RtcIceCandidateInit.rs":"811bec0569f7add98725f5fe3193fe37a1f9e5ba151468ba006c1111f8122bf8","src/features/gen_RtcIceCandidatePairStats.rs":"67405539d26845a08b2021c294934a9ad2c30eb08404a277fadfaba1d0c8165f","src/features/gen_RtcIceCandidateStats.rs":"904df81fbfa8d0d8142357beca448a51f530cb69579a0b14cc6d6e465b8e3f81","src/features/gen_RtcIceComponentStats.rs":"f00f4dd27e4487506c31c6d6b78707a8211269da31368f702dc794955db1a799","src/features/gen_RtcIceConnectionState.rs":"d9b79307c99e89dbba67d8a8876d239acf9491e31d7bd33c5556248cb7885845","src/features/gen_RtcIceCredentialType.rs":"7409d0a57b3e4d7d8495bba7a8b9ea501e76dcd88279094dc570c4c916750c65","src/features/gen_RtcIceGatheringState.rs":"05a65f05706ebb97d3f50858a2f2fb88e1b7d86828e8915376baf84a07cb03e0","src/features/gen_RtcIceServer.rs":"839fae6bbdbf3bd013403105411352662f131698680ee4861fff9a326ac1ef8f","src/features/gen_RtcIceTransportPolicy.rs":"fe32be8d9d52919c960e40bdfb3adf74ba972e5d656158bfa2b7907a4340a864","src/features/gen_RtcIdentityAssertion.rs":"91398f073e95c0cbe03064ac7e9c7a253ca6ced736bbe7d9923efae1c4459e5c","src/features/gen_RtcIdentityAssertionResult.rs":"55523f8edf705ebbe680a11ce611e2b6859fdcd995330f11e7622f542a019d2d","src/features/gen_RtcIdentityProvider.rs":"f2feea2daf80b944cc42c10f3a8103fc884c18881a864f0812e2cb0fc90358d3","src/features/gen_RtcIdentityProviderDetails.rs":"16246159be44539bbcb97a6866662836ee5536ef8a71805b1ee278f7d9022458","src/features/gen_RtcIdentityProviderOptions.rs":"1f429dd68bc669b2094668992e5b9aab4a3525856647a94b16efc4c5a9f401f1","src/features/gen_RtcIdentityProviderRegistrar.rs":"b8ba7e4e664ca83851aa0f3e260b8c2e1ca133d2479c9155bececc8da116dd8e","src/features/gen_RtcIdentityValidationResult.rs":"5411911ad7d0b3d366fcbdf98fd169da43065c69626044dfc6f9e04c606da1c0","src/features/gen_RtcInboundRtpStreamStats.rs":"1f4a032fd341994370ba36d44d204b6266ad28d2c033c14b47c7c5583c71f00c","src/features/gen_RtcLifecycleEvent.rs":"746b66215ee5b6a6e1369f50204a16cf239e4d080efb1ee0c748f7c44ca76764","src/features/gen_RtcMediaStreamStats.rs":"c3efeb190e8e0331f7c5b2aca2ed5703b7b7da7eb04280749e0179dbb921ac49","src/features/gen_RtcMediaStreamTrackStats.rs":"dd1657ad576be3346a04426c4c0e4a4572bbab190f5c19a8cb2c701f7ed899e6","src/features/gen_RtcOfferAnswerOptions.rs":"17ef33ceecd30261acb69ca24cc766eb8f967eaab7554bab18eace161edd849d","src/features/gen_RtcOfferOptions.rs":"20e2b0cacdf2e33d398aa6b8e08bf5fdaee93b5f7253343fb536170cb19f82f0","src/features/gen_RtcOutboundRtpStreamStats.rs":"68e5f107e1889904470e0498ed3823ce863c3ed543432784d70a885640f77c76","src/features/gen_RtcPeerConnection.rs":"501b2f90e15bda04c2bc387e0490385267f90f588beb8034cd11228cc6d1fdec","src/features/gen_RtcPeerConnectionIceEvent.rs":"bc6713ebe6c96a8befc6af27967aad356dbcbdcbb81c669bf1b72027fe2e134b","src/features/gen_RtcPeerConnectionIceEventInit.rs":"fe12dfe2fb90159aaed1b2dc4ed8194e8c11dbd952b243df02b49b29955f21fe","src/features/gen_RtcPeerConnectionState.rs":"bf2c12d3d07888cdf019047f06276adec24aa7d8ccd603aa15c5e6fc29bc1885","src/features/gen_RtcPriorityType.rs":"111eea2271820cd7fcd6ade25d151c754950388cb642abbfe345f252e0e1c734","src/features/gen_RtcRtcpParameters.rs":"1d457d9bb1ca27bfebd1042d89b76c3ef19330370bece26ec64ac2c965e297e9","src/features/gen_RtcRtpCodecParameters.rs":"49808f9ac3a9654a26144edeb5905e17549aa77c4fd3dfc6a2213b5b16fc48c1","src/features/gen_RtcRtpContributingSource.rs":"97231f49d98ca367d199f6c6cb9f0030bf3f06557a80f9b825e88187b22c2c62","src/features/gen_RtcRtpEncodingParameters.rs":"67421157ff8078eccfb7c17b2e53d4a0093195d6843003b61b80b6975dafa669","src/features/gen_RtcRtpHeaderExtensionParameters.rs":"a28d2aaed4c0a4dfa227f9a31d686e943bea35c6314c38f0019433d3bc18fc28","src/features/gen_RtcRtpParameters.rs":"ce44e39a6ce3002ca97f3bac08fb83fd59f2ca3098cb65d3108e8cea123a9a1f","src/features/gen_RtcRtpReceiver.rs":"14e5806ed7304b13d3dde05f8fafbda98cf4a4cbe87d7eb6e029fed993f460ef","src/features/gen_RtcRtpSender.rs":"15ac0a8c26cd905b7ebf67892848728e845d11513737e694d3021ac0457283b3","src/features/gen_RtcRtpSourceEntry.rs":"d98345cbdf08ab956ff6fbaf3614288d3fe9a0e949be751dd5a429609a2d6d22","src/features/gen_RtcRtpSourceEntryType.rs":"740b28b1eefa20875e5e7ea731d2326f12a2c8093399cd305d8d1079d75d8848","src/features/gen_RtcRtpSynchronizationSource.rs":"db13996c3392df4a69bee3828d4709f9385f9448e9fe27e867dd1a688d42824b","src/features/gen_RtcRtpTransceiver.rs":"988fe9e6a2116b1d747942cc275aff2b42f420674952bc9c652649d6b49e5bdb","src/features/gen_RtcRtpTransceiverDirection.rs":"7a7e408e5226c1f85cbf12745da57094f0a32cd6dcf28f152767bb1cb24350cd","src/features/gen_RtcRtpTransceiverInit.rs":"191f34aa12936e99f8395876dbe90567d2c20b2b67d1cab328e2785d7ae7faad","src/features/gen_RtcRtxParameters.rs":"211bb4b1f979462b96cc73d4c75281be0a9cadfb116db668987b4a1400c7a8b9","src/features/gen_RtcSdpType.rs":"b45fc255c23f30a212b91405bf08fe9ae30fe5c85ad56aa59af234f55cb56503","src/features/gen_RtcSessionDescription.rs":"2f1d306533c6e8d352d2586c17fa0ae5ccffe3540461163b79e2763b3beaff27","src/features/gen_RtcSessionDescriptionInit.rs":"174b24d5fb12e6b5a97a7ee95ca4e3f13a9f8069903ec6e354f2aff3393b2cdf","src/features/gen_RtcSignalingState.rs":"18e1231bb649e81a79f28221527ecb8a98aad421d2d1ec4c9e037449c340c987","src/features/gen_RtcStats.rs":"9dc7e9112bc310aede2bd0343efd3c5252b4e7a4b8b9af473c7cc2207c823035","src/features/gen_RtcStatsIceCandidatePairState.rs":"01b282e46db6438bd3d1840f1b888599cbb5866e5d7c799c94e02913e48080a7","src/features/gen_RtcStatsIceCandidateType.rs":"447bbe9f6df6b74c47597bf8c8f3e8b9a050273e4c39140f20c98bbc5fe05c21","src/features/gen_RtcStatsReport.rs":"a5e54dd940aedcaaa10ce1801a6e8d5b18a7ef1221e05542d5f3ffb5507f619c","src/features/gen_RtcStatsReportInternal.rs":"a68d8bfb72e60e159ec8bac8601301d45bf789cf8f48e2298d8c694e7cdb8fdf","src/features/gen_RtcStatsType.rs":"9f9ee0610b207cdbfbd49bd6cb88371b72eb99b52242b0990e6745b191aaed6a","src/features/gen_RtcTrackEvent.rs":"9da9b129e4ae43c2fecfbb8e52707d80be119ecae455e98d539e4f7f1ed807ac","src/features/gen_RtcTrackEventInit.rs":"88fd8abdf2d91009b55d5ac29b379101b88872f227a3dd2f0e951c9580d54bca","src/features/gen_RtcTransportStats.rs":"f53eef78fdbaff45cfecc7ec47f5b7c37ec5fbe4a78664c6f1230aae763b4bbe","src/features/gen_RtcdtmfSender.rs":"4874fdaf13705721aec3013239db17c90df9b3a6ca9d3792f8e1b6cf1e7bea03","src/features/gen_RtcdtmfToneChangeEvent.rs":"001fd8daca85d009d1ec7fd78f40d726ca48608301b9a677d03a9a2b9c582ce3","src/features/gen_RtcdtmfToneChangeEventInit.rs":"4c37bd8590272a9663c65689982be593d5cf5489ca7cd2032b1912cbd4dfa3f2","src/features/gen_RtcrtpContributingSourceStats.rs":"51f0f8bbbde7c4e72f40874d4312368f02c55d92fc4afdaf911a2d6850cb8bfb","src/features/gen_RtcrtpStreamStats.rs":"04c504e29bb4cd8179ef4cd5d5cd3f44fabf560f9cb4029207010ffc19ca4edc","src/features/gen_Scheduler.rs":"735b8d3e83f496dad748bf4eb3e0ee03f64c858f66670d49ef614ca639255b45","src/features/gen_SchedulerPostTaskOptions.rs":"8a8e181e5cf0197b0a99d4a695cb83936da95d541a6c129b18f128b83d75867e","src/features/gen_Scheduling.rs":"4903d4268e3ae981a06f8c5bea8d78b48cb7b6a2777fd605c6cfc6423a5eb87d","src/features/gen_Screen.rs":"ce170d116a5462c64c5f3f2bbed0afc98a8e9d0c9704695c1d4c3e4f8e40c851","src/features/gen_ScreenColorGamut.rs":"9d6fdf9b01cffe44fb3481dac9c0a5cba1a5178b0dc36fd888d5dd5d9fb6581c","src/features/gen_ScreenLuminance.rs":"c519a97c92e2cdc12d17b351608fe03ab572fed34b5b8dc57dddde473fd3f578","src/features/gen_ScreenOrientation.rs":"8874c1476a505ebbc0540170df6b6eb4f34d56249e8dbd2cb460eae63ca086a2","src/features/gen_ScriptProcessorNode.rs":"547864f8a39e8d757924cc51c4366c5dfc38741802625d0c60951d2086feb2fe","src/features/gen_ScrollAreaEvent.rs":"321fc91443ee506138280b734bc00485aba07ae4dfa11cb77538478fc39824d1","src/features/gen_ScrollBehavior.rs":"6533455773c7f393abf6d51bbaf509e395dbbe0ef9e1db16c8edd1a4ab661f45","src/features/gen_ScrollBoxObject.rs":"b9de2c99c406b044d6fba5b21602f7e8380d3883ecbce1bee7ba8d8294bef38e","src/features/gen_ScrollIntoViewOptions.rs":"3dd83fc3c426e53cd3e712856cf02ba3aee4c55348f34906abfc765c6055b36a","src/features/gen_ScrollLogicalPosition.rs":"04ca7530d005362d646d248fd2c1c67f0870ba1e3e13e19bc72b0ae0a65d946b","src/features/gen_ScrollOptions.rs":"f0d5582ff3d2ed984445bc4b16728099868b6752648a981dea4728d2afe77fd2","src/features/gen_ScrollRestoration.rs":"24f67a7109bca1d064a566ddfa420e358fa5a4dcfdea4bb381a760c00f0118b4","src/features/gen_ScrollSetting.rs":"f61e8ce8c8e8ffcbb9548e7bb8882dca5c8104f2302f73d62b3394d34e5a1825","src/features/gen_ScrollState.rs":"9117df89dfb6e6d4e09dfe1fa4fbf5fadd21f83bbc1ceb5572f67f4a89359d2b","src/features/gen_ScrollToOptions.rs":"34da1aa1e8b753d67a9dd5b1df9a5267717295f8102fef19bbd43708209ecbe2","src/features/gen_ScrollViewChangeEventInit.rs":"ca22a1fe806782ff23990b1225fab00933d373f50591b873e649ae9525c00f01","src/features/gen_SecurityPolicyViolationEvent.rs":"4ed0f426421a7bc9e6d133e4800ce350f5427dfbf36bbad267b6b07e3ddabb49","src/features/gen_SecurityPolicyViolationEventDisposition.rs":"ca7e975677990dfbbdd476df3f3a89b55763a0da4049ee2fd763343b6c82795d","src/features/gen_SecurityPolicyViolationEventInit.rs":"b60126d62817a6e6d03c4b1cfd8f973350c695f85807b0a3d2fccb8f365fb304","src/features/gen_Selection.rs":"9c142a6af3218dd95e141396a74cdc799d4662602105d5926b45c850bc0408d4","src/features/gen_SelectionMode.rs":"58b547a25152f38f95272a174689197ae61e26fc124f00632e6ea83af027fda7","src/features/gen_Serial.rs":"8380d007b5af41fc64dd1ed393f5a87aebec439207e6295bb1fbd94d7ced79d3","src/features/gen_SerialInputSignals.rs":"5a3dbe00a165b53bd86d5fc580ae9c2024da168c5b853d449eaa00ce3ee5c02a","src/features/gen_SerialOptions.rs":"72c3a119f984b97919d02023f6dcb606114ebbc28c8b8280e277ceb885a135be","src/features/gen_SerialOutputSignals.rs":"944582a60899f489b4ec29ff86e875acb02c2531d00d4d15166954b1db25a84d","src/features/gen_SerialPort.rs":"ba1039c36262a202d05368a5610e8fb89a61ac2b8b2d5c20654c212a56ef41c7","src/features/gen_SerialPortFilter.rs":"eadbf68fd7c841ff0e7d5a8fa10b0add4caa954e98ce5e5425876bbca65eadd4","src/features/gen_SerialPortInfo.rs":"81b400c58f5b408ae0eb868d5e11b76f15960a715ec6703b77b632a3d07909c6","src/features/gen_SerialPortRequestOptions.rs":"b7c30c1344d9a72b3d34e34120ea296851155a9278ad749b5c7c85eb18ef24a2","src/features/gen_ServerSocketOptions.rs":"5385b2f9ab3e04eab37f9eae190a4b3645593c7ba1aeddc97231f31f25d9f10e","src/features/gen_ServiceWorker.rs":"e30ef133e76ee02364078d4f7680559fded75baa3d6f2fc58b459640111bac74","src/features/gen_ServiceWorkerContainer.rs":"b946477bf7388813ea5d4d8cef3a20c0f615ec947d4788b6877a98280afb4c90","src/features/gen_ServiceWorkerGlobalScope.rs":"bc73997bf65ba21d9e6bad748a864b585ab0f50b3bae18d6136bf09a0ee310d0","src/features/gen_ServiceWorkerRegistration.rs":"eb615771dd9ba11f4d33afe16c1c474a3580713e28e87f037462a44b5dbb2bce","src/features/gen_ServiceWorkerState.rs":"4d7b9c788e26fd04339e0db13cdaa98d2821ca387672a9093dd06dda3681d677","src/features/gen_ServiceWorkerUpdateViaCache.rs":"eb7c97b5248cb1e62dd0ce475d7647eced3188a741977cd45e338eb01597d898","src/features/gen_ShadowRoot.rs":"1ed2edfe031db5305826ffea68c8b6a3ddd5d7e16b4cfe2852cfe2dd6815293c","src/features/gen_ShadowRootInit.rs":"86fb9a36ffc53f35d875860d8299432af405f22127d2ee5cf4f9ae1ebea2f892","src/features/gen_ShadowRootMode.rs":"ec348d573e34e3f5d8786c38580a6b61272c8a461dbfe67f4cea23e571b87c65","src/features/gen_ShareData.rs":"b1675bb622c319ab2f55dc9b26a28dec7eae585f7be07d65b0e1c154718d6a1a","src/features/gen_SharedWorker.rs":"b20eae7e79af3460332ed64bd14a4d90d40fc6c3210b7d1f27682a6d5f7b0831","src/features/gen_SharedWorkerGlobalScope.rs":"47f00a437040ab34d4e7db3754b5c191103f6920345de5c8696139b8863f652f","src/features/gen_SignResponse.rs":"3516ff1084c548d55a35b53b8189ca965b474036b512bbc77439d1a0d99833ce","src/features/gen_SocketElement.rs":"59dad30f9f2d18a2e7b48f0e47d89bccc5fc38ae776c62addb5d21c1ccf9acf5","src/features/gen_SocketOptions.rs":"5b5569be4fd1680d12b619dd9ce52881a4b257617b38ba9df38e0e57fb021c2f","src/features/gen_SocketReadyState.rs":"a396ff988bb68256d4ea18816441b357de965920465eabc933eee70e0b7f224d","src/features/gen_SocketsDict.rs":"9dcd815b9230fe5b4a08768c12f7e9faff24bc24c4bf4e730eee3c2fc372dad0","src/features/gen_SourceBuffer.rs":"38cfd744290f83eabf58dc07c390f4084917841e6e16e87e38b79a41667a3cf3","src/features/gen_SourceBufferAppendMode.rs":"1d53f574c6b8cc27194ad234bbc09c5bee9a367f59bb0a2b139b79ae346d516e","src/features/gen_SourceBufferList.rs":"3522424933998b713d52d9e4d8fe64bd162a2d1510680731d77d124b05a6da1a","src/features/gen_SpeechGrammar.rs":"8a5478f87c10857f31435f32b2d98fe5b367b2c885a676738197a03a3aa56942","src/features/gen_SpeechGrammarList.rs":"fca3e3cc402fc8c508c3de8fed6bcbdd09101fcbe8c2a7fb245dd4d9338a73e8","src/features/gen_SpeechRecognition.rs":"ac016c8db86f7a0728791a630ed5545daef93c46c6a2a923e088135a975dd84c","src/features/gen_SpeechRecognitionAlternative.rs":"7aff88827721565bb8e25c1a836c2d944ea1290ceff29d46df7a4dc117f6138a","src/features/gen_SpeechRecognitionError.rs":"33285060d79103d3e6b0153607cc823ea4bc21480a5d77ef8c5eac7c84e6395b","src/features/gen_SpeechRecognitionErrorCode.rs":"586d253e30b4531fedebc8cd8853543121f2f53ea0afb4deb832986f40592966","src/features/gen_SpeechRecognitionErrorInit.rs":"4629d509d148929daaa23fba437e7a53aed8850bcb74254b6a76cca1471a6869","src/features/gen_SpeechRecognitionEvent.rs":"cce320b09fb941627ebdcc27703f237fbdcd80be1e80a4ae63677c33ed7373bb","src/features/gen_SpeechRecognitionEventInit.rs":"e5a26f0e8aad9ca325691254113f1ff24f3279d4d14732dccc2fb254a641a3fe","src/features/gen_SpeechRecognitionResult.rs":"cf437b5a0ccc6187e2296ade7c96bd617c9a3a86c19f5f1846960381b87dd161","src/features/gen_SpeechRecognitionResultList.rs":"8b01d1228c55c7cafe2f105f06f084063cf493ec2104b666c15243d3e6ac8895","src/features/gen_SpeechSynthesis.rs":"fab62864a3c7dad2288cb28f28a21194aa656120f86061e40666b5f22e1d5a6d","src/features/gen_SpeechSynthesisErrorCode.rs":"3e4d4e9f6e0b3371efc30f0887e597d92519b0f0d83d8e692d3e0b3103b2417e","src/features/gen_SpeechSynthesisErrorEvent.rs":"5c5cb151cfc0c24f47308e8d95b674ac9849b5ca766853288a42506fcdf25de5","src/features/gen_SpeechSynthesisErrorEventInit.rs":"b7b518a5510eed6156ae76288bffc9366688808d6d8ef27c325335071e236c67","src/features/gen_SpeechSynthesisEvent.rs":"17fb47533cbc1ad82fb1970d6254db778ec3f20d45e235d87cb6e52383b6ad8c","src/features/gen_SpeechSynthesisEventInit.rs":"93e986f784423d9d830f5e222eea0f80dbabf372bc82a69472a44daf80c46528","src/features/gen_SpeechSynthesisUtterance.rs":"d5964209dd80c554032f8fc0060394c451d7a693ba46f44759264adc9bcdeee6","src/features/gen_SpeechSynthesisVoice.rs":"e5d425580bd5dfbd1aef24937339d21847cb5b9885798465e96a4044aa2ad672","src/features/gen_StereoPannerNode.rs":"8035121495ce790072f917cc4ec613ca40190175638e267d5a6e128725cb1439","src/features/gen_StereoPannerOptions.rs":"2042868d1dff47dbb6bca2e1b9a2eb45aa8c7f3cc729c1dc3764ed8617c5b2ea","src/features/gen_Storage.rs":"7b2e5620c2a25b59421ab22a8ae0c2540896e95a5172290537fa79093498dfe1","src/features/gen_StorageEstimate.rs":"616353a5f841081f2330331096f1f2665cfde7acdffe0a3958a252b049f9a168","src/features/gen_StorageEvent.rs":"d425293074fa7502eaa84a2a1dcb718f59efac5dde9aff7340c478683dcb7929","src/features/gen_StorageEventInit.rs":"2c032021903290f83d26d6afdbec0cefe2b10bba294fd63ac219bb3f0540042e","src/features/gen_StorageManager.rs":"3c9031e0de479422c2ae71e8cebf96a97667f83d3634587425a651a8115f912f","src/features/gen_StorageType.rs":"8721a6ae414ce80d65895563dd4cbb351a676439182bcb2264e1879874c90347","src/features/gen_StreamPipeOptions.rs":"f0cfba77fa41b4e2262693aca460e43ce5a478f415618ca99ab5ab7a3759c9fd","src/features/gen_StyleRuleChangeEventInit.rs":"2893a3a4913c3e6240fbc1fdce1f831d3988ca439bab6a8b2db5f5dff1ebb2ff","src/features/gen_StyleSheet.rs":"806d4f5ac89375fe7743bbdf2c9f15f44c5b3ebdfeea5de76bb1d33da2134bf7","src/features/gen_StyleSheetApplicableStateChangeEventInit.rs":"bf5c8f01aba0bf2b7b6690f4e81df2238176428e8aaed4f4631b69af556e6697","src/features/gen_StyleSheetChangeEventInit.rs":"8e12272b90bf5db0334518d4daa2e71afea37bbb50c47459fa0919678fb11efb","src/features/gen_StyleSheetList.rs":"f2f00dd8609c38a650e511ce800e4583f37393e75676697f38f89b168d5eca06","src/features/gen_SubmitEvent.rs":"84ed72d317455e56935a12ebbffe5a9ff7717b66819c20e4b1806dde54112d1b","src/features/gen_SubmitEventInit.rs":"0953d9ae9dce80183f565a497473da9287865bf3b728478a386701704ffd27ee","src/features/gen_SubtleCrypto.rs":"c9839946ab3107d9613cfeb9d982dc97266da2bac919c1199f9dcf93f70cf084","src/features/gen_SupportedType.rs":"dc46459afd665a7ce264f149d229b0fabd06093720040d857f75b80cf8489ee1","src/features/gen_SvcOutputMetadata.rs":"6dcdbb087ddb467047814873533dd10faa7562245c2e944210abdde1ce2511b8","src/features/gen_SvgAngle.rs":"6b3feba71e97f236435c9a9d6e44e8d1866a349b81cfb90d11b0bf83cbde8faa","src/features/gen_SvgAnimateElement.rs":"bbc71c765310375c0398d49f75036bcd6def99291014675d736af65db316e79c","src/features/gen_SvgAnimateMotionElement.rs":"82892dc8d910a85f82f8e87cfb59cc905be89d3e385aa452b789d7a25b577199","src/features/gen_SvgAnimateTransformElement.rs":"2207b2c66154f10097fbdbf04869c76d3fdeb22101b52f6e5842d95cde1a4e4d","src/features/gen_SvgAnimatedAngle.rs":"806ad5f85c5b7305fedc9b24a4efa9224b032a1498c2f2b0c556cb8a2f0f8f09","src/features/gen_SvgAnimatedBoolean.rs":"07c74b1c865d644b214034d4c298ade8439e6f8932a227f066a4e1be1873cd92","src/features/gen_SvgAnimatedEnumeration.rs":"a67c37bf9d4dd9ee7de41955db1117b36437ce5d8a001a8b902b85dea3d71daa","src/features/gen_SvgAnimatedInteger.rs":"522834102e4f3201511230209fe1f10f7570b3781bfb25b02ecd8979dc778385","src/features/gen_SvgAnimatedLength.rs":"b3894c69eab0cc18e417619865a329d5d4fe39ee86078501dd89d21a4380c8b1","src/features/gen_SvgAnimatedLengthList.rs":"43d328403203b43b819e51fd184e1da6c27f9e3d43372042209b19a5332d6cf1","src/features/gen_SvgAnimatedNumber.rs":"caf4db12ba55b98cc8f273c20c4ae13e3fa4277ace79d5e24bc2fd3ef3884dfe","src/features/gen_SvgAnimatedNumberList.rs":"cfc2951d0505ac583a52dcc905d6bd5a20268dd287001e80fc81276d93dad655","src/features/gen_SvgAnimatedPreserveAspectRatio.rs":"3b9eabc7bb248af0f1bcc380e44077a9bdfc26a7c32b08d76ad0c5930c63bd87","src/features/gen_SvgAnimatedRect.rs":"0521972f7d4e03dd7c3d85e4a31d4067c820b49e2cb2581c281b2d467c957fee","src/features/gen_SvgAnimatedString.rs":"322a44e6c25696f69f7c3b096dc4e458b1a7b3e76c15237f80a9fd119adc0fc9","src/features/gen_SvgAnimatedTransformList.rs":"79871d8e50a3e334d3f8be417f6f845c226672b57a53157aad65e2607772a67a","src/features/gen_SvgAnimationElement.rs":"6edb6ef7da9543e18140e935b807fca40d7671efd76e75deda63e909b329ceb3","src/features/gen_SvgBoundingBoxOptions.rs":"45e225cc5eecf7230908945edf0c6e0688641a4e3f12c8761ba8657c712bb95c","src/features/gen_SvgCircleElement.rs":"5fdad71797a45f5ea043246ae64bddbf95d8bc4eceafa975a135723a06348b2d","src/features/gen_SvgClipPathElement.rs":"c4b06dc1ebcdb679e62cc2ca2140350a004967e75046bc5a58b7f422a99e5702","src/features/gen_SvgComponentTransferFunctionElement.rs":"a60a6dea0ad586d26020901b8acc59f9155a5379a4212ad13679c8bbddf67436","src/features/gen_SvgDefsElement.rs":"800ee50a047c3f0a685e8bca29f62ce9934acbd71d31b8fd9e3acbf8014e8767","src/features/gen_SvgDescElement.rs":"8764d50100b22f0bd4ecb1d28b7773b3ab64b51c7a16281a3bc355053d67ceb2","src/features/gen_SvgElement.rs":"f21de48d51f38997e162a709d90a3ae1287bd39dbe7b411aa97c20bf7d980bf2","src/features/gen_SvgEllipseElement.rs":"0c2ef1e717e84aa9a4ed5c38d40c6550c6ba2b26facf33073086c33b652ea0ce","src/features/gen_SvgFilterElement.rs":"f36f6e95adafd0fa8a3a81ef1e19f859bcaa3022ff718042dd1c3ff9d8d33b60","src/features/gen_SvgForeignObjectElement.rs":"77edbff64b7c921b8bf65edc7db487f126ca193d75cb16a02fb18bfc67e55ede","src/features/gen_SvgGeometryElement.rs":"96e0e35cda46152373f4543dab95e5e110fa3618d300acf2c72d89c4e606cede","src/features/gen_SvgGradientElement.rs":"54bf9c36723165b194a0be43807b6d8364fa19667c4a8a710f559fd34d7d35fb","src/features/gen_SvgGraphicsElement.rs":"843c557ff9616ab0956239619c193b2d532b6b24de6f74b578898fd412ffb093","src/features/gen_SvgImageElement.rs":"0984653b29c7107bae8b3caaf6891673800310a629d37d7f3acfdc8dbda966c1","src/features/gen_SvgLength.rs":"c740c5026a8f232525d990f12c53e872836f679abd24d257c066b6e0bdedccc1","src/features/gen_SvgLengthList.rs":"eca96f0deb6e8729ecec4f6fd165b1863e7972d03c8f21a490512208ff02d362","src/features/gen_SvgLineElement.rs":"33f413654b941b48c93f1ebbfece23e53898e111baa463e792dd6c92569c201c","src/features/gen_SvgLinearGradientElement.rs":"4e8ec162a4526ef5d4998db35b9e0781a504ca775b29514611b8600f39be2af1","src/features/gen_SvgMarkerElement.rs":"bf876d42af812d6d5cce2031564e8abdac3fa5dd815c5fdf399c1c4358f02844","src/features/gen_SvgMaskElement.rs":"5cb779d967f039a5a2dadcf24492a86bcea06ac3b24bc0bec55c9f073eeed7b5","src/features/gen_SvgMatrix.rs":"e494c0b26ddff2ffd6518262f14d4b13d9e7eb3d67d7f0a51c845a9ca30f70d7","src/features/gen_SvgMetadataElement.rs":"195c8544a06707cfe30cde3fdd74fce02361c6b84f1599393dad79960bc41825","src/features/gen_SvgNumber.rs":"4f3be4606a88760c411c4c09ed1fbf7148cf6cea26377b2049e90315c17acfc3","src/features/gen_SvgNumberList.rs":"9ae2fb332f6d447cb6c56b536ec6b5f84f86b020bfd19c81580c308759d3a494","src/features/gen_SvgPathElement.rs":"45ff3bc3447f09d7528f02a9eef5a21be4fe27ebb94394553aa62b4b17921b11","src/features/gen_SvgPathSeg.rs":"483d100401e2910337cf3756f9f08f41c387a6f57481fa3cd2010d9b2f751c47","src/features/gen_SvgPathSegArcAbs.rs":"49e70abec0cc1d053774fc78e5f423f736a0dd5e453962948e81bb8c8d61bdb2","src/features/gen_SvgPathSegArcRel.rs":"e85aff82ecb6725c8084bfa766fd85345e0774d1dc269d97de0aa89aaf2c875a","src/features/gen_SvgPathSegClosePath.rs":"afde22076ca2755f878ba8d533dceb4912edfde999ae47350296794ad89d6784","src/features/gen_SvgPathSegCurvetoCubicAbs.rs":"b42f17f88394b9802125fda7a8505146834fe83b4beb71a7159cc0c316bfca6d","src/features/gen_SvgPathSegCurvetoCubicRel.rs":"0533e87a9f32b19253e1eee785654980ad7d212808f03b8a44c28d96189376d9","src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs":"402965ada4b43a6f0a426d51fb318bbfc26efcfaa64517a55fa9214e57a5e2f4","src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs":"e3b4f03cafb08544e7040b0f8adf6dd1704754b67c88e998b04f46986771a59e","src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs":"f6fef16878e820681c3c65c4a361f86ed82360a194b70ebef313505ef446e628","src/features/gen_SvgPathSegCurvetoQuadraticRel.rs":"49ecb6f89a528c81460c8c4d7c78e84eef771311482863bbe2d77f242b38c1f1","src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs":"807de1f27ef8f82bedd9091ca398ad3aa8aefa3408bf51ea078f280fbc9d57fe","src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs":"1b3b6eade6b4e84ada6aeaf6f5c0cdfdbadaf168d199405c268072b67bbe4c65","src/features/gen_SvgPathSegLinetoAbs.rs":"67b29ef6ad7172e9457507720659a775cff5a7457531add0cb9472d0af399429","src/features/gen_SvgPathSegLinetoHorizontalAbs.rs":"b58cc1fe1a0c7d76435231d5bc9abb263d208577ce2e14e241eb2bf523838934","src/features/gen_SvgPathSegLinetoHorizontalRel.rs":"61d7bf26f3dde895ecda9e9d184431d28af48f36f1f1d630dd32dc4245d4df78","src/features/gen_SvgPathSegLinetoRel.rs":"ec0302bef23b799c9f7fa3c71b38aec3ea997e7dcff849902c8f5b81302e3114","src/features/gen_SvgPathSegLinetoVerticalAbs.rs":"dc037ede9164440fde62975014ac9d5936579261e9d3593f037be76203e1536f","src/features/gen_SvgPathSegLinetoVerticalRel.rs":"defb2acd5b48ffa65e59bc666f77323f6a03869a5001ec605748f19734b2bc35","src/features/gen_SvgPathSegList.rs":"58af846e488a3323384b833301bdc1cd8b40286ce25da7fb2bc914facde34a70","src/features/gen_SvgPathSegMovetoAbs.rs":"08d92267a01ffc60ddaa4550e3fd1b3a7f3b6ebd31348f491d4f53cbf4379298","src/features/gen_SvgPathSegMovetoRel.rs":"e4fd3d0fd0133b1c094fd9e5ab4199acdc744d4a334e3386522abae6610acf6c","src/features/gen_SvgPatternElement.rs":"986704a7f309d82d21d405ae17537ec4988f84611aff7200bbbfa7fc54cc0ef6","src/features/gen_SvgPoint.rs":"6f30902ff818e99f30ceb90ccef51ce140908a6146cf8314d5f52df1fecb3bfd","src/features/gen_SvgPointList.rs":"c98db514401691314cc9155ca38db83e6059a9ac7930a3bdc700c5ab162fae9a","src/features/gen_SvgPolygonElement.rs":"3843c786b26963a862f357d468c919a7143ae0f2b75d7b3f6a6d8bc045f5a063","src/features/gen_SvgPolylineElement.rs":"206828a738f8eda2161a5149c18348e461ba78b3d63c5b05cc842dfd3b1ce0f0","src/features/gen_SvgPreserveAspectRatio.rs":"a3fc02fc75966c567587611017a3ba02f4bfcf091e754d2e0745643b0e6d0223","src/features/gen_SvgRadialGradientElement.rs":"6f7d0a3af047a88d81cc8239b1fdb88b912d73f73de2830401ff448561627add","src/features/gen_SvgRect.rs":"91b4610b4907e976b2961e74f51de8e3ab2650d3ca0319b01c1e309f548d6cbe","src/features/gen_SvgRectElement.rs":"c94af71fc9079da8625880df4808f885e413056a1560c9cf86c896e64f2f3d13","src/features/gen_SvgScriptElement.rs":"f3c5507d451680e18a37f84ba629aad718c6ae2cd4d1986f1b4ffe836abf46a0","src/features/gen_SvgSetElement.rs":"3a34ca18d85a69fc35748a488ea419b6ae0b57494c70367f64c70f7f45ce93ec","src/features/gen_SvgStopElement.rs":"ebbc844ed5e963da096192f4f3d5bdf0c3cb3a94453f0f3716879d319496290c","src/features/gen_SvgStringList.rs":"cecc678eecad140cfebbb3f60679cad612069ccc164301937202c511fa7d1d96","src/features/gen_SvgStyleElement.rs":"30005c363a30c3b83437556747434aff9b47da913ffb394306d62158b483e3bb","src/features/gen_SvgSwitchElement.rs":"89b4cdf99897be74b8c9ac8572b3d1b7e7b25a2f55fc22bf9cd9af24de4cc710","src/features/gen_SvgSymbolElement.rs":"ce7b3bc849135960b8ad8ccd1a499bd7798a7de91d52e6a69324de4745c7083b","src/features/gen_SvgTextContentElement.rs":"82d43fe6502f839cb787968d1eb2aa2f5bbf1e535d48677f1a4d39ab495656b5","src/features/gen_SvgTextElement.rs":"14ddd6394b71d7d4076b8bbf29cb8080cef1eebe9ebd13d4e20d832c283948d7","src/features/gen_SvgTextPathElement.rs":"cd4c41f93154bd96500b27108378a4eab15c7eed3f8410b9eb58268c48451e0a","src/features/gen_SvgTextPositioningElement.rs":"b4c88f6d4afefe6f42c0e61f3718400a8916db6857026355997acb8e8d76dd74","src/features/gen_SvgTitleElement.rs":"b633525dd40c0d6ce4846a90d72d90c337bc48087066a8e997b2ff1edaad8864","src/features/gen_SvgTransform.rs":"688a32808fd77bb291ef235020bf33d36428e71f03ddad4c38e5969a6fcb5ba5","src/features/gen_SvgTransformList.rs":"6236560d02a2d04dbcb47a726b900ea6d9f84f2cb34e7271840d37e172431c09","src/features/gen_SvgUnitTypes.rs":"0058ef70792fb47aa628f2dd5fd06a79fca236413ff4fc61ab0f2dfbde8b499d","src/features/gen_SvgUseElement.rs":"f893ef9e0dfe5e42ba69125528cfb83e4f3ac96948f3e6dba632839a5394595c","src/features/gen_SvgViewElement.rs":"1902395197a985f63f4bc926a0e5bbf6289dbc47d52b9a6992a69410b412983c","src/features/gen_SvgZoomAndPan.rs":"68735384900d73815633b02c61cd42e7bcecc36bec211028089128a36befc92f","src/features/gen_SvgaElement.rs":"2732722483c881ac8004aa9355ff3638a0ed06164aa7e64a76edbe40cd206c7e","src/features/gen_SvgfeBlendElement.rs":"c4f7fa6448da5a1b3a43e53cc2d8c081a4481523e67427fcae71969fe9634656","src/features/gen_SvgfeColorMatrixElement.rs":"11460d041c5d0f80817a48bef4f2092f6fbe7d56ad15e3e5ec80dd5928aea710","src/features/gen_SvgfeComponentTransferElement.rs":"b7962f717f050ece9078b69e7a66f030186e556d990b848b838c8ae2b93e385c","src/features/gen_SvgfeCompositeElement.rs":"b030095c2a5bcc43569a05450c52689181adddbd3cfea924aa8cc911df4ff842","src/features/gen_SvgfeConvolveMatrixElement.rs":"5371397bd268f5687046ecb7016a413aac6d8e20ca208a57f842026e6b4fab54","src/features/gen_SvgfeDiffuseLightingElement.rs":"163bfafb0b0b0c09299f89516ccf71c7d069d8619c3d44feca2bf0576b6208c7","src/features/gen_SvgfeDisplacementMapElement.rs":"50deb12a5254b46cb650b4fb4e454c027b399a58e80ba9177e0011a5ae40287d","src/features/gen_SvgfeDistantLightElement.rs":"e75ba4257bc711e65e6c655c348d5dee4ebd705690e93655ff9e2a7833189174","src/features/gen_SvgfeDropShadowElement.rs":"93156718e2f9b67670f8f204eaa5cc02f3e7d09db3d54af1309fd4adf479fecb","src/features/gen_SvgfeFloodElement.rs":"214e978a2460feceeaeba31487526bbad6c672d008b7497ff46ae63ffb390bca","src/features/gen_SvgfeFuncAElement.rs":"97a6658f7b96317a1eaa9efb2b088e65355fef8d4baafff8b9378d6f35173073","src/features/gen_SvgfeFuncBElement.rs":"60658ac771313f8008e25b009cbc50580740e815a37689c194e1c5e9c9448600","src/features/gen_SvgfeFuncGElement.rs":"12f532487fc05c65f842e9d03cafef4f494970d6e9cc21bc37066bbfd00028d3","src/features/gen_SvgfeFuncRElement.rs":"28b41674feb632385dc37c455a88de1797ff1247538492b5d14691d6c65d1e8f","src/features/gen_SvgfeGaussianBlurElement.rs":"d18429c9af40a0e9c042ee189d4dcdbdc293fa6f8bf3ed089234582c8a95f215","src/features/gen_SvgfeImageElement.rs":"65c513fb3cf5ecf0c56d1807545cb792eb35d4f44be129db3bc905a42a4ec8cc","src/features/gen_SvgfeMergeElement.rs":"d6cee647bae1a15b5911bc8fc33f6e9e40b586e01dd92d6204069f48233a83bd","src/features/gen_SvgfeMergeNodeElement.rs":"02560c27ffc73919a86482875b0a17e5b3d758a858b567c7d25fb802c0d7bc3e","src/features/gen_SvgfeMorphologyElement.rs":"039573884b00f563b7249051ede07bb5c7fef5fa5e9a18d1dc390cc75cd9c8fb","src/features/gen_SvgfeOffsetElement.rs":"e0a8321b1e9fdbb2f2c96dad5c59e6eb2fdb4b8624aea5c1111b170304e4c163","src/features/gen_SvgfePointLightElement.rs":"1368349da126d46fd3bae5507c548ca89b939ddf32eeec5f4f5bde83fc0dc26f","src/features/gen_SvgfeSpecularLightingElement.rs":"7534322d7cb49457c2e99d9ab14b7026c22bd6332a54a2a2e243fa27cbefb18c","src/features/gen_SvgfeSpotLightElement.rs":"d139cc28522e7fe8379684c957bcc3eba02962e54028399d77f78319f8e3a992","src/features/gen_SvgfeTileElement.rs":"03a855dc104aa28fb99936abdd0dd3b04687d8b42ffe0530492f06e6d24faa8d","src/features/gen_SvgfeTurbulenceElement.rs":"41ff0ad65001896fb83b5255b3711ff091c99b5e039853910f61c8a8d9f55c4b","src/features/gen_SvggElement.rs":"af2b5ddb57b67730c62fa2ac11f6d947c9e1c2a87c3a95bce9b9a7461a33b231","src/features/gen_SvgmPathElement.rs":"51caec4ed20d0168c063981eaa17edddc1f13fb9311741f9639c25370025ce10","src/features/gen_SvgsvgElement.rs":"e0acee6b2fd63b55f1188dd7b058d3dbe2866a13bed51348d536504c5d2d2c52","src/features/gen_SvgtSpanElement.rs":"7785e950bc12a0c165a1e002bf538b0e444de699758727f1e64f080a2ab00aa8","src/features/gen_TaskController.rs":"07294efa28dc895295b4a09f887fcbc68e0ef51620b36b7a4c65058614a5d289","src/features/gen_TaskControllerInit.rs":"23ea1445ed7f0f8fe6da660093eaa3055f893f8e4f1a4533afa0ed37705f7e4f","src/features/gen_TaskPriority.rs":"0d099b8a5c7156c89e8a83e7bdbe8a519e8d4dffa8eddad989b51ba766284e5c","src/features/gen_TaskPriorityChangeEvent.rs":"53cc7b15774e0c42b9735dcc00f60c3e7e7752008b83bfed6ffa9968199edbaa","src/features/gen_TaskPriorityChangeEventInit.rs":"e7c504522b44dfec9adb39b07148cf48def11ce503c9849db6d43d213dde5848","src/features/gen_TaskSignal.rs":"393021201afae4594c3fe4b77f81ee401aecf360669b922754210a3e50a04a43","src/features/gen_TaskSignalAnyInit.rs":"1346e7666f58a44518b06be4e3b58d9d15a2293729885df9bcf9e9e405f246c5","src/features/gen_TcpReadyState.rs":"4539b25bc7a6c310430c24ca34a786c43e710400386e5ca841dc12510d0410f7","src/features/gen_TcpServerSocket.rs":"0176c3e073e9abbc376d9f2e2bdd71cd76a11af080f3b7d6d290396c17444eb9","src/features/gen_TcpServerSocketEvent.rs":"33ba6a5ba84c1cdc13ed8627a3389cb5e1a1502c4b04f6fe7629dbd3547cc868","src/features/gen_TcpServerSocketEventInit.rs":"cc3702336d29cff55eab9b9f27f6237fa2dd31cbcf9c2d25719b736db508a34c","src/features/gen_TcpSocket.rs":"b2ad2f8ac9a24b553e1ad721b340b6f9be42691b1c6b8e0602cdc222d9e00123","src/features/gen_TcpSocketBinaryType.rs":"2f34438ad72f5999f807e6449b65524b860a9cfe161c8ca16aede9090487629d","src/features/gen_TcpSocketErrorEvent.rs":"9571ac9159b287e823926cc073880a237956c9c2d9802dc51dd67cd8751adb55","src/features/gen_TcpSocketErrorEventInit.rs":"ae0ecf6bcd9c04e51c8d8c2e9c1220591f56eed29588abf8f37649d2ed0aecd6","src/features/gen_TcpSocketEvent.rs":"f7d080a51d95e7d63c247fb4b01850c8afa785b270373ea6fd0f4cf8e751708b","src/features/gen_TcpSocketEventInit.rs":"d7c79ab57a8b1101b33032dc14697e1950c01a5df7152066bb8efff918cd887d","src/features/gen_Text.rs":"569527efcad462b48f2bd9a667ffa7f71440124c58bdf900f59051510f26318c","src/features/gen_TextDecodeOptions.rs":"93841d4e55d8a5db2432ad0f7f6d12aeed0fa86475d8edb4def4aa295fa7f500","src/features/gen_TextDecoder.rs":"dc2102ce7493361b635abdc14be061a7e9865a3377b50430bab906e5e6ed4249","src/features/gen_TextDecoderOptions.rs":"8f9d863f039a4e6e8141e3379dd1bfe48c0ae6655206d3aaa27e9b70bfd5c637","src/features/gen_TextEncoder.rs":"4ba691c39d5faeaf13ce201eb01d8390907156247344321c6d70bf9ca065a2d7","src/features/gen_TextMetrics.rs":"3a92144b1bdf0d02d14b8071518e75701e79177448f14ba6ef28db26acfcdc39","src/features/gen_TextTrack.rs":"5540b2fe181c54f996b021fac80569e49f69d7b6b318b43c81950efa23bf7d69","src/features/gen_TextTrackCue.rs":"9b55f4a6d80959f9d2e8680171f10b9b04f5514d94b94095d8c47bbe8ae1df8a","src/features/gen_TextTrackCueList.rs":"875439fe5bf20ede7f0ea126be171ac451d6c8631bc02351aa611f907a968b3a","src/features/gen_TextTrackKind.rs":"195a7c2fb50fa34a809f1fbac3a3ffe7bf28ddcf146766effb88b0ea39e0161b","src/features/gen_TextTrackList.rs":"1407b0c0f4592d58218aefeefa371829d160108255229b4e3eb8b22bb385669c","src/features/gen_TextTrackMode.rs":"aba58a77887861ec3a9a35c44122b013272506ae80db2c50cc81540d0010b6b0","src/features/gen_TimeEvent.rs":"0ad47908d17c473f19dc23de42eb59701ff2afeb07be23e0779bc217707fba18","src/features/gen_TimeRanges.rs":"e94e8fa664f35a54cb74819ae98cc51de28aaba177b797f2779603aa097fa16a","src/features/gen_Touch.rs":"cf75d0062b879e3d3daee7c5a58578cde885a3dac234baa11a527d3881144b19","src/features/gen_TouchEvent.rs":"64637d656940856b8096f31b7187a6d6128a3abab960e02a899837e9ef9654de","src/features/gen_TouchEventInit.rs":"baee123664dff284a5cc2de6bd538d0c086d1c584b5339ec4218afaa266630ca","src/features/gen_TouchInit.rs":"f2dfd166d45cae7947a8856f8efb13318f19ecba1c5647a2cfb10625aff8ef23","src/features/gen_TouchList.rs":"03cac131a6dd4ef609fd58e818654b899701e3a48d5dedf0975ac5e9269e4e37","src/features/gen_TrackEvent.rs":"f9e596aabe543621b77d689198bebde4c8d18382784f63b122f0bed09182d3b5","src/features/gen_TrackEventInit.rs":"4bb1fb064f40d72b05e9e46d30cc0b8e85ce5e042ec31950da285fa113148506","src/features/gen_TransformStream.rs":"4784a7ec6dd58b5608acf108cb278df01a379752adc495bfb146dea5741d2655","src/features/gen_TransformStreamDefaultController.rs":"1d5daa47589b2585a385b75736e20f0cf79fca827b51c2c9b020030290681c33","src/features/gen_Transformer.rs":"e014bc2f95b3eff1748f46fc5f43f999b54384fcc7ecdac148edb40d69205d4c","src/features/gen_TransitionEvent.rs":"a856d711a10fd206e9fb20b70b32256576d2ca6885327677338f8dd3b298dc2c","src/features/gen_TransitionEventInit.rs":"2d19fc139ff625788fdf4da149337790dcbb65510361db3cc2e2a58b9ddf7f0b","src/features/gen_Transport.rs":"9879e63ba98d29366610b54a7dd9c6c127aa646bc55f2df649e79410a55a39b7","src/features/gen_TreeBoxObject.rs":"b8138e7991abb55c3b6b9fdaa6aa0033570b9c2496e9e6efda445bc2f2b27966","src/features/gen_TreeCellInfo.rs":"e94105cc13cb760f4b7c19d4b59cc0ac17f582683eb2171324ee5bb05639151c","src/features/gen_TreeView.rs":"2494e927d51ce97b7dc9e10b2e0f0a38ac5fde9331df5a77274f658cab09a106","src/features/gen_TreeWalker.rs":"631e47ff517c910b459dde8401af35f2915f337331293f95605c06a3c38171e9","src/features/gen_U2f.rs":"41517218daa6a747bfb2032ee307518b6680959b33db707695d9c6c7d27028f7","src/features/gen_U2fClientData.rs":"c5c53fe843447a1a13d7ccef56881cd3f2f8087a7b94d2aa5447003a48a04c6d","src/features/gen_UdpMessageEventInit.rs":"5957ff15d46b9cf77d0cb54db0f42fe9f5d999f6faafaad3d8c31d42c3e09f93","src/features/gen_UdpOptions.rs":"5c224e6c714d83ee33c1a9aa9b55d14b3492076f0617e9f5270edcd90a30845e","src/features/gen_UiEvent.rs":"e98b9fa70507472cd3ac4c8485ca279ed18dc377224be7c8e5d25855b5b00b5f","src/features/gen_UiEventInit.rs":"03c198cf8d6a12e5ac509057024dc9d09134559eab29442fcc4222c7107ed69c","src/features/gen_UnderlyingSink.rs":"b88d209683d7e334ddca6006f66697f2048b2400dbdd502ce8075c91a21dadaa","src/features/gen_UnderlyingSource.rs":"7f840677d24106c2994e42c07e0227a7b96ed4d54d7845f32f59303a3fabe8ff","src/features/gen_Url.rs":"07d3d37d934eefeacca7885c8ba8c545fd6e0932e3dda8336665ca0f119db48e","src/features/gen_UrlSearchParams.rs":"966d56074abb66568edbc75106443fb990ab8474b04f7d531311ad8a1902a661","src/features/gen_Usb.rs":"335f11c17d43a4926704c14e459d7fd7ee379df114b336c87cb739142cbaded8","src/features/gen_UsbAlternateInterface.rs":"d42f1ccf2f00667d883f219e21ae73d48df055dca90f495a8391da97b337578f","src/features/gen_UsbConfiguration.rs":"80759ac34e0a460b7665deb3ef68844479ba61e79da19a900df4c37278342061","src/features/gen_UsbConnectionEvent.rs":"e424787dcda8ca730f181bda9b826f3087be7283e346bc98e05b6464b84ba197","src/features/gen_UsbConnectionEventInit.rs":"df5218bac5f5a9233c68cfde0a16ee1c3dd3cdc497c65d08a7c89f2b1a627232","src/features/gen_UsbControlTransferParameters.rs":"ac50aa269e542b2c5e41b86ce6700b95876e0ee0d7f2664fd6396d210b3e7fca","src/features/gen_UsbDevice.rs":"6575f5bec63136ecd5f3d7f8df8fd255fb2fa85a6a40578abb3c84cc48d1e02e","src/features/gen_UsbDeviceFilter.rs":"86049c292a86294a6a96313b5dca8aa41e5a82d4465644c9e09f21f02e9dbbd2","src/features/gen_UsbDeviceRequestOptions.rs":"427d318704d7c858c89c07a8a5ef051ae918caff2e662a45ae7a88c2403c311e","src/features/gen_UsbDirection.rs":"86d0fe138d3d354e9512afd800e9d5899f288c21b94811712eea71deff9a39f8","src/features/gen_UsbEndpoint.rs":"fdabd25d3730f3065931d502d6ec2792eef59aeb571a354b16bb8aced929bbf5","src/features/gen_UsbEndpointType.rs":"134f49ca3373de051603667e94bab1e27c993cf3ddd9b643d66ca49aaff4ecd2","src/features/gen_UsbInTransferResult.rs":"11932c1e563da8882f93f1f8455b5209e4726c547dd1ef161fd3994272fa6465","src/features/gen_UsbInterface.rs":"004209e103f3816a1f9f95c81d44e567666b80fe072cc762db48f7e7a0961b24","src/features/gen_UsbIsochronousInTransferPacket.rs":"d9cca483575cfbfe32b05256f04dba5da2b09c10f5c14a09d11cd5d43abbc1a8","src/features/gen_UsbIsochronousInTransferResult.rs":"717d3486c5f632dbc930b366f04bc97a1c8f623f313e10c56459651d701867e4","src/features/gen_UsbIsochronousOutTransferPacket.rs":"0ab20cb1959e9b1fd0ccd957be48a313d3418bef7800b5077c82e7c042d28e6a","src/features/gen_UsbIsochronousOutTransferResult.rs":"b7e3e117741e49f0e31b12372ee8dd5c8dc7e8e387ee819fe825234e5c391d50","src/features/gen_UsbOutTransferResult.rs":"663a733073c5dc09fcb8ba86917d6b40a6af86be5b03c88e2182894c0f719813","src/features/gen_UsbPermissionDescriptor.rs":"dfdd00b514e5501d4574ff41596ae50a9e8724439364ec53747ecc6fe8d231d9","src/features/gen_UsbPermissionResult.rs":"d7efca9797d19a38d830bd6fbf13d98e3622bfe8c3be7ffa2399dadc385646b3","src/features/gen_UsbPermissionStorage.rs":"f878e9d9ef51bc523c1142dbcd91bebe064c5e1ea3731f4d27cd13c680310d36","src/features/gen_UsbRecipient.rs":"be13d62e41364f10326419c697be9be2b88f7037bbf4a28d4023cb7f636f4d9b","src/features/gen_UsbRequestType.rs":"7de2dd3235f85337d40cdc00bcf8b488d3bd61e9cbb8fdabdb352707e15f88bf","src/features/gen_UsbTransferStatus.rs":"694af05accc0edaff79118c21ad2cb25c424d94df87451d57db897dffad347ce","src/features/gen_UserProximityEvent.rs":"4735928088525655e0baafd96f81e484e09072de086df724ee75d54df428fb44","src/features/gen_UserProximityEventInit.rs":"b84ebad08c0351b0a36e65dbff29fbe1696f9d6a9a693c4f157790afdd368b76","src/features/gen_UserVerificationRequirement.rs":"a45fbac3b91f786a400eb5c89475a53753db1471214f38c503bc74c928aea64c","src/features/gen_ValidityState.rs":"19fc8630ed8265d80876c235ef52ffa9d7b5b7cf8562c21beaa21d01432106b0","src/features/gen_ValueEvent.rs":"61bd906296de23dec127f17e69d6005e177ee94f66bcd89264e612a533e21bd5","src/features/gen_ValueEventInit.rs":"8f3ae3c0e24a465592cf4d1b13f747e8dac7c1066bdb0841a66bcae9409e336a","src/features/gen_VideoColorPrimaries.rs":"84a16e5b1285521aa972a7c120aba3e4e6c4ba09ee28d5a91181bd802c89b3df","src/features/gen_VideoColorSpace.rs":"c347084e2a96543f668cb9a385687a489aa779709fc778ede48f36dbf6c5d39f","src/features/gen_VideoColorSpaceInit.rs":"06b72089a8c631b4477dae281ed9e5841d36f19015d2f64cb3df8d969ae07c2f","src/features/gen_VideoConfiguration.rs":"9f16db4f216b3d9abfa719bb1ec15bb8f5bd36ac43cc1ba13b124a4528799f17","src/features/gen_VideoDecoder.rs":"5ac339d921511b07aaf233e2f925d139eda1aec46bb6bdf126d271af6cfb21d1","src/features/gen_VideoDecoderConfig.rs":"5af97131cf87ac9cff4ca6ea2d9c7e87ec24c73575c2e02ebe1447160d0f691f","src/features/gen_VideoDecoderInit.rs":"cb4fc191097bc5c42105d1e058d19bbd07cbc466268c5045e24c9e5ac17844ec","src/features/gen_VideoDecoderSupport.rs":"ebe09ca9d258b7c8b48dd5d11373ae91fa19e51551f5de4755b82ba90cd33fce","src/features/gen_VideoEncoder.rs":"b5e60800a115ff66ebff8efa2cd31922c35cba6ce44e8a4548fe3deceeb1271d","src/features/gen_VideoEncoderConfig.rs":"2e7293ff24af25852262609743e9d318f44dd8923d8686f601a4c1aa4e750de5","src/features/gen_VideoEncoderEncodeOptions.rs":"f133297997cdeba2e5abb7abb7dcf6ed84f4b4c1674612f63481dd4872dac93c","src/features/gen_VideoEncoderInit.rs":"140e2bfbfee6abcc75e2fb2fa4e1b48f05035038f3b0effcb90955c73b2b43a3","src/features/gen_VideoEncoderSupport.rs":"9110f37cefb0b42e330137872f7fd7feccd6dabeab6c13db2d9ce6bc2f06f072","src/features/gen_VideoFacingModeEnum.rs":"6a13ef5cdc574528532b4e67ad46eb54d07f846bfb547dbecb3b4afabb6bbb84","src/features/gen_VideoFrame.rs":"7aefd17bec7b7421cbfe9a6148e8939b2391bbe9cebdd66880d89696fa145ccf","src/features/gen_VideoFrameBufferInit.rs":"547b9e07d064f3d3e5f3e52742dcd7a697df9c9d3b4c5d513013454a07eb7a81","src/features/gen_VideoFrameCopyToOptions.rs":"ec616662f8f7fd9dccee8b6e03901eee3e93f9b11bfd3bdaa25cd0ddbe47fd6b","src/features/gen_VideoFrameInit.rs":"de84cfe26f4e6bcbc40668d3ecff0ddead49614dd5e4f17d521bc39a16dba7b3","src/features/gen_VideoMatrixCoefficients.rs":"5fa08051bd0eeaa391af5bc6b21ba622db3e4030bc310533aacaeb7d5d8bbacd","src/features/gen_VideoPixelFormat.rs":"3bc88631861fd02e18ff9b40020b79f01c91fb4b22623d928cf38d4c5042764a","src/features/gen_VideoPlaybackQuality.rs":"bff63c5cfc9c9acb45761759923ec654c8f73ebf5a25dcc0e299354a01efbb9c","src/features/gen_VideoStreamTrack.rs":"3ee89406bde4c1fcbbf823ee35c3d040d072e8f55b2f69dec59e88c486b5597e","src/features/gen_VideoTrack.rs":"4b5fb9d69f03623d0e5dbbcff168031472cf41bfe16b7a0f53827f04173f4513","src/features/gen_VideoTrackList.rs":"7783245e492cdb7125e9c9beedb8d017a087a26abc144ab7a0cdf20b7b70e3ba","src/features/gen_VideoTransferCharacteristics.rs":"309299f0ca9687b69ab676cd5cc0c6f3e0a9169841e4037c05100fab2ed4e305","src/features/gen_ViewTransition.rs":"12985ed30b55d693f37c5c526099baa3a92b6bbd86b7b21e131fb68ac03282ed","src/features/gen_VisibilityState.rs":"b09e19e4ecbc7a7f6938b263c1b707f558d731479efd2532c917d8ed62a27d84","src/features/gen_VoidCallback.rs":"05c53345a85fe3917064ffc3cf943353acf5a470cf1ccf8f0b6f5b47abc1df19","src/features/gen_VrDisplay.rs":"2973ecae743a9f8a23b3f39d14b12970c7219e7be7525b55c08b911165273d63","src/features/gen_VrDisplayCapabilities.rs":"ab4655895b1480008e06f81df3acf364a11af732bc01af2d0ac507a1abe88a39","src/features/gen_VrEye.rs":"5fc00113bafb9a115067f194b426fcbf1410bb7d1d591eb958622b32982b36c7","src/features/gen_VrEyeParameters.rs":"9d7b0ec1e459bf5936bf905c64d21fe12681bf75ce497dd492f9d865ad8a6bb1","src/features/gen_VrFieldOfView.rs":"c1bc018d11c2e3041356ed0cfd222e2643ec7528e6f4b05de6559d6f3c1b2d54","src/features/gen_VrFrameData.rs":"5717b24963b4aea2e34e7dc7f8e788fc9203b3c48ce9820b45f6d1c7a948dced","src/features/gen_VrLayer.rs":"50672e7b8808baa299963a960c4e38ddd0bec42ca38933dbb35a480f0d733014","src/features/gen_VrMockController.rs":"b661eadc684cf9b7ec82209aaca4d8f3934213a0e07ecccd61cebc3ecda19b0c","src/features/gen_VrMockDisplay.rs":"7d5b26316bae9eab4d32c7d47ea670dcaccf7d24ffe0a587379e38d61cefcecc","src/features/gen_VrPose.rs":"8c2213d3b99eac6d044a1fd7c27818f9ac4c403c815ff6308a7a5fcf140b7ce7","src/features/gen_VrServiceTest.rs":"74ab05ebfe35282ba9617145b930bb9264cb90989a76c67a078962a138e68762","src/features/gen_VrStageParameters.rs":"d8c5765a575b16c377c15e4c1a99befa4b2d4fcad417ecc9e119e25e5a3d1e15","src/features/gen_VrSubmitFrameResult.rs":"1578307ee1f28c2213ded5854b19559afc4100c379cb038b24b436b02dca75f1","src/features/gen_VttCue.rs":"fef2b72b3d7fa385169a2974d8cf7b871b5f58ad4b9af7f1644e3d9db2d333b8","src/features/gen_VttRegion.rs":"9611417a6ce63d0bbf29dcaf0172f06010aae9fa4536d97bfa34c9a5b12caf8c","src/features/gen_WakeLock.rs":"82c3b72475075bd1bba5ae783514030e311bd37992aff008095646ff5178d409","src/features/gen_WakeLockSentinel.rs":"d822dc604e8561a650ac92a6a0ae73db62b499ec843f703f0a2d81f321c5887c","src/features/gen_WakeLockType.rs":"d0f37cceab24e13fabd85efdc0f96f8626728b938db309e1a61499822a805a68","src/features/gen_WatchAdvertisementsOptions.rs":"9a7ff90281a3035aad715d1230c0def7562b749427441e922fb2f1da92b4bfb9","src/features/gen_WaveShaperNode.rs":"d879712320ff2c4d9447c8d78b7e4c97d5c4f9552d9d83e05f175ff7fb5d0483","src/features/gen_WaveShaperOptions.rs":"12595cabf889677ecddb0e9813c90c3682b954c9e3c4bfe923dfc8d97a90688e","src/features/gen_WebGl2RenderingContext.rs":"07572b6cffa619bf70e30121fa0add019ae13cfcf78058d76e5cfd197f50033c","src/features/gen_WebGlActiveInfo.rs":"451d720ba722d645353edf7af7c03b106e1463c235a9cd39d70a50a3df0d51cc","src/features/gen_WebGlBuffer.rs":"2e4b7c2fa73c1a34439d16cbf98104d6f89bd25ad465d5101934e72547b4cb86","src/features/gen_WebGlContextAttributes.rs":"619d4cada3534322a0a10eebf42ba45cdf758b8fadeabef0ce11f0accece6c74","src/features/gen_WebGlContextEvent.rs":"fb9ebbaedee72bd089e3abb76f485a6e88a702d23c5adb7a22552f812adaa9bb","src/features/gen_WebGlContextEventInit.rs":"5ba52c70daa6efd0f527fee283b5f759f4d58170bc73c4fa8bf62d3a5a25a774","src/features/gen_WebGlFramebuffer.rs":"354ef6774d2e2195feb582c8a0887392098b06dbf62eb10a6e890add73e5ca70","src/features/gen_WebGlPowerPreference.rs":"08e9a32a55fe1ccba3c373c8d1b4874b115d6126b0b4d611c1f8c4548348bcc9","src/features/gen_WebGlProgram.rs":"f87fab1cbb82e8f18321e14a6d807a66707d7d427e4fcf4d6468cfb51f357b39","src/features/gen_WebGlQuery.rs":"9459e53acf48ba864654d0d3828599ee052bc30c602f35deb8cf717d2a2e09a3","src/features/gen_WebGlRenderbuffer.rs":"6591985c15839205fa04dfa9ebcddd2d22a94d8139786e4017597b8e21a7c901","src/features/gen_WebGlRenderingContext.rs":"eb46964f1fc73f5746362c2b59a9da301e814b1d3aa1da9083dda89e0dd900a6","src/features/gen_WebGlSampler.rs":"bf2785e9f720f0eed1475985632b42e35bd4a86a4b425e798a77b12fb357d018","src/features/gen_WebGlShader.rs":"1af0c087bef275431e14fc02b99e7f525f7777340caeb0d1864d41ae0c05fe06","src/features/gen_WebGlShaderPrecisionFormat.rs":"d74ca425a9aabdba343d108274bae6b4e9c20d5e8fbf41bce12423ab7d1de8d9","src/features/gen_WebGlSync.rs":"dd23cb79922602eb563f7bc321cc4967ce1a92b1f9cfe1236b19dc3965fe768c","src/features/gen_WebGlTexture.rs":"bf541cdc03e32804addad54a3fa3829bb6dfc0458b91844db076e6d60d087fd7","src/features/gen_WebGlTransformFeedback.rs":"1f63c38b719747e582b276ae7f8a88d17a6bbc8ef09cf6d800bc7335641bcf70","src/features/gen_WebGlUniformLocation.rs":"71304a208e1759856f19ba6920516455153008d5a8128f9f8e9e173f0982aae2","src/features/gen_WebGlVertexArrayObject.rs":"f3c9227f50494c8ba5055e059ceef6a5f3d1c36d5b8ddbcb525d5962d4825a18","src/features/gen_WebKitCssMatrix.rs":"b79d0c8fa62a07c51a5b2a9eaabebb03133b032282eb275db4a0447f8425ce58","src/features/gen_WebSocket.rs":"d0ee33c211f5cd20f77564fcf13c46d316b88beea17b506c1e567e6328755d7c","src/features/gen_WebSocketDict.rs":"0b7886f411f795c1c75516c62fb3ef2a953543fd3f84919a129568d4739b2a58","src/features/gen_WebSocketElement.rs":"4800b9ec72c2dd075b41fda5796a8516faf7207f9483872302d1c92d5ecb613b","src/features/gen_WebTransport.rs":"6af1a042311c7a0e1dc7af582502b92788127fffefa90f72672657495feaa135","src/features/gen_WebTransportBidirectionalStream.rs":"458e78ab3791f9b455aabdd9c7a59bbf342172583cfb5248e761ffdc7a957e3e","src/features/gen_WebTransportCloseInfo.rs":"ec43d7d43e5fb3ec1c9a114fecef89071aa623aad8574a1ddab2c7c8e983ec99","src/features/gen_WebTransportCongestionControl.rs":"c1bc1b6ff61d4853c9a7b38110d5e6de57ce166d395d639893cdc1a16fe0d6d9","src/features/gen_WebTransportDatagramDuplexStream.rs":"55718bc4ca56e2fe0f2dfca711948250761dc3c8e1e492c40f1f3ee545f08388","src/features/gen_WebTransportDatagramStats.rs":"999dc02a3192d3b627a41b2d609977dc80f19eb0407c70f7dad8ac3dc1caf251","src/features/gen_WebTransportError.rs":"64f614a4c7f7a07adab67082ff284713014fbbf4965322bec9e9d74b70feb712","src/features/gen_WebTransportErrorOptions.rs":"96278f119ff6cda57d1a1fb8f4c42b29988771526dfb86f0421227e8767d9ad2","src/features/gen_WebTransportErrorSource.rs":"59c221d21d789f12d59d70b543736c473661a557b7be37aa7418ca8110b3cb90","src/features/gen_WebTransportHash.rs":"c8abd238546fb30a4996e670c052b31917730db67a515054803e0d8a7fd4ef38","src/features/gen_WebTransportOptions.rs":"56478adbdc3be1363aad91abec7dbe2516f7926a9fbd50ad60b10f4d03411c70","src/features/gen_WebTransportReceiveStream.rs":"b5aeec4a62ec139f213acd81712dad4bc7057fed306cf90c4fea89154848a33c","src/features/gen_WebTransportReceiveStreamStats.rs":"a71423ddd577dc12434b2ac3b5fdf8219d45bdb0ea76320e702e1cc20e4b8d67","src/features/gen_WebTransportReliabilityMode.rs":"2958c78a022aea93265e1069e5051d5fc62dabdc8e52159ea0b0681fa97ff285","src/features/gen_WebTransportSendStream.rs":"26a1c779d8d08343b3c792788718922b7f432ecb8c70f67b1834b71fe54db8cf","src/features/gen_WebTransportSendStreamOptions.rs":"7f29423873a4ef005e729f61cd9a4f96706203d4cbfc1f7cf98acf3392753a50","src/features/gen_WebTransportSendStreamStats.rs":"a721a139ada3ed79592e66595a37c335c54fe51f4f83390ff5e6866106149560","src/features/gen_WebTransportStats.rs":"3a9700a97e3772b5d3b0fcdfecf396f46d305546767903a52847b26a61e9050f","src/features/gen_WebglColorBufferFloat.rs":"fb0ad839cbdb15f5462a9005943b43834579021d721b84cbe7cb92287060284e","src/features/gen_WebglCompressedTextureAstc.rs":"a22cd811f50e5f15c4315422386a515e0173038e75a4f9d696ee0a3dcb11a121","src/features/gen_WebglCompressedTextureAtc.rs":"523b98df7479ef4c93bfb6dfc731d30d7a6d553cbc86787bcdafe751c3371c3e","src/features/gen_WebglCompressedTextureEtc.rs":"bc159423afd07b57ea12c2565393a71efd3ba515484ae1b490435432f9bea917","src/features/gen_WebglCompressedTextureEtc1.rs":"c041bd0e88a01a1e64dc53cb86a8048c379bf7efced8342ee0a3aaf499eae958","src/features/gen_WebglCompressedTexturePvrtc.rs":"34971edc49ab360d6afe4eb459aa1c8ec1869744f08ee3596bd6a2926f903580","src/features/gen_WebglCompressedTextureS3tc.rs":"7a6e7028a4d4f289d63edcb409361109c5ed579316f2502978ed1d2856f498b2","src/features/gen_WebglCompressedTextureS3tcSrgb.rs":"8462aef67ca48b2d516a27e55cbad3c305817966d6d5e986ab1ef1ccf52c6200","src/features/gen_WebglDebugRendererInfo.rs":"defc88f23103e95fe7dda28adc7ec9d382ca1848fbdb7363f9825ef550ec9810","src/features/gen_WebglDebugShaders.rs":"d452ff1e7a7e2e561a7cdf46235d66aff0f54e0acfb0f3e2f07620e1ed1c9963","src/features/gen_WebglDepthTexture.rs":"b425833c41bd5fa09e0740f64dac771721f44db09d1dac63c9d7ca1cae47c6a1","src/features/gen_WebglDrawBuffers.rs":"82efa9a5af62736665918f4bcd493587a788e127c54484629d6264c6277cbd2c","src/features/gen_WebglLoseContext.rs":"55039075f93c3ecfd6ce186361b87c138c59a48eb962d9e5ca43a7638408b0a9","src/features/gen_WebglMultiDraw.rs":"4e3d3bc8b7e339b9602256b772e7232276d59aec2b6a2d24c5d27025b1828aa3","src/features/gen_WebrtcGlobalStatisticsReport.rs":"88b8f4bd959fea5e5894c0c7e8c5522612bb941861525c51b24e3b4587c2708b","src/features/gen_WgslLanguageFeatures.rs":"cfb20af2a3e611d876c9342faf071cfab87cef52ee5f53540a407186ecca6abb","src/features/gen_WheelEvent.rs":"253d8bf6759b25e70cc2d38d922ca7742df1eb15f0c53fc032a65f3f209c76d0","src/features/gen_WheelEventInit.rs":"f0c6d17031a849d4d0706e04a63cf5b7f77e491aa29965a48e56837da52861cb","src/features/gen_WidevineCdmManifest.rs":"f1c5297a6b6617b98442e9611958dc2fee2515f1d31acc4ec749a1b5100119b0","src/features/gen_Window.rs":"7332ac48778c7acc72ee459f0baa0bc6c90ce1a599b28239f35c1b3074e470dc","src/features/gen_WindowClient.rs":"e2e9be5a4e90f039125368e385719fd5b7bf2ad4ecb3a0964d41d9f36243c010","src/features/gen_Worker.rs":"3943b6505ed9ab47b2c01df99d538b402dd0259e28acd74a33e04851934ae43f","src/features/gen_WorkerDebuggerGlobalScope.rs":"4de77c302e531b3b642fa7a3131dd4e5c0f4f6c21cadf26c3bcd590205af3e90","src/features/gen_WorkerGlobalScope.rs":"e5a47a43a826d9bee2de239b4fd731c5a5eef80f43c4f6a041af67b3e89f4280","src/features/gen_WorkerLocation.rs":"821ad721dc0fc6e492e67aa73a5f7675cdf65172f506c68073ee108ffec08612","src/features/gen_WorkerNavigator.rs":"1c8886a661847fa973b3f20b55b51773963ee638dd9a3d4694aaf841d95ae65e","src/features/gen_WorkerOptions.rs":"0daaa92a0f5e511275d7ba549505561f628f8fa15e3ff03253077318a854bbbb","src/features/gen_WorkerType.rs":"1f7d3c81aba26cf39697e45855decb7386b13e7b3ff83a8c56accc271e7140e1","src/features/gen_Worklet.rs":"5b4ee4558ca9bfa4006fc80537cb3fe1ef7735f43d32829d357203a41cbca860","src/features/gen_WorkletGlobalScope.rs":"05c3c7946da501ba067597a3265ac194a69072fe9a0f061a71ed0457c1cbe880","src/features/gen_WorkletOptions.rs":"4d853dd370ca9cdbea4d32d9098fe64ba512df682558faab92de7b8fe36741ef","src/features/gen_WritableStream.rs":"af8182ab37a604aaf120b4a50c8dc129bf7a344eb58d3dbc9bd74e353d73f8d1","src/features/gen_WritableStreamDefaultController.rs":"322f65886e617317395db55c97a6dab354f6841968c4b71e15fb1aa424704dba","src/features/gen_WritableStreamDefaultWriter.rs":"3aca074a58cc039daf9a3e99ec44cd8d67acfd8750e99e9bf33a54b6e6386290","src/features/gen_WriteCommandType.rs":"cc123ea2a11a060a3cf5ed51667e80e39685136cdf39a19cff7b2f5147e99611","src/features/gen_WriteParams.rs":"d6f7af6caf78ea6111c63a6abebc48d65baf588d6b486f20b1bb0614b8436192","src/features/gen_XPathExpression.rs":"79a949c40933ec0d183d39d4efee0b2e898eb865b3a4c957630a0bac295f544a","src/features/gen_XPathNsResolver.rs":"21a68efb64053906e51c2eafa790429874c86ebb913081d77bd6b2de282cf7d3","src/features/gen_XPathResult.rs":"7f9c0a7c2443f3b9ff0c42e422dc3b0d4b128608339a397cbd01557c1658eebe","src/features/gen_XmlDocument.rs":"36bb7b566213dbec46f6dab50ec41f196ea0e99aadf8fb0a0034578e31e3f2cf","src/features/gen_XmlHttpRequest.rs":"6149529e86415f2e5076a9b0e80262e217dc3c70e98f83b06fd2979dc88aa27f","src/features/gen_XmlHttpRequestEventTarget.rs":"2ce8dd2e07936140ac141ec8946ed105354308d8573e17db4da9ec955c0e3a43","src/features/gen_XmlHttpRequestResponseType.rs":"8a89bd9ce7cf101d5e2833bbd3e6d1f3dc7528444800e904a286410a1753d226","src/features/gen_XmlHttpRequestUpload.rs":"3852e9fc98e9c1b530df5e6ad7537e4be8577230553aebbe48cf3d2196c87b94","src/features/gen_XmlSerializer.rs":"2d757977269b26fc4ae28aed51c6f300e230ec8e88f12878fa22ec6cb170b589","src/features/gen_XrBoundedReferenceSpace.rs":"279ac395730a189114f45f44b7ab75f121d7958ee656b3bb9851111f39501bb6","src/features/gen_XrEye.rs":"a57e6589e84584ad08ae1aff625b9d12e245160d6995072b90b5ce4751bd38e7","src/features/gen_XrFrame.rs":"9403455720f398a5cc64d7570d7a8e7de1e06cd5ce9486221f40571ad7bb0199","src/features/gen_XrHand.rs":"7b9d11e19974c863425cad801dbc3d6a119dad1f313eec1c1049f936dcbf4a54","src/features/gen_XrHandJoint.rs":"3d8f27904cf9936786df62c9524d4ac0e43abc62f1b74073a0bcb878b5328c75","src/features/gen_XrHandedness.rs":"6e27a88e98bc7d48ab2944d518dabdf643943dfa30b0329e1df291f80db80556","src/features/gen_XrInputSource.rs":"9eae08bd3d97811a8c9b2f49f03a5e3b2d9ff0d7d5647eaa9ca17e5e81a570cd","src/features/gen_XrInputSourceArray.rs":"ae5d683fb1947f26518546f656b25ccb85b98ae7625f1fd6375d277dcfbe06a2","src/features/gen_XrInputSourceEvent.rs":"9380361568b0ea143819e85f72f22d4dc4181a747c611a373400d5cea5c1a0f8","src/features/gen_XrInputSourceEventInit.rs":"b66bdecc8565a6d43a15bc3f6686a107da5052eb96f10c29831f1c0e4ca4c48d","src/features/gen_XrInputSourcesChangeEvent.rs":"c67a2802245a4355a44b13260f3987bfdbabf09c4b30d6e228e9ea8a4fb42818","src/features/gen_XrInputSourcesChangeEventInit.rs":"dd4aeaf885bfe33a9df4a189c0787dd6756c9125fd16d1c0debf61bb686b290b","src/features/gen_XrJointPose.rs":"bf103ab59391799ced03dd27f2a35e7421f933b5f6b8ba49352274a66819057f","src/features/gen_XrJointSpace.rs":"db31fc02957e7bf98df0a45ba65f0f56ba83ca4e87c00bdfe6d7747603505ecd","src/features/gen_XrLayer.rs":"11db85d0ff30c07a3d9fa3f5979d3a262ea0f53be9713f6f1120f93c11d452e5","src/features/gen_XrPermissionDescriptor.rs":"2c13c7655379b33495f68cb139fa23fcf155be2d553c58d7cd9dc1d5abf167e1","src/features/gen_XrPermissionStatus.rs":"f5a7392681dff7881a1523a667a83630a3f3e887a44b06a834448a535a0fb7d6","src/features/gen_XrPose.rs":"2fc45cc108ffaf2f06ff063929e8e213b5c3760c8adbef0680d0bafbc7369dd8","src/features/gen_XrReferenceSpace.rs":"54c7b49bf29ad5dd7527a4d493cd8aee0441e0f401c0bfe2bf4d6cdf8ed219d0","src/features/gen_XrReferenceSpaceEvent.rs":"d2d4c1007d0dc1815387b66f66a9a65b805dadf414db9a68b47e73002581d626","src/features/gen_XrReferenceSpaceEventInit.rs":"f07c2b92c06f0cfa5c4775b4f4eeceb75db037be05430d26e58686dc9db06e13","src/features/gen_XrReferenceSpaceType.rs":"69879dee14bb4ec173792eec4a90aa5a1757207886660b8de9b72915b13223f8","src/features/gen_XrRenderState.rs":"a06d48a56a26f9162adc0a38d901164acf44dbb4759fb2fc41a554c066a065c5","src/features/gen_XrRenderStateInit.rs":"41fd3d5c10be4a12bc75788b366cac7327f19b66fab74c12cfe52b1fe6fa58ee","src/features/gen_XrRigidTransform.rs":"66a958262770ea0a18791b958d366fc7c6532f15edba54addf716f03d6de33e7","src/features/gen_XrSession.rs":"d5d1aba495bac72b4fcdaa1d441213c67939255417f3366eaa3f390c594e0a24","src/features/gen_XrSessionEvent.rs":"62e2dda288bf09b7ab004b8e3d5260d6ef56314ad0ee187ac21c014e1ed2f66d","src/features/gen_XrSessionEventInit.rs":"39503c6ed54c3f5f9a2880537cfe5d501d8bf04b22271a0909db02dec906dd96","src/features/gen_XrSessionInit.rs":"c4c0acd12244104165074683e5e82d667cbb2f714fba5a979ef16e837ef73cd8","src/features/gen_XrSessionMode.rs":"9e1b7cdda0407859d14bad694be9b0b7ed8df9816e594365c72d06facbd74e57","src/features/gen_XrSessionSupportedPermissionDescriptor.rs":"f75bd9384eb28a206b65345455c1002363e3f8e73965448675304e333a47f4d6","src/features/gen_XrSpace.rs":"7885cad4c4c03e0c9477a313765863c124fecd5a164247c70dbe95f7cc3b9707","src/features/gen_XrSystem.rs":"d9fc777175018e843fd09978023dd230ac65d1df2c771b272e871e145ca09cce","src/features/gen_XrTargetRayMode.rs":"14668a44341666685f994d1eed3f45dda7a92a66b1899f544e2cbe1ed567f1a1","src/features/gen_XrView.rs":"4275557a79fc4db7be9d4aaccffef80a3e0916d60ff3cce5922ae7c2c23289c3","src/features/gen_XrViewerPose.rs":"bccb6402a0b3263425a94830ebf51b47e3cc627a47c254da17b2f471ab0766fd","src/features/gen_XrViewport.rs":"f117915e98ba557f9f8df92e654245e40f2eee9dd65dd11f402770f64c81ad69","src/features/gen_XrVisibilityState.rs":"48a5941406b1a1a3b2407aefc46e87cf0cd275e05fd3b26d1c2c58935ac946f1","src/features/gen_XrWebGlLayer.rs":"08a4942986313fe8b67fd3af20d495fd03697a3dc9098dd62e1d46c9dfae514e","src/features/gen_XrWebGlLayerInit.rs":"3366c49bb5d6d86f55cce4cc02af5e3a432650bc219ceca1a712a8452491c09d","src/features/gen_XsltProcessor.rs":"e7f6d5b2a5de3dd8432a106af56934925709f61ce2139fe2254ada81ad9d771e","src/features/gen_console.rs":"d7b185f3fb2dfb0cb20a3e0e4c99d479f76197bdf001fff6ce5e822baa6a1450","src/features/gen_css.rs":"e1f42fe169d7948cbaa635e4567dff5fb6630215413dfa263c89bcb1de890dd6","src/features/gen_gpu_buffer_usage.rs":"b54cd59f1900357dbfe7209576fc96af0c9963df62056342632c1c6d139d6016","src/features/gen_gpu_color_write.rs":"08dea3fc0afeeb7776205987838a507654d033e8d431eaa29f1472d561cff87b","src/features/gen_gpu_map_mode.rs":"583ce179f035d5b2e6da9d981083e8507c728059fa93a6f98c9d01f4c77e120b","src/features/gen_gpu_shader_stage.rs":"9a039d331a96dcce51385095244cf223d8b7691a945ccbee61540e98e3993f95","src/features/gen_gpu_texture_usage.rs":"59b0bd64a38ecc2e63ee1a2fca516ee3bef8c43c01385cb2d313a561afb5872f","src/features/mod.rs":"491c2d0577fa1d10a97ee3c034b888684bb35f3646c766b8fe4669a0fd7ded7b","src/lib.rs":"1d3fef62c77c65f59c37f1c32f5e52ba3ffd8fe3ddc0edb42520e4fbcbbee991","tests/wasm/anchor_element.rs":"d81b8164a053cb9bc6e0260f9d02189b1a3b0e6641a2ed6f3a5ad77651355b41","tests/wasm/blob.js":"0941f81ef62f2b79576d5449b1ed9ace4769e8cc9217d73ee5a84458ab301eaa","tests/wasm/blob.rs":"897804ae34183197bedc199a29cb0e579d5eb02a536df278e0174835610cdb17","tests/wasm/body_element.rs":"a685026c9661beb45cfb979b40ac8a4db4888c1a31290c607f1b825f899eb7dd","tests/wasm/br_element.rs":"e173291a963e904d1af98af2a56fea5e0261fa521d0f5bf2190e9db379a02750","tests/wasm/button_element.rs":"cc7814a92a83a4e17d479bf05b1d598dd8cc675ef876ea087a3fbaed8dd3a12c","tests/wasm/console.rs":"119e2fca44af45ad2729caebc03480249ee6b7f14aca0714bf6b813fe818fc0b","tests/wasm/div_element.rs":"e07aae54d094c95372ecca15e7b4bcdc51a033c2e832ff128c00579c692fade6","tests/wasm/dom_point.rs":"157b3fc2ba453c71d5dd88afff6645f646234b48b013a90897d22783b9f5b99f","tests/wasm/element.js":"924a7ad4fac9b7742a16986ea5f29cd2ad73fda410d51af892ba28541d8e5053","tests/wasm/element.rs":"dcbd4995e50553cc01f36fc034c0c971079a2d4588d31ca2ce6885e4a78e980f","tests/wasm/event.js":"3bb5a3f34d82681f15f64467621eb71a2ee003a941eeea3a86b74b699c686981","tests/wasm/event.rs":"b477d1a39a2e45e1bff72ad9d6f5c95607a5d96972935953a3ef2d453ad12379","tests/wasm/head_element.rs":"7a40e1d68ce01f73837a888813c593e98361a51c43be0a517e4250597dbc46d3","tests/wasm/headers.js":"61d901c54bc6061c253f2e008d83a501a5c474199dbaf11f4f9b4c902b9828fe","tests/wasm/headers.rs":"0bc1dd8e35110563afbcbb8ea859ad4cb75c0144df8fbbe2fff6a2c67a98c95a","tests/wasm/heading_element.rs":"2b03a9e8be6dc8f775a04d567ee5cb662115b10685c4c22b65117571baf2d459","tests/wasm/history.rs":"431de0cb978a8af659bf296bb9b21d7e1bb89a403f22306a08ab8242014058c8","tests/wasm/hr_element.rs":"a8a5a947cf929235f97eb235c35e72c19ecad708db6e0ed9736dbb6714cfd60c","tests/wasm/html_element.rs":"6ae1626f3780b0ed18a52ece129b08274546d1bf1204d108a3b3dc490b275826","tests/wasm/html_html_element.rs":"eec3cc44e9dfd497ee4f3a2fa86fe9b29bb6ef63a6a3cdf2d222c761939635bc","tests/wasm/image_data.rs":"5f37ea0a65d5aeeba236ec5c243c626371dd33169c26ab53a822287550957189","tests/wasm/indexeddb.rs":"85d85320d2dc03340f121f903d701bcfd893d069d2f41762b9f8e972354b1390","tests/wasm/input_element.rs":"a13ceb8487fdfb34d225e3a1cde5bcec575c30ab056b5fe4e35bd7aa7c8d5876","tests/wasm/location.rs":"02280feb8888d6cbae4c78c62464a74a948275585a22eebebbaac088f089dba5","tests/wasm/main.rs":"a670922e282e08cacfe37b97815c9770c7cbf509fe9fbc017e17710288f54e83","tests/wasm/menu_element.rs":"e184f9977f7f678148f1c8eb5f51f9a6fdbcaec43b496f368f3e8899c91fa414","tests/wasm/meta_element.rs":"81b2529543adeb894dc148f45f17c5a64e31a2a87a93d5e258818c53ddb9bf8e","tests/wasm/meter_element.rs":"fe2504c6cc10c99ce94d55df0cbfce86d9f2dd88c627e2ffb4d8010085c994f7","tests/wasm/mod_elements.rs":"b678141009a5ebaf55e8171f116e770eee2712cb30884bad42e8a60e12fdbaae","tests/wasm/olist_element.rs":"6ef5067d3e1a3c4efc8f2c429286245dc9874762ec0dda2c6b72dc560fa22f67","tests/wasm/optgroup_element.rs":"f64dbc200f3f700a43f0d4628901a1b9d40f8c818244c52324d9602c4d3a1bef","tests/wasm/option_element.rs":"c841ff8ac3abf37fb0306ff553462195140869dfca978c749a59fd168fd82e9b","tests/wasm/options_collection.rs":"b9071a0a8e659cb59a09a0263ed15453186720653131b8b3bcfb2a41bf8b83a1","tests/wasm/output_element.rs":"6a3f7dca0d18cc01b37f413797e8b0efccdbfdfbbb96d133b387426a71a0a34f","tests/wasm/paragraph_element.rs":"e2ec82bd46336dc186c9a127330a115ba16749e6e2002f0ed98b6b45ec6e851f","tests/wasm/param_element.rs":"3d0ba799f06d06448d33f47134fa93b3276cf71aea03ba271368259aea9e4f20","tests/wasm/performance.rs":"3e89000a2edd79ddddeea319f00d27988582ae96fd82470c038e02813e19c3f6","tests/wasm/pre_element.rs":"91e5dd0012b33e54a5d79436f10505a33638bb0cd8c623063ea647da5b73603c","tests/wasm/progress_element.rs":"192c833db7e02d30767a2411405ba2989d0be0376dffda4ed696440e1309ef56","tests/wasm/quote_element.rs":"069bc812ee94323550d699968b49c73179f03cd45570c0252ae12943cc90f7c8","tests/wasm/response.js":"348c69796ae672a7ea3ed4e170e6474d551b128094e61679ef9bdc5fc05ec480","tests/wasm/response.rs":"380029c289b17383aaf7624cb137e5cbdd8382ce63fa582af8c33e6db1db29ba","tests/wasm/rtc_rtp_transceiver_direction.rs":"8110c5dcf11bf644b69d5e338092f864656d884191690326ce5f4d07033efd29","tests/wasm/script_element.rs":"43ab8519f106505edf7b260c9ffc8dc6f0601c85f0b52820165a18d104ad3a25","tests/wasm/select_element.rs":"703f4f66c52b1701d8f3624d192081fd61fb3b125cfba7ea92839b198a6a33ee","tests/wasm/slot_element.rs":"595de8b501931d81a14cce1e19c4658e315fe67b12a9d8e5b935105fb1069796","tests/wasm/span_element.rs":"8674b3d22e539c35348eccdb5ec7bda067664475e0bbe6fc7f93048fb58016eb","tests/wasm/style_element.rs":"258951e44d1b090fad51ec9f88a39189b23db512cd3038ff14a74843676a9bfc","tests/wasm/table_element.rs":"0148fb21f804289f00d076ec2513f264754d2e18ab2b36321073901c4065cf32","tests/wasm/title_element.rs":"45441849b48e9a76b2154b2b2537d2a3de3acb2baea45344e99a33b3344759eb","tests/wasm/whitelisted_immutable_slices.rs":"116e1d40ee9efe2e7318e1e6a885d3ebe64fc00a193a767598bfcba4f0ee4714","tests/wasm/xpath_result.rs":"73b4a266fa9cdeed78995f167ab965d324a049b1acccaa9452030137278b0739","webidls/disabled/README.md":"fed82e8fe36dc5d00b920c4ee9a2414cd0ce36acbe5d919aaf74b63d54a35171","webidls/enabled/AbortController.webidl":"f58169caf4ce85fd1aecca3a6407b34eec7228bd38909110a5d8ae09a62f60f9","webidls/enabled/AbortSignal.webidl":"f74eb8fa35d704e08577a79d9dd43af9f85acbb10d5c3f45c13b8095d53381cb","webidls/enabled/AbstractWorker.webidl":"686dd52b59005af6a26c4568587a615aaceb29dacaf62c68d85c49b652ddd05d","webidls/enabled/AnalyserNode.webidl":"b13c9d8f4f6ff18c3c356320376a20441e55ffa9023d91163eaa1bcc439875c2","webidls/enabled/Animation.webidl":"6a4f3b332cbb42d2e59e8e0a85b88fe7312053279869de725b894322faef0e5f","webidls/enabled/AnimationEffect.webidl":"6e0a16de15cd7b6f69217d04ee45b53a4a3f0673e39fc200ed822fdcf2320bad","webidls/enabled/AnimationEvent.webidl":"1909fde84b084b7f08c6ec743fbbcdcc999752a82e6e41b1eddc11a2aa993ac6","webidls/enabled/AnimationFrame.webidl":"ce1f038af1135785ec402e84f9699c527a5931c1415260b559a7ab89f3181e2c","webidls/enabled/AnimationPlaybackEvent.webidl":"4ad10915c9f09c3c29d916ed60211bd05a4dfc1808134b3c86dd5b59ed44cd5c","webidls/enabled/AnimationTimeline.webidl":"2919663ac49c67b37bec89bbadfa588da6f0151a7f76aefc14de2b401af9f3aa","webidls/enabled/Attr.webidl":"93c5596b9910cdc4b7e5a1d10540140804b913f6144bf92a2ca4908989810786","webidls/enabled/AudioBuffer.webidl":"135fdde7d51b0583ce5ec3dba6489791b74911af948d422f393115b4448119b4","webidls/enabled/AudioBufferSourceNode.webidl":"c3be4b3dd9277c05ddaf36637c8c068b8fbefa7b2165c17f87137ca827cc3aef","webidls/enabled/AudioContext.webidl":"2176d8a47325bc982eeccfd93af6e9e579ca6617321a29195767cae26f7f34f4","webidls/enabled/AudioDestinationNode.webidl":"2eddaa6204b0909cf04d5cb0d3f1f5be437627c6c6d6d8406e76236d6057acae","webidls/enabled/AudioListener.webidl":"6b5d9f559252f7279797b9cd283f6d8ab8ac158ac60ed3b27bb6ea2867ae233b","webidls/enabled/AudioNode.webidl":"e3608d3db0c6bd456b47ce7417fa20b3e4160e4e6bd24e0b47b8892760a51dc2","webidls/enabled/AudioParam.webidl":"7c05f7dc0f835dcd11df71a14acd8f022420bde29b1538608d94a14675e270e8","webidls/enabled/AudioParamMap.webidl":"5de70145121b759dd3c0c0fae816efd16594ec54e0bc5cede32b3ac07c19d98b","webidls/enabled/AudioProcessingEvent.webidl":"d3e745f7638c8612c935ecdea396a79ced2c85db92ab583663c6eef960b1ba26","webidls/enabled/AudioScheduledSourceNode.webidl":"bca7325531eea98cf7a145f957ac41110d9c9dd6a1642c33c3e29602cce8aabc","webidls/enabled/AudioStreamTrack.webidl":"02808973b874aa79c1a48679034388756a3290c12f82e3628582eb31dbcea947","webidls/enabled/AudioTrack.webidl":"05c804d8782e2fce573f25bde5ec22e97b62db30ce078f41a5557e215b0fa182","webidls/enabled/AudioTrackList.webidl":"042090b55f4177512d76af56c0390ad464db5f7a7885c27782c65f712373f147","webidls/enabled/AudioWorklet.webidl":"46c6d9db119e3ad907c4562d72622cb8b50565cb94bd471785e5a5ec5cfc2eb3","webidls/enabled/AudioWorkletGlobalScope.webidl":"9c57f6122faa98f1d4bfa08a6929f20fd4d36283ca4c419a0d77fccbade63e0d","webidls/enabled/AudioWorkletNode.webidl":"152b5807d30d7758536a788df8acc249d86ed0da9ffeb102aa86a6f29a7c0ab5","webidls/enabled/AudioWorkletProcessor.webidl":"d434eeec0f01f4e4bcfffa09265d001465e6c5de8ba04e554c46cf0856580511","webidls/enabled/AutocompleteInfo.webidl":"37c61e3383ed0adbf64c58dcd971526728f38d795e34f4a169df906a94318be1","webidls/enabled/BarProp.webidl":"7090c75a43ded4a69279c21d95cfa93bbd892f28cdf20f07419024625a20d8a5","webidls/enabled/BaseAudioContext.webidl":"ecbd01c99db90726b574e2d9a5e95860902fd5db540a3319f79de236ccdb3622","webidls/enabled/BaseKeyframeTypes.webidl":"868c8af21d1dc070665bb4094ff9120864b51ea782456b15e19735f884bfbcae","webidls/enabled/BasicCardPayment.webidl":"58f8668af928def7f481264e9b188eb8ec37d06a6d2db7f09982527ed12f4c80","webidls/enabled/BatteryManager.webidl":"6e1a16048d8461a2fe741bd8c5a36a7e0e5568aa23df3cf6d9171c25bc410b51","webidls/enabled/BeforeUnloadEvent.webidl":"ece2550a12535f09976d2162f275549786e297f716d0a4a0602f0abba4b88902","webidls/enabled/BiquadFilterNode.webidl":"9479e916a533e347256cb39802d9a60056fd7e437a376b695e9ccb3f119acab1","webidls/enabled/Blob.webidl":"6e2e9170e0f106f7288d887ab20f6d8c86ac740efec0b449a02b7067aab381ff","webidls/enabled/BlobEvent.webidl":"daa437be043dbb78f3a0ee0f2a6d678dcb1b87f93b30bb1eb5ffcb8e35a91b61","webidls/enabled/BroadcastChannel.webidl":"31d906ead85a2dcb44996cb7a31daf8640f68c9509495de45b57a7c8350576b9","webidls/enabled/BrowserElement.webidl":"b5d93eedc74fe16e914147396f709760bea9fe04509050e7406a9fe4f92b54f9","webidls/enabled/BrowserElementDictionaries.webidl":"b17c3827fe54297b6f219366578a014bcd026696f00c9af69f49281dc11ccf0f","webidls/enabled/BrowserFeedWriter.webidl":"2e1fea89a94d92471a6a80401f87cf3efe0cb573050d8ac3b87f847a204bdcac","webidls/enabled/CDATASection.webidl":"d4b63c03dbbe6a3d4f6e4af3e14623275d1a340f63197e99799752daa3b0bef4","webidls/enabled/CSS.webidl":"fcd69a266cf4afa42918686fa6c3905e100d3818e371bc5024466d45e58ded9c","webidls/enabled/CSSAnimation.webidl":"6b22c711173de295a97e58441ba978bcd5b94d9baa61be942f3057a75c68d43f","webidls/enabled/CSSConditionRule.webidl":"db214bd8a2318883f743e6205d9de8bb0d0e6177c3aacbf5d7d9edd53a5ca9ec","webidls/enabled/CSSCounterStyleRule.webidl":"f6d000ed82d6865cd90c1a9c50f92d7bdf750817ffdaa8f4bf48d620396a1e46","webidls/enabled/CSSFontFaceRule.webidl":"776837af265c277f0903163c82463f17522f886cdefe287eccd65e1ccc76b8e1","webidls/enabled/CSSFontFeatureValuesRule.webidl":"5c41b9f45ab3138d14bda783a71a5cd7757bf322fdc6929c5ecfb7766aba6fbb","webidls/enabled/CSSGroupingRule.webidl":"c666240491d2b7d616e972cd71e0d8fc7cc122c7f0f524ebfcd15aec56100c62","webidls/enabled/CSSImportRule.webidl":"2a86b7d98441e09625f9bbf0c37fb19d156bce2be4a67b38b77ace84499916b5","webidls/enabled/CSSKeyframeRule.webidl":"9be4cfc74e85fc5cd6caae8e0e68c501e230ded614f395b1fb4bbb5ba317a655","webidls/enabled/CSSKeyframesRule.webidl":"8e9c7b2aba2d44d0577bfa2d47aa99b3b6e9c97d02b19e2bc195d6ddf2ada652","webidls/enabled/CSSMediaRule.webidl":"4628bf3fb3a1e962a9620c3a9f0e38c83f13f6004821e7f44acc9426580f675b","webidls/enabled/CSSMozDocumentRule.webidl":"75512e059392c8508d4bc1482b8fb64ada87b98c0a49facb03e989da0516ed6b","webidls/enabled/CSSNamespaceRule.webidl":"ad8bf21e6a4ac78ce0121a19a81ef894be10d4181be073e1953da71de679700d","webidls/enabled/CSSPageRule.webidl":"cc9ab4d1c6f97d271072518308ab8ac304349344f0d7eccf79d588a2fef237fc","webidls/enabled/CSSPseudoElement.webidl":"b5301e7127d6f242e986dbe27a28c3a0fef9cd4c4971a40de57226289345caf0","webidls/enabled/CSSRule.webidl":"0c80b2aa8f585e8c079cdfe7501559a03d39eb29f5c67fb28f6693f84b28beec","webidls/enabled/CSSRuleList.webidl":"c154d7193260fd94e0bc6e59004688acbefa5e6295141800319af6b48445bf11","webidls/enabled/CSSStyleDeclaration.webidl":"9c2deefbce32527759551dcda35a6cbeb5dbcf517ed28539f8a1a88a4735cdd5","webidls/enabled/CSSStyleRule.webidl":"af892d9d4e5bcfacda5eb3149d388bab1c48e315457e7da9e634b15641c3e15c","webidls/enabled/CSSStyleSheet.webidl":"a2fe32a74f0afc5faf54c5716e629e7adcf8e17bfa93589caa6a20e49349a775","webidls/enabled/CSSSupportsRule.webidl":"4bcb8d7322a6946f1e221f50961032e4f7e0d505e1e4036eedbf6c77ece3bdab","webidls/enabled/CSSTransition.webidl":"4eacd7bef998ef2a65c04ccd4cae986412861aa832b557e267f26eb6147713ff","webidls/enabled/Cache.webidl":"65bca29e1f8820f75e37ba315b6053901db2df2828941eee9ce7c91b68081a12","webidls/enabled/CacheStorage.webidl":"2241ac3b02009ee05e398eef37c2c1c820f51df51ba9e14921cb53a0e008a9ab","webidls/enabled/CanvasCaptureMediaStream.webidl":"a293335fc5b56ab24cf6e6a5489d1fae441cfa6ee0139d757fe64e53214b2799","webidls/enabled/CanvasCaptureMediaStreamTrack.webidl":"66f36fd72374d5274b2aa4739870af7b638aa186b321752bd7689cd1d8d75645","webidls/enabled/CanvasRenderingContext2D.webidl":"d1f6175db6b1299a1fa425c0566cd162629cd3cbeb0fe131e75abaade11b4a21","webidls/enabled/CaretPosition.webidl":"ba94dd9aaf16cfc0ccd542c95f3660cf077296240b9dfe4334cd6b5ffe671525","webidls/enabled/CaretStateChangedEvent.webidl":"0134ffce3d0182e79c9d6ff8b7c6cdb4a97d9b2ff9a13561366811cfea6a12d8","webidls/enabled/ChannelMergerNode.webidl":"7f11b5fd15a3f6ac3f044e467cac63a26209cbc4ead0457bfbd41a08640e9125","webidls/enabled/ChannelSplitterNode.webidl":"b6c1dc502e54d04774d49dbedc3e272279e58c32fa7dfa54d79c21cedbf47e2c","webidls/enabled/CharacterData.webidl":"9e25440ce2f886539ea3395d0db29f198cd23682e9c3fb2b22c60ceb42c08569","webidls/enabled/CheckerboardReportService.webidl":"e9dfab3838aa24bc97447c7626984ed50ff1c44fd35fe6126472348174a66818","webidls/enabled/ChildNode.webidl":"07ea27a94a9cd723bffee9b97c82dd6b532a5adf6c9f61dedd508896666a885a","webidls/enabled/ChildSHistory.webidl":"33938353c3bdf6325a8a3819701a1cc1ce18806b764a6ce7468413b8b87a4a31","webidls/enabled/Client.webidl":"97a3f557fb24f6ab44f6a79b2dea8a44dd6651a9ec636ebefcb72dfd00b682af","webidls/enabled/Clients.webidl":"8abf090639c031cfed787bfeb706764c1411bb0694f3e963a7a318d1a07e2f4a","webidls/enabled/CloseEvent.webidl":"4be59406394ce09bb52df54fecc0e4d8b57b9a4dabc4c879932de6f18a77c9ff","webidls/enabled/Comment.webidl":"247cdf5db093d5c6cd65026fd01e89bff9238219bb396b9bbacc0414000ffd4b","webidls/enabled/CompositionEvent.webidl":"ab086646c17da2b5572ae3adbbd58a7c5753f2db4ee91b2ddb227744b647b9fb","webidls/enabled/Console.webidl":"b16ced12e357ba51a89b034984bc8c71a1e29b5e28dd04cef28b01069539040f","webidls/enabled/ConstantSourceNode.webidl":"b73cd0b4b99f807884e414d02f23cd463f6ce18930c7a7d53404166b5d1483d1","webidls/enabled/ConvolverNode.webidl":"f3568dc792134493c1eeb3695aff0a050583432a62fcbebd6f98f4c965167a60","webidls/enabled/Coordinates.webidl":"fbd19a84b321fbc47e36920e0b928337425663454bf18a008e2614eadcfbca0d","webidls/enabled/CreateOfferRequest.webidl":"3f2c597dab891a9ab706877d247d1813cf08b186b6466a607c98df3b9ed3627b","webidls/enabled/CredentialManagement.webidl":"4afb5893119ee632e570fa2c78cfb9fc4c31912fb6ad68ec3957c6a3a9eb3fa3","webidls/enabled/Crypto.webidl":"426dde526bb1b70d8fb2cfd12d9628a8c5e5f6d46ae123617b2f8c51705712a8","webidls/enabled/CustomElementRegistry.webidl":"a581b8015f01ec5b6481a081719fb43627fa7f26cf11a155345fb57d8c9d1612","webidls/enabled/CustomEvent.webidl":"b618f7e566aad4468e1813a8c15392d4e8d3cf98f83dba2314ff115c50a83627","webidls/enabled/DOMError.webidl":"cf1284821ac423e6e12a8364f3780070de8b90e5397001428c9ce0bcb04d92b0","webidls/enabled/DOMException.webidl":"ae3b2f004a3a4665217d00f0515c59580bbd1868b303980c69f2c2914cea6a17","webidls/enabled/DOMHighResTimeStamp.webidl":"a625f3d3afebacf6d9dde7bcc9900e31c22269b280069fb3369be50f651c02cc","webidls/enabled/DOMImplementation.webidl":"c9e3c075f4f675d77f02a1f2411f5e077f5ac73f9dd4054a2186e8c21783ede1","webidls/enabled/DOMMatrix.webidl":"7421fe74214ea03a8ba021838e93992c8f9eecdc3b21140ebe448746f2ce35af","webidls/enabled/DOMParser.webidl":"1466c13c06577c97f34d2742bbb3bbae3e08772133c89635347840f7f0dd7115","webidls/enabled/DOMPoint.webidl":"80425c8b3e478ee89d1cb424dc044bd8f0f50b8f4e25978f06c1a9afcc2836a7","webidls/enabled/DOMQuad.webidl":"a5f9c69d63c20bb4997ef0c3606d143bb99133b959ecabb06cd29bdfa73d33be","webidls/enabled/DOMRect.webidl":"9d53d4ea40b863cef890dff5a64d88a9d82476f513be2968b444abb026a0c12a","webidls/enabled/DOMRectList.webidl":"014d3aa34f758ec7f0fc9d22560c5b63a910d0d81e03562b7e42704d244cd02e","webidls/enabled/DOMRequest.webidl":"b540e91e8fd42e712178a5748c3e050a66e0b44e61e0a6c8819466fe557c0a80","webidls/enabled/DOMStringList.webidl":"1a8808f5ad7dfc317c8be2aee38f371a460c3df4438f5b43f1ffc7fd53569df4","webidls/enabled/DOMStringMap.webidl":"a7302611b98978fd5131e60fc6ef145dca824e0aedc9aee4ca7f919b2d3effe8","webidls/enabled/DOMTokenList.webidl":"ca5e72b3bf410709bc6aad5f37afb83ef589e142d2868b699a431125598b2591","webidls/enabled/DataTransfer.webidl":"489090d9843e2b13bb55a837155590a51077821fc4ab39a2b45a7cacefab0f3c","webidls/enabled/DataTransferItem.webidl":"46a91a059e83273dbd34f00786a1990d2abb5ff69853c068769e79abc13881ea","webidls/enabled/DataTransferItemList.webidl":"121799cb890f4446398d3ae1e932e5ae642c59c167b1905e05d33c2f36f7079d","webidls/enabled/DecoderDoctorNotification.webidl":"7433c819f26e6d87b60cbfe3e47b4a01d8459daf2ffad069c4d80942436bfe44","webidls/enabled/DedicatedWorkerGlobalScope.webidl":"529b8ec9aded8849361004a77ebe39421035c13bf3fc6ed22a24fcc9ea0da538","webidls/enabled/DelayNode.webidl":"8149532f064510f47f20103ce98aa71324dcf026aa784a180d773c73153a8d7a","webidls/enabled/DeviceLightEvent.webidl":"d37471f88312940800b65663daa968f11c6c3aab73fae19bd9c55f30ca160247","webidls/enabled/DeviceMotionEvent.webidl":"643de66eb3045c9af443bca568786643a83615ef084907932f5a76d998d95700","webidls/enabled/DeviceOrientationEvent.webidl":"2e88d1957715faf693515ec05cf91e9fb7c8b30efa6159931bc9113339688cb9","webidls/enabled/DeviceProximityEvent.webidl":"9dd73c557174f955fbe1aa07eca784900015fd06da463b027320f483a9ca5406","webidls/enabled/Directory.webidl":"b10754b626fb2e10d08b96faa5cc518fc857375b7ad6d46bbf621ca07c90a067","webidls/enabled/Document.webidl":"98efbd34e889cebd417232815b3972b0cd2fba0093201b70f3391b9c15aa5e57","webidls/enabled/DocumentFragment.webidl":"a414150e4f5b0b9d6dbdd785fc7c478c03b7e8695016854f81b96d2a66d22eaa","webidls/enabled/DocumentOrShadowRoot.webidl":"b185c3fdde1cbecbf02c5f35306eb8dd5401f02ecaa10db19031cd5202be9eab","webidls/enabled/DocumentTimeline.webidl":"d58a5f2db91c2254b52a5ac93209c255bf51d4902fc89b317f44b0c177ba8e0f","webidls/enabled/DocumentType.webidl":"02cd492b434c876d14176936af762de6e4b8597e899e11ca2781e911f739a478","webidls/enabled/DragEvent.webidl":"1f12cd956166fd17ac66b8a45797acb7eb65deac8294ed220c4c156eb680fc44","webidls/enabled/DynamicsCompressorNode.webidl":"6e7db468e68d848fb6a2b324aaa91d380d9527d2f16389f551fdbf5c014e463a","webidls/enabled/Element.webidl":"e6da98a38da81e9d8d710e4da216724b1f9ce6192a4f689caa3e52182f6c1f65","webidls/enabled/ErrorEvent.webidl":"54c7f54480c4b0b6d3e0ec8acb0706e3c39d2a8243450e9635465ca49f1d7dce","webidls/enabled/Event.webidl":"db7e44c631f87f4520ccde6627945725fc391403af7366ec4713ccc66edf7493","webidls/enabled/EventHandler.webidl":"76648d023242168a438b6e1be7251ce9aaf5a7ac97416748ca62d930de814365","webidls/enabled/EventListener.webidl":"d9984669abda9266281274e9fe084904c54b1d71c15033b36c69ff93b560da36","webidls/enabled/EventSource.webidl":"e277f35be84f3a0957c624ee422e43aec3b17a24644714e6de24be8c5bc4fa4c","webidls/enabled/EventTarget.webidl":"5d303c1b4ba45061f1de06558dcdb7c9b3cfc54c539e0853ff3038111009cfdd","webidls/enabled/ExtendableEvent.webidl":"15354aa78f8b996853c21815e48ddb39de5bccd19e11ee234af9f85f182d2b3e","webidls/enabled/ExtendableMessageEvent.webidl":"4b156c28fe958a210b4c36c70b10608038dc01d6e4e2b8538fdd838b49204fe0","webidls/enabled/External.webidl":"6274b07951a3ee892b51266e89ce1673a8587b7b28ed592d2100c78f2edb41e7","webidls/enabled/FakePluginTagInit.webidl":"650764c6f953960228adb980789bea1b27063e8425f166ed95be6f3e2a6cd555","webidls/enabled/Fetch.webidl":"479ee79d19b374436c7e64a18392ea4674ce6bf9c0f70fa04c33686cbf4221d8","webidls/enabled/FetchEvent.webidl":"44cb01a7e650948abcb9ad4dab22aa2fc47aa94884cf1ef5dff95fe90bb99804","webidls/enabled/FetchObserver.webidl":"98e0498ec43f79811b50e5d999046fb1d7ac8ba7b2e3d9d428ad45b8670b0d28","webidls/enabled/File.webidl":"9f4d4364b8e1b5dd818f057859e2a78e4ddd37cfac5c4037bb36561372da01db","webidls/enabled/FileList.webidl":"25ea98ff242e523322790af498b0eb4244d6a043ad40e7021e84b9bcc071f713","webidls/enabled/FileReader.webidl":"dae5c206d56950ba85c7a88eb865320875b119607880f46c076cffd4f5055097","webidls/enabled/FileReaderSync.webidl":"b2e20aad23a052460eb9477134fc470cd584302fd008be9e63e8199e845fbba7","webidls/enabled/FileSystem.webidl":"6c35399931e6ee50ce7eb04cd45ca2b573c4fa55252bed3864117b1d887bef24","webidls/enabled/FileSystemDirectoryEntry.webidl":"67b81667e6fd85b7f2a4663676f5d06c5dbcfc5abcad0210ada7d23ecf10535f","webidls/enabled/FileSystemDirectoryReader.webidl":"f578c5b8d435d84e0dfe0a4cf7d2fa47ea449238b2f08c6f9fb5a615935b4394","webidls/enabled/FileSystemEntry.webidl":"deb905ac99bd1c411cc7b847361f8f541e6c84b52f6778e60dcac0a971f64f0e","webidls/enabled/FileSystemFileEntry.webidl":"72e5b5024aed480345b8a5a44d7a9491722661f7d613255c7b132ca8121c47ee","webidls/enabled/Flex.webidl":"66353797d8a358336c0ccec47abce7e27af7cac091be33aa070191708adeb8c2","webidls/enabled/FocusEvent.webidl":"785632d65c2c65a83531f275a13f78a3313ed5143e1b27d894b7c7cb92f0034b","webidls/enabled/FontFace.webidl":"373443d52e08d3e9846b3d32f235c3d4906e6a629dd2b555f1736849d744dab4","webidls/enabled/FontFaceSet.webidl":"60792d6d3a03a87ec7c23828fa89285e183bd1f4c077389b8bcdb9bb84dde47a","webidls/enabled/FontFaceSetLoadEvent.webidl":"77c31560bef55a814579eac3a92adb39bd9f3a1c9994b35c95923b30dfb2e772","webidls/enabled/FontFaceSource.webidl":"4bd55612ff913320383541643cecfcd26049a84ec0d0a138273c2ae83090e145","webidls/enabled/FormData.webidl":"06714409d1c538dd1e4d36a6d37a1b2423a7bf845078930c79da6507f7e7904a","webidls/enabled/FrameLoader.webidl":"2118244c44c142e9da53f153b0216e7289d9ece4b6f3f22ca547dde303ace25c","webidls/enabled/Function.webidl":"23529f87dc7d752ef38e07eaa16743e22050c9860a27dfbe8527b26391e79e16","webidls/enabled/FuzzingFunctions.webidl":"0220b76387612398fd28a0a168c375735b786276971efd7f5249920bcede6e66","webidls/enabled/GainNode.webidl":"bd7b7367d39fdf384204790ba3bd3bb711e00b50be70fa24ac550ac973e37152","webidls/enabled/Gamepad.webidl":"97974dccdfb8842adcbe266f15a777631e2210708edf2f52c7ead60aacf9b548","webidls/enabled/GamepadAxisMoveEvent.webidl":"ea86a6aba28574d9c92c2a5fab7a353c52990819a3c879c2a46d2b0852358a3d","webidls/enabled/GamepadButtonEvent.webidl":"4fc269cc3740e74cf0768e1de19b8b706b110769d3dc67a221bdfc178535ebe8","webidls/enabled/GamepadEvent.webidl":"f696441506b360ffc8daffb102f4ed6f70d8bdabbf34f81639e0008c16b96d50","webidls/enabled/GamepadHapticActuator.webidl":"7c76aa852470fa4e0be4a296b0f40ae30625aebf563ced44c97b47c50f6f84b2","webidls/enabled/GamepadPose.webidl":"e287374f54910af89a3adea7b03e40e2d47543226c4acf87df4432a120648c70","webidls/enabled/GamepadServiceTest.webidl":"f86a0e6bcd1c6da5fc224c2563ba191d7ce295b5c48b5b6591a032770189908b","webidls/enabled/Geolocation.webidl":"4fba86d71ebd9e6e822950ea951112408c3aaa4ad11d23116e1eceadb9d31e55","webidls/enabled/GeometryUtils.webidl":"8b3fb64f1fe7bf50a85c580fc1265b4234c4418bc2021cf69eb3c9b3baa700ff","webidls/enabled/GetUserMediaRequest.webidl":"eaa284f01a9ff6104ac39c5c81773d2185e3b580fa106ce7011ca8285aa7c46d","webidls/enabled/Grid.webidl":"df70b1c6d1115e4ee7607e321c0e8db5f4d0c2dbfc1a2bfb9f31e087a7979e0d","webidls/enabled/GroupedHistoryEvent.webidl":"03a70bbdd88f23166189b94332d5af19c3ffe92a64806d7dc7e561ce0a68eea4","webidls/enabled/HTMLAllCollection.webidl":"911e1f71ef504f2ac767746f6824dcb2657a7812031d6c96d654039211fd821d","webidls/enabled/HTMLAnchorElement.webidl":"b47247a861732603ba42d30f23cebf6b9e4c181be00147188df1cd1d09e8c59e","webidls/enabled/HTMLAreaElement.webidl":"532631e8f1560c34603a324800d406dc3142f264b04fd8d603fca0ba3ef07bc3","webidls/enabled/HTMLAudioElement.webidl":"d345663eab59d6f1b4cd89c06815a759ee7dd56ba599b5acf8691b71412b09b0","webidls/enabled/HTMLBRElement.webidl":"0d51f01d47710a439ea5a6990b8ac957a911cfaeda13418bf833c8f3a2950419","webidls/enabled/HTMLBaseElement.webidl":"dac35d6efe54834ec0f603966f32884edfa8e19e84147a0beb9e529e9c5cb962","webidls/enabled/HTMLBodyElement.webidl":"91040e98085638f1d3b008af5095e9aa1cfec26a198d277c9cc45a51db3de22b","webidls/enabled/HTMLButtonElement.webidl":"675fda12c739ef8bb73509ad4d2eea45ddce77ea56b2c307596f4436de5822b3","webidls/enabled/HTMLCanvasElement.webidl":"bef57305b8e3097b33ff4e99331d3dafd959120e3a96f72f1dc9aed36657a056","webidls/enabled/HTMLCollection.webidl":"9de949e45fa8ed104d65cde5f6fd3d14fbce486f6929d250ad0df4f7b90761e8","webidls/enabled/HTMLDListElement.webidl":"b1d9a3246ae855bc27c772d8bdb78b6eb29d53ea578bce227ef07759d03ba01f","webidls/enabled/HTMLDataElement.webidl":"0a634c145a85789033a38a8a8bbbd2a739d7beb177965d65aaa457cfa2170e39","webidls/enabled/HTMLDataListElement.webidl":"6dbd134a023f91992c8b5c3b0010e96b5ec832bdc9815e9f7a815319fb4d1338","webidls/enabled/HTMLDetailsElement.webidl":"a7594e9a10a37c9428b5c9b12868cc44c1608cdba609c69ae9bfc6a6aba6befb","webidls/enabled/HTMLDialogElement.webidl":"3c79889eca00e5b0ee13847a45021c002e70b03fb6263953cec90ef79736d462","webidls/enabled/HTMLDirectoryElement.webidl":"514908cd8fe9f661ac53aad204f35709601a3a07d39123b7f59e18bc22426029","webidls/enabled/HTMLDivElement.webidl":"52950712bff7f588c8068ae22cb6361a7d7dd12293e930aaebf2de82ebcf48c5","webidls/enabled/HTMLDocument.webidl":"d6837c86a9b26838cbc677377dd251b89464fb7e38e45fc418196446e2acabfc","webidls/enabled/HTMLElement.webidl":"710a0cd73e15837bb6cff7e94e16ecb2f64ff6f9b37618ba85be9f2e2809f39e","webidls/enabled/HTMLEmbedElement.webidl":"f3e0f590bb3aa783a654e6c330ff0aefbf58c4f0282e9b292b3952850a3886bb","webidls/enabled/HTMLFieldSetElement.webidl":"28b971856338d6481da21f39e0610cb12a9f84f6efa48a8523000ee7315eb53a","webidls/enabled/HTMLFontElement.webidl":"53245e2002f2be50a73d4ed57b6990f71c83aa9602e7427d39735b161df9edb9","webidls/enabled/HTMLFormControlsCollection.webidl":"888734b0d8fcd38406791ba9f8e64358f36ee7953b3291fcf0ec98de70d25fc3","webidls/enabled/HTMLFormElement.webidl":"17e3ef7f89aaae92c1abeae1363f8678e09c0ba482414fac1b9936c9b9cfdf97","webidls/enabled/HTMLFrameElement.webidl":"27ca6eb4eb8c1d8c970a704b3a5b9d833f5a9306ab38b3b3d0f260a5910880fe","webidls/enabled/HTMLFrameSetElement.webidl":"930323ebfd8d5a1cc5d51e44c7430f130f3cd22dabe06d48b0c98bdd0ac86dbb","webidls/enabled/HTMLHRElement.webidl":"ae5c90df7ced4b6b53d3894f6311d2ddfc319bb82cdbb02d31a46cbdf3b73ac7","webidls/enabled/HTMLHeadElement.webidl":"988d03275a9869bf7e8fa43ca19af6633e8620b6fdc953686eca4aa75c641158","webidls/enabled/HTMLHeadingElement.webidl":"5eaf33184107dadcf275e475ad4514e0d8a284b883c5d041400126cfdb612bd3","webidls/enabled/HTMLHtmlElement.webidl":"20e7b4c634ab5707801b1409d09e40a73d060b0037ab5ebf82f8222c98d1d942","webidls/enabled/HTMLHyperlinkElementUtils.webidl":"a692047eae18831f97049dc6675df4f1a5c5f8074c7f65b305958ff00a342f11","webidls/enabled/HTMLIFrameElement.webidl":"bfb7f7293e7a8490321e0bb72e41fab95bf72cc57172b49363ae0c6245f1716d","webidls/enabled/HTMLImageElement.webidl":"be5a75246e845e68638dbf644c980ff5fcc1f7575f2facc468fc1d18e69126ce","webidls/enabled/HTMLInputElement.webidl":"fd486ccef7a24412117918eb28a0363bab719f3c5b60eff9a1285323d9ec7ff7","webidls/enabled/HTMLLIElement.webidl":"a69f089ccf8d4c9b7404bbac1716d7d6c9c52a44e8cee19fc524797fc8c6c225","webidls/enabled/HTMLLabelElement.webidl":"20b224fabbecb8f7e8baca8b02d07e2a5d40b9d9ed23b033eb4f970deecf0d0d","webidls/enabled/HTMLLegendElement.webidl":"5cfd37822114dc8632b6fbd945b22e05f0917390d0dedb9c4f25ac9f6accf459","webidls/enabled/HTMLLinkElement.webidl":"bf1ae8f6e0ae80150c086a4f8bd21527fe5c7612dd156a5287f7ff7c473e20c4","webidls/enabled/HTMLMapElement.webidl":"fc6bdad42f4227b6568d616bd989ce6ace9218052f08e96fd5e8e10d907a2cf0","webidls/enabled/HTMLMediaElement.webidl":"25e8614ad3813f8ce44c9803dbdd8685f16578bd4ee9fdfe941968cb3caa2c04","webidls/enabled/HTMLMenuElement.webidl":"24ad0a1cc3faf2854cda53d969743d946afc1074e80d79749b8fd75e373eeb81","webidls/enabled/HTMLMenuItemElement.webidl":"ba371fb53c2bfe0a81db517f13ca90a115db853e2688c9550f4126ee1b1b1eb2","webidls/enabled/HTMLMetaElement.webidl":"5e552df9ff76ad54f7984608dc7967a3a138c7c0d84ebdd8157a7ed6713b3023","webidls/enabled/HTMLMeterElement.webidl":"21a8832878f43f57b716d5fe0e99a617492602b971f7fdc23ac42f597968f0ba","webidls/enabled/HTMLModElement.webidl":"63beaf5e6d77e63739acbd6b58147af7d84e665f4a5853445ae160de4cf21b30","webidls/enabled/HTMLOListElement.webidl":"07bb6b740fa7f619f621e8693e07932c6bb67747e2a5556685dcf3ccbafe7a04","webidls/enabled/HTMLObjectElement.webidl":"4c4edfbcbb867e4e6a5945f213c5a246e1ac28fec4f61a59f40025aeaf0570d2","webidls/enabled/HTMLOptGroupElement.webidl":"bd91a7cf0eaa65f217e7cf47e54d11a4315245209a52ba846d770392921ed15b","webidls/enabled/HTMLOptionElement.webidl":"0d6dcc38b9a6c799aaf5937725c3ace50a6629e05fc4621d8caa901a4e7536d8","webidls/enabled/HTMLOptionsCollection.webidl":"902bdf9c4e15f30c3be3745842fdfe4e4e0739b7650eb7ee2c6781200825ceac","webidls/enabled/HTMLOutputElement.webidl":"863c2a5fae4e3ddeffd325ab6e49a11479a89264aeaf9b945f72595e611304e4","webidls/enabled/HTMLParagraphElement.webidl":"259b49192386f7448a548ef630403d576e0489d43da92b1fce891856da83258c","webidls/enabled/HTMLParamElement.webidl":"cb4f844f9698cfff48b02cdd7fe2c2820dc7c0f5b5e6ec24c27cddad25810e63","webidls/enabled/HTMLPictureElement.webidl":"b0bcc2f70ac7ea0835669bfc7f51676518f1cbb68f388f3ea8ec4e4f51df4974","webidls/enabled/HTMLPreElement.webidl":"1e6619dd4b9a111e9c9021e5b25be43cda52ca97e2d07e3c4f695cdd557f4f02","webidls/enabled/HTMLProgressElement.webidl":"3dc186323a3ab7837afd1feb9b1a0bf647677dea57d0af691381ee5e706f6cd7","webidls/enabled/HTMLQuoteElement.webidl":"6e2da7bdc4cccdfe1e9a4a0eac8eec04366bf950edc279c1f0adaf15b85b5637","webidls/enabled/HTMLScriptElement.webidl":"2ccb5d8577c1f59af4162b00289c4bc492faa97ed24bf1156c69a39a2ebd4a0d","webidls/enabled/HTMLSelectElement.webidl":"88b81485179669a3cab43e1b70b695d7428a219b8d896c3915ee79d1871af482","webidls/enabled/HTMLSlotElement.webidl":"0596089d5a147ac30025ec605b3a3153cd23d6ce3f5bc44747a4d2841119ec96","webidls/enabled/HTMLSourceElement.webidl":"94aa3d4813b51191598cb03db140823663cff47ae30ff42a266fdf7451788233","webidls/enabled/HTMLSpanElement.webidl":"6423fbaca98b5ce2ab38321ca5f1f172839ee46b9b2ae0674c4b6a27ead11d19","webidls/enabled/HTMLStyleElement.webidl":"fbacc26b670030072a883935f76e3100babc35d6f941fa1f8c7f5818f33e0127","webidls/enabled/HTMLTableCaptionElement.webidl":"958c408d02849c9cd19f31a9c5e072f5d3430b966bc271d80162292b3651608a","webidls/enabled/HTMLTableCellElement.webidl":"c84cf7b3a19d63fa1bdece8b8bdee3ed9c406466612170bcff633a769c7db83e","webidls/enabled/HTMLTableColElement.webidl":"ed7925a256b258e1c12cc23906513a8873f0a250964285f46ce7f7562273263f","webidls/enabled/HTMLTableElement.webidl":"5cccd80201ee85f478c7e13a81d6dbb0540999bca34babed4c624348394e2699","webidls/enabled/HTMLTableRowElement.webidl":"fc316de4f53eee5972d4be2833ebd846e02468e93488ed8256b8d25514ed0b0c","webidls/enabled/HTMLTableSectionElement.webidl":"96a78ae9c92e7a846bcf3617be572cf653fbe27b26b91c5072ce37839cdcf346","webidls/enabled/HTMLTemplateElement.webidl":"856f72fe1152031a0723dcc0db42981fd178535110e5b3464fe6c6961abac80a","webidls/enabled/HTMLTextAreaElement.webidl":"f118ab143c85a0b537da93247741133e24e1e779a47742088cc9bc2704886696","webidls/enabled/HTMLTimeElement.webidl":"e3600955169b12d39e2c28350596c6dad1cfcad1e6c7aab7a796443851135f9a","webidls/enabled/HTMLTitleElement.webidl":"2a19cb43661fc288db244f76239a0615e8708442f14f19564d885f2171b39e2d","webidls/enabled/HTMLTrackElement.webidl":"aae1b41c17c99812bee6dd027c1cdaa7c9837c25bf6aa7f6feec249132c097a1","webidls/enabled/HTMLUListElement.webidl":"386d32f21bad1d28bc7dfe52eb3c145e0d1af972e0e15ff1f045898b323a3835","webidls/enabled/HTMLVideoElement.webidl":"74752f0439de22022f063ebe1af45e87873745e879d8a66d11731444c81f9580","webidls/enabled/HashChangeEvent.webidl":"763423e003a16e9dc5b533fbee8feeab272fc6bf26b5919317d4af84d7b01d32","webidls/enabled/Headers.webidl":"e926b6f5b1c4ca759e273a453c8e3febcf197c59c3df58cfcf75cc15da0a4bdf","webidls/enabled/HiddenPluginEvent.webidl":"3e0963c7234e801be89c767237b587d2de0411347c9ac3a12aa83614b2436108","webidls/enabled/History.webidl":"bf089265b512c70b13469a1f15dfb2c133379d54a2e400d3a1b2f60efc6a7097","webidls/enabled/IDBCursor.webidl":"797746aa8d9542c27e2d313174b274c9ca787c888ab17c048197b01f6b84253e","webidls/enabled/IDBDatabase.webidl":"521f6c68b694121e453a90bc08dd212a0cb95f490004d0b37bd16d239973fecf","webidls/enabled/IDBFactory.webidl":"8c628520e744ff5cbd44c7c45fb90ba98ee594b91c255cc6a7e2489fc1f926a1","webidls/enabled/IDBFileHandle.webidl":"24e4bf8211ee3bc93a215f9d21e052130e071d7b88494581f43c923667e801a6","webidls/enabled/IDBFileRequest.webidl":"54471acf4c7d569403f33405c051124ecd5eb5ae9eb42965ec9159a7ed0db4fc","webidls/enabled/IDBIndex.webidl":"683a510a5cbf727bdea21e9f746a59516e84de5538935fa3f1d586ef5faea0c9","webidls/enabled/IDBKeyRange.webidl":"a1474209ad1065b4ce1ab022e3ed56ed8eaf8a1f6057e3430006a6a1d4b87952","webidls/enabled/IDBMutableFile.webidl":"3812e0bb9f9eefd5647a03b5b51c3ae1a790f5214ae020abc297759158323aac","webidls/enabled/IDBObjectStore.webidl":"57ffa10162099e2bb89b4c6423920cafeb52f880cfd66299b80b57b1d198e8bb","webidls/enabled/IDBOpenDBRequest.webidl":"9eea9088bb7f8c2e85309ab3a3b1e7f4402b14366b1c0cc3aab9a2d8c3f316db","webidls/enabled/IDBRequest.webidl":"7eb90bf020acaad57471e3094d2701bd3c517497414487bf40321682c720be72","webidls/enabled/IDBTransaction.webidl":"dfe01201f94c6cea896436f2f3336c4ce35d9b0f81b7cf442687d5d1e579e778","webidls/enabled/IDBVersionChangeEvent.webidl":"7dda382eca992d9f79e7407595fc4e883f27a7d1635ba101ea7851bba8d66b1c","webidls/enabled/IIRFilterNode.webidl":"80a0fdeea73945603c5cd6d1f85d3c9596b4e8be23d72db79234a441c537b4b4","webidls/enabled/IdleDeadline.webidl":"fc18e1e454adc488d4fbcf6ab6716c872001402d87839902801120a248ca5949","webidls/enabled/ImageBitmap.webidl":"08a2bb2c5688920a1fd7163b62475cbbc119b1d9669202aac54b0d147e0de90f","webidls/enabled/ImageBitmapRenderingContext.webidl":"18b6058348161d5c8dd0e3304f3f0870ee8b2892e6935cc1d2306f367fe5e287","webidls/enabled/ImageCaptureErrorEvent.webidl":"d6573af4e4dfb5e46fb00d7c1ab8e9309a0e589a4afccce76cedec5953831278","webidls/enabled/ImageData.webidl":"f9af056bde477d5e0f33b4a15de4a90e5c14a3b47a77d084ef1c992482f8d87f","webidls/enabled/ImageDocument.webidl":"02d381ad74b8b79371c50799b0c08995b35f77e9fdad674202902a9bd2227879","webidls/enabled/InputEvent.webidl":"2e7cd9ef0fba43a89ed17fed1c0826b43a779f4413a1d3bae8b56583a0449cf3","webidls/enabled/InstallTrigger.webidl":"05f9fde3b20b0845e80851ba848d0e5ce5ddc9f9b49ad9d00d44243c0c6bfaae","webidls/enabled/IntersectionObserver.webidl":"df9812da4b5360065bd25d0596c8a4accec582863497d90803aca1dced443b4e","webidls/enabled/IntlUtils.webidl":"57f74df6b5666e29cb8c065bca9a4ba1bce721d5b8ffe551d7bb1d02f0f892ed","webidls/enabled/IterableIterator.webidl":"baccf4e84a6b0db6939d0513bda2ee3d5c9368b5c3c81abbf2eac36232ee8891","webidls/enabled/KeyAlgorithm.webidl":"0e04cffe31f96f7e2807bb2dfa1e6bf02462815d693c8a3aeae949ed9e21a7d4","webidls/enabled/KeyEvent.webidl":"696a44a23b0e626f8a0f1501463249ff63f920bb2f565548258c3fcf9d1b9067","webidls/enabled/KeyIdsInitData.webidl":"74b45f0eb628afb2b9c6f8cae2b183199dafdccf9b87744dc1b1bbbf9114f6aa","webidls/enabled/KeyboardEvent.webidl":"634a8d06d479ea1ce5fbce9a5591876aed8ecb315849735d7e0305fddfabdc26","webidls/enabled/KeyframeAnimationOptions.webidl":"68d0e95aab8b82f4b2bbc78211d7625b836d412f9cffa1f19c0b89b7cd14e589","webidls/enabled/KeyframeEffect.webidl":"c6c6fff71d4a344b4a035c980f66e91339fd721723037b5205a50684aaee8a2e","webidls/enabled/L10nUtils.webidl":"85fe322b17bb6a46d2dd889a631b8bc82799beafe283611f28ac0a8355fdd2b8","webidls/enabled/LinkStyle.webidl":"28e1365b101a6d7b254f4f12e8a355df5fc7aff6bbedf0c4d9e87565425989a1","webidls/enabled/ListBoxObject.webidl":"fe5e39d16b8e781b53d8eeaf5fc5f59511a137180fe574d4441cb2524361769f","webidls/enabled/LocalMediaStream.webidl":"006e7d70d312b75c33c75fc90a342811c9ca4d745232814a24d61d304a8b2e7b","webidls/enabled/Location.webidl":"b5a280c463d23a070071b3063df584145b507e513f1b0d2974915cbac0abdecd","webidls/enabled/MIDIAccess.webidl":"58f6e706e668360ff02f794fffc8f81dea879f68f59ae9d2d13f18d3c5916f80","webidls/enabled/MIDIConnectionEvent.webidl":"8775a52412a3904f46deb8635f14e18701c36fdf9084f906f573d22a7de3486d","webidls/enabled/MIDIInput.webidl":"11a4eeccc4ab74501291d25d7d5068dcb689721f93ebefe40653d3a95fa6a75a","webidls/enabled/MIDIInputMap.webidl":"6a356c20cc9bcbf679ea7e8d2deab519fce8e6b7390f309da7bf425b18670231","webidls/enabled/MIDIMessageEvent.webidl":"fe15f6b56f1a102f04e13f2ea544f5d37a805f8e01b305d1caee76ed40fc8c0f","webidls/enabled/MIDIOptions.webidl":"3ef87d615386ba5cb1ce19b13fc430488476246a8970bc0218795139ef3b039c","webidls/enabled/MIDIOutput.webidl":"7a883cc5a3438a73aa524682fdc1a2aeb122ac57bd6df775cf4264851cbcf208","webidls/enabled/MIDIOutputMap.webidl":"f68fa016132b90ad2a18bc4fc024a24568b7ed85379238698eae3d38aac01b3a","webidls/enabled/MIDIPort.webidl":"3fdda9ee45900012dcb6886cf5ca7465be826dba05305d4a9d2ba254e610e76b","webidls/enabled/MediaCapabilities.webidl":"26019e7e198c2b17df984c4df5e78836ddd56c9e1eafd7e09f7f52e6db478d32","webidls/enabled/MediaDeviceInfo.webidl":"39e9ae3834c61db85ae2f3ba034a7a69e721dbef396823615cdf79f410cbef9f","webidls/enabled/MediaDevices.webidl":"2b9b65d1186f18077012f66eafc79d4e9d6c1a478213d0a3053720b377ec07a0","webidls/enabled/MediaElementAudioSourceNode.webidl":"8d1e8f589128a98d46ead4393ec012a44c1b8848f72ede824afca1320040d825","webidls/enabled/MediaEncryptedEvent.webidl":"0370afe3a99060853cf2d3850afb494f7f0414eff53788c1b6e92c0b60338b6c","webidls/enabled/MediaError.webidl":"f7040be08c475be0176a8eff443f1cde81d26a9b76ed71b7a8485e7e2d424448","webidls/enabled/MediaKeyError.webidl":"2ee05d150360dc18e1da2a8143a7a883a73292c7498c18496703a522b7310d96","webidls/enabled/MediaKeyMessageEvent.webidl":"2663944d4bca18a5a26f5d1ed63ae22b6180eb042344b86441f319bf8f02ace2","webidls/enabled/MediaKeySession.webidl":"82e5bae1694bd530c3228da3e742c88b7c1d40eb2a77edf2d19ade6a388c5628","webidls/enabled/MediaKeyStatusMap.webidl":"4f8ee56ebb7e6bb9ecce7755d2972b2c4cd58d448f9201b92420e3ce3ba7036d","webidls/enabled/MediaKeySystemAccess.webidl":"001bc4ad92c0bf64434d7bca21a51de2eaee9d64c412fc7c9300d5d22ac6de14","webidls/enabled/MediaKeys.webidl":"eba4547a687f049131921d5d6eb950395817184de2ebf8f443ed49c3476daae9","webidls/enabled/MediaKeysRequestStatus.webidl":"ea6e75921cfe8326e7363314e8f26d54af9a0e95979187e91fb946d0be063bf9","webidls/enabled/MediaList.webidl":"cafc6b4bd71eedaad33fa5fae41e53edecd182a716d6f63db591e7f362e42a26","webidls/enabled/MediaQueryList.webidl":"66a1aaf73a788ecaff60fe1782aab47e5e4de12e6e2eceaa306506c39d5ddfa9","webidls/enabled/MediaQueryListEvent.webidl":"a7b021abf05e8d95222c0125331af9a78eee1f4a93d68bd81f9157925a29725d","webidls/enabled/MediaRecorder.webidl":"025f38f44f27c1502a4aaa293700232c68c6c55df21347c1decb74e2bc595209","webidls/enabled/MediaRecorderErrorEvent.webidl":"8b92015f20fb6f7713a86b78775a1c1409b836101c9528ad30f58ffe9d441039","webidls/enabled/MediaSource.webidl":"b6b117032cf7c474062d2980cf71fa1820aaab3a9dd474fa2b326f69669a1fd8","webidls/enabled/MediaStream.webidl":"ee8f14692caeb5ecd685f9271161d556c494aa6f20b3abeeaec03a863fad2b1f","webidls/enabled/MediaStreamAudioDestinationNode.webidl":"97ac421a9aa230abdde89655bb11a3191b5868aa91c7f1ddb543106923ec7f65","webidls/enabled/MediaStreamAudioSourceNode.webidl":"08ffe8661570e05d5f14a1a98f667c75490b71a30e9aa41f0c2fb6d1747d140e","webidls/enabled/MediaStreamError.webidl":"8d5b8ca56dc1a2de36920227cc760eaba720cfc475c8b2a54477002eaf5bc1b1","webidls/enabled/MediaStreamEvent.webidl":"c88d8691cb94213bd1f7e37c1133a3665d6068991ccd6415fee41cbe6ac2d8e6","webidls/enabled/MediaStreamTrack.webidl":"15ce546469c519d9dce742700cb6df39e8bb858891ac11d664e3e2a82f20b8a4","webidls/enabled/MediaStreamTrackEvent.webidl":"6f33b799bb7e2fb3488614e3c90ff880c3b826be1a218fdf138b7ed6b99c98ce","webidls/enabled/MediaTrackConstraintSet.webidl":"da63d3cdc6f7933857d9bba7e264479f290ba03f998582812e402aab27878bc9","webidls/enabled/MediaTrackSettings.webidl":"988264c143728a0bca54193a7f22f93226d29b00e8a72c8a32fc56900cf019fe","webidls/enabled/MediaTrackSupportedConstraints.webidl":"b2824bee249132b4d2c2a4712427e7c2ef9ecbd453a8cd8cd14d304f10c07971","webidls/enabled/MessageChannel.webidl":"6efa741daefc8bcf42fae3421300772320b3ca6703a173e0d336f99e260bf890","webidls/enabled/MessageEvent.webidl":"f45e89ee3fea8c987f75e4dc049c796c67d59640e176def5510fcf3c32152899","webidls/enabled/MessagePort.webidl":"b9c1245a59ff0185dff678889fff61f67a2ece6d81ec4269655f07a8165249ff","webidls/enabled/MimeType.webidl":"757626dfb9f020b59cd3f739ab46022cf281e4beaf4c039aa515b167ee70e246","webidls/enabled/MimeTypeArray.webidl":"4c6ae0d0c6a967662f8cff4bfb33f26f7479a603aa8540b74fecb2064277699b","webidls/enabled/MouseEvent.webidl":"3d3da4ef7163b5996dbe24f2cff42581de65826ddb5c2452e79d35833c7ce3b9","webidls/enabled/MouseScrollEvent.webidl":"958dfac037298b7b32367655db780311b8afe881adc58fb3176c678209625f07","webidls/enabled/MozApplicationEvent.webidl":"75512e059392c8508d4bc1482b8fb64ada87b98c0a49facb03e989da0516ed6b","webidls/enabled/MutationEvent.webidl":"669e0af319257c6e364bdcd79447313fb240e5266a321bbe08f87163cc872ad4","webidls/enabled/MutationObserver.webidl":"8acdb27ba6f9201f2589626a402ed4f92eaf6d361e325100865bc791254bdb46","webidls/enabled/NamedNodeMap.webidl":"149542c31147345d43d93d670b0e856a1dde4d5c534cfa52d8aa584ee2153af3","webidls/enabled/NativeOSFileInternals.webidl":"b518244fb86ba62334e13f42a561a3a48e520321c196a48c024359c6eda3ce6e","webidls/enabled/Navigator.webidl":"c014640de9c0d208a554de73ca45f11974f0c58739d0021e8890d5b9237da217","webidls/enabled/NetDashboard.webidl":"99f5150c764f90494142efcfd8a2cb824b44f1190189f9aaf30af93cd85ccaaf","webidls/enabled/NetworkInformation.webidl":"de0820f9049746b459e5dd2a4dd9e40404c8857cf31c12e29fdfbac1fdabcb62","webidls/enabled/NetworkOptions.webidl":"8782c373d76d76f336decce7274f43ca99a896d961722026898eeb60bcb473a7","webidls/enabled/Node.webidl":"713e28cceccd791e997db68b5b0d84aa46285e6de42126b9f0ae8e4781ea8ec1","webidls/enabled/NodeFilter.webidl":"527355d4a296696054715a80a30231ea74cb5927b5e940ab769bc3bc31aa0d5d","webidls/enabled/NodeIterator.webidl":"99b822656a67ec184e1bfd09cb7cb4e2f684a7f2d8d197047501a45cd25b9150","webidls/enabled/NodeList.webidl":"4c7d5d3149f3e79087e89108430acd4e9deebe531a946e23f91f3fee9a20b712","webidls/enabled/Notification.webidl":"ce94275e7d2f371f4c2417df9254c6d68e939c5baf6694ce238cf52b2a62baac","webidls/enabled/NotificationEvent.webidl":"abe1d7da9d0dd1a25f4b2940d5b0319f4ab130a9f856738de7b97864bdc2828c","webidls/enabled/NotifyPaintEvent.webidl":"7e58bbd1dcdd2e3cfa25ab411495045872fc4e9bdd126764fe2f5ecab7996fda","webidls/enabled/OVRMultiview2.webidl":"c81aa84d3e1f358eced8df948fa45f87dfbf7d71e5ab502bbb99737965fd619f","webidls/enabled/OfflineAudioCompletionEvent.webidl":"87284c182880aa88a9dfa49cb8375594bec1f9af6475d20c4d54322bf3f49650","webidls/enabled/OfflineAudioContext.webidl":"3cd688ad772feeedab5f1f8f1970b94fc214824329345715667591d16b80af09","webidls/enabled/OfflineResourceList.webidl":"0be922a661387bc2dc8798511493d448dbed92fced1026a341d445fef9c6d292","webidls/enabled/OffscreenCanvas.webidl":"1561eca7f81c43a0dd1c1ee4d40a06db67c0e2e1cfd68266f91a160df0a3198e","webidls/enabled/OffscreenCanvasRenderingContext2D.webidl":"f1687bbcf1dd5ef5ec8acfd7ab63f57221d5501ab5cc1de0e57a937c5822bdfe","webidls/enabled/OscillatorNode.webidl":"da2d3207a42adffaba99f452bd26dd70a9d33330c3387a3211bb2394b0d9d734","webidls/enabled/PageTransitionEvent.webidl":"56539720e7a07f1b7b57ef204b5a1f2d4c288f68728e0180d298a7a40f3b2ebb","webidls/enabled/PaintRequest.webidl":"e8c046b22f6b46d6d15e206f23f33564cda53364b22eb4828785065d7772d995","webidls/enabled/PaintRequestList.webidl":"840ea6f7382f1d295bb60fb399dedadd25a3bea4997f82b889d5507e04e408e9","webidls/enabled/PaintWorkletGlobalScope.webidl":"0dd8d9cca67b0614191ff51e2ea2ad3d6931fcebc373cee232a7f1eecfab6622","webidls/enabled/PannerNode.webidl":"89878fe816b8cb7d87c7827d80bd6793a45027f12a18f30cee332d76a0ea25f2","webidls/enabled/ParentNode.webidl":"c6bbe5d5a548b9f1a59f252c28f8ae216b80697c12ff9c7953ad2366a5910904","webidls/enabled/ParentSHistory.webidl":"0bdd83ec933e0e3311e9e1519efe7311d893404c0651d94a5885fa5f2773dac4","webidls/enabled/PaymentAddress.webidl":"c71b7efeb0d3d1b8fd6f01eee3af89f5cd8b42660d25d889dedf0615f528faa5","webidls/enabled/PaymentMethodChangeEvent.webidl":"f037593088cec9010aa383133613aebb8f14fbc5c9973f21773625353fafb389","webidls/enabled/PaymentRequestUpdateEvent.webidl":"fa0c3008240926490e742a9a3595df6ffa989717066f2388d0bb5c9b14d45211","webidls/enabled/PaymentResponse.webidl":"0f7565bd2b5c2a28ee1508062ea4dfa56df719e72eb4b0b5c8ed20b0c658bbd3","webidls/enabled/PeerConnectionImpl.webidl":"10a3cd47a2320691dd600193bcd1ce73bea1f07cee67b592ea7708af71a517f8","webidls/enabled/PeerConnectionImplEnums.webidl":"c9f54424a844df7a01eaac3ba3a96e5e31e2530eb99cca84f48a3d9d875f4d52","webidls/enabled/PeerConnectionObserver.webidl":"de1368051415402be718fb1a7b105295738961199d03a32233bae8a0c9feae70","webidls/enabled/PeerConnectionObserverEnums.webidl":"67e698124e7cd1f758c1d8ce2d5ef5f2a3cb818af4d08ee54dcdbc10cd890783","webidls/enabled/Performance.webidl":"7dde1a5f0a7d197e4477232b50a69f196d74ebba8699b5e424cecefb7ca0d557","webidls/enabled/PerformanceEntry.webidl":"d4287b10c20bd543e607fb717e09fd2f9fa510fa8d425187b78a5ec464649993","webidls/enabled/PerformanceEntryEvent.webidl":"36855fbb87f6ee4ab9bc99ece991c81ce1c0aa537eb9987f7fd4a5ce83be498c","webidls/enabled/PerformanceMark.webidl":"83d630e8efeb08b521194c98404029b4f495141a038269ee188094400adc8173","webidls/enabled/PerformanceMeasure.webidl":"74f29148a94dcd4881669a64857d13caf5a8aa295e8a0ae9a749be79e761fa67","webidls/enabled/PerformanceNavigation.webidl":"e2f8f4f77a5926932c56a9a9deb5c12c4991245c81f1a3f09d4ae494ca414bae","webidls/enabled/PerformanceNavigationTiming.webidl":"9995bfabffc7d7d23114ae7c5d4eee93048164da9b1e74851b518b069fd7eb29","webidls/enabled/PerformanceObserver.webidl":"bb1f4e05f7751ef85adc4b9159ba1c99610b90007ffbd627acc6ac1a7bdc017b","webidls/enabled/PerformanceObserverEntryList.webidl":"5917ca5fd5199ac3b527fbcf3d19f0885b9670d40bdb996df63c34537503c435","webidls/enabled/PerformanceResourceTiming.webidl":"8a0f4e08bf0288dcacf29b3e8270b8828a26b0a3cdcd3259c95e35276f6a82f8","webidls/enabled/PerformanceServerTiming.webidl":"2ea12d8606689422ba4cfbd3de676f155cb764ac83915f235c8dc119572a5713","webidls/enabled/PerformanceTiming.webidl":"444081120979dc63fa0f8f20b339ad6e2bd5460e25bb727c3a047cc394d528ce","webidls/enabled/PeriodicWave.webidl":"13ecbaad1289109aaf58c5ed2595face11563a921546c0ad812ba66e64bf38a1","webidls/enabled/PermissionStatus.webidl":"af7a7599374070947d2c8c1f0425363cfaf510db202fdec592b6c01a382e87ee","webidls/enabled/Permissions.webidl":"7567d31bd5dce5df70fc0c0bf033d1d02d599df1ee88352eeeff04150f863180","webidls/enabled/Plugin.webidl":"ccc55caf98f299b044eaa2d58edf49bf92c30319f64fd0dd9b4be1fdaa75a776","webidls/enabled/PluginArray.webidl":"56664598004a41d88f39a1d14efad836ca63002e01e9ce9e7a478503af67dc4b","webidls/enabled/PluginCrashedEvent.webidl":"4dc5bf4bd81716bbbf78a88b75ac76a163a2f25e508b4df60805870b8ca17553","webidls/enabled/PointerEvent.webidl":"842a273210f481e541db88187a4e4f506f9682ab27f4ada97236e6816737ae68","webidls/enabled/PopStateEvent.webidl":"b3fbde27e8a0990a9f3ee510ae077b4d73bbb0e6ea481007c3cb6dcccedad979","webidls/enabled/PopupBlockedEvent.webidl":"7097dae7f8bf471487ea5942b3747b5ae47aca54e111bc6cbaf1599e13d90716","webidls/enabled/Position.webidl":"e0455234c92c570ae8bfdbe2f535c62b16ddd339f9a82e4c4f945c04fa2776cb","webidls/enabled/PositionError.webidl":"b6158a0245dc08a95e13559a03d8ac1c5569b8d486c0fbca872f13dbb953e0ef","webidls/enabled/Presentation.webidl":"8bc67e499d9f99263774da2773ec87fe5ebfd38df4bec99983c9c6a213055ce7","webidls/enabled/PresentationAvailability.webidl":"0ccdb1da5aee3e5495a372c1310b2d4f483a2f92b7a6cd322c620c72ddf1bcee","webidls/enabled/PresentationConnection.webidl":"93f6218b08492ab8af703a3d1524e8d634a2724cdea38b5304089129ccf10d63","webidls/enabled/PresentationConnectionAvailableEvent.webidl":"3927bc5f09504bdd34068e018741ae66158fc442922c3f94211e2794c0bab240","webidls/enabled/PresentationConnectionCloseEvent.webidl":"e943f060198350fa90d509806b15e0ba29c694c6f96c70b80ba7878861b3e6af","webidls/enabled/PresentationConnectionList.webidl":"bfb59c582a8787c44f1dbaf29a50b40b754c9828093b8056ee20e1db902a4d97","webidls/enabled/PresentationReceiver.webidl":"faa276a23a21d8db39a07dce80a7a120e6cc0e2597b5bf3d4240db568bd42356","webidls/enabled/PresentationRequest.webidl":"669dd03457f5eb4ddbd6ce9ae8fcd02ccabfb062ae9322fe7e91940b3655af72","webidls/enabled/ProcessingInstruction.webidl":"c653d1de81771557a93cac5694336418576cce5a8358e40f089304d8adc474e6","webidls/enabled/ProfileTimelineMarker.webidl":"08414691af335e0f2bb906cf53cfec9a8723254ecc37f0e7bacf6b8be63c7f4f","webidls/enabled/ProgressEvent.webidl":"aafe0abe465e049bd95032ee52877aed82bff3dddaab231cc3eb71453184ab1e","webidls/enabled/Promise.webidl":"0196edcf454c2a67b8c81fab76d3522cffc8a593e014db2d997a6f5f0d725d81","webidls/enabled/PromiseRejectionEvent.webidl":"25accc9224ed7795778b4cc93b7f51b5b4e1ae0ce18f97e7a91e6b6cf02bcea9","webidls/enabled/PushEvent.webidl":"2b1fd7de0888b157ba25991c4e6ef4615a1276c2cce16c68d53f92f1eb4aaa09","webidls/enabled/PushManager.webidl":"a6fcf2d1eb32de1619f5f95bbf3b66635224c68496067e3002e03a6e972e4d42","webidls/enabled/PushMessageData.webidl":"72ce9e056c2ba9857ecaedda5362cd2d56faf161ed142296cb84def701a88f53","webidls/enabled/PushSubscription.webidl":"77d0d1cbd486f109ee2104aa3c23791b8094e9887fa517ac18bfe1691d3d6409","webidls/enabled/PushSubscriptionOptions.webidl":"817516cac055730ff992f8d972d3b752432ebab9b1903cfc18c8cedbd9ae7294","webidls/enabled/RTCCertificate.webidl":"10b5eb04b373caafe3fcff85601e9249261521d824128f876f2bdf8117951917","webidls/enabled/RTCConfiguration.webidl":"77029b6e5ecaf3a6fad064b7f183b3dae38013badc3fbb52e3ee41644121d943","webidls/enabled/RTCDTMFSender.webidl":"c39f43e55e99ee405a460f61b3bdab82c44dbdc99d4dd44d90d2f66e3c8c11d8","webidls/enabled/RTCDTMFToneChangeEvent.webidl":"d5c54f4fc2aa1085a5c966e5028a98865133f43fa537578e66f3d183ec3415f4","webidls/enabled/RTCDataChannel.webidl":"d4b3a63df4c2d934b9b0360ae4848a83806ba0de9057ef5d7b38f9054707e1e6","webidls/enabled/RTCDataChannelEvent.webidl":"4a95a226ddedfe4dcceaba7338343f8a8621023015563cf2f905c19128e8e7b2","webidls/enabled/RTCIceCandidate.webidl":"9c53b5ada7baaa7d79922795981bc6d180d425ceef2485898546cbf4cde05450","webidls/enabled/RTCIdentityAssertion.webidl":"fc8faa529cf633e6fd7b510599fb1db4c30a2d168f4a156515065cfa167d6d23","webidls/enabled/RTCIdentityProvider.webidl":"691b7c71765e7b8eb9750127def9a7221ea02c9c285a7fc70b43766203ba1a5e","webidls/enabled/RTCPeerConnection.webidl":"26a026f36525f1b6faaf74513f35430db3e84a58636bf76cb931f54fee4546fa","webidls/enabled/RTCPeerConnectionIceEvent.webidl":"a48cc1c8e9984364fcda93381a2a1b00dd2a38684e540a1482dab8218b4d6a1e","webidls/enabled/RTCPeerConnectionStatic.webidl":"df6df2f73a649ed1aff025c04a7f14fe4864bd48264e9752b90ffcb257e84321","webidls/enabled/RTCRtpReceiver.webidl":"167fa341b3f51c78c5bace58b083997eb4d909046b7b0028b4bd68d72289278d","webidls/enabled/RTCRtpSender.webidl":"4e500133b28cf3853a3fb836bdc2524998a8782070855f0f0bb2105a8cb66d40","webidls/enabled/RTCRtpSources.webidl":"a5d739766665a4f290cd121407bd44d23ebf57b869350a3796ac2aa315383f39","webidls/enabled/RTCRtpTransceiver.webidl":"86b7f1065a38ac894160798964bbb38f24136cac7b8f51d09f2ccf7f7af5cc07","webidls/enabled/RTCSessionDescription.webidl":"7ad506b114aec2894fa4c650d929e1cc3a1406e2388b9961607ff53cf2c192de","webidls/enabled/RTCStatsReport.webidl":"8921ce8843ba6bedb22e4c37241455680382449a50289a3476ce770a30f6d24c","webidls/enabled/RTCTrackEvent.webidl":"5f0a6325b2ea07859be497d968954f0a698c4d56e109fa1308fc9669bdc14b0b","webidls/enabled/RadioNodeList.webidl":"5b1751029f985b32667174c4414eea17b926ea681d3608bf4f15f084b0184cc1","webidls/enabled/Range.webidl":"9b3a888227ec17c4ba0eb48ba2cc4fb24d0fc3a61ee30643bb0c4e12a3544f99","webidls/enabled/Request.webidl":"f1929c2c4d6f8d19e592a0d7821d06613adc7a02926da489641ee7efb989575b","webidls/enabled/ResizeObserver.webidl":"f4a6a5b13d062833f2c5604e9eeeaf7ba9d2b5cd1d33005321e46bd65a0c28c4","webidls/enabled/Response.webidl":"333c54b567c87b4995268b608551055db70249f93c08c12b5f129f3a62ce34d7","webidls/enabled/SVGAElement.webidl":"9266973cab81785a2d9651a4bcacacf0df9c080f87ce7e20ca8662a86cda9ae1","webidls/enabled/SVGAngle.webidl":"2c611ab01465abec50c5d412f9f9b8d013af0be13613e55bc011746243d02c56","webidls/enabled/SVGAnimateElement.webidl":"406e108607cf6f6532fc02f2503e52c0651127c45f4aea2cb3a4a388c4ba6c1d","webidls/enabled/SVGAnimateMotionElement.webidl":"0b99671068057b224eb5fb40c2ca818ef89bcc408aad982bde138092f1412dff","webidls/enabled/SVGAnimateTransformElement.webidl":"c8c232b0c2193b259f024158e61c79756042e96eb642ce32ef83abfc00946f36","webidls/enabled/SVGAnimatedAngle.webidl":"1ec87dd46edb885b468de542e37b3a2ff3e69015b3c92386f92f1903f9222f81","webidls/enabled/SVGAnimatedBoolean.webidl":"21ca5be2d236ba2a8935532a82a7791cf921cc22050d1911706b13a6f40a60f7","webidls/enabled/SVGAnimatedEnumeration.webidl":"ac2483e79c8c0681b24b400e88f3490ffe040c50584f51e98533fc5fd64b8822","webidls/enabled/SVGAnimatedInteger.webidl":"1225c8d8f41ee85008eee904eac1e017a0f60762d7adb09a7ab467141535cf3d","webidls/enabled/SVGAnimatedLength.webidl":"ec75bc98faa3fa71fd96af7a4aab0f3bf982507360d9fc55737a8aa00526f93c","webidls/enabled/SVGAnimatedLengthList.webidl":"4a2c967bf7c3069567f53edc7bfa7baefc81985a76e82013fcbf0556de3cd7c3","webidls/enabled/SVGAnimatedNumber.webidl":"a352a8f78f6feb508c3139f8b129ec63288424fe8afb84abbcf73b24857683c0","webidls/enabled/SVGAnimatedNumberList.webidl":"586dec7836b1a38358f333637b3d10cbe44db1cb3e6527ffda21984912cc09d5","webidls/enabled/SVGAnimatedPathData.webidl":"9fd44f6b2db82cfa362324f1ae291214cfb3ee81432974e4f9b5767f4d6ed15f","webidls/enabled/SVGAnimatedPoints.webidl":"50a53c450b5e7a660f40abe303d8e99d9dba86a1b68143decfea8149dee940c0","webidls/enabled/SVGAnimatedPreserveAspectRatio.webidl":"f9d89696cefa023f366a95c43cfe7ddbbba069541e115baba0121bcb9d67835a","webidls/enabled/SVGAnimatedRect.webidl":"82b5590f298c162a3143db0884c11558256562c42740d263af230c058e1dd740","webidls/enabled/SVGAnimatedString.webidl":"538b70cf811953c09aabba7e3a0218df267e23bb3716fe972427abd27e10269f","webidls/enabled/SVGAnimatedTransformList.webidl":"bd33eeb6a4530cb1f1d4aee69996fb40a153a636124b233fd98b30a69c865da4","webidls/enabled/SVGAnimationElement.webidl":"2409dfa104150ea27ee52588dfe205153bab86173fa602b274a47791825c4fa7","webidls/enabled/SVGCircleElement.webidl":"af611f14ef46c012c4803c0712f7ac4293b7332fb0d718ce0f088c1b2f23179a","webidls/enabled/SVGClipPathElement.webidl":"632723812c80f2713beebf908830e6ea0a1dd18f1136d6e7c3d62db1daaa2365","webidls/enabled/SVGComponentTransferFunctionElement.webidl":"fd86f255607d5124e5b3ba4e94eddb4e09081be7acc70ecaf18a3b16147d5a64","webidls/enabled/SVGDefsElement.webidl":"a472683867e97fee7949177b855cbc8d00c0ac382df1307ad6c04f615cbbdc9c","webidls/enabled/SVGDescElement.webidl":"1e53672d52672362c5b24429554a346c02f88bf0af92f9aba1a765dcfa1f725b","webidls/enabled/SVGElement.webidl":"ff5e68745c8dec85d34e528a4689f311a3f013f0a1ec3f782fd132553a907004","webidls/enabled/SVGEllipseElement.webidl":"c409ec29884913a14283b120e7171a3fc6d00991d70c5c5e328f2fb6a6369388","webidls/enabled/SVGFEBlendElement.webidl":"a97a3542c0d6df30ead0ff7c85fc6621eb738cc058d381a9c4a14d1e2ff5dc07","webidls/enabled/SVGFEColorMatrixElement.webidl":"c4948fc95e2b0ac5c7dd749c33ed3f280d199fcbf1c1c5bec627b7945292ca1b","webidls/enabled/SVGFEComponentTransferElement.webidl":"afae71ba9759d1f64c84bc20461af3049a40871bbe311c84ce6d4206e373b51e","webidls/enabled/SVGFECompositeElement.webidl":"fa3ef383464e76b4c9d355a1205482f296ec9d2ea8064219ffc1647f3d5e72f9","webidls/enabled/SVGFEConvolveMatrixElement.webidl":"fa50facca3ff39ed8518f2544d7a00f9ed8080be6f55ca82c068908442d83446","webidls/enabled/SVGFEDiffuseLightingElement.webidl":"afd160379bdd740ee1cdb94c98d0c5a5f100005a74a888d95187bef9143e99aa","webidls/enabled/SVGFEDisplacementMapElement.webidl":"04de93553c74074f036b9b4ba2f9df5040eee50f5fe9c29b0ab7d37faa0be57b","webidls/enabled/SVGFEDistantLightElement.webidl":"ef9695659ef0fbc29d8a65618b94e273b7628a129b861c6fb591d9a8987c1d52","webidls/enabled/SVGFEDropShadowElement.webidl":"d2bceb961dd63c4a7bdd2d471c25357969f9275d22fd0aeeb490b5b31cb53412","webidls/enabled/SVGFEFloodElement.webidl":"dc1d87cc8b66c37700c4eb780efc5eed6852fc2110a36d6f87436cab4c602ab6","webidls/enabled/SVGFEFuncAElement.webidl":"be785a50252c031f4ca1527e661d7c2b755941f23e43e4e058059d65a3e58299","webidls/enabled/SVGFEFuncBElement.webidl":"23c0f541ee460d88c2bfffc23d39f0b2cf55afdcc166bf8d21b0c6a44027dbe8","webidls/enabled/SVGFEFuncGElement.webidl":"744bc8c3d1c94826a4e77bfb804ad15e261ebbb97a0b54449b919de96360c82a","webidls/enabled/SVGFEFuncRElement.webidl":"c9cc8f0e5751873a92d1c2dcab2abfb54eeba2f4fe29bd0444c3860ca5d6f62d","webidls/enabled/SVGFEGaussianBlurElement.webidl":"b57fcbd7010044f4f7b985660761295a011c120c1bc946b1f0df650c76ebfaf6","webidls/enabled/SVGFEImageElement.webidl":"abb94b92701be406254738f5da555d427ce22f618df430f56053436bdb601977","webidls/enabled/SVGFEMergeElement.webidl":"9469944946e6117fe2c9ad894f4791c87e389951d3a639b0ac167801d2fbabf3","webidls/enabled/SVGFEMergeNodeElement.webidl":"f1f8d479644ec523d59dda7e1091909a1e523af2ec8dfa212ecd9e46cdb69e82","webidls/enabled/SVGFEMorphologyElement.webidl":"6595ca562b5ff35c102b58d4db856026b29e4c39035428b243a090164e8396e3","webidls/enabled/SVGFEOffsetElement.webidl":"6f4c392cec4199615873b79141b89586394ef3d87ad226eada35e0f08dcf620a","webidls/enabled/SVGFEPointLightElement.webidl":"4a572696b33c47bf4449edf743df65ada8e755145cee81f03395a9450986e926","webidls/enabled/SVGFESpecularLightingElement.webidl":"403020eb2023ca663700c693a48c6d7469a09ad1e96482d3902642e4cd3e0d8e","webidls/enabled/SVGFESpotLightElement.webidl":"30cc640692270ad6f98fb7d5b786c0208499c13edae57e564829cbdcbca16358","webidls/enabled/SVGFETileElement.webidl":"342a723b07d6397362ffd31fd890d2754651465f703bd91e06440f6fec89b11b","webidls/enabled/SVGFETurbulenceElement.webidl":"69b932ff2f1fc73aa8256daa9c88b133aa29c2d6ccf44ebbd1a00055ef3a49ea","webidls/enabled/SVGFilterElement.webidl":"15ab2e501123bca1f8f8051891c91cc8f02399b2ecb607a5f4786bebdac34cfe","webidls/enabled/SVGFilterPrimitiveStandardAttributes.webidl":"0b690e40034014c00ce6870c62750735292e22a6f63f34fac3e8773fecfddbdf","webidls/enabled/SVGFitToViewBox.webidl":"c54c72b53fc99992fa17dfed0d4ef1159633c1a973073691c744b76e90ba39ea","webidls/enabled/SVGForeignObjectElement.webidl":"27312a4ce1f30c2a42028be85200b384808e7f9bf43e1156392ef4e4591711fa","webidls/enabled/SVGGElement.webidl":"d35dc8c24962a0a42dca4dc1242ac5561b76db6d730ce28edb601187d53b2923","webidls/enabled/SVGGeometryElement.webidl":"dd0f86c2571613a37c9be53298d86cfcd48851d2775270604eccb23891215f6e","webidls/enabled/SVGGradientElement.webidl":"47efcfa524e2cdfe2435862dfb30c7df990acc9909ba5958aa0f42b2a6a92bef","webidls/enabled/SVGGraphicsElement.webidl":"846e3cdfeadff07b5360f6870796ed8effe0df1a15fa74a359a2afa296497900","webidls/enabled/SVGImageElement.webidl":"cb24d5626d0634ad5e2d026b1fa50bf7410158f3535717ccb8f0828b86a5621a","webidls/enabled/SVGLength.webidl":"55eec15aa711a9e7b4936d51713a98fd584a7739152032c5baedaba2ad646dad","webidls/enabled/SVGLengthList.webidl":"ba84807f6a41814e2e3ee76d9ec2c77b60e7a19d7d8268ca644b5ffd3d429a17","webidls/enabled/SVGLineElement.webidl":"ebf5835ae85de91fa701dfd1d90c814f564d42726000cfb5e81755f8112650b0","webidls/enabled/SVGLinearGradientElement.webidl":"08418f12e42c67d57f66c63895d353b63a30e752fc81bcaa682dcc29972fa7f5","webidls/enabled/SVGMPathElement.webidl":"65ae7e78f412d13d434b023518f7a91ade30e5fb1445fb275616e1db158a1de5","webidls/enabled/SVGMarkerElement.webidl":"44b14d831193c7c8861e03c85558d215d54c01503a6335c2af7d3717dcfa73ef","webidls/enabled/SVGMaskElement.webidl":"2e9a8b5eddff4cd6f3daced2c32227e31a67032451506c49e8d45e8a80199b76","webidls/enabled/SVGMatrix.webidl":"2c36393352662d30b3e15ac98976d0ffbfe6fecb9bf9a46788e3748feb7d9ee8","webidls/enabled/SVGMetadataElement.webidl":"edefcf9243c063a58dfd18648b10be9516c798db0eefa08cf0843f0014ebb16c","webidls/enabled/SVGNumber.webidl":"c094b396c9dd967c23eee36cf78ea9be5d97df72b0b22177f5fdf6a7390e792f","webidls/enabled/SVGNumberList.webidl":"29e35160d72aa287675018cf85bcd35d1c08c4a1147ed3a241695697b1b2a5b5","webidls/enabled/SVGPathElement.webidl":"d3e339379a478000382a56d34ba98adc08a2c3c2fe1260937d9c40e8e265a605","webidls/enabled/SVGPathSeg.webidl":"aab6325878704a3a46567ace2757640c8e45f9e68e632dccd06d919b3aca95f9","webidls/enabled/SVGPathSegList.webidl":"e43bb7403e0dbc76554a7589f24db6b2c8042b946ebab71b210a30459881e972","webidls/enabled/SVGPatternElement.webidl":"577dc47c532c5936068309fd6bfc65d0bb21e45e2903cd4515f03ac39e556a50","webidls/enabled/SVGPoint.webidl":"bbd6730609d9394f7199b269f24cb5aecea28e8625794e47eaab414f67afe281","webidls/enabled/SVGPointList.webidl":"cf36eeb67bba98bf204b50620934a1d4f42f03c25e70b213e16b5b0bde31008f","webidls/enabled/SVGPolygonElement.webidl":"e902ed44dffcf2efb005ba2ff9ffffbb62d382e52a8dbb9a105abdb227b7403f","webidls/enabled/SVGPolylineElement.webidl":"1d2e524aedb66b056b69f8d2560fa3b68a8417411b16e07bb58f0f1628ec1965","webidls/enabled/SVGPreserveAspectRatio.webidl":"687f803cac4b9a6e7f3f32d8ede0d5d2cf838fa4b7a5abd063be28c976d09d13","webidls/enabled/SVGRadialGradientElement.webidl":"66586aba27c83dddb8646f5263e35ec841e72a0267824bf856d4a8fa055de370","webidls/enabled/SVGRect.webidl":"81c17d4961853662265c27acb21543baad83170b65096a2aa0186f5c811ab129","webidls/enabled/SVGRectElement.webidl":"75ddf7eda4a1a1ac1d4b243364e21d8fbc84b47fa33d936abe509995c683433e","webidls/enabled/SVGSVGElement.webidl":"8d544dd5181b8e851dd0f722b0b33579634f28f00dcb268e23fb1265008f2968","webidls/enabled/SVGScriptElement.webidl":"cdf1a3aba7db43ac419bff2831ad62b925c24410c3608b63953996d4d8842661","webidls/enabled/SVGSetElement.webidl":"858076ae56590ecb61aab88b746a92b6f161d90e7c78ffac4fc6c0bcaff6b1ce","webidls/enabled/SVGStopElement.webidl":"5a51ffa270957553fedc913848867a9f0786673c3111585a638c3c4517e5bb44","webidls/enabled/SVGStringList.webidl":"24d5fb5896875652f0e8f691a809ae21211138953b0d0fc2e5003a3b7a202463","webidls/enabled/SVGStyleElement.webidl":"fb96e6f37015f9d9a4f20fd91f5f6199e0e71c0c6875666753209a7415b810a5","webidls/enabled/SVGSwitchElement.webidl":"c9758f48f58a700705f56d4bcce9bb67def9f0cb1e8410018f95e0d83cdda80e","webidls/enabled/SVGSymbolElement.webidl":"3c3a9f9d778404f4082edc53b2a015b14be759392fca787e911535d4f4437ef5","webidls/enabled/SVGTSpanElement.webidl":"237383c44aaeb9daaf5839c91800355cef2488cb107c2d7afe7bdca73c01e7ce","webidls/enabled/SVGTests.webidl":"e41ebf9f26401ad603f11cae37b46ee0b0cf36ef0d10adf4a039eee1184c31b9","webidls/enabled/SVGTextContentElement.webidl":"3f009cf0d40b5ea4cc0bc3a1c29fa080d4be290303a5ee054d12567271cf4db1","webidls/enabled/SVGTextElement.webidl":"a4e13ba09815aca62014069ee79aa1fc32ceb1e2770f0c712bf11096ce30a55a","webidls/enabled/SVGTextPathElement.webidl":"717b1ba9ab66c3ed589a89cf5ace7273add4d6c8d9a2acf628bd36e771658a6b","webidls/enabled/SVGTextPositioningElement.webidl":"8d67f3364c487310ff034b42d520ebfda3bf8fab718aa0008f0b2cff668064fb","webidls/enabled/SVGTitleElement.webidl":"4de199bfc0c27e876a27b6016f8fbb33190fcdb73a521a9538f2d63f89337a32","webidls/enabled/SVGTransform.webidl":"d37e820b70eb0cabef9bdf2f3f659e79ee94c305848dedc686bea0b96c8fbdbe","webidls/enabled/SVGTransformList.webidl":"33d93445ef164886a04d30d47dc1e47a2ae8c7405c7b537b00919ec076c28c13","webidls/enabled/SVGURIReference.webidl":"1a209294dc3a93a82de934b06d8d2122b47a15a12033376b8b4581b4da857bb9","webidls/enabled/SVGUnitTypes.webidl":"94aab6a0c212cf5f541bd463100e0a91e8c3c1d2da8e450f013841c989cdf151","webidls/enabled/SVGUseElement.webidl":"57dc59cee19582a3f1068757b7256d8594cada661d349cb3c0ec5cb7fe6bbff8","webidls/enabled/SVGViewElement.webidl":"dcd8c5d4d96f130750b77a25f3014813267eeffd2f5486d6f1738ec98b998645","webidls/enabled/SVGZoomAndPan.webidl":"f3d3d76f88dae5a4ad43c9759dd269ae53afd1c1aa40c5cf7e674ccd63362c66","webidls/enabled/SVGZoomAndPanValues.webidl":"7b98dde6c7bb2937953f5eea85e7906845cf1d4d7615c281d54699eac7f89162","webidls/enabled/Screen.webidl":"edabc2ab6ac7a8c1cc3cb31310cade22c3456464e5be1521079bf869d0448fac","webidls/enabled/ScreenOrientation.webidl":"a150e228618f005cf574fad2928a0c621e3407c570e271a9c576c44ed3d43086","webidls/enabled/ScriptProcessorNode.webidl":"975e17ea75e47d41f7594c86c1e8c70fab15cd62d95247a731720cf97728d7ae","webidls/enabled/ScrollAreaEvent.webidl":"011178fe11784066ba040ed23c06533b66a9d6f7eee7369937a6732c02c15d7e","webidls/enabled/ScrollBoxObject.webidl":"252e511ca675b87288413de1cea0ad03ddcef85232d6bc88f178f7c31a4b0427","webidls/enabled/ScrollViewChangeEvent.webidl":"243bddb6bf78f5d362ac33ff57f37ea26111e72232675fcebe84d81a970d3993","webidls/enabled/SecurityPolicyViolationEvent.webidl":"2e77aa3d68aede50ae1f99f7f77050b249d706783c7492a59b0a7a9b4b82b0e1","webidls/enabled/Selection.webidl":"e7c9ce0ebe7682e465041703cf87816778de9d7e4cf1b402ff7d554485b720d4","webidls/enabled/ServiceWorker.webidl":"c82e31e1324c4441605a21e582b92e9d0ef36156d3a818f7ee7bcb5240ec05d5","webidls/enabled/ServiceWorkerContainer.webidl":"2da8d2ef384ede2cb0b09690628675c7bb30210b221a42c31a7ed964308f5aa0","webidls/enabled/ServiceWorkerGlobalScope.webidl":"9e00be5c419275c6082d5897f47f3e8f638b69b37ae0bb91da865adbf24cb13d","webidls/enabled/ServiceWorkerRegistration.webidl":"9349028080c0df9531a7e104368ec5b3250167e64a75c77a3eb4f34fad6b7e31","webidls/enabled/ShadowRoot.webidl":"da96cf6f2c1a871cdc646bec67d24ffe9345eb5bbb62634da5c9e7b0a5024d98","webidls/enabled/SharedWorker.webidl":"5f622c95284d639e7d0bc396d60b3e660eb655c0eb7a0ccde54e0b986f94df6c","webidls/enabled/SharedWorkerGlobalScope.webidl":"bf36b09c0cc5d6bc65f325ec6f6c5d6f00325a6c40802156d9acebb5197cf395","webidls/enabled/SocketCommon.webidl":"65872f202a5324c291c5499f8593ed4826911a077f4d1d8a114d564e65ebfbae","webidls/enabled/SourceBuffer.webidl":"a92034684a913805104d7371ad84684698321cade8072855bf837a43742d5a9d","webidls/enabled/SourceBufferList.webidl":"5dc259a31f77b9bc8a6125aaeb1238102235b5f23261b4282acc21888f69a798","webidls/enabled/SpeechGrammar.webidl":"6aebc3b030f5baf5abef93e32aafaa358f0de5494f273b0851b43e5ec15bd4fc","webidls/enabled/SpeechGrammarList.webidl":"0c2c2b01155a481ec45164eb5561f47beb177fc39ab13ce1b8066a22816ef752","webidls/enabled/SpeechRecognition.webidl":"718734f6db9e0eddbe0d78b23a46c60dfea1d6e64b87b9c617556b8c934171eb","webidls/enabled/SpeechRecognitionAlternative.webidl":"bdb0ceaa3fa8dcc053cf097c88ef93e16024ce65f1c6992771088a19110b6e3a","webidls/enabled/SpeechRecognitionError.webidl":"fc8aeb8170d4269667ab76d53d6fb4c9f358a9aaddee7b90a700d8b5b65362c1","webidls/enabled/SpeechRecognitionEvent.webidl":"2789b5157f7739cbcb64783eb1c7fc909ad3c28593b244817309260a8d9de16e","webidls/enabled/SpeechRecognitionResult.webidl":"c136902df06dd6c99837b2fea499c430165b4cffaa876af09023993932db33db","webidls/enabled/SpeechRecognitionResultList.webidl":"e7269b67251ec271436a8da484def7654cabf23caba6ceada18b9828e8e168d1","webidls/enabled/SpeechSynthesis.webidl":"bd2384a31fd4216a388ff58888679f2a27f1d2e98edae96aea069dfb8cdeee15","webidls/enabled/SpeechSynthesisErrorEvent.webidl":"1231f5651bd3440a59c967ce22fb56b53d2bca7a9c2d0be913642ab2ded65cd2","webidls/enabled/SpeechSynthesisEvent.webidl":"2c86b63898380ec9a3665f83a350ab964ae3de52073aa06de68ebe429c97fad0","webidls/enabled/SpeechSynthesisUtterance.webidl":"0c463f489ecf947a897e32cb77869ca61018ba53a503e9c43e9d194524f69c2f","webidls/enabled/SpeechSynthesisVoice.webidl":"615ca94184a3d9de46c3ec47f860faa275dd4607f1395fa2f2203f5a82330804","webidls/enabled/StereoPannerNode.webidl":"ba538833cc7cf33fd621838a349b01712290e5e53a00d8c1397c60b0e2249965","webidls/enabled/Storage.webidl":"81e3792a1c753157683441a44a0c23900c954eaf158204b3ff5e154eff37808d","webidls/enabled/StorageEvent.webidl":"c2a378abf1f1918d787fe0b38af8993e8e8dc83295992293a2f9801861ad623f","webidls/enabled/StorageManager.webidl":"d72dc2e1869068c8297f182c446375417f485c314ef5dd6b42fec20793b1cf06","webidls/enabled/StorageType.webidl":"4784de962657f20943274788b8118a4bb105113f69bef7c15accd9a9a1708639","webidls/enabled/Streams.webidl":"3ba445627077faa73b7d506ca76fdc5b9af608fe5d83b64f3894b9e6167cc7c3","webidls/enabled/StyleRuleChangeEvent.webidl":"0521ff622835d6e093b3dfc742d10e867b416246233b3979f995f21ece3e7677","webidls/enabled/StyleSheet.webidl":"5d34b67fcca9d7a0460d344e31a683e44aece4321d0c99e46ab3fc108edd7037","webidls/enabled/StyleSheetApplicableStateChangeEvent.webidl":"01ef38bbcdc8b59daa8fc455374270a606127e0cf3f528793635fa5788fdbd7d","webidls/enabled/StyleSheetChangeEvent.webidl":"82c65f78a3939d2e5e8ba012f854f13949c96c5157d67fa2cfda03527a705cb4","webidls/enabled/StyleSheetList.webidl":"10ab6f214b7501041e6ff1ff4ca0991e2bc32c833a09415b70d9c3f06b515bc9","webidls/enabled/SubmitEvent.webidl":"fd3cf63e1b988722d972384cdad5044da728ea616ac8b620022c604c6c34e4e7","webidls/enabled/SubtleCrypto.webidl":"8ffb08be9f2200fceda4aebd296d00ad478cbe402dc9fb7da1a8699d44bbd57f","webidls/enabled/TCPServerSocket.webidl":"6cb2948c47f24da5914e1bf2ec781012a73922a4cbbff4531ed61809b05139de","webidls/enabled/TCPServerSocketEvent.webidl":"3169fd04ae2c3e31d5c57f493c5247caab9dbbfa0f38a6088abaa4b35e5d41d2","webidls/enabled/TCPSocket.webidl":"278a817cb093e1b4c168cb148e07b0a79e209cceed1276b0ec2243d3de961c8c","webidls/enabled/TCPSocketErrorEvent.webidl":"639f7bf942b272983c2d0495d13c4d51e33b011517bad27930d4022d85719914","webidls/enabled/TCPSocketEvent.webidl":"c958fee252aa98f6eac35048964aeac905293006e0cf80c6845ba16000c91e79","webidls/enabled/Text.webidl":"56fbb7605981f8d363ca4ce2cf666180ad3afdd2b792022a47b02769fc1e9ca0","webidls/enabled/TextClause.webidl":"900118a0b65693a577b25a23522f299622f034de6d7d13a14c45abe967a56606","webidls/enabled/TextDecoder.webidl":"28d2750c80b7bc651a55a77ff02ba8d3992f15cd98b802711ff6189d95601488","webidls/enabled/TextEncoder.webidl":"9c6fec6dd1aae1154702bcf7fb5ca712db1281d08ecaaf97596a488a81b02f24","webidls/enabled/TextTrack.webidl":"813e1cc26284a67c61b045a3d9997d0957a7d232d8650157a322ccfbfc71d844","webidls/enabled/TextTrackCue.webidl":"9dac62a7e82c03cc914d4edec84f7c4c018aa925535041d99cba447c8158170a","webidls/enabled/TextTrackCueList.webidl":"68acd65d75d9cfdacfc8e266c3147736cef3b6d59f2cedf65480eb5a8c1a8af8","webidls/enabled/TextTrackList.webidl":"057df5f7bc9bf2b57c2db79ebb72ea6bd62474034279159c65c30a4ae934e4eb","webidls/enabled/TimeEvent.webidl":"f516b56d682f41ea4cfd4b79d44707e896fa80677ac0e6a53c0dd24cd43a4fd9","webidls/enabled/TimeRanges.webidl":"926ffda3eb7b15a1750a608351d12b1df624fdc5f9469c9bd278491d4d1a70d3","webidls/enabled/Touch.webidl":"93720f0d2b8b807bb2967de4fe8cf1ada71c2c08d42155022b3ec5a9acb11cc3","webidls/enabled/TouchEvent.webidl":"93bee04784f1c5dce705b782072abc16dc9f296dee06b72167e2accca4e22c50","webidls/enabled/TouchList.webidl":"e38500c028542915bd23a6a8fd0b69d60d70ee5ff72e0a0a67736763eada79ac","webidls/enabled/TrackEvent.webidl":"646d6266c3258dc2db8d5cd52ecfe54fabe34561b8f50ca49257f3898638f5cd","webidls/enabled/TransceiverImpl.webidl":"6a5a827bcf4a98741ff68a9a389bb38782a328a965b482059016476549d2eff1","webidls/enabled/TransitionEvent.webidl":"fbced41fcb7810b4c1b8c8d1d2ae6b93c0d57056372956d4586178e18dd1e433","webidls/enabled/TreeBoxObject.webidl":"9c7524b2984549e3308405d1ed2ea5a7bf1d1f91a5ac248802612d4321c4f501","webidls/enabled/TreeView.webidl":"f9fce08c706c9af4982e3af4ecd6be683dc6fae2ec00ca0d60cfc6f6afad59db","webidls/enabled/TreeWalker.webidl":"c4c41e63f6344711ece9127d0aa47a317ab1cdf033b8bc5c8e2457ccea7f33aa","webidls/enabled/U2F.webidl":"89560a2258259bf7bf3028dcb39f2fa96c08547cc126ae6489b75265b3341188","webidls/enabled/UDPMessageEvent.webidl":"20ef1b7ab382adb831261bcd2d1012c8d1ae4a86686a339241833f1747b646f1","webidls/enabled/UDPSocket.webidl":"1f4832f892dc5917bc94e2b33ae9f86fba17abfb2b68cb801d3ec557c67dad66","webidls/enabled/UIEvent.webidl":"baf73d89d59893db3fe46a65c1631d95412f273e819ba240b7c5df7ac32d8647","webidls/enabled/URL.webidl":"f2e01d246e53d2c604be77c24f4e8e0a9f49229ac6397418e2dc4df78816fb55","webidls/enabled/URLSearchParams.webidl":"ff1a908768d5a1caf4ab773f3060b694d4a7498d4443c2022cd36f527e70f84c","webidls/enabled/UserProximityEvent.webidl":"7b4a94b00c4228aa1f4f23173c81caf695c9a6fe2f7636e1bb6541337446c8e2","webidls/enabled/VRDisplay.webidl":"cbd85f9443b289a949143047e2a11e78a7876495c7cbe5d984820770f779cb95","webidls/enabled/VRServiceTest.webidl":"00bdca757373eb90f58747ca73fbd37ea2d3c9c1689c4b9747a3f2fc97367f03","webidls/enabled/VTTCue.webidl":"dbeac63c2c1e62eb7dd1271b9c64dd6e78ca4cb281ef5e780faab68b0b80ae8d","webidls/enabled/VTTRegion.webidl":"f27235cfdbc6e44dcd65b023e487e487b5ebfeeffc7aaa650df0cca650fab254","webidls/enabled/ValidityState.webidl":"49853d0c5b3b9036b1fd538535f69ebcb09decb13369a31bf0f918cce2c70392","webidls/enabled/VideoPlaybackQuality.webidl":"d5788b9ee029f65d00fb033b3a140e81b1a6b631ea0b27077c3459d51e766a88","webidls/enabled/VideoStreamTrack.webidl":"f3ae8966e8f43f2e7889bd201863700618e2261fc295967a4e83998c1f818c4c","webidls/enabled/VideoTrack.webidl":"3f5a8613457ba5167cac2d51b0d4713ed270352b555b302375581538cf3d5514","webidls/enabled/VideoTrackList.webidl":"5d7d92ffbb1d0e367220bdb2dd60b9a51cd76129205fc6968c46781b9999fab2","webidls/enabled/WaveShaperNode.webidl":"2414eb5bb9da49f46cc19e50f4a6f5daf2aa95d2808ec09b1d24b8e1e6bd2722","webidls/enabled/WebAuthentication.webidl":"7743c280e9089aad5c4e648598f753781e5c2190231f7a7fc954f4990d3c619e","webidls/enabled/WebComponents.webidl":"9fa5080f1e24837ba9020ed6d9cab2b6cea1bf0ac5f9663b6910047a73ef973a","webidls/enabled/WebGL2RenderingContext.webidl":"88cb334849915cee76eb9760e48de23e9be7033be024269f731ce8bb4de0bfdd","webidls/enabled/WebGLContextEvent.webidl":"d14a1221ec65fa3f3ec0aca9068c6ef34fe838b47da87451c5c3376c17100f64","webidls/enabled/WebGLMultiDraw.webidl":"64aa473f56eca1280d30a58ddff965bf44a75db2768c9e5659c0d9164e121500","webidls/enabled/WebGLRenderingContext.webidl":"55a1697e3d7204f8771598b265f45f00205f2980c8a32f46fe7508a456faaa5a","webidls/enabled/WebKitCSSMatrix.webidl":"6352f13d6a9a265a24d2c0208f515455068d90feeb1c5c35b03b08e5450c4e75","webidls/enabled/WebSocket.webidl":"b4a43d3b30a4746e7d37f210bb0eae060aae9fbd25b795645094c3adaff5e1bc","webidls/enabled/WebrtcDeprecated.webidl":"4e45cee6502ff5f367ed2d2d70c8d02c6cd2286399ba3216930017e0f88a1fbc","webidls/enabled/WebrtcGlobalInformation.webidl":"f1c928589b949651661c2f2175a71318da898a61dfa2134a4548979c585f8d74","webidls/enabled/WheelEvent.webidl":"e66dfac75f22f387d8800f262bed8f9775605bb558854a0363711fef8cd4b792","webidls/enabled/WidevineCDMManifest.webidl":"e8ddae9d39c447aa996f9c398cbb5ed25fe1888c96cf8cb3d7f9e4dcb572a4f9","webidls/enabled/Window.webidl":"60a84d6b49196ba529614a0f6cd867d2774140138ea2083842719eca1543adff","webidls/enabled/WindowOrWorkerGlobalScope.webidl":"f2105d8836ea6ce2a8efe34e3e0971726097e6a51b50c4e0e495591877c6781d","webidls/enabled/WindowRoot.webidl":"19ca1ac9641a219ecc3f04084c1605768a92cea39fdf0d87b13f1bed69197d65","webidls/enabled/Worker.webidl":"0bb49d29355c9d51dd2e0e075dc6b7718cadc4e030e823115c97fffdb6c7f8a2","webidls/enabled/WorkerDebuggerGlobalScope.webidl":"6a176eb8c9faf74ea2fb13c0ecf318c689d9696c5fae1ff57e67173a7ef41bd8","webidls/enabled/WorkerGlobalScope.webidl":"4f420dc5f52a620af17ff2aa13936c93c6547af2fe8a284e868525de1e417615","webidls/enabled/WorkerLocation.webidl":"86a85cead8f1ccc91357c29e5f100abfb7aa1a7254f4096c9f5a9ed10aeea5b8","webidls/enabled/WorkerNavigator.webidl":"8bb49d3460aa9580a53be991d3e5d1c38bc2217606c8a766744d33141cb2159c","webidls/enabled/Worklet.webidl":"c2b4020b16311557d11dbf40e473f1009d971d38b11f4a9fc4ff2433aa673c1f","webidls/enabled/WorkletGlobalScope.webidl":"a1fdfe1774a6c9fb84ff97733aa38f429d31d05317980a4d01f1d089abc01919","webidls/enabled/XMLDocument.webidl":"305e736ecbf2d1ce5d36e2f027a3f9063a1272708d1bf11912c852d003979c9e","webidls/enabled/XMLHttpRequest.webidl":"b194283955dc37eafa78cf486c141202b81b0e303d79d52c543208ade31b5f4a","webidls/enabled/XMLHttpRequestEventTarget.webidl":"518e63b2b0ca73e80a16bc2224fb8544a8d8cab091a768859041979f7c7ee1f7","webidls/enabled/XMLHttpRequestUpload.webidl":"bc484d3e99947124dd9a222dc2d2333728ccae2801c995890d8846ba8976be32","webidls/enabled/XMLSerializer.webidl":"debd3ca7717a6d768694c384eb1ae2c19be3c48a96f4ada25eb45682ce5432ff","webidls/enabled/XPathEvaluator.webidl":"ee62bd2950cd45133036f9fc3616119ab36eef1656019aaad096e1d90d63abaa","webidls/enabled/XPathExpression.webidl":"fc377e078e136b88d8b57fcdae3562766be19a07f9582eca9de938be5fc6aac5","webidls/enabled/XPathNSResolver.webidl":"aa9675d1c521cdde72d9240fb2aa2b419a6a88313697857925be5ff23152ffe6","webidls/enabled/XPathResult.webidl":"9aeee101e1c58a9e7bcd40bff869b6a1edf8ba3184b8260549fd21b5d5d0778f","webidls/enabled/XSLTProcessor.webidl":"25fdce9fa32f6ac0c2a757b9a0349319a0994cda61770bd9d90823b725ba25bf","webidls/enabled/nsISupports.webidl":"5a857b3c311298fd9b1a4de08fa4d8e0ee60ccb88d374d4a189f0f45ffd7dd51","webidls/unavailable_option_primitive/PaymentRequest.webidl":"5a227487e72dd7e855c22e3b30560e6dc76845cd0a7c5df97a30f7850fdc8a41","webidls/unavailable_option_primitive/README.md":"2fe458cfa8faba4b5a3ecf6809a538e219880c214e564a0272cc7c91994609b9","webidls/unavailable_option_primitive/VRDisplayEvent.webidl":"10a00f04eaaf1496d1ffa2fba048753008bee79ebbd2639516e73feca20b85ea","webidls/unstable/Animatable.webidl":"60e5b91d815300e767a1705002e5f6a7c6cae255a6a9d86ded56162f6e4e6a4f","webidls/unstable/AudioContext.webidl":"0ddd5ddb1d6e0403be97cef84fc95c1e10a7613d89de9dbf0a57a5d84dda07ef","webidls/unstable/AudioSinkInfo.webidl":"11d82876bf309bbd1da3222c2c647ef61af9e617431eaac9e9608bcc66653a54","webidls/unstable/Bluetooth.webidl":"fb72b2522c67d7cb3cacdd2d6c414d264d12f288230461dac39ba9d10eeb0a1d","webidls/unstable/Clipboard.webidl":"440eb20159569205332c7b593207bec62e8c5c276a564c7498f9647728bdf076","webidls/unstable/FileSystemAccess.webidl":"7c9e67bd264607fd9fba703681094e5d40b099d82a929ac1f95cc6d70e7be398","webidls/unstable/ImageCapture.webidl":"b324635b5585a2bdc24f213571816f7eb2d8fdd2af25e2b3642c887ea6fec8be","webidls/unstable/LocalFontAccess.webidl":"760ec6fc5d7af2e2a977043771b31a130df312ee4fe3ee998f7978aa9d529af8","webidls/unstable/MeasureMemory.webidl":"46091dd8ec8205e86e54515692c06446399f260612d8dae9e4cf191dc441b20b","webidls/unstable/MediaCaptureTransform.webidl":"cdd0d34238d839a0227a41b6a50133b79101ba808c507ba15c27898f9eccbbb7","webidls/unstable/MediaSession.webidl":"dd8554a60f7e16b0c2e592aa70b50b14c39ca4cb996aa85d0f3ab0011c80250f","webidls/unstable/QueuingStrategy.webidl":"ae2600efd82f8fe5afb072859b0c5796a2770dc55d74711f8d19df20687a9911","webidls/unstable/ScreenWakeLock.webidl":"ede7e4df35aa6504551291b7b7dce3e3f60b6c857e2dfa6be6d1c98f1b592c20","webidls/unstable/Share.webidl":"9ecad3e9c8f85502c002d699452151503041beed11f9763f9fb8209802c2c702","webidls/unstable/ViewTransition.webidl":"45d751be41cfea4ccb9000bc456e27bd252314bc1a98a5069fda713befd83252","webidls/unstable/WebCodecs.webidl":"74e517302e935c4d99172fca3d3ca71b6dc7407f12ad109672cf99ac50f56ba1","webidls/unstable/WebGPU.webidl":"95bd3792994086a885d6892737f7cc590dd9fe48652fcd4f29a88d71b038f107","webidls/unstable/WebHID.webidl":"a8b6fc4f7801565026d310d8f06cad188faad9335ee8b6374b547410981c5978","webidls/unstable/WebSerial.webidl":"7f4c5f90647084e9afede44f9874d513a714d46fea6769095313e07fbe4366ce","webidls/unstable/WebTransport.webidl":"24df187fbb64b43a20b8650ea6e9543403e7f54b919108b4b86a6a7108e5f5fc","webidls/unstable/WebUSB.webidl":"c09980878e761daadd0793838dbf924998bc71621652d6fd41b5248f0df973d9","webidls/unstable/WebXRDevice.webidl":"bc43fe1f2aa0f099aea3be7b221007a2187a1a8b5f54cec5feab6f2cc754527c","webidls/unstable/WebXRGamepadsModule.webidl":"44910c516b1d3d63837994c4c721317cabf1a574b312efa1b89ed23651828c50","webidls/unstable/WebXRHandInputModule.webidl":"7d112e58485ed2f5a1b7389806018ac06181763557374b7d63bc5727254fade9","webidls/unstable/is-input-pending.webidl":"6314c3e79f6cec902bf1be616e644a6207f634938086e6446e5e7b3f0090a71d","webidls/unstable/scheduling-apis.webidl":"efa9de7e7429b699d72b4b39f0c6fd4be3cda2b7619665958cfd645b865c1701","webidls/unstable/weblock-apis.webidl":"0baab2f729c2782520432008a9afa424128f63c4e5baefec8ff910ee3fc2b33c"},"package":"50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f"} \ No newline at end of file +{"files":{"Cargo.toml":"937e4f5391781dbcf923c386847e88cbd965f6eadc61098192b99b17fd353e35","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"8c3d4c072113f0b5baed2713ea41684cbbafff8bd02fd7a5571d3d0757b739bf","src/features/gen_AbortController.rs":"e93623bf39fc0511d7108c542e729d0d6dc4137b3c4182d9a5f0577c02af4e0f","src/features/gen_AbortSignal.rs":"2540fc31634caac12a37f5ae7ef79c82bcddb87496d1d05fa244c282ab4183be","src/features/gen_AddEventListenerOptions.rs":"79d1838fdf9c7ecae11c104531f3628e572f38eb1d0d9c78b7ccb8045680263f","src/features/gen_AesCbcParams.rs":"b8031b752d0a5ec33db88d2bfb7a057bc4f9bd6685cd9d7f0886b19820e0e685","src/features/gen_AesCtrParams.rs":"3f26a558e16b224911576e611973a17378d9b9a1516d62e45752ca7542800be9","src/features/gen_AesDerivedKeyParams.rs":"60d1af3927b2001c3eceb7e8305179bfbd05576f64e43d22984d07212103435b","src/features/gen_AesGcmParams.rs":"28148dccdc668504580fe3e7007aa1c36f9397649dd80f6b91b554419f635bd3","src/features/gen_AesKeyAlgorithm.rs":"330a337116a187da4244a588a8f4672e96185f26cc87d8bc55996047e7d3fb04","src/features/gen_AesKeyGenParams.rs":"4b6abfe93ae32b6e0b268d2634440f0c910acb0a5d7b645b860844aab5879e91","src/features/gen_Algorithm.rs":"6971b54561e2ac3b910b01c06671f9d44b95a1873c36a476d9fc18447f3994a7","src/features/gen_AlignSetting.rs":"48fd57daac22fdebd11b151ad67e009a7df7b1b40f240e29d1e8acbbef2093e6","src/features/gen_AllowedBluetoothDevice.rs":"73b7c21b3b5705eaf4148910de28cdacf7cf66123e47f8b856d3270395a7e6aa","src/features/gen_AllowedUsbDevice.rs":"abbbff27e31b6d35cd22c279140608cf9a1e00cb9ad9a49b0444da7077cc2522","src/features/gen_AlphaOption.rs":"13c34968e30b6a2efc69a7efcbcbef75f0df1f6042e2b0b2c1f0ba8eca40c6c2","src/features/gen_AnalyserNode.rs":"96a3842731aadea282699276c27902be59e21c3bf8fd622815240e8f52fb919b","src/features/gen_AnalyserOptions.rs":"3eca2be4f0a8fed62a7fcc32a4a21c4cd65a9f8a24035c5f576d9e27c420afa1","src/features/gen_AngleInstancedArrays.rs":"09fed73d98060b7f17fd16a2be385b4171bc7b42ce20a5094b4c69cb73d4fef9","src/features/gen_Animation.rs":"558aa77beb07e8dbdf43c5fa0f34768e2fc98369e81e755a0cc0955f1942346c","src/features/gen_AnimationEffect.rs":"38f6b41f392476aa5ebb33e737ef04047ebb4b695a82c621fdedbdd75cf1696b","src/features/gen_AnimationEvent.rs":"e0283b83a782ab911191caee377f50fc6043cc50ecfb516b5d71bfb8046af2cb","src/features/gen_AnimationEventInit.rs":"487bf61e0ad7ac83a7b3a7f956058daa55bd11dd422d70b8d2dccaee22deb768","src/features/gen_AnimationPlayState.rs":"ff0ca3274d65f1eb12c62c2fd5b8e873bda54a9f094272ce11078c1c645403bd","src/features/gen_AnimationPlaybackEvent.rs":"4313d4a2f3b80094b214eb5800200e72894e63bf4f37845bc72fa76ade04f33c","src/features/gen_AnimationPlaybackEventInit.rs":"8f48b01b6093f99ce2c0150419570c6a7dfd010ff13f199d89335f49416909e7","src/features/gen_AnimationPropertyDetails.rs":"29e47cdf6b61666ada2e30b5db53e6d81915b7075bfdd786346a3f776612f291","src/features/gen_AnimationPropertyValueDetails.rs":"1cb568581080fd4a18cd7081f92a47bc329fab230e9fcb6c4eab6d34f7fcde0b","src/features/gen_AnimationTimeline.rs":"8c53820df95fdf79146ffdc682b2b97ec95fe54ce73b6f93f73ddfe9f34f79cd","src/features/gen_AssignedNodesOptions.rs":"365536e63fb1b9a1be0ca67106aeb6367267c1fdab0ac5c144362cf8f2a13482","src/features/gen_AttestationConveyancePreference.rs":"4d3db99abeb3e9859b133644ff3e687ea6c2ff89e19c6d73a3c28dc736a7f28a","src/features/gen_Attr.rs":"f271648a8cfdf15af9793511c348be635b0e406044aef2af71b5a241b8ecdae9","src/features/gen_AttributeNameValue.rs":"073c9f4db5c3af4544360832dc2dcd5f6915060478bbfd9f3d62336f1c608aca","src/features/gen_AudioBuffer.rs":"64fcbe25f39baad00d5905bce4610c01e536deb007a3ec44c3acbb7dc73d4397","src/features/gen_AudioBufferOptions.rs":"4935887e4e96d33ccb39e74fdc7ce5f0309e79c4f772bd079aa3c00f67641420","src/features/gen_AudioBufferSourceNode.rs":"ec7a01ea15d3d4f65a557045d24df11accf0fb3aac43233e5e4ee15d29b114e2","src/features/gen_AudioBufferSourceOptions.rs":"c9f4ab5d2d0532bc0478b1baa7bddfee0d5cc66f004f85951bdf0c244aecf032","src/features/gen_AudioConfiguration.rs":"1153391354ef7ad9b0d16ff2bcb56f5c96cc598ce286e9a5e91b864122edb689","src/features/gen_AudioContext.rs":"71ebf333adabb96aa99d55e679946814d16741d178ab51b6917efcb6cd4d4a99","src/features/gen_AudioContextLatencyCategory.rs":"2390689a056318f2bbf060ee67501858c0ba9f8d82f0af5ae01f202264ae5d00","src/features/gen_AudioContextOptions.rs":"8c613322037bde7df6226102f1e8b525965ba6f05bab5bc3c2cfe8c4708b0d75","src/features/gen_AudioContextState.rs":"82df1d0270b9e46f1b2a098e43a64408355bf31525e41e1b4e5672b1ef3d864d","src/features/gen_AudioData.rs":"98814aee5ddd1a74dccc7d24efebdcec2b8e87b3217f4e13f62fa07cfd0e1e90","src/features/gen_AudioDataCopyToOptions.rs":"c234528888483f5365124f5b8735e93b3e7a62df99d0811caa77b1908a5bcdf3","src/features/gen_AudioDataInit.rs":"0e1a321016c9a4c6a69472dfa3c2f3d890049e97d46482820cc4b91f5d3adb09","src/features/gen_AudioDecoder.rs":"23f2314cd850dff151fb9195188ef99ee6bc0be260173374821c0b5c1550604c","src/features/gen_AudioDecoderConfig.rs":"8dee543d4d8ebf1bd0d6071d646a1007f49e39121dc55b0ecaa48d312ed2b77b","src/features/gen_AudioDecoderInit.rs":"d8481a22e424969cc18c79cace2f8d9786128f482c8d4a5ea58b92bd96d0a498","src/features/gen_AudioDecoderSupport.rs":"9659f0b764bf91c662a97be008c3f91316b106ecbe055774167e022bc8b5c156","src/features/gen_AudioDestinationNode.rs":"f37dc515a38e8a9b4b5d14d72c96020533c14a3006721eac9273850bf9994def","src/features/gen_AudioEncoder.rs":"b8a6751dff88a6186802111212985ebeabe8c01983a852f6ffde6ec0cec0f1b1","src/features/gen_AudioEncoderConfig.rs":"93822a5969626e3186dbc215dac0de0416bca01cec4356d8df3368727bf48608","src/features/gen_AudioEncoderInit.rs":"a4e8e568d1daef238d40689f0533980c6898808c19a556c5550f5f4bee19c70a","src/features/gen_AudioEncoderSupport.rs":"43b468a08b42995f2a25ba363ed88cf22ac420186d25d038f7d0f8dbafb1fa37","src/features/gen_AudioListener.rs":"83e6c0132513831ede1933a6c14593f4140e35b59b279da7a6d02d2a5e3b83df","src/features/gen_AudioNode.rs":"57a84b0c8ff147c19ea273f0ccce95202c94b1ba3bb806199b414c8ea3c2b7d3","src/features/gen_AudioNodeOptions.rs":"733205b3811aaae5ef87a0097e72190dacc1cbaa5f37fb04270bb2ee14692d86","src/features/gen_AudioParam.rs":"75b13e6ef26607b749cbc4b4694424bff45a9065debfd34ee7203675152529eb","src/features/gen_AudioParamMap.rs":"091328e5ce3248b34520aa5d700de7d135c1f31d77ee50bf7b61cb3e34c45fb0","src/features/gen_AudioProcessingEvent.rs":"f5534edece040a7fa43dc9fcebec75f6882e833a3580039c6fe95693ab84e1a3","src/features/gen_AudioSampleFormat.rs":"4ee3d125206c2114f653222973683daee264439f0c457c83586af59c2fc1d926","src/features/gen_AudioScheduledSourceNode.rs":"f3d2661edba2d426da34126b5d8ba2dec36d9969fcaf2f0b7f00bd9b1855b158","src/features/gen_AudioSinkInfo.rs":"945fd255af6df9b7931344ab080829896459e5cde3742136c73a130cbb0b1ca3","src/features/gen_AudioSinkOptions.rs":"eafcfb9ef502a810e5f9097e78b5afb4fb6366841a80dad416b32e2119e4ef83","src/features/gen_AudioSinkType.rs":"71445dbe9c69a87a4fb93806d088905daae78281eea431ade19d79d0425d56b2","src/features/gen_AudioStreamTrack.rs":"83ef9e410255564263683b2c09273a2ed83e4ab7bd1d562c2009e6fc57cffbfa","src/features/gen_AudioTrack.rs":"64b31ed517e28b1f8049e5087f2cff321c4aa84d209de30e2dfe310e4b42e989","src/features/gen_AudioTrackList.rs":"da5d6cff9f3a83231fc164a4cf1daecb9a84623056ee5165701bece3e2d59067","src/features/gen_AudioWorklet.rs":"e78246281bc7e0c5df102022f61dcff558f23e2aef770e126f756ecca14c717f","src/features/gen_AudioWorkletGlobalScope.rs":"1a21260d0c8c6c97f60b2dd703a1df4723611b017f3af74c680bad02fa2a7769","src/features/gen_AudioWorkletNode.rs":"7c2ed263240c9164b35a3347704b625d5c5c0e463f56044da9d66b70869fbf1f","src/features/gen_AudioWorkletNodeOptions.rs":"1e40b79c52e10b3c595aef5a258d6c91ae596adc1f981f91d94e89d22e94da31","src/features/gen_AudioWorkletProcessor.rs":"ab0df7d00d4ca8b69c3f32a05d200bf1574d9a2874083ff414fdfb569ba67744","src/features/gen_AuthenticationExtensionsClientInputs.rs":"c55069c8ed2152a223c700afce71a4e7fbf5c8fa9f28379968662cb8a2bc0265","src/features/gen_AuthenticationExtensionsClientOutputs.rs":"5f552aa22770d0c69a597b0b4e94bb29dae353d742d1e2f4ca0a34b641c89265","src/features/gen_AuthenticatorAssertionResponse.rs":"6214681778015bb0aaf52990fd487089aa8daced4279197993ac779bf35a48d5","src/features/gen_AuthenticatorAttachment.rs":"e1e59a560c9a232f98823ed981c17106951a848ea2a53adbaf88a8ebfacd7495","src/features/gen_AuthenticatorAttestationResponse.rs":"872fd2bf7bab942d562826d6a435958f42c174a013f4f4005706cbbb9a8d1286","src/features/gen_AuthenticatorResponse.rs":"a21b9521fecd8514058109706ef6bb9115c1ab46658d181b152ca068da2723e4","src/features/gen_AuthenticatorSelectionCriteria.rs":"e82d483047fbb2da43a0c842b8bdedb372485eae7c6f69b6491d6bc6ce71bc6f","src/features/gen_AuthenticatorTransport.rs":"b729e2f5274c438d9f079d7b5ff6a10a8003d1afd91124cd05596ea8302b1fc1","src/features/gen_AutoKeyword.rs":"4a25ca00cbbb01bb4d929a8cb4ede84c1c7e0189ba8d08cf5a399afdec285194","src/features/gen_AutocompleteInfo.rs":"bde29b49864d60241502dc9aed2f874b41dfdd8463a2f770a74c305704b16d60","src/features/gen_BarProp.rs":"6755b9acba54f5cffe7f3ef49fdca90431da4471f58dcf133fb041f72a412a58","src/features/gen_BaseAudioContext.rs":"fc5abb2e1f1df21426b9eaa4db8d13e9d4a381aa2a0322111a844fb1adfef427","src/features/gen_BaseComputedKeyframe.rs":"1b2ec6cb68ab3d9ac00b5300e394b0dbed3d00ebc39959b3f7b2af69fc09739c","src/features/gen_BaseKeyframe.rs":"eddc814f28053391332bb3f3654ee9bfef47bb5d1280ca99bb78311a62599d25","src/features/gen_BasePropertyIndexedKeyframe.rs":"3bc3659dd22321348b318c032e2db2151a4ef65cc9b8ac8fdef372f81c13ac5c","src/features/gen_BasicCardRequest.rs":"e79c4871053b14446134c4bd5314b392479d53f9ec16b155e14a9f11d692b70d","src/features/gen_BasicCardResponse.rs":"48e4a18a505c2dfa3481613ee58ffa09d99504314c900903dd62fd27ccc56f82","src/features/gen_BasicCardType.rs":"d49e9147cb92bb6669f54bba3c45855e11d3857b6f193f847f87dc07149f3519","src/features/gen_BatteryManager.rs":"dfa8b5732f83aa78b56b3d6f4386784447d8fb7a6d4443a9bc8e6acdd4335536","src/features/gen_BeforeUnloadEvent.rs":"e68501edd489f6e31193ae54290fbf1865a8bc8936d5544e71b4a4ebef3fba5d","src/features/gen_BinaryType.rs":"360427cdc9b055f54add20fcc12fceaa2ebbf0f1822a4c2b34797cca86a444cc","src/features/gen_BiquadFilterNode.rs":"5c858c3a00024c64b4be5cf87546097fef6d05ce8ffdbf7329e7dc111851f301","src/features/gen_BiquadFilterOptions.rs":"02fcaea7715f34576972e104c8f00d893de5847f5e94a2e375994d38d50465a5","src/features/gen_BiquadFilterType.rs":"795510f7935f68f2350bf816ead5628db823bad9a24ad3dac1f1c0db2f6d3bd9","src/features/gen_Blob.rs":"ffd40c12401320c7cc23dfaa93bd7213cb3c132621b313c29ef0395dc158b9a5","src/features/gen_BlobEvent.rs":"baff7dcbbe67e52bec86cb306d49f871ae2fc95c8242878472568f72d5cdabe9","src/features/gen_BlobEventInit.rs":"21c7fdbf19d082605038d68872c23ce8e7dc3e79ee628a6c38661c123f2cb283","src/features/gen_BlobPropertyBag.rs":"f801cf6225e048372b2e4881940e84079c6867f1fef83beb035d12c0991ff79f","src/features/gen_BlockParsingOptions.rs":"ef1d9e0063ff23388ff6100b52456150d1442aadf2c7d74a6210fefe7f394b65","src/features/gen_Bluetooth.rs":"ce3891a2593a55eca37135466c0457c64caca2260f1969e595188a98b711acf6","src/features/gen_BluetoothAdvertisingEvent.rs":"7a8ec7c52c6f29771e38e3b5b849fc7aea4365a9d2863820c8e331ee3501e1a1","src/features/gen_BluetoothAdvertisingEventInit.rs":"6231f227bebe4b9ec6dc66a79fdfdf4a7c87210e5aa4fd52da815dc70e4a3e9b","src/features/gen_BluetoothCharacteristicProperties.rs":"ff5aef6e0939619728b1845689a8a4f578f90bc8e39f65e10b8dbf1652c39b43","src/features/gen_BluetoothDataFilterInit.rs":"b53193470d13c7376c4cb5967708e8888154e846a8ba260c6c25c4bea9c47e56","src/features/gen_BluetoothDevice.rs":"64528244f6197a62210498ec5bc58427230f501bb592995d6d4b1d006b8bdfd7","src/features/gen_BluetoothLeScanFilterInit.rs":"c3c9c0f1e43ff1fbee480cd239b542a1d1af4320888a5a55b58d541707d819f3","src/features/gen_BluetoothManufacturerDataMap.rs":"eef5c40f060cf6656ec698f84663597fe7c933e654908efa98b0e107fc048d32","src/features/gen_BluetoothPermissionDescriptor.rs":"4b53775dfdabad424ac54b34cccdef70fb358de7e632b4a0368045164291713b","src/features/gen_BluetoothPermissionResult.rs":"b894d5889b8ea549d61a0f96380c31b3e74a33a71061782a2788b6fe7a0205ee","src/features/gen_BluetoothPermissionStorage.rs":"ceb60f3464549d52af8c234588059c213f4715a735778457cd17ae7ee91b3f4c","src/features/gen_BluetoothRemoteGattCharacteristic.rs":"fb5203a6a107831b9a8a780aaaf7839c9ae252e81e43370f4a321f64c8120587","src/features/gen_BluetoothRemoteGattDescriptor.rs":"9b652f6b71ab1a685a70921bb6d8e47ccbada02680452c52c7afdaab8d7afe60","src/features/gen_BluetoothRemoteGattServer.rs":"1e840a8036db44e7d65ab2b0ee4fd4ba5609fd8902c0a9e8a48cd212a5e412b5","src/features/gen_BluetoothRemoteGattService.rs":"328010445712ff840a8b7d76d0ef04b5ae8bd453ad76b1bd0175916af786a5f5","src/features/gen_BluetoothServiceDataMap.rs":"526e5ba1d91cf7210121401a701ca49da9f3da6bba8fcd77e5d49e4c16b8ff75","src/features/gen_BluetoothUuid.rs":"92701eea940a85d225227c957554b117118d814a76a527f2a8887d6cf14b23d9","src/features/gen_BoxQuadOptions.rs":"dbed98f4fa5cdab046b41a78d3d61278beb4426b67a7070aa10c0896a7cb944f","src/features/gen_BroadcastChannel.rs":"a12dab1d0324304202e709a265d11e4a32998be75debbc261824ee1635a4ace9","src/features/gen_BrowserElementDownloadOptions.rs":"b43a6b9e970fc010cf273e57b2043ca9a470d4f81373fbd70c6d818a383acfe8","src/features/gen_BrowserElementExecuteScriptOptions.rs":"652c3bd7317b096f3a39e911678017cef7bae83d2f2f9445f2f1d29d1908e5eb","src/features/gen_BrowserFeedWriter.rs":"e4cfd730cb527f6b06c9e2b437ffa7e39262933b96cd6745b964b37649df389f","src/features/gen_BrowserFindCaseSensitivity.rs":"8c11b091b1b4044140d209a1e04ae65ca5af7787909423158a0176f13a25fa1e","src/features/gen_BrowserFindDirection.rs":"e36f007317d046e1eb84965e858e8b147af8809e1b588c801bd8e664b65e3c5d","src/features/gen_ByteLengthQueuingStrategy.rs":"2e96362f6f82a53ec24ce0547632513a2609f7d3dc6aa40979ddff5991976cec","src/features/gen_Cache.rs":"afb56d598487c61488d4232f3f606914c0d0870a325ecb3a6bd318bc98ae57f1","src/features/gen_CacheBatchOperation.rs":"df4885199844d3e305d9659a8efd3d5109b3bb07d8041c90d2394ccb804b130e","src/features/gen_CacheQueryOptions.rs":"8c4eb4b3df6aae66c88d1fff9b696bdef252d2615b2105d079aabf49c9ab6a5d","src/features/gen_CacheStorage.rs":"79a77de4068d05ea348665a42454cb83b5764ea9be917d7ddb5a3f94011324d5","src/features/gen_CacheStorageNamespace.rs":"48cc76a716c3cba09cd6bb91176c28887c6df089595d69bd914f9d8902d2db35","src/features/gen_CanvasCaptureMediaStream.rs":"fb045b40794ef5e2a3da6de0e9862aa351a7c92dfbec58e556be2bda78f1d6c8","src/features/gen_CanvasCaptureMediaStreamTrack.rs":"41907d63731bcea426a7cee6c27eee166032af245c101497d339f3e1b47b160d","src/features/gen_CanvasGradient.rs":"7f845aafd61f217457d3ed03b7758b92b5b82479739d29ee536390974809f8d7","src/features/gen_CanvasPattern.rs":"5f1424f7207fd8a764db62db3a4c52550bcb014dc1aeb1719a82a6d80d3a7937","src/features/gen_CanvasRenderingContext2d.rs":"008ecdb8fe84131b13a24db7b6b7036d8f2fd48f4eb402762f5a74361d6d3bee","src/features/gen_CanvasWindingRule.rs":"77cefc02d417772b8130f5c91f2c50426b13e8a81e93f1196469c36102794219","src/features/gen_CaretChangedReason.rs":"7006fee015c9e687f00f49ab5eac5bcfd7d88b4ea02f29c17c21cc6accb596da","src/features/gen_CaretPosition.rs":"4eb685d65afe75026cde61b8b4cd15cc94f1cdc60a2d5a397480553c58602e69","src/features/gen_CaretStateChangedEventInit.rs":"915bee887e5f3f83b0d56c69de9f0a2a8391a13a4198efe550b2df2fe8e7b6fd","src/features/gen_CdataSection.rs":"c89ea5eae00ec9d19a0332151ac366cbf7593d4e08b60a2230841261864f482e","src/features/gen_ChannelCountMode.rs":"ba87a770bdca27571c0019675136b01e9ce4187723288f6c4ac9d8680bad655b","src/features/gen_ChannelInterpretation.rs":"7ef32012ee4319177e411323a3d39e816064a3bf2c76ff7f56277c098b8dfc0c","src/features/gen_ChannelMergerNode.rs":"82259412fa3828d5a2638200830a0c9f86678cc8caa6056c66978308c9e646f0","src/features/gen_ChannelMergerOptions.rs":"f858902ce95b422a98f04038e2d3b10af13bba2a70c65907113f16ce5337eeaf","src/features/gen_ChannelSplitterNode.rs":"081c8908514f789625656331e8fb8fdfb04b0c0f909c0f9d3e432563a1ba8e6f","src/features/gen_ChannelSplitterOptions.rs":"14812d057a886ad8c2a10bd69f894821cab2a9b3d0ee4346fe91e29b3b9d4290","src/features/gen_CharacterData.rs":"d4ad3ad16304937bce684d14ed780036671ec6692e1c467cafc1a8a4fcae5b42","src/features/gen_CheckerboardReason.rs":"515ad8e54c013ff3306a521539e8a4f1b049d3bedd1288e60d01087b770b9149","src/features/gen_CheckerboardReport.rs":"ec2bd96a6337ab90d9e738250d487de483a643e6892350d4cf84de4c4ed70329","src/features/gen_CheckerboardReportService.rs":"41b2b85859e7c4488b1700b8045ad578652ca74a9ff92bab8baa94e7ff8546c0","src/features/gen_ChromeFilePropertyBag.rs":"474e9a1438748cde81565ab04aa62aec31717d480b3fb226bb6feb8afcb75aa4","src/features/gen_ChromeWorker.rs":"7bff8a9a179983aa26a17b0194e54dfd82564074a7caac5c2f24379d8cc8289e","src/features/gen_Client.rs":"93f391c9a7f68bd9010dbfe14c2d6ce99411b499e1b802e0782c7189824a38ee","src/features/gen_ClientQueryOptions.rs":"b097377303c9e31942a8b2e2c89e66dab1006a8e35d4a225424e5e52f029d05b","src/features/gen_ClientRectsAndTexts.rs":"60c91c3247b1c57a7fc9e268a0fd9eac3d092b25dc44cc0fc28230a920ed0baa","src/features/gen_ClientType.rs":"a993d26987688f0f0adcccdc6f7e454b0f6825109c5f48fddbb88d04f847ce20","src/features/gen_Clients.rs":"53c51c3f2f6cbad020b33bd45d4af75d2bb0889a9be7425084a5a8c1d031054f","src/features/gen_Clipboard.rs":"a609ade26f2c3b90b4dda6b8890240be5d1d4c903d7311f41650785a8256da17","src/features/gen_ClipboardEvent.rs":"8e57b7c0c0b8d8118f94b475dd9f8c81ed28f36e7a29a69f7fb3d3edd61f7534","src/features/gen_ClipboardEventInit.rs":"69b0d180e2bbd98d3d2f63ccc6c4227ea625bff92adcd0faba36454ced9d9ca4","src/features/gen_ClipboardItem.rs":"0757c396862782e5dfd879918067140ada2360c6310f38b2573029c1514a00f4","src/features/gen_ClipboardItemOptions.rs":"19f35a28d4cb0fcfe21cb4ce0e4edc304ba58f35f0e8b1187f212abf83c11733","src/features/gen_ClipboardPermissionDescriptor.rs":"a72fb823f1700c60d74c9ec4743fb4d15cad86fe7fe5da1a047ddcd3fa45085d","src/features/gen_CloseEvent.rs":"2cba52c53ac7b6fb8e6f152f30d54fb8f9009684ce63b286250a942cac971841","src/features/gen_CloseEventInit.rs":"5947b5d0cbc86c0d70402152279dcd8f58f3696a0728f47a8494a0862aa0a3c0","src/features/gen_CodecState.rs":"289686512c0bb6f188b29ac9a71d628f5f96440277c82fea4699f3330a3360ac","src/features/gen_CollectedClientData.rs":"970a7a54b138df25c3fc95c4cb1710454c915ab9491c2f327fe5a5c1ceae7bc3","src/features/gen_ColorSpaceConversion.rs":"653730d79a912aac1f87998a7d7b39aaff83ba7bd7e376d14db00b8e4ccb3baf","src/features/gen_Comment.rs":"f36ddc1c763d44f3b7cd406d740482c7e0d51d9ad1f4123634be59831fc50d11","src/features/gen_CompositeOperation.rs":"cf9aa8f73ad59136702222d1b2dd5573335bb82961eaddbb0a4825b411713502","src/features/gen_CompositionEvent.rs":"bc37f7c7e4e1c632f446e75bf1328fc17013910aaa3708f03f6c5f2db3290548","src/features/gen_CompositionEventInit.rs":"22942ad98f52bcf41b958c95fe342684fdbe2917762871a231dc2d4ce8b0b1fc","src/features/gen_CompressionFormat.rs":"5d576695994027c0c94e9d09f5b93c6dc2b082443c1e5c29fb24379cf8fdb726","src/features/gen_CompressionStream.rs":"4fc2f9c86fbc7b4ffb2e6f6b96a5ed85e82b323868e2c6d75fd14cb1e885e292","src/features/gen_ComputedEffectTiming.rs":"6d092206ff79ffd1c30c251352e8deee8e62e0a08261896b182533a43f822429","src/features/gen_ConnStatusDict.rs":"7c2957024814773a23d01696e4ae963d22cfca1f63769479154ccea94215e206","src/features/gen_ConnectionType.rs":"e6e56569fa7541ce4f9aaab8083d543fd447467cb36ef456d85f32bd8d33c6cf","src/features/gen_ConsoleCounter.rs":"f8cf2341830b026c9ccd8fabd672aeb94e0bfeacb2a86ee39694661ed9368106","src/features/gen_ConsoleCounterError.rs":"08ec0e5d232a4dc77bcb1ac20f687d83c58e4704af03867ee930ff34d0478f14","src/features/gen_ConsoleEvent.rs":"87c19f73e208ad7f203a275518afcb2914114af93edb6d812ed0e08f901530c3","src/features/gen_ConsoleInstance.rs":"0956be3c5df0f3e97ea12b38eca5d83ea8c78bed5425ee16b18c76257c525bed","src/features/gen_ConsoleInstanceOptions.rs":"033a7f39009e0a91135cd6de63c78aa79754d78f63f872fe232bdfe35b42f16d","src/features/gen_ConsoleLevel.rs":"20931320bf448747a668bcef04b60f8c738633bffc2b613a1edc86072ce362ae","src/features/gen_ConsoleLogLevel.rs":"6cd7165ba98b61d84a94f196848d086f20db9c3b42e14186dfdde203f8bf0e6e","src/features/gen_ConsoleProfileEvent.rs":"1224b2be97747c23a6dcea63101a9b84920cfbc8ea5422380b18e8521fe58803","src/features/gen_ConsoleStackEntry.rs":"4a5a7e43e97e4bad51857335f580145e672721e2b848d361ff059aeb8d2ccd6d","src/features/gen_ConsoleTimerError.rs":"2b3bf42e30dc6448c5505a3832e1484e8d2bac3b58d7aae6e476bc3cf19452be","src/features/gen_ConsoleTimerLogOrEnd.rs":"43a8f05640bbe3fd0eb676afa8a40b48ed553c3db3911b3346ca616526123a31","src/features/gen_ConsoleTimerStart.rs":"4e67dc757ea324a22f0afd7d3f96ef7e516caa3b1d1e98a0ea6a3fa41999ef34","src/features/gen_ConstantSourceNode.rs":"6b5ef2fba89a757c9a774822c1754c97175c5bb8f2e45e3565934e45f955a09d","src/features/gen_ConstantSourceOptions.rs":"1b5abb3723b7c2ad41cf5e17c523ff912b4e38788b544d783801c4a1c9854dd1","src/features/gen_ConstrainBooleanParameters.rs":"de495d0f1e4bd0876df16bf96919cffc2441046b0befe9b20fe4dcf8146288e0","src/features/gen_ConstrainDomStringParameters.rs":"6f8e175cd33ff62e139a1e92e1b87d99df6ed0f317c82242ffcdbaef52a3f328","src/features/gen_ConstrainDoubleRange.rs":"b76545b90b74d7ef55cd0464591edb3c48df577154a274dd295b3c839251133e","src/features/gen_ConstrainLongRange.rs":"ee730a6268f4c41a757c42071c7d22b66fe5fc53c6d838c9633bc2891ffb30d3","src/features/gen_ContextAttributes2d.rs":"26c39bd07490b7703b178b824cb9d758c8e00953dc7bf32cb0e99cb03556ce7d","src/features/gen_ConvertCoordinateOptions.rs":"a0739f9825f6f86ca8d3912b496d34782c87bf426f9b32d69729da088b8f7982","src/features/gen_ConvolverNode.rs":"0170e943dda5e557e97885e778510d3ed4578b554c3bb6043d3b9d667a0e6611","src/features/gen_ConvolverOptions.rs":"c20e1230aa3541ea7a5c4fb3de7bf419aac46dc82ba2d7b52430acd9c5d467b5","src/features/gen_Coordinates.rs":"0362a23495b736e4c86708866453eb3f168cd39d71586f21b9780105fcc5909f","src/features/gen_CountQueuingStrategy.rs":"7fe3325ab3de5ef6ea38a53f957adbf8d580bd2f3438827b5e6ac3741e95e332","src/features/gen_Credential.rs":"ddded70cc2575c15db40e12cbfe35f3ab4deb94fb52681ab81066f0756f58e31","src/features/gen_CredentialCreationOptions.rs":"5939e418096b553695091984984f62d26a4a3459055c811f191d68af40b6b1b5","src/features/gen_CredentialRequestOptions.rs":"ab6f8540008e0d76c81ff7e6b196ea8ac9ed7a40b8c75cef4765604c6774ee92","src/features/gen_CredentialsContainer.rs":"ec133a72849d444c7ac8e2be04e2dd7384ad04b2a7d4c7927b4d9eafd8bb8f6b","src/features/gen_Crypto.rs":"6ae1152ebfc6c06a5aeda4275dd6f983012359b8b91049bfc6d5dbcf0b42db83","src/features/gen_CryptoKey.rs":"8142c9721bbabc6e2cfff06fdfedc8179958ef85854c5d9d3a8141d1cbbadd6c","src/features/gen_CryptoKeyPair.rs":"b84360bb0ac394381377f49c9e14ff98524d353a3d6fcd39deea40a88e659ba9","src/features/gen_CssAnimation.rs":"b89ea2db873081e7bf3443894352e759112daa9bffa97eb0a8009a38ff59157b","src/features/gen_CssBoxType.rs":"5bfbf9397cc00ae6e3dc0e5ba06d76c04e8052d43eeb0ec8be98032501cb580f","src/features/gen_CssConditionRule.rs":"b9b1179b25f4a94aeca592d0a831c2a7ccb34c7f079b37f3d02819be3407ec8f","src/features/gen_CssCounterStyleRule.rs":"ad0be1c8ec0f863e54050912a973a9d0c2a6cb5cfb8909f18d7103c7a3177074","src/features/gen_CssFontFaceRule.rs":"76abaea1622a7d541349c1baeee1827c2395c10b1795372040d3013f1d52cf4a","src/features/gen_CssFontFeatureValuesRule.rs":"331d61d8c583836e465b5f13b353b36e63cb9ba8a1d657c11603e742711a1a32","src/features/gen_CssGroupingRule.rs":"1b21020cc17aa74947c9771310279ba0de5dd990d9bb961716fff228cdf5657c","src/features/gen_CssImportRule.rs":"daf9172224e2d3397d4c34d6a09bba433d6c4f39a9be60f70daecd4193fbf0fe","src/features/gen_CssKeyframeRule.rs":"4638a3a964704f3bf5e8fde66d5f963a36edfb9ec7c31b979f42379af2385117","src/features/gen_CssKeyframesRule.rs":"116b9e591c9788a8f4e531f1980cc47832c7aa06a0b0961f071927cad5e4df11","src/features/gen_CssMediaRule.rs":"4d59f3424ce083f75db3524513b32c4e5e8e0a29cba796b53ed23e04af579cf9","src/features/gen_CssNamespaceRule.rs":"94cf7c7e1cebd8df2fca2187f7bd8a80dcd85c595c413ae19c2ba1576c2e20b6","src/features/gen_CssPageRule.rs":"ded12ddc5fe551ddda61d2d0890bf5bfbb0b8b36a6601c68cbac52a557060b03","src/features/gen_CssPseudoElement.rs":"bb0aa5e33a7a8a675ea4bcfbc9c0d2e1f3fa1843d86b8a91a7abece3db778b0f","src/features/gen_CssRule.rs":"aa74335aff29a73628c67b14f46e29c42141d6a3f36bd27623f9d3a368983228","src/features/gen_CssRuleList.rs":"08b0d5eaaa7e09523b6e79ed67d780c3f3474b351773b14806684b8878a494da","src/features/gen_CssStyleDeclaration.rs":"b3348d841df8b4fdfa3207ef5201ec0becea52c2e7d1c00c14daf1d736c2e72a","src/features/gen_CssStyleRule.rs":"b1127dd913947876d45822a862ff2df12a1e5595ed3eccf99b9283d8a6d7f671","src/features/gen_CssStyleSheet.rs":"bf41ce72b272720972cdbf3be536dc64ee950c57c59e131d7d975c94aceb824d","src/features/gen_CssStyleSheetParsingMode.rs":"cbd3b161f205a443cd9b9bc0f31a6c9d213c902f128d8623bd7aafc2e5c33774","src/features/gen_CssSupportsRule.rs":"b0784a3832bef9af1882cde3b8d129224403d184fb08423a2f8049ead2adc75f","src/features/gen_CssTransition.rs":"9b666bdc016c13028ac30f6e3e6780ee725f4123f6cfab306da831fe0bb2dd2d","src/features/gen_CustomElementRegistry.rs":"18e18fe08ee429e769558f7fcb3e851a57477ebb930a33c9aae8bdbc69c41c99","src/features/gen_CustomEvent.rs":"99c225a5f332bf497b5afa9ca60f105db36c2b57efc270c688c23e47bc0d1e37","src/features/gen_CustomEventInit.rs":"32b95effd707c2c65e35262d3191dd2876d1f0d82a7402e80c53fce1f0766dca","src/features/gen_DataTransfer.rs":"cc93e717e1f2e66f03c5eab713952c6a91a160b868d1081f59c935eaa156cf58","src/features/gen_DataTransferItem.rs":"12a6c4119689328bb5594dcf40a9b63172f4d329d55b23e59eebdae8aa0da4dd","src/features/gen_DataTransferItemList.rs":"26dc140d5c0df3d4438f0b6da9675cae9d61dd3919b7b1919c0ccad7ec19bdd1","src/features/gen_DateTimeValue.rs":"bc1fdfea44288c74fa6d1a5218f4c19a88337aa8cddc5b25fc11869207fce13f","src/features/gen_DecoderDoctorNotification.rs":"ffba0a97060386071dfb0ea01f4526dd1fff5f3965867ca184abee5d26103058","src/features/gen_DecoderDoctorNotificationType.rs":"b55fe8e4f0ea8d2a0a580d38666c391482d0e3078e67b244c4cfc3989a260803","src/features/gen_DecompressionStream.rs":"318ffa3d7c28c1c846517bca03d9d649d435b2eff58eaf16635723f9a31af560","src/features/gen_DedicatedWorkerGlobalScope.rs":"96578a5e8a269aeb63dcd60b058bf3f8458c4107238e3c6defc2d45712a15c09","src/features/gen_DelayNode.rs":"35e7e6af363c85304df5c05229455184529fd469813a2168aa247e3e2e694762","src/features/gen_DelayOptions.rs":"f67ec541ada14d02161ec9c5f3e28e5a5b9668408482edf50cdf44c28a6cc0a2","src/features/gen_DeviceAcceleration.rs":"48470403673a9872fac1e5e81a8a343835c72f868d82cba5089c2a5687f2c84f","src/features/gen_DeviceAccelerationInit.rs":"6348af9f56b1b2d6614a72f29d46b00cbc7ad29c0214fd3c4ab3d202b2ece98e","src/features/gen_DeviceLightEvent.rs":"e4cee15b6ee3ebbc3f09327ebeb7fcddf06796527117b6fffa956f76207f5699","src/features/gen_DeviceLightEventInit.rs":"5b77688eab5ede129325063739cf9d0ad9407e3b8120cb9a153e558e4bd754e4","src/features/gen_DeviceMotionEvent.rs":"50a2fd97f8e767af589afb363491e2b46f094e81c5b7efb896235bdfc0d4bf45","src/features/gen_DeviceMotionEventInit.rs":"fce3c65c5622a420c3b44ceb0bdca2c2e118a9831b25055b3b6978f800a6063f","src/features/gen_DeviceOrientationEvent.rs":"6bf6c75bbb520c40ad55403e33693860f7c20c4cb460ae63beb4740ffe3a0629","src/features/gen_DeviceOrientationEventInit.rs":"416305d0f2453dffccb35a7e109d9eb881ffb93648853660b76d2ba4aa5609a1","src/features/gen_DeviceProximityEvent.rs":"1f9774f313c0b6238dbf07db99f3778d93954d18886327888e1a004bad2bc4b9","src/features/gen_DeviceProximityEventInit.rs":"3fbe9c34993d917d3be67316ccfa158e37d9f143eaf9f54d42b799c3ad568eac","src/features/gen_DeviceRotationRate.rs":"fda4720a54efe410fc043c97777d19f634fee56d11abb39ed7f48cbf159f4138","src/features/gen_DeviceRotationRateInit.rs":"74b18b8db0a0c4a727c857e6c2ef183022207c9d7d0718300a0a3cfa334fd754","src/features/gen_DhKeyDeriveParams.rs":"ab98a6ac96801c2ed04c112c5895c10386884264d772a7afad0fc5faf2bac62c","src/features/gen_DirectionSetting.rs":"649103ca0104b17d42175eb2c720ae880a4c49ded179cf2e9173b328d85c227d","src/features/gen_Directory.rs":"676d19ae092ab20787c82f7702d4f806121f6097200058cebb32a129be6e625d","src/features/gen_DisplayMediaStreamConstraints.rs":"fff2a7f9ac235c24f1619490397512c562bf6336bf37772977bd78169efdd880","src/features/gen_DisplayNameOptions.rs":"aeb36164ea21c53dedb81ccda9eed723fa8bf119809c9538b170c60c85b3a2e5","src/features/gen_DisplayNameResult.rs":"ed1f6b757bac7a916ca368beaab808242fc547241e805af37463bb5d067e811c","src/features/gen_DistanceModelType.rs":"3ec072394e165022bb428e7f5fe33814a69ec6fbc7ca8c121c346d01effe01e9","src/features/gen_DnsCacheDict.rs":"2321572217ce877b8939699154afe6c433b616cc9e16f4db654772b96e69575a","src/features/gen_DnsCacheEntry.rs":"0ad82465778a66cbe76f7fa75ffdbc9927c3306e56a99ca775ae26f9abd4ed3b","src/features/gen_DnsLookupDict.rs":"664d17117289dd5e44ea8d96f37f2b9277764997d895e610289040099cad8632","src/features/gen_Document.rs":"1e8cac11133b93d2c7202e2b8a24f7409821f2c4e33d724cf817726c5e338714","src/features/gen_DocumentFragment.rs":"178cd4cd3f1c86333f5a7e649ee04fcb7c6878b6ad6d5f59ad7bfd0c640b53bf","src/features/gen_DocumentTimeline.rs":"9a4b1d746cca866634bd781e5143668412c64b9c1392ab0c59bb7d84dbff9600","src/features/gen_DocumentTimelineOptions.rs":"3508efbe9cc4eded432663564f5c71e7d6cf2a03ab390cd2f8461d2204028503","src/features/gen_DocumentType.rs":"825c05808ab210957d9d379921747ab64b29de6194f72f0d69db180df9d19ae4","src/features/gen_DomError.rs":"057483b827b45aee89a26e894bd0b25caca44c39f74e715922d1cfddf4c7edf4","src/features/gen_DomException.rs":"2943c46f0da528e820356299996c48d0f248c0d9a59ab839e3957fb64a997353","src/features/gen_DomImplementation.rs":"a4657e003af5d78010a8d98ea9a68fc76f8c48baa01c2921070d82c9e48be0bf","src/features/gen_DomMatrix.rs":"289889707479f48ee01b3b18a4e43aec2dd497b11934f429aa93efe414b401c6","src/features/gen_DomMatrix2dInit.rs":"06efb39fada6e987cdf6c9a36b1241a27c7818725468026e9afb49f79835ba09","src/features/gen_DomMatrixInit.rs":"6e72dc38f6532cd5bdb5dfe6df9f24346850676479a3682302f2c13f464b05f0","src/features/gen_DomMatrixReadOnly.rs":"cbb55db46ec4ed483c63f862d79771afbe2a9560f81bcfcf351c151428725bda","src/features/gen_DomParser.rs":"e299ad75f73114da571f37b63d8be9b8e630c2fd95b7c6b4d5cb452e3726829b","src/features/gen_DomPoint.rs":"0a95d76ff8982a4aefdb100f8e17db39738888e4d78dba08dc24c6eb75af090f","src/features/gen_DomPointInit.rs":"3a75ca23258f4a1f2b052af176288b9cd62cb8a19291121f298976921cfe8691","src/features/gen_DomPointReadOnly.rs":"fd0d3f9d0d6f9fb0256a098832c5f3d638602a29a89e93c562896afba0848570","src/features/gen_DomQuad.rs":"685e12bca5354f41ef1e62e464d431909a0720b78e61348db679d7e1164a513b","src/features/gen_DomQuadInit.rs":"6ed79540ef5b5a8fdb5feb315923f7a6a0267d1cfa2d3d1e14d0957634cdee01","src/features/gen_DomQuadJson.rs":"ad845059c6f4438aeb32a951ef984f552dd59d6605999a18734c3d62d06b37f6","src/features/gen_DomRect.rs":"cc892a305c0639a7b2ce180aff2708ddc8cef4499ef74b19d2da29bca3051b0d","src/features/gen_DomRectInit.rs":"548c703eb5e17bb5a3a4f90308000a49bbb53be144640d2bd5c5b99b09a9a294","src/features/gen_DomRectList.rs":"cfa519f05431bb9e63e5ae7755fc3a617b45a06790c5d2ca00319e8abf4c22be","src/features/gen_DomRectReadOnly.rs":"fb836db1f8b8f2fa09432f2a2fe4650e35c04452fc3148106699b5d71c4690fd","src/features/gen_DomRequest.rs":"c2dec73a76f48fa9d4a575be70efec82249a7c549a3bfb970e4e4159f5caea13","src/features/gen_DomRequestReadyState.rs":"a4361128dac131bcc2512bbf6db9c08b4312e8db72c3684cffbea6af0c43d9a6","src/features/gen_DomStringList.rs":"c3e70df285cff62a10c2faf605ca531a19ad8698ad91aa919354d4b16928764a","src/features/gen_DomStringMap.rs":"4cf80b49e99e25d079ba9f5c858814bd8f421308a4cf6b718955bebaecd703f6","src/features/gen_DomTokenList.rs":"2f2cf348621da9a4ed46139c2957a2e9d322e2684300f661c4abf1d37729feb2","src/features/gen_DomWindowResizeEventDetail.rs":"af3edf71ae8aadc285412d7dab07f39d4301f6ec6f59c4cd784db27cf9db0ace","src/features/gen_DragEvent.rs":"113aa5d3cc60f084030d7c16183b254f304a80771e299d6a651a905b711afeae","src/features/gen_DragEventInit.rs":"4abfd006af8326be3c039e4a59468463209496409e211cc5307c50f11efb6b80","src/features/gen_DynamicsCompressorNode.rs":"b83933de65bc45fac94351f30d80339f7ff2cb744a349b9536cf900142bf6a6d","src/features/gen_DynamicsCompressorOptions.rs":"12c66c386cce94f5e4da5ab59eb58fde276d1b23dc757c3cbfec468d2f2b216b","src/features/gen_EcKeyAlgorithm.rs":"177be560f40286e9e395cc85c269b6f5e72f9eb8da77a8275dac3c926deb2ae4","src/features/gen_EcKeyGenParams.rs":"c4fa44046626fec17e23bb004fff61d7b3cfed569e0f6f9bff71784e287757f0","src/features/gen_EcKeyImportParams.rs":"46383e050ccaeebf9e5d4428bf9b99d59bcfd3cf00105bd903c5b580dcd974c2","src/features/gen_EcdhKeyDeriveParams.rs":"dd4c6c2a2c41ee5bf5db62f3d289cc463a81311705873afe74461de9d46f0624","src/features/gen_EcdsaParams.rs":"16d7483506778864fb59a39e738c0d2dc1f7404729d6e2ccef9d3321570c0f82","src/features/gen_EffectTiming.rs":"72de93b3e0c941d917ee59877e142f40d3caaa6ab1221f548d2616af33f10c93","src/features/gen_Element.rs":"7db96bde4b8390e31eadae63cdec1ff4a9ca9e41b08d05e6cf8c4fcb1cb75836","src/features/gen_ElementCreationOptions.rs":"a29ce5f412c9a6b78a5fcda91cc4a4fbcf593722858974de3312180b86860bc9","src/features/gen_ElementDefinitionOptions.rs":"7f208f69134710ce8d926d21f3c99f8f221ed8544b542fdf6adbb07b0d00b29b","src/features/gen_EncodedAudioChunk.rs":"ee6e56d4310a6aba4fe95aef09773a4bc6bedbe8d3d07cc8e4ede154004cb714","src/features/gen_EncodedAudioChunkInit.rs":"a0b944f3a8b357256f4de1e948ef7ec705096d84e35151127e5deb5ce6c0397f","src/features/gen_EncodedAudioChunkMetadata.rs":"87b5da25e9dae9190b3ec489228ac739454fc88311e4ee9cfbb94c703f35113d","src/features/gen_EncodedAudioChunkType.rs":"31eb58ee6fe36c12caccaba0e5bc7418d20d5a05edacfcb64724442da0e5ac10","src/features/gen_EncodedVideoChunk.rs":"86f447488b37213b2746f7f2fc769b467b089351c75d6aef7fabf42b31230613","src/features/gen_EncodedVideoChunkInit.rs":"de3734ad8d7ed72b1119004e0619b5d831431e27fbe46a3dcbb0ef88c1777a69","src/features/gen_EncodedVideoChunkMetadata.rs":"c17c23a1bf0c458d6f583a4a531f4e42442eab0d76efe2e0db1340bc918f51b3","src/features/gen_EncodedVideoChunkType.rs":"d11b01b86f834ec32df5bca56c0aec69ac1304ab60709a361b1888c590a7509e","src/features/gen_EndingTypes.rs":"4c6e006e9da24e8070dcf6bb55ef945b4712828518b13bb1a696327aecaec301","src/features/gen_ErrorCallback.rs":"b2806dffe62b1824ed365f42c1b557ce57cbf2b27dce5053da9aa050bf2fe809","src/features/gen_ErrorEvent.rs":"91a80f8834192f299cedcb599aa184d2b8b41bdb1aeb9733c89eac82610830a4","src/features/gen_ErrorEventInit.rs":"bde9d396b2a365c286fcdf4f5f5e4c7554aa268334998696317cdd699f7167f6","src/features/gen_Event.rs":"c69549e7e14ef25d63cf5ecf8eab9996030118001dba8d277ab83436fe78af68","src/features/gen_EventInit.rs":"d89b8b3f8fa593c62c80184c382dd23d0ab174466262bd350933c13e13212db2","src/features/gen_EventListener.rs":"276d66f93e624e13bfb7e9deeee6eb513138a86263312d022174748050149d26","src/features/gen_EventListenerOptions.rs":"5eb262af294477ad4bde966a3aca2a001eece6619e385ce434cae41705043991","src/features/gen_EventModifierInit.rs":"98be7e2b2bac7ceda61caac73c016cb117c347e82f9e3fafb0135a36e003578f","src/features/gen_EventSource.rs":"98f5a34580e048afcbd9c314967fa130255a559bb151bc9bde375f4c24c1aacf","src/features/gen_EventSourceInit.rs":"271e499ec5ed43abf57f5cdae7c0a0b9e824ee63fb46bc5e7dff23bd65d3a0ad","src/features/gen_EventTarget.rs":"bbc16c538a25e3b8f6c1d65d6f4f9ead60ddcdb735e2435d5e2716eabe293b08","src/features/gen_Exception.rs":"7b88818a827612d04260d40289d96fefa7e4699dee9d77c8ac336dfa3c1ed478","src/features/gen_ExtBlendMinmax.rs":"3d33ddb26d68e21d2c2d484bce57122cac8ccd48788b215b5237fe5d638401fa","src/features/gen_ExtColorBufferFloat.rs":"8a567f81fa8d802cc82353f2a89ff74776882cbb1528cf200a9c4bd40fd4fb51","src/features/gen_ExtColorBufferHalfFloat.rs":"fce64d861eea29a2b3d02f8e218a5fa688d5853ad4ab4392d7236232cd332973","src/features/gen_ExtDisjointTimerQuery.rs":"517e487e7140eb059e3dda794bb2879fba8622edca87f1b9769b85823fa58d62","src/features/gen_ExtFragDepth.rs":"ec85d616c9821582115294004b2bee5ec04a1da9e31a13b7a6a9764a0a9985d7","src/features/gen_ExtSRgb.rs":"64437a88c9752f13d183274d67bd38e911de8fff4929df0609146f85c599cef0","src/features/gen_ExtShaderTextureLod.rs":"cd5657c8fa8fa8207c5801c7a4fb6d8cd1daebe8e87302e297c2b68eae1adc89","src/features/gen_ExtTextureFilterAnisotropic.rs":"d5717d45b4d1d007c2b2bed01dc4967abd21b06f9491f785fcd24dd34998b0bf","src/features/gen_ExtTextureNorm16.rs":"08b0da1131e769343cdd199b93d11b93f988ad2a8de39b592001f96772e17d07","src/features/gen_ExtendableEvent.rs":"d6bda62e5673870d29b9e5aa0874ae785446608c2222c6502bdecd522277f319","src/features/gen_ExtendableEventInit.rs":"33f3851c7ec7155359e10474b6c42f84225296a4e00a4ef16d94ac849a433558","src/features/gen_ExtendableMessageEvent.rs":"aa0700e0bcef80386a01f39b8081263b2ac65f7f967c7c295b8ff4c51fe8ee6b","src/features/gen_ExtendableMessageEventInit.rs":"29af87519be542bbe00b2d050de63d4f307379803ea4cbb6f0f4568aaa09ebbe","src/features/gen_External.rs":"c55bbe708bfd8467ce3e1a3802ca220a17f19a8bad00d67318db6067a16275b3","src/features/gen_FakePluginMimeEntry.rs":"d78635795534b757a5e262b821768ff85091cf12dd2a31565a444ed0ce2a99ca","src/features/gen_FakePluginTagInit.rs":"de7e9dc14a56ac5e8cf852274bf0e3f3d25922f4775125feb5d60fa972fc6b59","src/features/gen_FetchEvent.rs":"5b5c72d24ebec33b68fe97ea6fcf0f164f9ff6c8f35e63362b82035b598c63c5","src/features/gen_FetchEventInit.rs":"f27b3ffba3f76f37ff5b96ee18a0936b7b473ded57aece3fd361414994967563","src/features/gen_FetchObserver.rs":"e960853c635dfc01fd6eb26dfe21fd2a1ae6339db0910c331614478addce5a34","src/features/gen_FetchReadableStreamReadDataArray.rs":"6c92b2d6696b6517d19fe2b04a994589a6b7cb80c559c5f1f587aa3a84167011","src/features/gen_FetchReadableStreamReadDataDone.rs":"188b586dde52b31fed24644727fcb8cf759d6cb4da94e5629dc04904ed7944d9","src/features/gen_FetchState.rs":"b13ae496c9fcd00a581fe77e0edfffec399e6c89f90595974802c48bae9194ba","src/features/gen_File.rs":"a5f9f275a8f5d144811a20736269574249441008216a13cf09dab3e04166f85c","src/features/gen_FileCallback.rs":"0a6c4f7542435d35b398dd95fc92bb7e6c2da80d5bc519d62fcb25963638e09e","src/features/gen_FileList.rs":"f367e2c1a50e9fc9764895b9595c5b85507629ec4a4be1559a2333145119e27d","src/features/gen_FilePropertyBag.rs":"eb5ead802fa347c3c4f38c682f315419da92b22729a02c46e07ecce739aa661e","src/features/gen_FileReader.rs":"315b24c09854e27d0f52ede62808a3f38550ded3b13ea07f1427d0dec66d3d1f","src/features/gen_FileReaderSync.rs":"80fc86cf5f7a4de841c1b722485dfe049a64c4b626f173ff155d8f7cb68aa2ea","src/features/gen_FileSystem.rs":"67d07f22fbcc968a84cfcc0ce2551b853f763099c694a8440f5a152636b2e0c0","src/features/gen_FileSystemCreateWritableOptions.rs":"c9d120b672557061a8ecc614fe141c182e818e5a5e9515043caa04603b9831e0","src/features/gen_FileSystemDirectoryEntry.rs":"2ccf85bc8967c0011e3d3091b5892c3d8b62b00074e30a898d80a576dda80dbe","src/features/gen_FileSystemDirectoryHandle.rs":"f82258d0d7a13afb9699231f8d8c8f410e4d82d526792bb4a6d469b799532c75","src/features/gen_FileSystemDirectoryReader.rs":"95cef0146fa97a5849149c3fdc61deeb93a52fd1072374a8ffcd1765ca09dcd4","src/features/gen_FileSystemEntriesCallback.rs":"43a42c15dbc945ed207d9bb1a24aef56201b0d858ee9cb6fc406a6661fcc54c0","src/features/gen_FileSystemEntry.rs":"ad7dcb8ec02764dcc512a281b864fa656eed478ff3c2d82264a7985c639898a2","src/features/gen_FileSystemEntryCallback.rs":"0189ed3e10897cf299d1bc3860aa4299ea67fa2dd049f03ab9cf4aca2938873f","src/features/gen_FileSystemFileEntry.rs":"0910958118b84c620e1c75956c7e1dd216cbbb602d3feb48ecddeef3bc48bf04","src/features/gen_FileSystemFileHandle.rs":"0836dd9bb4a958081eb21bdab9d50b17c1b487292e6b58bd8d58dfd81344799c","src/features/gen_FileSystemFlags.rs":"8301d22b9be2033d054db5f9e0770c6b6b15c05ae58bf5bee52c44170b57b264","src/features/gen_FileSystemGetDirectoryOptions.rs":"b6b60b2778645c3d869dffdb4685c9e9073e11c4aa576f7aef47824033a859c2","src/features/gen_FileSystemGetFileOptions.rs":"2aecaadebc745d3a1c11ce6fb3f6d46271394733d62992334e7ec9313d9ee269","src/features/gen_FileSystemHandle.rs":"956260678889693c3df79cdf7d9908a66f9e9681730b0bc098ebf9f082aa24c3","src/features/gen_FileSystemHandleKind.rs":"45eb24c1855a0c555f7cb3835153fe7ce0ba6c3e99fd8c4f1bfe59efc909e702","src/features/gen_FileSystemReadWriteOptions.rs":"af556f59d3fcf3c019b539b03c51b37c79df531d1174bfa9b5541285fd6011d5","src/features/gen_FileSystemRemoveOptions.rs":"4851722a197079320095247f6e29b968f3a6949ec5fd34a5f0784b4d38aeeac7","src/features/gen_FileSystemSyncAccessHandle.rs":"7c96552a94676c3c1b9be3cee2a766d13456ab47a96d963177c3677093d450a4","src/features/gen_FileSystemWritableFileStream.rs":"a654329587351d0429f9605ad44973f8d7eb125d3f2fa00743ec3e4d3b0c3ed5","src/features/gen_FillMode.rs":"c11fcbcbef200567dd1396b3a5ae5d9192b404099a7b680b4659f43f849d3f1c","src/features/gen_FlashClassification.rs":"6fcf08e25b200ee8b009c054cb28555219a3679eb81afe8b40623459ab4e23dc","src/features/gen_FlowControlType.rs":"2e6e1c5bd30c509be52fa0f4edb8cca64f1505babce2b9f06f6d69a0c46dfb7f","src/features/gen_FocusEvent.rs":"5da4678e0fe2bae579ffd3e0bcc3c6855b584c8cfb2c872a4177dd616da11be4","src/features/gen_FocusEventInit.rs":"c6111234853d90f32ef3a97a679c8f77854d7a54600fec360bdd504cac0dee01","src/features/gen_FontData.rs":"7be19547cdbc2bf3b4a1b1477dd7b6f8a01052a5930db9745e049cd75fff8906","src/features/gen_FontFace.rs":"2ceb8cdb69d8db4ce0f70c2ff4a0dc02acfe85bc89718c84a007088e4ce4d556","src/features/gen_FontFaceDescriptors.rs":"a1bc1e1e100fde83df256eb57650e720ddd1f1283c6023cc14562b3830388109","src/features/gen_FontFaceLoadStatus.rs":"774541eee9cb1ac54327545245725e7a6f36649badc73296f1c5d911d618e777","src/features/gen_FontFaceSet.rs":"82f694b3342e6d86ed49ab1effebd46c4ff60defffca1821e2951c23f56b6e11","src/features/gen_FontFaceSetIterator.rs":"cfe74b4ff73094fbf47181c7df85fdee436d8110156b3916c6cfa8bdc803583b","src/features/gen_FontFaceSetIteratorResult.rs":"308391d77fc56fb3000fe50834211092023475aaf382e2485ee8a506891c1cff","src/features/gen_FontFaceSetLoadEvent.rs":"92b1f195a9812f0f0a51d235910922d7e1fd244c8e3f32618f3741406eb820b5","src/features/gen_FontFaceSetLoadEventInit.rs":"631e75351c1d1c93498f1a244dd9f878b8b351c6822b52544276358245f538cc","src/features/gen_FontFaceSetLoadStatus.rs":"15420c2ae2408330077de678d17f1305790c6a89e88174e37e670667ff029451","src/features/gen_FormData.rs":"dcca0bde2ef2fe625dd72ffe2a2f31e8173274fe3b50675f315cb1c8c896315b","src/features/gen_FrameType.rs":"f30491c7e8a2af1ba10ebbede3f8fe4c06b998214046f92e9547616c7a23aad8","src/features/gen_FuzzingFunctions.rs":"6fc5f1f2597d10a50dd51cef5ad9d03af2b09e7487b23b6eaf38a963ae88ec96","src/features/gen_GainNode.rs":"78df91a76125f922d00ed74567ec2a23526c282200eddca886beaf574e0d5a65","src/features/gen_GainOptions.rs":"70579b376d820aac09f994b60f44ce131d45ea3e7249f140a83911729eed414a","src/features/gen_Gamepad.rs":"63a888551ca8b0cb48d1e8cd5a37da5b1a55cd8207f9aa115ad6b6d48d2ddfe4","src/features/gen_GamepadAxisMoveEvent.rs":"408a83e749cd25c7fbf4bbb7f8e1341da092d3dae36ef86752f866dd53ff02dc","src/features/gen_GamepadAxisMoveEventInit.rs":"a6a0bd810ff691e092b247381b61fd503f901aa7dc291b1b6e6117764cfb7c82","src/features/gen_GamepadButton.rs":"9f32885dfaf7c3ea57cce536c06748698f42e19b768a5df587447621209cba49","src/features/gen_GamepadButtonEvent.rs":"720fac3c9c1ba591ea8078ac2f7f38f270a74fd94e3f66d1cd08bd3a05a348db","src/features/gen_GamepadButtonEventInit.rs":"51c41e942c1f4eaf48d7980f64013dc22d044f8a70b2f941be161140a14b95eb","src/features/gen_GamepadEvent.rs":"60a3445576670ca75b8f30d8dfdca926499d10c563dc8f897f8e680f6f82cee6","src/features/gen_GamepadEventInit.rs":"94145a7ad65b58df31f2027176ad6146e7c7749e71563f5c9ed54f674aeed214","src/features/gen_GamepadHand.rs":"eb082eaf4802c715ec0476df54596b120c858287ef565f091adb63e3db1f6f17","src/features/gen_GamepadHapticActuator.rs":"9b9210126f2d63b9d9d677e7dccd51b44dc0f59e01476c866cbab98cde40e37d","src/features/gen_GamepadHapticActuatorType.rs":"02f6360ae91f4f951c8bbff2b5a510b2b417dde3488defe5b77a0aed153460c5","src/features/gen_GamepadMappingType.rs":"42f605b364f3f6b3433ced7954c94c9267ce0b524e33ea39138051a79f890a52","src/features/gen_GamepadPose.rs":"413e86dc66864ea730e66caed3131c344c4c309efdc8fd9d3696d05545225570","src/features/gen_GamepadServiceTest.rs":"a3ca974f7aeb433a1ec6fbbda88999e77e05f6dbdd6cc84496f2200a45e334c7","src/features/gen_Geolocation.rs":"ca7fb5519d00bec15a86bb9debafd95a466ec2ac8a9a606662025ede5b7698c4","src/features/gen_GetAnimationsOptions.rs":"f64fe73afe11796d4e775b587fb3e62bb0bfa51cc9d5e42ae73a91f3b34b3906","src/features/gen_GetRootNodeOptions.rs":"6805661462b5996e3f827a3fe89ba7ac26c0b732cd914bb7704807cb07092af6","src/features/gen_GetUserMediaRequest.rs":"4a843d325bfe1a9e772dc03eb7a381d325e08d5cfd70d45e461742aa87bf751e","src/features/gen_Gpu.rs":"5dd645434fbd64fe9186164b96e04cc6464c2cb414b9bde5caac1cf646d83485","src/features/gen_GpuAdapter.rs":"20e4d231b2f4b374ec468396df76440461bcf31709751cf03e577b3efbd44bcb","src/features/gen_GpuAdapterInfo.rs":"13443ad87ba0c2b3db07ffdd3ddef41a2035db6c088e107288714092704ed8dc","src/features/gen_GpuAddressMode.rs":"e13013c2fa7c6fadf7756d7867d9965a8bbd1399a911a3c088327792c1982993","src/features/gen_GpuAutoLayoutMode.rs":"67de5388b4849a7379f63ae4ae431a0c9b6b9757ddbef41386d394e9beb402a6","src/features/gen_GpuBindGroup.rs":"cc035884d63d097a331ffe8aa5e7c7a416ed4046410f00474e2be4644327916e","src/features/gen_GpuBindGroupDescriptor.rs":"e117eaf2d2df71299860dd55527e5926979b46064119e5989f8e25131c51624f","src/features/gen_GpuBindGroupEntry.rs":"5b9add12bb0b8520c04f941e109aec5bc6677f6890ec9b77486e4f0cf58ebad4","src/features/gen_GpuBindGroupLayout.rs":"ab2fafd2b39a645f6c99926fe089eb329298f745bcc617e1b29d4045abe2783e","src/features/gen_GpuBindGroupLayoutDescriptor.rs":"1b65053927c07b23da12e9928abc386ee78d6951d51e098cf70fe08c40572242","src/features/gen_GpuBindGroupLayoutEntry.rs":"62d3bb4fd18b9c4dc5c997d1432931e8a8f2499efde1c803019459708be4b45f","src/features/gen_GpuBlendComponent.rs":"e42ee14b444f2f5d93ab295f99970943f103346c8979bd6ff2e98cd46315bea1","src/features/gen_GpuBlendFactor.rs":"6ee1de70f87ec03a4c5b55c3bd772bebcb9801785354d8f35b10bc0bf983d636","src/features/gen_GpuBlendOperation.rs":"162a802a824e214dd016baa3d33d6d6ee18909eb6881461f10161e08cc3b01df","src/features/gen_GpuBlendState.rs":"dafaf1689cdf28ee4827ac2cdd1782b02a4e8f65fa8352fa6d7397a31ee29d79","src/features/gen_GpuBuffer.rs":"e0fa2e0be21fc9b1e7a3eca2de45fecca2daabc797c2b13964a7f8421731d44b","src/features/gen_GpuBufferBinding.rs":"e45719ef72c49572eccff6913adeefb2746c90da817f1f64aac7fe768f5715e9","src/features/gen_GpuBufferBindingLayout.rs":"18ebba6213b24c56385bd113ee7952c11ae3f682c7d3d3fdcf6f76f3199b3df1","src/features/gen_GpuBufferBindingType.rs":"5d9d6c44815cec2507552502d9f25c0bf02f393b4de10e387362aeb018e68769","src/features/gen_GpuBufferDescriptor.rs":"37153a7281527d3acbfa1d78af69c1b711eec16b867912439650fa95a736cf34","src/features/gen_GpuBufferMapState.rs":"99fc3692c738dd44aa2d2c23521de18ea86a3802ae095145da34991764f3ac77","src/features/gen_GpuCanvasAlphaMode.rs":"683a3fb1b61c3458a35c1bc0f30fd3279a7bd7642bd6071a4b0392dcc111e166","src/features/gen_GpuCanvasConfiguration.rs":"00449e2d7cca9088a723ad2bc558bb151c76d4b61d55d48bb1237a4a57a445d1","src/features/gen_GpuCanvasContext.rs":"5e4b7367dd92ef55b664f8444a8d7ba0ec3b8029209dcdea08a71f6a5db6d6bb","src/features/gen_GpuColorDict.rs":"b3f9a501c8d0dbb5477883c198a6823965b009cf931e4bee14aaeb0dc4ff066a","src/features/gen_GpuColorTargetState.rs":"84f19302a9854ee39e22c0be252f2d2799e9ff91a3e1accae0383e7703b6b455","src/features/gen_GpuCommandBuffer.rs":"ebde68d23162df2754525b23e3101003cc40f8e8d8928db9a5f74bddc1b265bf","src/features/gen_GpuCommandBufferDescriptor.rs":"d42dbeb32f018dd0913ef5e73efbc94db6cd7f6371064445548142ca8fdd0e69","src/features/gen_GpuCommandEncoder.rs":"a3e9aeb2dacc58ca91cf1349ee63bfbbc318c69b712383737278f0ce8e1cf487","src/features/gen_GpuCommandEncoderDescriptor.rs":"27ec41838a82791790625563468ff6b43028178a630d57203daea90977db1b0b","src/features/gen_GpuCompareFunction.rs":"ae884092c51c53235232329e46a39bf221f333833dd1e4b33374d3b29172df87","src/features/gen_GpuCompilationInfo.rs":"d5e6b09c9bafd4fe18691c85eb940d99e174f075db6d7e9fd4e66a54641a2772","src/features/gen_GpuCompilationMessage.rs":"8a660d5d68b6d9d639dc827dba68e35375c45f65b3cd03e2d4830a5233f08b75","src/features/gen_GpuCompilationMessageType.rs":"d19626971ee46cda6d599d9def14e6dc9144cf1142f199e97b9dcc8ad9f9ea8e","src/features/gen_GpuComputePassDescriptor.rs":"c4c58c0568712e42460e0f1fd207d3b3ed174a68915cd857af4f7ab47973263f","src/features/gen_GpuComputePassEncoder.rs":"a057ef0e52e085a615c225fd492319b3fc6af16244a393a6eba8dafdd345a89f","src/features/gen_GpuComputePassTimestampWrites.rs":"32744795b5884d72e26906bece9763dd2645ecff6e6d396d7de07c1651f42d7e","src/features/gen_GpuComputePipeline.rs":"35d0b270eed79bfe89d56f94403aca4454deafc7c9401ce2a73658e31a94a97f","src/features/gen_GpuComputePipelineDescriptor.rs":"f340eae850047c4f02a67520e1a4741d84b05bad66d0643854959be71e2fd4f8","src/features/gen_GpuCullMode.rs":"0335fd26ac547a60a7ee427154942ed65bfa3ddcce733f1f3eda85c184bc94d0","src/features/gen_GpuDepthStencilState.rs":"072e14563d03ede4936ec119647ebf30128ccfb6ed8c1861ab51204e7c2dd217","src/features/gen_GpuDevice.rs":"3a28fd474d0d8dc825a098e62caeed36e9fcfbaa7fedab8a0d26f11c63cee100","src/features/gen_GpuDeviceDescriptor.rs":"42bad52b1dc7565a2be54fc22c79941bf5fac6fe39d8bb259f82fa0983321678","src/features/gen_GpuDeviceLostInfo.rs":"4044f832c75148eea000d42b02b97bda03e9f095f3749dba7580a60e4b6dab50","src/features/gen_GpuDeviceLostReason.rs":"4a5e4246017f02fdb06a72cda4743fee924d5509f436823a9ecfd353f76d5e98","src/features/gen_GpuError.rs":"2b9d1993c7c9dc4d77e500bd4138b9f6e6495d857be41d6c9a97b074bdfa37da","src/features/gen_GpuErrorFilter.rs":"1531b2cdc97697671778c52adbb7a6ab61e1cf5f41750fbe225bff1abe5715b2","src/features/gen_GpuExtent3dDict.rs":"76a00e0474745d0931300ee066937348426dbc8e84d209df8771fa7be768def7","src/features/gen_GpuExternalTexture.rs":"763cc288af77099f446afd57b2a581baea90009aeb9e8075dc8c48edd81b7a2e","src/features/gen_GpuExternalTextureBindingLayout.rs":"ba217c9513d1319e2f5e20f852ca9454690753e1de99b81d82220882029159a9","src/features/gen_GpuExternalTextureDescriptor.rs":"944540070d479681bc9977681153e46c33d6ec20f74fa01de6d83e2aa02a887b","src/features/gen_GpuFeatureName.rs":"da038e8e94f6ee6bb2e0a20bfe65e9dfaa5cb88d42522a7e0cf62acff8f580d1","src/features/gen_GpuFilterMode.rs":"7f5b9498b678268fe6d263733a4dce9c983211397b0d3906f8039d014ae3f425","src/features/gen_GpuFragmentState.rs":"f9a4839958b58ed5e5e0d52977aef65127e417cbe3850d745daa597e0af36e02","src/features/gen_GpuFrontFace.rs":"c18309fd830fe1396ca7b8e023f03947133fb2fb88796024a0072c92d7c4f0f6","src/features/gen_GpuImageCopyBuffer.rs":"9d8cd1a580efc3071b80b023a735d513d8f6fcf2d45b866b94dc8e1ab458a58c","src/features/gen_GpuImageCopyExternalImage.rs":"0a5436c8b8c49d0e30371e2bed42964027fe832ea2c49c3c1d05520c7b4572e3","src/features/gen_GpuImageCopyTexture.rs":"28e25edac3971461d1bdc25e139b8959156c1ef734aba9a16190df4f39486390","src/features/gen_GpuImageCopyTextureTagged.rs":"e8676b0dc16d2ff702a4adc897cfe97f5fecdcda911b88cc27488aa40480ce28","src/features/gen_GpuImageDataLayout.rs":"811e6a39934dc42a960c3df9aa456fb36ecc274e066d0b402bb9c3a9da10b04d","src/features/gen_GpuIndexFormat.rs":"b8f8f7e39bad3da7e8c5ee2d1f93759537e19494febb77d350ab4d9d63cda121","src/features/gen_GpuInternalError.rs":"ef6cb85e9ca40ac51c188854a581cfe480cf0c3357b6b404f0bab6b690f82556","src/features/gen_GpuLoadOp.rs":"dcdb0a1f37f80a7a3e32680e275f7cca5aafcdaec828bcb827b1600a80d1b4a6","src/features/gen_GpuMipmapFilterMode.rs":"91766a86ecf0191ad3475fa864ade484d0925cb365a0efb97386024012c32058","src/features/gen_GpuMultisampleState.rs":"cd851a499ea4454b5d6759f6efc2baf1082a345d1dc42219b5b49755425855ab","src/features/gen_GpuObjectDescriptorBase.rs":"a6faccafc7c6aa16c74516dff2718dec5aa8a285916ca42c50ecd888aa7f6554","src/features/gen_GpuOrigin2dDict.rs":"a303f5de1e1614129e48d59d18c6ec90b56cd9a5f8ed28bc321438fb17e23b62","src/features/gen_GpuOrigin3dDict.rs":"4f6e09ea0abe2c22bcc485d75eefb07aef073aba3d63b3cccc5a66e24d1d8518","src/features/gen_GpuOutOfMemoryError.rs":"7cc6aafba18c0a166e69b9276eef73100025a2dbb655ba410659de3ecfe5c709","src/features/gen_GpuPipelineDescriptorBase.rs":"da99e10bbf7823145b7f7db46a7b00d1150978e15ff85324898b15706fdfc770","src/features/gen_GpuPipelineError.rs":"afad36b096807c6219bd34753a37161d5f8744133577d6200f3ecd61e04c429c","src/features/gen_GpuPipelineErrorInit.rs":"14943eb9c3625e3dec25000cc5d33db3e03ac178da4d92faac77fbd8fc67439d","src/features/gen_GpuPipelineErrorReason.rs":"7246206cea6ac7141b118676f4cc04a62cac5e5b1d5d78b15fc569ae358ac0f8","src/features/gen_GpuPipelineLayout.rs":"b9fca87d6a3050c1b52de8b1d48a278e8a2f88b8aa6d78faf0161058cf3fc475","src/features/gen_GpuPipelineLayoutDescriptor.rs":"28e441a79f89543f82d69f596be1d9ca76eed5e1ace26b71b53ef00c0b176748","src/features/gen_GpuPowerPreference.rs":"d6a0a0b4bca9d4745242389e030bba3f5cbf65d50a54ad13002e7915358072c1","src/features/gen_GpuPrimitiveState.rs":"db064cf5d19ed6eb90aad57322a27b51d5f56304544c4d8aec7f09414107d250","src/features/gen_GpuPrimitiveTopology.rs":"1a2206072fadf23ba9d2e3c920a5ac19d5db3170279d2fbd17204f2f980fba97","src/features/gen_GpuProgrammableStage.rs":"771c9c1d0afe40f37319355d560c4eb083e70047056b3cbda257ab8deeccc243","src/features/gen_GpuQuerySet.rs":"4b704964ddd3b1e8d17dd809edc60280352a02deea6f1863e7fa5e56305f4182","src/features/gen_GpuQuerySetDescriptor.rs":"14d6418dad5adcdab57dd30431b2ded285eff338ae39e383bbf4e06cdb4c31ec","src/features/gen_GpuQueryType.rs":"98c94d3a56175db7bd89c9b7715079d89e143a40512d04d55c6839db27e0ccf8","src/features/gen_GpuQueue.rs":"a10ab6a8240707f221899f8704da9a39fb8cb569e66d6192d3bb1a2cad2430fa","src/features/gen_GpuQueueDescriptor.rs":"e0108c52a24cddececb81904e915caba77a243f89c1fa762c87e885fd5d93ace","src/features/gen_GpuRenderBundle.rs":"00219dc42abfd22d17329a839766cb116cc3a4d1d745e6152572fd3b7a6311ce","src/features/gen_GpuRenderBundleDescriptor.rs":"27e33a9fa17c770353165d789261da75a6b461c2bb5da625e48c7ae514405fb6","src/features/gen_GpuRenderBundleEncoder.rs":"ebc0f7b749bb08b11918a9ddbe5f8d8eac9f9b8385378ae3cb948a03df77ed05","src/features/gen_GpuRenderBundleEncoderDescriptor.rs":"15d2ca9bac6eb66faec79fab72c6d2fdde768afcf7d84ba4ecd2330821a0dc90","src/features/gen_GpuRenderPassColorAttachment.rs":"0a6ad5a9ca0775911f5131424d8f357ed9883cd2024b73bdbda91114261fd9a7","src/features/gen_GpuRenderPassDepthStencilAttachment.rs":"a6eb37d4d0552efc483677e1c1e382e90758f5b1da95bd7ec3ae5ccc9cd953e1","src/features/gen_GpuRenderPassDescriptor.rs":"31e1a70766f1a2eb71c20805eb13cb89061e9878732111893e651e256e914844","src/features/gen_GpuRenderPassEncoder.rs":"771cd4bb6982bdb00a56c29db377f8f7efb9745df23d0db22b195dabcb957646","src/features/gen_GpuRenderPassLayout.rs":"8e95ba950cac29f9b89da468f2f91befb2f6dd17fd7c88f50821e26999e02af3","src/features/gen_GpuRenderPassTimestampWrites.rs":"e0a99c8a3ca4fa59a3b5e8f66fc2e372d23ebf7d72360d053fac106df007b82a","src/features/gen_GpuRenderPipeline.rs":"dba9317d7a6e537b3369482eca5d3afeb5bd4a78b4ea7079491412cdee0ef9e6","src/features/gen_GpuRenderPipelineDescriptor.rs":"0876f2539a24890adb7b446defe7f473f9b38aa0779ea95fcd906563a0069aef","src/features/gen_GpuRequestAdapterOptions.rs":"e13cae983270d10417985ff78aadef756acc23b1d10ef8d4016f3082972b7fa2","src/features/gen_GpuSampler.rs":"f56303ee2a10f4e292b6d5b992d64c0de2916e0494d4f7c25ec1c5be98eb662b","src/features/gen_GpuSamplerBindingLayout.rs":"4ae13e6382365646167e98745d870b55e0aa04897094771e7dab98ba896f9f40","src/features/gen_GpuSamplerBindingType.rs":"939f124ebf9776a3e31629734261b5edf9184cdd2d2e8d4112ea30f6f2d28933","src/features/gen_GpuSamplerDescriptor.rs":"758bfb0e2735fce4530b1013f23da3dd39b77880ab1e43704e8f60df3a782c53","src/features/gen_GpuShaderModule.rs":"ed50beb55088b0bf82cce02ee6dc72f970239b65f5595c40401a8334c293c898","src/features/gen_GpuShaderModuleCompilationHint.rs":"9adc46d7ac66ad9032693c2a460839b4d9d997ab6074a759cc060fdd41eb5350","src/features/gen_GpuShaderModuleDescriptor.rs":"ab77ef1aa2a952f0bad8aa17ec4b1221d5a8d69b72313d13c88974a998bcf01d","src/features/gen_GpuStencilFaceState.rs":"784df7232fbaf550645f789fd71fbd40403751e691736f7fd65b23462e736eb5","src/features/gen_GpuStencilOperation.rs":"43baf569c35a6b30cc803c6b614e72b8482334e32a6d6b005e38655ccfd77582","src/features/gen_GpuStorageTextureAccess.rs":"79aa5278e993860e38bc0b9d3b097afec4186cb55711d1e7ff60bfeef6b4e0aa","src/features/gen_GpuStorageTextureBindingLayout.rs":"2730278d222bbcfd7d38e872f852f40bbae7d5ce9eacf3d93622a52588bb351d","src/features/gen_GpuStoreOp.rs":"68c36797d8f88ab54b825fbc4774dc1c5efa0771885c200c622f917e3e5f5df7","src/features/gen_GpuSupportedFeatures.rs":"52ead8045b8bf682c850df012e84c714613892295fa83bdbd367619445767a9b","src/features/gen_GpuSupportedLimits.rs":"b2e5ec2e45b81209bba90017ef9f9517aa25bd338fd705caa6f22345c80993b1","src/features/gen_GpuTexture.rs":"cace9e0e3d374e2cd58f9bbaea62a993cc0821557f769dc96b2457a02bbb643c","src/features/gen_GpuTextureAspect.rs":"f03afcc204529ef5dfbbbef4ed477b089618db2e764be2d64207292943ef9b77","src/features/gen_GpuTextureBindingLayout.rs":"d0fe7163e7d4c930855a10b9028c222f2fc940f5ba9b83155a86ce212fc0c57d","src/features/gen_GpuTextureDescriptor.rs":"c7e3b6c6c0be88d6c40f95ae252fd7d68d45db41480ffd6df30e124ca4562318","src/features/gen_GpuTextureDimension.rs":"37e3e95e71d6ae16c962006332a126a92ee9f486b7a47a24beadfc1bb1977c47","src/features/gen_GpuTextureFormat.rs":"09d69200a7e72b5c626dd32850ec27f3e590fd4f2311a96d4a04a2a60039d17e","src/features/gen_GpuTextureSampleType.rs":"dc5ab7959447f17e8f83df7701f7d0eac8e5d48ec9390050d80af3e93df5395e","src/features/gen_GpuTextureView.rs":"e181951d20e3c7d2919e024e6c6378be73c316f8269fb17d6b0ac76f8787e4ce","src/features/gen_GpuTextureViewDescriptor.rs":"d7e4593be10c80e5ed4f487e8e9453d8c31256c732639e250a27fa9d7f7668dc","src/features/gen_GpuTextureViewDimension.rs":"8ec612991126bfbf21bf587c6f3ea793f221164c172b614dcd2b7cca258477d7","src/features/gen_GpuUncapturedErrorEvent.rs":"88237729113102e181624689dc72c4bbd5592cf5b7796f44e3d2f7f6ab5ee561","src/features/gen_GpuUncapturedErrorEventInit.rs":"7b3c4c9c2c6ae780812be13f8a7fed73b9c4804831c0e727994f3043ecd747fc","src/features/gen_GpuValidationError.rs":"dc089848896be7542697adb41798712d54acc5160a62b9f4b556035bfa03ada4","src/features/gen_GpuVertexAttribute.rs":"e41905128f66129370945a07954a462498df717684e10048fb3827bb80b68fd3","src/features/gen_GpuVertexBufferLayout.rs":"ae1cf5d75b20068093510a08b994bc370b7773c7db97e529591f8740afd0a736","src/features/gen_GpuVertexFormat.rs":"f6116ff44da029b3c66f003bcbf784f3749cbd27d7cb4cd4e75d9267f13a07c9","src/features/gen_GpuVertexState.rs":"757631d10f84781e3e84881f8bdf3c34ea6ee5b36895589a0dd15f552a1ce891","src/features/gen_GpuVertexStepMode.rs":"99dcbb225e5c54a22f069324f093d93ece87b9b41ad3189cbea4d47b8c42e3dc","src/features/gen_GroupedHistoryEventInit.rs":"66b51e5f9b024816f433d7ca26a64bf165b2efa81139e14b2a26442614fecb58","src/features/gen_HalfOpenInfoDict.rs":"3823284d2f782df3c57ae2544ebb4b28208286b642260e85eae69a8f4fa19e5c","src/features/gen_HardwareAcceleration.rs":"54d07989b181bcca65cfbb8964e858071d76ef8fa1919086171068f428d18c1b","src/features/gen_HashChangeEvent.rs":"5fde6b9a4f01e9be49dda9d06ff81a8bdfd9f862daf670c9aefad15858d3cc50","src/features/gen_HashChangeEventInit.rs":"33ff84fa68dbed2ea3868eb75b6c7cfa85a08e18b966e8aaaa1113e70293cb96","src/features/gen_Headers.rs":"485c6b7c8a8204459e8ba8bf44009e6f9c8acac9486500cb9fe75223e6b8ccff","src/features/gen_HeadersGuardEnum.rs":"6a8a61a6e44189e04d54fe8331b0df06201e300f9eee455ee3d8facf687646d1","src/features/gen_Hid.rs":"965c3a628ab672d2298d109cf9fa178c8f51ce0f30d808cb56553eea5066d2e0","src/features/gen_HidCollectionInfo.rs":"020efb44b3724973ea942e3bb710e08e2cdf52fabec0e0f20e6be15c4e3f648a","src/features/gen_HidConnectionEvent.rs":"bfcb0ccf600042c8ce71ef44abb3ddda629322f5bf733d76b73942669708f712","src/features/gen_HidConnectionEventInit.rs":"03ccb86693e55e9180c4ca7dfb697329bf2d453ed03445a637c249cc4b3a6b26","src/features/gen_HidDevice.rs":"eb1917662310ce5578883a5b26391854232c0af15bb6b7647cf99cf83a8ceb2f","src/features/gen_HidDeviceFilter.rs":"533e1fcba38867965419688d840e84410ccbedadb82e636750249a1099179b93","src/features/gen_HidDeviceRequestOptions.rs":"336e3a9f62a55234b62e495f8fc37fa1496bb5107a075821f5924424a5082c4b","src/features/gen_HidInputReportEvent.rs":"be5cb14be47298cb46da934f9017cfbfca1b172623f74ea9ce010e5d09aa18f6","src/features/gen_HidInputReportEventInit.rs":"ee200ff68209e4a451fcd234d88c9f85006ed19f4c7bbbe1cd4a3a11fd9964a4","src/features/gen_HidReportInfo.rs":"7be1d891dc1b2065ebc6f1e6a31b25cb2887c22fdfc65f76089fd44e92833aa2","src/features/gen_HidReportItem.rs":"2e70b39ce19615bfcc01b21f8c4ab1a1f5e4941421f23df3ac9118c3876deb05","src/features/gen_HidUnitSystem.rs":"ea74caeda4f1bf1bb06b57a7292a206de93817fbd4cc5f86d1f8ef683193818e","src/features/gen_HiddenPluginEventInit.rs":"f2a1e3308a6906c1a18c66231ad83d85f3ef341d384395caf281f7adca444f1d","src/features/gen_History.rs":"27557ca309e231f48b7aa0df096fa9a0726f0d4eceacf931905cd5e1020f7f41","src/features/gen_HitRegionOptions.rs":"88e2ff04ad6115779c6964c1d78cbdafd012805074d9e67bc302602408a13d32","src/features/gen_HkdfParams.rs":"435c7321a16e005c310bbd1ffa4614e0079bb2138b7a6d329c8b2ee3a2970bf2","src/features/gen_HmacDerivedKeyParams.rs":"d52167f6df1a20eb429a50e6b3c689cd6183032bc1495e7b0f4c9e302996057f","src/features/gen_HmacImportParams.rs":"94ae53089b1ea815b9ef5f6dcd453c066633ef7986ef177e1930ed9e4ad60495","src/features/gen_HmacKeyAlgorithm.rs":"7e02c562e9ef98270c73381e80c35bb409824bca912cb0b6cedf1d845d625593","src/features/gen_HmacKeyGenParams.rs":"dde8081898659225981574c9e44888dd4ea2ee6362ef7d2c83fb5eba705d423c","src/features/gen_HtmlAllCollection.rs":"732035fdd73e68eb6c83a6c6c1ed7e99b3243952cf0e928ce930602ec37ccdf2","src/features/gen_HtmlAnchorElement.rs":"d40a7c1ef409f0cb887a5147a39fdb446b5348844372d415c57d0660c852f80a","src/features/gen_HtmlAreaElement.rs":"cc41394f2baea9096b7fc4ec02305a213ccc863b9f8bb40ba9dffeb968d1e557","src/features/gen_HtmlAudioElement.rs":"389ba0e9fb5d9036801527277ead68523902d0a611beeb2b76a38e0d38f82b64","src/features/gen_HtmlBaseElement.rs":"b5058f145b7e6a4c5a8fcc4b49bc4330f4f8b379272311977462bf3a43c22239","src/features/gen_HtmlBodyElement.rs":"944ef769bb6b7030c5f33157bb0e105cb3b7cc6d7ab7a0f822894ed2ceec1868","src/features/gen_HtmlBrElement.rs":"a65868d07fbde4369d2c7010ad38fa0b954451ef4d8e7ef7a8eb6b632b98a301","src/features/gen_HtmlButtonElement.rs":"9be1c30d74f63f66ddb5eaef33122bda8ca5729ea92c518bb98de12117ed19d4","src/features/gen_HtmlCanvasElement.rs":"f380540660d6fa89a3a9b4b8af5dbd84481d957df6e4fb9967f931f1c9acf496","src/features/gen_HtmlCollection.rs":"eaa09d495d0d4de7986c1da947304e0de1c55f85668cf86d477497f4d8c19c75","src/features/gen_HtmlDListElement.rs":"65bfda76102c550b833b1273d85bffa98a90fb0c596a7fab0ef6d74ed6a5d22e","src/features/gen_HtmlDataElement.rs":"d51275c036418a3a2fca5823a5e3e1a9700547564a436271b1d353323024a41d","src/features/gen_HtmlDataListElement.rs":"fc3318381e9388e665aac14b178781e8b42734188334b77b18004f1b597824d6","src/features/gen_HtmlDetailsElement.rs":"fa18eda62df9418e6590424986b5ce60a52e5dbf0473dcd9fdf16ffa35c70ee5","src/features/gen_HtmlDialogElement.rs":"cc293effa7fd55e81bd0765afc85b7b6e85953530abe20556ee5a82ee9e41a4d","src/features/gen_HtmlDirectoryElement.rs":"67933af6473132c846bee0af29c4e2114a25a20942bdad8b461adae42bca8cd3","src/features/gen_HtmlDivElement.rs":"c5b1854f65474101920cf703317f3a77944a67acfdc01e5abdcca419f847b87a","src/features/gen_HtmlDocument.rs":"89d90a3f212e44fb0fe9ad29fc68778c51799ace09385774255a67fc27d0603b","src/features/gen_HtmlElement.rs":"7c14ba74faa1c563ad456ce4ced9f8e2ef93cfd765977254a625d69785b18ed6","src/features/gen_HtmlEmbedElement.rs":"1e49161377c73cf0eee807c19f771796d3941e05d94486318eff5f5b5c2c9278","src/features/gen_HtmlFieldSetElement.rs":"b401bc970f5efba17bb9a9d299e01095ae07cd6392f58fb0e9bffaf6e2ccbc5b","src/features/gen_HtmlFontElement.rs":"b04021bfec01ba921439e8686842e931e46e0c89a40a420019cbd34c90adc69e","src/features/gen_HtmlFormControlsCollection.rs":"40f0a540fbaa612fc2fc530e69a8490203a8ddd3d210813bc17027d75388d807","src/features/gen_HtmlFormElement.rs":"1f112972f970e277f90625e444aabd0dd40fb588da87db85b6d2804d200e861d","src/features/gen_HtmlFrameElement.rs":"4edcf8e8f1f12b5776d6d97a3c816add14a63fa06af8941770fa632d9bf6333e","src/features/gen_HtmlFrameSetElement.rs":"c8d7299b4c6557db9e9b64ce49634a5bade44e3ee75bd9dc3106145dd4702803","src/features/gen_HtmlHeadElement.rs":"de547b4ab913d3f5b4b3e328dc32a4a5066d5df01b3dd6b2da1354e6f3b91eed","src/features/gen_HtmlHeadingElement.rs":"50fcc67d0fe4331c86829126c2b906d3d8be429e238bc91cb6f17ce1b250520b","src/features/gen_HtmlHrElement.rs":"7d5a00798236fe8551b0ad5723bd691d7fe12c7e6359944e85c16fab497eed2b","src/features/gen_HtmlHtmlElement.rs":"c11daca541d585dd385ffc97638e425e41593c52f75aa7afdeeb9d86a1cfe62f","src/features/gen_HtmlIFrameElement.rs":"ac60704a6cbf90abd657a05af103bbd3266a1650d42d4c905326a235a02aa56e","src/features/gen_HtmlImageElement.rs":"03c7b7344ce3f0fe0a0dc3436ae54a2af65217537f1ee71f4988e87b562469f0","src/features/gen_HtmlInputElement.rs":"272df6f26279bbda113c93ef8d1287dcfad3ecec27eefdcf65408325a496237b","src/features/gen_HtmlLabelElement.rs":"c5efbb7a17bd6a11471676e02ebab61cc4863add2a3ccaf64fbb9aee6a83c19c","src/features/gen_HtmlLegendElement.rs":"9ef4eb3475fdca5cd1ffa48abc5fd5527621fb6bde21d30da07e2d03b924308d","src/features/gen_HtmlLiElement.rs":"76f7fe36ea62acd79edaca8579e3674efcbb5f8bf0fd2e9be5017ad4033e9d75","src/features/gen_HtmlLinkElement.rs":"30b7838586da4307ff950ff81431cb9b4f91229f39f7f11cc6390025f24f122c","src/features/gen_HtmlMapElement.rs":"cf0fd627448f7c8e04ed8158b140e1fd08deca8e5f1b56afa1ea3f550699ce3f","src/features/gen_HtmlMediaElement.rs":"b6d400513d4e80fc74f7c3040512c2a86fbc059be591908cb2502a0455d3001c","src/features/gen_HtmlMenuElement.rs":"661f93c7eeacdd9c71cd8b2ddba6eb2b7e91bba341eddb06f8bc3fea41fd9e5d","src/features/gen_HtmlMenuItemElement.rs":"99deb45d5cd9415c15c4ca7aa6f0e441ddf2c32ca97a726561e0c6161396731c","src/features/gen_HtmlMetaElement.rs":"13e2ff234fd5fd1e07a8316151f39df94cabf2cfeefe107406e077ca82e0c8fc","src/features/gen_HtmlMeterElement.rs":"61c5d39c7b3725abb7103496edb60debb0b2424c6a4c0caae163215a0035c4cc","src/features/gen_HtmlModElement.rs":"3965784883a43c0748eadf46ee6bd2ca2528f5825090090785ab91824454a2d4","src/features/gen_HtmlOListElement.rs":"0f83a837cda5a32b9254e18c820117cab1fb7713c8eddcf7af2b37564f24ab67","src/features/gen_HtmlObjectElement.rs":"de25c9178e054da99ecaeb7b06f4b46c41f1322dbeff140ef3f2798faeee7a44","src/features/gen_HtmlOptGroupElement.rs":"7d719556ee6b56056f4df81a4c261f0584b1e11251bb38c281a47433b5b6bd5c","src/features/gen_HtmlOptionElement.rs":"cff5ef91f5f79fd3a337f4a22ac67a2e5e55cfb595aa48eebb4a564cece76fc3","src/features/gen_HtmlOptionsCollection.rs":"06733f03f54656052593317688d0e9a4b8decdf45313196e624b65d5e62ad609","src/features/gen_HtmlOutputElement.rs":"f550ca628e914049cedcca85919acf3dc2fd89e344940495ab48ceb849dac495","src/features/gen_HtmlParagraphElement.rs":"8bb5b4f122da3770627b6d7f090684fa2d75cb00b402dd596e0889e605cfd416","src/features/gen_HtmlParamElement.rs":"6d12aee274fdda40d3c17111134a579e0363cb2a6959119ee814f0e15d67f31c","src/features/gen_HtmlPictureElement.rs":"4f42fc44befcca293155ef2eb79e3304792465ac947e0f52fdd44975f94cd089","src/features/gen_HtmlPreElement.rs":"cf473395d54a28c31fcd64cd16fb453ca00a71c16311031985b89d50e3b48688","src/features/gen_HtmlProgressElement.rs":"496811708e97d76c0d666bce11735b67399e8190bef3324b05f3550c22935793","src/features/gen_HtmlQuoteElement.rs":"139fa0b1b42c9bee42ba21834b131ba581747cdbf8fc2bf0aedea142d467fdc7","src/features/gen_HtmlScriptElement.rs":"f4bc613e502fd9e03a1e153a5ba3e0a5ad4e64866ab963df2d6d67e5e9ecf98e","src/features/gen_HtmlSelectElement.rs":"287c7019281f25b7a1e45348fe2f30fb4c30be5926d1b4e05d410b0230e8a9c6","src/features/gen_HtmlSlotElement.rs":"203cbf4e9e73efbda58aeef842c7b0af3f8192efa7f3bda82caaea6876ac3cd0","src/features/gen_HtmlSourceElement.rs":"61e13038fa55dff87b903e476a5a6e560ba689e709a34f862a0f423a919cf091","src/features/gen_HtmlSpanElement.rs":"81c461118e16e8d6bb157d82a6526d4f7184679b2a439aa9aec6d658601bbe8e","src/features/gen_HtmlStyleElement.rs":"d40395cbeb374546a1386c50164989c0d854166c57525feb49317f2cf46ad61f","src/features/gen_HtmlTableCaptionElement.rs":"c51ab3614e86d2c539a9aa32e213a0c2a80a5e7d37dc6a05d365cf351176d7fa","src/features/gen_HtmlTableCellElement.rs":"73e2184282d517ac5c6658376494f74b9c07c1d2a6b0222f046f4ee1864f6f3f","src/features/gen_HtmlTableColElement.rs":"a7ed4a49ed8cd27f9ea3dbbd637fd2537028e890fd04f05f9d852f38270d9a33","src/features/gen_HtmlTableElement.rs":"d8f5e7755ef0fab11b566fa996945155b22513f484d5fe04dc77522b0f35b8c4","src/features/gen_HtmlTableRowElement.rs":"0d846683ae2f5062c50b2f125fbff9865f36054c8b8e539cbcf2acd27c006e58","src/features/gen_HtmlTableSectionElement.rs":"95d7c706ee659a6a08556fae177cdab3226dbb801f4969b13c43f8af4b1ceee4","src/features/gen_HtmlTemplateElement.rs":"0716a08a04a04c0c822f775d5405de5acfdf424bc8c94bbc2f713e9800c37c4a","src/features/gen_HtmlTextAreaElement.rs":"e55ef968e33e81a90e06a0733c84ee86d7668fc5ec38b60bac3318f55dd40550","src/features/gen_HtmlTimeElement.rs":"6dc2e9250662f4cb939f41475b5d4a1ae5f06a7d0a8407202c4df04d06d93a3c","src/features/gen_HtmlTitleElement.rs":"37d41524d8eebffae96103f5ee9864ac059581ecb464c59fe4f2e399060a641d","src/features/gen_HtmlTrackElement.rs":"b02617fb305cfed86a5ff3ad85967aa953bb74fb648bec26b2b9b10ff785b6be","src/features/gen_HtmlUListElement.rs":"e8ac1b5b4dcfd972a25be89b2c2a20f83997185c555b4d6312623d6da43091dc","src/features/gen_HtmlUnknownElement.rs":"07638b73cf26d18ca06054e008e98139c9514952af8bb0aa51f42616af6f03a2","src/features/gen_HtmlVideoElement.rs":"5e0b904dd1a7ed12e39f22dbd9e425628e48871911c9c5856594325afb1a93f7","src/features/gen_HttpConnDict.rs":"c36d787428c7a179b466d7d382a9102e869de9fa219d89e6900ddaf9e410146f","src/features/gen_HttpConnInfo.rs":"38a8cb2d6936236bcec0927b8f122f80620b29ab04aa3d17d7daf04ef64fb11c","src/features/gen_HttpConnectionElement.rs":"4ccccaae6c1c1ad8912d39e728066584895f6fd4f71c90393fbff2796250bb27","src/features/gen_IdbCursor.rs":"b7225239cce75e3cef1acc45a12df7178db3ff2b5d61aca433a9cc2f6fe36117","src/features/gen_IdbCursorDirection.rs":"bb8cf78ac731568a46e037c5715726aa48e6d778bb8d9646413adf47d0b69b58","src/features/gen_IdbCursorWithValue.rs":"50253f6159b4b36f21cfbf879cd2e6bca67eb8772ec37b720cd41bf22338a2ed","src/features/gen_IdbDatabase.rs":"5ce06ea852dcb24aab4f234e30d135bda2e0631c94151cb60d2c05a45b25da0b","src/features/gen_IdbFactory.rs":"e0280903cfa90c3a3801548b1b9dda09e53ba0f065bfd6635d3d7f3742a3b951","src/features/gen_IdbFileHandle.rs":"8f44e93a211bc011aea4126c477147d84c78392a55f8af369ac0fd91584f2e24","src/features/gen_IdbFileMetadataParameters.rs":"9d0dd14568018acfd13065d4373b5e5a8fb8bc2b2cb24bacea3f0cfab57089ca","src/features/gen_IdbFileRequest.rs":"67d821f3ebbd4b2080170b78e5c2750fd45b2bb1b2031da85af05652beda2de6","src/features/gen_IdbIndex.rs":"fcc238853cccf19b360322c6ce44bf3b9725bcdc78692b2b9494828bd4e1cc10","src/features/gen_IdbIndexParameters.rs":"a67f9122268ef1b349c59731bee911938688daa1d248a41ccbdb07dba7c6b243","src/features/gen_IdbKeyRange.rs":"1b76bf16c7dd6ab7f0ffee60a4299463b866d141f4f35bce724152c4ff1bfd02","src/features/gen_IdbLocaleAwareKeyRange.rs":"3744fc47c0a153a439b9f66c240ef47b7716f5a82759f3df055c8433b64abbf7","src/features/gen_IdbMutableFile.rs":"f476de5cb5667af8bef87810569095a49bef07c01125bd7b9a29f243781f9721","src/features/gen_IdbObjectStore.rs":"31b3ec6dae12a22fce7977f7ada58efa56918119d443679176e4941eff64bc0b","src/features/gen_IdbObjectStoreParameters.rs":"ebdcc3ecf2756db4bf54b43e6bc8803a32878a64f4fe089e93c8e723db13ba06","src/features/gen_IdbOpenDbOptions.rs":"2958fe7296da309a69bb9f65aa6fa45a4888abd5d5f0c50dacf690ca93c8f0e3","src/features/gen_IdbOpenDbRequest.rs":"e3488ce9f475ee4e8067ee0a9d55a0ecb86e4f67bdbe16f664533732dc448110","src/features/gen_IdbRequest.rs":"0e0d5898aa5c080813ab7a2d4fd2ff1fae36872f430c26f1eabea2fa6c44e730","src/features/gen_IdbRequestReadyState.rs":"bc5cc2f6cbbf23657b07dfa028a7ce05299cd97af9e7e4f62df881ac0588057e","src/features/gen_IdbTransaction.rs":"9264431a68eee286b2ce3aaab00f61676d80ff8b0f2450e449e9a752001701b2","src/features/gen_IdbTransactionMode.rs":"3ce2f3471e6524a620de9d7ec7dcbf72c61b24b9ed08fabfb0d2e8b31518f760","src/features/gen_IdbVersionChangeEvent.rs":"084d04b86e512cb73dae07dd49175223010c5aca56aa98d19e38e578266deff6","src/features/gen_IdbVersionChangeEventInit.rs":"3ad89faa7d1f19d60d87ae90fd062f13d6fc44431645a6d186aaf15b760d7f81","src/features/gen_IdleDeadline.rs":"89a03c647c79b7349c492c0cee9fb49a661406f4d034202e9771b38a9ee9689c","src/features/gen_IdleRequestOptions.rs":"1055449c08f3bbc8fb8e679a98f626476ac9e839d3e3fff02a6433e51866a777","src/features/gen_IirFilterNode.rs":"53d59e86f2fd7813cc0db67e4c48623a3f8ebd2d156948aac909db0b3d5d3770","src/features/gen_IirFilterOptions.rs":"4cc46216d1064cd47c31e7728829ab5fd767a875c2410d8a9fae9cc0eda9ff86","src/features/gen_ImageBitmap.rs":"022c4abe3d64042ff803f6b787b9b3903a24591579caff5c64108dced4bffe04","src/features/gen_ImageBitmapOptions.rs":"09aa8f5c855847aa89b18768e8aa486bbc462f253a6660a2918ee02c49483517","src/features/gen_ImageBitmapRenderingContext.rs":"bad9ddad928684e6b9c9ccd566f3ca3b3e5eb8ca103b3c565336bd50bf3a0b94","src/features/gen_ImageCapture.rs":"c65fe0f67725151a287e65037d9a963261ad3dc41baddc02d107e4f073dd848e","src/features/gen_ImageCaptureError.rs":"8acd5474ce459bdfbf9d488c22b80f774ade266aeb00b80d9962eb294527e0a5","src/features/gen_ImageCaptureErrorEvent.rs":"fb371751af82b831daaf76539c3eafa4172ecd4fee6172179560f89859c5a72e","src/features/gen_ImageCaptureErrorEventInit.rs":"4d7b0f216f37b655b9c3e92067df4e4f5fa6c3f4ff5b8a913b992248d3120d64","src/features/gen_ImageData.rs":"a5eee95529f1ed339e6a9cb0b9df84b09485e07c9847609fa46e1027ef805b9f","src/features/gen_ImageDecodeOptions.rs":"8329e462c4b301f11a2202d24b3a30a8c2cc583dc5e21acac1dfa4c9b3248ec6","src/features/gen_ImageDecodeResult.rs":"8e90ff31eac6bc0da7a7c85182cdc95809460ca9fb5a26d652b4429952c55488","src/features/gen_ImageDecoder.rs":"f1e8fb7f099be85cee04f9ebc5f652b556283d106edc67190c6acfe341aaef32","src/features/gen_ImageDecoderInit.rs":"90c02e7a32111c85d1cd1d64384a913827c777b2342369457e111b3996c45ea4","src/features/gen_ImageEncodeOptions.rs":"059a6ffb3fb9641cc49c52e45b1f29efb4033c44d644119973226f0e9b567d81","src/features/gen_ImageOrientation.rs":"adb817e9d779e6c0e2296cee0b24f0a61eedbf18048dec994a9e190e37f310b9","src/features/gen_ImageTrack.rs":"00a81b5d0d1cb5b2b8354d53e0db9586e33eb4a29d83986757d297e7f1710170","src/features/gen_ImageTrackList.rs":"c902ea20b280043324705f4572bd87d5eff736042e27289fe57c88f7658b3f9c","src/features/gen_InputEvent.rs":"fe1ca48d4216ac081b05f370a4fb59412167881772681255a8662969a448d16d","src/features/gen_InputEventInit.rs":"8827e904851cd4a6edf199878ca1c2b0075f7d2e26136d302a552d194f09428e","src/features/gen_IntersectionObserver.rs":"41f84dca9ac99992d1f2357e22581759fa5f547fc351da51fc4cc1bcfa9dd4c5","src/features/gen_IntersectionObserverEntry.rs":"aac59aff87f217fe9f82bdf236d19fe14637bd750ea97abe9cb67f62d477c0da","src/features/gen_IntersectionObserverEntryInit.rs":"32aa88e9432dab2721d95942487db32c067d80839f3e8ce5ec864ef21f25e41c","src/features/gen_IntersectionObserverInit.rs":"29ece5a314cef886b6dfc43d8da44fe39957016d434e9cdb7e68054a32a771e2","src/features/gen_IntlUtils.rs":"b82515769688e2658088f0db010bbe1799ea97574cf474c1b4461739a29954d6","src/features/gen_IsInputPendingOptions.rs":"db0f12c5b44378a198c9a0d5c1a265faeb2f55da06b92027b9a7800e2e5b0968","src/features/gen_IterableKeyAndValueResult.rs":"0eb491f60d38321e3e177137fb3542c86d05e559787aeb28ff9574177a754c1e","src/features/gen_IterableKeyOrValueResult.rs":"76e258910b94c2ad3ead3cef57e71076cea1d8657f381647f88dd1567253396f","src/features/gen_IterationCompositeOperation.rs":"1605e2a347bafdf986f414b55eb7c4d952221e22c3fe70b4e2b66c67b89cb9b2","src/features/gen_JsonWebKey.rs":"262d26564826372c56fc05606f31deb02bdae80066a8b0d03b27eb47867ab087","src/features/gen_KeyAlgorithm.rs":"b5918361a6f3d7d95d061f34bbc88d8335f5a02b8afe6fd474e4f7799d352ba4","src/features/gen_KeyEvent.rs":"fe7fdc8ed4f6a1c42a253ecaa0f0c54adae784f5897449186ddd254bf3c1db57","src/features/gen_KeyIdsInitData.rs":"5ba5481ae5c66a80eee9d7ea7f011c96a3eff46de94a5698128c06e3cc99a732","src/features/gen_KeyboardEvent.rs":"a8d98415bf8cf0cb370905aaf9037bb5e652287afefbed3aed23835f78b37137","src/features/gen_KeyboardEventInit.rs":"732c8260d18e6adc8994e7985165c0a7254b6fd98d363f9d23bd5d71727451dd","src/features/gen_KeyframeAnimationOptions.rs":"3dd594aa284bc9af2a814184781cdd7b4b42aa26413dc2cef50c6a515e8207d9","src/features/gen_KeyframeEffect.rs":"4c034d8a43b789e5a96870c583590020e2b8f43691153161b69f450506603144","src/features/gen_KeyframeEffectOptions.rs":"a522f591d54e94eb96c93481195bc6af6608a7c291057b21f177159adf4afbdf","src/features/gen_L10nElement.rs":"52b36bedaa697c21a1432d0eff505f10351fc8af572d07ef9c83ac300ea20d3e","src/features/gen_L10nValue.rs":"0061ec05934fc6a0bb6a9c3fa62a200e7243634e1b69e779773fb9ec0a9d0698","src/features/gen_LatencyMode.rs":"7083401598c5c401090ab1e69c1e56ff96550b4979cdcb2c062cae848306da5c","src/features/gen_LifecycleCallbacks.rs":"12629bbdc68a7a5ba26a6651c5b4d25f582ac7c836dcb775e38fd23d33c58fc4","src/features/gen_LineAlignSetting.rs":"bf80f5841646addf3c610ec64e2d5737a6ee180d8e8d7e723d75a3e420fd4b11","src/features/gen_ListBoxObject.rs":"14121136a4ee24950d9f1981aa06598b87070814613a5329c89dc5f1f2bf9229","src/features/gen_LocalMediaStream.rs":"61c9b7885c405d13a1cfb222f822e2660bad651d8a980b43adc551248b371d50","src/features/gen_LocaleInfo.rs":"f347ea211290173b51e3769011e445e52dbdb24f28292f94847efe85b919598f","src/features/gen_Location.rs":"eb8642a1eecff6cb24b5fdc7e37fb83d653738f0a014f98dc86aa2e69e69f33f","src/features/gen_Lock.rs":"5ac3b05db9c1494c289d1441e1fef915058196d281634a6b2f58621048e56caf","src/features/gen_LockInfo.rs":"5dc97339fed5cbe644649e3c4175ec9cf71716a50bb39f31c6f3be5723a7761f","src/features/gen_LockManager.rs":"dddbe59a5a4c1100df9c8866232b9d1acdf76abd220089865c08aa784899d330","src/features/gen_LockManagerSnapshot.rs":"ba605fb1f54856b85376f3d05bc80a6fe2f7a8def71b84844199ea86751715b9","src/features/gen_LockMode.rs":"fa7959f09a6d678e0ab112d038b601c16265313e15fff141d4e73e044ef65805","src/features/gen_LockOptions.rs":"cb9d6042b0dcc28ef379ff6828f514f6479e3c56bab405742917cdf06fdf09ea","src/features/gen_MediaCapabilities.rs":"89f333315590997ecfbf2b5c89648cbb345a8e042e9d4db24974b97c281bd3e7","src/features/gen_MediaCapabilitiesInfo.rs":"5b2972776a759304fa9ed9c67b12300dc6754b25d2d3d3d8c44db7d9d625343a","src/features/gen_MediaConfiguration.rs":"fdfb570542dcdb07a1afd47700e40e0bda99dece3f143d8e28e12f0b42f674d1","src/features/gen_MediaDecodingConfiguration.rs":"e1cc32e1733eebbfc1fbc466887a01e77b1893637436cf6b4c62b899202052dd","src/features/gen_MediaDecodingType.rs":"90c03bb22598f18d7af1c9edf4aaf68264b6b13fcfe86bdb58cf1b76ea7e7838","src/features/gen_MediaDeviceInfo.rs":"1e880c4f3f646c750cd5a6c3e0cd7dac58cf2f50f5a4d24a7829e01bf3ef943c","src/features/gen_MediaDeviceKind.rs":"af669e2fabffee518b5eb3c1d3a94eebb27f778c17029fbc372b4d9e7ca88a97","src/features/gen_MediaDevices.rs":"4fc0991c6c0bd0f0d6d4e5be51e0555ba14b811321d14bc1e8ab77e76c88054e","src/features/gen_MediaElementAudioSourceNode.rs":"1e5062752c181c02fb0974c78004b22916f84118e13ae9abd38eeae71edb04ca","src/features/gen_MediaElementAudioSourceOptions.rs":"859086849e7611e2535e34752a9133dfe6498420ca2330cbcf0280574f25fa6a","src/features/gen_MediaEncodingConfiguration.rs":"47b1612887cf606fe20bbd1cc7e424ef674ca4b4eb0d1dcf3776eb55ae554d45","src/features/gen_MediaEncodingType.rs":"4df0d9c6b90674d65762bc724409a13abfbbbe9249820fc6eb872e9e0d978904","src/features/gen_MediaEncryptedEvent.rs":"43272922cf3d95954422ff5f6ada0fa79c2ffab6888714ffb6fe471c193fa870","src/features/gen_MediaError.rs":"09543dfa52c52415cf92bfca54460517fed15822c47fca65c876257f8417b96a","src/features/gen_MediaImage.rs":"e50ceb9ea29a337348436710c111e191434b323795ed65e9d997d20b62c1caed","src/features/gen_MediaKeyError.rs":"05ec34968e1777d16555b1d0b6aef536b255f9ec23509348e1591c7d9b20b778","src/features/gen_MediaKeyMessageEvent.rs":"1ff46fa351e669d69d8dd1aea5030a3015f83ee812db48a3e947ec4c9c6aeef0","src/features/gen_MediaKeyMessageEventInit.rs":"25894c5cb1478ddd4ede797ef176f45ca30a1926db695e5dfcce0db4a3462d43","src/features/gen_MediaKeyMessageType.rs":"7d7768714bf346d1e278637576f82fff41b731f3426f9e87a5f977cb5e6513af","src/features/gen_MediaKeyNeededEventInit.rs":"5d41a45f976a5c083173a8c545c4f78b65e1e0508f35908ac033ff3319add16c","src/features/gen_MediaKeySession.rs":"171a9e8f6900321f29457ebb1817d86171ebe9e25745b21da0632b53ee380f89","src/features/gen_MediaKeySessionType.rs":"ccaa595c59ec9822876cc7f19733e4235fc8ed8757c805e2ec62b9123a3db3c2","src/features/gen_MediaKeyStatus.rs":"84b494af1ff0f280212c4cd7a3870003b2b3dd6d81effc4c1b0d726f557776f0","src/features/gen_MediaKeyStatusMap.rs":"6b9998312edca6fd61c12bd07e2f4e7c401796ce6c61c6889d8671a75cfba394","src/features/gen_MediaKeySystemAccess.rs":"5fe55a3799a819ab9d66de3eaeaf1abde00c748d80d875d6567a4f4dde8f0ba6","src/features/gen_MediaKeySystemConfiguration.rs":"10885228b1f2aefe3334c8b81eccaf7ba279cd2d0c06fbf118c317357ac7d166","src/features/gen_MediaKeySystemMediaCapability.rs":"4eeac88eb0383412c65843d9dbb644b41cfdda2b25f90ddf2bef88cc287eb710","src/features/gen_MediaKeySystemStatus.rs":"9e8c4583447028582c00728ac99541b9c218ce2bda3fa9611bf994376bc57977","src/features/gen_MediaKeys.rs":"08cc712c57c3ed89e998528dfb7841a4e13b8e61c7c5c5dea9e23fc95638a1c4","src/features/gen_MediaKeysPolicy.rs":"d4ce8a419a9782082b3cb1f8af23980a26e01823549bf793be0c3e812aa8793a","src/features/gen_MediaKeysRequirement.rs":"a27c91277d6aa7d31f5a2ac6413c69ee5fccbb2fe2f537dddffee54134659ce4","src/features/gen_MediaList.rs":"e51ed7accb171549dfb19ea4e6f57340b299e7086145b9e0317492873c4b5fd2","src/features/gen_MediaMetadata.rs":"7455a490ededea4abf0141e3ea01d7711a7fdd5d23694bdc602c6f9db27d8654","src/features/gen_MediaMetadataInit.rs":"1a5c5a1a560b5ad58afe4308738c17961ce08c26c6ec414971fd18b7f7a2e5a1","src/features/gen_MediaPositionState.rs":"2c8d26750606a49914559b9734e79d0720526a20675750d6564b567ee7494c81","src/features/gen_MediaQueryList.rs":"4d7ade5b006b5d0a41b6c946c94a05fd8094f013e994e6b50a707b19525b0a0d","src/features/gen_MediaQueryListEvent.rs":"9ab20240a365f26915fdc7665deb978d1f07220234389bf698eb5787a7d8c009","src/features/gen_MediaQueryListEventInit.rs":"9970860bfc187bfd10e46b49ad1031ab4adc5b356813ea082e252e495ad92278","src/features/gen_MediaRecorder.rs":"a4e3068d22914e97cfe54e5be7c29f3c54b40c666202c945b9b2ca93d5eed6e2","src/features/gen_MediaRecorderErrorEvent.rs":"95f0bf371c23e551403897ef9772567504fd8d06a93f877ecbd5f2de27ac6805","src/features/gen_MediaRecorderErrorEventInit.rs":"1edcd8f5df871d7c8e36290766af52babc8d556ad55d2c90d3238b357acb4c59","src/features/gen_MediaRecorderOptions.rs":"dd66440960657c159296907a1c5dbf3a95ff12e5f663f723207c232904cad00a","src/features/gen_MediaSession.rs":"b2db222fefcb3ab85f24eda34d109dc04641f485dfcb11280221731ff7a0fb59","src/features/gen_MediaSessionAction.rs":"6041db37063bcabea7ccfafeea270d8cb47d5696af29c0cbcbede84733564daf","src/features/gen_MediaSessionActionDetails.rs":"ee83122df5e28263c4922e83a20c51d820db4ad5ec64e97749844ad4b41f7d57","src/features/gen_MediaSessionPlaybackState.rs":"d4a2b569ad5d9230f7f3660565b01e4aaa0a98f31815a1dfe7af0dc19e1e51f8","src/features/gen_MediaSource.rs":"ebec12077e7e6d7b76a4d757f6c4c63a757ace8f891102eed25360166236b1d9","src/features/gen_MediaSourceEndOfStreamError.rs":"7c3cf43ba95fdf0eac8d1a2cb2909a0531391d8ea847d07eced4b2a1f9aac51b","src/features/gen_MediaSourceEnum.rs":"aecde33a8d44c7502b014a7b024b1dfbec2025744f63183821e1c3e1d34e76a7","src/features/gen_MediaSourceReadyState.rs":"af7a2b78f877d8d7df0c6a4a63d4ca93fbe34223e9e2beff88fef7248fd14265","src/features/gen_MediaStream.rs":"2fd8ec437b476b9205f92935729a67ea8fea80d20e24b3db383cb6aba882fd37","src/features/gen_MediaStreamAudioDestinationNode.rs":"2cb00c542aea26fbdec4802b58a5b9ce35a66ede609747b32e820f4e1046f7e8","src/features/gen_MediaStreamAudioSourceNode.rs":"3e6b82f03890d82976b5d48db7145e63981f2cfb9f7a86cb685cdda58e33a239","src/features/gen_MediaStreamAudioSourceOptions.rs":"c76437e54686f61e8f6dd38c214438fe83651d5ab24b6e08794e31a9cc22d408","src/features/gen_MediaStreamConstraints.rs":"47b764c64ff2a0d86affe91f2d6402d7ae2f549557b156c77ce83671a708c88b","src/features/gen_MediaStreamError.rs":"b3c74e1c82f9535ec3d3f26a51d30d76397b97bd0fa284bf32d05139c3225776","src/features/gen_MediaStreamEvent.rs":"f4a4dc8ff06b45bb361b16226463a68923efff5978ca690c57b8ec3605102217","src/features/gen_MediaStreamEventInit.rs":"89f183eef87e1085acab6dc5709dfb2c32a1f645e42e63aad72bf94fdaf475d9","src/features/gen_MediaStreamTrack.rs":"90e2db66267317d10cd0e0c15618840dbd80d0a3c0e5a0d529b0bae8d1ff1ea6","src/features/gen_MediaStreamTrackEvent.rs":"a507298ab5131eba7f2f7f7779d5bb7952471f6698b36694c0b3e4eb58ba7a39","src/features/gen_MediaStreamTrackEventInit.rs":"77ea734f6a29d7b75514aae744b3f70bcc99f2d997987cbb3d621df4075e0a0d","src/features/gen_MediaStreamTrackGenerator.rs":"3b60bac5e3c8591f777e95262a3221d8b8a5c19754313cc545e247f0242f4bbe","src/features/gen_MediaStreamTrackGeneratorInit.rs":"eb27053c0fbf3dddfb444719ccdd2c2e7f8c6cb0896d3e674e7d89dbb9886291","src/features/gen_MediaStreamTrackProcessor.rs":"5e6a539b0b12950393155d72e9cc28a33a6b870cd58a13d24289dcf035267543","src/features/gen_MediaStreamTrackProcessorInit.rs":"0e6012ac528458506cc4217637b1b9fcc0b76cfa77f60608ee2d457d708023f7","src/features/gen_MediaStreamTrackState.rs":"60e233672eb80152c8a8267cb1ea5132d2a959b8df34d3d1d774fcbaccdfafce","src/features/gen_MediaTrackConstraintSet.rs":"14bb6b6101a96c46dff452b2bdd57e0bb4ce15966468a639287ca4ec4cc9d544","src/features/gen_MediaTrackConstraints.rs":"fabf0db4431c4e89918f7222deced3f7bba2c75c463585bddc7f845780d16e1b","src/features/gen_MediaTrackSettings.rs":"95e90d19d850979248cbb233acc7114b55616f96b13945905ddb7ca277378f30","src/features/gen_MediaTrackSupportedConstraints.rs":"92706f730b947f543d1dd44df38117d6651a1005989f1c14d532d03ce98a6ef5","src/features/gen_MemoryAttribution.rs":"fd1b71d59dc2752912de6ce9b9ded52f1f92b4a6ccc160ec4737815144596254","src/features/gen_MemoryAttributionContainer.rs":"db0a80811f32cb91e8cffb1a9bf48927a8d7e8b095ae1b15dd0236729421d909","src/features/gen_MemoryBreakdownEntry.rs":"19a2a702a6b5736e13110ab3e1c1d95a3d0e5fc303f2e05864c9a4827b410263","src/features/gen_MemoryMeasurement.rs":"3da484aac77ee2d3ae7470a386066441e5272eced1e98ae9818b08aae3445fcd","src/features/gen_MessageChannel.rs":"90ddcd571426733c187e984c52d35c87b6bf7b45541cbb2d82d6ca15aa161a24","src/features/gen_MessageEvent.rs":"528d440ef5fd62da17fa117c462f216ac50c231fceb3c3ade4003fe5760d71bd","src/features/gen_MessageEventInit.rs":"605b686753e887758d4e49853c7985dcc5127b7995e2dd1898d7368a025e8eac","src/features/gen_MessagePort.rs":"e72a8d3fe4c2397cb775ffb1cb87a700b69c75764400c54b297393ac37176e64","src/features/gen_MidiAccess.rs":"f1ec878192a8f25cdcb82727ade4e8f8835827ea6ce858ea7d39752921565992","src/features/gen_MidiConnectionEvent.rs":"d9d3ea88634d34cecf4c7f28f659835fa798b0fc82df227c66ec23fd6e74e3d8","src/features/gen_MidiConnectionEventInit.rs":"f2ee2c440c27b215be4e98c8a0b9e8f3bcbe43807822b1e731c207468643fdf1","src/features/gen_MidiInput.rs":"862d9f6df4e4f1043a55b1b963401c172eeb0caec6e2b97f8b232795ac6cd2ce","src/features/gen_MidiInputMap.rs":"823aea47c8adecda0ed24a6be25392766df70a3f47c099e4603b64e8c7e11fdb","src/features/gen_MidiMessageEvent.rs":"892d8a7b6f0ded04996ca7ebf1fb0619225bc7251131a6fa0c48350e837099fc","src/features/gen_MidiMessageEventInit.rs":"dbd78e2942103dac7e291ebf425e1c13cec0085c7ce13140ded7d6869c12edef","src/features/gen_MidiOptions.rs":"56e6c0c0390b89d5d4065523b49065a38348ca0c1d17f3c810e3c9bd5ddffce4","src/features/gen_MidiOutput.rs":"158b148c24bdac164e491651d132ebabc67fa42b8629b6f621c093b4e1fd4d69","src/features/gen_MidiOutputMap.rs":"b49b063c30fae4b72e70340807a00e5829f5f16d3b6b24edab9bd959798484ec","src/features/gen_MidiPort.rs":"296134c2822c1558df115d3c05b01ff379aad1f481a478f61642dd9ad4fa4316","src/features/gen_MidiPortConnectionState.rs":"e305dc46eb590a8e76c098c27f24adcd2dd6e181973a1af45c6e4b49df8438be","src/features/gen_MidiPortDeviceState.rs":"684964649c442af5c3f393ee4f7ea17c456654da50fbc3e77581216f74f00f57","src/features/gen_MidiPortType.rs":"f030980b943fce327115f2a21e378ffe77f787b097f6fa174ae99ac671868ff6","src/features/gen_MimeType.rs":"ea39e0116eeeb796baef5cd592a2c50c1774f99a6725c79184a8ee8f59fa0826","src/features/gen_MimeTypeArray.rs":"70f8ddd7face2e7b9d2f7613a606dc01ee47a6a3fbab4fb88989b250e8e9a24d","src/features/gen_MouseEvent.rs":"744067e6edae947f5ee8e0cbd34e57d72e7cd83f95121099f665d80640ee3a8c","src/features/gen_MouseEventInit.rs":"5cc092e6cc4a00008397c907b52195f33828acfffaa9772e819d581c42f2108b","src/features/gen_MouseScrollEvent.rs":"e8807f52b667c9a6d60827879004ec5ffc444c4ce4c10f5f724254088d0f122d","src/features/gen_MozDebug.rs":"a12b0881b7d709edd5fb635c89291c33401b5cd88ae523899dff9e5aacdb7841","src/features/gen_MutationEvent.rs":"798c8e4989c3493231fe9f548876c5993633b57dbb76ffc137ac97a1a9bdaad2","src/features/gen_MutationObserver.rs":"2b5bd53b741a7c150933d6dc963f70f19fc16413d16fc697e8e8b7143669046c","src/features/gen_MutationObserverInit.rs":"cbf90586c194ad02ddbf6d1d41d42a816967359c5f40fe8fd6cfc8cb75793f87","src/features/gen_MutationObservingInfo.rs":"edc536bfca7579b4652c38f255d96f55710442c440c2a99c87beeb4dcac067a2","src/features/gen_MutationRecord.rs":"87eac3e462dea50aa5d5e56375fe471febe89c7298b73b46aeeef78cfd258e8e","src/features/gen_NamedNodeMap.rs":"7e88eba9b250d2d7b9db3ae1d2d4be06610e67e4a5558378392eace26a598c6b","src/features/gen_NativeOsFileReadOptions.rs":"7ced578bb2c58a2a19ac890df800f8e5277e2913ece4e1abd155d94ba0e7ff50","src/features/gen_NativeOsFileWriteAtomicOptions.rs":"7cc1298a7b93e33e5cde28a47201d9225642ee77287ae396f3477ea0f000c2f8","src/features/gen_NavigationType.rs":"4f073deaf31b99f07a359f12c5366c3eb5a7e9f1a0be88e6d7ad2339b8ff07d8","src/features/gen_Navigator.rs":"04e81df5abe88fd162106efc67327bec17e949eac74e08ec4d8db611184d8438","src/features/gen_NavigatorAutomationInformation.rs":"e8c68b8079b3c6445388c90c5bcef54d89f95797b8826c5152bda8085cf7b9ea","src/features/gen_NetworkCommandOptions.rs":"08c2127b883d50e836a8743db57c43cb8e750c026d03dc0665dc33a7c0b1cd7a","src/features/gen_NetworkInformation.rs":"b103ea140d1f72f1fff507af635d3e7ae6f45f67ee83ec55499a0699a941ccc1","src/features/gen_NetworkResultOptions.rs":"fa47520ff00b7c8c09acc50e98b41dc98aaf1bfc8e8fc8a2d47476d6f1b3b0b0","src/features/gen_Node.rs":"f4c652f29c11156b6a64122c9827031b56a2e1bb05c6a1c969971751a6959a86","src/features/gen_NodeFilter.rs":"dbe8533d61602514245543d158609cf4cb2a5c09f00e4f195e6f533b720b25aa","src/features/gen_NodeIterator.rs":"e57962ba4674006f9c5538595e7f48e005b9b8b53cfabf29b10fe2541fd7b712","src/features/gen_NodeList.rs":"7250441e6abc77a92ef9a497076ba14b69ab600faec4b793719d9b790099a386","src/features/gen_Notification.rs":"0dda9037a797bbb5607ddea4fd0935c6c03890593e72128b69865d28ad17099b","src/features/gen_NotificationAction.rs":"8d576fd07fc6e9fcbf71c5b4d9e5d2d17e3b9c8cb210b38745a5faafc1408809","src/features/gen_NotificationDirection.rs":"bbb2c98b4e2b3918fca611e264ee1b6f38e08ac3379f86c99cd033475035eba1","src/features/gen_NotificationEvent.rs":"639da39dbfbf90b480376ceb07fa4024e9271cdbb28562a101ce0936986570a2","src/features/gen_NotificationEventInit.rs":"6db00374683490e1c1c0078c43cb9cfbaac9722e50b0d6492061583c4eed5892","src/features/gen_NotificationOptions.rs":"0e9b925662258eaafee7855a96a4a86b0c13fce6e27965208e1395c39d2cfb5e","src/features/gen_NotificationPermission.rs":"370230c16c6e6d81a8ae195d724f938d58dd3db674e71d5003ca6a525b632085","src/features/gen_ObserverCallback.rs":"98c111a515dc2ee5c38980d6e2f185b83dfaf271247ff61c563402e23023a40b","src/features/gen_OesElementIndexUint.rs":"b79e186b250b5979ed2d7e1ee062e47e3b75bb97977d8a46912304e626ac0e7a","src/features/gen_OesStandardDerivatives.rs":"e6e0f9278eb8991e6b556b8c47e1b7ded706450d700448d0c6a34cee75db64ef","src/features/gen_OesTextureFloat.rs":"fbb7c8a7c73b7faa65b15b06564c006f11a2ca855f05eebbc76b65f03e03ca56","src/features/gen_OesTextureFloatLinear.rs":"afd9775c76e873186775a5b980861e95c62bb1868422a6a237aae83178dfbaf3","src/features/gen_OesTextureHalfFloat.rs":"9fc4e416bd233c7aac695bad24aaa00ce68b7061492137b8883fdba11087c107","src/features/gen_OesTextureHalfFloatLinear.rs":"83bd642b12ffefd083f3f6f5be1ff63dd9015c7870004c30c7db19a5aefc198f","src/features/gen_OesVertexArrayObject.rs":"a84b2d5d3a3cedfd3db726a146f971a1510e116b840227980501435e00369ef5","src/features/gen_OfflineAudioCompletionEvent.rs":"10b44cd8425f1ab180690dfc95ab6186eab9dddc849f3aa5413118ebb5da8d23","src/features/gen_OfflineAudioCompletionEventInit.rs":"b336618b9cbf21bbb8bfc77c47739e2aba2fccdfb861a7c22b935dc6d0fae782","src/features/gen_OfflineAudioContext.rs":"a7f6d8a14652b744702a765c22a75a0e141b94a2f42ee3f5a7ed0cb2eff5f3cb","src/features/gen_OfflineAudioContextOptions.rs":"6560aaae0e68aac843c7e2f11da58d1816af99f6ec56b191c3fcc0be41aa33d7","src/features/gen_OfflineResourceList.rs":"a088dff292704be1502f70a93471a12f20f67b820c02ea8e795a459d4b1d29e1","src/features/gen_OffscreenCanvas.rs":"9f504626aa1d26c14d1f3a77c06967710a96b53e74ea2dc04705794226fcbc2e","src/features/gen_OffscreenCanvasRenderingContext2d.rs":"a62fab40a13068aaa555bb066ace036ccfd919825a4111d8785d92341acb9c83","src/features/gen_OpenWindowEventDetail.rs":"e6887d57f05beb441c26254597042b22d19b4aa73914cf883dc3f8f0ccaeb4c8","src/features/gen_OptionalEffectTiming.rs":"0605622c435ea32e6d7e5367204ab5c6cc0634347f7ecff21bd85499c9eea841","src/features/gen_OrientationLockType.rs":"987eb55f23b9152b38b3ddf5049cb619ac7e2a962406ff572ff906c7928926ca","src/features/gen_OrientationType.rs":"813f5e9c8bb9a3601fc42e811880e4ca5509e0f7beeb51b1aa2ce0a9db6d68a6","src/features/gen_OscillatorNode.rs":"9027efc4b3169bdd57ce02668f0f6820aea9c747409f94e45e852df395eec4f7","src/features/gen_OscillatorOptions.rs":"817d49de786fb96ce890b226030372e882fda2a2f495363e5ebde81af9248ead","src/features/gen_OscillatorType.rs":"cd13084dab02a8dd042278ecfb7a8083cb70c626487aa63efd9a3a9e3b52aeba","src/features/gen_OverSampleType.rs":"18b92d95d3f5bcf97eec28e1d166a32df0493819d9dfad17e390cb7a0b2d5d67","src/features/gen_OvrMultiview2.rs":"b00ba8a8cc917da69991575a82d57ddda8b8fd135d29866bb8bc224e0aff31a9","src/features/gen_PageTransitionEvent.rs":"4f62637150ec2064aa5e837acb133a1c76d5c4cc6ea189522e6936259a2ae617","src/features/gen_PageTransitionEventInit.rs":"8b28a033279508f968febff92288902395b8685b9a23f6ea6e032f75b8f083b8","src/features/gen_PaintRequest.rs":"468944d82440e982c1fd8cfecb0fbc4d01b7e46f9e814de2ca09e70ac34047b4","src/features/gen_PaintRequestList.rs":"221972c7b627191d511b4684ef0a9342c1fa628ceacb859ce2e730f5e08796c9","src/features/gen_PaintWorkletGlobalScope.rs":"97e2a518a38109028c4828e3275445220c2165432e0085d2ab07f3a5f138d6dc","src/features/gen_PannerNode.rs":"9c82ffeb28bfb9a0af06f2ba94cfd8ce2aa047aced00594efcac97c0ab3b7beb","src/features/gen_PannerOptions.rs":"851bff8a54867fea4fae6cbe2bfb10d2c4d55a0e944ff91022dc336a856573b3","src/features/gen_PanningModelType.rs":"8b96b1cba3ab177741cd0d9aa8df232f4f10252397c464c13c0447fd29c587a4","src/features/gen_ParityType.rs":"5503e75a17f074cff994f47d27ae099ffd0d6dfb0fc27d15b2658627d54bc7fd","src/features/gen_Path2d.rs":"dceb735e674d929b14df0741fa09a8068d67f479ebb0db1a06dce9ec8cb6240e","src/features/gen_PaymentAddress.rs":"ac27dc10089e7f75b9d6b65cee0861bacc3361fd2862cb692305a4c675263963","src/features/gen_PaymentComplete.rs":"548a78e5bff05cb7c5486c76f118668f803ff2fdb7ff5ef259ca055df4427d77","src/features/gen_PaymentMethodChangeEvent.rs":"377b87f796766558db63a4eaf4843e0da5d63db9fe7d1de7040dd1663cebcf1f","src/features/gen_PaymentMethodChangeEventInit.rs":"632fe554c7dc3aabbff3b798a10a301391646e65b7f74b71b8710eb11c652b6b","src/features/gen_PaymentRequestUpdateEvent.rs":"7f0be72ab066d5569a76742f91540d4a59f364b12bfda984b678aa320caf3cee","src/features/gen_PaymentRequestUpdateEventInit.rs":"5c8f74a7de44b948f488559b1eac3a475c5560d44f5860f1e1bd2623639faebf","src/features/gen_PaymentResponse.rs":"574c68d8eaf164900d5475d1b6f5540d91f83d5364c2de251963f1b2af0bf86b","src/features/gen_Pbkdf2Params.rs":"1cd849475909f52c086eb79bdb0dbdc0dca5dea14e3c1947010a50ba1d0306a7","src/features/gen_PcImplIceConnectionState.rs":"f21f4dba3ed64c75e7dba65c6c87fa1685199756db83a8e6dfe9224790194b9a","src/features/gen_PcImplIceGatheringState.rs":"9873ef4688dcb5faa86b3904a70fb7a4eda61cac459078f8478eccda872916bc","src/features/gen_PcImplSignalingState.rs":"3e9beb92e4645127636245971f65bf5f005f4bbdfc3be8a3c15534d268f29bcb","src/features/gen_PcObserverStateType.rs":"b2339607bccd0848877ea3791a3aee9d09204ee2301386616574e1d6b0c2331e","src/features/gen_Performance.rs":"283abbecd1e76771b074bd17d3c919be63be061966156b18300a02004b629c8b","src/features/gen_PerformanceEntry.rs":"a1d163527b2b5d298583bff0d7e0f5e298916e0555ed813f2e7133c4584c8e23","src/features/gen_PerformanceEntryEventInit.rs":"d9047a79b9e1cb6959e72b7b4aafc944d8d59ca3ecb4492138fed4a8781ce916","src/features/gen_PerformanceEntryFilterOptions.rs":"44f4de8afaceaaef77f89b621b3f4a24a9bc228a50fcd5b2d2f7f95ed6bc9e59","src/features/gen_PerformanceMark.rs":"2f3e720d6d239308bf8e8b9f61d8152e396f8186966172aeb9e1fb99cd130985","src/features/gen_PerformanceMeasure.rs":"0b9b93749e026e4cca74dd846736b9ded62576c949ab2394bdca5dd7e8e55f8d","src/features/gen_PerformanceNavigation.rs":"52ab7aa8f5efdb05beec5851fed95bcecccc0dcdd63642e96481d9081995163e","src/features/gen_PerformanceNavigationTiming.rs":"b1d6f3e10062eb31dbbdf5a29e45880c023dcf606fada4a3081d48919aef8c60","src/features/gen_PerformanceObserver.rs":"03a36768e8249bb5ef2e9e83a34d437bde27dd8e80bd37445e5d275314f083f5","src/features/gen_PerformanceObserverEntryList.rs":"4249028e2d94f43c3e7747e0c858cdaa28ea34772a97e899dabb9f85997bee13","src/features/gen_PerformanceObserverInit.rs":"285151558ed8673ffc8ce88b3854d445314e421c25908828c1616f4bc512cb43","src/features/gen_PerformanceResourceTiming.rs":"c0421e1066301834b469409cba32d237189cb8b81ca8570636606eab5f921407","src/features/gen_PerformanceServerTiming.rs":"9434899f4267e553ff7d179ff107fbc15fb1d77608c95b7d09262a2f62b10dde","src/features/gen_PerformanceTiming.rs":"a971a00e12bd305bbd32df2303255566e0b7117c2c01d6d2e2adbf4c1c03a508","src/features/gen_PeriodicWave.rs":"30d36fb6ceafb9c793437e93834186eeacea1db3922a29566a8d16807e739252","src/features/gen_PeriodicWaveConstraints.rs":"928e9ebccca8e1d1027cce6127081f7638c567c7cc3daf5b372955ff16e7b0d9","src/features/gen_PeriodicWaveOptions.rs":"5c513b1940315ad451f370a5e0fbf5ef37a12c75b864077230bc93d0c60ecc50","src/features/gen_PermissionDescriptor.rs":"d93c5644beef31854913da0143c8c6a38c2483ba1ac99392006bfce329e58b08","src/features/gen_PermissionName.rs":"be40252fbf78fdbe45ce98e71b3b23dfc2a383b6a53e4e503cf1bdc09d590fcd","src/features/gen_PermissionState.rs":"0e0a343cbebd9a2ceb3f53a7cf0cb5493603c16828386f75b7cbddb1489bd92a","src/features/gen_PermissionStatus.rs":"176cca45428a2f5ae25fce1fd16cfdd01ab5eca4a0e5fd90a4df714203ab095c","src/features/gen_Permissions.rs":"6fc71866f8623537d120756ace620835a0f6a4a241d5c94e80e0c65227e4d3ee","src/features/gen_PlaneLayout.rs":"2a95302c76a647fcd4f90f589bfd6951961f3a0611273d56697ac39211773128","src/features/gen_PlaybackDirection.rs":"e0b8abb2584692a3187149bd80297e1dfb3b8ac32d25095a0f725e24b1170d97","src/features/gen_Plugin.rs":"6c5f4bf8064f03b3962b8ab53764578aa54301b6a9e54e882877f2402a0ace7f","src/features/gen_PluginArray.rs":"7c26114770e7592c76775a47b1cabe83d9f6fa213629af5cedf8a55301a56ac3","src/features/gen_PluginCrashedEventInit.rs":"3f79e6878be161ebd739fc4b970989e341c837f5370489caf5381f536a26f88a","src/features/gen_PointerEvent.rs":"d31532d290fa9f704df400a5ab53402d1393dd5b3d38cf06a61a6099a787b792","src/features/gen_PointerEventInit.rs":"06abbb28f5d9ac0d6fb5d0fff4404cc0185efbd5f2053d0ed83a6a9b6a701d4a","src/features/gen_PopStateEvent.rs":"6a869c0e72500867b831494685588227a5184dd4983bc701ad2776c6cabdd3b5","src/features/gen_PopStateEventInit.rs":"5a9d1d850140190a21674ffe068013670e0aabfdaa6ebbde5db517bed38b4906","src/features/gen_PopupBlockedEvent.rs":"facbd804ced0cf6d1e6066c8d53922ad04e18bfdef31d9cdda98f75777837d69","src/features/gen_PopupBlockedEventInit.rs":"22ea049599a7e2d8d229020a341db6838bcb031c4a570dd62e011e6d9483d0ac","src/features/gen_Position.rs":"22b05f3161d8a4586af0155dc2538958a85a033ceb2bc4167c0ccaca2e5ad42d","src/features/gen_PositionAlignSetting.rs":"f2ed593481eea26584252438e2ddaa81abf9c26be3c3737089cfd2025086c7f0","src/features/gen_PositionError.rs":"914ecd97c1a73b7021cfb66859d54d49cf2f3384e9c76c1686a368da0db89d33","src/features/gen_PositionOptions.rs":"18a5db98b28bada8181a151ff4987a226cf167ca5cbf760316e45d03cdfadeed","src/features/gen_PremultiplyAlpha.rs":"b4ecca471612e50f211b2426fc847654e882ffa0f8cdf54a4fc73d304ede3263","src/features/gen_Presentation.rs":"ad1bd472499d90d4f0d840bb9b9a3d0e5e03c9cca8742563a7a0a2f35792088e","src/features/gen_PresentationAvailability.rs":"576d8fb2f584bd1be20357ef59bdbc7ebd5bb67e4ae213155d81d99225fb7078","src/features/gen_PresentationConnection.rs":"41494b748e7a8c460c5fc0acfc5f611a6cff530952fb8a1d967ab84324090094","src/features/gen_PresentationConnectionAvailableEvent.rs":"62f1a09dcc701743892036fe82218b9b8c4e7ac4d5ea5b4f9dac885048d9c9af","src/features/gen_PresentationConnectionAvailableEventInit.rs":"550c60a21acf8216994f9be051c0601a40d855558eb5c8b779ae1f76496eee9b","src/features/gen_PresentationConnectionBinaryType.rs":"14940054e35a841e6c7170b0703038e5e3212d16d4d6a97173a039a42045b8fa","src/features/gen_PresentationConnectionCloseEvent.rs":"398ea414813de4c7b1b34eb6210c418fc16042194dacd4e5d6bc8e19a53c8f0b","src/features/gen_PresentationConnectionCloseEventInit.rs":"2860b758ca8d4b006087fd190bcc79e334c7660722ceca3b86c9d45f179210c1","src/features/gen_PresentationConnectionClosedReason.rs":"3706f631259dd21ef64bdd79e713adeb7cf54be30a7b64b9cce12025a86f8ddd","src/features/gen_PresentationConnectionList.rs":"e91af0d1d53f6e81647e8313e9a155e8c49dbfc3f114fe5745fcb7e92c4d42f6","src/features/gen_PresentationConnectionState.rs":"2c871eaebe3c1f42511a22fdd29b6a3900c5775dfa1dca9e66f5822c83daafb5","src/features/gen_PresentationReceiver.rs":"4c1f36c12ccd9f41690a4da56ba7eb5296eaf1283701bc50161e07b67f650873","src/features/gen_PresentationRequest.rs":"01ef29504c91c603da3c4dda13a2c187340d1bd98450b42d68b0ed9b9daf86bd","src/features/gen_PresentationStyle.rs":"e523c50092eb5a2a2c97f98256d4fdb27d5377c839eec77f34c1154c75ecaab7","src/features/gen_ProcessingInstruction.rs":"a86e2e63800a8653878cf2231d6c9706190ca8a55582870d4b66f954ae460079","src/features/gen_ProfileTimelineLayerRect.rs":"1e91a879278972b86b5b1098330a108a46b0dfb6b2402fcd32cb0bba191ab5a0","src/features/gen_ProfileTimelineMarker.rs":"2abd3a0748bf43bd905cb8a49c3bae2f209b2022d687653a63478801200dae6b","src/features/gen_ProfileTimelineMessagePortOperationType.rs":"4a53015df740b672d2cb19d2a1899b35afacffeb1fd4882cc615ed5805f0625d","src/features/gen_ProfileTimelineStackFrame.rs":"dcdee283aef92f1d74ebdbaef54d6508435908a8b3e799ee4db0b0325937c92c","src/features/gen_ProfileTimelineWorkerOperationType.rs":"5d0d6d70abbc4424173fbd7d0508cd22fe01643aa36e30b3b1307f0c6fad89a3","src/features/gen_ProgressEvent.rs":"03aac3fcf3474a971dd894c9199e1c2365366058dd2edc0600a39572a8d8465b","src/features/gen_ProgressEventInit.rs":"717f4b38ff20a831eb4eaf9d9f8750d7abbb98bfc8ba50839a8cf9b7da281228","src/features/gen_PromiseNativeHandler.rs":"8356d5714486363489424575d2c0dbee0979d1956d9938cc918f5649d4a1e787","src/features/gen_PromiseRejectionEvent.rs":"f29fbae4edfc7b6d1bc1cd8cd47c6fd78ee81096a0fd62f60b10a22a248f132f","src/features/gen_PromiseRejectionEventInit.rs":"f701975d52a6c3b141f35db14b09355750bce3a3671e5ec299232d4c533d2766","src/features/gen_PublicKeyCredential.rs":"8da8c49929461f8ebe7dcce985c35527a58a43af04b0752ec17ca3d17368be45","src/features/gen_PublicKeyCredentialCreationOptions.rs":"2b4acbf0ef649b9d5e32b256986b307b736152dd9fd2085ca0efcdc700dd1b39","src/features/gen_PublicKeyCredentialDescriptor.rs":"57d11266052dee2a252e9efc9d81ba33d5a473c6988475a572024456f4cf96f8","src/features/gen_PublicKeyCredentialEntity.rs":"1766727b3a576ca112b8d915d05e05f75286cddaae3b3f5f7157dc9831cbdc95","src/features/gen_PublicKeyCredentialParameters.rs":"2ccf923d69f50963112f9767b36ec4d7af3ceb8569fa08e824f77581e68c62b4","src/features/gen_PublicKeyCredentialRequestOptions.rs":"a5df863158fbc34d36cb0a09b2523721fc6793ae8396e542f3644c4ba9162a18","src/features/gen_PublicKeyCredentialRpEntity.rs":"8a0c751c4989bc5643ab860127cd7b291724817a241bc742d6467b70a95964e8","src/features/gen_PublicKeyCredentialType.rs":"2fa53e1f9c1559b9d2b97a457a0e73bcf570fe29ba6ca9f81fc66c5d345fd979","src/features/gen_PublicKeyCredentialUserEntity.rs":"a525f6bbdcba70642addee41a154be60f95f69a9fc2a1af5814d954e2e9f0118","src/features/gen_PushEncryptionKeyName.rs":"e254e739e6d569331f53e3dc40a6e58bebebc761bc5ab038655c573117956091","src/features/gen_PushEvent.rs":"8cfd0ae71613f5bd823694f0b3fb7fb61a761ff9e1df51fb6913a86e661216aa","src/features/gen_PushEventInit.rs":"250374814cfdf7fe00e1766aac880a960e634ecf7c2c2865e91954e9c4343a3f","src/features/gen_PushManager.rs":"6f76c893923e46d40dabf22a67172e705de0f619eb240bb35db90384d9705767","src/features/gen_PushMessageData.rs":"58a06eac3d005600f0cc5326daf329869984768050790cb0480b50f697a04a52","src/features/gen_PushPermissionState.rs":"1a85b221aee9e0b8c1f65c0c27904d4731987e3178179a765f97c520e26338e6","src/features/gen_PushSubscription.rs":"22299648dae11e856bf5ec693c1a82f66efa1472ddabec3bcdefecf548ac58b8","src/features/gen_PushSubscriptionInit.rs":"8740069503123507bce03d98cb5b13f3a1ac948316937c82820510c78189710f","src/features/gen_PushSubscriptionJson.rs":"671fe8b739679d6d3c7b18cbce539a7895245ee94de95e0fbfb23784d20c16be","src/features/gen_PushSubscriptionKeys.rs":"48e59f1022c8eb962ef005f635d08af31970656451e50075b51ac97e836d1af1","src/features/gen_PushSubscriptionOptions.rs":"63ff5dc5bb6505069023d155fc3bd66a82c4e0611e87f3723e5b24ccc7cc8a96","src/features/gen_PushSubscriptionOptionsInit.rs":"541c793b4953ca71ef227d4dc1c5bd4b3dce0d81e2dc0b77d9d5e71cff86795b","src/features/gen_QueryOptions.rs":"fb85859efd590209034c2867f37d25a0a0e8e2a792787f7c6156d86a2acf2f88","src/features/gen_QueuingStrategy.rs":"844033eabad5d8ee2fb27651f9493e79bf30dfbdf60c39b13dd544f2a2ece73a","src/features/gen_QueuingStrategyInit.rs":"ea721a5fafdd5c4cff8645996883dc6abf472e82e82a26c23307820400ccc475","src/features/gen_RadioNodeList.rs":"c3b52e570b2be848e9abe2b5d8d388cf079f1cb722016238badbc4846744263f","src/features/gen_Range.rs":"97deebd332acb3fd5b81e0a3659585c986b6dae5ecbab880b2c7d37d61e126f3","src/features/gen_RcwnPerfStats.rs":"1564dc28218d0a8d0c35dee07ba294c4639e9c36a8b6294e986ed21d5985a68c","src/features/gen_RcwnStatus.rs":"e56f4d42fa9b945d2a15313539344d4fa43f284cdde1d814cf39b95836ba738d","src/features/gen_ReadableByteStreamController.rs":"63357ae3f1107fef75f06966818b23cf9b5bf533507016f8bd668f2147140139","src/features/gen_ReadableStream.rs":"c1974de094b09a69124c6f3f7712c62567c16218ba4a8a1ec71b8cddae484801","src/features/gen_ReadableStreamByobReader.rs":"929983b3aa28116302008cfd482bde089a2cc5922e7d828a7cbda42f3fac6e39","src/features/gen_ReadableStreamByobRequest.rs":"be032efc76bc085f64c6c8da2421fa2a070511d73575a8375ebb3c2a62bd2210","src/features/gen_ReadableStreamDefaultController.rs":"c9e0a9534b4c3cb7eaffeeff6591e3dff1d08be37e4d2a5afc1e82e0c4441339","src/features/gen_ReadableStreamDefaultReader.rs":"307cf5a9bf7ac899cda243b83638b2c7c4fbf6f9c13bf46fe81937fad2748c4c","src/features/gen_ReadableStreamGetReaderOptions.rs":"82f86603f9fcffc28268bdab3ffe909e2df90758a748b2dab986359092ff13b8","src/features/gen_ReadableStreamIteratorOptions.rs":"f5cd4f0ecf984c864f08d440c147a1e43f60700c2c405d2a3130bce61ce90ea0","src/features/gen_ReadableStreamReadResult.rs":"023dd762284715277ccc6215f88c482fc565c64657d1fe9e82d8e8e9560b0b0d","src/features/gen_ReadableStreamReaderMode.rs":"5efb5ba3ea0165f005155812cf4e1f8dca54415641cd809051d6415071d98a5b","src/features/gen_ReadableStreamType.rs":"1707c86a4020cb6fd279bb4c301a5bba3e80d92c7f968385d006ce3da1b8fcec","src/features/gen_ReadableWritablePair.rs":"6a2a06652e1a76fa1bc98c2c178b9217dceb604d818cedd23cf78a548fb479b4","src/features/gen_RecordingState.rs":"59bcd7668a8a907ba8d8aca501307621b75dceac84ab48ac8ce369038013ffa7","src/features/gen_ReferrerPolicy.rs":"fe559985a5f95f4df07f795997803e5f38fc3ea8cefec1d4980507d9b751f543","src/features/gen_RegisterRequest.rs":"08ef80b5d59057a2c09c8635df67fc6ab3de705ca1c0df9113af11f559b1a6ea","src/features/gen_RegisterResponse.rs":"6aa1680fa9441e94f5aaedba2a2e898f19c900b27495be8d8e4a8ffef1c029d3","src/features/gen_RegisteredKey.rs":"afa0868446b436f3e965ebec4bbc2fd682ca03f02212ac04e388fc1e3552d100","src/features/gen_RegistrationOptions.rs":"50423d9e062f53cbf3cacff8b6c7e2e7c0294ec637460033bf0df8b7360d5acc","src/features/gen_Request.rs":"455f7f3f0b6196d0995c7a22ddc7beae8eb3dc81761cf628292be3b71fe1603d","src/features/gen_RequestCache.rs":"363a9ea076467fad178082d6bed1b1c8821504a6f7109c55a0d40f6a5463fbe0","src/features/gen_RequestCredentials.rs":"a0fe65006fd67d6301524516ff5245d3658236f053ff2e6f69bc0c893ad70ebc","src/features/gen_RequestDestination.rs":"386d65ea0616c6f420c2a3f5355a62b9215a32fbb4742901b22f1e3265303853","src/features/gen_RequestDeviceOptions.rs":"f100c954d5053549b87d2e9181a1d52fe8650b93443928bddc9bb04c4c6113a6","src/features/gen_RequestInit.rs":"948d94a7a3f054e40eebd950c8ec4f96314e56725983535b6f3e7e8f32003939","src/features/gen_RequestMediaKeySystemAccessNotification.rs":"2f0e81d8f5a5f33e8e20fa2a67e6a1d8b204f8c684719af74c3d4f6e888c4b28","src/features/gen_RequestMode.rs":"0c169faa398e0e293221483dcd70dc15c5d897c4eee41154408a10c20517e84b","src/features/gen_RequestRedirect.rs":"4fab9367c3971695cac584b7376556fb8d35981b83109654b56e710806623001","src/features/gen_ResizeObserver.rs":"ba8fc29f629a2d93cf7fb91becdfd855ae4c6a494b8c1277579215ecd3c57b1e","src/features/gen_ResizeObserverBoxOptions.rs":"bc8619f5f63e3a16a9fd1fd08802bafc84d25d52dfe03d6ba2bdb88fe073a01d","src/features/gen_ResizeObserverEntry.rs":"20ae515d7a87f08d2369186fd3ef53f25c4afc2bb8eac83ad622aee307e389b1","src/features/gen_ResizeObserverOptions.rs":"c42e7248293249a8b46392fca45a9e1b04b2de84d47dbd13513593abdcc2d511","src/features/gen_ResizeObserverSize.rs":"52218e9d399492173e9f0e838cf17be98757e879e24e1b5d993c890620ea6876","src/features/gen_ResizeQuality.rs":"8c54391b672c020ba27eea4230ccb7312bbc0d380a240d9549b4588018b6adf3","src/features/gen_Response.rs":"0ab5ce1296c20f27eed30acd365b6faca05482bf4692cf5691f544d2d0244f72","src/features/gen_ResponseInit.rs":"4e60fee530dcf2bf3599b0502c99d3cd2bd83a935834fa2b27e37cbb3c77453b","src/features/gen_ResponseType.rs":"51c6035f110f10c607883a8ac31339dc705ed399b8644491621b9a7666f6b126","src/features/gen_RsaHashedImportParams.rs":"017e6a7f87bfe596bf4611601accf61e363406371de4b120690459bb449f33f0","src/features/gen_RsaOaepParams.rs":"dd9c8bb93855735f25075776c0da87cf749c7663939bfde4ca4d6eb47f13283c","src/features/gen_RsaOtherPrimesInfo.rs":"ce02b9add52345646a9e2e132b42c6cd78ad15b22167e3be1e00c07ccac6ab9c","src/features/gen_RsaPssParams.rs":"e233ba0b96680990ee9357ba6010a41b3d8d6e903d2636c6fa6237f6ac9dc57e","src/features/gen_RtcAnswerOptions.rs":"d6bc1dfbbdf8ab522cb519cea6f15f89ab3ae78e6151ac9a0d8952166609bfd0","src/features/gen_RtcBundlePolicy.rs":"3804c950ca1b58436b500f27dfcee7180915b74f1195376245b769ac40b00e31","src/features/gen_RtcCertificate.rs":"d20076174be0444464705eb7353fabc442ec76038012ed5501cf83b0cf987fc1","src/features/gen_RtcCertificateExpiration.rs":"775ba7d98fcf288e99966343e3a5a12a68ca7ef37e68c516546d4768b6bc3028","src/features/gen_RtcCodecStats.rs":"1802b839068f833e6d10dee6805e2aa67e0225ee8793ad7b824150de3fc314e1","src/features/gen_RtcConfiguration.rs":"7c26dcec23e49b1a7182146b02ae9754ab3245d19dbd0fa060ecba6dcc38458e","src/features/gen_RtcDataChannel.rs":"c49d0135047fbf89156c8f482975e50d95f13718c2245dca08ea65d10f6cd566","src/features/gen_RtcDataChannelEvent.rs":"f61afb174a7ab9d8d2b46fae5cff465e24aa97c88270449dab529ce589b7cf2d","src/features/gen_RtcDataChannelEventInit.rs":"539ea363b1c0830ef9ae8b8448ef5992ccfceb9a8c9bd0c9b01b61c1d9eca4a0","src/features/gen_RtcDataChannelInit.rs":"034033b9f9eb6a014476d4b2ddd572e862aba79384eb91a8f5d15e97c56a828a","src/features/gen_RtcDataChannelState.rs":"c0ef0db7587582bc75007dec7799ed972690c05dfd0cfa630cd51e33576c1252","src/features/gen_RtcDataChannelType.rs":"dc9bd626c4dc24d25db20590c6246cc7b618217ba7010d57ef89dcac9326b9d7","src/features/gen_RtcDegradationPreference.rs":"c10f9ef8d77b10f82ef6032dcbcc5e12c97379f728c763b39d1080de6a7fa5b2","src/features/gen_RtcFecParameters.rs":"5617fa794bd604d58edb29ee1f1062b792ad149506ac2fea71dc22e3086bcaa7","src/features/gen_RtcIceCandidate.rs":"b1fe834d7c70542d7b4247f9c46e758584a744e29bc2608f2ab0caceecf99f04","src/features/gen_RtcIceCandidateInit.rs":"811bec0569f7add98725f5fe3193fe37a1f9e5ba151468ba006c1111f8122bf8","src/features/gen_RtcIceCandidatePairStats.rs":"67405539d26845a08b2021c294934a9ad2c30eb08404a277fadfaba1d0c8165f","src/features/gen_RtcIceCandidateStats.rs":"904df81fbfa8d0d8142357beca448a51f530cb69579a0b14cc6d6e465b8e3f81","src/features/gen_RtcIceComponentStats.rs":"f00f4dd27e4487506c31c6d6b78707a8211269da31368f702dc794955db1a799","src/features/gen_RtcIceConnectionState.rs":"d9b79307c99e89dbba67d8a8876d239acf9491e31d7bd33c5556248cb7885845","src/features/gen_RtcIceCredentialType.rs":"7409d0a57b3e4d7d8495bba7a8b9ea501e76dcd88279094dc570c4c916750c65","src/features/gen_RtcIceGatheringState.rs":"05a65f05706ebb97d3f50858a2f2fb88e1b7d86828e8915376baf84a07cb03e0","src/features/gen_RtcIceServer.rs":"839fae6bbdbf3bd013403105411352662f131698680ee4861fff9a326ac1ef8f","src/features/gen_RtcIceTransportPolicy.rs":"fe32be8d9d52919c960e40bdfb3adf74ba972e5d656158bfa2b7907a4340a864","src/features/gen_RtcIdentityAssertion.rs":"91398f073e95c0cbe03064ac7e9c7a253ca6ced736bbe7d9923efae1c4459e5c","src/features/gen_RtcIdentityAssertionResult.rs":"55523f8edf705ebbe680a11ce611e2b6859fdcd995330f11e7622f542a019d2d","src/features/gen_RtcIdentityProvider.rs":"f2feea2daf80b944cc42c10f3a8103fc884c18881a864f0812e2cb0fc90358d3","src/features/gen_RtcIdentityProviderDetails.rs":"16246159be44539bbcb97a6866662836ee5536ef8a71805b1ee278f7d9022458","src/features/gen_RtcIdentityProviderOptions.rs":"1f429dd68bc669b2094668992e5b9aab4a3525856647a94b16efc4c5a9f401f1","src/features/gen_RtcIdentityProviderRegistrar.rs":"b8ba7e4e664ca83851aa0f3e260b8c2e1ca133d2479c9155bececc8da116dd8e","src/features/gen_RtcIdentityValidationResult.rs":"5411911ad7d0b3d366fcbdf98fd169da43065c69626044dfc6f9e04c606da1c0","src/features/gen_RtcInboundRtpStreamStats.rs":"1f4a032fd341994370ba36d44d204b6266ad28d2c033c14b47c7c5583c71f00c","src/features/gen_RtcMediaStreamStats.rs":"c3efeb190e8e0331f7c5b2aca2ed5703b7b7da7eb04280749e0179dbb921ac49","src/features/gen_RtcMediaStreamTrackStats.rs":"dd1657ad576be3346a04426c4c0e4a4572bbab190f5c19a8cb2c701f7ed899e6","src/features/gen_RtcOfferAnswerOptions.rs":"17ef33ceecd30261acb69ca24cc766eb8f967eaab7554bab18eace161edd849d","src/features/gen_RtcOfferOptions.rs":"20e2b0cacdf2e33d398aa6b8e08bf5fdaee93b5f7253343fb536170cb19f82f0","src/features/gen_RtcOutboundRtpStreamStats.rs":"68e5f107e1889904470e0498ed3823ce863c3ed543432784d70a885640f77c76","src/features/gen_RtcPeerConnection.rs":"501b2f90e15bda04c2bc387e0490385267f90f588beb8034cd11228cc6d1fdec","src/features/gen_RtcPeerConnectionIceEvent.rs":"bc6713ebe6c96a8befc6af27967aad356dbcbdcbb81c669bf1b72027fe2e134b","src/features/gen_RtcPeerConnectionIceEventInit.rs":"fe12dfe2fb90159aaed1b2dc4ed8194e8c11dbd952b243df02b49b29955f21fe","src/features/gen_RtcPeerConnectionState.rs":"bf2c12d3d07888cdf019047f06276adec24aa7d8ccd603aa15c5e6fc29bc1885","src/features/gen_RtcPriorityType.rs":"111eea2271820cd7fcd6ade25d151c754950388cb642abbfe345f252e0e1c734","src/features/gen_RtcRtcpParameters.rs":"1d457d9bb1ca27bfebd1042d89b76c3ef19330370bece26ec64ac2c965e297e9","src/features/gen_RtcRtpCapabilities.rs":"323daf19881350faedd20ded90d829f085d833db49ae9d28caaf942ad53e4758","src/features/gen_RtcRtpCodecCapability.rs":"51ec4ebe568455c0650068462b64cbd2000d2a9408f762444b50246342133ee9","src/features/gen_RtcRtpCodecParameters.rs":"49808f9ac3a9654a26144edeb5905e17549aa77c4fd3dfc6a2213b5b16fc48c1","src/features/gen_RtcRtpContributingSource.rs":"97231f49d98ca367d199f6c6cb9f0030bf3f06557a80f9b825e88187b22c2c62","src/features/gen_RtcRtpEncodingParameters.rs":"67421157ff8078eccfb7c17b2e53d4a0093195d6843003b61b80b6975dafa669","src/features/gen_RtcRtpHeaderExtensionCapability.rs":"a640b06757a515f851595a48206c27efce00555351fc770ee5ffb7c312ee9f9d","src/features/gen_RtcRtpHeaderExtensionParameters.rs":"a28d2aaed4c0a4dfa227f9a31d686e943bea35c6314c38f0019433d3bc18fc28","src/features/gen_RtcRtpParameters.rs":"ce44e39a6ce3002ca97f3bac08fb83fd59f2ca3098cb65d3108e8cea123a9a1f","src/features/gen_RtcRtpReceiver.rs":"14e5806ed7304b13d3dde05f8fafbda98cf4a4cbe87d7eb6e029fed993f460ef","src/features/gen_RtcRtpSender.rs":"c8dd5959c9db5484ca24860bef0ce2efd1d4b61f07350bb2882055085b7febe6","src/features/gen_RtcRtpSourceEntry.rs":"d98345cbdf08ab956ff6fbaf3614288d3fe9a0e949be751dd5a429609a2d6d22","src/features/gen_RtcRtpSourceEntryType.rs":"740b28b1eefa20875e5e7ea731d2326f12a2c8093399cd305d8d1079d75d8848","src/features/gen_RtcRtpSynchronizationSource.rs":"db13996c3392df4a69bee3828d4709f9385f9448e9fe27e867dd1a688d42824b","src/features/gen_RtcRtpTransceiver.rs":"988fe9e6a2116b1d747942cc275aff2b42f420674952bc9c652649d6b49e5bdb","src/features/gen_RtcRtpTransceiverDirection.rs":"7a7e408e5226c1f85cbf12745da57094f0a32cd6dcf28f152767bb1cb24350cd","src/features/gen_RtcRtpTransceiverInit.rs":"191f34aa12936e99f8395876dbe90567d2c20b2b67d1cab328e2785d7ae7faad","src/features/gen_RtcRtxParameters.rs":"211bb4b1f979462b96cc73d4c75281be0a9cadfb116db668987b4a1400c7a8b9","src/features/gen_RtcSdpType.rs":"b45fc255c23f30a212b91405bf08fe9ae30fe5c85ad56aa59af234f55cb56503","src/features/gen_RtcSessionDescription.rs":"2f1d306533c6e8d352d2586c17fa0ae5ccffe3540461163b79e2763b3beaff27","src/features/gen_RtcSessionDescriptionInit.rs":"174b24d5fb12e6b5a97a7ee95ca4e3f13a9f8069903ec6e354f2aff3393b2cdf","src/features/gen_RtcSignalingState.rs":"18e1231bb649e81a79f28221527ecb8a98aad421d2d1ec4c9e037449c340c987","src/features/gen_RtcStats.rs":"9dc7e9112bc310aede2bd0343efd3c5252b4e7a4b8b9af473c7cc2207c823035","src/features/gen_RtcStatsIceCandidatePairState.rs":"01b282e46db6438bd3d1840f1b888599cbb5866e5d7c799c94e02913e48080a7","src/features/gen_RtcStatsIceCandidateType.rs":"447bbe9f6df6b74c47597bf8c8f3e8b9a050273e4c39140f20c98bbc5fe05c21","src/features/gen_RtcStatsReport.rs":"a5e54dd940aedcaaa10ce1801a6e8d5b18a7ef1221e05542d5f3ffb5507f619c","src/features/gen_RtcStatsReportInternal.rs":"a68d8bfb72e60e159ec8bac8601301d45bf789cf8f48e2298d8c694e7cdb8fdf","src/features/gen_RtcStatsType.rs":"9f9ee0610b207cdbfbd49bd6cb88371b72eb99b52242b0990e6745b191aaed6a","src/features/gen_RtcTrackEvent.rs":"9da9b129e4ae43c2fecfbb8e52707d80be119ecae455e98d539e4f7f1ed807ac","src/features/gen_RtcTrackEventInit.rs":"88fd8abdf2d91009b55d5ac29b379101b88872f227a3dd2f0e951c9580d54bca","src/features/gen_RtcTransportStats.rs":"f53eef78fdbaff45cfecc7ec47f5b7c37ec5fbe4a78664c6f1230aae763b4bbe","src/features/gen_RtcdtmfSender.rs":"4874fdaf13705721aec3013239db17c90df9b3a6ca9d3792f8e1b6cf1e7bea03","src/features/gen_RtcdtmfToneChangeEvent.rs":"001fd8daca85d009d1ec7fd78f40d726ca48608301b9a677d03a9a2b9c582ce3","src/features/gen_RtcdtmfToneChangeEventInit.rs":"4c37bd8590272a9663c65689982be593d5cf5489ca7cd2032b1912cbd4dfa3f2","src/features/gen_RtcrtpContributingSourceStats.rs":"51f0f8bbbde7c4e72f40874d4312368f02c55d92fc4afdaf911a2d6850cb8bfb","src/features/gen_RtcrtpStreamStats.rs":"04c504e29bb4cd8179ef4cd5d5cd3f44fabf560f9cb4029207010ffc19ca4edc","src/features/gen_Scheduler.rs":"735b8d3e83f496dad748bf4eb3e0ee03f64c858f66670d49ef614ca639255b45","src/features/gen_SchedulerPostTaskOptions.rs":"8a8e181e5cf0197b0a99d4a695cb83936da95d541a6c129b18f128b83d75867e","src/features/gen_Scheduling.rs":"4903d4268e3ae981a06f8c5bea8d78b48cb7b6a2777fd605c6cfc6423a5eb87d","src/features/gen_Screen.rs":"ce170d116a5462c64c5f3f2bbed0afc98a8e9d0c9704695c1d4c3e4f8e40c851","src/features/gen_ScreenColorGamut.rs":"9d6fdf9b01cffe44fb3481dac9c0a5cba1a5178b0dc36fd888d5dd5d9fb6581c","src/features/gen_ScreenLuminance.rs":"c519a97c92e2cdc12d17b351608fe03ab572fed34b5b8dc57dddde473fd3f578","src/features/gen_ScreenOrientation.rs":"8874c1476a505ebbc0540170df6b6eb4f34d56249e8dbd2cb460eae63ca086a2","src/features/gen_ScriptProcessorNode.rs":"547864f8a39e8d757924cc51c4366c5dfc38741802625d0c60951d2086feb2fe","src/features/gen_ScrollAreaEvent.rs":"321fc91443ee506138280b734bc00485aba07ae4dfa11cb77538478fc39824d1","src/features/gen_ScrollBehavior.rs":"6533455773c7f393abf6d51bbaf509e395dbbe0ef9e1db16c8edd1a4ab661f45","src/features/gen_ScrollBoxObject.rs":"b9de2c99c406b044d6fba5b21602f7e8380d3883ecbce1bee7ba8d8294bef38e","src/features/gen_ScrollIntoViewOptions.rs":"3dd83fc3c426e53cd3e712856cf02ba3aee4c55348f34906abfc765c6055b36a","src/features/gen_ScrollLogicalPosition.rs":"04ca7530d005362d646d248fd2c1c67f0870ba1e3e13e19bc72b0ae0a65d946b","src/features/gen_ScrollOptions.rs":"f0d5582ff3d2ed984445bc4b16728099868b6752648a981dea4728d2afe77fd2","src/features/gen_ScrollRestoration.rs":"24f67a7109bca1d064a566ddfa420e358fa5a4dcfdea4bb381a760c00f0118b4","src/features/gen_ScrollSetting.rs":"f61e8ce8c8e8ffcbb9548e7bb8882dca5c8104f2302f73d62b3394d34e5a1825","src/features/gen_ScrollState.rs":"9117df89dfb6e6d4e09dfe1fa4fbf5fadd21f83bbc1ceb5572f67f4a89359d2b","src/features/gen_ScrollToOptions.rs":"34da1aa1e8b753d67a9dd5b1df9a5267717295f8102fef19bbd43708209ecbe2","src/features/gen_ScrollViewChangeEventInit.rs":"ca22a1fe806782ff23990b1225fab00933d373f50591b873e649ae9525c00f01","src/features/gen_SecurityPolicyViolationEvent.rs":"4ed0f426421a7bc9e6d133e4800ce350f5427dfbf36bbad267b6b07e3ddabb49","src/features/gen_SecurityPolicyViolationEventDisposition.rs":"ca7e975677990dfbbdd476df3f3a89b55763a0da4049ee2fd763343b6c82795d","src/features/gen_SecurityPolicyViolationEventInit.rs":"b60126d62817a6e6d03c4b1cfd8f973350c695f85807b0a3d2fccb8f365fb304","src/features/gen_Selection.rs":"9c142a6af3218dd95e141396a74cdc799d4662602105d5926b45c850bc0408d4","src/features/gen_SelectionMode.rs":"58b547a25152f38f95272a174689197ae61e26fc124f00632e6ea83af027fda7","src/features/gen_Serial.rs":"8380d007b5af41fc64dd1ed393f5a87aebec439207e6295bb1fbd94d7ced79d3","src/features/gen_SerialInputSignals.rs":"5a3dbe00a165b53bd86d5fc580ae9c2024da168c5b853d449eaa00ce3ee5c02a","src/features/gen_SerialOptions.rs":"72c3a119f984b97919d02023f6dcb606114ebbc28c8b8280e277ceb885a135be","src/features/gen_SerialOutputSignals.rs":"944582a60899f489b4ec29ff86e875acb02c2531d00d4d15166954b1db25a84d","src/features/gen_SerialPort.rs":"ba1039c36262a202d05368a5610e8fb89a61ac2b8b2d5c20654c212a56ef41c7","src/features/gen_SerialPortFilter.rs":"eadbf68fd7c841ff0e7d5a8fa10b0add4caa954e98ce5e5425876bbca65eadd4","src/features/gen_SerialPortInfo.rs":"81b400c58f5b408ae0eb868d5e11b76f15960a715ec6703b77b632a3d07909c6","src/features/gen_SerialPortRequestOptions.rs":"b7c30c1344d9a72b3d34e34120ea296851155a9278ad749b5c7c85eb18ef24a2","src/features/gen_ServerSocketOptions.rs":"5385b2f9ab3e04eab37f9eae190a4b3645593c7ba1aeddc97231f31f25d9f10e","src/features/gen_ServiceWorker.rs":"e30ef133e76ee02364078d4f7680559fded75baa3d6f2fc58b459640111bac74","src/features/gen_ServiceWorkerContainer.rs":"b946477bf7388813ea5d4d8cef3a20c0f615ec947d4788b6877a98280afb4c90","src/features/gen_ServiceWorkerGlobalScope.rs":"bc73997bf65ba21d9e6bad748a864b585ab0f50b3bae18d6136bf09a0ee310d0","src/features/gen_ServiceWorkerRegistration.rs":"eb615771dd9ba11f4d33afe16c1c474a3580713e28e87f037462a44b5dbb2bce","src/features/gen_ServiceWorkerState.rs":"4d7b9c788e26fd04339e0db13cdaa98d2821ca387672a9093dd06dda3681d677","src/features/gen_ServiceWorkerUpdateViaCache.rs":"eb7c97b5248cb1e62dd0ce475d7647eced3188a741977cd45e338eb01597d898","src/features/gen_ShadowRoot.rs":"1ed2edfe031db5305826ffea68c8b6a3ddd5d7e16b4cfe2852cfe2dd6815293c","src/features/gen_ShadowRootInit.rs":"86fb9a36ffc53f35d875860d8299432af405f22127d2ee5cf4f9ae1ebea2f892","src/features/gen_ShadowRootMode.rs":"ec348d573e34e3f5d8786c38580a6b61272c8a461dbfe67f4cea23e571b87c65","src/features/gen_ShareData.rs":"b1675bb622c319ab2f55dc9b26a28dec7eae585f7be07d65b0e1c154718d6a1a","src/features/gen_SharedWorker.rs":"b20eae7e79af3460332ed64bd14a4d90d40fc6c3210b7d1f27682a6d5f7b0831","src/features/gen_SharedWorkerGlobalScope.rs":"47f00a437040ab34d4e7db3754b5c191103f6920345de5c8696139b8863f652f","src/features/gen_SignResponse.rs":"3516ff1084c548d55a35b53b8189ca965b474036b512bbc77439d1a0d99833ce","src/features/gen_SocketElement.rs":"59dad30f9f2d18a2e7b48f0e47d89bccc5fc38ae776c62addb5d21c1ccf9acf5","src/features/gen_SocketOptions.rs":"5b5569be4fd1680d12b619dd9ce52881a4b257617b38ba9df38e0e57fb021c2f","src/features/gen_SocketReadyState.rs":"a396ff988bb68256d4ea18816441b357de965920465eabc933eee70e0b7f224d","src/features/gen_SocketsDict.rs":"9dcd815b9230fe5b4a08768c12f7e9faff24bc24c4bf4e730eee3c2fc372dad0","src/features/gen_SourceBuffer.rs":"38cfd744290f83eabf58dc07c390f4084917841e6e16e87e38b79a41667a3cf3","src/features/gen_SourceBufferAppendMode.rs":"1d53f574c6b8cc27194ad234bbc09c5bee9a367f59bb0a2b139b79ae346d516e","src/features/gen_SourceBufferList.rs":"3522424933998b713d52d9e4d8fe64bd162a2d1510680731d77d124b05a6da1a","src/features/gen_SpeechGrammar.rs":"8a5478f87c10857f31435f32b2d98fe5b367b2c885a676738197a03a3aa56942","src/features/gen_SpeechGrammarList.rs":"fca3e3cc402fc8c508c3de8fed6bcbdd09101fcbe8c2a7fb245dd4d9338a73e8","src/features/gen_SpeechRecognition.rs":"ac016c8db86f7a0728791a630ed5545daef93c46c6a2a923e088135a975dd84c","src/features/gen_SpeechRecognitionAlternative.rs":"7aff88827721565bb8e25c1a836c2d944ea1290ceff29d46df7a4dc117f6138a","src/features/gen_SpeechRecognitionError.rs":"33285060d79103d3e6b0153607cc823ea4bc21480a5d77ef8c5eac7c84e6395b","src/features/gen_SpeechRecognitionErrorCode.rs":"586d253e30b4531fedebc8cd8853543121f2f53ea0afb4deb832986f40592966","src/features/gen_SpeechRecognitionErrorInit.rs":"4629d509d148929daaa23fba437e7a53aed8850bcb74254b6a76cca1471a6869","src/features/gen_SpeechRecognitionEvent.rs":"cce320b09fb941627ebdcc27703f237fbdcd80be1e80a4ae63677c33ed7373bb","src/features/gen_SpeechRecognitionEventInit.rs":"e5a26f0e8aad9ca325691254113f1ff24f3279d4d14732dccc2fb254a641a3fe","src/features/gen_SpeechRecognitionResult.rs":"cf437b5a0ccc6187e2296ade7c96bd617c9a3a86c19f5f1846960381b87dd161","src/features/gen_SpeechRecognitionResultList.rs":"8b01d1228c55c7cafe2f105f06f084063cf493ec2104b666c15243d3e6ac8895","src/features/gen_SpeechSynthesis.rs":"fab62864a3c7dad2288cb28f28a21194aa656120f86061e40666b5f22e1d5a6d","src/features/gen_SpeechSynthesisErrorCode.rs":"3e4d4e9f6e0b3371efc30f0887e597d92519b0f0d83d8e692d3e0b3103b2417e","src/features/gen_SpeechSynthesisErrorEvent.rs":"5c5cb151cfc0c24f47308e8d95b674ac9849b5ca766853288a42506fcdf25de5","src/features/gen_SpeechSynthesisErrorEventInit.rs":"b7b518a5510eed6156ae76288bffc9366688808d6d8ef27c325335071e236c67","src/features/gen_SpeechSynthesisEvent.rs":"17fb47533cbc1ad82fb1970d6254db778ec3f20d45e235d87cb6e52383b6ad8c","src/features/gen_SpeechSynthesisEventInit.rs":"93e986f784423d9d830f5e222eea0f80dbabf372bc82a69472a44daf80c46528","src/features/gen_SpeechSynthesisUtterance.rs":"d5964209dd80c554032f8fc0060394c451d7a693ba46f44759264adc9bcdeee6","src/features/gen_SpeechSynthesisVoice.rs":"e5d425580bd5dfbd1aef24937339d21847cb5b9885798465e96a4044aa2ad672","src/features/gen_StereoPannerNode.rs":"8035121495ce790072f917cc4ec613ca40190175638e267d5a6e128725cb1439","src/features/gen_StereoPannerOptions.rs":"2042868d1dff47dbb6bca2e1b9a2eb45aa8c7f3cc729c1dc3764ed8617c5b2ea","src/features/gen_Storage.rs":"7b2e5620c2a25b59421ab22a8ae0c2540896e95a5172290537fa79093498dfe1","src/features/gen_StorageEstimate.rs":"616353a5f841081f2330331096f1f2665cfde7acdffe0a3958a252b049f9a168","src/features/gen_StorageEvent.rs":"d425293074fa7502eaa84a2a1dcb718f59efac5dde9aff7340c478683dcb7929","src/features/gen_StorageEventInit.rs":"2c032021903290f83d26d6afdbec0cefe2b10bba294fd63ac219bb3f0540042e","src/features/gen_StorageManager.rs":"43111d3a11b92ea6e7748cbf352159fdf630b8f8a6791d8d2f3457201caffe8c","src/features/gen_StorageType.rs":"8721a6ae414ce80d65895563dd4cbb351a676439182bcb2264e1879874c90347","src/features/gen_StreamPipeOptions.rs":"f0cfba77fa41b4e2262693aca460e43ce5a478f415618ca99ab5ab7a3759c9fd","src/features/gen_StyleRuleChangeEventInit.rs":"2893a3a4913c3e6240fbc1fdce1f831d3988ca439bab6a8b2db5f5dff1ebb2ff","src/features/gen_StyleSheet.rs":"806d4f5ac89375fe7743bbdf2c9f15f44c5b3ebdfeea5de76bb1d33da2134bf7","src/features/gen_StyleSheetApplicableStateChangeEventInit.rs":"bf5c8f01aba0bf2b7b6690f4e81df2238176428e8aaed4f4631b69af556e6697","src/features/gen_StyleSheetChangeEventInit.rs":"8e12272b90bf5db0334518d4daa2e71afea37bbb50c47459fa0919678fb11efb","src/features/gen_StyleSheetList.rs":"f2f00dd8609c38a650e511ce800e4583f37393e75676697f38f89b168d5eca06","src/features/gen_SubmitEvent.rs":"84ed72d317455e56935a12ebbffe5a9ff7717b66819c20e4b1806dde54112d1b","src/features/gen_SubmitEventInit.rs":"0953d9ae9dce80183f565a497473da9287865bf3b728478a386701704ffd27ee","src/features/gen_SubtleCrypto.rs":"c9839946ab3107d9613cfeb9d982dc97266da2bac919c1199f9dcf93f70cf084","src/features/gen_SupportedType.rs":"dc46459afd665a7ce264f149d229b0fabd06093720040d857f75b80cf8489ee1","src/features/gen_SvcOutputMetadata.rs":"6dcdbb087ddb467047814873533dd10faa7562245c2e944210abdde1ce2511b8","src/features/gen_SvgAngle.rs":"6b3feba71e97f236435c9a9d6e44e8d1866a349b81cfb90d11b0bf83cbde8faa","src/features/gen_SvgAnimateElement.rs":"bbc71c765310375c0398d49f75036bcd6def99291014675d736af65db316e79c","src/features/gen_SvgAnimateMotionElement.rs":"82892dc8d910a85f82f8e87cfb59cc905be89d3e385aa452b789d7a25b577199","src/features/gen_SvgAnimateTransformElement.rs":"2207b2c66154f10097fbdbf04869c76d3fdeb22101b52f6e5842d95cde1a4e4d","src/features/gen_SvgAnimatedAngle.rs":"806ad5f85c5b7305fedc9b24a4efa9224b032a1498c2f2b0c556cb8a2f0f8f09","src/features/gen_SvgAnimatedBoolean.rs":"07c74b1c865d644b214034d4c298ade8439e6f8932a227f066a4e1be1873cd92","src/features/gen_SvgAnimatedEnumeration.rs":"a67c37bf9d4dd9ee7de41955db1117b36437ce5d8a001a8b902b85dea3d71daa","src/features/gen_SvgAnimatedInteger.rs":"522834102e4f3201511230209fe1f10f7570b3781bfb25b02ecd8979dc778385","src/features/gen_SvgAnimatedLength.rs":"b3894c69eab0cc18e417619865a329d5d4fe39ee86078501dd89d21a4380c8b1","src/features/gen_SvgAnimatedLengthList.rs":"43d328403203b43b819e51fd184e1da6c27f9e3d43372042209b19a5332d6cf1","src/features/gen_SvgAnimatedNumber.rs":"caf4db12ba55b98cc8f273c20c4ae13e3fa4277ace79d5e24bc2fd3ef3884dfe","src/features/gen_SvgAnimatedNumberList.rs":"cfc2951d0505ac583a52dcc905d6bd5a20268dd287001e80fc81276d93dad655","src/features/gen_SvgAnimatedPreserveAspectRatio.rs":"3b9eabc7bb248af0f1bcc380e44077a9bdfc26a7c32b08d76ad0c5930c63bd87","src/features/gen_SvgAnimatedRect.rs":"0521972f7d4e03dd7c3d85e4a31d4067c820b49e2cb2581c281b2d467c957fee","src/features/gen_SvgAnimatedString.rs":"322a44e6c25696f69f7c3b096dc4e458b1a7b3e76c15237f80a9fd119adc0fc9","src/features/gen_SvgAnimatedTransformList.rs":"79871d8e50a3e334d3f8be417f6f845c226672b57a53157aad65e2607772a67a","src/features/gen_SvgAnimationElement.rs":"6edb6ef7da9543e18140e935b807fca40d7671efd76e75deda63e909b329ceb3","src/features/gen_SvgBoundingBoxOptions.rs":"45e225cc5eecf7230908945edf0c6e0688641a4e3f12c8761ba8657c712bb95c","src/features/gen_SvgCircleElement.rs":"5fdad71797a45f5ea043246ae64bddbf95d8bc4eceafa975a135723a06348b2d","src/features/gen_SvgClipPathElement.rs":"c4b06dc1ebcdb679e62cc2ca2140350a004967e75046bc5a58b7f422a99e5702","src/features/gen_SvgComponentTransferFunctionElement.rs":"a60a6dea0ad586d26020901b8acc59f9155a5379a4212ad13679c8bbddf67436","src/features/gen_SvgDefsElement.rs":"800ee50a047c3f0a685e8bca29f62ce9934acbd71d31b8fd9e3acbf8014e8767","src/features/gen_SvgDescElement.rs":"8764d50100b22f0bd4ecb1d28b7773b3ab64b51c7a16281a3bc355053d67ceb2","src/features/gen_SvgElement.rs":"f21de48d51f38997e162a709d90a3ae1287bd39dbe7b411aa97c20bf7d980bf2","src/features/gen_SvgEllipseElement.rs":"0c2ef1e717e84aa9a4ed5c38d40c6550c6ba2b26facf33073086c33b652ea0ce","src/features/gen_SvgFilterElement.rs":"f36f6e95adafd0fa8a3a81ef1e19f859bcaa3022ff718042dd1c3ff9d8d33b60","src/features/gen_SvgForeignObjectElement.rs":"77edbff64b7c921b8bf65edc7db487f126ca193d75cb16a02fb18bfc67e55ede","src/features/gen_SvgGeometryElement.rs":"96e0e35cda46152373f4543dab95e5e110fa3618d300acf2c72d89c4e606cede","src/features/gen_SvgGradientElement.rs":"54bf9c36723165b194a0be43807b6d8364fa19667c4a8a710f559fd34d7d35fb","src/features/gen_SvgGraphicsElement.rs":"843c557ff9616ab0956239619c193b2d532b6b24de6f74b578898fd412ffb093","src/features/gen_SvgImageElement.rs":"0984653b29c7107bae8b3caaf6891673800310a629d37d7f3acfdc8dbda966c1","src/features/gen_SvgLength.rs":"c740c5026a8f232525d990f12c53e872836f679abd24d257c066b6e0bdedccc1","src/features/gen_SvgLengthList.rs":"eca96f0deb6e8729ecec4f6fd165b1863e7972d03c8f21a490512208ff02d362","src/features/gen_SvgLineElement.rs":"33f413654b941b48c93f1ebbfece23e53898e111baa463e792dd6c92569c201c","src/features/gen_SvgLinearGradientElement.rs":"4e8ec162a4526ef5d4998db35b9e0781a504ca775b29514611b8600f39be2af1","src/features/gen_SvgMarkerElement.rs":"bf876d42af812d6d5cce2031564e8abdac3fa5dd815c5fdf399c1c4358f02844","src/features/gen_SvgMaskElement.rs":"5cb779d967f039a5a2dadcf24492a86bcea06ac3b24bc0bec55c9f073eeed7b5","src/features/gen_SvgMatrix.rs":"e494c0b26ddff2ffd6518262f14d4b13d9e7eb3d67d7f0a51c845a9ca30f70d7","src/features/gen_SvgMetadataElement.rs":"195c8544a06707cfe30cde3fdd74fce02361c6b84f1599393dad79960bc41825","src/features/gen_SvgNumber.rs":"4f3be4606a88760c411c4c09ed1fbf7148cf6cea26377b2049e90315c17acfc3","src/features/gen_SvgNumberList.rs":"9ae2fb332f6d447cb6c56b536ec6b5f84f86b020bfd19c81580c308759d3a494","src/features/gen_SvgPathElement.rs":"45ff3bc3447f09d7528f02a9eef5a21be4fe27ebb94394553aa62b4b17921b11","src/features/gen_SvgPathSeg.rs":"483d100401e2910337cf3756f9f08f41c387a6f57481fa3cd2010d9b2f751c47","src/features/gen_SvgPathSegArcAbs.rs":"49e70abec0cc1d053774fc78e5f423f736a0dd5e453962948e81bb8c8d61bdb2","src/features/gen_SvgPathSegArcRel.rs":"e85aff82ecb6725c8084bfa766fd85345e0774d1dc269d97de0aa89aaf2c875a","src/features/gen_SvgPathSegClosePath.rs":"afde22076ca2755f878ba8d533dceb4912edfde999ae47350296794ad89d6784","src/features/gen_SvgPathSegCurvetoCubicAbs.rs":"b42f17f88394b9802125fda7a8505146834fe83b4beb71a7159cc0c316bfca6d","src/features/gen_SvgPathSegCurvetoCubicRel.rs":"0533e87a9f32b19253e1eee785654980ad7d212808f03b8a44c28d96189376d9","src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs":"402965ada4b43a6f0a426d51fb318bbfc26efcfaa64517a55fa9214e57a5e2f4","src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs":"e3b4f03cafb08544e7040b0f8adf6dd1704754b67c88e998b04f46986771a59e","src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs":"f6fef16878e820681c3c65c4a361f86ed82360a194b70ebef313505ef446e628","src/features/gen_SvgPathSegCurvetoQuadraticRel.rs":"49ecb6f89a528c81460c8c4d7c78e84eef771311482863bbe2d77f242b38c1f1","src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs":"807de1f27ef8f82bedd9091ca398ad3aa8aefa3408bf51ea078f280fbc9d57fe","src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs":"1b3b6eade6b4e84ada6aeaf6f5c0cdfdbadaf168d199405c268072b67bbe4c65","src/features/gen_SvgPathSegLinetoAbs.rs":"67b29ef6ad7172e9457507720659a775cff5a7457531add0cb9472d0af399429","src/features/gen_SvgPathSegLinetoHorizontalAbs.rs":"b58cc1fe1a0c7d76435231d5bc9abb263d208577ce2e14e241eb2bf523838934","src/features/gen_SvgPathSegLinetoHorizontalRel.rs":"61d7bf26f3dde895ecda9e9d184431d28af48f36f1f1d630dd32dc4245d4df78","src/features/gen_SvgPathSegLinetoRel.rs":"ec0302bef23b799c9f7fa3c71b38aec3ea997e7dcff849902c8f5b81302e3114","src/features/gen_SvgPathSegLinetoVerticalAbs.rs":"dc037ede9164440fde62975014ac9d5936579261e9d3593f037be76203e1536f","src/features/gen_SvgPathSegLinetoVerticalRel.rs":"defb2acd5b48ffa65e59bc666f77323f6a03869a5001ec605748f19734b2bc35","src/features/gen_SvgPathSegList.rs":"58af846e488a3323384b833301bdc1cd8b40286ce25da7fb2bc914facde34a70","src/features/gen_SvgPathSegMovetoAbs.rs":"08d92267a01ffc60ddaa4550e3fd1b3a7f3b6ebd31348f491d4f53cbf4379298","src/features/gen_SvgPathSegMovetoRel.rs":"e4fd3d0fd0133b1c094fd9e5ab4199acdc744d4a334e3386522abae6610acf6c","src/features/gen_SvgPatternElement.rs":"986704a7f309d82d21d405ae17537ec4988f84611aff7200bbbfa7fc54cc0ef6","src/features/gen_SvgPoint.rs":"6f30902ff818e99f30ceb90ccef51ce140908a6146cf8314d5f52df1fecb3bfd","src/features/gen_SvgPointList.rs":"c98db514401691314cc9155ca38db83e6059a9ac7930a3bdc700c5ab162fae9a","src/features/gen_SvgPolygonElement.rs":"3843c786b26963a862f357d468c919a7143ae0f2b75d7b3f6a6d8bc045f5a063","src/features/gen_SvgPolylineElement.rs":"206828a738f8eda2161a5149c18348e461ba78b3d63c5b05cc842dfd3b1ce0f0","src/features/gen_SvgPreserveAspectRatio.rs":"a3fc02fc75966c567587611017a3ba02f4bfcf091e754d2e0745643b0e6d0223","src/features/gen_SvgRadialGradientElement.rs":"6f7d0a3af047a88d81cc8239b1fdb88b912d73f73de2830401ff448561627add","src/features/gen_SvgRect.rs":"91b4610b4907e976b2961e74f51de8e3ab2650d3ca0319b01c1e309f548d6cbe","src/features/gen_SvgRectElement.rs":"c94af71fc9079da8625880df4808f885e413056a1560c9cf86c896e64f2f3d13","src/features/gen_SvgScriptElement.rs":"f3c5507d451680e18a37f84ba629aad718c6ae2cd4d1986f1b4ffe836abf46a0","src/features/gen_SvgSetElement.rs":"3a34ca18d85a69fc35748a488ea419b6ae0b57494c70367f64c70f7f45ce93ec","src/features/gen_SvgStopElement.rs":"ebbc844ed5e963da096192f4f3d5bdf0c3cb3a94453f0f3716879d319496290c","src/features/gen_SvgStringList.rs":"cecc678eecad140cfebbb3f60679cad612069ccc164301937202c511fa7d1d96","src/features/gen_SvgStyleElement.rs":"30005c363a30c3b83437556747434aff9b47da913ffb394306d62158b483e3bb","src/features/gen_SvgSwitchElement.rs":"89b4cdf99897be74b8c9ac8572b3d1b7e7b25a2f55fc22bf9cd9af24de4cc710","src/features/gen_SvgSymbolElement.rs":"ce7b3bc849135960b8ad8ccd1a499bd7798a7de91d52e6a69324de4745c7083b","src/features/gen_SvgTextContentElement.rs":"82d43fe6502f839cb787968d1eb2aa2f5bbf1e535d48677f1a4d39ab495656b5","src/features/gen_SvgTextElement.rs":"14ddd6394b71d7d4076b8bbf29cb8080cef1eebe9ebd13d4e20d832c283948d7","src/features/gen_SvgTextPathElement.rs":"cd4c41f93154bd96500b27108378a4eab15c7eed3f8410b9eb58268c48451e0a","src/features/gen_SvgTextPositioningElement.rs":"b4c88f6d4afefe6f42c0e61f3718400a8916db6857026355997acb8e8d76dd74","src/features/gen_SvgTitleElement.rs":"b633525dd40c0d6ce4846a90d72d90c337bc48087066a8e997b2ff1edaad8864","src/features/gen_SvgTransform.rs":"688a32808fd77bb291ef235020bf33d36428e71f03ddad4c38e5969a6fcb5ba5","src/features/gen_SvgTransformList.rs":"6236560d02a2d04dbcb47a726b900ea6d9f84f2cb34e7271840d37e172431c09","src/features/gen_SvgUnitTypes.rs":"0058ef70792fb47aa628f2dd5fd06a79fca236413ff4fc61ab0f2dfbde8b499d","src/features/gen_SvgUseElement.rs":"f893ef9e0dfe5e42ba69125528cfb83e4f3ac96948f3e6dba632839a5394595c","src/features/gen_SvgViewElement.rs":"1902395197a985f63f4bc926a0e5bbf6289dbc47d52b9a6992a69410b412983c","src/features/gen_SvgZoomAndPan.rs":"68735384900d73815633b02c61cd42e7bcecc36bec211028089128a36befc92f","src/features/gen_SvgaElement.rs":"2732722483c881ac8004aa9355ff3638a0ed06164aa7e64a76edbe40cd206c7e","src/features/gen_SvgfeBlendElement.rs":"c4f7fa6448da5a1b3a43e53cc2d8c081a4481523e67427fcae71969fe9634656","src/features/gen_SvgfeColorMatrixElement.rs":"11460d041c5d0f80817a48bef4f2092f6fbe7d56ad15e3e5ec80dd5928aea710","src/features/gen_SvgfeComponentTransferElement.rs":"b7962f717f050ece9078b69e7a66f030186e556d990b848b838c8ae2b93e385c","src/features/gen_SvgfeCompositeElement.rs":"b030095c2a5bcc43569a05450c52689181adddbd3cfea924aa8cc911df4ff842","src/features/gen_SvgfeConvolveMatrixElement.rs":"5371397bd268f5687046ecb7016a413aac6d8e20ca208a57f842026e6b4fab54","src/features/gen_SvgfeDiffuseLightingElement.rs":"163bfafb0b0b0c09299f89516ccf71c7d069d8619c3d44feca2bf0576b6208c7","src/features/gen_SvgfeDisplacementMapElement.rs":"50deb12a5254b46cb650b4fb4e454c027b399a58e80ba9177e0011a5ae40287d","src/features/gen_SvgfeDistantLightElement.rs":"e75ba4257bc711e65e6c655c348d5dee4ebd705690e93655ff9e2a7833189174","src/features/gen_SvgfeDropShadowElement.rs":"93156718e2f9b67670f8f204eaa5cc02f3e7d09db3d54af1309fd4adf479fecb","src/features/gen_SvgfeFloodElement.rs":"214e978a2460feceeaeba31487526bbad6c672d008b7497ff46ae63ffb390bca","src/features/gen_SvgfeFuncAElement.rs":"97a6658f7b96317a1eaa9efb2b088e65355fef8d4baafff8b9378d6f35173073","src/features/gen_SvgfeFuncBElement.rs":"60658ac771313f8008e25b009cbc50580740e815a37689c194e1c5e9c9448600","src/features/gen_SvgfeFuncGElement.rs":"12f532487fc05c65f842e9d03cafef4f494970d6e9cc21bc37066bbfd00028d3","src/features/gen_SvgfeFuncRElement.rs":"28b41674feb632385dc37c455a88de1797ff1247538492b5d14691d6c65d1e8f","src/features/gen_SvgfeGaussianBlurElement.rs":"d18429c9af40a0e9c042ee189d4dcdbdc293fa6f8bf3ed089234582c8a95f215","src/features/gen_SvgfeImageElement.rs":"65c513fb3cf5ecf0c56d1807545cb792eb35d4f44be129db3bc905a42a4ec8cc","src/features/gen_SvgfeMergeElement.rs":"d6cee647bae1a15b5911bc8fc33f6e9e40b586e01dd92d6204069f48233a83bd","src/features/gen_SvgfeMergeNodeElement.rs":"02560c27ffc73919a86482875b0a17e5b3d758a858b567c7d25fb802c0d7bc3e","src/features/gen_SvgfeMorphologyElement.rs":"039573884b00f563b7249051ede07bb5c7fef5fa5e9a18d1dc390cc75cd9c8fb","src/features/gen_SvgfeOffsetElement.rs":"e0a8321b1e9fdbb2f2c96dad5c59e6eb2fdb4b8624aea5c1111b170304e4c163","src/features/gen_SvgfePointLightElement.rs":"1368349da126d46fd3bae5507c548ca89b939ddf32eeec5f4f5bde83fc0dc26f","src/features/gen_SvgfeSpecularLightingElement.rs":"7534322d7cb49457c2e99d9ab14b7026c22bd6332a54a2a2e243fa27cbefb18c","src/features/gen_SvgfeSpotLightElement.rs":"d139cc28522e7fe8379684c957bcc3eba02962e54028399d77f78319f8e3a992","src/features/gen_SvgfeTileElement.rs":"03a855dc104aa28fb99936abdd0dd3b04687d8b42ffe0530492f06e6d24faa8d","src/features/gen_SvgfeTurbulenceElement.rs":"41ff0ad65001896fb83b5255b3711ff091c99b5e039853910f61c8a8d9f55c4b","src/features/gen_SvggElement.rs":"af2b5ddb57b67730c62fa2ac11f6d947c9e1c2a87c3a95bce9b9a7461a33b231","src/features/gen_SvgmPathElement.rs":"51caec4ed20d0168c063981eaa17edddc1f13fb9311741f9639c25370025ce10","src/features/gen_SvgsvgElement.rs":"e0acee6b2fd63b55f1188dd7b058d3dbe2866a13bed51348d536504c5d2d2c52","src/features/gen_SvgtSpanElement.rs":"7785e950bc12a0c165a1e002bf538b0e444de699758727f1e64f080a2ab00aa8","src/features/gen_TaskController.rs":"07294efa28dc895295b4a09f887fcbc68e0ef51620b36b7a4c65058614a5d289","src/features/gen_TaskControllerInit.rs":"23ea1445ed7f0f8fe6da660093eaa3055f893f8e4f1a4533afa0ed37705f7e4f","src/features/gen_TaskPriority.rs":"0d099b8a5c7156c89e8a83e7bdbe8a519e8d4dffa8eddad989b51ba766284e5c","src/features/gen_TaskPriorityChangeEvent.rs":"53cc7b15774e0c42b9735dcc00f60c3e7e7752008b83bfed6ffa9968199edbaa","src/features/gen_TaskPriorityChangeEventInit.rs":"e7c504522b44dfec9adb39b07148cf48def11ce503c9849db6d43d213dde5848","src/features/gen_TaskSignal.rs":"393021201afae4594c3fe4b77f81ee401aecf360669b922754210a3e50a04a43","src/features/gen_TaskSignalAnyInit.rs":"1346e7666f58a44518b06be4e3b58d9d15a2293729885df9bcf9e9e405f246c5","src/features/gen_TcpReadyState.rs":"4539b25bc7a6c310430c24ca34a786c43e710400386e5ca841dc12510d0410f7","src/features/gen_TcpServerSocket.rs":"0176c3e073e9abbc376d9f2e2bdd71cd76a11af080f3b7d6d290396c17444eb9","src/features/gen_TcpServerSocketEvent.rs":"33ba6a5ba84c1cdc13ed8627a3389cb5e1a1502c4b04f6fe7629dbd3547cc868","src/features/gen_TcpServerSocketEventInit.rs":"cc3702336d29cff55eab9b9f27f6237fa2dd31cbcf9c2d25719b736db508a34c","src/features/gen_TcpSocket.rs":"b2ad2f8ac9a24b553e1ad721b340b6f9be42691b1c6b8e0602cdc222d9e00123","src/features/gen_TcpSocketBinaryType.rs":"2f34438ad72f5999f807e6449b65524b860a9cfe161c8ca16aede9090487629d","src/features/gen_TcpSocketErrorEvent.rs":"9571ac9159b287e823926cc073880a237956c9c2d9802dc51dd67cd8751adb55","src/features/gen_TcpSocketErrorEventInit.rs":"ae0ecf6bcd9c04e51c8d8c2e9c1220591f56eed29588abf8f37649d2ed0aecd6","src/features/gen_TcpSocketEvent.rs":"f7d080a51d95e7d63c247fb4b01850c8afa785b270373ea6fd0f4cf8e751708b","src/features/gen_TcpSocketEventInit.rs":"d7c79ab57a8b1101b33032dc14697e1950c01a5df7152066bb8efff918cd887d","src/features/gen_Text.rs":"569527efcad462b48f2bd9a667ffa7f71440124c58bdf900f59051510f26318c","src/features/gen_TextDecodeOptions.rs":"93841d4e55d8a5db2432ad0f7f6d12aeed0fa86475d8edb4def4aa295fa7f500","src/features/gen_TextDecoder.rs":"dc2102ce7493361b635abdc14be061a7e9865a3377b50430bab906e5e6ed4249","src/features/gen_TextDecoderOptions.rs":"8f9d863f039a4e6e8141e3379dd1bfe48c0ae6655206d3aaa27e9b70bfd5c637","src/features/gen_TextEncoder.rs":"4ba691c39d5faeaf13ce201eb01d8390907156247344321c6d70bf9ca065a2d7","src/features/gen_TextMetrics.rs":"3a92144b1bdf0d02d14b8071518e75701e79177448f14ba6ef28db26acfcdc39","src/features/gen_TextTrack.rs":"5540b2fe181c54f996b021fac80569e49f69d7b6b318b43c81950efa23bf7d69","src/features/gen_TextTrackCue.rs":"9b55f4a6d80959f9d2e8680171f10b9b04f5514d94b94095d8c47bbe8ae1df8a","src/features/gen_TextTrackCueList.rs":"875439fe5bf20ede7f0ea126be171ac451d6c8631bc02351aa611f907a968b3a","src/features/gen_TextTrackKind.rs":"195a7c2fb50fa34a809f1fbac3a3ffe7bf28ddcf146766effb88b0ea39e0161b","src/features/gen_TextTrackList.rs":"1407b0c0f4592d58218aefeefa371829d160108255229b4e3eb8b22bb385669c","src/features/gen_TextTrackMode.rs":"aba58a77887861ec3a9a35c44122b013272506ae80db2c50cc81540d0010b6b0","src/features/gen_TimeEvent.rs":"0ad47908d17c473f19dc23de42eb59701ff2afeb07be23e0779bc217707fba18","src/features/gen_TimeRanges.rs":"e94e8fa664f35a54cb74819ae98cc51de28aaba177b797f2779603aa097fa16a","src/features/gen_Touch.rs":"cf75d0062b879e3d3daee7c5a58578cde885a3dac234baa11a527d3881144b19","src/features/gen_TouchEvent.rs":"64637d656940856b8096f31b7187a6d6128a3abab960e02a899837e9ef9654de","src/features/gen_TouchEventInit.rs":"baee123664dff284a5cc2de6bd538d0c086d1c584b5339ec4218afaa266630ca","src/features/gen_TouchInit.rs":"f2dfd166d45cae7947a8856f8efb13318f19ecba1c5647a2cfb10625aff8ef23","src/features/gen_TouchList.rs":"03cac131a6dd4ef609fd58e818654b899701e3a48d5dedf0975ac5e9269e4e37","src/features/gen_TrackEvent.rs":"f9e596aabe543621b77d689198bebde4c8d18382784f63b122f0bed09182d3b5","src/features/gen_TrackEventInit.rs":"4bb1fb064f40d72b05e9e46d30cc0b8e85ce5e042ec31950da285fa113148506","src/features/gen_TransformStream.rs":"57c16349cd072e60cd712330180b1c8598242c20ad7036b5fb18fe41f2791d72","src/features/gen_TransformStreamDefaultController.rs":"1d5daa47589b2585a385b75736e20f0cf79fca827b51c2c9b020030290681c33","src/features/gen_Transformer.rs":"e014bc2f95b3eff1748f46fc5f43f999b54384fcc7ecdac148edb40d69205d4c","src/features/gen_TransitionEvent.rs":"a856d711a10fd206e9fb20b70b32256576d2ca6885327677338f8dd3b298dc2c","src/features/gen_TransitionEventInit.rs":"2d19fc139ff625788fdf4da149337790dcbb65510361db3cc2e2a58b9ddf7f0b","src/features/gen_Transport.rs":"9879e63ba98d29366610b54a7dd9c6c127aa646bc55f2df649e79410a55a39b7","src/features/gen_TreeBoxObject.rs":"b8138e7991abb55c3b6b9fdaa6aa0033570b9c2496e9e6efda445bc2f2b27966","src/features/gen_TreeCellInfo.rs":"e94105cc13cb760f4b7c19d4b59cc0ac17f582683eb2171324ee5bb05639151c","src/features/gen_TreeView.rs":"2494e927d51ce97b7dc9e10b2e0f0a38ac5fde9331df5a77274f658cab09a106","src/features/gen_TreeWalker.rs":"631e47ff517c910b459dde8401af35f2915f337331293f95605c06a3c38171e9","src/features/gen_U2f.rs":"41517218daa6a747bfb2032ee307518b6680959b33db707695d9c6c7d27028f7","src/features/gen_U2fClientData.rs":"c5c53fe843447a1a13d7ccef56881cd3f2f8087a7b94d2aa5447003a48a04c6d","src/features/gen_UdpMessageEventInit.rs":"5957ff15d46b9cf77d0cb54db0f42fe9f5d999f6faafaad3d8c31d42c3e09f93","src/features/gen_UdpOptions.rs":"5c224e6c714d83ee33c1a9aa9b55d14b3492076f0617e9f5270edcd90a30845e","src/features/gen_UiEvent.rs":"e98b9fa70507472cd3ac4c8485ca279ed18dc377224be7c8e5d25855b5b00b5f","src/features/gen_UiEventInit.rs":"03c198cf8d6a12e5ac509057024dc9d09134559eab29442fcc4222c7107ed69c","src/features/gen_UnderlyingSink.rs":"b88d209683d7e334ddca6006f66697f2048b2400dbdd502ce8075c91a21dadaa","src/features/gen_UnderlyingSource.rs":"7f840677d24106c2994e42c07e0227a7b96ed4d54d7845f32f59303a3fabe8ff","src/features/gen_Url.rs":"07d3d37d934eefeacca7885c8ba8c545fd6e0932e3dda8336665ca0f119db48e","src/features/gen_UrlSearchParams.rs":"966d56074abb66568edbc75106443fb990ab8474b04f7d531311ad8a1902a661","src/features/gen_Usb.rs":"335f11c17d43a4926704c14e459d7fd7ee379df114b336c87cb739142cbaded8","src/features/gen_UsbAlternateInterface.rs":"d42f1ccf2f00667d883f219e21ae73d48df055dca90f495a8391da97b337578f","src/features/gen_UsbConfiguration.rs":"80759ac34e0a460b7665deb3ef68844479ba61e79da19a900df4c37278342061","src/features/gen_UsbConnectionEvent.rs":"e424787dcda8ca730f181bda9b826f3087be7283e346bc98e05b6464b84ba197","src/features/gen_UsbConnectionEventInit.rs":"df5218bac5f5a9233c68cfde0a16ee1c3dd3cdc497c65d08a7c89f2b1a627232","src/features/gen_UsbControlTransferParameters.rs":"ac50aa269e542b2c5e41b86ce6700b95876e0ee0d7f2664fd6396d210b3e7fca","src/features/gen_UsbDevice.rs":"6575f5bec63136ecd5f3d7f8df8fd255fb2fa85a6a40578abb3c84cc48d1e02e","src/features/gen_UsbDeviceFilter.rs":"86049c292a86294a6a96313b5dca8aa41e5a82d4465644c9e09f21f02e9dbbd2","src/features/gen_UsbDeviceRequestOptions.rs":"427d318704d7c858c89c07a8a5ef051ae918caff2e662a45ae7a88c2403c311e","src/features/gen_UsbDirection.rs":"86d0fe138d3d354e9512afd800e9d5899f288c21b94811712eea71deff9a39f8","src/features/gen_UsbEndpoint.rs":"fdabd25d3730f3065931d502d6ec2792eef59aeb571a354b16bb8aced929bbf5","src/features/gen_UsbEndpointType.rs":"134f49ca3373de051603667e94bab1e27c993cf3ddd9b643d66ca49aaff4ecd2","src/features/gen_UsbInTransferResult.rs":"11932c1e563da8882f93f1f8455b5209e4726c547dd1ef161fd3994272fa6465","src/features/gen_UsbInterface.rs":"004209e103f3816a1f9f95c81d44e567666b80fe072cc762db48f7e7a0961b24","src/features/gen_UsbIsochronousInTransferPacket.rs":"d9cca483575cfbfe32b05256f04dba5da2b09c10f5c14a09d11cd5d43abbc1a8","src/features/gen_UsbIsochronousInTransferResult.rs":"717d3486c5f632dbc930b366f04bc97a1c8f623f313e10c56459651d701867e4","src/features/gen_UsbIsochronousOutTransferPacket.rs":"0ab20cb1959e9b1fd0ccd957be48a313d3418bef7800b5077c82e7c042d28e6a","src/features/gen_UsbIsochronousOutTransferResult.rs":"b7e3e117741e49f0e31b12372ee8dd5c8dc7e8e387ee819fe825234e5c391d50","src/features/gen_UsbOutTransferResult.rs":"663a733073c5dc09fcb8ba86917d6b40a6af86be5b03c88e2182894c0f719813","src/features/gen_UsbPermissionDescriptor.rs":"dfdd00b514e5501d4574ff41596ae50a9e8724439364ec53747ecc6fe8d231d9","src/features/gen_UsbPermissionResult.rs":"d7efca9797d19a38d830bd6fbf13d98e3622bfe8c3be7ffa2399dadc385646b3","src/features/gen_UsbPermissionStorage.rs":"f878e9d9ef51bc523c1142dbcd91bebe064c5e1ea3731f4d27cd13c680310d36","src/features/gen_UsbRecipient.rs":"be13d62e41364f10326419c697be9be2b88f7037bbf4a28d4023cb7f636f4d9b","src/features/gen_UsbRequestType.rs":"7de2dd3235f85337d40cdc00bcf8b488d3bd61e9cbb8fdabdb352707e15f88bf","src/features/gen_UsbTransferStatus.rs":"694af05accc0edaff79118c21ad2cb25c424d94df87451d57db897dffad347ce","src/features/gen_UserActivation.rs":"4bd510de720139007f5ab268293a7c96a904922b202b41f231e34a824215661d","src/features/gen_UserProximityEvent.rs":"4735928088525655e0baafd96f81e484e09072de086df724ee75d54df428fb44","src/features/gen_UserProximityEventInit.rs":"b84ebad08c0351b0a36e65dbff29fbe1696f9d6a9a693c4f157790afdd368b76","src/features/gen_UserVerificationRequirement.rs":"a45fbac3b91f786a400eb5c89475a53753db1471214f38c503bc74c928aea64c","src/features/gen_ValidityState.rs":"19fc8630ed8265d80876c235ef52ffa9d7b5b7cf8562c21beaa21d01432106b0","src/features/gen_ValueEvent.rs":"61bd906296de23dec127f17e69d6005e177ee94f66bcd89264e612a533e21bd5","src/features/gen_ValueEventInit.rs":"8f3ae3c0e24a465592cf4d1b13f747e8dac7c1066bdb0841a66bcae9409e336a","src/features/gen_VideoColorPrimaries.rs":"84a16e5b1285521aa972a7c120aba3e4e6c4ba09ee28d5a91181bd802c89b3df","src/features/gen_VideoColorSpace.rs":"c347084e2a96543f668cb9a385687a489aa779709fc778ede48f36dbf6c5d39f","src/features/gen_VideoColorSpaceInit.rs":"06b72089a8c631b4477dae281ed9e5841d36f19015d2f64cb3df8d969ae07c2f","src/features/gen_VideoConfiguration.rs":"9f16db4f216b3d9abfa719bb1ec15bb8f5bd36ac43cc1ba13b124a4528799f17","src/features/gen_VideoDecoder.rs":"5ac339d921511b07aaf233e2f925d139eda1aec46bb6bdf126d271af6cfb21d1","src/features/gen_VideoDecoderConfig.rs":"5af97131cf87ac9cff4ca6ea2d9c7e87ec24c73575c2e02ebe1447160d0f691f","src/features/gen_VideoDecoderInit.rs":"cb4fc191097bc5c42105d1e058d19bbd07cbc466268c5045e24c9e5ac17844ec","src/features/gen_VideoDecoderSupport.rs":"ebe09ca9d258b7c8b48dd5d11373ae91fa19e51551f5de4755b82ba90cd33fce","src/features/gen_VideoEncoder.rs":"b5e60800a115ff66ebff8efa2cd31922c35cba6ce44e8a4548fe3deceeb1271d","src/features/gen_VideoEncoderConfig.rs":"2e7293ff24af25852262609743e9d318f44dd8923d8686f601a4c1aa4e750de5","src/features/gen_VideoEncoderEncodeOptions.rs":"f133297997cdeba2e5abb7abb7dcf6ed84f4b4c1674612f63481dd4872dac93c","src/features/gen_VideoEncoderInit.rs":"140e2bfbfee6abcc75e2fb2fa4e1b48f05035038f3b0effcb90955c73b2b43a3","src/features/gen_VideoEncoderSupport.rs":"9110f37cefb0b42e330137872f7fd7feccd6dabeab6c13db2d9ce6bc2f06f072","src/features/gen_VideoFacingModeEnum.rs":"6a13ef5cdc574528532b4e67ad46eb54d07f846bfb547dbecb3b4afabb6bbb84","src/features/gen_VideoFrame.rs":"7aefd17bec7b7421cbfe9a6148e8939b2391bbe9cebdd66880d89696fa145ccf","src/features/gen_VideoFrameBufferInit.rs":"547b9e07d064f3d3e5f3e52742dcd7a697df9c9d3b4c5d513013454a07eb7a81","src/features/gen_VideoFrameCopyToOptions.rs":"ec616662f8f7fd9dccee8b6e03901eee3e93f9b11bfd3bdaa25cd0ddbe47fd6b","src/features/gen_VideoFrameInit.rs":"de84cfe26f4e6bcbc40668d3ecff0ddead49614dd5e4f17d521bc39a16dba7b3","src/features/gen_VideoMatrixCoefficients.rs":"5fa08051bd0eeaa391af5bc6b21ba622db3e4030bc310533aacaeb7d5d8bbacd","src/features/gen_VideoPixelFormat.rs":"3bc88631861fd02e18ff9b40020b79f01c91fb4b22623d928cf38d4c5042764a","src/features/gen_VideoPlaybackQuality.rs":"bff63c5cfc9c9acb45761759923ec654c8f73ebf5a25dcc0e299354a01efbb9c","src/features/gen_VideoStreamTrack.rs":"3ee89406bde4c1fcbbf823ee35c3d040d072e8f55b2f69dec59e88c486b5597e","src/features/gen_VideoTrack.rs":"4b5fb9d69f03623d0e5dbbcff168031472cf41bfe16b7a0f53827f04173f4513","src/features/gen_VideoTrackList.rs":"7783245e492cdb7125e9c9beedb8d017a087a26abc144ab7a0cdf20b7b70e3ba","src/features/gen_VideoTransferCharacteristics.rs":"309299f0ca9687b69ab676cd5cc0c6f3e0a9169841e4037c05100fab2ed4e305","src/features/gen_ViewTransition.rs":"12985ed30b55d693f37c5c526099baa3a92b6bbd86b7b21e131fb68ac03282ed","src/features/gen_VisibilityState.rs":"b09e19e4ecbc7a7f6938b263c1b707f558d731479efd2532c917d8ed62a27d84","src/features/gen_VoidCallback.rs":"05c53345a85fe3917064ffc3cf943353acf5a470cf1ccf8f0b6f5b47abc1df19","src/features/gen_VrDisplay.rs":"2973ecae743a9f8a23b3f39d14b12970c7219e7be7525b55c08b911165273d63","src/features/gen_VrDisplayCapabilities.rs":"ab4655895b1480008e06f81df3acf364a11af732bc01af2d0ac507a1abe88a39","src/features/gen_VrEye.rs":"5fc00113bafb9a115067f194b426fcbf1410bb7d1d591eb958622b32982b36c7","src/features/gen_VrEyeParameters.rs":"9d7b0ec1e459bf5936bf905c64d21fe12681bf75ce497dd492f9d865ad8a6bb1","src/features/gen_VrFieldOfView.rs":"c1bc018d11c2e3041356ed0cfd222e2643ec7528e6f4b05de6559d6f3c1b2d54","src/features/gen_VrFrameData.rs":"5717b24963b4aea2e34e7dc7f8e788fc9203b3c48ce9820b45f6d1c7a948dced","src/features/gen_VrLayer.rs":"50672e7b8808baa299963a960c4e38ddd0bec42ca38933dbb35a480f0d733014","src/features/gen_VrMockController.rs":"b661eadc684cf9b7ec82209aaca4d8f3934213a0e07ecccd61cebc3ecda19b0c","src/features/gen_VrMockDisplay.rs":"7d5b26316bae9eab4d32c7d47ea670dcaccf7d24ffe0a587379e38d61cefcecc","src/features/gen_VrPose.rs":"8c2213d3b99eac6d044a1fd7c27818f9ac4c403c815ff6308a7a5fcf140b7ce7","src/features/gen_VrServiceTest.rs":"74ab05ebfe35282ba9617145b930bb9264cb90989a76c67a078962a138e68762","src/features/gen_VrStageParameters.rs":"d8c5765a575b16c377c15e4c1a99befa4b2d4fcad417ecc9e119e25e5a3d1e15","src/features/gen_VrSubmitFrameResult.rs":"1578307ee1f28c2213ded5854b19559afc4100c379cb038b24b436b02dca75f1","src/features/gen_VttCue.rs":"fef2b72b3d7fa385169a2974d8cf7b871b5f58ad4b9af7f1644e3d9db2d333b8","src/features/gen_VttRegion.rs":"9611417a6ce63d0bbf29dcaf0172f06010aae9fa4536d97bfa34c9a5b12caf8c","src/features/gen_WakeLock.rs":"82c3b72475075bd1bba5ae783514030e311bd37992aff008095646ff5178d409","src/features/gen_WakeLockSentinel.rs":"d822dc604e8561a650ac92a6a0ae73db62b499ec843f703f0a2d81f321c5887c","src/features/gen_WakeLockType.rs":"d0f37cceab24e13fabd85efdc0f96f8626728b938db309e1a61499822a805a68","src/features/gen_WatchAdvertisementsOptions.rs":"9a7ff90281a3035aad715d1230c0def7562b749427441e922fb2f1da92b4bfb9","src/features/gen_WaveShaperNode.rs":"d879712320ff2c4d9447c8d78b7e4c97d5c4f9552d9d83e05f175ff7fb5d0483","src/features/gen_WaveShaperOptions.rs":"12595cabf889677ecddb0e9813c90c3682b954c9e3c4bfe923dfc8d97a90688e","src/features/gen_WebGl2RenderingContext.rs":"07572b6cffa619bf70e30121fa0add019ae13cfcf78058d76e5cfd197f50033c","src/features/gen_WebGlActiveInfo.rs":"451d720ba722d645353edf7af7c03b106e1463c235a9cd39d70a50a3df0d51cc","src/features/gen_WebGlBuffer.rs":"2e4b7c2fa73c1a34439d16cbf98104d6f89bd25ad465d5101934e72547b4cb86","src/features/gen_WebGlContextAttributes.rs":"619d4cada3534322a0a10eebf42ba45cdf758b8fadeabef0ce11f0accece6c74","src/features/gen_WebGlContextEvent.rs":"fb9ebbaedee72bd089e3abb76f485a6e88a702d23c5adb7a22552f812adaa9bb","src/features/gen_WebGlContextEventInit.rs":"5ba52c70daa6efd0f527fee283b5f759f4d58170bc73c4fa8bf62d3a5a25a774","src/features/gen_WebGlFramebuffer.rs":"354ef6774d2e2195feb582c8a0887392098b06dbf62eb10a6e890add73e5ca70","src/features/gen_WebGlPowerPreference.rs":"08e9a32a55fe1ccba3c373c8d1b4874b115d6126b0b4d611c1f8c4548348bcc9","src/features/gen_WebGlProgram.rs":"f87fab1cbb82e8f18321e14a6d807a66707d7d427e4fcf4d6468cfb51f357b39","src/features/gen_WebGlQuery.rs":"9459e53acf48ba864654d0d3828599ee052bc30c602f35deb8cf717d2a2e09a3","src/features/gen_WebGlRenderbuffer.rs":"6591985c15839205fa04dfa9ebcddd2d22a94d8139786e4017597b8e21a7c901","src/features/gen_WebGlRenderingContext.rs":"eb46964f1fc73f5746362c2b59a9da301e814b1d3aa1da9083dda89e0dd900a6","src/features/gen_WebGlSampler.rs":"bf2785e9f720f0eed1475985632b42e35bd4a86a4b425e798a77b12fb357d018","src/features/gen_WebGlShader.rs":"1af0c087bef275431e14fc02b99e7f525f7777340caeb0d1864d41ae0c05fe06","src/features/gen_WebGlShaderPrecisionFormat.rs":"d74ca425a9aabdba343d108274bae6b4e9c20d5e8fbf41bce12423ab7d1de8d9","src/features/gen_WebGlSync.rs":"dd23cb79922602eb563f7bc321cc4967ce1a92b1f9cfe1236b19dc3965fe768c","src/features/gen_WebGlTexture.rs":"bf541cdc03e32804addad54a3fa3829bb6dfc0458b91844db076e6d60d087fd7","src/features/gen_WebGlTransformFeedback.rs":"1f63c38b719747e582b276ae7f8a88d17a6bbc8ef09cf6d800bc7335641bcf70","src/features/gen_WebGlUniformLocation.rs":"71304a208e1759856f19ba6920516455153008d5a8128f9f8e9e173f0982aae2","src/features/gen_WebGlVertexArrayObject.rs":"f3c9227f50494c8ba5055e059ceef6a5f3d1c36d5b8ddbcb525d5962d4825a18","src/features/gen_WebKitCssMatrix.rs":"b79d0c8fa62a07c51a5b2a9eaabebb03133b032282eb275db4a0447f8425ce58","src/features/gen_WebSocket.rs":"d0ee33c211f5cd20f77564fcf13c46d316b88beea17b506c1e567e6328755d7c","src/features/gen_WebSocketDict.rs":"0b7886f411f795c1c75516c62fb3ef2a953543fd3f84919a129568d4739b2a58","src/features/gen_WebSocketElement.rs":"4800b9ec72c2dd075b41fda5796a8516faf7207f9483872302d1c92d5ecb613b","src/features/gen_WebTransport.rs":"6af1a042311c7a0e1dc7af582502b92788127fffefa90f72672657495feaa135","src/features/gen_WebTransportBidirectionalStream.rs":"458e78ab3791f9b455aabdd9c7a59bbf342172583cfb5248e761ffdc7a957e3e","src/features/gen_WebTransportCloseInfo.rs":"ec43d7d43e5fb3ec1c9a114fecef89071aa623aad8574a1ddab2c7c8e983ec99","src/features/gen_WebTransportCongestionControl.rs":"c1bc1b6ff61d4853c9a7b38110d5e6de57ce166d395d639893cdc1a16fe0d6d9","src/features/gen_WebTransportDatagramDuplexStream.rs":"55718bc4ca56e2fe0f2dfca711948250761dc3c8e1e492c40f1f3ee545f08388","src/features/gen_WebTransportDatagramStats.rs":"999dc02a3192d3b627a41b2d609977dc80f19eb0407c70f7dad8ac3dc1caf251","src/features/gen_WebTransportError.rs":"64f614a4c7f7a07adab67082ff284713014fbbf4965322bec9e9d74b70feb712","src/features/gen_WebTransportErrorOptions.rs":"96278f119ff6cda57d1a1fb8f4c42b29988771526dfb86f0421227e8767d9ad2","src/features/gen_WebTransportErrorSource.rs":"59c221d21d789f12d59d70b543736c473661a557b7be37aa7418ca8110b3cb90","src/features/gen_WebTransportHash.rs":"c8abd238546fb30a4996e670c052b31917730db67a515054803e0d8a7fd4ef38","src/features/gen_WebTransportOptions.rs":"56478adbdc3be1363aad91abec7dbe2516f7926a9fbd50ad60b10f4d03411c70","src/features/gen_WebTransportReceiveStream.rs":"b5aeec4a62ec139f213acd81712dad4bc7057fed306cf90c4fea89154848a33c","src/features/gen_WebTransportReceiveStreamStats.rs":"a71423ddd577dc12434b2ac3b5fdf8219d45bdb0ea76320e702e1cc20e4b8d67","src/features/gen_WebTransportReliabilityMode.rs":"2958c78a022aea93265e1069e5051d5fc62dabdc8e52159ea0b0681fa97ff285","src/features/gen_WebTransportSendStream.rs":"26a1c779d8d08343b3c792788718922b7f432ecb8c70f67b1834b71fe54db8cf","src/features/gen_WebTransportSendStreamOptions.rs":"7f29423873a4ef005e729f61cd9a4f96706203d4cbfc1f7cf98acf3392753a50","src/features/gen_WebTransportSendStreamStats.rs":"a721a139ada3ed79592e66595a37c335c54fe51f4f83390ff5e6866106149560","src/features/gen_WebTransportStats.rs":"3a9700a97e3772b5d3b0fcdfecf396f46d305546767903a52847b26a61e9050f","src/features/gen_WebglColorBufferFloat.rs":"fb0ad839cbdb15f5462a9005943b43834579021d721b84cbe7cb92287060284e","src/features/gen_WebglCompressedTextureAstc.rs":"a22cd811f50e5f15c4315422386a515e0173038e75a4f9d696ee0a3dcb11a121","src/features/gen_WebglCompressedTextureAtc.rs":"523b98df7479ef4c93bfb6dfc731d30d7a6d553cbc86787bcdafe751c3371c3e","src/features/gen_WebglCompressedTextureEtc.rs":"bc159423afd07b57ea12c2565393a71efd3ba515484ae1b490435432f9bea917","src/features/gen_WebglCompressedTextureEtc1.rs":"c041bd0e88a01a1e64dc53cb86a8048c379bf7efced8342ee0a3aaf499eae958","src/features/gen_WebglCompressedTexturePvrtc.rs":"34971edc49ab360d6afe4eb459aa1c8ec1869744f08ee3596bd6a2926f903580","src/features/gen_WebglCompressedTextureS3tc.rs":"7a6e7028a4d4f289d63edcb409361109c5ed579316f2502978ed1d2856f498b2","src/features/gen_WebglCompressedTextureS3tcSrgb.rs":"8462aef67ca48b2d516a27e55cbad3c305817966d6d5e986ab1ef1ccf52c6200","src/features/gen_WebglDebugRendererInfo.rs":"defc88f23103e95fe7dda28adc7ec9d382ca1848fbdb7363f9825ef550ec9810","src/features/gen_WebglDebugShaders.rs":"d452ff1e7a7e2e561a7cdf46235d66aff0f54e0acfb0f3e2f07620e1ed1c9963","src/features/gen_WebglDepthTexture.rs":"b425833c41bd5fa09e0740f64dac771721f44db09d1dac63c9d7ca1cae47c6a1","src/features/gen_WebglDrawBuffers.rs":"82efa9a5af62736665918f4bcd493587a788e127c54484629d6264c6277cbd2c","src/features/gen_WebglLoseContext.rs":"55039075f93c3ecfd6ce186361b87c138c59a48eb962d9e5ca43a7638408b0a9","src/features/gen_WebglMultiDraw.rs":"4e3d3bc8b7e339b9602256b772e7232276d59aec2b6a2d24c5d27025b1828aa3","src/features/gen_WgslLanguageFeatures.rs":"cfb20af2a3e611d876c9342faf071cfab87cef52ee5f53540a407186ecca6abb","src/features/gen_WheelEvent.rs":"253d8bf6759b25e70cc2d38d922ca7742df1eb15f0c53fc032a65f3f209c76d0","src/features/gen_WheelEventInit.rs":"f0c6d17031a849d4d0706e04a63cf5b7f77e491aa29965a48e56837da52861cb","src/features/gen_WidevineCdmManifest.rs":"f1c5297a6b6617b98442e9611958dc2fee2515f1d31acc4ec749a1b5100119b0","src/features/gen_Window.rs":"7332ac48778c7acc72ee459f0baa0bc6c90ce1a599b28239f35c1b3074e470dc","src/features/gen_WindowClient.rs":"e2e9be5a4e90f039125368e385719fd5b7bf2ad4ecb3a0964d41d9f36243c010","src/features/gen_Worker.rs":"3943b6505ed9ab47b2c01df99d538b402dd0259e28acd74a33e04851934ae43f","src/features/gen_WorkerDebuggerGlobalScope.rs":"4de77c302e531b3b642fa7a3131dd4e5c0f4f6c21cadf26c3bcd590205af3e90","src/features/gen_WorkerGlobalScope.rs":"e5a47a43a826d9bee2de239b4fd731c5a5eef80f43c4f6a041af67b3e89f4280","src/features/gen_WorkerLocation.rs":"821ad721dc0fc6e492e67aa73a5f7675cdf65172f506c68073ee108ffec08612","src/features/gen_WorkerNavigator.rs":"1c8886a661847fa973b3f20b55b51773963ee638dd9a3d4694aaf841d95ae65e","src/features/gen_WorkerOptions.rs":"0daaa92a0f5e511275d7ba549505561f628f8fa15e3ff03253077318a854bbbb","src/features/gen_WorkerType.rs":"1f7d3c81aba26cf39697e45855decb7386b13e7b3ff83a8c56accc271e7140e1","src/features/gen_Worklet.rs":"5b4ee4558ca9bfa4006fc80537cb3fe1ef7735f43d32829d357203a41cbca860","src/features/gen_WorkletGlobalScope.rs":"05c3c7946da501ba067597a3265ac194a69072fe9a0f061a71ed0457c1cbe880","src/features/gen_WorkletOptions.rs":"4d853dd370ca9cdbea4d32d9098fe64ba512df682558faab92de7b8fe36741ef","src/features/gen_WritableStream.rs":"53c50cc3a652c3ed9df984380aa2fbb69edad70028447f542c869d7dbc713eb1","src/features/gen_WritableStreamDefaultController.rs":"322f65886e617317395db55c97a6dab354f6841968c4b71e15fb1aa424704dba","src/features/gen_WritableStreamDefaultWriter.rs":"3aca074a58cc039daf9a3e99ec44cd8d67acfd8750e99e9bf33a54b6e6386290","src/features/gen_WriteCommandType.rs":"f790c35bc48614d3d9a01b7d962c74580f95e030e7dc653cd9208e213aaff4b0","src/features/gen_WriteParams.rs":"0283680f68fa077fd4a79eb56791cf692c52ed740cb1fa9a1fd8c2d902368102","src/features/gen_XPathExpression.rs":"79a949c40933ec0d183d39d4efee0b2e898eb865b3a4c957630a0bac295f544a","src/features/gen_XPathNsResolver.rs":"21a68efb64053906e51c2eafa790429874c86ebb913081d77bd6b2de282cf7d3","src/features/gen_XPathResult.rs":"7f9c0a7c2443f3b9ff0c42e422dc3b0d4b128608339a397cbd01557c1658eebe","src/features/gen_XmlDocument.rs":"36bb7b566213dbec46f6dab50ec41f196ea0e99aadf8fb0a0034578e31e3f2cf","src/features/gen_XmlHttpRequest.rs":"6149529e86415f2e5076a9b0e80262e217dc3c70e98f83b06fd2979dc88aa27f","src/features/gen_XmlHttpRequestEventTarget.rs":"2ce8dd2e07936140ac141ec8946ed105354308d8573e17db4da9ec955c0e3a43","src/features/gen_XmlHttpRequestResponseType.rs":"8a89bd9ce7cf101d5e2833bbd3e6d1f3dc7528444800e904a286410a1753d226","src/features/gen_XmlHttpRequestUpload.rs":"3852e9fc98e9c1b530df5e6ad7537e4be8577230553aebbe48cf3d2196c87b94","src/features/gen_XmlSerializer.rs":"2d757977269b26fc4ae28aed51c6f300e230ec8e88f12878fa22ec6cb170b589","src/features/gen_XrBoundedReferenceSpace.rs":"279ac395730a189114f45f44b7ab75f121d7958ee656b3bb9851111f39501bb6","src/features/gen_XrEye.rs":"a57e6589e84584ad08ae1aff625b9d12e245160d6995072b90b5ce4751bd38e7","src/features/gen_XrFrame.rs":"9403455720f398a5cc64d7570d7a8e7de1e06cd5ce9486221f40571ad7bb0199","src/features/gen_XrHand.rs":"7b9d11e19974c863425cad801dbc3d6a119dad1f313eec1c1049f936dcbf4a54","src/features/gen_XrHandJoint.rs":"3d8f27904cf9936786df62c9524d4ac0e43abc62f1b74073a0bcb878b5328c75","src/features/gen_XrHandedness.rs":"6e27a88e98bc7d48ab2944d518dabdf643943dfa30b0329e1df291f80db80556","src/features/gen_XrInputSource.rs":"9eae08bd3d97811a8c9b2f49f03a5e3b2d9ff0d7d5647eaa9ca17e5e81a570cd","src/features/gen_XrInputSourceArray.rs":"ae5d683fb1947f26518546f656b25ccb85b98ae7625f1fd6375d277dcfbe06a2","src/features/gen_XrInputSourceEvent.rs":"9380361568b0ea143819e85f72f22d4dc4181a747c611a373400d5cea5c1a0f8","src/features/gen_XrInputSourceEventInit.rs":"b66bdecc8565a6d43a15bc3f6686a107da5052eb96f10c29831f1c0e4ca4c48d","src/features/gen_XrInputSourcesChangeEvent.rs":"c67a2802245a4355a44b13260f3987bfdbabf09c4b30d6e228e9ea8a4fb42818","src/features/gen_XrInputSourcesChangeEventInit.rs":"dd4aeaf885bfe33a9df4a189c0787dd6756c9125fd16d1c0debf61bb686b290b","src/features/gen_XrJointPose.rs":"bf103ab59391799ced03dd27f2a35e7421f933b5f6b8ba49352274a66819057f","src/features/gen_XrJointSpace.rs":"db31fc02957e7bf98df0a45ba65f0f56ba83ca4e87c00bdfe6d7747603505ecd","src/features/gen_XrLayer.rs":"11db85d0ff30c07a3d9fa3f5979d3a262ea0f53be9713f6f1120f93c11d452e5","src/features/gen_XrPermissionDescriptor.rs":"2c13c7655379b33495f68cb139fa23fcf155be2d553c58d7cd9dc1d5abf167e1","src/features/gen_XrPermissionStatus.rs":"f5a7392681dff7881a1523a667a83630a3f3e887a44b06a834448a535a0fb7d6","src/features/gen_XrPose.rs":"2fc45cc108ffaf2f06ff063929e8e213b5c3760c8adbef0680d0bafbc7369dd8","src/features/gen_XrReferenceSpace.rs":"54c7b49bf29ad5dd7527a4d493cd8aee0441e0f401c0bfe2bf4d6cdf8ed219d0","src/features/gen_XrReferenceSpaceEvent.rs":"d2d4c1007d0dc1815387b66f66a9a65b805dadf414db9a68b47e73002581d626","src/features/gen_XrReferenceSpaceEventInit.rs":"f07c2b92c06f0cfa5c4775b4f4eeceb75db037be05430d26e58686dc9db06e13","src/features/gen_XrReferenceSpaceType.rs":"69879dee14bb4ec173792eec4a90aa5a1757207886660b8de9b72915b13223f8","src/features/gen_XrRenderState.rs":"a06d48a56a26f9162adc0a38d901164acf44dbb4759fb2fc41a554c066a065c5","src/features/gen_XrRenderStateInit.rs":"41fd3d5c10be4a12bc75788b366cac7327f19b66fab74c12cfe52b1fe6fa58ee","src/features/gen_XrRigidTransform.rs":"66a958262770ea0a18791b958d366fc7c6532f15edba54addf716f03d6de33e7","src/features/gen_XrSession.rs":"d5d1aba495bac72b4fcdaa1d441213c67939255417f3366eaa3f390c594e0a24","src/features/gen_XrSessionEvent.rs":"62e2dda288bf09b7ab004b8e3d5260d6ef56314ad0ee187ac21c014e1ed2f66d","src/features/gen_XrSessionEventInit.rs":"39503c6ed54c3f5f9a2880537cfe5d501d8bf04b22271a0909db02dec906dd96","src/features/gen_XrSessionInit.rs":"c4c0acd12244104165074683e5e82d667cbb2f714fba5a979ef16e837ef73cd8","src/features/gen_XrSessionMode.rs":"9e1b7cdda0407859d14bad694be9b0b7ed8df9816e594365c72d06facbd74e57","src/features/gen_XrSessionSupportedPermissionDescriptor.rs":"f75bd9384eb28a206b65345455c1002363e3f8e73965448675304e333a47f4d6","src/features/gen_XrSpace.rs":"7885cad4c4c03e0c9477a313765863c124fecd5a164247c70dbe95f7cc3b9707","src/features/gen_XrSystem.rs":"d9fc777175018e843fd09978023dd230ac65d1df2c771b272e871e145ca09cce","src/features/gen_XrTargetRayMode.rs":"14668a44341666685f994d1eed3f45dda7a92a66b1899f544e2cbe1ed567f1a1","src/features/gen_XrView.rs":"4275557a79fc4db7be9d4aaccffef80a3e0916d60ff3cce5922ae7c2c23289c3","src/features/gen_XrViewerPose.rs":"bccb6402a0b3263425a94830ebf51b47e3cc627a47c254da17b2f471ab0766fd","src/features/gen_XrViewport.rs":"f117915e98ba557f9f8df92e654245e40f2eee9dd65dd11f402770f64c81ad69","src/features/gen_XrVisibilityState.rs":"48a5941406b1a1a3b2407aefc46e87cf0cd275e05fd3b26d1c2c58935ac946f1","src/features/gen_XrWebGlLayer.rs":"08a4942986313fe8b67fd3af20d495fd03697a3dc9098dd62e1d46c9dfae514e","src/features/gen_XrWebGlLayerInit.rs":"3366c49bb5d6d86f55cce4cc02af5e3a432650bc219ceca1a712a8452491c09d","src/features/gen_XsltProcessor.rs":"e7f6d5b2a5de3dd8432a106af56934925709f61ce2139fe2254ada81ad9d771e","src/features/gen_console.rs":"d7b185f3fb2dfb0cb20a3e0e4c99d479f76197bdf001fff6ce5e822baa6a1450","src/features/gen_css.rs":"e1f42fe169d7948cbaa635e4567dff5fb6630215413dfa263c89bcb1de890dd6","src/features/gen_gpu_buffer_usage.rs":"b54cd59f1900357dbfe7209576fc96af0c9963df62056342632c1c6d139d6016","src/features/gen_gpu_color_write.rs":"08dea3fc0afeeb7776205987838a507654d033e8d431eaa29f1472d561cff87b","src/features/gen_gpu_map_mode.rs":"583ce179f035d5b2e6da9d981083e8507c728059fa93a6f98c9d01f4c77e120b","src/features/gen_gpu_shader_stage.rs":"9a039d331a96dcce51385095244cf223d8b7691a945ccbee61540e98e3993f95","src/features/gen_gpu_texture_usage.rs":"59b0bd64a38ecc2e63ee1a2fca516ee3bef8c43c01385cb2d313a561afb5872f","src/features/mod.rs":"38517b25a54676e28ff0cea96c9fb56fef3c928731fb9e68068591e97997d1b6","src/lib.rs":"1d3fef62c77c65f59c37f1c32f5e52ba3ffd8fe3ddc0edb42520e4fbcbbee991","tests/wasm/anchor_element.rs":"d81b8164a053cb9bc6e0260f9d02189b1a3b0e6641a2ed6f3a5ad77651355b41","tests/wasm/blob.js":"0941f81ef62f2b79576d5449b1ed9ace4769e8cc9217d73ee5a84458ab301eaa","tests/wasm/blob.rs":"897804ae34183197bedc199a29cb0e579d5eb02a536df278e0174835610cdb17","tests/wasm/body_element.rs":"a685026c9661beb45cfb979b40ac8a4db4888c1a31290c607f1b825f899eb7dd","tests/wasm/br_element.rs":"e173291a963e904d1af98af2a56fea5e0261fa521d0f5bf2190e9db379a02750","tests/wasm/button_element.rs":"cc7814a92a83a4e17d479bf05b1d598dd8cc675ef876ea087a3fbaed8dd3a12c","tests/wasm/console.rs":"119e2fca44af45ad2729caebc03480249ee6b7f14aca0714bf6b813fe818fc0b","tests/wasm/div_element.rs":"e07aae54d094c95372ecca15e7b4bcdc51a033c2e832ff128c00579c692fade6","tests/wasm/dom_point.rs":"157b3fc2ba453c71d5dd88afff6645f646234b48b013a90897d22783b9f5b99f","tests/wasm/element.js":"924a7ad4fac9b7742a16986ea5f29cd2ad73fda410d51af892ba28541d8e5053","tests/wasm/element.rs":"dcbd4995e50553cc01f36fc034c0c971079a2d4588d31ca2ce6885e4a78e980f","tests/wasm/event.js":"3bb5a3f34d82681f15f64467621eb71a2ee003a941eeea3a86b74b699c686981","tests/wasm/event.rs":"b477d1a39a2e45e1bff72ad9d6f5c95607a5d96972935953a3ef2d453ad12379","tests/wasm/head_element.rs":"7a40e1d68ce01f73837a888813c593e98361a51c43be0a517e4250597dbc46d3","tests/wasm/headers.js":"61d901c54bc6061c253f2e008d83a501a5c474199dbaf11f4f9b4c902b9828fe","tests/wasm/headers.rs":"0bc1dd8e35110563afbcbb8ea859ad4cb75c0144df8fbbe2fff6a2c67a98c95a","tests/wasm/heading_element.rs":"2b03a9e8be6dc8f775a04d567ee5cb662115b10685c4c22b65117571baf2d459","tests/wasm/history.rs":"431de0cb978a8af659bf296bb9b21d7e1bb89a403f22306a08ab8242014058c8","tests/wasm/hr_element.rs":"a8a5a947cf929235f97eb235c35e72c19ecad708db6e0ed9736dbb6714cfd60c","tests/wasm/html_element.rs":"6ae1626f3780b0ed18a52ece129b08274546d1bf1204d108a3b3dc490b275826","tests/wasm/html_html_element.rs":"eec3cc44e9dfd497ee4f3a2fa86fe9b29bb6ef63a6a3cdf2d222c761939635bc","tests/wasm/image_data.rs":"5f37ea0a65d5aeeba236ec5c243c626371dd33169c26ab53a822287550957189","tests/wasm/indexeddb.rs":"85d85320d2dc03340f121f903d701bcfd893d069d2f41762b9f8e972354b1390","tests/wasm/input_element.rs":"a13ceb8487fdfb34d225e3a1cde5bcec575c30ab056b5fe4e35bd7aa7c8d5876","tests/wasm/location.rs":"02280feb8888d6cbae4c78c62464a74a948275585a22eebebbaac088f089dba5","tests/wasm/main.rs":"a670922e282e08cacfe37b97815c9770c7cbf509fe9fbc017e17710288f54e83","tests/wasm/menu_element.rs":"e184f9977f7f678148f1c8eb5f51f9a6fdbcaec43b496f368f3e8899c91fa414","tests/wasm/meta_element.rs":"81b2529543adeb894dc148f45f17c5a64e31a2a87a93d5e258818c53ddb9bf8e","tests/wasm/meter_element.rs":"fe2504c6cc10c99ce94d55df0cbfce86d9f2dd88c627e2ffb4d8010085c994f7","tests/wasm/mod_elements.rs":"b678141009a5ebaf55e8171f116e770eee2712cb30884bad42e8a60e12fdbaae","tests/wasm/olist_element.rs":"6ef5067d3e1a3c4efc8f2c429286245dc9874762ec0dda2c6b72dc560fa22f67","tests/wasm/optgroup_element.rs":"f64dbc200f3f700a43f0d4628901a1b9d40f8c818244c52324d9602c4d3a1bef","tests/wasm/option_element.rs":"c841ff8ac3abf37fb0306ff553462195140869dfca978c749a59fd168fd82e9b","tests/wasm/options_collection.rs":"b9071a0a8e659cb59a09a0263ed15453186720653131b8b3bcfb2a41bf8b83a1","tests/wasm/output_element.rs":"6a3f7dca0d18cc01b37f413797e8b0efccdbfdfbbb96d133b387426a71a0a34f","tests/wasm/paragraph_element.rs":"e2ec82bd46336dc186c9a127330a115ba16749e6e2002f0ed98b6b45ec6e851f","tests/wasm/param_element.rs":"3d0ba799f06d06448d33f47134fa93b3276cf71aea03ba271368259aea9e4f20","tests/wasm/performance.rs":"3e89000a2edd79ddddeea319f00d27988582ae96fd82470c038e02813e19c3f6","tests/wasm/pre_element.rs":"91e5dd0012b33e54a5d79436f10505a33638bb0cd8c623063ea647da5b73603c","tests/wasm/progress_element.rs":"192c833db7e02d30767a2411405ba2989d0be0376dffda4ed696440e1309ef56","tests/wasm/quote_element.rs":"069bc812ee94323550d699968b49c73179f03cd45570c0252ae12943cc90f7c8","tests/wasm/response.js":"348c69796ae672a7ea3ed4e170e6474d551b128094e61679ef9bdc5fc05ec480","tests/wasm/response.rs":"380029c289b17383aaf7624cb137e5cbdd8382ce63fa582af8c33e6db1db29ba","tests/wasm/rtc_rtp_transceiver_direction.rs":"8110c5dcf11bf644b69d5e338092f864656d884191690326ce5f4d07033efd29","tests/wasm/script_element.rs":"43ab8519f106505edf7b260c9ffc8dc6f0601c85f0b52820165a18d104ad3a25","tests/wasm/select_element.rs":"703f4f66c52b1701d8f3624d192081fd61fb3b125cfba7ea92839b198a6a33ee","tests/wasm/slot_element.rs":"595de8b501931d81a14cce1e19c4658e315fe67b12a9d8e5b935105fb1069796","tests/wasm/span_element.rs":"8674b3d22e539c35348eccdb5ec7bda067664475e0bbe6fc7f93048fb58016eb","tests/wasm/style_element.rs":"258951e44d1b090fad51ec9f88a39189b23db512cd3038ff14a74843676a9bfc","tests/wasm/table_element.rs":"0148fb21f804289f00d076ec2513f264754d2e18ab2b36321073901c4065cf32","tests/wasm/title_element.rs":"45441849b48e9a76b2154b2b2537d2a3de3acb2baea45344e99a33b3344759eb","tests/wasm/whitelisted_immutable_slices.rs":"116e1d40ee9efe2e7318e1e6a885d3ebe64fc00a193a767598bfcba4f0ee4714","tests/wasm/xpath_result.rs":"73b4a266fa9cdeed78995f167ab965d324a049b1acccaa9452030137278b0739","webidls/disabled/README.md":"fed82e8fe36dc5d00b920c4ee9a2414cd0ce36acbe5d919aaf74b63d54a35171","webidls/enabled/AbortController.webidl":"f58169caf4ce85fd1aecca3a6407b34eec7228bd38909110a5d8ae09a62f60f9","webidls/enabled/AbortSignal.webidl":"f74eb8fa35d704e08577a79d9dd43af9f85acbb10d5c3f45c13b8095d53381cb","webidls/enabled/AbstractWorker.webidl":"686dd52b59005af6a26c4568587a615aaceb29dacaf62c68d85c49b652ddd05d","webidls/enabled/AnalyserNode.webidl":"b13c9d8f4f6ff18c3c356320376a20441e55ffa9023d91163eaa1bcc439875c2","webidls/enabled/Animation.webidl":"6a4f3b332cbb42d2e59e8e0a85b88fe7312053279869de725b894322faef0e5f","webidls/enabled/AnimationEffect.webidl":"6e0a16de15cd7b6f69217d04ee45b53a4a3f0673e39fc200ed822fdcf2320bad","webidls/enabled/AnimationEvent.webidl":"1909fde84b084b7f08c6ec743fbbcdcc999752a82e6e41b1eddc11a2aa993ac6","webidls/enabled/AnimationFrame.webidl":"ce1f038af1135785ec402e84f9699c527a5931c1415260b559a7ab89f3181e2c","webidls/enabled/AnimationPlaybackEvent.webidl":"4ad10915c9f09c3c29d916ed60211bd05a4dfc1808134b3c86dd5b59ed44cd5c","webidls/enabled/AnimationTimeline.webidl":"2919663ac49c67b37bec89bbadfa588da6f0151a7f76aefc14de2b401af9f3aa","webidls/enabled/Attr.webidl":"93c5596b9910cdc4b7e5a1d10540140804b913f6144bf92a2ca4908989810786","webidls/enabled/AudioBuffer.webidl":"135fdde7d51b0583ce5ec3dba6489791b74911af948d422f393115b4448119b4","webidls/enabled/AudioBufferSourceNode.webidl":"c3be4b3dd9277c05ddaf36637c8c068b8fbefa7b2165c17f87137ca827cc3aef","webidls/enabled/AudioContext.webidl":"2176d8a47325bc982eeccfd93af6e9e579ca6617321a29195767cae26f7f34f4","webidls/enabled/AudioDestinationNode.webidl":"2eddaa6204b0909cf04d5cb0d3f1f5be437627c6c6d6d8406e76236d6057acae","webidls/enabled/AudioListener.webidl":"6b5d9f559252f7279797b9cd283f6d8ab8ac158ac60ed3b27bb6ea2867ae233b","webidls/enabled/AudioNode.webidl":"e3608d3db0c6bd456b47ce7417fa20b3e4160e4e6bd24e0b47b8892760a51dc2","webidls/enabled/AudioParam.webidl":"7c05f7dc0f835dcd11df71a14acd8f022420bde29b1538608d94a14675e270e8","webidls/enabled/AudioParamMap.webidl":"5de70145121b759dd3c0c0fae816efd16594ec54e0bc5cede32b3ac07c19d98b","webidls/enabled/AudioProcessingEvent.webidl":"d3e745f7638c8612c935ecdea396a79ced2c85db92ab583663c6eef960b1ba26","webidls/enabled/AudioScheduledSourceNode.webidl":"bca7325531eea98cf7a145f957ac41110d9c9dd6a1642c33c3e29602cce8aabc","webidls/enabled/AudioStreamTrack.webidl":"02808973b874aa79c1a48679034388756a3290c12f82e3628582eb31dbcea947","webidls/enabled/AudioTrack.webidl":"05c804d8782e2fce573f25bde5ec22e97b62db30ce078f41a5557e215b0fa182","webidls/enabled/AudioTrackList.webidl":"042090b55f4177512d76af56c0390ad464db5f7a7885c27782c65f712373f147","webidls/enabled/AudioWorklet.webidl":"46c6d9db119e3ad907c4562d72622cb8b50565cb94bd471785e5a5ec5cfc2eb3","webidls/enabled/AudioWorkletGlobalScope.webidl":"9c57f6122faa98f1d4bfa08a6929f20fd4d36283ca4c419a0d77fccbade63e0d","webidls/enabled/AudioWorkletNode.webidl":"152b5807d30d7758536a788df8acc249d86ed0da9ffeb102aa86a6f29a7c0ab5","webidls/enabled/AudioWorkletProcessor.webidl":"d434eeec0f01f4e4bcfffa09265d001465e6c5de8ba04e554c46cf0856580511","webidls/enabled/AutocompleteInfo.webidl":"37c61e3383ed0adbf64c58dcd971526728f38d795e34f4a169df906a94318be1","webidls/enabled/BarProp.webidl":"7090c75a43ded4a69279c21d95cfa93bbd892f28cdf20f07419024625a20d8a5","webidls/enabled/BaseAudioContext.webidl":"ecbd01c99db90726b574e2d9a5e95860902fd5db540a3319f79de236ccdb3622","webidls/enabled/BaseKeyframeTypes.webidl":"868c8af21d1dc070665bb4094ff9120864b51ea782456b15e19735f884bfbcae","webidls/enabled/BasicCardPayment.webidl":"58f8668af928def7f481264e9b188eb8ec37d06a6d2db7f09982527ed12f4c80","webidls/enabled/BatteryManager.webidl":"6e1a16048d8461a2fe741bd8c5a36a7e0e5568aa23df3cf6d9171c25bc410b51","webidls/enabled/BeforeUnloadEvent.webidl":"ece2550a12535f09976d2162f275549786e297f716d0a4a0602f0abba4b88902","webidls/enabled/BiquadFilterNode.webidl":"9479e916a533e347256cb39802d9a60056fd7e437a376b695e9ccb3f119acab1","webidls/enabled/Blob.webidl":"6e2e9170e0f106f7288d887ab20f6d8c86ac740efec0b449a02b7067aab381ff","webidls/enabled/BlobEvent.webidl":"daa437be043dbb78f3a0ee0f2a6d678dcb1b87f93b30bb1eb5ffcb8e35a91b61","webidls/enabled/BroadcastChannel.webidl":"31d906ead85a2dcb44996cb7a31daf8640f68c9509495de45b57a7c8350576b9","webidls/enabled/BrowserElement.webidl":"b5d93eedc74fe16e914147396f709760bea9fe04509050e7406a9fe4f92b54f9","webidls/enabled/BrowserElementDictionaries.webidl":"b17c3827fe54297b6f219366578a014bcd026696f00c9af69f49281dc11ccf0f","webidls/enabled/BrowserFeedWriter.webidl":"2e1fea89a94d92471a6a80401f87cf3efe0cb573050d8ac3b87f847a204bdcac","webidls/enabled/CDATASection.webidl":"d4b63c03dbbe6a3d4f6e4af3e14623275d1a340f63197e99799752daa3b0bef4","webidls/enabled/CSS.webidl":"fcd69a266cf4afa42918686fa6c3905e100d3818e371bc5024466d45e58ded9c","webidls/enabled/CSSAnimation.webidl":"6b22c711173de295a97e58441ba978bcd5b94d9baa61be942f3057a75c68d43f","webidls/enabled/CSSConditionRule.webidl":"db214bd8a2318883f743e6205d9de8bb0d0e6177c3aacbf5d7d9edd53a5ca9ec","webidls/enabled/CSSCounterStyleRule.webidl":"f6d000ed82d6865cd90c1a9c50f92d7bdf750817ffdaa8f4bf48d620396a1e46","webidls/enabled/CSSFontFaceRule.webidl":"776837af265c277f0903163c82463f17522f886cdefe287eccd65e1ccc76b8e1","webidls/enabled/CSSFontFeatureValuesRule.webidl":"5c41b9f45ab3138d14bda783a71a5cd7757bf322fdc6929c5ecfb7766aba6fbb","webidls/enabled/CSSGroupingRule.webidl":"c666240491d2b7d616e972cd71e0d8fc7cc122c7f0f524ebfcd15aec56100c62","webidls/enabled/CSSImportRule.webidl":"2a86b7d98441e09625f9bbf0c37fb19d156bce2be4a67b38b77ace84499916b5","webidls/enabled/CSSKeyframeRule.webidl":"9be4cfc74e85fc5cd6caae8e0e68c501e230ded614f395b1fb4bbb5ba317a655","webidls/enabled/CSSKeyframesRule.webidl":"8e9c7b2aba2d44d0577bfa2d47aa99b3b6e9c97d02b19e2bc195d6ddf2ada652","webidls/enabled/CSSMediaRule.webidl":"4628bf3fb3a1e962a9620c3a9f0e38c83f13f6004821e7f44acc9426580f675b","webidls/enabled/CSSMozDocumentRule.webidl":"75512e059392c8508d4bc1482b8fb64ada87b98c0a49facb03e989da0516ed6b","webidls/enabled/CSSNamespaceRule.webidl":"ad8bf21e6a4ac78ce0121a19a81ef894be10d4181be073e1953da71de679700d","webidls/enabled/CSSPageRule.webidl":"cc9ab4d1c6f97d271072518308ab8ac304349344f0d7eccf79d588a2fef237fc","webidls/enabled/CSSPseudoElement.webidl":"b5301e7127d6f242e986dbe27a28c3a0fef9cd4c4971a40de57226289345caf0","webidls/enabled/CSSRule.webidl":"0c80b2aa8f585e8c079cdfe7501559a03d39eb29f5c67fb28f6693f84b28beec","webidls/enabled/CSSRuleList.webidl":"c154d7193260fd94e0bc6e59004688acbefa5e6295141800319af6b48445bf11","webidls/enabled/CSSStyleDeclaration.webidl":"9c2deefbce32527759551dcda35a6cbeb5dbcf517ed28539f8a1a88a4735cdd5","webidls/enabled/CSSStyleRule.webidl":"af892d9d4e5bcfacda5eb3149d388bab1c48e315457e7da9e634b15641c3e15c","webidls/enabled/CSSStyleSheet.webidl":"a2fe32a74f0afc5faf54c5716e629e7adcf8e17bfa93589caa6a20e49349a775","webidls/enabled/CSSSupportsRule.webidl":"4bcb8d7322a6946f1e221f50961032e4f7e0d505e1e4036eedbf6c77ece3bdab","webidls/enabled/CSSTransition.webidl":"4eacd7bef998ef2a65c04ccd4cae986412861aa832b557e267f26eb6147713ff","webidls/enabled/Cache.webidl":"65bca29e1f8820f75e37ba315b6053901db2df2828941eee9ce7c91b68081a12","webidls/enabled/CacheStorage.webidl":"2241ac3b02009ee05e398eef37c2c1c820f51df51ba9e14921cb53a0e008a9ab","webidls/enabled/CanvasCaptureMediaStream.webidl":"a293335fc5b56ab24cf6e6a5489d1fae441cfa6ee0139d757fe64e53214b2799","webidls/enabled/CanvasCaptureMediaStreamTrack.webidl":"66f36fd72374d5274b2aa4739870af7b638aa186b321752bd7689cd1d8d75645","webidls/enabled/CanvasRenderingContext2D.webidl":"d1f6175db6b1299a1fa425c0566cd162629cd3cbeb0fe131e75abaade11b4a21","webidls/enabled/CaretPosition.webidl":"ba94dd9aaf16cfc0ccd542c95f3660cf077296240b9dfe4334cd6b5ffe671525","webidls/enabled/CaretStateChangedEvent.webidl":"0134ffce3d0182e79c9d6ff8b7c6cdb4a97d9b2ff9a13561366811cfea6a12d8","webidls/enabled/ChannelMergerNode.webidl":"7f11b5fd15a3f6ac3f044e467cac63a26209cbc4ead0457bfbd41a08640e9125","webidls/enabled/ChannelSplitterNode.webidl":"b6c1dc502e54d04774d49dbedc3e272279e58c32fa7dfa54d79c21cedbf47e2c","webidls/enabled/CharacterData.webidl":"9e25440ce2f886539ea3395d0db29f198cd23682e9c3fb2b22c60ceb42c08569","webidls/enabled/CheckerboardReportService.webidl":"e9dfab3838aa24bc97447c7626984ed50ff1c44fd35fe6126472348174a66818","webidls/enabled/ChildNode.webidl":"07ea27a94a9cd723bffee9b97c82dd6b532a5adf6c9f61dedd508896666a885a","webidls/enabled/Client.webidl":"97a3f557fb24f6ab44f6a79b2dea8a44dd6651a9ec636ebefcb72dfd00b682af","webidls/enabled/Clients.webidl":"8abf090639c031cfed787bfeb706764c1411bb0694f3e963a7a318d1a07e2f4a","webidls/enabled/CloseEvent.webidl":"4be59406394ce09bb52df54fecc0e4d8b57b9a4dabc4c879932de6f18a77c9ff","webidls/enabled/Comment.webidl":"247cdf5db093d5c6cd65026fd01e89bff9238219bb396b9bbacc0414000ffd4b","webidls/enabled/CompositionEvent.webidl":"ab086646c17da2b5572ae3adbbd58a7c5753f2db4ee91b2ddb227744b647b9fb","webidls/enabled/Console.webidl":"b16ced12e357ba51a89b034984bc8c71a1e29b5e28dd04cef28b01069539040f","webidls/enabled/ConstantSourceNode.webidl":"b73cd0b4b99f807884e414d02f23cd463f6ce18930c7a7d53404166b5d1483d1","webidls/enabled/ConvolverNode.webidl":"f3568dc792134493c1eeb3695aff0a050583432a62fcbebd6f98f4c965167a60","webidls/enabled/Coordinates.webidl":"fbd19a84b321fbc47e36920e0b928337425663454bf18a008e2614eadcfbca0d","webidls/enabled/CreateOfferRequest.webidl":"3f2c597dab891a9ab706877d247d1813cf08b186b6466a607c98df3b9ed3627b","webidls/enabled/CredentialManagement.webidl":"4afb5893119ee632e570fa2c78cfb9fc4c31912fb6ad68ec3957c6a3a9eb3fa3","webidls/enabled/Crypto.webidl":"426dde526bb1b70d8fb2cfd12d9628a8c5e5f6d46ae123617b2f8c51705712a8","webidls/enabled/CustomElementRegistry.webidl":"a581b8015f01ec5b6481a081719fb43627fa7f26cf11a155345fb57d8c9d1612","webidls/enabled/CustomEvent.webidl":"b618f7e566aad4468e1813a8c15392d4e8d3cf98f83dba2314ff115c50a83627","webidls/enabled/DOMError.webidl":"cf1284821ac423e6e12a8364f3780070de8b90e5397001428c9ce0bcb04d92b0","webidls/enabled/DOMException.webidl":"ae3b2f004a3a4665217d00f0515c59580bbd1868b303980c69f2c2914cea6a17","webidls/enabled/DOMHighResTimeStamp.webidl":"a625f3d3afebacf6d9dde7bcc9900e31c22269b280069fb3369be50f651c02cc","webidls/enabled/DOMImplementation.webidl":"c9e3c075f4f675d77f02a1f2411f5e077f5ac73f9dd4054a2186e8c21783ede1","webidls/enabled/DOMMatrix.webidl":"7421fe74214ea03a8ba021838e93992c8f9eecdc3b21140ebe448746f2ce35af","webidls/enabled/DOMParser.webidl":"1466c13c06577c97f34d2742bbb3bbae3e08772133c89635347840f7f0dd7115","webidls/enabled/DOMPoint.webidl":"80425c8b3e478ee89d1cb424dc044bd8f0f50b8f4e25978f06c1a9afcc2836a7","webidls/enabled/DOMQuad.webidl":"a5f9c69d63c20bb4997ef0c3606d143bb99133b959ecabb06cd29bdfa73d33be","webidls/enabled/DOMRect.webidl":"9d53d4ea40b863cef890dff5a64d88a9d82476f513be2968b444abb026a0c12a","webidls/enabled/DOMRectList.webidl":"014d3aa34f758ec7f0fc9d22560c5b63a910d0d81e03562b7e42704d244cd02e","webidls/enabled/DOMRequest.webidl":"b540e91e8fd42e712178a5748c3e050a66e0b44e61e0a6c8819466fe557c0a80","webidls/enabled/DOMStringList.webidl":"1a8808f5ad7dfc317c8be2aee38f371a460c3df4438f5b43f1ffc7fd53569df4","webidls/enabled/DOMStringMap.webidl":"a7302611b98978fd5131e60fc6ef145dca824e0aedc9aee4ca7f919b2d3effe8","webidls/enabled/DOMTokenList.webidl":"ca5e72b3bf410709bc6aad5f37afb83ef589e142d2868b699a431125598b2591","webidls/enabled/DataTransfer.webidl":"489090d9843e2b13bb55a837155590a51077821fc4ab39a2b45a7cacefab0f3c","webidls/enabled/DataTransferItem.webidl":"46a91a059e83273dbd34f00786a1990d2abb5ff69853c068769e79abc13881ea","webidls/enabled/DataTransferItemList.webidl":"121799cb890f4446398d3ae1e932e5ae642c59c167b1905e05d33c2f36f7079d","webidls/enabled/DecoderDoctorNotification.webidl":"7433c819f26e6d87b60cbfe3e47b4a01d8459daf2ffad069c4d80942436bfe44","webidls/enabled/DedicatedWorkerGlobalScope.webidl":"529b8ec9aded8849361004a77ebe39421035c13bf3fc6ed22a24fcc9ea0da538","webidls/enabled/DelayNode.webidl":"8149532f064510f47f20103ce98aa71324dcf026aa784a180d773c73153a8d7a","webidls/enabled/DeviceLightEvent.webidl":"d37471f88312940800b65663daa968f11c6c3aab73fae19bd9c55f30ca160247","webidls/enabled/DeviceMotionEvent.webidl":"643de66eb3045c9af443bca568786643a83615ef084907932f5a76d998d95700","webidls/enabled/DeviceOrientationEvent.webidl":"2e88d1957715faf693515ec05cf91e9fb7c8b30efa6159931bc9113339688cb9","webidls/enabled/DeviceProximityEvent.webidl":"9dd73c557174f955fbe1aa07eca784900015fd06da463b027320f483a9ca5406","webidls/enabled/Directory.webidl":"b10754b626fb2e10d08b96faa5cc518fc857375b7ad6d46bbf621ca07c90a067","webidls/enabled/Document.webidl":"98efbd34e889cebd417232815b3972b0cd2fba0093201b70f3391b9c15aa5e57","webidls/enabled/DocumentFragment.webidl":"a414150e4f5b0b9d6dbdd785fc7c478c03b7e8695016854f81b96d2a66d22eaa","webidls/enabled/DocumentOrShadowRoot.webidl":"b185c3fdde1cbecbf02c5f35306eb8dd5401f02ecaa10db19031cd5202be9eab","webidls/enabled/DocumentTimeline.webidl":"d58a5f2db91c2254b52a5ac93209c255bf51d4902fc89b317f44b0c177ba8e0f","webidls/enabled/DocumentType.webidl":"02cd492b434c876d14176936af762de6e4b8597e899e11ca2781e911f739a478","webidls/enabled/DragEvent.webidl":"1f12cd956166fd17ac66b8a45797acb7eb65deac8294ed220c4c156eb680fc44","webidls/enabled/DynamicsCompressorNode.webidl":"6e7db468e68d848fb6a2b324aaa91d380d9527d2f16389f551fdbf5c014e463a","webidls/enabled/Element.webidl":"e6da98a38da81e9d8d710e4da216724b1f9ce6192a4f689caa3e52182f6c1f65","webidls/enabled/ErrorEvent.webidl":"54c7f54480c4b0b6d3e0ec8acb0706e3c39d2a8243450e9635465ca49f1d7dce","webidls/enabled/Event.webidl":"db7e44c631f87f4520ccde6627945725fc391403af7366ec4713ccc66edf7493","webidls/enabled/EventHandler.webidl":"76648d023242168a438b6e1be7251ce9aaf5a7ac97416748ca62d930de814365","webidls/enabled/EventListener.webidl":"d9984669abda9266281274e9fe084904c54b1d71c15033b36c69ff93b560da36","webidls/enabled/EventSource.webidl":"e277f35be84f3a0957c624ee422e43aec3b17a24644714e6de24be8c5bc4fa4c","webidls/enabled/EventTarget.webidl":"5d303c1b4ba45061f1de06558dcdb7c9b3cfc54c539e0853ff3038111009cfdd","webidls/enabled/ExtendableEvent.webidl":"15354aa78f8b996853c21815e48ddb39de5bccd19e11ee234af9f85f182d2b3e","webidls/enabled/ExtendableMessageEvent.webidl":"4b156c28fe958a210b4c36c70b10608038dc01d6e4e2b8538fdd838b49204fe0","webidls/enabled/External.webidl":"6274b07951a3ee892b51266e89ce1673a8587b7b28ed592d2100c78f2edb41e7","webidls/enabled/FakePluginTagInit.webidl":"650764c6f953960228adb980789bea1b27063e8425f166ed95be6f3e2a6cd555","webidls/enabled/Fetch.webidl":"479ee79d19b374436c7e64a18392ea4674ce6bf9c0f70fa04c33686cbf4221d8","webidls/enabled/FetchEvent.webidl":"44cb01a7e650948abcb9ad4dab22aa2fc47aa94884cf1ef5dff95fe90bb99804","webidls/enabled/FetchObserver.webidl":"98e0498ec43f79811b50e5d999046fb1d7ac8ba7b2e3d9d428ad45b8670b0d28","webidls/enabled/File.webidl":"9f4d4364b8e1b5dd818f057859e2a78e4ddd37cfac5c4037bb36561372da01db","webidls/enabled/FileList.webidl":"25ea98ff242e523322790af498b0eb4244d6a043ad40e7021e84b9bcc071f713","webidls/enabled/FileReader.webidl":"dae5c206d56950ba85c7a88eb865320875b119607880f46c076cffd4f5055097","webidls/enabled/FileReaderSync.webidl":"b2e20aad23a052460eb9477134fc470cd584302fd008be9e63e8199e845fbba7","webidls/enabled/FileSystem.webidl":"6c35399931e6ee50ce7eb04cd45ca2b573c4fa55252bed3864117b1d887bef24","webidls/enabled/FileSystemAccess.webidl":"7c9e67bd264607fd9fba703681094e5d40b099d82a929ac1f95cc6d70e7be398","webidls/enabled/FileSystemDirectoryEntry.webidl":"67b81667e6fd85b7f2a4663676f5d06c5dbcfc5abcad0210ada7d23ecf10535f","webidls/enabled/FileSystemDirectoryReader.webidl":"f578c5b8d435d84e0dfe0a4cf7d2fa47ea449238b2f08c6f9fb5a615935b4394","webidls/enabled/FileSystemEntry.webidl":"deb905ac99bd1c411cc7b847361f8f541e6c84b52f6778e60dcac0a971f64f0e","webidls/enabled/FileSystemFileEntry.webidl":"72e5b5024aed480345b8a5a44d7a9491722661f7d613255c7b132ca8121c47ee","webidls/enabled/FocusEvent.webidl":"785632d65c2c65a83531f275a13f78a3313ed5143e1b27d894b7c7cb92f0034b","webidls/enabled/FontFace.webidl":"373443d52e08d3e9846b3d32f235c3d4906e6a629dd2b555f1736849d744dab4","webidls/enabled/FontFaceSet.webidl":"60792d6d3a03a87ec7c23828fa89285e183bd1f4c077389b8bcdb9bb84dde47a","webidls/enabled/FontFaceSetLoadEvent.webidl":"77c31560bef55a814579eac3a92adb39bd9f3a1c9994b35c95923b30dfb2e772","webidls/enabled/FontFaceSource.webidl":"4bd55612ff913320383541643cecfcd26049a84ec0d0a138273c2ae83090e145","webidls/enabled/FormData.webidl":"06714409d1c538dd1e4d36a6d37a1b2423a7bf845078930c79da6507f7e7904a","webidls/enabled/Function.webidl":"23529f87dc7d752ef38e07eaa16743e22050c9860a27dfbe8527b26391e79e16","webidls/enabled/FuzzingFunctions.webidl":"0220b76387612398fd28a0a168c375735b786276971efd7f5249920bcede6e66","webidls/enabled/GainNode.webidl":"bd7b7367d39fdf384204790ba3bd3bb711e00b50be70fa24ac550ac973e37152","webidls/enabled/Gamepad.webidl":"97974dccdfb8842adcbe266f15a777631e2210708edf2f52c7ead60aacf9b548","webidls/enabled/GamepadAxisMoveEvent.webidl":"ea86a6aba28574d9c92c2a5fab7a353c52990819a3c879c2a46d2b0852358a3d","webidls/enabled/GamepadButtonEvent.webidl":"4fc269cc3740e74cf0768e1de19b8b706b110769d3dc67a221bdfc178535ebe8","webidls/enabled/GamepadEvent.webidl":"f696441506b360ffc8daffb102f4ed6f70d8bdabbf34f81639e0008c16b96d50","webidls/enabled/GamepadHapticActuator.webidl":"7c76aa852470fa4e0be4a296b0f40ae30625aebf563ced44c97b47c50f6f84b2","webidls/enabled/GamepadPose.webidl":"e287374f54910af89a3adea7b03e40e2d47543226c4acf87df4432a120648c70","webidls/enabled/GamepadServiceTest.webidl":"f86a0e6bcd1c6da5fc224c2563ba191d7ce295b5c48b5b6591a032770189908b","webidls/enabled/Geolocation.webidl":"4fba86d71ebd9e6e822950ea951112408c3aaa4ad11d23116e1eceadb9d31e55","webidls/enabled/GeometryUtils.webidl":"8b3fb64f1fe7bf50a85c580fc1265b4234c4418bc2021cf69eb3c9b3baa700ff","webidls/enabled/GetUserMediaRequest.webidl":"eaa284f01a9ff6104ac39c5c81773d2185e3b580fa106ce7011ca8285aa7c46d","webidls/enabled/GroupedHistoryEvent.webidl":"03a70bbdd88f23166189b94332d5af19c3ffe92a64806d7dc7e561ce0a68eea4","webidls/enabled/HTMLAllCollection.webidl":"911e1f71ef504f2ac767746f6824dcb2657a7812031d6c96d654039211fd821d","webidls/enabled/HTMLAnchorElement.webidl":"b47247a861732603ba42d30f23cebf6b9e4c181be00147188df1cd1d09e8c59e","webidls/enabled/HTMLAreaElement.webidl":"532631e8f1560c34603a324800d406dc3142f264b04fd8d603fca0ba3ef07bc3","webidls/enabled/HTMLAudioElement.webidl":"d345663eab59d6f1b4cd89c06815a759ee7dd56ba599b5acf8691b71412b09b0","webidls/enabled/HTMLBRElement.webidl":"0d51f01d47710a439ea5a6990b8ac957a911cfaeda13418bf833c8f3a2950419","webidls/enabled/HTMLBaseElement.webidl":"dac35d6efe54834ec0f603966f32884edfa8e19e84147a0beb9e529e9c5cb962","webidls/enabled/HTMLBodyElement.webidl":"91040e98085638f1d3b008af5095e9aa1cfec26a198d277c9cc45a51db3de22b","webidls/enabled/HTMLButtonElement.webidl":"675fda12c739ef8bb73509ad4d2eea45ddce77ea56b2c307596f4436de5822b3","webidls/enabled/HTMLCanvasElement.webidl":"bef57305b8e3097b33ff4e99331d3dafd959120e3a96f72f1dc9aed36657a056","webidls/enabled/HTMLCollection.webidl":"9de949e45fa8ed104d65cde5f6fd3d14fbce486f6929d250ad0df4f7b90761e8","webidls/enabled/HTMLDListElement.webidl":"b1d9a3246ae855bc27c772d8bdb78b6eb29d53ea578bce227ef07759d03ba01f","webidls/enabled/HTMLDataElement.webidl":"0a634c145a85789033a38a8a8bbbd2a739d7beb177965d65aaa457cfa2170e39","webidls/enabled/HTMLDataListElement.webidl":"6dbd134a023f91992c8b5c3b0010e96b5ec832bdc9815e9f7a815319fb4d1338","webidls/enabled/HTMLDetailsElement.webidl":"a7594e9a10a37c9428b5c9b12868cc44c1608cdba609c69ae9bfc6a6aba6befb","webidls/enabled/HTMLDialogElement.webidl":"3c79889eca00e5b0ee13847a45021c002e70b03fb6263953cec90ef79736d462","webidls/enabled/HTMLDirectoryElement.webidl":"514908cd8fe9f661ac53aad204f35709601a3a07d39123b7f59e18bc22426029","webidls/enabled/HTMLDivElement.webidl":"52950712bff7f588c8068ae22cb6361a7d7dd12293e930aaebf2de82ebcf48c5","webidls/enabled/HTMLDocument.webidl":"d6837c86a9b26838cbc677377dd251b89464fb7e38e45fc418196446e2acabfc","webidls/enabled/HTMLElement.webidl":"710a0cd73e15837bb6cff7e94e16ecb2f64ff6f9b37618ba85be9f2e2809f39e","webidls/enabled/HTMLEmbedElement.webidl":"f3e0f590bb3aa783a654e6c330ff0aefbf58c4f0282e9b292b3952850a3886bb","webidls/enabled/HTMLFieldSetElement.webidl":"28b971856338d6481da21f39e0610cb12a9f84f6efa48a8523000ee7315eb53a","webidls/enabled/HTMLFontElement.webidl":"53245e2002f2be50a73d4ed57b6990f71c83aa9602e7427d39735b161df9edb9","webidls/enabled/HTMLFormControlsCollection.webidl":"888734b0d8fcd38406791ba9f8e64358f36ee7953b3291fcf0ec98de70d25fc3","webidls/enabled/HTMLFormElement.webidl":"145820e3b487c303d9d0a3866457c130bda1995d0376fbdf63463e8ea3e89aac","webidls/enabled/HTMLFrameElement.webidl":"27ca6eb4eb8c1d8c970a704b3a5b9d833f5a9306ab38b3b3d0f260a5910880fe","webidls/enabled/HTMLFrameSetElement.webidl":"930323ebfd8d5a1cc5d51e44c7430f130f3cd22dabe06d48b0c98bdd0ac86dbb","webidls/enabled/HTMLHRElement.webidl":"ae5c90df7ced4b6b53d3894f6311d2ddfc319bb82cdbb02d31a46cbdf3b73ac7","webidls/enabled/HTMLHeadElement.webidl":"988d03275a9869bf7e8fa43ca19af6633e8620b6fdc953686eca4aa75c641158","webidls/enabled/HTMLHeadingElement.webidl":"5eaf33184107dadcf275e475ad4514e0d8a284b883c5d041400126cfdb612bd3","webidls/enabled/HTMLHtmlElement.webidl":"20e7b4c634ab5707801b1409d09e40a73d060b0037ab5ebf82f8222c98d1d942","webidls/enabled/HTMLHyperlinkElementUtils.webidl":"a692047eae18831f97049dc6675df4f1a5c5f8074c7f65b305958ff00a342f11","webidls/enabled/HTMLIFrameElement.webidl":"bfb7f7293e7a8490321e0bb72e41fab95bf72cc57172b49363ae0c6245f1716d","webidls/enabled/HTMLImageElement.webidl":"be5a75246e845e68638dbf644c980ff5fcc1f7575f2facc468fc1d18e69126ce","webidls/enabled/HTMLInputElement.webidl":"fd486ccef7a24412117918eb28a0363bab719f3c5b60eff9a1285323d9ec7ff7","webidls/enabled/HTMLLIElement.webidl":"a69f089ccf8d4c9b7404bbac1716d7d6c9c52a44e8cee19fc524797fc8c6c225","webidls/enabled/HTMLLabelElement.webidl":"20b224fabbecb8f7e8baca8b02d07e2a5d40b9d9ed23b033eb4f970deecf0d0d","webidls/enabled/HTMLLegendElement.webidl":"5cfd37822114dc8632b6fbd945b22e05f0917390d0dedb9c4f25ac9f6accf459","webidls/enabled/HTMLLinkElement.webidl":"bf1ae8f6e0ae80150c086a4f8bd21527fe5c7612dd156a5287f7ff7c473e20c4","webidls/enabled/HTMLMapElement.webidl":"fc6bdad42f4227b6568d616bd989ce6ace9218052f08e96fd5e8e10d907a2cf0","webidls/enabled/HTMLMediaElement.webidl":"25e8614ad3813f8ce44c9803dbdd8685f16578bd4ee9fdfe941968cb3caa2c04","webidls/enabled/HTMLMenuElement.webidl":"24ad0a1cc3faf2854cda53d969743d946afc1074e80d79749b8fd75e373eeb81","webidls/enabled/HTMLMenuItemElement.webidl":"ba371fb53c2bfe0a81db517f13ca90a115db853e2688c9550f4126ee1b1b1eb2","webidls/enabled/HTMLMetaElement.webidl":"5e552df9ff76ad54f7984608dc7967a3a138c7c0d84ebdd8157a7ed6713b3023","webidls/enabled/HTMLMeterElement.webidl":"21a8832878f43f57b716d5fe0e99a617492602b971f7fdc23ac42f597968f0ba","webidls/enabled/HTMLModElement.webidl":"63beaf5e6d77e63739acbd6b58147af7d84e665f4a5853445ae160de4cf21b30","webidls/enabled/HTMLOListElement.webidl":"07bb6b740fa7f619f621e8693e07932c6bb67747e2a5556685dcf3ccbafe7a04","webidls/enabled/HTMLObjectElement.webidl":"4c4edfbcbb867e4e6a5945f213c5a246e1ac28fec4f61a59f40025aeaf0570d2","webidls/enabled/HTMLOptGroupElement.webidl":"bd91a7cf0eaa65f217e7cf47e54d11a4315245209a52ba846d770392921ed15b","webidls/enabled/HTMLOptionElement.webidl":"0d6dcc38b9a6c799aaf5937725c3ace50a6629e05fc4621d8caa901a4e7536d8","webidls/enabled/HTMLOptionsCollection.webidl":"902bdf9c4e15f30c3be3745842fdfe4e4e0739b7650eb7ee2c6781200825ceac","webidls/enabled/HTMLOutputElement.webidl":"863c2a5fae4e3ddeffd325ab6e49a11479a89264aeaf9b945f72595e611304e4","webidls/enabled/HTMLParagraphElement.webidl":"259b49192386f7448a548ef630403d576e0489d43da92b1fce891856da83258c","webidls/enabled/HTMLParamElement.webidl":"cb4f844f9698cfff48b02cdd7fe2c2820dc7c0f5b5e6ec24c27cddad25810e63","webidls/enabled/HTMLPictureElement.webidl":"b0bcc2f70ac7ea0835669bfc7f51676518f1cbb68f388f3ea8ec4e4f51df4974","webidls/enabled/HTMLPreElement.webidl":"1e6619dd4b9a111e9c9021e5b25be43cda52ca97e2d07e3c4f695cdd557f4f02","webidls/enabled/HTMLProgressElement.webidl":"3dc186323a3ab7837afd1feb9b1a0bf647677dea57d0af691381ee5e706f6cd7","webidls/enabled/HTMLQuoteElement.webidl":"6e2da7bdc4cccdfe1e9a4a0eac8eec04366bf950edc279c1f0adaf15b85b5637","webidls/enabled/HTMLScriptElement.webidl":"2ccb5d8577c1f59af4162b00289c4bc492faa97ed24bf1156c69a39a2ebd4a0d","webidls/enabled/HTMLSelectElement.webidl":"88b81485179669a3cab43e1b70b695d7428a219b8d896c3915ee79d1871af482","webidls/enabled/HTMLSlotElement.webidl":"0596089d5a147ac30025ec605b3a3153cd23d6ce3f5bc44747a4d2841119ec96","webidls/enabled/HTMLSourceElement.webidl":"94aa3d4813b51191598cb03db140823663cff47ae30ff42a266fdf7451788233","webidls/enabled/HTMLSpanElement.webidl":"6423fbaca98b5ce2ab38321ca5f1f172839ee46b9b2ae0674c4b6a27ead11d19","webidls/enabled/HTMLStyleElement.webidl":"fbacc26b670030072a883935f76e3100babc35d6f941fa1f8c7f5818f33e0127","webidls/enabled/HTMLTableCaptionElement.webidl":"958c408d02849c9cd19f31a9c5e072f5d3430b966bc271d80162292b3651608a","webidls/enabled/HTMLTableCellElement.webidl":"c84cf7b3a19d63fa1bdece8b8bdee3ed9c406466612170bcff633a769c7db83e","webidls/enabled/HTMLTableColElement.webidl":"ed7925a256b258e1c12cc23906513a8873f0a250964285f46ce7f7562273263f","webidls/enabled/HTMLTableElement.webidl":"5cccd80201ee85f478c7e13a81d6dbb0540999bca34babed4c624348394e2699","webidls/enabled/HTMLTableRowElement.webidl":"fc316de4f53eee5972d4be2833ebd846e02468e93488ed8256b8d25514ed0b0c","webidls/enabled/HTMLTableSectionElement.webidl":"96a78ae9c92e7a846bcf3617be572cf653fbe27b26b91c5072ce37839cdcf346","webidls/enabled/HTMLTemplateElement.webidl":"856f72fe1152031a0723dcc0db42981fd178535110e5b3464fe6c6961abac80a","webidls/enabled/HTMLTextAreaElement.webidl":"f118ab143c85a0b537da93247741133e24e1e779a47742088cc9bc2704886696","webidls/enabled/HTMLTimeElement.webidl":"e3600955169b12d39e2c28350596c6dad1cfcad1e6c7aab7a796443851135f9a","webidls/enabled/HTMLTitleElement.webidl":"2a19cb43661fc288db244f76239a0615e8708442f14f19564d885f2171b39e2d","webidls/enabled/HTMLTrackElement.webidl":"aae1b41c17c99812bee6dd027c1cdaa7c9837c25bf6aa7f6feec249132c097a1","webidls/enabled/HTMLUListElement.webidl":"386d32f21bad1d28bc7dfe52eb3c145e0d1af972e0e15ff1f045898b323a3835","webidls/enabled/HTMLVideoElement.webidl":"74752f0439de22022f063ebe1af45e87873745e879d8a66d11731444c81f9580","webidls/enabled/HashChangeEvent.webidl":"763423e003a16e9dc5b533fbee8feeab272fc6bf26b5919317d4af84d7b01d32","webidls/enabled/Headers.webidl":"e926b6f5b1c4ca759e273a453c8e3febcf197c59c3df58cfcf75cc15da0a4bdf","webidls/enabled/HiddenPluginEvent.webidl":"3e0963c7234e801be89c767237b587d2de0411347c9ac3a12aa83614b2436108","webidls/enabled/History.webidl":"bf089265b512c70b13469a1f15dfb2c133379d54a2e400d3a1b2f60efc6a7097","webidls/enabled/IDBCursor.webidl":"797746aa8d9542c27e2d313174b274c9ca787c888ab17c048197b01f6b84253e","webidls/enabled/IDBDatabase.webidl":"521f6c68b694121e453a90bc08dd212a0cb95f490004d0b37bd16d239973fecf","webidls/enabled/IDBFactory.webidl":"8c628520e744ff5cbd44c7c45fb90ba98ee594b91c255cc6a7e2489fc1f926a1","webidls/enabled/IDBFileHandle.webidl":"24e4bf8211ee3bc93a215f9d21e052130e071d7b88494581f43c923667e801a6","webidls/enabled/IDBFileRequest.webidl":"54471acf4c7d569403f33405c051124ecd5eb5ae9eb42965ec9159a7ed0db4fc","webidls/enabled/IDBIndex.webidl":"683a510a5cbf727bdea21e9f746a59516e84de5538935fa3f1d586ef5faea0c9","webidls/enabled/IDBKeyRange.webidl":"a1474209ad1065b4ce1ab022e3ed56ed8eaf8a1f6057e3430006a6a1d4b87952","webidls/enabled/IDBMutableFile.webidl":"3812e0bb9f9eefd5647a03b5b51c3ae1a790f5214ae020abc297759158323aac","webidls/enabled/IDBObjectStore.webidl":"57ffa10162099e2bb89b4c6423920cafeb52f880cfd66299b80b57b1d198e8bb","webidls/enabled/IDBOpenDBRequest.webidl":"9eea9088bb7f8c2e85309ab3a3b1e7f4402b14366b1c0cc3aab9a2d8c3f316db","webidls/enabled/IDBRequest.webidl":"7eb90bf020acaad57471e3094d2701bd3c517497414487bf40321682c720be72","webidls/enabled/IDBTransaction.webidl":"dfe01201f94c6cea896436f2f3336c4ce35d9b0f81b7cf442687d5d1e579e778","webidls/enabled/IDBVersionChangeEvent.webidl":"7dda382eca992d9f79e7407595fc4e883f27a7d1635ba101ea7851bba8d66b1c","webidls/enabled/IIRFilterNode.webidl":"80a0fdeea73945603c5cd6d1f85d3c9596b4e8be23d72db79234a441c537b4b4","webidls/enabled/IdleDeadline.webidl":"fc18e1e454adc488d4fbcf6ab6716c872001402d87839902801120a248ca5949","webidls/enabled/ImageBitmap.webidl":"08a2bb2c5688920a1fd7163b62475cbbc119b1d9669202aac54b0d147e0de90f","webidls/enabled/ImageBitmapRenderingContext.webidl":"18b6058348161d5c8dd0e3304f3f0870ee8b2892e6935cc1d2306f367fe5e287","webidls/enabled/ImageCaptureErrorEvent.webidl":"d6573af4e4dfb5e46fb00d7c1ab8e9309a0e589a4afccce76cedec5953831278","webidls/enabled/ImageData.webidl":"f9af056bde477d5e0f33b4a15de4a90e5c14a3b47a77d084ef1c992482f8d87f","webidls/enabled/ImageDocument.webidl":"02d381ad74b8b79371c50799b0c08995b35f77e9fdad674202902a9bd2227879","webidls/enabled/InputEvent.webidl":"2e7cd9ef0fba43a89ed17fed1c0826b43a779f4413a1d3bae8b56583a0449cf3","webidls/enabled/IntersectionObserver.webidl":"df9812da4b5360065bd25d0596c8a4accec582863497d90803aca1dced443b4e","webidls/enabled/IntlUtils.webidl":"57f74df6b5666e29cb8c065bca9a4ba1bce721d5b8ffe551d7bb1d02f0f892ed","webidls/enabled/IterableIterator.webidl":"baccf4e84a6b0db6939d0513bda2ee3d5c9368b5c3c81abbf2eac36232ee8891","webidls/enabled/KeyAlgorithm.webidl":"0e04cffe31f96f7e2807bb2dfa1e6bf02462815d693c8a3aeae949ed9e21a7d4","webidls/enabled/KeyEvent.webidl":"696a44a23b0e626f8a0f1501463249ff63f920bb2f565548258c3fcf9d1b9067","webidls/enabled/KeyIdsInitData.webidl":"74b45f0eb628afb2b9c6f8cae2b183199dafdccf9b87744dc1b1bbbf9114f6aa","webidls/enabled/KeyboardEvent.webidl":"634a8d06d479ea1ce5fbce9a5591876aed8ecb315849735d7e0305fddfabdc26","webidls/enabled/KeyframeAnimationOptions.webidl":"68d0e95aab8b82f4b2bbc78211d7625b836d412f9cffa1f19c0b89b7cd14e589","webidls/enabled/KeyframeEffect.webidl":"c6c6fff71d4a344b4a035c980f66e91339fd721723037b5205a50684aaee8a2e","webidls/enabled/L10nUtils.webidl":"85fe322b17bb6a46d2dd889a631b8bc82799beafe283611f28ac0a8355fdd2b8","webidls/enabled/LinkStyle.webidl":"28e1365b101a6d7b254f4f12e8a355df5fc7aff6bbedf0c4d9e87565425989a1","webidls/enabled/ListBoxObject.webidl":"fe5e39d16b8e781b53d8eeaf5fc5f59511a137180fe574d4441cb2524361769f","webidls/enabled/LocalMediaStream.webidl":"006e7d70d312b75c33c75fc90a342811c9ca4d745232814a24d61d304a8b2e7b","webidls/enabled/Location.webidl":"b5a280c463d23a070071b3063df584145b507e513f1b0d2974915cbac0abdecd","webidls/enabled/MIDIAccess.webidl":"58f6e706e668360ff02f794fffc8f81dea879f68f59ae9d2d13f18d3c5916f80","webidls/enabled/MIDIConnectionEvent.webidl":"8775a52412a3904f46deb8635f14e18701c36fdf9084f906f573d22a7de3486d","webidls/enabled/MIDIInput.webidl":"11a4eeccc4ab74501291d25d7d5068dcb689721f93ebefe40653d3a95fa6a75a","webidls/enabled/MIDIInputMap.webidl":"6a356c20cc9bcbf679ea7e8d2deab519fce8e6b7390f309da7bf425b18670231","webidls/enabled/MIDIMessageEvent.webidl":"fe15f6b56f1a102f04e13f2ea544f5d37a805f8e01b305d1caee76ed40fc8c0f","webidls/enabled/MIDIOptions.webidl":"3ef87d615386ba5cb1ce19b13fc430488476246a8970bc0218795139ef3b039c","webidls/enabled/MIDIOutput.webidl":"7a883cc5a3438a73aa524682fdc1a2aeb122ac57bd6df775cf4264851cbcf208","webidls/enabled/MIDIOutputMap.webidl":"f68fa016132b90ad2a18bc4fc024a24568b7ed85379238698eae3d38aac01b3a","webidls/enabled/MIDIPort.webidl":"3fdda9ee45900012dcb6886cf5ca7465be826dba05305d4a9d2ba254e610e76b","webidls/enabled/MediaCapabilities.webidl":"26019e7e198c2b17df984c4df5e78836ddd56c9e1eafd7e09f7f52e6db478d32","webidls/enabled/MediaDeviceInfo.webidl":"39e9ae3834c61db85ae2f3ba034a7a69e721dbef396823615cdf79f410cbef9f","webidls/enabled/MediaDevices.webidl":"2b9b65d1186f18077012f66eafc79d4e9d6c1a478213d0a3053720b377ec07a0","webidls/enabled/MediaElementAudioSourceNode.webidl":"8d1e8f589128a98d46ead4393ec012a44c1b8848f72ede824afca1320040d825","webidls/enabled/MediaEncryptedEvent.webidl":"0370afe3a99060853cf2d3850afb494f7f0414eff53788c1b6e92c0b60338b6c","webidls/enabled/MediaError.webidl":"f7040be08c475be0176a8eff443f1cde81d26a9b76ed71b7a8485e7e2d424448","webidls/enabled/MediaKeyError.webidl":"2ee05d150360dc18e1da2a8143a7a883a73292c7498c18496703a522b7310d96","webidls/enabled/MediaKeyMessageEvent.webidl":"2663944d4bca18a5a26f5d1ed63ae22b6180eb042344b86441f319bf8f02ace2","webidls/enabled/MediaKeySession.webidl":"82e5bae1694bd530c3228da3e742c88b7c1d40eb2a77edf2d19ade6a388c5628","webidls/enabled/MediaKeyStatusMap.webidl":"4f8ee56ebb7e6bb9ecce7755d2972b2c4cd58d448f9201b92420e3ce3ba7036d","webidls/enabled/MediaKeySystemAccess.webidl":"001bc4ad92c0bf64434d7bca21a51de2eaee9d64c412fc7c9300d5d22ac6de14","webidls/enabled/MediaKeys.webidl":"eba4547a687f049131921d5d6eb950395817184de2ebf8f443ed49c3476daae9","webidls/enabled/MediaKeysRequestStatus.webidl":"ea6e75921cfe8326e7363314e8f26d54af9a0e95979187e91fb946d0be063bf9","webidls/enabled/MediaList.webidl":"cafc6b4bd71eedaad33fa5fae41e53edecd182a716d6f63db591e7f362e42a26","webidls/enabled/MediaQueryList.webidl":"66a1aaf73a788ecaff60fe1782aab47e5e4de12e6e2eceaa306506c39d5ddfa9","webidls/enabled/MediaQueryListEvent.webidl":"a7b021abf05e8d95222c0125331af9a78eee1f4a93d68bd81f9157925a29725d","webidls/enabled/MediaRecorder.webidl":"025f38f44f27c1502a4aaa293700232c68c6c55df21347c1decb74e2bc595209","webidls/enabled/MediaRecorderErrorEvent.webidl":"8b92015f20fb6f7713a86b78775a1c1409b836101c9528ad30f58ffe9d441039","webidls/enabled/MediaSource.webidl":"b6b117032cf7c474062d2980cf71fa1820aaab3a9dd474fa2b326f69669a1fd8","webidls/enabled/MediaStream.webidl":"ee8f14692caeb5ecd685f9271161d556c494aa6f20b3abeeaec03a863fad2b1f","webidls/enabled/MediaStreamAudioDestinationNode.webidl":"97ac421a9aa230abdde89655bb11a3191b5868aa91c7f1ddb543106923ec7f65","webidls/enabled/MediaStreamAudioSourceNode.webidl":"08ffe8661570e05d5f14a1a98f667c75490b71a30e9aa41f0c2fb6d1747d140e","webidls/enabled/MediaStreamError.webidl":"8d5b8ca56dc1a2de36920227cc760eaba720cfc475c8b2a54477002eaf5bc1b1","webidls/enabled/MediaStreamEvent.webidl":"c88d8691cb94213bd1f7e37c1133a3665d6068991ccd6415fee41cbe6ac2d8e6","webidls/enabled/MediaStreamTrack.webidl":"15ce546469c519d9dce742700cb6df39e8bb858891ac11d664e3e2a82f20b8a4","webidls/enabled/MediaStreamTrackEvent.webidl":"6f33b799bb7e2fb3488614e3c90ff880c3b826be1a218fdf138b7ed6b99c98ce","webidls/enabled/MediaTrackConstraintSet.webidl":"da63d3cdc6f7933857d9bba7e264479f290ba03f998582812e402aab27878bc9","webidls/enabled/MediaTrackSettings.webidl":"988264c143728a0bca54193a7f22f93226d29b00e8a72c8a32fc56900cf019fe","webidls/enabled/MediaTrackSupportedConstraints.webidl":"b2824bee249132b4d2c2a4712427e7c2ef9ecbd453a8cd8cd14d304f10c07971","webidls/enabled/MessageChannel.webidl":"6efa741daefc8bcf42fae3421300772320b3ca6703a173e0d336f99e260bf890","webidls/enabled/MessageEvent.webidl":"f45e89ee3fea8c987f75e4dc049c796c67d59640e176def5510fcf3c32152899","webidls/enabled/MessagePort.webidl":"b9c1245a59ff0185dff678889fff61f67a2ece6d81ec4269655f07a8165249ff","webidls/enabled/MimeType.webidl":"757626dfb9f020b59cd3f739ab46022cf281e4beaf4c039aa515b167ee70e246","webidls/enabled/MimeTypeArray.webidl":"4c6ae0d0c6a967662f8cff4bfb33f26f7479a603aa8540b74fecb2064277699b","webidls/enabled/MouseEvent.webidl":"3d3da4ef7163b5996dbe24f2cff42581de65826ddb5c2452e79d35833c7ce3b9","webidls/enabled/MouseScrollEvent.webidl":"958dfac037298b7b32367655db780311b8afe881adc58fb3176c678209625f07","webidls/enabled/MozApplicationEvent.webidl":"75512e059392c8508d4bc1482b8fb64ada87b98c0a49facb03e989da0516ed6b","webidls/enabled/MutationEvent.webidl":"669e0af319257c6e364bdcd79447313fb240e5266a321bbe08f87163cc872ad4","webidls/enabled/MutationObserver.webidl":"8acdb27ba6f9201f2589626a402ed4f92eaf6d361e325100865bc791254bdb46","webidls/enabled/NamedNodeMap.webidl":"149542c31147345d43d93d670b0e856a1dde4d5c534cfa52d8aa584ee2153af3","webidls/enabled/NativeOSFileInternals.webidl":"b518244fb86ba62334e13f42a561a3a48e520321c196a48c024359c6eda3ce6e","webidls/enabled/Navigator.webidl":"c014640de9c0d208a554de73ca45f11974f0c58739d0021e8890d5b9237da217","webidls/enabled/NetDashboard.webidl":"99f5150c764f90494142efcfd8a2cb824b44f1190189f9aaf30af93cd85ccaaf","webidls/enabled/NetworkInformation.webidl":"de0820f9049746b459e5dd2a4dd9e40404c8857cf31c12e29fdfbac1fdabcb62","webidls/enabled/NetworkOptions.webidl":"8782c373d76d76f336decce7274f43ca99a896d961722026898eeb60bcb473a7","webidls/enabled/Node.webidl":"713e28cceccd791e997db68b5b0d84aa46285e6de42126b9f0ae8e4781ea8ec1","webidls/enabled/NodeFilter.webidl":"527355d4a296696054715a80a30231ea74cb5927b5e940ab769bc3bc31aa0d5d","webidls/enabled/NodeIterator.webidl":"99b822656a67ec184e1bfd09cb7cb4e2f684a7f2d8d197047501a45cd25b9150","webidls/enabled/NodeList.webidl":"4c7d5d3149f3e79087e89108430acd4e9deebe531a946e23f91f3fee9a20b712","webidls/enabled/Notification.webidl":"ce94275e7d2f371f4c2417df9254c6d68e939c5baf6694ce238cf52b2a62baac","webidls/enabled/NotificationEvent.webidl":"abe1d7da9d0dd1a25f4b2940d5b0319f4ab130a9f856738de7b97864bdc2828c","webidls/enabled/NotifyPaintEvent.webidl":"7e58bbd1dcdd2e3cfa25ab411495045872fc4e9bdd126764fe2f5ecab7996fda","webidls/enabled/OVRMultiview2.webidl":"c81aa84d3e1f358eced8df948fa45f87dfbf7d71e5ab502bbb99737965fd619f","webidls/enabled/OfflineAudioCompletionEvent.webidl":"87284c182880aa88a9dfa49cb8375594bec1f9af6475d20c4d54322bf3f49650","webidls/enabled/OfflineAudioContext.webidl":"3cd688ad772feeedab5f1f8f1970b94fc214824329345715667591d16b80af09","webidls/enabled/OfflineResourceList.webidl":"0be922a661387bc2dc8798511493d448dbed92fced1026a341d445fef9c6d292","webidls/enabled/OffscreenCanvas.webidl":"1561eca7f81c43a0dd1c1ee4d40a06db67c0e2e1cfd68266f91a160df0a3198e","webidls/enabled/OffscreenCanvasRenderingContext2D.webidl":"f1687bbcf1dd5ef5ec8acfd7ab63f57221d5501ab5cc1de0e57a937c5822bdfe","webidls/enabled/OscillatorNode.webidl":"da2d3207a42adffaba99f452bd26dd70a9d33330c3387a3211bb2394b0d9d734","webidls/enabled/PageTransitionEvent.webidl":"56539720e7a07f1b7b57ef204b5a1f2d4c288f68728e0180d298a7a40f3b2ebb","webidls/enabled/PaintRequest.webidl":"e8c046b22f6b46d6d15e206f23f33564cda53364b22eb4828785065d7772d995","webidls/enabled/PaintRequestList.webidl":"840ea6f7382f1d295bb60fb399dedadd25a3bea4997f82b889d5507e04e408e9","webidls/enabled/PaintWorkletGlobalScope.webidl":"0dd8d9cca67b0614191ff51e2ea2ad3d6931fcebc373cee232a7f1eecfab6622","webidls/enabled/PannerNode.webidl":"89878fe816b8cb7d87c7827d80bd6793a45027f12a18f30cee332d76a0ea25f2","webidls/enabled/ParentNode.webidl":"c6bbe5d5a548b9f1a59f252c28f8ae216b80697c12ff9c7953ad2366a5910904","webidls/enabled/PaymentAddress.webidl":"c71b7efeb0d3d1b8fd6f01eee3af89f5cd8b42660d25d889dedf0615f528faa5","webidls/enabled/PaymentMethodChangeEvent.webidl":"f037593088cec9010aa383133613aebb8f14fbc5c9973f21773625353fafb389","webidls/enabled/PaymentRequestUpdateEvent.webidl":"fa0c3008240926490e742a9a3595df6ffa989717066f2388d0bb5c9b14d45211","webidls/enabled/PaymentResponse.webidl":"0f7565bd2b5c2a28ee1508062ea4dfa56df719e72eb4b0b5c8ed20b0c658bbd3","webidls/enabled/PeerConnectionImplEnums.webidl":"c9f54424a844df7a01eaac3ba3a96e5e31e2530eb99cca84f48a3d9d875f4d52","webidls/enabled/PeerConnectionObserverEnums.webidl":"67e698124e7cd1f758c1d8ce2d5ef5f2a3cb818af4d08ee54dcdbc10cd890783","webidls/enabled/Performance.webidl":"7dde1a5f0a7d197e4477232b50a69f196d74ebba8699b5e424cecefb7ca0d557","webidls/enabled/PerformanceEntry.webidl":"d4287b10c20bd543e607fb717e09fd2f9fa510fa8d425187b78a5ec464649993","webidls/enabled/PerformanceEntryEvent.webidl":"36855fbb87f6ee4ab9bc99ece991c81ce1c0aa537eb9987f7fd4a5ce83be498c","webidls/enabled/PerformanceMark.webidl":"83d630e8efeb08b521194c98404029b4f495141a038269ee188094400adc8173","webidls/enabled/PerformanceMeasure.webidl":"74f29148a94dcd4881669a64857d13caf5a8aa295e8a0ae9a749be79e761fa67","webidls/enabled/PerformanceNavigation.webidl":"e2f8f4f77a5926932c56a9a9deb5c12c4991245c81f1a3f09d4ae494ca414bae","webidls/enabled/PerformanceNavigationTiming.webidl":"9995bfabffc7d7d23114ae7c5d4eee93048164da9b1e74851b518b069fd7eb29","webidls/enabled/PerformanceObserver.webidl":"bb1f4e05f7751ef85adc4b9159ba1c99610b90007ffbd627acc6ac1a7bdc017b","webidls/enabled/PerformanceObserverEntryList.webidl":"5917ca5fd5199ac3b527fbcf3d19f0885b9670d40bdb996df63c34537503c435","webidls/enabled/PerformanceResourceTiming.webidl":"8a0f4e08bf0288dcacf29b3e8270b8828a26b0a3cdcd3259c95e35276f6a82f8","webidls/enabled/PerformanceServerTiming.webidl":"2ea12d8606689422ba4cfbd3de676f155cb764ac83915f235c8dc119572a5713","webidls/enabled/PerformanceTiming.webidl":"444081120979dc63fa0f8f20b339ad6e2bd5460e25bb727c3a047cc394d528ce","webidls/enabled/PeriodicWave.webidl":"13ecbaad1289109aaf58c5ed2595face11563a921546c0ad812ba66e64bf38a1","webidls/enabled/PermissionStatus.webidl":"af7a7599374070947d2c8c1f0425363cfaf510db202fdec592b6c01a382e87ee","webidls/enabled/Permissions.webidl":"7567d31bd5dce5df70fc0c0bf033d1d02d599df1ee88352eeeff04150f863180","webidls/enabled/Plugin.webidl":"ccc55caf98f299b044eaa2d58edf49bf92c30319f64fd0dd9b4be1fdaa75a776","webidls/enabled/PluginArray.webidl":"56664598004a41d88f39a1d14efad836ca63002e01e9ce9e7a478503af67dc4b","webidls/enabled/PluginCrashedEvent.webidl":"4dc5bf4bd81716bbbf78a88b75ac76a163a2f25e508b4df60805870b8ca17553","webidls/enabled/PointerEvent.webidl":"842a273210f481e541db88187a4e4f506f9682ab27f4ada97236e6816737ae68","webidls/enabled/PopStateEvent.webidl":"b3fbde27e8a0990a9f3ee510ae077b4d73bbb0e6ea481007c3cb6dcccedad979","webidls/enabled/PopupBlockedEvent.webidl":"7097dae7f8bf471487ea5942b3747b5ae47aca54e111bc6cbaf1599e13d90716","webidls/enabled/Position.webidl":"e0455234c92c570ae8bfdbe2f535c62b16ddd339f9a82e4c4f945c04fa2776cb","webidls/enabled/PositionError.webidl":"b6158a0245dc08a95e13559a03d8ac1c5569b8d486c0fbca872f13dbb953e0ef","webidls/enabled/Presentation.webidl":"8bc67e499d9f99263774da2773ec87fe5ebfd38df4bec99983c9c6a213055ce7","webidls/enabled/PresentationAvailability.webidl":"0ccdb1da5aee3e5495a372c1310b2d4f483a2f92b7a6cd322c620c72ddf1bcee","webidls/enabled/PresentationConnection.webidl":"93f6218b08492ab8af703a3d1524e8d634a2724cdea38b5304089129ccf10d63","webidls/enabled/PresentationConnectionAvailableEvent.webidl":"3927bc5f09504bdd34068e018741ae66158fc442922c3f94211e2794c0bab240","webidls/enabled/PresentationConnectionCloseEvent.webidl":"e943f060198350fa90d509806b15e0ba29c694c6f96c70b80ba7878861b3e6af","webidls/enabled/PresentationConnectionList.webidl":"bfb59c582a8787c44f1dbaf29a50b40b754c9828093b8056ee20e1db902a4d97","webidls/enabled/PresentationReceiver.webidl":"faa276a23a21d8db39a07dce80a7a120e6cc0e2597b5bf3d4240db568bd42356","webidls/enabled/PresentationRequest.webidl":"669dd03457f5eb4ddbd6ce9ae8fcd02ccabfb062ae9322fe7e91940b3655af72","webidls/enabled/ProcessingInstruction.webidl":"c653d1de81771557a93cac5694336418576cce5a8358e40f089304d8adc474e6","webidls/enabled/ProfileTimelineMarker.webidl":"08414691af335e0f2bb906cf53cfec9a8723254ecc37f0e7bacf6b8be63c7f4f","webidls/enabled/ProgressEvent.webidl":"aafe0abe465e049bd95032ee52877aed82bff3dddaab231cc3eb71453184ab1e","webidls/enabled/Promise.webidl":"0196edcf454c2a67b8c81fab76d3522cffc8a593e014db2d997a6f5f0d725d81","webidls/enabled/PromiseRejectionEvent.webidl":"25accc9224ed7795778b4cc93b7f51b5b4e1ae0ce18f97e7a91e6b6cf02bcea9","webidls/enabled/PushEvent.webidl":"2b1fd7de0888b157ba25991c4e6ef4615a1276c2cce16c68d53f92f1eb4aaa09","webidls/enabled/PushManager.webidl":"a6fcf2d1eb32de1619f5f95bbf3b66635224c68496067e3002e03a6e972e4d42","webidls/enabled/PushMessageData.webidl":"72ce9e056c2ba9857ecaedda5362cd2d56faf161ed142296cb84def701a88f53","webidls/enabled/PushSubscription.webidl":"77d0d1cbd486f109ee2104aa3c23791b8094e9887fa517ac18bfe1691d3d6409","webidls/enabled/PushSubscriptionOptions.webidl":"817516cac055730ff992f8d972d3b752432ebab9b1903cfc18c8cedbd9ae7294","webidls/enabled/RTCCertificate.webidl":"10b5eb04b373caafe3fcff85601e9249261521d824128f876f2bdf8117951917","webidls/enabled/RTCConfiguration.webidl":"77029b6e5ecaf3a6fad064b7f183b3dae38013badc3fbb52e3ee41644121d943","webidls/enabled/RTCDTMFSender.webidl":"c39f43e55e99ee405a460f61b3bdab82c44dbdc99d4dd44d90d2f66e3c8c11d8","webidls/enabled/RTCDTMFToneChangeEvent.webidl":"d5c54f4fc2aa1085a5c966e5028a98865133f43fa537578e66f3d183ec3415f4","webidls/enabled/RTCDataChannel.webidl":"d4b3a63df4c2d934b9b0360ae4848a83806ba0de9057ef5d7b38f9054707e1e6","webidls/enabled/RTCDataChannelEvent.webidl":"4a95a226ddedfe4dcceaba7338343f8a8621023015563cf2f905c19128e8e7b2","webidls/enabled/RTCIceCandidate.webidl":"9c53b5ada7baaa7d79922795981bc6d180d425ceef2485898546cbf4cde05450","webidls/enabled/RTCIdentityAssertion.webidl":"fc8faa529cf633e6fd7b510599fb1db4c30a2d168f4a156515065cfa167d6d23","webidls/enabled/RTCIdentityProvider.webidl":"691b7c71765e7b8eb9750127def9a7221ea02c9c285a7fc70b43766203ba1a5e","webidls/enabled/RTCPeerConnection.webidl":"26a026f36525f1b6faaf74513f35430db3e84a58636bf76cb931f54fee4546fa","webidls/enabled/RTCPeerConnectionIceEvent.webidl":"a48cc1c8e9984364fcda93381a2a1b00dd2a38684e540a1482dab8218b4d6a1e","webidls/enabled/RTCRtpReceiver.webidl":"167fa341b3f51c78c5bace58b083997eb4d909046b7b0028b4bd68d72289278d","webidls/enabled/RTCRtpSender.webidl":"63fdcd90c70c62349ca172fae0585301d47a51496d3b9c96f018633d113d447d","webidls/enabled/RTCRtpSources.webidl":"a5d739766665a4f290cd121407bd44d23ebf57b869350a3796ac2aa315383f39","webidls/enabled/RTCRtpTransceiver.webidl":"86b7f1065a38ac894160798964bbb38f24136cac7b8f51d09f2ccf7f7af5cc07","webidls/enabled/RTCSessionDescription.webidl":"7ad506b114aec2894fa4c650d929e1cc3a1406e2388b9961607ff53cf2c192de","webidls/enabled/RTCStatsReport.webidl":"8921ce8843ba6bedb22e4c37241455680382449a50289a3476ce770a30f6d24c","webidls/enabled/RTCTrackEvent.webidl":"5f0a6325b2ea07859be497d968954f0a698c4d56e109fa1308fc9669bdc14b0b","webidls/enabled/RadioNodeList.webidl":"5b1751029f985b32667174c4414eea17b926ea681d3608bf4f15f084b0184cc1","webidls/enabled/Range.webidl":"9b3a888227ec17c4ba0eb48ba2cc4fb24d0fc3a61ee30643bb0c4e12a3544f99","webidls/enabled/Request.webidl":"f1929c2c4d6f8d19e592a0d7821d06613adc7a02926da489641ee7efb989575b","webidls/enabled/ResizeObserver.webidl":"f4a6a5b13d062833f2c5604e9eeeaf7ba9d2b5cd1d33005321e46bd65a0c28c4","webidls/enabled/Response.webidl":"333c54b567c87b4995268b608551055db70249f93c08c12b5f129f3a62ce34d7","webidls/enabled/SVGAElement.webidl":"9266973cab81785a2d9651a4bcacacf0df9c080f87ce7e20ca8662a86cda9ae1","webidls/enabled/SVGAngle.webidl":"2c611ab01465abec50c5d412f9f9b8d013af0be13613e55bc011746243d02c56","webidls/enabled/SVGAnimateElement.webidl":"406e108607cf6f6532fc02f2503e52c0651127c45f4aea2cb3a4a388c4ba6c1d","webidls/enabled/SVGAnimateMotionElement.webidl":"0b99671068057b224eb5fb40c2ca818ef89bcc408aad982bde138092f1412dff","webidls/enabled/SVGAnimateTransformElement.webidl":"c8c232b0c2193b259f024158e61c79756042e96eb642ce32ef83abfc00946f36","webidls/enabled/SVGAnimatedAngle.webidl":"1ec87dd46edb885b468de542e37b3a2ff3e69015b3c92386f92f1903f9222f81","webidls/enabled/SVGAnimatedBoolean.webidl":"21ca5be2d236ba2a8935532a82a7791cf921cc22050d1911706b13a6f40a60f7","webidls/enabled/SVGAnimatedEnumeration.webidl":"ac2483e79c8c0681b24b400e88f3490ffe040c50584f51e98533fc5fd64b8822","webidls/enabled/SVGAnimatedInteger.webidl":"1225c8d8f41ee85008eee904eac1e017a0f60762d7adb09a7ab467141535cf3d","webidls/enabled/SVGAnimatedLength.webidl":"ec75bc98faa3fa71fd96af7a4aab0f3bf982507360d9fc55737a8aa00526f93c","webidls/enabled/SVGAnimatedLengthList.webidl":"4a2c967bf7c3069567f53edc7bfa7baefc81985a76e82013fcbf0556de3cd7c3","webidls/enabled/SVGAnimatedNumber.webidl":"a352a8f78f6feb508c3139f8b129ec63288424fe8afb84abbcf73b24857683c0","webidls/enabled/SVGAnimatedNumberList.webidl":"586dec7836b1a38358f333637b3d10cbe44db1cb3e6527ffda21984912cc09d5","webidls/enabled/SVGAnimatedPathData.webidl":"9fd44f6b2db82cfa362324f1ae291214cfb3ee81432974e4f9b5767f4d6ed15f","webidls/enabled/SVGAnimatedPoints.webidl":"50a53c450b5e7a660f40abe303d8e99d9dba86a1b68143decfea8149dee940c0","webidls/enabled/SVGAnimatedPreserveAspectRatio.webidl":"f9d89696cefa023f366a95c43cfe7ddbbba069541e115baba0121bcb9d67835a","webidls/enabled/SVGAnimatedRect.webidl":"82b5590f298c162a3143db0884c11558256562c42740d263af230c058e1dd740","webidls/enabled/SVGAnimatedString.webidl":"538b70cf811953c09aabba7e3a0218df267e23bb3716fe972427abd27e10269f","webidls/enabled/SVGAnimatedTransformList.webidl":"bd33eeb6a4530cb1f1d4aee69996fb40a153a636124b233fd98b30a69c865da4","webidls/enabled/SVGAnimationElement.webidl":"2409dfa104150ea27ee52588dfe205153bab86173fa602b274a47791825c4fa7","webidls/enabled/SVGCircleElement.webidl":"af611f14ef46c012c4803c0712f7ac4293b7332fb0d718ce0f088c1b2f23179a","webidls/enabled/SVGClipPathElement.webidl":"632723812c80f2713beebf908830e6ea0a1dd18f1136d6e7c3d62db1daaa2365","webidls/enabled/SVGComponentTransferFunctionElement.webidl":"fd86f255607d5124e5b3ba4e94eddb4e09081be7acc70ecaf18a3b16147d5a64","webidls/enabled/SVGDefsElement.webidl":"a472683867e97fee7949177b855cbc8d00c0ac382df1307ad6c04f615cbbdc9c","webidls/enabled/SVGDescElement.webidl":"1e53672d52672362c5b24429554a346c02f88bf0af92f9aba1a765dcfa1f725b","webidls/enabled/SVGElement.webidl":"ff5e68745c8dec85d34e528a4689f311a3f013f0a1ec3f782fd132553a907004","webidls/enabled/SVGEllipseElement.webidl":"c409ec29884913a14283b120e7171a3fc6d00991d70c5c5e328f2fb6a6369388","webidls/enabled/SVGFEBlendElement.webidl":"a97a3542c0d6df30ead0ff7c85fc6621eb738cc058d381a9c4a14d1e2ff5dc07","webidls/enabled/SVGFEColorMatrixElement.webidl":"c4948fc95e2b0ac5c7dd749c33ed3f280d199fcbf1c1c5bec627b7945292ca1b","webidls/enabled/SVGFEComponentTransferElement.webidl":"afae71ba9759d1f64c84bc20461af3049a40871bbe311c84ce6d4206e373b51e","webidls/enabled/SVGFECompositeElement.webidl":"fa3ef383464e76b4c9d355a1205482f296ec9d2ea8064219ffc1647f3d5e72f9","webidls/enabled/SVGFEConvolveMatrixElement.webidl":"fa50facca3ff39ed8518f2544d7a00f9ed8080be6f55ca82c068908442d83446","webidls/enabled/SVGFEDiffuseLightingElement.webidl":"afd160379bdd740ee1cdb94c98d0c5a5f100005a74a888d95187bef9143e99aa","webidls/enabled/SVGFEDisplacementMapElement.webidl":"04de93553c74074f036b9b4ba2f9df5040eee50f5fe9c29b0ab7d37faa0be57b","webidls/enabled/SVGFEDistantLightElement.webidl":"ef9695659ef0fbc29d8a65618b94e273b7628a129b861c6fb591d9a8987c1d52","webidls/enabled/SVGFEDropShadowElement.webidl":"d2bceb961dd63c4a7bdd2d471c25357969f9275d22fd0aeeb490b5b31cb53412","webidls/enabled/SVGFEFloodElement.webidl":"dc1d87cc8b66c37700c4eb780efc5eed6852fc2110a36d6f87436cab4c602ab6","webidls/enabled/SVGFEFuncAElement.webidl":"be785a50252c031f4ca1527e661d7c2b755941f23e43e4e058059d65a3e58299","webidls/enabled/SVGFEFuncBElement.webidl":"23c0f541ee460d88c2bfffc23d39f0b2cf55afdcc166bf8d21b0c6a44027dbe8","webidls/enabled/SVGFEFuncGElement.webidl":"744bc8c3d1c94826a4e77bfb804ad15e261ebbb97a0b54449b919de96360c82a","webidls/enabled/SVGFEFuncRElement.webidl":"c9cc8f0e5751873a92d1c2dcab2abfb54eeba2f4fe29bd0444c3860ca5d6f62d","webidls/enabled/SVGFEGaussianBlurElement.webidl":"b57fcbd7010044f4f7b985660761295a011c120c1bc946b1f0df650c76ebfaf6","webidls/enabled/SVGFEImageElement.webidl":"abb94b92701be406254738f5da555d427ce22f618df430f56053436bdb601977","webidls/enabled/SVGFEMergeElement.webidl":"9469944946e6117fe2c9ad894f4791c87e389951d3a639b0ac167801d2fbabf3","webidls/enabled/SVGFEMergeNodeElement.webidl":"f1f8d479644ec523d59dda7e1091909a1e523af2ec8dfa212ecd9e46cdb69e82","webidls/enabled/SVGFEMorphologyElement.webidl":"6595ca562b5ff35c102b58d4db856026b29e4c39035428b243a090164e8396e3","webidls/enabled/SVGFEOffsetElement.webidl":"6f4c392cec4199615873b79141b89586394ef3d87ad226eada35e0f08dcf620a","webidls/enabled/SVGFEPointLightElement.webidl":"4a572696b33c47bf4449edf743df65ada8e755145cee81f03395a9450986e926","webidls/enabled/SVGFESpecularLightingElement.webidl":"403020eb2023ca663700c693a48c6d7469a09ad1e96482d3902642e4cd3e0d8e","webidls/enabled/SVGFESpotLightElement.webidl":"30cc640692270ad6f98fb7d5b786c0208499c13edae57e564829cbdcbca16358","webidls/enabled/SVGFETileElement.webidl":"342a723b07d6397362ffd31fd890d2754651465f703bd91e06440f6fec89b11b","webidls/enabled/SVGFETurbulenceElement.webidl":"69b932ff2f1fc73aa8256daa9c88b133aa29c2d6ccf44ebbd1a00055ef3a49ea","webidls/enabled/SVGFilterElement.webidl":"15ab2e501123bca1f8f8051891c91cc8f02399b2ecb607a5f4786bebdac34cfe","webidls/enabled/SVGFilterPrimitiveStandardAttributes.webidl":"0b690e40034014c00ce6870c62750735292e22a6f63f34fac3e8773fecfddbdf","webidls/enabled/SVGFitToViewBox.webidl":"c54c72b53fc99992fa17dfed0d4ef1159633c1a973073691c744b76e90ba39ea","webidls/enabled/SVGForeignObjectElement.webidl":"27312a4ce1f30c2a42028be85200b384808e7f9bf43e1156392ef4e4591711fa","webidls/enabled/SVGGElement.webidl":"d35dc8c24962a0a42dca4dc1242ac5561b76db6d730ce28edb601187d53b2923","webidls/enabled/SVGGeometryElement.webidl":"dd0f86c2571613a37c9be53298d86cfcd48851d2775270604eccb23891215f6e","webidls/enabled/SVGGradientElement.webidl":"47efcfa524e2cdfe2435862dfb30c7df990acc9909ba5958aa0f42b2a6a92bef","webidls/enabled/SVGGraphicsElement.webidl":"846e3cdfeadff07b5360f6870796ed8effe0df1a15fa74a359a2afa296497900","webidls/enabled/SVGImageElement.webidl":"cb24d5626d0634ad5e2d026b1fa50bf7410158f3535717ccb8f0828b86a5621a","webidls/enabled/SVGLength.webidl":"55eec15aa711a9e7b4936d51713a98fd584a7739152032c5baedaba2ad646dad","webidls/enabled/SVGLengthList.webidl":"ba84807f6a41814e2e3ee76d9ec2c77b60e7a19d7d8268ca644b5ffd3d429a17","webidls/enabled/SVGLineElement.webidl":"ebf5835ae85de91fa701dfd1d90c814f564d42726000cfb5e81755f8112650b0","webidls/enabled/SVGLinearGradientElement.webidl":"08418f12e42c67d57f66c63895d353b63a30e752fc81bcaa682dcc29972fa7f5","webidls/enabled/SVGMPathElement.webidl":"65ae7e78f412d13d434b023518f7a91ade30e5fb1445fb275616e1db158a1de5","webidls/enabled/SVGMarkerElement.webidl":"44b14d831193c7c8861e03c85558d215d54c01503a6335c2af7d3717dcfa73ef","webidls/enabled/SVGMaskElement.webidl":"2e9a8b5eddff4cd6f3daced2c32227e31a67032451506c49e8d45e8a80199b76","webidls/enabled/SVGMatrix.webidl":"2c36393352662d30b3e15ac98976d0ffbfe6fecb9bf9a46788e3748feb7d9ee8","webidls/enabled/SVGMetadataElement.webidl":"edefcf9243c063a58dfd18648b10be9516c798db0eefa08cf0843f0014ebb16c","webidls/enabled/SVGNumber.webidl":"c094b396c9dd967c23eee36cf78ea9be5d97df72b0b22177f5fdf6a7390e792f","webidls/enabled/SVGNumberList.webidl":"29e35160d72aa287675018cf85bcd35d1c08c4a1147ed3a241695697b1b2a5b5","webidls/enabled/SVGPathElement.webidl":"d3e339379a478000382a56d34ba98adc08a2c3c2fe1260937d9c40e8e265a605","webidls/enabled/SVGPathSeg.webidl":"aab6325878704a3a46567ace2757640c8e45f9e68e632dccd06d919b3aca95f9","webidls/enabled/SVGPathSegList.webidl":"e43bb7403e0dbc76554a7589f24db6b2c8042b946ebab71b210a30459881e972","webidls/enabled/SVGPatternElement.webidl":"577dc47c532c5936068309fd6bfc65d0bb21e45e2903cd4515f03ac39e556a50","webidls/enabled/SVGPoint.webidl":"bbd6730609d9394f7199b269f24cb5aecea28e8625794e47eaab414f67afe281","webidls/enabled/SVGPointList.webidl":"cf36eeb67bba98bf204b50620934a1d4f42f03c25e70b213e16b5b0bde31008f","webidls/enabled/SVGPolygonElement.webidl":"e902ed44dffcf2efb005ba2ff9ffffbb62d382e52a8dbb9a105abdb227b7403f","webidls/enabled/SVGPolylineElement.webidl":"1d2e524aedb66b056b69f8d2560fa3b68a8417411b16e07bb58f0f1628ec1965","webidls/enabled/SVGPreserveAspectRatio.webidl":"687f803cac4b9a6e7f3f32d8ede0d5d2cf838fa4b7a5abd063be28c976d09d13","webidls/enabled/SVGRadialGradientElement.webidl":"66586aba27c83dddb8646f5263e35ec841e72a0267824bf856d4a8fa055de370","webidls/enabled/SVGRect.webidl":"81c17d4961853662265c27acb21543baad83170b65096a2aa0186f5c811ab129","webidls/enabled/SVGRectElement.webidl":"75ddf7eda4a1a1ac1d4b243364e21d8fbc84b47fa33d936abe509995c683433e","webidls/enabled/SVGSVGElement.webidl":"8d544dd5181b8e851dd0f722b0b33579634f28f00dcb268e23fb1265008f2968","webidls/enabled/SVGScriptElement.webidl":"cdf1a3aba7db43ac419bff2831ad62b925c24410c3608b63953996d4d8842661","webidls/enabled/SVGSetElement.webidl":"858076ae56590ecb61aab88b746a92b6f161d90e7c78ffac4fc6c0bcaff6b1ce","webidls/enabled/SVGStopElement.webidl":"5a51ffa270957553fedc913848867a9f0786673c3111585a638c3c4517e5bb44","webidls/enabled/SVGStringList.webidl":"24d5fb5896875652f0e8f691a809ae21211138953b0d0fc2e5003a3b7a202463","webidls/enabled/SVGStyleElement.webidl":"fb96e6f37015f9d9a4f20fd91f5f6199e0e71c0c6875666753209a7415b810a5","webidls/enabled/SVGSwitchElement.webidl":"c9758f48f58a700705f56d4bcce9bb67def9f0cb1e8410018f95e0d83cdda80e","webidls/enabled/SVGSymbolElement.webidl":"3c3a9f9d778404f4082edc53b2a015b14be759392fca787e911535d4f4437ef5","webidls/enabled/SVGTSpanElement.webidl":"237383c44aaeb9daaf5839c91800355cef2488cb107c2d7afe7bdca73c01e7ce","webidls/enabled/SVGTests.webidl":"e41ebf9f26401ad603f11cae37b46ee0b0cf36ef0d10adf4a039eee1184c31b9","webidls/enabled/SVGTextContentElement.webidl":"3f009cf0d40b5ea4cc0bc3a1c29fa080d4be290303a5ee054d12567271cf4db1","webidls/enabled/SVGTextElement.webidl":"a4e13ba09815aca62014069ee79aa1fc32ceb1e2770f0c712bf11096ce30a55a","webidls/enabled/SVGTextPathElement.webidl":"717b1ba9ab66c3ed589a89cf5ace7273add4d6c8d9a2acf628bd36e771658a6b","webidls/enabled/SVGTextPositioningElement.webidl":"8d67f3364c487310ff034b42d520ebfda3bf8fab718aa0008f0b2cff668064fb","webidls/enabled/SVGTitleElement.webidl":"4de199bfc0c27e876a27b6016f8fbb33190fcdb73a521a9538f2d63f89337a32","webidls/enabled/SVGTransform.webidl":"d37e820b70eb0cabef9bdf2f3f659e79ee94c305848dedc686bea0b96c8fbdbe","webidls/enabled/SVGTransformList.webidl":"33d93445ef164886a04d30d47dc1e47a2ae8c7405c7b537b00919ec076c28c13","webidls/enabled/SVGURIReference.webidl":"1a209294dc3a93a82de934b06d8d2122b47a15a12033376b8b4581b4da857bb9","webidls/enabled/SVGUnitTypes.webidl":"94aab6a0c212cf5f541bd463100e0a91e8c3c1d2da8e450f013841c989cdf151","webidls/enabled/SVGUseElement.webidl":"57dc59cee19582a3f1068757b7256d8594cada661d349cb3c0ec5cb7fe6bbff8","webidls/enabled/SVGViewElement.webidl":"dcd8c5d4d96f130750b77a25f3014813267eeffd2f5486d6f1738ec98b998645","webidls/enabled/SVGZoomAndPan.webidl":"f3d3d76f88dae5a4ad43c9759dd269ae53afd1c1aa40c5cf7e674ccd63362c66","webidls/enabled/SVGZoomAndPanValues.webidl":"7b98dde6c7bb2937953f5eea85e7906845cf1d4d7615c281d54699eac7f89162","webidls/enabled/Screen.webidl":"edabc2ab6ac7a8c1cc3cb31310cade22c3456464e5be1521079bf869d0448fac","webidls/enabled/ScreenOrientation.webidl":"a150e228618f005cf574fad2928a0c621e3407c570e271a9c576c44ed3d43086","webidls/enabled/ScriptProcessorNode.webidl":"975e17ea75e47d41f7594c86c1e8c70fab15cd62d95247a731720cf97728d7ae","webidls/enabled/ScrollAreaEvent.webidl":"011178fe11784066ba040ed23c06533b66a9d6f7eee7369937a6732c02c15d7e","webidls/enabled/ScrollBoxObject.webidl":"252e511ca675b87288413de1cea0ad03ddcef85232d6bc88f178f7c31a4b0427","webidls/enabled/ScrollViewChangeEvent.webidl":"243bddb6bf78f5d362ac33ff57f37ea26111e72232675fcebe84d81a970d3993","webidls/enabled/SecurityPolicyViolationEvent.webidl":"2e77aa3d68aede50ae1f99f7f77050b249d706783c7492a59b0a7a9b4b82b0e1","webidls/enabled/Selection.webidl":"e7c9ce0ebe7682e465041703cf87816778de9d7e4cf1b402ff7d554485b720d4","webidls/enabled/ServiceWorker.webidl":"c82e31e1324c4441605a21e582b92e9d0ef36156d3a818f7ee7bcb5240ec05d5","webidls/enabled/ServiceWorkerContainer.webidl":"2da8d2ef384ede2cb0b09690628675c7bb30210b221a42c31a7ed964308f5aa0","webidls/enabled/ServiceWorkerGlobalScope.webidl":"9e00be5c419275c6082d5897f47f3e8f638b69b37ae0bb91da865adbf24cb13d","webidls/enabled/ServiceWorkerRegistration.webidl":"9349028080c0df9531a7e104368ec5b3250167e64a75c77a3eb4f34fad6b7e31","webidls/enabled/ShadowRoot.webidl":"da96cf6f2c1a871cdc646bec67d24ffe9345eb5bbb62634da5c9e7b0a5024d98","webidls/enabled/SharedWorker.webidl":"5f622c95284d639e7d0bc396d60b3e660eb655c0eb7a0ccde54e0b986f94df6c","webidls/enabled/SharedWorkerGlobalScope.webidl":"bf36b09c0cc5d6bc65f325ec6f6c5d6f00325a6c40802156d9acebb5197cf395","webidls/enabled/SocketCommon.webidl":"65872f202a5324c291c5499f8593ed4826911a077f4d1d8a114d564e65ebfbae","webidls/enabled/SourceBuffer.webidl":"a92034684a913805104d7371ad84684698321cade8072855bf837a43742d5a9d","webidls/enabled/SourceBufferList.webidl":"5dc259a31f77b9bc8a6125aaeb1238102235b5f23261b4282acc21888f69a798","webidls/enabled/SpeechGrammar.webidl":"6aebc3b030f5baf5abef93e32aafaa358f0de5494f273b0851b43e5ec15bd4fc","webidls/enabled/SpeechGrammarList.webidl":"0c2c2b01155a481ec45164eb5561f47beb177fc39ab13ce1b8066a22816ef752","webidls/enabled/SpeechRecognition.webidl":"718734f6db9e0eddbe0d78b23a46c60dfea1d6e64b87b9c617556b8c934171eb","webidls/enabled/SpeechRecognitionAlternative.webidl":"bdb0ceaa3fa8dcc053cf097c88ef93e16024ce65f1c6992771088a19110b6e3a","webidls/enabled/SpeechRecognitionError.webidl":"fc8aeb8170d4269667ab76d53d6fb4c9f358a9aaddee7b90a700d8b5b65362c1","webidls/enabled/SpeechRecognitionEvent.webidl":"2789b5157f7739cbcb64783eb1c7fc909ad3c28593b244817309260a8d9de16e","webidls/enabled/SpeechRecognitionResult.webidl":"c136902df06dd6c99837b2fea499c430165b4cffaa876af09023993932db33db","webidls/enabled/SpeechRecognitionResultList.webidl":"e7269b67251ec271436a8da484def7654cabf23caba6ceada18b9828e8e168d1","webidls/enabled/SpeechSynthesis.webidl":"bd2384a31fd4216a388ff58888679f2a27f1d2e98edae96aea069dfb8cdeee15","webidls/enabled/SpeechSynthesisErrorEvent.webidl":"1231f5651bd3440a59c967ce22fb56b53d2bca7a9c2d0be913642ab2ded65cd2","webidls/enabled/SpeechSynthesisEvent.webidl":"2c86b63898380ec9a3665f83a350ab964ae3de52073aa06de68ebe429c97fad0","webidls/enabled/SpeechSynthesisUtterance.webidl":"0c463f489ecf947a897e32cb77869ca61018ba53a503e9c43e9d194524f69c2f","webidls/enabled/SpeechSynthesisVoice.webidl":"615ca94184a3d9de46c3ec47f860faa275dd4607f1395fa2f2203f5a82330804","webidls/enabled/StereoPannerNode.webidl":"ba538833cc7cf33fd621838a349b01712290e5e53a00d8c1397c60b0e2249965","webidls/enabled/Storage.webidl":"81e3792a1c753157683441a44a0c23900c954eaf158204b3ff5e154eff37808d","webidls/enabled/StorageEvent.webidl":"c2a378abf1f1918d787fe0b38af8993e8e8dc83295992293a2f9801861ad623f","webidls/enabled/StorageManager.webidl":"d72dc2e1869068c8297f182c446375417f485c314ef5dd6b42fec20793b1cf06","webidls/enabled/StorageType.webidl":"4784de962657f20943274788b8118a4bb105113f69bef7c15accd9a9a1708639","webidls/enabled/Streams.webidl":"3ba445627077faa73b7d506ca76fdc5b9af608fe5d83b64f3894b9e6167cc7c3","webidls/enabled/StyleRuleChangeEvent.webidl":"0521ff622835d6e093b3dfc742d10e867b416246233b3979f995f21ece3e7677","webidls/enabled/StyleSheet.webidl":"5d34b67fcca9d7a0460d344e31a683e44aece4321d0c99e46ab3fc108edd7037","webidls/enabled/StyleSheetApplicableStateChangeEvent.webidl":"01ef38bbcdc8b59daa8fc455374270a606127e0cf3f528793635fa5788fdbd7d","webidls/enabled/StyleSheetChangeEvent.webidl":"82c65f78a3939d2e5e8ba012f854f13949c96c5157d67fa2cfda03527a705cb4","webidls/enabled/StyleSheetList.webidl":"10ab6f214b7501041e6ff1ff4ca0991e2bc32c833a09415b70d9c3f06b515bc9","webidls/enabled/SubmitEvent.webidl":"fd3cf63e1b988722d972384cdad5044da728ea616ac8b620022c604c6c34e4e7","webidls/enabled/SubtleCrypto.webidl":"8ffb08be9f2200fceda4aebd296d00ad478cbe402dc9fb7da1a8699d44bbd57f","webidls/enabled/TCPServerSocket.webidl":"6cb2948c47f24da5914e1bf2ec781012a73922a4cbbff4531ed61809b05139de","webidls/enabled/TCPServerSocketEvent.webidl":"3169fd04ae2c3e31d5c57f493c5247caab9dbbfa0f38a6088abaa4b35e5d41d2","webidls/enabled/TCPSocket.webidl":"278a817cb093e1b4c168cb148e07b0a79e209cceed1276b0ec2243d3de961c8c","webidls/enabled/TCPSocketErrorEvent.webidl":"639f7bf942b272983c2d0495d13c4d51e33b011517bad27930d4022d85719914","webidls/enabled/TCPSocketEvent.webidl":"c958fee252aa98f6eac35048964aeac905293006e0cf80c6845ba16000c91e79","webidls/enabled/Text.webidl":"56fbb7605981f8d363ca4ce2cf666180ad3afdd2b792022a47b02769fc1e9ca0","webidls/enabled/TextClause.webidl":"900118a0b65693a577b25a23522f299622f034de6d7d13a14c45abe967a56606","webidls/enabled/TextDecoder.webidl":"28d2750c80b7bc651a55a77ff02ba8d3992f15cd98b802711ff6189d95601488","webidls/enabled/TextEncoder.webidl":"9c6fec6dd1aae1154702bcf7fb5ca712db1281d08ecaaf97596a488a81b02f24","webidls/enabled/TextTrack.webidl":"813e1cc26284a67c61b045a3d9997d0957a7d232d8650157a322ccfbfc71d844","webidls/enabled/TextTrackCue.webidl":"9dac62a7e82c03cc914d4edec84f7c4c018aa925535041d99cba447c8158170a","webidls/enabled/TextTrackCueList.webidl":"68acd65d75d9cfdacfc8e266c3147736cef3b6d59f2cedf65480eb5a8c1a8af8","webidls/enabled/TextTrackList.webidl":"057df5f7bc9bf2b57c2db79ebb72ea6bd62474034279159c65c30a4ae934e4eb","webidls/enabled/TimeEvent.webidl":"f516b56d682f41ea4cfd4b79d44707e896fa80677ac0e6a53c0dd24cd43a4fd9","webidls/enabled/TimeRanges.webidl":"926ffda3eb7b15a1750a608351d12b1df624fdc5f9469c9bd278491d4d1a70d3","webidls/enabled/Touch.webidl":"93720f0d2b8b807bb2967de4fe8cf1ada71c2c08d42155022b3ec5a9acb11cc3","webidls/enabled/TouchEvent.webidl":"93bee04784f1c5dce705b782072abc16dc9f296dee06b72167e2accca4e22c50","webidls/enabled/TouchList.webidl":"e38500c028542915bd23a6a8fd0b69d60d70ee5ff72e0a0a67736763eada79ac","webidls/enabled/TrackEvent.webidl":"646d6266c3258dc2db8d5cd52ecfe54fabe34561b8f50ca49257f3898638f5cd","webidls/enabled/TransitionEvent.webidl":"fbced41fcb7810b4c1b8c8d1d2ae6b93c0d57056372956d4586178e18dd1e433","webidls/enabled/TreeBoxObject.webidl":"9c7524b2984549e3308405d1ed2ea5a7bf1d1f91a5ac248802612d4321c4f501","webidls/enabled/TreeView.webidl":"f9fce08c706c9af4982e3af4ecd6be683dc6fae2ec00ca0d60cfc6f6afad59db","webidls/enabled/TreeWalker.webidl":"c4c41e63f6344711ece9127d0aa47a317ab1cdf033b8bc5c8e2457ccea7f33aa","webidls/enabled/U2F.webidl":"89560a2258259bf7bf3028dcb39f2fa96c08547cc126ae6489b75265b3341188","webidls/enabled/UDPMessageEvent.webidl":"20ef1b7ab382adb831261bcd2d1012c8d1ae4a86686a339241833f1747b646f1","webidls/enabled/UDPSocket.webidl":"1f4832f892dc5917bc94e2b33ae9f86fba17abfb2b68cb801d3ec557c67dad66","webidls/enabled/UIEvent.webidl":"baf73d89d59893db3fe46a65c1631d95412f273e819ba240b7c5df7ac32d8647","webidls/enabled/URL.webidl":"f2e01d246e53d2c604be77c24f4e8e0a9f49229ac6397418e2dc4df78816fb55","webidls/enabled/URLSearchParams.webidl":"ff1a908768d5a1caf4ab773f3060b694d4a7498d4443c2022cd36f527e70f84c","webidls/enabled/UserActivation.webidl":"bd789612edde1208bb20e38d2e12684d0c4926ffe772c445437f87751dd296b6","webidls/enabled/UserProximityEvent.webidl":"7b4a94b00c4228aa1f4f23173c81caf695c9a6fe2f7636e1bb6541337446c8e2","webidls/enabled/VRDisplay.webidl":"cbd85f9443b289a949143047e2a11e78a7876495c7cbe5d984820770f779cb95","webidls/enabled/VRServiceTest.webidl":"00bdca757373eb90f58747ca73fbd37ea2d3c9c1689c4b9747a3f2fc97367f03","webidls/enabled/VTTCue.webidl":"dbeac63c2c1e62eb7dd1271b9c64dd6e78ca4cb281ef5e780faab68b0b80ae8d","webidls/enabled/VTTRegion.webidl":"f27235cfdbc6e44dcd65b023e487e487b5ebfeeffc7aaa650df0cca650fab254","webidls/enabled/ValidityState.webidl":"49853d0c5b3b9036b1fd538535f69ebcb09decb13369a31bf0f918cce2c70392","webidls/enabled/VideoPlaybackQuality.webidl":"d5788b9ee029f65d00fb033b3a140e81b1a6b631ea0b27077c3459d51e766a88","webidls/enabled/VideoStreamTrack.webidl":"f3ae8966e8f43f2e7889bd201863700618e2261fc295967a4e83998c1f818c4c","webidls/enabled/VideoTrack.webidl":"3f5a8613457ba5167cac2d51b0d4713ed270352b555b302375581538cf3d5514","webidls/enabled/VideoTrackList.webidl":"5d7d92ffbb1d0e367220bdb2dd60b9a51cd76129205fc6968c46781b9999fab2","webidls/enabled/WaveShaperNode.webidl":"2414eb5bb9da49f46cc19e50f4a6f5daf2aa95d2808ec09b1d24b8e1e6bd2722","webidls/enabled/WebAuthentication.webidl":"7743c280e9089aad5c4e648598f753781e5c2190231f7a7fc954f4990d3c619e","webidls/enabled/WebComponents.webidl":"9fa5080f1e24837ba9020ed6d9cab2b6cea1bf0ac5f9663b6910047a73ef973a","webidls/enabled/WebGL2RenderingContext.webidl":"88cb334849915cee76eb9760e48de23e9be7033be024269f731ce8bb4de0bfdd","webidls/enabled/WebGLContextEvent.webidl":"d14a1221ec65fa3f3ec0aca9068c6ef34fe838b47da87451c5c3376c17100f64","webidls/enabled/WebGLMultiDraw.webidl":"64aa473f56eca1280d30a58ddff965bf44a75db2768c9e5659c0d9164e121500","webidls/enabled/WebGLRenderingContext.webidl":"55a1697e3d7204f8771598b265f45f00205f2980c8a32f46fe7508a456faaa5a","webidls/enabled/WebKitCSSMatrix.webidl":"6352f13d6a9a265a24d2c0208f515455068d90feeb1c5c35b03b08e5450c4e75","webidls/enabled/WebSocket.webidl":"b4a43d3b30a4746e7d37f210bb0eae060aae9fbd25b795645094c3adaff5e1bc","webidls/enabled/WebrtcDeprecated.webidl":"4e45cee6502ff5f367ed2d2d70c8d02c6cd2286399ba3216930017e0f88a1fbc","webidls/enabled/WheelEvent.webidl":"e66dfac75f22f387d8800f262bed8f9775605bb558854a0363711fef8cd4b792","webidls/enabled/WidevineCDMManifest.webidl":"e8ddae9d39c447aa996f9c398cbb5ed25fe1888c96cf8cb3d7f9e4dcb572a4f9","webidls/enabled/Window.webidl":"60a84d6b49196ba529614a0f6cd867d2774140138ea2083842719eca1543adff","webidls/enabled/WindowOrWorkerGlobalScope.webidl":"f2105d8836ea6ce2a8efe34e3e0971726097e6a51b50c4e0e495591877c6781d","webidls/enabled/Worker.webidl":"0bb49d29355c9d51dd2e0e075dc6b7718cadc4e030e823115c97fffdb6c7f8a2","webidls/enabled/WorkerDebuggerGlobalScope.webidl":"6a176eb8c9faf74ea2fb13c0ecf318c689d9696c5fae1ff57e67173a7ef41bd8","webidls/enabled/WorkerGlobalScope.webidl":"4f420dc5f52a620af17ff2aa13936c93c6547af2fe8a284e868525de1e417615","webidls/enabled/WorkerLocation.webidl":"86a85cead8f1ccc91357c29e5f100abfb7aa1a7254f4096c9f5a9ed10aeea5b8","webidls/enabled/WorkerNavigator.webidl":"8bb49d3460aa9580a53be991d3e5d1c38bc2217606c8a766744d33141cb2159c","webidls/enabled/Worklet.webidl":"c2b4020b16311557d11dbf40e473f1009d971d38b11f4a9fc4ff2433aa673c1f","webidls/enabled/WorkletGlobalScope.webidl":"a1fdfe1774a6c9fb84ff97733aa38f429d31d05317980a4d01f1d089abc01919","webidls/enabled/XMLDocument.webidl":"305e736ecbf2d1ce5d36e2f027a3f9063a1272708d1bf11912c852d003979c9e","webidls/enabled/XMLHttpRequest.webidl":"b194283955dc37eafa78cf486c141202b81b0e303d79d52c543208ade31b5f4a","webidls/enabled/XMLHttpRequestEventTarget.webidl":"518e63b2b0ca73e80a16bc2224fb8544a8d8cab091a768859041979f7c7ee1f7","webidls/enabled/XMLHttpRequestUpload.webidl":"bc484d3e99947124dd9a222dc2d2333728ccae2801c995890d8846ba8976be32","webidls/enabled/XMLSerializer.webidl":"debd3ca7717a6d768694c384eb1ae2c19be3c48a96f4ada25eb45682ce5432ff","webidls/enabled/XPathEvaluator.webidl":"ee62bd2950cd45133036f9fc3616119ab36eef1656019aaad096e1d90d63abaa","webidls/enabled/XPathExpression.webidl":"fc377e078e136b88d8b57fcdae3562766be19a07f9582eca9de938be5fc6aac5","webidls/enabled/XPathNSResolver.webidl":"aa9675d1c521cdde72d9240fb2aa2b419a6a88313697857925be5ff23152ffe6","webidls/enabled/XPathResult.webidl":"9aeee101e1c58a9e7bcd40bff869b6a1edf8ba3184b8260549fd21b5d5d0778f","webidls/enabled/XSLTProcessor.webidl":"25fdce9fa32f6ac0c2a757b9a0349319a0994cda61770bd9d90823b725ba25bf","webidls/enabled/nsISupports.webidl":"5a857b3c311298fd9b1a4de08fa4d8e0ee60ccb88d374d4a189f0f45ffd7dd51","webidls/unavailable_option_primitive/PaymentRequest.webidl":"5a227487e72dd7e855c22e3b30560e6dc76845cd0a7c5df97a30f7850fdc8a41","webidls/unavailable_option_primitive/README.md":"2fe458cfa8faba4b5a3ecf6809a538e219880c214e564a0272cc7c91994609b9","webidls/unavailable_option_primitive/VRDisplayEvent.webidl":"10a00f04eaaf1496d1ffa2fba048753008bee79ebbd2639516e73feca20b85ea","webidls/unstable/Animatable.webidl":"60e5b91d815300e767a1705002e5f6a7c6cae255a6a9d86ded56162f6e4e6a4f","webidls/unstable/AudioContext.webidl":"0ddd5ddb1d6e0403be97cef84fc95c1e10a7613d89de9dbf0a57a5d84dda07ef","webidls/unstable/AudioSinkInfo.webidl":"11d82876bf309bbd1da3222c2c647ef61af9e617431eaac9e9608bcc66653a54","webidls/unstable/Bluetooth.webidl":"fb72b2522c67d7cb3cacdd2d6c414d264d12f288230461dac39ba9d10eeb0a1d","webidls/unstable/Clipboard.webidl":"440eb20159569205332c7b593207bec62e8c5c276a564c7498f9647728bdf076","webidls/unstable/Compression.webidl":"27de9737001ce346c9bba8caaf3560d47ad811367d48e9fd3d4f29ff47f31337","webidls/unstable/ImageCapture.webidl":"b324635b5585a2bdc24f213571816f7eb2d8fdd2af25e2b3642c887ea6fec8be","webidls/unstable/LocalFontAccess.webidl":"760ec6fc5d7af2e2a977043771b31a130df312ee4fe3ee998f7978aa9d529af8","webidls/unstable/MeasureMemory.webidl":"46091dd8ec8205e86e54515692c06446399f260612d8dae9e4cf191dc441b20b","webidls/unstable/MediaCaptureTransform.webidl":"cdd0d34238d839a0227a41b6a50133b79101ba808c507ba15c27898f9eccbbb7","webidls/unstable/MediaSession.webidl":"dd8554a60f7e16b0c2e592aa70b50b14c39ca4cb996aa85d0f3ab0011c80250f","webidls/unstable/ScreenWakeLock.webidl":"ede7e4df35aa6504551291b7b7dce3e3f60b6c857e2dfa6be6d1c98f1b592c20","webidls/unstable/Share.webidl":"9ecad3e9c8f85502c002d699452151503041beed11f9763f9fb8209802c2c702","webidls/unstable/ViewTransition.webidl":"45d751be41cfea4ccb9000bc456e27bd252314bc1a98a5069fda713befd83252","webidls/unstable/WebCodecs.webidl":"74e517302e935c4d99172fca3d3ca71b6dc7407f12ad109672cf99ac50f56ba1","webidls/unstable/WebGPU.webidl":"95bd3792994086a885d6892737f7cc590dd9fe48652fcd4f29a88d71b038f107","webidls/unstable/WebHID.webidl":"a8b6fc4f7801565026d310d8f06cad188faad9335ee8b6374b547410981c5978","webidls/unstable/WebSerial.webidl":"7f4c5f90647084e9afede44f9874d513a714d46fea6769095313e07fbe4366ce","webidls/unstable/WebTransport.webidl":"24df187fbb64b43a20b8650ea6e9543403e7f54b919108b4b86a6a7108e5f5fc","webidls/unstable/WebUSB.webidl":"c09980878e761daadd0793838dbf924998bc71621652d6fd41b5248f0df973d9","webidls/unstable/WebXRDevice.webidl":"bc43fe1f2aa0f099aea3be7b221007a2187a1a8b5f54cec5feab6f2cc754527c","webidls/unstable/WebXRGamepadsModule.webidl":"44910c516b1d3d63837994c4c721317cabf1a574b312efa1b89ed23651828c50","webidls/unstable/WebXRHandInputModule.webidl":"7d112e58485ed2f5a1b7389806018ac06181763557374b7d63bc5727254fade9","webidls/unstable/is-input-pending.webidl":"6314c3e79f6cec902bf1be616e644a6207f634938086e6446e5e7b3f0090a71d","webidls/unstable/scheduling-apis.webidl":"efa9de7e7429b699d72b4b39f0c6fd4be3cda2b7619665958cfd645b865c1701","webidls/unstable/weblock-apis.webidl":"0baab2f729c2782520432008a9afa424128f63c4e5baefec8ff910ee3fc2b33c"},"package":"58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed"} \ No newline at end of file diff --git a/vendor/web-sys/Cargo.toml b/vendor/web-sys/Cargo.toml index 5e458e8ed..f0c63790d 100644 --- a/vendor/web-sys/Cargo.toml +++ b/vendor/web-sys/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.57" name = "web-sys" -version = "0.3.66" +version = "0.3.67" authors = ["The wasm-bindgen Developers"] description = """ Bindings for all Web APIs, a procedurally generated crate from WebIDL @@ -34,10 +34,10 @@ test = false doctest = false [dependencies.js-sys] -version = "0.3.66" +version = "0.3.67" [dependencies.wasm-bindgen] -version = "0.2.89" +version = "0.2.90" [features] AbortController = [] @@ -273,6 +273,8 @@ CompositionEvent = [ "UiEvent", ] CompositionEventInit = [] +CompressionFormat = [] +CompressionStream = [] ComputedEffectTiming = [] ConnStatusDict = [] ConnectionType = [] @@ -362,6 +364,7 @@ DataTransferItemList = [] DateTimeValue = [] DecoderDoctorNotification = [] DecoderDoctorNotificationType = [] +DecompressionStream = [] DedicatedWorkerGlobalScope = [ "EventTarget", "WorkerGlobalScope", @@ -530,7 +533,6 @@ FileSystemSyncAccessHandle = [] FileSystemWritableFileStream = ["WritableStream"] FillMode = [] FlashClassification = [] -FlexLineGrowthState = [] FlowControlType = [] FocusEvent = [ "Event", @@ -708,8 +710,6 @@ GpuVertexBufferLayout = [] GpuVertexFormat = [] GpuVertexState = [] GpuVertexStepMode = [] -GridDeclaration = [] -GridTrackState = [] GroupedHistoryEventInit = [] HalfOpenInfoDict = [] HardwareAcceleration = [] @@ -1233,7 +1233,6 @@ InputEvent = [ "UiEvent", ] InputEventInit = [] -InstallTriggerData = [] IntersectionObserver = [] IntersectionObserverEntry = [] IntersectionObserverEntryInit = [] @@ -1660,7 +1659,6 @@ RtcIdentityProviderOptions = [] RtcIdentityProviderRegistrar = [] RtcIdentityValidationResult = [] RtcInboundRtpStreamStats = [] -RtcLifecycleEvent = [] RtcMediaStreamStats = [] RtcMediaStreamTrackStats = [] RtcOfferAnswerOptions = [] @@ -1672,9 +1670,12 @@ RtcPeerConnectionIceEventInit = [] RtcPeerConnectionState = [] RtcPriorityType = [] RtcRtcpParameters = [] +RtcRtpCapabilities = [] +RtcRtpCodecCapability = [] RtcRtpCodecParameters = [] RtcRtpContributingSource = [] RtcRtpEncodingParameters = [] +RtcRtpHeaderExtensionCapability = [] RtcRtpHeaderExtensionParameters = [] RtcRtpParameters = [] RtcRtpReceiver = [] @@ -2431,6 +2432,7 @@ UsbPermissionStorage = [] UsbRecipient = [] UsbRequestType = [] UsbTransferStatus = [] +UserActivation = [] UserProximityEvent = ["Event"] UserProximityEventInit = [] UserVerificationRequirement = [] @@ -2554,7 +2556,6 @@ WebglDepthTexture = [] WebglDrawBuffers = [] WebglLoseContext = [] WebglMultiDraw = [] -WebrtcGlobalStatisticsReport = [] WgslLanguageFeatures = [] WheelEvent = [ "Event", @@ -2665,7 +2666,7 @@ gpu_shader_stage = [] gpu_texture_usage = [] [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-futures] -version = "0.4.39" +version = "0.4.40" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-test] -version = "0.3.39" +version = "0.3.40" diff --git a/vendor/web-sys/src/features/gen_CompressionFormat.rs b/vendor/web-sys/src/features/gen_CompressionFormat.rs new file mode 100644 index 000000000..1ee2070cd --- /dev/null +++ b/vendor/web-sys/src/features/gen_CompressionFormat.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `CompressionFormat` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `CompressionFormat`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CompressionFormat { + Deflate = "deflate", + DeflateRaw = "deflate-raw", + Gzip = "gzip", +} diff --git a/vendor/web-sys/src/features/gen_CompressionStream.rs b/vendor/web-sys/src/features/gen_CompressionStream.rs new file mode 100644 index 000000000..9db5f808c --- /dev/null +++ b/vendor/web-sys/src/features/gen_CompressionStream.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CompressionStream , typescript_type = "CompressionStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CompressionStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type CompressionStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "CompressionStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &CompressionStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "CompressionStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &CompressionStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompressionFormat")] + #[wasm_bindgen(catch, constructor, js_class = "CompressionStream")] + #[doc = "The `new CompressionStream(..)` constructor, creating a new instance of `CompressionStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/CompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionFormat`, `CompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: CompressionFormat) -> Result; +} diff --git a/vendor/web-sys/src/features/gen_DecompressionStream.rs b/vendor/web-sys/src/features/gen_DecompressionStream.rs new file mode 100644 index 000000000..e7807ab98 --- /dev/null +++ b/vendor/web-sys/src/features/gen_DecompressionStream.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DecompressionStream , typescript_type = "DecompressionStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `DecompressionStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type DecompressionStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "DecompressionStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &DecompressionStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "DecompressionStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &DecompressionStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompressionFormat")] + #[wasm_bindgen(catch, constructor, js_class = "DecompressionStream")] + #[doc = "The `new DecompressionStream(..)` constructor, creating a new instance of `DecompressionStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/DecompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionFormat`, `DecompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: CompressionFormat) -> Result; +} diff --git a/vendor/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs b/vendor/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs index 76ebad998..b8a1f135e 100644 --- a/vendor/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs +++ b/vendor/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemCreateWritableOptions)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `FileSystemCreateWritableOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemCreateWritableOptions; } -#[cfg(web_sys_unstable_apis)] impl FileSystemCreateWritableOptions { #[doc = "Construct a new `FileSystemCreateWritableOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `keepExistingData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn keep_existing_data(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( @@ -50,7 +38,6 @@ impl FileSystemCreateWritableOptions { self } } -#[cfg(web_sys_unstable_apis)] impl Default for FileSystemCreateWritableOptions { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_FileSystemDirectoryHandle.rs b/vendor/web-sys/src/features/gen_FileSystemDirectoryHandle.rs index 9487482f3..cfac88f43 100644 --- a/vendor/web-sys/src/features/gen_FileSystemDirectoryHandle.rs +++ b/vendor/web-sys/src/features/gen_FileSystemDirectoryHandle.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = FileSystemHandle , extends = :: js_sys :: Object , js_name = FileSystemDirectoryHandle , typescript_type = "FileSystemDirectoryHandle")] @@ -12,22 +11,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemDirectoryHandle; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getDirectoryHandle)] #[doc = "The `getDirectoryHandle()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_directory_handle(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemGetDirectoryOptions")] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getDirectoryHandle)] #[doc = "The `getDirectoryHandle()` method."] @@ -35,26 +26,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemGetDirectoryOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_directory_handle_with_options( this: &FileSystemDirectoryHandle, name: &str, options: &FileSystemGetDirectoryOptions, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getFileHandle)] #[doc = "The `getFileHandle()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_file_handle(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemGetFileOptions")] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getFileHandle)] #[doc = "The `getFileHandle()` method."] @@ -62,26 +45,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemGetFileOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_file_handle_with_options( this: &FileSystemDirectoryHandle, name: &str, options: &FileSystemGetFileOptions, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = removeEntry)] #[doc = "The `removeEntry()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn remove_entry(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemRemoveOptions")] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = removeEntry)] #[doc = "The `removeEntry()` method."] @@ -89,24 +64,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemRemoveOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn remove_entry_with_options( this: &FileSystemDirectoryHandle, name: &str, options: &FileSystemRemoveOptions, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = resolve)] #[doc = "The `resolve()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn resolve( this: &FileSystemDirectoryHandle, possible_descendant: &FileSystemHandle, diff --git a/vendor/web-sys/src/features/gen_FileSystemFileHandle.rs b/vendor/web-sys/src/features/gen_FileSystemFileHandle.rs index c11c88e59..b22d79832 100644 --- a/vendor/web-sys/src/features/gen_FileSystemFileHandle.rs +++ b/vendor/web-sys/src/features/gen_FileSystemFileHandle.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = FileSystemHandle , extends = :: js_sys :: Object , js_name = FileSystemFileHandle , typescript_type = "FileSystemFileHandle")] @@ -12,33 +11,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemFileHandle; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createSyncAccessHandle)] #[doc = "The `createSyncAccessHandle()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create_sync_access_handle(this: &FileSystemFileHandle) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createWritable)] #[doc = "The `createWritable()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create_writable(this: &FileSystemFileHandle) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemCreateWritableOptions")] # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createWritable)] #[doc = "The `createWritable()` method."] @@ -46,22 +33,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`, `FileSystemFileHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create_writable_with_options( this: &FileSystemFileHandle, options: &FileSystemCreateWritableOptions, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = getFile)] #[doc = "The `getFile()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_file(this: &FileSystemFileHandle) -> ::js_sys::Promise; } diff --git a/vendor/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs b/vendor/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs index a26ba7356..e5f3e136a 100644 --- a/vendor/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs +++ b/vendor/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemGetDirectoryOptions)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `FileSystemGetDirectoryOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemGetDirectoryOptions; } -#[cfg(web_sys_unstable_apis)] impl FileSystemGetDirectoryOptions { #[doc = "Construct a new `FileSystemGetDirectoryOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `create` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = @@ -47,7 +35,6 @@ impl FileSystemGetDirectoryOptions { self } } -#[cfg(web_sys_unstable_apis)] impl Default for FileSystemGetDirectoryOptions { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_FileSystemGetFileOptions.rs b/vendor/web-sys/src/features/gen_FileSystemGetFileOptions.rs index 08dbf37c6..8cc7a410c 100644 --- a/vendor/web-sys/src/features/gen_FileSystemGetFileOptions.rs +++ b/vendor/web-sys/src/features/gen_FileSystemGetFileOptions.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemGetFileOptions)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `FileSystemGetFileOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemGetFileOptions; } -#[cfg(web_sys_unstable_apis)] impl FileSystemGetFileOptions { #[doc = "Construct a new `FileSystemGetFileOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `create` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn create(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = @@ -47,7 +35,6 @@ impl FileSystemGetFileOptions { self } } -#[cfg(web_sys_unstable_apis)] impl Default for FileSystemGetFileOptions { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_FileSystemHandle.rs b/vendor/web-sys/src/features/gen_FileSystemHandle.rs index 35e9b66bb..6a019fe67 100644 --- a/vendor/web-sys/src/features/gen_FileSystemHandle.rs +++ b/vendor/web-sys/src/features/gen_FileSystemHandle.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemHandle , typescript_type = "FileSystemHandle")] @@ -12,11 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemHandle; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemHandleKind")] # [wasm_bindgen (structural , method , getter , js_class = "FileSystemHandle" , js_name = kind)] #[doc = "Getter for the `kind` field of this object."] @@ -24,30 +19,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/kind)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemHandleKind`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn kind(this: &FileSystemHandle) -> FileSystemHandleKind; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "FileSystemHandle" , js_name = name)] #[doc = "Getter for the `name` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn name(this: &FileSystemHandle) -> String; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = isSameEntry)] #[doc = "The `isSameEntry()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/isSameEntry)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn is_same_entry(this: &FileSystemHandle, other: &FileSystemHandle) -> ::js_sys::Promise; } diff --git a/vendor/web-sys/src/features/gen_FileSystemHandleKind.rs b/vendor/web-sys/src/features/gen_FileSystemHandleKind.rs index 8dfa38a30..4cb6fdb6f 100644 --- a/vendor/web-sys/src/features/gen_FileSystemHandleKind.rs +++ b/vendor/web-sys/src/features/gen_FileSystemHandleKind.rs @@ -1,14 +1,10 @@ #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] #[doc = "The `FileSystemHandleKind` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemHandleKind`*"] -#[doc = ""] -#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] -#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum FileSystemHandleKind { File = "file", diff --git a/vendor/web-sys/src/features/gen_FileSystemReadWriteOptions.rs b/vendor/web-sys/src/features/gen_FileSystemReadWriteOptions.rs index 1188a945f..209b2af44 100644 --- a/vendor/web-sys/src/features/gen_FileSystemReadWriteOptions.rs +++ b/vendor/web-sys/src/features/gen_FileSystemReadWriteOptions.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemReadWriteOptions)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `FileSystemReadWriteOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemReadWriteOptions; } -#[cfg(web_sys_unstable_apis)] impl FileSystemReadWriteOptions { #[doc = "Construct a new `FileSystemReadWriteOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `at` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn at(&mut self, val: f64) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("at"), &JsValue::from(val)); @@ -46,7 +34,6 @@ impl FileSystemReadWriteOptions { self } } -#[cfg(web_sys_unstable_apis)] impl Default for FileSystemReadWriteOptions { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_FileSystemRemoveOptions.rs b/vendor/web-sys/src/features/gen_FileSystemRemoveOptions.rs index a0e895dfc..3f81a31ce 100644 --- a/vendor/web-sys/src/features/gen_FileSystemRemoveOptions.rs +++ b/vendor/web-sys/src/features/gen_FileSystemRemoveOptions.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemRemoveOptions)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `FileSystemRemoveOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemRemoveOptions; } -#[cfg(web_sys_unstable_apis)] impl FileSystemRemoveOptions { #[doc = "Construct a new `FileSystemRemoveOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `recursive` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn recursive(&mut self, val: bool) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( @@ -50,7 +38,6 @@ impl FileSystemRemoveOptions { self } } -#[cfg(web_sys_unstable_apis)] impl Default for FileSystemRemoveOptions { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs b/vendor/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs index 8b293264f..beaac4a12 100644 --- a/vendor/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs +++ b/vendor/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemSyncAccessHandle , typescript_type = "FileSystemSyncAccessHandle")] @@ -12,72 +11,48 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemSyncAccessHandle; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &FileSystemSyncAccessHandle); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = flush)] #[doc = "The `flush()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/flush)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn flush(this: &FileSystemSyncAccessHandle) -> Result<(), JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = getSize)] #[doc = "The `getSize()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/getSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_size(this: &FileSystemSyncAccessHandle) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_buffer_source( this: &FileSystemSyncAccessHandle, buffer: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array( this: &FileSystemSyncAccessHandle, buffer: &mut [u8], ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemReadWriteOptions")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] #[doc = "The `read()` method."] @@ -85,15 +60,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_buffer_source_and_options( this: &FileSystemSyncAccessHandle, buffer: &::js_sys::Object, options: &FileSystemReadWriteOptions, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemReadWriteOptions")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] #[doc = "The `read()` method."] @@ -101,71 +72,51 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array_and_options( this: &FileSystemSyncAccessHandle, buffer: &mut [u8], options: &FileSystemReadWriteOptions, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = truncate)] #[doc = "The `truncate()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn truncate_with_u32( this: &FileSystemSyncAccessHandle, new_size: u32, ) -> Result<(), JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = truncate)] #[doc = "The `truncate()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn truncate_with_f64( this: &FileSystemSyncAccessHandle, new_size: f64, ) -> Result<(), JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_buffer_source( this: &FileSystemSyncAccessHandle, buffer: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_u8_array( this: &FileSystemSyncAccessHandle, buffer: &[u8], ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemReadWriteOptions")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] #[doc = "The `write()` method."] @@ -173,15 +124,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_buffer_source_and_options( this: &FileSystemSyncAccessHandle, buffer: &::js_sys::Object, options: &FileSystemReadWriteOptions, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "FileSystemReadWriteOptions")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] #[doc = "The `write()` method."] @@ -189,9 +136,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_u8_array_and_options( this: &FileSystemSyncAccessHandle, buffer: &[u8], diff --git a/vendor/web-sys/src/features/gen_FileSystemWritableFileStream.rs b/vendor/web-sys/src/features/gen_FileSystemWritableFileStream.rs index 56f113261..8732dfc27 100644 --- a/vendor/web-sys/src/features/gen_FileSystemWritableFileStream.rs +++ b/vendor/web-sys/src/features/gen_FileSystemWritableFileStream.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = WritableStream , extends = :: js_sys :: Object , js_name = FileSystemWritableFileStream , typescript_type = "FileSystemWritableFileStream")] @@ -12,95 +11,67 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type FileSystemWritableFileStream; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = seek)] #[doc = "The `seek()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn seek_with_u32( this: &FileSystemWritableFileStream, position: u32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = seek)] #[doc = "The `seek()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn seek_with_f64( this: &FileSystemWritableFileStream, position: f64, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = truncate)] #[doc = "The `truncate()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn truncate_with_u32( this: &FileSystemWritableFileStream, size: u32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = truncate)] #[doc = "The `truncate()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn truncate_with_f64( this: &FileSystemWritableFileStream, size: f64, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_buffer_source( this: &FileSystemWritableFileStream, data: &::js_sys::Object, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_u8_array( this: &FileSystemWritableFileStream, data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] @@ -108,28 +79,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_blob( this: &FileSystemWritableFileStream, data: &Blob, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_str( this: &FileSystemWritableFileStream, data: &str, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WriteParams")] # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] @@ -137,9 +100,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`, `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_write_params( this: &FileSystemWritableFileStream, data: &WriteParams, diff --git a/vendor/web-sys/src/features/gen_FlexLineGrowthState.rs b/vendor/web-sys/src/features/gen_FlexLineGrowthState.rs deleted file mode 100644 index 8b4bd3fd9..000000000 --- a/vendor/web-sys/src/features/gen_FlexLineGrowthState.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `FlexLineGrowthState` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `FlexLineGrowthState`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum FlexLineGrowthState { - Unchanged = "unchanged", - Shrinking = "shrinking", - Growing = "growing", -} diff --git a/vendor/web-sys/src/features/gen_GridDeclaration.rs b/vendor/web-sys/src/features/gen_GridDeclaration.rs deleted file mode 100644 index c01e2adba..000000000 --- a/vendor/web-sys/src/features/gen_GridDeclaration.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `GridDeclaration` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GridDeclaration`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GridDeclaration { - Explicit = "explicit", - Implicit = "implicit", -} diff --git a/vendor/web-sys/src/features/gen_GridTrackState.rs b/vendor/web-sys/src/features/gen_GridTrackState.rs deleted file mode 100644 index c3c43cf55..000000000 --- a/vendor/web-sys/src/features/gen_GridTrackState.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `GridTrackState` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GridTrackState`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GridTrackState { - Static = "static", - Repeat = "repeat", - Removed = "removed", -} diff --git a/vendor/web-sys/src/features/gen_HtmlFormElement.rs b/vendor/web-sys/src/features/gen_HtmlFormElement.rs index aad396637..474500098 100644 --- a/vendor/web-sys/src/features/gen_HtmlFormElement.rs +++ b/vendor/web-sys/src/features/gen_HtmlFormElement.rs @@ -167,6 +167,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] pub fn report_validity(this: &HtmlFormElement) -> bool; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit(this: &HtmlFormElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit_with_submitter( + this: &HtmlFormElement, + submitter: Option<&HtmlElement>, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "HTMLFormElement" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] diff --git a/vendor/web-sys/src/features/gen_InstallTriggerData.rs b/vendor/web-sys/src/features/gen_InstallTriggerData.rs deleted file mode 100644 index 44c494c56..000000000 --- a/vendor/web-sys/src/features/gen_InstallTriggerData.rs +++ /dev/null @@ -1,71 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = InstallTriggerData)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `InstallTriggerData` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub type InstallTriggerData; -} -impl InstallTriggerData { - #[doc = "Construct a new `InstallTriggerData`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `Hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn hash(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("Hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `IconURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn icon_url(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("IconURL"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `URL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("URL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for InstallTriggerData { - fn default() -> Self { - Self::new() - } -} diff --git a/vendor/web-sys/src/features/gen_Navigator.rs b/vendor/web-sys/src/features/gen_Navigator.rs index 17197347d..a9b499e6d 100644 --- a/vendor/web-sys/src/features/gen_Navigator.rs +++ b/vendor/web-sys/src/features/gen_Navigator.rs @@ -105,6 +105,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialsContainer`, `Navigator`*"] pub fn credentials(this: &Navigator) -> CredentialsContainer; + #[cfg(feature = "UserActivation")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = userActivation)] + #[doc = "Getter for the `userActivation` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userActivation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`, `UserActivation`*"] + pub fn user_activation(this: &Navigator) -> UserActivation; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Bluetooth")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = bluetooth)] diff --git a/vendor/web-sys/src/features/gen_QueuingStrategy.rs b/vendor/web-sys/src/features/gen_QueuingStrategy.rs index a92cca58a..aec86360b 100644 --- a/vendor/web-sys/src/features/gen_QueuingStrategy.rs +++ b/vendor/web-sys/src/features/gen_QueuingStrategy.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategy)] @@ -10,31 +9,20 @@ extern "C" { #[doc = "The `QueuingStrategy` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type QueuingStrategy; } -#[cfg(web_sys_unstable_apis)] impl QueuingStrategy { #[doc = "Construct a new `QueuingStrategy`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `highWaterMark` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn high_water_mark(&mut self, val: f64) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( @@ -49,13 +37,9 @@ impl QueuingStrategy { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `size` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn size(&mut self, val: &::js_sys::Function) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); @@ -67,7 +51,6 @@ impl QueuingStrategy { self } } -#[cfg(web_sys_unstable_apis)] impl Default for QueuingStrategy { fn default() -> Self { Self::new() diff --git a/vendor/web-sys/src/features/gen_ReadableStream.rs b/vendor/web-sys/src/features/gen_ReadableStream.rs index 05e41cd9d..77a44341a 100644 --- a/vendor/web-sys/src/features/gen_ReadableStream.rs +++ b/vendor/web-sys/src/features/gen_ReadableStream.rs @@ -19,31 +19,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] pub fn locked(this: &ReadableStream) -> bool; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_source( underlying_source: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] @@ -51,9 +42,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_source_and_strategy( underlying_source: &::js_sys::Object, strategy: &QueuingStrategy, diff --git a/vendor/web-sys/src/features/gen_RtcLifecycleEvent.rs b/vendor/web-sys/src/features/gen_RtcLifecycleEvent.rs deleted file mode 100644 index 98fd2a54e..000000000 --- a/vendor/web-sys/src/features/gen_RtcLifecycleEvent.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `RtcLifecycleEvent` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `RtcLifecycleEvent`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum RtcLifecycleEvent { - Initialized = "initialized", - Icegatheringstatechange = "icegatheringstatechange", - Iceconnectionstatechange = "iceconnectionstatechange", -} diff --git a/vendor/web-sys/src/features/gen_RtcRtpCapabilities.rs b/vendor/web-sys/src/features/gen_RtcRtpCapabilities.rs new file mode 100644 index 000000000..872d90d0b --- /dev/null +++ b/vendor/web-sys/src/features/gen_RtcRtpCapabilities.rs @@ -0,0 +1,59 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCapabilities)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpCapabilities` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub type RtcRtpCapabilities; +} +impl RtcRtpCapabilities { + #[doc = "Construct a new `RtcRtpCapabilities`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub fn new( + codecs: &::wasm_bindgen::JsValue, + header_extensions: &::wasm_bindgen::JsValue, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.codecs(codecs); + ret.header_extensions(header_extensions); + ret + } + #[doc = "Change the `codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codecs"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `headerExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("headerExtensions"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/vendor/web-sys/src/features/gen_RtcRtpCodecCapability.rs b/vendor/web-sys/src/features/gen_RtcRtpCodecCapability.rs new file mode 100644 index 000000000..1b8730d70 --- /dev/null +++ b/vendor/web-sys/src/features/gen_RtcRtpCodecCapability.rs @@ -0,0 +1,93 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCodecCapability)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpCodecCapability` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub type RtcRtpCodecCapability; +} +impl RtcRtpCodecCapability { + #[doc = "Construct a new `RtcRtpCodecCapability`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn new(clock_rate: u32, mime_type: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.clock_rate(clock_rate); + ret.mime_type(mime_type); + ret + } + #[doc = "Change the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn channels(&mut self, val: u16) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("channels"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn clock_rate(&mut self, val: u32) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("clockRate"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn mime_type(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mimeType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `sdpFmtpLine` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("sdpFmtpLine"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/vendor/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs b/vendor/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs new file mode 100644 index 000000000..de9ec5599 --- /dev/null +++ b/vendor/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpHeaderExtensionCapability)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpHeaderExtensionCapability` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + pub type RtcRtpHeaderExtensionCapability; +} +impl RtcRtpHeaderExtensionCapability { + #[doc = "Construct a new `RtcRtpHeaderExtensionCapability`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + pub fn new(uri: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.uri(uri); + ret + } + #[doc = "Change the `uri` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + pub fn uri(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uri"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/vendor/web-sys/src/features/gen_RtcRtpSender.rs b/vendor/web-sys/src/features/gen_RtcRtpSender.rs index 714521c0d..8cdd9d5d6 100644 --- a/vendor/web-sys/src/features/gen_RtcRtpSender.rs +++ b/vendor/web-sys/src/features/gen_RtcRtpSender.rs @@ -28,6 +28,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`, `RtcdtmfSender`*"] pub fn dtmf(this: &RtcRtpSender) -> Option; + #[cfg(feature = "RtcRtpCapabilities")] + # [wasm_bindgen (static_method_of = RtcRtpSender , js_class = "RTCRtpSender" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/getCapabilities)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`, `RtcRtpSender`*"] + pub fn get_capabilities(kind: &str) -> Option; #[cfg(feature = "RtcRtpParameters")] # [wasm_bindgen (method , structural , js_class = "RTCRtpSender" , js_name = getParameters)] #[doc = "The `getParameters()` method."] diff --git a/vendor/web-sys/src/features/gen_StorageManager.rs b/vendor/web-sys/src/features/gen_StorageManager.rs index 1c10d7610..2bb5782eb 100644 --- a/vendor/web-sys/src/features/gen_StorageManager.rs +++ b/vendor/web-sys/src/features/gen_StorageManager.rs @@ -19,16 +19,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageManager`*"] pub fn estimate(this: &StorageManager) -> Result<::js_sys::Promise, JsValue>; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "StorageManager" , js_name = getDirectory)] #[doc = "The `getDirectory()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/getDirectory)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageManager`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_directory(this: &StorageManager) -> ::js_sys::Promise; # [wasm_bindgen (catch , method , structural , js_class = "StorageManager" , js_name = persist)] #[doc = "The `persist()` method."] diff --git a/vendor/web-sys/src/features/gen_TransformStream.rs b/vendor/web-sys/src/features/gen_TransformStream.rs index d9882d7b8..8fd7aff7c 100644 --- a/vendor/web-sys/src/features/gen_TransformStream.rs +++ b/vendor/web-sys/src/features/gen_TransformStream.rs @@ -28,30 +28,21 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] pub fn writable(this: &TransformStream) -> WritableStream; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer(transformer: &::js_sys::Object) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] @@ -59,14 +50,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer_and_writable_strategy( transformer: &::js_sys::Object, writable_strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] @@ -74,9 +61,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer_and_writable_strategy_and_readable_strategy( transformer: &::js_sys::Object, writable_strategy: &QueuingStrategy, diff --git a/vendor/web-sys/src/features/gen_UserActivation.rs b/vendor/web-sys/src/features/gen_UserActivation.rs new file mode 100644 index 000000000..deef4a5ce --- /dev/null +++ b/vendor/web-sys/src/features/gen_UserActivation.rs @@ -0,0 +1,29 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UserActivation , typescript_type = "UserActivation")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UserActivation` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub type UserActivation; + # [wasm_bindgen (structural , method , getter , js_class = "UserActivation" , js_name = hasBeenActive)] + #[doc = "Getter for the `hasBeenActive` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/hasBeenActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub fn has_been_active(this: &UserActivation) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "UserActivation" , js_name = isActive)] + #[doc = "Getter for the `isActive` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/isActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub fn is_active(this: &UserActivation) -> bool; +} diff --git a/vendor/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs b/vendor/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs deleted file mode 100644 index a06f06ede..000000000 --- a/vendor/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebrtcGlobalStatisticsReport)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `WebrtcGlobalStatisticsReport` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub type WebrtcGlobalStatisticsReport; -} -impl WebrtcGlobalStatisticsReport { - #[doc = "Construct a new `WebrtcGlobalStatisticsReport`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `reports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub fn reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for WebrtcGlobalStatisticsReport { - fn default() -> Self { - Self::new() - } -} diff --git a/vendor/web-sys/src/features/gen_WritableStream.rs b/vendor/web-sys/src/features/gen_WritableStream.rs index c831b1237..f4943b466 100644 --- a/vendor/web-sys/src/features/gen_WritableStream.rs +++ b/vendor/web-sys/src/features/gen_WritableStream.rs @@ -19,31 +19,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] pub fn locked(this: &WritableStream) -> bool; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_sink( underlying_sink: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] @@ -51,9 +42,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_sink_and_strategy( underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, diff --git a/vendor/web-sys/src/features/gen_WriteCommandType.rs b/vendor/web-sys/src/features/gen_WriteCommandType.rs index 7a4f3684c..eb962259d 100644 --- a/vendor/web-sys/src/features/gen_WriteCommandType.rs +++ b/vendor/web-sys/src/features/gen_WriteCommandType.rs @@ -1,14 +1,10 @@ #![allow(unused_imports)] #![allow(clippy::all)] use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] #[doc = "The `WriteCommandType` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`*"] -#[doc = ""] -#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] -#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WriteCommandType { Write = "write", diff --git a/vendor/web-sys/src/features/gen_WriteParams.rs b/vendor/web-sys/src/features/gen_WriteParams.rs index a142040f8..06af78da2 100644 --- a/vendor/web-sys/src/features/gen_WriteParams.rs +++ b/vendor/web-sys/src/features/gen_WriteParams.rs @@ -2,7 +2,6 @@ #![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WriteParams)] @@ -10,33 +9,22 @@ extern "C" { #[doc = "The `WriteParams` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WriteParams; } -#[cfg(web_sys_unstable_apis)] impl WriteParams { #[cfg(feature = "WriteCommandType")] #[doc = "Construct a new `WriteParams`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(type_: WriteCommandType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret.type_(type_); ret } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn data(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); @@ -47,13 +35,9 @@ impl WriteParams { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `position` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn position(&mut self, val: Option) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( @@ -68,13 +52,9 @@ impl WriteParams { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[doc = "Change the `size` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn size(&mut self, val: Option) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); @@ -85,14 +65,10 @@ impl WriteParams { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WriteCommandType")] #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn type_(&mut self, val: WriteCommandType) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); diff --git a/vendor/web-sys/src/features/mod.rs b/vendor/web-sys/src/features/mod.rs index 16189dcc6..cc817704a 100644 --- a/vendor/web-sys/src/features/mod.rs +++ b/vendor/web-sys/src/features/mod.rs @@ -2,9520 +2,11114 @@ #[allow(non_snake_case)] mod gen_AbortController; #[cfg(feature = "AbortController")] +#[allow(unused_imports)] pub use gen_AbortController::*; #[cfg(feature = "AbortSignal")] #[allow(non_snake_case)] mod gen_AbortSignal; #[cfg(feature = "AbortSignal")] +#[allow(unused_imports)] pub use gen_AbortSignal::*; #[cfg(feature = "AddEventListenerOptions")] #[allow(non_snake_case)] mod gen_AddEventListenerOptions; #[cfg(feature = "AddEventListenerOptions")] +#[allow(unused_imports)] pub use gen_AddEventListenerOptions::*; #[cfg(feature = "AesCbcParams")] #[allow(non_snake_case)] mod gen_AesCbcParams; #[cfg(feature = "AesCbcParams")] +#[allow(unused_imports)] pub use gen_AesCbcParams::*; #[cfg(feature = "AesCtrParams")] #[allow(non_snake_case)] mod gen_AesCtrParams; #[cfg(feature = "AesCtrParams")] +#[allow(unused_imports)] pub use gen_AesCtrParams::*; #[cfg(feature = "AesDerivedKeyParams")] #[allow(non_snake_case)] mod gen_AesDerivedKeyParams; #[cfg(feature = "AesDerivedKeyParams")] +#[allow(unused_imports)] pub use gen_AesDerivedKeyParams::*; #[cfg(feature = "AesGcmParams")] #[allow(non_snake_case)] mod gen_AesGcmParams; #[cfg(feature = "AesGcmParams")] +#[allow(unused_imports)] pub use gen_AesGcmParams::*; #[cfg(feature = "AesKeyAlgorithm")] #[allow(non_snake_case)] mod gen_AesKeyAlgorithm; #[cfg(feature = "AesKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_AesKeyAlgorithm::*; #[cfg(feature = "AesKeyGenParams")] #[allow(non_snake_case)] mod gen_AesKeyGenParams; #[cfg(feature = "AesKeyGenParams")] +#[allow(unused_imports)] pub use gen_AesKeyGenParams::*; #[cfg(feature = "Algorithm")] #[allow(non_snake_case)] mod gen_Algorithm; #[cfg(feature = "Algorithm")] +#[allow(unused_imports)] pub use gen_Algorithm::*; #[cfg(feature = "AlignSetting")] #[allow(non_snake_case)] mod gen_AlignSetting; #[cfg(feature = "AlignSetting")] +#[allow(unused_imports)] pub use gen_AlignSetting::*; #[cfg(feature = "AllowedBluetoothDevice")] #[allow(non_snake_case)] mod gen_AllowedBluetoothDevice; #[cfg(feature = "AllowedBluetoothDevice")] +#[allow(unused_imports)] pub use gen_AllowedBluetoothDevice::*; #[cfg(feature = "AllowedUsbDevice")] #[allow(non_snake_case)] mod gen_AllowedUsbDevice; #[cfg(feature = "AllowedUsbDevice")] +#[allow(unused_imports)] pub use gen_AllowedUsbDevice::*; #[cfg(feature = "AlphaOption")] #[allow(non_snake_case)] mod gen_AlphaOption; #[cfg(feature = "AlphaOption")] +#[allow(unused_imports)] pub use gen_AlphaOption::*; #[cfg(feature = "AnalyserNode")] #[allow(non_snake_case)] mod gen_AnalyserNode; #[cfg(feature = "AnalyserNode")] +#[allow(unused_imports)] pub use gen_AnalyserNode::*; #[cfg(feature = "AnalyserOptions")] #[allow(non_snake_case)] mod gen_AnalyserOptions; #[cfg(feature = "AnalyserOptions")] +#[allow(unused_imports)] pub use gen_AnalyserOptions::*; #[cfg(feature = "AngleInstancedArrays")] #[allow(non_snake_case)] mod gen_AngleInstancedArrays; #[cfg(feature = "AngleInstancedArrays")] +#[allow(unused_imports)] pub use gen_AngleInstancedArrays::*; #[cfg(feature = "Animation")] #[allow(non_snake_case)] mod gen_Animation; #[cfg(feature = "Animation")] +#[allow(unused_imports)] pub use gen_Animation::*; #[cfg(feature = "AnimationEffect")] #[allow(non_snake_case)] mod gen_AnimationEffect; #[cfg(feature = "AnimationEffect")] +#[allow(unused_imports)] pub use gen_AnimationEffect::*; #[cfg(feature = "AnimationEvent")] #[allow(non_snake_case)] mod gen_AnimationEvent; #[cfg(feature = "AnimationEvent")] +#[allow(unused_imports)] pub use gen_AnimationEvent::*; #[cfg(feature = "AnimationEventInit")] #[allow(non_snake_case)] mod gen_AnimationEventInit; #[cfg(feature = "AnimationEventInit")] +#[allow(unused_imports)] pub use gen_AnimationEventInit::*; #[cfg(feature = "AnimationPlayState")] #[allow(non_snake_case)] mod gen_AnimationPlayState; #[cfg(feature = "AnimationPlayState")] +#[allow(unused_imports)] pub use gen_AnimationPlayState::*; #[cfg(feature = "AnimationPlaybackEvent")] #[allow(non_snake_case)] mod gen_AnimationPlaybackEvent; #[cfg(feature = "AnimationPlaybackEvent")] +#[allow(unused_imports)] pub use gen_AnimationPlaybackEvent::*; #[cfg(feature = "AnimationPlaybackEventInit")] #[allow(non_snake_case)] mod gen_AnimationPlaybackEventInit; #[cfg(feature = "AnimationPlaybackEventInit")] +#[allow(unused_imports)] pub use gen_AnimationPlaybackEventInit::*; #[cfg(feature = "AnimationPropertyDetails")] #[allow(non_snake_case)] mod gen_AnimationPropertyDetails; #[cfg(feature = "AnimationPropertyDetails")] +#[allow(unused_imports)] pub use gen_AnimationPropertyDetails::*; #[cfg(feature = "AnimationPropertyValueDetails")] #[allow(non_snake_case)] mod gen_AnimationPropertyValueDetails; #[cfg(feature = "AnimationPropertyValueDetails")] +#[allow(unused_imports)] pub use gen_AnimationPropertyValueDetails::*; #[cfg(feature = "AnimationTimeline")] #[allow(non_snake_case)] mod gen_AnimationTimeline; #[cfg(feature = "AnimationTimeline")] +#[allow(unused_imports)] pub use gen_AnimationTimeline::*; #[cfg(feature = "AssignedNodesOptions")] #[allow(non_snake_case)] mod gen_AssignedNodesOptions; #[cfg(feature = "AssignedNodesOptions")] +#[allow(unused_imports)] pub use gen_AssignedNodesOptions::*; #[cfg(feature = "AttestationConveyancePreference")] #[allow(non_snake_case)] mod gen_AttestationConveyancePreference; #[cfg(feature = "AttestationConveyancePreference")] +#[allow(unused_imports)] pub use gen_AttestationConveyancePreference::*; #[cfg(feature = "Attr")] #[allow(non_snake_case)] mod gen_Attr; #[cfg(feature = "Attr")] +#[allow(unused_imports)] pub use gen_Attr::*; #[cfg(feature = "AttributeNameValue")] #[allow(non_snake_case)] mod gen_AttributeNameValue; #[cfg(feature = "AttributeNameValue")] +#[allow(unused_imports)] pub use gen_AttributeNameValue::*; #[cfg(feature = "AudioBuffer")] #[allow(non_snake_case)] mod gen_AudioBuffer; #[cfg(feature = "AudioBuffer")] +#[allow(unused_imports)] pub use gen_AudioBuffer::*; #[cfg(feature = "AudioBufferOptions")] #[allow(non_snake_case)] mod gen_AudioBufferOptions; #[cfg(feature = "AudioBufferOptions")] +#[allow(unused_imports)] pub use gen_AudioBufferOptions::*; #[cfg(feature = "AudioBufferSourceNode")] #[allow(non_snake_case)] mod gen_AudioBufferSourceNode; #[cfg(feature = "AudioBufferSourceNode")] +#[allow(unused_imports)] pub use gen_AudioBufferSourceNode::*; #[cfg(feature = "AudioBufferSourceOptions")] #[allow(non_snake_case)] mod gen_AudioBufferSourceOptions; #[cfg(feature = "AudioBufferSourceOptions")] +#[allow(unused_imports)] pub use gen_AudioBufferSourceOptions::*; #[cfg(feature = "AudioConfiguration")] #[allow(non_snake_case)] mod gen_AudioConfiguration; #[cfg(feature = "AudioConfiguration")] +#[allow(unused_imports)] pub use gen_AudioConfiguration::*; #[cfg(feature = "AudioContext")] #[allow(non_snake_case)] mod gen_AudioContext; #[cfg(feature = "AudioContext")] +#[allow(unused_imports)] pub use gen_AudioContext::*; #[cfg(feature = "AudioContextLatencyCategory")] #[allow(non_snake_case)] mod gen_AudioContextLatencyCategory; #[cfg(feature = "AudioContextLatencyCategory")] +#[allow(unused_imports)] pub use gen_AudioContextLatencyCategory::*; #[cfg(feature = "AudioContextOptions")] #[allow(non_snake_case)] mod gen_AudioContextOptions; #[cfg(feature = "AudioContextOptions")] +#[allow(unused_imports)] pub use gen_AudioContextOptions::*; #[cfg(feature = "AudioContextState")] #[allow(non_snake_case)] mod gen_AudioContextState; #[cfg(feature = "AudioContextState")] +#[allow(unused_imports)] pub use gen_AudioContextState::*; #[cfg(feature = "AudioData")] #[allow(non_snake_case)] mod gen_AudioData; #[cfg(feature = "AudioData")] +#[allow(unused_imports)] pub use gen_AudioData::*; #[cfg(feature = "AudioDataCopyToOptions")] #[allow(non_snake_case)] mod gen_AudioDataCopyToOptions; #[cfg(feature = "AudioDataCopyToOptions")] +#[allow(unused_imports)] pub use gen_AudioDataCopyToOptions::*; #[cfg(feature = "AudioDataInit")] #[allow(non_snake_case)] mod gen_AudioDataInit; #[cfg(feature = "AudioDataInit")] +#[allow(unused_imports)] pub use gen_AudioDataInit::*; #[cfg(feature = "AudioDecoder")] #[allow(non_snake_case)] mod gen_AudioDecoder; #[cfg(feature = "AudioDecoder")] +#[allow(unused_imports)] pub use gen_AudioDecoder::*; #[cfg(feature = "AudioDecoderConfig")] #[allow(non_snake_case)] mod gen_AudioDecoderConfig; #[cfg(feature = "AudioDecoderConfig")] +#[allow(unused_imports)] pub use gen_AudioDecoderConfig::*; #[cfg(feature = "AudioDecoderInit")] #[allow(non_snake_case)] mod gen_AudioDecoderInit; #[cfg(feature = "AudioDecoderInit")] +#[allow(unused_imports)] pub use gen_AudioDecoderInit::*; #[cfg(feature = "AudioDecoderSupport")] #[allow(non_snake_case)] mod gen_AudioDecoderSupport; #[cfg(feature = "AudioDecoderSupport")] +#[allow(unused_imports)] pub use gen_AudioDecoderSupport::*; #[cfg(feature = "AudioDestinationNode")] #[allow(non_snake_case)] mod gen_AudioDestinationNode; #[cfg(feature = "AudioDestinationNode")] +#[allow(unused_imports)] pub use gen_AudioDestinationNode::*; #[cfg(feature = "AudioEncoder")] #[allow(non_snake_case)] mod gen_AudioEncoder; #[cfg(feature = "AudioEncoder")] +#[allow(unused_imports)] pub use gen_AudioEncoder::*; #[cfg(feature = "AudioEncoderConfig")] #[allow(non_snake_case)] mod gen_AudioEncoderConfig; #[cfg(feature = "AudioEncoderConfig")] +#[allow(unused_imports)] pub use gen_AudioEncoderConfig::*; #[cfg(feature = "AudioEncoderInit")] #[allow(non_snake_case)] mod gen_AudioEncoderInit; #[cfg(feature = "AudioEncoderInit")] +#[allow(unused_imports)] pub use gen_AudioEncoderInit::*; #[cfg(feature = "AudioEncoderSupport")] #[allow(non_snake_case)] mod gen_AudioEncoderSupport; #[cfg(feature = "AudioEncoderSupport")] +#[allow(unused_imports)] pub use gen_AudioEncoderSupport::*; #[cfg(feature = "AudioListener")] #[allow(non_snake_case)] mod gen_AudioListener; #[cfg(feature = "AudioListener")] +#[allow(unused_imports)] pub use gen_AudioListener::*; #[cfg(feature = "AudioNode")] #[allow(non_snake_case)] mod gen_AudioNode; #[cfg(feature = "AudioNode")] +#[allow(unused_imports)] pub use gen_AudioNode::*; #[cfg(feature = "AudioNodeOptions")] #[allow(non_snake_case)] mod gen_AudioNodeOptions; #[cfg(feature = "AudioNodeOptions")] +#[allow(unused_imports)] pub use gen_AudioNodeOptions::*; #[cfg(feature = "AudioParam")] #[allow(non_snake_case)] mod gen_AudioParam; #[cfg(feature = "AudioParam")] +#[allow(unused_imports)] pub use gen_AudioParam::*; #[cfg(feature = "AudioParamMap")] #[allow(non_snake_case)] mod gen_AudioParamMap; #[cfg(feature = "AudioParamMap")] +#[allow(unused_imports)] pub use gen_AudioParamMap::*; #[cfg(feature = "AudioProcessingEvent")] #[allow(non_snake_case)] mod gen_AudioProcessingEvent; #[cfg(feature = "AudioProcessingEvent")] +#[allow(unused_imports)] pub use gen_AudioProcessingEvent::*; #[cfg(feature = "AudioSampleFormat")] #[allow(non_snake_case)] mod gen_AudioSampleFormat; #[cfg(feature = "AudioSampleFormat")] +#[allow(unused_imports)] pub use gen_AudioSampleFormat::*; #[cfg(feature = "AudioScheduledSourceNode")] #[allow(non_snake_case)] mod gen_AudioScheduledSourceNode; #[cfg(feature = "AudioScheduledSourceNode")] +#[allow(unused_imports)] pub use gen_AudioScheduledSourceNode::*; #[cfg(feature = "AudioSinkInfo")] #[allow(non_snake_case)] mod gen_AudioSinkInfo; #[cfg(feature = "AudioSinkInfo")] +#[allow(unused_imports)] pub use gen_AudioSinkInfo::*; #[cfg(feature = "AudioSinkOptions")] #[allow(non_snake_case)] mod gen_AudioSinkOptions; #[cfg(feature = "AudioSinkOptions")] +#[allow(unused_imports)] pub use gen_AudioSinkOptions::*; #[cfg(feature = "AudioSinkType")] #[allow(non_snake_case)] mod gen_AudioSinkType; #[cfg(feature = "AudioSinkType")] +#[allow(unused_imports)] pub use gen_AudioSinkType::*; #[cfg(feature = "AudioStreamTrack")] #[allow(non_snake_case)] mod gen_AudioStreamTrack; #[cfg(feature = "AudioStreamTrack")] +#[allow(unused_imports)] pub use gen_AudioStreamTrack::*; #[cfg(feature = "AudioTrack")] #[allow(non_snake_case)] mod gen_AudioTrack; #[cfg(feature = "AudioTrack")] +#[allow(unused_imports)] pub use gen_AudioTrack::*; #[cfg(feature = "AudioTrackList")] #[allow(non_snake_case)] mod gen_AudioTrackList; #[cfg(feature = "AudioTrackList")] +#[allow(unused_imports)] pub use gen_AudioTrackList::*; #[cfg(feature = "AudioWorklet")] #[allow(non_snake_case)] mod gen_AudioWorklet; #[cfg(feature = "AudioWorklet")] +#[allow(unused_imports)] pub use gen_AudioWorklet::*; #[cfg(feature = "AudioWorkletGlobalScope")] #[allow(non_snake_case)] mod gen_AudioWorkletGlobalScope; #[cfg(feature = "AudioWorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_AudioWorkletGlobalScope::*; #[cfg(feature = "AudioWorkletNode")] #[allow(non_snake_case)] mod gen_AudioWorkletNode; #[cfg(feature = "AudioWorkletNode")] +#[allow(unused_imports)] pub use gen_AudioWorkletNode::*; #[cfg(feature = "AudioWorkletNodeOptions")] #[allow(non_snake_case)] mod gen_AudioWorkletNodeOptions; #[cfg(feature = "AudioWorkletNodeOptions")] +#[allow(unused_imports)] pub use gen_AudioWorkletNodeOptions::*; #[cfg(feature = "AudioWorkletProcessor")] #[allow(non_snake_case)] mod gen_AudioWorkletProcessor; #[cfg(feature = "AudioWorkletProcessor")] +#[allow(unused_imports)] pub use gen_AudioWorkletProcessor::*; #[cfg(feature = "AuthenticationExtensionsClientInputs")] #[allow(non_snake_case)] mod gen_AuthenticationExtensionsClientInputs; #[cfg(feature = "AuthenticationExtensionsClientInputs")] +#[allow(unused_imports)] pub use gen_AuthenticationExtensionsClientInputs::*; #[cfg(feature = "AuthenticationExtensionsClientOutputs")] #[allow(non_snake_case)] mod gen_AuthenticationExtensionsClientOutputs; #[cfg(feature = "AuthenticationExtensionsClientOutputs")] +#[allow(unused_imports)] pub use gen_AuthenticationExtensionsClientOutputs::*; #[cfg(feature = "AuthenticatorAssertionResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorAssertionResponse; #[cfg(feature = "AuthenticatorAssertionResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorAssertionResponse::*; #[cfg(feature = "AuthenticatorAttachment")] #[allow(non_snake_case)] mod gen_AuthenticatorAttachment; #[cfg(feature = "AuthenticatorAttachment")] +#[allow(unused_imports)] pub use gen_AuthenticatorAttachment::*; #[cfg(feature = "AuthenticatorAttestationResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorAttestationResponse; #[cfg(feature = "AuthenticatorAttestationResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorAttestationResponse::*; #[cfg(feature = "AuthenticatorResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorResponse; #[cfg(feature = "AuthenticatorResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorResponse::*; #[cfg(feature = "AuthenticatorSelectionCriteria")] #[allow(non_snake_case)] mod gen_AuthenticatorSelectionCriteria; #[cfg(feature = "AuthenticatorSelectionCriteria")] +#[allow(unused_imports)] pub use gen_AuthenticatorSelectionCriteria::*; #[cfg(feature = "AuthenticatorTransport")] #[allow(non_snake_case)] mod gen_AuthenticatorTransport; #[cfg(feature = "AuthenticatorTransport")] +#[allow(unused_imports)] pub use gen_AuthenticatorTransport::*; #[cfg(feature = "AutoKeyword")] #[allow(non_snake_case)] mod gen_AutoKeyword; #[cfg(feature = "AutoKeyword")] +#[allow(unused_imports)] pub use gen_AutoKeyword::*; #[cfg(feature = "AutocompleteInfo")] #[allow(non_snake_case)] mod gen_AutocompleteInfo; #[cfg(feature = "AutocompleteInfo")] +#[allow(unused_imports)] pub use gen_AutocompleteInfo::*; #[cfg(feature = "BarProp")] #[allow(non_snake_case)] mod gen_BarProp; #[cfg(feature = "BarProp")] +#[allow(unused_imports)] pub use gen_BarProp::*; #[cfg(feature = "BaseAudioContext")] #[allow(non_snake_case)] mod gen_BaseAudioContext; #[cfg(feature = "BaseAudioContext")] +#[allow(unused_imports)] pub use gen_BaseAudioContext::*; #[cfg(feature = "BaseComputedKeyframe")] #[allow(non_snake_case)] mod gen_BaseComputedKeyframe; #[cfg(feature = "BaseComputedKeyframe")] +#[allow(unused_imports)] pub use gen_BaseComputedKeyframe::*; #[cfg(feature = "BaseKeyframe")] #[allow(non_snake_case)] mod gen_BaseKeyframe; #[cfg(feature = "BaseKeyframe")] +#[allow(unused_imports)] pub use gen_BaseKeyframe::*; #[cfg(feature = "BasePropertyIndexedKeyframe")] #[allow(non_snake_case)] mod gen_BasePropertyIndexedKeyframe; #[cfg(feature = "BasePropertyIndexedKeyframe")] +#[allow(unused_imports)] pub use gen_BasePropertyIndexedKeyframe::*; #[cfg(feature = "BasicCardRequest")] #[allow(non_snake_case)] mod gen_BasicCardRequest; #[cfg(feature = "BasicCardRequest")] +#[allow(unused_imports)] pub use gen_BasicCardRequest::*; #[cfg(feature = "BasicCardResponse")] #[allow(non_snake_case)] mod gen_BasicCardResponse; #[cfg(feature = "BasicCardResponse")] +#[allow(unused_imports)] pub use gen_BasicCardResponse::*; #[cfg(feature = "BasicCardType")] #[allow(non_snake_case)] mod gen_BasicCardType; #[cfg(feature = "BasicCardType")] +#[allow(unused_imports)] pub use gen_BasicCardType::*; #[cfg(feature = "BatteryManager")] #[allow(non_snake_case)] mod gen_BatteryManager; #[cfg(feature = "BatteryManager")] +#[allow(unused_imports)] pub use gen_BatteryManager::*; #[cfg(feature = "BeforeUnloadEvent")] #[allow(non_snake_case)] mod gen_BeforeUnloadEvent; #[cfg(feature = "BeforeUnloadEvent")] +#[allow(unused_imports)] pub use gen_BeforeUnloadEvent::*; #[cfg(feature = "BinaryType")] #[allow(non_snake_case)] mod gen_BinaryType; #[cfg(feature = "BinaryType")] +#[allow(unused_imports)] pub use gen_BinaryType::*; #[cfg(feature = "BiquadFilterNode")] #[allow(non_snake_case)] mod gen_BiquadFilterNode; #[cfg(feature = "BiquadFilterNode")] +#[allow(unused_imports)] pub use gen_BiquadFilterNode::*; #[cfg(feature = "BiquadFilterOptions")] #[allow(non_snake_case)] mod gen_BiquadFilterOptions; #[cfg(feature = "BiquadFilterOptions")] +#[allow(unused_imports)] pub use gen_BiquadFilterOptions::*; #[cfg(feature = "BiquadFilterType")] #[allow(non_snake_case)] mod gen_BiquadFilterType; #[cfg(feature = "BiquadFilterType")] +#[allow(unused_imports)] pub use gen_BiquadFilterType::*; #[cfg(feature = "Blob")] #[allow(non_snake_case)] mod gen_Blob; #[cfg(feature = "Blob")] +#[allow(unused_imports)] pub use gen_Blob::*; #[cfg(feature = "BlobEvent")] #[allow(non_snake_case)] mod gen_BlobEvent; #[cfg(feature = "BlobEvent")] +#[allow(unused_imports)] pub use gen_BlobEvent::*; #[cfg(feature = "BlobEventInit")] #[allow(non_snake_case)] mod gen_BlobEventInit; #[cfg(feature = "BlobEventInit")] +#[allow(unused_imports)] pub use gen_BlobEventInit::*; #[cfg(feature = "BlobPropertyBag")] #[allow(non_snake_case)] mod gen_BlobPropertyBag; #[cfg(feature = "BlobPropertyBag")] +#[allow(unused_imports)] pub use gen_BlobPropertyBag::*; #[cfg(feature = "BlockParsingOptions")] #[allow(non_snake_case)] mod gen_BlockParsingOptions; #[cfg(feature = "BlockParsingOptions")] +#[allow(unused_imports)] pub use gen_BlockParsingOptions::*; #[cfg(feature = "Bluetooth")] #[allow(non_snake_case)] mod gen_Bluetooth; #[cfg(feature = "Bluetooth")] +#[allow(unused_imports)] pub use gen_Bluetooth::*; #[cfg(feature = "BluetoothAdvertisingEvent")] #[allow(non_snake_case)] mod gen_BluetoothAdvertisingEvent; #[cfg(feature = "BluetoothAdvertisingEvent")] +#[allow(unused_imports)] pub use gen_BluetoothAdvertisingEvent::*; #[cfg(feature = "BluetoothAdvertisingEventInit")] #[allow(non_snake_case)] mod gen_BluetoothAdvertisingEventInit; #[cfg(feature = "BluetoothAdvertisingEventInit")] +#[allow(unused_imports)] pub use gen_BluetoothAdvertisingEventInit::*; #[cfg(feature = "BluetoothCharacteristicProperties")] #[allow(non_snake_case)] mod gen_BluetoothCharacteristicProperties; #[cfg(feature = "BluetoothCharacteristicProperties")] +#[allow(unused_imports)] pub use gen_BluetoothCharacteristicProperties::*; #[cfg(feature = "BluetoothDataFilterInit")] #[allow(non_snake_case)] mod gen_BluetoothDataFilterInit; #[cfg(feature = "BluetoothDataFilterInit")] +#[allow(unused_imports)] pub use gen_BluetoothDataFilterInit::*; #[cfg(feature = "BluetoothDevice")] #[allow(non_snake_case)] mod gen_BluetoothDevice; #[cfg(feature = "BluetoothDevice")] +#[allow(unused_imports)] pub use gen_BluetoothDevice::*; #[cfg(feature = "BluetoothLeScanFilterInit")] #[allow(non_snake_case)] mod gen_BluetoothLeScanFilterInit; #[cfg(feature = "BluetoothLeScanFilterInit")] +#[allow(unused_imports)] pub use gen_BluetoothLeScanFilterInit::*; #[cfg(feature = "BluetoothManufacturerDataMap")] #[allow(non_snake_case)] mod gen_BluetoothManufacturerDataMap; #[cfg(feature = "BluetoothManufacturerDataMap")] +#[allow(unused_imports)] pub use gen_BluetoothManufacturerDataMap::*; #[cfg(feature = "BluetoothPermissionDescriptor")] #[allow(non_snake_case)] mod gen_BluetoothPermissionDescriptor; #[cfg(feature = "BluetoothPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionDescriptor::*; #[cfg(feature = "BluetoothPermissionResult")] #[allow(non_snake_case)] mod gen_BluetoothPermissionResult; #[cfg(feature = "BluetoothPermissionResult")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionResult::*; #[cfg(feature = "BluetoothPermissionStorage")] #[allow(non_snake_case)] mod gen_BluetoothPermissionStorage; #[cfg(feature = "BluetoothPermissionStorage")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionStorage::*; #[cfg(feature = "BluetoothRemoteGattCharacteristic")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattCharacteristic; #[cfg(feature = "BluetoothRemoteGattCharacteristic")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattCharacteristic::*; #[cfg(feature = "BluetoothRemoteGattDescriptor")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattDescriptor; #[cfg(feature = "BluetoothRemoteGattDescriptor")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattDescriptor::*; #[cfg(feature = "BluetoothRemoteGattServer")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattServer; #[cfg(feature = "BluetoothRemoteGattServer")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattServer::*; #[cfg(feature = "BluetoothRemoteGattService")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattService; #[cfg(feature = "BluetoothRemoteGattService")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattService::*; #[cfg(feature = "BluetoothServiceDataMap")] #[allow(non_snake_case)] mod gen_BluetoothServiceDataMap; #[cfg(feature = "BluetoothServiceDataMap")] +#[allow(unused_imports)] pub use gen_BluetoothServiceDataMap::*; #[cfg(feature = "BluetoothUuid")] #[allow(non_snake_case)] mod gen_BluetoothUuid; #[cfg(feature = "BluetoothUuid")] +#[allow(unused_imports)] pub use gen_BluetoothUuid::*; #[cfg(feature = "BoxQuadOptions")] #[allow(non_snake_case)] mod gen_BoxQuadOptions; #[cfg(feature = "BoxQuadOptions")] +#[allow(unused_imports)] pub use gen_BoxQuadOptions::*; #[cfg(feature = "BroadcastChannel")] #[allow(non_snake_case)] mod gen_BroadcastChannel; #[cfg(feature = "BroadcastChannel")] +#[allow(unused_imports)] pub use gen_BroadcastChannel::*; #[cfg(feature = "BrowserElementDownloadOptions")] #[allow(non_snake_case)] mod gen_BrowserElementDownloadOptions; #[cfg(feature = "BrowserElementDownloadOptions")] +#[allow(unused_imports)] pub use gen_BrowserElementDownloadOptions::*; #[cfg(feature = "BrowserElementExecuteScriptOptions")] #[allow(non_snake_case)] mod gen_BrowserElementExecuteScriptOptions; #[cfg(feature = "BrowserElementExecuteScriptOptions")] +#[allow(unused_imports)] pub use gen_BrowserElementExecuteScriptOptions::*; #[cfg(feature = "BrowserFeedWriter")] #[allow(non_snake_case)] mod gen_BrowserFeedWriter; #[cfg(feature = "BrowserFeedWriter")] +#[allow(unused_imports)] pub use gen_BrowserFeedWriter::*; #[cfg(feature = "BrowserFindCaseSensitivity")] #[allow(non_snake_case)] mod gen_BrowserFindCaseSensitivity; #[cfg(feature = "BrowserFindCaseSensitivity")] +#[allow(unused_imports)] pub use gen_BrowserFindCaseSensitivity::*; #[cfg(feature = "BrowserFindDirection")] #[allow(non_snake_case)] mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] +#[allow(unused_imports)] pub use gen_BrowserFindDirection::*; #[cfg(feature = "ByteLengthQueuingStrategy")] #[allow(non_snake_case)] mod gen_ByteLengthQueuingStrategy; #[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(unused_imports)] pub use gen_ByteLengthQueuingStrategy::*; #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; #[cfg(feature = "Cache")] +#[allow(unused_imports)] pub use gen_Cache::*; #[cfg(feature = "CacheBatchOperation")] #[allow(non_snake_case)] mod gen_CacheBatchOperation; #[cfg(feature = "CacheBatchOperation")] +#[allow(unused_imports)] pub use gen_CacheBatchOperation::*; #[cfg(feature = "CacheQueryOptions")] #[allow(non_snake_case)] mod gen_CacheQueryOptions; #[cfg(feature = "CacheQueryOptions")] +#[allow(unused_imports)] pub use gen_CacheQueryOptions::*; #[cfg(feature = "CacheStorage")] #[allow(non_snake_case)] mod gen_CacheStorage; #[cfg(feature = "CacheStorage")] +#[allow(unused_imports)] pub use gen_CacheStorage::*; #[cfg(feature = "CacheStorageNamespace")] #[allow(non_snake_case)] mod gen_CacheStorageNamespace; #[cfg(feature = "CacheStorageNamespace")] +#[allow(unused_imports)] pub use gen_CacheStorageNamespace::*; #[cfg(feature = "CanvasCaptureMediaStream")] #[allow(non_snake_case)] mod gen_CanvasCaptureMediaStream; #[cfg(feature = "CanvasCaptureMediaStream")] +#[allow(unused_imports)] pub use gen_CanvasCaptureMediaStream::*; #[cfg(feature = "CanvasCaptureMediaStreamTrack")] #[allow(non_snake_case)] mod gen_CanvasCaptureMediaStreamTrack; #[cfg(feature = "CanvasCaptureMediaStreamTrack")] +#[allow(unused_imports)] pub use gen_CanvasCaptureMediaStreamTrack::*; #[cfg(feature = "CanvasGradient")] #[allow(non_snake_case)] mod gen_CanvasGradient; #[cfg(feature = "CanvasGradient")] +#[allow(unused_imports)] pub use gen_CanvasGradient::*; #[cfg(feature = "CanvasPattern")] #[allow(non_snake_case)] mod gen_CanvasPattern; #[cfg(feature = "CanvasPattern")] +#[allow(unused_imports)] pub use gen_CanvasPattern::*; #[cfg(feature = "CanvasRenderingContext2d")] #[allow(non_snake_case)] mod gen_CanvasRenderingContext2d; #[cfg(feature = "CanvasRenderingContext2d")] +#[allow(unused_imports)] pub use gen_CanvasRenderingContext2d::*; #[cfg(feature = "CanvasWindingRule")] #[allow(non_snake_case)] mod gen_CanvasWindingRule; #[cfg(feature = "CanvasWindingRule")] +#[allow(unused_imports)] pub use gen_CanvasWindingRule::*; #[cfg(feature = "CaretChangedReason")] #[allow(non_snake_case)] mod gen_CaretChangedReason; #[cfg(feature = "CaretChangedReason")] +#[allow(unused_imports)] pub use gen_CaretChangedReason::*; #[cfg(feature = "CaretPosition")] #[allow(non_snake_case)] mod gen_CaretPosition; #[cfg(feature = "CaretPosition")] +#[allow(unused_imports)] pub use gen_CaretPosition::*; #[cfg(feature = "CaretStateChangedEventInit")] #[allow(non_snake_case)] mod gen_CaretStateChangedEventInit; #[cfg(feature = "CaretStateChangedEventInit")] +#[allow(unused_imports)] pub use gen_CaretStateChangedEventInit::*; #[cfg(feature = "CdataSection")] #[allow(non_snake_case)] mod gen_CdataSection; #[cfg(feature = "CdataSection")] +#[allow(unused_imports)] pub use gen_CdataSection::*; #[cfg(feature = "ChannelCountMode")] #[allow(non_snake_case)] mod gen_ChannelCountMode; #[cfg(feature = "ChannelCountMode")] +#[allow(unused_imports)] pub use gen_ChannelCountMode::*; #[cfg(feature = "ChannelInterpretation")] #[allow(non_snake_case)] mod gen_ChannelInterpretation; #[cfg(feature = "ChannelInterpretation")] +#[allow(unused_imports)] pub use gen_ChannelInterpretation::*; #[cfg(feature = "ChannelMergerNode")] #[allow(non_snake_case)] mod gen_ChannelMergerNode; #[cfg(feature = "ChannelMergerNode")] +#[allow(unused_imports)] pub use gen_ChannelMergerNode::*; #[cfg(feature = "ChannelMergerOptions")] #[allow(non_snake_case)] mod gen_ChannelMergerOptions; #[cfg(feature = "ChannelMergerOptions")] +#[allow(unused_imports)] pub use gen_ChannelMergerOptions::*; #[cfg(feature = "ChannelSplitterNode")] #[allow(non_snake_case)] mod gen_ChannelSplitterNode; #[cfg(feature = "ChannelSplitterNode")] +#[allow(unused_imports)] pub use gen_ChannelSplitterNode::*; #[cfg(feature = "ChannelSplitterOptions")] #[allow(non_snake_case)] mod gen_ChannelSplitterOptions; #[cfg(feature = "ChannelSplitterOptions")] +#[allow(unused_imports)] pub use gen_ChannelSplitterOptions::*; #[cfg(feature = "CharacterData")] #[allow(non_snake_case)] mod gen_CharacterData; #[cfg(feature = "CharacterData")] +#[allow(unused_imports)] pub use gen_CharacterData::*; #[cfg(feature = "CheckerboardReason")] #[allow(non_snake_case)] mod gen_CheckerboardReason; #[cfg(feature = "CheckerboardReason")] +#[allow(unused_imports)] pub use gen_CheckerboardReason::*; #[cfg(feature = "CheckerboardReport")] #[allow(non_snake_case)] mod gen_CheckerboardReport; #[cfg(feature = "CheckerboardReport")] +#[allow(unused_imports)] pub use gen_CheckerboardReport::*; #[cfg(feature = "CheckerboardReportService")] #[allow(non_snake_case)] mod gen_CheckerboardReportService; #[cfg(feature = "CheckerboardReportService")] +#[allow(unused_imports)] pub use gen_CheckerboardReportService::*; #[cfg(feature = "ChromeFilePropertyBag")] #[allow(non_snake_case)] mod gen_ChromeFilePropertyBag; #[cfg(feature = "ChromeFilePropertyBag")] +#[allow(unused_imports)] pub use gen_ChromeFilePropertyBag::*; #[cfg(feature = "ChromeWorker")] #[allow(non_snake_case)] mod gen_ChromeWorker; #[cfg(feature = "ChromeWorker")] +#[allow(unused_imports)] pub use gen_ChromeWorker::*; #[cfg(feature = "Client")] #[allow(non_snake_case)] mod gen_Client; #[cfg(feature = "Client")] +#[allow(unused_imports)] pub use gen_Client::*; #[cfg(feature = "ClientQueryOptions")] #[allow(non_snake_case)] mod gen_ClientQueryOptions; #[cfg(feature = "ClientQueryOptions")] +#[allow(unused_imports)] pub use gen_ClientQueryOptions::*; #[cfg(feature = "ClientRectsAndTexts")] #[allow(non_snake_case)] mod gen_ClientRectsAndTexts; #[cfg(feature = "ClientRectsAndTexts")] +#[allow(unused_imports)] pub use gen_ClientRectsAndTexts::*; #[cfg(feature = "ClientType")] #[allow(non_snake_case)] mod gen_ClientType; #[cfg(feature = "ClientType")] +#[allow(unused_imports)] pub use gen_ClientType::*; #[cfg(feature = "Clients")] #[allow(non_snake_case)] mod gen_Clients; #[cfg(feature = "Clients")] +#[allow(unused_imports)] pub use gen_Clients::*; #[cfg(feature = "Clipboard")] #[allow(non_snake_case)] mod gen_Clipboard; #[cfg(feature = "Clipboard")] +#[allow(unused_imports)] pub use gen_Clipboard::*; #[cfg(feature = "ClipboardEvent")] #[allow(non_snake_case)] mod gen_ClipboardEvent; #[cfg(feature = "ClipboardEvent")] +#[allow(unused_imports)] pub use gen_ClipboardEvent::*; #[cfg(feature = "ClipboardEventInit")] #[allow(non_snake_case)] mod gen_ClipboardEventInit; #[cfg(feature = "ClipboardEventInit")] +#[allow(unused_imports)] pub use gen_ClipboardEventInit::*; #[cfg(feature = "ClipboardItem")] #[allow(non_snake_case)] mod gen_ClipboardItem; #[cfg(feature = "ClipboardItem")] +#[allow(unused_imports)] pub use gen_ClipboardItem::*; #[cfg(feature = "ClipboardItemOptions")] #[allow(non_snake_case)] mod gen_ClipboardItemOptions; #[cfg(feature = "ClipboardItemOptions")] +#[allow(unused_imports)] pub use gen_ClipboardItemOptions::*; #[cfg(feature = "ClipboardPermissionDescriptor")] #[allow(non_snake_case)] mod gen_ClipboardPermissionDescriptor; #[cfg(feature = "ClipboardPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_ClipboardPermissionDescriptor::*; #[cfg(feature = "CloseEvent")] #[allow(non_snake_case)] mod gen_CloseEvent; #[cfg(feature = "CloseEvent")] +#[allow(unused_imports)] pub use gen_CloseEvent::*; #[cfg(feature = "CloseEventInit")] #[allow(non_snake_case)] mod gen_CloseEventInit; #[cfg(feature = "CloseEventInit")] +#[allow(unused_imports)] pub use gen_CloseEventInit::*; #[cfg(feature = "CodecState")] #[allow(non_snake_case)] mod gen_CodecState; #[cfg(feature = "CodecState")] +#[allow(unused_imports)] pub use gen_CodecState::*; #[cfg(feature = "CollectedClientData")] #[allow(non_snake_case)] mod gen_CollectedClientData; #[cfg(feature = "CollectedClientData")] +#[allow(unused_imports)] pub use gen_CollectedClientData::*; #[cfg(feature = "ColorSpaceConversion")] #[allow(non_snake_case)] mod gen_ColorSpaceConversion; #[cfg(feature = "ColorSpaceConversion")] +#[allow(unused_imports)] pub use gen_ColorSpaceConversion::*; #[cfg(feature = "Comment")] #[allow(non_snake_case)] mod gen_Comment; #[cfg(feature = "Comment")] +#[allow(unused_imports)] pub use gen_Comment::*; #[cfg(feature = "CompositeOperation")] #[allow(non_snake_case)] mod gen_CompositeOperation; #[cfg(feature = "CompositeOperation")] +#[allow(unused_imports)] pub use gen_CompositeOperation::*; #[cfg(feature = "CompositionEvent")] #[allow(non_snake_case)] mod gen_CompositionEvent; #[cfg(feature = "CompositionEvent")] +#[allow(unused_imports)] pub use gen_CompositionEvent::*; #[cfg(feature = "CompositionEventInit")] #[allow(non_snake_case)] mod gen_CompositionEventInit; #[cfg(feature = "CompositionEventInit")] +#[allow(unused_imports)] pub use gen_CompositionEventInit::*; +#[cfg(feature = "CompressionFormat")] +#[allow(non_snake_case)] +mod gen_CompressionFormat; +#[cfg(feature = "CompressionFormat")] +#[allow(unused_imports)] +pub use gen_CompressionFormat::*; + +#[cfg(feature = "CompressionStream")] +#[allow(non_snake_case)] +mod gen_CompressionStream; +#[cfg(feature = "CompressionStream")] +#[allow(unused_imports)] +pub use gen_CompressionStream::*; + #[cfg(feature = "ComputedEffectTiming")] #[allow(non_snake_case)] mod gen_ComputedEffectTiming; #[cfg(feature = "ComputedEffectTiming")] +#[allow(unused_imports)] pub use gen_ComputedEffectTiming::*; #[cfg(feature = "ConnStatusDict")] #[allow(non_snake_case)] mod gen_ConnStatusDict; #[cfg(feature = "ConnStatusDict")] +#[allow(unused_imports)] pub use gen_ConnStatusDict::*; #[cfg(feature = "ConnectionType")] #[allow(non_snake_case)] mod gen_ConnectionType; #[cfg(feature = "ConnectionType")] +#[allow(unused_imports)] pub use gen_ConnectionType::*; #[cfg(feature = "ConsoleCounter")] #[allow(non_snake_case)] mod gen_ConsoleCounter; #[cfg(feature = "ConsoleCounter")] +#[allow(unused_imports)] pub use gen_ConsoleCounter::*; #[cfg(feature = "ConsoleCounterError")] #[allow(non_snake_case)] mod gen_ConsoleCounterError; #[cfg(feature = "ConsoleCounterError")] +#[allow(unused_imports)] pub use gen_ConsoleCounterError::*; #[cfg(feature = "ConsoleEvent")] #[allow(non_snake_case)] mod gen_ConsoleEvent; #[cfg(feature = "ConsoleEvent")] +#[allow(unused_imports)] pub use gen_ConsoleEvent::*; #[cfg(feature = "ConsoleInstance")] #[allow(non_snake_case)] mod gen_ConsoleInstance; #[cfg(feature = "ConsoleInstance")] +#[allow(unused_imports)] pub use gen_ConsoleInstance::*; #[cfg(feature = "ConsoleInstanceOptions")] #[allow(non_snake_case)] mod gen_ConsoleInstanceOptions; #[cfg(feature = "ConsoleInstanceOptions")] +#[allow(unused_imports)] pub use gen_ConsoleInstanceOptions::*; #[cfg(feature = "ConsoleLevel")] #[allow(non_snake_case)] mod gen_ConsoleLevel; #[cfg(feature = "ConsoleLevel")] +#[allow(unused_imports)] pub use gen_ConsoleLevel::*; #[cfg(feature = "ConsoleLogLevel")] #[allow(non_snake_case)] mod gen_ConsoleLogLevel; #[cfg(feature = "ConsoleLogLevel")] +#[allow(unused_imports)] pub use gen_ConsoleLogLevel::*; #[cfg(feature = "ConsoleProfileEvent")] #[allow(non_snake_case)] mod gen_ConsoleProfileEvent; #[cfg(feature = "ConsoleProfileEvent")] +#[allow(unused_imports)] pub use gen_ConsoleProfileEvent::*; #[cfg(feature = "ConsoleStackEntry")] #[allow(non_snake_case)] mod gen_ConsoleStackEntry; #[cfg(feature = "ConsoleStackEntry")] +#[allow(unused_imports)] pub use gen_ConsoleStackEntry::*; #[cfg(feature = "ConsoleTimerError")] #[allow(non_snake_case)] mod gen_ConsoleTimerError; #[cfg(feature = "ConsoleTimerError")] +#[allow(unused_imports)] pub use gen_ConsoleTimerError::*; #[cfg(feature = "ConsoleTimerLogOrEnd")] #[allow(non_snake_case)] mod gen_ConsoleTimerLogOrEnd; #[cfg(feature = "ConsoleTimerLogOrEnd")] +#[allow(unused_imports)] pub use gen_ConsoleTimerLogOrEnd::*; #[cfg(feature = "ConsoleTimerStart")] #[allow(non_snake_case)] mod gen_ConsoleTimerStart; #[cfg(feature = "ConsoleTimerStart")] +#[allow(unused_imports)] pub use gen_ConsoleTimerStart::*; #[cfg(feature = "ConstantSourceNode")] #[allow(non_snake_case)] mod gen_ConstantSourceNode; #[cfg(feature = "ConstantSourceNode")] +#[allow(unused_imports)] pub use gen_ConstantSourceNode::*; #[cfg(feature = "ConstantSourceOptions")] #[allow(non_snake_case)] mod gen_ConstantSourceOptions; #[cfg(feature = "ConstantSourceOptions")] +#[allow(unused_imports)] pub use gen_ConstantSourceOptions::*; #[cfg(feature = "ConstrainBooleanParameters")] #[allow(non_snake_case)] mod gen_ConstrainBooleanParameters; #[cfg(feature = "ConstrainBooleanParameters")] +#[allow(unused_imports)] pub use gen_ConstrainBooleanParameters::*; #[cfg(feature = "ConstrainDomStringParameters")] #[allow(non_snake_case)] mod gen_ConstrainDomStringParameters; #[cfg(feature = "ConstrainDomStringParameters")] +#[allow(unused_imports)] pub use gen_ConstrainDomStringParameters::*; #[cfg(feature = "ConstrainDoubleRange")] #[allow(non_snake_case)] mod gen_ConstrainDoubleRange; #[cfg(feature = "ConstrainDoubleRange")] +#[allow(unused_imports)] pub use gen_ConstrainDoubleRange::*; #[cfg(feature = "ConstrainLongRange")] #[allow(non_snake_case)] mod gen_ConstrainLongRange; #[cfg(feature = "ConstrainLongRange")] +#[allow(unused_imports)] pub use gen_ConstrainLongRange::*; #[cfg(feature = "ContextAttributes2d")] #[allow(non_snake_case)] mod gen_ContextAttributes2d; #[cfg(feature = "ContextAttributes2d")] +#[allow(unused_imports)] pub use gen_ContextAttributes2d::*; #[cfg(feature = "ConvertCoordinateOptions")] #[allow(non_snake_case)] mod gen_ConvertCoordinateOptions; #[cfg(feature = "ConvertCoordinateOptions")] +#[allow(unused_imports)] pub use gen_ConvertCoordinateOptions::*; #[cfg(feature = "ConvolverNode")] #[allow(non_snake_case)] mod gen_ConvolverNode; #[cfg(feature = "ConvolverNode")] +#[allow(unused_imports)] pub use gen_ConvolverNode::*; #[cfg(feature = "ConvolverOptions")] #[allow(non_snake_case)] mod gen_ConvolverOptions; #[cfg(feature = "ConvolverOptions")] +#[allow(unused_imports)] pub use gen_ConvolverOptions::*; #[cfg(feature = "Coordinates")] #[allow(non_snake_case)] mod gen_Coordinates; #[cfg(feature = "Coordinates")] +#[allow(unused_imports)] pub use gen_Coordinates::*; #[cfg(feature = "CountQueuingStrategy")] #[allow(non_snake_case)] mod gen_CountQueuingStrategy; #[cfg(feature = "CountQueuingStrategy")] +#[allow(unused_imports)] pub use gen_CountQueuingStrategy::*; #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; #[cfg(feature = "Credential")] +#[allow(unused_imports)] pub use gen_Credential::*; #[cfg(feature = "CredentialCreationOptions")] #[allow(non_snake_case)] mod gen_CredentialCreationOptions; #[cfg(feature = "CredentialCreationOptions")] +#[allow(unused_imports)] pub use gen_CredentialCreationOptions::*; #[cfg(feature = "CredentialRequestOptions")] #[allow(non_snake_case)] mod gen_CredentialRequestOptions; #[cfg(feature = "CredentialRequestOptions")] +#[allow(unused_imports)] pub use gen_CredentialRequestOptions::*; #[cfg(feature = "CredentialsContainer")] #[allow(non_snake_case)] mod gen_CredentialsContainer; #[cfg(feature = "CredentialsContainer")] +#[allow(unused_imports)] pub use gen_CredentialsContainer::*; #[cfg(feature = "Crypto")] #[allow(non_snake_case)] mod gen_Crypto; #[cfg(feature = "Crypto")] +#[allow(unused_imports)] pub use gen_Crypto::*; #[cfg(feature = "CryptoKey")] #[allow(non_snake_case)] mod gen_CryptoKey; #[cfg(feature = "CryptoKey")] +#[allow(unused_imports)] pub use gen_CryptoKey::*; #[cfg(feature = "CryptoKeyPair")] #[allow(non_snake_case)] mod gen_CryptoKeyPair; #[cfg(feature = "CryptoKeyPair")] +#[allow(unused_imports)] pub use gen_CryptoKeyPair::*; #[cfg(feature = "CssAnimation")] #[allow(non_snake_case)] mod gen_CssAnimation; #[cfg(feature = "CssAnimation")] +#[allow(unused_imports)] pub use gen_CssAnimation::*; #[cfg(feature = "CssBoxType")] #[allow(non_snake_case)] mod gen_CssBoxType; #[cfg(feature = "CssBoxType")] +#[allow(unused_imports)] pub use gen_CssBoxType::*; #[cfg(feature = "CssConditionRule")] #[allow(non_snake_case)] mod gen_CssConditionRule; #[cfg(feature = "CssConditionRule")] +#[allow(unused_imports)] pub use gen_CssConditionRule::*; #[cfg(feature = "CssCounterStyleRule")] #[allow(non_snake_case)] mod gen_CssCounterStyleRule; #[cfg(feature = "CssCounterStyleRule")] +#[allow(unused_imports)] pub use gen_CssCounterStyleRule::*; #[cfg(feature = "CssFontFaceRule")] #[allow(non_snake_case)] mod gen_CssFontFaceRule; #[cfg(feature = "CssFontFaceRule")] +#[allow(unused_imports)] pub use gen_CssFontFaceRule::*; #[cfg(feature = "CssFontFeatureValuesRule")] #[allow(non_snake_case)] mod gen_CssFontFeatureValuesRule; #[cfg(feature = "CssFontFeatureValuesRule")] +#[allow(unused_imports)] pub use gen_CssFontFeatureValuesRule::*; #[cfg(feature = "CssGroupingRule")] #[allow(non_snake_case)] mod gen_CssGroupingRule; #[cfg(feature = "CssGroupingRule")] +#[allow(unused_imports)] pub use gen_CssGroupingRule::*; #[cfg(feature = "CssImportRule")] #[allow(non_snake_case)] mod gen_CssImportRule; #[cfg(feature = "CssImportRule")] +#[allow(unused_imports)] pub use gen_CssImportRule::*; #[cfg(feature = "CssKeyframeRule")] #[allow(non_snake_case)] mod gen_CssKeyframeRule; #[cfg(feature = "CssKeyframeRule")] +#[allow(unused_imports)] pub use gen_CssKeyframeRule::*; #[cfg(feature = "CssKeyframesRule")] #[allow(non_snake_case)] mod gen_CssKeyframesRule; #[cfg(feature = "CssKeyframesRule")] +#[allow(unused_imports)] pub use gen_CssKeyframesRule::*; #[cfg(feature = "CssMediaRule")] #[allow(non_snake_case)] mod gen_CssMediaRule; #[cfg(feature = "CssMediaRule")] +#[allow(unused_imports)] pub use gen_CssMediaRule::*; #[cfg(feature = "CssNamespaceRule")] #[allow(non_snake_case)] mod gen_CssNamespaceRule; #[cfg(feature = "CssNamespaceRule")] +#[allow(unused_imports)] pub use gen_CssNamespaceRule::*; #[cfg(feature = "CssPageRule")] #[allow(non_snake_case)] mod gen_CssPageRule; #[cfg(feature = "CssPageRule")] +#[allow(unused_imports)] pub use gen_CssPageRule::*; #[cfg(feature = "CssPseudoElement")] #[allow(non_snake_case)] mod gen_CssPseudoElement; #[cfg(feature = "CssPseudoElement")] +#[allow(unused_imports)] pub use gen_CssPseudoElement::*; #[cfg(feature = "CssRule")] #[allow(non_snake_case)] mod gen_CssRule; #[cfg(feature = "CssRule")] +#[allow(unused_imports)] pub use gen_CssRule::*; #[cfg(feature = "CssRuleList")] #[allow(non_snake_case)] mod gen_CssRuleList; #[cfg(feature = "CssRuleList")] +#[allow(unused_imports)] pub use gen_CssRuleList::*; #[cfg(feature = "CssStyleDeclaration")] #[allow(non_snake_case)] mod gen_CssStyleDeclaration; #[cfg(feature = "CssStyleDeclaration")] +#[allow(unused_imports)] pub use gen_CssStyleDeclaration::*; #[cfg(feature = "CssStyleRule")] #[allow(non_snake_case)] mod gen_CssStyleRule; #[cfg(feature = "CssStyleRule")] +#[allow(unused_imports)] pub use gen_CssStyleRule::*; #[cfg(feature = "CssStyleSheet")] #[allow(non_snake_case)] mod gen_CssStyleSheet; #[cfg(feature = "CssStyleSheet")] +#[allow(unused_imports)] pub use gen_CssStyleSheet::*; #[cfg(feature = "CssStyleSheetParsingMode")] #[allow(non_snake_case)] mod gen_CssStyleSheetParsingMode; #[cfg(feature = "CssStyleSheetParsingMode")] +#[allow(unused_imports)] pub use gen_CssStyleSheetParsingMode::*; #[cfg(feature = "CssSupportsRule")] #[allow(non_snake_case)] mod gen_CssSupportsRule; #[cfg(feature = "CssSupportsRule")] +#[allow(unused_imports)] pub use gen_CssSupportsRule::*; #[cfg(feature = "CssTransition")] #[allow(non_snake_case)] mod gen_CssTransition; #[cfg(feature = "CssTransition")] +#[allow(unused_imports)] pub use gen_CssTransition::*; #[cfg(feature = "CustomElementRegistry")] #[allow(non_snake_case)] mod gen_CustomElementRegistry; #[cfg(feature = "CustomElementRegistry")] +#[allow(unused_imports)] pub use gen_CustomElementRegistry::*; #[cfg(feature = "CustomEvent")] #[allow(non_snake_case)] mod gen_CustomEvent; #[cfg(feature = "CustomEvent")] +#[allow(unused_imports)] pub use gen_CustomEvent::*; #[cfg(feature = "CustomEventInit")] #[allow(non_snake_case)] mod gen_CustomEventInit; #[cfg(feature = "CustomEventInit")] +#[allow(unused_imports)] pub use gen_CustomEventInit::*; #[cfg(feature = "DataTransfer")] #[allow(non_snake_case)] mod gen_DataTransfer; #[cfg(feature = "DataTransfer")] +#[allow(unused_imports)] pub use gen_DataTransfer::*; #[cfg(feature = "DataTransferItem")] #[allow(non_snake_case)] mod gen_DataTransferItem; #[cfg(feature = "DataTransferItem")] +#[allow(unused_imports)] pub use gen_DataTransferItem::*; #[cfg(feature = "DataTransferItemList")] #[allow(non_snake_case)] mod gen_DataTransferItemList; #[cfg(feature = "DataTransferItemList")] +#[allow(unused_imports)] pub use gen_DataTransferItemList::*; #[cfg(feature = "DateTimeValue")] #[allow(non_snake_case)] mod gen_DateTimeValue; #[cfg(feature = "DateTimeValue")] +#[allow(unused_imports)] pub use gen_DateTimeValue::*; #[cfg(feature = "DecoderDoctorNotification")] #[allow(non_snake_case)] mod gen_DecoderDoctorNotification; #[cfg(feature = "DecoderDoctorNotification")] +#[allow(unused_imports)] pub use gen_DecoderDoctorNotification::*; #[cfg(feature = "DecoderDoctorNotificationType")] #[allow(non_snake_case)] mod gen_DecoderDoctorNotificationType; #[cfg(feature = "DecoderDoctorNotificationType")] +#[allow(unused_imports)] pub use gen_DecoderDoctorNotificationType::*; +#[cfg(feature = "DecompressionStream")] +#[allow(non_snake_case)] +mod gen_DecompressionStream; +#[cfg(feature = "DecompressionStream")] +#[allow(unused_imports)] +pub use gen_DecompressionStream::*; + #[cfg(feature = "DedicatedWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_DedicatedWorkerGlobalScope; #[cfg(feature = "DedicatedWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_DedicatedWorkerGlobalScope::*; #[cfg(feature = "DelayNode")] #[allow(non_snake_case)] mod gen_DelayNode; #[cfg(feature = "DelayNode")] +#[allow(unused_imports)] pub use gen_DelayNode::*; #[cfg(feature = "DelayOptions")] #[allow(non_snake_case)] mod gen_DelayOptions; #[cfg(feature = "DelayOptions")] +#[allow(unused_imports)] pub use gen_DelayOptions::*; #[cfg(feature = "DeviceAcceleration")] #[allow(non_snake_case)] mod gen_DeviceAcceleration; #[cfg(feature = "DeviceAcceleration")] +#[allow(unused_imports)] pub use gen_DeviceAcceleration::*; #[cfg(feature = "DeviceAccelerationInit")] #[allow(non_snake_case)] mod gen_DeviceAccelerationInit; #[cfg(feature = "DeviceAccelerationInit")] +#[allow(unused_imports)] pub use gen_DeviceAccelerationInit::*; #[cfg(feature = "DeviceLightEvent")] #[allow(non_snake_case)] mod gen_DeviceLightEvent; #[cfg(feature = "DeviceLightEvent")] +#[allow(unused_imports)] pub use gen_DeviceLightEvent::*; #[cfg(feature = "DeviceLightEventInit")] #[allow(non_snake_case)] mod gen_DeviceLightEventInit; #[cfg(feature = "DeviceLightEventInit")] +#[allow(unused_imports)] pub use gen_DeviceLightEventInit::*; #[cfg(feature = "DeviceMotionEvent")] #[allow(non_snake_case)] mod gen_DeviceMotionEvent; #[cfg(feature = "DeviceMotionEvent")] +#[allow(unused_imports)] pub use gen_DeviceMotionEvent::*; #[cfg(feature = "DeviceMotionEventInit")] #[allow(non_snake_case)] mod gen_DeviceMotionEventInit; #[cfg(feature = "DeviceMotionEventInit")] +#[allow(unused_imports)] pub use gen_DeviceMotionEventInit::*; #[cfg(feature = "DeviceOrientationEvent")] #[allow(non_snake_case)] mod gen_DeviceOrientationEvent; #[cfg(feature = "DeviceOrientationEvent")] +#[allow(unused_imports)] pub use gen_DeviceOrientationEvent::*; #[cfg(feature = "DeviceOrientationEventInit")] #[allow(non_snake_case)] mod gen_DeviceOrientationEventInit; #[cfg(feature = "DeviceOrientationEventInit")] +#[allow(unused_imports)] pub use gen_DeviceOrientationEventInit::*; #[cfg(feature = "DeviceProximityEvent")] #[allow(non_snake_case)] mod gen_DeviceProximityEvent; #[cfg(feature = "DeviceProximityEvent")] +#[allow(unused_imports)] pub use gen_DeviceProximityEvent::*; #[cfg(feature = "DeviceProximityEventInit")] #[allow(non_snake_case)] mod gen_DeviceProximityEventInit; #[cfg(feature = "DeviceProximityEventInit")] +#[allow(unused_imports)] pub use gen_DeviceProximityEventInit::*; #[cfg(feature = "DeviceRotationRate")] #[allow(non_snake_case)] mod gen_DeviceRotationRate; #[cfg(feature = "DeviceRotationRate")] +#[allow(unused_imports)] pub use gen_DeviceRotationRate::*; #[cfg(feature = "DeviceRotationRateInit")] #[allow(non_snake_case)] mod gen_DeviceRotationRateInit; #[cfg(feature = "DeviceRotationRateInit")] +#[allow(unused_imports)] pub use gen_DeviceRotationRateInit::*; #[cfg(feature = "DhKeyDeriveParams")] #[allow(non_snake_case)] mod gen_DhKeyDeriveParams; #[cfg(feature = "DhKeyDeriveParams")] +#[allow(unused_imports)] pub use gen_DhKeyDeriveParams::*; #[cfg(feature = "DirectionSetting")] #[allow(non_snake_case)] mod gen_DirectionSetting; #[cfg(feature = "DirectionSetting")] +#[allow(unused_imports)] pub use gen_DirectionSetting::*; #[cfg(feature = "Directory")] #[allow(non_snake_case)] mod gen_Directory; #[cfg(feature = "Directory")] +#[allow(unused_imports)] pub use gen_Directory::*; #[cfg(feature = "DisplayMediaStreamConstraints")] #[allow(non_snake_case)] mod gen_DisplayMediaStreamConstraints; #[cfg(feature = "DisplayMediaStreamConstraints")] +#[allow(unused_imports)] pub use gen_DisplayMediaStreamConstraints::*; #[cfg(feature = "DisplayNameOptions")] #[allow(non_snake_case)] mod gen_DisplayNameOptions; #[cfg(feature = "DisplayNameOptions")] +#[allow(unused_imports)] pub use gen_DisplayNameOptions::*; #[cfg(feature = "DisplayNameResult")] #[allow(non_snake_case)] mod gen_DisplayNameResult; #[cfg(feature = "DisplayNameResult")] +#[allow(unused_imports)] pub use gen_DisplayNameResult::*; #[cfg(feature = "DistanceModelType")] #[allow(non_snake_case)] mod gen_DistanceModelType; #[cfg(feature = "DistanceModelType")] +#[allow(unused_imports)] pub use gen_DistanceModelType::*; #[cfg(feature = "DnsCacheDict")] #[allow(non_snake_case)] mod gen_DnsCacheDict; #[cfg(feature = "DnsCacheDict")] +#[allow(unused_imports)] pub use gen_DnsCacheDict::*; #[cfg(feature = "DnsCacheEntry")] #[allow(non_snake_case)] mod gen_DnsCacheEntry; #[cfg(feature = "DnsCacheEntry")] +#[allow(unused_imports)] pub use gen_DnsCacheEntry::*; #[cfg(feature = "DnsLookupDict")] #[allow(non_snake_case)] mod gen_DnsLookupDict; #[cfg(feature = "DnsLookupDict")] +#[allow(unused_imports)] pub use gen_DnsLookupDict::*; #[cfg(feature = "Document")] #[allow(non_snake_case)] mod gen_Document; #[cfg(feature = "Document")] +#[allow(unused_imports)] pub use gen_Document::*; #[cfg(feature = "DocumentFragment")] #[allow(non_snake_case)] mod gen_DocumentFragment; #[cfg(feature = "DocumentFragment")] +#[allow(unused_imports)] pub use gen_DocumentFragment::*; #[cfg(feature = "DocumentTimeline")] #[allow(non_snake_case)] mod gen_DocumentTimeline; #[cfg(feature = "DocumentTimeline")] +#[allow(unused_imports)] pub use gen_DocumentTimeline::*; #[cfg(feature = "DocumentTimelineOptions")] #[allow(non_snake_case)] mod gen_DocumentTimelineOptions; #[cfg(feature = "DocumentTimelineOptions")] +#[allow(unused_imports)] pub use gen_DocumentTimelineOptions::*; #[cfg(feature = "DocumentType")] #[allow(non_snake_case)] mod gen_DocumentType; #[cfg(feature = "DocumentType")] +#[allow(unused_imports)] pub use gen_DocumentType::*; #[cfg(feature = "DomError")] #[allow(non_snake_case)] mod gen_DomError; #[cfg(feature = "DomError")] +#[allow(unused_imports)] pub use gen_DomError::*; #[cfg(feature = "DomException")] #[allow(non_snake_case)] mod gen_DomException; #[cfg(feature = "DomException")] +#[allow(unused_imports)] pub use gen_DomException::*; #[cfg(feature = "DomImplementation")] #[allow(non_snake_case)] mod gen_DomImplementation; #[cfg(feature = "DomImplementation")] +#[allow(unused_imports)] pub use gen_DomImplementation::*; #[cfg(feature = "DomMatrix")] #[allow(non_snake_case)] mod gen_DomMatrix; #[cfg(feature = "DomMatrix")] +#[allow(unused_imports)] pub use gen_DomMatrix::*; #[cfg(feature = "DomMatrix2dInit")] #[allow(non_snake_case)] mod gen_DomMatrix2dInit; #[cfg(feature = "DomMatrix2dInit")] +#[allow(unused_imports)] pub use gen_DomMatrix2dInit::*; #[cfg(feature = "DomMatrixInit")] #[allow(non_snake_case)] mod gen_DomMatrixInit; #[cfg(feature = "DomMatrixInit")] +#[allow(unused_imports)] pub use gen_DomMatrixInit::*; #[cfg(feature = "DomMatrixReadOnly")] #[allow(non_snake_case)] mod gen_DomMatrixReadOnly; #[cfg(feature = "DomMatrixReadOnly")] +#[allow(unused_imports)] pub use gen_DomMatrixReadOnly::*; #[cfg(feature = "DomParser")] #[allow(non_snake_case)] mod gen_DomParser; #[cfg(feature = "DomParser")] +#[allow(unused_imports)] pub use gen_DomParser::*; #[cfg(feature = "DomPoint")] #[allow(non_snake_case)] mod gen_DomPoint; #[cfg(feature = "DomPoint")] +#[allow(unused_imports)] pub use gen_DomPoint::*; #[cfg(feature = "DomPointInit")] #[allow(non_snake_case)] mod gen_DomPointInit; #[cfg(feature = "DomPointInit")] +#[allow(unused_imports)] pub use gen_DomPointInit::*; #[cfg(feature = "DomPointReadOnly")] #[allow(non_snake_case)] mod gen_DomPointReadOnly; #[cfg(feature = "DomPointReadOnly")] +#[allow(unused_imports)] pub use gen_DomPointReadOnly::*; #[cfg(feature = "DomQuad")] #[allow(non_snake_case)] mod gen_DomQuad; #[cfg(feature = "DomQuad")] +#[allow(unused_imports)] pub use gen_DomQuad::*; #[cfg(feature = "DomQuadInit")] #[allow(non_snake_case)] mod gen_DomQuadInit; #[cfg(feature = "DomQuadInit")] +#[allow(unused_imports)] pub use gen_DomQuadInit::*; #[cfg(feature = "DomQuadJson")] #[allow(non_snake_case)] mod gen_DomQuadJson; #[cfg(feature = "DomQuadJson")] +#[allow(unused_imports)] pub use gen_DomQuadJson::*; #[cfg(feature = "DomRect")] #[allow(non_snake_case)] mod gen_DomRect; #[cfg(feature = "DomRect")] +#[allow(unused_imports)] pub use gen_DomRect::*; #[cfg(feature = "DomRectInit")] #[allow(non_snake_case)] mod gen_DomRectInit; #[cfg(feature = "DomRectInit")] +#[allow(unused_imports)] pub use gen_DomRectInit::*; #[cfg(feature = "DomRectList")] #[allow(non_snake_case)] mod gen_DomRectList; #[cfg(feature = "DomRectList")] +#[allow(unused_imports)] pub use gen_DomRectList::*; #[cfg(feature = "DomRectReadOnly")] #[allow(non_snake_case)] mod gen_DomRectReadOnly; #[cfg(feature = "DomRectReadOnly")] +#[allow(unused_imports)] pub use gen_DomRectReadOnly::*; #[cfg(feature = "DomRequest")] #[allow(non_snake_case)] mod gen_DomRequest; #[cfg(feature = "DomRequest")] +#[allow(unused_imports)] pub use gen_DomRequest::*; #[cfg(feature = "DomRequestReadyState")] #[allow(non_snake_case)] mod gen_DomRequestReadyState; #[cfg(feature = "DomRequestReadyState")] +#[allow(unused_imports)] pub use gen_DomRequestReadyState::*; #[cfg(feature = "DomStringList")] #[allow(non_snake_case)] mod gen_DomStringList; #[cfg(feature = "DomStringList")] +#[allow(unused_imports)] pub use gen_DomStringList::*; #[cfg(feature = "DomStringMap")] #[allow(non_snake_case)] mod gen_DomStringMap; #[cfg(feature = "DomStringMap")] +#[allow(unused_imports)] pub use gen_DomStringMap::*; #[cfg(feature = "DomTokenList")] #[allow(non_snake_case)] mod gen_DomTokenList; #[cfg(feature = "DomTokenList")] +#[allow(unused_imports)] pub use gen_DomTokenList::*; #[cfg(feature = "DomWindowResizeEventDetail")] #[allow(non_snake_case)] mod gen_DomWindowResizeEventDetail; #[cfg(feature = "DomWindowResizeEventDetail")] +#[allow(unused_imports)] pub use gen_DomWindowResizeEventDetail::*; #[cfg(feature = "DragEvent")] #[allow(non_snake_case)] mod gen_DragEvent; #[cfg(feature = "DragEvent")] +#[allow(unused_imports)] pub use gen_DragEvent::*; #[cfg(feature = "DragEventInit")] #[allow(non_snake_case)] mod gen_DragEventInit; #[cfg(feature = "DragEventInit")] +#[allow(unused_imports)] pub use gen_DragEventInit::*; #[cfg(feature = "DynamicsCompressorNode")] #[allow(non_snake_case)] mod gen_DynamicsCompressorNode; #[cfg(feature = "DynamicsCompressorNode")] +#[allow(unused_imports)] pub use gen_DynamicsCompressorNode::*; #[cfg(feature = "DynamicsCompressorOptions")] #[allow(non_snake_case)] mod gen_DynamicsCompressorOptions; #[cfg(feature = "DynamicsCompressorOptions")] +#[allow(unused_imports)] pub use gen_DynamicsCompressorOptions::*; #[cfg(feature = "EcKeyAlgorithm")] #[allow(non_snake_case)] mod gen_EcKeyAlgorithm; #[cfg(feature = "EcKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_EcKeyAlgorithm::*; #[cfg(feature = "EcKeyGenParams")] #[allow(non_snake_case)] mod gen_EcKeyGenParams; #[cfg(feature = "EcKeyGenParams")] +#[allow(unused_imports)] pub use gen_EcKeyGenParams::*; #[cfg(feature = "EcKeyImportParams")] #[allow(non_snake_case)] mod gen_EcKeyImportParams; #[cfg(feature = "EcKeyImportParams")] +#[allow(unused_imports)] pub use gen_EcKeyImportParams::*; #[cfg(feature = "EcdhKeyDeriveParams")] #[allow(non_snake_case)] mod gen_EcdhKeyDeriveParams; #[cfg(feature = "EcdhKeyDeriveParams")] +#[allow(unused_imports)] pub use gen_EcdhKeyDeriveParams::*; #[cfg(feature = "EcdsaParams")] #[allow(non_snake_case)] mod gen_EcdsaParams; #[cfg(feature = "EcdsaParams")] +#[allow(unused_imports)] pub use gen_EcdsaParams::*; #[cfg(feature = "EffectTiming")] #[allow(non_snake_case)] mod gen_EffectTiming; #[cfg(feature = "EffectTiming")] +#[allow(unused_imports)] pub use gen_EffectTiming::*; #[cfg(feature = "Element")] #[allow(non_snake_case)] mod gen_Element; #[cfg(feature = "Element")] +#[allow(unused_imports)] pub use gen_Element::*; #[cfg(feature = "ElementCreationOptions")] #[allow(non_snake_case)] mod gen_ElementCreationOptions; #[cfg(feature = "ElementCreationOptions")] +#[allow(unused_imports)] pub use gen_ElementCreationOptions::*; #[cfg(feature = "ElementDefinitionOptions")] #[allow(non_snake_case)] mod gen_ElementDefinitionOptions; #[cfg(feature = "ElementDefinitionOptions")] +#[allow(unused_imports)] pub use gen_ElementDefinitionOptions::*; #[cfg(feature = "EncodedAudioChunk")] #[allow(non_snake_case)] mod gen_EncodedAudioChunk; #[cfg(feature = "EncodedAudioChunk")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunk::*; #[cfg(feature = "EncodedAudioChunkInit")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkInit; #[cfg(feature = "EncodedAudioChunkInit")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkInit::*; #[cfg(feature = "EncodedAudioChunkMetadata")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkMetadata; #[cfg(feature = "EncodedAudioChunkMetadata")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkMetadata::*; #[cfg(feature = "EncodedAudioChunkType")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkType; #[cfg(feature = "EncodedAudioChunkType")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkType::*; #[cfg(feature = "EncodedVideoChunk")] #[allow(non_snake_case)] mod gen_EncodedVideoChunk; #[cfg(feature = "EncodedVideoChunk")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunk::*; #[cfg(feature = "EncodedVideoChunkInit")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkInit; #[cfg(feature = "EncodedVideoChunkInit")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkInit::*; #[cfg(feature = "EncodedVideoChunkMetadata")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkMetadata; #[cfg(feature = "EncodedVideoChunkMetadata")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkMetadata::*; #[cfg(feature = "EncodedVideoChunkType")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkType; #[cfg(feature = "EncodedVideoChunkType")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkType::*; #[cfg(feature = "EndingTypes")] #[allow(non_snake_case)] mod gen_EndingTypes; #[cfg(feature = "EndingTypes")] +#[allow(unused_imports)] pub use gen_EndingTypes::*; #[cfg(feature = "ErrorCallback")] #[allow(non_snake_case)] mod gen_ErrorCallback; #[cfg(feature = "ErrorCallback")] +#[allow(unused_imports)] pub use gen_ErrorCallback::*; #[cfg(feature = "ErrorEvent")] #[allow(non_snake_case)] mod gen_ErrorEvent; #[cfg(feature = "ErrorEvent")] +#[allow(unused_imports)] pub use gen_ErrorEvent::*; #[cfg(feature = "ErrorEventInit")] #[allow(non_snake_case)] mod gen_ErrorEventInit; #[cfg(feature = "ErrorEventInit")] +#[allow(unused_imports)] pub use gen_ErrorEventInit::*; #[cfg(feature = "Event")] #[allow(non_snake_case)] mod gen_Event; #[cfg(feature = "Event")] +#[allow(unused_imports)] pub use gen_Event::*; #[cfg(feature = "EventInit")] #[allow(non_snake_case)] mod gen_EventInit; #[cfg(feature = "EventInit")] +#[allow(unused_imports)] pub use gen_EventInit::*; #[cfg(feature = "EventListener")] #[allow(non_snake_case)] mod gen_EventListener; #[cfg(feature = "EventListener")] +#[allow(unused_imports)] pub use gen_EventListener::*; #[cfg(feature = "EventListenerOptions")] #[allow(non_snake_case)] mod gen_EventListenerOptions; #[cfg(feature = "EventListenerOptions")] +#[allow(unused_imports)] pub use gen_EventListenerOptions::*; #[cfg(feature = "EventModifierInit")] #[allow(non_snake_case)] mod gen_EventModifierInit; #[cfg(feature = "EventModifierInit")] +#[allow(unused_imports)] pub use gen_EventModifierInit::*; #[cfg(feature = "EventSource")] #[allow(non_snake_case)] mod gen_EventSource; #[cfg(feature = "EventSource")] +#[allow(unused_imports)] pub use gen_EventSource::*; #[cfg(feature = "EventSourceInit")] #[allow(non_snake_case)] mod gen_EventSourceInit; #[cfg(feature = "EventSourceInit")] +#[allow(unused_imports)] pub use gen_EventSourceInit::*; #[cfg(feature = "EventTarget")] #[allow(non_snake_case)] mod gen_EventTarget; #[cfg(feature = "EventTarget")] +#[allow(unused_imports)] pub use gen_EventTarget::*; #[cfg(feature = "Exception")] #[allow(non_snake_case)] mod gen_Exception; #[cfg(feature = "Exception")] +#[allow(unused_imports)] pub use gen_Exception::*; #[cfg(feature = "ExtBlendMinmax")] #[allow(non_snake_case)] mod gen_ExtBlendMinmax; #[cfg(feature = "ExtBlendMinmax")] +#[allow(unused_imports)] pub use gen_ExtBlendMinmax::*; #[cfg(feature = "ExtColorBufferFloat")] #[allow(non_snake_case)] mod gen_ExtColorBufferFloat; #[cfg(feature = "ExtColorBufferFloat")] +#[allow(unused_imports)] pub use gen_ExtColorBufferFloat::*; #[cfg(feature = "ExtColorBufferHalfFloat")] #[allow(non_snake_case)] mod gen_ExtColorBufferHalfFloat; #[cfg(feature = "ExtColorBufferHalfFloat")] +#[allow(unused_imports)] pub use gen_ExtColorBufferHalfFloat::*; #[cfg(feature = "ExtDisjointTimerQuery")] #[allow(non_snake_case)] mod gen_ExtDisjointTimerQuery; #[cfg(feature = "ExtDisjointTimerQuery")] +#[allow(unused_imports)] pub use gen_ExtDisjointTimerQuery::*; #[cfg(feature = "ExtFragDepth")] #[allow(non_snake_case)] mod gen_ExtFragDepth; #[cfg(feature = "ExtFragDepth")] +#[allow(unused_imports)] pub use gen_ExtFragDepth::*; #[cfg(feature = "ExtSRgb")] #[allow(non_snake_case)] mod gen_ExtSRgb; #[cfg(feature = "ExtSRgb")] +#[allow(unused_imports)] pub use gen_ExtSRgb::*; #[cfg(feature = "ExtShaderTextureLod")] #[allow(non_snake_case)] mod gen_ExtShaderTextureLod; #[cfg(feature = "ExtShaderTextureLod")] +#[allow(unused_imports)] pub use gen_ExtShaderTextureLod::*; #[cfg(feature = "ExtTextureFilterAnisotropic")] #[allow(non_snake_case)] mod gen_ExtTextureFilterAnisotropic; #[cfg(feature = "ExtTextureFilterAnisotropic")] +#[allow(unused_imports)] pub use gen_ExtTextureFilterAnisotropic::*; #[cfg(feature = "ExtTextureNorm16")] #[allow(non_snake_case)] mod gen_ExtTextureNorm16; #[cfg(feature = "ExtTextureNorm16")] +#[allow(unused_imports)] pub use gen_ExtTextureNorm16::*; #[cfg(feature = "ExtendableEvent")] #[allow(non_snake_case)] mod gen_ExtendableEvent; #[cfg(feature = "ExtendableEvent")] +#[allow(unused_imports)] pub use gen_ExtendableEvent::*; #[cfg(feature = "ExtendableEventInit")] #[allow(non_snake_case)] mod gen_ExtendableEventInit; #[cfg(feature = "ExtendableEventInit")] +#[allow(unused_imports)] pub use gen_ExtendableEventInit::*; #[cfg(feature = "ExtendableMessageEvent")] #[allow(non_snake_case)] mod gen_ExtendableMessageEvent; #[cfg(feature = "ExtendableMessageEvent")] +#[allow(unused_imports)] pub use gen_ExtendableMessageEvent::*; #[cfg(feature = "ExtendableMessageEventInit")] #[allow(non_snake_case)] mod gen_ExtendableMessageEventInit; #[cfg(feature = "ExtendableMessageEventInit")] +#[allow(unused_imports)] pub use gen_ExtendableMessageEventInit::*; #[cfg(feature = "External")] #[allow(non_snake_case)] mod gen_External; #[cfg(feature = "External")] +#[allow(unused_imports)] pub use gen_External::*; #[cfg(feature = "FakePluginMimeEntry")] #[allow(non_snake_case)] mod gen_FakePluginMimeEntry; #[cfg(feature = "FakePluginMimeEntry")] +#[allow(unused_imports)] pub use gen_FakePluginMimeEntry::*; #[cfg(feature = "FakePluginTagInit")] #[allow(non_snake_case)] mod gen_FakePluginTagInit; #[cfg(feature = "FakePluginTagInit")] +#[allow(unused_imports)] pub use gen_FakePluginTagInit::*; #[cfg(feature = "FetchEvent")] #[allow(non_snake_case)] mod gen_FetchEvent; #[cfg(feature = "FetchEvent")] +#[allow(unused_imports)] pub use gen_FetchEvent::*; #[cfg(feature = "FetchEventInit")] #[allow(non_snake_case)] mod gen_FetchEventInit; #[cfg(feature = "FetchEventInit")] +#[allow(unused_imports)] pub use gen_FetchEventInit::*; #[cfg(feature = "FetchObserver")] #[allow(non_snake_case)] mod gen_FetchObserver; #[cfg(feature = "FetchObserver")] +#[allow(unused_imports)] pub use gen_FetchObserver::*; #[cfg(feature = "FetchReadableStreamReadDataArray")] #[allow(non_snake_case)] mod gen_FetchReadableStreamReadDataArray; #[cfg(feature = "FetchReadableStreamReadDataArray")] +#[allow(unused_imports)] pub use gen_FetchReadableStreamReadDataArray::*; #[cfg(feature = "FetchReadableStreamReadDataDone")] #[allow(non_snake_case)] mod gen_FetchReadableStreamReadDataDone; #[cfg(feature = "FetchReadableStreamReadDataDone")] +#[allow(unused_imports)] pub use gen_FetchReadableStreamReadDataDone::*; #[cfg(feature = "FetchState")] #[allow(non_snake_case)] mod gen_FetchState; #[cfg(feature = "FetchState")] +#[allow(unused_imports)] pub use gen_FetchState::*; #[cfg(feature = "File")] #[allow(non_snake_case)] mod gen_File; #[cfg(feature = "File")] +#[allow(unused_imports)] pub use gen_File::*; #[cfg(feature = "FileCallback")] #[allow(non_snake_case)] mod gen_FileCallback; #[cfg(feature = "FileCallback")] +#[allow(unused_imports)] pub use gen_FileCallback::*; #[cfg(feature = "FileList")] #[allow(non_snake_case)] mod gen_FileList; #[cfg(feature = "FileList")] +#[allow(unused_imports)] pub use gen_FileList::*; #[cfg(feature = "FilePropertyBag")] #[allow(non_snake_case)] mod gen_FilePropertyBag; #[cfg(feature = "FilePropertyBag")] +#[allow(unused_imports)] pub use gen_FilePropertyBag::*; #[cfg(feature = "FileReader")] #[allow(non_snake_case)] mod gen_FileReader; #[cfg(feature = "FileReader")] +#[allow(unused_imports)] pub use gen_FileReader::*; #[cfg(feature = "FileReaderSync")] #[allow(non_snake_case)] mod gen_FileReaderSync; #[cfg(feature = "FileReaderSync")] +#[allow(unused_imports)] pub use gen_FileReaderSync::*; #[cfg(feature = "FileSystem")] #[allow(non_snake_case)] mod gen_FileSystem; #[cfg(feature = "FileSystem")] +#[allow(unused_imports)] pub use gen_FileSystem::*; #[cfg(feature = "FileSystemCreateWritableOptions")] #[allow(non_snake_case)] mod gen_FileSystemCreateWritableOptions; #[cfg(feature = "FileSystemCreateWritableOptions")] +#[allow(unused_imports)] pub use gen_FileSystemCreateWritableOptions::*; #[cfg(feature = "FileSystemDirectoryEntry")] #[allow(non_snake_case)] mod gen_FileSystemDirectoryEntry; #[cfg(feature = "FileSystemDirectoryEntry")] +#[allow(unused_imports)] pub use gen_FileSystemDirectoryEntry::*; #[cfg(feature = "FileSystemDirectoryHandle")] #[allow(non_snake_case)] mod gen_FileSystemDirectoryHandle; #[cfg(feature = "FileSystemDirectoryHandle")] +#[allow(unused_imports)] pub use gen_FileSystemDirectoryHandle::*; #[cfg(feature = "FileSystemDirectoryReader")] #[allow(non_snake_case)] mod gen_FileSystemDirectoryReader; #[cfg(feature = "FileSystemDirectoryReader")] +#[allow(unused_imports)] pub use gen_FileSystemDirectoryReader::*; #[cfg(feature = "FileSystemEntriesCallback")] #[allow(non_snake_case)] mod gen_FileSystemEntriesCallback; #[cfg(feature = "FileSystemEntriesCallback")] +#[allow(unused_imports)] pub use gen_FileSystemEntriesCallback::*; #[cfg(feature = "FileSystemEntry")] #[allow(non_snake_case)] mod gen_FileSystemEntry; #[cfg(feature = "FileSystemEntry")] +#[allow(unused_imports)] pub use gen_FileSystemEntry::*; #[cfg(feature = "FileSystemEntryCallback")] #[allow(non_snake_case)] mod gen_FileSystemEntryCallback; #[cfg(feature = "FileSystemEntryCallback")] +#[allow(unused_imports)] pub use gen_FileSystemEntryCallback::*; #[cfg(feature = "FileSystemFileEntry")] #[allow(non_snake_case)] mod gen_FileSystemFileEntry; #[cfg(feature = "FileSystemFileEntry")] +#[allow(unused_imports)] pub use gen_FileSystemFileEntry::*; #[cfg(feature = "FileSystemFileHandle")] #[allow(non_snake_case)] mod gen_FileSystemFileHandle; #[cfg(feature = "FileSystemFileHandle")] +#[allow(unused_imports)] pub use gen_FileSystemFileHandle::*; #[cfg(feature = "FileSystemFlags")] #[allow(non_snake_case)] mod gen_FileSystemFlags; #[cfg(feature = "FileSystemFlags")] +#[allow(unused_imports)] pub use gen_FileSystemFlags::*; #[cfg(feature = "FileSystemGetDirectoryOptions")] #[allow(non_snake_case)] mod gen_FileSystemGetDirectoryOptions; #[cfg(feature = "FileSystemGetDirectoryOptions")] +#[allow(unused_imports)] pub use gen_FileSystemGetDirectoryOptions::*; #[cfg(feature = "FileSystemGetFileOptions")] #[allow(non_snake_case)] mod gen_FileSystemGetFileOptions; #[cfg(feature = "FileSystemGetFileOptions")] +#[allow(unused_imports)] pub use gen_FileSystemGetFileOptions::*; #[cfg(feature = "FileSystemHandle")] #[allow(non_snake_case)] mod gen_FileSystemHandle; #[cfg(feature = "FileSystemHandle")] +#[allow(unused_imports)] pub use gen_FileSystemHandle::*; #[cfg(feature = "FileSystemHandleKind")] #[allow(non_snake_case)] mod gen_FileSystemHandleKind; #[cfg(feature = "FileSystemHandleKind")] +#[allow(unused_imports)] pub use gen_FileSystemHandleKind::*; #[cfg(feature = "FileSystemReadWriteOptions")] #[allow(non_snake_case)] mod gen_FileSystemReadWriteOptions; #[cfg(feature = "FileSystemReadWriteOptions")] +#[allow(unused_imports)] pub use gen_FileSystemReadWriteOptions::*; #[cfg(feature = "FileSystemRemoveOptions")] #[allow(non_snake_case)] mod gen_FileSystemRemoveOptions; #[cfg(feature = "FileSystemRemoveOptions")] +#[allow(unused_imports)] pub use gen_FileSystemRemoveOptions::*; #[cfg(feature = "FileSystemSyncAccessHandle")] #[allow(non_snake_case)] mod gen_FileSystemSyncAccessHandle; #[cfg(feature = "FileSystemSyncAccessHandle")] +#[allow(unused_imports)] pub use gen_FileSystemSyncAccessHandle::*; #[cfg(feature = "FileSystemWritableFileStream")] #[allow(non_snake_case)] mod gen_FileSystemWritableFileStream; #[cfg(feature = "FileSystemWritableFileStream")] +#[allow(unused_imports)] pub use gen_FileSystemWritableFileStream::*; #[cfg(feature = "FillMode")] #[allow(non_snake_case)] mod gen_FillMode; #[cfg(feature = "FillMode")] +#[allow(unused_imports)] pub use gen_FillMode::*; #[cfg(feature = "FlashClassification")] #[allow(non_snake_case)] mod gen_FlashClassification; #[cfg(feature = "FlashClassification")] +#[allow(unused_imports)] pub use gen_FlashClassification::*; -#[cfg(feature = "FlexLineGrowthState")] -#[allow(non_snake_case)] -mod gen_FlexLineGrowthState; -#[cfg(feature = "FlexLineGrowthState")] -pub use gen_FlexLineGrowthState::*; - #[cfg(feature = "FlowControlType")] #[allow(non_snake_case)] mod gen_FlowControlType; #[cfg(feature = "FlowControlType")] +#[allow(unused_imports)] pub use gen_FlowControlType::*; #[cfg(feature = "FocusEvent")] #[allow(non_snake_case)] mod gen_FocusEvent; #[cfg(feature = "FocusEvent")] +#[allow(unused_imports)] pub use gen_FocusEvent::*; #[cfg(feature = "FocusEventInit")] #[allow(non_snake_case)] mod gen_FocusEventInit; #[cfg(feature = "FocusEventInit")] +#[allow(unused_imports)] pub use gen_FocusEventInit::*; #[cfg(feature = "FontData")] #[allow(non_snake_case)] mod gen_FontData; #[cfg(feature = "FontData")] +#[allow(unused_imports)] pub use gen_FontData::*; #[cfg(feature = "FontFace")] #[allow(non_snake_case)] mod gen_FontFace; #[cfg(feature = "FontFace")] +#[allow(unused_imports)] pub use gen_FontFace::*; #[cfg(feature = "FontFaceDescriptors")] #[allow(non_snake_case)] mod gen_FontFaceDescriptors; #[cfg(feature = "FontFaceDescriptors")] +#[allow(unused_imports)] pub use gen_FontFaceDescriptors::*; #[cfg(feature = "FontFaceLoadStatus")] #[allow(non_snake_case)] mod gen_FontFaceLoadStatus; #[cfg(feature = "FontFaceLoadStatus")] +#[allow(unused_imports)] pub use gen_FontFaceLoadStatus::*; #[cfg(feature = "FontFaceSet")] #[allow(non_snake_case)] mod gen_FontFaceSet; #[cfg(feature = "FontFaceSet")] +#[allow(unused_imports)] pub use gen_FontFaceSet::*; #[cfg(feature = "FontFaceSetIterator")] #[allow(non_snake_case)] mod gen_FontFaceSetIterator; #[cfg(feature = "FontFaceSetIterator")] +#[allow(unused_imports)] pub use gen_FontFaceSetIterator::*; #[cfg(feature = "FontFaceSetIteratorResult")] #[allow(non_snake_case)] mod gen_FontFaceSetIteratorResult; #[cfg(feature = "FontFaceSetIteratorResult")] +#[allow(unused_imports)] pub use gen_FontFaceSetIteratorResult::*; #[cfg(feature = "FontFaceSetLoadEvent")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadEvent; #[cfg(feature = "FontFaceSetLoadEvent")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadEvent::*; #[cfg(feature = "FontFaceSetLoadEventInit")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadEventInit; #[cfg(feature = "FontFaceSetLoadEventInit")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadEventInit::*; #[cfg(feature = "FontFaceSetLoadStatus")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadStatus; #[cfg(feature = "FontFaceSetLoadStatus")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadStatus::*; #[cfg(feature = "FormData")] #[allow(non_snake_case)] mod gen_FormData; #[cfg(feature = "FormData")] +#[allow(unused_imports)] pub use gen_FormData::*; #[cfg(feature = "FrameType")] #[allow(non_snake_case)] mod gen_FrameType; #[cfg(feature = "FrameType")] +#[allow(unused_imports)] pub use gen_FrameType::*; #[cfg(feature = "FuzzingFunctions")] #[allow(non_snake_case)] mod gen_FuzzingFunctions; #[cfg(feature = "FuzzingFunctions")] +#[allow(unused_imports)] pub use gen_FuzzingFunctions::*; #[cfg(feature = "GainNode")] #[allow(non_snake_case)] mod gen_GainNode; #[cfg(feature = "GainNode")] +#[allow(unused_imports)] pub use gen_GainNode::*; #[cfg(feature = "GainOptions")] #[allow(non_snake_case)] mod gen_GainOptions; #[cfg(feature = "GainOptions")] +#[allow(unused_imports)] pub use gen_GainOptions::*; #[cfg(feature = "Gamepad")] #[allow(non_snake_case)] mod gen_Gamepad; #[cfg(feature = "Gamepad")] +#[allow(unused_imports)] pub use gen_Gamepad::*; #[cfg(feature = "GamepadAxisMoveEvent")] #[allow(non_snake_case)] mod gen_GamepadAxisMoveEvent; #[cfg(feature = "GamepadAxisMoveEvent")] +#[allow(unused_imports)] pub use gen_GamepadAxisMoveEvent::*; #[cfg(feature = "GamepadAxisMoveEventInit")] #[allow(non_snake_case)] mod gen_GamepadAxisMoveEventInit; #[cfg(feature = "GamepadAxisMoveEventInit")] +#[allow(unused_imports)] pub use gen_GamepadAxisMoveEventInit::*; #[cfg(feature = "GamepadButton")] #[allow(non_snake_case)] mod gen_GamepadButton; #[cfg(feature = "GamepadButton")] +#[allow(unused_imports)] pub use gen_GamepadButton::*; #[cfg(feature = "GamepadButtonEvent")] #[allow(non_snake_case)] mod gen_GamepadButtonEvent; #[cfg(feature = "GamepadButtonEvent")] +#[allow(unused_imports)] pub use gen_GamepadButtonEvent::*; #[cfg(feature = "GamepadButtonEventInit")] #[allow(non_snake_case)] mod gen_GamepadButtonEventInit; #[cfg(feature = "GamepadButtonEventInit")] +#[allow(unused_imports)] pub use gen_GamepadButtonEventInit::*; #[cfg(feature = "GamepadEvent")] #[allow(non_snake_case)] mod gen_GamepadEvent; #[cfg(feature = "GamepadEvent")] +#[allow(unused_imports)] pub use gen_GamepadEvent::*; #[cfg(feature = "GamepadEventInit")] #[allow(non_snake_case)] mod gen_GamepadEventInit; #[cfg(feature = "GamepadEventInit")] +#[allow(unused_imports)] pub use gen_GamepadEventInit::*; #[cfg(feature = "GamepadHand")] #[allow(non_snake_case)] mod gen_GamepadHand; #[cfg(feature = "GamepadHand")] +#[allow(unused_imports)] pub use gen_GamepadHand::*; #[cfg(feature = "GamepadHapticActuator")] #[allow(non_snake_case)] mod gen_GamepadHapticActuator; #[cfg(feature = "GamepadHapticActuator")] +#[allow(unused_imports)] pub use gen_GamepadHapticActuator::*; #[cfg(feature = "GamepadHapticActuatorType")] #[allow(non_snake_case)] mod gen_GamepadHapticActuatorType; #[cfg(feature = "GamepadHapticActuatorType")] +#[allow(unused_imports)] pub use gen_GamepadHapticActuatorType::*; #[cfg(feature = "GamepadMappingType")] #[allow(non_snake_case)] mod gen_GamepadMappingType; #[cfg(feature = "GamepadMappingType")] +#[allow(unused_imports)] pub use gen_GamepadMappingType::*; #[cfg(feature = "GamepadPose")] #[allow(non_snake_case)] mod gen_GamepadPose; #[cfg(feature = "GamepadPose")] +#[allow(unused_imports)] pub use gen_GamepadPose::*; #[cfg(feature = "GamepadServiceTest")] #[allow(non_snake_case)] mod gen_GamepadServiceTest; #[cfg(feature = "GamepadServiceTest")] +#[allow(unused_imports)] pub use gen_GamepadServiceTest::*; #[cfg(feature = "Geolocation")] #[allow(non_snake_case)] mod gen_Geolocation; #[cfg(feature = "Geolocation")] +#[allow(unused_imports)] pub use gen_Geolocation::*; #[cfg(feature = "GetAnimationsOptions")] #[allow(non_snake_case)] mod gen_GetAnimationsOptions; #[cfg(feature = "GetAnimationsOptions")] +#[allow(unused_imports)] pub use gen_GetAnimationsOptions::*; #[cfg(feature = "GetRootNodeOptions")] #[allow(non_snake_case)] mod gen_GetRootNodeOptions; #[cfg(feature = "GetRootNodeOptions")] +#[allow(unused_imports)] pub use gen_GetRootNodeOptions::*; #[cfg(feature = "GetUserMediaRequest")] #[allow(non_snake_case)] mod gen_GetUserMediaRequest; #[cfg(feature = "GetUserMediaRequest")] +#[allow(unused_imports)] pub use gen_GetUserMediaRequest::*; #[cfg(feature = "Gpu")] #[allow(non_snake_case)] mod gen_Gpu; #[cfg(feature = "Gpu")] +#[allow(unused_imports)] pub use gen_Gpu::*; #[cfg(feature = "GpuAdapter")] #[allow(non_snake_case)] mod gen_GpuAdapter; #[cfg(feature = "GpuAdapter")] +#[allow(unused_imports)] pub use gen_GpuAdapter::*; #[cfg(feature = "GpuAdapterInfo")] #[allow(non_snake_case)] mod gen_GpuAdapterInfo; #[cfg(feature = "GpuAdapterInfo")] +#[allow(unused_imports)] pub use gen_GpuAdapterInfo::*; #[cfg(feature = "GpuAddressMode")] #[allow(non_snake_case)] mod gen_GpuAddressMode; #[cfg(feature = "GpuAddressMode")] +#[allow(unused_imports)] pub use gen_GpuAddressMode::*; #[cfg(feature = "GpuAutoLayoutMode")] #[allow(non_snake_case)] mod gen_GpuAutoLayoutMode; #[cfg(feature = "GpuAutoLayoutMode")] +#[allow(unused_imports)] pub use gen_GpuAutoLayoutMode::*; #[cfg(feature = "GpuBindGroup")] #[allow(non_snake_case)] mod gen_GpuBindGroup; #[cfg(feature = "GpuBindGroup")] +#[allow(unused_imports)] pub use gen_GpuBindGroup::*; #[cfg(feature = "GpuBindGroupDescriptor")] #[allow(non_snake_case)] mod gen_GpuBindGroupDescriptor; #[cfg(feature = "GpuBindGroupDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBindGroupDescriptor::*; #[cfg(feature = "GpuBindGroupEntry")] #[allow(non_snake_case)] mod gen_GpuBindGroupEntry; #[cfg(feature = "GpuBindGroupEntry")] +#[allow(unused_imports)] pub use gen_GpuBindGroupEntry::*; #[cfg(feature = "GpuBindGroupLayout")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayout; #[cfg(feature = "GpuBindGroupLayout")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayout::*; #[cfg(feature = "GpuBindGroupLayoutDescriptor")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayoutDescriptor; #[cfg(feature = "GpuBindGroupLayoutDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayoutDescriptor::*; #[cfg(feature = "GpuBindGroupLayoutEntry")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayoutEntry; #[cfg(feature = "GpuBindGroupLayoutEntry")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayoutEntry::*; #[cfg(feature = "GpuBlendComponent")] #[allow(non_snake_case)] mod gen_GpuBlendComponent; #[cfg(feature = "GpuBlendComponent")] +#[allow(unused_imports)] pub use gen_GpuBlendComponent::*; #[cfg(feature = "GpuBlendFactor")] #[allow(non_snake_case)] mod gen_GpuBlendFactor; #[cfg(feature = "GpuBlendFactor")] +#[allow(unused_imports)] pub use gen_GpuBlendFactor::*; #[cfg(feature = "GpuBlendOperation")] #[allow(non_snake_case)] mod gen_GpuBlendOperation; #[cfg(feature = "GpuBlendOperation")] +#[allow(unused_imports)] pub use gen_GpuBlendOperation::*; #[cfg(feature = "GpuBlendState")] #[allow(non_snake_case)] mod gen_GpuBlendState; #[cfg(feature = "GpuBlendState")] +#[allow(unused_imports)] pub use gen_GpuBlendState::*; #[cfg(feature = "GpuBuffer")] #[allow(non_snake_case)] mod gen_GpuBuffer; #[cfg(feature = "GpuBuffer")] +#[allow(unused_imports)] pub use gen_GpuBuffer::*; #[cfg(feature = "GpuBufferBinding")] #[allow(non_snake_case)] mod gen_GpuBufferBinding; #[cfg(feature = "GpuBufferBinding")] +#[allow(unused_imports)] pub use gen_GpuBufferBinding::*; #[cfg(feature = "GpuBufferBindingLayout")] #[allow(non_snake_case)] mod gen_GpuBufferBindingLayout; #[cfg(feature = "GpuBufferBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuBufferBindingLayout::*; #[cfg(feature = "GpuBufferBindingType")] #[allow(non_snake_case)] mod gen_GpuBufferBindingType; #[cfg(feature = "GpuBufferBindingType")] +#[allow(unused_imports)] pub use gen_GpuBufferBindingType::*; #[cfg(feature = "GpuBufferDescriptor")] #[allow(non_snake_case)] mod gen_GpuBufferDescriptor; #[cfg(feature = "GpuBufferDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBufferDescriptor::*; #[cfg(feature = "GpuBufferMapState")] #[allow(non_snake_case)] mod gen_GpuBufferMapState; #[cfg(feature = "GpuBufferMapState")] +#[allow(unused_imports)] pub use gen_GpuBufferMapState::*; #[cfg(feature = "GpuCanvasAlphaMode")] #[allow(non_snake_case)] mod gen_GpuCanvasAlphaMode; #[cfg(feature = "GpuCanvasAlphaMode")] +#[allow(unused_imports)] pub use gen_GpuCanvasAlphaMode::*; #[cfg(feature = "GpuCanvasConfiguration")] #[allow(non_snake_case)] mod gen_GpuCanvasConfiguration; #[cfg(feature = "GpuCanvasConfiguration")] +#[allow(unused_imports)] pub use gen_GpuCanvasConfiguration::*; #[cfg(feature = "GpuCanvasContext")] #[allow(non_snake_case)] mod gen_GpuCanvasContext; #[cfg(feature = "GpuCanvasContext")] +#[allow(unused_imports)] pub use gen_GpuCanvasContext::*; #[cfg(feature = "GpuColorDict")] #[allow(non_snake_case)] mod gen_GpuColorDict; #[cfg(feature = "GpuColorDict")] +#[allow(unused_imports)] pub use gen_GpuColorDict::*; #[cfg(feature = "GpuColorTargetState")] #[allow(non_snake_case)] mod gen_GpuColorTargetState; #[cfg(feature = "GpuColorTargetState")] +#[allow(unused_imports)] pub use gen_GpuColorTargetState::*; #[cfg(feature = "GpuCommandBuffer")] #[allow(non_snake_case)] mod gen_GpuCommandBuffer; #[cfg(feature = "GpuCommandBuffer")] +#[allow(unused_imports)] pub use gen_GpuCommandBuffer::*; #[cfg(feature = "GpuCommandBufferDescriptor")] #[allow(non_snake_case)] mod gen_GpuCommandBufferDescriptor; #[cfg(feature = "GpuCommandBufferDescriptor")] +#[allow(unused_imports)] pub use gen_GpuCommandBufferDescriptor::*; #[cfg(feature = "GpuCommandEncoder")] #[allow(non_snake_case)] mod gen_GpuCommandEncoder; #[cfg(feature = "GpuCommandEncoder")] +#[allow(unused_imports)] pub use gen_GpuCommandEncoder::*; #[cfg(feature = "GpuCommandEncoderDescriptor")] #[allow(non_snake_case)] mod gen_GpuCommandEncoderDescriptor; #[cfg(feature = "GpuCommandEncoderDescriptor")] +#[allow(unused_imports)] pub use gen_GpuCommandEncoderDescriptor::*; #[cfg(feature = "GpuCompareFunction")] #[allow(non_snake_case)] mod gen_GpuCompareFunction; #[cfg(feature = "GpuCompareFunction")] +#[allow(unused_imports)] pub use gen_GpuCompareFunction::*; #[cfg(feature = "GpuCompilationInfo")] #[allow(non_snake_case)] mod gen_GpuCompilationInfo; #[cfg(feature = "GpuCompilationInfo")] +#[allow(unused_imports)] pub use gen_GpuCompilationInfo::*; #[cfg(feature = "GpuCompilationMessage")] #[allow(non_snake_case)] mod gen_GpuCompilationMessage; #[cfg(feature = "GpuCompilationMessage")] +#[allow(unused_imports)] pub use gen_GpuCompilationMessage::*; #[cfg(feature = "GpuCompilationMessageType")] #[allow(non_snake_case)] mod gen_GpuCompilationMessageType; #[cfg(feature = "GpuCompilationMessageType")] +#[allow(unused_imports)] pub use gen_GpuCompilationMessageType::*; #[cfg(feature = "GpuComputePassDescriptor")] #[allow(non_snake_case)] mod gen_GpuComputePassDescriptor; #[cfg(feature = "GpuComputePassDescriptor")] +#[allow(unused_imports)] pub use gen_GpuComputePassDescriptor::*; #[cfg(feature = "GpuComputePassEncoder")] #[allow(non_snake_case)] mod gen_GpuComputePassEncoder; #[cfg(feature = "GpuComputePassEncoder")] +#[allow(unused_imports)] pub use gen_GpuComputePassEncoder::*; #[cfg(feature = "GpuComputePassTimestampWrites")] #[allow(non_snake_case)] mod gen_GpuComputePassTimestampWrites; #[cfg(feature = "GpuComputePassTimestampWrites")] +#[allow(unused_imports)] pub use gen_GpuComputePassTimestampWrites::*; #[cfg(feature = "GpuComputePipeline")] #[allow(non_snake_case)] mod gen_GpuComputePipeline; #[cfg(feature = "GpuComputePipeline")] +#[allow(unused_imports)] pub use gen_GpuComputePipeline::*; #[cfg(feature = "GpuComputePipelineDescriptor")] #[allow(non_snake_case)] mod gen_GpuComputePipelineDescriptor; #[cfg(feature = "GpuComputePipelineDescriptor")] +#[allow(unused_imports)] pub use gen_GpuComputePipelineDescriptor::*; #[cfg(feature = "GpuCullMode")] #[allow(non_snake_case)] mod gen_GpuCullMode; #[cfg(feature = "GpuCullMode")] +#[allow(unused_imports)] pub use gen_GpuCullMode::*; #[cfg(feature = "GpuDepthStencilState")] #[allow(non_snake_case)] mod gen_GpuDepthStencilState; #[cfg(feature = "GpuDepthStencilState")] +#[allow(unused_imports)] pub use gen_GpuDepthStencilState::*; #[cfg(feature = "GpuDevice")] #[allow(non_snake_case)] mod gen_GpuDevice; #[cfg(feature = "GpuDevice")] +#[allow(unused_imports)] pub use gen_GpuDevice::*; #[cfg(feature = "GpuDeviceDescriptor")] #[allow(non_snake_case)] mod gen_GpuDeviceDescriptor; #[cfg(feature = "GpuDeviceDescriptor")] +#[allow(unused_imports)] pub use gen_GpuDeviceDescriptor::*; #[cfg(feature = "GpuDeviceLostInfo")] #[allow(non_snake_case)] mod gen_GpuDeviceLostInfo; #[cfg(feature = "GpuDeviceLostInfo")] +#[allow(unused_imports)] pub use gen_GpuDeviceLostInfo::*; #[cfg(feature = "GpuDeviceLostReason")] #[allow(non_snake_case)] mod gen_GpuDeviceLostReason; #[cfg(feature = "GpuDeviceLostReason")] +#[allow(unused_imports)] pub use gen_GpuDeviceLostReason::*; #[cfg(feature = "GpuError")] #[allow(non_snake_case)] mod gen_GpuError; #[cfg(feature = "GpuError")] +#[allow(unused_imports)] pub use gen_GpuError::*; #[cfg(feature = "GpuErrorFilter")] #[allow(non_snake_case)] mod gen_GpuErrorFilter; #[cfg(feature = "GpuErrorFilter")] +#[allow(unused_imports)] pub use gen_GpuErrorFilter::*; #[cfg(feature = "GpuExtent3dDict")] #[allow(non_snake_case)] mod gen_GpuExtent3dDict; #[cfg(feature = "GpuExtent3dDict")] +#[allow(unused_imports)] pub use gen_GpuExtent3dDict::*; #[cfg(feature = "GpuExternalTexture")] #[allow(non_snake_case)] mod gen_GpuExternalTexture; #[cfg(feature = "GpuExternalTexture")] +#[allow(unused_imports)] pub use gen_GpuExternalTexture::*; #[cfg(feature = "GpuExternalTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuExternalTextureBindingLayout; #[cfg(feature = "GpuExternalTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuExternalTextureBindingLayout::*; #[cfg(feature = "GpuExternalTextureDescriptor")] #[allow(non_snake_case)] mod gen_GpuExternalTextureDescriptor; #[cfg(feature = "GpuExternalTextureDescriptor")] +#[allow(unused_imports)] pub use gen_GpuExternalTextureDescriptor::*; #[cfg(feature = "GpuFeatureName")] #[allow(non_snake_case)] mod gen_GpuFeatureName; #[cfg(feature = "GpuFeatureName")] +#[allow(unused_imports)] pub use gen_GpuFeatureName::*; #[cfg(feature = "GpuFilterMode")] #[allow(non_snake_case)] mod gen_GpuFilterMode; #[cfg(feature = "GpuFilterMode")] +#[allow(unused_imports)] pub use gen_GpuFilterMode::*; #[cfg(feature = "GpuFragmentState")] #[allow(non_snake_case)] mod gen_GpuFragmentState; #[cfg(feature = "GpuFragmentState")] +#[allow(unused_imports)] pub use gen_GpuFragmentState::*; #[cfg(feature = "GpuFrontFace")] #[allow(non_snake_case)] mod gen_GpuFrontFace; #[cfg(feature = "GpuFrontFace")] +#[allow(unused_imports)] pub use gen_GpuFrontFace::*; #[cfg(feature = "GpuImageCopyBuffer")] #[allow(non_snake_case)] mod gen_GpuImageCopyBuffer; #[cfg(feature = "GpuImageCopyBuffer")] +#[allow(unused_imports)] pub use gen_GpuImageCopyBuffer::*; #[cfg(feature = "GpuImageCopyExternalImage")] #[allow(non_snake_case)] mod gen_GpuImageCopyExternalImage; #[cfg(feature = "GpuImageCopyExternalImage")] +#[allow(unused_imports)] pub use gen_GpuImageCopyExternalImage::*; #[cfg(feature = "GpuImageCopyTexture")] #[allow(non_snake_case)] mod gen_GpuImageCopyTexture; #[cfg(feature = "GpuImageCopyTexture")] +#[allow(unused_imports)] pub use gen_GpuImageCopyTexture::*; #[cfg(feature = "GpuImageCopyTextureTagged")] #[allow(non_snake_case)] mod gen_GpuImageCopyTextureTagged; #[cfg(feature = "GpuImageCopyTextureTagged")] +#[allow(unused_imports)] pub use gen_GpuImageCopyTextureTagged::*; #[cfg(feature = "GpuImageDataLayout")] #[allow(non_snake_case)] mod gen_GpuImageDataLayout; #[cfg(feature = "GpuImageDataLayout")] +#[allow(unused_imports)] pub use gen_GpuImageDataLayout::*; #[cfg(feature = "GpuIndexFormat")] #[allow(non_snake_case)] mod gen_GpuIndexFormat; #[cfg(feature = "GpuIndexFormat")] +#[allow(unused_imports)] pub use gen_GpuIndexFormat::*; #[cfg(feature = "GpuInternalError")] #[allow(non_snake_case)] mod gen_GpuInternalError; #[cfg(feature = "GpuInternalError")] +#[allow(unused_imports)] pub use gen_GpuInternalError::*; #[cfg(feature = "GpuLoadOp")] #[allow(non_snake_case)] mod gen_GpuLoadOp; #[cfg(feature = "GpuLoadOp")] +#[allow(unused_imports)] pub use gen_GpuLoadOp::*; #[cfg(feature = "GpuMipmapFilterMode")] #[allow(non_snake_case)] mod gen_GpuMipmapFilterMode; #[cfg(feature = "GpuMipmapFilterMode")] +#[allow(unused_imports)] pub use gen_GpuMipmapFilterMode::*; #[cfg(feature = "GpuMultisampleState")] #[allow(non_snake_case)] mod gen_GpuMultisampleState; #[cfg(feature = "GpuMultisampleState")] +#[allow(unused_imports)] pub use gen_GpuMultisampleState::*; #[cfg(feature = "GpuObjectDescriptorBase")] #[allow(non_snake_case)] mod gen_GpuObjectDescriptorBase; #[cfg(feature = "GpuObjectDescriptorBase")] +#[allow(unused_imports)] pub use gen_GpuObjectDescriptorBase::*; #[cfg(feature = "GpuOrigin2dDict")] #[allow(non_snake_case)] mod gen_GpuOrigin2dDict; #[cfg(feature = "GpuOrigin2dDict")] +#[allow(unused_imports)] pub use gen_GpuOrigin2dDict::*; #[cfg(feature = "GpuOrigin3dDict")] #[allow(non_snake_case)] mod gen_GpuOrigin3dDict; #[cfg(feature = "GpuOrigin3dDict")] +#[allow(unused_imports)] pub use gen_GpuOrigin3dDict::*; #[cfg(feature = "GpuOutOfMemoryError")] #[allow(non_snake_case)] mod gen_GpuOutOfMemoryError; #[cfg(feature = "GpuOutOfMemoryError")] +#[allow(unused_imports)] pub use gen_GpuOutOfMemoryError::*; #[cfg(feature = "GpuPipelineDescriptorBase")] #[allow(non_snake_case)] mod gen_GpuPipelineDescriptorBase; #[cfg(feature = "GpuPipelineDescriptorBase")] +#[allow(unused_imports)] pub use gen_GpuPipelineDescriptorBase::*; #[cfg(feature = "GpuPipelineError")] #[allow(non_snake_case)] mod gen_GpuPipelineError; #[cfg(feature = "GpuPipelineError")] +#[allow(unused_imports)] pub use gen_GpuPipelineError::*; #[cfg(feature = "GpuPipelineErrorInit")] #[allow(non_snake_case)] mod gen_GpuPipelineErrorInit; #[cfg(feature = "GpuPipelineErrorInit")] +#[allow(unused_imports)] pub use gen_GpuPipelineErrorInit::*; #[cfg(feature = "GpuPipelineErrorReason")] #[allow(non_snake_case)] mod gen_GpuPipelineErrorReason; #[cfg(feature = "GpuPipelineErrorReason")] +#[allow(unused_imports)] pub use gen_GpuPipelineErrorReason::*; #[cfg(feature = "GpuPipelineLayout")] #[allow(non_snake_case)] mod gen_GpuPipelineLayout; #[cfg(feature = "GpuPipelineLayout")] +#[allow(unused_imports)] pub use gen_GpuPipelineLayout::*; #[cfg(feature = "GpuPipelineLayoutDescriptor")] #[allow(non_snake_case)] mod gen_GpuPipelineLayoutDescriptor; #[cfg(feature = "GpuPipelineLayoutDescriptor")] +#[allow(unused_imports)] pub use gen_GpuPipelineLayoutDescriptor::*; #[cfg(feature = "GpuPowerPreference")] #[allow(non_snake_case)] mod gen_GpuPowerPreference; #[cfg(feature = "GpuPowerPreference")] +#[allow(unused_imports)] pub use gen_GpuPowerPreference::*; #[cfg(feature = "GpuPrimitiveState")] #[allow(non_snake_case)] mod gen_GpuPrimitiveState; #[cfg(feature = "GpuPrimitiveState")] +#[allow(unused_imports)] pub use gen_GpuPrimitiveState::*; #[cfg(feature = "GpuPrimitiveTopology")] #[allow(non_snake_case)] mod gen_GpuPrimitiveTopology; #[cfg(feature = "GpuPrimitiveTopology")] +#[allow(unused_imports)] pub use gen_GpuPrimitiveTopology::*; #[cfg(feature = "GpuProgrammableStage")] #[allow(non_snake_case)] mod gen_GpuProgrammableStage; #[cfg(feature = "GpuProgrammableStage")] +#[allow(unused_imports)] pub use gen_GpuProgrammableStage::*; #[cfg(feature = "GpuQuerySet")] #[allow(non_snake_case)] mod gen_GpuQuerySet; #[cfg(feature = "GpuQuerySet")] +#[allow(unused_imports)] pub use gen_GpuQuerySet::*; #[cfg(feature = "GpuQuerySetDescriptor")] #[allow(non_snake_case)] mod gen_GpuQuerySetDescriptor; #[cfg(feature = "GpuQuerySetDescriptor")] +#[allow(unused_imports)] pub use gen_GpuQuerySetDescriptor::*; #[cfg(feature = "GpuQueryType")] #[allow(non_snake_case)] mod gen_GpuQueryType; #[cfg(feature = "GpuQueryType")] +#[allow(unused_imports)] pub use gen_GpuQueryType::*; #[cfg(feature = "GpuQueue")] #[allow(non_snake_case)] mod gen_GpuQueue; #[cfg(feature = "GpuQueue")] +#[allow(unused_imports)] pub use gen_GpuQueue::*; #[cfg(feature = "GpuQueueDescriptor")] #[allow(non_snake_case)] mod gen_GpuQueueDescriptor; #[cfg(feature = "GpuQueueDescriptor")] +#[allow(unused_imports)] pub use gen_GpuQueueDescriptor::*; #[cfg(feature = "GpuRenderBundle")] #[allow(non_snake_case)] mod gen_GpuRenderBundle; #[cfg(feature = "GpuRenderBundle")] +#[allow(unused_imports)] pub use gen_GpuRenderBundle::*; #[cfg(feature = "GpuRenderBundleDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderBundleDescriptor; #[cfg(feature = "GpuRenderBundleDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleDescriptor::*; #[cfg(feature = "GpuRenderBundleEncoder")] #[allow(non_snake_case)] mod gen_GpuRenderBundleEncoder; #[cfg(feature = "GpuRenderBundleEncoder")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleEncoder::*; #[cfg(feature = "GpuRenderBundleEncoderDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderBundleEncoderDescriptor; #[cfg(feature = "GpuRenderBundleEncoderDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleEncoderDescriptor::*; #[cfg(feature = "GpuRenderPassColorAttachment")] #[allow(non_snake_case)] mod gen_GpuRenderPassColorAttachment; #[cfg(feature = "GpuRenderPassColorAttachment")] +#[allow(unused_imports)] pub use gen_GpuRenderPassColorAttachment::*; #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] #[allow(non_snake_case)] mod gen_GpuRenderPassDepthStencilAttachment; #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] +#[allow(unused_imports)] pub use gen_GpuRenderPassDepthStencilAttachment::*; #[cfg(feature = "GpuRenderPassDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderPassDescriptor; #[cfg(feature = "GpuRenderPassDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderPassDescriptor::*; #[cfg(feature = "GpuRenderPassEncoder")] #[allow(non_snake_case)] mod gen_GpuRenderPassEncoder; #[cfg(feature = "GpuRenderPassEncoder")] +#[allow(unused_imports)] pub use gen_GpuRenderPassEncoder::*; #[cfg(feature = "GpuRenderPassLayout")] #[allow(non_snake_case)] mod gen_GpuRenderPassLayout; #[cfg(feature = "GpuRenderPassLayout")] +#[allow(unused_imports)] pub use gen_GpuRenderPassLayout::*; #[cfg(feature = "GpuRenderPassTimestampWrites")] #[allow(non_snake_case)] mod gen_GpuRenderPassTimestampWrites; #[cfg(feature = "GpuRenderPassTimestampWrites")] +#[allow(unused_imports)] pub use gen_GpuRenderPassTimestampWrites::*; #[cfg(feature = "GpuRenderPipeline")] #[allow(non_snake_case)] mod gen_GpuRenderPipeline; #[cfg(feature = "GpuRenderPipeline")] +#[allow(unused_imports)] pub use gen_GpuRenderPipeline::*; #[cfg(feature = "GpuRenderPipelineDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderPipelineDescriptor; #[cfg(feature = "GpuRenderPipelineDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderPipelineDescriptor::*; #[cfg(feature = "GpuRequestAdapterOptions")] #[allow(non_snake_case)] mod gen_GpuRequestAdapterOptions; #[cfg(feature = "GpuRequestAdapterOptions")] +#[allow(unused_imports)] pub use gen_GpuRequestAdapterOptions::*; #[cfg(feature = "GpuSampler")] #[allow(non_snake_case)] mod gen_GpuSampler; #[cfg(feature = "GpuSampler")] +#[allow(unused_imports)] pub use gen_GpuSampler::*; #[cfg(feature = "GpuSamplerBindingLayout")] #[allow(non_snake_case)] mod gen_GpuSamplerBindingLayout; #[cfg(feature = "GpuSamplerBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuSamplerBindingLayout::*; #[cfg(feature = "GpuSamplerBindingType")] #[allow(non_snake_case)] mod gen_GpuSamplerBindingType; #[cfg(feature = "GpuSamplerBindingType")] +#[allow(unused_imports)] pub use gen_GpuSamplerBindingType::*; #[cfg(feature = "GpuSamplerDescriptor")] #[allow(non_snake_case)] mod gen_GpuSamplerDescriptor; #[cfg(feature = "GpuSamplerDescriptor")] +#[allow(unused_imports)] pub use gen_GpuSamplerDescriptor::*; #[cfg(feature = "GpuShaderModule")] #[allow(non_snake_case)] mod gen_GpuShaderModule; #[cfg(feature = "GpuShaderModule")] +#[allow(unused_imports)] pub use gen_GpuShaderModule::*; #[cfg(feature = "GpuShaderModuleCompilationHint")] #[allow(non_snake_case)] mod gen_GpuShaderModuleCompilationHint; #[cfg(feature = "GpuShaderModuleCompilationHint")] +#[allow(unused_imports)] pub use gen_GpuShaderModuleCompilationHint::*; #[cfg(feature = "GpuShaderModuleDescriptor")] #[allow(non_snake_case)] mod gen_GpuShaderModuleDescriptor; #[cfg(feature = "GpuShaderModuleDescriptor")] +#[allow(unused_imports)] pub use gen_GpuShaderModuleDescriptor::*; #[cfg(feature = "GpuStencilFaceState")] #[allow(non_snake_case)] mod gen_GpuStencilFaceState; #[cfg(feature = "GpuStencilFaceState")] +#[allow(unused_imports)] pub use gen_GpuStencilFaceState::*; #[cfg(feature = "GpuStencilOperation")] #[allow(non_snake_case)] mod gen_GpuStencilOperation; #[cfg(feature = "GpuStencilOperation")] +#[allow(unused_imports)] pub use gen_GpuStencilOperation::*; #[cfg(feature = "GpuStorageTextureAccess")] #[allow(non_snake_case)] mod gen_GpuStorageTextureAccess; #[cfg(feature = "GpuStorageTextureAccess")] +#[allow(unused_imports)] pub use gen_GpuStorageTextureAccess::*; #[cfg(feature = "GpuStorageTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuStorageTextureBindingLayout; #[cfg(feature = "GpuStorageTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuStorageTextureBindingLayout::*; #[cfg(feature = "GpuStoreOp")] #[allow(non_snake_case)] mod gen_GpuStoreOp; #[cfg(feature = "GpuStoreOp")] +#[allow(unused_imports)] pub use gen_GpuStoreOp::*; #[cfg(feature = "GpuSupportedFeatures")] #[allow(non_snake_case)] mod gen_GpuSupportedFeatures; #[cfg(feature = "GpuSupportedFeatures")] +#[allow(unused_imports)] pub use gen_GpuSupportedFeatures::*; #[cfg(feature = "GpuSupportedLimits")] #[allow(non_snake_case)] mod gen_GpuSupportedLimits; #[cfg(feature = "GpuSupportedLimits")] +#[allow(unused_imports)] pub use gen_GpuSupportedLimits::*; #[cfg(feature = "GpuTexture")] #[allow(non_snake_case)] mod gen_GpuTexture; #[cfg(feature = "GpuTexture")] +#[allow(unused_imports)] pub use gen_GpuTexture::*; #[cfg(feature = "GpuTextureAspect")] #[allow(non_snake_case)] mod gen_GpuTextureAspect; #[cfg(feature = "GpuTextureAspect")] +#[allow(unused_imports)] pub use gen_GpuTextureAspect::*; #[cfg(feature = "GpuTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuTextureBindingLayout; #[cfg(feature = "GpuTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuTextureBindingLayout::*; #[cfg(feature = "GpuTextureDescriptor")] #[allow(non_snake_case)] mod gen_GpuTextureDescriptor; #[cfg(feature = "GpuTextureDescriptor")] +#[allow(unused_imports)] pub use gen_GpuTextureDescriptor::*; #[cfg(feature = "GpuTextureDimension")] #[allow(non_snake_case)] mod gen_GpuTextureDimension; #[cfg(feature = "GpuTextureDimension")] +#[allow(unused_imports)] pub use gen_GpuTextureDimension::*; #[cfg(feature = "GpuTextureFormat")] #[allow(non_snake_case)] mod gen_GpuTextureFormat; #[cfg(feature = "GpuTextureFormat")] +#[allow(unused_imports)] pub use gen_GpuTextureFormat::*; #[cfg(feature = "GpuTextureSampleType")] #[allow(non_snake_case)] mod gen_GpuTextureSampleType; #[cfg(feature = "GpuTextureSampleType")] +#[allow(unused_imports)] pub use gen_GpuTextureSampleType::*; #[cfg(feature = "GpuTextureView")] #[allow(non_snake_case)] mod gen_GpuTextureView; #[cfg(feature = "GpuTextureView")] +#[allow(unused_imports)] pub use gen_GpuTextureView::*; #[cfg(feature = "GpuTextureViewDescriptor")] #[allow(non_snake_case)] mod gen_GpuTextureViewDescriptor; #[cfg(feature = "GpuTextureViewDescriptor")] +#[allow(unused_imports)] pub use gen_GpuTextureViewDescriptor::*; #[cfg(feature = "GpuTextureViewDimension")] #[allow(non_snake_case)] mod gen_GpuTextureViewDimension; #[cfg(feature = "GpuTextureViewDimension")] +#[allow(unused_imports)] pub use gen_GpuTextureViewDimension::*; #[cfg(feature = "GpuUncapturedErrorEvent")] #[allow(non_snake_case)] mod gen_GpuUncapturedErrorEvent; #[cfg(feature = "GpuUncapturedErrorEvent")] +#[allow(unused_imports)] pub use gen_GpuUncapturedErrorEvent::*; #[cfg(feature = "GpuUncapturedErrorEventInit")] #[allow(non_snake_case)] mod gen_GpuUncapturedErrorEventInit; #[cfg(feature = "GpuUncapturedErrorEventInit")] +#[allow(unused_imports)] pub use gen_GpuUncapturedErrorEventInit::*; #[cfg(feature = "GpuValidationError")] #[allow(non_snake_case)] mod gen_GpuValidationError; #[cfg(feature = "GpuValidationError")] +#[allow(unused_imports)] pub use gen_GpuValidationError::*; #[cfg(feature = "GpuVertexAttribute")] #[allow(non_snake_case)] mod gen_GpuVertexAttribute; #[cfg(feature = "GpuVertexAttribute")] +#[allow(unused_imports)] pub use gen_GpuVertexAttribute::*; #[cfg(feature = "GpuVertexBufferLayout")] #[allow(non_snake_case)] mod gen_GpuVertexBufferLayout; #[cfg(feature = "GpuVertexBufferLayout")] +#[allow(unused_imports)] pub use gen_GpuVertexBufferLayout::*; #[cfg(feature = "GpuVertexFormat")] #[allow(non_snake_case)] mod gen_GpuVertexFormat; #[cfg(feature = "GpuVertexFormat")] +#[allow(unused_imports)] pub use gen_GpuVertexFormat::*; #[cfg(feature = "GpuVertexState")] #[allow(non_snake_case)] mod gen_GpuVertexState; #[cfg(feature = "GpuVertexState")] +#[allow(unused_imports)] pub use gen_GpuVertexState::*; #[cfg(feature = "GpuVertexStepMode")] #[allow(non_snake_case)] mod gen_GpuVertexStepMode; #[cfg(feature = "GpuVertexStepMode")] +#[allow(unused_imports)] pub use gen_GpuVertexStepMode::*; -#[cfg(feature = "GridDeclaration")] -#[allow(non_snake_case)] -mod gen_GridDeclaration; -#[cfg(feature = "GridDeclaration")] -pub use gen_GridDeclaration::*; - -#[cfg(feature = "GridTrackState")] -#[allow(non_snake_case)] -mod gen_GridTrackState; -#[cfg(feature = "GridTrackState")] -pub use gen_GridTrackState::*; - #[cfg(feature = "GroupedHistoryEventInit")] #[allow(non_snake_case)] mod gen_GroupedHistoryEventInit; #[cfg(feature = "GroupedHistoryEventInit")] +#[allow(unused_imports)] pub use gen_GroupedHistoryEventInit::*; #[cfg(feature = "HalfOpenInfoDict")] #[allow(non_snake_case)] mod gen_HalfOpenInfoDict; #[cfg(feature = "HalfOpenInfoDict")] +#[allow(unused_imports)] pub use gen_HalfOpenInfoDict::*; #[cfg(feature = "HardwareAcceleration")] #[allow(non_snake_case)] mod gen_HardwareAcceleration; #[cfg(feature = "HardwareAcceleration")] +#[allow(unused_imports)] pub use gen_HardwareAcceleration::*; #[cfg(feature = "HashChangeEvent")] #[allow(non_snake_case)] mod gen_HashChangeEvent; #[cfg(feature = "HashChangeEvent")] +#[allow(unused_imports)] pub use gen_HashChangeEvent::*; #[cfg(feature = "HashChangeEventInit")] #[allow(non_snake_case)] mod gen_HashChangeEventInit; #[cfg(feature = "HashChangeEventInit")] +#[allow(unused_imports)] pub use gen_HashChangeEventInit::*; #[cfg(feature = "Headers")] #[allow(non_snake_case)] mod gen_Headers; #[cfg(feature = "Headers")] +#[allow(unused_imports)] pub use gen_Headers::*; #[cfg(feature = "HeadersGuardEnum")] #[allow(non_snake_case)] mod gen_HeadersGuardEnum; #[cfg(feature = "HeadersGuardEnum")] +#[allow(unused_imports)] pub use gen_HeadersGuardEnum::*; #[cfg(feature = "Hid")] #[allow(non_snake_case)] mod gen_Hid; #[cfg(feature = "Hid")] +#[allow(unused_imports)] pub use gen_Hid::*; #[cfg(feature = "HidCollectionInfo")] #[allow(non_snake_case)] mod gen_HidCollectionInfo; #[cfg(feature = "HidCollectionInfo")] +#[allow(unused_imports)] pub use gen_HidCollectionInfo::*; #[cfg(feature = "HidConnectionEvent")] #[allow(non_snake_case)] mod gen_HidConnectionEvent; #[cfg(feature = "HidConnectionEvent")] +#[allow(unused_imports)] pub use gen_HidConnectionEvent::*; #[cfg(feature = "HidConnectionEventInit")] #[allow(non_snake_case)] mod gen_HidConnectionEventInit; #[cfg(feature = "HidConnectionEventInit")] +#[allow(unused_imports)] pub use gen_HidConnectionEventInit::*; #[cfg(feature = "HidDevice")] #[allow(non_snake_case)] mod gen_HidDevice; #[cfg(feature = "HidDevice")] +#[allow(unused_imports)] pub use gen_HidDevice::*; #[cfg(feature = "HidDeviceFilter")] #[allow(non_snake_case)] mod gen_HidDeviceFilter; #[cfg(feature = "HidDeviceFilter")] +#[allow(unused_imports)] pub use gen_HidDeviceFilter::*; #[cfg(feature = "HidDeviceRequestOptions")] #[allow(non_snake_case)] mod gen_HidDeviceRequestOptions; #[cfg(feature = "HidDeviceRequestOptions")] +#[allow(unused_imports)] pub use gen_HidDeviceRequestOptions::*; #[cfg(feature = "HidInputReportEvent")] #[allow(non_snake_case)] mod gen_HidInputReportEvent; #[cfg(feature = "HidInputReportEvent")] +#[allow(unused_imports)] pub use gen_HidInputReportEvent::*; #[cfg(feature = "HidInputReportEventInit")] #[allow(non_snake_case)] mod gen_HidInputReportEventInit; #[cfg(feature = "HidInputReportEventInit")] +#[allow(unused_imports)] pub use gen_HidInputReportEventInit::*; #[cfg(feature = "HidReportInfo")] #[allow(non_snake_case)] mod gen_HidReportInfo; #[cfg(feature = "HidReportInfo")] +#[allow(unused_imports)] pub use gen_HidReportInfo::*; #[cfg(feature = "HidReportItem")] #[allow(non_snake_case)] mod gen_HidReportItem; #[cfg(feature = "HidReportItem")] +#[allow(unused_imports)] pub use gen_HidReportItem::*; #[cfg(feature = "HidUnitSystem")] #[allow(non_snake_case)] mod gen_HidUnitSystem; #[cfg(feature = "HidUnitSystem")] +#[allow(unused_imports)] pub use gen_HidUnitSystem::*; #[cfg(feature = "HiddenPluginEventInit")] #[allow(non_snake_case)] mod gen_HiddenPluginEventInit; #[cfg(feature = "HiddenPluginEventInit")] +#[allow(unused_imports)] pub use gen_HiddenPluginEventInit::*; #[cfg(feature = "History")] #[allow(non_snake_case)] mod gen_History; #[cfg(feature = "History")] +#[allow(unused_imports)] pub use gen_History::*; #[cfg(feature = "HitRegionOptions")] #[allow(non_snake_case)] mod gen_HitRegionOptions; #[cfg(feature = "HitRegionOptions")] +#[allow(unused_imports)] pub use gen_HitRegionOptions::*; #[cfg(feature = "HkdfParams")] #[allow(non_snake_case)] mod gen_HkdfParams; #[cfg(feature = "HkdfParams")] +#[allow(unused_imports)] pub use gen_HkdfParams::*; #[cfg(feature = "HmacDerivedKeyParams")] #[allow(non_snake_case)] mod gen_HmacDerivedKeyParams; #[cfg(feature = "HmacDerivedKeyParams")] +#[allow(unused_imports)] pub use gen_HmacDerivedKeyParams::*; #[cfg(feature = "HmacImportParams")] #[allow(non_snake_case)] mod gen_HmacImportParams; #[cfg(feature = "HmacImportParams")] +#[allow(unused_imports)] pub use gen_HmacImportParams::*; #[cfg(feature = "HmacKeyAlgorithm")] #[allow(non_snake_case)] mod gen_HmacKeyAlgorithm; #[cfg(feature = "HmacKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_HmacKeyAlgorithm::*; #[cfg(feature = "HmacKeyGenParams")] #[allow(non_snake_case)] mod gen_HmacKeyGenParams; #[cfg(feature = "HmacKeyGenParams")] +#[allow(unused_imports)] pub use gen_HmacKeyGenParams::*; #[cfg(feature = "HtmlAllCollection")] #[allow(non_snake_case)] mod gen_HtmlAllCollection; #[cfg(feature = "HtmlAllCollection")] +#[allow(unused_imports)] pub use gen_HtmlAllCollection::*; #[cfg(feature = "HtmlAnchorElement")] #[allow(non_snake_case)] mod gen_HtmlAnchorElement; #[cfg(feature = "HtmlAnchorElement")] +#[allow(unused_imports)] pub use gen_HtmlAnchorElement::*; #[cfg(feature = "HtmlAreaElement")] #[allow(non_snake_case)] mod gen_HtmlAreaElement; #[cfg(feature = "HtmlAreaElement")] +#[allow(unused_imports)] pub use gen_HtmlAreaElement::*; #[cfg(feature = "HtmlAudioElement")] #[allow(non_snake_case)] mod gen_HtmlAudioElement; #[cfg(feature = "HtmlAudioElement")] +#[allow(unused_imports)] pub use gen_HtmlAudioElement::*; #[cfg(feature = "HtmlBaseElement")] #[allow(non_snake_case)] mod gen_HtmlBaseElement; #[cfg(feature = "HtmlBaseElement")] +#[allow(unused_imports)] pub use gen_HtmlBaseElement::*; #[cfg(feature = "HtmlBodyElement")] #[allow(non_snake_case)] mod gen_HtmlBodyElement; #[cfg(feature = "HtmlBodyElement")] +#[allow(unused_imports)] pub use gen_HtmlBodyElement::*; #[cfg(feature = "HtmlBrElement")] #[allow(non_snake_case)] mod gen_HtmlBrElement; #[cfg(feature = "HtmlBrElement")] +#[allow(unused_imports)] pub use gen_HtmlBrElement::*; #[cfg(feature = "HtmlButtonElement")] #[allow(non_snake_case)] mod gen_HtmlButtonElement; #[cfg(feature = "HtmlButtonElement")] +#[allow(unused_imports)] pub use gen_HtmlButtonElement::*; #[cfg(feature = "HtmlCanvasElement")] #[allow(non_snake_case)] mod gen_HtmlCanvasElement; #[cfg(feature = "HtmlCanvasElement")] +#[allow(unused_imports)] pub use gen_HtmlCanvasElement::*; #[cfg(feature = "HtmlCollection")] #[allow(non_snake_case)] mod gen_HtmlCollection; #[cfg(feature = "HtmlCollection")] +#[allow(unused_imports)] pub use gen_HtmlCollection::*; #[cfg(feature = "HtmlDListElement")] #[allow(non_snake_case)] mod gen_HtmlDListElement; #[cfg(feature = "HtmlDListElement")] +#[allow(unused_imports)] pub use gen_HtmlDListElement::*; #[cfg(feature = "HtmlDataElement")] #[allow(non_snake_case)] mod gen_HtmlDataElement; #[cfg(feature = "HtmlDataElement")] +#[allow(unused_imports)] pub use gen_HtmlDataElement::*; #[cfg(feature = "HtmlDataListElement")] #[allow(non_snake_case)] mod gen_HtmlDataListElement; #[cfg(feature = "HtmlDataListElement")] +#[allow(unused_imports)] pub use gen_HtmlDataListElement::*; #[cfg(feature = "HtmlDetailsElement")] #[allow(non_snake_case)] mod gen_HtmlDetailsElement; #[cfg(feature = "HtmlDetailsElement")] +#[allow(unused_imports)] pub use gen_HtmlDetailsElement::*; #[cfg(feature = "HtmlDialogElement")] #[allow(non_snake_case)] mod gen_HtmlDialogElement; #[cfg(feature = "HtmlDialogElement")] +#[allow(unused_imports)] pub use gen_HtmlDialogElement::*; #[cfg(feature = "HtmlDirectoryElement")] #[allow(non_snake_case)] mod gen_HtmlDirectoryElement; #[cfg(feature = "HtmlDirectoryElement")] +#[allow(unused_imports)] pub use gen_HtmlDirectoryElement::*; #[cfg(feature = "HtmlDivElement")] #[allow(non_snake_case)] mod gen_HtmlDivElement; #[cfg(feature = "HtmlDivElement")] +#[allow(unused_imports)] pub use gen_HtmlDivElement::*; #[cfg(feature = "HtmlDocument")] #[allow(non_snake_case)] mod gen_HtmlDocument; #[cfg(feature = "HtmlDocument")] +#[allow(unused_imports)] pub use gen_HtmlDocument::*; #[cfg(feature = "HtmlElement")] #[allow(non_snake_case)] mod gen_HtmlElement; #[cfg(feature = "HtmlElement")] +#[allow(unused_imports)] pub use gen_HtmlElement::*; #[cfg(feature = "HtmlEmbedElement")] #[allow(non_snake_case)] mod gen_HtmlEmbedElement; #[cfg(feature = "HtmlEmbedElement")] +#[allow(unused_imports)] pub use gen_HtmlEmbedElement::*; #[cfg(feature = "HtmlFieldSetElement")] #[allow(non_snake_case)] mod gen_HtmlFieldSetElement; #[cfg(feature = "HtmlFieldSetElement")] +#[allow(unused_imports)] pub use gen_HtmlFieldSetElement::*; #[cfg(feature = "HtmlFontElement")] #[allow(non_snake_case)] mod gen_HtmlFontElement; #[cfg(feature = "HtmlFontElement")] +#[allow(unused_imports)] pub use gen_HtmlFontElement::*; #[cfg(feature = "HtmlFormControlsCollection")] #[allow(non_snake_case)] mod gen_HtmlFormControlsCollection; #[cfg(feature = "HtmlFormControlsCollection")] +#[allow(unused_imports)] pub use gen_HtmlFormControlsCollection::*; #[cfg(feature = "HtmlFormElement")] #[allow(non_snake_case)] mod gen_HtmlFormElement; #[cfg(feature = "HtmlFormElement")] +#[allow(unused_imports)] pub use gen_HtmlFormElement::*; #[cfg(feature = "HtmlFrameElement")] #[allow(non_snake_case)] mod gen_HtmlFrameElement; #[cfg(feature = "HtmlFrameElement")] +#[allow(unused_imports)] pub use gen_HtmlFrameElement::*; #[cfg(feature = "HtmlFrameSetElement")] #[allow(non_snake_case)] mod gen_HtmlFrameSetElement; #[cfg(feature = "HtmlFrameSetElement")] +#[allow(unused_imports)] pub use gen_HtmlFrameSetElement::*; #[cfg(feature = "HtmlHeadElement")] #[allow(non_snake_case)] mod gen_HtmlHeadElement; #[cfg(feature = "HtmlHeadElement")] +#[allow(unused_imports)] pub use gen_HtmlHeadElement::*; #[cfg(feature = "HtmlHeadingElement")] #[allow(non_snake_case)] mod gen_HtmlHeadingElement; #[cfg(feature = "HtmlHeadingElement")] +#[allow(unused_imports)] pub use gen_HtmlHeadingElement::*; #[cfg(feature = "HtmlHrElement")] #[allow(non_snake_case)] mod gen_HtmlHrElement; #[cfg(feature = "HtmlHrElement")] +#[allow(unused_imports)] pub use gen_HtmlHrElement::*; #[cfg(feature = "HtmlHtmlElement")] #[allow(non_snake_case)] mod gen_HtmlHtmlElement; #[cfg(feature = "HtmlHtmlElement")] +#[allow(unused_imports)] pub use gen_HtmlHtmlElement::*; #[cfg(feature = "HtmlIFrameElement")] #[allow(non_snake_case)] mod gen_HtmlIFrameElement; #[cfg(feature = "HtmlIFrameElement")] +#[allow(unused_imports)] pub use gen_HtmlIFrameElement::*; #[cfg(feature = "HtmlImageElement")] #[allow(non_snake_case)] mod gen_HtmlImageElement; #[cfg(feature = "HtmlImageElement")] +#[allow(unused_imports)] pub use gen_HtmlImageElement::*; #[cfg(feature = "HtmlInputElement")] #[allow(non_snake_case)] mod gen_HtmlInputElement; #[cfg(feature = "HtmlInputElement")] +#[allow(unused_imports)] pub use gen_HtmlInputElement::*; #[cfg(feature = "HtmlLabelElement")] #[allow(non_snake_case)] mod gen_HtmlLabelElement; #[cfg(feature = "HtmlLabelElement")] +#[allow(unused_imports)] pub use gen_HtmlLabelElement::*; #[cfg(feature = "HtmlLegendElement")] #[allow(non_snake_case)] mod gen_HtmlLegendElement; #[cfg(feature = "HtmlLegendElement")] +#[allow(unused_imports)] pub use gen_HtmlLegendElement::*; #[cfg(feature = "HtmlLiElement")] #[allow(non_snake_case)] mod gen_HtmlLiElement; #[cfg(feature = "HtmlLiElement")] +#[allow(unused_imports)] pub use gen_HtmlLiElement::*; #[cfg(feature = "HtmlLinkElement")] #[allow(non_snake_case)] mod gen_HtmlLinkElement; #[cfg(feature = "HtmlLinkElement")] +#[allow(unused_imports)] pub use gen_HtmlLinkElement::*; #[cfg(feature = "HtmlMapElement")] #[allow(non_snake_case)] mod gen_HtmlMapElement; #[cfg(feature = "HtmlMapElement")] +#[allow(unused_imports)] pub use gen_HtmlMapElement::*; #[cfg(feature = "HtmlMediaElement")] #[allow(non_snake_case)] mod gen_HtmlMediaElement; #[cfg(feature = "HtmlMediaElement")] +#[allow(unused_imports)] pub use gen_HtmlMediaElement::*; #[cfg(feature = "HtmlMenuElement")] #[allow(non_snake_case)] mod gen_HtmlMenuElement; #[cfg(feature = "HtmlMenuElement")] +#[allow(unused_imports)] pub use gen_HtmlMenuElement::*; #[cfg(feature = "HtmlMenuItemElement")] #[allow(non_snake_case)] mod gen_HtmlMenuItemElement; #[cfg(feature = "HtmlMenuItemElement")] +#[allow(unused_imports)] pub use gen_HtmlMenuItemElement::*; #[cfg(feature = "HtmlMetaElement")] #[allow(non_snake_case)] mod gen_HtmlMetaElement; #[cfg(feature = "HtmlMetaElement")] +#[allow(unused_imports)] pub use gen_HtmlMetaElement::*; #[cfg(feature = "HtmlMeterElement")] #[allow(non_snake_case)] mod gen_HtmlMeterElement; #[cfg(feature = "HtmlMeterElement")] +#[allow(unused_imports)] pub use gen_HtmlMeterElement::*; #[cfg(feature = "HtmlModElement")] #[allow(non_snake_case)] mod gen_HtmlModElement; #[cfg(feature = "HtmlModElement")] +#[allow(unused_imports)] pub use gen_HtmlModElement::*; #[cfg(feature = "HtmlOListElement")] #[allow(non_snake_case)] mod gen_HtmlOListElement; #[cfg(feature = "HtmlOListElement")] +#[allow(unused_imports)] pub use gen_HtmlOListElement::*; #[cfg(feature = "HtmlObjectElement")] #[allow(non_snake_case)] mod gen_HtmlObjectElement; #[cfg(feature = "HtmlObjectElement")] +#[allow(unused_imports)] pub use gen_HtmlObjectElement::*; #[cfg(feature = "HtmlOptGroupElement")] #[allow(non_snake_case)] mod gen_HtmlOptGroupElement; #[cfg(feature = "HtmlOptGroupElement")] +#[allow(unused_imports)] pub use gen_HtmlOptGroupElement::*; #[cfg(feature = "HtmlOptionElement")] #[allow(non_snake_case)] mod gen_HtmlOptionElement; #[cfg(feature = "HtmlOptionElement")] +#[allow(unused_imports)] pub use gen_HtmlOptionElement::*; #[cfg(feature = "HtmlOptionsCollection")] #[allow(non_snake_case)] mod gen_HtmlOptionsCollection; #[cfg(feature = "HtmlOptionsCollection")] +#[allow(unused_imports)] pub use gen_HtmlOptionsCollection::*; #[cfg(feature = "HtmlOutputElement")] #[allow(non_snake_case)] mod gen_HtmlOutputElement; #[cfg(feature = "HtmlOutputElement")] +#[allow(unused_imports)] pub use gen_HtmlOutputElement::*; #[cfg(feature = "HtmlParagraphElement")] #[allow(non_snake_case)] mod gen_HtmlParagraphElement; #[cfg(feature = "HtmlParagraphElement")] +#[allow(unused_imports)] pub use gen_HtmlParagraphElement::*; #[cfg(feature = "HtmlParamElement")] #[allow(non_snake_case)] mod gen_HtmlParamElement; #[cfg(feature = "HtmlParamElement")] +#[allow(unused_imports)] pub use gen_HtmlParamElement::*; #[cfg(feature = "HtmlPictureElement")] #[allow(non_snake_case)] mod gen_HtmlPictureElement; #[cfg(feature = "HtmlPictureElement")] +#[allow(unused_imports)] pub use gen_HtmlPictureElement::*; #[cfg(feature = "HtmlPreElement")] #[allow(non_snake_case)] mod gen_HtmlPreElement; #[cfg(feature = "HtmlPreElement")] +#[allow(unused_imports)] pub use gen_HtmlPreElement::*; #[cfg(feature = "HtmlProgressElement")] #[allow(non_snake_case)] mod gen_HtmlProgressElement; #[cfg(feature = "HtmlProgressElement")] +#[allow(unused_imports)] pub use gen_HtmlProgressElement::*; #[cfg(feature = "HtmlQuoteElement")] #[allow(non_snake_case)] mod gen_HtmlQuoteElement; #[cfg(feature = "HtmlQuoteElement")] +#[allow(unused_imports)] pub use gen_HtmlQuoteElement::*; #[cfg(feature = "HtmlScriptElement")] #[allow(non_snake_case)] mod gen_HtmlScriptElement; #[cfg(feature = "HtmlScriptElement")] +#[allow(unused_imports)] pub use gen_HtmlScriptElement::*; #[cfg(feature = "HtmlSelectElement")] #[allow(non_snake_case)] mod gen_HtmlSelectElement; #[cfg(feature = "HtmlSelectElement")] +#[allow(unused_imports)] pub use gen_HtmlSelectElement::*; #[cfg(feature = "HtmlSlotElement")] #[allow(non_snake_case)] mod gen_HtmlSlotElement; #[cfg(feature = "HtmlSlotElement")] +#[allow(unused_imports)] pub use gen_HtmlSlotElement::*; #[cfg(feature = "HtmlSourceElement")] #[allow(non_snake_case)] mod gen_HtmlSourceElement; #[cfg(feature = "HtmlSourceElement")] +#[allow(unused_imports)] pub use gen_HtmlSourceElement::*; #[cfg(feature = "HtmlSpanElement")] #[allow(non_snake_case)] mod gen_HtmlSpanElement; #[cfg(feature = "HtmlSpanElement")] +#[allow(unused_imports)] pub use gen_HtmlSpanElement::*; #[cfg(feature = "HtmlStyleElement")] #[allow(non_snake_case)] mod gen_HtmlStyleElement; #[cfg(feature = "HtmlStyleElement")] +#[allow(unused_imports)] pub use gen_HtmlStyleElement::*; #[cfg(feature = "HtmlTableCaptionElement")] #[allow(non_snake_case)] mod gen_HtmlTableCaptionElement; #[cfg(feature = "HtmlTableCaptionElement")] +#[allow(unused_imports)] pub use gen_HtmlTableCaptionElement::*; #[cfg(feature = "HtmlTableCellElement")] #[allow(non_snake_case)] mod gen_HtmlTableCellElement; #[cfg(feature = "HtmlTableCellElement")] +#[allow(unused_imports)] pub use gen_HtmlTableCellElement::*; #[cfg(feature = "HtmlTableColElement")] #[allow(non_snake_case)] mod gen_HtmlTableColElement; #[cfg(feature = "HtmlTableColElement")] +#[allow(unused_imports)] pub use gen_HtmlTableColElement::*; #[cfg(feature = "HtmlTableElement")] #[allow(non_snake_case)] mod gen_HtmlTableElement; #[cfg(feature = "HtmlTableElement")] +#[allow(unused_imports)] pub use gen_HtmlTableElement::*; #[cfg(feature = "HtmlTableRowElement")] #[allow(non_snake_case)] mod gen_HtmlTableRowElement; #[cfg(feature = "HtmlTableRowElement")] +#[allow(unused_imports)] pub use gen_HtmlTableRowElement::*; #[cfg(feature = "HtmlTableSectionElement")] #[allow(non_snake_case)] mod gen_HtmlTableSectionElement; #[cfg(feature = "HtmlTableSectionElement")] +#[allow(unused_imports)] pub use gen_HtmlTableSectionElement::*; #[cfg(feature = "HtmlTemplateElement")] #[allow(non_snake_case)] mod gen_HtmlTemplateElement; #[cfg(feature = "HtmlTemplateElement")] +#[allow(unused_imports)] pub use gen_HtmlTemplateElement::*; #[cfg(feature = "HtmlTextAreaElement")] #[allow(non_snake_case)] mod gen_HtmlTextAreaElement; #[cfg(feature = "HtmlTextAreaElement")] +#[allow(unused_imports)] pub use gen_HtmlTextAreaElement::*; #[cfg(feature = "HtmlTimeElement")] #[allow(non_snake_case)] mod gen_HtmlTimeElement; #[cfg(feature = "HtmlTimeElement")] +#[allow(unused_imports)] pub use gen_HtmlTimeElement::*; #[cfg(feature = "HtmlTitleElement")] #[allow(non_snake_case)] mod gen_HtmlTitleElement; #[cfg(feature = "HtmlTitleElement")] +#[allow(unused_imports)] pub use gen_HtmlTitleElement::*; #[cfg(feature = "HtmlTrackElement")] #[allow(non_snake_case)] mod gen_HtmlTrackElement; #[cfg(feature = "HtmlTrackElement")] +#[allow(unused_imports)] pub use gen_HtmlTrackElement::*; #[cfg(feature = "HtmlUListElement")] #[allow(non_snake_case)] mod gen_HtmlUListElement; #[cfg(feature = "HtmlUListElement")] +#[allow(unused_imports)] pub use gen_HtmlUListElement::*; #[cfg(feature = "HtmlUnknownElement")] #[allow(non_snake_case)] mod gen_HtmlUnknownElement; #[cfg(feature = "HtmlUnknownElement")] +#[allow(unused_imports)] pub use gen_HtmlUnknownElement::*; #[cfg(feature = "HtmlVideoElement")] #[allow(non_snake_case)] mod gen_HtmlVideoElement; #[cfg(feature = "HtmlVideoElement")] +#[allow(unused_imports)] pub use gen_HtmlVideoElement::*; #[cfg(feature = "HttpConnDict")] #[allow(non_snake_case)] mod gen_HttpConnDict; #[cfg(feature = "HttpConnDict")] +#[allow(unused_imports)] pub use gen_HttpConnDict::*; #[cfg(feature = "HttpConnInfo")] #[allow(non_snake_case)] mod gen_HttpConnInfo; #[cfg(feature = "HttpConnInfo")] +#[allow(unused_imports)] pub use gen_HttpConnInfo::*; #[cfg(feature = "HttpConnectionElement")] #[allow(non_snake_case)] mod gen_HttpConnectionElement; #[cfg(feature = "HttpConnectionElement")] +#[allow(unused_imports)] pub use gen_HttpConnectionElement::*; #[cfg(feature = "IdbCursor")] #[allow(non_snake_case)] mod gen_IdbCursor; #[cfg(feature = "IdbCursor")] +#[allow(unused_imports)] pub use gen_IdbCursor::*; #[cfg(feature = "IdbCursorDirection")] #[allow(non_snake_case)] mod gen_IdbCursorDirection; #[cfg(feature = "IdbCursorDirection")] +#[allow(unused_imports)] pub use gen_IdbCursorDirection::*; #[cfg(feature = "IdbCursorWithValue")] #[allow(non_snake_case)] mod gen_IdbCursorWithValue; #[cfg(feature = "IdbCursorWithValue")] +#[allow(unused_imports)] pub use gen_IdbCursorWithValue::*; #[cfg(feature = "IdbDatabase")] #[allow(non_snake_case)] mod gen_IdbDatabase; #[cfg(feature = "IdbDatabase")] +#[allow(unused_imports)] pub use gen_IdbDatabase::*; #[cfg(feature = "IdbFactory")] #[allow(non_snake_case)] mod gen_IdbFactory; #[cfg(feature = "IdbFactory")] +#[allow(unused_imports)] pub use gen_IdbFactory::*; #[cfg(feature = "IdbFileHandle")] #[allow(non_snake_case)] mod gen_IdbFileHandle; #[cfg(feature = "IdbFileHandle")] +#[allow(unused_imports)] pub use gen_IdbFileHandle::*; #[cfg(feature = "IdbFileMetadataParameters")] #[allow(non_snake_case)] mod gen_IdbFileMetadataParameters; #[cfg(feature = "IdbFileMetadataParameters")] +#[allow(unused_imports)] pub use gen_IdbFileMetadataParameters::*; #[cfg(feature = "IdbFileRequest")] #[allow(non_snake_case)] mod gen_IdbFileRequest; #[cfg(feature = "IdbFileRequest")] +#[allow(unused_imports)] pub use gen_IdbFileRequest::*; #[cfg(feature = "IdbIndex")] #[allow(non_snake_case)] mod gen_IdbIndex; #[cfg(feature = "IdbIndex")] +#[allow(unused_imports)] pub use gen_IdbIndex::*; #[cfg(feature = "IdbIndexParameters")] #[allow(non_snake_case)] mod gen_IdbIndexParameters; #[cfg(feature = "IdbIndexParameters")] +#[allow(unused_imports)] pub use gen_IdbIndexParameters::*; #[cfg(feature = "IdbKeyRange")] #[allow(non_snake_case)] mod gen_IdbKeyRange; #[cfg(feature = "IdbKeyRange")] +#[allow(unused_imports)] pub use gen_IdbKeyRange::*; #[cfg(feature = "IdbLocaleAwareKeyRange")] #[allow(non_snake_case)] mod gen_IdbLocaleAwareKeyRange; #[cfg(feature = "IdbLocaleAwareKeyRange")] +#[allow(unused_imports)] pub use gen_IdbLocaleAwareKeyRange::*; #[cfg(feature = "IdbMutableFile")] #[allow(non_snake_case)] mod gen_IdbMutableFile; #[cfg(feature = "IdbMutableFile")] +#[allow(unused_imports)] pub use gen_IdbMutableFile::*; #[cfg(feature = "IdbObjectStore")] #[allow(non_snake_case)] mod gen_IdbObjectStore; #[cfg(feature = "IdbObjectStore")] +#[allow(unused_imports)] pub use gen_IdbObjectStore::*; #[cfg(feature = "IdbObjectStoreParameters")] #[allow(non_snake_case)] mod gen_IdbObjectStoreParameters; #[cfg(feature = "IdbObjectStoreParameters")] +#[allow(unused_imports)] pub use gen_IdbObjectStoreParameters::*; #[cfg(feature = "IdbOpenDbOptions")] #[allow(non_snake_case)] mod gen_IdbOpenDbOptions; #[cfg(feature = "IdbOpenDbOptions")] +#[allow(unused_imports)] pub use gen_IdbOpenDbOptions::*; #[cfg(feature = "IdbOpenDbRequest")] #[allow(non_snake_case)] mod gen_IdbOpenDbRequest; #[cfg(feature = "IdbOpenDbRequest")] +#[allow(unused_imports)] pub use gen_IdbOpenDbRequest::*; #[cfg(feature = "IdbRequest")] #[allow(non_snake_case)] mod gen_IdbRequest; #[cfg(feature = "IdbRequest")] +#[allow(unused_imports)] pub use gen_IdbRequest::*; #[cfg(feature = "IdbRequestReadyState")] #[allow(non_snake_case)] mod gen_IdbRequestReadyState; #[cfg(feature = "IdbRequestReadyState")] +#[allow(unused_imports)] pub use gen_IdbRequestReadyState::*; #[cfg(feature = "IdbTransaction")] #[allow(non_snake_case)] mod gen_IdbTransaction; #[cfg(feature = "IdbTransaction")] +#[allow(unused_imports)] pub use gen_IdbTransaction::*; #[cfg(feature = "IdbTransactionMode")] #[allow(non_snake_case)] mod gen_IdbTransactionMode; #[cfg(feature = "IdbTransactionMode")] +#[allow(unused_imports)] pub use gen_IdbTransactionMode::*; #[cfg(feature = "IdbVersionChangeEvent")] #[allow(non_snake_case)] mod gen_IdbVersionChangeEvent; #[cfg(feature = "IdbVersionChangeEvent")] +#[allow(unused_imports)] pub use gen_IdbVersionChangeEvent::*; #[cfg(feature = "IdbVersionChangeEventInit")] #[allow(non_snake_case)] mod gen_IdbVersionChangeEventInit; #[cfg(feature = "IdbVersionChangeEventInit")] +#[allow(unused_imports)] pub use gen_IdbVersionChangeEventInit::*; #[cfg(feature = "IdleDeadline")] #[allow(non_snake_case)] mod gen_IdleDeadline; #[cfg(feature = "IdleDeadline")] +#[allow(unused_imports)] pub use gen_IdleDeadline::*; #[cfg(feature = "IdleRequestOptions")] #[allow(non_snake_case)] mod gen_IdleRequestOptions; #[cfg(feature = "IdleRequestOptions")] +#[allow(unused_imports)] pub use gen_IdleRequestOptions::*; #[cfg(feature = "IirFilterNode")] #[allow(non_snake_case)] mod gen_IirFilterNode; #[cfg(feature = "IirFilterNode")] +#[allow(unused_imports)] pub use gen_IirFilterNode::*; #[cfg(feature = "IirFilterOptions")] #[allow(non_snake_case)] mod gen_IirFilterOptions; #[cfg(feature = "IirFilterOptions")] +#[allow(unused_imports)] pub use gen_IirFilterOptions::*; #[cfg(feature = "ImageBitmap")] #[allow(non_snake_case)] mod gen_ImageBitmap; #[cfg(feature = "ImageBitmap")] +#[allow(unused_imports)] pub use gen_ImageBitmap::*; #[cfg(feature = "ImageBitmapOptions")] #[allow(non_snake_case)] mod gen_ImageBitmapOptions; #[cfg(feature = "ImageBitmapOptions")] +#[allow(unused_imports)] pub use gen_ImageBitmapOptions::*; #[cfg(feature = "ImageBitmapRenderingContext")] #[allow(non_snake_case)] mod gen_ImageBitmapRenderingContext; #[cfg(feature = "ImageBitmapRenderingContext")] +#[allow(unused_imports)] pub use gen_ImageBitmapRenderingContext::*; #[cfg(feature = "ImageCapture")] #[allow(non_snake_case)] mod gen_ImageCapture; #[cfg(feature = "ImageCapture")] +#[allow(unused_imports)] pub use gen_ImageCapture::*; #[cfg(feature = "ImageCaptureError")] #[allow(non_snake_case)] mod gen_ImageCaptureError; #[cfg(feature = "ImageCaptureError")] +#[allow(unused_imports)] pub use gen_ImageCaptureError::*; #[cfg(feature = "ImageCaptureErrorEvent")] #[allow(non_snake_case)] mod gen_ImageCaptureErrorEvent; #[cfg(feature = "ImageCaptureErrorEvent")] +#[allow(unused_imports)] pub use gen_ImageCaptureErrorEvent::*; #[cfg(feature = "ImageCaptureErrorEventInit")] #[allow(non_snake_case)] mod gen_ImageCaptureErrorEventInit; #[cfg(feature = "ImageCaptureErrorEventInit")] +#[allow(unused_imports)] pub use gen_ImageCaptureErrorEventInit::*; #[cfg(feature = "ImageData")] #[allow(non_snake_case)] mod gen_ImageData; #[cfg(feature = "ImageData")] +#[allow(unused_imports)] pub use gen_ImageData::*; #[cfg(feature = "ImageDecodeOptions")] #[allow(non_snake_case)] mod gen_ImageDecodeOptions; #[cfg(feature = "ImageDecodeOptions")] +#[allow(unused_imports)] pub use gen_ImageDecodeOptions::*; #[cfg(feature = "ImageDecodeResult")] #[allow(non_snake_case)] mod gen_ImageDecodeResult; #[cfg(feature = "ImageDecodeResult")] +#[allow(unused_imports)] pub use gen_ImageDecodeResult::*; #[cfg(feature = "ImageDecoder")] #[allow(non_snake_case)] mod gen_ImageDecoder; #[cfg(feature = "ImageDecoder")] +#[allow(unused_imports)] pub use gen_ImageDecoder::*; #[cfg(feature = "ImageDecoderInit")] #[allow(non_snake_case)] mod gen_ImageDecoderInit; #[cfg(feature = "ImageDecoderInit")] +#[allow(unused_imports)] pub use gen_ImageDecoderInit::*; #[cfg(feature = "ImageEncodeOptions")] #[allow(non_snake_case)] mod gen_ImageEncodeOptions; #[cfg(feature = "ImageEncodeOptions")] +#[allow(unused_imports)] pub use gen_ImageEncodeOptions::*; #[cfg(feature = "ImageOrientation")] #[allow(non_snake_case)] mod gen_ImageOrientation; #[cfg(feature = "ImageOrientation")] +#[allow(unused_imports)] pub use gen_ImageOrientation::*; #[cfg(feature = "ImageTrack")] #[allow(non_snake_case)] mod gen_ImageTrack; #[cfg(feature = "ImageTrack")] +#[allow(unused_imports)] pub use gen_ImageTrack::*; #[cfg(feature = "ImageTrackList")] #[allow(non_snake_case)] mod gen_ImageTrackList; #[cfg(feature = "ImageTrackList")] +#[allow(unused_imports)] pub use gen_ImageTrackList::*; #[cfg(feature = "InputEvent")] #[allow(non_snake_case)] mod gen_InputEvent; #[cfg(feature = "InputEvent")] +#[allow(unused_imports)] pub use gen_InputEvent::*; #[cfg(feature = "InputEventInit")] #[allow(non_snake_case)] mod gen_InputEventInit; #[cfg(feature = "InputEventInit")] +#[allow(unused_imports)] pub use gen_InputEventInit::*; -#[cfg(feature = "InstallTriggerData")] -#[allow(non_snake_case)] -mod gen_InstallTriggerData; -#[cfg(feature = "InstallTriggerData")] -pub use gen_InstallTriggerData::*; - #[cfg(feature = "IntersectionObserver")] #[allow(non_snake_case)] mod gen_IntersectionObserver; #[cfg(feature = "IntersectionObserver")] +#[allow(unused_imports)] pub use gen_IntersectionObserver::*; #[cfg(feature = "IntersectionObserverEntry")] #[allow(non_snake_case)] mod gen_IntersectionObserverEntry; #[cfg(feature = "IntersectionObserverEntry")] +#[allow(unused_imports)] pub use gen_IntersectionObserverEntry::*; #[cfg(feature = "IntersectionObserverEntryInit")] #[allow(non_snake_case)] mod gen_IntersectionObserverEntryInit; #[cfg(feature = "IntersectionObserverEntryInit")] +#[allow(unused_imports)] pub use gen_IntersectionObserverEntryInit::*; #[cfg(feature = "IntersectionObserverInit")] #[allow(non_snake_case)] mod gen_IntersectionObserverInit; #[cfg(feature = "IntersectionObserverInit")] +#[allow(unused_imports)] pub use gen_IntersectionObserverInit::*; #[cfg(feature = "IntlUtils")] #[allow(non_snake_case)] mod gen_IntlUtils; #[cfg(feature = "IntlUtils")] +#[allow(unused_imports)] pub use gen_IntlUtils::*; #[cfg(feature = "IsInputPendingOptions")] #[allow(non_snake_case)] mod gen_IsInputPendingOptions; #[cfg(feature = "IsInputPendingOptions")] +#[allow(unused_imports)] pub use gen_IsInputPendingOptions::*; #[cfg(feature = "IterableKeyAndValueResult")] #[allow(non_snake_case)] mod gen_IterableKeyAndValueResult; #[cfg(feature = "IterableKeyAndValueResult")] +#[allow(unused_imports)] pub use gen_IterableKeyAndValueResult::*; #[cfg(feature = "IterableKeyOrValueResult")] #[allow(non_snake_case)] mod gen_IterableKeyOrValueResult; #[cfg(feature = "IterableKeyOrValueResult")] +#[allow(unused_imports)] pub use gen_IterableKeyOrValueResult::*; #[cfg(feature = "IterationCompositeOperation")] #[allow(non_snake_case)] mod gen_IterationCompositeOperation; #[cfg(feature = "IterationCompositeOperation")] +#[allow(unused_imports)] pub use gen_IterationCompositeOperation::*; #[cfg(feature = "JsonWebKey")] #[allow(non_snake_case)] mod gen_JsonWebKey; #[cfg(feature = "JsonWebKey")] +#[allow(unused_imports)] pub use gen_JsonWebKey::*; #[cfg(feature = "KeyAlgorithm")] #[allow(non_snake_case)] mod gen_KeyAlgorithm; #[cfg(feature = "KeyAlgorithm")] +#[allow(unused_imports)] pub use gen_KeyAlgorithm::*; #[cfg(feature = "KeyEvent")] #[allow(non_snake_case)] mod gen_KeyEvent; #[cfg(feature = "KeyEvent")] +#[allow(unused_imports)] pub use gen_KeyEvent::*; #[cfg(feature = "KeyIdsInitData")] #[allow(non_snake_case)] mod gen_KeyIdsInitData; #[cfg(feature = "KeyIdsInitData")] +#[allow(unused_imports)] pub use gen_KeyIdsInitData::*; #[cfg(feature = "KeyboardEvent")] #[allow(non_snake_case)] mod gen_KeyboardEvent; #[cfg(feature = "KeyboardEvent")] +#[allow(unused_imports)] pub use gen_KeyboardEvent::*; #[cfg(feature = "KeyboardEventInit")] #[allow(non_snake_case)] mod gen_KeyboardEventInit; #[cfg(feature = "KeyboardEventInit")] +#[allow(unused_imports)] pub use gen_KeyboardEventInit::*; #[cfg(feature = "KeyframeAnimationOptions")] #[allow(non_snake_case)] mod gen_KeyframeAnimationOptions; #[cfg(feature = "KeyframeAnimationOptions")] +#[allow(unused_imports)] pub use gen_KeyframeAnimationOptions::*; #[cfg(feature = "KeyframeEffect")] #[allow(non_snake_case)] mod gen_KeyframeEffect; #[cfg(feature = "KeyframeEffect")] +#[allow(unused_imports)] pub use gen_KeyframeEffect::*; #[cfg(feature = "KeyframeEffectOptions")] #[allow(non_snake_case)] mod gen_KeyframeEffectOptions; #[cfg(feature = "KeyframeEffectOptions")] +#[allow(unused_imports)] pub use gen_KeyframeEffectOptions::*; #[cfg(feature = "L10nElement")] #[allow(non_snake_case)] mod gen_L10nElement; #[cfg(feature = "L10nElement")] +#[allow(unused_imports)] pub use gen_L10nElement::*; #[cfg(feature = "L10nValue")] #[allow(non_snake_case)] mod gen_L10nValue; #[cfg(feature = "L10nValue")] +#[allow(unused_imports)] pub use gen_L10nValue::*; #[cfg(feature = "LatencyMode")] #[allow(non_snake_case)] mod gen_LatencyMode; #[cfg(feature = "LatencyMode")] +#[allow(unused_imports)] pub use gen_LatencyMode::*; #[cfg(feature = "LifecycleCallbacks")] #[allow(non_snake_case)] mod gen_LifecycleCallbacks; #[cfg(feature = "LifecycleCallbacks")] +#[allow(unused_imports)] pub use gen_LifecycleCallbacks::*; #[cfg(feature = "LineAlignSetting")] #[allow(non_snake_case)] mod gen_LineAlignSetting; #[cfg(feature = "LineAlignSetting")] +#[allow(unused_imports)] pub use gen_LineAlignSetting::*; #[cfg(feature = "ListBoxObject")] #[allow(non_snake_case)] mod gen_ListBoxObject; #[cfg(feature = "ListBoxObject")] +#[allow(unused_imports)] pub use gen_ListBoxObject::*; #[cfg(feature = "LocalMediaStream")] #[allow(non_snake_case)] mod gen_LocalMediaStream; #[cfg(feature = "LocalMediaStream")] +#[allow(unused_imports)] pub use gen_LocalMediaStream::*; #[cfg(feature = "LocaleInfo")] #[allow(non_snake_case)] mod gen_LocaleInfo; #[cfg(feature = "LocaleInfo")] +#[allow(unused_imports)] pub use gen_LocaleInfo::*; #[cfg(feature = "Location")] #[allow(non_snake_case)] mod gen_Location; #[cfg(feature = "Location")] +#[allow(unused_imports)] pub use gen_Location::*; #[cfg(feature = "Lock")] #[allow(non_snake_case)] mod gen_Lock; #[cfg(feature = "Lock")] +#[allow(unused_imports)] pub use gen_Lock::*; #[cfg(feature = "LockInfo")] #[allow(non_snake_case)] mod gen_LockInfo; #[cfg(feature = "LockInfo")] +#[allow(unused_imports)] pub use gen_LockInfo::*; #[cfg(feature = "LockManager")] #[allow(non_snake_case)] mod gen_LockManager; #[cfg(feature = "LockManager")] +#[allow(unused_imports)] pub use gen_LockManager::*; #[cfg(feature = "LockManagerSnapshot")] #[allow(non_snake_case)] mod gen_LockManagerSnapshot; #[cfg(feature = "LockManagerSnapshot")] +#[allow(unused_imports)] pub use gen_LockManagerSnapshot::*; #[cfg(feature = "LockMode")] #[allow(non_snake_case)] mod gen_LockMode; #[cfg(feature = "LockMode")] +#[allow(unused_imports)] pub use gen_LockMode::*; #[cfg(feature = "LockOptions")] #[allow(non_snake_case)] mod gen_LockOptions; #[cfg(feature = "LockOptions")] +#[allow(unused_imports)] pub use gen_LockOptions::*; #[cfg(feature = "MediaCapabilities")] #[allow(non_snake_case)] mod gen_MediaCapabilities; #[cfg(feature = "MediaCapabilities")] +#[allow(unused_imports)] pub use gen_MediaCapabilities::*; #[cfg(feature = "MediaCapabilitiesInfo")] #[allow(non_snake_case)] mod gen_MediaCapabilitiesInfo; #[cfg(feature = "MediaCapabilitiesInfo")] +#[allow(unused_imports)] pub use gen_MediaCapabilitiesInfo::*; #[cfg(feature = "MediaConfiguration")] #[allow(non_snake_case)] mod gen_MediaConfiguration; #[cfg(feature = "MediaConfiguration")] +#[allow(unused_imports)] pub use gen_MediaConfiguration::*; #[cfg(feature = "MediaDecodingConfiguration")] #[allow(non_snake_case)] mod gen_MediaDecodingConfiguration; #[cfg(feature = "MediaDecodingConfiguration")] +#[allow(unused_imports)] pub use gen_MediaDecodingConfiguration::*; #[cfg(feature = "MediaDecodingType")] #[allow(non_snake_case)] mod gen_MediaDecodingType; #[cfg(feature = "MediaDecodingType")] +#[allow(unused_imports)] pub use gen_MediaDecodingType::*; #[cfg(feature = "MediaDeviceInfo")] #[allow(non_snake_case)] mod gen_MediaDeviceInfo; #[cfg(feature = "MediaDeviceInfo")] +#[allow(unused_imports)] pub use gen_MediaDeviceInfo::*; #[cfg(feature = "MediaDeviceKind")] #[allow(non_snake_case)] mod gen_MediaDeviceKind; #[cfg(feature = "MediaDeviceKind")] +#[allow(unused_imports)] pub use gen_MediaDeviceKind::*; #[cfg(feature = "MediaDevices")] #[allow(non_snake_case)] mod gen_MediaDevices; #[cfg(feature = "MediaDevices")] +#[allow(unused_imports)] pub use gen_MediaDevices::*; #[cfg(feature = "MediaElementAudioSourceNode")] #[allow(non_snake_case)] mod gen_MediaElementAudioSourceNode; #[cfg(feature = "MediaElementAudioSourceNode")] +#[allow(unused_imports)] pub use gen_MediaElementAudioSourceNode::*; #[cfg(feature = "MediaElementAudioSourceOptions")] #[allow(non_snake_case)] mod gen_MediaElementAudioSourceOptions; #[cfg(feature = "MediaElementAudioSourceOptions")] +#[allow(unused_imports)] pub use gen_MediaElementAudioSourceOptions::*; #[cfg(feature = "MediaEncodingConfiguration")] #[allow(non_snake_case)] mod gen_MediaEncodingConfiguration; #[cfg(feature = "MediaEncodingConfiguration")] +#[allow(unused_imports)] pub use gen_MediaEncodingConfiguration::*; #[cfg(feature = "MediaEncodingType")] #[allow(non_snake_case)] mod gen_MediaEncodingType; #[cfg(feature = "MediaEncodingType")] +#[allow(unused_imports)] pub use gen_MediaEncodingType::*; #[cfg(feature = "MediaEncryptedEvent")] #[allow(non_snake_case)] mod gen_MediaEncryptedEvent; #[cfg(feature = "MediaEncryptedEvent")] +#[allow(unused_imports)] pub use gen_MediaEncryptedEvent::*; #[cfg(feature = "MediaError")] #[allow(non_snake_case)] mod gen_MediaError; #[cfg(feature = "MediaError")] +#[allow(unused_imports)] pub use gen_MediaError::*; #[cfg(feature = "MediaImage")] #[allow(non_snake_case)] mod gen_MediaImage; #[cfg(feature = "MediaImage")] +#[allow(unused_imports)] pub use gen_MediaImage::*; #[cfg(feature = "MediaKeyError")] #[allow(non_snake_case)] mod gen_MediaKeyError; #[cfg(feature = "MediaKeyError")] +#[allow(unused_imports)] pub use gen_MediaKeyError::*; #[cfg(feature = "MediaKeyMessageEvent")] #[allow(non_snake_case)] mod gen_MediaKeyMessageEvent; #[cfg(feature = "MediaKeyMessageEvent")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageEvent::*; #[cfg(feature = "MediaKeyMessageEventInit")] #[allow(non_snake_case)] mod gen_MediaKeyMessageEventInit; #[cfg(feature = "MediaKeyMessageEventInit")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageEventInit::*; #[cfg(feature = "MediaKeyMessageType")] #[allow(non_snake_case)] mod gen_MediaKeyMessageType; #[cfg(feature = "MediaKeyMessageType")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageType::*; #[cfg(feature = "MediaKeyNeededEventInit")] #[allow(non_snake_case)] mod gen_MediaKeyNeededEventInit; #[cfg(feature = "MediaKeyNeededEventInit")] +#[allow(unused_imports)] pub use gen_MediaKeyNeededEventInit::*; #[cfg(feature = "MediaKeySession")] #[allow(non_snake_case)] mod gen_MediaKeySession; #[cfg(feature = "MediaKeySession")] +#[allow(unused_imports)] pub use gen_MediaKeySession::*; #[cfg(feature = "MediaKeySessionType")] #[allow(non_snake_case)] mod gen_MediaKeySessionType; #[cfg(feature = "MediaKeySessionType")] +#[allow(unused_imports)] pub use gen_MediaKeySessionType::*; #[cfg(feature = "MediaKeyStatus")] #[allow(non_snake_case)] mod gen_MediaKeyStatus; #[cfg(feature = "MediaKeyStatus")] +#[allow(unused_imports)] pub use gen_MediaKeyStatus::*; #[cfg(feature = "MediaKeyStatusMap")] #[allow(non_snake_case)] mod gen_MediaKeyStatusMap; #[cfg(feature = "MediaKeyStatusMap")] +#[allow(unused_imports)] pub use gen_MediaKeyStatusMap::*; #[cfg(feature = "MediaKeySystemAccess")] #[allow(non_snake_case)] mod gen_MediaKeySystemAccess; #[cfg(feature = "MediaKeySystemAccess")] +#[allow(unused_imports)] pub use gen_MediaKeySystemAccess::*; #[cfg(feature = "MediaKeySystemConfiguration")] #[allow(non_snake_case)] mod gen_MediaKeySystemConfiguration; #[cfg(feature = "MediaKeySystemConfiguration")] +#[allow(unused_imports)] pub use gen_MediaKeySystemConfiguration::*; #[cfg(feature = "MediaKeySystemMediaCapability")] #[allow(non_snake_case)] mod gen_MediaKeySystemMediaCapability; #[cfg(feature = "MediaKeySystemMediaCapability")] +#[allow(unused_imports)] pub use gen_MediaKeySystemMediaCapability::*; #[cfg(feature = "MediaKeySystemStatus")] #[allow(non_snake_case)] mod gen_MediaKeySystemStatus; #[cfg(feature = "MediaKeySystemStatus")] +#[allow(unused_imports)] pub use gen_MediaKeySystemStatus::*; #[cfg(feature = "MediaKeys")] #[allow(non_snake_case)] mod gen_MediaKeys; #[cfg(feature = "MediaKeys")] +#[allow(unused_imports)] pub use gen_MediaKeys::*; #[cfg(feature = "MediaKeysPolicy")] #[allow(non_snake_case)] mod gen_MediaKeysPolicy; #[cfg(feature = "MediaKeysPolicy")] +#[allow(unused_imports)] pub use gen_MediaKeysPolicy::*; #[cfg(feature = "MediaKeysRequirement")] #[allow(non_snake_case)] mod gen_MediaKeysRequirement; #[cfg(feature = "MediaKeysRequirement")] +#[allow(unused_imports)] pub use gen_MediaKeysRequirement::*; #[cfg(feature = "MediaList")] #[allow(non_snake_case)] mod gen_MediaList; #[cfg(feature = "MediaList")] +#[allow(unused_imports)] pub use gen_MediaList::*; #[cfg(feature = "MediaMetadata")] #[allow(non_snake_case)] mod gen_MediaMetadata; #[cfg(feature = "MediaMetadata")] +#[allow(unused_imports)] pub use gen_MediaMetadata::*; #[cfg(feature = "MediaMetadataInit")] #[allow(non_snake_case)] mod gen_MediaMetadataInit; #[cfg(feature = "MediaMetadataInit")] +#[allow(unused_imports)] pub use gen_MediaMetadataInit::*; #[cfg(feature = "MediaPositionState")] #[allow(non_snake_case)] mod gen_MediaPositionState; #[cfg(feature = "MediaPositionState")] +#[allow(unused_imports)] pub use gen_MediaPositionState::*; #[cfg(feature = "MediaQueryList")] #[allow(non_snake_case)] mod gen_MediaQueryList; #[cfg(feature = "MediaQueryList")] +#[allow(unused_imports)] pub use gen_MediaQueryList::*; #[cfg(feature = "MediaQueryListEvent")] #[allow(non_snake_case)] mod gen_MediaQueryListEvent; #[cfg(feature = "MediaQueryListEvent")] +#[allow(unused_imports)] pub use gen_MediaQueryListEvent::*; #[cfg(feature = "MediaQueryListEventInit")] #[allow(non_snake_case)] mod gen_MediaQueryListEventInit; #[cfg(feature = "MediaQueryListEventInit")] +#[allow(unused_imports)] pub use gen_MediaQueryListEventInit::*; #[cfg(feature = "MediaRecorder")] #[allow(non_snake_case)] mod gen_MediaRecorder; #[cfg(feature = "MediaRecorder")] +#[allow(unused_imports)] pub use gen_MediaRecorder::*; #[cfg(feature = "MediaRecorderErrorEvent")] #[allow(non_snake_case)] mod gen_MediaRecorderErrorEvent; #[cfg(feature = "MediaRecorderErrorEvent")] +#[allow(unused_imports)] pub use gen_MediaRecorderErrorEvent::*; #[cfg(feature = "MediaRecorderErrorEventInit")] #[allow(non_snake_case)] mod gen_MediaRecorderErrorEventInit; #[cfg(feature = "MediaRecorderErrorEventInit")] +#[allow(unused_imports)] pub use gen_MediaRecorderErrorEventInit::*; #[cfg(feature = "MediaRecorderOptions")] #[allow(non_snake_case)] mod gen_MediaRecorderOptions; #[cfg(feature = "MediaRecorderOptions")] +#[allow(unused_imports)] pub use gen_MediaRecorderOptions::*; #[cfg(feature = "MediaSession")] #[allow(non_snake_case)] mod gen_MediaSession; #[cfg(feature = "MediaSession")] +#[allow(unused_imports)] pub use gen_MediaSession::*; #[cfg(feature = "MediaSessionAction")] #[allow(non_snake_case)] mod gen_MediaSessionAction; #[cfg(feature = "MediaSessionAction")] +#[allow(unused_imports)] pub use gen_MediaSessionAction::*; #[cfg(feature = "MediaSessionActionDetails")] #[allow(non_snake_case)] mod gen_MediaSessionActionDetails; #[cfg(feature = "MediaSessionActionDetails")] +#[allow(unused_imports)] pub use gen_MediaSessionActionDetails::*; #[cfg(feature = "MediaSessionPlaybackState")] #[allow(non_snake_case)] mod gen_MediaSessionPlaybackState; #[cfg(feature = "MediaSessionPlaybackState")] +#[allow(unused_imports)] pub use gen_MediaSessionPlaybackState::*; #[cfg(feature = "MediaSource")] #[allow(non_snake_case)] mod gen_MediaSource; #[cfg(feature = "MediaSource")] +#[allow(unused_imports)] pub use gen_MediaSource::*; #[cfg(feature = "MediaSourceEndOfStreamError")] #[allow(non_snake_case)] mod gen_MediaSourceEndOfStreamError; #[cfg(feature = "MediaSourceEndOfStreamError")] +#[allow(unused_imports)] pub use gen_MediaSourceEndOfStreamError::*; #[cfg(feature = "MediaSourceEnum")] #[allow(non_snake_case)] mod gen_MediaSourceEnum; #[cfg(feature = "MediaSourceEnum")] +#[allow(unused_imports)] pub use gen_MediaSourceEnum::*; #[cfg(feature = "MediaSourceReadyState")] #[allow(non_snake_case)] mod gen_MediaSourceReadyState; #[cfg(feature = "MediaSourceReadyState")] +#[allow(unused_imports)] pub use gen_MediaSourceReadyState::*; #[cfg(feature = "MediaStream")] #[allow(non_snake_case)] mod gen_MediaStream; #[cfg(feature = "MediaStream")] +#[allow(unused_imports)] pub use gen_MediaStream::*; #[cfg(feature = "MediaStreamAudioDestinationNode")] #[allow(non_snake_case)] mod gen_MediaStreamAudioDestinationNode; #[cfg(feature = "MediaStreamAudioDestinationNode")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioDestinationNode::*; #[cfg(feature = "MediaStreamAudioSourceNode")] #[allow(non_snake_case)] mod gen_MediaStreamAudioSourceNode; #[cfg(feature = "MediaStreamAudioSourceNode")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioSourceNode::*; #[cfg(feature = "MediaStreamAudioSourceOptions")] #[allow(non_snake_case)] mod gen_MediaStreamAudioSourceOptions; #[cfg(feature = "MediaStreamAudioSourceOptions")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioSourceOptions::*; #[cfg(feature = "MediaStreamConstraints")] #[allow(non_snake_case)] mod gen_MediaStreamConstraints; #[cfg(feature = "MediaStreamConstraints")] +#[allow(unused_imports)] pub use gen_MediaStreamConstraints::*; #[cfg(feature = "MediaStreamError")] #[allow(non_snake_case)] mod gen_MediaStreamError; #[cfg(feature = "MediaStreamError")] +#[allow(unused_imports)] pub use gen_MediaStreamError::*; #[cfg(feature = "MediaStreamEvent")] #[allow(non_snake_case)] mod gen_MediaStreamEvent; #[cfg(feature = "MediaStreamEvent")] +#[allow(unused_imports)] pub use gen_MediaStreamEvent::*; #[cfg(feature = "MediaStreamEventInit")] #[allow(non_snake_case)] mod gen_MediaStreamEventInit; #[cfg(feature = "MediaStreamEventInit")] +#[allow(unused_imports)] pub use gen_MediaStreamEventInit::*; #[cfg(feature = "MediaStreamTrack")] #[allow(non_snake_case)] mod gen_MediaStreamTrack; #[cfg(feature = "MediaStreamTrack")] +#[allow(unused_imports)] pub use gen_MediaStreamTrack::*; #[cfg(feature = "MediaStreamTrackEvent")] #[allow(non_snake_case)] mod gen_MediaStreamTrackEvent; #[cfg(feature = "MediaStreamTrackEvent")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackEvent::*; #[cfg(feature = "MediaStreamTrackEventInit")] #[allow(non_snake_case)] mod gen_MediaStreamTrackEventInit; #[cfg(feature = "MediaStreamTrackEventInit")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackEventInit::*; #[cfg(feature = "MediaStreamTrackGenerator")] #[allow(non_snake_case)] mod gen_MediaStreamTrackGenerator; #[cfg(feature = "MediaStreamTrackGenerator")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackGenerator::*; #[cfg(feature = "MediaStreamTrackGeneratorInit")] #[allow(non_snake_case)] mod gen_MediaStreamTrackGeneratorInit; #[cfg(feature = "MediaStreamTrackGeneratorInit")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackGeneratorInit::*; #[cfg(feature = "MediaStreamTrackProcessor")] #[allow(non_snake_case)] mod gen_MediaStreamTrackProcessor; #[cfg(feature = "MediaStreamTrackProcessor")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackProcessor::*; #[cfg(feature = "MediaStreamTrackProcessorInit")] #[allow(non_snake_case)] mod gen_MediaStreamTrackProcessorInit; #[cfg(feature = "MediaStreamTrackProcessorInit")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackProcessorInit::*; #[cfg(feature = "MediaStreamTrackState")] #[allow(non_snake_case)] mod gen_MediaStreamTrackState; #[cfg(feature = "MediaStreamTrackState")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackState::*; #[cfg(feature = "MediaTrackConstraintSet")] #[allow(non_snake_case)] mod gen_MediaTrackConstraintSet; #[cfg(feature = "MediaTrackConstraintSet")] +#[allow(unused_imports)] pub use gen_MediaTrackConstraintSet::*; #[cfg(feature = "MediaTrackConstraints")] #[allow(non_snake_case)] mod gen_MediaTrackConstraints; #[cfg(feature = "MediaTrackConstraints")] +#[allow(unused_imports)] pub use gen_MediaTrackConstraints::*; #[cfg(feature = "MediaTrackSettings")] #[allow(non_snake_case)] mod gen_MediaTrackSettings; #[cfg(feature = "MediaTrackSettings")] +#[allow(unused_imports)] pub use gen_MediaTrackSettings::*; #[cfg(feature = "MediaTrackSupportedConstraints")] #[allow(non_snake_case)] mod gen_MediaTrackSupportedConstraints; #[cfg(feature = "MediaTrackSupportedConstraints")] +#[allow(unused_imports)] pub use gen_MediaTrackSupportedConstraints::*; #[cfg(feature = "MemoryAttribution")] #[allow(non_snake_case)] mod gen_MemoryAttribution; #[cfg(feature = "MemoryAttribution")] +#[allow(unused_imports)] pub use gen_MemoryAttribution::*; #[cfg(feature = "MemoryAttributionContainer")] #[allow(non_snake_case)] mod gen_MemoryAttributionContainer; #[cfg(feature = "MemoryAttributionContainer")] +#[allow(unused_imports)] pub use gen_MemoryAttributionContainer::*; #[cfg(feature = "MemoryBreakdownEntry")] #[allow(non_snake_case)] mod gen_MemoryBreakdownEntry; #[cfg(feature = "MemoryBreakdownEntry")] +#[allow(unused_imports)] pub use gen_MemoryBreakdownEntry::*; #[cfg(feature = "MemoryMeasurement")] #[allow(non_snake_case)] mod gen_MemoryMeasurement; #[cfg(feature = "MemoryMeasurement")] +#[allow(unused_imports)] pub use gen_MemoryMeasurement::*; #[cfg(feature = "MessageChannel")] #[allow(non_snake_case)] mod gen_MessageChannel; #[cfg(feature = "MessageChannel")] +#[allow(unused_imports)] pub use gen_MessageChannel::*; #[cfg(feature = "MessageEvent")] #[allow(non_snake_case)] mod gen_MessageEvent; #[cfg(feature = "MessageEvent")] +#[allow(unused_imports)] pub use gen_MessageEvent::*; #[cfg(feature = "MessageEventInit")] #[allow(non_snake_case)] mod gen_MessageEventInit; #[cfg(feature = "MessageEventInit")] +#[allow(unused_imports)] pub use gen_MessageEventInit::*; #[cfg(feature = "MessagePort")] #[allow(non_snake_case)] mod gen_MessagePort; #[cfg(feature = "MessagePort")] +#[allow(unused_imports)] pub use gen_MessagePort::*; #[cfg(feature = "MidiAccess")] #[allow(non_snake_case)] mod gen_MidiAccess; #[cfg(feature = "MidiAccess")] +#[allow(unused_imports)] pub use gen_MidiAccess::*; #[cfg(feature = "MidiConnectionEvent")] #[allow(non_snake_case)] mod gen_MidiConnectionEvent; #[cfg(feature = "MidiConnectionEvent")] +#[allow(unused_imports)] pub use gen_MidiConnectionEvent::*; #[cfg(feature = "MidiConnectionEventInit")] #[allow(non_snake_case)] mod gen_MidiConnectionEventInit; #[cfg(feature = "MidiConnectionEventInit")] +#[allow(unused_imports)] pub use gen_MidiConnectionEventInit::*; #[cfg(feature = "MidiInput")] #[allow(non_snake_case)] mod gen_MidiInput; #[cfg(feature = "MidiInput")] +#[allow(unused_imports)] pub use gen_MidiInput::*; #[cfg(feature = "MidiInputMap")] #[allow(non_snake_case)] mod gen_MidiInputMap; #[cfg(feature = "MidiInputMap")] +#[allow(unused_imports)] pub use gen_MidiInputMap::*; #[cfg(feature = "MidiMessageEvent")] #[allow(non_snake_case)] mod gen_MidiMessageEvent; #[cfg(feature = "MidiMessageEvent")] +#[allow(unused_imports)] pub use gen_MidiMessageEvent::*; #[cfg(feature = "MidiMessageEventInit")] #[allow(non_snake_case)] mod gen_MidiMessageEventInit; #[cfg(feature = "MidiMessageEventInit")] +#[allow(unused_imports)] pub use gen_MidiMessageEventInit::*; #[cfg(feature = "MidiOptions")] #[allow(non_snake_case)] mod gen_MidiOptions; #[cfg(feature = "MidiOptions")] +#[allow(unused_imports)] pub use gen_MidiOptions::*; #[cfg(feature = "MidiOutput")] #[allow(non_snake_case)] mod gen_MidiOutput; #[cfg(feature = "MidiOutput")] +#[allow(unused_imports)] pub use gen_MidiOutput::*; #[cfg(feature = "MidiOutputMap")] #[allow(non_snake_case)] mod gen_MidiOutputMap; #[cfg(feature = "MidiOutputMap")] +#[allow(unused_imports)] pub use gen_MidiOutputMap::*; #[cfg(feature = "MidiPort")] #[allow(non_snake_case)] mod gen_MidiPort; #[cfg(feature = "MidiPort")] +#[allow(unused_imports)] pub use gen_MidiPort::*; #[cfg(feature = "MidiPortConnectionState")] #[allow(non_snake_case)] mod gen_MidiPortConnectionState; #[cfg(feature = "MidiPortConnectionState")] +#[allow(unused_imports)] pub use gen_MidiPortConnectionState::*; #[cfg(feature = "MidiPortDeviceState")] #[allow(non_snake_case)] mod gen_MidiPortDeviceState; #[cfg(feature = "MidiPortDeviceState")] +#[allow(unused_imports)] pub use gen_MidiPortDeviceState::*; #[cfg(feature = "MidiPortType")] #[allow(non_snake_case)] mod gen_MidiPortType; #[cfg(feature = "MidiPortType")] +#[allow(unused_imports)] pub use gen_MidiPortType::*; #[cfg(feature = "MimeType")] #[allow(non_snake_case)] mod gen_MimeType; #[cfg(feature = "MimeType")] +#[allow(unused_imports)] pub use gen_MimeType::*; #[cfg(feature = "MimeTypeArray")] #[allow(non_snake_case)] mod gen_MimeTypeArray; #[cfg(feature = "MimeTypeArray")] +#[allow(unused_imports)] pub use gen_MimeTypeArray::*; #[cfg(feature = "MouseEvent")] #[allow(non_snake_case)] mod gen_MouseEvent; #[cfg(feature = "MouseEvent")] +#[allow(unused_imports)] pub use gen_MouseEvent::*; #[cfg(feature = "MouseEventInit")] #[allow(non_snake_case)] mod gen_MouseEventInit; #[cfg(feature = "MouseEventInit")] +#[allow(unused_imports)] pub use gen_MouseEventInit::*; #[cfg(feature = "MouseScrollEvent")] #[allow(non_snake_case)] mod gen_MouseScrollEvent; #[cfg(feature = "MouseScrollEvent")] +#[allow(unused_imports)] pub use gen_MouseScrollEvent::*; #[cfg(feature = "MozDebug")] #[allow(non_snake_case)] mod gen_MozDebug; #[cfg(feature = "MozDebug")] +#[allow(unused_imports)] pub use gen_MozDebug::*; #[cfg(feature = "MutationEvent")] #[allow(non_snake_case)] mod gen_MutationEvent; #[cfg(feature = "MutationEvent")] +#[allow(unused_imports)] pub use gen_MutationEvent::*; #[cfg(feature = "MutationObserver")] #[allow(non_snake_case)] mod gen_MutationObserver; #[cfg(feature = "MutationObserver")] +#[allow(unused_imports)] pub use gen_MutationObserver::*; #[cfg(feature = "MutationObserverInit")] #[allow(non_snake_case)] mod gen_MutationObserverInit; #[cfg(feature = "MutationObserverInit")] +#[allow(unused_imports)] pub use gen_MutationObserverInit::*; #[cfg(feature = "MutationObservingInfo")] #[allow(non_snake_case)] mod gen_MutationObservingInfo; #[cfg(feature = "MutationObservingInfo")] +#[allow(unused_imports)] pub use gen_MutationObservingInfo::*; #[cfg(feature = "MutationRecord")] #[allow(non_snake_case)] mod gen_MutationRecord; #[cfg(feature = "MutationRecord")] +#[allow(unused_imports)] pub use gen_MutationRecord::*; #[cfg(feature = "NamedNodeMap")] #[allow(non_snake_case)] mod gen_NamedNodeMap; #[cfg(feature = "NamedNodeMap")] +#[allow(unused_imports)] pub use gen_NamedNodeMap::*; #[cfg(feature = "NativeOsFileReadOptions")] #[allow(non_snake_case)] mod gen_NativeOsFileReadOptions; #[cfg(feature = "NativeOsFileReadOptions")] +#[allow(unused_imports)] pub use gen_NativeOsFileReadOptions::*; #[cfg(feature = "NativeOsFileWriteAtomicOptions")] #[allow(non_snake_case)] mod gen_NativeOsFileWriteAtomicOptions; #[cfg(feature = "NativeOsFileWriteAtomicOptions")] +#[allow(unused_imports)] pub use gen_NativeOsFileWriteAtomicOptions::*; #[cfg(feature = "NavigationType")] #[allow(non_snake_case)] mod gen_NavigationType; #[cfg(feature = "NavigationType")] +#[allow(unused_imports)] pub use gen_NavigationType::*; #[cfg(feature = "Navigator")] #[allow(non_snake_case)] mod gen_Navigator; #[cfg(feature = "Navigator")] +#[allow(unused_imports)] pub use gen_Navigator::*; #[cfg(feature = "NavigatorAutomationInformation")] #[allow(non_snake_case)] mod gen_NavigatorAutomationInformation; #[cfg(feature = "NavigatorAutomationInformation")] +#[allow(unused_imports)] pub use gen_NavigatorAutomationInformation::*; #[cfg(feature = "NetworkCommandOptions")] #[allow(non_snake_case)] mod gen_NetworkCommandOptions; #[cfg(feature = "NetworkCommandOptions")] +#[allow(unused_imports)] pub use gen_NetworkCommandOptions::*; #[cfg(feature = "NetworkInformation")] #[allow(non_snake_case)] mod gen_NetworkInformation; #[cfg(feature = "NetworkInformation")] +#[allow(unused_imports)] pub use gen_NetworkInformation::*; #[cfg(feature = "NetworkResultOptions")] #[allow(non_snake_case)] mod gen_NetworkResultOptions; #[cfg(feature = "NetworkResultOptions")] +#[allow(unused_imports)] pub use gen_NetworkResultOptions::*; #[cfg(feature = "Node")] #[allow(non_snake_case)] mod gen_Node; #[cfg(feature = "Node")] +#[allow(unused_imports)] pub use gen_Node::*; #[cfg(feature = "NodeFilter")] #[allow(non_snake_case)] mod gen_NodeFilter; #[cfg(feature = "NodeFilter")] +#[allow(unused_imports)] pub use gen_NodeFilter::*; #[cfg(feature = "NodeIterator")] #[allow(non_snake_case)] mod gen_NodeIterator; #[cfg(feature = "NodeIterator")] +#[allow(unused_imports)] pub use gen_NodeIterator::*; #[cfg(feature = "NodeList")] #[allow(non_snake_case)] mod gen_NodeList; #[cfg(feature = "NodeList")] +#[allow(unused_imports)] pub use gen_NodeList::*; #[cfg(feature = "Notification")] #[allow(non_snake_case)] mod gen_Notification; #[cfg(feature = "Notification")] +#[allow(unused_imports)] pub use gen_Notification::*; #[cfg(feature = "NotificationAction")] #[allow(non_snake_case)] mod gen_NotificationAction; #[cfg(feature = "NotificationAction")] +#[allow(unused_imports)] pub use gen_NotificationAction::*; #[cfg(feature = "NotificationDirection")] #[allow(non_snake_case)] mod gen_NotificationDirection; #[cfg(feature = "NotificationDirection")] +#[allow(unused_imports)] pub use gen_NotificationDirection::*; #[cfg(feature = "NotificationEvent")] #[allow(non_snake_case)] mod gen_NotificationEvent; #[cfg(feature = "NotificationEvent")] +#[allow(unused_imports)] pub use gen_NotificationEvent::*; #[cfg(feature = "NotificationEventInit")] #[allow(non_snake_case)] mod gen_NotificationEventInit; #[cfg(feature = "NotificationEventInit")] +#[allow(unused_imports)] pub use gen_NotificationEventInit::*; #[cfg(feature = "NotificationOptions")] #[allow(non_snake_case)] mod gen_NotificationOptions; #[cfg(feature = "NotificationOptions")] +#[allow(unused_imports)] pub use gen_NotificationOptions::*; #[cfg(feature = "NotificationPermission")] #[allow(non_snake_case)] mod gen_NotificationPermission; #[cfg(feature = "NotificationPermission")] +#[allow(unused_imports)] pub use gen_NotificationPermission::*; #[cfg(feature = "ObserverCallback")] #[allow(non_snake_case)] mod gen_ObserverCallback; #[cfg(feature = "ObserverCallback")] +#[allow(unused_imports)] pub use gen_ObserverCallback::*; #[cfg(feature = "OesElementIndexUint")] #[allow(non_snake_case)] mod gen_OesElementIndexUint; #[cfg(feature = "OesElementIndexUint")] +#[allow(unused_imports)] pub use gen_OesElementIndexUint::*; #[cfg(feature = "OesStandardDerivatives")] #[allow(non_snake_case)] mod gen_OesStandardDerivatives; #[cfg(feature = "OesStandardDerivatives")] +#[allow(unused_imports)] pub use gen_OesStandardDerivatives::*; #[cfg(feature = "OesTextureFloat")] #[allow(non_snake_case)] mod gen_OesTextureFloat; #[cfg(feature = "OesTextureFloat")] +#[allow(unused_imports)] pub use gen_OesTextureFloat::*; #[cfg(feature = "OesTextureFloatLinear")] #[allow(non_snake_case)] mod gen_OesTextureFloatLinear; #[cfg(feature = "OesTextureFloatLinear")] +#[allow(unused_imports)] pub use gen_OesTextureFloatLinear::*; #[cfg(feature = "OesTextureHalfFloat")] #[allow(non_snake_case)] mod gen_OesTextureHalfFloat; #[cfg(feature = "OesTextureHalfFloat")] +#[allow(unused_imports)] pub use gen_OesTextureHalfFloat::*; #[cfg(feature = "OesTextureHalfFloatLinear")] #[allow(non_snake_case)] mod gen_OesTextureHalfFloatLinear; #[cfg(feature = "OesTextureHalfFloatLinear")] +#[allow(unused_imports)] pub use gen_OesTextureHalfFloatLinear::*; #[cfg(feature = "OesVertexArrayObject")] #[allow(non_snake_case)] mod gen_OesVertexArrayObject; #[cfg(feature = "OesVertexArrayObject")] +#[allow(unused_imports)] pub use gen_OesVertexArrayObject::*; #[cfg(feature = "OfflineAudioCompletionEvent")] #[allow(non_snake_case)] mod gen_OfflineAudioCompletionEvent; #[cfg(feature = "OfflineAudioCompletionEvent")] +#[allow(unused_imports)] pub use gen_OfflineAudioCompletionEvent::*; #[cfg(feature = "OfflineAudioCompletionEventInit")] #[allow(non_snake_case)] mod gen_OfflineAudioCompletionEventInit; #[cfg(feature = "OfflineAudioCompletionEventInit")] +#[allow(unused_imports)] pub use gen_OfflineAudioCompletionEventInit::*; #[cfg(feature = "OfflineAudioContext")] #[allow(non_snake_case)] mod gen_OfflineAudioContext; #[cfg(feature = "OfflineAudioContext")] +#[allow(unused_imports)] pub use gen_OfflineAudioContext::*; #[cfg(feature = "OfflineAudioContextOptions")] #[allow(non_snake_case)] mod gen_OfflineAudioContextOptions; #[cfg(feature = "OfflineAudioContextOptions")] +#[allow(unused_imports)] pub use gen_OfflineAudioContextOptions::*; #[cfg(feature = "OfflineResourceList")] #[allow(non_snake_case)] mod gen_OfflineResourceList; #[cfg(feature = "OfflineResourceList")] +#[allow(unused_imports)] pub use gen_OfflineResourceList::*; #[cfg(feature = "OffscreenCanvas")] #[allow(non_snake_case)] mod gen_OffscreenCanvas; #[cfg(feature = "OffscreenCanvas")] +#[allow(unused_imports)] pub use gen_OffscreenCanvas::*; #[cfg(feature = "OffscreenCanvasRenderingContext2d")] #[allow(non_snake_case)] mod gen_OffscreenCanvasRenderingContext2d; #[cfg(feature = "OffscreenCanvasRenderingContext2d")] +#[allow(unused_imports)] pub use gen_OffscreenCanvasRenderingContext2d::*; #[cfg(feature = "OpenWindowEventDetail")] #[allow(non_snake_case)] mod gen_OpenWindowEventDetail; #[cfg(feature = "OpenWindowEventDetail")] +#[allow(unused_imports)] pub use gen_OpenWindowEventDetail::*; #[cfg(feature = "OptionalEffectTiming")] #[allow(non_snake_case)] mod gen_OptionalEffectTiming; #[cfg(feature = "OptionalEffectTiming")] +#[allow(unused_imports)] pub use gen_OptionalEffectTiming::*; #[cfg(feature = "OrientationLockType")] #[allow(non_snake_case)] mod gen_OrientationLockType; #[cfg(feature = "OrientationLockType")] +#[allow(unused_imports)] pub use gen_OrientationLockType::*; #[cfg(feature = "OrientationType")] #[allow(non_snake_case)] mod gen_OrientationType; #[cfg(feature = "OrientationType")] +#[allow(unused_imports)] pub use gen_OrientationType::*; #[cfg(feature = "OscillatorNode")] #[allow(non_snake_case)] mod gen_OscillatorNode; #[cfg(feature = "OscillatorNode")] +#[allow(unused_imports)] pub use gen_OscillatorNode::*; #[cfg(feature = "OscillatorOptions")] #[allow(non_snake_case)] mod gen_OscillatorOptions; #[cfg(feature = "OscillatorOptions")] +#[allow(unused_imports)] pub use gen_OscillatorOptions::*; #[cfg(feature = "OscillatorType")] #[allow(non_snake_case)] mod gen_OscillatorType; #[cfg(feature = "OscillatorType")] +#[allow(unused_imports)] pub use gen_OscillatorType::*; #[cfg(feature = "OverSampleType")] #[allow(non_snake_case)] mod gen_OverSampleType; #[cfg(feature = "OverSampleType")] +#[allow(unused_imports)] pub use gen_OverSampleType::*; #[cfg(feature = "OvrMultiview2")] #[allow(non_snake_case)] mod gen_OvrMultiview2; #[cfg(feature = "OvrMultiview2")] +#[allow(unused_imports)] pub use gen_OvrMultiview2::*; #[cfg(feature = "PageTransitionEvent")] #[allow(non_snake_case)] mod gen_PageTransitionEvent; #[cfg(feature = "PageTransitionEvent")] +#[allow(unused_imports)] pub use gen_PageTransitionEvent::*; #[cfg(feature = "PageTransitionEventInit")] #[allow(non_snake_case)] mod gen_PageTransitionEventInit; #[cfg(feature = "PageTransitionEventInit")] +#[allow(unused_imports)] pub use gen_PageTransitionEventInit::*; #[cfg(feature = "PaintRequest")] #[allow(non_snake_case)] mod gen_PaintRequest; #[cfg(feature = "PaintRequest")] +#[allow(unused_imports)] pub use gen_PaintRequest::*; #[cfg(feature = "PaintRequestList")] #[allow(non_snake_case)] mod gen_PaintRequestList; #[cfg(feature = "PaintRequestList")] +#[allow(unused_imports)] pub use gen_PaintRequestList::*; #[cfg(feature = "PaintWorkletGlobalScope")] #[allow(non_snake_case)] mod gen_PaintWorkletGlobalScope; #[cfg(feature = "PaintWorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_PaintWorkletGlobalScope::*; #[cfg(feature = "PannerNode")] #[allow(non_snake_case)] mod gen_PannerNode; #[cfg(feature = "PannerNode")] +#[allow(unused_imports)] pub use gen_PannerNode::*; #[cfg(feature = "PannerOptions")] #[allow(non_snake_case)] mod gen_PannerOptions; #[cfg(feature = "PannerOptions")] +#[allow(unused_imports)] pub use gen_PannerOptions::*; #[cfg(feature = "PanningModelType")] #[allow(non_snake_case)] mod gen_PanningModelType; #[cfg(feature = "PanningModelType")] +#[allow(unused_imports)] pub use gen_PanningModelType::*; #[cfg(feature = "ParityType")] #[allow(non_snake_case)] mod gen_ParityType; #[cfg(feature = "ParityType")] +#[allow(unused_imports)] pub use gen_ParityType::*; #[cfg(feature = "Path2d")] #[allow(non_snake_case)] mod gen_Path2d; #[cfg(feature = "Path2d")] +#[allow(unused_imports)] pub use gen_Path2d::*; #[cfg(feature = "PaymentAddress")] #[allow(non_snake_case)] mod gen_PaymentAddress; #[cfg(feature = "PaymentAddress")] +#[allow(unused_imports)] pub use gen_PaymentAddress::*; #[cfg(feature = "PaymentComplete")] #[allow(non_snake_case)] mod gen_PaymentComplete; #[cfg(feature = "PaymentComplete")] +#[allow(unused_imports)] pub use gen_PaymentComplete::*; #[cfg(feature = "PaymentMethodChangeEvent")] #[allow(non_snake_case)] mod gen_PaymentMethodChangeEvent; #[cfg(feature = "PaymentMethodChangeEvent")] +#[allow(unused_imports)] pub use gen_PaymentMethodChangeEvent::*; #[cfg(feature = "PaymentMethodChangeEventInit")] #[allow(non_snake_case)] mod gen_PaymentMethodChangeEventInit; #[cfg(feature = "PaymentMethodChangeEventInit")] +#[allow(unused_imports)] pub use gen_PaymentMethodChangeEventInit::*; #[cfg(feature = "PaymentRequestUpdateEvent")] #[allow(non_snake_case)] mod gen_PaymentRequestUpdateEvent; #[cfg(feature = "PaymentRequestUpdateEvent")] +#[allow(unused_imports)] pub use gen_PaymentRequestUpdateEvent::*; #[cfg(feature = "PaymentRequestUpdateEventInit")] #[allow(non_snake_case)] mod gen_PaymentRequestUpdateEventInit; #[cfg(feature = "PaymentRequestUpdateEventInit")] +#[allow(unused_imports)] pub use gen_PaymentRequestUpdateEventInit::*; #[cfg(feature = "PaymentResponse")] #[allow(non_snake_case)] mod gen_PaymentResponse; #[cfg(feature = "PaymentResponse")] +#[allow(unused_imports)] pub use gen_PaymentResponse::*; #[cfg(feature = "Pbkdf2Params")] #[allow(non_snake_case)] mod gen_Pbkdf2Params; #[cfg(feature = "Pbkdf2Params")] +#[allow(unused_imports)] pub use gen_Pbkdf2Params::*; #[cfg(feature = "PcImplIceConnectionState")] #[allow(non_snake_case)] mod gen_PcImplIceConnectionState; #[cfg(feature = "PcImplIceConnectionState")] +#[allow(unused_imports)] pub use gen_PcImplIceConnectionState::*; #[cfg(feature = "PcImplIceGatheringState")] #[allow(non_snake_case)] mod gen_PcImplIceGatheringState; #[cfg(feature = "PcImplIceGatheringState")] +#[allow(unused_imports)] pub use gen_PcImplIceGatheringState::*; #[cfg(feature = "PcImplSignalingState")] #[allow(non_snake_case)] mod gen_PcImplSignalingState; #[cfg(feature = "PcImplSignalingState")] +#[allow(unused_imports)] pub use gen_PcImplSignalingState::*; #[cfg(feature = "PcObserverStateType")] #[allow(non_snake_case)] mod gen_PcObserverStateType; #[cfg(feature = "PcObserverStateType")] +#[allow(unused_imports)] pub use gen_PcObserverStateType::*; #[cfg(feature = "Performance")] #[allow(non_snake_case)] mod gen_Performance; #[cfg(feature = "Performance")] +#[allow(unused_imports)] pub use gen_Performance::*; #[cfg(feature = "PerformanceEntry")] #[allow(non_snake_case)] mod gen_PerformanceEntry; #[cfg(feature = "PerformanceEntry")] +#[allow(unused_imports)] pub use gen_PerformanceEntry::*; #[cfg(feature = "PerformanceEntryEventInit")] #[allow(non_snake_case)] mod gen_PerformanceEntryEventInit; #[cfg(feature = "PerformanceEntryEventInit")] +#[allow(unused_imports)] pub use gen_PerformanceEntryEventInit::*; #[cfg(feature = "PerformanceEntryFilterOptions")] #[allow(non_snake_case)] mod gen_PerformanceEntryFilterOptions; #[cfg(feature = "PerformanceEntryFilterOptions")] +#[allow(unused_imports)] pub use gen_PerformanceEntryFilterOptions::*; #[cfg(feature = "PerformanceMark")] #[allow(non_snake_case)] mod gen_PerformanceMark; #[cfg(feature = "PerformanceMark")] +#[allow(unused_imports)] pub use gen_PerformanceMark::*; #[cfg(feature = "PerformanceMeasure")] #[allow(non_snake_case)] mod gen_PerformanceMeasure; #[cfg(feature = "PerformanceMeasure")] +#[allow(unused_imports)] pub use gen_PerformanceMeasure::*; #[cfg(feature = "PerformanceNavigation")] #[allow(non_snake_case)] mod gen_PerformanceNavigation; #[cfg(feature = "PerformanceNavigation")] +#[allow(unused_imports)] pub use gen_PerformanceNavigation::*; #[cfg(feature = "PerformanceNavigationTiming")] #[allow(non_snake_case)] mod gen_PerformanceNavigationTiming; #[cfg(feature = "PerformanceNavigationTiming")] +#[allow(unused_imports)] pub use gen_PerformanceNavigationTiming::*; #[cfg(feature = "PerformanceObserver")] #[allow(non_snake_case)] mod gen_PerformanceObserver; #[cfg(feature = "PerformanceObserver")] +#[allow(unused_imports)] pub use gen_PerformanceObserver::*; #[cfg(feature = "PerformanceObserverEntryList")] #[allow(non_snake_case)] mod gen_PerformanceObserverEntryList; #[cfg(feature = "PerformanceObserverEntryList")] +#[allow(unused_imports)] pub use gen_PerformanceObserverEntryList::*; #[cfg(feature = "PerformanceObserverInit")] #[allow(non_snake_case)] mod gen_PerformanceObserverInit; #[cfg(feature = "PerformanceObserverInit")] +#[allow(unused_imports)] pub use gen_PerformanceObserverInit::*; #[cfg(feature = "PerformanceResourceTiming")] #[allow(non_snake_case)] mod gen_PerformanceResourceTiming; #[cfg(feature = "PerformanceResourceTiming")] +#[allow(unused_imports)] pub use gen_PerformanceResourceTiming::*; #[cfg(feature = "PerformanceServerTiming")] #[allow(non_snake_case)] mod gen_PerformanceServerTiming; #[cfg(feature = "PerformanceServerTiming")] +#[allow(unused_imports)] pub use gen_PerformanceServerTiming::*; #[cfg(feature = "PerformanceTiming")] #[allow(non_snake_case)] mod gen_PerformanceTiming; #[cfg(feature = "PerformanceTiming")] +#[allow(unused_imports)] pub use gen_PerformanceTiming::*; #[cfg(feature = "PeriodicWave")] #[allow(non_snake_case)] mod gen_PeriodicWave; #[cfg(feature = "PeriodicWave")] +#[allow(unused_imports)] pub use gen_PeriodicWave::*; #[cfg(feature = "PeriodicWaveConstraints")] #[allow(non_snake_case)] mod gen_PeriodicWaveConstraints; #[cfg(feature = "PeriodicWaveConstraints")] +#[allow(unused_imports)] pub use gen_PeriodicWaveConstraints::*; #[cfg(feature = "PeriodicWaveOptions")] #[allow(non_snake_case)] mod gen_PeriodicWaveOptions; #[cfg(feature = "PeriodicWaveOptions")] +#[allow(unused_imports)] pub use gen_PeriodicWaveOptions::*; #[cfg(feature = "PermissionDescriptor")] #[allow(non_snake_case)] mod gen_PermissionDescriptor; #[cfg(feature = "PermissionDescriptor")] +#[allow(unused_imports)] pub use gen_PermissionDescriptor::*; #[cfg(feature = "PermissionName")] #[allow(non_snake_case)] mod gen_PermissionName; #[cfg(feature = "PermissionName")] +#[allow(unused_imports)] pub use gen_PermissionName::*; #[cfg(feature = "PermissionState")] #[allow(non_snake_case)] mod gen_PermissionState; #[cfg(feature = "PermissionState")] +#[allow(unused_imports)] pub use gen_PermissionState::*; #[cfg(feature = "PermissionStatus")] #[allow(non_snake_case)] mod gen_PermissionStatus; #[cfg(feature = "PermissionStatus")] +#[allow(unused_imports)] pub use gen_PermissionStatus::*; #[cfg(feature = "Permissions")] #[allow(non_snake_case)] mod gen_Permissions; #[cfg(feature = "Permissions")] +#[allow(unused_imports)] pub use gen_Permissions::*; #[cfg(feature = "PlaneLayout")] #[allow(non_snake_case)] mod gen_PlaneLayout; #[cfg(feature = "PlaneLayout")] +#[allow(unused_imports)] pub use gen_PlaneLayout::*; #[cfg(feature = "PlaybackDirection")] #[allow(non_snake_case)] mod gen_PlaybackDirection; #[cfg(feature = "PlaybackDirection")] +#[allow(unused_imports)] pub use gen_PlaybackDirection::*; #[cfg(feature = "Plugin")] #[allow(non_snake_case)] mod gen_Plugin; #[cfg(feature = "Plugin")] +#[allow(unused_imports)] pub use gen_Plugin::*; #[cfg(feature = "PluginArray")] #[allow(non_snake_case)] mod gen_PluginArray; #[cfg(feature = "PluginArray")] +#[allow(unused_imports)] pub use gen_PluginArray::*; #[cfg(feature = "PluginCrashedEventInit")] #[allow(non_snake_case)] mod gen_PluginCrashedEventInit; #[cfg(feature = "PluginCrashedEventInit")] +#[allow(unused_imports)] pub use gen_PluginCrashedEventInit::*; #[cfg(feature = "PointerEvent")] #[allow(non_snake_case)] mod gen_PointerEvent; #[cfg(feature = "PointerEvent")] +#[allow(unused_imports)] pub use gen_PointerEvent::*; #[cfg(feature = "PointerEventInit")] #[allow(non_snake_case)] mod gen_PointerEventInit; #[cfg(feature = "PointerEventInit")] +#[allow(unused_imports)] pub use gen_PointerEventInit::*; #[cfg(feature = "PopStateEvent")] #[allow(non_snake_case)] mod gen_PopStateEvent; #[cfg(feature = "PopStateEvent")] +#[allow(unused_imports)] pub use gen_PopStateEvent::*; #[cfg(feature = "PopStateEventInit")] #[allow(non_snake_case)] mod gen_PopStateEventInit; #[cfg(feature = "PopStateEventInit")] +#[allow(unused_imports)] pub use gen_PopStateEventInit::*; #[cfg(feature = "PopupBlockedEvent")] #[allow(non_snake_case)] mod gen_PopupBlockedEvent; #[cfg(feature = "PopupBlockedEvent")] +#[allow(unused_imports)] pub use gen_PopupBlockedEvent::*; #[cfg(feature = "PopupBlockedEventInit")] #[allow(non_snake_case)] mod gen_PopupBlockedEventInit; #[cfg(feature = "PopupBlockedEventInit")] +#[allow(unused_imports)] pub use gen_PopupBlockedEventInit::*; #[cfg(feature = "Position")] #[allow(non_snake_case)] mod gen_Position; #[cfg(feature = "Position")] +#[allow(unused_imports)] pub use gen_Position::*; #[cfg(feature = "PositionAlignSetting")] #[allow(non_snake_case)] mod gen_PositionAlignSetting; #[cfg(feature = "PositionAlignSetting")] +#[allow(unused_imports)] pub use gen_PositionAlignSetting::*; #[cfg(feature = "PositionError")] #[allow(non_snake_case)] mod gen_PositionError; #[cfg(feature = "PositionError")] +#[allow(unused_imports)] pub use gen_PositionError::*; #[cfg(feature = "PositionOptions")] #[allow(non_snake_case)] mod gen_PositionOptions; #[cfg(feature = "PositionOptions")] +#[allow(unused_imports)] pub use gen_PositionOptions::*; #[cfg(feature = "PremultiplyAlpha")] #[allow(non_snake_case)] mod gen_PremultiplyAlpha; #[cfg(feature = "PremultiplyAlpha")] +#[allow(unused_imports)] pub use gen_PremultiplyAlpha::*; #[cfg(feature = "Presentation")] #[allow(non_snake_case)] mod gen_Presentation; #[cfg(feature = "Presentation")] +#[allow(unused_imports)] pub use gen_Presentation::*; #[cfg(feature = "PresentationAvailability")] #[allow(non_snake_case)] mod gen_PresentationAvailability; #[cfg(feature = "PresentationAvailability")] +#[allow(unused_imports)] pub use gen_PresentationAvailability::*; #[cfg(feature = "PresentationConnection")] #[allow(non_snake_case)] mod gen_PresentationConnection; #[cfg(feature = "PresentationConnection")] +#[allow(unused_imports)] pub use gen_PresentationConnection::*; #[cfg(feature = "PresentationConnectionAvailableEvent")] #[allow(non_snake_case)] mod gen_PresentationConnectionAvailableEvent; #[cfg(feature = "PresentationConnectionAvailableEvent")] +#[allow(unused_imports)] pub use gen_PresentationConnectionAvailableEvent::*; #[cfg(feature = "PresentationConnectionAvailableEventInit")] #[allow(non_snake_case)] mod gen_PresentationConnectionAvailableEventInit; #[cfg(feature = "PresentationConnectionAvailableEventInit")] +#[allow(unused_imports)] pub use gen_PresentationConnectionAvailableEventInit::*; #[cfg(feature = "PresentationConnectionBinaryType")] #[allow(non_snake_case)] mod gen_PresentationConnectionBinaryType; #[cfg(feature = "PresentationConnectionBinaryType")] +#[allow(unused_imports)] pub use gen_PresentationConnectionBinaryType::*; #[cfg(feature = "PresentationConnectionCloseEvent")] #[allow(non_snake_case)] mod gen_PresentationConnectionCloseEvent; #[cfg(feature = "PresentationConnectionCloseEvent")] +#[allow(unused_imports)] pub use gen_PresentationConnectionCloseEvent::*; #[cfg(feature = "PresentationConnectionCloseEventInit")] #[allow(non_snake_case)] mod gen_PresentationConnectionCloseEventInit; #[cfg(feature = "PresentationConnectionCloseEventInit")] +#[allow(unused_imports)] pub use gen_PresentationConnectionCloseEventInit::*; #[cfg(feature = "PresentationConnectionClosedReason")] #[allow(non_snake_case)] mod gen_PresentationConnectionClosedReason; #[cfg(feature = "PresentationConnectionClosedReason")] +#[allow(unused_imports)] pub use gen_PresentationConnectionClosedReason::*; #[cfg(feature = "PresentationConnectionList")] #[allow(non_snake_case)] mod gen_PresentationConnectionList; #[cfg(feature = "PresentationConnectionList")] +#[allow(unused_imports)] pub use gen_PresentationConnectionList::*; #[cfg(feature = "PresentationConnectionState")] #[allow(non_snake_case)] mod gen_PresentationConnectionState; #[cfg(feature = "PresentationConnectionState")] +#[allow(unused_imports)] pub use gen_PresentationConnectionState::*; #[cfg(feature = "PresentationReceiver")] #[allow(non_snake_case)] mod gen_PresentationReceiver; #[cfg(feature = "PresentationReceiver")] +#[allow(unused_imports)] pub use gen_PresentationReceiver::*; #[cfg(feature = "PresentationRequest")] #[allow(non_snake_case)] mod gen_PresentationRequest; #[cfg(feature = "PresentationRequest")] +#[allow(unused_imports)] pub use gen_PresentationRequest::*; #[cfg(feature = "PresentationStyle")] #[allow(non_snake_case)] mod gen_PresentationStyle; #[cfg(feature = "PresentationStyle")] +#[allow(unused_imports)] pub use gen_PresentationStyle::*; #[cfg(feature = "ProcessingInstruction")] #[allow(non_snake_case)] mod gen_ProcessingInstruction; #[cfg(feature = "ProcessingInstruction")] +#[allow(unused_imports)] pub use gen_ProcessingInstruction::*; #[cfg(feature = "ProfileTimelineLayerRect")] #[allow(non_snake_case)] mod gen_ProfileTimelineLayerRect; #[cfg(feature = "ProfileTimelineLayerRect")] +#[allow(unused_imports)] pub use gen_ProfileTimelineLayerRect::*; #[cfg(feature = "ProfileTimelineMarker")] #[allow(non_snake_case)] mod gen_ProfileTimelineMarker; #[cfg(feature = "ProfileTimelineMarker")] +#[allow(unused_imports)] pub use gen_ProfileTimelineMarker::*; #[cfg(feature = "ProfileTimelineMessagePortOperationType")] #[allow(non_snake_case)] mod gen_ProfileTimelineMessagePortOperationType; #[cfg(feature = "ProfileTimelineMessagePortOperationType")] +#[allow(unused_imports)] pub use gen_ProfileTimelineMessagePortOperationType::*; #[cfg(feature = "ProfileTimelineStackFrame")] #[allow(non_snake_case)] mod gen_ProfileTimelineStackFrame; #[cfg(feature = "ProfileTimelineStackFrame")] +#[allow(unused_imports)] pub use gen_ProfileTimelineStackFrame::*; #[cfg(feature = "ProfileTimelineWorkerOperationType")] #[allow(non_snake_case)] mod gen_ProfileTimelineWorkerOperationType; #[cfg(feature = "ProfileTimelineWorkerOperationType")] +#[allow(unused_imports)] pub use gen_ProfileTimelineWorkerOperationType::*; #[cfg(feature = "ProgressEvent")] #[allow(non_snake_case)] mod gen_ProgressEvent; #[cfg(feature = "ProgressEvent")] +#[allow(unused_imports)] pub use gen_ProgressEvent::*; #[cfg(feature = "ProgressEventInit")] #[allow(non_snake_case)] mod gen_ProgressEventInit; #[cfg(feature = "ProgressEventInit")] +#[allow(unused_imports)] pub use gen_ProgressEventInit::*; #[cfg(feature = "PromiseNativeHandler")] #[allow(non_snake_case)] mod gen_PromiseNativeHandler; #[cfg(feature = "PromiseNativeHandler")] +#[allow(unused_imports)] pub use gen_PromiseNativeHandler::*; #[cfg(feature = "PromiseRejectionEvent")] #[allow(non_snake_case)] mod gen_PromiseRejectionEvent; #[cfg(feature = "PromiseRejectionEvent")] +#[allow(unused_imports)] pub use gen_PromiseRejectionEvent::*; #[cfg(feature = "PromiseRejectionEventInit")] #[allow(non_snake_case)] mod gen_PromiseRejectionEventInit; #[cfg(feature = "PromiseRejectionEventInit")] +#[allow(unused_imports)] pub use gen_PromiseRejectionEventInit::*; #[cfg(feature = "PublicKeyCredential")] #[allow(non_snake_case)] mod gen_PublicKeyCredential; #[cfg(feature = "PublicKeyCredential")] +#[allow(unused_imports)] pub use gen_PublicKeyCredential::*; #[cfg(feature = "PublicKeyCredentialCreationOptions")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialCreationOptions; #[cfg(feature = "PublicKeyCredentialCreationOptions")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialCreationOptions::*; #[cfg(feature = "PublicKeyCredentialDescriptor")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialDescriptor; #[cfg(feature = "PublicKeyCredentialDescriptor")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialDescriptor::*; #[cfg(feature = "PublicKeyCredentialEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialEntity; #[cfg(feature = "PublicKeyCredentialEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialEntity::*; #[cfg(feature = "PublicKeyCredentialParameters")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialParameters; #[cfg(feature = "PublicKeyCredentialParameters")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialParameters::*; #[cfg(feature = "PublicKeyCredentialRequestOptions")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialRequestOptions; #[cfg(feature = "PublicKeyCredentialRequestOptions")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialRequestOptions::*; #[cfg(feature = "PublicKeyCredentialRpEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialRpEntity; #[cfg(feature = "PublicKeyCredentialRpEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialRpEntity::*; #[cfg(feature = "PublicKeyCredentialType")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialType; #[cfg(feature = "PublicKeyCredentialType")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialType::*; #[cfg(feature = "PublicKeyCredentialUserEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialUserEntity; #[cfg(feature = "PublicKeyCredentialUserEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialUserEntity::*; #[cfg(feature = "PushEncryptionKeyName")] #[allow(non_snake_case)] mod gen_PushEncryptionKeyName; #[cfg(feature = "PushEncryptionKeyName")] +#[allow(unused_imports)] pub use gen_PushEncryptionKeyName::*; #[cfg(feature = "PushEvent")] #[allow(non_snake_case)] mod gen_PushEvent; #[cfg(feature = "PushEvent")] +#[allow(unused_imports)] pub use gen_PushEvent::*; #[cfg(feature = "PushEventInit")] #[allow(non_snake_case)] mod gen_PushEventInit; #[cfg(feature = "PushEventInit")] +#[allow(unused_imports)] pub use gen_PushEventInit::*; #[cfg(feature = "PushManager")] #[allow(non_snake_case)] mod gen_PushManager; #[cfg(feature = "PushManager")] +#[allow(unused_imports)] pub use gen_PushManager::*; #[cfg(feature = "PushMessageData")] #[allow(non_snake_case)] mod gen_PushMessageData; #[cfg(feature = "PushMessageData")] +#[allow(unused_imports)] pub use gen_PushMessageData::*; #[cfg(feature = "PushPermissionState")] #[allow(non_snake_case)] mod gen_PushPermissionState; #[cfg(feature = "PushPermissionState")] +#[allow(unused_imports)] pub use gen_PushPermissionState::*; #[cfg(feature = "PushSubscription")] #[allow(non_snake_case)] mod gen_PushSubscription; #[cfg(feature = "PushSubscription")] +#[allow(unused_imports)] pub use gen_PushSubscription::*; #[cfg(feature = "PushSubscriptionInit")] #[allow(non_snake_case)] mod gen_PushSubscriptionInit; #[cfg(feature = "PushSubscriptionInit")] +#[allow(unused_imports)] pub use gen_PushSubscriptionInit::*; #[cfg(feature = "PushSubscriptionJson")] #[allow(non_snake_case)] mod gen_PushSubscriptionJson; #[cfg(feature = "PushSubscriptionJson")] +#[allow(unused_imports)] pub use gen_PushSubscriptionJson::*; #[cfg(feature = "PushSubscriptionKeys")] #[allow(non_snake_case)] mod gen_PushSubscriptionKeys; #[cfg(feature = "PushSubscriptionKeys")] +#[allow(unused_imports)] pub use gen_PushSubscriptionKeys::*; #[cfg(feature = "PushSubscriptionOptions")] #[allow(non_snake_case)] mod gen_PushSubscriptionOptions; #[cfg(feature = "PushSubscriptionOptions")] +#[allow(unused_imports)] pub use gen_PushSubscriptionOptions::*; #[cfg(feature = "PushSubscriptionOptionsInit")] #[allow(non_snake_case)] mod gen_PushSubscriptionOptionsInit; #[cfg(feature = "PushSubscriptionOptionsInit")] +#[allow(unused_imports)] pub use gen_PushSubscriptionOptionsInit::*; #[cfg(feature = "QueryOptions")] #[allow(non_snake_case)] mod gen_QueryOptions; #[cfg(feature = "QueryOptions")] +#[allow(unused_imports)] pub use gen_QueryOptions::*; #[cfg(feature = "QueuingStrategy")] #[allow(non_snake_case)] mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] +#[allow(unused_imports)] pub use gen_QueuingStrategy::*; #[cfg(feature = "QueuingStrategyInit")] #[allow(non_snake_case)] mod gen_QueuingStrategyInit; #[cfg(feature = "QueuingStrategyInit")] +#[allow(unused_imports)] pub use gen_QueuingStrategyInit::*; #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; #[cfg(feature = "RadioNodeList")] +#[allow(unused_imports)] pub use gen_RadioNodeList::*; #[cfg(feature = "Range")] #[allow(non_snake_case)] mod gen_Range; #[cfg(feature = "Range")] +#[allow(unused_imports)] pub use gen_Range::*; #[cfg(feature = "RcwnPerfStats")] #[allow(non_snake_case)] mod gen_RcwnPerfStats; #[cfg(feature = "RcwnPerfStats")] +#[allow(unused_imports)] pub use gen_RcwnPerfStats::*; #[cfg(feature = "RcwnStatus")] #[allow(non_snake_case)] mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] +#[allow(unused_imports)] pub use gen_RcwnStatus::*; #[cfg(feature = "ReadableByteStreamController")] #[allow(non_snake_case)] mod gen_ReadableByteStreamController; #[cfg(feature = "ReadableByteStreamController")] +#[allow(unused_imports)] pub use gen_ReadableByteStreamController::*; #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] +#[allow(unused_imports)] pub use gen_ReadableStream::*; #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] +#[allow(unused_imports)] pub use gen_ReadableStreamByobReader::*; #[cfg(feature = "ReadableStreamByobRequest")] #[allow(non_snake_case)] mod gen_ReadableStreamByobRequest; #[cfg(feature = "ReadableStreamByobRequest")] +#[allow(unused_imports)] pub use gen_ReadableStreamByobRequest::*; #[cfg(feature = "ReadableStreamDefaultController")] #[allow(non_snake_case)] mod gen_ReadableStreamDefaultController; #[cfg(feature = "ReadableStreamDefaultController")] +#[allow(unused_imports)] pub use gen_ReadableStreamDefaultController::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] mod gen_ReadableStreamDefaultReader; #[cfg(feature = "ReadableStreamDefaultReader")] +#[allow(unused_imports)] pub use gen_ReadableStreamDefaultReader::*; #[cfg(feature = "ReadableStreamGetReaderOptions")] #[allow(non_snake_case)] mod gen_ReadableStreamGetReaderOptions; #[cfg(feature = "ReadableStreamGetReaderOptions")] +#[allow(unused_imports)] pub use gen_ReadableStreamGetReaderOptions::*; #[cfg(feature = "ReadableStreamIteratorOptions")] #[allow(non_snake_case)] mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] +#[allow(unused_imports)] pub use gen_ReadableStreamIteratorOptions::*; #[cfg(feature = "ReadableStreamReadResult")] #[allow(non_snake_case)] mod gen_ReadableStreamReadResult; #[cfg(feature = "ReadableStreamReadResult")] +#[allow(unused_imports)] pub use gen_ReadableStreamReadResult::*; #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] +#[allow(unused_imports)] pub use gen_ReadableStreamReaderMode::*; #[cfg(feature = "ReadableStreamType")] #[allow(non_snake_case)] mod gen_ReadableStreamType; #[cfg(feature = "ReadableStreamType")] +#[allow(unused_imports)] pub use gen_ReadableStreamType::*; #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; #[cfg(feature = "ReadableWritablePair")] +#[allow(unused_imports)] pub use gen_ReadableWritablePair::*; #[cfg(feature = "RecordingState")] #[allow(non_snake_case)] mod gen_RecordingState; #[cfg(feature = "RecordingState")] +#[allow(unused_imports)] pub use gen_RecordingState::*; #[cfg(feature = "ReferrerPolicy")] #[allow(non_snake_case)] mod gen_ReferrerPolicy; #[cfg(feature = "ReferrerPolicy")] +#[allow(unused_imports)] pub use gen_ReferrerPolicy::*; #[cfg(feature = "RegisterRequest")] #[allow(non_snake_case)] mod gen_RegisterRequest; #[cfg(feature = "RegisterRequest")] +#[allow(unused_imports)] pub use gen_RegisterRequest::*; #[cfg(feature = "RegisterResponse")] #[allow(non_snake_case)] mod gen_RegisterResponse; #[cfg(feature = "RegisterResponse")] +#[allow(unused_imports)] pub use gen_RegisterResponse::*; #[cfg(feature = "RegisteredKey")] #[allow(non_snake_case)] mod gen_RegisteredKey; #[cfg(feature = "RegisteredKey")] +#[allow(unused_imports)] pub use gen_RegisteredKey::*; #[cfg(feature = "RegistrationOptions")] #[allow(non_snake_case)] mod gen_RegistrationOptions; #[cfg(feature = "RegistrationOptions")] +#[allow(unused_imports)] pub use gen_RegistrationOptions::*; #[cfg(feature = "Request")] #[allow(non_snake_case)] mod gen_Request; #[cfg(feature = "Request")] +#[allow(unused_imports)] pub use gen_Request::*; #[cfg(feature = "RequestCache")] #[allow(non_snake_case)] mod gen_RequestCache; #[cfg(feature = "RequestCache")] +#[allow(unused_imports)] pub use gen_RequestCache::*; #[cfg(feature = "RequestCredentials")] #[allow(non_snake_case)] mod gen_RequestCredentials; #[cfg(feature = "RequestCredentials")] +#[allow(unused_imports)] pub use gen_RequestCredentials::*; #[cfg(feature = "RequestDestination")] #[allow(non_snake_case)] mod gen_RequestDestination; #[cfg(feature = "RequestDestination")] +#[allow(unused_imports)] pub use gen_RequestDestination::*; #[cfg(feature = "RequestDeviceOptions")] #[allow(non_snake_case)] mod gen_RequestDeviceOptions; #[cfg(feature = "RequestDeviceOptions")] +#[allow(unused_imports)] pub use gen_RequestDeviceOptions::*; #[cfg(feature = "RequestInit")] #[allow(non_snake_case)] mod gen_RequestInit; #[cfg(feature = "RequestInit")] +#[allow(unused_imports)] pub use gen_RequestInit::*; #[cfg(feature = "RequestMediaKeySystemAccessNotification")] #[allow(non_snake_case)] mod gen_RequestMediaKeySystemAccessNotification; #[cfg(feature = "RequestMediaKeySystemAccessNotification")] +#[allow(unused_imports)] pub use gen_RequestMediaKeySystemAccessNotification::*; #[cfg(feature = "RequestMode")] #[allow(non_snake_case)] mod gen_RequestMode; #[cfg(feature = "RequestMode")] +#[allow(unused_imports)] pub use gen_RequestMode::*; #[cfg(feature = "RequestRedirect")] #[allow(non_snake_case)] mod gen_RequestRedirect; #[cfg(feature = "RequestRedirect")] +#[allow(unused_imports)] pub use gen_RequestRedirect::*; #[cfg(feature = "ResizeObserver")] #[allow(non_snake_case)] mod gen_ResizeObserver; #[cfg(feature = "ResizeObserver")] +#[allow(unused_imports)] pub use gen_ResizeObserver::*; #[cfg(feature = "ResizeObserverBoxOptions")] #[allow(non_snake_case)] mod gen_ResizeObserverBoxOptions; #[cfg(feature = "ResizeObserverBoxOptions")] +#[allow(unused_imports)] pub use gen_ResizeObserverBoxOptions::*; #[cfg(feature = "ResizeObserverEntry")] #[allow(non_snake_case)] mod gen_ResizeObserverEntry; #[cfg(feature = "ResizeObserverEntry")] +#[allow(unused_imports)] pub use gen_ResizeObserverEntry::*; #[cfg(feature = "ResizeObserverOptions")] #[allow(non_snake_case)] mod gen_ResizeObserverOptions; #[cfg(feature = "ResizeObserverOptions")] +#[allow(unused_imports)] pub use gen_ResizeObserverOptions::*; #[cfg(feature = "ResizeObserverSize")] #[allow(non_snake_case)] mod gen_ResizeObserverSize; #[cfg(feature = "ResizeObserverSize")] +#[allow(unused_imports)] pub use gen_ResizeObserverSize::*; #[cfg(feature = "ResizeQuality")] #[allow(non_snake_case)] mod gen_ResizeQuality; #[cfg(feature = "ResizeQuality")] +#[allow(unused_imports)] pub use gen_ResizeQuality::*; #[cfg(feature = "Response")] #[allow(non_snake_case)] mod gen_Response; #[cfg(feature = "Response")] +#[allow(unused_imports)] pub use gen_Response::*; #[cfg(feature = "ResponseInit")] #[allow(non_snake_case)] mod gen_ResponseInit; #[cfg(feature = "ResponseInit")] +#[allow(unused_imports)] pub use gen_ResponseInit::*; #[cfg(feature = "ResponseType")] #[allow(non_snake_case)] mod gen_ResponseType; #[cfg(feature = "ResponseType")] +#[allow(unused_imports)] pub use gen_ResponseType::*; #[cfg(feature = "RsaHashedImportParams")] #[allow(non_snake_case)] mod gen_RsaHashedImportParams; #[cfg(feature = "RsaHashedImportParams")] +#[allow(unused_imports)] pub use gen_RsaHashedImportParams::*; #[cfg(feature = "RsaOaepParams")] #[allow(non_snake_case)] mod gen_RsaOaepParams; #[cfg(feature = "RsaOaepParams")] +#[allow(unused_imports)] pub use gen_RsaOaepParams::*; #[cfg(feature = "RsaOtherPrimesInfo")] #[allow(non_snake_case)] mod gen_RsaOtherPrimesInfo; #[cfg(feature = "RsaOtherPrimesInfo")] +#[allow(unused_imports)] pub use gen_RsaOtherPrimesInfo::*; #[cfg(feature = "RsaPssParams")] #[allow(non_snake_case)] mod gen_RsaPssParams; #[cfg(feature = "RsaPssParams")] +#[allow(unused_imports)] pub use gen_RsaPssParams::*; #[cfg(feature = "RtcAnswerOptions")] #[allow(non_snake_case)] mod gen_RtcAnswerOptions; #[cfg(feature = "RtcAnswerOptions")] +#[allow(unused_imports)] pub use gen_RtcAnswerOptions::*; #[cfg(feature = "RtcBundlePolicy")] #[allow(non_snake_case)] mod gen_RtcBundlePolicy; #[cfg(feature = "RtcBundlePolicy")] +#[allow(unused_imports)] pub use gen_RtcBundlePolicy::*; #[cfg(feature = "RtcCertificate")] #[allow(non_snake_case)] mod gen_RtcCertificate; #[cfg(feature = "RtcCertificate")] +#[allow(unused_imports)] pub use gen_RtcCertificate::*; #[cfg(feature = "RtcCertificateExpiration")] #[allow(non_snake_case)] mod gen_RtcCertificateExpiration; #[cfg(feature = "RtcCertificateExpiration")] +#[allow(unused_imports)] pub use gen_RtcCertificateExpiration::*; #[cfg(feature = "RtcCodecStats")] #[allow(non_snake_case)] mod gen_RtcCodecStats; #[cfg(feature = "RtcCodecStats")] +#[allow(unused_imports)] pub use gen_RtcCodecStats::*; #[cfg(feature = "RtcConfiguration")] #[allow(non_snake_case)] mod gen_RtcConfiguration; #[cfg(feature = "RtcConfiguration")] +#[allow(unused_imports)] pub use gen_RtcConfiguration::*; #[cfg(feature = "RtcDataChannel")] #[allow(non_snake_case)] mod gen_RtcDataChannel; #[cfg(feature = "RtcDataChannel")] +#[allow(unused_imports)] pub use gen_RtcDataChannel::*; #[cfg(feature = "RtcDataChannelEvent")] #[allow(non_snake_case)] mod gen_RtcDataChannelEvent; #[cfg(feature = "RtcDataChannelEvent")] +#[allow(unused_imports)] pub use gen_RtcDataChannelEvent::*; #[cfg(feature = "RtcDataChannelEventInit")] #[allow(non_snake_case)] mod gen_RtcDataChannelEventInit; #[cfg(feature = "RtcDataChannelEventInit")] +#[allow(unused_imports)] pub use gen_RtcDataChannelEventInit::*; #[cfg(feature = "RtcDataChannelInit")] #[allow(non_snake_case)] mod gen_RtcDataChannelInit; #[cfg(feature = "RtcDataChannelInit")] +#[allow(unused_imports)] pub use gen_RtcDataChannelInit::*; #[cfg(feature = "RtcDataChannelState")] #[allow(non_snake_case)] mod gen_RtcDataChannelState; #[cfg(feature = "RtcDataChannelState")] +#[allow(unused_imports)] pub use gen_RtcDataChannelState::*; #[cfg(feature = "RtcDataChannelType")] #[allow(non_snake_case)] mod gen_RtcDataChannelType; #[cfg(feature = "RtcDataChannelType")] +#[allow(unused_imports)] pub use gen_RtcDataChannelType::*; #[cfg(feature = "RtcDegradationPreference")] #[allow(non_snake_case)] mod gen_RtcDegradationPreference; #[cfg(feature = "RtcDegradationPreference")] +#[allow(unused_imports)] pub use gen_RtcDegradationPreference::*; #[cfg(feature = "RtcFecParameters")] #[allow(non_snake_case)] mod gen_RtcFecParameters; #[cfg(feature = "RtcFecParameters")] +#[allow(unused_imports)] pub use gen_RtcFecParameters::*; #[cfg(feature = "RtcIceCandidate")] #[allow(non_snake_case)] mod gen_RtcIceCandidate; #[cfg(feature = "RtcIceCandidate")] +#[allow(unused_imports)] pub use gen_RtcIceCandidate::*; #[cfg(feature = "RtcIceCandidateInit")] #[allow(non_snake_case)] mod gen_RtcIceCandidateInit; #[cfg(feature = "RtcIceCandidateInit")] +#[allow(unused_imports)] pub use gen_RtcIceCandidateInit::*; #[cfg(feature = "RtcIceCandidatePairStats")] #[allow(non_snake_case)] mod gen_RtcIceCandidatePairStats; #[cfg(feature = "RtcIceCandidatePairStats")] +#[allow(unused_imports)] pub use gen_RtcIceCandidatePairStats::*; #[cfg(feature = "RtcIceCandidateStats")] #[allow(non_snake_case)] mod gen_RtcIceCandidateStats; #[cfg(feature = "RtcIceCandidateStats")] +#[allow(unused_imports)] pub use gen_RtcIceCandidateStats::*; #[cfg(feature = "RtcIceComponentStats")] #[allow(non_snake_case)] mod gen_RtcIceComponentStats; #[cfg(feature = "RtcIceComponentStats")] +#[allow(unused_imports)] pub use gen_RtcIceComponentStats::*; #[cfg(feature = "RtcIceConnectionState")] #[allow(non_snake_case)] mod gen_RtcIceConnectionState; #[cfg(feature = "RtcIceConnectionState")] +#[allow(unused_imports)] pub use gen_RtcIceConnectionState::*; #[cfg(feature = "RtcIceCredentialType")] #[allow(non_snake_case)] mod gen_RtcIceCredentialType; #[cfg(feature = "RtcIceCredentialType")] +#[allow(unused_imports)] pub use gen_RtcIceCredentialType::*; #[cfg(feature = "RtcIceGatheringState")] #[allow(non_snake_case)] mod gen_RtcIceGatheringState; #[cfg(feature = "RtcIceGatheringState")] +#[allow(unused_imports)] pub use gen_RtcIceGatheringState::*; #[cfg(feature = "RtcIceServer")] #[allow(non_snake_case)] mod gen_RtcIceServer; #[cfg(feature = "RtcIceServer")] +#[allow(unused_imports)] pub use gen_RtcIceServer::*; #[cfg(feature = "RtcIceTransportPolicy")] #[allow(non_snake_case)] mod gen_RtcIceTransportPolicy; #[cfg(feature = "RtcIceTransportPolicy")] +#[allow(unused_imports)] pub use gen_RtcIceTransportPolicy::*; #[cfg(feature = "RtcIdentityAssertion")] #[allow(non_snake_case)] mod gen_RtcIdentityAssertion; #[cfg(feature = "RtcIdentityAssertion")] +#[allow(unused_imports)] pub use gen_RtcIdentityAssertion::*; #[cfg(feature = "RtcIdentityAssertionResult")] #[allow(non_snake_case)] mod gen_RtcIdentityAssertionResult; #[cfg(feature = "RtcIdentityAssertionResult")] +#[allow(unused_imports)] pub use gen_RtcIdentityAssertionResult::*; #[cfg(feature = "RtcIdentityProvider")] #[allow(non_snake_case)] mod gen_RtcIdentityProvider; #[cfg(feature = "RtcIdentityProvider")] +#[allow(unused_imports)] pub use gen_RtcIdentityProvider::*; #[cfg(feature = "RtcIdentityProviderDetails")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderDetails; #[cfg(feature = "RtcIdentityProviderDetails")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderDetails::*; #[cfg(feature = "RtcIdentityProviderOptions")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderOptions; #[cfg(feature = "RtcIdentityProviderOptions")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderOptions::*; #[cfg(feature = "RtcIdentityProviderRegistrar")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderRegistrar; #[cfg(feature = "RtcIdentityProviderRegistrar")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderRegistrar::*; #[cfg(feature = "RtcIdentityValidationResult")] #[allow(non_snake_case)] mod gen_RtcIdentityValidationResult; #[cfg(feature = "RtcIdentityValidationResult")] +#[allow(unused_imports)] pub use gen_RtcIdentityValidationResult::*; #[cfg(feature = "RtcInboundRtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcInboundRtpStreamStats; #[cfg(feature = "RtcInboundRtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcInboundRtpStreamStats::*; -#[cfg(feature = "RtcLifecycleEvent")] -#[allow(non_snake_case)] -mod gen_RtcLifecycleEvent; -#[cfg(feature = "RtcLifecycleEvent")] -pub use gen_RtcLifecycleEvent::*; - #[cfg(feature = "RtcMediaStreamStats")] #[allow(non_snake_case)] mod gen_RtcMediaStreamStats; #[cfg(feature = "RtcMediaStreamStats")] +#[allow(unused_imports)] pub use gen_RtcMediaStreamStats::*; #[cfg(feature = "RtcMediaStreamTrackStats")] #[allow(non_snake_case)] mod gen_RtcMediaStreamTrackStats; #[cfg(feature = "RtcMediaStreamTrackStats")] +#[allow(unused_imports)] pub use gen_RtcMediaStreamTrackStats::*; #[cfg(feature = "RtcOfferAnswerOptions")] #[allow(non_snake_case)] mod gen_RtcOfferAnswerOptions; #[cfg(feature = "RtcOfferAnswerOptions")] +#[allow(unused_imports)] pub use gen_RtcOfferAnswerOptions::*; #[cfg(feature = "RtcOfferOptions")] #[allow(non_snake_case)] mod gen_RtcOfferOptions; #[cfg(feature = "RtcOfferOptions")] +#[allow(unused_imports)] pub use gen_RtcOfferOptions::*; #[cfg(feature = "RtcOutboundRtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcOutboundRtpStreamStats; #[cfg(feature = "RtcOutboundRtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcOutboundRtpStreamStats::*; #[cfg(feature = "RtcPeerConnection")] #[allow(non_snake_case)] mod gen_RtcPeerConnection; #[cfg(feature = "RtcPeerConnection")] +#[allow(unused_imports)] pub use gen_RtcPeerConnection::*; #[cfg(feature = "RtcPeerConnectionIceEvent")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionIceEvent; #[cfg(feature = "RtcPeerConnectionIceEvent")] +#[allow(unused_imports)] pub use gen_RtcPeerConnectionIceEvent::*; #[cfg(feature = "RtcPeerConnectionIceEventInit")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionIceEventInit; #[cfg(feature = "RtcPeerConnectionIceEventInit")] +#[allow(unused_imports)] pub use gen_RtcPeerConnectionIceEventInit::*; #[cfg(feature = "RtcPeerConnectionState")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionState; #[cfg(feature = "RtcPeerConnectionState")] +#[allow(unused_imports)] pub use gen_RtcPeerConnectionState::*; #[cfg(feature = "RtcPriorityType")] #[allow(non_snake_case)] mod gen_RtcPriorityType; #[cfg(feature = "RtcPriorityType")] +#[allow(unused_imports)] pub use gen_RtcPriorityType::*; #[cfg(feature = "RtcRtcpParameters")] #[allow(non_snake_case)] mod gen_RtcRtcpParameters; #[cfg(feature = "RtcRtcpParameters")] +#[allow(unused_imports)] pub use gen_RtcRtcpParameters::*; +#[cfg(feature = "RtcRtpCapabilities")] +#[allow(non_snake_case)] +mod gen_RtcRtpCapabilities; +#[cfg(feature = "RtcRtpCapabilities")] +#[allow(unused_imports)] +pub use gen_RtcRtpCapabilities::*; + +#[cfg(feature = "RtcRtpCodecCapability")] +#[allow(non_snake_case)] +mod gen_RtcRtpCodecCapability; +#[cfg(feature = "RtcRtpCodecCapability")] +#[allow(unused_imports)] +pub use gen_RtcRtpCodecCapability::*; + #[cfg(feature = "RtcRtpCodecParameters")] #[allow(non_snake_case)] mod gen_RtcRtpCodecParameters; #[cfg(feature = "RtcRtpCodecParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpCodecParameters::*; #[cfg(feature = "RtcRtpContributingSource")] #[allow(non_snake_case)] mod gen_RtcRtpContributingSource; #[cfg(feature = "RtcRtpContributingSource")] +#[allow(unused_imports)] pub use gen_RtcRtpContributingSource::*; #[cfg(feature = "RtcRtpEncodingParameters")] #[allow(non_snake_case)] mod gen_RtcRtpEncodingParameters; #[cfg(feature = "RtcRtpEncodingParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpEncodingParameters::*; +#[cfg(feature = "RtcRtpHeaderExtensionCapability")] +#[allow(non_snake_case)] +mod gen_RtcRtpHeaderExtensionCapability; +#[cfg(feature = "RtcRtpHeaderExtensionCapability")] +#[allow(unused_imports)] +pub use gen_RtcRtpHeaderExtensionCapability::*; + #[cfg(feature = "RtcRtpHeaderExtensionParameters")] #[allow(non_snake_case)] mod gen_RtcRtpHeaderExtensionParameters; #[cfg(feature = "RtcRtpHeaderExtensionParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpHeaderExtensionParameters::*; #[cfg(feature = "RtcRtpParameters")] #[allow(non_snake_case)] mod gen_RtcRtpParameters; #[cfg(feature = "RtcRtpParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpParameters::*; #[cfg(feature = "RtcRtpReceiver")] #[allow(non_snake_case)] mod gen_RtcRtpReceiver; #[cfg(feature = "RtcRtpReceiver")] +#[allow(unused_imports)] pub use gen_RtcRtpReceiver::*; #[cfg(feature = "RtcRtpSender")] #[allow(non_snake_case)] mod gen_RtcRtpSender; #[cfg(feature = "RtcRtpSender")] +#[allow(unused_imports)] pub use gen_RtcRtpSender::*; #[cfg(feature = "RtcRtpSourceEntry")] #[allow(non_snake_case)] mod gen_RtcRtpSourceEntry; #[cfg(feature = "RtcRtpSourceEntry")] +#[allow(unused_imports)] pub use gen_RtcRtpSourceEntry::*; #[cfg(feature = "RtcRtpSourceEntryType")] #[allow(non_snake_case)] mod gen_RtcRtpSourceEntryType; #[cfg(feature = "RtcRtpSourceEntryType")] +#[allow(unused_imports)] pub use gen_RtcRtpSourceEntryType::*; #[cfg(feature = "RtcRtpSynchronizationSource")] #[allow(non_snake_case)] mod gen_RtcRtpSynchronizationSource; #[cfg(feature = "RtcRtpSynchronizationSource")] +#[allow(unused_imports)] pub use gen_RtcRtpSynchronizationSource::*; #[cfg(feature = "RtcRtpTransceiver")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiver; #[cfg(feature = "RtcRtpTransceiver")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiver::*; #[cfg(feature = "RtcRtpTransceiverDirection")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiverDirection; #[cfg(feature = "RtcRtpTransceiverDirection")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiverDirection::*; #[cfg(feature = "RtcRtpTransceiverInit")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiverInit; #[cfg(feature = "RtcRtpTransceiverInit")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiverInit::*; #[cfg(feature = "RtcRtxParameters")] #[allow(non_snake_case)] mod gen_RtcRtxParameters; #[cfg(feature = "RtcRtxParameters")] +#[allow(unused_imports)] pub use gen_RtcRtxParameters::*; #[cfg(feature = "RtcSdpType")] #[allow(non_snake_case)] mod gen_RtcSdpType; #[cfg(feature = "RtcSdpType")] +#[allow(unused_imports)] pub use gen_RtcSdpType::*; #[cfg(feature = "RtcSessionDescription")] #[allow(non_snake_case)] mod gen_RtcSessionDescription; #[cfg(feature = "RtcSessionDescription")] +#[allow(unused_imports)] pub use gen_RtcSessionDescription::*; #[cfg(feature = "RtcSessionDescriptionInit")] #[allow(non_snake_case)] mod gen_RtcSessionDescriptionInit; #[cfg(feature = "RtcSessionDescriptionInit")] +#[allow(unused_imports)] pub use gen_RtcSessionDescriptionInit::*; #[cfg(feature = "RtcSignalingState")] #[allow(non_snake_case)] mod gen_RtcSignalingState; #[cfg(feature = "RtcSignalingState")] +#[allow(unused_imports)] pub use gen_RtcSignalingState::*; #[cfg(feature = "RtcStats")] #[allow(non_snake_case)] mod gen_RtcStats; #[cfg(feature = "RtcStats")] +#[allow(unused_imports)] pub use gen_RtcStats::*; #[cfg(feature = "RtcStatsIceCandidatePairState")] #[allow(non_snake_case)] mod gen_RtcStatsIceCandidatePairState; #[cfg(feature = "RtcStatsIceCandidatePairState")] +#[allow(unused_imports)] pub use gen_RtcStatsIceCandidatePairState::*; #[cfg(feature = "RtcStatsIceCandidateType")] #[allow(non_snake_case)] mod gen_RtcStatsIceCandidateType; #[cfg(feature = "RtcStatsIceCandidateType")] +#[allow(unused_imports)] pub use gen_RtcStatsIceCandidateType::*; #[cfg(feature = "RtcStatsReport")] #[allow(non_snake_case)] mod gen_RtcStatsReport; #[cfg(feature = "RtcStatsReport")] +#[allow(unused_imports)] pub use gen_RtcStatsReport::*; #[cfg(feature = "RtcStatsReportInternal")] #[allow(non_snake_case)] mod gen_RtcStatsReportInternal; #[cfg(feature = "RtcStatsReportInternal")] +#[allow(unused_imports)] pub use gen_RtcStatsReportInternal::*; #[cfg(feature = "RtcStatsType")] #[allow(non_snake_case)] mod gen_RtcStatsType; #[cfg(feature = "RtcStatsType")] +#[allow(unused_imports)] pub use gen_RtcStatsType::*; #[cfg(feature = "RtcTrackEvent")] #[allow(non_snake_case)] mod gen_RtcTrackEvent; #[cfg(feature = "RtcTrackEvent")] +#[allow(unused_imports)] pub use gen_RtcTrackEvent::*; #[cfg(feature = "RtcTrackEventInit")] #[allow(non_snake_case)] mod gen_RtcTrackEventInit; #[cfg(feature = "RtcTrackEventInit")] +#[allow(unused_imports)] pub use gen_RtcTrackEventInit::*; #[cfg(feature = "RtcTransportStats")] #[allow(non_snake_case)] mod gen_RtcTransportStats; #[cfg(feature = "RtcTransportStats")] +#[allow(unused_imports)] pub use gen_RtcTransportStats::*; #[cfg(feature = "RtcdtmfSender")] #[allow(non_snake_case)] mod gen_RtcdtmfSender; #[cfg(feature = "RtcdtmfSender")] +#[allow(unused_imports)] pub use gen_RtcdtmfSender::*; #[cfg(feature = "RtcdtmfToneChangeEvent")] #[allow(non_snake_case)] mod gen_RtcdtmfToneChangeEvent; #[cfg(feature = "RtcdtmfToneChangeEvent")] +#[allow(unused_imports)] pub use gen_RtcdtmfToneChangeEvent::*; #[cfg(feature = "RtcdtmfToneChangeEventInit")] #[allow(non_snake_case)] mod gen_RtcdtmfToneChangeEventInit; #[cfg(feature = "RtcdtmfToneChangeEventInit")] +#[allow(unused_imports)] pub use gen_RtcdtmfToneChangeEventInit::*; #[cfg(feature = "RtcrtpContributingSourceStats")] #[allow(non_snake_case)] mod gen_RtcrtpContributingSourceStats; #[cfg(feature = "RtcrtpContributingSourceStats")] +#[allow(unused_imports)] pub use gen_RtcrtpContributingSourceStats::*; #[cfg(feature = "RtcrtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcrtpStreamStats; #[cfg(feature = "RtcrtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcrtpStreamStats::*; #[cfg(feature = "Scheduler")] #[allow(non_snake_case)] mod gen_Scheduler; #[cfg(feature = "Scheduler")] +#[allow(unused_imports)] pub use gen_Scheduler::*; #[cfg(feature = "SchedulerPostTaskOptions")] #[allow(non_snake_case)] mod gen_SchedulerPostTaskOptions; #[cfg(feature = "SchedulerPostTaskOptions")] +#[allow(unused_imports)] pub use gen_SchedulerPostTaskOptions::*; #[cfg(feature = "Scheduling")] #[allow(non_snake_case)] mod gen_Scheduling; #[cfg(feature = "Scheduling")] +#[allow(unused_imports)] pub use gen_Scheduling::*; #[cfg(feature = "Screen")] #[allow(non_snake_case)] mod gen_Screen; #[cfg(feature = "Screen")] +#[allow(unused_imports)] pub use gen_Screen::*; #[cfg(feature = "ScreenColorGamut")] #[allow(non_snake_case)] mod gen_ScreenColorGamut; #[cfg(feature = "ScreenColorGamut")] +#[allow(unused_imports)] pub use gen_ScreenColorGamut::*; #[cfg(feature = "ScreenLuminance")] #[allow(non_snake_case)] mod gen_ScreenLuminance; #[cfg(feature = "ScreenLuminance")] +#[allow(unused_imports)] pub use gen_ScreenLuminance::*; #[cfg(feature = "ScreenOrientation")] #[allow(non_snake_case)] mod gen_ScreenOrientation; #[cfg(feature = "ScreenOrientation")] +#[allow(unused_imports)] pub use gen_ScreenOrientation::*; #[cfg(feature = "ScriptProcessorNode")] #[allow(non_snake_case)] mod gen_ScriptProcessorNode; #[cfg(feature = "ScriptProcessorNode")] +#[allow(unused_imports)] pub use gen_ScriptProcessorNode::*; #[cfg(feature = "ScrollAreaEvent")] #[allow(non_snake_case)] mod gen_ScrollAreaEvent; #[cfg(feature = "ScrollAreaEvent")] +#[allow(unused_imports)] pub use gen_ScrollAreaEvent::*; #[cfg(feature = "ScrollBehavior")] #[allow(non_snake_case)] mod gen_ScrollBehavior; #[cfg(feature = "ScrollBehavior")] +#[allow(unused_imports)] pub use gen_ScrollBehavior::*; #[cfg(feature = "ScrollBoxObject")] #[allow(non_snake_case)] mod gen_ScrollBoxObject; #[cfg(feature = "ScrollBoxObject")] +#[allow(unused_imports)] pub use gen_ScrollBoxObject::*; #[cfg(feature = "ScrollIntoViewOptions")] #[allow(non_snake_case)] mod gen_ScrollIntoViewOptions; #[cfg(feature = "ScrollIntoViewOptions")] +#[allow(unused_imports)] pub use gen_ScrollIntoViewOptions::*; #[cfg(feature = "ScrollLogicalPosition")] #[allow(non_snake_case)] mod gen_ScrollLogicalPosition; #[cfg(feature = "ScrollLogicalPosition")] +#[allow(unused_imports)] pub use gen_ScrollLogicalPosition::*; #[cfg(feature = "ScrollOptions")] #[allow(non_snake_case)] mod gen_ScrollOptions; #[cfg(feature = "ScrollOptions")] +#[allow(unused_imports)] pub use gen_ScrollOptions::*; #[cfg(feature = "ScrollRestoration")] #[allow(non_snake_case)] mod gen_ScrollRestoration; #[cfg(feature = "ScrollRestoration")] +#[allow(unused_imports)] pub use gen_ScrollRestoration::*; #[cfg(feature = "ScrollSetting")] #[allow(non_snake_case)] mod gen_ScrollSetting; #[cfg(feature = "ScrollSetting")] +#[allow(unused_imports)] pub use gen_ScrollSetting::*; #[cfg(feature = "ScrollState")] #[allow(non_snake_case)] mod gen_ScrollState; #[cfg(feature = "ScrollState")] +#[allow(unused_imports)] pub use gen_ScrollState::*; #[cfg(feature = "ScrollToOptions")] #[allow(non_snake_case)] mod gen_ScrollToOptions; #[cfg(feature = "ScrollToOptions")] +#[allow(unused_imports)] pub use gen_ScrollToOptions::*; #[cfg(feature = "ScrollViewChangeEventInit")] #[allow(non_snake_case)] mod gen_ScrollViewChangeEventInit; #[cfg(feature = "ScrollViewChangeEventInit")] +#[allow(unused_imports)] pub use gen_ScrollViewChangeEventInit::*; #[cfg(feature = "SecurityPolicyViolationEvent")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEvent; #[cfg(feature = "SecurityPolicyViolationEvent")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEvent::*; #[cfg(feature = "SecurityPolicyViolationEventDisposition")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEventDisposition; #[cfg(feature = "SecurityPolicyViolationEventDisposition")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEventDisposition::*; #[cfg(feature = "SecurityPolicyViolationEventInit")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEventInit; #[cfg(feature = "SecurityPolicyViolationEventInit")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEventInit::*; #[cfg(feature = "Selection")] #[allow(non_snake_case)] mod gen_Selection; #[cfg(feature = "Selection")] +#[allow(unused_imports)] pub use gen_Selection::*; #[cfg(feature = "SelectionMode")] #[allow(non_snake_case)] mod gen_SelectionMode; #[cfg(feature = "SelectionMode")] +#[allow(unused_imports)] pub use gen_SelectionMode::*; #[cfg(feature = "Serial")] #[allow(non_snake_case)] mod gen_Serial; #[cfg(feature = "Serial")] +#[allow(unused_imports)] pub use gen_Serial::*; #[cfg(feature = "SerialInputSignals")] #[allow(non_snake_case)] mod gen_SerialInputSignals; #[cfg(feature = "SerialInputSignals")] +#[allow(unused_imports)] pub use gen_SerialInputSignals::*; #[cfg(feature = "SerialOptions")] #[allow(non_snake_case)] mod gen_SerialOptions; #[cfg(feature = "SerialOptions")] +#[allow(unused_imports)] pub use gen_SerialOptions::*; #[cfg(feature = "SerialOutputSignals")] #[allow(non_snake_case)] mod gen_SerialOutputSignals; #[cfg(feature = "SerialOutputSignals")] +#[allow(unused_imports)] pub use gen_SerialOutputSignals::*; #[cfg(feature = "SerialPort")] #[allow(non_snake_case)] mod gen_SerialPort; #[cfg(feature = "SerialPort")] +#[allow(unused_imports)] pub use gen_SerialPort::*; #[cfg(feature = "SerialPortFilter")] #[allow(non_snake_case)] mod gen_SerialPortFilter; #[cfg(feature = "SerialPortFilter")] +#[allow(unused_imports)] pub use gen_SerialPortFilter::*; #[cfg(feature = "SerialPortInfo")] #[allow(non_snake_case)] mod gen_SerialPortInfo; #[cfg(feature = "SerialPortInfo")] +#[allow(unused_imports)] pub use gen_SerialPortInfo::*; #[cfg(feature = "SerialPortRequestOptions")] #[allow(non_snake_case)] mod gen_SerialPortRequestOptions; #[cfg(feature = "SerialPortRequestOptions")] +#[allow(unused_imports)] pub use gen_SerialPortRequestOptions::*; #[cfg(feature = "ServerSocketOptions")] #[allow(non_snake_case)] mod gen_ServerSocketOptions; #[cfg(feature = "ServerSocketOptions")] +#[allow(unused_imports)] pub use gen_ServerSocketOptions::*; #[cfg(feature = "ServiceWorker")] #[allow(non_snake_case)] mod gen_ServiceWorker; #[cfg(feature = "ServiceWorker")] +#[allow(unused_imports)] pub use gen_ServiceWorker::*; #[cfg(feature = "ServiceWorkerContainer")] #[allow(non_snake_case)] mod gen_ServiceWorkerContainer; #[cfg(feature = "ServiceWorkerContainer")] +#[allow(unused_imports)] pub use gen_ServiceWorkerContainer::*; #[cfg(feature = "ServiceWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_ServiceWorkerGlobalScope; #[cfg(feature = "ServiceWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_ServiceWorkerGlobalScope::*; #[cfg(feature = "ServiceWorkerRegistration")] #[allow(non_snake_case)] mod gen_ServiceWorkerRegistration; #[cfg(feature = "ServiceWorkerRegistration")] +#[allow(unused_imports)] pub use gen_ServiceWorkerRegistration::*; #[cfg(feature = "ServiceWorkerState")] #[allow(non_snake_case)] mod gen_ServiceWorkerState; #[cfg(feature = "ServiceWorkerState")] +#[allow(unused_imports)] pub use gen_ServiceWorkerState::*; #[cfg(feature = "ServiceWorkerUpdateViaCache")] #[allow(non_snake_case)] mod gen_ServiceWorkerUpdateViaCache; #[cfg(feature = "ServiceWorkerUpdateViaCache")] +#[allow(unused_imports)] pub use gen_ServiceWorkerUpdateViaCache::*; #[cfg(feature = "ShadowRoot")] #[allow(non_snake_case)] mod gen_ShadowRoot; #[cfg(feature = "ShadowRoot")] +#[allow(unused_imports)] pub use gen_ShadowRoot::*; #[cfg(feature = "ShadowRootInit")] #[allow(non_snake_case)] mod gen_ShadowRootInit; #[cfg(feature = "ShadowRootInit")] +#[allow(unused_imports)] pub use gen_ShadowRootInit::*; #[cfg(feature = "ShadowRootMode")] #[allow(non_snake_case)] mod gen_ShadowRootMode; #[cfg(feature = "ShadowRootMode")] +#[allow(unused_imports)] pub use gen_ShadowRootMode::*; #[cfg(feature = "ShareData")] #[allow(non_snake_case)] mod gen_ShareData; #[cfg(feature = "ShareData")] +#[allow(unused_imports)] pub use gen_ShareData::*; #[cfg(feature = "SharedWorker")] #[allow(non_snake_case)] mod gen_SharedWorker; #[cfg(feature = "SharedWorker")] +#[allow(unused_imports)] pub use gen_SharedWorker::*; #[cfg(feature = "SharedWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_SharedWorkerGlobalScope; #[cfg(feature = "SharedWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_SharedWorkerGlobalScope::*; #[cfg(feature = "SignResponse")] #[allow(non_snake_case)] mod gen_SignResponse; #[cfg(feature = "SignResponse")] +#[allow(unused_imports)] pub use gen_SignResponse::*; #[cfg(feature = "SocketElement")] #[allow(non_snake_case)] mod gen_SocketElement; #[cfg(feature = "SocketElement")] +#[allow(unused_imports)] pub use gen_SocketElement::*; #[cfg(feature = "SocketOptions")] #[allow(non_snake_case)] mod gen_SocketOptions; #[cfg(feature = "SocketOptions")] +#[allow(unused_imports)] pub use gen_SocketOptions::*; #[cfg(feature = "SocketReadyState")] #[allow(non_snake_case)] mod gen_SocketReadyState; #[cfg(feature = "SocketReadyState")] +#[allow(unused_imports)] pub use gen_SocketReadyState::*; #[cfg(feature = "SocketsDict")] #[allow(non_snake_case)] mod gen_SocketsDict; #[cfg(feature = "SocketsDict")] +#[allow(unused_imports)] pub use gen_SocketsDict::*; #[cfg(feature = "SourceBuffer")] #[allow(non_snake_case)] mod gen_SourceBuffer; #[cfg(feature = "SourceBuffer")] +#[allow(unused_imports)] pub use gen_SourceBuffer::*; #[cfg(feature = "SourceBufferAppendMode")] #[allow(non_snake_case)] mod gen_SourceBufferAppendMode; #[cfg(feature = "SourceBufferAppendMode")] +#[allow(unused_imports)] pub use gen_SourceBufferAppendMode::*; #[cfg(feature = "SourceBufferList")] #[allow(non_snake_case)] mod gen_SourceBufferList; #[cfg(feature = "SourceBufferList")] +#[allow(unused_imports)] pub use gen_SourceBufferList::*; #[cfg(feature = "SpeechGrammar")] #[allow(non_snake_case)] mod gen_SpeechGrammar; #[cfg(feature = "SpeechGrammar")] +#[allow(unused_imports)] pub use gen_SpeechGrammar::*; #[cfg(feature = "SpeechGrammarList")] #[allow(non_snake_case)] mod gen_SpeechGrammarList; #[cfg(feature = "SpeechGrammarList")] +#[allow(unused_imports)] pub use gen_SpeechGrammarList::*; #[cfg(feature = "SpeechRecognition")] #[allow(non_snake_case)] mod gen_SpeechRecognition; #[cfg(feature = "SpeechRecognition")] +#[allow(unused_imports)] pub use gen_SpeechRecognition::*; #[cfg(feature = "SpeechRecognitionAlternative")] #[allow(non_snake_case)] mod gen_SpeechRecognitionAlternative; #[cfg(feature = "SpeechRecognitionAlternative")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionAlternative::*; #[cfg(feature = "SpeechRecognitionError")] #[allow(non_snake_case)] mod gen_SpeechRecognitionError; #[cfg(feature = "SpeechRecognitionError")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionError::*; #[cfg(feature = "SpeechRecognitionErrorCode")] #[allow(non_snake_case)] mod gen_SpeechRecognitionErrorCode; #[cfg(feature = "SpeechRecognitionErrorCode")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionErrorCode::*; #[cfg(feature = "SpeechRecognitionErrorInit")] #[allow(non_snake_case)] mod gen_SpeechRecognitionErrorInit; #[cfg(feature = "SpeechRecognitionErrorInit")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionErrorInit::*; #[cfg(feature = "SpeechRecognitionEvent")] #[allow(non_snake_case)] mod gen_SpeechRecognitionEvent; #[cfg(feature = "SpeechRecognitionEvent")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionEvent::*; #[cfg(feature = "SpeechRecognitionEventInit")] #[allow(non_snake_case)] mod gen_SpeechRecognitionEventInit; #[cfg(feature = "SpeechRecognitionEventInit")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionEventInit::*; #[cfg(feature = "SpeechRecognitionResult")] #[allow(non_snake_case)] mod gen_SpeechRecognitionResult; #[cfg(feature = "SpeechRecognitionResult")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionResult::*; #[cfg(feature = "SpeechRecognitionResultList")] #[allow(non_snake_case)] mod gen_SpeechRecognitionResultList; #[cfg(feature = "SpeechRecognitionResultList")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionResultList::*; #[cfg(feature = "SpeechSynthesis")] #[allow(non_snake_case)] mod gen_SpeechSynthesis; #[cfg(feature = "SpeechSynthesis")] +#[allow(unused_imports)] pub use gen_SpeechSynthesis::*; #[cfg(feature = "SpeechSynthesisErrorCode")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorCode; #[cfg(feature = "SpeechSynthesisErrorCode")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorCode::*; #[cfg(feature = "SpeechSynthesisErrorEvent")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorEvent; #[cfg(feature = "SpeechSynthesisErrorEvent")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorEvent::*; #[cfg(feature = "SpeechSynthesisErrorEventInit")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorEventInit; #[cfg(feature = "SpeechSynthesisErrorEventInit")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorEventInit::*; #[cfg(feature = "SpeechSynthesisEvent")] #[allow(non_snake_case)] mod gen_SpeechSynthesisEvent; #[cfg(feature = "SpeechSynthesisEvent")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisEvent::*; #[cfg(feature = "SpeechSynthesisEventInit")] #[allow(non_snake_case)] mod gen_SpeechSynthesisEventInit; #[cfg(feature = "SpeechSynthesisEventInit")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisEventInit::*; #[cfg(feature = "SpeechSynthesisUtterance")] #[allow(non_snake_case)] mod gen_SpeechSynthesisUtterance; #[cfg(feature = "SpeechSynthesisUtterance")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisUtterance::*; #[cfg(feature = "SpeechSynthesisVoice")] #[allow(non_snake_case)] mod gen_SpeechSynthesisVoice; #[cfg(feature = "SpeechSynthesisVoice")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisVoice::*; #[cfg(feature = "StereoPannerNode")] #[allow(non_snake_case)] mod gen_StereoPannerNode; #[cfg(feature = "StereoPannerNode")] +#[allow(unused_imports)] pub use gen_StereoPannerNode::*; #[cfg(feature = "StereoPannerOptions")] #[allow(non_snake_case)] mod gen_StereoPannerOptions; #[cfg(feature = "StereoPannerOptions")] +#[allow(unused_imports)] pub use gen_StereoPannerOptions::*; #[cfg(feature = "Storage")] #[allow(non_snake_case)] mod gen_Storage; #[cfg(feature = "Storage")] +#[allow(unused_imports)] pub use gen_Storage::*; #[cfg(feature = "StorageEstimate")] #[allow(non_snake_case)] mod gen_StorageEstimate; #[cfg(feature = "StorageEstimate")] +#[allow(unused_imports)] pub use gen_StorageEstimate::*; #[cfg(feature = "StorageEvent")] #[allow(non_snake_case)] mod gen_StorageEvent; #[cfg(feature = "StorageEvent")] +#[allow(unused_imports)] pub use gen_StorageEvent::*; #[cfg(feature = "StorageEventInit")] #[allow(non_snake_case)] mod gen_StorageEventInit; #[cfg(feature = "StorageEventInit")] +#[allow(unused_imports)] pub use gen_StorageEventInit::*; #[cfg(feature = "StorageManager")] #[allow(non_snake_case)] mod gen_StorageManager; #[cfg(feature = "StorageManager")] +#[allow(unused_imports)] pub use gen_StorageManager::*; #[cfg(feature = "StorageType")] #[allow(non_snake_case)] mod gen_StorageType; #[cfg(feature = "StorageType")] +#[allow(unused_imports)] pub use gen_StorageType::*; #[cfg(feature = "StreamPipeOptions")] #[allow(non_snake_case)] mod gen_StreamPipeOptions; #[cfg(feature = "StreamPipeOptions")] +#[allow(unused_imports)] pub use gen_StreamPipeOptions::*; #[cfg(feature = "StyleRuleChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleRuleChangeEventInit; #[cfg(feature = "StyleRuleChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleRuleChangeEventInit::*; #[cfg(feature = "StyleSheet")] #[allow(non_snake_case)] mod gen_StyleSheet; #[cfg(feature = "StyleSheet")] +#[allow(unused_imports)] pub use gen_StyleSheet::*; #[cfg(feature = "StyleSheetApplicableStateChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleSheetApplicableStateChangeEventInit; #[cfg(feature = "StyleSheetApplicableStateChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleSheetApplicableStateChangeEventInit::*; #[cfg(feature = "StyleSheetChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleSheetChangeEventInit; #[cfg(feature = "StyleSheetChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleSheetChangeEventInit::*; #[cfg(feature = "StyleSheetList")] #[allow(non_snake_case)] mod gen_StyleSheetList; #[cfg(feature = "StyleSheetList")] +#[allow(unused_imports)] pub use gen_StyleSheetList::*; #[cfg(feature = "SubmitEvent")] #[allow(non_snake_case)] mod gen_SubmitEvent; #[cfg(feature = "SubmitEvent")] +#[allow(unused_imports)] pub use gen_SubmitEvent::*; #[cfg(feature = "SubmitEventInit")] #[allow(non_snake_case)] mod gen_SubmitEventInit; #[cfg(feature = "SubmitEventInit")] +#[allow(unused_imports)] pub use gen_SubmitEventInit::*; #[cfg(feature = "SubtleCrypto")] #[allow(non_snake_case)] mod gen_SubtleCrypto; #[cfg(feature = "SubtleCrypto")] +#[allow(unused_imports)] pub use gen_SubtleCrypto::*; #[cfg(feature = "SupportedType")] #[allow(non_snake_case)] mod gen_SupportedType; #[cfg(feature = "SupportedType")] +#[allow(unused_imports)] pub use gen_SupportedType::*; #[cfg(feature = "SvcOutputMetadata")] #[allow(non_snake_case)] mod gen_SvcOutputMetadata; #[cfg(feature = "SvcOutputMetadata")] +#[allow(unused_imports)] pub use gen_SvcOutputMetadata::*; #[cfg(feature = "SvgAngle")] #[allow(non_snake_case)] mod gen_SvgAngle; #[cfg(feature = "SvgAngle")] +#[allow(unused_imports)] pub use gen_SvgAngle::*; #[cfg(feature = "SvgAnimateElement")] #[allow(non_snake_case)] mod gen_SvgAnimateElement; #[cfg(feature = "SvgAnimateElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateElement::*; #[cfg(feature = "SvgAnimateMotionElement")] #[allow(non_snake_case)] mod gen_SvgAnimateMotionElement; #[cfg(feature = "SvgAnimateMotionElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateMotionElement::*; #[cfg(feature = "SvgAnimateTransformElement")] #[allow(non_snake_case)] mod gen_SvgAnimateTransformElement; #[cfg(feature = "SvgAnimateTransformElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateTransformElement::*; #[cfg(feature = "SvgAnimatedAngle")] #[allow(non_snake_case)] mod gen_SvgAnimatedAngle; #[cfg(feature = "SvgAnimatedAngle")] +#[allow(unused_imports)] pub use gen_SvgAnimatedAngle::*; #[cfg(feature = "SvgAnimatedBoolean")] #[allow(non_snake_case)] mod gen_SvgAnimatedBoolean; #[cfg(feature = "SvgAnimatedBoolean")] +#[allow(unused_imports)] pub use gen_SvgAnimatedBoolean::*; #[cfg(feature = "SvgAnimatedEnumeration")] #[allow(non_snake_case)] mod gen_SvgAnimatedEnumeration; #[cfg(feature = "SvgAnimatedEnumeration")] +#[allow(unused_imports)] pub use gen_SvgAnimatedEnumeration::*; #[cfg(feature = "SvgAnimatedInteger")] #[allow(non_snake_case)] mod gen_SvgAnimatedInteger; #[cfg(feature = "SvgAnimatedInteger")] +#[allow(unused_imports)] pub use gen_SvgAnimatedInteger::*; #[cfg(feature = "SvgAnimatedLength")] #[allow(non_snake_case)] mod gen_SvgAnimatedLength; #[cfg(feature = "SvgAnimatedLength")] +#[allow(unused_imports)] pub use gen_SvgAnimatedLength::*; #[cfg(feature = "SvgAnimatedLengthList")] #[allow(non_snake_case)] mod gen_SvgAnimatedLengthList; #[cfg(feature = "SvgAnimatedLengthList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedLengthList::*; #[cfg(feature = "SvgAnimatedNumber")] #[allow(non_snake_case)] mod gen_SvgAnimatedNumber; #[cfg(feature = "SvgAnimatedNumber")] +#[allow(unused_imports)] pub use gen_SvgAnimatedNumber::*; #[cfg(feature = "SvgAnimatedNumberList")] #[allow(non_snake_case)] mod gen_SvgAnimatedNumberList; #[cfg(feature = "SvgAnimatedNumberList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedNumberList::*; #[cfg(feature = "SvgAnimatedPreserveAspectRatio")] #[allow(non_snake_case)] mod gen_SvgAnimatedPreserveAspectRatio; #[cfg(feature = "SvgAnimatedPreserveAspectRatio")] +#[allow(unused_imports)] pub use gen_SvgAnimatedPreserveAspectRatio::*; #[cfg(feature = "SvgAnimatedRect")] #[allow(non_snake_case)] mod gen_SvgAnimatedRect; #[cfg(feature = "SvgAnimatedRect")] +#[allow(unused_imports)] pub use gen_SvgAnimatedRect::*; #[cfg(feature = "SvgAnimatedString")] #[allow(non_snake_case)] mod gen_SvgAnimatedString; #[cfg(feature = "SvgAnimatedString")] +#[allow(unused_imports)] pub use gen_SvgAnimatedString::*; #[cfg(feature = "SvgAnimatedTransformList")] #[allow(non_snake_case)] mod gen_SvgAnimatedTransformList; #[cfg(feature = "SvgAnimatedTransformList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedTransformList::*; #[cfg(feature = "SvgAnimationElement")] #[allow(non_snake_case)] mod gen_SvgAnimationElement; #[cfg(feature = "SvgAnimationElement")] +#[allow(unused_imports)] pub use gen_SvgAnimationElement::*; #[cfg(feature = "SvgBoundingBoxOptions")] #[allow(non_snake_case)] mod gen_SvgBoundingBoxOptions; #[cfg(feature = "SvgBoundingBoxOptions")] +#[allow(unused_imports)] pub use gen_SvgBoundingBoxOptions::*; #[cfg(feature = "SvgCircleElement")] #[allow(non_snake_case)] mod gen_SvgCircleElement; #[cfg(feature = "SvgCircleElement")] +#[allow(unused_imports)] pub use gen_SvgCircleElement::*; #[cfg(feature = "SvgClipPathElement")] #[allow(non_snake_case)] mod gen_SvgClipPathElement; #[cfg(feature = "SvgClipPathElement")] +#[allow(unused_imports)] pub use gen_SvgClipPathElement::*; #[cfg(feature = "SvgComponentTransferFunctionElement")] #[allow(non_snake_case)] mod gen_SvgComponentTransferFunctionElement; #[cfg(feature = "SvgComponentTransferFunctionElement")] +#[allow(unused_imports)] pub use gen_SvgComponentTransferFunctionElement::*; #[cfg(feature = "SvgDefsElement")] #[allow(non_snake_case)] mod gen_SvgDefsElement; #[cfg(feature = "SvgDefsElement")] +#[allow(unused_imports)] pub use gen_SvgDefsElement::*; #[cfg(feature = "SvgDescElement")] #[allow(non_snake_case)] mod gen_SvgDescElement; #[cfg(feature = "SvgDescElement")] +#[allow(unused_imports)] pub use gen_SvgDescElement::*; #[cfg(feature = "SvgElement")] #[allow(non_snake_case)] mod gen_SvgElement; #[cfg(feature = "SvgElement")] +#[allow(unused_imports)] pub use gen_SvgElement::*; #[cfg(feature = "SvgEllipseElement")] #[allow(non_snake_case)] mod gen_SvgEllipseElement; #[cfg(feature = "SvgEllipseElement")] +#[allow(unused_imports)] pub use gen_SvgEllipseElement::*; #[cfg(feature = "SvgFilterElement")] #[allow(non_snake_case)] mod gen_SvgFilterElement; #[cfg(feature = "SvgFilterElement")] +#[allow(unused_imports)] pub use gen_SvgFilterElement::*; #[cfg(feature = "SvgForeignObjectElement")] #[allow(non_snake_case)] mod gen_SvgForeignObjectElement; #[cfg(feature = "SvgForeignObjectElement")] +#[allow(unused_imports)] pub use gen_SvgForeignObjectElement::*; #[cfg(feature = "SvgGeometryElement")] #[allow(non_snake_case)] mod gen_SvgGeometryElement; #[cfg(feature = "SvgGeometryElement")] +#[allow(unused_imports)] pub use gen_SvgGeometryElement::*; #[cfg(feature = "SvgGradientElement")] #[allow(non_snake_case)] mod gen_SvgGradientElement; #[cfg(feature = "SvgGradientElement")] +#[allow(unused_imports)] pub use gen_SvgGradientElement::*; #[cfg(feature = "SvgGraphicsElement")] #[allow(non_snake_case)] mod gen_SvgGraphicsElement; #[cfg(feature = "SvgGraphicsElement")] +#[allow(unused_imports)] pub use gen_SvgGraphicsElement::*; #[cfg(feature = "SvgImageElement")] #[allow(non_snake_case)] mod gen_SvgImageElement; #[cfg(feature = "SvgImageElement")] +#[allow(unused_imports)] pub use gen_SvgImageElement::*; #[cfg(feature = "SvgLength")] #[allow(non_snake_case)] mod gen_SvgLength; #[cfg(feature = "SvgLength")] +#[allow(unused_imports)] pub use gen_SvgLength::*; #[cfg(feature = "SvgLengthList")] #[allow(non_snake_case)] mod gen_SvgLengthList; #[cfg(feature = "SvgLengthList")] +#[allow(unused_imports)] pub use gen_SvgLengthList::*; #[cfg(feature = "SvgLineElement")] #[allow(non_snake_case)] mod gen_SvgLineElement; #[cfg(feature = "SvgLineElement")] +#[allow(unused_imports)] pub use gen_SvgLineElement::*; #[cfg(feature = "SvgLinearGradientElement")] #[allow(non_snake_case)] mod gen_SvgLinearGradientElement; #[cfg(feature = "SvgLinearGradientElement")] +#[allow(unused_imports)] pub use gen_SvgLinearGradientElement::*; #[cfg(feature = "SvgMarkerElement")] #[allow(non_snake_case)] mod gen_SvgMarkerElement; #[cfg(feature = "SvgMarkerElement")] +#[allow(unused_imports)] pub use gen_SvgMarkerElement::*; #[cfg(feature = "SvgMaskElement")] #[allow(non_snake_case)] mod gen_SvgMaskElement; #[cfg(feature = "SvgMaskElement")] +#[allow(unused_imports)] pub use gen_SvgMaskElement::*; #[cfg(feature = "SvgMatrix")] #[allow(non_snake_case)] mod gen_SvgMatrix; #[cfg(feature = "SvgMatrix")] +#[allow(unused_imports)] pub use gen_SvgMatrix::*; #[cfg(feature = "SvgMetadataElement")] #[allow(non_snake_case)] mod gen_SvgMetadataElement; #[cfg(feature = "SvgMetadataElement")] +#[allow(unused_imports)] pub use gen_SvgMetadataElement::*; #[cfg(feature = "SvgNumber")] #[allow(non_snake_case)] mod gen_SvgNumber; #[cfg(feature = "SvgNumber")] +#[allow(unused_imports)] pub use gen_SvgNumber::*; #[cfg(feature = "SvgNumberList")] #[allow(non_snake_case)] mod gen_SvgNumberList; #[cfg(feature = "SvgNumberList")] +#[allow(unused_imports)] pub use gen_SvgNumberList::*; #[cfg(feature = "SvgPathElement")] #[allow(non_snake_case)] mod gen_SvgPathElement; #[cfg(feature = "SvgPathElement")] +#[allow(unused_imports)] pub use gen_SvgPathElement::*; #[cfg(feature = "SvgPathSeg")] #[allow(non_snake_case)] mod gen_SvgPathSeg; #[cfg(feature = "SvgPathSeg")] +#[allow(unused_imports)] pub use gen_SvgPathSeg::*; #[cfg(feature = "SvgPathSegArcAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegArcAbs; #[cfg(feature = "SvgPathSegArcAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegArcAbs::*; #[cfg(feature = "SvgPathSegArcRel")] #[allow(non_snake_case)] mod gen_SvgPathSegArcRel; #[cfg(feature = "SvgPathSegArcRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegArcRel::*; #[cfg(feature = "SvgPathSegClosePath")] #[allow(non_snake_case)] mod gen_SvgPathSegClosePath; #[cfg(feature = "SvgPathSegClosePath")] +#[allow(unused_imports)] pub use gen_SvgPathSegClosePath::*; #[cfg(feature = "SvgPathSegCurvetoCubicAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicAbs; #[cfg(feature = "SvgPathSegCurvetoCubicAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicAbs::*; #[cfg(feature = "SvgPathSegCurvetoCubicRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicRel; #[cfg(feature = "SvgPathSegCurvetoCubicRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicRel::*; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicSmoothAbs; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicSmoothAbs::*; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicSmoothRel; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicSmoothRel::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticAbs; #[cfg(feature = "SvgPathSegCurvetoQuadraticAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticAbs::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticRel; #[cfg(feature = "SvgPathSegCurvetoQuadraticRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticRel::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticSmoothAbs; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticSmoothAbs::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticSmoothRel; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticSmoothRel::*; #[cfg(feature = "SvgPathSegLinetoAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoAbs; #[cfg(feature = "SvgPathSegLinetoAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoAbs::*; #[cfg(feature = "SvgPathSegLinetoHorizontalAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoHorizontalAbs; #[cfg(feature = "SvgPathSegLinetoHorizontalAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoHorizontalAbs::*; #[cfg(feature = "SvgPathSegLinetoHorizontalRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoHorizontalRel; #[cfg(feature = "SvgPathSegLinetoHorizontalRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoHorizontalRel::*; #[cfg(feature = "SvgPathSegLinetoRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoRel; #[cfg(feature = "SvgPathSegLinetoRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoRel::*; #[cfg(feature = "SvgPathSegLinetoVerticalAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoVerticalAbs; #[cfg(feature = "SvgPathSegLinetoVerticalAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoVerticalAbs::*; #[cfg(feature = "SvgPathSegLinetoVerticalRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoVerticalRel; #[cfg(feature = "SvgPathSegLinetoVerticalRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoVerticalRel::*; #[cfg(feature = "SvgPathSegList")] #[allow(non_snake_case)] mod gen_SvgPathSegList; #[cfg(feature = "SvgPathSegList")] +#[allow(unused_imports)] pub use gen_SvgPathSegList::*; #[cfg(feature = "SvgPathSegMovetoAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegMovetoAbs; #[cfg(feature = "SvgPathSegMovetoAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegMovetoAbs::*; #[cfg(feature = "SvgPathSegMovetoRel")] #[allow(non_snake_case)] mod gen_SvgPathSegMovetoRel; #[cfg(feature = "SvgPathSegMovetoRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegMovetoRel::*; #[cfg(feature = "SvgPatternElement")] #[allow(non_snake_case)] mod gen_SvgPatternElement; #[cfg(feature = "SvgPatternElement")] +#[allow(unused_imports)] pub use gen_SvgPatternElement::*; #[cfg(feature = "SvgPoint")] #[allow(non_snake_case)] mod gen_SvgPoint; #[cfg(feature = "SvgPoint")] +#[allow(unused_imports)] pub use gen_SvgPoint::*; #[cfg(feature = "SvgPointList")] #[allow(non_snake_case)] mod gen_SvgPointList; #[cfg(feature = "SvgPointList")] +#[allow(unused_imports)] pub use gen_SvgPointList::*; #[cfg(feature = "SvgPolygonElement")] #[allow(non_snake_case)] mod gen_SvgPolygonElement; #[cfg(feature = "SvgPolygonElement")] +#[allow(unused_imports)] pub use gen_SvgPolygonElement::*; #[cfg(feature = "SvgPolylineElement")] #[allow(non_snake_case)] mod gen_SvgPolylineElement; #[cfg(feature = "SvgPolylineElement")] +#[allow(unused_imports)] pub use gen_SvgPolylineElement::*; #[cfg(feature = "SvgPreserveAspectRatio")] #[allow(non_snake_case)] mod gen_SvgPreserveAspectRatio; #[cfg(feature = "SvgPreserveAspectRatio")] +#[allow(unused_imports)] pub use gen_SvgPreserveAspectRatio::*; #[cfg(feature = "SvgRadialGradientElement")] #[allow(non_snake_case)] mod gen_SvgRadialGradientElement; #[cfg(feature = "SvgRadialGradientElement")] +#[allow(unused_imports)] pub use gen_SvgRadialGradientElement::*; #[cfg(feature = "SvgRect")] #[allow(non_snake_case)] mod gen_SvgRect; #[cfg(feature = "SvgRect")] +#[allow(unused_imports)] pub use gen_SvgRect::*; #[cfg(feature = "SvgRectElement")] #[allow(non_snake_case)] mod gen_SvgRectElement; #[cfg(feature = "SvgRectElement")] +#[allow(unused_imports)] pub use gen_SvgRectElement::*; #[cfg(feature = "SvgScriptElement")] #[allow(non_snake_case)] mod gen_SvgScriptElement; #[cfg(feature = "SvgScriptElement")] +#[allow(unused_imports)] pub use gen_SvgScriptElement::*; #[cfg(feature = "SvgSetElement")] #[allow(non_snake_case)] mod gen_SvgSetElement; #[cfg(feature = "SvgSetElement")] +#[allow(unused_imports)] pub use gen_SvgSetElement::*; #[cfg(feature = "SvgStopElement")] #[allow(non_snake_case)] mod gen_SvgStopElement; #[cfg(feature = "SvgStopElement")] +#[allow(unused_imports)] pub use gen_SvgStopElement::*; #[cfg(feature = "SvgStringList")] #[allow(non_snake_case)] mod gen_SvgStringList; #[cfg(feature = "SvgStringList")] +#[allow(unused_imports)] pub use gen_SvgStringList::*; #[cfg(feature = "SvgStyleElement")] #[allow(non_snake_case)] mod gen_SvgStyleElement; #[cfg(feature = "SvgStyleElement")] +#[allow(unused_imports)] pub use gen_SvgStyleElement::*; #[cfg(feature = "SvgSwitchElement")] #[allow(non_snake_case)] mod gen_SvgSwitchElement; #[cfg(feature = "SvgSwitchElement")] +#[allow(unused_imports)] pub use gen_SvgSwitchElement::*; #[cfg(feature = "SvgSymbolElement")] #[allow(non_snake_case)] mod gen_SvgSymbolElement; #[cfg(feature = "SvgSymbolElement")] +#[allow(unused_imports)] pub use gen_SvgSymbolElement::*; #[cfg(feature = "SvgTextContentElement")] #[allow(non_snake_case)] mod gen_SvgTextContentElement; #[cfg(feature = "SvgTextContentElement")] +#[allow(unused_imports)] pub use gen_SvgTextContentElement::*; #[cfg(feature = "SvgTextElement")] #[allow(non_snake_case)] mod gen_SvgTextElement; #[cfg(feature = "SvgTextElement")] +#[allow(unused_imports)] pub use gen_SvgTextElement::*; #[cfg(feature = "SvgTextPathElement")] #[allow(non_snake_case)] mod gen_SvgTextPathElement; #[cfg(feature = "SvgTextPathElement")] +#[allow(unused_imports)] pub use gen_SvgTextPathElement::*; #[cfg(feature = "SvgTextPositioningElement")] #[allow(non_snake_case)] mod gen_SvgTextPositioningElement; #[cfg(feature = "SvgTextPositioningElement")] +#[allow(unused_imports)] pub use gen_SvgTextPositioningElement::*; #[cfg(feature = "SvgTitleElement")] #[allow(non_snake_case)] mod gen_SvgTitleElement; #[cfg(feature = "SvgTitleElement")] +#[allow(unused_imports)] pub use gen_SvgTitleElement::*; #[cfg(feature = "SvgTransform")] #[allow(non_snake_case)] mod gen_SvgTransform; #[cfg(feature = "SvgTransform")] +#[allow(unused_imports)] pub use gen_SvgTransform::*; #[cfg(feature = "SvgTransformList")] #[allow(non_snake_case)] mod gen_SvgTransformList; #[cfg(feature = "SvgTransformList")] +#[allow(unused_imports)] pub use gen_SvgTransformList::*; #[cfg(feature = "SvgUnitTypes")] #[allow(non_snake_case)] mod gen_SvgUnitTypes; #[cfg(feature = "SvgUnitTypes")] +#[allow(unused_imports)] pub use gen_SvgUnitTypes::*; #[cfg(feature = "SvgUseElement")] #[allow(non_snake_case)] mod gen_SvgUseElement; #[cfg(feature = "SvgUseElement")] +#[allow(unused_imports)] pub use gen_SvgUseElement::*; #[cfg(feature = "SvgViewElement")] #[allow(non_snake_case)] mod gen_SvgViewElement; #[cfg(feature = "SvgViewElement")] +#[allow(unused_imports)] pub use gen_SvgViewElement::*; #[cfg(feature = "SvgZoomAndPan")] #[allow(non_snake_case)] mod gen_SvgZoomAndPan; #[cfg(feature = "SvgZoomAndPan")] +#[allow(unused_imports)] pub use gen_SvgZoomAndPan::*; #[cfg(feature = "SvgaElement")] #[allow(non_snake_case)] mod gen_SvgaElement; #[cfg(feature = "SvgaElement")] +#[allow(unused_imports)] pub use gen_SvgaElement::*; #[cfg(feature = "SvgfeBlendElement")] #[allow(non_snake_case)] mod gen_SvgfeBlendElement; #[cfg(feature = "SvgfeBlendElement")] +#[allow(unused_imports)] pub use gen_SvgfeBlendElement::*; #[cfg(feature = "SvgfeColorMatrixElement")] #[allow(non_snake_case)] mod gen_SvgfeColorMatrixElement; #[cfg(feature = "SvgfeColorMatrixElement")] +#[allow(unused_imports)] pub use gen_SvgfeColorMatrixElement::*; #[cfg(feature = "SvgfeComponentTransferElement")] #[allow(non_snake_case)] mod gen_SvgfeComponentTransferElement; #[cfg(feature = "SvgfeComponentTransferElement")] +#[allow(unused_imports)] pub use gen_SvgfeComponentTransferElement::*; #[cfg(feature = "SvgfeCompositeElement")] #[allow(non_snake_case)] mod gen_SvgfeCompositeElement; #[cfg(feature = "SvgfeCompositeElement")] +#[allow(unused_imports)] pub use gen_SvgfeCompositeElement::*; #[cfg(feature = "SvgfeConvolveMatrixElement")] #[allow(non_snake_case)] mod gen_SvgfeConvolveMatrixElement; #[cfg(feature = "SvgfeConvolveMatrixElement")] +#[allow(unused_imports)] pub use gen_SvgfeConvolveMatrixElement::*; #[cfg(feature = "SvgfeDiffuseLightingElement")] #[allow(non_snake_case)] mod gen_SvgfeDiffuseLightingElement; #[cfg(feature = "SvgfeDiffuseLightingElement")] +#[allow(unused_imports)] pub use gen_SvgfeDiffuseLightingElement::*; #[cfg(feature = "SvgfeDisplacementMapElement")] #[allow(non_snake_case)] mod gen_SvgfeDisplacementMapElement; #[cfg(feature = "SvgfeDisplacementMapElement")] +#[allow(unused_imports)] pub use gen_SvgfeDisplacementMapElement::*; #[cfg(feature = "SvgfeDistantLightElement")] #[allow(non_snake_case)] mod gen_SvgfeDistantLightElement; #[cfg(feature = "SvgfeDistantLightElement")] +#[allow(unused_imports)] pub use gen_SvgfeDistantLightElement::*; #[cfg(feature = "SvgfeDropShadowElement")] #[allow(non_snake_case)] mod gen_SvgfeDropShadowElement; #[cfg(feature = "SvgfeDropShadowElement")] +#[allow(unused_imports)] pub use gen_SvgfeDropShadowElement::*; #[cfg(feature = "SvgfeFloodElement")] #[allow(non_snake_case)] mod gen_SvgfeFloodElement; #[cfg(feature = "SvgfeFloodElement")] +#[allow(unused_imports)] pub use gen_SvgfeFloodElement::*; #[cfg(feature = "SvgfeFuncAElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncAElement; #[cfg(feature = "SvgfeFuncAElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncAElement::*; #[cfg(feature = "SvgfeFuncBElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncBElement; #[cfg(feature = "SvgfeFuncBElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncBElement::*; #[cfg(feature = "SvgfeFuncGElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncGElement; #[cfg(feature = "SvgfeFuncGElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncGElement::*; #[cfg(feature = "SvgfeFuncRElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncRElement; #[cfg(feature = "SvgfeFuncRElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncRElement::*; #[cfg(feature = "SvgfeGaussianBlurElement")] #[allow(non_snake_case)] mod gen_SvgfeGaussianBlurElement; #[cfg(feature = "SvgfeGaussianBlurElement")] +#[allow(unused_imports)] pub use gen_SvgfeGaussianBlurElement::*; #[cfg(feature = "SvgfeImageElement")] #[allow(non_snake_case)] mod gen_SvgfeImageElement; #[cfg(feature = "SvgfeImageElement")] +#[allow(unused_imports)] pub use gen_SvgfeImageElement::*; #[cfg(feature = "SvgfeMergeElement")] #[allow(non_snake_case)] mod gen_SvgfeMergeElement; #[cfg(feature = "SvgfeMergeElement")] +#[allow(unused_imports)] pub use gen_SvgfeMergeElement::*; #[cfg(feature = "SvgfeMergeNodeElement")] #[allow(non_snake_case)] mod gen_SvgfeMergeNodeElement; #[cfg(feature = "SvgfeMergeNodeElement")] +#[allow(unused_imports)] pub use gen_SvgfeMergeNodeElement::*; #[cfg(feature = "SvgfeMorphologyElement")] #[allow(non_snake_case)] mod gen_SvgfeMorphologyElement; #[cfg(feature = "SvgfeMorphologyElement")] +#[allow(unused_imports)] pub use gen_SvgfeMorphologyElement::*; #[cfg(feature = "SvgfeOffsetElement")] #[allow(non_snake_case)] mod gen_SvgfeOffsetElement; #[cfg(feature = "SvgfeOffsetElement")] +#[allow(unused_imports)] pub use gen_SvgfeOffsetElement::*; #[cfg(feature = "SvgfePointLightElement")] #[allow(non_snake_case)] mod gen_SvgfePointLightElement; #[cfg(feature = "SvgfePointLightElement")] +#[allow(unused_imports)] pub use gen_SvgfePointLightElement::*; #[cfg(feature = "SvgfeSpecularLightingElement")] #[allow(non_snake_case)] mod gen_SvgfeSpecularLightingElement; #[cfg(feature = "SvgfeSpecularLightingElement")] +#[allow(unused_imports)] pub use gen_SvgfeSpecularLightingElement::*; #[cfg(feature = "SvgfeSpotLightElement")] #[allow(non_snake_case)] mod gen_SvgfeSpotLightElement; #[cfg(feature = "SvgfeSpotLightElement")] +#[allow(unused_imports)] pub use gen_SvgfeSpotLightElement::*; #[cfg(feature = "SvgfeTileElement")] #[allow(non_snake_case)] mod gen_SvgfeTileElement; #[cfg(feature = "SvgfeTileElement")] +#[allow(unused_imports)] pub use gen_SvgfeTileElement::*; #[cfg(feature = "SvgfeTurbulenceElement")] #[allow(non_snake_case)] mod gen_SvgfeTurbulenceElement; #[cfg(feature = "SvgfeTurbulenceElement")] +#[allow(unused_imports)] pub use gen_SvgfeTurbulenceElement::*; #[cfg(feature = "SvggElement")] #[allow(non_snake_case)] mod gen_SvggElement; #[cfg(feature = "SvggElement")] +#[allow(unused_imports)] pub use gen_SvggElement::*; #[cfg(feature = "SvgmPathElement")] #[allow(non_snake_case)] mod gen_SvgmPathElement; #[cfg(feature = "SvgmPathElement")] +#[allow(unused_imports)] pub use gen_SvgmPathElement::*; #[cfg(feature = "SvgsvgElement")] #[allow(non_snake_case)] mod gen_SvgsvgElement; #[cfg(feature = "SvgsvgElement")] +#[allow(unused_imports)] pub use gen_SvgsvgElement::*; #[cfg(feature = "SvgtSpanElement")] #[allow(non_snake_case)] mod gen_SvgtSpanElement; #[cfg(feature = "SvgtSpanElement")] +#[allow(unused_imports)] pub use gen_SvgtSpanElement::*; #[cfg(feature = "TaskController")] #[allow(non_snake_case)] mod gen_TaskController; #[cfg(feature = "TaskController")] +#[allow(unused_imports)] pub use gen_TaskController::*; #[cfg(feature = "TaskControllerInit")] #[allow(non_snake_case)] mod gen_TaskControllerInit; #[cfg(feature = "TaskControllerInit")] +#[allow(unused_imports)] pub use gen_TaskControllerInit::*; #[cfg(feature = "TaskPriority")] #[allow(non_snake_case)] mod gen_TaskPriority; #[cfg(feature = "TaskPriority")] +#[allow(unused_imports)] pub use gen_TaskPriority::*; #[cfg(feature = "TaskPriorityChangeEvent")] #[allow(non_snake_case)] mod gen_TaskPriorityChangeEvent; #[cfg(feature = "TaskPriorityChangeEvent")] +#[allow(unused_imports)] pub use gen_TaskPriorityChangeEvent::*; #[cfg(feature = "TaskPriorityChangeEventInit")] #[allow(non_snake_case)] mod gen_TaskPriorityChangeEventInit; #[cfg(feature = "TaskPriorityChangeEventInit")] +#[allow(unused_imports)] pub use gen_TaskPriorityChangeEventInit::*; #[cfg(feature = "TaskSignal")] #[allow(non_snake_case)] mod gen_TaskSignal; #[cfg(feature = "TaskSignal")] +#[allow(unused_imports)] pub use gen_TaskSignal::*; #[cfg(feature = "TaskSignalAnyInit")] #[allow(non_snake_case)] mod gen_TaskSignalAnyInit; #[cfg(feature = "TaskSignalAnyInit")] +#[allow(unused_imports)] pub use gen_TaskSignalAnyInit::*; #[cfg(feature = "TcpReadyState")] #[allow(non_snake_case)] mod gen_TcpReadyState; #[cfg(feature = "TcpReadyState")] +#[allow(unused_imports)] pub use gen_TcpReadyState::*; #[cfg(feature = "TcpServerSocket")] #[allow(non_snake_case)] mod gen_TcpServerSocket; #[cfg(feature = "TcpServerSocket")] +#[allow(unused_imports)] pub use gen_TcpServerSocket::*; #[cfg(feature = "TcpServerSocketEvent")] #[allow(non_snake_case)] mod gen_TcpServerSocketEvent; #[cfg(feature = "TcpServerSocketEvent")] +#[allow(unused_imports)] pub use gen_TcpServerSocketEvent::*; #[cfg(feature = "TcpServerSocketEventInit")] #[allow(non_snake_case)] mod gen_TcpServerSocketEventInit; #[cfg(feature = "TcpServerSocketEventInit")] +#[allow(unused_imports)] pub use gen_TcpServerSocketEventInit::*; #[cfg(feature = "TcpSocket")] #[allow(non_snake_case)] mod gen_TcpSocket; #[cfg(feature = "TcpSocket")] +#[allow(unused_imports)] pub use gen_TcpSocket::*; #[cfg(feature = "TcpSocketBinaryType")] #[allow(non_snake_case)] mod gen_TcpSocketBinaryType; #[cfg(feature = "TcpSocketBinaryType")] +#[allow(unused_imports)] pub use gen_TcpSocketBinaryType::*; #[cfg(feature = "TcpSocketErrorEvent")] #[allow(non_snake_case)] mod gen_TcpSocketErrorEvent; #[cfg(feature = "TcpSocketErrorEvent")] +#[allow(unused_imports)] pub use gen_TcpSocketErrorEvent::*; #[cfg(feature = "TcpSocketErrorEventInit")] #[allow(non_snake_case)] mod gen_TcpSocketErrorEventInit; #[cfg(feature = "TcpSocketErrorEventInit")] +#[allow(unused_imports)] pub use gen_TcpSocketErrorEventInit::*; #[cfg(feature = "TcpSocketEvent")] #[allow(non_snake_case)] mod gen_TcpSocketEvent; #[cfg(feature = "TcpSocketEvent")] +#[allow(unused_imports)] pub use gen_TcpSocketEvent::*; #[cfg(feature = "TcpSocketEventInit")] #[allow(non_snake_case)] mod gen_TcpSocketEventInit; #[cfg(feature = "TcpSocketEventInit")] +#[allow(unused_imports)] pub use gen_TcpSocketEventInit::*; #[cfg(feature = "Text")] #[allow(non_snake_case)] mod gen_Text; #[cfg(feature = "Text")] +#[allow(unused_imports)] pub use gen_Text::*; #[cfg(feature = "TextDecodeOptions")] #[allow(non_snake_case)] mod gen_TextDecodeOptions; #[cfg(feature = "TextDecodeOptions")] +#[allow(unused_imports)] pub use gen_TextDecodeOptions::*; #[cfg(feature = "TextDecoder")] #[allow(non_snake_case)] mod gen_TextDecoder; #[cfg(feature = "TextDecoder")] +#[allow(unused_imports)] pub use gen_TextDecoder::*; #[cfg(feature = "TextDecoderOptions")] #[allow(non_snake_case)] mod gen_TextDecoderOptions; #[cfg(feature = "TextDecoderOptions")] +#[allow(unused_imports)] pub use gen_TextDecoderOptions::*; #[cfg(feature = "TextEncoder")] #[allow(non_snake_case)] mod gen_TextEncoder; #[cfg(feature = "TextEncoder")] +#[allow(unused_imports)] pub use gen_TextEncoder::*; #[cfg(feature = "TextMetrics")] #[allow(non_snake_case)] mod gen_TextMetrics; #[cfg(feature = "TextMetrics")] +#[allow(unused_imports)] pub use gen_TextMetrics::*; #[cfg(feature = "TextTrack")] #[allow(non_snake_case)] mod gen_TextTrack; #[cfg(feature = "TextTrack")] +#[allow(unused_imports)] pub use gen_TextTrack::*; #[cfg(feature = "TextTrackCue")] #[allow(non_snake_case)] mod gen_TextTrackCue; #[cfg(feature = "TextTrackCue")] +#[allow(unused_imports)] pub use gen_TextTrackCue::*; #[cfg(feature = "TextTrackCueList")] #[allow(non_snake_case)] mod gen_TextTrackCueList; #[cfg(feature = "TextTrackCueList")] +#[allow(unused_imports)] pub use gen_TextTrackCueList::*; #[cfg(feature = "TextTrackKind")] #[allow(non_snake_case)] mod gen_TextTrackKind; #[cfg(feature = "TextTrackKind")] +#[allow(unused_imports)] pub use gen_TextTrackKind::*; #[cfg(feature = "TextTrackList")] #[allow(non_snake_case)] mod gen_TextTrackList; #[cfg(feature = "TextTrackList")] +#[allow(unused_imports)] pub use gen_TextTrackList::*; #[cfg(feature = "TextTrackMode")] #[allow(non_snake_case)] mod gen_TextTrackMode; #[cfg(feature = "TextTrackMode")] +#[allow(unused_imports)] pub use gen_TextTrackMode::*; #[cfg(feature = "TimeEvent")] #[allow(non_snake_case)] mod gen_TimeEvent; #[cfg(feature = "TimeEvent")] +#[allow(unused_imports)] pub use gen_TimeEvent::*; #[cfg(feature = "TimeRanges")] #[allow(non_snake_case)] mod gen_TimeRanges; #[cfg(feature = "TimeRanges")] +#[allow(unused_imports)] pub use gen_TimeRanges::*; #[cfg(feature = "Touch")] #[allow(non_snake_case)] mod gen_Touch; #[cfg(feature = "Touch")] +#[allow(unused_imports)] pub use gen_Touch::*; #[cfg(feature = "TouchEvent")] #[allow(non_snake_case)] mod gen_TouchEvent; #[cfg(feature = "TouchEvent")] +#[allow(unused_imports)] pub use gen_TouchEvent::*; #[cfg(feature = "TouchEventInit")] #[allow(non_snake_case)] mod gen_TouchEventInit; #[cfg(feature = "TouchEventInit")] +#[allow(unused_imports)] pub use gen_TouchEventInit::*; #[cfg(feature = "TouchInit")] #[allow(non_snake_case)] mod gen_TouchInit; #[cfg(feature = "TouchInit")] +#[allow(unused_imports)] pub use gen_TouchInit::*; #[cfg(feature = "TouchList")] #[allow(non_snake_case)] mod gen_TouchList; #[cfg(feature = "TouchList")] +#[allow(unused_imports)] pub use gen_TouchList::*; #[cfg(feature = "TrackEvent")] #[allow(non_snake_case)] mod gen_TrackEvent; #[cfg(feature = "TrackEvent")] +#[allow(unused_imports)] pub use gen_TrackEvent::*; #[cfg(feature = "TrackEventInit")] #[allow(non_snake_case)] mod gen_TrackEventInit; #[cfg(feature = "TrackEventInit")] +#[allow(unused_imports)] pub use gen_TrackEventInit::*; #[cfg(feature = "TransformStream")] #[allow(non_snake_case)] mod gen_TransformStream; #[cfg(feature = "TransformStream")] +#[allow(unused_imports)] pub use gen_TransformStream::*; #[cfg(feature = "TransformStreamDefaultController")] #[allow(non_snake_case)] mod gen_TransformStreamDefaultController; #[cfg(feature = "TransformStreamDefaultController")] +#[allow(unused_imports)] pub use gen_TransformStreamDefaultController::*; #[cfg(feature = "Transformer")] #[allow(non_snake_case)] mod gen_Transformer; #[cfg(feature = "Transformer")] +#[allow(unused_imports)] pub use gen_Transformer::*; #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; #[cfg(feature = "TransitionEvent")] +#[allow(unused_imports)] pub use gen_TransitionEvent::*; #[cfg(feature = "TransitionEventInit")] #[allow(non_snake_case)] mod gen_TransitionEventInit; #[cfg(feature = "TransitionEventInit")] +#[allow(unused_imports)] pub use gen_TransitionEventInit::*; #[cfg(feature = "Transport")] #[allow(non_snake_case)] mod gen_Transport; #[cfg(feature = "Transport")] +#[allow(unused_imports)] pub use gen_Transport::*; #[cfg(feature = "TreeBoxObject")] #[allow(non_snake_case)] mod gen_TreeBoxObject; #[cfg(feature = "TreeBoxObject")] +#[allow(unused_imports)] pub use gen_TreeBoxObject::*; #[cfg(feature = "TreeCellInfo")] #[allow(non_snake_case)] mod gen_TreeCellInfo; #[cfg(feature = "TreeCellInfo")] +#[allow(unused_imports)] pub use gen_TreeCellInfo::*; #[cfg(feature = "TreeView")] #[allow(non_snake_case)] mod gen_TreeView; #[cfg(feature = "TreeView")] +#[allow(unused_imports)] pub use gen_TreeView::*; #[cfg(feature = "TreeWalker")] #[allow(non_snake_case)] mod gen_TreeWalker; #[cfg(feature = "TreeWalker")] +#[allow(unused_imports)] pub use gen_TreeWalker::*; #[cfg(feature = "U2f")] #[allow(non_snake_case)] mod gen_U2f; #[cfg(feature = "U2f")] +#[allow(unused_imports)] pub use gen_U2f::*; #[cfg(feature = "U2fClientData")] #[allow(non_snake_case)] mod gen_U2fClientData; #[cfg(feature = "U2fClientData")] +#[allow(unused_imports)] pub use gen_U2fClientData::*; #[cfg(feature = "UdpMessageEventInit")] #[allow(non_snake_case)] mod gen_UdpMessageEventInit; #[cfg(feature = "UdpMessageEventInit")] +#[allow(unused_imports)] pub use gen_UdpMessageEventInit::*; #[cfg(feature = "UdpOptions")] #[allow(non_snake_case)] mod gen_UdpOptions; #[cfg(feature = "UdpOptions")] +#[allow(unused_imports)] pub use gen_UdpOptions::*; #[cfg(feature = "UiEvent")] #[allow(non_snake_case)] mod gen_UiEvent; #[cfg(feature = "UiEvent")] +#[allow(unused_imports)] pub use gen_UiEvent::*; #[cfg(feature = "UiEventInit")] #[allow(non_snake_case)] mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] +#[allow(unused_imports)] pub use gen_UiEventInit::*; #[cfg(feature = "UnderlyingSink")] #[allow(non_snake_case)] mod gen_UnderlyingSink; #[cfg(feature = "UnderlyingSink")] +#[allow(unused_imports)] pub use gen_UnderlyingSink::*; #[cfg(feature = "UnderlyingSource")] #[allow(non_snake_case)] mod gen_UnderlyingSource; #[cfg(feature = "UnderlyingSource")] +#[allow(unused_imports)] pub use gen_UnderlyingSource::*; #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; #[cfg(feature = "Url")] +#[allow(unused_imports)] pub use gen_Url::*; #[cfg(feature = "UrlSearchParams")] #[allow(non_snake_case)] mod gen_UrlSearchParams; #[cfg(feature = "UrlSearchParams")] +#[allow(unused_imports)] pub use gen_UrlSearchParams::*; #[cfg(feature = "Usb")] #[allow(non_snake_case)] mod gen_Usb; #[cfg(feature = "Usb")] +#[allow(unused_imports)] pub use gen_Usb::*; #[cfg(feature = "UsbAlternateInterface")] #[allow(non_snake_case)] mod gen_UsbAlternateInterface; #[cfg(feature = "UsbAlternateInterface")] +#[allow(unused_imports)] pub use gen_UsbAlternateInterface::*; #[cfg(feature = "UsbConfiguration")] #[allow(non_snake_case)] mod gen_UsbConfiguration; #[cfg(feature = "UsbConfiguration")] +#[allow(unused_imports)] pub use gen_UsbConfiguration::*; #[cfg(feature = "UsbConnectionEvent")] #[allow(non_snake_case)] mod gen_UsbConnectionEvent; #[cfg(feature = "UsbConnectionEvent")] +#[allow(unused_imports)] pub use gen_UsbConnectionEvent::*; #[cfg(feature = "UsbConnectionEventInit")] #[allow(non_snake_case)] mod gen_UsbConnectionEventInit; #[cfg(feature = "UsbConnectionEventInit")] +#[allow(unused_imports)] pub use gen_UsbConnectionEventInit::*; #[cfg(feature = "UsbControlTransferParameters")] #[allow(non_snake_case)] mod gen_UsbControlTransferParameters; #[cfg(feature = "UsbControlTransferParameters")] +#[allow(unused_imports)] pub use gen_UsbControlTransferParameters::*; #[cfg(feature = "UsbDevice")] #[allow(non_snake_case)] mod gen_UsbDevice; #[cfg(feature = "UsbDevice")] +#[allow(unused_imports)] pub use gen_UsbDevice::*; #[cfg(feature = "UsbDeviceFilter")] #[allow(non_snake_case)] mod gen_UsbDeviceFilter; #[cfg(feature = "UsbDeviceFilter")] +#[allow(unused_imports)] pub use gen_UsbDeviceFilter::*; #[cfg(feature = "UsbDeviceRequestOptions")] #[allow(non_snake_case)] mod gen_UsbDeviceRequestOptions; #[cfg(feature = "UsbDeviceRequestOptions")] +#[allow(unused_imports)] pub use gen_UsbDeviceRequestOptions::*; #[cfg(feature = "UsbDirection")] #[allow(non_snake_case)] mod gen_UsbDirection; #[cfg(feature = "UsbDirection")] +#[allow(unused_imports)] pub use gen_UsbDirection::*; #[cfg(feature = "UsbEndpoint")] #[allow(non_snake_case)] mod gen_UsbEndpoint; #[cfg(feature = "UsbEndpoint")] +#[allow(unused_imports)] pub use gen_UsbEndpoint::*; #[cfg(feature = "UsbEndpointType")] #[allow(non_snake_case)] mod gen_UsbEndpointType; #[cfg(feature = "UsbEndpointType")] +#[allow(unused_imports)] pub use gen_UsbEndpointType::*; #[cfg(feature = "UsbInTransferResult")] #[allow(non_snake_case)] mod gen_UsbInTransferResult; #[cfg(feature = "UsbInTransferResult")] +#[allow(unused_imports)] pub use gen_UsbInTransferResult::*; #[cfg(feature = "UsbInterface")] #[allow(non_snake_case)] mod gen_UsbInterface; #[cfg(feature = "UsbInterface")] +#[allow(unused_imports)] pub use gen_UsbInterface::*; #[cfg(feature = "UsbIsochronousInTransferPacket")] #[allow(non_snake_case)] mod gen_UsbIsochronousInTransferPacket; #[cfg(feature = "UsbIsochronousInTransferPacket")] +#[allow(unused_imports)] pub use gen_UsbIsochronousInTransferPacket::*; #[cfg(feature = "UsbIsochronousInTransferResult")] #[allow(non_snake_case)] mod gen_UsbIsochronousInTransferResult; #[cfg(feature = "UsbIsochronousInTransferResult")] +#[allow(unused_imports)] pub use gen_UsbIsochronousInTransferResult::*; #[cfg(feature = "UsbIsochronousOutTransferPacket")] #[allow(non_snake_case)] mod gen_UsbIsochronousOutTransferPacket; #[cfg(feature = "UsbIsochronousOutTransferPacket")] +#[allow(unused_imports)] pub use gen_UsbIsochronousOutTransferPacket::*; #[cfg(feature = "UsbIsochronousOutTransferResult")] #[allow(non_snake_case)] mod gen_UsbIsochronousOutTransferResult; #[cfg(feature = "UsbIsochronousOutTransferResult")] +#[allow(unused_imports)] pub use gen_UsbIsochronousOutTransferResult::*; #[cfg(feature = "UsbOutTransferResult")] #[allow(non_snake_case)] mod gen_UsbOutTransferResult; #[cfg(feature = "UsbOutTransferResult")] +#[allow(unused_imports)] pub use gen_UsbOutTransferResult::*; #[cfg(feature = "UsbPermissionDescriptor")] #[allow(non_snake_case)] mod gen_UsbPermissionDescriptor; #[cfg(feature = "UsbPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_UsbPermissionDescriptor::*; #[cfg(feature = "UsbPermissionResult")] #[allow(non_snake_case)] mod gen_UsbPermissionResult; #[cfg(feature = "UsbPermissionResult")] +#[allow(unused_imports)] pub use gen_UsbPermissionResult::*; #[cfg(feature = "UsbPermissionStorage")] #[allow(non_snake_case)] mod gen_UsbPermissionStorage; #[cfg(feature = "UsbPermissionStorage")] +#[allow(unused_imports)] pub use gen_UsbPermissionStorage::*; #[cfg(feature = "UsbRecipient")] #[allow(non_snake_case)] mod gen_UsbRecipient; #[cfg(feature = "UsbRecipient")] +#[allow(unused_imports)] pub use gen_UsbRecipient::*; #[cfg(feature = "UsbRequestType")] #[allow(non_snake_case)] mod gen_UsbRequestType; #[cfg(feature = "UsbRequestType")] +#[allow(unused_imports)] pub use gen_UsbRequestType::*; #[cfg(feature = "UsbTransferStatus")] #[allow(non_snake_case)] mod gen_UsbTransferStatus; #[cfg(feature = "UsbTransferStatus")] +#[allow(unused_imports)] pub use gen_UsbTransferStatus::*; +#[cfg(feature = "UserActivation")] +#[allow(non_snake_case)] +mod gen_UserActivation; +#[cfg(feature = "UserActivation")] +#[allow(unused_imports)] +pub use gen_UserActivation::*; + #[cfg(feature = "UserProximityEvent")] #[allow(non_snake_case)] mod gen_UserProximityEvent; #[cfg(feature = "UserProximityEvent")] +#[allow(unused_imports)] pub use gen_UserProximityEvent::*; #[cfg(feature = "UserProximityEventInit")] #[allow(non_snake_case)] mod gen_UserProximityEventInit; #[cfg(feature = "UserProximityEventInit")] +#[allow(unused_imports)] pub use gen_UserProximityEventInit::*; #[cfg(feature = "UserVerificationRequirement")] #[allow(non_snake_case)] mod gen_UserVerificationRequirement; #[cfg(feature = "UserVerificationRequirement")] +#[allow(unused_imports)] pub use gen_UserVerificationRequirement::*; #[cfg(feature = "ValidityState")] #[allow(non_snake_case)] mod gen_ValidityState; #[cfg(feature = "ValidityState")] +#[allow(unused_imports)] pub use gen_ValidityState::*; #[cfg(feature = "ValueEvent")] #[allow(non_snake_case)] mod gen_ValueEvent; #[cfg(feature = "ValueEvent")] +#[allow(unused_imports)] pub use gen_ValueEvent::*; #[cfg(feature = "ValueEventInit")] #[allow(non_snake_case)] mod gen_ValueEventInit; #[cfg(feature = "ValueEventInit")] +#[allow(unused_imports)] pub use gen_ValueEventInit::*; #[cfg(feature = "VideoColorPrimaries")] #[allow(non_snake_case)] mod gen_VideoColorPrimaries; #[cfg(feature = "VideoColorPrimaries")] +#[allow(unused_imports)] pub use gen_VideoColorPrimaries::*; #[cfg(feature = "VideoColorSpace")] #[allow(non_snake_case)] mod gen_VideoColorSpace; #[cfg(feature = "VideoColorSpace")] +#[allow(unused_imports)] pub use gen_VideoColorSpace::*; #[cfg(feature = "VideoColorSpaceInit")] #[allow(non_snake_case)] mod gen_VideoColorSpaceInit; #[cfg(feature = "VideoColorSpaceInit")] +#[allow(unused_imports)] pub use gen_VideoColorSpaceInit::*; #[cfg(feature = "VideoConfiguration")] #[allow(non_snake_case)] mod gen_VideoConfiguration; #[cfg(feature = "VideoConfiguration")] +#[allow(unused_imports)] pub use gen_VideoConfiguration::*; #[cfg(feature = "VideoDecoder")] #[allow(non_snake_case)] mod gen_VideoDecoder; #[cfg(feature = "VideoDecoder")] +#[allow(unused_imports)] pub use gen_VideoDecoder::*; #[cfg(feature = "VideoDecoderConfig")] #[allow(non_snake_case)] mod gen_VideoDecoderConfig; #[cfg(feature = "VideoDecoderConfig")] +#[allow(unused_imports)] pub use gen_VideoDecoderConfig::*; #[cfg(feature = "VideoDecoderInit")] #[allow(non_snake_case)] mod gen_VideoDecoderInit; #[cfg(feature = "VideoDecoderInit")] +#[allow(unused_imports)] pub use gen_VideoDecoderInit::*; #[cfg(feature = "VideoDecoderSupport")] #[allow(non_snake_case)] mod gen_VideoDecoderSupport; #[cfg(feature = "VideoDecoderSupport")] +#[allow(unused_imports)] pub use gen_VideoDecoderSupport::*; #[cfg(feature = "VideoEncoder")] #[allow(non_snake_case)] mod gen_VideoEncoder; #[cfg(feature = "VideoEncoder")] +#[allow(unused_imports)] pub use gen_VideoEncoder::*; #[cfg(feature = "VideoEncoderConfig")] #[allow(non_snake_case)] mod gen_VideoEncoderConfig; #[cfg(feature = "VideoEncoderConfig")] +#[allow(unused_imports)] pub use gen_VideoEncoderConfig::*; #[cfg(feature = "VideoEncoderEncodeOptions")] #[allow(non_snake_case)] mod gen_VideoEncoderEncodeOptions; #[cfg(feature = "VideoEncoderEncodeOptions")] +#[allow(unused_imports)] pub use gen_VideoEncoderEncodeOptions::*; #[cfg(feature = "VideoEncoderInit")] #[allow(non_snake_case)] mod gen_VideoEncoderInit; #[cfg(feature = "VideoEncoderInit")] +#[allow(unused_imports)] pub use gen_VideoEncoderInit::*; #[cfg(feature = "VideoEncoderSupport")] #[allow(non_snake_case)] mod gen_VideoEncoderSupport; #[cfg(feature = "VideoEncoderSupport")] +#[allow(unused_imports)] pub use gen_VideoEncoderSupport::*; #[cfg(feature = "VideoFacingModeEnum")] #[allow(non_snake_case)] mod gen_VideoFacingModeEnum; #[cfg(feature = "VideoFacingModeEnum")] +#[allow(unused_imports)] pub use gen_VideoFacingModeEnum::*; #[cfg(feature = "VideoFrame")] #[allow(non_snake_case)] mod gen_VideoFrame; #[cfg(feature = "VideoFrame")] +#[allow(unused_imports)] pub use gen_VideoFrame::*; #[cfg(feature = "VideoFrameBufferInit")] #[allow(non_snake_case)] mod gen_VideoFrameBufferInit; #[cfg(feature = "VideoFrameBufferInit")] +#[allow(unused_imports)] pub use gen_VideoFrameBufferInit::*; #[cfg(feature = "VideoFrameCopyToOptions")] #[allow(non_snake_case)] mod gen_VideoFrameCopyToOptions; #[cfg(feature = "VideoFrameCopyToOptions")] +#[allow(unused_imports)] pub use gen_VideoFrameCopyToOptions::*; #[cfg(feature = "VideoFrameInit")] #[allow(non_snake_case)] mod gen_VideoFrameInit; #[cfg(feature = "VideoFrameInit")] +#[allow(unused_imports)] pub use gen_VideoFrameInit::*; #[cfg(feature = "VideoMatrixCoefficients")] #[allow(non_snake_case)] mod gen_VideoMatrixCoefficients; #[cfg(feature = "VideoMatrixCoefficients")] +#[allow(unused_imports)] pub use gen_VideoMatrixCoefficients::*; #[cfg(feature = "VideoPixelFormat")] #[allow(non_snake_case)] mod gen_VideoPixelFormat; #[cfg(feature = "VideoPixelFormat")] +#[allow(unused_imports)] pub use gen_VideoPixelFormat::*; #[cfg(feature = "VideoPlaybackQuality")] #[allow(non_snake_case)] mod gen_VideoPlaybackQuality; #[cfg(feature = "VideoPlaybackQuality")] +#[allow(unused_imports)] pub use gen_VideoPlaybackQuality::*; #[cfg(feature = "VideoStreamTrack")] #[allow(non_snake_case)] mod gen_VideoStreamTrack; #[cfg(feature = "VideoStreamTrack")] +#[allow(unused_imports)] pub use gen_VideoStreamTrack::*; #[cfg(feature = "VideoTrack")] #[allow(non_snake_case)] mod gen_VideoTrack; #[cfg(feature = "VideoTrack")] +#[allow(unused_imports)] pub use gen_VideoTrack::*; #[cfg(feature = "VideoTrackList")] #[allow(non_snake_case)] mod gen_VideoTrackList; #[cfg(feature = "VideoTrackList")] +#[allow(unused_imports)] pub use gen_VideoTrackList::*; #[cfg(feature = "VideoTransferCharacteristics")] #[allow(non_snake_case)] mod gen_VideoTransferCharacteristics; #[cfg(feature = "VideoTransferCharacteristics")] +#[allow(unused_imports)] pub use gen_VideoTransferCharacteristics::*; #[cfg(feature = "ViewTransition")] #[allow(non_snake_case)] mod gen_ViewTransition; #[cfg(feature = "ViewTransition")] +#[allow(unused_imports)] pub use gen_ViewTransition::*; #[cfg(feature = "VisibilityState")] #[allow(non_snake_case)] mod gen_VisibilityState; #[cfg(feature = "VisibilityState")] +#[allow(unused_imports)] pub use gen_VisibilityState::*; #[cfg(feature = "VoidCallback")] #[allow(non_snake_case)] mod gen_VoidCallback; #[cfg(feature = "VoidCallback")] +#[allow(unused_imports)] pub use gen_VoidCallback::*; #[cfg(feature = "VrDisplay")] #[allow(non_snake_case)] mod gen_VrDisplay; #[cfg(feature = "VrDisplay")] +#[allow(unused_imports)] pub use gen_VrDisplay::*; #[cfg(feature = "VrDisplayCapabilities")] #[allow(non_snake_case)] mod gen_VrDisplayCapabilities; #[cfg(feature = "VrDisplayCapabilities")] +#[allow(unused_imports)] pub use gen_VrDisplayCapabilities::*; #[cfg(feature = "VrEye")] #[allow(non_snake_case)] mod gen_VrEye; #[cfg(feature = "VrEye")] +#[allow(unused_imports)] pub use gen_VrEye::*; #[cfg(feature = "VrEyeParameters")] #[allow(non_snake_case)] mod gen_VrEyeParameters; #[cfg(feature = "VrEyeParameters")] +#[allow(unused_imports)] pub use gen_VrEyeParameters::*; #[cfg(feature = "VrFieldOfView")] #[allow(non_snake_case)] mod gen_VrFieldOfView; #[cfg(feature = "VrFieldOfView")] +#[allow(unused_imports)] pub use gen_VrFieldOfView::*; #[cfg(feature = "VrFrameData")] #[allow(non_snake_case)] mod gen_VrFrameData; #[cfg(feature = "VrFrameData")] +#[allow(unused_imports)] pub use gen_VrFrameData::*; #[cfg(feature = "VrLayer")] #[allow(non_snake_case)] mod gen_VrLayer; #[cfg(feature = "VrLayer")] +#[allow(unused_imports)] pub use gen_VrLayer::*; #[cfg(feature = "VrMockController")] #[allow(non_snake_case)] mod gen_VrMockController; #[cfg(feature = "VrMockController")] +#[allow(unused_imports)] pub use gen_VrMockController::*; #[cfg(feature = "VrMockDisplay")] #[allow(non_snake_case)] mod gen_VrMockDisplay; #[cfg(feature = "VrMockDisplay")] +#[allow(unused_imports)] pub use gen_VrMockDisplay::*; #[cfg(feature = "VrPose")] #[allow(non_snake_case)] mod gen_VrPose; #[cfg(feature = "VrPose")] +#[allow(unused_imports)] pub use gen_VrPose::*; #[cfg(feature = "VrServiceTest")] #[allow(non_snake_case)] mod gen_VrServiceTest; #[cfg(feature = "VrServiceTest")] +#[allow(unused_imports)] pub use gen_VrServiceTest::*; #[cfg(feature = "VrStageParameters")] #[allow(non_snake_case)] mod gen_VrStageParameters; #[cfg(feature = "VrStageParameters")] +#[allow(unused_imports)] pub use gen_VrStageParameters::*; #[cfg(feature = "VrSubmitFrameResult")] #[allow(non_snake_case)] mod gen_VrSubmitFrameResult; #[cfg(feature = "VrSubmitFrameResult")] +#[allow(unused_imports)] pub use gen_VrSubmitFrameResult::*; #[cfg(feature = "VttCue")] #[allow(non_snake_case)] mod gen_VttCue; #[cfg(feature = "VttCue")] +#[allow(unused_imports)] pub use gen_VttCue::*; #[cfg(feature = "VttRegion")] #[allow(non_snake_case)] mod gen_VttRegion; #[cfg(feature = "VttRegion")] +#[allow(unused_imports)] pub use gen_VttRegion::*; #[cfg(feature = "WakeLock")] #[allow(non_snake_case)] mod gen_WakeLock; #[cfg(feature = "WakeLock")] +#[allow(unused_imports)] pub use gen_WakeLock::*; #[cfg(feature = "WakeLockSentinel")] #[allow(non_snake_case)] mod gen_WakeLockSentinel; #[cfg(feature = "WakeLockSentinel")] +#[allow(unused_imports)] pub use gen_WakeLockSentinel::*; #[cfg(feature = "WakeLockType")] #[allow(non_snake_case)] mod gen_WakeLockType; #[cfg(feature = "WakeLockType")] +#[allow(unused_imports)] pub use gen_WakeLockType::*; #[cfg(feature = "WatchAdvertisementsOptions")] #[allow(non_snake_case)] mod gen_WatchAdvertisementsOptions; #[cfg(feature = "WatchAdvertisementsOptions")] +#[allow(unused_imports)] pub use gen_WatchAdvertisementsOptions::*; #[cfg(feature = "WaveShaperNode")] #[allow(non_snake_case)] mod gen_WaveShaperNode; #[cfg(feature = "WaveShaperNode")] +#[allow(unused_imports)] pub use gen_WaveShaperNode::*; #[cfg(feature = "WaveShaperOptions")] #[allow(non_snake_case)] mod gen_WaveShaperOptions; #[cfg(feature = "WaveShaperOptions")] +#[allow(unused_imports)] pub use gen_WaveShaperOptions::*; #[cfg(feature = "WebGl2RenderingContext")] #[allow(non_snake_case)] mod gen_WebGl2RenderingContext; #[cfg(feature = "WebGl2RenderingContext")] +#[allow(unused_imports)] pub use gen_WebGl2RenderingContext::*; #[cfg(feature = "WebGlActiveInfo")] #[allow(non_snake_case)] mod gen_WebGlActiveInfo; #[cfg(feature = "WebGlActiveInfo")] +#[allow(unused_imports)] pub use gen_WebGlActiveInfo::*; #[cfg(feature = "WebGlBuffer")] #[allow(non_snake_case)] mod gen_WebGlBuffer; #[cfg(feature = "WebGlBuffer")] +#[allow(unused_imports)] pub use gen_WebGlBuffer::*; #[cfg(feature = "WebGlContextAttributes")] #[allow(non_snake_case)] mod gen_WebGlContextAttributes; #[cfg(feature = "WebGlContextAttributes")] +#[allow(unused_imports)] pub use gen_WebGlContextAttributes::*; #[cfg(feature = "WebGlContextEvent")] #[allow(non_snake_case)] mod gen_WebGlContextEvent; #[cfg(feature = "WebGlContextEvent")] +#[allow(unused_imports)] pub use gen_WebGlContextEvent::*; #[cfg(feature = "WebGlContextEventInit")] #[allow(non_snake_case)] mod gen_WebGlContextEventInit; #[cfg(feature = "WebGlContextEventInit")] +#[allow(unused_imports)] pub use gen_WebGlContextEventInit::*; #[cfg(feature = "WebGlFramebuffer")] #[allow(non_snake_case)] mod gen_WebGlFramebuffer; #[cfg(feature = "WebGlFramebuffer")] +#[allow(unused_imports)] pub use gen_WebGlFramebuffer::*; #[cfg(feature = "WebGlPowerPreference")] #[allow(non_snake_case)] mod gen_WebGlPowerPreference; #[cfg(feature = "WebGlPowerPreference")] +#[allow(unused_imports)] pub use gen_WebGlPowerPreference::*; #[cfg(feature = "WebGlProgram")] #[allow(non_snake_case)] mod gen_WebGlProgram; #[cfg(feature = "WebGlProgram")] +#[allow(unused_imports)] pub use gen_WebGlProgram::*; #[cfg(feature = "WebGlQuery")] #[allow(non_snake_case)] mod gen_WebGlQuery; #[cfg(feature = "WebGlQuery")] +#[allow(unused_imports)] pub use gen_WebGlQuery::*; #[cfg(feature = "WebGlRenderbuffer")] #[allow(non_snake_case)] mod gen_WebGlRenderbuffer; #[cfg(feature = "WebGlRenderbuffer")] +#[allow(unused_imports)] pub use gen_WebGlRenderbuffer::*; #[cfg(feature = "WebGlRenderingContext")] #[allow(non_snake_case)] mod gen_WebGlRenderingContext; #[cfg(feature = "WebGlRenderingContext")] +#[allow(unused_imports)] pub use gen_WebGlRenderingContext::*; #[cfg(feature = "WebGlSampler")] #[allow(non_snake_case)] mod gen_WebGlSampler; #[cfg(feature = "WebGlSampler")] +#[allow(unused_imports)] pub use gen_WebGlSampler::*; #[cfg(feature = "WebGlShader")] #[allow(non_snake_case)] mod gen_WebGlShader; #[cfg(feature = "WebGlShader")] +#[allow(unused_imports)] pub use gen_WebGlShader::*; #[cfg(feature = "WebGlShaderPrecisionFormat")] #[allow(non_snake_case)] mod gen_WebGlShaderPrecisionFormat; #[cfg(feature = "WebGlShaderPrecisionFormat")] +#[allow(unused_imports)] pub use gen_WebGlShaderPrecisionFormat::*; #[cfg(feature = "WebGlSync")] #[allow(non_snake_case)] mod gen_WebGlSync; #[cfg(feature = "WebGlSync")] +#[allow(unused_imports)] pub use gen_WebGlSync::*; #[cfg(feature = "WebGlTexture")] #[allow(non_snake_case)] mod gen_WebGlTexture; #[cfg(feature = "WebGlTexture")] +#[allow(unused_imports)] pub use gen_WebGlTexture::*; #[cfg(feature = "WebGlTransformFeedback")] #[allow(non_snake_case)] mod gen_WebGlTransformFeedback; #[cfg(feature = "WebGlTransformFeedback")] +#[allow(unused_imports)] pub use gen_WebGlTransformFeedback::*; #[cfg(feature = "WebGlUniformLocation")] #[allow(non_snake_case)] mod gen_WebGlUniformLocation; #[cfg(feature = "WebGlUniformLocation")] +#[allow(unused_imports)] pub use gen_WebGlUniformLocation::*; #[cfg(feature = "WebGlVertexArrayObject")] #[allow(non_snake_case)] mod gen_WebGlVertexArrayObject; #[cfg(feature = "WebGlVertexArrayObject")] +#[allow(unused_imports)] pub use gen_WebGlVertexArrayObject::*; #[cfg(feature = "WebKitCssMatrix")] #[allow(non_snake_case)] mod gen_WebKitCssMatrix; #[cfg(feature = "WebKitCssMatrix")] +#[allow(unused_imports)] pub use gen_WebKitCssMatrix::*; #[cfg(feature = "WebSocket")] #[allow(non_snake_case)] mod gen_WebSocket; #[cfg(feature = "WebSocket")] +#[allow(unused_imports)] pub use gen_WebSocket::*; #[cfg(feature = "WebSocketDict")] #[allow(non_snake_case)] mod gen_WebSocketDict; #[cfg(feature = "WebSocketDict")] +#[allow(unused_imports)] pub use gen_WebSocketDict::*; #[cfg(feature = "WebSocketElement")] #[allow(non_snake_case)] mod gen_WebSocketElement; #[cfg(feature = "WebSocketElement")] +#[allow(unused_imports)] pub use gen_WebSocketElement::*; #[cfg(feature = "WebTransport")] #[allow(non_snake_case)] mod gen_WebTransport; #[cfg(feature = "WebTransport")] +#[allow(unused_imports)] pub use gen_WebTransport::*; #[cfg(feature = "WebTransportBidirectionalStream")] #[allow(non_snake_case)] mod gen_WebTransportBidirectionalStream; #[cfg(feature = "WebTransportBidirectionalStream")] +#[allow(unused_imports)] pub use gen_WebTransportBidirectionalStream::*; #[cfg(feature = "WebTransportCloseInfo")] #[allow(non_snake_case)] mod gen_WebTransportCloseInfo; #[cfg(feature = "WebTransportCloseInfo")] +#[allow(unused_imports)] pub use gen_WebTransportCloseInfo::*; #[cfg(feature = "WebTransportCongestionControl")] #[allow(non_snake_case)] mod gen_WebTransportCongestionControl; #[cfg(feature = "WebTransportCongestionControl")] +#[allow(unused_imports)] pub use gen_WebTransportCongestionControl::*; #[cfg(feature = "WebTransportDatagramDuplexStream")] #[allow(non_snake_case)] mod gen_WebTransportDatagramDuplexStream; #[cfg(feature = "WebTransportDatagramDuplexStream")] +#[allow(unused_imports)] pub use gen_WebTransportDatagramDuplexStream::*; #[cfg(feature = "WebTransportDatagramStats")] #[allow(non_snake_case)] mod gen_WebTransportDatagramStats; #[cfg(feature = "WebTransportDatagramStats")] +#[allow(unused_imports)] pub use gen_WebTransportDatagramStats::*; #[cfg(feature = "WebTransportError")] #[allow(non_snake_case)] mod gen_WebTransportError; #[cfg(feature = "WebTransportError")] +#[allow(unused_imports)] pub use gen_WebTransportError::*; #[cfg(feature = "WebTransportErrorOptions")] #[allow(non_snake_case)] mod gen_WebTransportErrorOptions; #[cfg(feature = "WebTransportErrorOptions")] +#[allow(unused_imports)] pub use gen_WebTransportErrorOptions::*; #[cfg(feature = "WebTransportErrorSource")] #[allow(non_snake_case)] mod gen_WebTransportErrorSource; #[cfg(feature = "WebTransportErrorSource")] +#[allow(unused_imports)] pub use gen_WebTransportErrorSource::*; #[cfg(feature = "WebTransportHash")] #[allow(non_snake_case)] mod gen_WebTransportHash; #[cfg(feature = "WebTransportHash")] +#[allow(unused_imports)] pub use gen_WebTransportHash::*; #[cfg(feature = "WebTransportOptions")] #[allow(non_snake_case)] mod gen_WebTransportOptions; #[cfg(feature = "WebTransportOptions")] +#[allow(unused_imports)] pub use gen_WebTransportOptions::*; #[cfg(feature = "WebTransportReceiveStream")] #[allow(non_snake_case)] mod gen_WebTransportReceiveStream; #[cfg(feature = "WebTransportReceiveStream")] +#[allow(unused_imports)] pub use gen_WebTransportReceiveStream::*; #[cfg(feature = "WebTransportReceiveStreamStats")] #[allow(non_snake_case)] mod gen_WebTransportReceiveStreamStats; #[cfg(feature = "WebTransportReceiveStreamStats")] +#[allow(unused_imports)] pub use gen_WebTransportReceiveStreamStats::*; #[cfg(feature = "WebTransportReliabilityMode")] #[allow(non_snake_case)] mod gen_WebTransportReliabilityMode; #[cfg(feature = "WebTransportReliabilityMode")] +#[allow(unused_imports)] pub use gen_WebTransportReliabilityMode::*; #[cfg(feature = "WebTransportSendStream")] #[allow(non_snake_case)] mod gen_WebTransportSendStream; #[cfg(feature = "WebTransportSendStream")] +#[allow(unused_imports)] pub use gen_WebTransportSendStream::*; #[cfg(feature = "WebTransportSendStreamOptions")] #[allow(non_snake_case)] mod gen_WebTransportSendStreamOptions; #[cfg(feature = "WebTransportSendStreamOptions")] +#[allow(unused_imports)] pub use gen_WebTransportSendStreamOptions::*; #[cfg(feature = "WebTransportSendStreamStats")] #[allow(non_snake_case)] mod gen_WebTransportSendStreamStats; #[cfg(feature = "WebTransportSendStreamStats")] +#[allow(unused_imports)] pub use gen_WebTransportSendStreamStats::*; #[cfg(feature = "WebTransportStats")] #[allow(non_snake_case)] mod gen_WebTransportStats; #[cfg(feature = "WebTransportStats")] +#[allow(unused_imports)] pub use gen_WebTransportStats::*; #[cfg(feature = "WebglColorBufferFloat")] #[allow(non_snake_case)] mod gen_WebglColorBufferFloat; #[cfg(feature = "WebglColorBufferFloat")] +#[allow(unused_imports)] pub use gen_WebglColorBufferFloat::*; #[cfg(feature = "WebglCompressedTextureAstc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureAstc; #[cfg(feature = "WebglCompressedTextureAstc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureAstc::*; #[cfg(feature = "WebglCompressedTextureAtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureAtc; #[cfg(feature = "WebglCompressedTextureAtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureAtc::*; #[cfg(feature = "WebglCompressedTextureEtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureEtc; #[cfg(feature = "WebglCompressedTextureEtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureEtc::*; #[cfg(feature = "WebglCompressedTextureEtc1")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureEtc1; #[cfg(feature = "WebglCompressedTextureEtc1")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureEtc1::*; #[cfg(feature = "WebglCompressedTexturePvrtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTexturePvrtc; #[cfg(feature = "WebglCompressedTexturePvrtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTexturePvrtc::*; #[cfg(feature = "WebglCompressedTextureS3tc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureS3tc; #[cfg(feature = "WebglCompressedTextureS3tc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureS3tc::*; #[cfg(feature = "WebglCompressedTextureS3tcSrgb")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureS3tcSrgb; #[cfg(feature = "WebglCompressedTextureS3tcSrgb")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureS3tcSrgb::*; #[cfg(feature = "WebglDebugRendererInfo")] #[allow(non_snake_case)] mod gen_WebglDebugRendererInfo; #[cfg(feature = "WebglDebugRendererInfo")] +#[allow(unused_imports)] pub use gen_WebglDebugRendererInfo::*; #[cfg(feature = "WebglDebugShaders")] #[allow(non_snake_case)] mod gen_WebglDebugShaders; #[cfg(feature = "WebglDebugShaders")] +#[allow(unused_imports)] pub use gen_WebglDebugShaders::*; #[cfg(feature = "WebglDepthTexture")] #[allow(non_snake_case)] mod gen_WebglDepthTexture; #[cfg(feature = "WebglDepthTexture")] +#[allow(unused_imports)] pub use gen_WebglDepthTexture::*; #[cfg(feature = "WebglDrawBuffers")] #[allow(non_snake_case)] mod gen_WebglDrawBuffers; #[cfg(feature = "WebglDrawBuffers")] +#[allow(unused_imports)] pub use gen_WebglDrawBuffers::*; #[cfg(feature = "WebglLoseContext")] #[allow(non_snake_case)] mod gen_WebglLoseContext; #[cfg(feature = "WebglLoseContext")] +#[allow(unused_imports)] pub use gen_WebglLoseContext::*; #[cfg(feature = "WebglMultiDraw")] #[allow(non_snake_case)] mod gen_WebglMultiDraw; #[cfg(feature = "WebglMultiDraw")] +#[allow(unused_imports)] pub use gen_WebglMultiDraw::*; -#[cfg(feature = "WebrtcGlobalStatisticsReport")] -#[allow(non_snake_case)] -mod gen_WebrtcGlobalStatisticsReport; -#[cfg(feature = "WebrtcGlobalStatisticsReport")] -pub use gen_WebrtcGlobalStatisticsReport::*; - #[cfg(feature = "WgslLanguageFeatures")] #[allow(non_snake_case)] mod gen_WgslLanguageFeatures; #[cfg(feature = "WgslLanguageFeatures")] +#[allow(unused_imports)] pub use gen_WgslLanguageFeatures::*; #[cfg(feature = "WheelEvent")] #[allow(non_snake_case)] mod gen_WheelEvent; #[cfg(feature = "WheelEvent")] +#[allow(unused_imports)] pub use gen_WheelEvent::*; #[cfg(feature = "WheelEventInit")] #[allow(non_snake_case)] mod gen_WheelEventInit; #[cfg(feature = "WheelEventInit")] +#[allow(unused_imports)] pub use gen_WheelEventInit::*; #[cfg(feature = "WidevineCdmManifest")] #[allow(non_snake_case)] mod gen_WidevineCdmManifest; #[cfg(feature = "WidevineCdmManifest")] +#[allow(unused_imports)] pub use gen_WidevineCdmManifest::*; #[cfg(feature = "Window")] #[allow(non_snake_case)] mod gen_Window; #[cfg(feature = "Window")] +#[allow(unused_imports)] pub use gen_Window::*; #[cfg(feature = "WindowClient")] #[allow(non_snake_case)] mod gen_WindowClient; #[cfg(feature = "WindowClient")] +#[allow(unused_imports)] pub use gen_WindowClient::*; #[cfg(feature = "Worker")] #[allow(non_snake_case)] mod gen_Worker; #[cfg(feature = "Worker")] +#[allow(unused_imports)] pub use gen_Worker::*; #[cfg(feature = "WorkerDebuggerGlobalScope")] #[allow(non_snake_case)] mod gen_WorkerDebuggerGlobalScope; #[cfg(feature = "WorkerDebuggerGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkerDebuggerGlobalScope::*; #[cfg(feature = "WorkerGlobalScope")] #[allow(non_snake_case)] mod gen_WorkerGlobalScope; #[cfg(feature = "WorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkerGlobalScope::*; #[cfg(feature = "WorkerLocation")] #[allow(non_snake_case)] mod gen_WorkerLocation; #[cfg(feature = "WorkerLocation")] +#[allow(unused_imports)] pub use gen_WorkerLocation::*; #[cfg(feature = "WorkerNavigator")] #[allow(non_snake_case)] mod gen_WorkerNavigator; #[cfg(feature = "WorkerNavigator")] +#[allow(unused_imports)] pub use gen_WorkerNavigator::*; #[cfg(feature = "WorkerOptions")] #[allow(non_snake_case)] mod gen_WorkerOptions; #[cfg(feature = "WorkerOptions")] +#[allow(unused_imports)] pub use gen_WorkerOptions::*; #[cfg(feature = "WorkerType")] #[allow(non_snake_case)] mod gen_WorkerType; #[cfg(feature = "WorkerType")] +#[allow(unused_imports)] pub use gen_WorkerType::*; #[cfg(feature = "Worklet")] #[allow(non_snake_case)] mod gen_Worklet; #[cfg(feature = "Worklet")] +#[allow(unused_imports)] pub use gen_Worklet::*; #[cfg(feature = "WorkletGlobalScope")] #[allow(non_snake_case)] mod gen_WorkletGlobalScope; #[cfg(feature = "WorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkletGlobalScope::*; #[cfg(feature = "WorkletOptions")] #[allow(non_snake_case)] mod gen_WorkletOptions; #[cfg(feature = "WorkletOptions")] +#[allow(unused_imports)] pub use gen_WorkletOptions::*; #[cfg(feature = "WritableStream")] #[allow(non_snake_case)] mod gen_WritableStream; #[cfg(feature = "WritableStream")] +#[allow(unused_imports)] pub use gen_WritableStream::*; #[cfg(feature = "WritableStreamDefaultController")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultController; #[cfg(feature = "WritableStreamDefaultController")] +#[allow(unused_imports)] pub use gen_WritableStreamDefaultController::*; #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; #[cfg(feature = "WritableStreamDefaultWriter")] +#[allow(unused_imports)] pub use gen_WritableStreamDefaultWriter::*; #[cfg(feature = "WriteCommandType")] #[allow(non_snake_case)] mod gen_WriteCommandType; #[cfg(feature = "WriteCommandType")] +#[allow(unused_imports)] pub use gen_WriteCommandType::*; #[cfg(feature = "WriteParams")] #[allow(non_snake_case)] mod gen_WriteParams; #[cfg(feature = "WriteParams")] +#[allow(unused_imports)] pub use gen_WriteParams::*; #[cfg(feature = "XPathExpression")] #[allow(non_snake_case)] mod gen_XPathExpression; #[cfg(feature = "XPathExpression")] +#[allow(unused_imports)] pub use gen_XPathExpression::*; #[cfg(feature = "XPathNsResolver")] #[allow(non_snake_case)] mod gen_XPathNsResolver; #[cfg(feature = "XPathNsResolver")] +#[allow(unused_imports)] pub use gen_XPathNsResolver::*; #[cfg(feature = "XPathResult")] #[allow(non_snake_case)] mod gen_XPathResult; #[cfg(feature = "XPathResult")] +#[allow(unused_imports)] pub use gen_XPathResult::*; #[cfg(feature = "XmlDocument")] #[allow(non_snake_case)] mod gen_XmlDocument; #[cfg(feature = "XmlDocument")] +#[allow(unused_imports)] pub use gen_XmlDocument::*; #[cfg(feature = "XmlHttpRequest")] #[allow(non_snake_case)] mod gen_XmlHttpRequest; #[cfg(feature = "XmlHttpRequest")] +#[allow(unused_imports)] pub use gen_XmlHttpRequest::*; #[cfg(feature = "XmlHttpRequestEventTarget")] #[allow(non_snake_case)] mod gen_XmlHttpRequestEventTarget; #[cfg(feature = "XmlHttpRequestEventTarget")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestEventTarget::*; #[cfg(feature = "XmlHttpRequestResponseType")] #[allow(non_snake_case)] mod gen_XmlHttpRequestResponseType; #[cfg(feature = "XmlHttpRequestResponseType")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestResponseType::*; #[cfg(feature = "XmlHttpRequestUpload")] #[allow(non_snake_case)] mod gen_XmlHttpRequestUpload; #[cfg(feature = "XmlHttpRequestUpload")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestUpload::*; #[cfg(feature = "XmlSerializer")] #[allow(non_snake_case)] mod gen_XmlSerializer; #[cfg(feature = "XmlSerializer")] +#[allow(unused_imports)] pub use gen_XmlSerializer::*; #[cfg(feature = "XrBoundedReferenceSpace")] #[allow(non_snake_case)] mod gen_XrBoundedReferenceSpace; #[cfg(feature = "XrBoundedReferenceSpace")] +#[allow(unused_imports)] pub use gen_XrBoundedReferenceSpace::*; #[cfg(feature = "XrEye")] #[allow(non_snake_case)] mod gen_XrEye; #[cfg(feature = "XrEye")] +#[allow(unused_imports)] pub use gen_XrEye::*; #[cfg(feature = "XrFrame")] #[allow(non_snake_case)] mod gen_XrFrame; #[cfg(feature = "XrFrame")] +#[allow(unused_imports)] pub use gen_XrFrame::*; #[cfg(feature = "XrHand")] #[allow(non_snake_case)] mod gen_XrHand; #[cfg(feature = "XrHand")] +#[allow(unused_imports)] pub use gen_XrHand::*; #[cfg(feature = "XrHandJoint")] #[allow(non_snake_case)] mod gen_XrHandJoint; #[cfg(feature = "XrHandJoint")] +#[allow(unused_imports)] pub use gen_XrHandJoint::*; #[cfg(feature = "XrHandedness")] #[allow(non_snake_case)] mod gen_XrHandedness; #[cfg(feature = "XrHandedness")] +#[allow(unused_imports)] pub use gen_XrHandedness::*; #[cfg(feature = "XrInputSource")] #[allow(non_snake_case)] mod gen_XrInputSource; #[cfg(feature = "XrInputSource")] +#[allow(unused_imports)] pub use gen_XrInputSource::*; #[cfg(feature = "XrInputSourceArray")] #[allow(non_snake_case)] mod gen_XrInputSourceArray; #[cfg(feature = "XrInputSourceArray")] +#[allow(unused_imports)] pub use gen_XrInputSourceArray::*; #[cfg(feature = "XrInputSourceEvent")] #[allow(non_snake_case)] mod gen_XrInputSourceEvent; #[cfg(feature = "XrInputSourceEvent")] +#[allow(unused_imports)] pub use gen_XrInputSourceEvent::*; #[cfg(feature = "XrInputSourceEventInit")] #[allow(non_snake_case)] mod gen_XrInputSourceEventInit; #[cfg(feature = "XrInputSourceEventInit")] +#[allow(unused_imports)] pub use gen_XrInputSourceEventInit::*; #[cfg(feature = "XrInputSourcesChangeEvent")] #[allow(non_snake_case)] mod gen_XrInputSourcesChangeEvent; #[cfg(feature = "XrInputSourcesChangeEvent")] +#[allow(unused_imports)] pub use gen_XrInputSourcesChangeEvent::*; #[cfg(feature = "XrInputSourcesChangeEventInit")] #[allow(non_snake_case)] mod gen_XrInputSourcesChangeEventInit; #[cfg(feature = "XrInputSourcesChangeEventInit")] +#[allow(unused_imports)] pub use gen_XrInputSourcesChangeEventInit::*; #[cfg(feature = "XrJointPose")] #[allow(non_snake_case)] mod gen_XrJointPose; #[cfg(feature = "XrJointPose")] +#[allow(unused_imports)] pub use gen_XrJointPose::*; #[cfg(feature = "XrJointSpace")] #[allow(non_snake_case)] mod gen_XrJointSpace; #[cfg(feature = "XrJointSpace")] +#[allow(unused_imports)] pub use gen_XrJointSpace::*; #[cfg(feature = "XrLayer")] #[allow(non_snake_case)] mod gen_XrLayer; #[cfg(feature = "XrLayer")] +#[allow(unused_imports)] pub use gen_XrLayer::*; #[cfg(feature = "XrPermissionDescriptor")] #[allow(non_snake_case)] mod gen_XrPermissionDescriptor; #[cfg(feature = "XrPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_XrPermissionDescriptor::*; #[cfg(feature = "XrPermissionStatus")] #[allow(non_snake_case)] mod gen_XrPermissionStatus; #[cfg(feature = "XrPermissionStatus")] +#[allow(unused_imports)] pub use gen_XrPermissionStatus::*; #[cfg(feature = "XrPose")] #[allow(non_snake_case)] mod gen_XrPose; #[cfg(feature = "XrPose")] +#[allow(unused_imports)] pub use gen_XrPose::*; #[cfg(feature = "XrReferenceSpace")] #[allow(non_snake_case)] mod gen_XrReferenceSpace; #[cfg(feature = "XrReferenceSpace")] +#[allow(unused_imports)] pub use gen_XrReferenceSpace::*; #[cfg(feature = "XrReferenceSpaceEvent")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceEvent; #[cfg(feature = "XrReferenceSpaceEvent")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceEvent::*; #[cfg(feature = "XrReferenceSpaceEventInit")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceEventInit; #[cfg(feature = "XrReferenceSpaceEventInit")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceEventInit::*; #[cfg(feature = "XrReferenceSpaceType")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceType; #[cfg(feature = "XrReferenceSpaceType")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceType::*; #[cfg(feature = "XrRenderState")] #[allow(non_snake_case)] mod gen_XrRenderState; #[cfg(feature = "XrRenderState")] +#[allow(unused_imports)] pub use gen_XrRenderState::*; #[cfg(feature = "XrRenderStateInit")] #[allow(non_snake_case)] mod gen_XrRenderStateInit; #[cfg(feature = "XrRenderStateInit")] +#[allow(unused_imports)] pub use gen_XrRenderStateInit::*; #[cfg(feature = "XrRigidTransform")] #[allow(non_snake_case)] mod gen_XrRigidTransform; #[cfg(feature = "XrRigidTransform")] +#[allow(unused_imports)] pub use gen_XrRigidTransform::*; #[cfg(feature = "XrSession")] #[allow(non_snake_case)] mod gen_XrSession; #[cfg(feature = "XrSession")] +#[allow(unused_imports)] pub use gen_XrSession::*; #[cfg(feature = "XrSessionEvent")] #[allow(non_snake_case)] mod gen_XrSessionEvent; #[cfg(feature = "XrSessionEvent")] +#[allow(unused_imports)] pub use gen_XrSessionEvent::*; #[cfg(feature = "XrSessionEventInit")] #[allow(non_snake_case)] mod gen_XrSessionEventInit; #[cfg(feature = "XrSessionEventInit")] +#[allow(unused_imports)] pub use gen_XrSessionEventInit::*; #[cfg(feature = "XrSessionInit")] #[allow(non_snake_case)] mod gen_XrSessionInit; #[cfg(feature = "XrSessionInit")] +#[allow(unused_imports)] pub use gen_XrSessionInit::*; #[cfg(feature = "XrSessionMode")] #[allow(non_snake_case)] mod gen_XrSessionMode; #[cfg(feature = "XrSessionMode")] +#[allow(unused_imports)] pub use gen_XrSessionMode::*; #[cfg(feature = "XrSessionSupportedPermissionDescriptor")] #[allow(non_snake_case)] mod gen_XrSessionSupportedPermissionDescriptor; #[cfg(feature = "XrSessionSupportedPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_XrSessionSupportedPermissionDescriptor::*; #[cfg(feature = "XrSpace")] #[allow(non_snake_case)] mod gen_XrSpace; #[cfg(feature = "XrSpace")] +#[allow(unused_imports)] pub use gen_XrSpace::*; #[cfg(feature = "XrSystem")] #[allow(non_snake_case)] mod gen_XrSystem; #[cfg(feature = "XrSystem")] +#[allow(unused_imports)] pub use gen_XrSystem::*; #[cfg(feature = "XrTargetRayMode")] #[allow(non_snake_case)] mod gen_XrTargetRayMode; #[cfg(feature = "XrTargetRayMode")] +#[allow(unused_imports)] pub use gen_XrTargetRayMode::*; #[cfg(feature = "XrView")] #[allow(non_snake_case)] mod gen_XrView; #[cfg(feature = "XrView")] +#[allow(unused_imports)] pub use gen_XrView::*; #[cfg(feature = "XrViewerPose")] #[allow(non_snake_case)] mod gen_XrViewerPose; #[cfg(feature = "XrViewerPose")] +#[allow(unused_imports)] pub use gen_XrViewerPose::*; #[cfg(feature = "XrViewport")] #[allow(non_snake_case)] mod gen_XrViewport; #[cfg(feature = "XrViewport")] +#[allow(unused_imports)] pub use gen_XrViewport::*; #[cfg(feature = "XrVisibilityState")] #[allow(non_snake_case)] mod gen_XrVisibilityState; #[cfg(feature = "XrVisibilityState")] +#[allow(unused_imports)] pub use gen_XrVisibilityState::*; #[cfg(feature = "XrWebGlLayer")] #[allow(non_snake_case)] mod gen_XrWebGlLayer; #[cfg(feature = "XrWebGlLayer")] +#[allow(unused_imports)] pub use gen_XrWebGlLayer::*; #[cfg(feature = "XrWebGlLayerInit")] #[allow(non_snake_case)] mod gen_XrWebGlLayerInit; #[cfg(feature = "XrWebGlLayerInit")] +#[allow(unused_imports)] pub use gen_XrWebGlLayerInit::*; #[cfg(feature = "XsltProcessor")] #[allow(non_snake_case)] mod gen_XsltProcessor; #[cfg(feature = "XsltProcessor")] +#[allow(unused_imports)] pub use gen_XsltProcessor::*; #[cfg(feature = "console")] #[allow(non_snake_case)] mod gen_console; #[cfg(feature = "console")] +#[allow(unused_imports)] pub use gen_console::*; #[cfg(feature = "css")] #[allow(non_snake_case)] mod gen_css; #[cfg(feature = "css")] +#[allow(unused_imports)] pub use gen_css::*; #[cfg(feature = "gpu_buffer_usage")] #[allow(non_snake_case)] mod gen_gpu_buffer_usage; #[cfg(feature = "gpu_buffer_usage")] +#[allow(unused_imports)] pub use gen_gpu_buffer_usage::*; #[cfg(feature = "gpu_color_write")] #[allow(non_snake_case)] mod gen_gpu_color_write; #[cfg(feature = "gpu_color_write")] +#[allow(unused_imports)] pub use gen_gpu_color_write::*; #[cfg(feature = "gpu_map_mode")] #[allow(non_snake_case)] mod gen_gpu_map_mode; #[cfg(feature = "gpu_map_mode")] +#[allow(unused_imports)] pub use gen_gpu_map_mode::*; #[cfg(feature = "gpu_shader_stage")] #[allow(non_snake_case)] mod gen_gpu_shader_stage; #[cfg(feature = "gpu_shader_stage")] +#[allow(unused_imports)] pub use gen_gpu_shader_stage::*; #[cfg(feature = "gpu_texture_usage")] #[allow(non_snake_case)] mod gen_gpu_texture_usage; #[cfg(feature = "gpu_texture_usage")] +#[allow(unused_imports)] pub use gen_gpu_texture_usage::*; diff --git a/vendor/web-sys/webidls/enabled/ChildSHistory.webidl b/vendor/web-sys/webidls/enabled/ChildSHistory.webidl deleted file mode 100644 index 7ae2151b6..000000000 --- a/vendor/web-sys/webidls/enabled/ChildSHistory.webidl +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// invalid widl -///interface nsISHistory; - -/** - * The ChildSHistory interface represents the child side of a browsing - * context's session history. - */ -[ChromeOnly] -interface ChildSHistory { - [Pure] - readonly attribute long count; - [Pure] - readonly attribute long index; - - boolean canGo(long aOffset); - [Throws] - undefined go(long aOffset); - - /** - * Reload the current entry. The flags which should be passed to this - * function are documented and defined in nsIWebNavigation.idl - */ - [Throws] - undefined reload(unsigned long aReloadFlags); - - /** - * Getter for the legacy nsISHistory implementation. - * - * This getter _will be going away_, but is needed while we finish - * implementing all of the APIs which we will need in the content - * process on ChildSHistory. - */ - readonly attribute nsISHistory legacySHistory; -}; diff --git a/vendor/web-sys/webidls/unstable/FileSystemAccess.webidl b/vendor/web-sys/webidls/enabled/FileSystemAccess.webidl similarity index 100% rename from vendor/web-sys/webidls/unstable/FileSystemAccess.webidl rename to vendor/web-sys/webidls/enabled/FileSystemAccess.webidl diff --git a/vendor/web-sys/webidls/enabled/Flex.webidl b/vendor/web-sys/webidls/enabled/Flex.webidl deleted file mode 100644 index 58c713630..000000000 --- a/vendor/web-sys/webidls/enabled/Flex.webidl +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -/** - * These objects support visualization of flex containers by the - * dev tools. - */ - -[ChromeOnly] -interface Flex -{ - sequence getLines(); -}; - -/** - * Lines with items that have been shrunk are shrinking; with items - * that have grown are growing, and all others are unchanged. - */ -enum FlexLineGrowthState { "unchanged", "shrinking", "growing" }; - -[ChromeOnly] -interface FlexLine -{ - readonly attribute FlexLineGrowthState growthState; - readonly attribute double crossStart; - readonly attribute double crossSize; - - // firstBaselineOffset measures from flex-start edge. - readonly attribute double firstBaselineOffset; - - // lastBaselineOffset measures from flex-end edge. - readonly attribute double lastBaselineOffset; - - /** - * getItems() returns FlexItems only for the Elements in this Flex - * container -- ignoring struts and abs-pos Elements. - */ - sequence getItems(); -}; - -[ChromeOnly] -interface FlexItem -{ - readonly attribute Node? node; - readonly attribute double mainBaseSize; - readonly attribute double mainDeltaSize; - readonly attribute double mainMinSize; - readonly attribute double mainMaxSize; - readonly attribute double crossMinSize; - readonly attribute double crossMaxSize; -}; diff --git a/vendor/web-sys/webidls/enabled/FrameLoader.webidl b/vendor/web-sys/webidls/enabled/FrameLoader.webidl deleted file mode 100644 index 7cf40f225..000000000 --- a/vendor/web-sys/webidls/enabled/FrameLoader.webidl +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// invalid widl -//interface LoadContext; -//interface TabParent; -//interface URI; -//interface nsIDocShell; -//interface nsIPrintSettings; -//interface nsIWebBrowserPersistDocumentReceiver; -//interface nsIWebProgressListener; - -[ChromeOnly] -interface FrameLoader { - /** - * Get the docshell from the frame loader. - */ - [GetterThrows] - readonly attribute nsIDocShell? docShell; - - /** - * Get this frame loader's TabParent, if it has a remote frame. Otherwise, - * returns null. - */ - readonly attribute TabParent? tabParent; - - /** - * Get an nsILoadContext for the top-level docshell. For remote - * frames, a shim is returned that contains private browsing and app - * information. - */ - readonly attribute LoadContext loadContext; - - /** - * Get the ParentSHistory for the nsFrameLoader. May return null if this - * frameloader is not for a toplevel frame. - */ - readonly attribute ParentSHistory? parentSHistory; - - /** - * Adds a blocking promise for the current cross process navigation. - * This method can only be called while the "BrowserWillChangeProcess" event - * is being fired. - */ - [Throws] - undefined addProcessChangeBlockingPromise(Promise aPromise); - - /** - * Find out whether the loader's frame is at too great a depth in - * the frame tree. This can be used to decide what operations may - * or may not be allowed on the loader's docshell. - */ - [Pure] - readonly attribute boolean depthTooGreat; - - /** - * Activate remote frame. - * Throws an exception with non-remote frames. - */ - [Throws] - undefined activateRemoteFrame(); - - /** - * Deactivate remote frame. - * Throws an exception with non-remote frames. - */ - [Throws] - undefined deactivateRemoteFrame(); - - /** - * @see nsIDOMWindowUtils sendMouseEvent. - */ - [Throws] - undefined sendCrossProcessMouseEvent(DOMString aType, - float aX, - float aY, - long aButton, - long aClickCount, - long aModifiers, - optional boolean aIgnoreRootScrollFrame = false); - - /** - * Activate event forwarding from client (remote frame) to parent. - */ - [Throws] - undefined activateFrameEvent(DOMString aType, boolean capture); - - // Note, when frameloaders are swapped, also messageManagers are swapped. - readonly attribute MessageSender? messageManager; - - /** - * Request that the next time a remote layer transaction has been - * received by the Compositor, a MozAfterRemoteFrame event be sent - * to the window. - */ - undefined requestNotifyAfterRemotePaint(); - - /** - * Close the window through the ownerElement. - */ - [Throws] - undefined requestFrameLoaderClose(); - - /** - * Force a remote browser to recompute its dimension and screen position. - */ - [Throws] - undefined requestUpdatePosition(); - - /** - * Print the current document. - * - * @param aOuterWindowID the ID of the outer window to print - * @param aPrintSettings optional print settings to use; printSilent can be - * set to prevent prompting. - * @param aProgressListener optional print progress listener. - */ - [Throws] - undefined print(unsigned long long aOuterWindowID, - nsIPrintSettings aPrintSettings, - optional nsIWebProgressListener? aProgressListener = null); - - /** - * If false, then the subdocument is not clipped to its CSS viewport, and the - * subdocument's viewport scrollbar(s) are not rendered. - * Defaults to true. - */ - attribute boolean clipSubdocument; - - /** - * If false, then the subdocument's scroll coordinates will not be clamped - * to their scroll boundaries. - * Defaults to true. - */ - attribute boolean clampScrollPosition; - - /** - * The element which owns this frame loader. - * - * For example, if this is a frame loader for an