Roll tinyvec: 1.8.1 => 1.9.0 in //third_party/rust.
This CL has been created semi-automatically. The expected review
process and other details can be found at
//tools/crates/create_update_cl.md
Updated crates:
* tinyvec: 1.8.1 => 1.9.0
Chromium `supply-chain/config.toml` policy requires that the following
audit criteria are met (note that these are the *minimum* required
criteria and `supply-chain/audits.toml` can and should record a stricter
certification if possible; see also //docs/rust-unsafe.md):
* tinyvec@1.9.0: crypto-safe, safe-to-deploy, ub-risk-2
Bug: None
Change-Id: I1efa225b6f107268257cee138e8d0d44113eedd0
Cq-Include-Trybots: chromium/try:android-rust-arm32-rel
Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg
Cq-Include-Trybots: chromium/try:android-rust-arm64-rel
Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg
Cq-Include-Trybots: chromium/try:linux-rust-x64-rel
Cq-Include-Trybots: chromium/try:win-rust-x64-dbg
Cq-Include-Trybots: chromium/try:win-rust-x64-rel
Disable-Rts: True
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6322854
Reviewed-by: Ćukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429168}
diff --git a/third_party/rust/chromium_crates_io/Cargo.lock b/third_party/rust/chromium_crates_io/Cargo.lock
index 97892e24..dd023ba 100644
--- a/third_party/rust/chromium_crates_io/Cargo.lock
+++ b/third_party/rust/chromium_crates_io/Cargo.lock
@@ -1337,7 +1337,7 @@
[[package]]
name = "tinyvec"
-version = "1.8.1"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
diff --git a/third_party/rust/chromium_crates_io/supply-chain/audits.toml b/third_party/rust/chromium_crates_io/supply-chain/audits.toml
index f625d87..ac2db98 100644
--- a/third_party/rust/chromium_crates_io/supply-chain/audits.toml
+++ b/third_party/rust/chromium_crates_io/supply-chain/audits.toml
@@ -3571,6 +3571,17 @@
criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"]
delta = "1.8.0 -> 1.8.1"
+[[audits.tinyvec]]
+who = "Daniel Cheng <dcheng@chromium.org>"
+criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-0"]
+delta = "1.8.1 -> 1.9.0"
+notes = """
+Larger delta, but no unsafe code introduced. Deltas for:
+- borsh (Binary Object Representation Serializer for Hashing) serialization/deserialization support behind the `borsh` feature.
+- trait implementations to interoperate with the generic-array crate
+- miscellaneous helper functions and support code, e.g. `into_vec()`.
+"""
+
[[audits.unicode-bidi]]
who = "Manish Goregaokar <manishearth@google.com>"
criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-1"]
diff --git a/third_party/rust/chromium_crates_io/supply-chain/config.toml b/third_party/rust/chromium_crates_io/supply-chain/config.toml
index 9e7613b..a8753ad 100644
--- a/third_party/rust/chromium_crates_io/supply-chain/config.toml
+++ b/third_party/rust/chromium_crates_io/supply-chain/config.toml
@@ -473,7 +473,7 @@
[policy."tinystr:0.8.0"]
criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"]
-[policy."tinyvec:1.8.1"]
+[policy."tinyvec:1.9.0"]
criteria = ["crypto-safe", "safe-to-deploy", "ub-risk-2"]
[policy."unicode-bidi:0.3.18"]
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json
deleted file mode 100644
index 290ed7d..0000000
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo_vcs_info.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "git": {
- "sha1": "659e6c1f1f683b7504e71b6773cf0cdb86b1faf3"
- },
- "path_in_vcs": ""
-}
\ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.cargo-checksum.json
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.cargo-checksum.json
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.cargo-checksum.json
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.cargo_vcs_info.json b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.cargo_vcs_info.json
new file mode 100644
index 0000000..d55d7d0
--- /dev/null
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.cargo_vcs_info.json
@@ -0,0 +1,6 @@
+{
+ "git": {
+ "sha1": "f83214e657df4fea93be654859fcfe85687a1232"
+ },
+ "path_in_vcs": ""
+}
\ No newline at end of file
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.gitignore b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.gitignore
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/.gitignore
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/.gitignore
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/CHANGELOG.md
similarity index 91%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/CHANGELOG.md
index b40a48d6..3471d26 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/CHANGELOG.md
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 1.9
+
+* Adds a `latest_stable_rust` cargo feature, which will automatically pull in
+ other cargo features related to the latest Stable version of rust.
+* Adds `ArrayVec::try_from_array_len`
+* Adds `TinyVec::into_vec` and `TinyVec::into_boxed_slice`
+* Adds support for `generic-array` crate
+* Adds support for the `borsh` crate
+
## 1.8.1
* [e00E](https://github.com/e00E) updated the rustc features so that they all
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.lock b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.lock
new file mode 100644
index 0000000..a929873
--- /dev/null
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.lock
@@ -0,0 +1,647 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.81"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
+
+[[package]]
+name = "arbitrary"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "borsh"
+version = "1.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc"
+dependencies = [
+ "cfg_aliases",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.15.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
+
+[[package]]
+name = "cast"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "cfg_aliases"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
+
+[[package]]
+name = "clap"
+version = "2.34.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
+dependencies = [
+ "bitflags",
+ "textwrap",
+ "unicode-width",
+]
+
+[[package]]
+name = "criterion"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f"
+dependencies = [
+ "atty",
+ "cast",
+ "clap",
+ "criterion-plot",
+ "csv",
+ "itertools",
+ "lazy_static",
+ "num-traits",
+ "oorandom",
+ "plotters",
+ "rayon",
+ "regex",
+ "serde",
+ "serde_cbor",
+ "serde_derive",
+ "serde_json",
+ "tinytemplate",
+ "walkdir",
+]
+
+[[package]]
+name = "criterion-plot"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876"
+dependencies = [
+ "cast",
+ "itertools",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
+dependencies = [
+ "crossbeam-epoch",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
+
+[[package]]
+name = "csv"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
+dependencies = [
+ "csv-core",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "csv-core"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "debugger_test"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d95bb55f592fbb86947bee426d831de84bd65602a54f5cdcb10bfa70a62e52a0"
+dependencies = [
+ "anyhow",
+ "log",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "debugger_test_parser"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebe536452a777752b9316f0c840afbb94a2411684d4f15c081449ea801ef9e75"
+dependencies = [
+ "anyhow",
+ "log",
+ "regex",
+]
+
+[[package]]
+name = "either"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
+
+[[package]]
+name = "generic-array"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8c8444bc9d71b935156cc0ccab7f622180808af7867b1daae6547d773591703"
+dependencies = [
+ "typenum",
+]
+
+[[package]]
+name = "half"
+version = "1.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403"
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "itertools"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
+
+[[package]]
+name = "js-sys"
+version = "0.3.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+dependencies = [
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "libc"
+version = "0.2.153"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+
+[[package]]
+name = "log"
+version = "0.4.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+
+[[package]]
+name = "memchr"
+version = "2.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+
+[[package]]
+name = "num-traits"
+version = "0.2.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+
+[[package]]
+name = "oorandom"
+version = "11.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
+
+[[package]]
+name = "plotters"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45"
+dependencies = [
+ "num-traits",
+ "plotters-backend",
+ "plotters-svg",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "plotters-backend"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609"
+
+[[package]]
+name = "plotters-svg"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab"
+dependencies = [
+ "plotters-backend",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.79"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rayon"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd"
+dependencies = [
+ "either",
+ "rayon-core",
+]
+
+[[package]]
+name = "rayon-core"
+version = "1.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
+dependencies = [
+ "crossbeam-deque",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "regex"
+version = "1.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
+
+[[package]]
+name = "ryu"
+version = "1.0.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "serde"
+version = "1.0.197"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_cbor"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
+dependencies = [
+ "half",
+ "serde",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.197"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.53",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.114"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_test"
+version = "1.0.176"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a2f49ace1498612d14f7e0b8245519584db8299541dfe31a06374a828d620ab"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "smallvec"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.53"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
+dependencies = [
+ "unicode-width",
+]
+
+[[package]]
+name = "tinytemplate"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
+dependencies = [
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "tinyvec"
+version = "1.9.0"
+dependencies = [
+ "arbitrary",
+ "borsh",
+ "criterion",
+ "debugger_test",
+ "debugger_test_parser",
+ "generic-array",
+ "serde",
+ "serde_test",
+ "smallvec",
+ "tinyvec_macros",
+]
+
+[[package]]
+name = "tinyvec_macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
+
+[[package]]
+name = "typenum"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
+
+[[package]]
+name = "walkdir"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+dependencies = [
+ "same-file",
+ "winapi-util",
+]
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.53",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.53",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+
+[[package]]
+name = "web-sys"
+version = "0.3.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml
similarity index 89%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml
index 564cdff2..db45dc0 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "tinyvec"
-version = "1.8.1"
+version = "1.9.0"
authors = ["Lokathor <zefria@gmail.com>"]
build = false
exclude = [
@@ -21,6 +21,7 @@
"/*.sh",
"/src-backup",
]
+autolib = false
autobins = false
autoexamples = false
autotests = false
@@ -44,8 +45,9 @@
"alloc",
"std",
"grab_spare_slice",
- "rustc_1_55",
+ "latest_stable_rust",
"serde",
+ "borsh",
]
rustdoc-args = [
"--cfg",
@@ -57,12 +59,25 @@
"alloc",
"std",
"grab_spare_slice",
- "rustc_1_55",
+ "latest_stable_rust",
"serde",
+ "borsh",
]
-[profile.bench]
-debug = 2
+[features]
+alloc = ["tinyvec_macros"]
+debugger_visualizer = []
+default = []
+experimental_write_impl = []
+grab_spare_slice = []
+latest_stable_rust = ["rustc_1_61"]
+nightly_slice_partition_dedup = []
+real_blackbox = ["criterion/real_blackbox"]
+rustc_1_40 = []
+rustc_1_55 = ["rustc_1_40"]
+rustc_1_57 = ["rustc_1_55"]
+rustc_1_61 = ["rustc_1_57"]
+std = ["alloc"]
[lib]
name = "tinyvec"
@@ -105,6 +120,16 @@
version = "1"
optional = true
+[dependencies.borsh]
+version = "1.2.0"
+optional = true
+default-features = false
+
+[dependencies.generic-array]
+version = "1.1.1"
+optional = true
+default-features = false
+
[dependencies.serde]
version = "1.0"
optional = true
@@ -129,16 +154,5 @@
[dev-dependencies.smallvec]
version = "1"
-[features]
-alloc = ["tinyvec_macros"]
-debugger_visualizer = []
-default = []
-experimental_write_impl = []
-grab_spare_slice = []
-nightly_slice_partition_dedup = []
-real_blackbox = ["criterion/real_blackbox"]
-rustc_1_40 = []
-rustc_1_55 = ["rustc_1_40"]
-rustc_1_57 = ["rustc_1_55"]
-rustc_1_61 = ["rustc_1_57"]
-std = ["alloc"]
+[profile.bench]
+debug = 2
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml.orig
similarity index 81%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml.orig
index f46fc01..dff4e916 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/Cargo.toml.orig
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/Cargo.toml.orig
@@ -1,7 +1,7 @@
[package]
name = "tinyvec"
description = "`tinyvec` provides 100% safe vec-like data structures."
-version = "1.8.1"
+version = "1.9.0"
authors = ["Lokathor <zefria@gmail.com>"]
edition = "2018"
license = "Zlib OR Apache-2.0 OR MIT"
@@ -16,6 +16,11 @@
serde = { version = "1.0", optional = true, default-features = false }
# Provides derived `Arbitrary` implementations
arbitrary = { version = "1", optional = true }
+# Provides `BorshSerialize` and `BorshDeserialize implementations
+borsh = { version = "1.2.0", optional = true, default-features = false }
+# Implements the trait `Array` for `GenericArray` struct.
+generic-array = { version = "1.1.1", optional = true, default-features = false }
+
[features]
default = []
@@ -45,6 +50,11 @@
# add retain_mut function to TinyVec
rustc_1_61 = ["rustc_1_57"]
+# We're done with per-version featuring, this feature opts in to all the
+# abilities of the latest release of Stable rust, and we don't need a million
+# features forever now.
+latest_stable_rust = ["rustc_1_61"]
+
# allow use of nightly feature `slice_partition_dedup`,
# will become useless once that is stabilized:
# https://github.com/rust-lang/rust/issues/54279
@@ -67,11 +77,11 @@
real_blackbox = ["criterion/real_blackbox"]
[package.metadata.docs.rs]
-features = ["alloc", "std", "grab_spare_slice", "rustc_1_55", "serde"]
+features = ["alloc", "std", "grab_spare_slice", "latest_stable_rust", "serde", "borsh"]
rustdoc-args = ["--cfg","docs_rs"]
[package.metadata.playground]
-features = ["alloc", "std", "grab_spare_slice", "rustc_1_55", "serde"]
+features = ["alloc", "std", "grab_spare_slice", "latest_stable_rust", "serde", "borsh"]
[profile.bench]
debug = 2
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-APACHE.md
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-APACHE.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-MIT.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-MIT.md
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-MIT.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-MIT.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-ZLIB.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-ZLIB.md
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-ZLIB.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-ZLIB.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/README.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/README.md
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/README.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/macros.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/benches/macros.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/macros.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/benches/macros.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/smallvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/benches/smallvec.rs
similarity index 90%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/smallvec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/benches/smallvec.rs
index 504ffaf3..1defc7f6 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/benches/smallvec.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/benches/smallvec.rs
@@ -3,27 +3,30 @@
//! All the following commentary is based on the latest nightly at the time:
//! rustc 1.55.0 (c8dfcfe04 2021-09-06).
//!
-//! Some of these benchmarks are just a few instructions, so we put our own for loop inside
-//! the criterion::Bencher::iter call. This seems to improve the stability of measurements, and it
-//! has the wonderful side effect of making the emitted assembly easier to follow. Some of these
-//! benchmarks are totally inlined so that there are no calls at all in the hot path, so finding
+//! Some of these benchmarks are just a few instructions, so we put our own for
+//! loop inside the criterion::Bencher::iter call. This seems to improve the
+//! stability of measurements, and it has the wonderful side effect of making
+//! the emitted assembly easier to follow. Some of these benchmarks are totally
+//! inlined so that there are no calls at all in the hot path, so finding
//! this for loop is an easy way to find your way around the emitted assembly.
//!
-//! The clear method is cheaper to call for arrays of elements without a Drop impl, so wherever
-//! possible we reuse a single object in the benchmark loop, with a clear + black_box on each
-//! iteration in an attempt to not make that visible to the optimizer.
+//! The clear method is cheaper to call for arrays of elements without a Drop
+//! impl, so wherever possible we reuse a single object in the benchmark loop,
+//! with a clear + black_box on each iteration in an attempt to not make that
+//! visible to the optimizer.
//!
-//! We always call black_box(&v), instead of v = black_box(v) because the latter does a move of the
-//! inline array, which is linear in the size of the array and thus varies based on the array type
-//! being benchmarked, and this move can be more expensive than the function we're trying to
-//! benchmark.
+//! We always call black_box(&v), instead of v = black_box(v) because the latter
+//! does a move of the inline array, which is linear in the size of the array
+//! and thus varies based on the array type being benchmarked, and this move can
+//! be more expensive than the function we're trying to benchmark.
//!
-//! We also black_box the input to each method call. This has a significant effect on the assembly
-//! emitted, for example if we do not black_box the range we iterate over in the ::push benchmarks,
-//! the loop is unrolled. It's not entirely clear if it's better to black_box the iterator that
-//! yields the items being pushed, or to black_box at a deeper level: v.push(black_box(i)) for
-//! example. Anecdotally, it seems like the latter approach produces unreasonably bad assembly.
-//!
+//! We also black_box the input to each method call. This has a significant
+//! effect on the assembly emitted, for example if we do not black_box the range
+//! we iterate over in the ::push benchmarks, the loop is unrolled. It's not
+//! entirely clear if it's better to black_box the iterator that yields the
+//! items being pushed, or to black_box at a deeper level: v.push(black_box(i))
+//! for example. Anecdotally, it seems like the latter approach produces
+//! unreasonably bad assembly.
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use smallvec::SmallVec;
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/README.md b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/debug_metadata/README.md
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/README.md
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/debug_metadata/README.md
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/tinyvec.natvis b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/debug_metadata/tinyvec.natvis
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/debug_metadata/tinyvec.natvis
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/debug_metadata/tinyvec.natvis
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/rustfmt.toml b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/rustfmt.toml
similarity index 77%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/rustfmt.toml
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/rustfmt.toml
index 777bb3d..e312d17 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/rustfmt.toml
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/rustfmt.toml
@@ -1,7 +1,7 @@
# Stable
edition = "2018"
-fn_args_layout = "Compressed"
+fn_params_layout = "Compressed"
max_width = 80
tab_spaces = 2
use_field_init_shorthand = true
@@ -11,4 +11,4 @@
# Unstable
format_code_in_doc_comments = true
wrap_comments = true
-imports_granularity="Crate"
+imports_granularity = "Crate"
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array.rs
similarity index 89%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array.rs
index 9a209847..aec4580 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array.rs
@@ -41,8 +41,14 @@
fn default() -> Self;
}
+#[cfg(all(feature = "generic-array", not(feature = "rustc_1_55")))]
+core::compile_error!("generic-array requires `rustc_1_55` feature");
+
#[cfg(feature = "rustc_1_55")]
mod const_generic_impl;
#[cfg(not(feature = "rustc_1_55"))]
mod generated_impl;
+
+#[cfg(feature = "generic-array")]
+mod generic_array_impl;
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/const_generic_impl.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/const_generic_impl.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generated_impl.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generated_impl.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generic_array_impl.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generic_array_impl.rs
new file mode 100644
index 0000000..383fb83e
--- /dev/null
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generic_array_impl.rs
@@ -0,0 +1,26 @@
+use core::default;
+
+use super::Array;
+use generic_array::{ArrayLength, GenericArray};
+
+impl<T: Default, N: ArrayLength> Array for GenericArray<T, N> {
+ type Item = T;
+ const CAPACITY: usize = N::USIZE;
+
+ #[inline(always)]
+ #[must_use]
+ fn as_slice(&self) -> &[T] {
+ &*self
+ }
+
+ #[inline(always)]
+ #[must_use]
+ fn as_slice_mut(&mut self) -> &mut [T] {
+ &mut *self
+ }
+
+ #[inline(always)]
+ fn default() -> Self {
+ <Self as Default>::default()
+ }
+}
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec.rs
similarity index 96%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec.rs
index 94b6fc7..884d930c 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec.rs
@@ -219,6 +219,53 @@
}
}
+#[cfg(feature = "borsh")]
+#[cfg_attr(docs_rs, doc(cfg(feature = "borsh")))]
+impl<A: Array> borsh::BorshSerialize for ArrayVec<A>
+where
+ <A as Array>::Item: borsh::BorshSerialize,
+{
+ fn serialize<W: borsh::io::Write>(
+ &self, writer: &mut W,
+ ) -> borsh::io::Result<()> {
+ <usize as borsh::BorshSerialize>::serialize(&self.len(), writer)?;
+ for elem in self.iter() {
+ <<A as Array>::Item as borsh::BorshSerialize>::serialize(elem, writer)?;
+ }
+ Ok(())
+ }
+}
+
+#[cfg(feature = "borsh")]
+#[cfg_attr(docs_rs, doc(cfg(feature = "borsh")))]
+impl<A: Array> borsh::BorshDeserialize for ArrayVec<A>
+where
+ <A as Array>::Item: borsh::BorshDeserialize,
+{
+ fn deserialize_reader<R: borsh::io::Read>(
+ reader: &mut R,
+ ) -> borsh::io::Result<Self> {
+ let len = <usize as borsh::BorshDeserialize>::deserialize_reader(reader)?;
+ let mut new_arrayvec = Self::default();
+
+ for idx in 0..len {
+ let value =
+ <<A as Array>::Item as borsh::BorshDeserialize>::deserialize_reader(
+ reader,
+ )?;
+ if idx >= new_arrayvec.capacity() {
+ return Err(borsh::io::Error::new(
+ borsh::io::ErrorKind::InvalidData,
+ "invalid ArrayVec length",
+ ));
+ }
+ new_arrayvec.push(value)
+ }
+
+ Ok(new_arrayvec)
+ }
+}
+
#[cfg(feature = "arbitrary")]
#[cfg_attr(docs_rs, doc(cfg(feature = "arbitrary")))]
impl<'a, A> arbitrary::Arbitrary<'a> for ArrayVec<A>
@@ -1071,6 +1118,7 @@
/// If the given length is greater than the capacity of the array this will
/// error, and you'll get the array back in the `Err`.
#[inline]
+ #[cfg(not(feature = "latest_stable_rust"))]
pub fn try_from_array_len(data: A, len: usize) -> Result<Self, A> {
/* Note(Soveu): Should we allow A::CAPACITY > u16::MAX for now? */
if len <= A::CAPACITY {
@@ -1079,6 +1127,26 @@
Err(data)
}
}
+
+ /// Wraps an array, using the given length as the starting length.
+ ///
+ /// If you want to use the whole length of the array, you can just use the
+ /// `From` impl.
+ ///
+ /// ## Failure
+ ///
+ /// If the given length is greater than the capacity of the array this will
+ /// error, and you'll get the array back in the `Err`.
+ #[inline]
+ #[cfg(feature = "latest_stable_rust")]
+ pub const fn try_from_array_len(data: A, len: usize) -> Result<Self, A> {
+ /* Note(Soveu): Should we allow A::CAPACITY > u16::MAX for now? */
+ if len <= A::CAPACITY {
+ Ok(Self { data, len: len as u16 })
+ } else {
+ Err(data)
+ }
+ }
}
impl<A> ArrayVec<A> {
@@ -1883,6 +1951,7 @@
/// assert_eq!(v, &[1, 2, 3]);
/// assert_eq!(v.capacity(), 13);
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_drain_to_vec_and_reserve(
&mut self, n: usize,
@@ -1925,6 +1994,7 @@
/// // Vec may reserve more than necessary in order to prevent more future allocations.
/// assert!(v.capacity() >= 3);
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_drain_to_vec(&mut self) -> Result<Vec<A::Item>, TryReserveError> {
self.try_drain_to_vec_and_reserve(0)
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec_drain.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec_drain.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/lib.rs
similarity index 95%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/lib.rs
index 8ecd7715..375dcc4 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/lib.rs
@@ -49,6 +49,9 @@
//! * `serde` provides a `Serialize` and `Deserialize` implementation for
//! [`TinyVec`] and [`ArrayVec`] types, provided the inner item also has an
//! implementation.
+//! * `borsh` provides a `BorshSerialize` and `BorshDeserialize` implementation
+//! for [`TinyVec`] and [`ArrayVec`] types, provided the inner item also has
+//! an implementation.
//!
//! ## API
//! The general goal of the crate is that, as much as possible, the vecs here
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/slicevec.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/slicevec.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/tinyvec.rs
similarity index 90%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/tinyvec.rs
index 953a47ae..9afdad5 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/tinyvec.rs
@@ -221,6 +221,47 @@
}
}
+#[cfg(feature = "borsh")]
+#[cfg_attr(docs_rs, doc(cfg(feature = "borsh")))]
+impl<A: Array> borsh::BorshSerialize for TinyVec<A>
+where
+ <A as Array>::Item: borsh::BorshSerialize,
+{
+ fn serialize<W: borsh::io::Write>(
+ &self, writer: &mut W,
+ ) -> borsh::io::Result<()> {
+ <usize as borsh::BorshSerialize>::serialize(&self.len(), writer)?;
+ for elem in self.iter() {
+ <<A as Array>::Item as borsh::BorshSerialize>::serialize(elem, writer)?;
+ }
+ Ok(())
+ }
+}
+
+#[cfg(feature = "borsh")]
+#[cfg_attr(docs_rs, doc(cfg(feature = "borsh")))]
+impl<A: Array> borsh::BorshDeserialize for TinyVec<A>
+where
+ <A as Array>::Item: borsh::BorshDeserialize,
+{
+ fn deserialize_reader<R: borsh::io::Read>(
+ reader: &mut R,
+ ) -> borsh::io::Result<Self> {
+ let len = <usize as borsh::BorshDeserialize>::deserialize_reader(reader)?;
+ let mut new_tinyvec = Self::with_capacity(len);
+
+ for _ in 0..len {
+ new_tinyvec.push(
+ <<A as Array>::Item as borsh::BorshDeserialize>::deserialize_reader(
+ reader,
+ )?,
+ )
+ }
+
+ Ok(new_tinyvec)
+ }
+}
+
#[cfg(feature = "arbitrary")]
#[cfg_attr(docs_rs, doc(cfg(feature = "arbitrary")))]
impl<'a, A> arbitrary::Arbitrary<'a> for TinyVec<A>
@@ -316,6 +357,7 @@
/// assert_eq!(Ok(()), tv.try_move_to_the_heap());
/// assert!(tv.is_heap());
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_move_to_the_heap(&mut self) -> Result<(), TryReserveError> {
let arr = match self {
@@ -364,6 +406,7 @@
/// assert!(tv.is_heap());
/// assert!(tv.capacity() >= 35);
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_move_to_the_heap_and_reserve(
&mut self, n: usize,
@@ -419,6 +462,7 @@
/// assert!(tv.is_heap());
/// assert!(tv.capacity() >= 5);
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_reserve(&mut self, n: usize) -> Result<(), TryReserveError> {
let arr = match self {
@@ -489,6 +533,7 @@
/// assert!(tv.is_heap());
/// assert!(tv.capacity() >= 5);
/// ```
+ #[inline]
#[cfg(feature = "rustc_1_57")]
pub fn try_reserve_exact(&mut self, n: usize) -> Result<(), TryReserveError> {
let arr = match self {
@@ -528,6 +573,65 @@
TinyVec::Heap(Vec::with_capacity(cap))
}
}
+
+ /// Converts a `TinyVec<[T; N]>` into a `Box<[T]>`.
+ ///
+ /// - For `TinyVec::Heap(Vec<T>)`, it takes the `Vec<T>` and converts it into
+ /// a `Box<[T]>` without heap reallocation.
+ /// - For `TinyVec::Inline(inner_data)`, it first converts the `inner_data` to
+ /// `Vec<T>`, then into a `Box<[T]>`. Requiring only a single heap
+ /// allocation.
+ ///
+ /// ## Example
+ ///
+ /// ```
+ /// use core::mem::size_of_val as mem_size_of;
+ /// use tinyvec::TinyVec;
+ ///
+ /// // Initialize TinyVec with 256 elements (exceeding inline capacity)
+ /// let v: TinyVec<[_; 128]> = (0u8..=255).collect();
+ ///
+ /// assert!(v.is_heap());
+ /// assert_eq!(mem_size_of(&v), 136); // mem size of TinyVec<[u8; N]>: N+8
+ /// assert_eq!(v.len(), 256);
+ ///
+ /// let boxed = v.into_boxed_slice();
+ /// assert_eq!(mem_size_of(&boxed), 16); // mem size of Box<[u8]>: 16 bytes (fat pointer)
+ /// assert_eq!(boxed.len(), 256);
+ /// ```
+ #[inline]
+ #[must_use]
+ pub fn into_boxed_slice(self) -> alloc::boxed::Box<[A::Item]> {
+ self.into_vec().into_boxed_slice()
+ }
+
+ /// Converts a `TinyVec<[T; N]>` into a `Vec<T>`.
+ ///
+ /// `v.into_vec()` is equivalent to `Into::<Vec<_>>::into(v)`.
+ ///
+ /// - For `TinyVec::Inline(_)`, `.into_vec()` **does not** offer a performance
+ /// advantage over `.to_vec()`.
+ /// - For `TinyVec::Heap(vec_data)`, `.into_vec()` will take `vec_data`
+ /// without heap reallocation.
+ ///
+ /// ## Example
+ ///
+ /// ```
+ /// use tinyvec::TinyVec;
+ ///
+ /// let v = TinyVec::from([0u8; 8]);
+ /// let v2 = v.clone();
+ ///
+ /// let vec = v.into_vec();
+ /// let vec2: Vec<_> = v2.into();
+ ///
+ /// assert_eq!(vec, vec2);
+ /// ```
+ #[inline]
+ #[must_use]
+ pub fn into_vec(self) -> Vec<A::Item> {
+ self.into()
+ }
}
impl<A: Array> TinyVec<A> {
@@ -1332,6 +1436,61 @@
}
}
+impl<A: Array> Into<Vec<A::Item>> for TinyVec<A> {
+ /// Converts a `TinyVec` into a `Vec`.
+ ///
+ /// ## Examples
+ ///
+ /// ### Inline to Vec
+ ///
+ /// For `TinyVec::Inline(_)`,
+ /// `.into()` **does not** offer a performance advantage over `.to_vec()`.
+ ///
+ /// ```
+ /// use core::mem::size_of_val as mem_size_of;
+ /// use tinyvec::TinyVec;
+ ///
+ /// let v = TinyVec::from([0u8; 128]);
+ /// assert_eq!(mem_size_of(&v), 136);
+ ///
+ /// let vec: Vec<_> = v.into();
+ /// assert_eq!(mem_size_of(&vec), 24);
+ /// ```
+ ///
+ /// ### Heap into Vec
+ ///
+ /// For `TinyVec::Heap(vec_data)`,
+ /// `.into()` will take `vec_data` without heap reallocation.
+ ///
+ /// ```
+ /// use core::{
+ /// any::type_name_of_val as type_of, mem::size_of_val as mem_size_of,
+ /// };
+ /// use tinyvec::TinyVec;
+ ///
+ /// const fn from_heap<T: Default>(owned: Vec<T>) -> TinyVec<[T; 1]> {
+ /// TinyVec::Heap(owned)
+ /// }
+ ///
+ /// let v = from_heap(vec![0u8; 128]);
+ /// assert_eq!(v.len(), 128);
+ /// assert_eq!(mem_size_of(&v), 24);
+ /// assert!(type_of(&v).ends_with("TinyVec<[u8; 1]>"));
+ ///
+ /// let vec: Vec<_> = v.into();
+ /// assert_eq!(mem_size_of(&vec), 24);
+ /// assert!(type_of(&vec).ends_with("Vec<u8>"));
+ /// ```
+ #[inline]
+ #[must_use]
+ fn into(self) -> Vec<A::Item> {
+ match self {
+ Self::Heap(inner) => inner,
+ Self::Inline(mut inner) => inner.drain_to_vec(),
+ }
+ }
+}
+
/// Iterator for consuming an `TinyVec` and returning owned elements.
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub enum TinyVecIterator<A: Array> {
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/arrayvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/arrayvec.rs
similarity index 95%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/arrayvec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/arrayvec.rs
index 518b6e0b..fa08273 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/arrayvec.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/arrayvec.rs
@@ -447,6 +447,28 @@
);
}
+#[cfg(feature = "borsh")]
+#[test]
+fn ArrayVec_borsh_de_empty() {
+ let tv: ArrayVec<[i32; 0]> = Default::default();
+ let buffer = borsh::to_vec(&tv).unwrap();
+ let des: ArrayVec<[i32; 0]> = borsh::from_slice(&buffer).unwrap();
+ assert_eq!(tv, des);
+}
+
+#[cfg(feature = "borsh")]
+#[test]
+fn ArrayVec_borsh_de() {
+ let mut tv: ArrayVec<[i32; 4]> = Default::default();
+ tv.push(1);
+ tv.push(2);
+ tv.push(3);
+ tv.push(4);
+ let buffer = borsh::to_vec(&tv).unwrap();
+ let des: ArrayVec<[i32; 4]> = borsh::from_slice(&buffer).unwrap();
+ assert_eq!(tv, des);
+}
+
#[test]
fn ArrayVec_try_from_slice() {
use std::convert::TryFrom;
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/debugger_visualizer.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/debugger_visualizer.rs
similarity index 100%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/debugger_visualizer.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/debugger_visualizer.rs
diff --git a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/tinyvec.rs b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/tinyvec.rs
similarity index 93%
rename from third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/tinyvec.rs
rename to third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/tinyvec.rs
index 32e2a01..fca78456 100644
--- a/third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/tests/tinyvec.rs
+++ b/third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/tests/tinyvec.rs
@@ -443,6 +443,39 @@
);
}
+#[cfg(feature = "borsh")]
+#[test]
+fn TinyVec_borsh_de_empty() {
+ let tv: ArrayVec<[i32; 0]> = Default::default();
+ let buffer = borsh::to_vec(&tv).unwrap();
+ let des: ArrayVec<[i32; 0]> = borsh::from_slice(&buffer).unwrap();
+ assert_eq!(tv, des);
+}
+
+#[cfg(feature = "borsh")]
+#[test]
+fn TinyVec_borsh_de() {
+ let mut tv: ArrayVec<[i32; 4]> = Default::default();
+ tv.push(1);
+ tv.push(2);
+ tv.push(3);
+ tv.push(4);
+ let buffer = borsh::to_vec(&tv).unwrap();
+ let des: ArrayVec<[i32; 4]> = borsh::from_slice(&buffer).unwrap();
+ assert_eq!(tv, des);
+}
+
+#[cfg(feature = "borsh")]
+#[test]
+fn TinyVec_borsh_de_heap() {
+ let mut tv: TinyVec<[i32; 4]> = tiny_vec![1, 2, 3, 4];
+ tv.move_to_the_heap();
+
+ let buffer = borsh::to_vec(&tv).unwrap();
+ let des: TinyVec<[i32; 4]> = borsh::from_slice(&buffer).unwrap();
+ assert_eq!(tv, des);
+}
+
#[test]
fn TinyVec_pretty_debug() {
let tv: TinyVec<[i32; 6]> = tiny_vec![1, 2, 3];
diff --git a/third_party/rust/tinyvec/v1/BUILD.gn b/third_party/rust/tinyvec/v1/BUILD.gn
index 2c7216c..d7b1f3f 100644
--- a/third_party/rust/tinyvec/v1/BUILD.gn
+++ b/third_party/rust/tinyvec/v1/BUILD.gn
@@ -13,22 +13,23 @@
epoch = "1"
crate_type = "rlib"
crate_root =
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs"
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/lib.rs"
sources = [
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/const_generic_impl.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/array/generated_impl.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/arrayvec_drain.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/lib.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/slicevec.rs",
- "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/src/tinyvec.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/const_generic_impl.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generated_impl.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/array/generic_array_impl.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/arrayvec_drain.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/lib.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/slicevec.rs",
+ "//third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/src/tinyvec.rs",
]
inputs = []
build_native_rust_unit_tests = false
edition = "2018"
- cargo_pkg_version = "1.8.1"
+ cargo_pkg_version = "1.9.0"
cargo_pkg_authors = "Lokathor <zefria@gmail.com>"
cargo_pkg_name = "tinyvec"
cargo_pkg_description =
diff --git a/third_party/rust/tinyvec/v1/README.chromium b/third_party/rust/tinyvec/v1/README.chromium
index ae0df96..ffdc5af 100644
--- a/third_party/rust/tinyvec/v1/README.chromium
+++ b/third_party/rust/tinyvec/v1/README.chromium
@@ -1,9 +1,9 @@
Name: tinyvec
URL: https://crates.io/crates/tinyvec
-Version: 1.8.1
-Revision: 659e6c1f1f683b7504e71b6773cf0cdb86b1faf3
+Version: 1.9.0
+Revision: f83214e657df4fea93be654859fcfe85687a1232
License: Apache-2.0
-License File: //third_party/rust/chromium_crates_io/vendor/tinyvec-1.8.1/LICENSE-APACHE.md
+License File: //third_party/rust/chromium_crates_io/vendor/tinyvec-1.9.0/LICENSE-APACHE.md
Shipped: yes
Security Critical: yes