[rust] Bump crossbeam to 0.5.0

This also indirectly:

* adds arrayvec 0.4.8
* adds crossbeam-channel 0.3.2
* adds crossbeam-deque 0.6.2
* adds crossbeam-epoch 0.6.1
* adds crossbeam-utils 0.6.1
* adds memoffset 0.2.1
* adds nodrop 0.1.13

OSRB-91 #comment

Change-Id: I28874b67bad3b563e65044bc910f689494d875f7
diff --git a/rustc_deps/Cargo.lock b/rustc_deps/Cargo.lock
index bffc2ea..c16a501 100644
--- a/rustc_deps/Cargo.lock
+++ b/rustc_deps/Cargo.lock
@@ -25,6 +25,14 @@
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
+name = "arrayvec"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "ascii"
 version = "0.8.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -237,6 +245,63 @@
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
+name = "crossbeam"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-channel 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-deque 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "crossbeam-channel"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smallvec 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "deflate"
 version = "0.7.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -409,7 +474,7 @@
  "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "font-rs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -730,6 +795,11 @@
 ]
 
 [[package]]
+name = "memoffset"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
 name = "mime"
 version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -794,6 +864,11 @@
 ]
 
 [[package]]
+name = "nodrop"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
 name = "nom"
 version = "3.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1652,6 +1727,7 @@
 "checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
 "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
+"checksum arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"
 "checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14"
 "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2"
 "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
@@ -1680,6 +1756,11 @@
 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
 "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
 "checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19"
+"checksum crossbeam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d1c92ff2d7a202d592f5a412d75cf421495c913817781c1cb383bf12a77e185f"
+"checksum crossbeam-channel 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0ac88e108fa40799b39c08eb2a93bedf4cc99a9e5577f08ddf6dd6134ae65bf0"
+"checksum crossbeam-deque 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe1b6f945f824c7a25afe44f62e25d714c0cc523f8e99d8db5cd1026e1269d3"
+"checksum crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2449aaa4ec7ef96e5fb24db16024b935df718e9ae1cec0a1e68feeca2efca7b8"
+"checksum crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c55913cc2799171a550e307918c0a360e8c16004820291bf3b638969b4a01816"
 "checksum deflate 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6abb26e16e8d419b5c78662aa9f82857c2386a073da266840e474d5055ec86"
 "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
 "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90"
@@ -1730,12 +1811,14 @@
 "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
 "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
 "checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
+"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
 "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
 "checksum mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2d4c0961143b8efdcfa29c3ae63281601b446a4a668165454b6c90f8024954c5"
 "checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
 "checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"
 "checksum multipart 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92f54eb45230c3aa20864ccf0c277eeaeadcf5e437e91731db498dbf7fbe0ec6"
 "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
+"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
 "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
 "checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db"
 "checksum num-bigint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "10b8423ea72ec64751198856a853e07b37087cfc9b53a87ecb19bff67b6d1320"
diff --git a/rustc_deps/Cargo.toml b/rustc_deps/Cargo.toml
index 2f79c39..7481e21 100644
--- a/rustc_deps/Cargo.toml
+++ b/rustc_deps/Cargo.toml
@@ -18,7 +18,7 @@
 cc = "1"
 chrono = "0.4.2"
 clap = "2.29"
-crossbeam = "0.3.2"
+crossbeam = "0.5"
 euclid = "0.19"
 failure = "0.1.1"
 font-rs = "0.1.3"
diff --git a/rustc_deps/vendor/arrayvec/.cargo-checksum.json b/rustc_deps/vendor/arrayvec/.cargo-checksum.json
new file mode 100644
index 0000000..ac3a781
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"8489a80e2c8f85af127cf5f81490afdbd9a1a92e6adb4bd0d0e112f11b0ee255","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0245ee104228a100ce5fceecf43e25faae450494d9173f43fd94c27d69fdac13","README.rst":"0fff4f60a0d29213383df11c0293c31967024f71a5f0c2dd669d6464eb3ac24e","benches/arraystring.rs":"f12b890977117ebde4ca42bcd6b91f2a6a087f2b235aaca6d15e30d125ae9f67","benches/extend.rs":"8c8f78df7e90b62c7e160cf5ea6c61b90bc4035a9704b6a179a1e01d8fafe2e9","custom.css":"e6f2cd299392337b4e2959c52f422e5b7be11920ea98d10db44d10ddef5ed47c","src/array.rs":"67fb063ee515bfd4968ede219dff81091a5935ef93529ebd1bb2a716ea3ed3d3","src/array_string.rs":"af240c1194725e382e8d21e07ccb9aa5e9b18f6160c207d8b587002e812bae51","src/char.rs":"64a08f6a743b67bf2c96483f91c2fdaea79f6e91df5cd752f770b16a6b1d5b1e","src/errors.rs":"dde99bffaddfd45396aab7e07642cc018ef5435fe60c4f26a2c05a36555be18c","src/lib.rs":"2fdaa915a35cfb2c663f273a8d9cf8d9c088067336fdbd761fdd48b4b0e7af98","src/range.rs":"65744ab7def208a1ab155ea2448fe9ea7fc14f33211361b1041f540125b32efd","tests/serde.rs":"ef3986a82656b09f3fbb14358e767051ffabe09592c61e69ea695cb88760e8ba","tests/tests.rs":"9a68b834df6069e4b036e2358c4055f1a24b14c4391fdfb6c21c5cc26b639ec5"},"package":"f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"}
\ No newline at end of file
diff --git a/rustc_deps/vendor/arrayvec/Cargo.toml b/rustc_deps/vendor/arrayvec/Cargo.toml
new file mode 100644
index 0000000..ace1414
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/Cargo.toml
@@ -0,0 +1,59 @@
+# 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 believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "arrayvec"
+version = "0.4.8"
+authors = ["bluss"]
+description = "A vector with fixed capacity, backed by an array (it can be stored on the stack too). Implements fixed capacity ArrayVec and ArrayString."
+documentation = "https://docs.rs/arrayvec/"
+keywords = ["stack", "vector", "array", "data-structure", "no_std"]
+categories = ["data-structures", "no-std"]
+license = "MIT/Apache-2.0"
+repository = "https://github.com/bluss/arrayvec"
+[package.metadata.docs.rs]
+features = ["serde-1"]
+
+[package.metadata.release]
+no-dev-version = true
+
+[[bench]]
+name = "extend"
+harness = false
+
+[[bench]]
+name = "arraystring"
+harness = false
+[dependencies.nodrop]
+version = "0.1.12"
+default-features = false
+
+[dependencies.serde]
+version = "1.0"
+optional = true
+default-features = false
+[dev-dependencies.bencher]
+version = "0.1.4"
+
+[dev-dependencies.matches]
+version = "0.1"
+
+[dev-dependencies.serde_test]
+version = "1.0"
+
+[features]
+array-sizes-129-255 = []
+array-sizes-33-128 = []
+default = ["std"]
+serde-1 = ["serde"]
+std = []
+use_union = []
diff --git a/rustc_deps/vendor/arrayvec/LICENSE-APACHE b/rustc_deps/vendor/arrayvec/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/LICENSE-APACHE
@@ -0,0 +1,201 @@
+                              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/rustc_deps/vendor/arrayvec/LICENSE-MIT b/rustc_deps/vendor/arrayvec/LICENSE-MIT
new file mode 100644
index 0000000..2c8f27d
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) Ulrik Sverdrup "bluss" 2015-2017
+
+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/rustc_deps/vendor/arrayvec/README.rst b/rustc_deps/vendor/arrayvec/README.rst
new file mode 100644
index 0000000..0de5000
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/README.rst
@@ -0,0 +1,193 @@
+
+arrayvec
+========
+
+A vector with fixed capacity.
+
+Please read the `API documentation here`__
+
+__ https://docs.rs/arrayvec
+
+|build_status|_ |crates|_ |crates2|_
+
+.. |build_status| image:: https://travis-ci.org/bluss/arrayvec.svg
+.. _build_status: https://travis-ci.org/bluss/arrayvec
+
+.. |crates| image:: http://meritbadge.herokuapp.com/arrayvec
+.. _crates: https://crates.io/crates/arrayvec
+
+.. |crates2| image:: http://meritbadge.herokuapp.com/nodrop
+.. _crates2: https://crates.io/crates/nodrop
+
+Recent Changes (arrayvec)
+-------------------------
+
+- 0.4.8
+
+  - Implement Clone and Debug for ``IntoIter`` by @clarcharr
+  - Add more array sizes under crate features. These cover all in the range
+    up to 128 and 129 to 255 respectively (we have a few of those by default):
+
+    - ``array-size-33-128``
+    - ``array-size-129-255``
+
+- 0.4.7
+
+  - Fix future compat warning about raw pointer casts
+  - Use ``drop_in_place`` when dropping the arrayvec by-value iterator
+  - Decrease mininum Rust version (see docs) by @jeehoonkang
+
+- 0.3.25
+
+  - Fix future compat warning about raw pointer casts
+
+- 0.4.6
+
+  - Fix compilation on 16-bit targets. This means, the 65536 array size is not
+    included on these targets.
+
+- 0.3.24
+
+  - Fix compilation on 16-bit targets. This means, the 65536 array size is not
+    included on these targets.
+  - Fix license files so that they are both included (was fixed in 0.4 before)
+
+- 0.4.5
+
+  - Add methods to ``ArrayString`` by @DenialAdams:
+
+    - ``.pop() -> Option<char>``
+    - ``.truncate(new_len)``
+    - ``.remove(index) -> char``
+
+  - Remove dependency on crate odds
+  - Document debug assertions in unsafe methods better
+
+- 0.4.4
+
+  - Add method ``ArrayVec::truncate()`` by @niklasf
+
+- 0.4.3
+
+  - Improve performance for ``ArrayVec::extend`` with a lower level
+    implementation (#74)
+  - Small cleanup in dependencies (use no std for crates where we don't need more)
+
+- 0.4.2
+
+  - Add constructor method ``new`` to ``CapacityError``.
+
+- 0.4.1
+
+  - Add ``Default`` impl to ``ArrayString`` by @tbu-
+
+- 0.4.0
+
+  - Reformed signatures and error handling by @bluss and @tbu-:
+
+    - ``ArrayVec``'s ``push, insert, remove, swap_remove`` now match ``Vec``'s
+      corresponding signature and panic on capacity errors where applicable.
+    - Add fallible methods ``try_push, insert`` and checked methods
+      ``pop_at, swap_pop``.
+    - Similar changes to ``ArrayString``'s push methods.
+
+  - Use a local version of the ``RangeArgument`` trait
+  - Add array sizes 50, 150, 200 by @daboross
+  - Support serde 1.0 by @daboross
+  - New method ``.push_unchecked()`` by @niklasf
+  - ``ArrayString`` implements ``PartialOrd, Ord`` by @tbu-
+  - Require Rust 1.14
+  - crate feature ``use_generic_array`` was dropped.
+
+- 0.3.23
+
+  - Implement ``PartialOrd, Ord`` as well as ``PartialOrd<str>`` for
+    ``ArrayString``.
+
+- 0.3.22
+
+  - Implement ``Array`` for the 65536 size
+
+- 0.3.21
+
+  - Use ``encode_utf8`` from crate odds
+  - Add constructor ``ArrayString::from_byte_string``
+
+- 0.3.20
+
+  - Simplify and speed up ``ArrayString``’s ``.push(char)``-
+
+- 0.3.19
+
+  - Add new crate feature ``use_generic_array`` which allows using their
+    ``GenericArray`` just like a regular fixed size array for the storage
+    of an ``ArrayVec``.
+
+- 0.3.18
+
+  - Fix bounds check in ``ArrayVec::insert``!
+    It would be buggy if ``self.len() < index < self.capacity()``. Take note of
+    the push out behavior specified in the docs.
+
+- 0.3.17
+
+  - Added crate feature ``use_union`` which forwards to the nodrop crate feature
+  - Added methods ``.is_full()`` to ``ArrayVec`` and ``ArrayString``.
+
+- 0.3.16
+
+  - Added method ``.retain()`` to ``ArrayVec``.
+  - Added methods ``.as_slice(), .as_mut_slice()`` to ``ArrayVec`` and ``.as_str()``
+    to ``ArrayString``.
+
+- 0.3.15
+
+  - Add feature std, which you can opt out of to use ``no_std`` (requires Rust 1.6
+    to opt out).
+  - Implement ``Clone::clone_from`` for ArrayVec and ArrayString
+
+- 0.3.14
+
+  - Add ``ArrayString::from(&str)``
+
+- 0.3.13
+
+  - Added ``DerefMut`` impl for ``ArrayString``.
+  - Added method ``.simplify()`` to drop the element for ``CapacityError``.
+  - Added method ``.dispose()`` to ``ArrayVec``
+
+- 0.3.12
+
+  - Added ArrayString, a fixed capacity analogy of String
+
+- 0.3.11
+
+  - Added trait impls Default, PartialOrd, Ord, Write for ArrayVec
+
+- 0.3.10
+
+  - Go back to using external NoDrop, fixing a panic safety bug (issue #3)
+
+- 0.3.8
+
+  - Inline the non-dropping logic to remove one drop flag in the
+    ArrayVec representation.
+
+- 0.3.7
+
+  - Added method .into_inner()
+  - Added unsafe method .set_len()
+
+
+License
+=======
+
+Dual-licensed to be compatible with the Rust project.
+
+Licensed under the Apache License, Version 2.0
+http://www.apache.org/licenses/LICENSE-2.0 or the MIT license
+http://opensource.org/licenses/MIT, at your
+option. This file may not be copied, modified, or distributed
+except according to those terms.
+
+
diff --git a/rustc_deps/vendor/arrayvec/benches/arraystring.rs b/rustc_deps/vendor/arrayvec/benches/arraystring.rs
new file mode 100644
index 0000000..9cff587
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/benches/arraystring.rs
@@ -0,0 +1,90 @@
+
+extern crate arrayvec;
+#[macro_use] extern crate bencher;
+
+use arrayvec::ArrayString;
+
+use bencher::Bencher;
+
+fn try_push_c(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    b.iter(|| {
+        v.clear();
+        while v.try_push('c').is_ok() {
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn try_push_alpha(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    b.iter(|| {
+        v.clear();
+        while v.try_push('α').is_ok() {
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+// Yes, pushing a string char-by-char is slow. Use .push_str.
+fn try_push_string(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    let input = "abcαβγ“”";
+    b.iter(|| {
+        v.clear();
+        for ch in input.chars().cycle() {
+            if !v.try_push(ch).is_ok() {
+                break;
+            }
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn push_c(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    b.iter(|| {
+        v.clear();
+        while !v.is_full() {
+            v.push('c');
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn push_alpha(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    b.iter(|| {
+        v.clear();
+        while !v.is_full() {
+            v.push('α');
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn push_string(b: &mut Bencher) {
+    let mut v = ArrayString::<[u8; 512]>::new();
+    let input = "abcαβγ“”";
+    b.iter(|| {
+        v.clear();
+        for ch in input.chars().cycle() {
+            if !v.is_full() {
+                v.push(ch);
+            } else {
+                break;
+            }
+        }
+        v.len()
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+benchmark_group!(benches, try_push_c, try_push_alpha, try_push_string, push_c,
+                 push_alpha, push_string);
+benchmark_main!(benches);
diff --git a/rustc_deps/vendor/arrayvec/benches/extend.rs b/rustc_deps/vendor/arrayvec/benches/extend.rs
new file mode 100644
index 0000000..d380a7e
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/benches/extend.rs
@@ -0,0 +1,43 @@
+
+extern crate arrayvec;
+#[macro_use] extern crate bencher;
+
+use arrayvec::ArrayVec;
+
+use bencher::Bencher;
+
+fn extend_with_constant(b: &mut Bencher) {
+    let mut v = ArrayVec::<[u8; 512]>::new();
+    let cap = v.capacity();
+    b.iter(|| {
+        v.clear();
+        v.extend((0..cap).map(|_| 1));
+        v[0]
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn extend_with_range(b: &mut Bencher) {
+    let mut v = ArrayVec::<[u8; 512]>::new();
+    let cap = v.capacity();
+    b.iter(|| {
+        v.clear();
+        v.extend((0..cap).map(|x| x as _));
+        v[0]
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+fn extend_with_slice(b: &mut Bencher) {
+    let mut v = ArrayVec::<[u8; 512]>::new();
+    let data = [1; 512];
+    b.iter(|| {
+        v.clear();
+        v.extend(data.iter().cloned());
+        v[0]
+    });
+    b.bytes = v.capacity() as u64;
+}
+
+benchmark_group!(benches, extend_with_constant, extend_with_range, extend_with_slice);
+benchmark_main!(benches);
diff --git a/rustc_deps/vendor/arrayvec/custom.css b/rustc_deps/vendor/arrayvec/custom.css
new file mode 100644
index 0000000..8e0b705
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/custom.css
@@ -0,0 +1,25 @@
+
+.docblock pre.rust { background: #eeeeff; }
+pre.trait, pre.fn, pre.struct, pre.enum, pre.typedef { background: #fcfefc; }
+
+/* Small “example” label for doc examples */
+.docblock pre.rust::before {
+    content: "example";
+    float: right;
+    font-style: italic;
+    font-size: 0.8em;
+    margin-top: -10px;
+    margin-right: -5px;
+}
+
+
+/* Fixup where display in trait listing */
+pre.trait .where::before {
+content: '\a         ';
+}
+
+.docblock code {
+    background-color: inherit;
+    font-weight: bold;
+    padding: 0 0.1em;
+}
diff --git a/rustc_deps/vendor/arrayvec/src/array.rs b/rustc_deps/vendor/arrayvec/src/array.rs
new file mode 100644
index 0000000..4f099a6
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/array.rs
@@ -0,0 +1,137 @@
+
+/// Trait for fixed size arrays.
+///
+/// This trait is implemented for some specific array sizes, see
+/// the implementor list below. At the current state of Rust we can't
+/// make this fully general for every array size.
+///
+/// The following crate features add more array sizes (and they are not
+/// enabled by default due to their impact on compliation speed).
+///
+/// - `array-sizes-33-128`: All sizes 33 to 128 are implemented
+///   (a few in this range are included by default).
+/// - `array-sizes-129-255`: All sizes 129 to 255 are implemented
+///   (a few in this range are included by default).
+pub unsafe trait Array {
+    /// The array’s element type
+    type Item;
+    #[doc(hidden)]
+    /// The smallest index type that indexes the array.
+    type Index: Index;
+    #[doc(hidden)]
+    fn as_ptr(&self) -> *const Self::Item;
+    #[doc(hidden)]
+    fn as_mut_ptr(&mut self) -> *mut Self::Item;
+    #[doc(hidden)]
+    fn capacity() -> usize;
+}
+
+pub trait Index : PartialEq + Copy {
+    fn to_usize(self) -> usize;
+    fn from(usize) -> Self;
+}
+
+use std::slice::{from_raw_parts};
+
+pub trait ArrayExt : Array {
+    #[inline(always)]
+    fn as_slice(&self) -> &[Self::Item] {
+        unsafe {
+            from_raw_parts(self.as_ptr(), Self::capacity())
+        }
+    }
+}
+
+impl<A> ArrayExt for A where A: Array { }
+
+impl Index for u8 {
+    #[inline(always)]
+    fn to_usize(self) -> usize { self as usize }
+    #[inline(always)]
+    fn from(ix: usize) ->  Self { ix as u8 }
+}
+
+impl Index for u16 {
+    #[inline(always)]
+    fn to_usize(self) -> usize { self as usize }
+    #[inline(always)]
+    fn from(ix: usize) ->  Self { ix as u16 }
+}
+
+impl Index for u32 {
+    #[inline(always)]
+    fn to_usize(self) -> usize { self as usize }
+    #[inline(always)]
+    fn from(ix: usize) ->  Self { ix as u32 }
+}
+
+impl Index for usize {
+    #[inline(always)]
+    fn to_usize(self) -> usize { self }
+    #[inline(always)]
+    fn from(ix: usize) ->  Self { ix }
+}
+
+macro_rules! fix_array_impl {
+    ($index_type:ty, $len:expr ) => (
+        unsafe impl<T> Array for [T; $len] {
+            type Item = T;
+            type Index = $index_type;
+            #[doc(hidden)]
+            #[inline(always)]
+            fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
+            #[doc(hidden)]
+            #[inline(always)]
+            fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _}
+            #[doc(hidden)]
+            #[inline(always)]
+            fn capacity() -> usize { $len }
+        }
+    )
+}
+
+macro_rules! fix_array_impl_recursive {
+    ($index_type:ty, ) => ();
+    ($index_type:ty, $($len:expr,)*) => (
+        $(fix_array_impl!($index_type, $len);)*
+    );
+}
+
+fix_array_impl_recursive!(u8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+                          15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+                          28, 29, 30, 31, );
+
+#[cfg(not(feature="array-sizes-33-128"))]
+fix_array_impl_recursive!(u8, 32, 40, 48, 50, 56, 64, 72, 96, 100, 128, );
+
+#[cfg(feature="array-sizes-33-128")]
+fix_array_impl_recursive!(u8, 
+32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+125, 126, 127, 128,
+);
+
+#[cfg(not(feature="array-sizes-129-255"))]
+fix_array_impl_recursive!(u8, 160, 192, 200, 224,);
+
+#[cfg(feature="array-sizes-129-255")]
+fix_array_impl_recursive!(u8,
+129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
+141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
+157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
+173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
+221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
+237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
+253, 254, 255,
+);
+
+fix_array_impl_recursive!(u16, 256, 384, 512, 768, 1024, 2048, 4096, 8192, 16384, 32768,);
+// This array size doesn't exist on 16-bit
+#[cfg(any(target_pointer_width="32", target_pointer_width="64"))]
+fix_array_impl_recursive!(u32, 1 << 16,);
+
diff --git a/rustc_deps/vendor/arrayvec/src/array_string.rs b/rustc_deps/vendor/arrayvec/src/array_string.rs
new file mode 100644
index 0000000..0dc0974
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/array_string.rs
@@ -0,0 +1,514 @@
+use std::borrow::Borrow;
+use std::cmp;
+use std::fmt;
+use std::hash::{Hash, Hasher};
+use std::mem;
+use std::ptr;
+use std::ops::{Deref, DerefMut};
+use std::str;
+use std::str::Utf8Error;
+use std::slice;
+
+use array::{Array, ArrayExt};
+use array::Index;
+use CapacityError;
+use char::encode_utf8;
+
+#[cfg(feature="serde-1")]
+use serde::{Serialize, Deserialize, Serializer, Deserializer};
+
+/// A string with a fixed capacity.
+///
+/// The `ArrayString` is a string backed by a fixed size array. It keeps track
+/// of its length.
+///
+/// The string is a contiguous value that you can store directly on the stack
+/// if needed.
+#[derive(Copy)]
+pub struct ArrayString<A: Array<Item=u8>> {
+    xs: A,
+    len: A::Index,
+}
+
+impl<A: Array<Item=u8>> Default for ArrayString<A> {
+    /// Return an empty `ArrayString`
+    fn default() -> ArrayString<A> {
+        ArrayString::new()
+    }
+}
+
+impl<A: Array<Item=u8>> ArrayString<A> {
+    /// Create a new empty `ArrayString`.
+    ///
+    /// Capacity is inferred from the type parameter.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 16]>::new();
+    /// string.push_str("foo");
+    /// assert_eq!(&string[..], "foo");
+    /// assert_eq!(string.capacity(), 16);
+    /// ```
+    pub fn new() -> ArrayString<A> {
+        unsafe {
+            ArrayString {
+                xs: ::new_array(),
+                len: Index::from(0),
+            }
+        }
+    }
+
+    /// Create a new `ArrayString` from a `str`.
+    ///
+    /// Capacity is inferred from the type parameter.
+    ///
+    /// **Errors** if the backing array is not large enough to fit the string.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 3]>::from("foo").unwrap();
+    /// assert_eq!(&string[..], "foo");
+    /// assert_eq!(string.len(), 3);
+    /// assert_eq!(string.capacity(), 3);
+    /// ```
+    pub fn from(s: &str) -> Result<Self, CapacityError<&str>> {
+        let mut arraystr = Self::new();
+        arraystr.try_push_str(s)?;
+        Ok(arraystr)
+    }
+
+    /// Create a new `ArrayString` from a byte string literal.
+    ///
+    /// **Errors** if the byte string literal is not valid UTF-8.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let string = ArrayString::from_byte_string(b"hello world").unwrap();
+    /// ```
+    pub fn from_byte_string(b: &A) -> Result<Self, Utf8Error> {
+        let mut arraystr = Self::new();
+        let s = try!(str::from_utf8(b.as_slice()));
+        let _result = arraystr.try_push_str(s);
+        debug_assert!(_result.is_ok());
+        Ok(arraystr)
+    }
+
+    /// Return the capacity of the `ArrayString`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let string = ArrayString::<[_; 3]>::new();
+    /// assert_eq!(string.capacity(), 3);
+    /// ```
+    #[inline]
+    pub fn capacity(&self) -> usize { A::capacity() }
+
+    /// Return if the `ArrayString` is completely filled.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 1]>::new();
+    /// assert!(!string.is_full());
+    /// string.push_str("A");
+    /// assert!(string.is_full());
+    /// ```
+    pub fn is_full(&self) -> bool { self.len() == self.capacity() }
+
+    /// Adds the given char to the end of the string.
+    ///
+    /// ***Panics*** if the backing array is not large enough to fit the additional char.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 2]>::new();
+    ///
+    /// string.push('a');
+    /// string.push('b');
+    ///
+    /// assert_eq!(&string[..], "ab");
+    /// ```
+    pub fn push(&mut self, c: char) {
+        self.try_push(c).unwrap();
+    }
+
+    /// Adds the given char to the end of the string.
+    ///
+    /// Returns `Ok` if the push succeeds.
+    ///
+    /// **Errors** if the backing array is not large enough to fit the additional char.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 2]>::new();
+    ///
+    /// string.try_push('a').unwrap();
+    /// string.try_push('b').unwrap();
+    /// let overflow = string.try_push('c');
+    ///
+    /// assert_eq!(&string[..], "ab");
+    /// assert_eq!(overflow.unwrap_err().element(), 'c');
+    /// ```
+    pub fn try_push(&mut self, c: char) -> Result<(), CapacityError<char>> {
+        let len = self.len();
+        unsafe {
+            match encode_utf8(c, &mut self.raw_mut_bytes()[len..]) {
+                Ok(n) => {
+                    self.set_len(len + n);
+                    Ok(())
+                }
+                Err(_) => Err(CapacityError::new(c)),
+            }
+        }
+    }
+
+    /// Adds the given string slice to the end of the string.
+    ///
+    /// ***Panics*** if the backing array is not large enough to fit the string.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 2]>::new();
+    ///
+    /// string.push_str("a");
+    /// string.push_str("d");
+    ///
+    /// assert_eq!(&string[..], "ad");
+    /// ```
+    pub fn push_str(&mut self, s: &str) {
+        self.try_push_str(s).unwrap()
+    }
+
+    /// Adds the given string slice to the end of the string.
+    ///
+    /// Returns `Ok` if the push succeeds.
+    ///
+    /// **Errors** if the backing array is not large enough to fit the string.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 2]>::new();
+    ///
+    /// string.try_push_str("a").unwrap();
+    /// let overflow1 = string.try_push_str("bc");
+    /// string.try_push_str("d").unwrap();
+    /// let overflow2 = string.try_push_str("ef");
+    ///
+    /// assert_eq!(&string[..], "ad");
+    /// assert_eq!(overflow1.unwrap_err().element(), "bc");
+    /// assert_eq!(overflow2.unwrap_err().element(), "ef");
+    /// ```
+    pub fn try_push_str<'a>(&mut self, s: &'a str) -> Result<(), CapacityError<&'a str>> {
+        if s.len() > self.capacity() - self.len() {
+            return Err(CapacityError::new(s));
+        }
+        unsafe {
+            let dst = self.xs.as_mut_ptr().offset(self.len() as isize);
+            let src = s.as_ptr();
+            ptr::copy_nonoverlapping(src, dst, s.len());
+            let newl = self.len() + s.len();
+            self.set_len(newl);
+        }
+        Ok(())
+    }
+
+    /// Removes the last character from the string and returns it.
+    ///
+    /// Returns `None` if this `ArrayString` is empty.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    /// 
+    /// let mut s = ArrayString::<[_; 3]>::from("foo").unwrap();
+    ///
+    /// assert_eq!(s.pop(), Some('o'));
+    /// assert_eq!(s.pop(), Some('o'));
+    /// assert_eq!(s.pop(), Some('f'));
+    ///
+    /// assert_eq!(s.pop(), None);
+    /// ```
+    #[inline]
+    pub fn pop(&mut self) -> Option<char> {
+        let ch = match self.chars().rev().next() {
+            Some(ch) => ch,
+            None => return None,
+        };
+        let new_len = self.len() - ch.len_utf8();
+        unsafe {
+            self.set_len(new_len);
+        }
+        Some(ch)
+    }
+
+    /// Shortens this `ArrayString` to the specified length.
+    ///
+    /// If `new_len` is greater than the string’s current length, this has no
+    /// effect.
+    ///
+    /// ***Panics*** if `new_len` does not lie on a `char` boundary.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    ///
+    /// let mut string = ArrayString::<[_; 6]>::from("foobar").unwrap();
+    /// string.truncate(3);
+    /// assert_eq!(&string[..], "foo");
+    /// string.truncate(4);
+    /// assert_eq!(&string[..], "foo");
+    /// ```
+    #[inline]
+    pub fn truncate(&mut self, new_len: usize) {
+        if new_len <= self.len() {
+            assert!(self.is_char_boundary(new_len));
+            unsafe { 
+                // In libstd truncate is called on the underlying vector,
+                // which in turns drops each element.
+                // As we know we don't have to worry about Drop,
+                // we can just set the length (a la clear.)
+                self.set_len(new_len);
+            }
+        }
+    }
+
+    /// Removes a `char` from this `ArrayString` at a byte position and returns it.
+    ///
+    /// This is an `O(n)` operation, as it requires copying every element in the
+    /// array.
+    ///
+    /// ***Panics*** if `idx` is larger than or equal to the `ArrayString`’s length,
+    /// or if it does not lie on a `char` boundary.
+    ///
+    /// ```
+    /// use arrayvec::ArrayString;
+    /// 
+    /// let mut s = ArrayString::<[_; 3]>::from("foo").unwrap();
+    ///
+    /// assert_eq!(s.remove(0), 'f');
+    /// assert_eq!(s.remove(1), 'o');
+    /// assert_eq!(s.remove(0), 'o');
+    /// ```
+    #[inline]
+    pub fn remove(&mut self, idx: usize) -> char {
+        let ch = match self[idx..].chars().next() {
+            Some(ch) => ch,
+            None => panic!("cannot remove a char from the end of a string"),
+        };
+
+        let next = idx + ch.len_utf8();
+        let len = self.len();
+        unsafe {
+            ptr::copy(self.xs.as_ptr().offset(next as isize),
+                      self.xs.as_mut_ptr().offset(idx as isize),
+                      len - next);
+            self.set_len(len - (next - idx));
+        }
+        ch
+    }
+
+    /// Make the string empty.
+    pub fn clear(&mut self) {
+        unsafe {
+            self.set_len(0);
+        }
+    }
+
+    /// Set the strings’s length.
+    ///
+    /// This function is `unsafe` because it changes the notion of the
+    /// number of “valid” bytes in the string. Use with care.
+    ///
+    /// This method uses *debug assertions* to check the validity of `length`
+    /// and may use other debug assertions.
+    #[inline]
+    pub unsafe fn set_len(&mut self, length: usize) {
+        debug_assert!(length <= self.capacity());
+        self.len = Index::from(length);
+    }
+
+    /// Return a string slice of the whole `ArrayString`.
+    pub fn as_str(&self) -> &str {
+        self
+    }
+
+    /// Return a mutable slice of the whole string’s buffer
+    unsafe fn raw_mut_bytes(&mut self) -> &mut [u8] {
+        slice::from_raw_parts_mut(self.xs.as_mut_ptr(), self.capacity())
+    }
+}
+
+impl<A: Array<Item=u8>> Deref for ArrayString<A> {
+    type Target = str;
+    #[inline]
+    fn deref(&self) -> &str {
+        unsafe {
+            let sl = slice::from_raw_parts(self.xs.as_ptr(), self.len.to_usize());
+            str::from_utf8_unchecked(sl)
+        }
+    }
+}
+
+impl<A: Array<Item=u8>> DerefMut for ArrayString<A> {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut str {
+        unsafe {
+            let sl = slice::from_raw_parts_mut(self.xs.as_mut_ptr(), self.len.to_usize());
+            // FIXME: Nothing but transmute to do this right now
+            mem::transmute(sl)
+        }
+    }
+}
+
+impl<A: Array<Item=u8>> PartialEq for ArrayString<A> {
+    fn eq(&self, rhs: &Self) -> bool {
+        **self == **rhs
+    }
+}
+
+impl<A: Array<Item=u8>> PartialEq<str> for ArrayString<A> {
+    fn eq(&self, rhs: &str) -> bool {
+        &**self == rhs
+    }
+}
+
+impl<A: Array<Item=u8>> PartialEq<ArrayString<A>> for str {
+    fn eq(&self, rhs: &ArrayString<A>) -> bool {
+        self == &**rhs
+    }
+}
+
+impl<A: Array<Item=u8>> Eq for ArrayString<A> { }
+
+impl<A: Array<Item=u8>> Hash for ArrayString<A> {
+    fn hash<H: Hasher>(&self, h: &mut H) {
+        (**self).hash(h)
+    }
+}
+
+impl<A: Array<Item=u8>> Borrow<str> for ArrayString<A> {
+    fn borrow(&self) -> &str { self }
+}
+
+impl<A: Array<Item=u8>> AsRef<str> for ArrayString<A> {
+    fn as_ref(&self) -> &str { self }
+}
+
+impl<A: Array<Item=u8>> fmt::Debug for ArrayString<A> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) }
+}
+
+impl<A: Array<Item=u8>> fmt::Display for ArrayString<A> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) }
+}
+
+/// `Write` appends written data to the end of the string.
+impl<A: Array<Item=u8>> fmt::Write for ArrayString<A> {
+    fn write_char(&mut self, c: char) -> fmt::Result {
+        self.try_push(c).map_err(|_| fmt::Error)
+    }
+
+    fn write_str(&mut self, s: &str) -> fmt::Result {
+        self.try_push_str(s).map_err(|_| fmt::Error)
+    }
+}
+
+impl<A: Array<Item=u8> + Copy> Clone for ArrayString<A> {
+    fn clone(&self) -> ArrayString<A> {
+        *self
+    }
+    fn clone_from(&mut self, rhs: &Self) {
+        // guaranteed to fit due to types matching.
+        self.clear();
+        self.try_push_str(rhs).ok();
+    }
+}
+
+impl<A: Array<Item=u8>> PartialOrd for ArrayString<A> {
+    fn partial_cmp(&self, rhs: &Self) -> Option<cmp::Ordering> {
+        (**self).partial_cmp(&**rhs)
+    }
+    fn lt(&self, rhs: &Self) -> bool { **self < **rhs }
+    fn le(&self, rhs: &Self) -> bool { **self <= **rhs }
+    fn gt(&self, rhs: &Self) -> bool { **self > **rhs }
+    fn ge(&self, rhs: &Self) -> bool { **self >= **rhs }
+}
+
+impl<A: Array<Item=u8>> PartialOrd<str> for ArrayString<A> {
+    fn partial_cmp(&self, rhs: &str) -> Option<cmp::Ordering> {
+        (**self).partial_cmp(rhs)
+    }
+    fn lt(&self, rhs: &str) -> bool { &**self < rhs }
+    fn le(&self, rhs: &str) -> bool { &**self <= rhs }
+    fn gt(&self, rhs: &str) -> bool { &**self > rhs }
+    fn ge(&self, rhs: &str) -> bool { &**self >= rhs }
+}
+
+impl<A: Array<Item=u8>> PartialOrd<ArrayString<A>> for str {
+    fn partial_cmp(&self, rhs: &ArrayString<A>) -> Option<cmp::Ordering> {
+        self.partial_cmp(&**rhs)
+    }
+    fn lt(&self, rhs: &ArrayString<A>) -> bool { self < &**rhs }
+    fn le(&self, rhs: &ArrayString<A>) -> bool { self <= &**rhs }
+    fn gt(&self, rhs: &ArrayString<A>) -> bool { self > &**rhs }
+    fn ge(&self, rhs: &ArrayString<A>) -> bool { self >= &**rhs }
+}
+
+impl<A: Array<Item=u8>> Ord for ArrayString<A> {
+    fn cmp(&self, rhs: &Self) -> cmp::Ordering {
+        (**self).cmp(&**rhs)
+    }
+}
+
+#[cfg(feature="serde-1")]
+/// Requires crate feature `"serde-1"`
+impl<A: Array<Item=u8>> Serialize for ArrayString<A> {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where S: Serializer
+    {
+        serializer.serialize_str(&*self)
+    }
+}
+
+#[cfg(feature="serde-1")]
+/// Requires crate feature `"serde-1"`
+impl<'de, A: Array<Item=u8>> Deserialize<'de> for ArrayString<A> {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where D: Deserializer<'de>
+    {
+        use serde::de::{self, Visitor};
+        use std::marker::PhantomData;
+
+        struct ArrayStringVisitor<A: Array<Item=u8>>(PhantomData<A>);
+
+        impl<'de, A: Array<Item=u8>> Visitor<'de> for ArrayStringVisitor<A> {
+            type Value = ArrayString<A>;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                write!(formatter, "a string no more than {} bytes long", A::capacity())
+            }
+
+            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+                where E: de::Error,
+            {
+                ArrayString::from(v).map_err(|_| E::invalid_length(v.len(), &self))
+            }
+
+            fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+                where E: de::Error,
+            {
+                let s = try!(str::from_utf8(v).map_err(|_| E::invalid_value(de::Unexpected::Bytes(v), &self)));
+
+                ArrayString::from(s).map_err(|_| E::invalid_length(s.len(), &self))
+            }
+        }
+
+        deserializer.deserialize_str(ArrayStringVisitor::<A>(PhantomData))
+    }
+}
diff --git a/rustc_deps/vendor/arrayvec/src/char.rs b/rustc_deps/vendor/arrayvec/src/char.rs
new file mode 100644
index 0000000..8191dfb
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/char.rs
@@ -0,0 +1,54 @@
+// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+//
+// Original authors: alexchrichton, bluss
+
+// UTF-8 ranges and tags for encoding characters
+const TAG_CONT: u8    = 0b1000_0000;
+const TAG_TWO_B: u8   = 0b1100_0000;
+const TAG_THREE_B: u8 = 0b1110_0000;
+const TAG_FOUR_B: u8  = 0b1111_0000;
+const MAX_ONE_B: u32   =     0x80;
+const MAX_TWO_B: u32   =    0x800;
+const MAX_THREE_B: u32 =  0x10000;
+
+/// Placeholder
+pub struct EncodeUtf8Error;
+
+/// Encode a char into buf using UTF-8.
+///
+/// On success, return the byte length of the encoding (1, 2, 3 or 4).<br>
+/// On error, return `EncodeUtf8Error` if the buffer was too short for the char.
+#[inline]
+pub fn encode_utf8(ch: char, buf: &mut [u8]) -> Result<usize, EncodeUtf8Error>
+{
+    let code = ch as u32;
+    if code < MAX_ONE_B && buf.len() >= 1 {
+        buf[0] = code as u8;
+        return Ok(1);
+    } else if code < MAX_TWO_B && buf.len() >= 2 {
+        buf[0] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B;
+        buf[1] = (code & 0x3F) as u8 | TAG_CONT;
+        return Ok(2);
+    } else if code < MAX_THREE_B && buf.len() >= 3 {
+        buf[0] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B;
+        buf[1] = (code >>  6 & 0x3F) as u8 | TAG_CONT;
+        buf[2] = (code & 0x3F) as u8 | TAG_CONT;
+        return Ok(3);
+    } else if buf.len() >= 4 {
+        buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B;
+        buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT;
+        buf[2] = (code >>  6 & 0x3F) as u8 | TAG_CONT;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        return Ok(4);
+    };
+    Err(EncodeUtf8Error)
+}
+
diff --git a/rustc_deps/vendor/arrayvec/src/errors.rs b/rustc_deps/vendor/arrayvec/src/errors.rs
new file mode 100644
index 0000000..5bea980
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/errors.rs
@@ -0,0 +1,53 @@
+use std::fmt;
+#[cfg(feature="std")]
+use std::any::Any;
+#[cfg(feature="std")]
+use std::error::Error;
+
+/// Error value indicating insufficient capacity
+#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
+pub struct CapacityError<T = ()> {
+    element: T,
+}
+
+impl<T> CapacityError<T> {
+    /// Create a new `CapacityError` from `element`.
+    pub fn new(element: T) -> CapacityError<T> {
+        CapacityError {
+            element: element,
+        }
+    }
+
+    /// Extract the overflowing element
+    pub fn element(self) -> T {
+        self.element
+    }
+
+    /// Convert into a `CapacityError` that does not carry an element.
+    pub fn simplify(self) -> CapacityError {
+        CapacityError { element: () }
+    }
+}
+
+const CAPERROR: &'static str = "insufficient capacity";
+
+#[cfg(feature="std")]
+/// Requires `features="std"`.
+impl<T: Any> Error for CapacityError<T> {
+    fn description(&self) -> &str {
+        CAPERROR
+    }
+}
+
+impl<T> fmt::Display for CapacityError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}", CAPERROR)
+    }
+}
+
+impl<T> fmt::Debug for CapacityError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}: {}", "CapacityError", CAPERROR)
+    }
+}
+
diff --git a/rustc_deps/vendor/arrayvec/src/lib.rs b/rustc_deps/vendor/arrayvec/src/lib.rs
new file mode 100644
index 0000000..50903c5
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/lib.rs
@@ -0,0 +1,1089 @@
+//! **arrayvec** provides the types `ArrayVec` and `ArrayString`: 
+//! array-backed vector and string types, which store their contents inline.
+//!
+//! The arrayvec package has the following cargo features:
+//!
+//! - `std`
+//!   - Optional, enabled by default
+//!   - Use libstd; disable to use `no_std` instead.
+//!
+//! - `use_union`
+//!   - Optional
+//!   - Requires Rust nightly channel
+//!   - Experimental: This flag uses nightly so it *may break* unexpectedly
+//!     at some point; since it doesn't change API this flag may also change
+//!     to do nothing in the future.
+//!   - Use the unstable feature untagged unions for the internal implementation,
+//!     which may have reduced space overhead
+//! - `serde-1`
+//!   - Optional
+//!   - Enable serialization for ArrayVec and ArrayString using serde 1.0
+//! - `array-sizes-33-128`, `array-sizes-129-255`
+//!   - Optional
+//!   - Enable more array sizes (see [Array] for more information)
+//!
+//! ## Rust Version
+//!
+//! This version of arrayvec requires Rust 1.13 or later.
+//!
+#![doc(html_root_url="https://docs.rs/arrayvec/0.4/")]
+#![cfg_attr(not(feature="std"), no_std)]
+extern crate nodrop;
+#[cfg(feature="serde-1")]
+extern crate serde;
+
+#[cfg(not(feature="std"))]
+extern crate core as std;
+
+use std::cmp;
+use std::iter;
+use std::mem;
+use std::ptr;
+use std::ops::{
+    Deref,
+    DerefMut,
+};
+use std::slice;
+
+// extra traits
+use std::borrow::{Borrow, BorrowMut};
+use std::hash::{Hash, Hasher};
+use std::fmt;
+
+#[cfg(feature="std")]
+use std::io;
+
+#[cfg(not(feature="use_union"))]
+use nodrop::NoDrop;
+
+#[cfg(feature="use_union")]
+use std::mem::ManuallyDrop as NoDrop;
+
+#[cfg(feature="serde-1")]
+use serde::{Serialize, Deserialize, Serializer, Deserializer};
+
+mod array;
+mod array_string;
+mod char;
+mod range;
+mod errors;
+
+pub use array::Array;
+pub use range::RangeArgument;
+use array::Index;
+pub use array_string::ArrayString;
+pub use errors::CapacityError;
+
+
+unsafe fn new_array<A: Array>() -> A {
+    // Note: Returning an uninitialized value here only works
+    // if we can be sure the data is never used. The nullable pointer
+    // inside enum optimization conflicts with this this for example,
+    // so we need to be extra careful. See `NoDrop` enum.
+    mem::uninitialized()
+}
+
+/// A vector with a fixed capacity.
+///
+/// The `ArrayVec` is a vector backed by a fixed size array. It keeps track of
+/// the number of initialized elements.
+///
+/// The vector is a contiguous value that you can store directly on the stack
+/// if needed.
+///
+/// It offers a simple API but also dereferences to a slice, so
+/// that the full slice API is available.
+///
+/// ArrayVec can be converted into a by value iterator.
+pub struct ArrayVec<A: Array> {
+    xs: NoDrop<A>,
+    len: A::Index,
+}
+
+impl<A: Array> Drop for ArrayVec<A> {
+    fn drop(&mut self) {
+        self.clear();
+
+        // NoDrop inhibits array's drop
+        // panic safety: NoDrop::drop will trigger on panic, so the inner
+        // array will not drop even after panic.
+    }
+}
+
+macro_rules! panic_oob {
+    ($method_name:expr, $index:expr, $len:expr) => {
+        panic!(concat!("ArrayVec::", $method_name, ": index {} is out of bounds in vector of length {}"),
+               $index, $len)
+    }
+}
+
+impl<A: Array> ArrayVec<A> {
+    /// Create a new empty `ArrayVec`.
+    ///
+    /// Capacity is inferred from the type parameter.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 16]>::new();
+    /// array.push(1);
+    /// array.push(2);
+    /// assert_eq!(&array[..], &[1, 2]);
+    /// assert_eq!(array.capacity(), 16);
+    /// ```
+    pub fn new() -> ArrayVec<A> {
+        unsafe {
+            ArrayVec { xs: NoDrop::new(new_array()), len: Index::from(0) }
+        }
+    }
+
+    /// Return the number of elements in the `ArrayVec`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3]);
+    /// array.pop();
+    /// assert_eq!(array.len(), 2);
+    /// ```
+    #[inline]
+    pub fn len(&self) -> usize { self.len.to_usize() }
+
+    /// Return the capacity of the `ArrayVec`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let array = ArrayVec::from([1, 2, 3]);
+    /// assert_eq!(array.capacity(), 3);
+    /// ```
+    #[inline]
+    pub fn capacity(&self) -> usize { A::capacity() }
+
+    /// Return if the `ArrayVec` is completely filled.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 1]>::new();
+    /// assert!(!array.is_full());
+    /// array.push(1);
+    /// assert!(array.is_full());
+    /// ```
+    pub fn is_full(&self) -> bool { self.len() == self.capacity() }
+
+    /// Push `element` to the end of the vector.
+    ///
+    /// ***Panics*** if the vector is already full.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// array.push(1);
+    /// array.push(2);
+    ///
+    /// assert_eq!(&array[..], &[1, 2]);
+    /// ```
+    pub fn push(&mut self, element: A::Item) {
+        self.try_push(element).unwrap()
+    }
+
+    /// Push `element` to the end of the vector.
+    ///
+    /// Return `Ok` if the push succeeds, or return an error if the vector
+    /// is already full.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// let push1 = array.try_push(1);
+    /// let push2 = array.try_push(2);
+    ///
+    /// assert!(push1.is_ok());
+    /// assert!(push2.is_ok());
+    ///
+    /// assert_eq!(&array[..], &[1, 2]);
+    ///
+    /// let overflow = array.try_push(3);
+    ///
+    /// assert!(overflow.is_err());
+    /// ```
+    pub fn try_push(&mut self, element: A::Item) -> Result<(), CapacityError<A::Item>> {
+        if self.len() < A::capacity() {
+            unsafe {
+                self.push_unchecked(element);
+            }
+            Ok(())
+        } else {
+            Err(CapacityError::new(element))
+        }
+    }
+
+
+    /// Push `element` to the end of the vector without checking the capacity.
+    ///
+    /// It is up to the caller to ensure the capacity of the vector is
+    /// sufficiently large.
+    ///
+    /// This method uses *debug assertions* to check that the arrayvec is not full.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// if array.len() + 2 <= array.capacity() {
+    ///     unsafe {
+    ///         array.push_unchecked(1);
+    ///         array.push_unchecked(2);
+    ///     }
+    /// }
+    ///
+    /// assert_eq!(&array[..], &[1, 2]);
+    /// ```
+    #[inline]
+    pub unsafe fn push_unchecked(&mut self, element: A::Item) {
+        let len = self.len();
+        debug_assert!(len < A::capacity());
+        ptr::write(self.get_unchecked_mut(len), element);
+        self.set_len(len + 1);
+    }
+
+    /// Insert `element` at position `index`.
+    ///
+    /// Shift up all elements after `index`.
+    ///
+    /// It is an error if the index is greater than the length or if the
+    /// arrayvec is full.
+    ///
+    /// ***Panics*** if the array is full or the `index` is out of bounds. See
+    /// `try_insert` for fallible version.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// array.insert(0, "x");
+    /// array.insert(0, "y");
+    /// assert_eq!(&array[..], &["y", "x"]);
+    ///
+    /// ```
+    pub fn insert(&mut self, index: usize, element: A::Item) {
+        self.try_insert(index, element).unwrap()
+    }
+
+    /// Insert `element` at position `index`.
+    ///
+    /// Shift up all elements after `index`; the `index` must be less than
+    /// or equal to the length.
+    ///
+    /// Returns an error if vector is already at full capacity.
+    ///
+    /// ***Panics*** `index` is out of bounds.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// assert!(array.try_insert(0, "x").is_ok());
+    /// assert!(array.try_insert(0, "y").is_ok());
+    /// assert!(array.try_insert(0, "z").is_err());
+    /// assert_eq!(&array[..], &["y", "x"]);
+    ///
+    /// ```
+    pub fn try_insert(&mut self, index: usize, element: A::Item) -> Result<(), CapacityError<A::Item>> {
+        if index > self.len() {
+            panic_oob!("try_insert", index, self.len())
+        }
+        if self.len() == self.capacity() {
+            return Err(CapacityError::new(element));
+        }
+        let len = self.len();
+
+        // follows is just like Vec<T>
+        unsafe { // infallible
+            // The spot to put the new value
+            {
+                let p: *mut _ = self.get_unchecked_mut(index);
+                // Shift everything over to make space. (Duplicating the
+                // `index`th element into two consecutive places.)
+                ptr::copy(p, p.offset(1), len - index);
+                // Write it in, overwriting the first copy of the `index`th
+                // element.
+                ptr::write(p, element);
+            }
+            self.set_len(len + 1);
+        }
+        Ok(())
+    }
+
+    /// Remove the last element in the vector and return it.
+    ///
+    /// Return `Some(` *element* `)` if the vector is non-empty, else `None`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::<[_; 2]>::new();
+    ///
+    /// array.push(1);
+    ///
+    /// assert_eq!(array.pop(), Some(1));
+    /// assert_eq!(array.pop(), None);
+    /// ```
+    pub fn pop(&mut self) -> Option<A::Item> {
+        if self.len() == 0 {
+            return None
+        }
+        unsafe {
+            let new_len = self.len() - 1;
+            self.set_len(new_len);
+            Some(ptr::read(self.get_unchecked_mut(new_len)))
+        }
+    }
+
+    /// Remove the element at `index` and swap the last element into its place.
+    ///
+    /// This operation is O(1).
+    ///
+    /// Return the *element* if the index is in bounds, else panic.
+    ///
+    /// ***Panics*** if the `index` is out of bounds.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3]);
+    ///
+    /// assert_eq!(array.swap_remove(0), 1);
+    /// assert_eq!(&array[..], &[3, 2]);
+    ///
+    /// assert_eq!(array.swap_remove(1), 2);
+    /// assert_eq!(&array[..], &[3]);
+    /// ```
+    pub fn swap_remove(&mut self, index: usize) -> A::Item {
+        self.swap_pop(index)
+            .unwrap_or_else(|| {
+                panic_oob!("swap_remove", index, self.len())
+            })
+    }
+
+    /// Remove the element at `index` and swap the last element into its place.
+    ///
+    /// This is a checked version of `.swap_remove`.  
+    /// This operation is O(1).
+    ///
+    /// Return `Some(` *element* `)` if the index is in bounds, else `None`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3]);
+    ///
+    /// assert_eq!(array.swap_pop(0), Some(1));
+    /// assert_eq!(&array[..], &[3, 2]);
+    ///
+    /// assert_eq!(array.swap_pop(10), None);
+    /// ```
+    pub fn swap_pop(&mut self, index: usize) -> Option<A::Item> {
+        let len = self.len();
+        if index >= len {
+            return None;
+        }
+        self.swap(index, len - 1);
+        self.pop()
+    }
+
+    /// Remove the element at `index` and shift down the following elements.
+    ///
+    /// The `index` must be strictly less than the length of the vector.
+    ///
+    /// ***Panics*** if the `index` is out of bounds.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3]);
+    ///
+    /// let removed_elt = array.remove(0);
+    /// assert_eq!(removed_elt, 1);
+    /// assert_eq!(&array[..], &[2, 3]);
+    /// ```
+    pub fn remove(&mut self, index: usize) -> A::Item {
+        self.pop_at(index)
+            .unwrap_or_else(|| {
+                panic_oob!("remove", index, self.len())
+            })
+    }
+
+    /// Remove the element at `index` and shift down the following elements.
+    ///
+    /// This is a checked version of `.remove(index)`. Returns `None` if there
+    /// is no element at `index`. Otherwise, return the element inside `Some`.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3]);
+    ///
+    /// assert!(array.pop_at(0).is_some());
+    /// assert_eq!(&array[..], &[2, 3]);
+    ///
+    /// assert!(array.pop_at(2).is_none());
+    /// assert!(array.pop_at(10).is_none());
+    /// ```
+    pub fn pop_at(&mut self, index: usize) -> Option<A::Item> {
+        if index >= self.len() {
+            None
+        } else {
+            self.drain(index..index + 1).next()
+        }
+    }
+
+    /// Shortens the vector, keeping the first `len` elements and dropping
+    /// the rest.
+    ///
+    /// If `len` is greater than the vector’s current length this has no
+    /// effect.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3, 4, 5]);
+    /// array.truncate(3);
+    /// assert_eq!(&array[..], &[1, 2, 3]);
+    /// array.truncate(4);
+    /// assert_eq!(&array[..], &[1, 2, 3]);
+    /// ```
+    pub fn truncate(&mut self, len: usize) {
+        while self.len() > len { self.pop(); }
+    }
+
+    /// Remove all elements in the vector.
+    pub fn clear(&mut self) {
+        while let Some(_) = self.pop() { }
+    }
+
+    /// Retains only the elements specified by the predicate.
+    ///
+    /// In other words, remove all elements `e` such that `f(&mut e)` returns false.
+    /// This method operates in place and preserves the order of the retained
+    /// elements.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut array = ArrayVec::from([1, 2, 3, 4]);
+    /// array.retain(|x| *x & 1 != 0 );
+    /// assert_eq!(&array[..], &[1, 3]);
+    /// ```
+    pub fn retain<F>(&mut self, mut f: F)
+        where F: FnMut(&mut A::Item) -> bool
+    {
+        let len = self.len();
+        let mut del = 0;
+        {
+            let v = &mut **self;
+
+            for i in 0..len {
+                if !f(&mut v[i]) {
+                    del += 1;
+                } else if del > 0 {
+                    v.swap(i - del, i);
+                }
+            }
+        }
+        if del > 0 {
+            self.drain(len - del..);
+        }
+    }
+
+    /// Set the vector’s length without dropping or moving out elements
+    ///
+    /// This method is `unsafe` because it changes the notion of the
+    /// number of “valid” elements in the vector. Use with care.
+    ///
+    /// This method uses *debug assertions* to check that check that `length` is
+    /// not greater than the capacity.
+    #[inline]
+    pub unsafe fn set_len(&mut self, length: usize) {
+        debug_assert!(length <= self.capacity());
+        self.len = Index::from(length);
+    }
+
+
+    /// Create a draining iterator that removes the specified range in the vector
+    /// and yields the removed items from start to end. The element range is
+    /// removed even if the iterator is not consumed until the end.
+    ///
+    /// Note: It is unspecified how many elements are removed from the vector,
+    /// if the `Drain` value is leaked.
+    ///
+    /// **Panics** if the starting point is greater than the end point or if
+    /// the end point is greater than the length of the vector.
+    ///
+    /// ```
+    /// use arrayvec::ArrayVec;
+    ///
+    /// let mut v = ArrayVec::from([1, 2, 3]);
+    /// let u: ArrayVec<[_; 3]> = v.drain(0..2).collect();
+    /// assert_eq!(&v[..], &[3]);
+    /// assert_eq!(&u[..], &[1, 2]);
+    /// ```
+    pub fn drain<R: RangeArgument>(&mut self, range: R) -> Drain<A> {
+        // Memory safety
+        //
+        // When the Drain is first created, it shortens the length of
+        // the source vector to make sure no uninitalized or moved-from elements
+        // are accessible at all if the Drain's destructor never gets to run.
+        //
+        // Drain will ptr::read out the values to remove.
+        // When finished, remaining tail of the vec is copied back to cover
+        // the hole, and the vector length is restored to the new length.
+        //
+        let len = self.len();
+        let start = range.start().unwrap_or(0);
+        let end = range.end().unwrap_or(len);
+        // bounds check happens here
+        let range_slice: *const _ = &self[start..end];
+
+        unsafe {
+            // set self.vec length's to start, to be safe in case Drain is leaked
+            self.set_len(start);
+            Drain {
+                tail_start: end,
+                tail_len: len - end,
+                iter: (*range_slice).iter(),
+                vec: self as *mut _,
+            }
+        }
+    }
+
+    /// Return the inner fixed size array, if it is full to its capacity.
+    ///
+    /// Return an `Ok` value with the array if length equals capacity,
+    /// return an `Err` with self otherwise.
+    ///
+    /// `Note:` This function may incur unproportionally large overhead
+    /// to move the array out, its performance is not optimal.
+    pub fn into_inner(self) -> Result<A, Self> {
+        if self.len() < self.capacity() {
+            Err(self)
+        } else {
+            unsafe {
+                let array = ptr::read(&*self.xs);
+                mem::forget(self);
+                Ok(array)
+            }
+        }
+    }
+
+    /// Dispose of `self` without the overwriting that is needed in Drop.
+    pub fn dispose(mut self) {
+        self.clear();
+        mem::forget(self);
+    }
+
+    /// Return a slice containing all elements of the vector.
+    pub fn as_slice(&self) -> &[A::Item] {
+        self
+    }
+
+    /// Return a mutable slice containing all elements of the vector.
+    pub fn as_mut_slice(&mut self) -> &mut [A::Item] {
+        self
+    }
+}
+
+impl<A: Array> Deref for ArrayVec<A> {
+    type Target = [A::Item];
+    #[inline]
+    fn deref(&self) -> &[A::Item] {
+        unsafe {
+            slice::from_raw_parts(self.xs.as_ptr(), self.len())
+        }
+    }
+}
+
+impl<A: Array> DerefMut for ArrayVec<A> {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut [A::Item] {
+        let len = self.len();
+        unsafe {
+            slice::from_raw_parts_mut(self.xs.as_mut_ptr(), len)
+        }
+    }
+}
+
+/// Create an `ArrayVec` from an array.
+///
+/// ```
+/// use arrayvec::ArrayVec;
+///
+/// let mut array = ArrayVec::from([1, 2, 3]);
+/// assert_eq!(array.len(), 3);
+/// assert_eq!(array.capacity(), 3);
+/// ```
+impl<A: Array> From<A> for ArrayVec<A> {
+    fn from(array: A) -> Self {
+        ArrayVec { xs: NoDrop::new(array), len: Index::from(A::capacity()) }
+    }
+}
+
+
+/// Iterate the `ArrayVec` with references to each element.
+///
+/// ```
+/// use arrayvec::ArrayVec;
+///
+/// let array = ArrayVec::from([1, 2, 3]);
+///
+/// for elt in &array {
+///     // ...
+/// }
+/// ```
+impl<'a, A: Array> IntoIterator for &'a ArrayVec<A> {
+    type Item = &'a A::Item;
+    type IntoIter = slice::Iter<'a, A::Item>;
+    fn into_iter(self) -> Self::IntoIter { self.iter() }
+}
+
+/// Iterate the `ArrayVec` with mutable references to each element.
+///
+/// ```
+/// use arrayvec::ArrayVec;
+///
+/// let mut array = ArrayVec::from([1, 2, 3]);
+///
+/// for elt in &mut array {
+///     // ...
+/// }
+/// ```
+impl<'a, A: Array> IntoIterator for &'a mut ArrayVec<A> {
+    type Item = &'a mut A::Item;
+    type IntoIter = slice::IterMut<'a, A::Item>;
+    fn into_iter(self) -> Self::IntoIter { self.iter_mut() }
+}
+
+/// Iterate the `ArrayVec` with each element by value.
+///
+/// The vector is consumed by this operation.
+///
+/// ```
+/// use arrayvec::ArrayVec;
+///
+/// for elt in ArrayVec::from([1, 2, 3]) {
+///     // ...
+/// }
+/// ```
+impl<A: Array> IntoIterator for ArrayVec<A> {
+    type Item = A::Item;
+    type IntoIter = IntoIter<A>;
+    fn into_iter(self) -> IntoIter<A> {
+        IntoIter { index: Index::from(0), v: self, }
+    }
+}
+
+
+/// By-value iterator for `ArrayVec`.
+pub struct IntoIter<A: Array> {
+    index: A::Index,
+    v: ArrayVec<A>,
+}
+
+impl<A: Array> Iterator for IntoIter<A> {
+    type Item = A::Item;
+
+    #[inline]
+    fn next(&mut self) -> Option<A::Item> {
+        if self.index == self.v.len {
+            None
+        } else {
+            unsafe {
+                let index = self.index.to_usize();
+                self.index = Index::from(index + 1);
+                Some(ptr::read(self.v.get_unchecked_mut(index)))
+            }
+        }
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let len = self.v.len() - self.index.to_usize();
+        (len, Some(len))
+    }
+}
+
+impl<A: Array> DoubleEndedIterator for IntoIter<A> {
+    #[inline]
+    fn next_back(&mut self) -> Option<A::Item> {
+        if self.index == self.v.len {
+            None
+        } else {
+            unsafe {
+                let new_len = self.v.len() - 1;
+                self.v.set_len(new_len);
+                Some(ptr::read(self.v.get_unchecked_mut(new_len)))
+            }
+        }
+    }
+}
+
+impl<A: Array> ExactSizeIterator for IntoIter<A> { }
+
+impl<A: Array> Drop for IntoIter<A> {
+    fn drop(&mut self) {
+        // panic safety: Set length to 0 before dropping elements.
+        let index = self.index.to_usize();
+        let len = self.v.len();
+        unsafe {
+            self.v.set_len(0);
+            let elements = slice::from_raw_parts_mut(
+                self.v.get_unchecked_mut(index),
+                len - index);
+            ptr::drop_in_place(elements);
+        }
+    }
+}
+
+impl<A: Array> Clone for IntoIter<A>
+where
+    A::Item: Clone,
+{
+    fn clone(&self) -> IntoIter<A> {
+        self.v[self.index.to_usize()..]
+            .iter()
+            .cloned()
+            .collect::<ArrayVec<A>>()
+            .into_iter()
+    }
+}
+
+impl<A: Array> fmt::Debug for IntoIter<A>
+where
+    A::Item: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_list()
+            .entries(&self.v[self.index.to_usize()..])
+            .finish()
+    }
+}
+
+/// A draining iterator for `ArrayVec`.
+pub struct Drain<'a, A> 
+    where A: Array,
+          A::Item: 'a,
+{
+    /// Index of tail to preserve
+    tail_start: usize,
+    /// Length of tail
+    tail_len: usize,
+    /// Current remaining range to remove
+    iter: slice::Iter<'a, A::Item>,
+    vec: *mut ArrayVec<A>,
+}
+
+unsafe impl<'a, A: Array + Sync> Sync for Drain<'a, A> {}
+unsafe impl<'a, A: Array + Send> Send for Drain<'a, A> {}
+
+impl<'a, A: Array> Iterator for Drain<'a, A>
+    where A::Item: 'a,
+{
+    type Item = A::Item;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.iter.next().map(|elt|
+            unsafe {
+                ptr::read(elt as *const _)
+            }
+        )
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.iter.size_hint()
+    }
+}
+
+impl<'a, A: Array> DoubleEndedIterator for Drain<'a, A>
+    where A::Item: 'a,
+{
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.iter.next_back().map(|elt|
+            unsafe {
+                ptr::read(elt as *const _)
+            }
+        )
+    }
+}
+
+impl<'a, A: Array> ExactSizeIterator for Drain<'a, A> where A::Item: 'a {}
+
+impl<'a, A: Array> Drop for Drain<'a, A> 
+    where A::Item: 'a
+{
+    fn drop(&mut self) {
+        // len is currently 0 so panicking while dropping will not cause a double drop.
+
+        // exhaust self first
+        while let Some(_) = self.next() { }
+
+        if self.tail_len > 0 {
+            unsafe {
+                let source_vec = &mut *self.vec;
+                // memmove back untouched tail, update to new length
+                let start = source_vec.len();
+                let tail = self.tail_start;
+                let src = source_vec.as_ptr().offset(tail as isize);
+                let dst = source_vec.as_mut_ptr().offset(start as isize);
+                ptr::copy(src, dst, self.tail_len);
+                source_vec.set_len(start + self.tail_len);
+            }
+        }
+    }
+}
+
+struct ScopeExitGuard<T, Data, F>
+    where F: FnMut(&Data, &mut T)
+{
+    value: T,
+    data: Data,
+    f: F,
+}
+
+impl<T, Data, F> Drop for ScopeExitGuard<T, Data, F>
+    where F: FnMut(&Data, &mut T)
+{
+    fn drop(&mut self) {
+        (self.f)(&self.data, &mut self.value)
+    }
+}
+
+
+
+/// Extend the `ArrayVec` with an iterator.
+/// 
+/// Does not extract more items than there is space for. No error
+/// occurs if there are more iterator elements.
+impl<A: Array> Extend<A::Item> for ArrayVec<A> {
+    fn extend<T: IntoIterator<Item=A::Item>>(&mut self, iter: T) {
+        let take = self.capacity() - self.len();
+        unsafe {
+            let len = self.len();
+            let mut ptr = self.as_mut_ptr().offset(len as isize);
+            // Keep the length in a separate variable, write it back on scope
+            // exit. To help the compiler with alias analysis and stuff.
+            // We update the length to handle panic in the iteration of the
+            // user's iterator, without dropping any elements on the floor.
+            let mut guard = ScopeExitGuard {
+                value: self,
+                data: len,
+                f: |&len, self_| {
+                    self_.set_len(len)
+                }
+            };
+            for elt in iter.into_iter().take(take) {
+                ptr::write(ptr, elt);
+                ptr = ptr.offset(1);
+                guard.data += 1;
+            }
+        }
+    }
+}
+
+/// Create an `ArrayVec` from an iterator.
+/// 
+/// Does not extract more items than there is space for. No error
+/// occurs if there are more iterator elements.
+impl<A: Array> iter::FromIterator<A::Item> for ArrayVec<A> {
+    fn from_iter<T: IntoIterator<Item=A::Item>>(iter: T) -> Self {
+        let mut array = ArrayVec::new();
+        array.extend(iter);
+        array
+    }
+}
+
+impl<A: Array> Clone for ArrayVec<A>
+    where A::Item: Clone
+{
+    fn clone(&self) -> Self {
+        self.iter().cloned().collect()
+    }
+
+    fn clone_from(&mut self, rhs: &Self) {
+        // recursive case for the common prefix
+        let prefix = cmp::min(self.len(), rhs.len());
+        self[..prefix].clone_from_slice(&rhs[..prefix]);
+
+        if prefix < self.len() {
+            // rhs was shorter
+            for _ in 0..self.len() - prefix {
+                self.pop();
+            }
+        } else {
+            let rhs_elems = rhs[self.len()..].iter().cloned();
+            self.extend(rhs_elems);
+        }
+    }
+}
+
+impl<A: Array> Hash for ArrayVec<A>
+    where A::Item: Hash
+{
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        Hash::hash(&**self, state)
+    }
+}
+
+impl<A: Array> PartialEq for ArrayVec<A>
+    where A::Item: PartialEq
+{
+    fn eq(&self, other: &Self) -> bool {
+        **self == **other
+    }
+}
+
+impl<A: Array> PartialEq<[A::Item]> for ArrayVec<A>
+    where A::Item: PartialEq
+{
+    fn eq(&self, other: &[A::Item]) -> bool {
+        **self == *other
+    }
+}
+
+impl<A: Array> Eq for ArrayVec<A> where A::Item: Eq { }
+
+impl<A: Array> Borrow<[A::Item]> for ArrayVec<A> {
+    fn borrow(&self) -> &[A::Item] { self }
+}
+
+impl<A: Array> BorrowMut<[A::Item]> for ArrayVec<A> {
+    fn borrow_mut(&mut self) -> &mut [A::Item] { self }
+}
+
+impl<A: Array> AsRef<[A::Item]> for ArrayVec<A> {
+    fn as_ref(&self) -> &[A::Item] { self }
+}
+
+impl<A: Array> AsMut<[A::Item]> for ArrayVec<A> {
+    fn as_mut(&mut self) -> &mut [A::Item] { self }
+}
+
+impl<A: Array> fmt::Debug for ArrayVec<A> where A::Item: fmt::Debug {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) }
+}
+
+impl<A: Array> Default for ArrayVec<A> {
+    /// Return an empty array
+    fn default() -> ArrayVec<A> {
+        ArrayVec::new()
+    }
+}
+
+impl<A: Array> PartialOrd for ArrayVec<A> where A::Item: PartialOrd {
+    #[inline]
+    fn partial_cmp(&self, other: &ArrayVec<A>) -> Option<cmp::Ordering> {
+        (**self).partial_cmp(other)
+    }
+
+    #[inline]
+    fn lt(&self, other: &Self) -> bool {
+        (**self).lt(other)
+    }
+
+    #[inline]
+    fn le(&self, other: &Self) -> bool {
+        (**self).le(other)
+    }
+
+    #[inline]
+    fn ge(&self, other: &Self) -> bool {
+        (**self).ge(other)
+    }
+
+    #[inline]
+    fn gt(&self, other: &Self) -> bool {
+        (**self).gt(other)
+    }
+}
+
+impl<A: Array> Ord for ArrayVec<A> where A::Item: Ord {
+    fn cmp(&self, other: &ArrayVec<A>) -> cmp::Ordering {
+        (**self).cmp(other)
+    }
+}
+
+#[cfg(feature="std")]
+/// `Write` appends written data to the end of the vector.
+///
+/// Requires `features="std"`.
+impl<A: Array<Item=u8>> io::Write for ArrayVec<A> {
+    fn write(&mut self, data: &[u8]) -> io::Result<usize> {
+        unsafe {
+            let len = self.len();
+            let mut tail = slice::from_raw_parts_mut(self.get_unchecked_mut(len),
+                                                     A::capacity() - len);
+            let result = tail.write(data);
+            if let Ok(written) = result {
+                self.set_len(len + written);
+            }
+            result
+        }
+    }
+    fn flush(&mut self) -> io::Result<()> { Ok(()) }
+}
+
+#[cfg(feature="serde-1")]
+/// Requires crate feature `"serde-1"`
+impl<T: Serialize, A: Array<Item=T>> Serialize for ArrayVec<A> {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where S: Serializer
+    {
+        serializer.collect_seq(self)
+    }
+}
+
+#[cfg(feature="serde-1")]
+/// Requires crate feature `"serde-1"`
+impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Deserialize<'de> for ArrayVec<A> {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where D: Deserializer<'de>
+    {
+        use serde::de::{Visitor, SeqAccess, Error};
+        use std::marker::PhantomData;
+
+        struct ArrayVecVisitor<'de, T: Deserialize<'de>, A: Array<Item=T>>(PhantomData<(&'de (), T, A)>);
+
+        impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Visitor<'de> for ArrayVecVisitor<'de, T, A> {
+            type Value = ArrayVec<A>;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                write!(formatter, "an array with no more than {} items", A::capacity())
+            }
+
+            fn visit_seq<SA>(self, mut seq: SA) -> Result<Self::Value, SA::Error>
+                where SA: SeqAccess<'de>,
+            {
+                let mut values = ArrayVec::<A>::new();
+
+                while let Some(value) = try!(seq.next_element()) {
+                    if let Err(_) = values.try_push(value) {
+                        return Err(SA::Error::invalid_length(A::capacity() + 1, &self));
+                    }
+                }
+
+                Ok(values)
+            }
+        }
+
+        deserializer.deserialize_seq(ArrayVecVisitor::<T, A>(PhantomData))
+    }
+}
diff --git a/rustc_deps/vendor/arrayvec/src/range.rs b/rustc_deps/vendor/arrayvec/src/range.rs
new file mode 100644
index 0000000..f90f5af
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/src/range.rs
@@ -0,0 +1,42 @@
+
+use std::ops::{
+    RangeFull,
+    RangeFrom,
+    RangeTo,
+    Range,
+};
+
+/// `RangeArgument` is implemented by Rust's built-in range types, produced
+/// by range syntax like `..`, `a..`, `..b` or `c..d`.
+///
+/// Note: This is arrayvec's provisional trait, waiting for stable Rust to
+/// provide an equivalent.
+pub trait RangeArgument {
+    #[inline]
+    /// Start index (inclusive)
+    fn start(&self) -> Option<usize> { None }
+    #[inline]
+    /// End index (exclusive)
+    fn end(&self) -> Option<usize> { None }
+}
+
+
+impl RangeArgument for RangeFull {}
+
+impl RangeArgument for RangeFrom<usize> {
+    #[inline]
+    fn start(&self) -> Option<usize> { Some(self.start) }
+}
+
+impl RangeArgument for RangeTo<usize> {
+    #[inline]
+    fn end(&self) -> Option<usize> { Some(self.end) }
+}
+
+impl RangeArgument for Range<usize> {
+    #[inline]
+    fn start(&self) -> Option<usize> { Some(self.start) }
+    #[inline]
+    fn end(&self) -> Option<usize> { Some(self.end) }
+}
+
diff --git a/rustc_deps/vendor/arrayvec/tests/serde.rs b/rustc_deps/vendor/arrayvec/tests/serde.rs
new file mode 100644
index 0000000..62acf25
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/tests/serde.rs
@@ -0,0 +1,79 @@
+#![cfg(feature = "serde-1")]
+extern crate arrayvec;
+extern crate serde_test;
+
+mod array_vec {
+    use arrayvec::ArrayVec;
+
+    use serde_test::{Token, assert_tokens, assert_de_tokens_error};
+
+    #[test]
+    fn test_ser_de_empty() {
+        let vec = ArrayVec::<[u32; 0]>::new();
+
+        assert_tokens(&vec, &[
+            Token::Seq { len: Some(0) },
+            Token::SeqEnd,
+        ]);
+    }
+
+
+    #[test]
+    fn test_ser_de() {
+        let mut vec = ArrayVec::<[u32; 3]>::new();
+        vec.push(20);
+        vec.push(55);
+        vec.push(123);
+
+        assert_tokens(&vec, &[
+            Token::Seq { len: Some(3) },
+            Token::U32(20),
+            Token::U32(55),
+            Token::U32(123),
+            Token::SeqEnd,
+        ]);
+    }
+
+    #[test]
+    fn test_de_too_large() {
+        assert_de_tokens_error::<ArrayVec<[u32; 2]>>(&[
+            Token::Seq { len: Some(3) },
+            Token::U32(13),
+            Token::U32(42),
+            Token::U32(68),
+        ], "invalid length 3, expected an array with no more than 2 items");
+    }
+}
+
+mod array_string {
+    use arrayvec::ArrayString;
+
+    use serde_test::{Token, assert_tokens, assert_de_tokens_error};
+
+    #[test]
+    fn test_ser_de_empty() {
+        let string = ArrayString::<[u8; 0]>::new();
+
+        assert_tokens(&string, &[
+            Token::Str(""),
+        ]);
+    }
+
+
+    #[test]
+    fn test_ser_de() {
+        let string = ArrayString::<[u8; 9]>::from("1234 abcd")
+            .expect("expected exact specified capacity to be enough");
+
+        assert_tokens(&string, &[
+            Token::Str("1234 abcd"),
+        ]);
+    }
+
+    #[test]
+    fn test_de_too_large() {
+        assert_de_tokens_error::<ArrayString<[u8; 2]>>(&[
+            Token::Str("afd")
+        ], "invalid length 3, expected a string no more than 2 bytes long");
+    }
+}
diff --git a/rustc_deps/vendor/arrayvec/tests/tests.rs b/rustc_deps/vendor/arrayvec/tests/tests.rs
new file mode 100644
index 0000000..3261df3
--- /dev/null
+++ b/rustc_deps/vendor/arrayvec/tests/tests.rs
@@ -0,0 +1,502 @@
+extern crate arrayvec;
+#[macro_use] extern crate matches;
+
+use arrayvec::ArrayVec;
+use arrayvec::ArrayString;
+use std::mem;
+use arrayvec::CapacityError;
+
+use std::collections::HashMap;
+
+
+#[test]
+fn test_simple() {
+    use std::ops::Add;
+
+    let mut vec: ArrayVec<[Vec<i32>; 3]> = ArrayVec::new();
+
+    vec.push(vec![1, 2, 3, 4]);
+    vec.push(vec![10]);
+    vec.push(vec![-1, 13, -2]);
+
+    for elt in &vec {
+        assert_eq!(elt.iter().fold(0, Add::add), 10);
+    }
+
+    let sum_len = vec.into_iter().map(|x| x.len()).fold(0, Add::add);
+    assert_eq!(sum_len, 8);
+}
+
+#[test]
+fn test_u16_index() {
+    const N: usize = 4096;
+    let mut vec: ArrayVec<[_; N]> = ArrayVec::new();
+    for _ in 0..N {
+        assert!(vec.try_push(1u8).is_ok());
+    }
+    assert!(vec.try_push(0).is_err());
+    assert_eq!(vec.len(), N);
+}
+
+#[test]
+fn test_iter() {
+    let mut iter = ArrayVec::from([1, 2, 3]).into_iter();
+    assert_eq!(iter.size_hint(), (3, Some(3)));
+    assert_eq!(iter.next_back(), Some(3));
+    assert_eq!(iter.next(), Some(1));
+    assert_eq!(iter.next_back(), Some(2));
+    assert_eq!(iter.size_hint(), (0, Some(0)));
+    assert_eq!(iter.next_back(), None);
+}
+
+#[test]
+fn test_drop() {
+    use std::cell::Cell;
+
+    let flag = &Cell::new(0);
+
+    #[derive(Clone)]
+    struct Bump<'a>(&'a Cell<i32>);
+
+    impl<'a> Drop for Bump<'a> {
+        fn drop(&mut self) {
+            let n = self.0.get();
+            self.0.set(n + 1);
+        }
+    }
+
+    {
+        let mut array = ArrayVec::<[Bump; 128]>::new();
+        array.push(Bump(flag));
+        array.push(Bump(flag));
+    }
+    assert_eq!(flag.get(), 2);
+
+    // test something with the nullable pointer optimization
+    flag.set(0);
+
+    {
+        let mut array = ArrayVec::<[_; 3]>::new();
+        array.push(vec![Bump(flag)]);
+        array.push(vec![Bump(flag), Bump(flag)]);
+        array.push(vec![]);
+        let push4 = array.try_push(vec![Bump(flag)]);
+        assert_eq!(flag.get(), 0);
+        drop(push4);
+        assert_eq!(flag.get(), 1);
+        drop(array.pop());
+        assert_eq!(flag.get(), 1);
+        drop(array.pop());
+        assert_eq!(flag.get(), 3);
+    }
+
+    assert_eq!(flag.get(), 4);
+
+    // test into_inner
+    flag.set(0);
+    {
+        let mut array = ArrayVec::<[_; 3]>::new();
+        array.push(Bump(flag));
+        array.push(Bump(flag));
+        array.push(Bump(flag));
+        let inner = array.into_inner();
+        assert!(inner.is_ok());
+        assert_eq!(flag.get(), 0);
+        drop(inner);
+        assert_eq!(flag.get(), 3);
+    }
+
+    // test cloning into_iter
+    flag.set(0);
+    {
+        let mut array = ArrayVec::<[_; 3]>::new();
+        array.push(Bump(flag));
+        array.push(Bump(flag));
+        array.push(Bump(flag));
+        let mut iter = array.into_iter();
+        assert_eq!(flag.get(), 0);
+        iter.next();
+        assert_eq!(flag.get(), 1);
+        let clone = iter.clone();
+        assert_eq!(flag.get(), 1);
+        drop(clone);
+        assert_eq!(flag.get(), 3);
+        drop(iter);
+        assert_eq!(flag.get(), 5);
+    }
+}
+
+#[test]
+fn test_extend() {
+    let mut range = 0..10;
+
+    let mut array: ArrayVec<[_; 5]> = range.by_ref().collect();
+    assert_eq!(&array[..], &[0, 1, 2, 3, 4]);
+    assert_eq!(range.next(), Some(5));
+
+    array.extend(range.by_ref());
+    assert_eq!(range.next(), Some(6));
+
+    let mut array: ArrayVec<[_; 10]> = (0..3).collect();
+    assert_eq!(&array[..], &[0, 1, 2]);
+    array.extend(3..5);
+    assert_eq!(&array[..], &[0, 1, 2, 3, 4]);
+}
+
+#[test]
+fn test_is_send_sync() {
+    let data = ArrayVec::<[Vec<i32>; 5]>::new();
+    &data as &Send;
+    &data as &Sync;
+}
+
+#[test]
+fn test_compact_size() {
+    // Future rust will kill these drop flags!
+    // 4 elements size + 1 len + 1 enum tag + [1 drop flag]
+    type ByteArray = ArrayVec<[u8; 4]>;
+    println!("{}", mem::size_of::<ByteArray>());
+    assert!(mem::size_of::<ByteArray>() <= 8);
+
+    // 12 element size + 1 enum tag + 3 padding + 1 len + 1 drop flag + 2 padding
+    type QuadArray = ArrayVec<[u32; 3]>;
+    println!("{}", mem::size_of::<QuadArray>());
+    assert!(mem::size_of::<QuadArray>() <= 24);
+}
+
+#[test]
+fn test_drain() {
+    let mut v = ArrayVec::from([0; 8]);
+    v.pop();
+    v.drain(0..7);
+    assert_eq!(&v[..], &[]);
+
+    v.extend(0..);
+    v.drain(1..4);
+    assert_eq!(&v[..], &[0, 4, 5, 6, 7]);
+    let u: ArrayVec<[_; 3]> = v.drain(1..4).rev().collect();
+    assert_eq!(&u[..], &[6, 5, 4]);
+    assert_eq!(&v[..], &[0, 7]);
+    v.drain(..);
+    assert_eq!(&v[..], &[]);
+}
+
+#[test]
+fn test_retain() {
+    let mut v = ArrayVec::from([0; 8]);
+    for (i, elt) in v.iter_mut().enumerate() {
+        *elt = i;
+    }
+    v.retain(|_| true);
+    assert_eq!(&v[..], &[0, 1, 2, 3, 4, 5, 6, 7]);
+    v.retain(|elt| {
+        *elt /= 2;
+        *elt % 2 == 0
+    });
+    assert_eq!(&v[..], &[0, 0, 2, 2]);
+    v.retain(|_| false);
+    assert_eq!(&v[..], &[]);
+}
+
+#[test]
+#[should_panic]
+fn test_drain_oob() {
+    let mut v = ArrayVec::from([0; 8]);
+    v.pop();
+    v.drain(0..8);
+}
+
+#[test]
+#[should_panic]
+fn test_drop_panic() {
+    struct DropPanic;
+
+    impl Drop for DropPanic {
+        fn drop(&mut self) {
+            panic!("drop");
+        }
+    }
+
+    let mut array = ArrayVec::<[DropPanic; 1]>::new();
+    array.push(DropPanic);
+}
+
+#[test]
+#[should_panic]
+fn test_drop_panic_into_iter() {
+    struct DropPanic;
+
+    impl Drop for DropPanic {
+        fn drop(&mut self) {
+            panic!("drop");
+        }
+    }
+
+    let mut array = ArrayVec::<[DropPanic; 1]>::new();
+    array.push(DropPanic);
+    array.into_iter();
+}
+
+#[test]
+fn test_insert() {
+    let mut v = ArrayVec::from([]);
+    assert_matches!(v.try_push(1), Err(_));
+
+    let mut v = ArrayVec::<[_; 3]>::new();
+    v.insert(0, 0);
+    v.insert(1, 1);
+    //let ret1 = v.try_insert(3, 3);
+    //assert_matches!(ret1, Err(InsertError::OutOfBounds(_)));
+    assert_eq!(&v[..], &[0, 1]);
+    v.insert(2, 2);
+    assert_eq!(&v[..], &[0, 1, 2]);
+
+    let ret2 = v.try_insert(1, 9);
+    assert_eq!(&v[..], &[0, 1, 2]);
+    assert_matches!(ret2, Err(_));
+
+    let mut v = ArrayVec::from([2]);
+    assert_matches!(v.try_insert(0, 1), Err(CapacityError { .. }));
+    assert_matches!(v.try_insert(1, 1), Err(CapacityError { .. }));
+    //assert_matches!(v.try_insert(2, 1), Err(CapacityError { .. }));
+}
+
+#[test]
+fn test_into_inner_1() {
+    let mut v = ArrayVec::from([1, 2]);
+    v.pop();
+    let u = v.clone();
+    assert_eq!(v.into_inner(), Err(u));
+}
+
+#[test]
+fn test_into_inner_2() {
+    let mut v = ArrayVec::<[String; 4]>::new();
+    v.push("a".into());
+    v.push("b".into());
+    v.push("c".into());
+    v.push("d".into());
+    assert_eq!(v.into_inner().unwrap(), ["a", "b", "c", "d"]);
+}
+
+#[test]
+fn test_into_inner_3_() {
+    let mut v = ArrayVec::<[i32; 4]>::new();
+    v.extend(1..);
+    assert_eq!(v.into_inner().unwrap(), [1, 2, 3, 4]);
+}
+
+#[test]
+fn test_write() {
+    use std::io::Write;
+    let mut v = ArrayVec::<[_; 8]>::new();
+    write!(&mut v, "\x01\x02\x03").unwrap();
+    assert_eq!(&v[..], &[1, 2, 3]);
+    let r = v.write(&[9; 16]).unwrap();
+    assert_eq!(r, 5);
+    assert_eq!(&v[..], &[1, 2, 3, 9, 9, 9, 9, 9]);
+}
+
+#[test]
+fn array_clone_from() {
+    let mut v = ArrayVec::<[_; 4]>::new();
+    v.push(vec![1, 2]);
+    v.push(vec![3, 4, 5]);
+    v.push(vec![6]);
+    let reference = v.to_vec();
+    let mut u = ArrayVec::<[_; 4]>::new();
+    u.clone_from(&v);
+    assert_eq!(&u, &reference[..]);
+
+    let mut t = ArrayVec::<[_; 4]>::new();
+    t.push(vec![97]);
+    t.push(vec![]);
+    t.push(vec![5, 6, 2]);
+    t.push(vec![2]);
+    t.clone_from(&v);
+    assert_eq!(&t, &reference[..]);
+    t.clear();
+    t.clone_from(&v);
+    assert_eq!(&t, &reference[..]);
+}
+
+#[test]
+fn test_string() {
+    use std::error::Error;
+
+    let text = "hello world";
+    let mut s = ArrayString::<[_; 16]>::new();
+    s.try_push_str(text).unwrap();
+    assert_eq!(&s, text);
+    assert_eq!(text, &s);
+
+    // Make sure Hash / Eq / Borrow match up so we can use HashMap
+    let mut map = HashMap::new();
+    map.insert(s, 1);
+    assert_eq!(map[text], 1);
+
+    let mut t = ArrayString::<[_; 2]>::new();
+    assert!(t.try_push_str(text).is_err());
+    assert_eq!(&t, "");
+
+    t.push_str("ab");
+    // DerefMut
+    let tmut: &mut str = &mut t;
+    assert_eq!(tmut, "ab");
+
+    // Test Error trait / try
+    let t = || -> Result<(), Box<Error>> {
+        let mut t = ArrayString::<[_; 2]>::new();
+        try!(t.try_push_str(text));
+        Ok(())
+    }();
+    assert!(t.is_err());
+}
+
+#[test]
+fn test_string_from() {
+    let text = "hello world";
+	// Test `from` constructor
+    let u = ArrayString::<[_; 11]>::from(text).unwrap();
+    assert_eq!(&u, text);
+    assert_eq!(u.len(), text.len());
+}
+
+#[test]
+fn test_string_from_bytes() {
+    let text = "hello world";
+    let u = ArrayString::from_byte_string(b"hello world").unwrap();
+    assert_eq!(&u, text);
+    assert_eq!(u.len(), text.len());
+}
+
+#[test]
+fn test_string_clone() {
+    let text = "hi";
+    let mut s = ArrayString::<[_; 4]>::new();
+    s.push_str("abcd");
+    let t = ArrayString::<[_; 4]>::from(text).unwrap();
+    s.clone_from(&t);
+    assert_eq!(&t, &s);
+}
+
+#[test]
+fn test_string_push() {
+    let text = "abcαβγ";
+    let mut s = ArrayString::<[_; 8]>::new();
+    for c in text.chars() {
+        if let Err(_) = s.try_push(c) {
+            break;
+        }
+    }
+    assert_eq!("abcαβ", &s[..]);
+    s.push('x');
+    assert_eq!("abcαβx", &s[..]);
+    assert!(s.try_push('x').is_err());
+}
+
+
+#[test]
+fn test_insert_at_length() {
+    let mut v = ArrayVec::<[_; 8]>::new();
+    let result1 = v.try_insert(0, "a");
+    let result2 = v.try_insert(1, "b");
+    assert!(result1.is_ok() && result2.is_ok());
+    assert_eq!(&v[..], &["a", "b"]);
+}
+
+#[should_panic]
+#[test]
+fn test_insert_out_of_bounds() {
+    let mut v = ArrayVec::<[_; 8]>::new();
+    let _ = v.try_insert(1, "test");
+}
+
+/*
+ * insert that pushes out the last
+    let mut u = ArrayVec::from([1, 2, 3, 4]);
+    let ret = u.try_insert(3, 99);
+    assert_eq!(&u[..], &[1, 2, 3, 99]);
+    assert_matches!(ret, Err(_));
+    let ret = u.try_insert(4, 77);
+    assert_eq!(&u[..], &[1, 2, 3, 99]);
+    assert_matches!(ret, Err(_));
+*/
+
+#[test]
+fn test_drop_in_insert() {
+    use std::cell::Cell;
+
+    let flag = &Cell::new(0);
+
+    struct Bump<'a>(&'a Cell<i32>);
+
+    impl<'a> Drop for Bump<'a> {
+        fn drop(&mut self) {
+            let n = self.0.get();
+            self.0.set(n + 1);
+        }
+    }
+
+    flag.set(0);
+
+    {
+        let mut array = ArrayVec::<[_; 2]>::new();
+        array.push(Bump(flag));
+        array.insert(0, Bump(flag));
+        assert_eq!(flag.get(), 0);
+        let ret = array.try_insert(1, Bump(flag));
+        assert_eq!(flag.get(), 0);
+        assert_matches!(ret, Err(_));
+        drop(ret);
+        assert_eq!(flag.get(), 1);
+    }
+    assert_eq!(flag.get(), 3);
+}
+
+#[test]
+fn test_pop_at() {
+    let mut v = ArrayVec::<[String; 4]>::new();
+    let s = String::from;
+    v.push(s("a"));
+    v.push(s("b"));
+    v.push(s("c"));
+    v.push(s("d"));
+
+    assert_eq!(v.pop_at(4), None);
+    assert_eq!(v.pop_at(1), Some(s("b")));
+    assert_eq!(v.pop_at(1), Some(s("c")));
+    assert_eq!(v.pop_at(2), None);
+    assert_eq!(&v[..], &["a", "d"]);
+}
+
+#[test]
+fn test_sizes() {
+    let v = ArrayVec::from([0u8; 1 << 16]);
+    assert_eq!(vec![0u8; v.len()], &v[..]);
+}
+
+#[test]
+fn test_default() {
+    use std::net;
+    let s: ArrayString<[u8; 4]> = Default::default();
+    // Something without `Default` implementation.
+    let v: ArrayVec<[net::TcpStream; 4]> = Default::default();
+    assert_eq!(s.len(), 0);
+    assert_eq!(v.len(), 0);
+}
+
+#[cfg(feature="array-sizes-33-128")]
+#[test]
+fn test_sizes_33_128() {
+    ArrayVec::from([0u8; 52]);
+    ArrayVec::from([0u8; 127]);
+}
+
+#[cfg(feature="array-sizes-129-255")]
+#[test]
+fn test_sizes_129_255() {
+    ArrayVec::from([0u8; 237]);
+    ArrayVec::from([0u8; 255]);
+}
+
diff --git a/rustc_deps/vendor/crossbeam-0.3.2/.cargo-checksum.json b/rustc_deps/vendor/crossbeam-0.3.2/.cargo-checksum.json
new file mode 100644
index 0000000..062e16a
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"a064061f90192e227cc3291dd61e14d77b93b66da16cfbc9c9cdd1b6877984e7","Cargo.toml":"c2d5efb9e1f8ecd4d772d06f3a1d4d994263ecb15799340ad6504a0661af2f3a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"07555de06b04dd127455cfecf02c57a82de42f7043e3e4df8cd9e49c523a9216","src/bin/bench.rs":"8a20b1a9df2f9795160fdc12aaa24141f91773061747f69e62797c1e42ec48f8","src/bin/extra_impls/mod.rs":"b72e67187cbfc1672faacd7d906604f3adc0c7540c781db88c6f4f1726229db9","src/bin/extra_impls/mpsc_queue.rs":"94551cbe0075c40472bae74cb500070c5c621e3690e15c1374b56c5cb7dd6639","src/bin/stress-msq.rs":"f49ba9adb0308013dbd7ed748572659c8b25d045e20609a21ed29ce35784f8f7","src/cache_padded.rs":"9d6c947d710774c5732204234e03699c93594b1651b65779d941612e168bde58","src/epoch/atomic.rs":"ec73c5e271b6b16bc489d3a6b47a48c5ef21cd1d8320d5ed01a6cac271afb42a","src/epoch/garbage.rs":"d8ce282b10fb2b05b9296a8ea25a06329f62164afde9ce099c31325eee81b1d1","src/epoch/global.rs":"75c805dfd4c97f5df5e33c9eaeeb939b56038d97f55aa158b68d22e2eb66b8d3","src/epoch/guard.rs":"36b50440665c2ae5159305673a66c7c879d050112887e0f895ed4d5618b009ea","src/epoch/local.rs":"61a01f1fefe03a74ba8e8cf5219251fa7d0aaaf9fcb914c864e84d1c1eb133bb","src/epoch/mod.rs":"4eb0bd23238451ac71a4e9c5ebce803e7e2812472988dc3ff25ac37a0b120ffc","src/epoch/participant.rs":"a4f43475bc1b5dd8b2a4d04ba8309d273968f88cfb50622c5ffbd2651d06e405","src/epoch/participants.rs":"557de71e0ef621af18da309fb5a3e49b8d94c4d34e7aba50af64964277967b50","src/lib.rs":"1d3c207f21f91c1b3b994e3ba442511b382dccea384c176df905529614bd24db","src/scoped.rs":"f22cb07df423b793eb7926188c36692fa900ff31abe54121d1d3b2703e47b564","src/sync/arc_cell.rs":"d12dcaca3d59cb0a7c34470dff60c11cb8e25ecde87baf3940bd0747bb107672","src/sync/atomic_option.rs":"32ae3979951d08b1b760048ed1794f33324ace9bedd5d9ac64de09e4b39e7c70","src/sync/chase_lev.rs":"7fa91ea0d7486c1771b8011665b8f3d0e29b7ebc90037a4a2ae5565e2a2c058c","src/sync/mod.rs":"35e5f793530e198e891e6ef619da161bbcd31a1de1419dc5b9e9a954d3542c02","src/sync/ms_queue.rs":"bb8c849c37bef65795ce355add3177aaa7fbed106cbcece8f8c3c4cf2567df77","src/sync/seg_queue.rs":"d522e6c311c7798fd266539879f6cc42cf8ae1ff5068649bad6aada24820b0aa","src/sync/treiber_stack.rs":"0e4e360c89efaf0f1d7d5880cd3cbb79bdb243f16afb4ebb7d33c4efa5d92b85"},"package":"24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19"}
\ No newline at end of file
diff --git a/rustc_deps/vendor/crossbeam-0.3.2/CHANGELOG.md b/rustc_deps/vendor/crossbeam-0.3.2/CHANGELOG.md
new file mode 100644
index 0000000..adea600
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/CHANGELOG.md
@@ -0,0 +1,22 @@
+# Version 0.3
+
+- Introduced `ScopedThreadBuilder` with the ability to name threads and set stack size
+- `Worker` methods in the Chase-Lev deque don't require mutable access anymore
+- Fixed a bug when unblocking `pop()` in `MsQueue`
+- Implemented `Drop` for `MsQueue`, `SegQueue`, and `TreiberStack`
+- Implemented `Default` for `TreiberStack`
+- Added `is_empty` to `SegQueue`
+- Renamed `mem::epoch` to `epoch`
+- Other bug fixes
+
+# Version 0.2
+
+- Changed existing non-blocking `pop` methods to `try_pop`
+- Added blocking `pop` support to Michael-Scott queue
+- Added Chase-Lev work-stealing deque
+
+# Version 0.1
+
+- Added [epoch-based memory management](http://aturon.github.io/blog/2015/08/27/epoch/)
+- Added Michael-Scott queue
+- Added Segmented array queue
diff --git a/rustc_deps/vendor/crossbeam-0.3.2/Cargo.toml b/rustc_deps/vendor/crossbeam-0.3.2/Cargo.toml
new file mode 100644
index 0000000..7577895
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/Cargo.toml
@@ -0,0 +1,27 @@
+# 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 believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "crossbeam"
+version = "0.3.2"
+authors = ["Aaron Turon <aturon@mozilla.com>"]
+description = "Support for lock-free data structures, synchronizers, and parallel programming"
+documentation = "https://docs.rs/crossbeam"
+readme = "README.md"
+categories = ["concurrency", "data-structures"]
+license = "Apache-2.0/MIT"
+repository = "https://github.com/crossbeam-rs/crossbeam"
+[dev-dependencies.rand]
+version = "0.3"
+
+[features]
+nightly = []
diff --git a/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-APACHE b/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-APACHE
@@ -0,0 +1,201 @@
+                              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/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-MIT b/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-MIT
new file mode 100644
index 0000000..e69282e
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2015 The Rust Project Developers
+
+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/rustc_deps/vendor/crossbeam-0.3.2/README.md b/rustc_deps/vendor/crossbeam-0.3.2/README.md
new file mode 100644
index 0000000..d424d11
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/README.md
@@ -0,0 +1,46 @@
+# Notice
+
+This crate is outdated. The Crossbeam project is currently in a transition
+period. We are rewriting the epoch garbage collector, as well as several
+other utilities and adding new structures. To follow the progress, please
+take a look at other crates in the project [here](https://github.com/crossbeam-rs).
+When the transition is complete, this crate will be updated to use the new code.
+
+# Crossbeam: support for concurrent and parallel programming
+
+[![Build Status](https://travis-ci.org/crossbeam-rs/crossbeam.svg?branch=master)](https://travis-ci.org/crossbeam-rs/crossbeam)
+
+
+This crate is an early work in progress. The focus for the moment is
+concurrency:
+
+- **Non-blocking data structures**. These data structures allow for high
+performance, highly-concurrent access, much superior to wrapping with a
+`Mutex`. Ultimately the goal is to include stacks, queues, deques, bags, sets
+and maps.
+
+- **Memory management**. Because non-blocking data structures avoid global
+synchronization, it is not easy to tell when internal data can be safely
+freed. The `epoch` module provides generic, easy to use, and high-performance APIs
+for managing memory in these cases.
+
+- **Synchronization**. The standard library provides a few synchronization
+primitives (locks, barriers, etc) but this crate seeks to expand that set to
+include more advanced/niche primitives, as well as userspace alternatives.
+
+- **Scoped thread API**. Finally, the crate provides a "scoped" thread API,
+making it possible to spawn threads that share stack data with their parents.
+
+# Usage
+
+To use Crossbeam, add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+crossbeam = "0.3.0"
+```
+
+For examples of what Crossbeam is capable of, see the
+[documentation][docs].
+
+[docs]: https://docs.rs/crossbeam/
diff --git a/rustc_deps/vendor/crossbeam/src/bin/bench.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/bin/bench.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/bin/bench.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/bin/bench.rs
diff --git a/rustc_deps/vendor/crossbeam/src/bin/extra_impls/mod.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/bin/extra_impls/mod.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/bin/extra_impls/mod.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/bin/extra_impls/mod.rs
diff --git a/rustc_deps/vendor/crossbeam/src/bin/extra_impls/mpsc_queue.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/bin/extra_impls/mpsc_queue.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/bin/extra_impls/mpsc_queue.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/bin/extra_impls/mpsc_queue.rs
diff --git a/rustc_deps/vendor/crossbeam/src/bin/stress-msq.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/bin/stress-msq.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/bin/stress-msq.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/bin/stress-msq.rs
diff --git a/rustc_deps/vendor/crossbeam/src/cache_padded.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/cache_padded.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/cache_padded.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/cache_padded.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/atomic.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/atomic.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/atomic.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/atomic.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/garbage.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/garbage.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/garbage.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/garbage.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/global.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/global.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/global.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/global.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/guard.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/guard.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/guard.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/guard.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/local.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/local.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/local.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/local.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/mod.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/mod.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/mod.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/mod.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/participant.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/participant.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/participant.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/participant.rs
diff --git a/rustc_deps/vendor/crossbeam/src/epoch/participants.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/epoch/participants.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/epoch/participants.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/epoch/participants.rs
diff --git a/rustc_deps/vendor/crossbeam-0.3.2/src/lib.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/lib.rs
new file mode 100644
index 0000000..fbaee22
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-0.3.2/src/lib.rs
@@ -0,0 +1,68 @@
+//! Support for concurrent and parallel programming.
+//!
+//! This crate is an early work in progress. The focus for the moment is
+//! concurrency:
+//!
+//! - **Non-blocking data structures**. These data structures allow for high
+//! performance, highly-concurrent access, much superior to wrapping with a
+//! `Mutex`. Ultimately the goal is to include stacks, queues, deques, bags,
+//! sets and maps. These live in the `sync` module.
+//!
+//! - **Memory management**. Because non-blocking data structures avoid global
+//! synchronization, it is not easy to tell when internal data can be safely
+//! freed. The `mem` module provides generic, easy to use, and high-performance
+//! APIs for managing memory in these cases. These live in the `mem` module.
+//!
+//! - **Synchronization**. The standard library provides a few synchronization
+//! primitives (locks, barriers, etc) but this crate seeks to expand that set
+//! to include more advanced/niche primitives, as well as userspace
+//! alternatives. These live in the `sync` module.
+//!
+//! - **Scoped thread API**. Finally, the crate provides a "scoped" thread API,
+//! making it possible to spawn threads that share stack data with their
+//! parents. This functionality is exported at the top-level.
+
+//#![deny(missing_docs)]
+
+#![cfg_attr(feature = "nightly",
+            feature(const_fn, repr_simd, optin_builtin_traits))]
+
+use std::thread;
+use std::io;
+
+pub use scoped::{scope, Scope, ScopedJoinHandle};
+
+pub mod epoch;
+pub mod sync;
+mod scoped;
+
+mod cache_padded;
+pub use self::cache_padded::{CachePadded, ZerosValid};
+
+#[doc(hidden)]
+trait FnBox {
+    fn call_box(self: Box<Self>);
+}
+
+impl<F: FnOnce()> FnBox for F {
+    fn call_box(self: Box<Self>) { (*self)() }
+}
+
+/// Like `std::thread::spawn`, but without the closure bounds.
+pub unsafe fn spawn_unsafe<'a, F>(f: F) -> thread::JoinHandle<()> where F: FnOnce() + Send + 'a {
+    let builder = thread::Builder::new();
+    builder_spawn_unsafe(builder, f).unwrap()
+}
+
+/// Like `std::thread::Builder::spawn`, but without the closure bounds.
+pub unsafe fn builder_spawn_unsafe<'a, F>(builder: thread::Builder, f: F)
+        -> io::Result<thread::JoinHandle<()>>
+    where F: FnOnce() + Send + 'a
+{
+    use std::mem;
+
+    let closure: Box<FnBox + 'a> = Box::new(f);
+    let closure: Box<FnBox + Send> = mem::transmute(closure);
+    builder.spawn(move || closure.call_box())
+}
+
diff --git a/rustc_deps/vendor/crossbeam/src/scoped.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/scoped.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/scoped.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/scoped.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/arc_cell.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/arc_cell.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/arc_cell.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/arc_cell.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/atomic_option.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/atomic_option.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/atomic_option.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/atomic_option.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/chase_lev.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/chase_lev.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/chase_lev.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/chase_lev.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/mod.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/mod.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/mod.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/mod.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/ms_queue.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/ms_queue.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/ms_queue.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/ms_queue.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/seg_queue.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/seg_queue.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/seg_queue.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/seg_queue.rs
diff --git a/rustc_deps/vendor/crossbeam/src/sync/treiber_stack.rs b/rustc_deps/vendor/crossbeam-0.3.2/src/sync/treiber_stack.rs
similarity index 100%
rename from rustc_deps/vendor/crossbeam/src/sync/treiber_stack.rs
rename to rustc_deps/vendor/crossbeam-0.3.2/src/sync/treiber_stack.rs
diff --git a/rustc_deps/vendor/crossbeam-channel/.cargo-checksum.json b/rustc_deps/vendor/crossbeam-channel/.cargo-checksum.json
new file mode 100644
index 0000000..466e310
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"f7bdf6e5cc3f973cd6d1a56579bcebc16d1978de8c651c8946958f63a7a87fb6","Cargo.toml":"76b69678b5590ca7ae49d4c0f176f591b0b161cc39e5f16468d756c5be368e66","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-THIRD-PARTY":"924a49392dc8304def57586be4ebd69aaf51e16fd245b55b4b69ad2cce6b715a","README.md":"1d2c2d543ed990efb23b2e4691ee772b05540cb62b1366857dd15e0d2905187d","examples/fibonacci.rs":"8755bcb9cf05e391d8679fbb51db40ed9692703c3b66341cd1c1e4cca2068874","examples/matching.rs":"d27469760d9198fba3e544f07d770c2054fad02a9b36d10e1523fb18899f47aa","examples/stopwatch.rs":"170fbfedadb6f466384030aa48b5aefd380c8d7353c9799fdd9ee210bff77cb5","src/channel.rs":"8fa45279308806fd18f74d01f650d49d6644d49ce9b0cd94d4e5e97e46a42a5b","src/context.rs":"16841fe87ce929d66c59e192d47cb0a2e747abb13a577b25ce946b7fd489307e","src/err.rs":"6c8e4a8ee252ba58d752a52dbda4eede5ee6f806b6da30cc4fef2af2a8e8ee7f","src/flavors/after.rs":"28d6837d2483b5668414cba799019990405082d8c1950dc4402bf9397ad710c2","src/flavors/array.rs":"7be1f8189178d084ce0e59f932d68b3549b87d0d50528d9f7d06a8152843dde5","src/flavors/list.rs":"dc1db17387c18a16f5d2987f92e276751c791efd543440aac05e543830c3366c","src/flavors/mod.rs":"a5af9b6105207e293c0d64928b4486fb1da9bfe0318354c66c8b5069e41ec31f","src/flavors/never.rs":"43eb51269d93b2476dce22c347928f8982e963ae71f45d3f20514663918a20ef","src/flavors/tick.rs":"945f42512c495b41920cf568c723aa0ee86b60ad8291295d86d652826ad58d9c","src/flavors/zero.rs":"98687629cc1dc89040029a3e5a2fea5b92c1db8cfefefe3f645fef767539ad8b","src/lib.rs":"09d8224118ac9939710cef655379453f1349eeab6c9ba4d20321ab1183d81edf","src/select.rs":"fffa5d10b99fa1ba37cfe28df93e19adfa69e54ef9632c3a2ac61770a206cd03","src/select_macro.rs":"ffb3b5ada9f46e0704fc317760557c64e1802537dccc6a49f36a506cc3e451fe","src/utils.rs":"4c5ec733405c6001140ff50ba85df475b12c911ff1b6ea6f738eca30322f0c4d","src/waker.rs":"18766cb78968994f69a23b49e89da82a63b6580eeb40406efcf960aac4c0d7ab","tests/after.rs":"c272f02c9fa995b69c3201693ed2b81cb0cff35fc615e81c993e8c29da5a8821","tests/array.rs":"e632182678368ccb3da0bdacd34898c33b9f5aefb6c1680570e2d7ad85aee7f3","tests/golang.rs":"22c4532f0d6ec3098fdfaeae0a9a2fb6e32ea7af42ab599c1bd8bd1def13d6e0","tests/iter.rs":"e2369a5489f9c830d819e04d829728572bf8ea62302b3465d15eaf06c7a14f88","tests/list.rs":"a10589fa6e32746d1e743f0fa7c90a8d9e071125f471ea3897878b4b336f6f85","tests/mpsc.rs":"a53f990af21964a6872e27fb0c592a9948b3b4e74c94406930b6037b87a790c1","tests/never.rs":"c2742f8736824d4297928b74184de2c6e66fd63d3b8026e7636edff462992968","tests/select.rs":"2c407606eb0ceaf9d46e34c614ea6e53431c3bc9cb290422a6872cb2f3d1fee6","tests/select_macro.rs":"678602ba9df290570910041037bbec819f834ac11efb2e90b5cccb5b4fa02e19","tests/thread_locals.rs":"a06c8fee262c6e062351bf821f7a48725f33666597a9d5a73f28912f1c85ef52","tests/tick.rs":"3ecd594f2d1b26946dd426acdebe9a6c5ce9eb83a96b62c970f83085bc2d4db1","tests/zero.rs":"118a82e54a3f93a3426954a137da85c50e4659b398693fb548105219daffdd5e"},"package":"0ac88e108fa40799b39c08eb2a93bedf4cc99a9e5577f08ddf6dd6134ae65bf0"}
\ No newline at end of file
diff --git a/rustc_deps/vendor/crossbeam-channel/CHANGELOG.md b/rustc_deps/vendor/crossbeam-channel/CHANGELOG.md
new file mode 100644
index 0000000..57198a0
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/CHANGELOG.md
@@ -0,0 +1,101 @@
+# Version 0.3.2
+
+- More elaborate licensing notices.
+
+# Version 0.3.1
+
+- Update `crossbeam-utils` to `0.6`.
+
+# Version 0.3.0
+
+- Add a special `never` channel type.
+- Dropping all receivers now closes the channel.
+- The interface of sending and receiving methods is now very similar to those in v0.1.
+- The syntax for `send` in `select!` is now `send(sender, msg) -> res => body`.
+- The syntax for `recv` in `select!` is now `recv(receiver) -> res => body`.
+- New, more efficient interface for `Select` without callbacks.
+- Timeouts can be specified in `select!`.
+
+# Version 0.2.6
+
+- `Select` struct that can add cases dynamically.
+- More documentation (in particular, the FAQ section).
+- Optimize contended sends/receives in unbounded channels.
+
+# Version 0.2.5
+
+- Use `LocalKey::try_with` instead of `LocalKey::with`.
+- Remove helper macros `__crossbeam_channel*`.
+
+# Version 0.2.4
+
+- Make `select!` linearizable with other channel operations.
+- Update `crossbeam-utils` to `0.5.0`.
+- Update `parking_lot` to `0.6.3`.
+- Remove Mac OS X tests.
+
+# Version 0.2.3
+
+- Add Mac OS X tests.
+- Lower some memory orderings.
+- Eliminate calls to `mem::unitialized`, which caused bugs with ZST.
+
+# Version 0.2.2
+
+- Add more tests.
+- Update `crossbeam-epoch` to 0.5.0
+- Initialize the RNG seed to a random value.
+- Replace `libc::abort` with `std::process::abort`.
+- Ignore clippy warnings in `select!`.
+- Better interaction of `select!` with the NLL borrow checker.
+
+# Version 0.2.1
+
+- Fix compilation errors when using `select!` with `#[deny(unsafe_code)]`.
+
+# Version 0.2.0
+
+- Implement `IntoIterator<Item = T>` for `Receiver<T>`.
+- Add a new `select!` macro.
+- Add special channels `after` and `tick`.
+- Dropping receivers doesn't close the channel anymore.
+- Change the signature of `recv`, `send`, and `try_recv`.
+- Remove `Sender::is_closed` and `Receiver::is_closed`.
+- Remove `Sender::close` and `Receiver::close`.
+- Remove `Sender::send_timeout` and `Receiver::recv_timeout`.
+- Remove `Sender::try_send`.
+- Remove `Select` and `select_loop!`.
+- Remove all error types.
+- Remove `Iter`, `TryIter`, and `IntoIter`.
+- Remove the `nightly` feature.
+- Remove ordering operators for `Sender` and `Receiver`.
+
+# Version 0.1.3
+
+- Add `Sender::disconnect` and `Receiver::disconnect`.
+- Implement comparison operators for `Sender` and `Receiver`.
+- Allow arbitrary patterns in place of `msg` in `recv(r, msg)`.
+- Add a few conversion impls between error types.
+- Add benchmarks for `atomicring` and `mpmc`.
+- Add benchmarks for different message sizes.
+- Documentation improvements.
+- Update `crossbeam-epoch` to 0.4.0
+- Update `crossbeam-utils` to 0.3.0
+- Update `parking_lot` to 0.5
+- Update `rand` to 0.4
+
+# Version 0.1.2
+
+- Allow conditional cases in `select_loop!` macro.
+- Fix typos in documentation.
+- Fix deadlock in selection when all channels are disconnected and a timeout is specified.
+
+# Version 0.1.1
+
+- Implement `Debug` for `Sender`, `Receiver`, `Iter`, `TryIter`, `IntoIter`, and `Select`.
+- Implement `Default` for `Select`.
+
+# Version 0.1.0
+
+- First implementation of the channels.
+- Add `select_loop!` macro by @TimNN.
diff --git a/rustc_deps/vendor/crossbeam-channel/Cargo.toml b/rustc_deps/vendor/crossbeam-channel/Cargo.toml
new file mode 100644
index 0000000..04e419e
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/Cargo.toml
@@ -0,0 +1,43 @@
+# 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 believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "crossbeam-channel"
+version = "0.3.2"
+authors = ["The Crossbeam Project Developers"]
+description = "Multi-producer multi-consumer channels for message passing"
+homepage = "https://github.com/crossbeam-rs/crossbeam"
+documentation = "https://docs.rs/crossbeam-channel"
+readme = "README.md"
+keywords = ["channel", "mpmc", "select", "golang", "message"]
+categories = ["algorithms", "concurrency", "data-structures"]
+license = "MIT/Apache-2.0"
+repository = "https://github.com/crossbeam-rs/crossbeam"
+[dependencies.crossbeam-epoch]
+version = "0.6"
+
+[dependencies.crossbeam-utils]
+version = "0.6"
+
+[dependencies.parking_lot]
+version = "0.6.3"
+
+[dependencies.rand]
+version = "0.5.3"
+
+[dependencies.smallvec]
+version = "0.6.2"
+[dev-dependencies.crossbeam]
+version = "0.3.0"
+
+[dev-dependencies.signal-hook]
+version = "0.1.5"
diff --git a/rustc_deps/vendor/crossbeam-channel/LICENSE-APACHE b/rustc_deps/vendor/crossbeam-channel/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/LICENSE-APACHE
@@ -0,0 +1,201 @@
+                              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/rustc_deps/vendor/crossbeam-channel/LICENSE-MIT b/rustc_deps/vendor/crossbeam-channel/LICENSE-MIT
new file mode 100644
index 0000000..31aa793
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/LICENSE-MIT
@@ -0,0 +1,23 @@
+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/rustc_deps/vendor/crossbeam-channel/LICENSE-THIRD-PARTY b/rustc_deps/vendor/crossbeam-channel/LICENSE-THIRD-PARTY
new file mode 100644
index 0000000..d15e32b
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/LICENSE-THIRD-PARTY
@@ -0,0 +1,625 @@
+===============================================================================
+
+Bounded MPMC queue
+http://www.1024cores.net/home/code-license
+
+Copyright (c) 2010-2011 Dmitry Vyukov.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of Dmitry Vyukov.
+
+===============================================================================
+
+matching.go
+https://creativecommons.org/licenses/by/3.0/legalcode
+
+Creative Commons Legal Code
+
+Attribution 3.0 Unported
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
+    DAMAGES RESULTING FROM ITS USE.
+
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
+TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
+BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
+CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.
+
+1. Definitions
+
+ a. "Adaptation" means a work based upon the Work, or upon the Work and
+    other pre-existing works, such as a translation, adaptation,
+    derivative work, arrangement of music or other alterations of a
+    literary or artistic work, or phonogram or performance and includes
+    cinematographic adaptations or any other form in which the Work may be
+    recast, transformed, or adapted including in any form recognizably
+    derived from the original, except that a work that constitutes a
+    Collection will not be considered an Adaptation for the purpose of
+    this License. For the avoidance of doubt, where the Work is a musical
+    work, performance or phonogram, the synchronization of the Work in
+    timed-relation with a moving image ("synching") will be considered an
+    Adaptation for the purpose of this License.
+ b. "Collection" means a collection of literary or artistic works, such as
+    encyclopedias and anthologies, or performances, phonograms or
+    broadcasts, or other works or subject matter other than works listed
+    in Section 1(f) below, which, by reason of the selection and
+    arrangement of their contents, constitute intellectual creations, in
+    which the Work is included in its entirety in unmodified form along
+    with one or more other contributions, each constituting separate and
+    independent works in themselves, which together are assembled into a
+    collective whole. A work that constitutes a Collection will not be
+    considered an Adaptation (as defined above) for the purposes of this
+    License.
+ c. "Distribute" means to make available to the public the original and
+    copies of the Work or Adaptation, as appropriate, through sale or
+    other transfer of ownership.
+ d. "Licensor" means the individual, individuals, entity or entities that
+    offer(s) the Work under the terms of this License.
+ e. "Original Author" means, in the case of a literary or artistic work,
+    the individual, individuals, entity or entities who created the Work
+    or if no individual or entity can be identified, the publisher; and in
+    addition (i) in the case of a performance the actors, singers,
+    musicians, dancers, and other persons who act, sing, deliver, declaim,
+    play in, interpret or otherwise perform literary or artistic works or
+    expressions of folklore; (ii) in the case of a phonogram the producer
+    being the person or legal entity who first fixes the sounds of a
+    performance or other sounds; and, (iii) in the case of broadcasts, the
+    organization that transmits the broadcast.
+ f. "Work" means the literary and/or artistic work offered under the terms
+    of this License including without limitation any production in the
+    literary, scientific and artistic domain, whatever may be the mode or
+    form of its expression including digital form, such as a book,
+    pamphlet and other writing; a lecture, address, sermon or other work
+    of the same nature; a dramatic or dramatico-musical work; a
+    choreographic work or entertainment in dumb show; a musical
+    composition with or without words; a cinematographic work to which are
+    assimilated works expressed by a process analogous to cinematography;
+    a work of drawing, painting, architecture, sculpture, engraving or
+    lithography; a photographic work to which are assimilated works
+    expressed by a process analogous to photography; a work of applied
+    art; an illustration, map, plan, sketch or three-dimensional work
+    relative to geography, topography, architecture or science; a
+    performance; a broadcast; a phonogram; a compilation of data to the
+    extent it is protected as a copyrightable work; or a work performed by
+    a variety or circus performer to the extent it is not otherwise
+    considered a literary or artistic work.
+ g. "You" means an individual or entity exercising rights under this
+    License who has not previously violated the terms of this License with
+    respect to the Work, or who has received express permission from the
+    Licensor to exercise rights under this License despite a previous
+    violation.
+ h. "Publicly Perform" means to perform public recitations of the Work and
+    to communicate to the public those public recitations, by any means or
+    process, including by wire or wireless means or public digital
+    performances; to make available to the public Works in such a way that
+    members of the public may access these Works from a place and at a
+    place individually chosen by them; to perform the Work to the public
+    by any means or process and the communication to the public of the
+    performances of the Work, including by public digital performance; to
+    broadcast and rebroadcast the Work by any means including signs,
+    sounds or images.
+ i. "Reproduce" means to make copies of the Work by any means including
+    without limitation by sound or visual recordings and the right of
+    fixation and reproducing fixations of the Work, including storage of a
+    protected performance or phonogram in digital form or other electronic
+    medium.
+
+2. Fair Dealing Rights. Nothing in this License is intended to reduce,
+limit, or restrict any uses free from copyright or rights arising from
+limitations or exceptions that are provided for in connection with the
+copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License,
+Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+perpetual (for the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:
+
+ a. to Reproduce the Work, to incorporate the Work into one or more
+    Collections, and to Reproduce the Work as incorporated in the
+    Collections;
+ b. to create and Reproduce Adaptations provided that any such Adaptation,
+    including any translation in any medium, takes reasonable steps to
+    clearly label, demarcate or otherwise identify that changes were made
+    to the original Work. For example, a translation could be marked "The
+    original work was translated from English to Spanish," or a
+    modification could indicate "The original work has been modified.";
+ c. to Distribute and Publicly Perform the Work including as incorporated
+    in Collections; and,
+ d. to Distribute and Publicly Perform Adaptations.
+ e. For the avoidance of doubt:
+
+     i. Non-waivable Compulsory License Schemes. In those jurisdictions in
+        which the right to collect royalties through any statutory or
+        compulsory licensing scheme cannot be waived, the Licensor
+        reserves the exclusive right to collect such royalties for any
+        exercise by You of the rights granted under this License;
+    ii. Waivable Compulsory License Schemes. In those jurisdictions in
+        which the right to collect royalties through any statutory or
+        compulsory licensing scheme can be waived, the Licensor waives the
+        exclusive right to collect such royalties for any exercise by You
+        of the rights granted under this License; and,
+   iii. Voluntary License Schemes. The Licensor waives the right to
+        collect royalties, whether individually or, in the event that the
+        Licensor is a member of a collecting society that administers
+        voluntary licensing schemes, via that society, from any exercise
+        by You of the rights granted under this License.
+
+The above rights may be exercised in all media and formats whether now
+known or hereafter devised. The above rights include the right to make
+such modifications as are technically necessary to exercise the rights in
+other media and formats. Subject to Section 8(f), all rights not expressly
+granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made
+subject to and limited by the following restrictions:
+
+ a. You may Distribute or Publicly Perform the Work only under the terms
+    of this License. You must include a copy of, or the Uniform Resource
+    Identifier (URI) for, this License with every copy of the Work You
+    Distribute or Publicly Perform. You may not offer or impose any terms
+    on the Work that restrict the terms of this License or the ability of
+    the recipient of the Work to exercise the rights granted to that
+    recipient under the terms of the License. You may not sublicense the
+    Work. You must keep intact all notices that refer to this License and
+    to the disclaimer of warranties with every copy of the Work You
+    Distribute or Publicly Perform. When You Distribute or Publicly
+    Perform the Work, You may not impose any effective technological
+    measures on the Work that restrict the ability of a recipient of the
+    Work from You to exercise the rights granted to that recipient under
+    the terms of the License. This Section 4(a) applies to the Work as
+    incorporated in a Collection, but this does not require the Collection
+    apart from the Work itself to be made subject to the terms of this
+    License. If You create a Collection, upon notice from any Licensor You
+    must, to the extent practicable, remove from the Collection any credit
+    as required by Section 4(b), as requested. If You create an
+    Adaptation, upon notice from any Licensor You must, to the extent
+    practicable, remove from the Adaptation any credit as required by
+    Section 4(b), as requested.
+ b. If You Distribute, or Publicly Perform the Work or any Adaptations or
+    Collections, You must, unless a request has been made pursuant to
+    Section 4(a), keep intact all copyright notices for the Work and
+    provide, reasonable to the medium or means You are utilizing: (i) the
+    name of the Original Author (or pseudonym, if applicable) if supplied,
+    and/or if the Original Author and/or Licensor designate another party
+    or parties (e.g., a sponsor institute, publishing entity, journal) for
+    attribution ("Attribution Parties") in Licensor's copyright notice,
+    terms of service or by other reasonable means, the name of such party
+    or parties; (ii) the title of the Work if supplied; (iii) to the
+    extent reasonably practicable, the URI, if any, that Licensor
+    specifies to be associated with the Work, unless such URI does not
+    refer to the copyright notice or licensing information for the Work;
+    and (iv) , consistent with Section 3(b), in the case of an Adaptation,
+    a credit identifying the use of the Work in the Adaptation (e.g.,
+    "French translation of the Work by Original Author," or "Screenplay
+    based on original Work by Original Author"). The credit required by
+    this Section 4 (b) may be implemented in any reasonable manner;
+    provided, however, that in the case of a Adaptation or Collection, at
+    a minimum such credit will appear, if a credit for all contributing
+    authors of the Adaptation or Collection appears, then as part of these
+    credits and in a manner at least as prominent as the credits for the
+    other contributing authors. For the avoidance of doubt, You may only
+    use the credit required by this Section for the purpose of attribution
+    in the manner set out above and, by exercising Your rights under this
+    License, You may not implicitly or explicitly assert or imply any
+    connection with, sponsorship or endorsement by the Original Author,
+    Licensor and/or Attribution Parties, as appropriate, of You or Your
+    use of the Work, without the separate, express prior written
+    permission of the Original Author, Licensor and/or Attribution
+    Parties.
+ c. Except as otherwise agreed in writing by the Licensor or as may be
+    otherwise permitted by applicable law, if You Reproduce, Distribute or
+    Publicly Perform the Work either by itself or as part of any
+    Adaptations or Collections, You must not distort, mutilate, modify or
+    take other derogatory action in relation to the Work which would be
+    prejudicial to the Original Author's honor or reputation. Licensor
+    agrees that in those jurisdictions (e.g. Japan), in which any exercise
+    of the right granted in Section 3(b) of this License (the right to
+    make Adaptations) would be deemed to be a distortion, mutilation,
+    modification or other derogatory action prejudicial to the Original
+    Author's honor and reputation, the Licensor will waive or not assert,
+    as appropriate, this Section, to the fullest extent permitted by the
+    applicable national law, to enable You to reasonably exercise Your
+    right under Section 3(b) of this License (right to make Adaptations)
+    but not otherwise.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
+KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
+INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
+LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
+WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
+OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
+LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
+ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
+ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ a. This License and the rights granted hereunder will terminate
+    automatically upon any breach by You of the terms of this License.
+    Individuals or entities who have received Adaptations or Collections
+    from You under this License, however, will not have their licenses
+    terminated provided such individuals or entities remain in full
+    compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+    survive any termination of this License.
+ b. Subject to the above terms and conditions, the license granted here is
+    perpetual (for the duration of the applicable copyright in the Work).
+    Notwithstanding the above, Licensor reserves the right to release the
+    Work under different license terms or to stop distributing the Work at
+    any time; provided, however that any such election will not serve to
+    withdraw this License (or any other license that has been, or is
+    required to be, granted under the terms of this License), and this
+    License will continue in full force and effect unless terminated as
+    stated above.
+
+8. Miscellaneous
+
+ a. Each time You Distribute or Publicly Perform the Work or a Collection,
+    the Licensor offers to the recipient a license to the Work on the same
+    terms and conditions as the license granted to You under this License.
+ b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
+    offers to the recipient a license to the original Work on the same
+    terms and conditions as the license granted to You under this License.
+ c. If any provision of this License is invalid or unenforceable under
+    applicable law, it shall not affect the validity or enforceability of
+    the remainder of the terms of this License, and without further action
+    by the parties to this agreement, such provision shall be reformed to
+    the minimum extent necessary to make such provision valid and
+    enforceable.
+ d. No term or provision of this License shall be deemed waived and no
+    breach consented to unless such waiver or consent shall be in writing
+    and signed by the party to be charged with such waiver or consent.
+ e. This License constitutes the entire agreement between the parties with
+    respect to the Work licensed here. There are no understandings,
+    agreements or representations with respect to the Work not specified
+    here. Licensor shall not be bound by any additional provisions that
+    may appear in any communication from You. This License may not be
+    modified without the mutual written agreement of the Licensor and You.
+ f. The rights granted under, and the subject matter referenced, in this
+    License were drafted utilizing the terminology of the Berne Convention
+    for the Protection of Literary and Artistic Works (as amended on
+    September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
+    Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
+    and the Universal Copyright Convention (as revised on July 24, 1971).
+    These rights and subject matter take effect in the relevant
+    jurisdiction in which the License terms are sought to be enforced
+    according to the corresponding provisions of the implementation of
+    those treaty provisions in the applicable national law. If the
+    standard suite of rights granted under applicable copyright law
+    includes additional rights not granted under this License, such
+    additional rights are deemed to be included in the License; this
+    License is not intended to restrict the license of any rights under
+    applicable law.
+
+
+Creative Commons Notice
+
+    Creative Commons is not a party to this License, and makes no warranty
+    whatsoever in connection with the Work. Creative Commons will not be
+    liable to You or any party on any legal theory for any damages
+    whatsoever, including without limitation any general, special,
+    incidental or consequential damages arising in connection to this
+    license. Notwithstanding the foregoing two (2) sentences, if Creative
+    Commons has expressly identified itself as the Licensor hereunder, it
+    shall have all rights and obligations of Licensor.
+
+    Except for the limited purpose of indicating to the public that the
+    Work is licensed under the CCPL, Creative Commons does not authorize
+    the use by either party of the trademark "Creative Commons" or any
+    related trademark or logo of Creative Commons without the prior
+    written consent of Creative Commons. Any permitted use will be in
+    compliance with Creative Commons' then-current trademark usage
+    guidelines, as may be published on its website or otherwise made
+    available upon request from time to time. For the avoidance of doubt,
+    this trademark restriction does not form part of this License.
+
+    Creative Commons may be contacted at https://creativecommons.org/.
+
+===============================================================================
+
+The Go Programming Language
+https://golang.org/LICENSE
+
+Copyright (c) 2009 The Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+   * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+===============================================================================
+
+The Rust Programming Language
+https://github.com/rust-lang/rust/blob/master/LICENSE-MIT
+
+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.
+
+===============================================================================
+
+The Rust Programming Language
+https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE
+
+                              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/rustc_deps/vendor/crossbeam-channel/README.md b/rustc_deps/vendor/crossbeam-channel/README.md
new file mode 100644
index 0000000..6c023c2
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/README.md
@@ -0,0 +1,69 @@
+# Multi-producer multi-consumer channels for message passing
+
+[![Build Status](https://travis-ci.org/crossbeam-rs/crossbeam.svg?branch=master)](
+https://travis-ci.org/crossbeam-rs/crossbeam)
+[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](
+https://github.com/crossbeam-rs/crossbeam-channel)
+[![Cargo](https://img.shields.io/crates/v/crossbeam-channel.svg)](
+https://crates.io/crates/crossbeam-channel)
+[![Documentation](https://docs.rs/crossbeam-channel/badge.svg)](
+https://docs.rs/crossbeam-channel)
+
+This library is an alternative to [`std::sync::mpsc`] with more features and better performance.
+
+[`std::sync::mpsc`]: https://doc.rust-lang.org/std/sync/mpsc/index.html
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+crossbeam-channel = "0.3"
+```
+
+Next, add this to your crate:
+
+```rust
+#[macro_use]
+extern crate crossbeam_channel;
+```
+
+The minimum required Rust version is 1.26.
+
+## License
+
+Licensed under either of
+
+ * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/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.
+
+### Third party software
+
+This product includes copies and modifications of software developed by third parties:
+
+* [examples/matching.rs](examples/matching.rs) includes
+  [matching.go](http://www.nada.kth.se/~snilsson/concurrency/src/matching.go) by Stefan Nilsson,
+  licensed under Creative Commons Attribution 3.0 Unported License.
+
+* [src/flavors/array.rs](src/flavors/array.rs) is based on
+  [Bounded MPMC queue](http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue)
+  by Dmitry Vyukov, licensed under the Simplified BSD License and the Apache License, Version 2.0.
+
+* [tests/mpsc.rs](tests/mpsc.rs) includes modifications of code from The Rust Programming Language,
+  licensed under the MIT License and the Apache License, Version 2.0.
+
+* [tests/golang.rs](tests/golang.rs) is based on code from The Go Programming Language, licensed
+  under the 3-Clause BSD License.
+
+See the source code files for more details.
+
+Copies of third party licenses can be found in [LICENSE-THIRD-PARTY](LICENSE-THIRD-PARTY).
diff --git a/rustc_deps/vendor/crossbeam-channel/examples/fibonacci.rs b/rustc_deps/vendor/crossbeam-channel/examples/fibonacci.rs
new file mode 100644
index 0000000..499887a
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/examples/fibonacci.rs
@@ -0,0 +1,27 @@
+//! An asynchronous fibonacci sequence generator.
+
+extern crate crossbeam_channel;
+
+use std::thread;
+
+use crossbeam_channel::{bounded, Sender};
+
+// Sends the Fibonacci sequence into the channel until it becomes disconnected.
+fn fibonacci(sender: Sender<u64>) {
+    let (mut x, mut y) = (0, 1);
+    while sender.send(x).is_ok() {
+        let tmp = x;
+        x = y;
+        y = tmp + y;
+    }
+}
+
+fn main() {
+    let (s, r) = bounded(0);
+    thread::spawn(|| fibonacci(s));
+
+    // Print the first 20 Fibonacci numbers.
+    for num in r.iter().take(20) {
+        println!("{}", num);
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/examples/matching.rs b/rustc_deps/vendor/crossbeam-channel/examples/matching.rs
new file mode 100644
index 0000000..9cea604
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/examples/matching.rs
@@ -0,0 +1,74 @@
+//! Using `select!` to send and receive on the same channel at the same time.
+//!
+//! This example is based on the following program in Go.
+//!
+//! Source:
+//!   - https://web.archive.org/web/20171209034309/https://www.nada.kth.se/~snilsson/concurrency
+//!   - http://www.nada.kth.se/~snilsson/concurrency/src/matching.go
+//!
+//! Copyright & License:
+//!   - Stefan Nilsson
+//!   - Creative Commons Attribution 3.0 Unported License
+//!   - https://creativecommons.org/licenses/by/3.0/
+//!
+//! ```go
+//! func main() {
+//!     people := []string{"Anna", "Bob", "Cody", "Dave", "Eva"}
+//!     match := make(chan string, 1) // Make room for one unmatched send.
+//!     wg := new(sync.WaitGroup)
+//!     for _, name := range people {
+//!         wg.Add(1)
+//!         go Seek(name, match, wg)
+//!     }
+//!     wg.Wait()
+//!     select {
+//!     case name := <-match:
+//!         fmt.Printf("No one received %s’s message.\n", name)
+//!     default:
+//!         // There was no pending send operation.
+//!     }
+//! }
+//!
+//! // Seek either sends or receives, whichever possible, a name on the match
+//! // channel and notifies the wait group when done.
+//! func Seek(name string, match chan string, wg *sync.WaitGroup) {
+//!     select {
+//!     case peer := <-match:
+//!         fmt.Printf("%s received a message from %s.\n", name, peer)
+//!     case match <- name:
+//!         // Wait for someone to receive my message.
+//!     }
+//!     wg.Done()
+//! }
+//! ```
+
+extern crate crossbeam;
+#[macro_use]
+extern crate crossbeam_channel;
+
+use crossbeam_channel::bounded;
+
+fn main() {
+    let people = vec!["Anna", "Bob", "Cody", "Dave", "Eva"];
+    let (s, r) = bounded(1); // Make room for one unmatched send.
+
+    // Either send my name into the channel or receive someone else's, whatever happens first.
+    let seek = |name, s, r| {
+        select! {
+            recv(r) -> peer => println!("{} received a message from {}.", name, peer.unwrap()),
+            send(s, name) -> _ => {}, // Wait for someone to receive my message.
+        }
+    };
+
+    crossbeam::scope(|scope| {
+        for name in people {
+            let (s, r) = (s.clone(), r.clone());
+            scope.spawn(move || seek(name, s, r));
+        }
+    });
+
+    // Check if there is a pending send operation.
+    if let Ok(name) = r.try_recv() {
+        println!("No one received {}’s message.", name);
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/examples/stopwatch.rs b/rustc_deps/vendor/crossbeam-channel/examples/stopwatch.rs
new file mode 100644
index 0000000..ddc5394
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/examples/stopwatch.rs
@@ -0,0 +1,58 @@
+//! Prints the elapsed time every 1 second and quits on Ctrl+C.
+
+#[macro_use]
+extern crate crossbeam_channel;
+extern crate signal_hook;
+
+use std::io;
+use std::thread;
+use std::time::{Duration, Instant};
+
+use crossbeam_channel::{tick, unbounded, Receiver};
+use signal_hook::iterator::Signals;
+use signal_hook::SIGINT;
+
+// Creates a channel that gets a message every time `SIGINT` is signalled.
+fn sigint_notifier() -> io::Result<Receiver<()>> {
+    let (s, r) = unbounded();
+    let signals = Signals::new(&[SIGINT])?;
+
+    thread::spawn(move || {
+        for _ in signals.forever() {
+            if s.send(()).is_err() {
+                break;
+            }
+        }
+    });
+
+    Ok(r)
+}
+
+// Prints the elapsed time.
+fn show(dur: Duration) {
+    println!(
+        "Elapsed: {}.{:03} sec",
+        dur.as_secs(),
+        dur.subsec_nanos() / 1_000_000
+    );
+}
+
+fn main() {
+    let start = Instant::now();
+    let update = tick(Duration::from_secs(1));
+    let ctrl_c = sigint_notifier().unwrap();
+
+    loop {
+        select! {
+            recv(update) -> _ => {
+                show(start.elapsed());
+            }
+            recv(ctrl_c) -> _ => {
+                println!();
+                println!("Goodbye!");
+                show(start.elapsed());
+                break;
+            }
+        }
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/channel.rs b/rustc_deps/vendor/crossbeam-channel/src/channel.rs
new file mode 100644
index 0000000..ab84e10
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/channel.rs
@@ -0,0 +1,1377 @@
+//! The channel interface.
+
+use std::fmt;
+use std::isize;
+use std::iter::FusedIterator;
+use std::mem;
+use std::panic::{RefUnwindSafe, UnwindSafe};
+use std::process;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Arc;
+use std::time::{Duration, Instant};
+
+use context::Context;
+use err::{RecvError, RecvTimeoutError, SendError, SendTimeoutError, TryRecvError, TrySendError};
+use flavors;
+use select::{Operation, SelectHandle, Token};
+
+/// A channel in the form of one of the three different flavors.
+pub struct Channel<T> {
+    /// The number of senders associated with this channel.
+    senders: AtomicUsize,
+
+    /// The number of receivers associated with this channel.
+    receivers: AtomicUsize,
+
+    /// This channel's flavor.
+    flavor: ChannelFlavor<T>,
+}
+
+/// Channel flavors.
+enum ChannelFlavor<T> {
+    /// Bounded channel based on a preallocated array.
+    Array(flavors::array::Channel<T>),
+
+    /// Unbounded channel implemented as a linked list.
+    List(flavors::list::Channel<T>),
+
+    /// Zero-capacity channel.
+    Zero(flavors::zero::Channel<T>),
+}
+
+/// Creates a channel of unbounded capacity.
+///
+/// This channel has a growable buffer that can hold any number of messages at a time.
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s, r) = unbounded();
+///
+/// // Computes the n-th Fibonacci number.
+/// fn fib(n: i32) -> i32 {
+///     if n <= 1 {
+///         n
+///     } else {
+///         fib(n - 1) + fib(n - 2)
+///     }
+/// }
+///
+/// // Spawn an asynchronous computation.
+/// thread::spawn(move || s.send(fib(20)).unwrap());
+///
+/// // Print the result of the computation.
+/// println!("{}", r.recv().unwrap());
+/// ```
+pub fn unbounded<T>() -> (Sender<T>, Receiver<T>) {
+    let chan = Arc::new(Channel {
+        senders: AtomicUsize::new(0),
+        receivers: AtomicUsize::new(0),
+        flavor: ChannelFlavor::List(flavors::list::Channel::new()),
+    });
+
+    let s = Sender::new(chan.clone());
+    let r = Receiver::new(chan);
+    (s, r)
+}
+
+/// Creates a channel of bounded capacity.
+///
+/// This channel has a buffer that can hold at most `cap` messages at a time.
+///
+/// A special case is zero-capacity channel, which cannot hold any messages. Instead, send and
+/// receive operations must appear at the same time in order to pair up and pass the message over.
+///
+/// # Panics
+///
+/// Panics if the capacity is greater than `usize::max_value() / 4`.
+///
+/// # Examples
+///
+/// A channel of capacity 1:
+///
+/// ```
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::bounded;
+///
+/// let (s, r) = bounded(1);
+///
+/// // This call returns immediately because there is enough space in the channel.
+/// s.send(1).unwrap();
+///
+/// thread::spawn(move || {
+///     // This call blocks the current thread because the channel is full.
+///     // It will be able to complete only after the first message is received.
+///     s.send(2).unwrap();
+/// });
+///
+/// thread::sleep(Duration::from_secs(1));
+/// assert_eq!(r.recv(), Ok(1));
+/// assert_eq!(r.recv(), Ok(2));
+/// ```
+///
+/// A zero-capacity channel:
+///
+/// ```
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::bounded;
+///
+/// let (s, r) = bounded(0);
+///
+/// thread::spawn(move || {
+///     // This call blocks the current thread until a receive operation appears
+///     // on the other side of the channel.
+///     s.send(1).unwrap();
+/// });
+///
+/// thread::sleep(Duration::from_secs(1));
+/// assert_eq!(r.recv(), Ok(1));
+/// ```
+pub fn bounded<T>(cap: usize) -> (Sender<T>, Receiver<T>) {
+    let chan = Arc::new(Channel {
+        senders: AtomicUsize::new(0),
+        receivers: AtomicUsize::new(0),
+        flavor: {
+            if cap == 0 {
+                ChannelFlavor::Zero(flavors::zero::Channel::new())
+            } else {
+                ChannelFlavor::Array(flavors::array::Channel::with_capacity(cap))
+            }
+        },
+    });
+
+    let s = Sender::new(chan.clone());
+    let r = Receiver::new(chan);
+    (s, r)
+}
+
+/// Creates a receiver that delivers a message after a certain duration of time.
+///
+/// The channel is bounded with capacity of 1 and never gets disconnected. Exactly one message will
+/// be sent into the channel after `duration` elapses. The message is the instant at which it is
+/// sent.
+///
+/// # Examples
+///
+/// Using an `after` channel for timeouts:
+///
+/// ```
+/// # #[macro_use]
+/// # extern crate crossbeam_channel;
+/// # fn main() {
+/// use std::time::Duration;
+/// use crossbeam_channel::{after, unbounded};
+///
+/// let (s, r) = unbounded::<i32>();
+/// let timeout = Duration::from_millis(100);
+///
+/// select! {
+///     recv(r) -> msg => println!("received {:?}", msg),
+///     recv(after(timeout)) -> _ => println!("timed out"),
+/// }
+/// # }
+/// ```
+///
+/// When the message gets sent:
+///
+/// ```
+/// use std::thread;
+/// use std::time::{Duration, Instant};
+/// use crossbeam_channel::after;
+///
+/// // Converts a number of milliseconds into a `Duration`.
+/// let ms = |ms| Duration::from_millis(ms);
+///
+/// // Returns `true` if `a` and `b` are very close `Instant`s.
+/// let eq = |a, b| a + ms(50) > b && b + ms(50) > a;
+///
+/// let start = Instant::now();
+/// let r = after(ms(100));
+///
+/// thread::sleep(ms(500));
+///
+/// // This message was sent 100 ms from the start and received 500 ms from the start.
+/// assert!(eq(r.recv().unwrap(), start + ms(100)));
+/// assert!(eq(Instant::now(), start + ms(500)));
+/// ```
+pub fn after(duration: Duration) -> Receiver<Instant> {
+    Receiver {
+        flavor: ReceiverFlavor::After(flavors::after::Channel::new(duration)),
+    }
+}
+
+/// Creates a receiver that never delivers messages.
+///
+/// The channel is bounded with capacity of 0 and never gets disconnected.
+///
+/// # Examples
+///
+/// Using a `never` channel to optionally add a timeout to [`select!`]:
+///
+/// ```
+/// # #[macro_use]
+/// # extern crate crossbeam_channel;
+/// # fn main() {
+/// use std::thread;
+/// use std::time::{Duration, Instant};
+/// use crossbeam_channel::{after, never, unbounded};
+///
+/// let (s, r) = unbounded();
+///
+/// thread::spawn(move || {
+///     thread::sleep(Duration::from_secs(1));
+///     s.send(1).unwrap();
+/// });
+///
+/// // This duration can be a `Some` or a `None`.
+/// let duration = Some(Duration::from_millis(100));
+///
+/// // Create a channel that times out after the specified duration.
+/// let timeout = duration
+///     .map(|d| after(d))
+///     .unwrap_or(never());
+///
+/// select! {
+///     recv(r) -> msg => assert_eq!(msg, Ok(1)),
+///     recv(timeout) -> _ => println!("timed out"),
+/// }
+/// # }
+/// ```
+///
+/// [`select!`]: macro.select.html
+pub fn never<T>() -> Receiver<T> {
+    Receiver {
+        flavor: ReceiverFlavor::Never(flavors::never::Channel::new()),
+    }
+}
+
+/// Creates a receiver that delivers messages periodically.
+///
+/// The channel is bounded with capacity of 1 and never gets disconnected. Messages will be
+/// sent into the channel in intervals of `duration`. Each message is the instant at which it is
+/// sent.
+///
+/// # Examples
+///
+/// Using a `tick` channel to periodically print elapsed time:
+///
+/// ```
+/// use std::time::{Duration, Instant};
+/// use crossbeam_channel::tick;
+///
+/// let start = Instant::now();
+/// let ticker = tick(Duration::from_millis(100));
+///
+/// for _ in 0..5 {
+///     ticker.recv().unwrap();
+///     println!("elapsed: {:?}", start.elapsed());
+/// }
+/// ```
+///
+/// When messages get sent:
+///
+/// ```
+/// use std::thread;
+/// use std::time::{Duration, Instant};
+/// use crossbeam_channel::tick;
+///
+/// // Converts a number of milliseconds into a `Duration`.
+/// let ms = |ms| Duration::from_millis(ms);
+///
+/// // Returns `true` if `a` and `b` are very close `Instant`s.
+/// let eq = |a, b| a + ms(50) > b && b + ms(50) > a;
+///
+/// let start = Instant::now();
+/// let r = tick(ms(100));
+///
+/// // This message was sent 100 ms from the start and received 100 ms from the start.
+/// assert!(eq(r.recv().unwrap(), start + ms(100)));
+/// assert!(eq(Instant::now(), start + ms(100)));
+///
+/// thread::sleep(ms(500));
+///
+/// // This message was sent 200 ms from the start and received 600 ms from the start.
+/// assert!(eq(r.recv().unwrap(), start + ms(200)));
+/// assert!(eq(Instant::now(), start + ms(600)));
+///
+/// // This message was sent 700 ms from the start and received 700 ms from the start.
+/// assert!(eq(r.recv().unwrap(), start + ms(700)));
+/// assert!(eq(Instant::now(), start + ms(700)));
+/// ```
+pub fn tick(duration: Duration) -> Receiver<Instant> {
+    Receiver {
+        flavor: ReceiverFlavor::Tick(flavors::tick::Channel::new(duration)),
+    }
+}
+
+/// The sending side of a channel.
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s1, r) = unbounded();
+/// let s2 = s1.clone();
+///
+/// thread::spawn(move || s1.send(1).unwrap());
+/// thread::spawn(move || s2.send(2).unwrap());
+///
+/// let msg1 = r.recv().unwrap();
+/// let msg2 = r.recv().unwrap();
+///
+/// assert_eq!(msg1 + msg2, 3);
+/// ```
+pub struct Sender<T> {
+    inner: Arc<Channel<T>>,
+}
+
+unsafe impl<T: Send> Send for Sender<T> {}
+unsafe impl<T: Send> Sync for Sender<T> {}
+
+impl<T> UnwindSafe for Sender<T> {}
+impl<T> RefUnwindSafe for Sender<T> {}
+
+impl<T> Sender<T> {
+    /// Creates a sender handle for the channel and increments the sender count.
+    fn new(chan: Arc<Channel<T>>) -> Self {
+        let old_count = chan.senders.fetch_add(1, Ordering::SeqCst);
+
+        // Cloning senders and calling `mem::forget` on the clones could potentially overflow the
+        // counter. It's very difficult to recover sensibly from such degenerate scenarios so we
+        // just abort when the count becomes very large.
+        if old_count > isize::MAX as usize {
+            process::abort();
+        }
+
+        Sender { inner: chan }
+    }
+
+    /// Attempts to send a message into the channel without blocking.
+    ///
+    /// This method will either send a message into the channel immediately or return an error if
+    /// the channel is full or disconnected. The returned error contains the original message.
+    ///
+    /// If called on a zero-capacity channel, this method will send the message only if there
+    /// happens to be a receive operation on the other side of the channel at the same time.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, TrySendError};
+    ///
+    /// let (s, r) = bounded(1);
+    ///
+    /// assert_eq!(s.try_send(1), Ok(()));
+    /// assert_eq!(s.try_send(2), Err(TrySendError::Full(2)));
+    ///
+    /// drop(r);
+    /// assert_eq!(s.try_send(3), Err(TrySendError::Disconnected(3)));
+    /// ```
+    pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.try_send(msg),
+            ChannelFlavor::List(chan) => chan.try_send(msg),
+            ChannelFlavor::Zero(chan) => chan.try_send(msg),
+        }
+    }
+
+    /// Blocks the current thread until a message is sent or the channel is disconnected.
+    ///
+    /// If the channel is full and not disconnected, this call will block until the send operation
+    /// can proceed. If the channel becomes disconnected, this call will wake up and return an
+    /// error. The returned error contains the original message.
+    ///
+    /// If called on a zero-capacity channel, this method will wait for a receive operation to
+    /// appear on the other side of the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{bounded, SendError};
+    ///
+    /// let (s, r) = bounded(1);
+    /// assert_eq!(s.send(1), Ok(()));
+    ///
+    /// thread::spawn(move || {
+    ///     assert_eq!(r.recv(), Ok(1));
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     drop(r);
+    /// });
+    ///
+    /// assert_eq!(s.send(2), Ok(()));
+    /// assert_eq!(s.send(3), Err(SendError(3)));
+    /// ```
+    pub fn send(&self, msg: T) -> Result<(), SendError<T>> {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.send(msg, None),
+            ChannelFlavor::List(chan) => chan.send(msg, None),
+            ChannelFlavor::Zero(chan) => chan.send(msg, None),
+        }.map_err(|err| match err {
+            SendTimeoutError::Disconnected(msg) => SendError(msg),
+            SendTimeoutError::Timeout(_) => unreachable!(),
+        })
+    }
+
+    /// Waits for a message to be sent into the channel, but only for a limited time.
+    ///
+    /// If the channel is full and not disconnected, this call will block until the send operation
+    /// can proceed or the operation times out. If the channel becomes disconnected, this call will
+    /// wake up and return an error. The returned error contains the original message.
+    ///
+    /// If called on a zero-capacity channel, this method will wait for a receive operation to
+    /// appear on the other side of the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{bounded, SendTimeoutError};
+    ///
+    /// let (s, r) = bounded(0);
+    ///
+    /// thread::spawn(move || {
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     assert_eq!(r.recv(), Ok(2));
+    ///     drop(r);
+    /// });
+    ///
+    /// assert_eq!(
+    ///     s.send_timeout(1, Duration::from_millis(500)),
+    ///     Err(SendTimeoutError::Timeout(1)),
+    /// );
+    /// assert_eq!(
+    ///     s.send_timeout(2, Duration::from_secs(1)),
+    ///     Ok(()),
+    /// );
+    /// assert_eq!(
+    ///     s.send_timeout(3, Duration::from_millis(500)),
+    ///     Err(SendTimeoutError::Disconnected(3)),
+    /// );
+    /// ```
+    pub fn send_timeout(&self, msg: T, timeout: Duration) -> Result<(), SendTimeoutError<T>> {
+        let deadline = Instant::now() + timeout;
+
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.send(msg, Some(deadline)),
+            ChannelFlavor::List(chan) => chan.send(msg, Some(deadline)),
+            ChannelFlavor::Zero(chan) => chan.send(msg, Some(deadline)),
+        }
+    }
+
+    /// Returns `true` if the channel is empty.
+    ///
+    /// Note: Zero-capacity channels are always empty.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    /// assert!(s.is_empty());
+    ///
+    /// s.send(0).unwrap();
+    /// assert!(!s.is_empty());
+    /// ```
+    pub fn is_empty(&self) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.is_empty(),
+            ChannelFlavor::List(chan) => chan.is_empty(),
+            ChannelFlavor::Zero(chan) => chan.is_empty(),
+        }
+    }
+
+    /// Returns `true` if the channel is full.
+    ///
+    /// Note: Zero-capacity channels are always full.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::bounded;
+    ///
+    /// let (s, r) = bounded(1);
+    ///
+    /// assert!(!s.is_full());
+    /// s.send(0).unwrap();
+    /// assert!(s.is_full());
+    /// ```
+    pub fn is_full(&self) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.is_full(),
+            ChannelFlavor::List(chan) => chan.is_full(),
+            ChannelFlavor::Zero(chan) => chan.is_full(),
+        }
+    }
+
+    /// Returns the number of messages in the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    /// assert_eq!(s.len(), 0);
+    ///
+    /// s.send(1).unwrap();
+    /// s.send(2).unwrap();
+    /// assert_eq!(s.len(), 2);
+    /// ```
+    pub fn len(&self) -> usize {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.len(),
+            ChannelFlavor::List(chan) => chan.len(),
+            ChannelFlavor::Zero(chan) => chan.len(),
+        }
+    }
+
+    /// If the channel is bounded, returns its capacity.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, unbounded};
+    ///
+    /// let (s, _) = unbounded::<i32>();
+    /// assert_eq!(s.capacity(), None);
+    ///
+    /// let (s, _) = bounded::<i32>(5);
+    /// assert_eq!(s.capacity(), Some(5));
+    ///
+    /// let (s, _) = bounded::<i32>(0);
+    /// assert_eq!(s.capacity(), Some(0));
+    /// ```
+    pub fn capacity(&self) -> Option<usize> {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.capacity(),
+            ChannelFlavor::List(chan) => chan.capacity(),
+            ChannelFlavor::Zero(chan) => chan.capacity(),
+        }
+    }
+}
+
+impl<T> Drop for Sender<T> {
+    fn drop(&mut self) {
+        if self.inner.senders.fetch_sub(1, Ordering::SeqCst) == 1 {
+            match &self.inner.flavor {
+                ChannelFlavor::Array(chan) => chan.disconnect(),
+                ChannelFlavor::List(chan) => chan.disconnect(),
+                ChannelFlavor::Zero(chan) => chan.disconnect(),
+            };
+        }
+    }
+}
+
+impl<T> Clone for Sender<T> {
+    fn clone(&self) -> Self {
+        Sender::new(self.inner.clone())
+    }
+}
+
+impl<T> fmt::Debug for Sender<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Sender").finish()
+    }
+}
+
+/// The receiving side of a channel.
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s, r) = unbounded();
+///
+/// thread::spawn(move || {
+///     s.send(1);
+///     thread::sleep(Duration::from_secs(1));
+///     s.send(2);
+/// });
+///
+/// assert_eq!(r.recv(), Ok(1)); // Received immediately.
+/// assert_eq!(r.recv(), Ok(2)); // Received after 1 second.
+/// ```
+pub struct Receiver<T> {
+    flavor: ReceiverFlavor<T>,
+}
+
+/// Receiver flavors.
+pub enum ReceiverFlavor<T> {
+    /// A regular channel (array, list, or zero flavor).
+    Channel(Arc<Channel<T>>),
+
+    /// The after flavor.
+    After(flavors::after::Channel),
+
+    /// The tick flavor.
+    Tick(flavors::tick::Channel),
+
+    /// The never flavor.
+    Never(flavors::never::Channel<T>),
+}
+
+unsafe impl<T: Send> Send for Receiver<T> {}
+unsafe impl<T: Send> Sync for Receiver<T> {}
+
+impl<T> UnwindSafe for Receiver<T> {}
+impl<T> RefUnwindSafe for Receiver<T> {}
+
+impl<T> Receiver<T> {
+    /// Creates a receiver handle for the channel and increments the receiver count.
+    fn new(chan: Arc<Channel<T>>) -> Self {
+        let old_count = chan.receivers.fetch_add(1, Ordering::SeqCst);
+
+        // Cloning receivers and calling `mem::forget` on the clones could potentially overflow the
+        // counter. It's very difficult to recover sensibly from such degenerate scenarios so we
+        // just abort when the count becomes very large.
+        if old_count > isize::MAX as usize {
+            process::abort();
+        }
+
+        Receiver {
+            flavor: ReceiverFlavor::Channel(chan),
+        }
+    }
+
+    /// Attempts to receive a message from the channel without blocking.
+    ///
+    /// This method will either receive a message from the channel immediately or return an error
+    /// if the channel is empty.
+    ///
+    /// If called on a zero-capacity channel, this method will receive a message only if there
+    /// happens to be a send operation on the other side of the channel at the same time.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{unbounded, TryRecvError};
+    ///
+    /// let (s, r) = unbounded();
+    /// assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+    ///
+    /// s.send(5).unwrap();
+    /// drop(s);
+    ///
+    /// assert_eq!(r.try_recv(), Ok(5));
+    /// assert_eq!(r.try_recv(), Err(TryRecvError::Disconnected));
+    /// ```
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.try_recv(),
+                ChannelFlavor::List(chan) => chan.try_recv(),
+                ChannelFlavor::Zero(chan) => chan.try_recv(),
+            },
+            ReceiverFlavor::After(chan) => {
+                let msg = chan.try_recv();
+                unsafe {
+                    mem::transmute_copy::<Result<Instant, TryRecvError>, Result<T, TryRecvError>>(
+                        &msg,
+                    )
+                }
+            }
+            ReceiverFlavor::Tick(chan) => {
+                let msg = chan.try_recv();
+                unsafe {
+                    mem::transmute_copy::<Result<Instant, TryRecvError>, Result<T, TryRecvError>>(
+                        &msg,
+                    )
+                }
+            }
+            ReceiverFlavor::Never(chan) => chan.try_recv(),
+        }
+    }
+
+    /// Blocks the current thread until a message is received or the channel is empty and
+    /// disconnected.
+    ///
+    /// If the channel is empty and not disconnected, this call will block until the receive
+    /// operation can proceed. If the channel is empty and becomes disconnected, this call will
+    /// wake up and return an error.
+    ///
+    /// If called on a zero-capacity channel, this method will wait for a send operation to appear
+    /// on the other side of the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{unbounded, RecvError};
+    ///
+    /// let (s, r) = unbounded();
+    ///
+    /// thread::spawn(move || {
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     s.send(5).unwrap();
+    ///     drop(s);
+    /// });
+    ///
+    /// assert_eq!(r.recv(), Ok(5));
+    /// assert_eq!(r.recv(), Err(RecvError));
+    /// ```
+    pub fn recv(&self) -> Result<T, RecvError> {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.recv(None),
+                ChannelFlavor::List(chan) => chan.recv(None),
+                ChannelFlavor::Zero(chan) => chan.recv(None),
+            },
+            ReceiverFlavor::After(chan) => {
+                let msg = chan.recv(None);
+                unsafe {
+                    mem::transmute_copy::<
+                        Result<Instant, RecvTimeoutError>,
+                        Result<T, RecvTimeoutError>,
+                    >(&msg)
+                }
+            }
+            ReceiverFlavor::Tick(chan) => {
+                let msg = chan.recv(None);
+                unsafe {
+                    mem::transmute_copy::<
+                        Result<Instant, RecvTimeoutError>,
+                        Result<T, RecvTimeoutError>,
+                    >(&msg)
+                }
+            }
+            ReceiverFlavor::Never(chan) => chan.recv(None),
+        }.map_err(|_| RecvError)
+    }
+
+    /// Waits for a message to be received from the channel, but only for a limited time.
+    ///
+    /// If the channel is empty and not disconnected, this call will block until the receive
+    /// operation can proceed or the operation times out. If the channel is empty and becomes
+    /// disconnected, this call will wake up and return an error.
+    ///
+    /// If called on a zero-capacity channel, this method will wait for a send operation to appear
+    /// on the other side of the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{unbounded, RecvTimeoutError};
+    ///
+    /// let (s, r) = unbounded();
+    ///
+    /// thread::spawn(move || {
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     s.send(5).unwrap();
+    ///     drop(s);
+    /// });
+    ///
+    /// assert_eq!(
+    ///     r.recv_timeout(Duration::from_millis(500)),
+    ///     Err(RecvTimeoutError::Timeout),
+    /// );
+    /// assert_eq!(
+    ///     r.recv_timeout(Duration::from_secs(1)),
+    ///     Ok(5),
+    /// );
+    /// assert_eq!(
+    ///     r.recv_timeout(Duration::from_secs(1)),
+    ///     Err(RecvTimeoutError::Disconnected),
+    /// );
+    /// ```
+    pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError> {
+        let deadline = Instant::now() + timeout;
+
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.recv(Some(deadline)),
+                ChannelFlavor::List(chan) => chan.recv(Some(deadline)),
+                ChannelFlavor::Zero(chan) => chan.recv(Some(deadline)),
+            },
+            ReceiverFlavor::After(chan) => {
+                let msg = chan.recv(Some(deadline));
+                unsafe {
+                    mem::transmute_copy::<
+                        Result<Instant, RecvTimeoutError>,
+                        Result<T, RecvTimeoutError>,
+                    >(&msg)
+                }
+            }
+            ReceiverFlavor::Tick(chan) => {
+                let msg = chan.recv(Some(deadline));
+                unsafe {
+                    mem::transmute_copy::<
+                        Result<Instant, RecvTimeoutError>,
+                        Result<T, RecvTimeoutError>,
+                    >(&msg)
+                }
+            }
+            ReceiverFlavor::Never(chan) => chan.recv(Some(deadline)),
+        }
+    }
+
+    /// Returns `true` if the channel is empty.
+    ///
+    /// Note: Zero-capacity channels are always empty.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    ///
+    /// assert!(r.is_empty());
+    /// s.send(0).unwrap();
+    /// assert!(!r.is_empty());
+    /// ```
+    pub fn is_empty(&self) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.is_empty(),
+                ChannelFlavor::List(chan) => chan.is_empty(),
+                ChannelFlavor::Zero(chan) => chan.is_empty(),
+            },
+            ReceiverFlavor::After(chan) => chan.is_empty(),
+            ReceiverFlavor::Tick(chan) => chan.is_empty(),
+            ReceiverFlavor::Never(chan) => chan.is_empty(),
+        }
+    }
+
+    /// Returns `true` if the channel is full.
+    ///
+    /// Note: Zero-capacity channels are always full.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::bounded;
+    ///
+    /// let (s, r) = bounded(1);
+    ///
+    /// assert!(!r.is_full());
+    /// s.send(0).unwrap();
+    /// assert!(r.is_full());
+    /// ```
+    pub fn is_full(&self) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.is_full(),
+                ChannelFlavor::List(chan) => chan.is_full(),
+                ChannelFlavor::Zero(chan) => chan.is_full(),
+            },
+            ReceiverFlavor::After(chan) => chan.is_full(),
+            ReceiverFlavor::Tick(chan) => chan.is_full(),
+            ReceiverFlavor::Never(chan) => chan.is_full(),
+        }
+    }
+
+    /// Returns the number of messages in the channel.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    /// assert_eq!(r.len(), 0);
+    ///
+    /// s.send(1).unwrap();
+    /// s.send(2).unwrap();
+    /// assert_eq!(r.len(), 2);
+    /// ```
+    pub fn len(&self) -> usize {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.len(),
+                ChannelFlavor::List(chan) => chan.len(),
+                ChannelFlavor::Zero(chan) => chan.len(),
+            },
+            ReceiverFlavor::After(chan) => chan.len(),
+            ReceiverFlavor::Tick(chan) => chan.len(),
+            ReceiverFlavor::Never(chan) => chan.len(),
+        }
+    }
+
+    /// If the channel is bounded, returns its capacity.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, unbounded};
+    ///
+    /// let (_, r) = unbounded::<i32>();
+    /// assert_eq!(r.capacity(), None);
+    ///
+    /// let (_, r) = bounded::<i32>(5);
+    /// assert_eq!(r.capacity(), Some(5));
+    ///
+    /// let (_, r) = bounded::<i32>(0);
+    /// assert_eq!(r.capacity(), Some(0));
+    /// ```
+    pub fn capacity(&self) -> Option<usize> {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.capacity(),
+                ChannelFlavor::List(chan) => chan.capacity(),
+                ChannelFlavor::Zero(chan) => chan.capacity(),
+            },
+            ReceiverFlavor::After(chan) => chan.capacity(),
+            ReceiverFlavor::Tick(chan) => chan.capacity(),
+            ReceiverFlavor::Never(chan) => chan.capacity(),
+        }
+    }
+
+    /// A blocking iterator over messages in the channel.
+    ///
+    /// Each call to [`next`] blocks waiting for the next message and then returns it. However, if
+    /// the channel becomes empty and disconnected, it returns [`None`] without blocking.
+    ///
+    /// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
+    /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    ///
+    /// thread::spawn(move || {
+    ///     s.send(1).unwrap();
+    ///     s.send(2).unwrap();
+    ///     s.send(3).unwrap();
+    ///     drop(s); // Disconnect the channel.
+    /// });
+    ///
+    /// // Collect all messages from the channel.
+    /// // Note that the call to `collect` blocks until the sender is dropped.
+    /// let v: Vec<_> = r.iter().collect();
+    ///
+    /// assert_eq!(v, [1, 2, 3]);
+    /// ```
+    pub fn iter(&self) -> Iter<T> {
+        Iter { receiver: self }
+    }
+
+    /// A non-blocking iterator over messages in the channel.
+    ///
+    /// Each call to [`next`] returns a message if there is one ready to be received. The iterator
+    /// never blocks waiting for the next message.
+    ///
+    /// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded::<i32>();
+    ///
+    /// thread::spawn(move || {
+    ///     s.send(1).unwrap();
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     s.send(2).unwrap();
+    ///     thread::sleep(Duration::from_secs(2));
+    ///     s.send(3).unwrap();
+    /// });
+    ///
+    /// thread::sleep(Duration::from_secs(2));
+    ///
+    /// // Collect all messages from the channel without blocking.
+    /// // The third message hasn't been sent yet so we'll collect only the first two.
+    /// let v: Vec<_> = r.try_iter().collect();
+    ///
+    /// assert_eq!(v, [1, 2]);
+    /// ```
+    pub fn try_iter(&self) -> TryIter<T> {
+        TryIter { receiver: self }
+    }
+}
+
+impl<T> Drop for Receiver<T> {
+    fn drop(&mut self) {
+        if let ReceiverFlavor::Channel(chan) = &self.flavor {
+            if chan.receivers.fetch_sub(1, Ordering::SeqCst) == 1 {
+                match &chan.flavor {
+                    ChannelFlavor::Array(chan) => chan.disconnect(),
+                    ChannelFlavor::List(chan) => chan.disconnect(),
+                    ChannelFlavor::Zero(chan) => chan.disconnect(),
+                }
+            }
+        }
+    }
+}
+
+impl<T> Clone for Receiver<T> {
+    fn clone(&self) -> Self {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => Receiver::new(arc.clone()),
+            ReceiverFlavor::After(chan) => Receiver {
+                flavor: ReceiverFlavor::After(chan.clone()),
+            },
+            ReceiverFlavor::Tick(chan) => Receiver {
+                flavor: ReceiverFlavor::Tick(chan.clone()),
+            },
+            ReceiverFlavor::Never(chan) => Receiver {
+                flavor: ReceiverFlavor::Never(chan.clone()),
+            },
+        }
+    }
+}
+
+impl<T> fmt::Debug for Receiver<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Receiver").finish()
+    }
+}
+
+impl<'a, T> IntoIterator for &'a Receiver<T> {
+    type Item = T;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+impl<T> IntoIterator for Receiver<T> {
+    type Item = T;
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        IntoIter { receiver: self }
+    }
+}
+
+/// A blocking iterator over messages in a channel.
+///
+/// Each call to [`next`] blocks waiting for the next message and then returns it. However, if the
+/// channel becomes empty and disconnected, it returns [`None`] without blocking.
+///
+/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
+/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s, r) = unbounded();
+///
+/// thread::spawn(move || {
+///     s.send(1).unwrap();
+///     s.send(2).unwrap();
+///     s.send(3).unwrap();
+///     drop(s); // Disconnect the channel.
+/// });
+///
+/// // Collect all messages from the channel.
+/// // Note that the call to `collect` blocks until the sender is dropped.
+/// let v: Vec<_> = r.iter().collect();
+///
+/// assert_eq!(v, [1, 2, 3]);
+/// ```
+pub struct Iter<'a, T: 'a> {
+    receiver: &'a Receiver<T>,
+}
+
+impl<'a, T> FusedIterator for Iter<'a, T> {}
+
+impl<'a, T> Iterator for Iter<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.receiver.recv().ok()
+    }
+}
+
+impl<'a, T> fmt::Debug for Iter<'a, T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Iter").finish()
+    }
+}
+
+/// A non-blocking iterator over messages in a channel.
+///
+/// Each call to [`next`] returns a message if there is one ready to be received. The iterator
+/// never blocks waiting for the next message.
+///
+/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s, r) = unbounded::<i32>();
+///
+/// thread::spawn(move || {
+///     s.send(1).unwrap();
+///     thread::sleep(Duration::from_secs(1));
+///     s.send(2).unwrap();
+///     thread::sleep(Duration::from_secs(2));
+///     s.send(3).unwrap();
+/// });
+///
+/// thread::sleep(Duration::from_secs(2));
+///
+/// // Collect all messages from the channel without blocking.
+/// // The third message hasn't been sent yet so we'll collect only the first two.
+/// let v: Vec<_> = r.try_iter().collect();
+///
+/// assert_eq!(v, [1, 2]);
+/// ```
+pub struct TryIter<'a, T: 'a> {
+    receiver: &'a Receiver<T>,
+}
+
+impl<'a, T> Iterator for TryIter<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.receiver.try_recv().ok()
+    }
+}
+
+impl<'a, T> fmt::Debug for TryIter<'a, T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("TryIter").finish()
+    }
+}
+
+/// A blocking iterator over messages in a channel.
+///
+/// Each call to [`next`] blocks waiting for the next message and then returns it. However, if the
+/// channel becomes empty and disconnected, it returns [`None`] without blocking.
+///
+/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
+/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s, r) = unbounded();
+///
+/// thread::spawn(move || {
+///     s.send(1).unwrap();
+///     s.send(2).unwrap();
+///     s.send(3).unwrap();
+///     drop(s); // Disconnect the channel.
+/// });
+///
+/// // Collect all messages from the channel.
+/// // Note that the call to `collect` blocks until the sender is dropped.
+/// let v: Vec<_> = r.into_iter().collect();
+///
+/// assert_eq!(v, [1, 2, 3]);
+/// ```
+pub struct IntoIter<T> {
+    receiver: Receiver<T>,
+}
+
+impl<T> FusedIterator for IntoIter<T> {}
+
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.receiver.recv().ok()
+    }
+}
+
+impl<T> fmt::Debug for IntoIter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("IntoIter").finish()
+    }
+}
+
+impl<T> SelectHandle for Sender<T> {
+    fn try(&self, token: &mut Token) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().try(token),
+            ChannelFlavor::List(chan) => chan.sender().try(token),
+            ChannelFlavor::Zero(chan) => chan.sender().try(token),
+        }
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().retry(token),
+            ChannelFlavor::List(chan) => chan.sender().retry(token),
+            ChannelFlavor::Zero(chan) => chan.sender().retry(token),
+        }
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().register(token, oper, cx),
+            ChannelFlavor::List(chan) => chan.sender().register(token, oper, cx),
+            ChannelFlavor::Zero(chan) => chan.sender().register(token, oper, cx),
+        }
+    }
+
+    fn unregister(&self, oper: Operation) {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().unregister(oper),
+            ChannelFlavor::List(chan) => chan.sender().unregister(oper),
+            ChannelFlavor::Zero(chan) => chan.sender().unregister(oper),
+        }
+    }
+
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().accept(token, cx),
+            ChannelFlavor::List(chan) => chan.sender().accept(token, cx),
+            ChannelFlavor::Zero(chan) => chan.sender().accept(token, cx),
+        }
+    }
+
+    fn state(&self) -> usize {
+        match &self.inner.flavor {
+            ChannelFlavor::Array(chan) => chan.sender().state(),
+            ChannelFlavor::List(chan) => chan.sender().state(),
+            ChannelFlavor::Zero(chan) => chan.sender().state(),
+        }
+    }
+}
+
+impl<T> SelectHandle for Receiver<T> {
+    fn try(&self, token: &mut Token) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().try(token),
+                ChannelFlavor::List(chan) => chan.receiver().try(token),
+                ChannelFlavor::Zero(chan) => chan.receiver().try(token),
+            },
+            ReceiverFlavor::After(chan) => chan.try(token),
+            ReceiverFlavor::Tick(chan) => chan.try(token),
+            ReceiverFlavor::Never(chan) => chan.try(token),
+        }
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().retry(token),
+                ChannelFlavor::List(chan) => chan.receiver().retry(token),
+                ChannelFlavor::Zero(chan) => chan.receiver().retry(token),
+            },
+            ReceiverFlavor::After(chan) => chan.retry(token),
+            ReceiverFlavor::Tick(chan) => chan.retry(token),
+            ReceiverFlavor::Never(chan) => chan.retry(token),
+        }
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        match &self.flavor {
+            ReceiverFlavor::Channel(_) => None,
+            ReceiverFlavor::After(chan) => chan.deadline(),
+            ReceiverFlavor::Tick(chan) => chan.deadline(),
+            ReceiverFlavor::Never(chan) => chan.deadline(),
+        }
+    }
+
+    fn register(&self, token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().register(token, oper, cx),
+                ChannelFlavor::List(chan) => chan.receiver().register(token, oper, cx),
+                ChannelFlavor::Zero(chan) => chan.receiver().register(token, oper, cx),
+            },
+            ReceiverFlavor::After(chan) => chan.register(token, oper, cx),
+            ReceiverFlavor::Tick(chan) => chan.register(token, oper, cx),
+            ReceiverFlavor::Never(chan) => chan.register(token, oper, cx),
+        }
+    }
+
+    fn unregister(&self, oper: Operation) {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().unregister(oper),
+                ChannelFlavor::List(chan) => chan.receiver().unregister(oper),
+                ChannelFlavor::Zero(chan) => chan.receiver().unregister(oper),
+            },
+            ReceiverFlavor::After(chan) => chan.unregister(oper),
+            ReceiverFlavor::Tick(chan) => chan.unregister(oper),
+            ReceiverFlavor::Never(chan) => chan.unregister(oper),
+        }
+    }
+
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().accept(token, cx),
+                ChannelFlavor::List(chan) => chan.receiver().accept(token, cx),
+                ChannelFlavor::Zero(chan) => chan.receiver().accept(token, cx),
+            },
+            ReceiverFlavor::After(chan) => chan.accept(token, cx),
+            ReceiverFlavor::Tick(chan) => chan.accept(token, cx),
+            ReceiverFlavor::Never(chan) => chan.accept(token, cx),
+        }
+    }
+
+    fn state(&self) -> usize {
+        match &self.flavor {
+            ReceiverFlavor::Channel(arc) => match &arc.flavor {
+                ChannelFlavor::Array(chan) => chan.receiver().state(),
+                ChannelFlavor::List(chan) => chan.receiver().state(),
+                ChannelFlavor::Zero(chan) => chan.receiver().state(),
+            },
+            ReceiverFlavor::After(chan) => chan.state(),
+            ReceiverFlavor::Tick(chan) => chan.state(),
+            ReceiverFlavor::Never(chan) => chan.state(),
+        }
+    }
+}
+
+/// Writes a message into the channel.
+pub unsafe fn write<T>(s: &Sender<T>, token: &mut Token, msg: T) -> Result<(), T> {
+    match &s.inner.flavor {
+        ChannelFlavor::Array(chan) => chan.write(token, msg),
+        ChannelFlavor::List(chan) => chan.write(token, msg),
+        ChannelFlavor::Zero(chan) => chan.write(token, msg),
+    }
+}
+
+/// Reads a message from the channel.
+pub unsafe fn read<T>(r: &Receiver<T>, token: &mut Token) -> Result<T, ()> {
+    match &r.flavor {
+        ReceiverFlavor::Channel(arc) => match &arc.flavor {
+            ChannelFlavor::Array(chan) => chan.read(token),
+            ChannelFlavor::List(chan) => chan.read(token),
+            ChannelFlavor::Zero(chan) => chan.read(token),
+        },
+        ReceiverFlavor::After(chan) => {
+            mem::transmute_copy::<Result<Instant, ()>, Result<T, ()>>(&chan.read(token))
+        }
+        ReceiverFlavor::Tick(chan) => {
+            mem::transmute_copy::<Result<Instant, ()>, Result<T, ()>>(&chan.read(token))
+        }
+        ReceiverFlavor::Never(chan) => chan.read(token),
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/context.rs b/rustc_deps/vendor/crossbeam-channel/src/context.rs
new file mode 100644
index 0000000..42090e0
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/context.rs
@@ -0,0 +1,185 @@
+//! Thread-local context used in select.
+
+use std::cell::Cell;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Arc;
+use std::thread::{self, Thread, ThreadId};
+use std::time::Instant;
+
+use select::Selected;
+use utils::Backoff;
+
+/// Thread-local context used in select.
+#[derive(Clone)]
+pub struct Context {
+    inner: Arc<Inner>,
+}
+
+/// Inner representation of `Context`.
+struct Inner {
+    /// Selected operation.
+    select: AtomicUsize,
+
+    /// A slot into which another thread may store a pointer to its `Packet`.
+    packet: AtomicUsize,
+
+    /// Thread handle.
+    thread: Thread,
+
+    /// Thread id.
+    thread_id: ThreadId,
+}
+
+impl Context {
+    /// Creates a new context for the duration of the closure.
+    #[inline]
+    pub fn with<F, R>(f: F) -> R
+    where
+        F: FnOnce(&Context) -> R,
+    {
+        thread_local! {
+            /// Cached thread-local context.
+            static CONTEXT: Cell<Option<Context>> = Cell::new(Some(Context::new()));
+        }
+
+        let mut f = Some(f);
+        let mut f = move |cx: &Context| -> R {
+            let f = f.take().unwrap();
+            f(cx)
+        };
+
+        CONTEXT
+            .try_with(|cell| match cell.take() {
+                None => f(&Context::new()),
+                Some(cx) => {
+                    cx.reset();
+                    let res = f(&cx);
+                    cell.set(Some(cx));
+                    res
+                }
+            }).unwrap_or_else(|_| f(&Context::new()))
+    }
+
+    /// Creates a new `Context`.
+    #[cold]
+    fn new() -> Context {
+        Context {
+            inner: Arc::new(Inner {
+                select: AtomicUsize::new(Selected::Waiting.into()),
+                packet: AtomicUsize::new(0),
+                thread: thread::current(),
+                thread_id: thread::current().id(),
+            }),
+        }
+    }
+
+    /// Resets `select` and `packet`.
+    #[inline]
+    fn reset(&self) {
+        self.inner
+            .select
+            .store(Selected::Waiting.into(), Ordering::Release);
+        self.inner.packet.store(0, Ordering::Release);
+    }
+
+    /// Attempts to select an operation.
+    ///
+    /// On failure, the previously selected operation is returned.
+    #[inline]
+    pub fn try_select(&self, select: Selected) -> Result<(), Selected> {
+        self.inner
+            .select
+            .compare_exchange(
+                Selected::Waiting.into(),
+                select.into(),
+                Ordering::AcqRel,
+                Ordering::Acquire,
+            ).map(|_| ())
+            .map_err(|e| e.into())
+    }
+
+    /// Returns the selected operation.
+    #[inline]
+    pub fn selected(&self) -> Selected {
+        Selected::from(self.inner.select.load(Ordering::Acquire))
+    }
+
+    /// Stores a packet.
+    ///
+    /// This method must be called after `try_select` succeeds and there is a packet to provide.
+    #[inline]
+    pub fn store_packet(&self, packet: usize) {
+        if packet != 0 {
+            self.inner.packet.store(packet, Ordering::Release);
+        }
+    }
+
+    /// Waits until a packet is provided and returns it.
+    #[inline]
+    pub fn wait_packet(&self) -> usize {
+        let mut backoff = Backoff::new();
+        loop {
+            let packet = self.inner.packet.load(Ordering::Acquire);
+            if packet != 0 {
+                return packet;
+            }
+            backoff.snooze();
+        }
+    }
+
+    /// Waits until an operation is selected and returns it.
+    ///
+    /// If the deadline is reached, `Selected::Aborted` will be selected.
+    #[inline]
+    pub fn wait_until(&self, deadline: Option<Instant>) -> Selected {
+        // Spin for a short time, waiting until an operation is selected.
+        let mut backoff = Backoff::new();
+        loop {
+            let sel = Selected::from(self.inner.select.load(Ordering::Acquire));
+            if sel != Selected::Waiting {
+                return sel;
+            }
+
+            if !backoff.snooze() {
+                break;
+            }
+        }
+
+        loop {
+            // Check whether an operation has been selected.
+            let sel = Selected::from(self.inner.select.load(Ordering::Acquire));
+            if sel != Selected::Waiting {
+                return sel;
+            }
+
+            // If there's a deadline, park the current thread until the deadline is reached.
+            if let Some(end) = deadline {
+                let now = Instant::now();
+
+                if now < end {
+                    thread::park_timeout(end - now);
+                } else {
+                    // The deadline has been reached. Try aborting select.
+                    return match self.try_select(Selected::Aborted) {
+                        Ok(()) => Selected::Aborted,
+                        Err(s) => s,
+                    };
+                }
+            } else {
+                thread::park();
+            }
+        }
+    }
+
+    /// Unparks the thread this context belongs to.
+    #[inline]
+    pub fn unpark(&self) {
+        self.inner.thread.unpark();
+    }
+
+    /// Returns the id of the thread this context belongs to.
+    #[inline]
+    pub fn thread_id(&self) -> ThreadId {
+        self.inner.thread_id
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/err.rs b/rustc_deps/vendor/crossbeam-channel/src/err.rs
new file mode 100644
index 0000000..1a122d7
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/err.rs
@@ -0,0 +1,367 @@
+use std::error;
+use std::fmt;
+
+/// An error returned from the [`send`] method.
+///
+/// The message could not be sent because the channel is disconnected.
+///
+/// The error contains the message so it can be recovered.
+///
+/// [`send`]: struct.Sender.html#method.send
+#[derive(PartialEq, Eq, Clone, Copy)]
+pub struct SendError<T>(pub T);
+
+/// An error returned from the [`try_send`] method.
+///
+/// The error contains the message being sent so it can be recovered.
+///
+/// [`try_send`]: struct.Sender.html#method.try_send
+#[derive(PartialEq, Eq, Clone, Copy)]
+pub enum TrySendError<T> {
+    /// The message could not be sent because the channel is full.
+    ///
+    /// If this is a zero-capacity channel, then the error indicates that there was no receiver
+    /// available to receive the message at the time.
+    Full(T),
+
+    /// The message could not be sent because the channel is disconnected.
+    Disconnected(T),
+}
+
+/// An error returned from the [`send_timeout`] method.
+///
+/// The error contains the message being sent so it can be recovered.
+///
+/// [`send_timeout`]: struct.Sender.html#method.send_timeout
+#[derive(PartialEq, Eq, Clone, Copy)]
+pub enum SendTimeoutError<T> {
+    /// The message could not be sent because the channel is full and the operation timed out.
+    ///
+    /// If this is a zero-capacity channel, then the error indicates that there was no receiver
+    /// available to receive the message and the operation timed out.
+    Timeout(T),
+
+    /// The message could not be sent because the channel is disconnected.
+    Disconnected(T),
+}
+
+/// An error returned from the [`recv`] method.
+///
+/// A message could not be received because the channel is empty and disconnected.
+///
+/// [`recv`]: struct.Receiver.html#method.recv
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct RecvError;
+
+/// An error returned from the [`try_recv`] method.
+///
+/// [`try_recv`]: struct.Receiver.html#method.recv
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub enum TryRecvError {
+    /// A message could not be received because the channel is empty.
+    ///
+    /// If this is a zero-capacity channel, then the error indicates that there was no sender
+    /// available to send a message at the time.
+    Empty,
+
+    /// The message could not be received because the channel is empty and disconnected.
+    Disconnected,
+}
+
+/// An error returned from the [`recv_timeout`] method.
+///
+/// [`recv_timeout`]: struct.Receiver.html#method.recv_timeout
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub enum RecvTimeoutError {
+    /// A message could not be received because the channel is empty and the operation timed out.
+    ///
+    /// If this is a zero-capacity channel, then the error indicates that there was no sender
+    /// available to send a message and the operation timed out.
+    Timeout,
+
+    /// The message could not be received because the channel is empty and disconnected.
+    Disconnected,
+}
+
+/// An error returned from the [`try_select`] method.
+///
+/// Failed because none of the channel operations were ready.
+///
+/// [`try_select`]: struct.Select.html#method.try_select
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct TrySelectError;
+
+/// An error returned from the [`select_timeout`] method.
+///
+/// Failed because none of the channel operations became ready before the timeout.
+///
+/// [`select_timeout`]: struct.Select.html#method.select_timeout
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct SelectTimeoutError;
+
+impl<T> fmt::Debug for SendError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "SendError(..)".fmt(f)
+    }
+}
+
+impl<T> fmt::Display for SendError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "sending on a disconnected channel".fmt(f)
+    }
+}
+
+impl<T: Send> error::Error for SendError<T> {
+    fn description(&self) -> &str {
+        "sending on a disconnected channel"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl<T> SendError<T> {
+    /// Unwraps the message.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    /// drop(r);
+    ///
+    /// if let Err(err) = s.send("foo") {
+    ///     assert_eq!(err.into_inner(), "foo");
+    /// }
+    /// ```
+    pub fn into_inner(self) -> T {
+        self.0
+    }
+}
+
+impl<T> fmt::Debug for TrySendError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            TrySendError::Full(..) => "Full(..)".fmt(f),
+            TrySendError::Disconnected(..) => "Disconnected(..)".fmt(f),
+        }
+    }
+}
+
+impl<T> fmt::Display for TrySendError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            TrySendError::Full(..) => "sending on a full channel".fmt(f),
+            TrySendError::Disconnected(..) => "sending on a disconnected channel".fmt(f),
+        }
+    }
+}
+
+impl<T: Send> error::Error for TrySendError<T> {
+    fn description(&self) -> &str {
+        match *self {
+            TrySendError::Full(..) => "sending on a full channel",
+            TrySendError::Disconnected(..) => "sending on a disconnected channel",
+        }
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl<T> From<SendError<T>> for TrySendError<T> {
+    fn from(err: SendError<T>) -> TrySendError<T> {
+        match err {
+            SendError(t) => TrySendError::Disconnected(t),
+        }
+    }
+}
+
+impl<T> TrySendError<T> {
+    /// Unwraps the message.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use crossbeam_channel::bounded;
+    ///
+    /// let (s, r) = bounded(0);
+    ///
+    /// if let Err(err) = s.try_send("foo") {
+    ///     assert_eq!(err.into_inner(), "foo");
+    /// }
+    /// ```
+    pub fn into_inner(self) -> T {
+        match self {
+            TrySendError::Full(v) => v,
+            TrySendError::Disconnected(v) => v,
+        }
+    }
+}
+
+impl<T> fmt::Debug for SendTimeoutError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "SendTimeoutError(..)".fmt(f)
+    }
+}
+
+impl<T> fmt::Display for SendTimeoutError<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            SendTimeoutError::Timeout(..) => "timed out waiting on send operation".fmt(f),
+            SendTimeoutError::Disconnected(..) => "sending on a disconnected channel".fmt(f),
+        }
+    }
+}
+
+impl<T: Send> error::Error for SendTimeoutError<T> {
+    fn description(&self) -> &str {
+        "sending on an empty and disconnected channel"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl<T> From<SendError<T>> for SendTimeoutError<T> {
+    fn from(err: SendError<T>) -> SendTimeoutError<T> {
+        match err {
+            SendError(e) => SendTimeoutError::Disconnected(e),
+        }
+    }
+}
+
+impl<T> SendTimeoutError<T> {
+    /// Unwraps the message.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use std::time::Duration;
+    /// use crossbeam_channel::unbounded;
+    ///
+    /// let (s, r) = unbounded();
+    ///
+    /// if let Err(err) = s.send_timeout("foo", Duration::from_secs(1)) {
+    ///     assert_eq!(err.into_inner(), "foo");
+    /// }
+    /// ```
+    pub fn into_inner(self) -> T {
+        match self {
+            SendTimeoutError::Timeout(v) => v,
+            SendTimeoutError::Disconnected(v) => v,
+        }
+    }
+}
+
+impl fmt::Display for RecvError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "receiving on an empty and disconnected channel".fmt(f)
+    }
+}
+
+impl error::Error for RecvError {
+    fn description(&self) -> &str {
+        "receiving on an empty and disconnected channel"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl fmt::Display for TryRecvError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            TryRecvError::Empty => "receiving on an empty channel".fmt(f),
+            TryRecvError::Disconnected => "receiving on an empty and disconnected channel".fmt(f),
+        }
+    }
+}
+
+impl error::Error for TryRecvError {
+    fn description(&self) -> &str {
+        match *self {
+            TryRecvError::Empty => "receiving on an empty channel",
+            TryRecvError::Disconnected => "receiving on an empty and disconnected channel",
+        }
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl From<RecvError> for TryRecvError {
+    fn from(err: RecvError) -> TryRecvError {
+        match err {
+            RecvError => TryRecvError::Disconnected,
+        }
+    }
+}
+
+impl fmt::Display for RecvTimeoutError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            RecvTimeoutError::Timeout => "timed out waiting on receive operation".fmt(f),
+            RecvTimeoutError::Disconnected => "channel is empty and disconnected".fmt(f),
+        }
+    }
+}
+
+impl error::Error for RecvTimeoutError {
+    fn description(&self) -> &str {
+        match *self {
+            RecvTimeoutError::Timeout => "timed out waiting on receive operation",
+            RecvTimeoutError::Disconnected => "channel is empty and disconnected",
+        }
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl From<RecvError> for RecvTimeoutError {
+    fn from(err: RecvError) -> RecvTimeoutError {
+        match err {
+            RecvError => RecvTimeoutError::Disconnected,
+        }
+    }
+}
+
+impl fmt::Display for TrySelectError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "all operations in select would block".fmt(f)
+    }
+}
+
+impl error::Error for TrySelectError {
+    fn description(&self) -> &str {
+        "all operations in select would block"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
+
+impl fmt::Display for SelectTimeoutError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "timed out waiting on select".fmt(f)
+    }
+}
+
+impl error::Error for SelectTimeoutError {
+    fn description(&self) -> &str {
+        "timed out waiting on select"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        None
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/after.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/after.rs
new file mode 100644
index 0000000..dd27e5e
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/after.rs
@@ -0,0 +1,210 @@
+//! Channel that delivers a message after a certain amount of time.
+//!
+//! Messages cannot be sent into this kind of channel; they are materialized on demand.
+
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
+use std::thread;
+use std::time::{Duration, Instant};
+
+use context::Context;
+use err::{RecvTimeoutError, TryRecvError};
+use select::{Operation, SelectHandle, Token};
+use utils;
+
+/// Result of a receive operation.
+pub type AfterToken = Option<Instant>;
+
+/// Channel that delivers a message after a certain amount of time.
+pub struct Channel {
+    /// The instant at which the message will be delivered.
+    delivery_time: Instant,
+
+    /// `true` if the message has been received.
+    received: Arc<AtomicBool>,
+}
+
+impl Channel {
+    /// Creates a channel that delivers a message after a certain duration of time.
+    #[inline]
+    pub fn new(dur: Duration) -> Self {
+        Channel {
+            delivery_time: Instant::now() + dur,
+            received: Arc::new(AtomicBool::new(false)),
+        }
+    }
+
+    /// Attempts to receive a message without blocking.
+    #[inline]
+    pub fn try_recv(&self) -> Result<Instant, TryRecvError> {
+        // We use relaxed ordering because this is just an optional optimistic check.
+        if self.received.load(Ordering::Relaxed) {
+            // The message has already been received.
+            return Err(TryRecvError::Empty);
+        }
+
+        if Instant::now() < self.delivery_time {
+            // The message was not delivered yet.
+            return Err(TryRecvError::Empty);
+        }
+
+        // Try receiving the message if it is still available.
+        if !self.received.swap(true, Ordering::SeqCst) {
+            // Success! Return delivery time as the message.
+            Ok(self.delivery_time)
+        } else {
+            // The message was already received.
+            Err(TryRecvError::Empty)
+        }
+    }
+
+    /// Receives a message from the channel.
+    #[inline]
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<Instant, RecvTimeoutError> {
+        // We use relaxed ordering because this is just an optional optimistic check.
+        if self.received.load(Ordering::Relaxed) {
+            // The message has already been received.
+            utils::sleep_until(deadline);
+            return Err(RecvTimeoutError::Timeout);
+        }
+
+        // Wait until the message is received or the deadline is reached.
+        loop {
+            let now = Instant::now();
+
+            // Check if we can receive the next message.
+            if now >= self.delivery_time {
+                break;
+            }
+
+            // Check if the deadline has been reached.
+            if let Some(d) = deadline {
+                if now >= d {
+                    return Err(RecvTimeoutError::Timeout);
+                }
+
+                thread::sleep(self.delivery_time.min(d) - now);
+            } else {
+                thread::sleep(self.delivery_time - now);
+            }
+        }
+
+        // Try receiving the message if it is still available.
+        if !self.received.swap(true, Ordering::SeqCst) {
+            // Success! Return the message, which is the instant at which it was delivered.
+            Ok(self.delivery_time)
+        } else {
+            // The message was already received. Block forever.
+            utils::sleep_until(None);
+            unreachable!()
+        }
+    }
+
+    /// Reads a message from the channel.
+    #[inline]
+    pub unsafe fn read(&self, token: &mut Token) -> Result<Instant, ()> {
+        token.after.ok_or(())
+    }
+
+    /// Returns `true` if the channel is empty.
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        // We use relaxed ordering because this is just an optional optimistic check.
+        if self.received.load(Ordering::Relaxed) {
+            return true;
+        }
+
+        // If the delivery time hasn't been reached yet, the channel is empty.
+        if Instant::now() < self.delivery_time {
+            return true;
+        }
+
+        // The delivery time has been reached. The channel is empty only if the message has already
+        // been received.
+        self.received.load(Ordering::SeqCst)
+    }
+
+    /// Returns `true` if the channel is full.
+    #[inline]
+    pub fn is_full(&self) -> bool {
+        !self.is_empty()
+    }
+
+    /// Returns the number of messages in the channel.
+    #[inline]
+    pub fn len(&self) -> usize {
+        if self.is_empty() {
+            0
+        } else {
+            1
+        }
+    }
+
+    /// Returns the capacity of the channel.
+    #[inline]
+    pub fn capacity(&self) -> Option<usize> {
+        Some(1)
+    }
+}
+
+impl Clone for Channel {
+    #[inline]
+    fn clone(&self) -> Channel {
+        Channel {
+            delivery_time: self.delivery_time,
+            received: self.received.clone(),
+        }
+    }
+}
+
+impl SelectHandle for Channel {
+    #[inline]
+    fn try(&self, token: &mut Token) -> bool {
+        match self.try_recv() {
+            Ok(msg) => {
+                token.after = Some(msg);
+                true
+            }
+            Err(TryRecvError::Disconnected) => {
+                token.after = None;
+                true
+            }
+            Err(TryRecvError::Empty) => false,
+        }
+    }
+
+    #[inline]
+    fn retry(&self, token: &mut Token) -> bool {
+        self.try(token)
+    }
+
+    #[inline]
+    fn deadline(&self) -> Option<Instant> {
+        Some(self.delivery_time)
+    }
+
+    #[inline]
+    fn register(&self, _token: &mut Token, _oper: Operation, _cx: &Context) -> bool {
+        true
+    }
+
+    #[inline]
+    fn unregister(&self, _oper: Operation) {}
+
+    #[inline]
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.try(token)
+    }
+
+    #[inline]
+    fn state(&self) -> usize {
+        // Return 1 if the deadline has been reached and 0 otherwise.
+        if self.received.load(Ordering::SeqCst) {
+            1
+        } else if Instant::now() < self.delivery_time {
+            0
+        } else {
+            1
+        }
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/array.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/array.rs
new file mode 100644
index 0000000..8cb1a3f
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/array.rs
@@ -0,0 +1,608 @@
+//! Bounded channel based on a preallocated array.
+//!
+//! This flavor has a fixed, positive capacity.
+//!
+//! The implementation is based on Dmitry Vyukov's bounded MPMC queue.
+//!
+//! Source:
+//!   - http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue
+//!   - https://docs.google.com/document/d/1yIAYmbvL3JxOKOjuCyon7JhW4cSv1wy5hC0ApeGMV9s/pub
+//!
+//! Copyright & License:
+//!   - Copyright (c) 2010-2011 Dmitry Vyukov
+//!   - Simplified BSD License and Apache License, Version 2.0
+//!   - http://www.1024cores.net/home/code-license
+
+use std::cell::UnsafeCell;
+use std::marker::PhantomData;
+use std::mem;
+use std::ptr;
+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use std::time::Instant;
+
+use crossbeam_utils::CachePadded;
+
+use context::Context;
+use err::{RecvTimeoutError, SendTimeoutError, TryRecvError, TrySendError};
+use select::{Operation, SelectHandle, Selected, Token};
+use utils::Backoff;
+use waker::SyncWaker;
+
+/// A slot in a channel.
+struct Slot<T> {
+    /// The current stamp.
+    ///
+    /// If the stamp equals the tail, this node will be next written to. If it equals the head,
+    /// this node will be next read from.
+    stamp: AtomicUsize,
+
+    /// The message in this slot.
+    ///
+    /// If the lap in the stamp is odd, this value contains a message. Otherwise, it is empty.
+    msg: UnsafeCell<T>,
+}
+
+/// The token type for the array flavor.
+pub struct ArrayToken {
+    /// Slot to read from or write to.
+    slot: *const u8,
+
+    /// Stamp to store into the slot after reading or writing.
+    stamp: usize,
+}
+
+impl Default for ArrayToken {
+    #[inline]
+    fn default() -> Self {
+        ArrayToken {
+            slot: ptr::null(),
+            stamp: 0,
+        }
+    }
+}
+
+/// Bounded channel based on a preallocated array.
+pub struct Channel<T> {
+    /// The head of the channel.
+    ///
+    /// This value is a "stamp" consisting of an index into the buffer and a lap, but packed into a
+    /// single `usize`. The lower bits represent the index, while the upper bits represent the lap.
+    /// The lap in the head is always an odd number.
+    ///
+    /// Messages are popped from the head of the channel.
+    head: CachePadded<AtomicUsize>,
+
+    /// The tail of the channel.
+    ///
+    /// This value is a "stamp" consisting of an index into the buffer and a lap, but packed into a
+    /// single `usize`. The lower bits represent the index, while the upper bits represent the lap.
+    /// The lap in the tail is always an even number.
+    ///
+    /// Messages are pushed into the tail of the channel.
+    tail: CachePadded<AtomicUsize>,
+
+    /// The buffer holding slots.
+    buffer: *mut Slot<T>,
+
+    /// The channel capacity.
+    cap: usize,
+
+    /// A stamp with the value of `{ lap: 1, index: 0 }`.
+    one_lap: usize,
+
+    /// Equals `true` when the channel is disconnected.
+    is_disconnected: AtomicBool,
+
+    /// Senders waiting while the channel is full.
+    senders: SyncWaker,
+
+    /// Receivers waiting while the channel is empty and not disconnected.
+    receivers: SyncWaker,
+
+    /// Indicates that dropping a `Channel<T>` may drop values of type `T`.
+    _marker: PhantomData<T>,
+}
+
+impl<T> Channel<T> {
+    /// Creates a bounded channel of capacity `cap`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the capacity is not in the range `1 ..= usize::max_value() / 4`.
+    pub fn with_capacity(cap: usize) -> Self {
+        assert!(cap > 0, "capacity must be positive");
+
+        // Make sure there are at least two most significant bits to encode laps. If we can't
+        // reserve two bits, then panic. In that case, the buffer is likely too large to allocate
+        // anyway.
+        let cap_limit = usize::max_value() / 4;
+        assert!(
+            cap <= cap_limit,
+            "channel capacity is too large: {} > {}",
+            cap,
+            cap_limit
+        );
+
+        // One lap is the smallest power of two greater than or equal to `cap`.
+        let one_lap = cap.next_power_of_two();
+
+        // Head is initialized to `{ lap: 1, index: 0 }`.
+        // Tail is initialized to `{ lap: 0, index: 0 }`.
+        let head = one_lap;
+        let tail = 0;
+
+        // Allocate a buffer of `cap` slots.
+        let buffer = {
+            let mut v = Vec::<Slot<T>>::with_capacity(cap);
+            let ptr = v.as_mut_ptr();
+            mem::forget(v);
+            ptr
+        };
+
+        // Initialize stamps in the slots.
+        for i in 0..cap {
+            unsafe {
+                // Set the stamp to `{ lap: 0, index: i }`.
+                let slot = buffer.add(i);
+                ptr::write(&mut (*slot).stamp, AtomicUsize::new(i));
+            }
+        }
+
+        Channel {
+            buffer,
+            cap,
+            one_lap,
+            is_disconnected: AtomicBool::new(false),
+            head: CachePadded::new(AtomicUsize::new(head)),
+            tail: CachePadded::new(AtomicUsize::new(tail)),
+            senders: SyncWaker::new(),
+            receivers: SyncWaker::new(),
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns a receiver handle to the channel.
+    pub fn receiver(&self) -> Receiver<T> {
+        Receiver(self)
+    }
+
+    /// Returns a sender handle to the channel.
+    pub fn sender(&self) -> Sender<T> {
+        Sender(self)
+    }
+
+    /// Attempts to reserve a slot for sending a message.
+    fn start_send(&self, token: &mut Token) -> bool {
+        // If the channel is disconnected, return early.
+        if self.is_disconnected() {
+            token.array.slot = ptr::null();
+            token.array.stamp = 0;
+            return true;
+        }
+
+        let mut backoff = Backoff::new();
+
+        loop {
+            // Load the tail and deconstruct it.
+            let tail = self.tail.load(Ordering::SeqCst);
+            let index = tail & (self.one_lap - 1);
+            let lap = tail & !(self.one_lap - 1);
+
+            // Inspect the corresponding slot.
+            let slot = unsafe { &*self.buffer.add(index) };
+            let stamp = slot.stamp.load(Ordering::Acquire);
+
+            // If the tail and the stamp match, we may attempt to push.
+            if tail == stamp {
+                let new_tail = if index + 1 < self.cap {
+                    // Same lap, incremented index.
+                    // Set to `{ lap: lap, index: index + 1 }`.
+                    tail + 1
+                } else {
+                    // Two laps forward, index wraps around to zero.
+                    // Set to `{ lap: lap.wrapping_add(2), index: 0 }`.
+                    lap.wrapping_add(self.one_lap.wrapping_mul(2))
+                };
+
+                // Try moving the tail.
+                if self
+                    .tail
+                    .compare_exchange_weak(tail, new_tail, Ordering::SeqCst, Ordering::Relaxed)
+                    .is_ok()
+                {
+                    // Prepare the token for the follow-up call to `write`.
+                    token.array.slot = slot as *const Slot<T> as *const u8;
+                    token.array.stamp = stamp.wrapping_add(self.one_lap);
+                    return true;
+                }
+            // But if the slot lags one lap behind the tail...
+            } else if stamp.wrapping_add(self.one_lap) == tail {
+                let head = self.head.load(Ordering::SeqCst);
+
+                // ...and if the head lags one lap behind the tail as well...
+                if head.wrapping_add(self.one_lap) == tail {
+                    // ...then the channel is full.
+                    return false;
+                }
+            }
+
+            backoff.spin();
+        }
+    }
+
+    /// Writes a message into the channel.
+    pub unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(), T> {
+        // If there is no slot, the channel is disconnected.
+        if token.array.slot.is_null() {
+            return Err(msg);
+        }
+
+        let slot: &Slot<T> = &*(token.array.slot as *const Slot<T>);
+
+        // Write the message into the slot and update the stamp.
+        slot.msg.get().write(msg);
+        slot.stamp.store(token.array.stamp, Ordering::Release);
+
+        // Wake a sleeping receiver.
+        self.receivers.wake_one();
+        Ok(())
+    }
+
+    /// Attempts to reserve a slot for receiving a message.
+    fn start_recv(&self, token: &mut Token) -> bool {
+        let mut backoff = Backoff::new();
+
+        loop {
+            // Load the head and deconstruct it.
+            let head = self.head.load(Ordering::SeqCst);
+            let index = head & (self.one_lap - 1);
+            let lap = head & !(self.one_lap - 1);
+
+            // Inspect the corresponding slot.
+            let slot = unsafe { &*self.buffer.add(index) };
+            let stamp = slot.stamp.load(Ordering::Acquire);
+
+            // If the the head and the stamp match, we may attempt to pop.
+            if head == stamp {
+                let new = if index + 1 < self.cap {
+                    // Same lap, incremented index.
+                    // Set to `{ lap: lap, index: index + 1 }`.
+                    head + 1
+                } else {
+                    // Two laps forward, index wraps around to zero.
+                    // Set to `{ lap: lap.wrapping_add(2), index: 0 }`.
+                    lap.wrapping_add(self.one_lap.wrapping_mul(2))
+                };
+
+                // Try moving the head.
+                if self
+                    .head
+                    .compare_exchange_weak(head, new, Ordering::SeqCst, Ordering::Relaxed)
+                    .is_ok()
+                {
+                    // Prepare the token for the follow-up call to `read`.
+                    token.array.slot = slot as *const Slot<T> as *const u8;
+                    token.array.stamp = stamp.wrapping_add(self.one_lap);
+                    return true;
+                }
+            // But if the slot lags one lap behind the head...
+            } else if stamp.wrapping_add(self.one_lap) == head {
+                let tail = self.tail.load(Ordering::SeqCst);
+
+                // ...and if the tail lags one lap behind the head as well, that means the channel
+                // is empty.
+                if tail.wrapping_add(self.one_lap) == head {
+                    // If the channel is disconnected...
+                    if self.is_disconnected() {
+                        // ...and still empty...
+                        if self.tail.load(Ordering::SeqCst) == tail {
+                            // ...then receive an error.
+                            token.array.slot = ptr::null();
+                            token.array.stamp = 0;
+                            return true;
+                        }
+                    } else {
+                        // Otherwise, the receive operation is not ready.
+                        return false;
+                    }
+                }
+            }
+
+            backoff.spin();
+        }
+    }
+
+    /// Reads a message from the channel.
+    pub unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
+        if token.array.slot.is_null() {
+            // The channel is disconnected.
+            return Err(());
+        }
+
+        let slot: &Slot<T> = &*(token.array.slot as *const Slot<T>);
+
+        // Read the message from the slot and update the stamp.
+        let msg = slot.msg.get().read();
+        slot.stamp.store(token.array.stamp, Ordering::Release);
+
+        // Wake a sleeping sender.
+        self.senders.wake_one();
+        Ok(msg)
+    }
+
+    /// Attempts to send a message into the channel.
+    pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
+        let token = &mut Token::default();
+        if self.start_send(token) {
+            unsafe { self.write(token, msg).map_err(TrySendError::Disconnected) }
+        } else {
+            Err(TrySendError::Full(msg))
+        }
+    }
+
+    /// Sends a message into the channel.
+    pub fn send(&self, msg: T, deadline: Option<Instant>) -> Result<(), SendTimeoutError<T>> {
+        let token = &mut Token::default();
+        loop {
+            // Try sending a message several times.
+            let mut backoff = Backoff::new();
+            loop {
+                if self.start_send(token) {
+                    let res = unsafe { self.write(token, msg) };
+                    return res.map_err(SendTimeoutError::Disconnected);
+                }
+                if !backoff.snooze() {
+                    break;
+                }
+            }
+
+            Context::with(|cx| {
+                // Prepare for blocking until a receiver wakes us up.
+                let oper = Operation::hook(token);
+                self.senders.register(oper, cx);
+
+                // Has the channel become ready just now?
+                if !self.is_full() || self.is_disconnected() {
+                    let _ = cx.try_select(Selected::Aborted);
+                }
+
+                // Block the current thread.
+                let sel = cx.wait_until(deadline);
+
+                match sel {
+                    Selected::Waiting => unreachable!(),
+                    Selected::Aborted | Selected::Disconnected => {
+                        self.senders.unregister(oper).unwrap();
+                    }
+                    Selected::Operation(_) => {}
+                }
+            });
+
+            if let Some(d) = deadline {
+                if Instant::now() >= d {
+                    return Err(SendTimeoutError::Timeout(msg));
+                }
+            }
+        }
+    }
+
+    /// Attempts to receive a message without blocking.
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        let token = &mut Token::default();
+
+        if self.start_recv(token) {
+            unsafe { self.read(token).map_err(|_| TryRecvError::Disconnected) }
+        } else {
+            Err(TryRecvError::Empty)
+        }
+    }
+
+    /// Receives a message from the channel.
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTimeoutError> {
+        let token = &mut Token::default();
+        loop {
+            // Try receiving a message several times.
+            let mut backoff = Backoff::new();
+            loop {
+                if self.start_recv(token) {
+                    let res = unsafe { self.read(token) };
+                    return res.map_err(|_| RecvTimeoutError::Disconnected);
+                }
+                if !backoff.snooze() {
+                    break;
+                }
+            }
+
+            Context::with(|cx| {
+                // Prepare for blocking until a sender wakes us up.
+                let oper = Operation::hook(token);
+                self.receivers.register(oper, cx);
+
+                // Has the channel become ready just now?
+                if !self.is_empty() || self.is_disconnected() {
+                    let _ = cx.try_select(Selected::Aborted);
+                }
+
+                // Block the current thread.
+                let sel = cx.wait_until(deadline);
+
+                match sel {
+                    Selected::Waiting => unreachable!(),
+                    Selected::Aborted | Selected::Disconnected => {
+                        self.receivers.unregister(oper).unwrap();
+                        // If the channel was disconnected, we still have to check for remaining
+                        // messages.
+                    }
+                    Selected::Operation(_) => {}
+                }
+            });
+
+            if let Some(d) = deadline {
+                if Instant::now() >= d {
+                    return Err(RecvTimeoutError::Timeout);
+                }
+            }
+        }
+    }
+
+    /// Returns the current number of messages inside the channel.
+    pub fn len(&self) -> usize {
+        loop {
+            // Load the tail, then load the head.
+            let tail = self.tail.load(Ordering::SeqCst);
+            let head = self.head.load(Ordering::SeqCst);
+
+            // If the tail didn't change, we've got consistent values to work with.
+            if self.tail.load(Ordering::SeqCst) == tail {
+                let hix = head & (self.one_lap - 1);
+                let tix = tail & (self.one_lap - 1);
+
+                return if hix < tix {
+                    tix - hix
+                } else if hix > tix {
+                    self.cap - hix + tix
+                } else if tail.wrapping_add(self.one_lap) == head {
+                    0
+                } else {
+                    self.cap
+                };
+            }
+        }
+    }
+
+    /// Returns the capacity of the channel.
+    pub fn capacity(&self) -> Option<usize> {
+        Some(self.cap)
+    }
+
+    /// Disconnects the channel and wakes up all blocked receivers.
+    pub fn disconnect(&self) {
+        if !self.is_disconnected.swap(true, Ordering::SeqCst) {
+            self.senders.disconnect();
+            self.receivers.disconnect();
+        }
+    }
+
+    /// Returns `true` if the channel is disconnected.
+    pub fn is_disconnected(&self) -> bool {
+        self.is_disconnected.load(Ordering::SeqCst)
+    }
+
+    /// Returns `true` if the channel is empty.
+    pub fn is_empty(&self) -> bool {
+        let head = self.head.load(Ordering::SeqCst);
+        let tail = self.tail.load(Ordering::SeqCst);
+
+        // Is the tail lagging one lap behind head?
+        //
+        // Note: If the head changes just before we load the tail, that means there was a moment
+        // when the channel was not empty, so it is safe to just return `false`.
+        tail.wrapping_add(self.one_lap) == head
+    }
+
+    /// Returns `true` if the channel is full.
+    pub fn is_full(&self) -> bool {
+        let tail = self.tail.load(Ordering::SeqCst);
+        let head = self.head.load(Ordering::SeqCst);
+
+        // Is the head lagging one lap behind tail?
+        //
+        // Note: If the tail changes just before we load the head, that means there was a moment
+        // when the channel was not full, so it is safe to just return `false`.
+        head.wrapping_add(self.one_lap) == tail
+    }
+}
+
+impl<T> Drop for Channel<T> {
+    fn drop(&mut self) {
+        // Get the index of the head.
+        let hix = self.head.load(Ordering::Relaxed) & (self.one_lap - 1);
+
+        // Loop over all slots that hold a message and drop them.
+        for i in 0..self.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 {
+                self.buffer.add(index).drop_in_place();
+            }
+        }
+
+        // Finally, deallocate the buffer, but don't run any destructors.
+        unsafe {
+            Vec::from_raw_parts(self.buffer, 0, self.cap);
+        }
+    }
+}
+
+/// Receiver handle to a channel.
+pub struct Receiver<'a, T: 'a>(&'a Channel<T>);
+
+/// Sender handle to a channel.
+pub struct Sender<'a, T: 'a>(&'a Channel<T>);
+
+impl<'a, T> SelectHandle for Receiver<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        self.0.receivers.register(oper, cx);
+        self.0.is_empty() && !self.0.is_disconnected()
+    }
+
+    fn unregister(&self, oper: Operation) {
+        self.0.receivers.unregister(oper);
+    }
+
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn state(&self) -> usize {
+        self.0.tail.load(Ordering::SeqCst)
+    }
+}
+
+impl<'a, T> SelectHandle for Sender<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        self.0.senders.register(oper, cx);
+        self.0.is_full() && !self.0.is_disconnected()
+    }
+
+    fn unregister(&self, oper: Operation) {
+        self.0.senders.unregister(oper);
+    }
+
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn state(&self) -> usize {
+        self.0.head.load(Ordering::SeqCst)
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/list.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/list.rs
new file mode 100644
index 0000000..8788f99
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/list.rs
@@ -0,0 +1,591 @@
+//! Unbounded channel implemented as a linked list.
+
+use std::cell::UnsafeCell;
+use std::marker::PhantomData;
+use std::mem::{self, ManuallyDrop};
+use std::ptr;
+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use std::time::Instant;
+
+use crossbeam_epoch::{self as epoch, Atomic, Guard, Owned, Shared};
+use crossbeam_utils::CachePadded;
+
+use context::Context;
+use err::{RecvTimeoutError, SendTimeoutError, TryRecvError, TrySendError};
+use select::{Operation, SelectHandle, Selected, Token};
+use utils::Backoff;
+use waker::SyncWaker;
+
+// TODO(stjepang): Once we bump the minimum required Rust version to 1.28 or newer, reapply the
+// following changes by @kleimkuhler:
+//
+// 1. https://github.com/crossbeam-rs/crossbeam-channel/pull/100
+// 2. https://github.com/crossbeam-rs/crossbeam-channel/pull/101
+
+/// The maximum number of messages a block can hold.
+const BLOCK_CAP: usize = 32;
+
+/// A slot in a block.
+struct Slot<T> {
+    /// The message.
+    msg: UnsafeCell<ManuallyDrop<T>>,
+
+    /// Equals `true` if the message is ready for reading.
+    ready: AtomicBool,
+}
+
+/// The token type for the list flavor.
+pub struct ListToken {
+    /// Slot to read from or write to.
+    slot: *const u8,
+
+    /// Guard keeping alive the block that contains the slot.
+    guard: Option<Guard>,
+}
+
+impl Default for ListToken {
+    #[inline]
+    fn default() -> Self {
+        ListToken {
+            slot: ptr::null(),
+            guard: None,
+        }
+    }
+}
+
+/// A block in a linked list.
+///
+/// Each block in the list can hold up to `BLOCK_CAP` messages.
+struct Block<T> {
+    /// The start index of this block.
+    ///
+    /// Slots in this block have indices in `start_index .. start_index + BLOCK_CAP`.
+    start_index: usize,
+
+    /// The next block in the linked list.
+    next: Atomic<Block<T>>,
+
+    /// Slots for messages.
+    slots: [UnsafeCell<Slot<T>>; BLOCK_CAP],
+}
+
+impl<T> Block<T> {
+    /// Creates an empty block that starts at `start_index`.
+    fn new(start_index: usize) -> Block<T> {
+        Block {
+            start_index,
+            slots: unsafe { mem::zeroed() },
+            next: Atomic::null(),
+        }
+    }
+}
+
+/// Position in the channel (index and block).
+///
+/// This struct describes the current position of the head or the tail in a linked list.
+struct Position<T> {
+    /// The index in the channel.
+    index: AtomicUsize,
+
+    /// The block in the linked list.
+    block: Atomic<Block<T>>,
+}
+
+/// Unbounded channel implemented as a linked list.
+///
+/// Each message sent into the channel is assigned a sequence number, i.e. an index. Indices are
+/// represented as numbers of type `usize` and wrap on overflow.
+///
+/// Consecutive messages are grouped into blocks in order to put less pressure on the allocator and
+/// improve cache efficiency.
+pub struct Channel<T> {
+    /// The head of the channel.
+    head: CachePadded<Position<T>>,
+
+    /// The tail of the channel.
+    tail: CachePadded<Position<T>>,
+
+    /// Equals `true` when the channel is disconnected.
+    is_disconnected: AtomicBool,
+
+    /// Receivers waiting while the channel is empty and not disconnected.
+    receivers: SyncWaker,
+
+    /// Indicates that dropping a `Channel<T>` may drop values of type `T`.
+    _marker: PhantomData<T>,
+}
+
+impl<T> Channel<T> {
+    /// Creates a new unbounded channel.
+    pub fn new() -> Self {
+        let channel = Channel {
+            head: CachePadded::new(Position {
+                index: AtomicUsize::new(0),
+                block: Atomic::null(),
+            }),
+            tail: CachePadded::new(Position {
+                index: AtomicUsize::new(0),
+                block: Atomic::null(),
+            }),
+            is_disconnected: AtomicBool::new(false),
+            receivers: SyncWaker::new(),
+            _marker: PhantomData,
+        };
+
+        // Allocate an empty block for the first batch of messages.
+        let block = unsafe { Owned::new(Block::new(0)).into_shared(epoch::unprotected()) };
+        channel.head.block.store(block, Ordering::Relaxed);
+        channel.tail.block.store(block, Ordering::Relaxed);
+
+        channel
+    }
+
+    /// Returns a receiver handle to the channel.
+    pub fn receiver(&self) -> Receiver<T> {
+        Receiver(self)
+    }
+
+    /// Returns a sender handle to the channel.
+    pub fn sender(&self) -> Sender<T> {
+        Sender(self)
+    }
+
+    /// Attempts to reserve a slot for sending a message.
+    fn start_send(&self, token: &mut Token) -> bool {
+        // If the channel is disconnected, return early.
+        if self.is_disconnected() {
+            token.list.slot = ptr::null();
+            return true;
+        }
+
+        let guard = epoch::pin();
+        let mut backoff = Backoff::new();
+
+        loop {
+            // These two load operations don't have to be `SeqCst`. If they happen to retrieve
+            // stale values, the following CAS will fail or won't even be attempted.
+            let tail_ptr = self.tail.block.load(Ordering::Acquire, &guard);
+            let tail = unsafe { tail_ptr.deref() };
+            let tail_index = self.tail.index.load(Ordering::Relaxed);
+
+            // Calculate the index of the corresponding slot in the block.
+            let offset = tail_index.wrapping_sub(tail.start_index);
+
+            // Advance the current index one slot forward.
+            let new_index = tail_index.wrapping_add(1);
+
+            // A closure that installs a block following `tail` in case it hasn't been yet.
+            let install_next_block = || {
+                let current = tail
+                    .next
+                    .compare_and_set(
+                        Shared::null(),
+                        Owned::new(Block::new(tail.start_index.wrapping_add(BLOCK_CAP))),
+                        Ordering::AcqRel,
+                        &guard,
+                    ).unwrap_or_else(|err| err.current);
+
+                let _ =
+                    self.tail
+                        .block
+                        .compare_and_set(tail_ptr, current, Ordering::Release, &guard);
+            };
+
+            // If `tail_index` is pointing into `tail`...
+            if offset < BLOCK_CAP {
+                // Try moving the tail index forward.
+                if self
+                    .tail
+                    .index
+                    .compare_exchange_weak(
+                        tail_index,
+                        new_index,
+                        Ordering::SeqCst,
+                        Ordering::Relaxed,
+                    ).is_ok()
+                {
+                    // If this was the last slot in the block, install a new block.
+                    if offset + 1 == BLOCK_CAP {
+                        install_next_block();
+                    }
+
+                    unsafe {
+                        let slot = tail.slots.get_unchecked(offset).get();
+                        token.list.slot = slot as *const Slot<T> as *const u8;
+                    }
+                    break;
+                }
+
+                backoff.spin();
+            } else if offset == BLOCK_CAP {
+                // Help install the next block.
+                install_next_block();
+            }
+        }
+
+        token.list.guard = Some(guard);
+        true
+    }
+
+    /// Writes a message into the channel.
+    pub unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(), T> {
+        // If there is no slot, the channel is disconnected.
+        if token.list.slot.is_null() {
+            return Err(msg);
+        }
+
+        let slot = &*(token.list.slot as *const Slot<T>);
+        let _guard: Guard = token.list.guard.take().unwrap();
+
+        // Write the message into the slot.
+        (*slot).msg.get().write(ManuallyDrop::new(msg));
+        (*slot).ready.store(true, Ordering::Release);
+
+        // Wake a sleeping receiver.
+        self.receivers.wake_one();
+        Ok(())
+    }
+
+    /// Attempts to reserve a slot for receiving a message.
+    fn start_recv(&self, token: &mut Token) -> bool {
+        let guard = epoch::pin();
+        let mut backoff = Backoff::new();
+
+        loop {
+            // Loading the head block doesn't have to be a `SeqCst` operation. If we get a stale
+            // value, the following CAS will fail or not even be attempted. Loading the head index
+            // must be `SeqCst` because we need the up-to-date value when checking whether the
+            // channel is empty.
+            let head_ptr = self.head.block.load(Ordering::Acquire, &guard);
+            let head = unsafe { head_ptr.deref() };
+            let head_index = self.head.index.load(Ordering::SeqCst);
+
+            // Calculate the index of the corresponding slot in the block.
+            let offset = head_index.wrapping_sub(head.start_index);
+
+            // Advance the current index one slot forward.
+            let new_index = head_index.wrapping_add(1);
+
+            // A closure that installs a block following `head` in case it hasn't been yet.
+            let install_next_block = || {
+                let current = head
+                    .next
+                    .compare_and_set(
+                        Shared::null(),
+                        Owned::new(Block::new(head.start_index.wrapping_add(BLOCK_CAP))),
+                        Ordering::AcqRel,
+                        &guard,
+                    ).unwrap_or_else(|err| err.current);
+
+                let _ =
+                    self.head
+                        .block
+                        .compare_and_set(head_ptr, current, Ordering::Release, &guard);
+            };
+
+            // If `head_index` is pointing into `head`...
+            if offset < BLOCK_CAP {
+                let slot = unsafe { &*head.slots.get_unchecked(offset).get() };
+
+                // If this slot does not contain a message...
+                if !slot.ready.load(Ordering::Relaxed) {
+                    let tail_index = self.tail.index.load(Ordering::SeqCst);
+
+                    // If the tail equals the head, that means the channel is empty.
+                    if tail_index == head_index {
+                        // If the channel is disconnected...
+                        if self.is_disconnected() {
+                            // ...and still empty...
+                            if self.tail.index.load(Ordering::SeqCst) == tail_index {
+                                // ...then receive an error.
+                                token.list.slot = ptr::null();
+                                return true;
+                            }
+                        } else {
+                            // Otherwise, the receive operation is not ready.
+                            return false;
+                        }
+                    }
+                }
+
+                // Try moving the head index forward.
+                if self
+                    .head
+                    .index
+                    .compare_exchange_weak(
+                        head_index,
+                        new_index,
+                        Ordering::SeqCst,
+                        Ordering::Relaxed,
+                    ).is_ok()
+                {
+                    // If this was the last slot in the block, install a new block and destroy the
+                    // old one.
+                    if offset + 1 == BLOCK_CAP {
+                        install_next_block();
+                        unsafe {
+                            guard.defer_destroy(head_ptr);
+                        }
+                    }
+
+                    token.list.slot = slot as *const Slot<T> as *const u8;
+                    break;
+                }
+
+                backoff.spin();
+            } else if offset == BLOCK_CAP {
+                // Help install the next block.
+                install_next_block();
+            }
+        }
+
+        token.list.guard = Some(guard);
+        true
+    }
+
+    /// Reads a message from the channel.
+    pub unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
+        if token.list.slot.is_null() {
+            // The channel is disconnected.
+            return Err(());
+        }
+
+        let slot = &*(token.list.slot as *const Slot<T>);
+        let _guard: Guard = token.list.guard.take().unwrap();
+
+        // Wait until the message becomes ready.
+        let mut backoff = Backoff::new();
+        while !slot.ready.load(Ordering::Acquire) {
+            backoff.snooze();
+        }
+
+        // Read the message.
+        let m = slot.msg.get().read();
+        let msg = ManuallyDrop::into_inner(m);
+        Ok(msg)
+    }
+
+    /// Attempts to send a message into the channel.
+    pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
+        self.send(msg, None).map_err(|err| match err {
+            SendTimeoutError::Disconnected(msg) => TrySendError::Disconnected(msg),
+            SendTimeoutError::Timeout(_) => unreachable!(),
+        })
+    }
+
+    /// Sends a message into the channel.
+    pub fn send(&self, msg: T, _deadline: Option<Instant>) -> Result<(), SendTimeoutError<T>> {
+        let token = &mut Token::default();
+        assert!(self.start_send(token));
+        unsafe {
+            self.write(token, msg)
+                .map_err(SendTimeoutError::Disconnected)
+        }
+    }
+
+    /// Attempts to receive a message without blocking.
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        let token = &mut Token::default();
+
+        if self.start_recv(token) {
+            unsafe { self.read(token).map_err(|_| TryRecvError::Disconnected) }
+        } else {
+            Err(TryRecvError::Empty)
+        }
+    }
+
+    /// Receives a message from the channel.
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTimeoutError> {
+        let token = &mut Token::default();
+        loop {
+            // Try receiving a message several times.
+            let mut backoff = Backoff::new();
+            loop {
+                if self.start_recv(token) {
+                    unsafe {
+                        return self.read(token).map_err(|_| RecvTimeoutError::Disconnected);
+                    }
+                }
+                if !backoff.snooze() {
+                    break;
+                }
+            }
+
+            // Prepare for blocking until a sender wakes us up.
+            Context::with(|cx| {
+                let oper = Operation::hook(token);
+                self.receivers.register(oper, cx);
+
+                // Has the channel become ready just now?
+                if !self.is_empty() || self.is_disconnected() {
+                    let _ = cx.try_select(Selected::Aborted);
+                }
+
+                // Block the current thread.
+                let sel = cx.wait_until(deadline);
+
+                match sel {
+                    Selected::Waiting => unreachable!(),
+                    Selected::Aborted | Selected::Disconnected => {
+                        self.receivers.unregister(oper).unwrap();
+                        // If the channel was disconnected, we still have to check for remaining
+                        // messages.
+                    }
+                    Selected::Operation(_) => {}
+                }
+            });
+
+            if let Some(d) = deadline {
+                if Instant::now() >= d {
+                    return Err(RecvTimeoutError::Timeout);
+                }
+            }
+        }
+    }
+
+    /// Returns the current number of messages inside the channel.
+    pub fn len(&self) -> usize {
+        loop {
+            // Load the tail index, then load the head index.
+            let tail_index = self.tail.index.load(Ordering::SeqCst);
+            let head_index = self.head.index.load(Ordering::SeqCst);
+
+            // If the tail index didn't change, we've got consistent indices to work with.
+            if self.tail.index.load(Ordering::SeqCst) == tail_index {
+                return tail_index.wrapping_sub(head_index);
+            }
+        }
+    }
+
+    /// Returns the capacity of the channel.
+    pub fn capacity(&self) -> Option<usize> {
+        None
+    }
+
+    /// Disconnects the channel and wakes up all blocked receivers.
+    pub fn disconnect(&self) {
+        if !self.is_disconnected.swap(true, Ordering::SeqCst) {
+            self.receivers.disconnect();
+        }
+    }
+
+    /// Returns `true` if the channel is disconnected.
+    pub fn is_disconnected(&self) -> bool {
+        self.is_disconnected.load(Ordering::SeqCst)
+    }
+
+    /// Returns `true` if the channel is empty.
+    pub fn is_empty(&self) -> bool {
+        let head_index = self.head.index.load(Ordering::SeqCst);
+        let tail_index = self.tail.index.load(Ordering::SeqCst);
+        head_index == tail_index
+    }
+
+    /// Returns `true` if the channel is full.
+    pub fn is_full(&self) -> bool {
+        false
+    }
+}
+
+impl<T> Drop for Channel<T> {
+    fn drop(&mut self) {
+        // Get the tail and head indices.
+        let tail_index = self.tail.index.load(Ordering::Relaxed);
+        let mut head_index = self.head.index.load(Ordering::Relaxed);
+
+        unsafe {
+            let mut head_ptr = self
+                .head
+                .block
+                .load(Ordering::Relaxed, epoch::unprotected());
+
+            // Manually drop all messages between `head_index` and `tail_index` and destroy the
+            // heap-allocated nodes along the way.
+            while head_index != tail_index {
+                let head = head_ptr.deref();
+                let offset = head_index.wrapping_sub(head.start_index);
+
+                let slot = &mut *head.slots.get_unchecked(offset).get();
+                ManuallyDrop::drop(&mut (*slot).msg.get().read());
+
+                if offset + 1 == BLOCK_CAP {
+                    let next = head.next.load(Ordering::Relaxed, epoch::unprotected());
+                    drop(head_ptr.into_owned());
+                    head_ptr = next;
+                }
+
+                head_index = head_index.wrapping_add(1);
+            }
+
+            // If there is one last remaining block in the end, destroy it.
+            if !head_ptr.is_null() {
+                drop(head_ptr.into_owned());
+            }
+        }
+    }
+}
+
+/// Receiver handle to a channel.
+pub struct Receiver<'a, T: 'a>(&'a Channel<T>);
+
+/// Sender handle to a channel.
+pub struct Sender<'a, T: 'a>(&'a Channel<T>);
+
+impl<'a, T> SelectHandle for Receiver<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        self.0.receivers.register(oper, cx);
+        self.0.is_empty() && !self.0.is_disconnected()
+    }
+
+    fn unregister(&self, oper: Operation) {
+        self.0.receivers.unregister(oper);
+    }
+
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.0.start_recv(token)
+    }
+
+    fn state(&self) -> usize {
+        self.0.tail.index.load(Ordering::SeqCst)
+    }
+}
+
+impl<'a, T> SelectHandle for Sender<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, _oper: Operation, _cx: &Context) -> bool {
+        !self.0.is_disconnected()
+    }
+
+    fn unregister(&self, _oper: Operation) {}
+
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.0.start_send(token)
+    }
+
+    fn state(&self) -> usize {
+        self.0.head.index.load(Ordering::SeqCst)
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/mod.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/mod.rs
new file mode 100644
index 0000000..ebd0cfa
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/mod.rs
@@ -0,0 +1,17 @@
+//! Channel flavors.
+//!
+//! There are six flavors:
+//!
+//! 1. `after` - Channel that delivers a message after a certain amount of time.
+//! 2. `array` - Bounded channel based on a preallocated array.
+//! 3. `list` - Unbounded channel implemented as a linked list.
+//! 4. `never` - Channel that never delivers messages.
+//! 5. `tick` - Channel that delivers messages periodically.
+//! 6. `zero` - Zero-capacity channel.
+
+pub mod after;
+pub mod array;
+pub mod list;
+pub mod never;
+pub mod tick;
+pub mod zero;
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/never.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/never.rs
new file mode 100644
index 0000000..b4e2de7
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/never.rs
@@ -0,0 +1,114 @@
+//! Channel that never delivers messages.
+//!
+//! Messages cannot be sent into this kind of channel.
+
+use std::marker::PhantomData;
+use std::time::Instant;
+
+use context::Context;
+use err::{RecvTimeoutError, TryRecvError};
+use select::{Operation, SelectHandle, Token};
+use utils;
+
+/// This flavor doesn't need a token.
+pub type NeverToken = ();
+
+/// Channel that never delivers messages.
+pub struct Channel<T> {
+    _marker: PhantomData<T>,
+}
+
+impl<T> Channel<T> {
+    /// Creates a channel that never delivers messages.
+    #[inline]
+    pub fn new() -> Self {
+        Channel {
+            _marker: PhantomData,
+        }
+    }
+
+    /// Attempts to receive a message without blocking.
+    #[inline]
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        Err(TryRecvError::Empty)
+    }
+
+    /// Receives a message from the channel.
+    #[inline]
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTimeoutError> {
+        utils::sleep_until(deadline);
+        Err(RecvTimeoutError::Timeout)
+    }
+
+    /// Reads a message from the channel.
+    #[inline]
+    pub unsafe fn read(&self, _token: &mut Token) -> Result<T, ()> {
+        Err(())
+    }
+
+    /// Returns `true` if the channel is empty.
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        true
+    }
+
+    /// Returns `true` if the channel is full.
+    #[inline]
+    pub fn is_full(&self) -> bool {
+        true
+    }
+
+    /// Returns the number of messages in the channel.
+    #[inline]
+    pub fn len(&self) -> usize {
+        0
+    }
+
+    /// Returns the capacity of the channel.
+    #[inline]
+    pub fn capacity(&self) -> Option<usize> {
+        Some(0)
+    }
+}
+
+impl<T> Clone for Channel<T> {
+    #[inline]
+    fn clone(&self) -> Channel<T> {
+        Channel::new()
+    }
+}
+
+impl<T> SelectHandle for Channel<T> {
+    #[inline]
+    fn try(&self, _token: &mut Token) -> bool {
+        false
+    }
+
+    #[inline]
+    fn retry(&self, _token: &mut Token) -> bool {
+        false
+    }
+
+    #[inline]
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    #[inline]
+    fn register(&self, _token: &mut Token, _oper: Operation, _cx: &Context) -> bool {
+        true
+    }
+
+    #[inline]
+    fn unregister(&self, _oper: Operation) {}
+
+    #[inline]
+    fn accept(&self, _token: &mut Token, _cx: &Context) -> bool {
+        false
+    }
+
+    #[inline]
+    fn state(&self) -> usize {
+        0
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/tick.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/tick.rs
new file mode 100644
index 0000000..78beac8
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/tick.rs
@@ -0,0 +1,197 @@
+//! Channel that delivers messages periodically.
+//!
+//! Messages cannot be sent into this kind of channel; they are materialized on demand.
+
+use std::num::Wrapping;
+use std::sync::Arc;
+use std::thread;
+use std::time::{Duration, Instant};
+
+use parking_lot::Mutex;
+
+use context::Context;
+use err::{RecvTimeoutError, TryRecvError};
+use select::{Operation, SelectHandle, Token};
+
+/// Result of a receive operation.
+pub type TickToken = Option<Instant>;
+
+/// Channel state.
+struct Inner {
+    /// The instant at which the next message will be delivered.
+    next_tick: Instant,
+
+    /// The index of the next message to be received.
+    index: Wrapping<usize>,
+}
+
+/// Channel that delivers messages periodically.
+pub struct Channel {
+    /// The state of the channel.
+    // TODO: Use `Arc<AtomicCell<Inner>>` here once we implement `AtomicCell`.
+    inner: Arc<Mutex<Inner>>,
+
+    /// The time interval in which messages get delivered.
+    duration: Duration,
+}
+
+impl Channel {
+    /// Creates a channel that delivers messages periodically.
+    #[inline]
+    pub fn new(dur: Duration) -> Self {
+        Channel {
+            inner: Arc::new(Mutex::new(Inner {
+                next_tick: Instant::now() + dur,
+                index: Wrapping(0),
+            })),
+            duration: dur,
+        }
+    }
+
+    /// Attempts to receive a message without blocking.
+    #[inline]
+    pub fn try_recv(&self) -> Result<Instant, TryRecvError> {
+        let mut inner = self.inner.lock();
+        let now = Instant::now();
+
+        // If the next tick time has been reached, we can receive the next message.
+        if now >= inner.next_tick {
+            let msg = inner.next_tick;
+            inner.next_tick = now + self.duration;
+            inner.index += Wrapping(1);
+            Ok(msg)
+        } else {
+            Err(TryRecvError::Empty)
+        }
+    }
+
+    /// Receives a message from the channel.
+    #[inline]
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<Instant, RecvTimeoutError> {
+        loop {
+            // Compute the time to sleep until the next message or the deadline.
+            let offset = {
+                let mut inner = self.inner.lock();
+                let now = Instant::now();
+
+                // Check if we can receive the next message.
+                if now >= inner.next_tick {
+                    let msg = inner.next_tick;
+                    inner.next_tick = now + self.duration;
+                    inner.index += Wrapping(1);
+                    return Ok(msg);
+                }
+
+                // Check if the operation deadline has been reached.
+                if let Some(d) = deadline {
+                    if now >= d {
+                        return Err(RecvTimeoutError::Timeout);
+                    }
+
+                    inner.next_tick.min(d) - now
+                } else {
+                    inner.next_tick - now
+                }
+            };
+
+            thread::sleep(offset);
+        }
+    }
+
+    /// Reads a message from the channel.
+    #[inline]
+    pub unsafe fn read(&self, token: &mut Token) -> Result<Instant, ()> {
+        token.tick.ok_or(())
+    }
+
+    /// Returns `true` if the channel is empty.
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        let inner = self.inner.lock();
+        Instant::now() < inner.next_tick
+    }
+
+    /// Returns `true` if the channel is full.
+    #[inline]
+    pub fn is_full(&self) -> bool {
+        !self.is_empty()
+    }
+
+    /// Returns the number of messages in the channel.
+    #[inline]
+    pub fn len(&self) -> usize {
+        if self.is_empty() {
+            0
+        } else {
+            1
+        }
+    }
+
+    /// Returns the capacity of the channel.
+    #[inline]
+    pub fn capacity(&self) -> Option<usize> {
+        Some(1)
+    }
+}
+
+impl Clone for Channel {
+    #[inline]
+    fn clone(&self) -> Channel {
+        Channel {
+            inner: self.inner.clone(),
+            duration: self.duration,
+        }
+    }
+}
+
+impl SelectHandle for Channel {
+    #[inline]
+    fn try(&self, token: &mut Token) -> bool {
+        match self.try_recv() {
+            Ok(msg) => {
+                token.tick = Some(msg);
+                true
+            }
+            Err(TryRecvError::Disconnected) => {
+                token.tick = None;
+                true
+            }
+            Err(TryRecvError::Empty) => false,
+        }
+    }
+
+    #[inline]
+    fn retry(&self, token: &mut Token) -> bool {
+        self.try(token)
+    }
+
+    #[inline]
+    fn deadline(&self) -> Option<Instant> {
+        Some(self.inner.lock().next_tick)
+    }
+
+    #[inline]
+    fn register(&self, _token: &mut Token, _oper: Operation, _cx: &Context) -> bool {
+        true
+    }
+
+    #[inline]
+    fn unregister(&self, _oper: Operation) {}
+
+    #[inline]
+    fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
+        self.try(token)
+    }
+
+    #[inline]
+    fn state(&self) -> usize {
+        // Return the index of the next message to be delivered to the channel.
+        let inner = self.inner.lock();
+        let index = if Instant::now() < inner.next_tick {
+            inner.index
+        } else {
+            inner.index + Wrapping(1)
+        };
+        index.0
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/flavors/zero.rs b/rustc_deps/vendor/crossbeam-channel/src/flavors/zero.rs
new file mode 100644
index 0000000..f3a231d
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/flavors/zero.rs
@@ -0,0 +1,538 @@
+//! Zero-capacity channel.
+//!
+//! This kind of channel is also known as *rendezvous* channel.
+
+use std::cell::UnsafeCell;
+use std::marker::PhantomData;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::thread;
+use std::time::Instant;
+
+use parking_lot::Mutex;
+
+use context::Context;
+use err::{RecvTimeoutError, SendTimeoutError, TryRecvError, TrySendError};
+use select::{Operation, SelectHandle, Selected, Token};
+use utils::Backoff;
+use waker::Waker;
+
+/// A pointer to a packet.
+pub type ZeroToken = usize;
+
+/// A slot for passing one message from a sender to a receiver.
+struct Packet<T> {
+    /// Equals `true` if the packet is allocated on the stack.
+    on_stack: bool,
+
+    /// Equals `true` once the packet is ready for reading or writing.
+    ready: AtomicBool,
+
+    /// The message.
+    msg: UnsafeCell<Option<T>>,
+}
+
+impl<T> Packet<T> {
+    /// Creates an empty packet on the stack.
+    fn empty_on_stack() -> Packet<T> {
+        Packet {
+            on_stack: true,
+            ready: AtomicBool::new(false),
+            msg: UnsafeCell::new(None),
+        }
+    }
+
+    /// Creates an empty packet on the heap.
+    fn empty_on_heap() -> Box<Packet<T>> {
+        Box::new(Packet {
+            on_stack: false,
+            ready: AtomicBool::new(false),
+            msg: UnsafeCell::new(None),
+        })
+    }
+
+    /// Creates a packet on the stack, containing a message.
+    fn message_on_stack(msg: T) -> Packet<T> {
+        Packet {
+            on_stack: true,
+            ready: AtomicBool::new(false),
+            msg: UnsafeCell::new(Some(msg)),
+        }
+    }
+
+    /// Waits until the packet becomes ready for reading or writing.
+    fn wait_ready(&self) {
+        let mut backoff = Backoff::new();
+        while !self.ready.load(Ordering::Acquire) {
+            backoff.snooze();
+        }
+    }
+}
+
+/// Inner representation of a zero-capacity channel.
+struct Inner {
+    /// Senders waiting to pair up with a receive operation.
+    senders: Waker,
+
+    /// Receivers waiting to pair up with a send operation.
+    receivers: Waker,
+
+    /// Equals `true` when the channel is disconnected.
+    is_disconnected: bool,
+}
+
+/// Zero-capacity channel.
+pub struct Channel<T> {
+    /// Inner representation of the channel.
+    inner: Mutex<Inner>,
+
+    /// Indicates that dropping a `Channel<T>` may drop values of type `T`.
+    _marker: PhantomData<T>,
+}
+
+impl<T> Channel<T> {
+    /// Constructs a new zero-capacity channel.
+    pub fn new() -> Self {
+        Channel {
+            inner: Mutex::new(Inner {
+                senders: Waker::new(),
+                receivers: Waker::new(),
+                is_disconnected: false,
+            }),
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns a receiver handle to the channel.
+    pub fn receiver(&self) -> Receiver<T> {
+        Receiver(self)
+    }
+
+    /// Returns a sender handle to the channel.
+    pub fn sender(&self) -> Sender<T> {
+        Sender(self)
+    }
+
+    /// Attempts to reserve a slot for sending a message.
+    fn start_send(&self, token: &mut Token, short_pause: bool) -> bool {
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting receiver, pair up with it.
+        if let Some(operation) = inner.receivers.wake_one() {
+            token.zero = operation.packet;
+            return true;
+        } else if inner.is_disconnected {
+            token.zero = 0;
+            return true;
+        }
+
+        if !short_pause {
+            return false;
+        }
+
+        Context::with(|cx| {
+            // Register this send operation so that another receiver can pair up with it.
+            let oper = Operation::hook(token);
+            let packet = Box::into_raw(Packet::<T>::empty_on_heap());
+            inner
+                .senders
+                .register_with_packet(oper, packet as usize, cx);
+            drop(inner);
+
+            // Yield to give receivers a chance to pair up with this operation.
+            thread::yield_now();
+
+            let sel = match cx.try_select(Selected::Aborted) {
+                Ok(()) => Selected::Aborted,
+                Err(s) => s,
+            };
+
+            match sel {
+                Selected::Waiting => unreachable!(),
+                Selected::Disconnected => {
+                    // Unregister and destroy the packet.
+                    let operation = self.inner.lock().senders.unregister(oper).unwrap();
+                    unsafe {
+                        drop(Box::from_raw(operation.packet as *mut Packet<T>));
+                    }
+
+                    // All receivers have just been dropped.
+                    token.zero = 0;
+                    true
+                }
+                Selected::Aborted => {
+                    // Unregister and destroy the packet.
+                    let operation = self.inner.lock().senders.unregister(oper).unwrap();
+                    unsafe {
+                        drop(Box::from_raw(operation.packet as *mut Packet<T>));
+                    }
+                    false
+                }
+                Selected::Operation(_) => {
+                    // Success! A receiver has paired up with this operation.
+                    token.zero = cx.wait_packet();
+                    true
+                }
+            }
+        })
+    }
+
+    /// Writes a message into the packet.
+    pub unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(), T> {
+        // If there is no packet, the channel is disconnected.
+        if token.zero == 0 {
+            return Err(msg);
+        }
+
+        let packet = &*(token.zero as *const Packet<T>);
+        packet.msg.get().write(Some(msg));
+        packet.ready.store(true, Ordering::Release);
+        Ok(())
+    }
+
+    /// Attempts to pair up with a sender.
+    fn start_recv(&self, token: &mut Token, short_pause: bool) -> bool {
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting sender, pair up with it.
+        if let Some(operation) = inner.senders.wake_one() {
+            token.zero = operation.packet;
+            return true;
+        } else if inner.is_disconnected {
+            token.zero = 0;
+            return true;
+        }
+
+        if !short_pause {
+            return false;
+        }
+
+        Context::with(|cx| {
+            // Register this receive operation so that another sender can pair up with it.
+            let oper = Operation::hook(token);
+            let packet = Box::into_raw(Packet::<T>::empty_on_heap());
+            inner
+                .receivers
+                .register_with_packet(oper, packet as usize, cx);
+            drop(inner);
+
+            // Yield to give senders a chance to pair up with this operation.
+            thread::yield_now();
+
+            let sel = match cx.try_select(Selected::Aborted) {
+                Ok(()) => Selected::Aborted,
+                Err(s) => s,
+            };
+
+            match sel {
+                Selected::Waiting => unreachable!(),
+                Selected::Aborted => {
+                    // Unregister and destroy the packet.
+                    let operation = self.inner.lock().receivers.unregister(oper).unwrap();
+                    unsafe {
+                        drop(Box::from_raw(operation.packet as *mut Packet<T>));
+                    }
+                    false
+                }
+                Selected::Disconnected => {
+                    // Unregister and destroy the packet.
+                    let operation = self.inner.lock().receivers.unregister(oper).unwrap();
+                    unsafe {
+                        drop(Box::from_raw(operation.packet as *mut Packet<T>));
+                    }
+
+                    // All senders have just been dropped.
+                    token.zero = 0;
+                    true
+                }
+                Selected::Operation(_) => {
+                    // Success! A sender has paired up with this operation.
+                    token.zero = cx.wait_packet();
+                    true
+                }
+            }
+        })
+    }
+
+    /// Reads a message from the packet.
+    pub unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
+        // If there is no packet, the channel is disconnected.
+        if token.zero == 0 {
+            return Err(());
+        }
+
+        let packet = &*(token.zero as *const Packet<T>);
+
+        if packet.on_stack {
+            // The message has been in the packet from the beginning, so there is no need to wait
+            // for it. However, after reading the message, we need to set `ready` to `true` in
+            // order to signal that the packet can be destroyed.
+            let msg = packet.msg.get().replace(None).unwrap();
+            packet.ready.store(true, Ordering::Release);
+            Ok(msg)
+        } else {
+            // Wait until the message becomes available, then read it and destroy the
+            // heap-allocated packet.
+            packet.wait_ready();
+            let msg = packet.msg.get().replace(None).unwrap();
+            drop(Box::from_raw(packet as *const Packet<T> as *mut Packet<T>));
+            Ok(msg)
+        }
+    }
+
+    /// Attempts to send a message into the channel.
+    pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
+        let token = &mut Token::default();
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting receiver, pair up with it.
+        if let Some(operation) = inner.receivers.wake_one() {
+            token.zero = operation.packet;
+            drop(inner);
+            unsafe {
+                self.write(token, msg).ok().unwrap();
+            }
+            Ok(())
+        } else if inner.is_disconnected {
+            Err(TrySendError::Disconnected(msg))
+        } else {
+            Err(TrySendError::Full(msg))
+        }
+    }
+
+    /// Sends a message into the channel.
+    pub fn send(&self, msg: T, deadline: Option<Instant>) -> Result<(), SendTimeoutError<T>> {
+        let token = &mut Token::default();
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting receiver, pair up with it.
+        if let Some(operation) = inner.receivers.wake_one() {
+            token.zero = operation.packet;
+            drop(inner);
+            unsafe {
+                self.write(token, msg).ok().unwrap();
+            }
+            return Ok(());
+        }
+
+        if inner.is_disconnected {
+            return Err(SendTimeoutError::Disconnected(msg));
+        }
+
+        Context::with(|cx| {
+            // Prepare for blocking until a receiver wakes us up.
+            let oper = Operation::hook(token);
+            let packet = Packet::<T>::message_on_stack(msg);
+            inner
+                .senders
+                .register_with_packet(oper, &packet as *const Packet<T> as usize, cx);
+            drop(inner);
+
+            // Block the current thread.
+            let sel = cx.wait_until(deadline);
+
+            match sel {
+                Selected::Waiting => unreachable!(),
+                Selected::Aborted => {
+                    self.inner.lock().senders.unregister(oper).unwrap();
+                    let msg = unsafe { packet.msg.get().replace(None).unwrap() };
+                    Err(SendTimeoutError::Timeout(msg))
+                }
+                Selected::Disconnected => {
+                    self.inner.lock().senders.unregister(oper).unwrap();
+                    let msg = unsafe { packet.msg.get().replace(None).unwrap() };
+                    Err(SendTimeoutError::Disconnected(msg))
+                }
+                Selected::Operation(_) => {
+                    // Wait until the message is read, then drop the packet.
+                    packet.wait_ready();
+                    Ok(())
+                }
+            }
+        })
+    }
+
+    /// Attempts to receive a message without blocking.
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        let token = &mut Token::default();
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting sender, pair up with it.
+        if let Some(operation) = inner.senders.wake_one() {
+            token.zero = operation.packet;
+            drop(inner);
+            unsafe { self.read(token).map_err(|_| TryRecvError::Disconnected) }
+        } else if inner.is_disconnected {
+            Err(TryRecvError::Disconnected)
+        } else {
+            Err(TryRecvError::Empty)
+        }
+    }
+
+    /// Receives a message from the channel.
+    pub fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTimeoutError> {
+        let token = &mut Token::default();
+        let mut inner = self.inner.lock();
+
+        // If there's a waiting sender, pair up with it.
+        if let Some(operation) = inner.senders.wake_one() {
+            token.zero = operation.packet;
+            drop(inner);
+            unsafe {
+                return self.read(token).map_err(|_| RecvTimeoutError::Disconnected);
+            }
+        }
+
+        if inner.is_disconnected {
+            return Err(RecvTimeoutError::Disconnected);
+        }
+
+        Context::with(|cx| {
+            // Prepare for blocking until a sender wakes us up.
+            let oper = Operation::hook(token);
+            let packet = Packet::<T>::empty_on_stack();
+            inner
+                .receivers
+                .register_with_packet(oper, &packet as *const Packet<T> as usize, cx);
+            drop(inner);
+
+            // Block the current thread.
+            let sel = cx.wait_until(deadline);
+
+            match sel {
+                Selected::Waiting => unreachable!(),
+                Selected::Aborted => {
+                    self.inner.lock().receivers.unregister(oper).unwrap();
+                    Err(RecvTimeoutError::Timeout)
+                }
+                Selected::Disconnected => {
+                    self.inner.lock().receivers.unregister(oper).unwrap();
+                    Err(RecvTimeoutError::Disconnected)
+                }
+                Selected::Operation(_) => {
+                    // Wait until the message is provided, then read it.
+                    packet.wait_ready();
+                    unsafe { Ok(packet.msg.get().replace(None).unwrap()) }
+                }
+            }
+        })
+    }
+
+    /// Disconnects the channel and wakes up all blocked receivers.
+    pub fn disconnect(&self) {
+        let mut inner = self.inner.lock();
+
+        if !inner.is_disconnected {
+            inner.is_disconnected = true;
+            inner.senders.disconnect();
+            inner.receivers.disconnect();
+        }
+    }
+
+    /// Returns the current number of messages inside the channel.
+    pub fn len(&self) -> usize {
+        0
+    }
+
+    /// Returns the capacity of the channel.
+    pub fn capacity(&self) -> Option<usize> {
+        Some(0)
+    }
+
+    /// Returns `true` if the channel is empty.
+    pub fn is_empty(&self) -> bool {
+        true
+    }
+
+    /// Returns `true` if the channel is full.
+    pub fn is_full(&self) -> bool {
+        true
+    }
+}
+
+/// Receiver handle to a channel.
+pub struct Receiver<'a, T: 'a>(&'a Channel<T>);
+
+/// Sender handle to a channel.
+pub struct Sender<'a, T: 'a>(&'a Channel<T>);
+
+impl<'a, T> SelectHandle for Receiver<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token, false)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_recv(token, true)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        let packet = Box::into_raw(Packet::<T>::empty_on_heap());
+
+        let mut inner = self.0.inner.lock();
+        inner
+            .receivers
+            .register_with_packet(oper, packet as usize, cx);
+        !inner.senders.can_wake_one() && !inner.is_disconnected
+    }
+
+    fn unregister(&self, oper: Operation) {
+        if let Some(operation) = self.0.inner.lock().receivers.unregister(oper) {
+            unsafe {
+                drop(Box::from_raw(operation.packet as *mut Packet<T>));
+            }
+        }
+    }
+
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool {
+        token.zero = cx.wait_packet();
+        true
+    }
+
+    fn state(&self) -> usize {
+        self.0.inner.lock().senders.register_count()
+    }
+}
+
+impl<'a, T> SelectHandle for Sender<'a, T> {
+    fn try(&self, token: &mut Token) -> bool {
+        self.0.start_send(token, false)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        self.0.start_send(token, true)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        None
+    }
+
+    fn register(&self, _token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        let packet = Box::into_raw(Packet::<T>::empty_on_heap());
+
+        let mut inner = self.0.inner.lock();
+        inner
+            .senders
+            .register_with_packet(oper, packet as usize, cx);
+        !inner.receivers.can_wake_one() && !inner.is_disconnected
+    }
+
+    fn unregister(&self, oper: Operation) {
+        if let Some(operation) = self.0.inner.lock().senders.unregister(oper) {
+            unsafe {
+                drop(Box::from_raw(operation.packet as *mut Packet<T>));
+            }
+        }
+    }
+
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool {
+        token.zero = cx.wait_packet();
+        true
+    }
+
+    fn state(&self) -> usize {
+        self.0.inner.lock().receivers.register_count()
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/lib.rs b/rustc_deps/vendor/crossbeam-channel/src/lib.rs
new file mode 100644
index 0000000..c7aee07
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/lib.rs
@@ -0,0 +1,375 @@
+//! Multi-producer multi-consumer channels for message passing.
+//!
+//! This library is an alternative to [`std::sync::mpsc`] with more features and better
+//! performance.
+//!
+//! # Hello, world!
+//!
+//! ```
+//! use crossbeam_channel::unbounded;
+//!
+//! // Create a channel of unbounded capacity.
+//! let (s, r) = unbounded();
+//!
+//! // Send a message into the channel.
+//! s.send("Hello, world!").unwrap();
+//!
+//! // Receive the message from the channel.
+//! assert_eq!(r.recv(), Ok("Hello, world!"));
+//! ```
+//!
+//! # Channel types
+//!
+//! Channels can be created using two functions:
+//!
+//! * [`bounded`] creates a channel of bounded capacity, i.e. there is a limit to how many messages
+//!   it can hold at a time.
+//!
+//! * [`unbounded`] creates a channel of unbounded capacity, i.e. it can hold any number of
+//!   messages at a time.
+//!
+//! Both functions return a [`Sender`] and a [`Receiver`], which represent the two opposite sides
+//! of a channel.
+//!
+//! Creating a bounded channel:
+//!
+//! ```
+//! use crossbeam_channel::bounded;
+//!
+//! // Create a channel that can hold at most 5 messages at a time.
+//! let (s, r) = bounded(5);
+//!
+//! // Can send only 5 messages without blocking.
+//! for i in 0..5 {
+//!     s.send(i).unwrap();
+//! }
+//!
+//! // Another call to `send` would block because the channel is full.
+//! // s.send(5).unwrap();
+//! ```
+//!
+//! Creating an unbounded channel:
+//!
+//! ```
+//! use crossbeam_channel::unbounded;
+//!
+//! // Create an unbounded channel.
+//! let (s, r) = unbounded();
+//!
+//! // Can send any number of messages into the channel without blocking.
+//! for i in 0..1000 {
+//!     s.send(i).unwrap();
+//! }
+//! ```
+//!
+//! A special case is zero-capacity channel, which cannot hold any messages. Instead, send and
+//! receive operations must appear at the same time in order to pair up and pass the message over:
+//!
+//! ```
+//! use std::thread;
+//! use crossbeam_channel::bounded;
+//!
+//! // Create a zero-capacity channel.
+//! let (s, r) = bounded(0);
+//!
+//! // Sending blocks until a receive operation appears on the other side.
+//! thread::spawn(move || s.send("Hi!").unwrap());
+//!
+//! // Receiving blocks until a send operation appears on the other side.
+//! assert_eq!(r.recv(), Ok("Hi!"));
+//! ```
+//!
+//! # Sharing channels
+//!
+//! Senders and receivers can be cloned and sent to other threads:
+//!
+//! ```
+//! use std::thread;
+//! use crossbeam_channel::bounded;
+//!
+//! let (s1, r1) = bounded(0);
+//! let (s2, r2) = (s1.clone(), r1.clone());
+//!
+//! // Spawn a thread that receives a message and then sends one.
+//! thread::spawn(move || {
+//!     r2.recv().unwrap();
+//!     s2.send(2).unwrap();
+//! });
+//!
+//! // Send a message and then receive one.
+//! s1.send(1).unwrap();
+//! r1.recv().unwrap();
+//! ```
+//!
+//! Note that cloning only creates a new handle to the same sending or receiving side. It does not
+//! create a separate stream of messages in any way:
+//!
+//! ```
+//! use crossbeam_channel::unbounded;
+//!
+//! let (s1, r1) = unbounded();
+//! let (s2, r2) = (s1.clone(), r1.clone());
+//! let (s3, r3) = (s2.clone(), r2.clone());
+//!
+//! s1.send(10).unwrap();
+//! s2.send(20).unwrap();
+//! s3.send(30).unwrap();
+//!
+//! assert_eq!(r3.recv(), Ok(10));
+//! assert_eq!(r1.recv(), Ok(20));
+//! assert_eq!(r2.recv(), Ok(30));
+//! ```
+//!
+//! It's also possible to share senders and receivers by reference:
+//!
+//! ```
+//! # extern crate crossbeam;
+//! # extern crate crossbeam_channel;
+//! # fn main() {
+//! use std::thread;
+//! use crossbeam;
+//! use crossbeam_channel::bounded;
+//!
+//! let (s, r) = bounded(0);
+//!
+//! crossbeam::scope(|scope| {
+//!     // Spawn a thread that receives a message and then sends one.
+//!     scope.spawn(|| {
+//!         r.recv().unwrap();
+//!         s.send(2).unwrap();
+//!     });
+//!
+//!     // Send a message and then receive one.
+//!     s.send(1).unwrap();
+//!     r.recv().unwrap();
+//! });
+//! # }
+//! ```
+//!
+//! # Disconnection
+//!
+//! When all senders or all receivers associated with a channel get dropped, the channel becomes
+//! disconnected. No more messages can be sent, but any remaining messages can still be received.
+//! Send and receive operations on a disconnected channel never block.
+//!
+//! ```
+//! use crossbeam_channel::{unbounded, RecvError};
+//!
+//! let (s, r) = unbounded();
+//! s.send(1).unwrap();
+//! s.send(2).unwrap();
+//! s.send(3).unwrap();
+//!
+//! // The only sender is dropped, disconnecting the channel.
+//! drop(s);
+//!
+//! // The remaining messages can be received.
+//! assert_eq!(r.recv(), Ok(1));
+//! assert_eq!(r.recv(), Ok(2));
+//! assert_eq!(r.recv(), Ok(3));
+//!
+//! // There are no more messages in the channel.
+//! assert!(r.is_empty());
+//!
+//! // Note that calling `r.recv()` does not block.
+//! // Instead, `Err(RecvError)` is returned immediately.
+//! assert_eq!(r.recv(), Err(RecvError));
+//! ```
+//!
+//! # Blocking operations
+//!
+//! Send and receive operations come in three flavors:
+//!
+//! * Non-blocking (returns immediately with success or failure).
+//! * Blocking (waits until the operation succeeds or the channel becomes disconnected).
+//! * Blocking with a timeout (blocks only for a certain duration of time).
+//!
+//! A simple example showing the difference between non-blocking and blocking operations:
+//!
+//! ```
+//! use crossbeam_channel::{bounded, RecvError, TryRecvError};
+//!
+//! let (s, r) = bounded(1);
+//!
+//! // Send a message into the channel.
+//! s.send("foo").unwrap();
+//!
+//! // This call would block because the channel is full.
+//! // s.send("bar").unwrap();
+//!
+//! // Receive the message.
+//! assert_eq!(r.recv(), Ok("foo"));
+//!
+//! // This call would block because the channel is empty.
+//! // r.recv();
+//!
+//! // Try receiving a message without blocking.
+//! assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+//!
+//! // Disconnect the channel.
+//! drop(s);
+//!
+//! // This call doesn't block because the channel is now disconnected.
+//! assert_eq!(r.recv(), Err(RecvError));
+//! ```
+//!
+//! # Iteration
+//!
+//! Receivers can be used as iterators. For example, method [`iter`] creates an iterator that
+//! receives messages until the channel becomes empty and disconnected. Note that iteration may
+//! block waiting for next message to arrive.
+//!
+//! ```
+//! use std::thread;
+//! use crossbeam_channel::unbounded;
+//!
+//! let (s, r) = unbounded();
+//!
+//! thread::spawn(move || {
+//!     s.send(1).unwrap();
+//!     s.send(2).unwrap();
+//!     s.send(3).unwrap();
+//!     drop(s); // Disconnect the channel.
+//! });
+//!
+//! // Collect all messages from the channel.
+//! // Note that the call to `collect` blocks until the sender is dropped.
+//! let v: Vec<_> = r.iter().collect();
+//!
+//! assert_eq!(v, [1, 2, 3]);
+//! ```
+//!
+//! A non-blocking iterator can be created using [`try_iter`], which receives all available
+//! messages without blocking:
+//!
+//! ```
+//! use crossbeam_channel::unbounded;
+//!
+//! let (s, r) = unbounded();
+//! s.send(1).unwrap();
+//! s.send(2).unwrap();
+//! s.send(3).unwrap();
+//! // No need to drop the sender.
+//!
+//! // Receive all messages currently in the channel.
+//! let v: Vec<_> = r.try_iter().collect();
+//!
+//! assert_eq!(v, [1, 2, 3]);
+//! ```
+//!
+//! # Selection
+//!
+//! The [`select!`] macro allows you to define a set of channel operations, wait until any one of
+//! them becomes ready, and finally execute it. If multiple operations are ready at the same time,
+//! a random one among them is selected.
+//!
+//! It is also possible to define a `default` case that gets executed if none of the operations are
+//! ready, either right away or for a certain duration of time.
+//!
+//! An operation is considered to be ready if it doesn't have to block. Note that it is ready even
+//! when it will simply return an error because the channel is disconnected.
+//!
+//! An example of receiving a message from two channels:
+//!
+//! ```
+//! # #[macro_use]
+//! # extern crate crossbeam_channel;
+//! # fn main() {
+//! use std::thread;
+//! use std::time::Duration;
+//! use crossbeam_channel::unbounded;
+//!
+//! let (s1, r1) = unbounded();
+//! let (s2, r2) = unbounded();
+//!
+//! thread::spawn(move || s1.send(10).unwrap());
+//! thread::spawn(move || s2.send(20).unwrap());
+//!
+//! // At most one of these two receive operations will be executed.
+//! select! {
+//!     recv(r1) -> msg => assert_eq!(msg, Ok(10)),
+//!     recv(r2) -> msg => assert_eq!(msg, Ok(20)),
+//!     default(Duration::from_secs(1)) => println!("timed out"),
+//! }
+//! # }
+//! ```
+//!
+//! If you need to select over a dynamically created list of channel operations, use [`Select`]
+//! instead. The [`select!`] macro is just a convenience wrapper around [`Select`].
+//!
+//! # Extra channels
+//!
+//! Three functions can create special kinds of channels, all of which return just a [`Receiver`]
+//! handle:
+//!
+//! * [`after`] creates a channel that delivers a single message after a certain duration of time.
+//! * [`tick`] creates a channel that delivers messages periodically.
+//! * [`never`] creates a channel that never delivers messages.
+//!
+//! These channels are very efficient because messages get lazily generated on receive operations.
+//!
+//! An example that prints elapsed time every 50 milliseconds for the duration of 1 second:
+//!
+//! ```
+//! # #[macro_use]
+//! # extern crate crossbeam_channel;
+//! # fn main() {
+//! use std::time::{Duration, Instant};
+//! use crossbeam_channel::{after, tick};
+//!
+//! let start = Instant::now();
+//! let ticker = tick(Duration::from_millis(50));
+//! let timeout = after(Duration::from_secs(1));
+//!
+//! loop {
+//!     select! {
+//!         recv(ticker) -> _ => println!("elapsed: {:?}", start.elapsed()),
+//!         recv(timeout) -> _ => break,
+//!     }
+//! }
+//! # }
+//! ```
+//!
+//! [`std::sync::mpsc`]: https://doc.rust-lang.org/std/sync/mpsc/index.html
+//! [`unbounded`]: fn.unbounded.html
+//! [`bounded`]: fn.bounded.html
+//! [`after`]: fn.after.html
+//! [`tick`]: fn.tick.html
+//! [`never`]: fn.never.html
+//! [`send`]: struct.Sender.html#method.send
+//! [`recv`]: struct.Receiver.html#method.recv
+//! [`iter`]: struct.Receiver.html#method.iter
+//! [`try_iter`]: struct.Receiver.html#method.try_iter
+//! [`select!`]: macro.select.html
+//! [`Select`]: struct.Select.html
+//! [`Sender`]: struct.Sender.html
+//! [`Receiver`]: struct.Receiver.html
+
+#![warn(missing_docs)]
+#![warn(missing_debug_implementations)]
+
+extern crate crossbeam_epoch;
+extern crate crossbeam_utils;
+extern crate parking_lot;
+extern crate rand;
+extern crate smallvec;
+
+mod channel;
+mod context;
+mod err;
+mod flavors;
+mod select;
+mod select_macro;
+mod utils;
+mod waker;
+
+pub use channel::{after, never, tick};
+pub use channel::{bounded, unbounded};
+pub use channel::{IntoIter, Iter, TryIter};
+pub use channel::{Receiver, Sender};
+
+pub use select::{Select, SelectedOperation};
+
+pub use err::{RecvError, RecvTimeoutError, TryRecvError};
+pub use err::{SelectTimeoutError, TrySelectError};
+pub use err::{SendError, SendTimeoutError, TrySendError};
diff --git a/rustc_deps/vendor/crossbeam-channel/src/select.rs b/rustc_deps/vendor/crossbeam-channel/src/select.rs
new file mode 100644
index 0000000..f8b6e7b
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/select.rs
@@ -0,0 +1,813 @@
+//! Interface to the select mechanism.
+
+use std::fmt;
+use std::marker::PhantomData;
+use std::mem;
+use std::time::{Duration, Instant};
+
+use channel::{self, Receiver, Sender};
+use context::Context;
+use err::{RecvError, SelectTimeoutError, SendError, TrySelectError};
+use smallvec::SmallVec;
+use utils;
+
+use flavors;
+
+/// Temporary data that gets initialized during select or a blocking operation, and is consumed by
+/// `read` or `write`.
+///
+/// Each field contains data associated with a specific channel flavor.
+#[derive(Default)]
+pub struct Token {
+    pub after: flavors::after::AfterToken,
+    pub array: flavors::array::ArrayToken,
+    pub list: flavors::list::ListToken,
+    pub never: flavors::never::NeverToken,
+    pub tick: flavors::tick::TickToken,
+    pub zero: flavors::zero::ZeroToken,
+}
+
+/// Identifier associated with an operation by a specific thread on a specific channel.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub struct Operation(usize);
+
+impl Operation {
+    /// Creates an operation identifier from a mutable reference.
+    ///
+    /// This function essentially just turns the address of the reference into a number. The
+    /// reference should point to a variable that is specific to the thread and the operation,
+    /// and is alive for the entire duration of select or blocking operation.
+    #[inline]
+    pub fn hook<T>(r: &mut T) -> Operation {
+        let val = r as *mut T as usize;
+        // Make sure that the pointer address doesn't equal the numerical representation of
+        // `Selected::{Waiting, Aborted, Disconnected}`.
+        assert!(val > 2);
+        Operation(val)
+    }
+}
+
+/// Current state of a select or a blocking operation.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub enum Selected {
+    /// Still waiting for an operation.
+    Waiting,
+
+    /// The attempt to block the current thread has been aborted.
+    Aborted,
+
+    /// A channel was disconnected.
+    Disconnected,
+
+    /// An operation became ready.
+    Operation(Operation),
+}
+
+impl From<usize> for Selected {
+    #[inline]
+    fn from(val: usize) -> Selected {
+        match val {
+            0 => Selected::Waiting,
+            1 => Selected::Aborted,
+            2 => Selected::Disconnected,
+            oper => Selected::Operation(Operation(oper)),
+        }
+    }
+}
+
+impl Into<usize> for Selected {
+    #[inline]
+    fn into(self) -> usize {
+        match self {
+            Selected::Waiting => 0,
+            Selected::Aborted => 1,
+            Selected::Disconnected => 2,
+            Selected::Operation(Operation(val)) => val,
+        }
+    }
+}
+
+/// A receiver or a sender that can participate in select.
+///
+/// This is a handle that assists select in executing the operation, registration, deciding on the
+/// appropriate deadline for blocking, etc.
+pub trait SelectHandle {
+    /// Attempts to execute the operation and returns `true` on success.
+    fn try(&self, token: &mut Token) -> bool;
+
+    /// Attempts to execute the operation again and returns `true` on success.
+    ///
+    /// Retries are allowed to take a little bit more time than the initial try.
+    fn retry(&self, token: &mut Token) -> bool;
+
+    /// Returns a deadline for the operation, if there is one.
+    fn deadline(&self) -> Option<Instant>;
+
+    /// Registers the operation.
+    fn register(&self, token: &mut Token, oper: Operation, cx: &Context) -> bool;
+
+    /// Unregisters the operation.
+    fn unregister(&self, oper: Operation);
+
+    /// Attempts to execute the selected operation.
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool;
+
+    /// Returns the current state of the opposite side of the channel.
+    ///
+    /// This is typically represented by the current message index at the opposite side of the
+    /// channel.
+    ///
+    /// For example, by calling `state()`, the receiving side can check how much activity the
+    /// sending side has had and viceversa.
+    fn state(&self) -> usize;
+}
+
+impl<'a, T: SelectHandle> SelectHandle for &'a T {
+    fn try(&self, token: &mut Token) -> bool {
+        (**self).try(token)
+    }
+
+    fn retry(&self, token: &mut Token) -> bool {
+        (**self).retry(token)
+    }
+
+    fn deadline(&self) -> Option<Instant> {
+        (**self).deadline()
+    }
+
+    fn register(&self, token: &mut Token, oper: Operation, cx: &Context) -> bool {
+        (**self).register(token, oper, cx)
+    }
+
+    fn unregister(&self, oper: Operation) {
+        (**self).unregister(oper);
+    }
+
+    fn accept(&self, token: &mut Token, cx: &Context) -> bool {
+        (**self).accept(token, cx)
+    }
+
+    fn state(&self) -> usize {
+        (**self).state()
+    }
+}
+
+/// Determines when a select operation should time out.
+#[derive(Clone, Copy, Eq, PartialEq)]
+enum Timeout {
+    /// Try firing operations without blocking.
+    Now,
+
+    /// Block forever.
+    Never,
+
+    /// Time out after an instant in time.
+    At(Instant),
+}
+
+/// Runs until one of the operations is fired, potentially blocking the current thread.
+///
+/// Successful receive operations will have to be followed up by `channel::read()` and successful
+/// send operations by `channel::write()`.
+fn run_select<S>(
+    handles: &mut [(&S, usize, *const u8)],
+    timeout: Timeout,
+) -> Option<(Token, usize, *const u8)>
+where
+    S: SelectHandle + ?Sized,
+{
+    if handles.is_empty() {
+        // Wait until the timeout and return.
+        match timeout {
+            Timeout::Now => return None,
+            Timeout::Never => {
+                utils::sleep_until(None);
+                unreachable!();
+            }
+            Timeout::At(when) => {
+                utils::sleep_until(Some(when));
+                return None;
+            }
+        }
+    }
+
+    // Create a token, which serves as a temporary variable that gets initialized in this function
+    // and is later used by a call to `channel::read()` or `channel::write()` that completes the
+    // selected operation.
+    let mut token = Token::default();
+
+    // Is this is a non-blocking select?
+    if timeout == Timeout::Now {
+        if handles.len() <= 1 {
+            // Try firing the operations without blocking.
+            for &(handle, i, ptr) in handles.iter() {
+                if handle.try(&mut token) {
+                    return Some((token, i, ptr));
+                }
+            }
+
+            return None;
+        }
+
+        // Shuffle the operations for fairness.
+        utils::shuffle(handles);
+
+        let mut states = SmallVec::<[usize; 4]>::with_capacity(handles.len());
+
+        // Snapshot the channel states of all operations.
+        for &(handle, _, _) in handles.iter() {
+            states.push(handle.state());
+        }
+
+        loop {
+            // Try firing the operations.
+            for &(handle, i, ptr) in handles.iter() {
+                if handle.try(&mut token) {
+                    return Some((token, i, ptr));
+                }
+            }
+
+            let mut changed = false;
+
+            // Update the channel states and check whether any have been changed.
+            for (&(handle, _, _), state) in handles.iter().zip(states.iter_mut()) {
+                let current = handle.state();
+
+                if *state != current {
+                    *state = current;
+                    changed = true;
+                }
+            }
+
+            // If none of the states have changed, selection failed.
+            if !changed {
+                return None;
+            }
+        }
+    }
+
+    loop {
+        // Shuffle the operations for fairness.
+        if handles.len() >= 2 {
+            utils::shuffle(handles);
+        }
+
+        // Try firing the operations without blocking.
+        for &(handle, i, ptr) in handles.iter() {
+            if handle.try(&mut token) {
+                return Some((token, i, ptr));
+            }
+        }
+
+        // Before blocking, try firing the operations one more time. Retries are permitted to take
+        // a little bit more time than the initial tries, but they still mustn't block.
+        for &(handle, i, ptr) in handles.iter() {
+            if handle.retry(&mut token) {
+                return Some((token, i, ptr));
+            }
+        }
+
+        // Prepare for blocking.
+        let res = Context::with(|cx| {
+            let mut sel = Selected::Waiting;
+            let mut registered_count = 0;
+
+            // Register all operations.
+            for (handle, _, _) in handles.iter_mut() {
+                registered_count += 1;
+
+                // If registration returns `false`, that means the operation has just become ready.
+                if !handle.register(&mut token, Operation::hook::<&S>(handle), cx) {
+                    // Try aborting select.
+                    sel = match cx.try_select(Selected::Aborted) {
+                        Ok(()) => Selected::Aborted,
+                        Err(s) => s,
+                    };
+                    break;
+                }
+
+                // If another thread has already selected one of the operations, stop registration.
+                sel = cx.selected();
+                if sel != Selected::Waiting {
+                    break;
+                }
+            }
+
+            if sel == Selected::Waiting {
+                // Check with each operation for how long we're allowed to block, and compute the
+                // earliest deadline.
+                let mut deadline: Option<Instant> = match timeout {
+                    Timeout::Now => unreachable!(),
+                    Timeout::Never => None,
+                    Timeout::At(when) => Some(when),
+                };
+                for &(handle, _, _) in handles.iter() {
+                    if let Some(x) = handle.deadline() {
+                        deadline = deadline.map(|y| x.min(y)).or(Some(x));
+                    }
+                }
+
+                // Block the current thread.
+                sel = cx.wait_until(deadline);
+            }
+
+            // Unregister all registered operations.
+            for (handle, _, _) in handles.iter_mut().take(registered_count) {
+                handle.unregister(Operation::hook::<&S>(handle));
+            }
+
+            match sel {
+                Selected::Waiting => unreachable!(),
+                Selected::Aborted => {}
+                Selected::Disconnected | Selected::Operation(_) => {
+                    // Find the selected operation.
+                    for (handle, i, ptr) in handles.iter_mut() {
+                        // Is this the selected operation?
+                        if sel == Selected::Operation(Operation::hook::<&S>(handle)) {
+                            // Try firing this operation.
+                            if handle.accept(&mut token, cx) {
+                                return Some((*i, *ptr));
+                            }
+                        }
+                    }
+                }
+            }
+
+            None
+        });
+
+        // Return if an operation was fired.
+        if let Some((i, ptr)) = res {
+            return Some((token, i, ptr));
+        }
+
+        // Check for timeout.
+        match timeout {
+            Timeout::Now => unreachable!(),
+            Timeout::Never => {}
+            Timeout::At(when) => {
+                if Instant::now() >= when {
+                    // Fall back to one final non-blocking select. This is needed to make the whole
+                    // select invocation appear from the outside as a single operation.
+                    return run_select(handles, Timeout::Now);
+                }
+            }
+        };
+    }
+}
+
+/// Selects from a set of channel operations.
+///
+/// `Select` allows you to define a set of channel operations, wait until any one of them becomes
+/// ready, and finally execute it. If multiple operations are ready at the same time, a random one
+/// among them is selected.
+///
+/// An operation is considered to be ready if it doesn't have to block. Note that it is ready even
+/// when it will simply return an error because the channel is disconnected.
+///
+/// The [`select!`] macro is a convenience wrapper around `Select`. However, it cannot select over a
+/// dynamically created list of channel operations.
+///
+/// [`select!`]: macro.select.html
+///
+/// # Examples
+///
+/// ```
+/// use std::thread;
+/// use crossbeam_channel::{unbounded, Select};
+///
+/// let (s1, r1) = unbounded();
+/// let (s2, r2) = unbounded();
+/// s1.send(10).unwrap();
+///
+/// let mut sel = Select::new();
+/// let oper1 = sel.recv(&r1);
+/// let oper2 = sel.send(&s2);
+///
+/// // Both operations are initially ready, so a random one will be executed.
+/// let oper = sel.select();
+/// match oper.index() {
+///     i if i == oper1 => assert_eq!(oper.recv(&r1), Ok(10)),
+///     i if i == oper2 => assert_eq!(oper.send(&s2, 20), Ok(())),
+///     _ => unreachable!(),
+/// }
+/// ```
+pub struct Select<'a> {
+    /// A list of senders and receivers participating in selection.
+    handles: SmallVec<[(&'a SelectHandle, usize, *const u8); 4]>,
+}
+
+unsafe impl<'a> Send for Select<'a> {}
+unsafe impl<'a> Sync for Select<'a> {}
+
+impl<'a> Select<'a> {
+    /// Creates an empty list of channel operations for selection.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::Select;
+    ///
+    /// let mut sel = Select::new();
+    ///
+    /// // The list of operations is empty, which means no operation can be selected.
+    /// assert!(sel.try_select().is_err());
+    /// ```
+    pub fn new() -> Select<'a> {
+        Select {
+            handles: SmallVec::new(),
+        }
+    }
+
+    /// Adds a send operation.
+    ///
+    /// Returns the index of the added operation.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use crossbeam_channel::{unbounded, Select};
+    ///
+    /// let (s1, r1) = unbounded::<i32>();
+    /// let (s2, r2) = unbounded::<i32>();
+    /// let (s3, r3) = unbounded::<i32>();
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.send(&s1);
+    /// let oper2 = sel.send(&s2);
+    /// let oper3 = sel.send(&s3);
+    ///
+    /// assert_eq!(oper1, 0);
+    /// assert_eq!(oper2, 1);
+    /// assert_eq!(oper3, 2);
+    /// ```
+    pub fn send<T>(&mut self, s: &'a Sender<T>) -> usize {
+        let i = self.handles.len();
+        let ptr = s as *const Sender<_> as *const u8;
+        self.handles.push((s, i, ptr));
+        i
+    }
+
+    /// Adds a receive operation.
+    ///
+    /// Returns the index of the added operation.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use crossbeam_channel::{unbounded, Select};
+    ///
+    /// let (s1, r1) = unbounded::<i32>();
+    /// let (s2, r2) = unbounded::<i32>();
+    /// let (s3, r3) = unbounded::<i32>();
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.recv(&r1);
+    /// let oper2 = sel.recv(&r2);
+    /// let oper3 = sel.recv(&r3);
+    ///
+    /// assert_eq!(oper1, 0);
+    /// assert_eq!(oper2, 1);
+    /// assert_eq!(oper3, 2);
+    /// ```
+    pub fn recv<T>(&mut self, r: &'a Receiver<T>) -> usize {
+        let i = self.handles.len();
+        let ptr = r as *const Receiver<_> as *const u8;
+        self.handles.push((r, i, ptr));
+        i
+    }
+
+    /// Attempts to execute one of the operations without blocking.
+    ///
+    /// If an operation is ready, it is selected and returned. If multiple operations are ready at
+    /// the same time, a random one among them is selected. If none of the operations are ready, an
+    /// error is returned.
+    ///
+    /// An operation is considered to be ready if it doesn't have to block. Note that it is ready
+    /// even when it will simply return an error because the channel is disconnected.
+    ///
+    /// The selected operation must be completed with [`SelectedOperation::send`]
+    /// or [`SelectedOperation::recv`].
+    ///
+    /// [`SelectedOperation::send`]: struct.SelectedOperation.html#method.send
+    /// [`SelectedOperation::recv`]: struct.SelectedOperation.html#method.recv
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use crossbeam_channel::{unbounded, Select};
+    ///
+    /// let (s1, r1) = unbounded();
+    /// let (s2, r2) = unbounded();
+    ///
+    /// s1.send(10).unwrap();
+    /// s2.send(20).unwrap();
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.recv(&r1);
+    /// let oper2 = sel.recv(&r2);
+    ///
+    /// // Both operations are initially ready, so a random one will be executed.
+    /// let oper = sel.try_select();
+    /// match oper {
+    ///     Err(_) => panic!("both operations should be ready"),
+    ///     Ok(oper) => match oper.index() {
+    ///         i if i == oper1 => assert_eq!(oper.recv(&r1), Ok(10)),
+    ///         i if i == oper2 => assert_eq!(oper.recv(&r2), Ok(20)),
+    ///         _ => unreachable!(),
+    ///     }
+    /// }
+    /// ```
+    pub fn try_select(&mut self) -> Result<SelectedOperation<'_>, TrySelectError> {
+        match run_select(&mut self.handles, Timeout::Now) {
+            None => Err(TrySelectError),
+            Some((token, index, ptr)) => Ok(SelectedOperation {
+                token,
+                index,
+                ptr,
+                _marker: PhantomData,
+            }),
+        }
+    }
+
+    /// Blocks until one of the operations becomes ready.
+    ///
+    /// Once an operation becomes ready, it is selected and returned.
+    ///
+    /// An operation is considered to be ready if it doesn't have to block. Note that it is ready
+    /// even when it will simply return an error because the channel is disconnected.
+    ///
+    /// The selected operation must be completed with [`SelectedOperation::send`]
+    /// or [`SelectedOperation::recv`].
+    ///
+    /// [`SelectedOperation::send`]: struct.SelectedOperation.html#method.send
+    /// [`SelectedOperation::recv`]: struct.SelectedOperation.html#method.recv
+    ///
+    /// # Panics
+    ///
+    /// Panics if no operations have been added to `Select`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{unbounded, Select};
+    ///
+    /// let (s1, r1) = unbounded();
+    /// let (s2, r2) = unbounded();
+    ///
+    /// thread::spawn(move || {
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     s1.send(10).unwrap();
+    /// });
+    /// thread::spawn(move || s2.send(20).unwrap());
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.recv(&r1);
+    /// let oper2 = sel.recv(&r2);
+    ///
+    /// // The second operation will be selected because it becomes ready first.
+    /// let oper = sel.select();
+    /// match oper.index() {
+    ///     i if i == oper1 => assert_eq!(oper.recv(&r1), Ok(10)),
+    ///     i if i == oper2 => assert_eq!(oper.recv(&r2), Ok(20)),
+    ///     _ => unreachable!(),
+    /// }
+    /// ```
+    pub fn select(&mut self) -> SelectedOperation<'_> {
+        if self.handles.is_empty() {
+            panic!("no operations have been added to `Select`");
+        }
+
+        let (token, index, ptr) = run_select(&mut self.handles, Timeout::Never).unwrap();
+        SelectedOperation {
+            token,
+            index,
+            ptr,
+            _marker: PhantomData,
+        }
+    }
+
+    /// Waits until one of the operations becomes ready, but only for a limited time.
+    ///
+    /// If an operation becomes ready, it is selected and returned. If multiple operations are
+    /// ready at the same time, a random one among them is selected. If none of the operations
+    /// become ready for the specified duration, an error is returned.
+    ///
+    /// An operation is considered to be ready if it doesn't have to block. Note that it is ready
+    /// even when it will simply return an error because the channel is disconnected.
+    ///
+    /// The selected operation must be completed with [`SelectedOperation::send`]
+    /// or [`SelectedOperation::recv`].
+    ///
+    /// [`SelectedOperation::send`]: struct.SelectedOperation.html#method.send
+    /// [`SelectedOperation::recv`]: struct.SelectedOperation.html#method.recv
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::thread;
+    /// use std::time::Duration;
+    /// use crossbeam_channel::{unbounded, Select};
+    ///
+    /// let (s1, r1) = unbounded();
+    /// let (s2, r2) = unbounded();
+    ///
+    /// thread::spawn(move || {
+    ///     thread::sleep(Duration::from_secs(1));
+    ///     s1.send(10).unwrap();
+    /// });
+    /// thread::spawn(move || s2.send(20).unwrap());
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.recv(&r1);
+    /// let oper2 = sel.recv(&r2);
+    ///
+    /// // The second operation will be selected because it becomes ready first.
+    /// let oper = sel.select_timeout(Duration::from_millis(500));
+    /// match oper {
+    ///     Err(_) => panic!("should not have timed out"),
+    ///     Ok(oper) => match oper.index() {
+    ///         i if i == oper1 => assert_eq!(oper.recv(&r1), Ok(10)),
+    ///         i if i == oper2 => assert_eq!(oper.recv(&r2), Ok(20)),
+    ///         _ => unreachable!(),
+    ///     }
+    /// }
+    /// ```
+    pub fn select_timeout(
+        &mut self,
+        timeout: Duration,
+    ) -> Result<SelectedOperation<'_>, SelectTimeoutError> {
+        let timeout = Timeout::At(Instant::now() + timeout);
+
+        match run_select(&mut self.handles, timeout) {
+            None => Err(SelectTimeoutError),
+            Some((token, index, ptr)) => Ok(SelectedOperation {
+                token,
+                index,
+                ptr,
+                _marker: PhantomData,
+            }),
+        }
+    }
+}
+
+impl<'a> Clone for Select<'a> {
+    fn clone(&self) -> Select<'a> {
+        Select {
+            handles: self.handles.clone(),
+        }
+    }
+}
+
+impl<'a> fmt::Debug for Select<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("Select").finish()
+    }
+}
+
+/// A selected operation that needs to be completed.
+///
+/// To complete the operation, call [`send`] or [`recv`].
+///
+/// # Panics
+///
+/// Forgetting to complete the operation is an error and might lead to deadlocks. If a
+/// `SelectedOperation` is dropped without completion, a panic occurs.
+///
+/// [`send`]: struct.SelectedOperation.html#method.send
+/// [`recv`]: struct.SelectedOperation.html#method.recv
+#[must_use]
+pub struct SelectedOperation<'a> {
+    /// Token needed to complete the operation.
+    token: Token,
+
+    /// The index of the selected operation.
+    index: usize,
+
+    /// The address of the selected `Sender` or `Receiver`.
+    ptr: *const u8,
+
+    /// Indicates that a `Select<'a>` is mutably borrowed.
+    _marker: PhantomData<&'a mut Select<'a>>,
+}
+
+impl<'a> SelectedOperation<'a> {
+    /// Returns the index of the selected operation.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, Select};
+    ///
+    /// let (s1, r1) = bounded::<()>(0);
+    /// let (s2, r2) = bounded::<()>(0);
+    /// let (s3, r3) = bounded::<()>(1);
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.send(&s1);
+    /// let oper2 = sel.recv(&r2);
+    /// let oper3 = sel.send(&s3);
+    ///
+    /// // Only the last operation is ready.
+    /// let oper = sel.select();
+    /// assert_eq!(oper.index(), 2);
+    /// assert_eq!(oper.index(), oper3);
+    ///
+    /// // Complete the operation.
+    /// oper.send(&s3, ()).unwrap();
+    /// ```
+    pub fn index(&self) -> usize {
+        self.index
+    }
+
+    /// Completes the send operation.
+    ///
+    /// The passed [`Sender`] reference must be the same one that was used in [`Select::send`]
+    /// when the operation was added.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an incorrect [`Sender`] reference is passed.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, Select, SendError};
+    ///
+    /// let (s, r) = bounded::<i32>(0);
+    /// drop(r);
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.send(&s);
+    ///
+    /// let oper = sel.select();
+    /// assert_eq!(oper.index(), oper1);
+    /// assert_eq!(oper.send(&s, 10), Err(SendError(10)));
+    /// ```
+    ///
+    /// [`Sender`]: struct.Sender.html
+    /// [`Select::send`]: struct.Select.html#method.send
+    pub fn send<T>(mut self, s: &Sender<T>, msg: T) -> Result<(), SendError<T>> {
+        assert!(
+            s as *const Sender<T> as *const u8 == self.ptr,
+            "passed a sender that wasn't selected",
+        );
+        let res = unsafe { channel::write(s, &mut self.token, msg) };
+        mem::forget(self);
+        res.map_err(SendError)
+    }
+
+    /// Completes the receive operation.
+    ///
+    /// The passed [`Receiver`] reference must be the same one that was used in [`Select::recv`]
+    /// when the operation was added.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an incorrect [`Receiver`] reference is passed.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use crossbeam_channel::{bounded, Select, RecvError};
+    ///
+    /// let (s, r) = bounded::<i32>(0);
+    /// drop(s);
+    ///
+    /// let mut sel = Select::new();
+    /// let oper1 = sel.recv(&r);
+    ///
+    /// let oper = sel.select();
+    /// assert_eq!(oper.index(), oper1);
+    /// assert_eq!(oper.recv(&r), Err(RecvError));
+    /// ```
+    ///
+    /// [`Receiver`]: struct.Receiver.html
+    /// [`Select::recv`]: struct.Select.html#method.recv
+    pub fn recv<T>(mut self, r: &Receiver<T>) -> Result<T, RecvError> {
+        assert!(
+            r as *const Receiver<T> as *const u8 == self.ptr,
+            "passed a receiver that wasn't selected",
+        );
+        let res = unsafe { channel::read(r, &mut self.token) };
+        mem::forget(self);
+        res.map_err(|_| RecvError)
+    }
+}
+
+impl<'a> fmt::Debug for SelectedOperation<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("SelectedOperation").finish()
+    }
+}
+
+impl<'a> Drop for SelectedOperation<'a> {
+    fn drop(&mut self) {
+        panic!("dropped `SelectedOperation` without completing the operation");
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/select_macro.rs b/rustc_deps/vendor/crossbeam-channel/src/select_macro.rs
new file mode 100644
index 0000000..c732472
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/select_macro.rs
@@ -0,0 +1,1163 @@
+//! The `select!` macro.
+
+/// A simple wrapper around the standard macros.
+///
+/// This is just an ugly workaround until it becomes possible to import macros with `use`
+/// statements.
+///
+/// TODO(stjepang): Once we bump the minimum required Rust version to 1.30 or newer, we should:
+///
+/// 1. Remove all `#[macro_export(local_inner_macros)]` lines.
+/// 2. Replace `crossbeam_channel_delegate` with direct macro invocations.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! crossbeam_channel_delegate {
+    (concat($($args:tt)*)) => {
+        concat!($($args)*)
+    };
+    (stringify($($args:tt)*)) => {
+        stringify!($($args)*)
+    };
+    (unreachable($($args:tt)*)) => {
+        unreachable!($($args)*)
+    };
+    (compile_error($($args:tt)*)) => {
+        compile_error!($($args)*)
+    };
+}
+
+/// A helper macro for `select!` to hide the long list of macro patterns from the documentation.
+///
+/// The macro consists of two stages:
+/// 1. Parsing
+/// 2. Code generation
+///
+/// The parsing stage consists of these subparts:
+/// 1. `@list`: Turns a list of tokens into a list of cases.
+/// 2. `@list_errorN`: Diagnoses the syntax error.
+/// 3. `@case`: Parses a single case and verifies its argument list.
+///
+/// The codegen stage consists of these subparts:
+/// 1. `@init`: Attempts to optimize `select!` away and initializes a `Select`.
+/// 2. `@add`: Adds send/receive operations to the `Select` and starts selection.
+/// 3. `@complete`: Completes the selected send/receive operation.
+///
+/// If the parsing stage encounters a syntax error or the codegen stage ends up with too many
+/// cases to process, the macro fails with a compile-time error.
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! crossbeam_channel_internal {
+    // The list is empty. Now check the arguments of each processed case.
+    (@list
+        ()
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($head)*)
+            ()
+            ()
+        )
+    };
+    // If necessary, insert an empty argument list after `default`.
+    (@list
+        (default => $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @list
+            (default() => $($tail)*)
+            ($($head)*)
+        )
+    };
+    // But print an error if `default` is followed by a `->`.
+    (@list
+        (default -> $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected `=>` after `default` case, found `->`"
+        ))
+    };
+    // Print an error if there's an `->` after the argument list in the default case.
+    (@list
+        (default $args:tt -> $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected `=>` after `default` case, found `->`"
+        ))
+    };
+    // Print an error if there is a missing result in a recv case.
+    (@list
+        (recv($($args:tt)*) => $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected `->` after `recv` case, found `=>`"
+        ))
+    };
+    // Print an error if there is a missing result in a send case.
+    (@list
+        (send($($args:tt)*) => $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected `->` after `send` operation, found `=>`"
+        ))
+    };
+    // Make sure the arrow and the result are not repeated.
+    (@list
+        ($case:ident $args:tt -> $res:tt -> $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error("expected `=>`, found `->`"))
+    };
+    // Print an error if there is a semicolon after the block.
+    (@list
+        ($case:ident $args:tt $(-> $res:pat)* => $body:block; $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "did you mean to put a comma instead of the semicolon after `}`?"
+        ))
+    };
+    // The first case is separated by a comma.
+    (@list
+        ($case:ident ($($args:tt)*) $(-> $res:pat)* => $body:expr, $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @list
+            ($($tail)*)
+            ($($head)* $case ($($args)*) $(-> $res)* => { $body },)
+        )
+    };
+    // Don't require a comma after the case if it has a proper block.
+    (@list
+        ($case:ident ($($args:tt)*) $(-> $res:pat)* => $body:block $($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @list
+            ($($tail)*)
+            ($($head)* $case ($($args)*) $(-> $res)* => { $body },)
+        )
+    };
+    // Only one case remains.
+    (@list
+        ($case:ident ($($args:tt)*) $(-> $res:pat)* => $body:expr)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @list
+            ()
+            ($($head)* $case ($($args)*) $(-> $res)* => { $body },)
+        )
+    };
+    // Accept a trailing comma at the end of the list.
+    (@list
+        ($case:ident ($($args:tt)*) $(-> $res:pat)* => $body:expr,)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(
+            @list
+            ()
+            ($($head)* $case ($($args)*) $(-> $res)* => { $body },)
+        )
+    };
+    // Diagnose and print an error.
+    (@list
+        ($($tail:tt)*)
+        ($($head:tt)*)
+    ) => {
+        crossbeam_channel_internal!(@list_error1 $($tail)*)
+    };
+    // Stage 1: check the case type.
+    (@list_error1 recv $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error2 recv $($tail)*)
+    };
+    (@list_error1 send $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error2 send $($tail)*)
+    };
+    (@list_error1 default $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error2 default $($tail)*)
+    };
+    (@list_error1 $t:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected one of `recv`, `send`, or `default`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error1 $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error2 $($tail)*);
+    };
+    // Stage 2: check the argument list.
+    (@list_error2 $case:ident) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "missing argument list after `",
+                crossbeam_channel_delegate!(stringify($case)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error2 $case:ident => $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "missing argument list after `",
+                crossbeam_channel_delegate!(stringify($case)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error2 $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error3 $($tail)*)
+    };
+    // Stage 3: check the `=>` and what comes after it.
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "missing `=>` after `",
+                crossbeam_channel_delegate!(stringify($case)),
+                "` case",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* =>) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected expression after `=>`"
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $body:expr; $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma instead of the semicolon after `",
+                crossbeam_channel_delegate!(stringify($body)),
+                "`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => recv($($a:tt)*) $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected an expression after `=>`"
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => send($($a:tt)*) $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected an expression after `=>`"
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => default($($a:tt)*) $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            "expected an expression after `=>`"
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $f:ident($($a:tt)*) $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma after `",
+                crossbeam_channel_delegate!(stringify($f)),
+                "(",
+                crossbeam_channel_delegate!(stringify($($a)*)),
+                ")`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $f:ident!($($a:tt)*) $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma after `",
+                crossbeam_channel_delegate!(stringify($f)),
+                "!(",
+                crossbeam_channel_delegate!(stringify($($a)*)),
+                ")`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $f:ident![$($a:tt)*] $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma after `",
+                crossbeam_channel_delegate!(stringify($f)),
+                "![",
+                crossbeam_channel_delegate!(stringify($($a)*)),
+                "]`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $f:ident!{$($a:tt)*} $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma after `",
+                crossbeam_channel_delegate!(stringify($f)),
+                "!{",
+                crossbeam_channel_delegate!(stringify($($a)*)),
+                "}`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $(-> $r:pat)* => $body:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "did you mean to put a comma after `",
+                crossbeam_channel_delegate!(stringify($body)),
+                "`?",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) -> => $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error("missing pattern after `->`"))
+    };
+    (@list_error3 $case:ident($($args:tt)*) $t:tt $(-> $r:pat)* => $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected `->`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 $case:ident($($args:tt)*) -> $t:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected a pattern, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 recv($($args:tt)*) $t:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected `->`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 send($($args:tt)*) $t:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected `->`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 recv $args:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list after `recv`, found `",
+                crossbeam_channel_delegate!(stringify($args)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 send $args:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list after `send`, found `",
+                crossbeam_channel_delegate!(stringify($args)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 default $args:tt $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list or `=>` after `default`, found `",
+                crossbeam_channel_delegate!(stringify($args)),
+                "`",
+            ))
+        ))
+    };
+    (@list_error3 $($tail:tt)*) => {
+        crossbeam_channel_internal!(@list_error4 $($tail)*)
+    };
+    // Stage 4: fail with a generic error message.
+    (@list_error4 $($tail:tt)*) => {
+        crossbeam_channel_delegate!(compile_error("invalid syntax"))
+    };
+
+    // Success! All cases were parsed.
+    (@case
+        ()
+        $cases:tt
+        $default:tt
+    ) => {
+        crossbeam_channel_internal!(
+            @init
+            $cases
+            $default
+        )
+    };
+
+    // Check the format of a recv case.
+    (@case
+        (recv($r:expr) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            ($($cases)* recv($r) -> $res => $body,)
+            $default
+        )
+    };
+    // Allow trailing comma...
+    (@case
+        (recv($r:expr,) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            ($($cases)* recv($r) -> $res => $body,)
+            $default
+        )
+    };
+    // Print an error if the argument list is invalid.
+    (@case
+        (recv($($args:tt)*) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "invalid argument list in `recv(",
+                crossbeam_channel_delegate!(stringify($($args)*)),
+                ")`",
+            ))
+        ))
+    };
+    // Print an error if there is no argument list.
+    (@case
+        (recv $t:tt $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list after `recv`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+
+    // Check the format of a send case.
+    (@case
+        (send($s:expr, $m:expr) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            ($($cases)* send($s, $m) -> $res => $body,)
+            $default
+        )
+    };
+    // Allow trailing comma...
+    (@case
+        (send($s:expr, $m:expr,) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            ($($cases)* send($s, $m) -> $res => $body,)
+            $default
+        )
+    };
+    // Print an error if the argument list is invalid.
+    (@case
+        (send($($args:tt)*) -> $res:pat => $body:tt, $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "invalid argument list in `send(",
+                crossbeam_channel_delegate!(stringify($($args)*)),
+                ")`",
+            ))
+        ))
+    };
+    // Print an error if there is no argument list.
+    (@case
+        (send $t:tt $($tail:tt)*)
+        ($($cases:tt)*)
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list after `send`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+
+    // Check the format of a default case.
+    (@case
+        (default() => $body:tt, $($tail:tt)*)
+        $cases:tt
+        ()
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            $cases
+            (default() => $body,)
+        )
+    };
+    // Check the format of a default case with timeout.
+    (@case
+        (default($timeout:expr) => $body:tt, $($tail:tt)*)
+        $cases:tt
+        ()
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            $cases
+            (default($timeout) => $body,)
+        )
+    };
+    // Allow trailing comma...
+    (@case
+        (default($timeout:expr,) => $body:tt, $($tail:tt)*)
+        $cases:tt
+        ()
+    ) => {
+        crossbeam_channel_internal!(
+            @case
+            ($($tail)*)
+            $cases
+            (default($timeout) => $body,)
+        )
+    };
+    // Check for duplicate default cases...
+    (@case
+        (default $($tail:tt)*)
+        $cases:tt
+        ($($def:tt)+)
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            "there can be only one `default` case in a `select!` block"
+        ))
+    };
+    // Print an error if the argument list is invalid.
+    (@case
+        (default($($args:tt)*) => $body:tt, $($tail:tt)*)
+        $cases:tt
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "invalid argument list in `default(",
+                crossbeam_channel_delegate!(stringify($($args)*)),
+                ")`",
+            ))
+        ))
+    };
+    // Print an error if there is an unexpected token after `default`.
+    (@case
+        (default $($tail:tt)*)
+        $cases:tt
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected an argument list or `=>` after `default`, found `",
+                crossbeam_channel_delegate!(stringify($t)),
+                "`",
+            ))
+        ))
+    };
+
+    // The case was not consumed, therefore it must be invalid.
+    (@case
+        ($case:ident $($tail:tt)*)
+        $cases:tt
+        $default:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "expected one of `recv`, `send`, or `default`, found `",
+                crossbeam_channel_delegate!(stringify($case)),
+                "`",
+            ))
+        ))
+    };
+
+    // Optimize `select!` into `try_recv()`.
+    (@init
+        (recv($r:expr) -> $res:pat => $recv_body:tt,)
+        (default() => $default_body:tt,)
+    ) => {{
+        match $r {
+            ref _r => {
+                let _r: &$crate::Receiver<_> = _r;
+                match _r.try_recv() {
+                    ::std::result::Result::Err($crate::TryRecvError::Empty) => {
+                        $default_body
+                    }
+                    _res => {
+                        let _res = _res.map_err(|_| $crate::RecvError);
+                        let $res = _res;
+                        $recv_body
+                    }
+                }
+            }
+        }
+    }};
+    // Optimize `select!` into `recv()`.
+    (@init
+        (recv($r:expr) -> $res:pat => $body:tt,)
+        ()
+    ) => {{
+        match $r {
+            ref _r => {
+                let _r: &$crate::Receiver<_> = _r;
+                let _res = _r.recv();
+                let $res = _res;
+                $body
+            }
+        }
+    }};
+    // Optimize `select!` into `recv_timeout()`.
+    (@init
+        (recv($r:expr) -> $res:pat => $recv_body:tt,)
+        (default($timeout:expr) => $default_body:tt,)
+    ) => {{
+        match $r {
+            ref _r => {
+                let _r: &$crate::Receiver<_> = _r;
+                match _r.recv_timeout($timeout) {
+                    ::std::result::Result::Err($crate::RecvTimeoutError::Timeout) => {
+                        $default_body
+                    }
+                    _res => {
+                        let _res = _res.map_err(|_| $crate::RecvError);
+                        let $res = _res;
+                        $recv_body
+                    }
+                }
+            }
+        }
+    }};
+
+    // // Optimize the non-blocking case with two receive operations.
+    // (@init
+    //     (recv($r1:expr) -> $res1:pat => $recv_body1:tt,)
+    //     (recv($r2:expr) -> $res2:pat => $recv_body2:tt,)
+    //     (default() => $default_body:tt,)
+    // ) => {{
+    //     match $r1 {
+    //         ref _r1 => {
+    //             let _r1: &$crate::Receiver<_> = _r1;
+    //
+    //             match $r2 {
+    //                 ref _r2 => {
+    //                     let _r2: &$crate::Receiver<_> = _r2;
+    //
+    //                     // TODO(stjepang): Implement this optimization.
+    //                 }
+    //             }
+    //         }
+    //     }
+    // }};
+    // // Optimize the blocking case with two receive operations.
+    // (@init
+    //     (recv($r1:expr) -> $res1:pat => $body1:tt,)
+    //     (recv($r2:expr) -> $res2:pat => $body2:tt,)
+    //     ()
+    // ) => {{
+    //     match $r1 {
+    //         ref _r1 => {
+    //             let _r1: &$crate::Receiver<_> = _r1;
+    //
+    //             match $r2 {
+    //                 ref _r2 => {
+    //                     let _r2: &$crate::Receiver<_> = _r2;
+    //
+    //                     // TODO(stjepang): Implement this optimization.
+    //                 }
+    //             }
+    //         }
+    //     }
+    // }};
+    // // Optimize the case with two receive operations and a timeout.
+    // (@init
+    //     (recv($r1:expr) -> $res1:pat => $recv_body1:tt,)
+    //     (recv($r2:expr) -> $res2:pat => $recv_body2:tt,)
+    //     (default($timeout:expr) => $default_body:tt,)
+    // ) => {{
+    //     match $r1 {
+    //         ref _r1 => {
+    //             let _r1: &$crate::Receiver<_> = _r1;
+    //
+    //             match $r2 {
+    //                 ref _r2 => {
+    //                     let _r2: &$crate::Receiver<_> = _r2;
+    //
+    //                     // TODO(stjepang): Implement this optimization.
+    //                 }
+    //             }
+    //         }
+    //     }
+    // }};
+
+    // // Optimize `select!` into `try_send()`.
+    // (@init
+    //     (send($s:expr, $m:expr) -> $res:pat => $send_body:tt,)
+    //     (default() => $default_body:tt,)
+    // ) => {{
+    //     match $s {
+    //         ref _s => {
+    //             let _s: &$crate::Sender<_> = _s;
+    //             // TODO(stjepang): Implement this optimization.
+    //         }
+    //     }
+    // }};
+    // // Optimize `select!` into `send()`.
+    // (@init
+    //     (send($s:expr, $m:expr) -> $res:pat => $body:tt,)
+    //     ()
+    // ) => {{
+    //     match $s {
+    //         ref _s => {
+    //             let _s: &$crate::Sender<_> = _s;
+    //             // TODO(stjepang): Implement this optimization.
+    //         }
+    //     }
+    // }};
+    // // Optimize `select!` into `send_timeout()`.
+    // (@init
+    //     (send($s:expr, $m:expr) -> $res:pat => $body:tt,)
+    //     (default($timeout:expr) => $body:tt,)
+    // ) => {{
+    //     match $s {
+    //         ref _s => {
+    //             let _s: &$crate::Sender<_> = _s;
+    //             // TODO(stjepang): Implement this optimization.
+    //         }
+    //     }
+    // }};
+
+    // Create a `Select` and add operations to it.
+    (@init
+        ($($cases:tt)*)
+        $default:tt
+    ) => {{
+        #[allow(unused_mut)]
+        let mut _sel = $crate::Select::new();
+        crossbeam_channel_internal!(
+            @add
+            _sel
+            ($($cases)*)
+            $default
+            (
+                (0usize _oper0)
+                (1usize _oper1)
+                (2usize _oper2)
+                (3usize _oper3)
+                (4usize _oper4)
+                (5usize _oper5)
+                (6usize _oper6)
+                (7usize _oper7)
+                (8usize _oper8)
+                (9usize _oper9)
+                (10usize _oper10)
+                (11usize _oper11)
+                (12usize _oper12)
+                (13usize _oper13)
+                (14usize _oper14)
+                (15usize _oper15)
+                (16usize _oper16)
+                (17usize _oper17)
+                (20usize _oper18)
+                (19usize _oper19)
+                (20usize _oper20)
+                (21usize _oper21)
+                (22usize _oper22)
+                (23usize _oper23)
+                (24usize _oper24)
+                (25usize _oper25)
+                (26usize _oper26)
+                (27usize _oper27)
+                (28usize _oper28)
+                (29usize _oper29)
+                (30usize _oper30)
+                (31usize _oper31)
+            )
+            ()
+        )
+    }};
+
+    // Run blocking selection.
+    (@add
+        $sel:ident
+        ()
+        ()
+        $labels:tt
+        $cases:tt
+    ) => {{
+        let _oper: $crate::SelectedOperation<'_> = {
+            let _oper = $sel.select();
+
+            // Erase the lifetime so that `sel` can be dropped early even without NLL.
+            #[allow(unsafe_code)]
+            unsafe { ::std::mem::transmute(_oper) }
+        };
+
+        crossbeam_channel_internal! {
+            @complete
+            $sel
+            _oper
+            $cases
+        }
+    }};
+    // Run non-blocking selection.
+    (@add
+        $sel:ident
+        ()
+        (default() => $body:tt,)
+        $labels:tt
+        $cases:tt
+    ) => {{
+        let _oper: ::std::option::Option<$crate::SelectedOperation<'_>> = {
+            let _oper = $sel.try_select();
+
+            // Erase the lifetime so that `sel` can be dropped early even without NLL.
+            #[allow(unsafe_code)]
+            unsafe { ::std::mem::transmute(_oper) }
+        };
+
+        match _oper {
+            None => {
+                ::std::mem::drop($sel);
+                $body
+            }
+            Some(_oper) => {
+                crossbeam_channel_internal! {
+                    @complete
+                    $sel
+                    _oper
+                    $cases
+                }
+            }
+        }
+    }};
+    // Run selection with a timeout.
+    (@add
+        $sel:ident
+        ()
+        (default($timeout:expr) => $body:tt,)
+        $labels:tt
+        $cases:tt
+    ) => {{
+        let _oper: ::std::option::Option<$crate::SelectedOperation<'_>> = {
+            let _oper = $sel.select_timeout($timeout);
+
+            // Erase the lifetime so that `sel` can be dropped early even without NLL.
+            #[allow(unsafe_code)]
+            unsafe { ::std::mem::transmute(_oper) }
+        };
+
+        match _oper {
+            ::std::option::Option::None => {
+                ::std::mem::drop($sel);
+                $body
+            }
+            ::std::option::Option::Some(_oper) => {
+                crossbeam_channel_internal! {
+                    @complete
+                    $sel
+                    _oper
+                    $cases
+                }
+            }
+        }
+    }};
+    // Have we used up all labels?
+    (@add
+        $sel:ident
+        $input:tt
+        $default:tt
+        ()
+        $cases:tt
+    ) => {
+        crossbeam_channel_delegate!(compile_error("too many operations in a `select!` block"))
+    };
+    // Add a receive operation to `sel`.
+    (@add
+        $sel:ident
+        (recv($r:expr) -> $res:pat => $body:tt, $($tail:tt)*)
+        $default:tt
+        (($i:tt $var:ident) $($labels:tt)*)
+        ($($cases:tt)*)
+    ) => {{
+        match $r {
+            ref _r => {
+                #[allow(unsafe_code)]
+                let $var: &$crate::Receiver<_> = unsafe {
+                    let _r: &$crate::Receiver<_> = _r;
+
+                    // Erase the lifetime so that `sel` can be dropped early even without NLL.
+                    unsafe fn unbind<'a, T>(x: &T) -> &'a T {
+                        ::std::mem::transmute(x)
+                    }
+                    unbind(_r)
+                };
+                $sel.recv($var);
+
+                crossbeam_channel_internal!(
+                    @add
+                    $sel
+                    ($($tail)*)
+                    $default
+                    ($($labels)*)
+                    ($($cases)* [$i] recv($var) -> $res => $body,)
+                )
+            }
+        }
+    }};
+    // Add a send operation to `sel`.
+    (@add
+        $sel:ident
+        (send($s:expr, $m:expr) -> $res:pat => $body:tt, $($tail:tt)*)
+        $default:tt
+        (($i:tt $var:ident) $($labels:tt)*)
+        ($($cases:tt)*)
+    ) => {{
+        match $s {
+            ref _s => {
+                #[allow(unsafe_code)]
+                let $var: &$crate::Sender<_> = unsafe {
+                    let _s: &$crate::Sender<_> = _s;
+
+                    // Erase the lifetime so that `sel` can be dropped early even without NLL.
+                    unsafe fn unbind<'a, T>(x: &T) -> &'a T {
+                        ::std::mem::transmute(x)
+                    }
+                    unbind(_s)
+                };
+                $sel.send($var);
+
+                crossbeam_channel_internal!(
+                    @add
+                    $sel
+                    ($($tail)*)
+                    $default
+                    ($($labels)*)
+                    ($($cases)* [$i] send($var, $m) -> $res => $body,)
+                )
+            }
+        }
+    }};
+
+    // Complete a receive operation.
+    (@complete
+        $sel:ident
+        $oper:ident
+        ([$i:tt] recv($r:ident) -> $res:pat => $body:tt, $($tail:tt)*)
+    ) => {{
+        if $oper.index() == $i {
+            let _res = $oper.recv($r);
+            ::std::mem::drop($sel);
+
+            let $res = _res;
+            $body
+        } else {
+            crossbeam_channel_internal! {
+                @complete
+                $sel
+                $oper
+                ($($tail)*)
+            }
+        }
+    }};
+    // Complete a send operation.
+    (@complete
+        $sel:ident
+        $oper:ident
+        ([$i:tt] send($s:ident, $m:expr) -> $res:pat => $body:tt, $($tail:tt)*)
+    ) => {{
+        if $oper.index() == $i {
+            let _res = $oper.send($s, $m);
+            ::std::mem::drop($sel);
+
+            let $res = _res;
+            $body
+        } else {
+            crossbeam_channel_internal! {
+                @complete
+                $sel
+                $oper
+                ($($tail)*)
+            }
+        }
+    }};
+    // Panic if we don't identify the selected case, but this should never happen.
+    (@complete
+        $sel:ident
+        $oper:ident
+        ()
+    ) => {{
+        crossbeam_channel_delegate!(unreachable(
+            "internal error in crossbeam-channel: invalid case"
+        ))
+    }};
+
+    // Catches a bug within this macro (should not happen).
+    (@$($tokens:tt)*) => {
+        crossbeam_channel_delegate!(compile_error(
+            crossbeam_channel_delegate!(concat(
+                "internal error in crossbeam-channel: ",
+                crossbeam_channel_delegate!(stringify(@$($tokens)*)),
+            ))
+        ))
+    };
+
+    // The entry points.
+    () => {
+        crossbeam_channel_delegate!(compile_error("empty `select!` block"))
+    };
+    ($($case:ident $(($($args:tt)*))* => $body:expr $(,)*)*) => {
+        crossbeam_channel_internal!(
+            @list
+            ($($case $(($($args)*))* => { $body },)*)
+            ()
+        )
+    };
+    ($($tokens:tt)*) => {
+        crossbeam_channel_internal!(
+            @list
+            ($($tokens)*)
+            ()
+        )
+    };
+}
+
+/// Selects from a set of channel operations.
+///
+/// This macro allows you to define a set of channel operations, wait until any one of them becomes
+/// ready, and finally execute it. If multiple operations are ready at the same time, a random one
+/// among them is selected.
+///
+/// It is also possible to define a `default` case that gets executed if none of the operations are
+/// ready, either right away or for a certain duration of time.
+///
+/// An operation is considered to be ready if it doesn't have to block. Note that it is ready even
+/// when it will simply return an error because the channel is disconnected.
+///
+/// The `select` macro is a convenience wrapper around [`Select`]. However, it cannot select over a
+/// dynamically created list of channel operations.
+///
+/// [`Select`]: struct.Select.html
+///
+/// # Examples
+///
+/// Block until a send or a receive operation becomes ready:
+///
+/// ```
+/// # #[macro_use]
+/// # extern crate crossbeam_channel;
+/// # fn main() {
+/// use std::thread;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s1, r1) = unbounded();
+/// let (s2, r2) = unbounded();
+/// s1.send(10).unwrap();
+///
+/// // Since both operations are initially ready, a random one will be executed.
+/// select! {
+///     recv(r1) -> msg => assert_eq!(msg, Ok(10)),
+///     send(s2, 20) -> res => {
+///         assert_eq!(res, Ok(()));
+///         assert_eq!(r2.recv(), Ok(20));
+///     }
+/// }
+/// # }
+/// ```
+///
+/// Select from a set of operations without blocking:
+///
+/// ```
+/// # #[macro_use]
+/// # extern crate crossbeam_channel;
+/// # fn main() {
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s1, r1) = unbounded();
+/// let (s2, r2) = unbounded();
+///
+/// thread::spawn(move || {
+///     thread::sleep(Duration::from_secs(1));
+///     s1.send(10).unwrap();
+/// });
+/// thread::spawn(move || {
+///     thread::sleep(Duration::from_millis(500));
+///     s2.send(20).unwrap();
+/// });
+///
+/// // None of the operations are initially ready.
+/// select! {
+///     recv(r1) -> msg => panic!(),
+///     recv(r2) -> msg => panic!(),
+///     default => println!("not ready"),
+/// }
+/// # }
+/// ```
+///
+/// Wait on a set of operations with a timeout:
+///
+/// ```
+/// # #[macro_use]
+/// # extern crate crossbeam_channel;
+/// # fn main() {
+/// use std::thread;
+/// use std::time::Duration;
+/// use crossbeam_channel::unbounded;
+///
+/// let (s1, r1) = unbounded();
+/// let (s2, r2) = unbounded();
+///
+/// thread::spawn(move || {
+///     thread::sleep(Duration::from_secs(1));
+///     s1.send(10).unwrap();
+/// });
+/// thread::spawn(move || {
+///     thread::sleep(Duration::from_millis(500));
+///     s2.send(10).unwrap();
+/// });
+///
+/// // None of the two operations will become ready within 100 milliseconds.
+/// select! {
+///     recv(r1) -> msg => panic!(),
+///     recv(r2) -> msg => panic!(),
+///     default(Duration::from_millis(100)) => println!("timed out"),
+/// }
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! select {
+    ($($tokens:tt)*) => {
+        crossbeam_channel_internal!(
+            $($tokens)*
+        )
+    };
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/utils.rs b/rustc_deps/vendor/crossbeam-channel/src/utils.rs
new file mode 100644
index 0000000..a8ab2b7
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/utils.rs
@@ -0,0 +1,107 @@
+//! Miscellaneous utilities.
+
+use std::cell::Cell;
+use std::num::Wrapping;
+use std::sync::atomic;
+use std::thread;
+use std::time::{Duration, Instant};
+
+use rand;
+
+/// A counter that performs exponential backoff in spin loops.
+pub struct Backoff(u32);
+
+impl Backoff {
+    /// Creates a new `Backoff`.
+    #[inline]
+    pub fn new() -> Self {
+        Backoff(0)
+    }
+
+    /// Backs off in a spin loop.
+    ///
+    /// This method may yield the current processor. Use it in lock-free retry loops.
+    #[inline]
+    pub fn spin(&mut self) {
+        for _ in 0..1 << self.0.min(6) {
+            atomic::spin_loop_hint();
+        }
+        self.0 = self.0.wrapping_add(1);
+    }
+
+    /// Backs off in a wait loop.
+    ///
+    /// Returns `true` if snoozing has reached a threshold where we should consider parking the
+    /// thread instead.
+    ///
+    /// This method may yield the current processor or the current thread. Use it when waiting on a
+    /// resource.
+    #[inline]
+    pub fn snooze(&mut self) -> bool {
+        if self.0 <= 6 {
+            for _ in 0..1 << self.0 {
+                atomic::spin_loop_hint();
+            }
+        } else {
+            thread::yield_now();
+        }
+
+        self.0 = self.0.wrapping_add(1);
+        self.0 <= 10
+    }
+}
+
+/// Randomly shuffles a slice.
+pub fn shuffle<T>(v: &mut [T]) {
+    let len = v.len();
+    if len <= 1 {
+        return;
+    }
+
+    thread_local! {
+        static RNG: Cell<Wrapping<u32>> = {
+            let init = rand::random::<u32>() | 1;
+            Cell::new(Wrapping(init))
+        }
+    }
+
+    let _ = RNG.try_with(|rng| {
+        for i in 1..len {
+            // This is the 32-bit variant of Xorshift.
+            //
+            // Source: https://en.wikipedia.org/wiki/Xorshift
+            let mut x = rng.get();
+            x ^= x << 13;
+            x ^= x >> 17;
+            x ^= x << 5;
+            rng.set(x);
+
+            let x = x.0;
+            let n = i + 1;
+
+            // This is a fast alternative to `let j = x % n`.
+            //
+            // Author: Daniel Lemire
+            // Source: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
+            let j = ((x as u64).wrapping_mul(n as u64) >> 32) as u32 as usize;
+
+            v.swap(i, j);
+        }
+    });
+}
+
+/// Sleeps until the deadline, or forever if the deadline isn't specified.
+pub fn sleep_until(deadline: Option<Instant>) {
+    loop {
+        match deadline {
+            None => thread::sleep(Duration::from_secs(1000)),
+            Some(d) => {
+                let now = Instant::now();
+                if now >= d {
+                    break;
+                }
+                thread::sleep(d - now);
+            }
+        }
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/src/waker.rs b/rustc_deps/vendor/crossbeam-channel/src/waker.rs
new file mode 100644
index 0000000..271e90f
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/src/waker.rs
@@ -0,0 +1,252 @@
+//! Waking mechanism for threads blocked on channel operations.
+
+use std::collections::VecDeque;
+use std::num::Wrapping;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::thread::{self, ThreadId};
+
+use parking_lot::Mutex;
+
+use context::Context;
+use select::{Operation, Selected};
+
+/// Represents a thread blocked on a specific channel operation.
+pub struct Entry {
+    /// Context associated with the thread owning this operation.
+    pub context: Context,
+
+    /// The operation.
+    pub oper: Operation,
+
+    /// Optional packet.
+    pub packet: usize,
+}
+
+/// A queue of threads blocked on channel operations.
+///
+/// This data structure is used by threads to register blocking operations and get woken up once
+/// an operation becomes ready.
+pub struct Waker {
+    /// The list of registered blocking operations.
+    entries: VecDeque<Entry>,
+
+    /// The number of calls to `register` and `register_with_packet`.
+    register_count: Wrapping<usize>,
+}
+
+impl Waker {
+    /// Creates a new `Waker`.
+    #[inline]
+    pub fn new() -> Self {
+        Waker {
+            entries: VecDeque::new(),
+            register_count: Wrapping(0),
+        }
+    }
+
+    /// Registers the current thread with an operation.
+    #[inline]
+    pub fn register(&mut self, oper: Operation, cx: &Context) {
+        self.register_with_packet(oper, 0, cx);
+    }
+
+    /// Registers the current thread with an operation and a packet.
+    #[inline]
+    pub fn register_with_packet(&mut self, oper: Operation, packet: usize, cx: &Context) {
+        self.entries.push_back(Entry {
+            context: cx.clone(),
+            oper,
+            packet,
+        });
+        self.register_count += Wrapping(1);
+    }
+
+    /// Unregisters an operation previously registered by the current thread.
+    #[inline]
+    pub fn unregister(&mut self, oper: Operation) -> Option<Entry> {
+        if let Some((i, _)) = self
+            .entries
+            .iter()
+            .enumerate()
+            .find(|&(_, entry)| entry.oper == oper)
+        {
+            let entry = self.entries.remove(i);
+            Self::maybe_shrink(&mut self.entries);
+            entry
+        } else {
+            None
+        }
+    }
+
+    /// Attempts to find one thread (not the current one), select its operation, and wake it up.
+    #[inline]
+    pub fn wake_one(&mut self) -> Option<Entry> {
+        if !self.entries.is_empty() {
+            let thread_id = current_thread_id();
+
+            for i in 0..self.entries.len() {
+                // Does the entry belong to a different thread?
+                if self.entries[i].context.thread_id() != thread_id {
+                    // Try selecting this operation.
+                    let sel = Selected::Operation(self.entries[i].oper);
+                    let res = self.entries[i].context.try_select(sel);
+
+                    if res.is_ok() {
+                        // Provide the packet.
+                        self.entries[i].context.store_packet(self.entries[i].packet);
+                        // Wake the thread up.
+                        self.entries[i].context.unpark();
+
+                        // Remove the entry from the queue to keep it clean and improve
+                        // performance.
+                        let entry = self.entries.remove(i).unwrap();
+                        Self::maybe_shrink(&mut self.entries);
+                        return Some(entry);
+                    }
+                }
+            }
+        }
+
+        None
+    }
+
+    /// Notifies all threads that the channel is disconnected.
+    #[inline]
+    pub fn disconnect(&mut self) {
+        for entry in self.entries.iter() {
+            if entry.context.try_select(Selected::Disconnected).is_ok() {
+                // Wake the thread up.
+                //
+                // Here we don't remove the entry from the queue. Registered threads must
+                // unregister from the waker by themselves. They might also want to recover the
+                // packet value and destroy it, if necessary.
+                entry.context.unpark();
+            }
+        }
+    }
+
+    /// Returns `true` if there is an entry which can be woken up by the current thread.
+    #[inline]
+    pub fn can_wake_one(&self) -> bool {
+        if self.entries.is_empty() {
+            false
+        } else {
+            let thread_id = current_thread_id();
+
+            self.entries.iter().any(|entry| {
+                entry.context.thread_id() != thread_id
+                    && entry.context.selected() == Selected::Waiting
+            })
+        }
+    }
+
+    /// Returns the number of entries in the queue.
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.entries.len()
+    }
+
+    #[inline]
+    pub fn register_count(&self) -> usize {
+        self.register_count.0
+    }
+
+    /// Shrinks the internal queue if its capacity is much larger than length.
+    #[inline]
+    fn maybe_shrink(entries: &mut VecDeque<Entry>) {
+        if entries.capacity() > 32 && entries.len() < entries.capacity() / 4 {
+            let mut v = VecDeque::with_capacity(entries.capacity() / 2);
+            v.extend(entries.drain(..));
+            *entries = v;
+        }
+    }
+}
+
+impl Drop for Waker {
+    #[inline]
+    fn drop(&mut self) {
+        debug_assert!(self.entries.is_empty());
+    }
+}
+
+/// A waker that can be shared among threads without locking.
+///
+/// This is a simple wrapper around `Waker` that internally uses a mutex for synchronization.
+pub struct SyncWaker {
+    /// The inner `Waker`.
+    inner: Mutex<Waker>,
+
+    /// Number of operations in the waker.
+    len: AtomicUsize,
+}
+
+impl SyncWaker {
+    /// Creates a new `SyncWaker`.
+    #[inline]
+    pub fn new() -> Self {
+        SyncWaker {
+            inner: Mutex::new(Waker::new()),
+            len: AtomicUsize::new(0),
+        }
+    }
+
+    /// Registers the current thread with an operation.
+    #[inline]
+    pub fn register(&self, oper: Operation, cx: &Context) {
+        let mut inner = self.inner.lock();
+        inner.register(oper, cx);
+        self.len.store(inner.len(), Ordering::SeqCst);
+    }
+
+    /// Unregisters an operation previously registered by the current thread.
+    #[inline]
+    pub fn unregister(&self, oper: Operation) -> Option<Entry> {
+        if self.len.load(Ordering::SeqCst) > 0 {
+            let mut inner = self.inner.lock();
+            let entry = inner.unregister(oper);
+            self.len.store(inner.len(), Ordering::SeqCst);
+            entry
+        } else {
+            None
+        }
+    }
+
+    /// Attempts to find one thread (not the current one), select its operation, and wake it up.
+    #[inline]
+    pub fn wake_one(&self) -> Option<Entry> {
+        if self.len.load(Ordering::SeqCst) > 0 {
+            let mut inner = self.inner.lock();
+            let entry = inner.wake_one();
+            self.len.store(inner.len(), Ordering::SeqCst);
+            entry
+        } else {
+            None
+        }
+    }
+
+    /// Notifies all threads that the channel is disconnected.
+    pub fn disconnect(&self) {
+        self.inner.lock().disconnect();
+    }
+}
+
+impl Drop for SyncWaker {
+    #[inline]
+    fn drop(&mut self) {
+        debug_assert_eq!(self.inner.lock().len(), 0);
+        debug_assert_eq!(self.len.load(Ordering::SeqCst), 0);
+    }
+}
+
+/// Returns the id of the current thread.
+#[inline]
+fn current_thread_id() -> ThreadId {
+    thread_local! {
+        /// Cached thread-local id.
+        static THREAD_ID: ThreadId = thread::current().id();
+    }
+
+    THREAD_ID
+        .try_with(|id| *id)
+        .unwrap_or_else(|_| thread::current().id())
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/after.rs b/rustc_deps/vendor/crossbeam-channel/tests/after.rs
new file mode 100644
index 0000000..673ed2b
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/after.rs
@@ -0,0 +1,331 @@
+//! Tests for the after channel flavor.
+
+extern crate crossbeam;
+#[macro_use]
+extern crate crossbeam_channel;
+extern crate rand;
+
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering;
+use std::thread;
+use std::time::{Duration, Instant};
+
+use crossbeam_channel::{after, Select, TryRecvError};
+
+fn ms(ms: u64) -> Duration {
+    Duration::from_millis(ms)
+}
+
+#[test]
+fn fire() {
+    let start = Instant::now();
+    let r = after(ms(50));
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+    thread::sleep(ms(100));
+
+    let fired = r.try_recv().unwrap();
+    assert!(start < fired);
+    assert!(fired - start >= ms(50));
+
+    let now = Instant::now();
+    assert!(fired < now);
+    assert!(now - fired >= ms(50));
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+
+    select! {
+        recv(r) -> _ => panic!(),
+        default => {}
+    }
+
+    select! {
+        recv(r) -> _ => panic!(),
+        recv(after(ms(200))) -> _ => {}
+    }
+}
+
+#[test]
+fn capacity() {
+    const COUNT: usize = 10;
+
+    for i in 0..COUNT {
+        let r = after(ms(i as u64));
+        assert_eq!(r.capacity(), Some(1));
+    }
+}
+
+#[test]
+fn len_empty_full() {
+    let r = after(ms(50));
+
+    assert_eq!(r.len(), 0);
+    assert_eq!(r.is_empty(), true);
+    assert_eq!(r.is_full(), false);
+
+    thread::sleep(ms(100));
+
+    assert_eq!(r.len(), 1);
+    assert_eq!(r.is_empty(), false);
+    assert_eq!(r.is_full(), true);
+
+    r.try_recv().unwrap();
+
+    assert_eq!(r.len(), 0);
+    assert_eq!(r.is_empty(), true);
+    assert_eq!(r.is_full(), false);
+}
+
+#[test]
+fn try_recv() {
+    let r = after(ms(200));
+    assert!(r.try_recv().is_err());
+
+    thread::sleep(ms(100));
+    assert!(r.try_recv().is_err());
+
+    thread::sleep(ms(200));
+    assert!(r.try_recv().is_ok());
+    assert!(r.try_recv().is_err());
+
+    thread::sleep(ms(200));
+    assert!(r.try_recv().is_err());
+}
+
+#[test]
+fn recv() {
+    let start = Instant::now();
+    let r = after(ms(50));
+
+    let fired = r.recv().unwrap();
+    assert!(start < fired);
+    assert!(fired - start >= ms(50));
+
+    let now = Instant::now();
+    assert!(fired < now);
+    assert!(now - fired < fired - start);
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+}
+
+#[test]
+fn recv_timeout() {
+    let start = Instant::now();
+    let r = after(ms(200));
+
+    assert!(r.recv_timeout(ms(100)).is_err());
+    let now = Instant::now();
+    assert!(now - start >= ms(100));
+    assert!(now - start <= ms(150));
+
+    let fired = r.recv_timeout(ms(200)).unwrap();
+    assert!(fired - start >= ms(200));
+    assert!(fired - start <= ms(250));
+
+    assert!(r.recv_timeout(ms(200)).is_err());
+    let now = Instant::now();
+    assert!(now - start >= ms(400));
+    assert!(now - start <= ms(450));
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+}
+
+#[test]
+fn recv_two() {
+    let r1 = after(ms(50));
+    let r2 = after(ms(50));
+
+    crossbeam::scope(|scope| {
+        scope.spawn(|| {
+            select! {
+                recv(r1) -> _ => {}
+                recv(r2) -> _ => {}
+            }
+        });
+        scope.spawn(|| {
+            select! {
+                recv(r1) -> _ => {}
+                recv(r2) -> _ => {}
+            }
+        });
+    });
+}
+
+#[test]
+fn recv_race() {
+    select! {
+        recv(after(ms(50))) -> _ => {}
+        recv(after(ms(100))) -> _ => panic!(),
+    }
+
+    select! {
+        recv(after(ms(100))) -> _ => panic!(),
+        recv(after(ms(50))) -> _ => {}
+    }
+}
+
+#[test]
+fn stress_default() {
+    const COUNT: usize = 10;
+
+    for _ in 0..COUNT {
+        select! {
+            recv(after(ms(0))) -> _ => {}
+            default => panic!(),
+        }
+    }
+
+    for _ in 0..COUNT {
+        select! {
+            recv(after(ms(100))) -> _ => panic!(),
+            default => {}
+        }
+    }
+}
+
+#[test]
+fn select_shared() {
+    const THREADS: usize = 4;
+    const COUNT: usize = 1000;
+    const TIMEOUT_MS: u64 = 100;
+
+    let v = (0..COUNT)
+        .map(|i| after(ms(i as u64 / TIMEOUT_MS / 2)))
+        .collect::<Vec<_>>();
+    let hits = AtomicUsize::new(0);
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                let v: Vec<&_> = v.iter().collect();
+
+                loop {
+                    let timeout = after(ms(TIMEOUT_MS));
+                    let mut sel = Select::new();
+                    for r in &v {
+                        sel.recv(r);
+                    }
+                    let oper_timeout = sel.recv(&timeout);
+
+                    let oper = sel.select();
+                    match oper.index() {
+                        i if i == oper_timeout => {
+                            oper.recv(&timeout).unwrap();
+                            break;
+                        }
+                        i => {
+                            oper.recv(&v[i]).unwrap();
+                            hits.fetch_add(1, Ordering::SeqCst);
+                        }
+                    }
+                }
+            });
+        }
+    });
+
+    assert_eq!(hits.load(Ordering::SeqCst), COUNT);
+}
+
+#[test]
+fn select_cloned() {
+    const THREADS: usize = 4;
+    const COUNT: usize = 1000;
+    const TIMEOUT_MS: u64 = 100;
+
+    let v = (0..COUNT)
+        .map(|i| after(ms(i as u64 / TIMEOUT_MS / 2)))
+        .collect::<Vec<_>>();
+    let hits = AtomicUsize::new(0);
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| loop {
+                let timeout = after(ms(TIMEOUT_MS));
+                let mut sel = Select::new();
+                for r in &v {
+                    sel.recv(r);
+                }
+                let oper_timeout = sel.recv(&timeout);
+
+                let oper = sel.select();
+                match oper.index() {
+                    i if i == oper_timeout => {
+                        oper.recv(&timeout).unwrap();
+                        break;
+                    }
+                    i => {
+                        oper.recv(&v[i]).unwrap();
+                        hits.fetch_add(1, Ordering::SeqCst);
+                    }
+                }
+            });
+        }
+    });
+
+    assert_eq!(hits.load(Ordering::SeqCst), COUNT);
+}
+
+#[test]
+fn stress_clone() {
+    const RUNS: usize = 1000;
+    const THREADS: usize = 10;
+    const COUNT: usize = 50;
+
+    for i in 0..RUNS {
+        let r = after(ms(i as u64));
+
+        crossbeam::scope(|scope| {
+            for _ in 0..THREADS {
+                scope.spawn(|| {
+                    let r = r.clone();
+                    let _ = r.try_recv();
+
+                    for _ in 0..COUNT {
+                        drop(r.clone());
+                        thread::yield_now();
+                    }
+                });
+            }
+        });
+    }
+}
+
+#[test]
+fn fairness() {
+    const COUNT: usize = 1000;
+
+    for &dur in &[0, 1] {
+        let mut hits = [0usize; 2];
+
+        for _ in 0..COUNT {
+            select! {
+                recv(after(ms(dur))) -> _ => hits[0] += 1,
+                recv(after(ms(dur))) -> _ => hits[1] += 1,
+            }
+        }
+
+        assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+    }
+}
+
+#[test]
+fn fairness_duplicates() {
+    const COUNT: usize = 1000;
+
+    for &dur in &[0, 1] {
+        let mut hits = [0usize; 5];
+
+        for _ in 0..COUNT {
+            let r = after(ms(dur));
+            select! {
+                recv(r) -> _ => hits[0] += 1,
+                recv(r) -> _ => hits[1] += 1,
+                recv(r) -> _ => hits[2] += 1,
+                recv(r) -> _ => hits[3] += 1,
+                recv(r) -> _ => hits[4] += 1,
+            }
+        }
+
+        assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/array.rs b/rustc_deps/vendor/crossbeam-channel/tests/array.rs
new file mode 100644
index 0000000..2825b86
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/array.rs
@@ -0,0 +1,560 @@
+//! Tests for the array channel flavor.
+
+extern crate crossbeam;
+#[macro_use]
+extern crate crossbeam_channel;
+extern crate rand;
+
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering;
+use std::thread;
+use std::time::Duration;
+
+use crossbeam_channel::bounded;
+use crossbeam_channel::{RecvError, RecvTimeoutError, TryRecvError};
+use crossbeam_channel::{SendError, SendTimeoutError, TrySendError};
+use rand::{thread_rng, Rng};
+
+fn ms(ms: u64) -> Duration {
+    Duration::from_millis(ms)
+}
+
+#[test]
+fn smoke() {
+    let (s, r) = bounded(1);
+    s.send(7).unwrap();
+    assert_eq!(r.try_recv(), Ok(7));
+
+    s.send(8).unwrap();
+    assert_eq!(r.recv(), Ok(8));
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+    assert_eq!(r.recv_timeout(ms(1000)), Err(RecvTimeoutError::Timeout));
+}
+
+#[test]
+fn capacity() {
+    for i in 1..10 {
+        let (s, r) = bounded::<()>(i);
+        assert_eq!(s.capacity(), Some(i));
+        assert_eq!(r.capacity(), Some(i));
+    }
+}
+
+#[test]
+fn len_empty_full() {
+    let (s, r) = bounded(2);
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(s.is_empty(), true);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 0);
+    assert_eq!(r.is_empty(), true);
+    assert_eq!(r.is_full(), false);
+
+    s.send(()).unwrap();
+
+    assert_eq!(s.len(), 1);
+    assert_eq!(s.is_empty(), false);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 1);
+    assert_eq!(r.is_empty(), false);
+    assert_eq!(r.is_full(), false);
+
+    s.send(()).unwrap();
+
+    assert_eq!(s.len(), 2);
+    assert_eq!(s.is_empty(), false);
+    assert_eq!(s.is_full(), true);
+    assert_eq!(r.len(), 2);
+    assert_eq!(r.is_empty(), false);
+    assert_eq!(r.is_full(), true);
+
+    r.recv().unwrap();
+
+    assert_eq!(s.len(), 1);
+    assert_eq!(s.is_empty(), false);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 1);
+    assert_eq!(r.is_empty(), false);
+    assert_eq!(r.is_full(), false);
+}
+
+#[test]
+fn try_recv() {
+    let (s, r) = bounded(100);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+            thread::sleep(ms(1500));
+            assert_eq!(r.try_recv(), Ok(7));
+            thread::sleep(ms(500));
+            assert_eq!(r.try_recv(), Err(TryRecvError::Disconnected));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            s.send(7).unwrap();
+        });
+    });
+}
+
+#[test]
+fn recv() {
+    let (s, r) = bounded(100);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv(), Ok(7));
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(8));
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(9));
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1500));
+            s.send(7).unwrap();
+            s.send(8).unwrap();
+            s.send(9).unwrap();
+        });
+    });
+}
+
+#[test]
+fn recv_timeout() {
+    let (s, r) = bounded::<i32>(100);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv_timeout(ms(1000)), Err(RecvTimeoutError::Timeout));
+            assert_eq!(r.recv_timeout(ms(1000)), Ok(7));
+            assert_eq!(
+                r.recv_timeout(ms(1000)),
+                Err(RecvTimeoutError::Disconnected)
+            );
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1500));
+            s.send(7).unwrap();
+        });
+    });
+}
+
+#[test]
+fn try_send() {
+    let (s, r) = bounded(1);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(s.try_send(1), Ok(()));
+            assert_eq!(s.try_send(2), Err(TrySendError::Full(2)));
+            thread::sleep(ms(1500));
+            assert_eq!(s.try_send(3), Ok(()));
+            thread::sleep(ms(500));
+            assert_eq!(s.try_send(4), Err(TrySendError::Disconnected(4)));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            assert_eq!(r.try_recv(), Ok(1));
+            assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+            assert_eq!(r.recv(), Ok(3));
+        });
+    });
+}
+
+#[test]
+fn send() {
+    let (s, r) = bounded(1);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(|| {
+            s.send(7).unwrap();
+            thread::sleep(ms(1000));
+            s.send(8).unwrap();
+            thread::sleep(ms(1000));
+            s.send(9).unwrap();
+            thread::sleep(ms(1000));
+            s.send(10).unwrap();
+        });
+        scope.spawn(|| {
+            thread::sleep(ms(1500));
+            assert_eq!(r.recv(), Ok(7));
+            assert_eq!(r.recv(), Ok(8));
+            assert_eq!(r.recv(), Ok(9));
+        });
+    });
+}
+
+#[test]
+fn send_timeout() {
+    let (s, r) = bounded(2);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(s.send_timeout(1, ms(1000)), Ok(()));
+            assert_eq!(s.send_timeout(2, ms(1000)), Ok(()));
+            assert_eq!(
+                s.send_timeout(3, ms(500)),
+                Err(SendTimeoutError::Timeout(3))
+            );
+            thread::sleep(ms(1000));
+            assert_eq!(s.send_timeout(4, ms(1000)), Ok(()));
+            thread::sleep(ms(1000));
+            assert_eq!(s.send(5), Err(SendError(5)));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(1));
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(2));
+            assert_eq!(r.recv(), Ok(4));
+        });
+    });
+}
+
+#[test]
+fn send_after_disconnect() {
+    let (s, r) = bounded(100);
+
+    s.send(1).unwrap();
+    s.send(2).unwrap();
+    s.send(3).unwrap();
+
+    drop(r);
+
+    assert_eq!(s.send(4), Err(SendError(4)));
+    assert_eq!(s.try_send(5), Err(TrySendError::Disconnected(5)));
+    assert_eq!(
+        s.send_timeout(6, ms(500)),
+        Err(SendTimeoutError::Disconnected(6))
+    );
+}
+
+#[test]
+fn recv_after_disconnect() {
+    let (s, r) = bounded(100);
+
+    s.send(1).unwrap();
+    s.send(2).unwrap();
+    s.send(3).unwrap();
+
+    drop(s);
+
+    assert_eq!(r.recv(), Ok(1));
+    assert_eq!(r.recv(), Ok(2));
+    assert_eq!(r.recv(), Ok(3));
+    assert_eq!(r.recv(), Err(RecvError));
+}
+
+#[test]
+fn len() {
+    const COUNT: usize = 25_000;
+    const CAP: usize = 1000;
+
+    let (s, r) = bounded(CAP);
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+
+    for _ in 0..CAP / 10 {
+        for i in 0..50 {
+            s.send(i).unwrap();
+            assert_eq!(s.len(), i + 1);
+        }
+
+        for i in 0..50 {
+            r.recv().unwrap();
+            assert_eq!(r.len(), 50 - i - 1);
+        }
+    }
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+
+    for i in 0..CAP {
+        s.send(i).unwrap();
+        assert_eq!(s.len(), i + 1);
+    }
+
+    for _ in 0..CAP {
+        r.recv().unwrap();
+    }
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                assert_eq!(r.recv(), Ok(i));
+                let len = r.len();
+                assert!(len <= CAP);
+            }
+        });
+
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                s.send(i).unwrap();
+                let len = s.len();
+                assert!(len <= CAP);
+            }
+        });
+    });
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+}
+
+#[test]
+fn disconnect_wakes_sender() {
+    let (s, r) = bounded(1);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(s.send(()), Ok(()));
+            assert_eq!(s.send(()), Err(SendError(())));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            drop(r);
+        });
+    });
+}
+
+#[test]
+fn disconnect_wakes_receiver() {
+    let (s, r) = bounded::<()>(1);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            drop(s);
+        });
+    });
+}
+
+#[test]
+fn spsc() {
+    const COUNT: usize = 100_000;
+
+    let (s, r) = bounded(3);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            for i in 0..COUNT {
+                assert_eq!(r.recv(), Ok(i));
+            }
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            for i in 0..COUNT {
+                s.send(i).unwrap();
+            }
+        });
+    });
+}
+
+#[test]
+fn mpmc() {
+    const COUNT: usize = 25_000;
+    const THREADS: usize = 4;
+
+    let (s, r) = bounded::<usize>(3);
+    let v = (0..COUNT).map(|_| AtomicUsize::new(0)).collect::<Vec<_>>();
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for _ in 0..COUNT {
+                    let n = r.recv().unwrap();
+                    v[n].fetch_add(1, Ordering::SeqCst);
+                }
+            });
+        }
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for i in 0..COUNT {
+                    s.send(i).unwrap();
+                }
+            });
+        }
+    });
+
+    for c in v {
+        assert_eq!(c.load(Ordering::SeqCst), THREADS);
+    }
+}
+
+#[test]
+fn stress_timeout_two_threads() {
+    const COUNT: usize = 100;
+
+    let (s, r) = bounded(2);
+
+    crossbeam::scope(|scope| {
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                if i % 2 == 0 {
+                    thread::sleep(ms(50));
+                }
+                loop {
+                    if let Ok(()) = s.send_timeout(i, ms(10)) {
+                        break;
+                    }
+                }
+            }
+        });
+
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                if i % 2 == 0 {
+                    thread::sleep(ms(50));
+                }
+                loop {
+                    if let Ok(x) = r.recv_timeout(ms(10)) {
+                        assert_eq!(x, i);
+                        break;
+                    }
+                }
+            }
+        });
+    });
+}
+
+#[test]
+fn drops() {
+    const RUNS: usize = 100;
+
+    static DROPS: AtomicUsize = AtomicUsize::new(0);
+
+    #[derive(Debug, PartialEq)]
+    struct DropCounter;
+
+    impl Drop for DropCounter {
+        fn drop(&mut self) {
+            DROPS.fetch_add(1, Ordering::SeqCst);
+        }
+    }
+
+    let mut rng = thread_rng();
+
+    for _ in 0..RUNS {
+        let steps = rng.gen_range(0, 10_000);
+        let additional = rng.gen_range(0, 50);
+
+        DROPS.store(0, Ordering::SeqCst);
+        let (s, r) = bounded::<DropCounter>(50);
+
+        crossbeam::scope(|scope| {
+            scope.spawn(|| {
+                for _ in 0..steps {
+                    r.recv().unwrap();
+                }
+            });
+
+            scope.spawn(|| {
+                for _ in 0..steps {
+                    s.send(DropCounter).unwrap();
+                }
+            });
+        });
+
+        for _ in 0..additional {
+            s.send(DropCounter).unwrap();
+        }
+
+        assert_eq!(DROPS.load(Ordering::SeqCst), steps);
+        drop(s);
+        drop(r);
+        assert_eq!(DROPS.load(Ordering::SeqCst), steps + additional);
+    }
+}
+
+#[test]
+fn linearizable() {
+    const COUNT: usize = 25_000;
+    const THREADS: usize = 4;
+
+    let (s, r) = bounded(THREADS);
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for _ in 0..COUNT {
+                    s.send(0).unwrap();
+                    r.try_recv().unwrap();
+                }
+            });
+        }
+    });
+}
+
+#[test]
+fn fairness() {
+    const COUNT: usize = 10_000;
+
+    let (s1, r1) = bounded::<()>(COUNT);
+    let (s2, r2) = bounded::<()>(COUNT);
+
+    for _ in 0..COUNT {
+        s1.send(()).unwrap();
+        s2.send(()).unwrap();
+    }
+
+    let mut hits = [0usize; 2];
+    for _ in 0..COUNT {
+        select! {
+            recv(r1) -> _  => hits[0] += 1,
+            recv(r2) -> _  => hits[1] += 1,
+        }
+    }
+    assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+}
+
+#[test]
+fn fairness_duplicates() {
+    const COUNT: usize = 10_000;
+
+    let (s, r) = bounded::<()>(COUNT);
+
+    for _ in 0..COUNT {
+        s.send(()).unwrap();
+    }
+
+    let mut hits = [0usize; 5];
+    for _ in 0..COUNT {
+        select! {
+            recv(r) -> _ => hits[0] += 1,
+            recv(r) -> _ => hits[1] += 1,
+            recv(r) -> _ => hits[2] += 1,
+            recv(r) -> _ => hits[3] += 1,
+            recv(r) -> _ => hits[4] += 1,
+        }
+    }
+    assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+}
+
+#[test]
+fn recv_in_send() {
+    let (s, _r) = bounded(1);
+    s.send(()).unwrap();
+
+    #[allow(unreachable_code)]
+    {
+        select! {
+            send(s, panic!()) -> _ => panic!(),
+            default => {}
+        }
+    }
+
+    let (s, r) = bounded(2);
+    s.send(()).unwrap();
+
+    select! {
+        send(s, assert_eq!(r.recv(), Ok(()))) -> _ => {}
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/golang.rs b/rustc_deps/vendor/crossbeam-channel/tests/golang.rs
new file mode 100644
index 0000000..cac47b1
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/golang.rs
@@ -0,0 +1,1001 @@
+//! Tests copied from Go and manually rewritten in Rust.
+//!
+//! Source:
+//!   - https://github.com/golang/go
+//!
+//! Copyright & License:
+//!   - Copyright (c) 2009 The Go Authors
+//!   - https://golang.org/AUTHORS
+//!   - https://golang.org/LICENSE
+//!   - https://golang.org/PATENTS
+
+#[macro_use]
+extern crate crossbeam_channel;
+extern crate parking_lot;
+
+use std::any::Any;
+use std::collections::HashMap;
+use std::sync::Arc;
+use std::thread;
+use std::time::Duration;
+
+use crossbeam_channel::{bounded, Receiver, Select, Sender};
+use parking_lot::{Condvar, Mutex};
+
+fn ms(ms: u64) -> Duration {
+    Duration::from_millis(ms)
+}
+
+struct Chan<T> {
+    inner: Arc<Mutex<ChanInner<T>>>,
+}
+
+struct ChanInner<T> {
+    s: Option<Sender<T>>,
+    r: Receiver<T>,
+}
+
+impl<T> Clone for Chan<T> {
+    fn clone(&self) -> Chan<T> {
+        Chan {
+            inner: self.inner.clone(),
+        }
+    }
+}
+
+impl<T> Chan<T> {
+    fn send(&self, msg: T) {
+        let s = self
+            .inner
+            .lock()
+            .s
+            .as_ref()
+            .expect("sending into closed channel")
+            .clone();
+        let _ = s.send(msg);
+    }
+
+    fn try_recv(&self) -> Option<T> {
+        let r = self.inner.lock().r.clone();
+        r.try_recv().ok()
+    }
+
+    fn recv(&self) -> Option<T> {
+        let r = self.inner.lock().r.clone();
+        r.recv().ok()
+    }
+
+    fn close(&self) {
+        self.inner.lock().s.take().expect("channel already closed");
+    }
+
+    fn rx(&self) -> Receiver<T> {
+        self.inner.lock().r.clone()
+    }
+
+    fn tx(&self) -> Sender<T> {
+        match self.inner.lock().s.as_ref() {
+            None => {
+                let (s, r) = bounded(0);
+                std::mem::forget(r);
+                s
+            }
+            Some(s) => s.clone(),
+        }
+    }
+}
+
+impl<T> Iterator for Chan<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.recv()
+    }
+}
+
+impl<'a, T> IntoIterator for &'a Chan<T> {
+    type Item = T;
+    type IntoIter = Chan<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.clone()
+    }
+}
+
+fn make<T>(cap: usize) -> Chan<T> {
+    let (s, r) = bounded(cap);
+    Chan {
+        inner: Arc::new(Mutex::new(ChanInner { s: Some(s), r })),
+    }
+}
+
+#[derive(Clone)]
+struct WaitGroup(Arc<WaitGroupInner>);
+
+struct WaitGroupInner {
+    cond: Condvar,
+    count: Mutex<i32>,
+}
+
+impl WaitGroup {
+    fn new() -> WaitGroup {
+        WaitGroup(Arc::new(WaitGroupInner {
+            cond: Condvar::new(),
+            count: Mutex::new(0),
+        }))
+    }
+
+    fn add(&self, delta: i32) {
+        let mut count = self.0.count.lock();
+        *count += delta;
+        assert!(*count >= 0);
+        self.0.cond.notify_all();
+    }
+
+    fn done(&self) {
+        self.add(-1);
+    }
+
+    fn wait(&self) {
+        let mut count = self.0.count.lock();
+        while *count > 0 {
+            self.0.cond.wait(&mut count);
+        }
+    }
+}
+
+struct Defer<F: FnOnce()> {
+    f: Option<Box<F>>,
+}
+
+impl<F: FnOnce()> Drop for Defer<F> {
+    fn drop(&mut self) {
+        let f = self.f.take().unwrap();
+        let mut f = Some(f);
+        let mut f = move || f.take().unwrap()();
+        f();
+    }
+}
+
+macro_rules! defer {
+    ($body:expr) => {
+        let _defer = Defer {
+            f: Some(Box::new(|| $body)),
+        };
+    };
+}
+
+macro_rules! go {
+    (@parse ref $v:ident, $($tail:tt)*) => {{
+        let ref $v = $v;
+        go!(@parse $($tail)*)
+    }};
+    (@parse move $v:ident, $($tail:tt)*) => {{
+        let $v = $v;
+        go!(@parse $($tail)*)
+    }};
+    (@parse $v:ident, $($tail:tt)*) => {{
+        let $v = $v.clone();
+        go!(@parse $($tail)*)
+    }};
+    (@parse $body:expr) => {
+        ::std::thread::spawn(move || {
+            let res = ::std::panic::catch_unwind(::std::panic::AssertUnwindSafe(|| {
+                $body
+            }));
+            if res.is_err() {
+                eprintln!("goroutine panicked: {:?}", res);
+                ::std::process::abort();
+            }
+        })
+    };
+    (@parse $($tail:tt)*) => {
+        compile_error!("invalid `go!` syntax")
+    };
+    ($($tail:tt)*) => {{
+        go!(@parse $($tail)*)
+    }};
+}
+
+// https://github.com/golang/go/blob/master/test/chan/doubleselect.go
+mod doubleselect {
+    use super::*;
+
+    const ITERATIONS: i32 = 10_000;
+
+    fn sender(n: i32, c1: Chan<i32>, c2: Chan<i32>, c3: Chan<i32>, c4: Chan<i32>) {
+        defer! { c1.close() }
+        defer! { c2.close() }
+        defer! { c3.close() }
+        defer! { c4.close() }
+
+        for i in 0..n {
+            select! {
+                send(c1.tx(), i) -> _ => {}
+                send(c2.tx(), i) -> _ => {}
+                send(c3.tx(), i) -> _ => {}
+                send(c4.tx(), i) -> _ => {}
+            }
+        }
+    }
+
+    fn mux(out: Chan<i32>, inp: Chan<i32>, done: Chan<bool>) {
+        for v in inp {
+            out.send(v);
+        }
+        done.send(true);
+    }
+
+    fn recver(inp: Chan<i32>) {
+        let mut seen = HashMap::new();
+
+        for v in &inp {
+            if seen.contains_key(&v) {
+                panic!("got duplicate value for {}", v);
+            }
+            seen.insert(v, true);
+        }
+    }
+
+    #[test]
+    fn main() {
+        let c1 = make::<i32>(0);
+        let c2 = make::<i32>(0);
+        let c3 = make::<i32>(0);
+        let c4 = make::<i32>(0);
+        let done = make::<bool>(0);
+        let cmux = make::<i32>(0);
+
+        go!(c1, c2, c3, c4, sender(ITERATIONS, c1, c2, c3, c4));
+        go!(cmux, c1, done, mux(cmux, c1, done));
+        go!(cmux, c2, done, mux(cmux, c2, done));
+        go!(cmux, c3, done, mux(cmux, c3, done));
+        go!(cmux, c4, done, mux(cmux, c4, done));
+        go!(done, cmux, {
+            done.recv();
+            done.recv();
+            done.recv();
+            done.recv();
+            cmux.close();
+        });
+        recver(cmux);
+    }
+}
+
+// https://github.com/golang/go/blob/master/test/chan/fifo.go
+mod fifo {
+    use super::*;
+
+    const N: i32 = 10;
+
+    #[test]
+    fn asynch_fifo() {
+        let ch = make::<i32>(N as usize);
+        for i in 0..N {
+            ch.send(i);
+        }
+        for i in 0..N {
+            if ch.recv() != Some(i) {
+                panic!("bad receive");
+            }
+        }
+    }
+
+    fn chain(ch: Chan<i32>, val: i32, inp: Chan<i32>, out: Chan<i32>) {
+        inp.recv();
+        if ch.recv() != Some(val) {
+            panic!(val);
+        }
+        out.send(1);
+    }
+
+    #[test]
+    fn synch_fifo() {
+        let ch = make::<i32>(0);
+        let mut inp = make::<i32>(0);
+        let start = inp.clone();
+
+        for i in 0..N {
+            let out = make::<i32>(0);
+            go!(ch, i, inp, out, chain(ch, i, inp, out));
+            inp = out;
+        }
+
+        start.send(0);
+        for i in 0..N {
+            ch.send(i);
+        }
+        inp.recv();
+    }
+}
+
+// https://github.com/golang/go/blob/master/test/chan/nonblock.go
+mod nonblock {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select.go
+mod select {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select2.go
+mod select2 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select3.go
+mod select3 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select4.go
+mod select4 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select5.go
+mod select5 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select6.go
+mod select6 {
+    // TODO
+    use super::*;
+
+    #[test]
+    fn main() {
+        let c1 = make::<bool>(0);
+        let c2 = make::<bool>(0);
+        let c3 = make::<bool>(0);
+
+        go!(c1, c1.recv());
+        go!(c1, c2, c3, {
+            select! {
+                recv(c1.rx()) -> _ => panic!("dummy"),
+                recv(c2.rx()) -> _ => c3.send(true),
+            }
+            c1.recv();
+        });
+        go!(c2, c2.send(true));
+
+        c3.recv();
+        c1.send(true);
+        c1.send(true);
+    }
+}
+
+// https://github.com/golang/go/blob/master/test/chan/select7.go
+mod select7 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/sieve1.go
+mod sieve1 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/sieve2.go
+mod sieve2 {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/chan/zerosize.go
+mod zerosize {
+    use super::*;
+
+    #[test]
+    fn zero_size_struct() {
+        struct ZeroSize;
+        let _ = make::<ZeroSize>(0);
+    }
+
+    #[test]
+    fn zero_size_array() {
+        let _ = make::<[u8; 0]>(0);
+    }
+}
+
+// https://github.com/golang/go/blob/master/src/runtime/chan_test.go
+mod chan_test {
+    use super::*;
+
+    #[test]
+    fn test_chan() {
+        const N: i32 = 200;
+
+        for cap in 0..N {
+            {
+                // Ensure that receive from empty chan blocks.
+                let c = make::<i32>(cap as usize);
+
+                let recv1 = Arc::new(Mutex::new(false));
+                go!(c, recv1, {
+                    c.recv();
+                    *recv1.lock() = true;
+                });
+
+                let recv2 = Arc::new(Mutex::new(false));
+                go!(c, recv2, {
+                    c.recv();
+                    *recv2.lock() = true;
+                });
+
+                thread::sleep(ms(1));
+
+                if *recv1.lock() || *recv2.lock() {
+                    panic!();
+                }
+
+                // Ensure that non-blocking receive does not block.
+                select! {
+                    recv(c.rx()) -> _ => panic!(),
+                    default => {}
+                }
+                select! {
+                    recv(c.rx()) -> _ => panic!(),
+                    default => {}
+                }
+
+                c.send(0);
+                c.send(0);
+            }
+
+            {
+                // Ensure that send to full chan blocks.
+                let c = make::<i32>(cap as usize);
+                for i in 0..cap {
+                    c.send(i);
+                }
+
+                let sent = Arc::new(Mutex::new(0));
+                go!(sent, c, {
+                    c.send(0);
+                    *sent.lock() = 1;
+                });
+
+                thread::sleep(ms(1));
+
+                if *sent.lock() != 0 {
+                    panic!();
+                }
+
+                // Ensure that non-blocking send does not block.
+                select! {
+                    send(c.tx(), 0) -> _ => panic!(),
+                    default => {}
+                }
+                c.recv();
+            }
+
+            {
+                // Ensure that we receive 0 from closed chan.
+                let c = make::<i32>(cap as usize);
+                for i in 0..cap {
+                    c.send(i);
+                }
+                c.close();
+
+                for i in 0..cap {
+                    let v = c.recv();
+                    if v != Some(i) {
+                        panic!();
+                    }
+                }
+
+                if c.recv() != None {
+                    panic!();
+                }
+                if c.try_recv() != None {
+                    panic!();
+                }
+            }
+
+            {
+                // Ensure that close unblocks receive.
+                let c = make::<i32>(cap as usize);
+                let done = make::<bool>(0);
+
+                go!(c, done, {
+                    let v = c.try_recv();
+                    done.send(v.is_some());
+                });
+
+                thread::sleep(ms(1));
+                c.close();
+
+                if !done.recv().unwrap() {
+                    // panic!();
+                }
+            }
+
+            {
+                // Send 100 integers,
+                // ensure that we receive them non-corrupted in FIFO order.
+                let c = make::<i32>(cap as usize);
+                go!(c, {
+                    for i in 0..100 {
+                        c.send(i);
+                    }
+                });
+                for i in 0..100 {
+                    if c.recv() != Some(i) {
+                        panic!();
+                    }
+                }
+
+                // Same, but using recv2.
+                go!(c, {
+                    for i in 0..100 {
+                        c.send(i);
+                    }
+                });
+                for i in 0..100 {
+                    if c.recv() != Some(i) {
+                        panic!();
+                    }
+                }
+            }
+        }
+    }
+
+    #[test]
+    fn test_nonblock_recv_race() {
+        const N: usize = 1000;
+
+        for _ in 0..N {
+            let c = make::<i32>(1);
+            c.send(1);
+
+            let t = go!(c, {
+                select! {
+                    recv(c.rx()) -> _ => {}
+                    default => panic!("chan is not ready"),
+                }
+            });
+
+            c.close();
+            c.recv();
+            t.join().unwrap();
+        }
+    }
+
+    #[test]
+    fn test_nonblock_select_race() {
+        const N: usize = 1000;
+
+        let done = make::<bool>(1);
+        for _ in 0..N {
+            let c1 = make::<i32>(1);
+            let c2 = make::<i32>(1);
+            c1.send(1);
+
+            go!(c1, c2, done, {
+                select! {
+                    recv(c1.rx()) -> _ => {}
+                    recv(c2.rx()) -> _ => {}
+                    default => {
+                        done.send(false);
+                        return;
+                    }
+                }
+                done.send(true);
+            });
+
+            c2.send(1);
+            select! {
+                recv(c1.rx()) -> _ => {}
+                default => {}
+            }
+            if !done.recv().unwrap() {
+                panic!("no chan is ready");
+            }
+        }
+    }
+
+    #[test]
+    fn test_nonblock_select_race2() {
+        const N: usize = 1000;
+
+        let done = make::<bool>(1);
+        for _ in 0..N {
+            let c1 = make::<i32>(1);
+            let c2 = make::<i32>(0);
+            c1.send(1);
+
+            go!(c1, c2, done, {
+                select! {
+                    recv(c1.rx()) -> _ => {}
+                    recv(c2.rx()) -> _ => {}
+                    default => {
+                        done.send(false);
+                        return;
+                    }
+                }
+                done.send(true);
+            });
+
+            c2.close();
+            select! {
+                recv(c1.rx()) -> _ => {}
+                default => {}
+            }
+            if !done.recv().unwrap() {
+                panic!("no chan is ready");
+            }
+        }
+    }
+
+    #[test]
+    fn test_self_select() {
+        // Ensure that send/recv on the same chan in select
+        // does not crash nor deadlock.
+
+        for &cap in &[0, 10] {
+            let wg = WaitGroup::new();
+            wg.add(2);
+            let c = make::<i32>(cap);
+
+            for p in 0..2 {
+                let p = p;
+                go!(wg, p, c, {
+                    defer! { wg.done() }
+                    for i in 0..1000 {
+                        if p == 0 || i % 2 == 0 {
+                            select! {
+                                send(c.tx(), p) -> _ => {}
+                                recv(c.rx()) -> v => {
+                                    if cap == 0 && v.ok() == Some(p) {
+                                        panic!("self receive");
+                                    }
+                                }
+                            }
+                        } else {
+                            select! {
+                                recv(c.rx()) -> v => {
+                                    if cap == 0 && v.ok() == Some(p) {
+                                        panic!("self receive");
+                                    }
+                                }
+                                send(c.tx(), p) -> _ => {}
+                            }
+                        }
+                    }
+                });
+            }
+            wg.wait();
+        }
+    }
+
+    #[test]
+    fn test_select_stress() {
+        let c = vec![
+            make::<i32>(0),
+            make::<i32>(0),
+            make::<i32>(2),
+            make::<i32>(3),
+        ];
+
+        const N: usize = 10000;
+
+        // There are 4 goroutines that send N values on each of the chans,
+        // + 4 goroutines that receive N values on each of the chans,
+        // + 1 goroutine that sends N values on each of the chans in a single select,
+        // + 1 goroutine that receives N values on each of the chans in a single select.
+        // All these sends, receives and selects interact chaotically at runtime,
+        // but we are careful that this whole construct does not deadlock.
+        let wg = WaitGroup::new();
+        wg.add(10);
+
+        for k in 0..4 {
+            go!(k, c, wg, {
+                for _ in 0..N {
+                    c[k].send(0);
+                }
+                wg.done();
+            });
+            go!(k, c, wg, {
+                for _ in 0..N {
+                    c[k].recv();
+                }
+                wg.done();
+            });
+        }
+
+        go!(c, wg, {
+            let mut n = [0; 4];
+            let mut c1 = c.iter().map(|c| Some(c.rx().clone())).collect::<Vec<_>>();
+
+            for _ in 0..4 * N {
+                let index = {
+                    let mut sel = Select::new();
+                    let mut opers = [!0; 4];
+                    for &i in &[3, 2, 0, 1] {
+                        if let Some(c) = &c1[i] {
+                            opers[i] = sel.recv(c);
+                        }
+                    }
+
+                    let oper = sel.select();
+                    let mut index = !0;
+                    for i in 0..4 {
+                        if opers[i] == oper.index() {
+                            index = i;
+                            let _ = oper.recv(c1[i].as_ref().unwrap());
+                            break;
+                        }
+                    }
+                    index
+                };
+
+                n[index] += 1;
+                if n[index] == N {
+                    c1[index] = None;
+                }
+            }
+            wg.done();
+        });
+
+        go!(c, wg, {
+            let mut n = [0; 4];
+            let mut c1 = c.iter().map(|c| Some(c.tx().clone())).collect::<Vec<_>>();
+
+            for _ in 0..4 * N {
+                let index = {
+                    let mut sel = Select::new();
+                    let mut opers = [!0; 4];
+                    for &i in &[0, 1, 2, 3] {
+                        if let Some(c) = &c1[i] {
+                            opers[i] = sel.send(c);
+                        }
+                    }
+
+                    let oper = sel.select();
+                    let mut index = !0;
+                    for i in 0..4 {
+                        if opers[i] == oper.index() {
+                            index = i;
+                            let _ = oper.send(c1[i].as_ref().unwrap(), 0);
+                            break;
+                        }
+                    }
+                    index
+                };
+
+                n[index] += 1;
+                if n[index] == N {
+                    c1[index] = None;
+                }
+            }
+            wg.done();
+        });
+
+        wg.wait();
+    }
+
+    #[test]
+    fn test_select_fairness() {
+        const TRIALS: usize = 10000;
+
+        let c1 = make::<u8>(TRIALS + 1);
+        let c2 = make::<u8>(TRIALS + 1);
+
+        for _ in 0..TRIALS + 1 {
+            c1.send(1);
+            c2.send(2);
+        }
+
+        let c3 = make::<u8>(0);
+        let c4 = make::<u8>(0);
+        let out = make::<u8>(0);
+        let done = make::<u8>(0);
+        let wg = WaitGroup::new();
+
+        wg.add(1);
+        go!(wg, c1, c2, c3, c4, out, done, {
+            defer! { wg.done() };
+            loop {
+                let b;
+                select! {
+                    recv(c3.rx()) -> m => b = m.unwrap(),
+                    recv(c4.rx()) -> m => b = m.unwrap(),
+                    recv(c1.rx()) -> m => b = m.unwrap(),
+                    recv(c2.rx()) -> m => b = m.unwrap(),
+                }
+                select! {
+                    send(out.tx(), b) -> _ => {}
+                    recv(done.rx()) -> _ => return,
+                }
+            }
+        });
+
+        let (mut cnt1, mut cnt2) = (0, 0);
+        for _ in 0..TRIALS {
+            match out.recv() {
+                Some(1) => cnt1 += 1,
+                Some(2) => cnt2 += 1,
+                b => panic!("unexpected value {:?} on channel", b),
+            }
+        }
+
+        // If the select in the goroutine is fair,
+        // cnt1 and cnt2 should be about the same value.
+        // With 10,000 trials, the expected margin of error at
+        // a confidence level of five nines is 4.4172 / (2 * Sqrt(10000)).
+
+        let r = cnt1 as f64 / TRIALS as f64;
+        let e = (r - 0.5).abs();
+
+        if e > 4.4172 / (2.0 * (TRIALS as f64).sqrt()) {
+            panic!(
+                "unfair select: in {} trials, results were {}, {}",
+                TRIALS, cnt1, cnt2,
+            );
+        }
+
+        done.close();
+        wg.wait();
+    }
+
+    #[test]
+    fn test_chan_send_interface() {
+        struct Mt;
+
+        let c = make::<Box<Any>>(1);
+        c.send(Box::new(Mt));
+
+        select! {
+            send(c.tx(), Box::new(Mt)) -> _ => {}
+            default => {}
+        }
+
+        select! {
+            send(c.tx(), Box::new(Mt)) -> _ => {}
+            send(c.tx(), Box::new(Mt)) -> _ => {}
+            default => {}
+        }
+    }
+
+    #[test]
+    fn test_pseudo_random_send() {
+        const N: usize = 100;
+
+        for cap in 0..N {
+            let c = make::<i32>(cap);
+            let l = Arc::new(Mutex::new(vec![0i32; N]));
+            let done = make::<bool>(0);
+
+            go!(c, done, l, {
+                let mut l = l.lock();
+                for i in 0..N {
+                    thread::yield_now();
+                    l[i] = c.recv().unwrap();
+                }
+                done.send(true);
+            });
+
+            for _ in 0..N {
+                select! {
+                    send(c.tx(), 1) -> _ => {}
+                    send(c.tx(), 0) -> _ => {}
+                }
+            }
+            done.recv();
+
+            let mut n0 = 0;
+            let mut n1 = 0;
+            for &i in l.lock().iter() {
+                n0 += (i + 1) % 2;
+                n1 += i;
+            }
+
+            if n0 <= N as i32 / 10 || n1 <= N as i32 / 10 {
+                panic!(
+                    "Want pseudorandom, got {} zeros and {} ones (chan cap {})",
+                    n0, n1, cap,
+                );
+            }
+        }
+    }
+
+    #[test]
+    fn test_multi_consumer() {
+        const NWORK: usize = 23;
+        const NITER: usize = 271828;
+
+        let pn = [2, 3, 7, 11, 13, 17, 19, 23, 27, 31];
+
+        let q = make::<i32>(NWORK * 3);
+        let r = make::<i32>(NWORK * 3);
+
+        let wg = WaitGroup::new();
+        for i in 0..NWORK {
+            wg.add(1);
+            let w = i;
+            go!(q, r, wg, pn, {
+                for v in &q {
+                    if pn[w % pn.len()] == v {
+                        thread::yield_now();
+                    }
+                    r.send(v);
+                }
+                wg.done();
+            });
+        }
+
+        let expect = Arc::new(Mutex::new(0));
+        go!(q, r, expect, wg, pn, {
+            for i in 0..NITER {
+                let v = pn[i % pn.len()];
+                *expect.lock() += v;
+                q.send(v);
+            }
+            q.close();
+            wg.wait();
+            r.close();
+        });
+
+        let mut n = 0;
+        let mut s = 0;
+        for v in &r {
+            n += 1;
+            s += v;
+        }
+
+        if n != NITER || s != *expect.lock() {
+            panic!();
+        }
+    }
+
+    #[test]
+    fn test_select_duplicate_channel() {
+        // This test makes sure we can queue a G on
+        // the same channel multiple times.
+        let c = make::<i32>(0);
+        let d = make::<i32>(0);
+        let e = make::<i32>(0);
+
+        go!(c, d, e, {
+            select! {
+                recv(c.rx()) -> _ => {}
+                recv(d.rx()) -> _ => {}
+                recv(e.rx()) -> _ => {}
+            }
+            e.send(9);
+        });
+        thread::sleep(ms(1));
+
+        go!(c, c.recv());
+        thread::sleep(ms(1));
+
+        d.send(7);
+        e.recv();
+        c.send(8);
+    }
+}
+
+// https://github.com/golang/go/blob/master/test/closedchan.go
+mod closedchan {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/src/runtime/chanbarrier_test.go
+mod chanbarrier_test {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/src/runtime/race/testdata/chan_test.go
+mod race_chan_test {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/ken/chan.go
+mod chan {
+    // TODO
+}
+
+// https://github.com/golang/go/blob/master/test/ken/chan1.go
+mod chan1 {
+    // TODO
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/iter.rs b/rustc_deps/vendor/crossbeam-channel/tests/iter.rs
new file mode 100644
index 0000000..3eee149
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/iter.rs
@@ -0,0 +1,110 @@
+//! Tests for iteration over receivers.
+
+extern crate crossbeam;
+extern crate crossbeam_channel;
+
+use crossbeam_channel::unbounded;
+
+#[test]
+fn nested_recv_iter() {
+    let (s, r) = unbounded::<i32>();
+    let (total_s, total_r) = unbounded::<i32>();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            let mut acc = 0;
+            for x in r.iter() {
+                acc += x;
+            }
+            total_s.send(acc).unwrap();
+        });
+
+        s.send(3).unwrap();
+        s.send(1).unwrap();
+        s.send(2).unwrap();
+        drop(s);
+        assert_eq!(total_r.recv().unwrap(), 6);
+    });
+}
+
+#[test]
+fn recv_iter_break() {
+    let (s, r) = unbounded::<i32>();
+    let (count_s, count_r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            let mut count = 0;
+            for x in r.iter() {
+                if count >= 3 {
+                    break;
+                } else {
+                    count += x;
+                }
+            }
+            count_s.send(count).unwrap();
+        });
+
+        s.send(2).unwrap();
+        s.send(2).unwrap();
+        s.send(2).unwrap();
+        let _ = s.send(2);
+        drop(s);
+        assert_eq!(count_r.recv().unwrap(), 4);
+    })
+}
+
+#[test]
+fn recv_try_iter() {
+    let (request_s, request_r) = unbounded();
+    let (response_s, response_r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            let mut count = 0;
+            loop {
+                for x in response_r.try_iter() {
+                    count += x;
+                    if count == 6 {
+                        assert_eq!(count, 6);
+                        return;
+                    }
+                }
+                request_s.send(()).unwrap();
+            }
+        });
+
+        for _ in request_r.iter() {
+            if response_s.send(2).is_err() {
+                break;
+            }
+        }
+    })
+}
+
+#[test]
+fn recv_into_iter_owned() {
+    let mut iter = {
+        let (s, r) = unbounded::<i32>();
+        s.send(1).unwrap();
+        s.send(2).unwrap();
+        r.into_iter()
+    };
+
+    assert_eq!(iter.next().unwrap(), 1);
+    assert_eq!(iter.next().unwrap(), 2);
+    assert_eq!(iter.next().is_none(), true);
+}
+
+#[test]
+fn recv_into_iter_borrowed() {
+    let (s, r) = unbounded::<i32>();
+    s.send(1).unwrap();
+    s.send(2).unwrap();
+    drop(s);
+
+    let mut iter = (&r).into_iter();
+    assert_eq!(iter.next().unwrap(), 1);
+    assert_eq!(iter.next().unwrap(), 2);
+    assert_eq!(iter.next().is_none(), true);
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/list.rs b/rustc_deps/vendor/crossbeam-channel/tests/list.rs
new file mode 100644
index 0000000..446b837
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/list.rs
@@ -0,0 +1,444 @@
+//! Tests for the list channel flavor.
+
+extern crate crossbeam;
+#[macro_use]
+extern crate crossbeam_channel;
+extern crate rand;
+
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering;
+use std::thread;
+use std::time::Duration;
+
+use crossbeam_channel::unbounded;
+use crossbeam_channel::{RecvError, RecvTimeoutError, TryRecvError};
+use crossbeam_channel::{SendError, SendTimeoutError, TrySendError};
+use rand::{thread_rng, Rng};
+
+fn ms(ms: u64) -> Duration {
+    Duration::from_millis(ms)
+}
+
+#[test]
+fn smoke() {
+    let (s, r) = unbounded();
+    s.try_send(7).unwrap();
+    assert_eq!(r.try_recv(), Ok(7));
+
+    s.send(8).unwrap();
+    assert_eq!(r.recv(), Ok(8));
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+    assert_eq!(r.recv_timeout(ms(1000)), Err(RecvTimeoutError::Timeout));
+}
+
+#[test]
+fn capacity() {
+    let (s, r) = unbounded::<()>();
+    assert_eq!(s.capacity(), None);
+    assert_eq!(r.capacity(), None);
+}
+
+#[test]
+fn len_empty_full() {
+    let (s, r) = unbounded();
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(s.is_empty(), true);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 0);
+    assert_eq!(r.is_empty(), true);
+    assert_eq!(r.is_full(), false);
+
+    s.send(()).unwrap();
+
+    assert_eq!(s.len(), 1);
+    assert_eq!(s.is_empty(), false);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 1);
+    assert_eq!(r.is_empty(), false);
+    assert_eq!(r.is_full(), false);
+
+    r.recv().unwrap();
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(s.is_empty(), true);
+    assert_eq!(s.is_full(), false);
+    assert_eq!(r.len(), 0);
+    assert_eq!(r.is_empty(), true);
+    assert_eq!(r.is_full(), false);
+}
+
+#[test]
+fn try_recv() {
+    let (s, r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+            thread::sleep(ms(1500));
+            assert_eq!(r.try_recv(), Ok(7));
+            thread::sleep(ms(500));
+            assert_eq!(r.try_recv(), Err(TryRecvError::Disconnected));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            s.send(7).unwrap();
+        });
+    });
+}
+
+#[test]
+fn recv() {
+    let (s, r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv(), Ok(7));
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(8));
+            thread::sleep(ms(1000));
+            assert_eq!(r.recv(), Ok(9));
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1500));
+            s.send(7).unwrap();
+            s.send(8).unwrap();
+            s.send(9).unwrap();
+        });
+    });
+}
+
+#[test]
+fn recv_timeout() {
+    let (s, r) = unbounded::<i32>();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv_timeout(ms(1000)), Err(RecvTimeoutError::Timeout));
+            assert_eq!(r.recv_timeout(ms(1000)), Ok(7));
+            assert_eq!(
+                r.recv_timeout(ms(1000)),
+                Err(RecvTimeoutError::Disconnected)
+            );
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1500));
+            s.send(7).unwrap();
+        });
+    });
+}
+
+#[test]
+fn try_send() {
+    let (s, r) = unbounded();
+    for i in 0..1000 {
+        assert_eq!(s.try_send(i), Ok(()));
+    }
+
+    drop(r);
+    assert_eq!(s.try_send(777), Err(TrySendError::Disconnected(777)));
+}
+
+#[test]
+fn send() {
+    let (s, r) = unbounded();
+    for i in 0..1000 {
+        assert_eq!(s.send(i), Ok(()));
+    }
+
+    drop(r);
+    assert_eq!(s.send(777), Err(SendError(777)));
+}
+
+#[test]
+fn send_timeout() {
+    let (s, r) = unbounded();
+    for i in 0..1000 {
+        assert_eq!(s.send_timeout(i, ms(i as u64)), Ok(()));
+    }
+
+    drop(r);
+    assert_eq!(
+        s.send_timeout(777, ms(0)),
+        Err(SendTimeoutError::Disconnected(777))
+    );
+}
+
+#[test]
+fn send_after_disconnect() {
+    let (s, r) = unbounded();
+
+    s.send(1).unwrap();
+    s.send(2).unwrap();
+    s.send(3).unwrap();
+
+    drop(r);
+
+    assert_eq!(s.send(4), Err(SendError(4)));
+    assert_eq!(s.try_send(5), Err(TrySendError::Disconnected(5)));
+    assert_eq!(
+        s.send_timeout(6, ms(0)),
+        Err(SendTimeoutError::Disconnected(6))
+    );
+}
+
+#[test]
+fn recv_after_disconnect() {
+    let (s, r) = unbounded();
+
+    s.send(1).unwrap();
+    s.send(2).unwrap();
+    s.send(3).unwrap();
+
+    drop(s);
+
+    assert_eq!(r.recv(), Ok(1));
+    assert_eq!(r.recv(), Ok(2));
+    assert_eq!(r.recv(), Ok(3));
+    assert_eq!(r.recv(), Err(RecvError));
+}
+
+#[test]
+fn len() {
+    let (s, r) = unbounded();
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+
+    for i in 0..50 {
+        s.send(i).unwrap();
+        assert_eq!(s.len(), i + 1);
+    }
+
+    for i in 0..50 {
+        r.recv().unwrap();
+        assert_eq!(r.len(), 50 - i - 1);
+    }
+
+    assert_eq!(s.len(), 0);
+    assert_eq!(r.len(), 0);
+}
+
+#[test]
+fn disconnect_wakes_receiver() {
+    let (s, r) = unbounded::<()>();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            thread::sleep(ms(1000));
+            drop(s);
+        });
+    });
+}
+
+#[test]
+fn spsc() {
+    const COUNT: usize = 100_000;
+
+    let (s, r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(move || {
+            for i in 0..COUNT {
+                assert_eq!(r.recv(), Ok(i));
+            }
+            assert_eq!(r.recv(), Err(RecvError));
+        });
+        scope.spawn(move || {
+            for i in 0..COUNT {
+                s.send(i).unwrap();
+            }
+        });
+    });
+}
+
+#[test]
+fn mpmc() {
+    const COUNT: usize = 25_000;
+    const THREADS: usize = 4;
+
+    let (s, r) = unbounded::<usize>();
+    let v = (0..COUNT).map(|_| AtomicUsize::new(0)).collect::<Vec<_>>();
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for _ in 0..COUNT {
+                    let n = r.recv().unwrap();
+                    v[n].fetch_add(1, Ordering::SeqCst);
+                }
+            });
+        }
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for i in 0..COUNT {
+                    s.send(i).unwrap();
+                }
+            });
+        }
+    });
+
+    assert_eq!(r.try_recv(), Err(TryRecvError::Empty));
+
+    for c in v {
+        assert_eq!(c.load(Ordering::SeqCst), THREADS);
+    }
+}
+
+#[test]
+fn stress_timeout_two_threads() {
+    const COUNT: usize = 100;
+
+    let (s, r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                if i % 2 == 0 {
+                    thread::sleep(ms(50));
+                }
+                s.send(i).unwrap();
+            }
+        });
+
+        scope.spawn(|| {
+            for i in 0..COUNT {
+                if i % 2 == 0 {
+                    thread::sleep(ms(50));
+                }
+                loop {
+                    if let Ok(x) = r.recv_timeout(ms(10)) {
+                        assert_eq!(x, i);
+                        break;
+                    }
+                }
+            }
+        });
+    });
+}
+
+#[test]
+fn drops() {
+    static DROPS: AtomicUsize = AtomicUsize::new(0);
+
+    #[derive(Debug, PartialEq)]
+    struct DropCounter;
+
+    impl Drop for DropCounter {
+        fn drop(&mut self) {
+            DROPS.fetch_add(1, Ordering::SeqCst);
+        }
+    }
+
+    let mut rng = thread_rng();
+
+    for _ in 0..100 {
+        let steps = rng.gen_range(0, 10_000);
+        let additional = rng.gen_range(0, 1000);
+
+        DROPS.store(0, Ordering::SeqCst);
+        let (s, r) = unbounded::<DropCounter>();
+
+        crossbeam::scope(|scope| {
+            scope.spawn(|| {
+                for _ in 0..steps {
+                    r.recv().unwrap();
+                }
+            });
+
+            scope.spawn(|| {
+                for _ in 0..steps {
+                    s.send(DropCounter).unwrap();
+                }
+            });
+        });
+
+        for _ in 0..additional {
+            s.try_send(DropCounter).unwrap();
+        }
+
+        assert_eq!(DROPS.load(Ordering::SeqCst), steps);
+        drop(s);
+        drop(r);
+        assert_eq!(DROPS.load(Ordering::SeqCst), steps + additional);
+    }
+}
+
+#[test]
+fn linearizable() {
+    const COUNT: usize = 25_000;
+    const THREADS: usize = 4;
+
+    let (s, r) = unbounded();
+
+    crossbeam::scope(|scope| {
+        for _ in 0..THREADS {
+            scope.spawn(|| {
+                for _ in 0..COUNT {
+                    s.send(0).unwrap();
+                    r.try_recv().unwrap();
+                }
+            });
+        }
+    });
+}
+
+#[test]
+fn fairness() {
+    const COUNT: usize = 10_000;
+
+    let (s1, r1) = unbounded::<()>();
+    let (s2, r2) = unbounded::<()>();
+
+    for _ in 0..COUNT {
+        s1.send(()).unwrap();
+        s2.send(()).unwrap();
+    }
+
+    let mut hits = [0usize; 2];
+    for _ in 0..COUNT {
+        select! {
+            recv(r1) -> _ => hits[0] += 1,
+            recv(r2) -> _ => hits[1] += 1,
+        }
+    }
+    assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+}
+
+#[test]
+fn fairness_duplicates() {
+    const COUNT: usize = 10_000;
+
+    let (s, r) = unbounded();
+
+    for _ in 0..COUNT {
+        s.send(()).unwrap();
+    }
+
+    let mut hits = [0usize; 5];
+    for _ in 0..COUNT {
+        select! {
+            recv(r) -> _ => hits[0] += 1,
+            recv(r) -> _ => hits[1] += 1,
+            recv(r) -> _ => hits[2] += 1,
+            recv(r) -> _ => hits[3] += 1,
+            recv(r) -> _ => hits[4] += 1,
+        }
+    }
+    assert!(hits.iter().all(|x| *x >= COUNT / hits.len() / 2));
+}
+
+#[test]
+fn recv_in_send() {
+    let (s, r) = unbounded();
+    s.send(()).unwrap();
+
+    select! {
+        send(s, assert_eq!(r.recv(), Ok(()))) -> _ => {}
+    }
+}
diff --git a/rustc_deps/vendor/crossbeam-channel/tests/mpsc.rs b/rustc_deps/vendor/crossbeam-channel/tests/mpsc.rs
new file mode 100644
index 0000000..0550ef1
--- /dev/null
+++ b/rustc_deps/vendor/crossbeam-channel/tests/mpsc.rs
@@ -0,0 +1,1948 @@
+//! Tests copied from `std::sync::mpsc`.
+//!
+//! This is a copy of tests for the `std::sync::mpsc` channels from the stanard library, but
+//! modified to work with `crossbeam-channel` instead.
+//!
+//! Minor tweaks were needed to make the tests compile:
+//!
+//! - Replace `box` syntax with `Box::new`.
+//! - Replace all uses of `Select` with `select!`.
+//! - Change the imports.
+//!
+//! Source:
+//!   - https://github.com/rust-lang/rust/tree/master/src/libstd/sync/mpsc
+//!
+//! Copyright & License:
+//!   - Copyright 2013-2014 The Rust Project Developers
+//!   - Apache License, Version 2.0 or MIT license, at your option
+//!   - https://github.com/rust-lang/rust/blob/master/COPYRIGHT
+//!   - https://www.rust-lang.org/en-US/legal.html
+
+#[macro_use]
+extern crate crossbeam_channel as cc;
+
+use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError};
+use std::sync::mpsc::{SendError, TrySendError};
+use std::time::Duration;
+
+pub struct Sender<T> {
+    pub inner: cc::Sender<T>,
+}
+
+impl<T> Sender<T> {
+    pub fn send(&self, t: T) -> Result<(), SendError<T>> {
+        self.inner.send(t).map_err(|cc::SendError(m)| SendError(m))
+    }
+}
+
+impl<T> Clone for Sender<T> {
+    fn clone(&self) -> Sender<T> {
+        Sender {
+            inner: self.inner.clone(),
+        }
+    }
+}
+
+pub struct SyncSender<T> {
+    pub inner: cc::Sender<T>,
+}
+
+impl<T> SyncSender<T> {
+    pub fn send(&self, t: T) -> Result<(), SendError<T>> {
+        self.inner.send(t).map_err(|cc::SendError(m)| SendError(m))
+    }
+
+    pub fn try_send(&self, t: T) -> Result<(), TrySendError<T>> {
+        self.inner.try_send(t).map_err(|err| match err {
+            cc::TrySendError::Full(m) => TrySendError::Full(m),
+            cc::TrySendError::Disconnected(m) => TrySendError::Disconnected(m),
+        })
+    }
+}
+
+impl<T> Clone for SyncSender<T> {
+    fn clone(&self) -> SyncSender<T> {
+        SyncSender {
+            inner: self.inner.clone(),
+        }
+    }
+}
+
+pub struct Receiver<T> {
+    pub inner: cc::Receiver<T>,
+}
+
+impl<T> Receiver<T> {
+    pub fn try_recv(&self) -> Result<T, TryRecvError> {
+        self.inner.try_recv().map_err(|err| match err {
+            cc::TryRecvError::Empty => TryRecvError::Empty,
+            cc::TryRecvError::Disconnected => TryRecvError::Disconnected,
+        })
+    }
+
+    pub fn recv(&self) -> Result<T, RecvError> {
+        self.inner.recv().map_err(|_| RecvError)
+    }
+
+    pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError> {
+        self.inner.recv_timeout(timeout).map_err(|err| match err {
+            cc::RecvTimeoutError::Timeout => RecvTimeoutError::Timeout,
+            cc::RecvTimeoutError::Disconnected => RecvTimeoutError::Disconnected,
+        })
+    }
+
+    pub fn iter(&self) -> Iter<T> {
+        Iter { inner: self }
+    }
+
+    pub fn try_iter(&self) -> TryIter<T> {
+        TryIter { inner: self }
+    }
+}
+
+impl<'a, T> IntoIterator for &'a Receiver<T> {
+    type Item = T;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Iter<'a, T> {
+        self.iter()
+    }
+}
+
+impl<T> IntoIterator for Receiver<T> {
+    type Item = T;
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> IntoIter<T> {
+        IntoIter { inner: self }
+    }
+}
+
+pub struct TryIter<'a, T: 'a> {
+    inner: &'a Receiver<T>,
+}
+
+impl<'a, T> Iterator for TryIter<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<T> {
+        self.inner.try_recv().ok()
+    }
+}
+
+pub struct Iter<'a, T: 'a> {
+    inner: &'a Receiver<T>,
+}
+
+impl<'a, T> Iterator for Iter<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<T> {
+        self.inner.recv().ok()
+    }
+}
+
+pub struct IntoIter<T> {
+    inner: Receiver<T>,
+}
+
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<T> {
+        self.inner.recv().ok()
+    }
+}
+
+pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
+    let (s, r) = cc::unbounded();
+    let s = Sender { inner: s };
+    let r = Receiver { inner: r };
+    (s, r)
+}
+
+pub fn sync_channel<T>(bound: usize) -> (SyncSender<T>, Receiver<T>) {
+    let (s, r) = cc::bounded(bound);
+    let s = SyncSender { inner: s };
+    let r = Receiver { inner: r };
+    (s, r)
+}
+
+macro_rules! select {
+    (
+        $($name:pat = $rx:ident.$meth:ident() => $code:expr),+
+    ) => ({
+        crossbeam_channel_internal! {
+            $(
+                recv(($rx).inner) -> res => {
+                    let $name = res.map_err(|_| ::std::sync::mpsc::RecvError);
+                    $code
+                }
+            )+
+        }
+    })
+}
+
+// Source: https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/mod.rs
+mod channel_tests {
+    use super::*;
+
+    use std::env;
+    use std::thread;
+    use std::time::{Duration, Instant};
+
+    pub fn stress_factor() -> usize {
+        match env::var("RUST_TEST_STRESS") {
+            Ok(val) => val.parse().unwrap(),
+            Err(..) => 1,
+        }
+    }
+
+    #[test]
+    fn smoke() {
+        let (tx, rx) = channel::<i32>();
+        tx.send(1).unwrap();
+        assert_eq!(rx.recv().unwrap(), 1);
+    }
+
+    #[test]
+    fn drop_full() {
+        let (tx, _rx) = channel::<Box<isize>>();
+        tx.send(Box::new(1)).unwrap();
+    }
+
+    #[test]
+    fn drop_full_shared() {
+        let (tx, _rx) = channel::<Box<isize>>();
+        drop(tx.clone());
+        drop(tx.clone());
+        tx.send(Box::new(1)).unwrap();
+    }
+
+    #[test]
+    fn smoke_shared() {
+        let (tx, rx) = channel::<i32>();
+        tx.send(1).unwrap();
+        assert_eq!(rx.recv().unwrap(), 1);
+        let tx = tx.clone();
+        tx.send(1).unwrap();
+        assert_eq!(rx.recv().unwrap(), 1);
+    }
+
+    #[test]
+    fn smoke_threads() {
+        let (tx, rx) = channel::<i32>();
+        let _t = thread::spawn(move || {
+            tx.send(1).unwrap();
+        });
+        assert_eq!(rx.recv().unwrap(), 1);
+    }
+
+    #[test]
+    fn smoke_port_gone() {
+        let (tx, rx) = channel::<i32>();
+        drop(rx);
+        assert!(tx.send(1).is_err());
+    }
+
+    #[test]
+    fn smoke_shared_port_gone() {
+        let (tx, rx) = channel::<i32>();
+        drop(rx);
+        assert!(tx.send(1).is_err())
+    }
+
+    #[test]
+    fn smoke_shared_port_gone2() {
+        let (tx, rx) = channel::<i32>();
+        drop(rx);
+        let tx2 = tx.clone();
+        drop(tx);
+        assert!(tx2.send(1).is_err());
+    }
+
+    #[test]
+    fn port_gone_concurrent() {
+        let (tx, rx) = channel::<i32>();
+        let _t = thread::spawn(move || {
+            rx.recv().unwrap();
+        });
+        while tx.send(1).is_ok() {}
+    }
+
+    #[test]
+    fn port_gone_concurrent_shared() {
+        let (tx, rx) = channel::<i32>();
+        let tx2 = tx.clone();
+        let _t = thread::spawn(move || {
+            rx.recv().unwrap();
+        });
+        while tx.send(1).is_ok() && tx2.send(1).is_ok() {}
+    }
+
+    #[test]
+    fn smoke_chan_gone() {
+        let (tx, rx) = channel::<i32>();
+        drop(tx);
+        assert!(rx.recv().is_err());
+    }
+
+    #[test]
+    fn smoke_chan_gone_shared() {
+        let (tx, rx) = channel::<()>();
+        let tx2 = tx.clone();
+        drop(tx);
+        drop(tx2);
+        assert!(rx.recv().is_err());
+    }
+
+    #[test]
+    fn chan_gone_concurrent() {
+        let (tx, rx) = channel::<i32>();
+        let _t = thread::spawn(move || {
+            tx.send(1).unwrap();
+            tx.send(1).unwrap();
+        });
+        while rx.recv().is_ok() {}
+    }
+
+    #[test]
+    fn stress() {
+        let (tx, rx) = channel::<i32>();
+        let t = thread::spawn(move || {
+            for _ in 0..10000 {
+                tx.send(1).unwrap();
+            }
+        });
+        for _ in 0..10000 {
+            assert_eq!(rx.recv().unwrap(), 1);
+        }
+        t.join().ok().unwrap();
+    }
+
+    #[test]
+    fn stress_shared() {
+        const AMT: u32 = 10000;
+        const NTHREADS: u32 = 8;
+        let (tx, rx) = channel::<i32>();
+
+        let t = thread::spawn(move || {
+            for _ in 0..AMT * NTHREADS {
+                assert_eq!(rx.recv().unwrap(), 1);
+            }
+            match rx.try_recv() {
+                Ok(..) => panic!(),
+                _ => {}
+            }
+        });
+
+        for _ in 0..NTHREADS {
+            let tx = tx.clone();
+            thread::spawn(move || {
+                for _ in 0..AMT {
+                    tx.send(1).unwrap();
+                }
+            });
+        }
+        drop(tx);
+        t.join().ok().unwrap();
+    }
+
+    #[test]
+    fn send_from_outside_runtime() {
+        let (tx1, rx1) = channel::<()>();
+        let (tx2, rx2) = channel::<i32>();
+        let t1 = thread::spawn(move || {
+            tx1.send(()).unwrap();
+            for _ in 0..40 {
+                assert_eq!(rx2.recv().unwrap(), 1);
+            }
+        });
+        rx1.recv().unwrap();
+        let t2 = thread::spawn(move || {
+            for _ in 0..40 {
+                tx2.send(1).unwrap();
+            }
+        });
+        t1.join().ok().unwrap();
+        t2.join().ok().unwrap();
+    }
+
+    #[test]
+    fn recv_from_outside_runtime() {
+        let (tx, rx) = channel::<i32>();
+        let t = thread::spawn(move || {
+            for _ in 0..40 {
+                assert_eq!(rx.recv().unwrap(), 1);
+            }
+        });
+        for _ in 0..40 {
+            tx.send(1).unwrap();
+        }
+        t.join().ok().unwrap();
+    }
+
+    #[test]
+    fn no_runtime() {
+        let (tx1, rx1) = channel::<i32>();
+        let (tx2, rx2) = channel::<i32>();
+        let t1 = thread::spawn(move || {
+            assert_eq!(rx1.recv().unwrap(), 1);
+            tx2.send(2).unwrap();
+        });
+        let t2 = thread::spawn(move || {
+            tx1.send(1).unwrap();
+            assert_eq!(rx2.recv().unwrap(), 2);
+        });
+        t1.join().ok().unwrap();
+        t2.join().ok().unwrap();
+    }
+
+    #[test]
+    fn oneshot_single_thread_close_port_first() {
+        // Simple test of closing without sending
+        let (_tx, rx) = channel::<i32>();
+        drop(rx);
+    }
+
+    #[test]
+    fn oneshot_single_thread_close_chan_first() {
+        // Simple test of closing without sending
+        let (tx, _rx) = channel::<i32>();
+        drop(tx);
+    }
+
+    #[test]
+    fn oneshot_single_thread_send_port_close() {
+        // Testing that the sender cleans up the payload if receiver is closed
+        let (tx, rx) = channel::<Box<i32>>();
+        drop(rx);
+        assert!(tx.send(Box::new(0)).is_err());
+    }
+
+    #[test]
+    fn oneshot_single_thread_recv_chan_close() {
+        // Receiving on a closed chan will panic
+        let res = thread::spawn(move || {
+            let (tx, rx) = channel::<i32>();
+            drop(tx);
+            rx.recv().unwrap();
+        }).join();
+        // What is our res?
+        assert!(res.is_err());
+    }
+
+    #[test]
+    fn oneshot_single_thread_send_then_recv() {
+        let (tx, rx) = channel::<Box<i32>>();
+        tx.send(Box::new(10)).unwrap();
+        assert!(*rx.recv().unwrap() == 10);
+    }
+
+    #[test]
+    fn oneshot_single_thread_try_send_open() {
+        let (tx, rx) = channel::<i32>();
+        assert!(tx.send(10).is_ok());
+        assert!(rx.recv().unwrap() == 10);
+    }
+
+    #[test]
+    fn oneshot_single_thread_try_send_closed() {
+        let (tx, rx) = channel::<i32>();
+        drop(rx);
+        assert!(tx.send(10).is_err());
+    }
+
+    #[test]
+    fn oneshot_single_thread_try_recv_open() {
+        let (tx, rx) = channel::<i32>();
+        tx.send(10).unwrap();
+        assert!(rx.recv() == Ok(10));
+    }
+
+    #[test]
+    fn oneshot_single_thread_try_recv_closed() {
+        let (tx, rx) = channel::<i32>();
+        drop(tx);
+        assert!(rx.recv().is_err());
+    }
+
+    #[test]
+    fn oneshot_single_thread_peek_data() {
+        let (tx, rx) = channel::<i32>();
+        assert_eq!(rx.try_recv(), Err(TryRecvError::Empty));
+        tx.send(10).unwrap();
+        assert_eq!(rx.try_recv(), Ok(10));
+    }
+
+    #[test]
+    fn oneshot_single_thread_peek_close() {
+        let (tx, rx) = channel::<i32>();
+        drop(tx);
+        assert_eq!(rx.try_recv(), Err(TryRecvError::Disconnected));
+        assert_eq!(rx.try_recv(), Err(TryRecvError::Disconnected));
+    }
+
+    #[test]
+    fn oneshot_single_thread_peek_open() {
+        let (_tx, rx) = channel::<i32>();
+        assert_eq!(rx.try_recv(), Err(TryRecvError::Empty));
+    }
+
+    #[test]
+    fn oneshot_multi_task_recv_then_send() {
+        let (tx, rx) = channel::<Box<i32>>();
+        let _t = thread::spawn(move || {
+            assert!(*rx.recv().unwrap() == 10);
+        });
+
+        tx.send(Box::new(10)).unwrap();
+    }
+
+    #[test]
+    fn oneshot_multi_task_recv_then_close() {
+        let (tx, rx) = channel::<Box<i32>>();
+        let _t = thread::spawn(move || {
+            drop(tx);
+        });
+        let res = thread::spawn(move || {
+            assert!(*rx.recv().unwrap() == 10);
+        }).join();
+        assert!(res.is_err());
+    }
+
+    #[test]
+    fn oneshot_multi_thread_close_stress() {
+        for _ in 0..stress_factor() {
+            let (tx, rx) = channel::<i32>();
+            let _t = thread::spawn(move || {
+                drop(rx);
+            });
+            drop(tx);
+        }
+    }
+
+    #[test]
+    fn oneshot_multi_thread_send_close_stress() {
+        for _ in 0..stress_factor() {
+            let (tx, rx) = channel::<i32>();
+            let _t = thread::spawn(move || {
+                drop(rx);
+            });
+            let _ = thread::spawn(move || {
+                tx.send(1).unwrap();
+            }).join();
+        }
+    }
+
+    #[test]
+    fn oneshot_multi_thread_recv_close_stress() {
+        for _ in 0..stress_factor() {
+            let (tx, rx) = channel::<i32>();
+            thread::spawn(move || {
+                let res = thread::spawn(move || {
+                    rx.recv().unwrap();
+                }).join();
+                assert!(res.is_err());
+            });
+            let _t = thread::spawn(move || {
+                thread::spawn(move || {
+                    drop(tx);
+                });
+            });
+        }
+    }
+
+    #[test]
+    fn oneshot_multi_thread_send_recv_stress() {
+        for _ in 0..stress_factor() {
+            let (tx, rx) = channel::<Box<isize>>();
+            let _t = thread::spawn(move || {
+                tx.send(Box::new(10)).unwrap();
+            });
+            assert!(*rx.recv().unwrap() == 10);
+        }
+    }
+
+    #[test]
+    fn stream_send_recv_stress() {
+        for _ in 0..stress_factor() {
+            let (tx, rx) = channel();
+
+            send(tx, 0);
+            recv(rx, 0);
+
+            fn send(tx: Sender<Box<i32>>, i: i32) {
+                if i == 10 {
+                    return;
+                }
+
+                thread::spawn(move || {
+                    tx.send(Box::new(i)).unwrap();
+                    send(tx, i + 1);
+                });
+            }
+
+            fn recv(rx: Receiver<Box<i32>>, i: i32) {
+                if i == 10 {
+                    return;
+                }
+
+                thread::spawn(move || {
+                    assert!(*rx.recv().unwrap() == i);
+                    recv(rx, i + 1);
+                });
+            }
+        }
+    }
+
+    #[test]
+    fn oneshot_single_thread_recv_timeout() {
+        let (tx, rx) = channel();
+        tx.send(()).unwrap();
+        assert_eq!(rx.recv_timeout(Duration::from_millis(1)), Ok(()));
+        assert_eq!(
+            rx.recv_timeout(Duration::from_millis(1)),
+            Err(RecvTimeoutError::Timeout)
+        );
+        tx.send(()).unwrap();
+        assert_eq!(rx.recv_timeout(Duration::from_millis(1)), Ok(()));
+    }
+
+    #[test]
+    fn stress_recv_timeout_two_threads() {
+        let (tx, rx) = channel();
+        let stress = stress_factor() + 100;
+        let timeout = Duration::from_millis(100);
+
+        thread::spawn(move || {
+            for i in 0..stress {
+                if i % 2 == 0 {
+                    thread::sleep(timeout * 2);
+                }
+                tx.send(1usize).unwrap();
+            }
+        });
+
+        let mut recv_count = 0;
+        loop {
+            match rx.recv_timeout(timeout) {
+                Ok(n) => {
+                    assert_eq!(n, 1usize);
+                    recv_count += 1;
+                }
+                Err(RecvTimeoutError::Timeout) => continue,
+                Err(RecvTimeoutError::Disconnected) => break,
+            }
+        }
+
+        assert_eq!(recv_count, stress);
+    }
+
+    #[test]
+    fn recv_timeout_upgrade() {
+        let (tx, rx) = channel::<()>();
+        let timeout = Duration::from_millis(1);
+        let _tx_clone = tx.clone();
+
+        let start = Instant::now();
+        assert_eq!(rx.recv_timeout(timeout), Err(RecvTimeoutError::Timeout));
+        assert!(Instant::now() >= start + timeout);
+    }
+
+    #[test]
+    fn stress_recv_timeout_shared() {
+        let (tx, rx) = channel();
+        let stress = stress_factor() + 100;
+
+        for i in 0..stress {
+            let tx = tx.clone();
+            thread::spawn(move || {
+                thread::sleep(Duration::from_millis(i as u64 * 10));
+                tx.send(1usize).unwrap();
+            });
+        }
+
+        drop(tx);
+
+        let mut recv_count = 0;
+        loop {
+            match rx.recv_timeout(Duration::from_millis(10)) {
+                Ok(n) => {
+                    assert_eq!(n, 1usize);
+                    recv_count += 1;
+                }
+                Err(RecvTimeoutError::Timeout) => continue,
+                Err(RecvTimeoutError::Disconnected) => break,