Snap for 8189365 from 5239b81c12c1c7b178e6f2bcf6fb32bcb31fb19c to tm-frc-os-statsd-release
Change-Id: I05c6e68ed90d9fb34c786971c36e87576ee8590e
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 620b2af..29bac5d 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "b28da881695e3c66e1782f0c2c330d4e162eb7c2"
+ "sha1": "d346ad2d77b11855969b82c9d16bd78ec84e4863"
}
}
diff --git a/Android.bp b/Android.bp
index 18934f1..30cd03d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
-// Do not modify this file as changes will be overridden on upgrade.
+// This file is generated by cargo2android.py --run --dependencies --device.
package {
default_applicable_licenses: ["external_rust_crates_async-stream_license"],
@@ -22,8 +21,6 @@
name: "libasync_stream",
host_supported: true,
crate_name: "async_stream",
- cargo_env_compat: true,
- cargo_pkg_version: "0.3.2",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -31,3 +28,11 @@
],
proc_macros: ["libasync_stream_impl"],
}
+
+// dependent_library ["feature_list"]
+// async-stream-impl-0.3.0
+// futures-core-0.3.12 "alloc,default,std"
+// proc-macro2-1.0.24 "default,proc-macro"
+// quote-1.0.8 "default,proc-macro"
+// syn-1.0.60 "clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit-mut"
+// unicode-xid-0.2.1 "default"
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index bd7f60f..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 0.3.2
-
-* Expand `yield` in internal macro calls (#57)
-
-# 0.3.1
-
-* Support reexporting (#46)
-* Allow yielding `!Unpin` values (#50)
-* Implement `Stream::size_hint` method on `AsyncStream` (#40)
-* Documentation improvements
-
-# 0.3.0
-
-* Remove proc-macro-hack (#30)
diff --git a/Cargo.lock b/Cargo.lock
index 1cdf89d..d924233 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,20 +1,14 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+[[package]]
+name = "arc-swap"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]]
name = "async-stream"
version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3670df70cbc01729f901f94c887814b3c68db038aad1329a418bae178bc5295c"
-dependencies = [
- "async-stream-impl",
- "futures-core",
-]
-
-[[package]]
-name = "async-stream"
-version = "0.3.2"
dependencies = [
"async-stream-impl",
"futures-core",
@@ -26,9 +20,9 @@
[[package]]
name = "async-stream-impl"
-version = "0.3.2"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
+checksum = "a3548b8efc9f8e8a5a0a2808c5bd8451a9031b9e5b879a79590304ae928b0a70"
dependencies = [
"proc-macro2",
"quote",
@@ -36,12 +30,6 @@
]
[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
name = "bitflags"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -49,29 +37,50 @@
[[package]]
name = "bytes"
-version = "1.0.1"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
+checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "cfg-if"
-version = "1.0.0"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "fuchsia-zircon"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
+dependencies = [
+ "bitflags",
+ "fuchsia-zircon-sys",
+]
+
+[[package]]
+name = "fuchsia-zircon-sys"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures-core"
-version = "0.3.15"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1"
+checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-macro"
-version = "0.3.15"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121"
+checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
- "autocfg",
"proc-macro-hack",
"proc-macro2",
"quote",
@@ -80,21 +89,23 @@
[[package]]
name = "futures-task"
-version = "0.3.15"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae"
+checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
+dependencies = [
+ "once_cell",
+]
[[package]]
name = "futures-util"
-version = "0.3.15"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967"
+checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
- "autocfg",
"futures-core",
"futures-macro",
"futures-task",
- "pin-project-lite",
+ "pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
@@ -109,27 +120,37 @@
[[package]]
name = "hermit-abi"
-version = "0.1.18"
+version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
+checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
dependencies = [
"libc",
]
[[package]]
-name = "instant"
-version = "0.1.9"
+name = "iovec"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
+checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
- "cfg-if",
+ "libc",
]
[[package]]
name = "itoa"
-version = "0.4.7"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
+checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
+
+[[package]]
+name = "kernel32-sys"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
+dependencies = [
+ "winapi 0.2.8",
+ "winapi-build",
+]
[[package]]
name = "lazy_static"
@@ -139,63 +160,98 @@
[[package]]
name = "libc"
-version = "0.2.94"
+version = "0.2.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
-
-[[package]]
-name = "lock_api"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
-dependencies = [
- "scopeguard",
-]
+checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10"
[[package]]
name = "log"
-version = "0.4.14"
+version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
+checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
dependencies = [
"cfg-if",
]
[[package]]
name = "memchr"
-version = "2.4.0"
+version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
+checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
[[package]]
name = "mio"
-version = "0.7.11"
+version = "0.6.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956"
+checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
dependencies = [
+ "cfg-if",
+ "fuchsia-zircon",
+ "fuchsia-zircon-sys",
+ "iovec",
+ "kernel32-sys",
"libc",
"log",
- "miow",
- "ntapi",
- "winapi",
+ "miow 0.2.1",
+ "net2",
+ "slab",
+ "winapi 0.2.8",
+]
+
+[[package]]
+name = "mio-named-pipes"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656"
+dependencies = [
+ "log",
+ "mio",
+ "miow 0.3.5",
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "mio-uds"
+version = "0.6.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
+dependencies = [
+ "iovec",
+ "libc",
+ "mio",
]
[[package]]
name = "miow"
-version = "0.3.7"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
+checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
dependencies = [
- "winapi",
+ "kernel32-sys",
+ "net2",
+ "winapi 0.2.8",
+ "ws2_32-sys",
]
[[package]]
-name = "ntapi"
-version = "0.3.6"
+name = "miow"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
+checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e"
dependencies = [
- "winapi",
+ "socket2",
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "net2"
+version = "0.2.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "winapi 0.3.9",
]
[[package]]
@@ -210,40 +266,35 @@
[[package]]
name = "once_cell"
-version = "1.7.2"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3"
+checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
[[package]]
-name = "parking_lot"
-version = "0.11.1"
+name = "pin-project"
+version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
+checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core",
+ "pin-project-internal",
]
[[package]]
-name = "parking_lot_core"
-version = "0.8.3"
+name = "pin-project-internal"
+version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
+checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall",
- "smallvec",
- "winapi",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
name = "pin-project-lite"
-version = "0.2.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"
+checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
@@ -253,42 +304,39 @@
[[package]]
name = "proc-macro-hack"
-version = "0.5.19"
+version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
+checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
[[package]]
name = "proc-macro-nested"
-version = "0.1.7"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
+checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
[[package]]
name = "proc-macro2"
-version = "1.0.27"
+version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"
+checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
dependencies = [
"unicode-xid",
]
[[package]]
name = "quote"
-version = "1.0.9"
+version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
+checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2",
]
[[package]]
name = "redox_syscall"
-version = "0.2.8"
+version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc"
-dependencies = [
- "bitflags",
-]
+checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "ryu"
@@ -297,25 +345,19 @@
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
name = "serde"
-version = "1.0.126"
+version = "1.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03"
+checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.126"
+version = "1.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43"
+checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e"
dependencies = [
"proc-macro2",
"quote",
@@ -324,9 +366,9 @@
[[package]]
name = "serde_json"
-version = "1.0.64"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
+checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
dependencies = [
"itoa",
"ryu",
@@ -335,30 +377,37 @@
[[package]]
name = "signal-hook-registry"
-version = "1.3.0"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6"
+checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
dependencies = [
+ "arc-swap",
"libc",
]
[[package]]
name = "slab"
-version = "0.4.3"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
+checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
[[package]]
-name = "smallvec"
-version = "1.6.1"
+name = "socket2"
+version = "0.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
+checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "winapi 0.3.9",
+]
[[package]]
name = "syn"
-version = "1.0.72"
+version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
+checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
dependencies = [
"proc-macro2",
"quote",
@@ -367,38 +416,42 @@
[[package]]
name = "termcolor"
-version = "1.1.2"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
+checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
dependencies = [
"winapi-util",
]
[[package]]
name = "tokio"
-version = "1.6.0"
+version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd3076b5c8cc18138b8f8814895c11eb4de37114a5d127bafdc5e55798ceef37"
+checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
- "autocfg",
"bytes",
+ "fnv",
+ "futures-core",
+ "iovec",
+ "lazy_static",
"libc",
"memchr",
"mio",
+ "mio-named-pipes",
+ "mio-uds",
"num_cpus",
- "once_cell",
- "parking_lot",
"pin-project-lite",
"signal-hook-registry",
+ "slab",
"tokio-macros",
- "winapi",
+ "winapi 0.3.9",
]
[[package]]
name = "tokio-macros"
-version = "1.2.0"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37"
+checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2",
"quote",
@@ -406,43 +459,30 @@
]
[[package]]
-name = "tokio-stream"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066"
-dependencies = [
- "futures-core",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
name = "tokio-test"
-version = "0.4.2"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53474327ae5e166530d17f2d956afcb4f8a004de581b3cae10f12006bc8163e3"
+checksum = "ed0049c119b6d505c4447f5c64873636c7af6c75ab0d45fd9f618d82acb8016d"
dependencies = [
- "async-stream 0.3.0",
"bytes",
"futures-core",
"tokio",
- "tokio-stream",
]
[[package]]
name = "toml"
-version = "0.5.8"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
+checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
dependencies = [
"serde",
]
[[package]]
name = "trybuild"
-version = "1.0.42"
+version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1768998d9a3b179411618e377dbb134c58a88cda284b0aa71c42c40660127d46"
+checksum = "7a4d94e6adf00b96b1ab94fcfcd8c3cf916733b39adf90c8f72693629887b9b8"
dependencies = [
"glob",
"lazy_static",
@@ -454,9 +494,15 @@
[[package]]
name = "unicode-xid"
-version = "0.2.2"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
+checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+
+[[package]]
+name = "winapi"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
[[package]]
name = "winapi"
@@ -469,6 +515,12 @@
]
[[package]]
+name = "winapi-build"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
+
+[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -480,7 +532,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
- "winapi",
+ "winapi 0.3.9",
]
[[package]]
@@ -488,3 +540,13 @@
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "ws2_32-sys"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
+dependencies = [
+ "winapi 0.2.8",
+ "winapi-build",
+]
diff --git a/Cargo.toml b/Cargo.toml
index a2d9ba7..39573bd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,16 +13,16 @@
[package]
edition = "2018"
name = "async-stream"
-version = "0.3.2"
+version = "0.3.0"
authors = ["Carl Lerche <[email protected]>"]
description = "Asynchronous streams using async & await notation"
homepage = "https://github.com/tokio-rs/async-stream"
-documentation = "https://docs.rs/async-stream"
+documentation = "https://docs.rs/async-stream/0.3.0/async-stream"
readme = "README.md"
license = "MIT"
repository = "https://github.com/tokio-rs/async-stream"
[dependencies.async-stream-impl]
-version = "=0.3.2"
+version = "0.3.0"
[dependencies.futures-core]
version = "0.3"
@@ -30,11 +30,11 @@
version = "0.3"
[dev-dependencies.tokio]
-version = "1"
+version = "0.2"
features = ["full"]
[dev-dependencies.tokio-test]
-version = "0.4"
+version = "0.2"
[dev-dependencies.trybuild]
version = "1"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 06ccf45..aca3396 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -2,25 +2,29 @@
name = "async-stream"
# When releasing to crates.io:
# - Update version number
+# - lib.rs: html_root_url.
# - README.md
# - Update CHANGELOG.md
+# - Update doc URL.
+# - Cargo.toml
+# - README.md
# - Create git tag
-version = "0.3.2"
+version = "0.3.0"
edition = "2018"
license = "MIT"
authors = ["Carl Lerche <[email protected]>"]
description = "Asynchronous streams using async & await notation"
-documentation = "https://docs.rs/async-stream"
+documentation = "https://docs.rs/async-stream/0.3.0/async-stream"
homepage = "https://github.com/tokio-rs/async-stream"
repository = "https://github.com/tokio-rs/async-stream"
readme = "README.md"
[dependencies]
-async-stream-impl = { version = "=0.3.2", path = "../async-stream-impl" }
+async-stream-impl = { version = "0.3.0", path = "../async-stream-impl" }
futures-core = "0.3"
[dev-dependencies]
futures-util = "0.3"
-tokio = { version = "1", features = ["full"] }
-tokio-test = "0.4"
+tokio = { version = "0.2", features = ["full"] }
+tokio-test = "0.2"
trybuild = "1"
diff --git a/METADATA b/METADATA
index 0ad5312..062a50f 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/async-stream/async-stream-0.3.2.crate"
+ value: "https://static.crates.io/crates/async-stream/async-stream-0.3.0.crate"
}
- version: "0.3.2"
+ version: "0.3.0"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 6
- day: 21
+ month: 2
+ day: 8
}
}
diff --git a/README.md b/README.md
index 77c7739..dd36923 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
Provides two macros, `stream!` and `try_stream!`, allowing the caller to
define asynchronous streams of elements. These are implemented using `async`
-& `await` notation. This crate works without unstable features.
+& `await` notation. The `stream!` macro works without unstable features.
The `stream!` macro returns an anonymous type implementing the [`Stream`]
trait. The `Item` associated type is the type of the values yielded from the
@@ -68,8 +68,7 @@
}
```
-Streams may be implemented in terms of other streams - `async-stream` provides `for await`
-syntax to assist with this:
+Streams may be implemented in terms of other streams:
```rust
use async_stream::stream;
@@ -90,7 +89,8 @@
-> impl Stream<Item = u32>
{
stream! {
- for await value in input {
+ pin_mut!(input);
+ while let Some(value) = input.next().await {
yield value * 2;
}
}
@@ -124,7 +124,7 @@
-> impl Stream<Item = io::Result<TcpStream>>
{
try_stream! {
- let mut listener = TcpListener::bind(addr).await?;
+ let mut listener = TcpListener::bind(&addr)?;
loop {
let (stream, addr) = listener.accept().await?;
@@ -138,7 +138,9 @@
## Implementation
The `stream!` and `try_stream!` macros are implemented using proc macros.
-The macro searches the syntax tree for instances of `sender.send($expr)` and
+Given that proc macros in expression position are not supported on stable
+rust, a hack similar to the one provided by the [`proc-macro-hack`] crate is
+used. The macro searches the syntax tree for instances of `sender.send($expr)` and
transforms them into `sender.send($expr).await`.
The stream uses a lightweight sender to send values from the stream
@@ -148,10 +150,17 @@
`sender.send(value)` stores the value that cell and yields back to the
caller.
-[`Stream`]: https://docs.rs/futures-core/*/futures_core/stream/trait.Stream.html
+## Limitations
-## Supported Rust Versions
-`async-stream` is built against the latest stable release. The minimum supported version is 1.45 due to [function-like procedural macros in expression, pattern, and statement positions](https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html#stabilizing-function-like-procedural-macros-in-expressions-patterns-and-statements).
+`async-stream` suffers from the same limitations as the [`proc-macro-hack`]
+crate. Primarily, nesting support must be implemented using a `TT-muncher`.
+If large `stream!` blocks are used, the caller will be required to add
+`#![recursion_limit = "..."]` to their crate.
+
+A `stream!` macro may only contain up to 64 macro invocations.
+
+[`Stream`]: https://docs.rs/futures-core/*/futures_core/stream/trait.Stream.html
+[`proc-macro-hack`]: https://github.com/dtolnay/proc-macro-hack/
## License
diff --git a/TEST_MAPPING b/TEST_MAPPING
deleted file mode 100644
index dfc3524..0000000
--- a/TEST_MAPPING
+++ /dev/null
@@ -1,11 +0,0 @@
-// Generated by update_crate_tests.py for tests that depend on this crate.
-{
- "imports": [
- {
- "path": "external/rust/crates/tokio"
- },
- {
- "path": "external/rust/crates/tokio-test"
- }
- ]
-}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index bf78496..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "device": true,
- "run": true
-}
\ No newline at end of file
diff --git a/examples/tcp_accept.rs b/examples/tcp_accept.rs
index 1b69bda..023e1a1 100644
--- a/examples/tcp_accept.rs
+++ b/examples/tcp_accept.rs
@@ -5,7 +5,7 @@
#[tokio::main]
async fn main() {
- let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
+ let mut listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let incoming = stream! {
loop {
diff --git a/src/async_stream.rs b/src/async_stream.rs
index f60c87e..30115df 100644
--- a/src/async_stream.rs
+++ b/src/async_stream.rs
@@ -66,12 +66,4 @@
}
}
}
-
- fn size_hint(&self) -> (usize, Option<usize>) {
- if self.done {
- (0, Some(0))
- } else {
- (0, None)
- }
- }
}
diff --git a/src/lib.rs b/src/lib.rs
index d2c78f9..9906677 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,4 @@
+#![doc(html_root_url = "https://docs.rs/async-stream/0.3.0")]
#![warn(
missing_debug_implementations,
missing_docs,
@@ -10,7 +11,7 @@
//!
//! Provides two macros, `stream!` and `try_stream!`, allowing the caller to
//! define asynchronous streams of elements. These are implemented using `async`
-//! & `await` notation. This crate works without unstable features.
+//! & `await` notation. The `stream!` macro works without unstable features.
//!
//! The `stream!` macro returns an anonymous type implementing the [`Stream`]
//! trait. The `Item` associated type is the type of the values yielded from the
@@ -74,8 +75,7 @@
//! }
//! ```
//!
-//! Streams may be implemented in terms of other streams - `async-stream` provides `for await`
-//! syntax to assist with this:
+//! Streams may be implemented in terms of other streams:
//!
//! ```rust
//! use async_stream::stream;
@@ -96,7 +96,8 @@
//! -> impl Stream<Item = u32>
//! {
//! stream! {
-//! for await value in input {
+//! pin_mut!(input);
+//! while let Some(value) = input.next().await {
//! yield value * 2;
//! }
//! }
@@ -144,7 +145,9 @@
//! # Implementation
//!
//! The `stream!` and `try_stream!` macros are implemented using proc macros.
-//! The macro searches the syntax tree for instances of `sender.send($expr)` and
+//! Given that proc macros in expression position are not supported on stable
+//! rust, a hack similar to the one provided by the [`proc-macro-hack`] crate is
+//! used. The macro searches the syntax tree for instances of `sender.send($expr)` and
//! transforms them into `sender.send($expr).await`.
//!
//! The stream uses a lightweight sender to send values from the stream
@@ -161,82 +164,11 @@
#[doc(hidden)]
pub mod yielder;
-// Used by the macro, but not intended to be accessed publicly.
+// Used by the macro, but not intended to be accessed publically.
#[doc(hidden)]
pub use crate::async_stream::AsyncStream;
-#[doc(hidden)]
-pub use async_stream_impl;
-
-/// Asynchronous stream
-///
-/// See [crate](index.html) documentation for more details.
-///
-/// # Examples
-///
-/// ```
-/// use async_stream::stream;
-///
-/// use futures_util::pin_mut;
-/// use futures_util::stream::StreamExt;
-///
-/// #[tokio::main]
-/// async fn main() {
-/// let s = stream! {
-/// for i in 0..3 {
-/// yield i;
-/// }
-/// };
-///
-/// pin_mut!(s); // needed for iteration
-///
-/// while let Some(value) = s.next().await {
-/// println!("got {}", value);
-/// }
-/// }
-/// ```
-#[macro_export]
-macro_rules! stream {
- ($($tt:tt)*) => {
- $crate::async_stream_impl::stream_inner!(($crate) $($tt)*)
- }
-}
-
-/// Asynchronous fallible stream
-///
-/// See [crate](index.html) documentation for more details.
-///
-/// # Examples
-///
-/// ```
-/// use tokio::net::{TcpListener, TcpStream};
-///
-/// use async_stream::try_stream;
-/// use futures_core::stream::Stream;
-///
-/// use std::io;
-/// use std::net::SocketAddr;
-///
-/// fn bind_and_accept(addr: SocketAddr)
-/// -> impl Stream<Item = io::Result<TcpStream>>
-/// {
-/// try_stream! {
-/// let mut listener = TcpListener::bind(addr).await?;
-///
-/// loop {
-/// let (stream, addr) = listener.accept().await?;
-/// println!("received on {:?}", addr);
-/// yield stream;
-/// }
-/// }
-/// }
-/// ```
-#[macro_export]
-macro_rules! try_stream {
- ($($tt:tt)*) => {
- $crate::async_stream_impl::try_stream_inner!(($crate) $($tt)*)
- }
-}
+pub use async_stream_impl::{stream, try_stream};
#[doc(hidden)]
pub mod reexport {
diff --git a/src/yielder.rs b/src/yielder.rs
index 1ee523f..49c4133 100644
--- a/src/yielder.rs
+++ b/src/yielder.rs
@@ -33,7 +33,7 @@
// ===== impl Sender =====
-impl<T> Sender<T> {
+impl<T: Unpin> Sender<T> {
pub fn send(&mut self, value: T) -> impl Future<Output = ()> {
Send { value: Some(value) }
}
@@ -43,9 +43,7 @@
value: Option<T>,
}
-impl<T> Unpin for Send<T> {}
-
-impl<T> Future for Send<T> {
+impl<T: Unpin> Future for Send<T> {
type Output = ();
fn poll(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()> {
diff --git a/tests/stream.rs b/tests/stream.rs
index 77b3813..e46fc5a 100644
--- a/tests/stream.rs
+++ b/tests/stream.rs
@@ -81,42 +81,6 @@
}
#[tokio::test]
-async fn unit_yield_in_select() {
- use tokio::select;
-
- async fn do_stuff_async() {}
-
- let s = stream! {
- select! {
- _ = do_stuff_async() => yield,
- else => yield,
- }
- };
-
- let values: Vec<_> = s.collect().await;
- assert_eq!(values.len(), 1);
-}
-
-#[tokio::test]
-async fn yield_with_select() {
- use tokio::select;
-
- async fn do_stuff_async() {}
- async fn more_async_work() {}
-
- let s = stream! {
- select! {
- _ = do_stuff_async() => yield "hey",
- _ = more_async_work() => yield "hey",
- else => yield "hey",
- }
- };
-
- let values: Vec<_> = s.collect().await;
- assert_eq!(values, vec!["hey"]);
-}
-
-#[tokio::test]
async fn return_stream() {
fn build_stream() -> impl Stream<Item = u32> {
stream! {
@@ -137,7 +101,7 @@
#[tokio::test]
async fn consume_channel() {
- let (tx, mut rx) = mpsc::channel(10);
+ let (mut tx, mut rx) = mpsc::channel(10);
let s = stream! {
while let Some(v) = rx.recv().await {
@@ -194,41 +158,6 @@
assert_eq!(3, values.len());
}
-#[tokio::test]
-async fn yield_non_unpin_value() {
- let s: Vec<_> = stream! {
- for i in 0..3 {
- yield async move { i };
- }
- }
- .buffered(1)
- .collect()
- .await;
-
- assert_eq!(s, vec![0, 1, 2]);
-}
-
-#[test]
-fn inner_try_stream() {
- use async_stream::try_stream;
- use tokio::select;
-
- async fn do_stuff_async() {}
-
- let _ = stream! {
- select! {
- _ = do_stuff_async() => {
- let another_s = try_stream! {
- yield;
- };
- let _: Result<(), ()> = Box::pin(another_s).next().await.unwrap();
- },
- else => {},
- }
- yield
- };
-}
-
#[test]
fn test() {
let t = trybuild::TestCases::new();
diff --git a/tests/ui/yield_bad_expr_in_macro.rs b/tests/ui/yield_bad_expr_in_macro.rs
deleted file mode 100644
index 37fcd34..0000000
--- a/tests/ui/yield_bad_expr_in_macro.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-use async_stream::stream;
-
-fn main() {
- async fn work() {}
-
- stream! {
- tokio::select! {
- _ = work() => yield fn f() {},
- }
- };
-}
diff --git a/tests/ui/yield_bad_expr_in_macro.stderr b/tests/ui/yield_bad_expr_in_macro.stderr
deleted file mode 100644
index 71d9075..0000000
--- a/tests/ui/yield_bad_expr_in_macro.stderr
+++ /dev/null
@@ -1,5 +0,0 @@
-error: expected expression
- --> $DIR/yield_bad_expr_in_macro.rs:8:33
- |
-8 | _ = work() => yield fn f() {},
- | ^^
diff --git a/tests/ui/yield_in_async.stderr b/tests/ui/yield_in_async.stderr
index 19691eb..1e9d8ff 100644
--- a/tests/ui/yield_in_async.stderr
+++ b/tests/ui/yield_in_async.stderr
@@ -12,7 +12,7 @@
6 | yield 123;
| ^^^^^^^^^
-error[E0271]: type mismatch resolving `<[static generator@$DIR/src/lib.rs:201:9: 201:67] as Generator<ResumeTy>>::Yield == ()`
+error[E0271]: type mismatch resolving `<[static generator@$DIR/tests/ui/yield_in_async.rs:4:5: 10:7 _] as std::ops::Generator<std::future::ResumeTy>>::Yield == ()`
--> $DIR/yield_in_async.rs:4:5
|
4 | / stream! {
@@ -23,8 +23,6 @@
9 | | let v = f.await;
10 | | };
| |______^ expected `()`, found integer
- |
- = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0698]: type inside `async` block must be known in this context
--> $DIR/yield_in_async.rs:6:19
@@ -73,3 +71,6 @@
|
9 | let v = f.await;
| ^^^^^^^
+
+Some errors have detailed explanations: E0271, E0658, E0698, E0727.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/yield_in_closure.stderr b/tests/ui/yield_in_closure.stderr
index 2506e18..77092e0 100644
--- a/tests/ui/yield_in_closure.stderr
+++ b/tests/ui/yield_in_closure.stderr
@@ -6,13 +6,13 @@
|
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
-error[E0277]: expected a `FnOnce<(&str,)>` closure, found `[generator@$DIR/src/lib.rs:201:9: 201:67]`
+error[E0277]: expected a `std::ops::FnOnce<(&str,)>` closure, found `[generator@$DIR/tests/ui/yield_in_closure.rs:4:5: 10:7 _]`
--> $DIR/yield_in_closure.rs:6:14
|
6 | .and_then(|v| {
- | ^^^^^^^^ expected an `FnOnce<(&str,)>` closure, found `[generator@$DIR/src/lib.rs:201:9: 201:67]`
+ | ^^^^^^^^ expected an `FnOnce<(&str,)>` closure, found `[generator@$DIR/tests/ui/yield_in_closure.rs:4:5: 10:7 _]`
|
- = help: the trait `FnOnce<(&str,)>` is not implemented for `[generator@$DIR/src/lib.rs:201:9: 201:67]`
+ = help: the trait `std::ops::FnOnce<(&str,)>` is not implemented for `[generator@$DIR/tests/ui/yield_in_closure.rs:4:5: 10:7 _]`
Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.