Bug 1468950 - Update Cargo lockfiles and re-vendor rust dependencies. r=Gankro
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 21 Jun 2018 08:22:02 -0400
changeset 477478 a2b811adb12fffa5d10e8e01dc9f2776ce2b757e
parent 477477 0088ae712bf5fe1a4ae4e0c7b816f1b9f68b20a4
child 477479 35dd3b1bd10be61a53952723c726534c8c3e599b
push id9385
push userdluca@mozilla.com
push dateFri, 22 Jun 2018 15:47:18 +0000
treeherdermozilla-beta@82a9a1027e2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGankro
bugs1468950
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468950 - Update Cargo lockfiles and re-vendor rust dependencies. r=Gankro MozReview-Commit-ID: 3kcDWGBPXt9
Cargo.lock
third_party/rust/proc-macro2-0.3.6/.cargo-checksum.json
third_party/rust/proc-macro2-0.3.6/.travis.yml
third_party/rust/proc-macro2-0.3.6/Cargo.toml
third_party/rust/proc-macro2-0.3.6/LICENSE-APACHE
third_party/rust/proc-macro2-0.3.6/LICENSE-MIT
third_party/rust/proc-macro2-0.3.6/README.md
third_party/rust/proc-macro2-0.3.6/src/lib.rs
third_party/rust/proc-macro2-0.3.6/src/stable.rs
third_party/rust/proc-macro2-0.3.6/src/strnom.rs
third_party/rust/proc-macro2-0.3.6/src/unstable.rs
third_party/rust/proc-macro2-0.3.6/tests/test.rs
third_party/rust/proc-macro2/.cargo-checksum.json
third_party/rust/proc-macro2/.travis.yml
third_party/rust/proc-macro2/Cargo.toml
third_party/rust/proc-macro2/README.md
third_party/rust/proc-macro2/src/lib.rs
third_party/rust/proc-macro2/src/stable.rs
third_party/rust/proc-macro2/src/strnom.rs
third_party/rust/proc-macro2/src/unstable.rs
third_party/rust/proc-macro2/tests/test.rs
third_party/rust/quote-0.5.2/.cargo-checksum.json
third_party/rust/quote-0.5.2/Cargo.toml
third_party/rust/quote-0.5.2/LICENSE-APACHE
third_party/rust/quote-0.5.2/LICENSE-MIT
third_party/rust/quote-0.5.2/README.md
third_party/rust/quote-0.5.2/src/lib.rs
third_party/rust/quote-0.5.2/src/to_tokens.rs
third_party/rust/quote-0.5.2/src/tokens.rs
third_party/rust/quote-0.5.2/tests/test.rs
third_party/rust/quote/.cargo-checksum.json
third_party/rust/quote/Cargo.toml
third_party/rust/quote/README.md
third_party/rust/quote/src/ext.rs
third_party/rust/quote/src/lib.rs
third_party/rust/quote/src/to_tokens.rs
third_party/rust/quote/src/tokens.rs
third_party/rust/quote/tests/test.rs
third_party/rust/serde/.cargo-checksum.json
third_party/rust/serde/Cargo.toml
third_party/rust/serde/README.md
third_party/rust/serde/build.rs
third_party/rust/serde/crates-io.md
third_party/rust/serde/src/de/from_primitive.rs
third_party/rust/serde/src/de/impls.rs
third_party/rust/serde/src/de/mod.rs
third_party/rust/serde/src/de/value.rs
third_party/rust/serde/src/integer128.rs
third_party/rust/serde/src/lib.rs
third_party/rust/serde/src/macros.rs
third_party/rust/serde/src/private/de.rs
third_party/rust/serde/src/private/ser.rs
third_party/rust/serde/src/ser/impls.rs
third_party/rust/serde/src/ser/mod.rs
third_party/rust/serde_derive/.cargo-checksum.json
third_party/rust/serde_derive/Cargo.toml
third_party/rust/serde_derive/README.md
third_party/rust/serde_derive/crates-io.md
third_party/rust/serde_derive/src/bound.rs
third_party/rust/serde_derive/src/de.rs
third_party/rust/serde_derive/src/fragment.rs
third_party/rust/serde_derive/src/internals/ast.rs
third_party/rust/serde_derive/src/internals/attr.rs
third_party/rust/serde_derive/src/internals/check.rs
third_party/rust/serde_derive/src/internals/mod.rs
third_party/rust/serde_derive/src/lib.rs
third_party/rust/serde_derive/src/pretend.rs
third_party/rust/serde_derive/src/ser.rs
third_party/rust/serde_derive/src/try.rs
third_party/rust/syn-0.13.1/.cargo-checksum.json
third_party/rust/syn-0.13.1/Cargo.toml
third_party/rust/syn-0.13.1/LICENSE-APACHE
third_party/rust/syn-0.13.1/LICENSE-MIT
third_party/rust/syn-0.13.1/README.md
third_party/rust/syn-0.13.1/src/attr.rs
third_party/rust/syn-0.13.1/src/buffer.rs
third_party/rust/syn-0.13.1/src/data.rs
third_party/rust/syn-0.13.1/src/derive.rs
third_party/rust/syn-0.13.1/src/error.rs
third_party/rust/syn-0.13.1/src/expr.rs
third_party/rust/syn-0.13.1/src/file.rs
third_party/rust/syn-0.13.1/src/gen/fold.rs
third_party/rust/syn-0.13.1/src/gen/visit.rs
third_party/rust/syn-0.13.1/src/gen/visit_mut.rs
third_party/rust/syn-0.13.1/src/gen_helper.rs
third_party/rust/syn-0.13.1/src/generics.rs
third_party/rust/syn-0.13.1/src/ident.rs
third_party/rust/syn-0.13.1/src/item.rs
third_party/rust/syn-0.13.1/src/lib.rs
third_party/rust/syn-0.13.1/src/lifetime.rs
third_party/rust/syn-0.13.1/src/lit.rs
third_party/rust/syn-0.13.1/src/mac.rs
third_party/rust/syn-0.13.1/src/macros.rs
third_party/rust/syn-0.13.1/src/op.rs
third_party/rust/syn-0.13.1/src/parse_quote.rs
third_party/rust/syn-0.13.1/src/parsers.rs
third_party/rust/syn-0.13.1/src/path.rs
third_party/rust/syn-0.13.1/src/punctuated.rs
third_party/rust/syn-0.13.1/src/spanned.rs
third_party/rust/syn-0.13.1/src/synom.rs
third_party/rust/syn-0.13.1/src/token.rs
third_party/rust/syn-0.13.1/src/tt.rs
third_party/rust/syn-0.13.1/src/ty.rs
third_party/rust/syn/.cargo-checksum.json
third_party/rust/syn/Cargo.toml
third_party/rust/syn/README.md
third_party/rust/syn/src/attr.rs
third_party/rust/syn/src/buffer.rs
third_party/rust/syn/src/data.rs
third_party/rust/syn/src/derive.rs
third_party/rust/syn/src/error.rs
third_party/rust/syn/src/expr.rs
third_party/rust/syn/src/file.rs
third_party/rust/syn/src/gen/fold.rs
third_party/rust/syn/src/gen/visit.rs
third_party/rust/syn/src/gen/visit_mut.rs
third_party/rust/syn/src/gen_helper.rs
third_party/rust/syn/src/generics.rs
third_party/rust/syn/src/ident.rs
third_party/rust/syn/src/item.rs
third_party/rust/syn/src/lib.rs
third_party/rust/syn/src/lifetime.rs
third_party/rust/syn/src/lit.rs
third_party/rust/syn/src/mac.rs
third_party/rust/syn/src/macros.rs
third_party/rust/syn/src/op.rs
third_party/rust/syn/src/parse_quote.rs
third_party/rust/syn/src/parsers.rs
third_party/rust/syn/src/path.rs
third_party/rust/syn/src/punctuated.rs
third_party/rust/syn/src/spanned.rs
third_party/rust/syn/src/synom.rs
third_party/rust/syn/src/token.rs
third_party/rust/syn/src/tt.rs
third_party/rust/syn/src/ty.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,17 +29,17 @@ dependencies = [
 ]
 
 [[package]]
 name = "app_units"
 version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "arrayvec"
 version = "0.4.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -87,18 +87,18 @@ dependencies = [
  "cubeb 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
  "tokio-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "audioipc-client"
 version = "0.4.0"
@@ -146,17 +146,17 @@ version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "bincode"
 version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "bindgen"
 version = "0.33.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -578,18 +578,18 @@ source = "registry+https://github.com/ru
 
 [[package]]
 name = "docopt"
 version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
  "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "dtoa"
 version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
@@ -605,18 +605,18 @@ dependencies = [
 name = "dwrote"
 version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "either"
 version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
@@ -669,17 +669,17 @@ version = "0.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "euclid"
 version = "0.17.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "fallible"
 version = "0.0.1"
 dependencies = [
  "hashglobe 0.1.0",
  "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1013,18 +1013,18 @@ dependencies = [
  "docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "ena 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "lalrpop-snap 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lalrpop-util 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "petgraph 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
  "string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "lalrpop-intern"
 version = "0.15.1"
@@ -1593,16 +1593,24 @@ version = "0.0.1"
 name = "proc-macro2"
 version = "0.3.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "proc-macro2"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "procedural-masquerade"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "pulse"
 version = "0.2.0"
 dependencies = [
@@ -1631,16 +1639,24 @@ source = "registry+https://github.com/ru
 name = "quote"
 version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "quote"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "rand"
 version = "0.3.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1707,17 +1723,17 @@ dependencies = [
  "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "ron"
 version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rsdparsa"
 version = "0.1.0"
 
 [[package]]
 name = "rsdparsa_capi"
@@ -1793,38 +1809,38 @@ dependencies = [
 
 [[package]]
 name = "semver-parser"
 version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "serde"
-version = "1.0.58"
+version = "1.0.66"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
 ]
 
 [[package]]
 name = "serde_bytes"
 version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.58"
-source = "git+https://github.com/servo/serde?branch=deserialize_from_enums7#884e8078a9c74314fa4a5a2e6ce4ac67ab8fa415"
+version = "1.0.66"
+source = "git+https://github.com/servo/serde?branch=deserialize_from_enums8#c4457d804b38b14e699b45c01d1909f93f25ab5e"
 dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "servo_arc"
 version = "0.1.1"
 dependencies = [
  "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1868,17 +1884,17 @@ source = "registry+https://github.com/ru
 name = "string_cache"
 version = "0.7.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
  "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "string_cache_codegen"
 version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2005,16 +2021,26 @@ version = "0.13.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "syn"
+version = "0.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "synstructure"
 version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2129,17 +2155,17 @@ dependencies = [
  "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "toml"
 version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "traitobject"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -2315,17 +2341,17 @@ dependencies = [
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "plane-split 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender_api 0.57.2",
 ]
 
 [[package]]
 name = "webrender_api"
@@ -2334,19 +2360,19 @@ dependencies = [
  "app_units 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)",
+ "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "webrender_bindings"
 version = "0.1.0"
 dependencies = [
  "app_units 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2634,20 +2660,22 @@ dependencies = [
 "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f"
 "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03"
 "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2"
 "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
 "checksum plane-split 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7079b8485b4f9d9560dee7a69ca8f6ca781f9f284ff9d2bf27255d440b03e4af"
 "checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0"
 "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
 "checksum proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118"
+"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6"
 "checksum procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260"
 "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
 "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
+"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
 "checksum rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd"
 "checksum rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "485541959c8ecc49865526fe6c4de9653dd6e60d829d6edf0be228167b60372d"
 "checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8"
 "checksum redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "ab105df655884ede59d45b7070c8a65002d921461ee813a024558ca16030eea0"
 "checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
 "checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3"
 "checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
 "checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b"
@@ -2656,31 +2684,32 @@ dependencies = [
 "checksum rust-ini 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8a654c5bda722c699be6b0fe4c0d90de218928da5b724c3e467fc48865c37263"
 "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
 "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
 "checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637"
 "checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
 "checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918"
 "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537"
 "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-"checksum serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "34e9df8efbe7a2c12ceec1fc8744d56ae3374d8ae325f4a0028949d16433d554"
+"checksum serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)" = "e9a2d9a9ac5120e0f768801ca2b58ad6eec929dc9d1d616c162f208869c2ce95"
 "checksum serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "adb6e51a6b3696b301bc221d785f898b4457c619b51d7ce195a6d20baecb37b3"
-"checksum serde_derive 1.0.58 (git+https://github.com/servo/serde?branch=deserialize_from_enums7)" = "<none>"
+"checksum serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)" = "<none>"
 "checksum simd 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ed3686dd9418ebcc3a26a0c0ae56deab0681e53fe899af91f5bbcee667ebffb1"
 "checksum siphasher 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ffc669b726f2bc9a3bcff66e5e23b56ba6bf70e22a34c3d7b6d0b3450b65b84"
 "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
 "checksum smallbitvec 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c63726029f0069f88467873e47f392575f28f9f16b72ac65465263db4b3a13c"
 "checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9"
 "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b"
 "checksum string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25d70109977172b127fe834e5449e5ab1740b9ba49fa18a2020f509174f25423"
 "checksum string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479cde50c3539481f33906a387f2bd17c8e87cb848c35b6021d41fb81ff9b4d7"
 "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc"
 "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
 "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
 "checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59"
+"checksum syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c67da57e61ebc7b7b6fff56bb34440ca3a83db037320b0507af4c10368deda7d"
 "checksum synstructure 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "98cad891cd238c98e1f0aec9f7c0f620aa696e4e5f7daba56ac67b5e86a6b049"
 "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
 "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
 "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
 "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
 "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
 "checksum thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf947d192a9be60ef5131cc7a4648886ba89d712f16700ebbf80c8a69d05d48f"
copy from third_party/rust/proc-macro2/.cargo-checksum.json
copy to third_party/rust/proc-macro2-0.3.6/.cargo-checksum.json
copy from third_party/rust/proc-macro2/.travis.yml
copy to third_party/rust/proc-macro2-0.3.6/.travis.yml
copy from third_party/rust/proc-macro2/Cargo.toml
copy to third_party/rust/proc-macro2-0.3.6/Cargo.toml
new file mode 100644
--- /dev/null
+++ b/third_party/rust/proc-macro2-0.3.6/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.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/proc-macro2-0.3.6/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
copy from third_party/rust/proc-macro2/README.md
copy to third_party/rust/proc-macro2-0.3.6/README.md
copy from third_party/rust/proc-macro2/src/lib.rs
copy to third_party/rust/proc-macro2-0.3.6/src/lib.rs
copy from third_party/rust/proc-macro2/src/stable.rs
copy to third_party/rust/proc-macro2-0.3.6/src/stable.rs
copy from third_party/rust/proc-macro2/src/strnom.rs
copy to third_party/rust/proc-macro2-0.3.6/src/strnom.rs
copy from third_party/rust/proc-macro2/src/unstable.rs
copy to third_party/rust/proc-macro2-0.3.6/src/unstable.rs
copy from third_party/rust/proc-macro2/tests/test.rs
copy to third_party/rust/proc-macro2-0.3.6/tests/test.rs
--- a/third_party/rust/proc-macro2/.cargo-checksum.json
+++ b/third_party/rust/proc-macro2/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".travis.yml":"872a0d195dcb1e84f28aa994f301c7139f70360bb42dee3954df5ee965efea15","Cargo.toml":"6ed5d7b9bf8805abd76f9e2a9be99b98e2cb70d9b97980b8aa09b6082d26a94d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ce05336717e1e90724491a2f54487c41c752fa2d32396639439f7c6d0f1e6776","src/lib.rs":"e99fedcb4b410c626fe1a3ab722c8b4f98baed2c64c2dff28c4eb62da354f2e2","src/stable.rs":"fd8d86f7542d211030056a7cdcc58b86131180d54f461910a4a067269eee9d4a","src/strnom.rs":"129fe22f0b50e5a64fca82e731c959135381c910e19f3305ef35420e0aadde08","src/unstable.rs":"b43c713ac16d9de0ba0fa1b9bebe390122b4ad60ef2fc75408f721305fdcd46b","tests/test.rs":"a8229931093cd6b39f759c60ef097e59bc43c98f1b0e5eea06ecc8d5d0879853"},"package":"49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118"}
\ No newline at end of file
+{"files":{".travis.yml":"a7e89030a6a25e881fd6ccc0f065e2990eb408e26a9cbdcdf7a73b201285ab0f","Cargo.toml":"a07d0acb6f3035bbd30180e3493f8ad05f5e8ceed8970e00ee3e3ce4c3427a0a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"261fb7bbe050bbff8a8e33da68926b44cd1bbd2b1e8b655d19ae681b8fff3c6e","src/lib.rs":"8fa6ba7df93c3ee57163f406f73fb5efa2b41709b7d27d25a46629038cabf339","src/stable.rs":"c325eadc1f0a78c55117589e6bacb72dd295ccd02cb3e2dea13e1381ad2e972e","src/strnom.rs":"807c377bdb49b8b1c67d013089b8ff33fe93ffd3fa36b6440dbb1d6fe8cd9c17","src/unstable.rs":"69ce792a9d8a9caeb43f598923f34c986628f3416355e118f256263afe870e13","tests/test.rs":"40486961d171ea6312cf46c63834738e2bec07fee9badb677ffa28073cc09e8d"},"package":"effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6"}
\ No newline at end of file
--- a/third_party/rust/proc-macro2/.travis.yml
+++ b/third_party/rust/proc-macro2/.travis.yml
@@ -2,31 +2,26 @@ language: rust
 sudo: false
 
 matrix:
   include:
     - rust: 1.15.0
     - rust: stable
     - rust: beta
     - rust: nightly
-      before_script:
-        - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
       script:
         - cargo test
-        - cargo build --features nightly
-        - cargo build --no-default-features
+        - cargo test --features nightly
+        - cargo test --no-default-features
         - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
-        - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --features nightly
-        - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo doc --no-deps
-      after_success:
-        - travis-cargo --only nightly doc-upload
+        - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --features nightly
+        - cargo update -Z minimal-versions && cargo build
+
+before_script:
+  - set -o errexit
 
 script:
   - cargo test
   - RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test
-env:
-  global:
-    - TRAVIS_CARGO_NIGHTLY_FEATURE=""
-    - secure: "NAsZghAVTAksrm4WP4I66VmD2wW0eRbwB+ZKHUQfvbgUaCRvVdp4WBbWXGU/f/yHgDFWZwljWR4iPMiBwAK8nZsQFRuLFdHrOOHqbkj639LLdT9A07s1zLMB1GfR1fDttzrGhm903pbT2yxSyqqpahGYM7TaGDYYmKYIk4XyVNA5F5Sk7RI+rCecKraoYDeUEFbjWWYtU2FkEXsELEKj0emX5reWkR+wja3QokFcRZ25+Zd2dRC0K8W5QcY2UokLzKncBMCTC5q70H616S3r/9qW67Si1njsJ7RzP0NlZQUNQ/VCvwr4LCr9w+AD9i1SZtXxuux77tWEWSJvBzUc82dDMUv/floJuF7HTulSxxQoRm+fbzpXj9mgaJNiUHXru6ZRTCRVRUSXpcAco94bVoy/jnjrTe3jgAIZK5w14zA8yLw1Jxof31DlbcWORxgF+6fnY2nKPRN2oiQ50+jm1AuGDZX59/wMiu1QlkjOBHtikHp+u+7mp3SkkM04DvuQ/tWODQQnOOtrA0EB3i5H1zeTSnUcmbJufUljWWOvF1QYII08MccqwfG1KWbpobvdu+cV2iVhkq/lNCEL3Ai101CnmSCnMz+9oK/XxYOrx2TnaD9ootOKgnk7XWxF19GZecQx6O2hHTouxvB/0KcRPGWmMWl0H88f3T/Obql8bG8="
 
 notifications:
   email:
     on_success: never
--- a/third_party/rust/proc-macro2/Cargo.toml
+++ b/third_party/rust/proc-macro2/Cargo.toml
@@ -7,25 +7,27 @@
 #
 # 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 = "proc-macro2"
-version = "0.3.6"
+version = "0.4.6"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 description = "A stable implementation of the upcoming new `proc_macro` API. Comes with an\noption, off by default, to also reimplement itself in terms of the upstream\nunstable API.\n"
 homepage = "https://github.com/alexcrichton/proc-macro2"
 documentation = "https://docs.rs/proc-macro2"
 readme = "README.md"
 keywords = ["macros"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/alexcrichton/proc-macro2"
+[package.metadata.docs.rs]
+rustdoc-args = ["--cfg", "procmacro2_semver_exempt"]
 
 [lib]
 doctest = false
 [dependencies.unicode-xid]
 version = "0.1"
 
 [features]
 default = ["proc-macro"]
--- a/third_party/rust/proc-macro2/README.md
+++ b/third_party/rust/proc-macro2/README.md
@@ -12,27 +12,27 @@ interface][upcoming].
 
 The upcoming support has features like:
 
 * Span information on tokens
 * No need to go in/out through strings
 * Structured input/output
 
 The hope is that libraries ported to `proc_macro2` will be trivial to port to
-the real `proc_macro` crate once the support on nightly is stabilize.
+the real `proc_macro` crate once the support on nightly is stabilized.
 
 ## Usage
 
 This crate by default compiles on the stable version of the compiler. It only
 uses the stable surface area of the `proc_macro` crate upstream in the compiler
 itself. Usage is done via:
 
 ```toml
 [dependencies]
-proc-macro2 = "0.3"
+proc-macro2 = "0.4"
 ```
 
 followed by
 
 ```rust
 extern crate proc_macro;
 extern crate proc_macro2;
 
@@ -52,17 +52,17 @@ If you'd like you can enable the `nightl
 cause it to compile against the **unstable and nightly-only** features of the
 `proc_macro` crate. This in turn requires a nightly compiler. This should help
 preserve span information, however, coming in from the compiler itself.
 
 You can enable this feature via:
 
 ```toml
 [dependencies]
-proc-macro2 = { version = "0.3", features = ["nightly"] }
+proc-macro2 = { version = "0.4", features = ["nightly"] }
 ```
 
 
 ## Unstable Features
 
 `proc-macro2` supports exporting some methods from `proc_macro` which are
 currently highly unstable, and may not be stabilized in the first pass of
 `proc_macro` stabilizations. These features are not exported by default. Minor
--- a/third_party/rust/proc-macro2/src/lib.rs
+++ b/third_party/rust/proc-macro2/src/lib.rs
@@ -15,74 +15,122 @@
 //! to use this crate will be trivially able to switch to the upstream
 //! `proc_macro` crate once its API stabilizes.
 //!
 //! In the meantime this crate also has a `nightly` Cargo feature which
 //! enables it to reimplement itself with the unstable API of [`proc_macro`].
 //! This'll allow immediate usage of the beneficial upstream API, particularly
 //! around preserving span information.
 //!
+//! # Unstable Features
+//!
+//! `proc-macro2` supports exporting some methods from `proc_macro` which are
+//! currently highly unstable, and may not be stabilized in the first pass of
+//! `proc_macro` stabilizations. These features are not exported by default.
+//! Minor versions of `proc-macro2` may make breaking changes to them at any
+//! time.
+//!
+//! To enable these features, the `procmacro2_semver_exempt` config flag must be
+//! passed to rustc.
+//!
+//! ```sh
+//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+//! ```
+//!
+//! Note that this must not only be done for your crate, but for any crate that
+//! depends on your crate. This infectious nature is intentional, as it serves
+//! as a reminder that you are outside of the normal semver guarantees.
+//!
 //! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/
 //! [ts]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html
 
 // Proc-macro2 types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/proc-macro2/0.3.6")]
+#![doc(html_root_url = "https://docs.rs/proc-macro2/0.4.6")]
 #![cfg_attr(feature = "nightly", feature(proc_macro))]
 
 #[cfg(feature = "proc-macro")]
 extern crate proc_macro;
-
-#[cfg(not(feature = "nightly"))]
 extern crate unicode_xid;
 
+use std::cmp::Ordering;
 use std::fmt;
+use std::hash::{Hash, Hasher};
 use std::iter::FromIterator;
 use std::marker;
 use std::rc::Rc;
 use std::str::FromStr;
 
 #[macro_use]
-#[cfg(not(feature = "nightly"))]
 mod strnom;
+mod stable;
 
-#[path = "stable.rs"]
 #[cfg(not(feature = "nightly"))]
-mod imp;
+use stable as imp;
 #[path = "unstable.rs"]
 #[cfg(feature = "nightly")]
 mod imp;
 
+/// An abstract stream of tokens, or more concretely a sequence of token trees.
+///
+/// This type provides interfaces for iterating over token trees and for
+/// collecting token trees into one stream.
+///
+/// Token stream is both the input and output of `#[proc_macro]`,
+/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions.
 #[derive(Clone)]
 pub struct TokenStream {
     inner: imp::TokenStream,
     _marker: marker::PhantomData<Rc<()>>,
 }
 
+/// Error returned from `TokenStream::from_str`.
 pub struct LexError {
     inner: imp::LexError,
     _marker: marker::PhantomData<Rc<()>>,
 }
 
 impl TokenStream {
     fn _new(inner: imp::TokenStream) -> TokenStream {
         TokenStream {
             inner: inner,
             _marker: marker::PhantomData,
         }
     }
 
-    pub fn empty() -> TokenStream {
-        TokenStream::_new(imp::TokenStream::empty())
+    fn _new_stable(inner: stable::TokenStream) -> TokenStream {
+        TokenStream {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
     }
 
+    /// Returns an empty `TokenStream` containing no token trees.
+    pub fn new() -> TokenStream {
+        TokenStream::_new(imp::TokenStream::new())
+    }
+
+    #[deprecated(since = "0.4.4", note = "please use TokenStream::new")]
+    pub fn empty() -> TokenStream {
+        TokenStream::new()
+    }
+
+    /// Checks if this `TokenStream` is empty.
     pub fn is_empty(&self) -> bool {
         self.inner.is_empty()
     }
 }
 
+/// Attempts to break the string into tokens and parse those tokens into a token
+/// stream.
+///
+/// May fail for a number of reasons, for example, if the string contains
+/// unbalanced delimiters or characters not existing in the language.
+///
+/// NOTE: Some errors may cause panics instead of returning `LexError`. We
+/// reserve the right to change these errors into `LexError`s later.
 impl FromStr for TokenStream {
     type Err = LexError;
 
     fn from_str(src: &str) -> Result<TokenStream, LexError> {
         let e = src.parse().map_err(|e| LexError {
             inner: e,
             _marker: marker::PhantomData,
         })?;
@@ -99,55 +147,84 @@ impl From<proc_macro::TokenStream> for T
 
 #[cfg(feature = "proc-macro")]
 impl From<TokenStream> for proc_macro::TokenStream {
     fn from(inner: TokenStream) -> proc_macro::TokenStream {
         inner.inner.into()
     }
 }
 
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams)
+    }
+}
+
+/// Collects a number of token trees into a single stream.
 impl FromIterator<TokenTree> for TokenStream {
     fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
         TokenStream::_new(streams.into_iter().collect())
     }
 }
 
+/// Prints the token stream as a string that is supposed to be losslessly
+/// convertible back into the same token stream (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
 impl fmt::Display for TokenStream {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
+/// Prints token in a form convenient for debugging.
 impl fmt::Debug for TokenStream {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
 impl fmt::Debug for LexError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
 // Returned by reference, so we can't easily wrap it.
 #[cfg(procmacro2_semver_exempt)]
 pub use imp::FileName;
 
+/// The source file of a given `Span`.
+///
+/// This type is semver exempt and not exposed by default.
 #[cfg(procmacro2_semver_exempt)]
 #[derive(Clone, PartialEq, Eq)]
 pub struct SourceFile(imp::SourceFile);
 
 #[cfg(procmacro2_semver_exempt)]
 impl SourceFile {
-    /// Get the path to this source file as a string.
+    /// Get the path to this source file.
+    ///
+    /// ### Note
+    ///
+    /// If the code span associated with this `SourceFile` was generated by an
+    /// external macro, this may not be an actual path on the filesystem. Use
+    /// [`is_real`] to check.
+    ///
+    /// Also note that even if `is_real` returns `true`, if
+    /// `--remap-path-prefix` was passed on the command line, the path as given
+    /// may not actually be valid.
+    ///
+    /// [`is_real`]: #method.is_real
     pub fn path(&self) -> &FileName {
         self.0.path()
     }
 
+    /// Returns `true` if this source file is a real source file, and not
+    /// generated by an external macro's expansion.
     pub fn is_real(&self) -> bool {
         self.0.is_real()
     }
 }
 
 #[cfg(procmacro2_semver_exempt)]
 impl AsRef<FileName> for SourceFile {
     fn as_ref(&self) -> &FileName {
@@ -157,337 +234,708 @@ impl AsRef<FileName> for SourceFile {
 
 #[cfg(procmacro2_semver_exempt)]
 impl fmt::Debug for SourceFile {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.0.fmt(f)
     }
 }
 
+/// A line-column pair representing the start or end of a `Span`.
+///
+/// This type is semver exempt and not exposed by default.
 #[cfg(procmacro2_semver_exempt)]
 pub struct LineColumn {
+    /// The 1-indexed line in the source file on which the span starts or ends
+    /// (inclusive).
     pub line: usize,
+    /// The 0-indexed column (in UTF-8 characters) in the source file on which
+    /// the span starts or ends (inclusive).
     pub column: usize,
 }
 
+/// A region of source code, along with macro expansion information.
 #[derive(Copy, Clone)]
 pub struct Span {
     inner: imp::Span,
     _marker: marker::PhantomData<Rc<()>>,
 }
 
 impl Span {
     fn _new(inner: imp::Span) -> Span {
         Span {
             inner: inner,
             _marker: marker::PhantomData,
         }
     }
 
+    fn _new_stable(inner: stable::Span) -> Span {
+        Span {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
+    }
+
+    /// The span of the invocation of the current procedural macro.
+    ///
+    /// Identifiers created with this span will be resolved as if they were
+    /// written directly at the macro call location (call-site hygiene) and
+    /// other code at the macro call site will be able to refer to them as well.
     pub fn call_site() -> Span {
         Span::_new(imp::Span::call_site())
     }
 
+    /// A span that resolves at the macro definition site.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn def_site() -> Span {
         Span::_new(imp::Span::def_site())
     }
 
     /// Creates a new span with the same line/column information as `self` but
     /// that resolves symbols as though it were at `other`.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn resolved_at(&self, other: Span) -> Span {
         Span::_new(self.inner.resolved_at(other.inner))
     }
 
     /// Creates a new span with the same name resolution behavior as `self` but
     /// with the line/column information of `other`.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn located_at(&self, other: Span) -> Span {
         Span::_new(self.inner.located_at(other.inner))
     }
 
     /// This method is only available when the `"nightly"` feature is enabled.
     #[cfg(all(feature = "nightly", feature = "proc-macro"))]
     pub fn unstable(self) -> proc_macro::Span {
         self.inner.unstable()
     }
 
+    /// The original source file into which this span points.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn source_file(&self) -> SourceFile {
         SourceFile(self.inner.source_file())
     }
 
+    /// Get the starting line/column in the source file for this span.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn start(&self) -> LineColumn {
         let imp::LineColumn { line, column } = self.inner.start();
         LineColumn {
             line: line,
             column: column,
         }
     }
 
+    /// Get the ending line/column in the source file for this span.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn end(&self) -> LineColumn {
         let imp::LineColumn { line, column } = self.inner.end();
         LineColumn {
             line: line,
             column: column,
         }
     }
 
+    /// Create a new span encompassing `self` and `other`.
+    ///
+    /// Returns `None` if `self` and `other` are from different files.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn join(&self, other: Span) -> Option<Span> {
         self.inner.join(other.inner).map(Span::_new)
     }
 
+    /// Compares to spans to see if they're equal.
+    ///
+    /// This method is semver exempt and not exposed by default.
     #[cfg(procmacro2_semver_exempt)]
     pub fn eq(&self, other: &Span) -> bool {
         self.inner.eq(&other.inner)
     }
 }
 
+/// Prints a span in a form convenient for debugging.
 impl fmt::Debug for Span {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
-#[derive(Clone, Debug)]
+/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`).
+#[derive(Clone)]
 pub enum TokenTree {
+    /// A token stream surrounded by bracket delimiters.
     Group(Group),
-    Term(Term),
-    Op(Op),
+    /// An identifier.
+    Ident(Ident),
+    /// A single punctuation character (`+`, `,`, `$`, etc.).
+    Punct(Punct),
+    /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc.
     Literal(Literal),
 }
 
 impl TokenTree {
+    /// Returns the span of this tree, delegating to the `span` method of
+    /// the contained token or a delimited stream.
     pub fn span(&self) -> Span {
         match *self {
             TokenTree::Group(ref t) => t.span(),
-            TokenTree::Term(ref t) => t.span(),
-            TokenTree::Op(ref t) => t.span(),
+            TokenTree::Ident(ref t) => t.span(),
+            TokenTree::Punct(ref t) => t.span(),
             TokenTree::Literal(ref t) => t.span(),
         }
     }
 
+    /// Configures the span for *only this token*.
+    ///
+    /// Note that if this token is a `Group` then this method will not configure
+    /// the span of each of the internal tokens, this will simply delegate to
+    /// the `set_span` method of each variant.
     pub fn set_span(&mut self, span: Span) {
         match *self {
             TokenTree::Group(ref mut t) => t.set_span(span),
-            TokenTree::Term(ref mut t) => t.set_span(span),
-            TokenTree::Op(ref mut t) => t.set_span(span),
+            TokenTree::Ident(ref mut t) => t.set_span(span),
+            TokenTree::Punct(ref mut t) => t.set_span(span),
             TokenTree::Literal(ref mut t) => t.set_span(span),
         }
     }
 }
 
 impl From<Group> for TokenTree {
     fn from(g: Group) -> TokenTree {
         TokenTree::Group(g)
     }
 }
 
-impl From<Term> for TokenTree {
-    fn from(g: Term) -> TokenTree {
-        TokenTree::Term(g)
+impl From<Ident> for TokenTree {
+    fn from(g: Ident) -> TokenTree {
+        TokenTree::Ident(g)
     }
 }
 
-impl From<Op> for TokenTree {
-    fn from(g: Op) -> TokenTree {
-        TokenTree::Op(g)
+impl From<Punct> for TokenTree {
+    fn from(g: Punct) -> TokenTree {
+        TokenTree::Punct(g)
     }
 }
 
 impl From<Literal> for TokenTree {
     fn from(g: Literal) -> TokenTree {
         TokenTree::Literal(g)
     }
 }
 
+/// Prints the token tree as a string that is supposed to be losslessly
+/// convertible back into the same token tree (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
 impl fmt::Display for TokenTree {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
             TokenTree::Group(ref t) => t.fmt(f),
-            TokenTree::Term(ref t) => t.fmt(f),
-            TokenTree::Op(ref t) => t.fmt(f),
+            TokenTree::Ident(ref t) => t.fmt(f),
+            TokenTree::Punct(ref t) => t.fmt(f),
             TokenTree::Literal(ref t) => t.fmt(f),
         }
     }
 }
 
-#[derive(Clone, Debug)]
+/// Prints token tree in a form convenient for debugging.
+impl fmt::Debug for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Each of these has the name in the struct type in the derived debug,
+        // so don't bother with an extra layer of indirection
+        match *self {
+            TokenTree::Group(ref t) => t.fmt(f),
+            TokenTree::Ident(ref t) => {
+                let mut debug = f.debug_struct("Ident");
+                debug.field("sym", &format_args!("{}", t));
+                #[cfg(any(feature = "nightly", procmacro2_semver_exempt))]
+                debug.field("span", &t.span());
+                debug.finish()
+            }
+            TokenTree::Punct(ref t) => t.fmt(f),
+            TokenTree::Literal(ref t) => t.fmt(f),
+        }
+    }
+}
+
+/// A delimited token stream.
+///
+/// A `Group` internally contains a `TokenStream` which is surrounded by
+/// `Delimiter`s.
+#[derive(Clone)]
 pub struct Group {
     delimiter: Delimiter,
     stream: TokenStream,
     span: Span,
 }
 
+/// Describes how a sequence of token trees is delimited.
 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
 pub enum Delimiter {
+    /// `( ... )`
     Parenthesis,
+    /// `{ ... }`
     Brace,
+    /// `[ ... ]`
     Bracket,
+    /// `Ø ... Ø`
+    ///
+    /// An implicit delimiter, that may, for example, appear around tokens
+    /// coming from a "macro variable" `$var`. It is important to preserve
+    /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`.
+    /// Implicit delimiters may not survive roundtrip of a token stream through
+    /// a string.
     None,
 }
 
 impl Group {
+    /// Creates a new `Group` with the given delimiter and token stream.
+    ///
+    /// This constructor will set the span for this group to
+    /// `Span::call_site()`. To change the span you can use the `set_span`
+    /// method below.
     pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group {
         Group {
             delimiter: delimiter,
             stream: stream,
             span: Span::call_site(),
         }
     }
 
+    /// Returns the delimiter of this `Group`
     pub fn delimiter(&self) -> Delimiter {
         self.delimiter
     }
 
+    /// Returns the `TokenStream` of tokens that are delimited in this `Group`.
+    ///
+    /// Note that the returned token stream does not include the delimiter
+    /// returned above.
     pub fn stream(&self) -> TokenStream {
         self.stream.clone()
     }
 
+    /// Returns the span for the delimiters of this token stream, spanning the
+    /// entire `Group`.
     pub fn span(&self) -> Span {
         self.span
     }
 
+    /// Configures the span for this `Group`'s delimiters, but not its internal
+    /// tokens.
+    ///
+    /// This method will **not** set the span of all the internal tokens spanned
+    /// by this group, but rather it will only set the span of the delimiter
+    /// tokens at the level of the `Group`.
     pub fn set_span(&mut self, span: Span) {
         self.span = span;
     }
 }
 
+/// Prints the group as a string that should be losslessly convertible back
+/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
+/// with `Delimiter::None` delimiters.
 impl fmt::Display for Group {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.stream.fmt(f)
+        let (left, right) = match self.delimiter {
+            Delimiter::Parenthesis => ("(", ")"),
+            Delimiter::Brace => ("{", "}"),
+            Delimiter::Bracket => ("[", "]"),
+            Delimiter::None => ("", ""),
+        };
+
+        f.write_str(left)?;
+        self.stream.fmt(f)?;
+        f.write_str(right)?;
+
+        Ok(())
     }
 }
 
-#[derive(Copy, Clone, Debug)]
-pub struct Op {
+impl fmt::Debug for Group {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Group");
+        debug.field("delimiter", &self.delimiter);
+        debug.field("stream", &self.stream);
+        #[cfg(procmacro2_semver_exempt)]
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+/// An `Punct` is an single punctuation character like `+`, `-` or `#`.
+///
+/// Multicharacter operators like `+=` are represented as two instances of
+/// `Punct` with different forms of `Spacing` returned.
+#[derive(Clone)]
+pub struct Punct {
     op: char,
     spacing: Spacing,
     span: Span,
 }
 
+/// Whether an `Punct` is followed immediately by another `Punct` or followed by
+/// another token or whitespace.
 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
 pub enum Spacing {
+    /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`.
     Alone,
+    /// E.g. `+` is `Joint` in `+=` or `'#`.
+    ///
+    /// Additionally, single quote `'` can join with identifiers to form
+    /// lifetimes `'ident`.
     Joint,
 }
 
-impl Op {
-    pub fn new(op: char, spacing: Spacing) -> Op {
-        Op {
+impl Punct {
+    /// Creates a new `Punct` from the given character and spacing.
+    ///
+    /// The `ch` argument must be a valid punctuation character permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// The returned `Punct` will have the default span of `Span::call_site()`
+    /// which can be further configured with the `set_span` method below.
+    pub fn new(op: char, spacing: Spacing) -> Punct {
+        Punct {
             op: op,
             spacing: spacing,
             span: Span::call_site(),
         }
     }
 
-    pub fn op(&self) -> char {
+    /// Returns the value of this punctuation character as `char`.
+    pub fn as_char(&self) -> char {
         self.op
     }
 
+    /// Returns the spacing of this punctuation character, indicating whether
+    /// it's immediately followed by another `Punct` in the token stream, so
+    /// they can potentially be combined into a multicharacter operator
+    /// (`Joint`), or it's followed by some other token or whitespace (`Alone`)
+    /// so the operator has certainly ended.
     pub fn spacing(&self) -> Spacing {
         self.spacing
     }
 
+    /// Returns the span for this punctuation character.
     pub fn span(&self) -> Span {
         self.span
     }
 
+    /// Configure the span for this punctuation character.
     pub fn set_span(&mut self, span: Span) {
         self.span = span;
     }
 }
 
-impl fmt::Display for Op {
+/// Prints the punctuation character as a string that should be losslessly
+/// convertible back into the same character.
+impl fmt::Display for Punct {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.op.fmt(f)
     }
 }
 
-#[derive(Copy, Clone)]
-pub struct Term {
-    inner: imp::Term,
+impl fmt::Debug for Punct {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Punct");
+        debug.field("op", &self.op);
+        debug.field("spacing", &self.spacing);
+        #[cfg(procmacro2_semver_exempt)]
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+/// A word of Rust code, which may be a keyword or legal variable name.
+///
+/// An identifier consists of at least one Unicode code point, the first of
+/// which has the XID_Start property and the rest of which have the XID_Continue
+/// property.
+///
+/// - The empty string is not an identifier. Use `Option<Ident>`.
+/// - A lifetime is not an identifier. Use `syn::Lifetime` instead.
+///
+/// An identifier constructed with `Ident::new` is permitted to be a Rust
+/// keyword, though parsing one through its [`Synom`] implementation rejects
+/// Rust keywords. Use `call!(Ident::parse_any)` when parsing to match the
+/// behaviour of `Ident::new`.
+///
+/// [`Synom`]: https://docs.rs/syn/0.14/syn/synom/trait.Synom.html
+///
+/// # Examples
+///
+/// A new ident can be created from a string using the `Ident::new` function.
+/// A span must be provided explicitly which governs the name resolution
+/// behavior of the resulting identifier.
+///
+/// ```rust
+/// extern crate proc_macro2;
+///
+/// use proc_macro2::{Ident, Span};
+///
+/// fn main() {
+///     let call_ident = Ident::new("calligraphy", Span::call_site());
+///
+///     println!("{}", call_ident);
+/// }
+/// ```
+///
+/// An ident can be interpolated into a token stream using the `quote!` macro.
+///
+/// ```rust
+/// #[macro_use]
+/// extern crate quote;
+///
+/// extern crate proc_macro2;
+///
+/// use proc_macro2::{Ident, Span};
+///
+/// fn main() {
+///     let ident = Ident::new("demo", Span::call_site());
+///
+///     // Create a variable binding whose name is this ident.
+///     let expanded = quote! { let #ident = 10; };
+///
+///     // Create a variable binding with a slightly different name.
+///     let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+///     let expanded = quote! { let #temp_ident = 10; };
+/// }
+/// ```
+///
+/// A string representation of the ident is available through the `to_string()`
+/// method.
+///
+/// ```rust
+/// # extern crate proc_macro2;
+/// #
+/// # use proc_macro2::{Ident, Span};
+/// #
+/// # let ident = Ident::new("another_identifier", Span::call_site());
+/// #
+/// // Examine the ident as a string.
+/// let ident_string = ident.to_string();
+/// if ident_string.len() > 60 {
+///     println!("Very long identifier: {}", ident_string)
+/// }
+/// ```
+#[derive(Clone)]
+pub struct Ident {
+    inner: imp::Ident,
     _marker: marker::PhantomData<Rc<()>>,
 }
 
-impl Term {
-    fn _new(inner: imp::Term) -> Term {
-        Term {
+impl Ident {
+    fn _new(inner: imp::Ident) -> Ident {
+        Ident {
             inner: inner,
             _marker: marker::PhantomData,
         }
     }
 
-    pub fn new(string: &str, span: Span) -> Term {
-        Term::_new(imp::Term::new(string, span.inner))
+    /// Creates a new `Ident` with the given `string` as well as the specified
+    /// `span`.
+    ///
+    /// The `string` argument must be a valid identifier permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// Note that `span`, currently in rustc, configures the hygiene information
+    /// for this identifier.
+    ///
+    /// As of this time `Span::call_site()` explicitly opts-in to "call-site"
+    /// hygiene meaning that identifiers created with this span will be resolved
+    /// as if they were written directly at the location of the macro call, and
+    /// other code at the macro call site will be able to refer to them as well.
+    ///
+    /// Later spans like `Span::def_site()` will allow to opt-in to
+    /// "definition-site" hygiene meaning that identifiers created with this
+    /// span will be resolved at the location of the macro definition and other
+    /// code at the macro call site will not be able to refer to them.
+    ///
+    /// Due to the current importance of hygiene this constructor, unlike other
+    /// tokens, requires a `Span` to be specified at construction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the input string is neither a keyword nor a legal variable
+    /// name.
+    pub fn new(string: &str, span: Span) -> Ident {
+        Ident::_new(imp::Ident::new(string, span.inner))
     }
 
-    pub fn as_str(&self) -> &str {
-        self.inner.as_str()
+    /// Same as `Ident::new`, but creates a raw identifier (`r#ident`).
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new_raw(string, span)
     }
 
+    fn _new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new(imp::Ident::new_raw(string, span.inner))
+    }
+
+    /// Returns the span of this `Ident`.
     pub fn span(&self) -> Span {
         Span::_new(self.inner.span())
     }
 
+    /// Configures the span of this `Ident`, possibly changing its hygiene
+    /// context.
     pub fn set_span(&mut self, span: Span) {
         self.inner.set_span(span.inner);
     }
 }
 
-impl fmt::Display for Term {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.as_str().fmt(f)
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.to_string() == other.to_string()
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        self.to_string() == other.as_ref()
     }
 }
 
-impl fmt::Debug for Term {
+impl Eq for Ident {}
+
+impl PartialOrd for Ident {
+    fn partial_cmp(&self, other: &Ident) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Ident {
+    fn cmp(&self, other: &Ident) -> Ordering {
+        self.to_string().cmp(&other.to_string())
+    }
+}
+
+impl Hash for Ident {
+    fn hash<H: Hasher>(&self, hasher: &mut H) {
+        self.to_string().hash(hasher)
+    }
+}
+
+/// Prints the identifier as a string that should be losslessly convertible back
+/// into the same identifier.
+impl fmt::Display for Ident {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
+impl fmt::Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`),
+/// byte character (`b'a'`), an integer or floating point number with or without
+/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`).
+///
+/// Boolean literals like `true` and `false` do not belong here, they are
+/// `Ident`s.
 #[derive(Clone)]
 pub struct Literal {
     inner: imp::Literal,
     _marker: marker::PhantomData<Rc<()>>,
 }
 
-macro_rules! int_literals {
+macro_rules! suffixed_int_literals {
     ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new suffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1u32` where the integer
+        /// value specified is the first part of the token and the integral is
+        /// also suffixed at the end. Literals created from negative numbers may
+        /// not survive rountrips through `TokenStream` or strings and may be
+        /// broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new unsuffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1` where the integer
+        /// value specified is the first part of the token. No suffix is
+        /// specified on this token, meaning that invocations like
+        /// `Literal::i8_unsuffixed(1)` are equivalent to
+        /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers
+        /// may not survive rountrips through `TokenStream` or strings and may
+        /// be broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
         pub fn $name(n: $kind) -> Literal {
             Literal::_new(imp::Literal::$name(n))
         }
     )*)
 }
 
 impl Literal {
     fn _new(inner: imp::Literal) -> Literal {
         Literal {
             inner: inner,
             _marker: marker::PhantomData,
         }
     }
 
-    int_literals! {
+    fn _new_stable(inner: stable::Literal) -> Literal {
+        Literal {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
+    }
+
+    suffixed_int_literals! {
         u8_suffixed => u8,
         u16_suffixed => u16,
         u32_suffixed => u32,
         u64_suffixed => u64,
         usize_suffixed => usize,
         i8_suffixed => i8,
         i16_suffixed => i16,
         i32_suffixed => i32,
         i64_suffixed => i64,
         isize_suffixed => isize,
+    }
 
+    unsuffixed_int_literals! {
         u8_unsuffixed => u8,
         u16_unsuffixed => u16,
         u32_unsuffixed => u32,
         u64_unsuffixed => u64,
         usize_unsuffixed => usize,
         i8_unsuffixed => i8,
         i16_unsuffixed => i16,
         i32_unsuffixed => i32,
@@ -500,16 +948,29 @@ impl Literal {
         Literal::_new(imp::Literal::f64_unsuffixed(f))
     }
 
     pub fn f64_suffixed(f: f64) -> Literal {
         assert!(f.is_finite());
         Literal::_new(imp::Literal::f64_suffixed(f))
     }
 
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive rountrips through
+    /// `TokenStream` or strings and may be broken into two tokens (`-` and
+    /// positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
     pub fn f32_unsuffixed(f: f32) -> Literal {
         assert!(f.is_finite());
         Literal::_new(imp::Literal::f32_unsuffixed(f))
     }
 
     pub fn f32_suffixed(f: f32) -> Literal {
         assert!(f.is_finite());
         Literal::_new(imp::Literal::f32_suffixed(f))
@@ -543,25 +1004,30 @@ impl fmt::Debug for Literal {
 }
 
 impl fmt::Display for Literal {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.inner.fmt(f)
     }
 }
 
+/// Public implementation details for the `TokenStream` type, such as iterators.
 pub mod token_stream {
     use std::fmt;
     use std::marker;
     use std::rc::Rc;
 
+    use imp;
     pub use TokenStream;
     use TokenTree;
-    use imp;
 
+    /// An iterator over `TokenStream`'s `TokenTree`s.
+    ///
+    /// The iteration is "shallow", e.g. the iterator doesn't recurse into
+    /// delimited groups, and returns whole groups as token trees.
     pub struct IntoIter {
         inner: imp::TokenTreeIter,
         _marker: marker::PhantomData<Rc<()>>,
     }
 
     impl Iterator for IntoIter {
         type Item = TokenTree;
 
--- a/third_party/rust/proc-macro2/src/stable.rs
+++ b/third_party/rust/proc-macro2/src/stable.rs
@@ -1,36 +1,34 @@
 #![cfg_attr(not(procmacro2_semver_exempt), allow(dead_code))]
 
-use std::borrow::Borrow;
+#[cfg(procmacro2_semver_exempt)]
 use std::cell::RefCell;
 #[cfg(procmacro2_semver_exempt)]
 use std::cmp;
-use std::collections::HashMap;
 use std::fmt;
 use std::iter;
-use std::rc::Rc;
 use std::str::FromStr;
 use std::vec;
 
 use strnom::{block_comment, skip_whitespace, whitespace, word_break, Cursor, PResult};
 use unicode_xid::UnicodeXID;
 
-use {Delimiter, Group, Op, Spacing, TokenTree};
+use {Delimiter, Group, Punct, Spacing, TokenTree};
 
-#[derive(Clone, Debug)]
+#[derive(Clone)]
 pub struct TokenStream {
     inner: Vec<TokenTree>,
 }
 
 #[derive(Debug)]
 pub struct LexError;
 
 impl TokenStream {
-    pub fn empty() -> TokenStream {
+    pub fn new() -> TokenStream {
         TokenStream { inner: Vec::new() }
     }
 
     pub fn is_empty(&self) -> bool {
         self.inner.len() == 0
     }
 }
 
@@ -60,17 +58,17 @@ impl FromStr for TokenStream {
         // Create a dummy file & add it to the codemap
         let cursor = get_cursor(src);
 
         match token_stream(cursor) {
             Ok((input, output)) => {
                 if skip_whitespace(input).len() != 0 {
                     Err(LexError)
                 } else {
-                    Ok(output.inner)
+                    Ok(output)
                 }
             }
             Err(LexError) => Err(LexError),
         }
     }
 }
 
 impl fmt::Display for TokenStream {
@@ -84,38 +82,45 @@ impl fmt::Display for TokenStream {
             match *tt {
                 TokenTree::Group(ref tt) => {
                     let (start, end) = match tt.delimiter() {
                         Delimiter::Parenthesis => ("(", ")"),
                         Delimiter::Brace => ("{", "}"),
                         Delimiter::Bracket => ("[", "]"),
                         Delimiter::None => ("", ""),
                     };
-                    if tt.stream().inner.inner.len() == 0 {
+                    if tt.stream().into_iter().next().is_none() {
                         write!(f, "{} {}", start, end)?
                     } else {
                         write!(f, "{} {} {}", start, tt.stream(), end)?
                     }
                 }
-                TokenTree::Term(ref tt) => write!(f, "{}", tt.as_str())?,
-                TokenTree::Op(ref tt) => {
-                    write!(f, "{}", tt.op())?;
+                TokenTree::Ident(ref tt) => write!(f, "{}", tt)?,
+                TokenTree::Punct(ref tt) => {
+                    write!(f, "{}", tt.as_char())?;
                     match tt.spacing() {
                         Spacing::Alone => {}
                         Spacing::Joint => joint = true,
                     }
                 }
                 TokenTree::Literal(ref tt) => write!(f, "{}", tt)?,
             }
         }
 
         Ok(())
     }
 }
 
+impl fmt::Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("TokenStream ")?;
+        f.debug_list().entries(self.clone()).finish()
+    }
+}
+
 #[cfg(feature = "proc-macro")]
 impl From<::proc_macro::TokenStream> for TokenStream {
     fn from(inner: ::proc_macro::TokenStream) -> TokenStream {
         inner
             .to_string()
             .parse()
             .expect("compiler token stream parse failed")
     }
@@ -144,75 +149,79 @@ impl iter::FromIterator<TokenTree> for T
         for token in streams.into_iter() {
             v.push(token);
         }
 
         TokenStream { inner: v }
     }
 }
 
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams);
+    }
+}
+
 pub type TokenTreeIter = vec::IntoIter<TokenTree>;
 
 impl IntoIterator for TokenStream {
     type Item = TokenTree;
     type IntoIter = TokenTreeIter;
 
     fn into_iter(self) -> TokenTreeIter {
         self.inner.into_iter()
     }
 }
 
-#[cfg(procmacro2_semver_exempt)]
 #[derive(Clone, PartialEq, Eq, Debug)]
 pub struct FileName(String);
 
-#[cfg(procmacro2_semver_exempt)]
+#[allow(dead_code)]
+pub fn file_name(s: String) -> FileName {
+    FileName(s)
+}
+
 impl fmt::Display for FileName {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.0.fmt(f)
     }
 }
 
-#[cfg(procmacro2_semver_exempt)]
 #[derive(Clone, PartialEq, Eq)]
 pub struct SourceFile {
     name: FileName,
 }
 
-#[cfg(procmacro2_semver_exempt)]
 impl SourceFile {
     /// Get the path to this source file as a string.
     pub fn path(&self) -> &FileName {
         &self.name
     }
 
     pub fn is_real(&self) -> bool {
         // XXX(nika): Support real files in the future?
         false
     }
 }
 
-#[cfg(procmacro2_semver_exempt)]
 impl AsRef<FileName> for SourceFile {
     fn as_ref(&self) -> &FileName {
         self.path()
     }
 }
 
-#[cfg(procmacro2_semver_exempt)]
 impl fmt::Debug for SourceFile {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.debug_struct("SourceFile")
             .field("path", &self.path())
             .field("is_real", &self.is_real())
             .finish()
     }
 }
 
-#[cfg(procmacro2_semver_exempt)]
 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
 pub struct LineColumn {
     pub line: usize,
     pub column: usize,
 }
 
 #[cfg(procmacro2_semver_exempt)]
 thread_local! {
@@ -309,17 +318,17 @@ impl Codemap {
             if file.span_within(span) {
                 return file;
             }
         }
         panic!("Invalid span with no related FileInfo!");
     }
 }
 
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+#[derive(Clone, Copy, PartialEq, Eq)]
 pub struct Span {
     #[cfg(procmacro2_semver_exempt)]
     lo: u32,
     #[cfg(procmacro2_semver_exempt)]
     hi: u32,
 }
 
 impl Span {
@@ -388,132 +397,139 @@ impl Span {
             Some(Span {
                 lo: cmp::min(self.lo, other.lo),
                 hi: cmp::max(self.hi, other.hi),
             })
         })
     }
 }
 
-#[derive(Copy, Clone)]
-pub struct Term {
-    intern: usize,
-    span: Span,
+impl fmt::Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        #[cfg(procmacro2_semver_exempt)]
+        return write!(f, "bytes({}..{})", self.lo, self.hi);
+
+        #[cfg(not(procmacro2_semver_exempt))]
+        write!(f, "Span")
+    }
 }
 
-thread_local!(static SYMBOLS: RefCell<Interner> = RefCell::new(Interner::new()));
+#[derive(Clone)]
+pub struct Ident {
+    sym: String,
+    span: Span,
+    raw: bool,
+}
 
-impl Term {
-    pub fn new(string: &str, span: Span) -> Term {
+impl Ident {
+    fn _new(string: &str, raw: bool, span: Span) -> Ident {
         validate_term(string);
 
-        Term {
-            intern: SYMBOLS.with(|s| s.borrow_mut().intern(string)),
+        Ident {
+            sym: string.to_owned(),
             span: span,
+            raw: raw,
         }
     }
 
-    pub fn as_str(&self) -> &str {
-        SYMBOLS.with(|interner| {
-            let interner = interner.borrow();
-            let s = interner.get(self.intern);
-            unsafe { &*(s as *const str) }
-        })
+    pub fn new(string: &str, span: Span) -> Ident {
+        Ident::_new(string, false, span)
+    }
+
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new(string, true, span)
     }
 
     pub fn span(&self) -> Span {
         self.span
     }
 
     pub fn set_span(&mut self, span: Span) {
         self.span = span;
     }
 }
 
+#[inline]
+fn is_ident_start(c: char) -> bool {
+    ('a' <= c && c <= 'z')
+        || ('A' <= c && c <= 'Z')
+        || c == '_'
+        || (c > '\x7f' && UnicodeXID::is_xid_start(c))
+}
+
+#[inline]
+fn is_ident_continue(c: char) -> bool {
+    ('a' <= c && c <= 'z')
+        || ('A' <= c && c <= 'Z')
+        || c == '_'
+        || ('0' <= c && c <= '9')
+        || (c > '\x7f' && UnicodeXID::is_xid_continue(c))
+}
+
 fn validate_term(string: &str) {
-    let validate = if string.starts_with('\'') {
-        &string[1..]
-    } else if string.starts_with("r#") {
-        &string[2..]
-    } else {
-        string
-    };
-
+    let validate = string;
     if validate.is_empty() {
-        panic!("Term is not allowed to be empty; use Option<Term>");
+        panic!("Ident is not allowed to be empty; use Option<Ident>");
     }
 
     if validate.bytes().all(|digit| digit >= b'0' && digit <= b'9') {
-        panic!("Term cannot be a number; use Literal instead");
+        panic!("Ident cannot be a number; use Literal instead");
     }
 
-    fn xid_ok(string: &str) -> bool {
+    fn ident_ok(string: &str) -> bool {
         let mut chars = string.chars();
         let first = chars.next().unwrap();
-        if !(UnicodeXID::is_xid_start(first) || first == '_') {
+        if !is_ident_start(first) {
             return false;
         }
         for ch in chars {
-            if !UnicodeXID::is_xid_continue(ch) {
+            if !is_ident_continue(ch) {
                 return false;
             }
         }
         true
     }
 
-    if !xid_ok(validate) {
-        panic!("{:?} is not a valid Term", string);
-    }
-}
-
-impl fmt::Debug for Term {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_tuple("Term").field(&self.as_str()).finish()
+    if !ident_ok(validate) {
+        panic!("{:?} is not a valid Ident", string);
     }
 }
 
-struct Interner {
-    string_to_index: HashMap<MyRc, usize>,
-    index_to_string: Vec<Rc<String>>,
-}
-
-#[derive(Hash, Eq, PartialEq)]
-struct MyRc(Rc<String>);
-
-impl Borrow<str> for MyRc {
-    fn borrow(&self) -> &str {
-        &self.0
+impl fmt::Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if self.raw {
+            "r#".fmt(f)?;
+        }
+        self.sym.fmt(f)
     }
 }
 
-impl Interner {
-    fn new() -> Interner {
-        Interner {
-            string_to_index: HashMap::new(),
-            index_to_string: Vec::new(),
-        }
+impl fmt::Debug for Ident {
+    // Ident(proc_macro), Ident(r#union)
+    #[cfg(not(procmacro2_semver_exempt))]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_tuple("Ident");
+        debug.field(&format_args!("{}", self));
+        debug.finish()
     }
 
-    fn intern(&mut self, s: &str) -> usize {
-        if let Some(&idx) = self.string_to_index.get(s) {
-            return idx;
-        }
-        let s = Rc::new(s.to_string());
-        self.index_to_string.push(s.clone());
-        self.string_to_index
-            .insert(MyRc(s), self.index_to_string.len() - 1);
-        self.index_to_string.len() - 1
-    }
-
-    fn get(&self, idx: usize) -> &str {
-        &self.index_to_string[idx]
+    // Ident {
+    //     sym: proc_macro,
+    //     span: bytes(128..138)
+    // }
+    #[cfg(procmacro2_semver_exempt)]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_struct("Ident");
+        debug.field("sym", &format_args!("{}", self));
+        debug.field("span", &self.span);
+        debug.finish()
     }
 }
 
-#[derive(Clone, Debug)]
+#[derive(Clone)]
 pub struct Literal {
     text: String,
     span: Span,
 }
 
 macro_rules! suffixed_numbers {
     ($($name:ident => $kind:ident,)*) => ($(
         pub fn $name(n: $kind) -> Literal {
@@ -579,17 +595,18 @@ impl Literal {
         let mut s = f.to_string();
         if !s.contains(".") {
             s.push_str(".0");
         }
         Literal::_new(s)
     }
 
     pub fn string(t: &str) -> Literal {
-        let mut s = t.chars()
+        let mut s = t
+            .chars()
             .flat_map(|c| c.escape_default())
             .collect::<String>();
         s.push('"');
         s.insert(0, '"');
         Literal::_new(s)
     }
 
     pub fn character(t: char) -> Literal {
@@ -624,160 +641,155 @@ impl Literal {
 }
 
 impl fmt::Display for Literal {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.text.fmt(f)
     }
 }
 
-fn token_stream(mut input: Cursor) -> PResult<::TokenStream> {
+impl fmt::Debug for Literal {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Literal");
+        debug.field("lit", &format_args!("{}", self.text));
+        #[cfg(procmacro2_semver_exempt)]
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+fn token_stream(mut input: Cursor) -> PResult<TokenStream> {
     let mut trees = Vec::new();
     loop {
         let input_no_ws = skip_whitespace(input);
         if input_no_ws.rest.len() == 0 {
-            break
+            break;
         }
         if let Ok((a, tokens)) = doc_comment(input_no_ws) {
             input = a;
             trees.extend(tokens);
-            continue
+            continue;
         }
 
         let (a, tt) = match token_tree(input_no_ws) {
             Ok(p) => p,
             Err(_) => break,
         };
         trees.push(tt);
         input = a;
     }
-    Ok((input, ::TokenStream::_new(TokenStream { inner: trees })))
+    Ok((input, TokenStream { inner: trees }))
 }
 
 #[cfg(not(procmacro2_semver_exempt))]
 fn spanned<'a, T>(
     input: Cursor<'a>,
     f: fn(Cursor<'a>) -> PResult<'a, T>,
 ) -> PResult<'a, (T, ::Span)> {
     let (a, b) = f(skip_whitespace(input))?;
-    Ok((a, ((b, ::Span::_new(Span { })))))
+    Ok((a, ((b, ::Span::_new_stable(Span {})))))
 }
 
 #[cfg(procmacro2_semver_exempt)]
 fn spanned<'a, T>(
     input: Cursor<'a>,
     f: fn(Cursor<'a>) -> PResult<'a, T>,
 ) -> PResult<'a, (T, ::Span)> {
     let input = skip_whitespace(input);
     let lo = input.off;
     let (a, b) = f(input)?;
     let hi = a.off;
-    let span = ::Span::_new(Span { lo: lo, hi: hi });
+    let span = ::Span::_new_stable(Span { lo: lo, hi: hi });
     Ok((a, (b, span)))
 }
 
 fn token_tree(input: Cursor) -> PResult<TokenTree> {
     let (rest, (mut tt, span)) = spanned(input, token_kind)?;
     tt.set_span(span);
     Ok((rest, tt))
 }
 
 named!(token_kind -> TokenTree, alt!(
     map!(group, TokenTree::Group)
     |
-    map!(literal, TokenTree::Literal) // must be before symbol
+    map!(literal, |l| TokenTree::Literal(::Literal::_new_stable(l))) // must be before symbol
     |
-    symbol
+    map!(op, TokenTree::Punct)
     |
-    map!(op, TokenTree::Op)
+    symbol_leading_ws
 ));
 
 named!(group -> Group, alt!(
     delimited!(
         punct!("("),
         token_stream,
         punct!(")")
-    ) => { |ts| Group::new(Delimiter::Parenthesis, ts) }
+    ) => { |ts| Group::new(Delimiter::Parenthesis, ::TokenStream::_new_stable(ts)) }
     |
     delimited!(
         punct!("["),
         token_stream,
         punct!("]")
-    ) => { |ts| Group::new(Delimiter::Bracket, ts) }
+    ) => { |ts| Group::new(Delimiter::Bracket, ::TokenStream::_new_stable(ts)) }
     |
     delimited!(
         punct!("{"),
         token_stream,
         punct!("}")
-    ) => { |ts| Group::new(Delimiter::Brace, ts) }
+    ) => { |ts| Group::new(Delimiter::Brace, ::TokenStream::_new_stable(ts)) }
 ));
 
-fn symbol(mut input: Cursor) -> PResult<TokenTree> {
-    input = skip_whitespace(input);
+fn symbol_leading_ws(input: Cursor) -> PResult<TokenTree> {
+    symbol(skip_whitespace(input))
+}
 
+fn symbol(input: Cursor) -> PResult<TokenTree> {
     let mut chars = input.char_indices();
 
-    let lifetime = input.starts_with("'");
-    if lifetime {
-        chars.next();
-    }
-
-    let raw = !lifetime && input.starts_with("r#");
+    let raw = input.starts_with("r#");
     if raw {
         chars.next();
         chars.next();
     }
 
     match chars.next() {
-        Some((_, ch)) if UnicodeXID::is_xid_start(ch) || ch == '_' => {}
+        Some((_, ch)) if is_ident_start(ch) => {}
         _ => return Err(LexError),
     }
 
     let mut end = input.len();
     for (i, ch) in chars {
-        if !UnicodeXID::is_xid_continue(ch) {
+        if !is_ident_continue(ch) {
             end = i;
             break;
         }
     }
 
     let a = &input.rest[..end];
-    if a == "r#_" || lifetime && a != "'static" && KEYWORDS.contains(&&a[1..]) {
+    if a == "r#_" {
         Err(LexError)
-    } else if a == "_" {
-        Ok((input.advance(end), Op::new('_', Spacing::Alone).into()))
     } else {
-        Ok((
-            input.advance(end),
-            ::Term::new(a, ::Span::call_site()).into(),
-        ))
+        let ident = if raw {
+            ::Ident::_new_raw(&a[2..], ::Span::call_site())
+        } else {
+            ::Ident::new(a, ::Span::call_site())
+        };
+        Ok((input.advance(end), ident.into()))
     }
 }
 
-// From https://github.com/rust-lang/rust/blob/master/src/libsyntax_pos/symbol.rs
-static KEYWORDS: &'static [&'static str] = &[
-    "abstract", "alignof", "as", "become", "box", "break", "const", "continue", "crate", "do",
-    "else", "enum", "extern", "false", "final", "fn", "for", "if", "impl", "in", "let", "loop",
-    "macro", "match", "mod", "move", "mut", "offsetof", "override", "priv", "proc", "pub", "pure",
-    "ref", "return", "self", "Self", "sizeof", "static", "struct", "super", "trait", "true",
-    "type", "typeof", "unsafe", "unsized", "use", "virtual", "where", "while", "yield",
-];
-
-fn literal(input: Cursor) -> PResult<::Literal> {
+fn literal(input: Cursor) -> PResult<Literal> {
     let input_no_ws = skip_whitespace(input);
 
     match literal_nocapture(input_no_ws) {
         Ok((a, ())) => {
             let start = input.len() - input_no_ws.len();
             let len = input_no_ws.len() - a.len();
             let end = start + len;
-            Ok((
-                a,
-                ::Literal::_new(Literal::_new(input.rest[start..end].to_string())),
-            ))
+            Ok((a, Literal::_new(input.rest[start..end].to_string())))
         }
         Err(LexError) => Err(LexError),
     }
 }
 
 named!(literal_nocapture -> (), alt!(
     string
     |
@@ -1126,17 +1138,17 @@ fn float_digits(input: Cursor) -> PResul
     }
 
     Ok((input.advance(len), ()))
 }
 
 fn int(input: Cursor) -> PResult<()> {
     let (rest, ()) = digits(input)?;
     for suffix in &[
-        "isize", "i8", "i16", "i32", "i64", "i128", "usize", "u8", "u16", "u32", "u64", "u128"
+        "isize", "i8", "i16", "i32", "i64", "i128", "usize", "u8", "u16", "u32", "u64", "u128",
     ] {
         if rest.starts_with(suffix) {
             return word_break(rest.advance(suffix.len()));
         }
     }
     word_break(rest)
 }
 
@@ -1178,56 +1190,65 @@ fn digits(mut input: Cursor) -> PResult<
     }
     if empty {
         Err(LexError)
     } else {
         Ok((input.advance(len), ()))
     }
 }
 
-fn op(input: Cursor) -> PResult<Op> {
+fn op(input: Cursor) -> PResult<Punct> {
     let input = skip_whitespace(input);
     match op_char(input) {
+        Ok((rest, '\'')) => {
+            symbol(rest)?;
+            Ok((rest, Punct::new('\'', Spacing::Joint)))
+        }
         Ok((rest, ch)) => {
             let kind = match op_char(rest) {
                 Ok(_) => Spacing::Joint,
                 Err(LexError) => Spacing::Alone,
             };
-            Ok((rest, Op::new(ch, kind)))
+            Ok((rest, Punct::new(ch, kind)))
         }
         Err(LexError) => Err(LexError),
     }
 }
 
 fn op_char(input: Cursor) -> PResult<char> {
+    if input.starts_with("//") || input.starts_with("/*") {
+        // Do not accept `/` of a comment as an op.
+        return Err(LexError);
+    }
+
     let mut chars = input.chars();
     let first = match chars.next() {
         Some(ch) => ch,
         None => {
             return Err(LexError);
         }
     };
-    let recognized = "~!@#$%^&*-=+|;:,<.>/?";
+    let recognized = "~!@#$%^&*-=+|;:,<.>/?'";
     if recognized.contains(first) {
         Ok((input.advance(first.len_utf8()), first))
     } else {
         Err(LexError)
     }
 }
 
 fn doc_comment(input: Cursor) -> PResult<Vec<TokenTree>> {
     let mut trees = Vec::new();
     let (rest, ((comment, inner), span)) = spanned(input, doc_comment_contents)?;
-    trees.push(TokenTree::Op(Op::new('#', Spacing::Alone)));
+    trees.push(TokenTree::Punct(Punct::new('#', Spacing::Alone)));
     if inner {
-        trees.push(Op::new('!', Spacing::Alone).into());
+        trees.push(Punct::new('!', Spacing::Alone).into());
     }
     let mut stream = vec![
-        TokenTree::Term(::Term::new("doc", span)),
-        TokenTree::Op(Op::new('=', Spacing::Alone)),
+        TokenTree::Ident(::Ident::new("doc", span)),
+        TokenTree::Punct(Punct::new('=', Spacing::Alone)),
         TokenTree::Literal(::Literal::string(comment)),
     ];
     for tt in stream.iter_mut() {
         tt.set_span(span);
     }
     trees.push(Group::new(Delimiter::Bracket, stream.into_iter().collect()).into());
     for tt in trees.iter_mut() {
         tt.set_span(span);
--- a/third_party/rust/proc-macro2/src/strnom.rs
+++ b/third_party/rust/proc-macro2/src/strnom.rs
@@ -1,15 +1,15 @@
 //! Adapted from [`nom`](https://github.com/Geal/nom).
 
 use std::str::{Bytes, CharIndices, Chars};
 
 use unicode_xid::UnicodeXID;
 
-use imp::LexError;
+use stable::LexError;
 
 #[derive(Copy, Clone, Eq, PartialEq)]
 pub struct Cursor<'a> {
     pub rest: &'a str,
     #[cfg(procmacro2_semver_exempt)]
     pub off: u32,
 }
 
@@ -68,28 +68,30 @@ pub fn whitespace(input: Cursor) -> PRes
         return Err(LexError);
     }
 
     let bytes = input.as_bytes();
     let mut i = 0;
     while i < bytes.len() {
         let s = input.advance(i);
         if bytes[i] == b'/' {
-            if s.starts_with("//") && (!s.starts_with("///") || s.starts_with("////"))
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
                 && !s.starts_with("//!")
             {
                 if let Some(len) = s.find('\n') {
                     i += len + 1;
                     continue;
                 }
                 break;
             } else if s.starts_with("/**/") {
                 i += 4;
                 continue;
-            } else if s.starts_with("/*") && (!s.starts_with("/**") || s.starts_with("/***"))
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
                 && !s.starts_with("/*!")
             {
                 let (_, com) = block_comment(s)?;
                 i += com.len();
                 continue;
             }
         }
         match bytes[i] {
--- a/third_party/rust/proc-macro2/src/unstable.rs
+++ b/third_party/rust/proc-macro2/src/unstable.rs
@@ -1,337 +1,559 @@
 #![cfg_attr(not(procmacro2_semver_exempt), allow(dead_code))]
 
 use std::fmt;
 use std::iter;
+use std::panic;
 use std::str::FromStr;
 
 use proc_macro;
+use stable;
 
-use {Delimiter, Group, Op, Spacing, TokenTree};
+use {Delimiter, Group, Punct, Spacing, TokenTree};
 
 #[derive(Clone)]
-pub struct TokenStream(proc_macro::TokenStream);
+pub enum TokenStream {
+    Nightly(proc_macro::TokenStream),
+    Stable(stable::TokenStream),
+}
+
+pub enum LexError {
+    Nightly(proc_macro::LexError),
+    Stable(stable::LexError),
+}
+
+fn nightly_works() -> bool {
+    use std::sync::atomic::*;
+    static WORKS: AtomicUsize = ATOMIC_USIZE_INIT;
 
-pub struct LexError(proc_macro::LexError);
+    match WORKS.load(Ordering::SeqCst) {
+        1 => return false,
+        2 => return true,
+        _ => {}
+    }
+    let works = panic::catch_unwind(|| proc_macro::Span::call_site()).is_ok();
+    WORKS.store(works as usize + 1, Ordering::SeqCst);
+    works
+}
+
+fn mismatch() -> ! {
+    panic!("stable/nightly mismatch")
+}
 
 impl TokenStream {
-    pub fn empty() -> TokenStream {
-        TokenStream(proc_macro::TokenStream::empty())
+    pub fn new() -> TokenStream {
+        if nightly_works() {
+            TokenStream::Nightly(proc_macro::TokenStream::new())
+        } else {
+            TokenStream::Stable(stable::TokenStream::new())
+        }
     }
 
     pub fn is_empty(&self) -> bool {
-        self.0.is_empty()
+        match self {
+            TokenStream::Nightly(tts) => tts.is_empty(),
+            TokenStream::Stable(tts) => tts.is_empty(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::TokenStream {
+        match self {
+            TokenStream::Nightly(s) => s,
+            TokenStream::Stable(_) => mismatch(),
+        }
     }
 }
 
 impl FromStr for TokenStream {
     type Err = LexError;
 
     fn from_str(src: &str) -> Result<TokenStream, LexError> {
-        Ok(TokenStream(src.parse().map_err(LexError)?))
+        if nightly_works() {
+            Ok(TokenStream::Nightly(src.parse()?))
+        } else {
+            Ok(TokenStream::Stable(src.parse()?))
+        }
     }
 }
 
 impl fmt::Display for TokenStream {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
+        match self {
+            TokenStream::Nightly(tts) => tts.fmt(f),
+            TokenStream::Stable(tts) => tts.fmt(f),
+        }
     }
 }
 
 impl From<proc_macro::TokenStream> for TokenStream {
     fn from(inner: proc_macro::TokenStream) -> TokenStream {
-        TokenStream(inner)
+        TokenStream::Nightly(inner)
     }
 }
 
 impl From<TokenStream> for proc_macro::TokenStream {
     fn from(inner: TokenStream) -> proc_macro::TokenStream {
-        inner.0
+        match inner {
+            TokenStream::Nightly(inner) => inner,
+            TokenStream::Stable(inner) => inner.to_string().parse().unwrap(),
+        }
+    }
+}
+
+impl From<stable::TokenStream> for TokenStream {
+    fn from(inner: stable::TokenStream) -> TokenStream {
+        TokenStream::Stable(inner)
     }
 }
 
 impl From<TokenTree> for TokenStream {
     fn from(token: TokenTree) -> TokenStream {
+        if !nightly_works() {
+            return TokenStream::Stable(token.into());
+        }
         let tt: proc_macro::TokenTree = match token {
             TokenTree::Group(tt) => {
                 let delim = match tt.delimiter() {
                     Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis,
                     Delimiter::Bracket => proc_macro::Delimiter::Bracket,
                     Delimiter::Brace => proc_macro::Delimiter::Brace,
                     Delimiter::None => proc_macro::Delimiter::None,
                 };
                 let span = tt.span();
-                let mut group = proc_macro::Group::new(delim, tt.stream.inner.0);
-                group.set_span(span.inner.0);
+                let mut group = proc_macro::Group::new(delim, tt.stream.inner.unwrap_nightly());
+                group.set_span(span.inner.unwrap_nightly());
                 group.into()
             }
-            TokenTree::Op(tt) => {
+            TokenTree::Punct(tt) => {
                 let spacing = match tt.spacing() {
                     Spacing::Joint => proc_macro::Spacing::Joint,
                     Spacing::Alone => proc_macro::Spacing::Alone,
                 };
-                let mut op = proc_macro::Op::new(tt.op(), spacing);
-                op.set_span(tt.span().inner.0);
+                let mut op = proc_macro::Punct::new(tt.as_char(), spacing);
+                op.set_span(tt.span().inner.unwrap_nightly());
                 op.into()
             }
-            TokenTree::Term(tt) => tt.inner.term.into(),
-            TokenTree::Literal(tt) => tt.inner.lit.into(),
+            TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(),
+            TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(),
         };
-        TokenStream(tt.into())
+        TokenStream::Nightly(tt.into())
     }
 }
 
 impl iter::FromIterator<TokenTree> for TokenStream {
-    fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
-        let streams = streams.into_iter().map(TokenStream::from)
-            .flat_map(|t| t.0);
-        TokenStream(streams.collect::<proc_macro::TokenStream>())
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
+        if nightly_works() {
+            let trees = trees
+                .into_iter()
+                .map(TokenStream::from)
+                .flat_map(|t| match t {
+                    TokenStream::Nightly(s) => s,
+                    TokenStream::Stable(_) => mismatch(),
+                });
+            TokenStream::Nightly(trees.collect())
+        } else {
+            TokenStream::Stable(trees.into_iter().collect())
+        }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        match self {
+            TokenStream::Nightly(tts) => {
+                *tts = tts
+                    .clone()
+                    .into_iter()
+                    .chain(
+                        streams
+                            .into_iter()
+                            .map(TokenStream::from)
+                            .flat_map(|t| match t {
+                                TokenStream::Nightly(tts) => tts.into_iter(),
+                                _ => panic!(),
+                            }),
+                    )
+                    .collect();
+            }
+            TokenStream::Stable(tts) => tts.extend(streams),
+        }
     }
 }
 
 impl fmt::Debug for TokenStream {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
+        match self {
+            TokenStream::Nightly(tts) => tts.fmt(f),
+            TokenStream::Stable(tts) => tts.fmt(f),
+        }
+    }
+}
+
+impl From<proc_macro::LexError> for LexError {
+    fn from(e: proc_macro::LexError) -> LexError {
+        LexError::Nightly(e)
+    }
+}
+
+impl From<stable::LexError> for LexError {
+    fn from(e: stable::LexError) -> LexError {
+        LexError::Stable(e)
     }
 }
 
 impl fmt::Debug for LexError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
+        match self {
+            LexError::Nightly(e) => e.fmt(f),
+            LexError::Stable(e) => e.fmt(f),
+        }
     }
 }
 
-pub struct TokenTreeIter(proc_macro::token_stream::IntoIter);
+pub enum TokenTreeIter {
+    Nightly(proc_macro::token_stream::IntoIter),
+    Stable(stable::TokenTreeIter),
+}
 
 impl IntoIterator for TokenStream {
     type Item = TokenTree;
     type IntoIter = TokenTreeIter;
 
     fn into_iter(self) -> TokenTreeIter {
-        TokenTreeIter(self.0.into_iter())
+        match self {
+            TokenStream::Nightly(tts) => TokenTreeIter::Nightly(tts.into_iter()),
+            TokenStream::Stable(tts) => TokenTreeIter::Stable(tts.into_iter()),
+        }
     }
 }
 
 impl Iterator for TokenTreeIter {
     type Item = TokenTree;
 
     fn next(&mut self) -> Option<TokenTree> {
-        let token = self.0.next()?;
+        let token = match self {
+            TokenTreeIter::Nightly(iter) => iter.next()?,
+            TokenTreeIter::Stable(iter) => return iter.next(),
+        };
         Some(match token {
             proc_macro::TokenTree::Group(tt) => {
                 let delim = match tt.delimiter() {
                     proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis,
                     proc_macro::Delimiter::Bracket => Delimiter::Bracket,
                     proc_macro::Delimiter::Brace => Delimiter::Brace,
                     proc_macro::Delimiter::None => Delimiter::None,
                 };
-                let stream = ::TokenStream::_new(TokenStream(tt.stream()));
+                let stream = ::TokenStream::_new(TokenStream::Nightly(tt.stream()));
                 let mut g = Group::new(delim, stream);
-                g.set_span(::Span::_new(Span(tt.span())));
+                g.set_span(::Span::_new(Span::Nightly(tt.span())));
                 g.into()
             }
-            proc_macro::TokenTree::Op(tt) => {
+            proc_macro::TokenTree::Punct(tt) => {
                 let spacing = match tt.spacing() {
                     proc_macro::Spacing::Joint => Spacing::Joint,
                     proc_macro::Spacing::Alone => Spacing::Alone,
                 };
-                let mut o = Op::new(tt.op(), spacing);
-                o.set_span(::Span::_new(Span(tt.span())));
+                let mut o = Punct::new(tt.as_char(), spacing);
+                o.set_span(::Span::_new(Span::Nightly(tt.span())));
                 o.into()
             }
-            proc_macro::TokenTree::Term(s) => {
-                ::Term::_new(Term {
-                    term: s,
-                }).into()
-            }
-            proc_macro::TokenTree::Literal(l) => {
-                ::Literal::_new(Literal {
-                    lit: l,
-                }).into()
-            }
+            proc_macro::TokenTree::Ident(s) => ::Ident::_new(Ident::Nightly(s)).into(),
+            proc_macro::TokenTree::Literal(l) => ::Literal::_new(Literal::Nightly(l)).into(),
         })
     }
 
     fn size_hint(&self) -> (usize, Option<usize>) {
-        self.0.size_hint()
+        match self {
+            TokenTreeIter::Nightly(tts) => tts.size_hint(),
+            TokenTreeIter::Stable(tts) => tts.size_hint(),
+        }
     }
 }
 
 impl fmt::Debug for TokenTreeIter {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.debug_struct("TokenTreeIter").finish()
     }
 }
 
-#[derive(Clone, PartialEq, Eq)]
-pub struct FileName(String);
-
-impl fmt::Display for FileName {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
-    }
-}
+pub use stable::FileName;
 
 // NOTE: We have to generate our own filename object here because we can't wrap
 // the one provided by proc_macro.
 #[derive(Clone, PartialEq, Eq)]
-pub struct SourceFile(proc_macro::SourceFile, FileName);
+pub enum SourceFile {
+    Nightly(proc_macro::SourceFile, FileName),
+    Stable(stable::SourceFile),
+}
 
 impl SourceFile {
-    fn new(sf: proc_macro::SourceFile) -> Self {
-        let filename = FileName(sf.path().to_string());
-        SourceFile(sf, filename)
+    fn nightly(sf: proc_macro::SourceFile) -> Self {
+        let filename = stable::file_name(sf.path().to_string());
+        SourceFile::Nightly(sf, filename)
     }
 
     /// Get the path to this source file as a string.
     pub fn path(&self) -> &FileName {
-        &self.1
+        match self {
+            SourceFile::Nightly(_, f) => f,
+            SourceFile::Stable(a) => a.path(),
+        }
     }
 
     pub fn is_real(&self) -> bool {
-        self.0.is_real()
+        match self {
+            SourceFile::Nightly(a, _) => a.is_real(),
+            SourceFile::Stable(a) => a.is_real(),
+        }
     }
 }
 
 impl AsRef<FileName> for SourceFile {
     fn as_ref(&self) -> &FileName {
         self.path()
     }
 }
 
 impl fmt::Debug for SourceFile {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
+        match self {
+            SourceFile::Nightly(a, _) => a.fmt(f),
+            SourceFile::Stable(a) => a.fmt(f),
+        }
     }
 }
 
 pub struct LineColumn {
     pub line: usize,
     pub column: usize,
 }
 
 #[derive(Copy, Clone)]
-pub struct Span(proc_macro::Span);
-
-impl From<proc_macro::Span> for ::Span {
-    fn from(proc_span: proc_macro::Span) -> ::Span {
-        ::Span::_new(Span(proc_span))
-    }
+pub enum Span {
+    Nightly(proc_macro::Span),
+    Stable(stable::Span),
 }
 
 impl Span {
     pub fn call_site() -> Span {
-        Span(proc_macro::Span::call_site())
+        if nightly_works() {
+            Span::Nightly(proc_macro::Span::call_site())
+        } else {
+            Span::Stable(stable::Span::call_site())
+        }
     }
 
     pub fn def_site() -> Span {
-        Span(proc_macro::Span::def_site())
+        if nightly_works() {
+            Span::Nightly(proc_macro::Span::def_site())
+        } else {
+            Span::Stable(stable::Span::def_site())
+        }
     }
 
     pub fn resolved_at(&self, other: Span) -> Span {
-        Span(self.0.resolved_at(other.0))
+        match (self, other) {
+            (Span::Nightly(a), Span::Nightly(b)) => Span::Nightly(a.resolved_at(b)),
+            (Span::Stable(a), Span::Stable(b)) => Span::Stable(a.resolved_at(b)),
+            _ => mismatch(),
+        }
     }
 
     pub fn located_at(&self, other: Span) -> Span {
-        Span(self.0.located_at(other.0))
+        match (self, other) {
+            (Span::Nightly(a), Span::Nightly(b)) => Span::Nightly(a.located_at(b)),
+            (Span::Stable(a), Span::Stable(b)) => Span::Stable(a.located_at(b)),
+            _ => mismatch(),
+        }
     }
 
     pub fn unstable(self) -> proc_macro::Span {
-        self.0
+        match self {
+            Span::Nightly(s) => s,
+            Span::Stable(_) => mismatch(),
+        }
     }
 
+    #[cfg(procmacro2_semver_exempt)]
     pub fn source_file(&self) -> SourceFile {
-        SourceFile::new(self.0.source_file())
+        match self {
+            Span::Nightly(s) => SourceFile::nightly(s.source_file()),
+            Span::Stable(s) => SourceFile::Stable(s.source_file()),
+        }
     }
 
+    #[cfg(procmacro2_semver_exempt)]
     pub fn start(&self) -> LineColumn {
-        let proc_macro::LineColumn { line, column } = self.0.start();
-        LineColumn { line, column }
+        match self {
+            Span::Nightly(s) => {
+                let proc_macro::LineColumn { line, column } = s.start();
+                LineColumn { line, column }
+            }
+            Span::Stable(s) => {
+                let stable::LineColumn { line, column } = s.start();
+                LineColumn { line, column }
+            }
+        }
     }
 
+    #[cfg(procmacro2_semver_exempt)]
     pub fn end(&self) -> LineColumn {
-        let proc_macro::LineColumn { line, column } = self.0.end();
-        LineColumn { line, column }
+        match self {
+            Span::Nightly(s) => {
+                let proc_macro::LineColumn { line, column } = s.end();
+                LineColumn { line, column }
+            }
+            Span::Stable(s) => {
+                let stable::LineColumn { line, column } = s.end();
+                LineColumn { line, column }
+            }
+        }
     }
 
+    #[cfg(procmacro2_semver_exempt)]
     pub fn join(&self, other: Span) -> Option<Span> {
-        self.0.join(other.0).map(Span)
+        let ret = match (self, other) {
+            (Span::Nightly(a), Span::Nightly(b)) => Span::Nightly(a.join(b)?),
+            (Span::Stable(a), Span::Stable(b)) => Span::Stable(a.join(b)?),
+            _ => return None,
+        };
+        Some(ret)
     }
 
     pub fn eq(&self, other: &Span) -> bool {
-        self.0.eq(&other.0)
+        match (self, other) {
+            (Span::Nightly(a), Span::Nightly(b)) => a.eq(b),
+            (Span::Stable(a), Span::Stable(b)) => a.eq(b),
+            _ => false,
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Span {
+        match self {
+            Span::Nightly(s) => s,
+            Span::Stable(_) => mismatch(),
+        }
+    }
+}
+
+impl From<proc_macro::Span> for ::Span {
+    fn from(proc_span: proc_macro::Span) -> ::Span {
+        ::Span::_new(Span::Nightly(proc_span))
+    }
+}
+
+impl From<stable::Span> for Span {
+    fn from(inner: stable::Span) -> Span {
+        Span::Stable(inner)
     }
 }
 
 impl fmt::Debug for Span {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
-    }
-}
-
-#[derive(Copy, Clone)]
-pub struct Term {
-    term: proc_macro::Term,
-}
-
-impl Term {
-    pub fn new(string: &str, span: Span) -> Term {
-        Term {
-            term: proc_macro::Term::new(string, span.0),
+        match self {
+            Span::Nightly(s) => s.fmt(f),
+            Span::Stable(s) => s.fmt(f),
         }
     }
-
-    pub fn as_str(&self) -> &str {
-        self.term.as_str()
-    }
-
-    pub fn span(&self) -> Span {
-        Span(self.term.span())
-    }
-
-    pub fn set_span(&mut self, span: Span) {
-        self.term.set_span(span.0);
-    }
-}
-
-impl fmt::Debug for Term {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.term.fmt(f)
-    }
 }
 
 #[derive(Clone)]
-pub struct Literal {
-    lit: proc_macro::Literal,
+pub enum Ident {
+    Nightly(proc_macro::Ident),
+    Stable(stable::Ident),
+}
+
+impl Ident {
+    pub fn new(string: &str, span: Span) -> Ident {
+        match span {
+            Span::Nightly(s) => Ident::Nightly(proc_macro::Ident::new(string, s)),
+            Span::Stable(s) => Ident::Stable(stable::Ident::new(string, s)),
+        }
+    }
+
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        match span {
+            Span::Nightly(s) => Ident::Nightly(proc_macro::Ident::new_raw(string, s)),
+            Span::Stable(s) => Ident::Stable(stable::Ident::new_raw(string, s)),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Ident::Nightly(t) => Span::Nightly(t.span()),
+            Ident::Stable(t) => Span::Stable(t.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Ident::Nightly(t), Span::Nightly(s)) => t.set_span(s),
+            (Ident::Stable(t), Span::Stable(s)) => t.set_span(s),
+            _ => mismatch(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Ident {
+        match self {
+            Ident::Nightly(s) => s,
+            Ident::Stable(_) => mismatch(),
+        }
+    }
+}
+
+impl fmt::Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Nightly(t) => t.fmt(f),
+            Ident::Stable(t) => t.fmt(f),
+        }
+    }
+}
+
+impl fmt::Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Nightly(t) => t.fmt(f),
+            Ident::Stable(t) => t.fmt(f),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub enum Literal {
+    Nightly(proc_macro::Literal),
+    Stable(stable::Literal),
 }
 
 macro_rules! suffixed_numbers {
     ($($name:ident => $kind:ident,)*) => ($(
         pub fn $name(n: $kind) -> Literal {
-            Literal::_new(proc_macro::Literal::$name(n))
+            if nightly_works() {
+                Literal::Nightly(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Stable(stable::Literal::$name(n))
+            }
         }
     )*)
 }
 
 macro_rules! unsuffixed_integers {
     ($($name:ident => $kind:ident,)*) => ($(
         pub fn $name(n: $kind) -> Literal {
-            Literal::_new(proc_macro::Literal::$name(n))
+            if nightly_works() {
+                Literal::Nightly(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Stable(stable::Literal::$name(n))
+            }
         }
     )*)
 }
 
 impl Literal {
-    fn _new(lit: proc_macro::Literal) -> Literal {
-        Literal {
-            lit,
-        }
-    }
-
     suffixed_numbers! {
         u8_suffixed => u8,
         u16_suffixed => u16,
         u32_suffixed => u32,
         u64_suffixed => u64,
         usize_suffixed => usize,
         i8_suffixed => i8,
         i16_suffixed => i16,
@@ -352,48 +574,93 @@ impl Literal {
         i8_unsuffixed => i8,
         i16_unsuffixed => i16,
         i32_unsuffixed => i32,
         i64_unsuffixed => i64,
         isize_unsuffixed => isize,
     }
 
     pub fn f32_unsuffixed(f: f32) -> Literal {
-        Literal::_new(proc_macro::Literal::f32_unsuffixed(f))
+        if nightly_works() {
+            Literal::Nightly(proc_macro::Literal::f32_unsuffixed(f))
+        } else {
+            Literal::Stable(stable::Literal::f32_unsuffixed(f))
+        }
     }
 
     pub fn f64_unsuffixed(f: f64) -> Literal {
-        Literal::_new(proc_macro::Literal::f64_unsuffixed(f))
+        if nightly_works() {
+            Literal::Nightly(proc_macro::Literal::f64_unsuffixed(f))
+        } else {
+            Literal::Stable(stable::Literal::f64_unsuffixed(f))
+        }
     }
 
-
     pub fn string(t: &str) -> Literal {
-        Literal::_new(proc_macro::Literal::string(t))
+        if nightly_works() {
+            Literal::Nightly(proc_macro::Literal::string(t))
+        } else {
+            Literal::Stable(stable::Literal::string(t))
+        }
     }
 
     pub fn character(t: char) -> Literal {
-        Literal::_new(proc_macro::Literal::character(t))
+        if nightly_works() {
+            Literal::Nightly(proc_macro::Literal::character(t))
+        } else {
+            Literal::Stable(stable::Literal::character(t))
+        }
     }
 
     pub fn byte_string(bytes: &[u8]) -> Literal {
-        Literal::_new(proc_macro::Literal::byte_string(bytes))
+        if nightly_works() {
+            Literal::Nightly(proc_macro::Literal::byte_string(bytes))
+        } else {
+            Literal::Stable(stable::Literal::byte_string(bytes))
+        }
     }
 
     pub fn span(&self) -> Span {
-        Span(self.lit.span())
+        match self {
+            Literal::Nightly(lit) => Span::Nightly(lit.span()),
+            Literal::Stable(lit) => Span::Stable(lit.span()),
+        }
     }
 
     pub fn set_span(&mut self, span: Span) {
-        self.lit.set_span(span.0);
+        match (self, span) {
+            (Literal::Nightly(lit), Span::Nightly(s)) => lit.set_span(s),
+            (Literal::Stable(lit), Span::Stable(s)) => lit.set_span(s),
+            _ => mismatch(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Literal {
+        match self {
+            Literal::Nightly(s) => s,
+            Literal::Stable(_) => mismatch(),
+        }
+    }
+}
+
+impl From<stable::Literal> for Literal {
+    fn from(s: stable::Literal) -> Literal {
+        Literal::Stable(s)
     }
 }
 
 impl fmt::Display for Literal {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.lit.fmt(f)
+        match self {
+            Literal::Nightly(t) => t.fmt(f),
+            Literal::Stable(t) => t.fmt(f),
+        }
     }
 }
 
 impl fmt::Debug for Literal {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.lit.fmt(f)
+        match self {
+            Literal::Nightly(t) => t.fmt(f),
+            Literal::Stable(t) => t.fmt(f),
+        }
     }
 }
--- a/third_party/rust/proc-macro2/tests/test.rs
+++ b/third_party/rust/proc-macro2/tests/test.rs
@@ -1,87 +1,87 @@
 extern crate proc_macro2;
 
 use std::str::{self, FromStr};
 
-use proc_macro2::{Literal, Span, Term, TokenStream, TokenTree};
+use proc_macro2::{Ident, Literal, Spacing, Span, TokenStream, TokenTree};
 
 #[test]
 fn terms() {
-    assert_eq!(Term::new("String", Span::call_site()).as_str(), "String");
-    assert_eq!(Term::new("fn", Span::call_site()).as_str(), "fn");
-    assert_eq!(Term::new("_", Span::call_site()).as_str(), "_");
-}
-
-#[test]
-fn raw_terms() {
-    assert_eq!(Term::new("r#String", Span::call_site()).as_str(), "r#String");
-    assert_eq!(Term::new("r#fn", Span::call_site()).as_str(), "r#fn");
-    assert_eq!(Term::new("r#_", Span::call_site()).as_str(), "r#_");
+    assert_eq!(
+        Ident::new("String", Span::call_site()).to_string(),
+        "String"
+    );
+    assert_eq!(Ident::new("fn", Span::call_site()).to_string(), "fn");
+    assert_eq!(Ident::new("_", Span::call_site()).to_string(), "_");
 }
 
 #[test]
-fn lifetimes() {
-    assert_eq!(Term::new("'a", Span::call_site()).as_str(), "'a");
-    assert_eq!(Term::new("'static", Span::call_site()).as_str(), "'static");
-    assert_eq!(Term::new("'_", Span::call_site()).as_str(), "'_");
+#[cfg(procmacro2_semver_exempt)]
+fn raw_terms() {
+    assert_eq!(
+        Ident::new_raw("String", Span::call_site()).to_string(),
+        "r#String"
+    );
+    assert_eq!(Ident::new_raw("fn", Span::call_site()).to_string(), "r#fn");
+    assert_eq!(Ident::new_raw("_", Span::call_site()).to_string(), "r#_");
 }
 
 #[test]
-#[should_panic(expected = "Term is not allowed to be empty; use Option<Term>")]
+#[should_panic(expected = "Ident is not allowed to be empty; use Option<Ident>")]
 fn term_empty() {
-    Term::new("", Span::call_site());
+    Ident::new("", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "Term cannot be a number; use Literal instead")]
+#[should_panic(expected = "Ident cannot be a number; use Literal instead")]
 fn term_number() {
-    Term::new("255", Span::call_site());
+    Ident::new("255", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "\"a#\" is not a valid Term")]
+#[should_panic(expected = "\"a#\" is not a valid Ident")]
 fn term_invalid() {
-    Term::new("a#", Span::call_site());
+    Ident::new("a#", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "Term is not allowed to be empty; use Option<Term>")]
+#[should_panic(expected = "not a valid Ident")]
 fn raw_term_empty() {
-    Term::new("r#", Span::call_site());
+    Ident::new("r#", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "Term cannot be a number; use Literal instead")]
+#[should_panic(expected = "not a valid Ident")]
 fn raw_term_number() {
-    Term::new("r#255", Span::call_site());
+    Ident::new("r#255", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "\"r#a#\" is not a valid Term")]
+#[should_panic(expected = "\"r#a#\" is not a valid Ident")]
 fn raw_term_invalid() {
-    Term::new("r#a#", Span::call_site());
+    Ident::new("r#a#", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "Term is not allowed to be empty; use Option<Term>")]
+#[should_panic(expected = "not a valid Ident")]
 fn lifetime_empty() {
-    Term::new("'", Span::call_site());
+    Ident::new("'", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = "Term cannot be a number; use Literal instead")]
+#[should_panic(expected = "not a valid Ident")]
 fn lifetime_number() {
-    Term::new("'255", Span::call_site());
+    Ident::new("'255", Span::call_site());
 }
 
 #[test]
-#[should_panic(expected = r#""\'a#" is not a valid Term"#)]
+#[should_panic(expected = r#""\'a#" is not a valid Ident"#)]
 fn lifetime_invalid() {
-    Term::new("'a#", Span::call_site());
+    Ident::new("'a#", Span::call_site());
 }
 
 #[test]
 fn literals() {
     assert_eq!(Literal::string("foo").to_string(), "\"foo\"");
     assert_eq!(Literal::string("\"").to_string(), "\"\\\"\"");
     assert_eq!(Literal::f32_unsuffixed(10.0).to_string(), "10.0");
 }
@@ -111,33 +111,33 @@ fn roundtrip() {
         1_0i32
         8u8
         9
         0
         0xffffffffffffffffffffffffffffffff
     ",
     );
     roundtrip("'a");
+    roundtrip("'_");
     roundtrip("'static");
     roundtrip("'\\u{10__FFFF}'");
     roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"");
 }
 
 #[test]
 fn fail() {
     fn fail(p: &str) {
-        if p.parse::<TokenStream>().is_ok() {
-            panic!("should have failed to parse: {}", p);
+        if let Ok(s) = p.parse::<TokenStream>() {
+            panic!("should have failed to parse: {}\n{:#?}", p, s);
         }
     }
     fail("1x");
     fail("1u80");
     fail("1f320");
     fail("' static");
-    fail("'mut");
     fail("r#1");
     fail("r#_");
 }
 
 #[cfg(procmacro2_semver_exempt)]
 #[test]
 fn span_test() {
     use proc_macro2::TokenTree;
@@ -256,49 +256,128 @@ fn tricky_doc_comment() {
     let stream = "/**/".parse::<proc_macro2::TokenStream>().unwrap();
     let tokens = stream.into_iter().collect::<Vec<_>>();
     assert!(tokens.is_empty(), "not empty -- {:?}", tokens);
 
     let stream = "/// doc".parse::<proc_macro2::TokenStream>().unwrap();
     let tokens = stream.into_iter().collect::<Vec<_>>();
     assert!(tokens.len() == 2, "not length 2 -- {:?}", tokens);
     match tokens[0] {
-        proc_macro2::TokenTree::Op(ref tt) => assert_eq!(tt.op(), '#'),
+        proc_macro2::TokenTree::Punct(ref tt) => assert_eq!(tt.as_char(), '#'),
         _ => panic!("wrong token {:?}", tokens[0]),
     }
     let mut tokens = match tokens[1] {
         proc_macro2::TokenTree::Group(ref tt) => {
             assert_eq!(tt.delimiter(), proc_macro2::Delimiter::Bracket);
             tt.stream().into_iter()
         }
         _ => panic!("wrong token {:?}", tokens[0]),
     };
 
     match tokens.next().unwrap() {
-        proc_macro2::TokenTree::Term(ref tt) => assert_eq!(tt.as_str(), "doc"),
+        proc_macro2::TokenTree::Ident(ref tt) => assert_eq!(tt.to_string(), "doc"),
         t => panic!("wrong token {:?}", t),
     }
     match tokens.next().unwrap() {
-        proc_macro2::TokenTree::Op(ref tt) => assert_eq!(tt.op(), '='),
+        proc_macro2::TokenTree::Punct(ref tt) => assert_eq!(tt.as_char(), '='),
         t => panic!("wrong token {:?}", t),
     }
     match tokens.next().unwrap() {
         proc_macro2::TokenTree::Literal(ref tt) => {
             assert_eq!(tt.to_string(), "\" doc\"");
         }
         t => panic!("wrong token {:?}", t),
     }
     assert!(tokens.next().is_none());
 
     let stream = "//! doc".parse::<proc_macro2::TokenStream>().unwrap();
     let tokens = stream.into_iter().collect::<Vec<_>>();
     assert!(tokens.len() == 3, "not length 3 -- {:?}", tokens);
 }
 
 #[test]
+fn op_before_comment() {
+    let mut tts = TokenStream::from_str("~// comment").unwrap().into_iter();
+    match tts.next().unwrap() {
+        TokenTree::Punct(tt) => {
+            assert_eq!(tt.as_char(), '~');
+            assert_eq!(tt.spacing(), Spacing::Alone);
+        }
+        wrong => panic!("wrong token {:?}", wrong),
+    }
+}
+
+#[test]
 fn raw_identifier() {
     let mut tts = TokenStream::from_str("r#dyn").unwrap().into_iter();
     match tts.next().unwrap() {
-        TokenTree::Term(raw) => assert_eq!("r#dyn", raw.as_str()),
+        TokenTree::Ident(raw) => assert_eq!("r#dyn", raw.to_string()),
         wrong => panic!("wrong token {:?}", wrong),
     }
     assert!(tts.next().is_none());
 }
+
+#[test]
+fn test_debug_ident() {
+    let ident = Ident::new("proc_macro", Span::call_site());
+
+    #[cfg(not(procmacro2_semver_exempt))]
+    let expected = "Ident(proc_macro)";
+
+    #[cfg(procmacro2_semver_exempt)]
+    let expected = "Ident { sym: proc_macro, span: bytes(0..0) }";
+
+    assert_eq!(expected, format!("{:?}", ident));
+}
+
+#[test]
+#[cfg(not(feature = "nightly"))]
+fn test_debug_tokenstream() {
+    let tts = TokenStream::from_str("[a + 1]").unwrap();
+
+    #[cfg(not(procmacro2_semver_exempt))]
+    let expected = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a
+            },
+            Punct {
+                op: '+',
+                spacing: Alone
+            },
+            Literal {
+                lit: 1
+            }
+        ]
+    }
+]\
+    ";
+
+    #[cfg(procmacro2_semver_exempt)]
+    let expected = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a,
+                span: bytes(2..3)
+            },
+            Punct {
+                op: '+',
+                spacing: Alone,
+                span: bytes(4..5)
+            },
+            Literal {
+                lit: 1,
+                span: bytes(6..7)
+            }
+        ],
+        span: bytes(1..8)
+    }
+]\
+    ";
+
+    assert_eq!(expected, format!("{:#?}", tts));
+}
copy from third_party/rust/quote/.cargo-checksum.json
copy to third_party/rust/quote-0.5.2/.cargo-checksum.json
copy from third_party/rust/quote/Cargo.toml
copy to third_party/rust/quote-0.5.2/Cargo.toml
new file mode 100644
--- /dev/null
+++ b/third_party/rust/quote-0.5.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.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/quote-0.5.2/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2016 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.
copy from third_party/rust/quote/README.md
copy to third_party/rust/quote-0.5.2/README.md
copy from third_party/rust/quote/src/lib.rs
copy to third_party/rust/quote-0.5.2/src/lib.rs
copy from third_party/rust/quote/src/to_tokens.rs
copy to third_party/rust/quote-0.5.2/src/to_tokens.rs
rename from third_party/rust/quote/src/tokens.rs
rename to third_party/rust/quote-0.5.2/src/tokens.rs
copy from third_party/rust/quote/tests/test.rs
copy to third_party/rust/quote-0.5.2/tests/test.rs
--- a/third_party/rust/quote/.cargo-checksum.json
+++ b/third_party/rust/quote/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"8078663280ca2bbda17459a3c2629b84aee2b9904a83f83b87f1bf60e096692f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"bdb5b5375e8cd37b75b4e0269b8fa9fb22776df9762c1df11ec88eb4cd2dc097","src/lib.rs":"7f72accca88679bc49cc8aedf7d96c922288e66a3d63bf1d06f5da262f02a4ad","src/to_tokens.rs":"6eb18c100701d1f9556cd21b1f2faca3316e85029345274dcfe7691e7ffa254d","src/tokens.rs":"a4939fc092d6466d5a2e75474886152e880586b12e057c0d7bf7b3f22428b2de","tests/test.rs":"35bac59a637a8dc3919df51bfa0957b6f964f408cc63c7a81a3e759ab8557f55"},"package":"9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"}
\ No newline at end of file
+{"files":{"Cargo.toml":"33e512b1a2fd40b4d0b5af4ac16ad4f163e0383ba2f4abcd7a7e575e2af3442c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"61dc7827fb2e29185f0d73594db326bfdbec8393ca7a48429b259711d42e80f9","src/ext.rs":"2e2f71fca8c8580eeed138da42d93dc21fc48d7a8da973ae6d3b616da6a3b0e3","src/lib.rs":"0dedf7935a0203324804cecdf6350245caa24dbdaaf9e168b7ab90b0883ec0c4","src/to_tokens.rs":"10dc32fbe69798408ee1f49ec25770b90eeb6b069552f50cd4e03228b8e85847","tests/test.rs":"90fe0e9a704e628339fe9298f0cb8307e94ebadfe28fffd7b2fc2d94203bc342"},"package":"e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"}
\ No newline at end of file
--- a/third_party/rust/quote/Cargo.toml
+++ b/third_party/rust/quote/Cargo.toml
@@ -7,24 +7,24 @@
 #
 # 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 = "quote"
-version = "0.5.2"
+version = "0.6.3"
 authors = ["David Tolnay <dtolnay@gmail.com>"]
 include = ["Cargo.toml", "src/**/*.rs", "tests/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
 description = "Quasi-quoting macro quote!(...)"
 documentation = "https://docs.rs/quote/"
 readme = "README.md"
 keywords = ["syn"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/dtolnay/quote"
 [dependencies.proc-macro2]
-version = "0.3"
+version = "0.4.4"
 default-features = false
 
 [features]
 default = ["proc-macro"]
 proc-macro = ["proc-macro2/proc-macro"]
--- a/third_party/rust/quote/README.md
+++ b/third_party/rust/quote/README.md
@@ -3,17 +3,17 @@ Rust Quasi-Quoting
 
 [![Build Status](https://api.travis-ci.org/dtolnay/quote.svg?branch=master)](https://travis-ci.org/dtolnay/quote)
 [![Latest Version](https://img.shields.io/crates/v/quote.svg)](https://crates.io/crates/quote)
 [![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/quote/)
 
 This crate provides the [`quote!`] macro for turning Rust syntax tree data
 structures into tokens of source code.
 
-[`quote!`]: https://docs.rs/quote/0.5/quote/macro.quote.html
+[`quote!`]: https://docs.rs/quote/0.6/quote/macro.quote.html
 
 Procedural macros in Rust receive a stream of tokens as input, execute arbitrary
 Rust code to determine how to manipulate those tokens, and produce a stream of
 tokens to hand back to the compiler to compile into the caller's crate.
 Quasi-quoting is a solution to one piece of that -- producing tokens to return
 to the compiler.
 
 The idea of quasi-quoting is that we write *code* that we treat as *data*.
@@ -26,54 +26,56 @@ the macro caller's crate.
 
 This crate is motivated by the procedural macro use case, but is a
 general-purpose Rust quasi-quoting library and is not specific to procedural
 macros.
 
 *Version requirement: Quote supports any compiler version back to Rust's very
 first support for procedural macros in Rust 1.15.0.*
 
+[*Release notes*](https://github.com/dtolnay/quote/releases)
+
 ```toml
 [dependencies]
-quote = "0.5"
+quote = "0.6"
 ```
 
 ```rust
 #[macro_use]
 extern crate quote;
 ```
 
 ## Syntax
 
 The quote crate provides a [`quote!`] macro within which you can write Rust code
-that gets packaged into a [`quote::Tokens`] and can be treated as data. You
-should think of `Tokens` as representing a fragment of Rust source code. Call
-`to_string()` on a `Tokens` to get back the fragment of source code as a string,
-or call `into()` to stream them as a `TokenStream` back to the compiler in a
-procedural macro.
+that gets packaged into a [`TokenStream`] and can be treated as data. You should
+think of `TokenStream` as representing a fragment of Rust source code. This type
+can be returned directly back to the compiler by a procedural macro to get
+compiled into the caller's crate.
 
-[`quote::Tokens`]: https://docs.rs/quote/0.5/quote/struct.Tokens.html
+[`TokenStream`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.TokenStream.html
 
 Within the `quote!` macro, interpolation is done with `#var`. Any type
 implementing the [`quote::ToTokens`] trait can be interpolated. This includes
 most Rust primitive types as well as most of the syntax tree types from [`syn`].
 
-[`quote::ToTokens`]: https://docs.rs/quote/0.5/quote/trait.ToTokens.html
+[`quote::ToTokens`]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html
 [`syn`]: https://github.com/dtolnay/syn
 
 ```rust
 let tokens = quote! {
     struct SerializeWith #generics #where_clause {
         value: &'a #field_ty,
         phantom: ::std::marker::PhantomData<#item_ty>,
     }
 
     impl #generics serde::Serialize for SerializeWith #generics #where_clause {
         fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error>
-            where S: serde::Serializer
+        where
+            S: serde::Serializer,
         {
             #path(self.value, s)
         }
     }
 
     SerializeWith {
         value: #value,
         phantom: ::std::marker::PhantomData::<#item_ty>,
@@ -97,24 +99,34 @@ a pre-existing iterator.
 Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latter
 does not produce a trailing comma. This matches the behavior of delimiters in
 `macro_rules!`.
 
 ## Hygiene
 
 Any interpolated tokens preserve the `Span` information provided by their
 `ToTokens` implementation. Tokens that originate within a `quote!` invocation
-are spanned with [`Span::def_site()`].
+are spanned with [`Span::call_site()`].
 
-[`Span::def_site()`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html#method.def_site
+[`Span::call_site()`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html#method.call_site
 
 A different span can be provided explicitly through the [`quote_spanned!`]
 macro.
 
-[`quote_spanned!`]: https://docs.rs/quote/0.5/quote/macro.quote_spanned.html
+[`quote_spanned!`]: https://docs.rs/quote/0.6/quote/macro.quote_spanned.html
+
+### Limitations
+
+- A non-repeating variable may not be interpolated inside of a repeating block
+  ([#7]).
+- The same variable may not be interpolated more than once inside of a repeating
+  block ([#8]).
+
+[#7]: https://github.com/dtolnay/quote/issues/7
+[#8]: https://github.com/dtolnay/quote/issues/8
 
 ### Recursion limit
 
 The `quote!` macro relies on deep recursion so some large invocations may fail
 with "recursion limit reached" when you compile. If it fails, bump up the
 recursion limit by adding `#![recursion_limit = "128"]` to your crate. An even
 higher limit may be necessary for especially large invocations. You don't need
 this unless the compiler tells you that you need it.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/quote/src/ext.rs
@@ -0,0 +1,113 @@
+use super::ToTokens;
+
+use proc_macro2::{TokenStream, TokenTree};
+
+/// TokenStream extension trait with methods for appending tokens.
+///
+/// This trait is sealed and cannot be implemented outside of the `quote` crate.
+pub trait TokenStreamExt: private::Sealed {
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>;
+
+    fn append_all<T, I>(&mut self, iter: I)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>;
+
+    fn append_separated<T, I, U>(&mut self, iter: I, op: U)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>,
+        U: ToTokens;
+
+    fn append_terminated<T, I, U>(&mut self, iter: I, term: U)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>,
+        U: ToTokens;
+}
+
+impl TokenStreamExt for TokenStream {
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends the token specified to this list of tokens.
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>,
+    {
+        self.extend(Some(token.into()));
+    }
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// ```
+    /// # #[macro_use] extern crate quote;
+    /// # extern crate proc_macro2;
+    /// # use quote::{TokenStreamExt, ToTokens};
+    /// # use proc_macro2::TokenStream;
+    /// # fn main() {
+    /// struct X;
+    ///
+    /// impl ToTokens for X {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         tokens.append_all(&[true, false]);
+    ///     }
+    /// }
+    ///
+    /// let tokens = quote!(#X);
+    /// assert_eq!(tokens.to_string(), "true false");
+    /// # }
+    /// ```
+    fn append_all<T, I>(&mut self, iter: I)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>,
+    {
+        for token in iter {
+            token.to_tokens(self);
+        }
+    }
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all of the items in the iterator `I`, separated by the tokens
+    /// `U`.
+    fn append_separated<T, I, U>(&mut self, iter: I, op: U)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>,
+        U: ToTokens,
+    {
+        for (i, token) in iter.into_iter().enumerate() {
+            if i > 0 {
+                op.to_tokens(self);
+            }
+            token.to_tokens(self);
+        }
+    }
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all tokens in the iterator `I`, appending `U` after each
+    /// element, including after the last element of the iterator.
+    fn append_terminated<T, I, U>(&mut self, iter: I, term: U)
+    where
+        T: ToTokens,
+        I: IntoIterator<Item = T>,
+        U: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+            term.to_tokens(self);
+        }
+    }
+}
+
+mod private {
+    use proc_macro2::TokenStream;
+
+    pub trait Sealed {}
+
+    impl Sealed for TokenStream {}
+}
--- a/third_party/rust/quote/src/lib.rs
+++ b/third_party/rust/quote/src/lib.rs
@@ -21,17 +21,17 @@
 //! general-purpose Rust quasi-quoting library and is not specific to procedural
 //! macros.
 //!
 //! *Version requirement: Quote supports any compiler version back to Rust's
 //! very first support for procedural macros in Rust 1.15.0.*
 //!
 //! ```toml
 //! [dependencies]
-//! quote = "0.5"
+//! quote = "0.6"
 //! ```
 //!
 //! ```
 //! #[macro_use]
 //! extern crate quote;
 //! #
 //! # fn main() {}
 //! ```
@@ -63,17 +63,18 @@
 //! let tokens = quote! {
 //!     struct SerializeWith #generics #where_clause {
 //!         value: &'a #field_ty,
 //!         phantom: ::std::marker::PhantomData<#item_ty>,
 //!     }
 //!
 //!     impl #generics serde::Serialize for SerializeWith #generics #where_clause {
 //!         fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error>
-//!             where S: serde::Serializer
+//!         where
+//!             S: serde::Serializer,
 //!         {
 //!             #path(self.value, s)
 //!         }
 //!     }
 //!
 //!     SerializeWith {
 //!         value: #value,
 //!         phantom: ::std::marker::PhantomData::<#item_ty>,
@@ -86,51 +87,51 @@
 //! ## Recursion limit
 //!
 //! The `quote!` macro relies on deep recursion so some large invocations may
 //! fail with "recursion limit reached" when you compile. If it fails, bump up
 //! the recursion limit by adding `#![recursion_limit = "128"]` to your crate.
 //! An even higher limit may be necessary for especially large invocations.
 
 // Quote types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/quote/0.5.2")]
+#![doc(html_root_url = "https://docs.rs/quote/0.6.3")]
 
 #[cfg(feature = "proc-macro")]
 extern crate proc_macro;
 extern crate proc_macro2;
 
-mod tokens;
-pub use tokens::Tokens;
+mod ext;
+pub use ext::TokenStreamExt;
 
 mod to_tokens;
 pub use to_tokens::ToTokens;
 
 // Not public API.
 #[doc(hidden)]
 pub mod __rt {
     // Not public API.
     pub use proc_macro2::*;
 
     // Not public API.
-    pub fn parse(tokens: &mut ::Tokens, span: Span, s: &str) {
+    pub fn parse(tokens: &mut TokenStream, span: Span, s: &str) {
         let s: TokenStream = s.parse().expect("invalid token stream");
-        tokens.append_all(s.into_iter().map(|mut t| {
+        tokens.extend(s.into_iter().map(|mut t| {
             t.set_span(span);
             t
         }));
     }
 }
 
 /// The whole point.
 ///
 /// Performs variable interpolation against the input and produces it as
-/// [`Tokens`]. For returning tokens to the compiler in a procedural macro, use
+/// [`TokenStream`]. For returning tokens to the compiler in a procedural macro, use
 /// `into()` to build a `TokenStream`.
 ///
-/// [`Tokens`]: struct.Tokens.html
+/// [`TokenStream`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.TokenStream.html
 ///
 /// # Interpolation
 ///
 /// Variable interpolation is done with `#var` (similar to `$var` in
 /// `macro_rules!` macros). This grabs the `var` variable that is currently in
 /// scope and inserts it in that location in the output tokens. The variable
 /// must implement the [`ToTokens`] trait.
 ///
@@ -148,28 +149,27 @@ pub mod __rt {
 /// - `#( #k => println!("{}", #v), )*` — even multiple interpolations
 ///
 /// # Hygiene
 ///
 /// Any interpolated tokens preserve the `Span` information provided by their
 /// `ToTokens` implementation. Tokens that originate within the `quote!`
 /// invocation are spanned with [`Span::call_site()`].
 ///
-/// [`Span::call_site()`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html#method.call_site
+/// [`Span::call_site()`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html#method.call_site
 ///
 /// A different span can be provided through the [`quote_spanned!`] macro.
 ///
 /// [`quote_spanned!`]: macro.quote_spanned.html
 ///
 /// # Example
 ///
 /// ```
-/// # #[cfg(feature = "proc-macro")]
+/// # #[cfg(any())]
 /// extern crate proc_macro;
-/// # #[cfg(not(feature = "proc-macro"))]
 /// # extern crate proc_macro2 as proc_macro;
 ///
 /// #[macro_use]
 /// extern crate quote;
 ///
 /// use proc_macro::TokenStream;
 ///
 /// # const IGNORE_TOKENS: &'static str = stringify! {
@@ -209,17 +209,17 @@ macro_rules! quote {
 /// the macro invocation.
 ///
 /// # Syntax
 ///
 /// A span expression of type [`Span`], followed by `=>`, followed by the tokens
 /// to quote. The span expression should be brief -- use a variable for anything
 /// more than a few characters. There should be no space before the `=>` token.
 ///
-/// [`Span`]: https://docs.rs/proc-macro2/0.2/proc_macro2/struct.Span.html
+/// [`Span`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html
 ///
 /// ```
 /// # #[macro_use]
 /// # extern crate quote;
 /// # extern crate proc_macro2;
 /// #
 /// # use proc_macro2::Span;
 /// #
@@ -260,29 +260,29 @@ macro_rules! quote {
 ///
 /// [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
 ///
 /// ```
 /// # #[macro_use]
 /// # extern crate quote;
 /// # extern crate proc_macro2;
 /// #
-/// # use quote::{Tokens, ToTokens};
-/// # use proc_macro2::Span;
+/// # use quote::{TokenStreamExt, ToTokens};
+/// # use proc_macro2::{Span, TokenStream};
 /// #
 /// # struct Type;
 /// #
 /// # impl Type {
 /// #     fn span(&self) -> Span {
 /// #         Span::call_site()
 /// #     }
 /// # }
 /// #
 /// # impl ToTokens for Type {
-/// #     fn to_tokens(&self, _tokens: &mut Tokens) {}
+/// #     fn to_tokens(&self, _tokens: &mut TokenStream) {}
 /// # }
 /// #
 /// # fn main() {
 /// # let ty = Type;
 /// # let call_site = Span::call_site();
 /// #
 /// let ty_span = ty.span();
 /// let assert_sync = quote_spanned! {ty_span=>
@@ -308,17 +308,17 @@ macro_rules! quote {
 /// that `Sync` resolves at the macro definition site and not the macro call
 /// site. If we resolve `Sync` at the same span that the user's type is going to
 /// be resolved, then they could bypass our check by defining their own trait
 /// named `Sync` that is implemented for their type.
 #[macro_export]
 macro_rules! quote_spanned {
     ($span:expr=> $($tt:tt)*) => {
         {
-            let mut _s = $crate::Tokens::new();
+            let mut _s = $crate::__rt::TokenStream::new();
             let _span = $span;
             quote_each_token!(_s _span $($tt)*);
             _s
         }
     };
 }
 
 // Extract the names of all #metavariables and pass them to the $finish macro.
@@ -446,64 +446,64 @@ macro_rules! quote_each_token {
             }
             quote_each_token!($tokens $span $($inner)*);
         }
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident # [ $($inner:tt)* ] $($rest:tt)*) => {
         quote_each_token!($tokens $span #);
-        $tokens.append({
+        $tokens.extend({
             let mut g = $crate::__rt::Group::new(
                 $crate::__rt::Delimiter::Bracket,
                 quote_spanned!($span=> $($inner)*).into(),
             );
             g.set_span($span);
-            g
+            Some($crate::__rt::TokenTree::from(g))
         });
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident # $first:ident $($rest:tt)*) => {
         $crate::ToTokens::to_tokens(&$first, &mut $tokens);
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident ( $($first:tt)* ) $($rest:tt)*) => {
-        $tokens.append({
+        $tokens.extend({
             let mut g = $crate::__rt::Group::new(
                 $crate::__rt::Delimiter::Parenthesis,
                 quote_spanned!($span=> $($first)*).into(),
             );
             g.set_span($span);
-            g
+            Some($crate::__rt::TokenTree::from(g))
         });
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident [ $($first:tt)* ] $($rest:tt)*) => {
-        $tokens.append({
+        $tokens.extend({
             let mut g = $crate::__rt::Group::new(
                 $crate::__rt::Delimiter::Bracket,
                 quote_spanned!($span=> $($first)*).into(),
             );
             g.set_span($span);
-            g
+            Some($crate::__rt::TokenTree::from(g))
         });
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident { $($first:tt)* } $($rest:tt)*) => {
-        $tokens.append({
+        $tokens.extend({
             let mut g = $crate::__rt::Group::new(
                 $crate::__rt::Delimiter::Brace,
                 quote_spanned!($span=> $($first)*).into(),
             );
             g.set_span($span);
-            g
+            Some($crate::__rt::TokenTree::from(g))
         });
         quote_each_token!($tokens $span $($rest)*);
     };
 
     ($tokens:ident $span:ident $first:tt $($rest:tt)*) => {
         // TODO: this seems slow... special case some `:tt` arguments?
         $crate::__rt::parse(&mut $tokens, $span, stringify!($first));
         quote_each_token!($tokens $span $($rest)*);
--- a/third_party/rust/quote/src/to_tokens.rs
+++ b/third_party/rust/quote/src/to_tokens.rs
@@ -1,116 +1,123 @@
-use super::Tokens;
+use super::TokenStreamExt;
 
 use std::borrow::Cow;
 
-use proc_macro2::{Group, Literal, Op, Span, Term, TokenStream, TokenTree};
+use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
 
 /// Types that can be interpolated inside a [`quote!`] invocation.
 ///
 /// [`quote!`]: macro.quote.html
 pub trait ToTokens {
-    /// Write `self` to the given `Tokens`.
+    /// Write `self` to the given `TokenStream`.
+    ///
+    /// The token append methods provided by the [`TokenStreamExt`] extension
+    /// trait may be useful for implementing `ToTokens`.
+    ///
+    /// [`TokenStreamExt`]: trait.TokenStreamExt.html
+    ///
+    /// # Example
     ///
     /// Example implementation for a struct representing Rust paths like
     /// `std::cmp::PartialEq`:
     ///
     /// ```
     /// extern crate quote;
-    /// use quote::{Tokens, ToTokens};
+    /// use quote::{TokenStreamExt, ToTokens};
     ///
     /// extern crate proc_macro2;
-    /// use proc_macro2::{TokenTree, Spacing, Span, Op};
+    /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
     ///
     /// pub struct Path {
     ///     pub global: bool,
     ///     pub segments: Vec<PathSegment>,
     /// }
     ///
     /// impl ToTokens for Path {
-    ///     fn to_tokens(&self, tokens: &mut Tokens) {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
     ///         for (i, segment) in self.segments.iter().enumerate() {
     ///             if i > 0 || self.global {
     ///                 // Double colon `::`
-    ///                 tokens.append(Op::new(':', Spacing::Joint));
-    ///                 tokens.append(Op::new(':', Spacing::Alone));
+    ///                 tokens.append(Punct::new(':', Spacing::Joint));
+    ///                 tokens.append(Punct::new(':', Spacing::Alone));
     ///             }
     ///             segment.to_tokens(tokens);
     ///         }
     ///     }
     /// }
     /// #
     /// # pub struct PathSegment;
     /// #
     /// # impl ToTokens for PathSegment {
-    /// #     fn to_tokens(&self, tokens: &mut Tokens) {
+    /// #     fn to_tokens(&self, tokens: &mut TokenStream) {
     /// #         unimplemented!()
     /// #     }
     /// # }
     /// #
     /// # fn main() {}
     /// ```
-    fn to_tokens(&self, tokens: &mut Tokens);
+    fn to_tokens(&self, tokens: &mut TokenStream);
 
-    /// Convert `self` directly into a `Tokens` object.
+    /// Convert `self` directly into a `TokenStream` object.
     ///
     /// This method is implicitly implemented using `to_tokens`, and acts as a
     /// convenience method for consumers of the `ToTokens` trait.
-    fn into_tokens(self) -> Tokens
+    fn into_token_stream(self) -> TokenStream
     where
         Self: Sized,
     {
-        let mut tokens = Tokens::new();
+        let mut tokens = TokenStream::new();
         self.to_tokens(&mut tokens);
         tokens
     }
 }
 
 impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         (**self).to_tokens(tokens);
     }
 }
 
 impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         (**self).to_tokens(tokens);
     }
 }
 
 impl<T: ?Sized + ToTokens> ToTokens for Box<T> {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         (**self).to_tokens(tokens);
     }
 }
 
 impl<T: ToTokens> ToTokens for Option<T> {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         if let Some(ref t) = *self {
             t.to_tokens(tokens);
         }
     }
 }
 
 impl ToTokens for str {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(Literal::string(self));
     }
 }
 
 impl ToTokens for String {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         self.as_str().to_tokens(tokens);
     }
 }
 
 macro_rules! primitive {
     ($($t:ident => $name:ident)*) => ($(
         impl ToTokens for $t {
-            fn to_tokens(&self, tokens: &mut Tokens) {
+            fn to_tokens(&self, tokens: &mut TokenStream) {
                 tokens.append(Literal::$name(*self));
             }
         }
     )*)
 }
 
 primitive! {
     i8 => i8_suffixed
@@ -125,55 +132,59 @@ primitive! {
     u64 => u64_suffixed
     usize => usize_suffixed
 
     f32 => f32_suffixed
     f64 => f64_suffixed
 }
 
 impl ToTokens for char {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(Literal::character(*self));
     }
 }
 
 impl ToTokens for bool {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         let word = if *self { "true" } else { "false" };
-        tokens.append(Term::new(word, Span::call_site()));
+        tokens.append(Ident::new(word, Span::call_site()));
     }
 }
 
 impl ToTokens for Group {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(self.clone());
     }
 }
 
-impl ToTokens for Term {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+impl ToTokens for Ident {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(self.clone());
     }
 }
 
-impl ToTokens for Op {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+impl ToTokens for Punct {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(self.clone());
     }
 }
 
 impl ToTokens for Literal {
-    fn to_tokens(&self, tokens: &mut Tokens) {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
         tokens.append(self.clone());
     }
 }
 
 impl ToTokens for TokenTree {
-    fn to_tokens(&self, dst: &mut Tokens) {
+    fn to_tokens(&self, dst: &mut TokenStream) {
         dst.append(self.clone());
     }
 }
 
 impl ToTokens for TokenStream {
-    fn to_tokens(&self, dst: &mut Tokens) {
+    fn to_tokens(&self, dst: &mut TokenStream) {
         dst.append_all(self.clone().into_iter());
     }
+
+    fn into_token_stream(self) -> TokenStream {
+        self
+    }
 }
--- a/third_party/rust/quote/tests/test.rs
+++ b/third_party/rust/quote/tests/test.rs
@@ -1,39 +1,40 @@
 #![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))]
 
 use std::borrow::Cow;
 
 extern crate proc_macro2;
 #[macro_use]
 extern crate quote;
 
-use proc_macro2::{Span, Term};
+use proc_macro2::{Ident, Span, TokenStream};
+use quote::TokenStreamExt;
 
 struct X;
 
 impl quote::ToTokens for X {
-    fn to_tokens(&self, tokens: &mut quote::Tokens) {
-        tokens.append(Term::new("X", Span::call_site()));
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Ident::new("X", Span::call_site()));
     }
 }
 
 #[test]
 fn test_quote_impl() {
     let tokens = quote! {
         impl<'a, T: ToTokens> ToTokens for &'a T {
-            fn to_tokens(&self, tokens: &mut Tokens) {
+            fn to_tokens(&self, tokens: &mut TokenStream) {
                 (**self).to_tokens(tokens)
             }
         }
     };
 
     let expected = concat!(
         "impl < 'a , T : ToTokens > ToTokens for & 'a T { ",
-        "fn to_tokens ( & self , tokens : & mut Tokens ) { ",
+        "fn to_tokens ( & self , tokens : & mut TokenStream ) { ",
         "( * * self ) . to_tokens ( tokens ) ",
         "} ",
         "}"
     );
 
     assert_eq!(expected, tokens.to_string());
 }
 
@@ -177,18 +178,18 @@ fn test_string() {
     let s = "\0 a 'b \" c".to_string();
     let tokens = quote!(#s);
     let expected = "\"\\u{0} a \\'b \\\" c\"";
     assert_eq!(expected, tokens.to_string());
 }
 
 #[test]
 fn test_ident() {
-    let foo = Term::new("Foo", Span::call_site());
-    let bar = Term::new(&format!("Bar{}", 7), Span::call_site());
+    let foo = Ident::new("Foo", Span::call_site());
+    let bar = Ident::new(&format!("Bar{}", 7), Span::call_site());
     let tokens = quote!(struct #foo; enum #bar {});
     let expected = "struct Foo ; enum Bar7 { }";
     assert_eq!(expected, tokens.to_string());
 }
 
 #[test]
 fn test_duplicate() {
     let ch = 'x';
@@ -252,29 +253,29 @@ fn test_empty_quote() {
 fn test_box_str() {
     let b = "str".to_owned().into_boxed_str();
     let tokens = quote! { #b };
     assert_eq!("\"str\"", tokens.to_string());
 }
 
 #[test]
 fn test_cow() {
-    let owned: Cow<Term> = Cow::Owned(Term::new("owned", Span::call_site()));
+    let owned: Cow<Ident> = Cow::Owned(Ident::new("owned", Span::call_site()));
 
-    let ident = Term::new("borrowed", Span::call_site());
+    let ident = Ident::new("borrowed", Span::call_site());
     let borrowed = Cow::Borrowed(&ident);
 
     let tokens = quote! { #owned #borrowed };
     assert_eq!("owned borrowed", tokens.to_string());
 }
 
 #[test]
 fn test_closure() {
-    fn field_i(i: usize) -> Term {
-        Term::new(&format!("__field{}", i), Span::call_site())
+    fn field_i(i: usize) -> Ident {
+        Ident::new(&format!("__field{}", i), Span::call_site())
     }
 
     let fields = (0usize..3)
         .map(field_i as fn(_) -> _)
         .map(|var| quote! { #var });
 
     let tokens = quote! { #(#fields)* };
     assert_eq!("__field0 __field1 __field2", tokens.to_string());
--- a/third_party/rust/serde/.cargo-checksum.json
+++ b/third_party/rust/serde/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"cf6e0bc93d4aa0e3a918240d385ecd9f97e2811c3a408d1acd5d31a3da23df15","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"16de77b2d10fac8c70219ba183ad083ae12d4553c6f3213dec39d9936622b371","build.rs":"c441b6b782f4962671f74d86db0442ae8e93aced058dac2d4c17044e1740af4c","src/de/from_primitive.rs":"46b635d939b10163a01739b082cff4b7f2635579920f8160aeadc03f33ad2b51","src/de/ignored_any.rs":"ea47caa53548c394a70bb512afd75b2de7fc9937b33518606282e4084dc70a77","src/de/impls.rs":"072a58dc9c33cc021ecbfc91626d5ea403b263fff0bbfa4516db585719ccc646","src/de/mod.rs":"2df8b3522b03e4bab5a5e0aa6ad45638c8bd21ea048aab5852f8cde5da405268","src/de/utf8.rs":"956b124b7ce98353cb781b56e43a6fed2e67f1389d35b7a468d5be75b1485853","src/de/value.rs":"004a5892e75fdfe015399027429da0ad4ee4ac3db50a980a38339f20bdbdd8e3","src/export.rs":"4e3ed8aa2b0e5d9c18f462183dff7fa4772a30e88e6b3cc0fb9712282ecbe0c5","src/lib.rs":"91df096c81fd3a478d337d29249d0f25eedb872ea00a261eb993df1897386fff","src/macros.rs":"a563019118ab3b1d408fb5fb9f2f80ec64cb53fe7af0fc0e0f35c2cf503b92f8","src/private/de.rs":"283c690c87db77f5adc6d03d62a9731a77b2c79a4d10ec5884d7872d80d573d0","src/private/macros.rs":"6861a4f332ea24d0ed5db1c28fe3105d2716523902f045c0bbbd439ebf9e44de","src/private/mod.rs":"0c774d86042cefdb447857070a1d4d2c0b9f519a7f5db588a1e7fcc16ca5a511","src/private/ser.rs":"189a091e1e77354c7859f34dc564879ad0116bb9fc340b55c3a718ae3126b36a","src/ser/impls.rs":"d5434a4eed1d82b040dc8a73a566a3bc4c085d99a20585654057461088fe0bb8","src/ser/impossible.rs":"91da408362284ec567b2316050900251ff66a1134413963720154fb70f3919c0","src/ser/mod.rs":"cc6c6155139df6e7270d880ad9e5aafb60542a6e0c2230620e0e6315858f82be"},"package":"34e9df8efbe7a2c12ceec1fc8744d56ae3374d8ae325f4a0028949d16433d554"}
\ No newline at end of file
+{"files":{"Cargo.toml":"844ca61f123bafc3da9cf0409d3425f20d3796e38607e88f33fe328c277589e9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"fe0d3aa328d0e26c76f646c45197bc8c518257d31f3640baed096915b9bdf642","build.rs":"8a7c78d54d7a36e31b21014a9818a3847d6e4e6ee439ecc1d34e6fdef3927ae7","crates-io.md":"4de7b932987feadedd392855d166d0346e8f405190e8085a2e2f84c936a68959","src/de/from_primitive.rs":"3cf03cb47d884ff32555673831d79de8f6bf0c58a22783d73077d1f694c1494d","src/de/ignored_any.rs":"ea47caa53548c394a70bb512afd75b2de7fc9937b33518606282e4084dc70a77","src/de/impls.rs":"19fe62cd61cf74d58eebcec1ad7f96aa5f0824d0173c214d9b0784affd00ab35","src/de/mod.rs":"31466428748f808de1b7f1940047b5c46474604745fc898f39eee182075204aa","src/de/utf8.rs":"956b124b7ce98353cb781b56e43a6fed2e67f1389d35b7a468d5be75b1485853","src/de/value.rs":"5883ea09fb61c30fcb7422a000688481f4fae4c0980ca4618f8b5747b573d545","src/export.rs":"4e3ed8aa2b0e5d9c18f462183dff7fa4772a30e88e6b3cc0fb9712282ecbe0c5","src/integer128.rs":"1bf9e18047a4a3f95a43b8d253e4f844b6be62e71684e47d980582462bce4223","src/lib.rs":"7b24f7fff89cc5122ab1a128285425ad8c287598bbd973a937aa20c5340cacf3","src/macros.rs":"bcffeb59dd91a23368f0c0e5cca5bdbf9dedc7850162c1d571b5d2902a73a309","src/private/de.rs":"3b2dc579aea37c8f231ed2228a584f146f71799f393547583cc7ea182ec551e6","src/private/macros.rs":"6861a4f332ea24d0ed5db1c28fe3105d2716523902f045c0bbbd439ebf9e44de","src/private/mod.rs":"0c774d86042cefdb447857070a1d4d2c0b9f519a7f5db588a1e7fcc16ca5a511","src/private/ser.rs":"56b61986a7c57d37d65d763cb69119889a3dc06eb27a9e95cd5e758acf0e4535","src/ser/impls.rs":"3735a8620dd0e7ff33e33c15f844ecb76207d5101389bf45abca732bd48294eb","src/ser/impossible.rs":"91da408362284ec567b2316050900251ff66a1134413963720154fb70f3919c0","src/ser/mod.rs":"5a1c38bfb1898e7fd41f8f5b53c9fc952edb66d23de1356941050314f37504a0"},"package":"e9a2d9a9ac5120e0f768801ca2b58ad6eec929dc9d1d616c162f208869c2ce95"}
\ No newline at end of file
--- a/third_party/rust/serde/Cargo.toml
+++ b/third_party/rust/serde/Cargo.toml
@@ -7,24 +7,24 @@
 #
 # 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 = "serde"
-version = "1.0.58"
+version = "1.0.66"
 authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
 build = "build.rs"
-include = ["Cargo.toml", "build.rs", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
+include = ["Cargo.toml", "build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
 description = "A generic serialization/deserialization framework"
 homepage = "https://serde.rs"
 documentation = "https://docs.serde.rs/serde/"
-readme = "README.md"
+readme = "crates-io.md"
 keywords = ["serde", "serialization", "no_std"]
 categories = ["encoding"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/serde-rs/serde"
 [dependencies.serde_derive]
 version = "1.0"
 optional = true
 [dev-dependencies.serde_derive]
--- a/third_party/rust/serde/README.md
+++ b/third_party/rust/serde/README.md
@@ -20,17 +20,17 @@ You may be looking for:
 - [API documentation](https://docs.serde.rs/serde/)
 - [Release notes](https://github.com/serde-rs/serde/releases)
 
 ## Serde in action
 
 <details>
 <summary>
 Click to show Cargo.toml.
-<a href="http://play.integer32.com/?gist=9003c5b88c1f4989941925d7190c6eec" target="_blank">Run this code in the playground.</a>
+<a href="https://play.rust-lang.org/?gist=9003c5b88c1f4989941925d7190c6eec" target="_blank">Run this code in the playground.</a>
 </summary>
 
 ```toml
 [dependencies]
 
 # The core APIs, including the Serialize and Deserialize traits. Always
 # required when using Serde.
 serde = "1.0"
--- a/third_party/rust/serde/build.rs
+++ b/third_party/rust/serde/build.rs
@@ -1,41 +1,78 @@
 use std::env;
 use std::process::Command;
 use std::str::{self, FromStr};
 
+// The rustc-cfg strings below are *not* public API. Please let us know by
+// opening a GitHub issue if your build environment requires some way to enable
+// these cfgs other than by executing our build script.
 fn main() {
-    let rustc = match env::var_os("RUSTC") {
-        Some(rustc) => rustc,
+    let minor = match rustc_minor_version() {
+        Some(minor) => minor,
         None => return,
     };
 
-    let output = match Command::new(rustc).arg("--version").output() {
-        Ok(output) => output,
-        Err(_) => return,
-    };
-
-    let version = match str::from_utf8(&output.stdout) {
-        Ok(version) => version,
-        Err(_) => return,
-    };
-
-    let mut pieces = version.split('.');
-    if pieces.next() != Some("rustc 1") {
-        return;
+    // CString::into_boxed_c_str stabilized in Rust 1.20:
+    // https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str
+    if minor >= 20 {
+        println!("cargo:rustc-cfg=de_boxed_c_str");
     }
 
-    let next = match pieces.next() {
-        Some(next) => next,
-        None => return,
-    };
+    // From<Box<T>> for Rc<T> / Arc<T> stabilized in Rust 1.21:
+    // https://doc.rust-lang.org/std/rc/struct.Rc.html#impl-From<Box<T>>
+    // https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-From<Box<T>>
+    if minor >= 21 {
+        println!("cargo:rustc-cfg=de_rc_dst");
+    }
 
-    let minor = match u32::from_str(next) {
-        Ok(minor) => minor,
-        Err(_) => return,
-    };
+    // Duration available in core since Rust 1.25:
+    // https://blog.rust-lang.org/2018/03/29/Rust-1.25.html#library-stabilizations
+    if minor >= 25 {
+        println!("cargo:rustc-cfg=core_duration");
+    }
 
     // 128-bit integers stabilized in Rust 1.26:
     // https://blog.rust-lang.org/2018/05/10/Rust-1.26.html
     if minor >= 26 {
         println!("cargo:rustc-cfg=integer128");
     }
+
+    // Non-zero integers stabilized in Rust 1.28:
+    // https://github.com/rust-lang/rust/pull/50808
+    if minor >= 28 {
+        println!("cargo:rustc-cfg=num_nonzero");
+    }
 }
+
+fn rustc_minor_version() -> Option<u32> {
+    let rustc = match env::var_os("RUSTC") {
+        Some(rustc) => rustc,
+        None => return None,
+    };
+
+    let output = match Command::new(rustc).arg("--version").output() {
+        Ok(output) => output,
+        Err(_) => return None,
+    };
+
+    let version = match str::from_utf8(&output.stdout) {
+        Ok(version) => version,
+        Err(_) => return None,
+    };
+
+    // Temporary workaround to support the old 1.26-dev compiler on docs.rs.
+    if version.contains("0eb87c9bf") {
+        return Some(25);
+    }
+
+    let mut pieces = version.split('.');
+    if pieces.next() != Some("rustc 1") {
+        return None;
+    }
+
+    let next = match pieces.next() {
+        Some(next) => next,
+        None => return None,
+    };
+
+    u32::from_str(next).ok()
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/serde/crates-io.md
@@ -0,0 +1,55 @@
+<!-- Serde readme rendered on crates.io -->
+
+**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**
+
+---
+
+You may be looking for:
+
+- [An overview of Serde](https://serde.rs/)
+- [Data formats supported by Serde](https://serde.rs/#data-formats)
+- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/codegen.html)
+- [Examples](https://serde.rs/examples.html)
+- [API documentation](https://docs.serde.rs/serde/)
+- [Release notes](https://github.com/serde-rs/serde/releases)
+
+## Serde in action
+
+```rust
+#[macro_use]
+extern crate serde_derive;
+
+extern crate serde;
+extern crate serde_json;
+
+#[derive(Serialize, Deserialize, Debug)]
+struct Point {
+    x: i32,
+    y: i32,
+}
+
+fn main() {
+    let point = Point { x: 1, y: 2 };
+
+    // Convert the Point to a JSON string.
+    let serialized = serde_json::to_string(&point).unwrap();
+
+    // Prints serialized = {"x":1,"y":2}
+    println!("serialized = {}", serialized);
+
+    // Convert the JSON string back to a Point.
+    let deserialized: Point = serde_json::from_str(&serialized).unwrap();
+
+    // Prints deserialized = Point { x: 1, y: 2 }
+    println!("deserialized = {:?}", deserialized);
+}
+```
+
+## Getting help
+
+Serde developers live in the #serde channel on
+[`irc.mozilla.org`](https://wiki.mozilla.org/IRC). The #rust channel is also a
+good resource with generally faster response time but less specific knowledge
+about Serde. If IRC is not your thing or you don't get a good response, we are
+happy to respond to [GitHub issues](https://github.com/serde-rs/serde/issues/new)
+as well.
--- a/third_party/rust/serde/src/de/from_primitive.rs
+++ b/third_party/rust/serde/src/de/from_primitive.rs
@@ -173,8 +173,96 @@ impl_from_primitive_for_int!(i32);
 impl_from_primitive_for_int!(i64);
 impl_from_primitive_for_uint!(usize);
 impl_from_primitive_for_uint!(u8);
 impl_from_primitive_for_uint!(u16);
 impl_from_primitive_for_uint!(u32);
 impl_from_primitive_for_uint!(u64);
 impl_from_primitive_for_float!(f32);
 impl_from_primitive_for_float!(f64);
+
+serde_if_integer128! {
+    impl FromPrimitive for i128 {
+        #[inline]
+        fn from_i8(n: i8) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i16(n: i16) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i32(n: i32) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i64(n: i64) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u8(n: u8) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u16(n: u16) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u32(n: u32) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u64(n: u64) -> Option<Self> {
+            Some(n as i128)
+        }
+    }
+
+    impl FromPrimitive for u128 {
+        #[inline]
+        fn from_i8(n: i8) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i16(n: i16) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i32(n: i32) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i64(n: i64) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_u8(n: u8) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u16(n: u16) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u32(n: u32) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u64(n: u64) -> Option<Self> {
+            Some(n as u128)
+        }
+    }
+}
--- a/third_party/rust/serde/src/de/impls.rs
+++ b/third_party/rust/serde/src/de/impls.rs
@@ -7,17 +7,17 @@
 // except according to those terms.
 
 use lib::*;
 
 use de::{
     Deserialize, Deserializer, EnumAccess, Error, SeqAccess, Unexpected, VariantAccess, Visitor,
 };
 
-#[cfg(any(feature = "std", feature = "alloc"))]
+#[cfg(any(core_duration, feature = "std", feature = "alloc"))]
 use de::MapAccess;
 
 use de::from_primitive::FromPrimitive;
 use private::de::InPlaceSeed;
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 use private::de::size_hint;
 
@@ -44,16 +44,26 @@ impl<'de> Deserialize<'de> for () {
     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
     where
         D: Deserializer<'de>,
     {
         deserializer.deserialize_unit(UnitVisitor)
     }
 }
 
+#[cfg(feature = "unstable")]
+impl<'de> Deserialize<'de> for ! {
+    fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        Err(Error::custom("cannot deserialize `!`"))
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 struct BoolVisitor;
 
 impl<'de> Visitor<'de> for BoolVisitor {
     type Value = bool;
 
     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -161,16 +171,102 @@ impl_deserialize_num!(u8, deserialize_u8
 impl_deserialize_num!(u16, deserialize_u16, integer);
 impl_deserialize_num!(u32, deserialize_u32, integer);
 impl_deserialize_num!(u64, deserialize_u64, integer);
 impl_deserialize_num!(usize, deserialize_u64, integer);
 
 impl_deserialize_num!(f32, deserialize_f32, integer, float);
 impl_deserialize_num!(f64, deserialize_f64, integer, float);
 
+serde_if_integer128! {
+    impl<'de> Deserialize<'de> for i128 {
+        #[inline]
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct PrimitiveVisitor;
+
+            impl<'de> Visitor<'de> for PrimitiveVisitor {
+                type Value = i128;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("i128")
+                }
+
+                impl_deserialize_num!(integer i128);
+
+                #[inline]
+                fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    Ok(v)
+                }
+
+                #[inline]
+                fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    if v <= i128::max_value() as u128 {
+                        Ok(v as i128)
+                    } else {
+                        Err(Error::invalid_value(Unexpected::Other("u128"), &self))
+                    }
+                }
+            }
+
+            deserializer.deserialize_i128(PrimitiveVisitor)
+        }
+    }
+
+    impl<'de> Deserialize<'de> for u128 {
+        #[inline]
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct PrimitiveVisitor;
+
+            impl<'de> Visitor<'de> for PrimitiveVisitor {
+                type Value = u128;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("u128")
+                }
+
+                impl_deserialize_num!(integer u128);
+
+                #[inline]
+                fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    if v >= 0 {
+                        Ok(v as u128)
+                    } else {
+                        Err(Error::invalid_value(Unexpected::Other("i128"), &self))
+                    }
+                }
+
+                #[inline]
+                fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    Ok(v)
+                }
+            }
+
+            deserializer.deserialize_u128(PrimitiveVisitor)
+        }
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 struct CharVisitor;
 
 impl<'de> Visitor<'de> for CharVisitor {
     type Value = char;
 
     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -482,17 +578,17 @@ macro_rules! forwarded_impl {
                 D: Deserializer<'de>,
             {
                 Deserialize::deserialize(deserializer).map($func)
             }
         }
     }
 }
 
-#[cfg(all(feature = "std", feature = "unstable"))]
+#[cfg(all(feature = "std", de_boxed_c_str))]
 forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
 
 ////////////////////////////////////////////////////////////////////////////////
 
 struct OptionVisitor<T> {
     marker: PhantomData<T>,
 }
 
@@ -1081,25 +1177,41 @@ map_impl!(
     map,
     HashMap::with_hasher(S::default()),
     HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default()));
 
 ////////////////////////////////////////////////////////////////////////////////
 
 #[cfg(feature = "std")]
 macro_rules! parse_ip_impl {
-    ($ty:ty; $size:expr) => {
+    ($expecting:tt $ty:ty; $size:tt) => {
         impl<'de> Deserialize<'de> for $ty {
             fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
             where
                 D: Deserializer<'de>,
             {
                 if deserializer.is_human_readable() {
-                    let s = try!(String::deserialize(deserializer));
-                    s.parse().map_err(Error::custom)
+                    struct IpAddrVisitor;
+
+                    impl<'de> Visitor<'de> for IpAddrVisitor {
+                        type Value = $ty;
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str($expecting)
+                        }
+
+                        fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                        where
+                            E: Error,
+                        {
+                            s.parse().map_err(Error::custom)
+                        }
+                    }
+
+                    deserializer.deserialize_str(IpAddrVisitor)
                 } else {
                     <[u8; $size]>::deserialize(deserializer).map(<$ty>::from)
                 }
             }
         }
     };
 }
 
@@ -1217,79 +1329,127 @@ macro_rules! deserialize_enum {
 
 #[cfg(feature = "std")]
 impl<'de> Deserialize<'de> for net::IpAddr {
     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
     where
         D: Deserializer<'de>,
     {
         if deserializer.is_human_readable() {
-            let s = try!(String::deserialize(deserializer));
-            s.parse().map_err(Error::custom)
+            struct IpAddrVisitor;
+
+            impl<'de> Visitor<'de> for IpAddrVisitor {
+                type Value = net::IpAddr;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("IP address")
+                }
+
+                fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    s.parse().map_err(Error::custom)
+                }
+            }
+
+            deserializer.deserialize_str(IpAddrVisitor)
         } else {
             use lib::net::IpAddr;
             deserialize_enum!{
                 IpAddr IpAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
                 "`V4` or `V6`",
                 deserializer
             }
         }
     }
 }
 
 #[cfg(feature = "std")]
-parse_ip_impl!(net::Ipv4Addr; 4);
+parse_ip_impl!("IPv4 address" net::Ipv4Addr; 4);
 
 #[cfg(feature = "std")]
-parse_ip_impl!(net::Ipv6Addr; 16);
+parse_ip_impl!("IPv6 address" net::Ipv6Addr; 16);
 
 #[cfg(feature = "std")]
 macro_rules! parse_socket_impl {
-    ($ty:ty, $new:expr) => {
+    ($expecting:tt $ty:ty, $new:expr) => {
         impl<'de> Deserialize<'de> for $ty {
             fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
             where
                 D: Deserializer<'de>,
             {
                 if deserializer.is_human_readable() {
-                    let s = try!(String::deserialize(deserializer));
-                    s.parse().map_err(Error::custom)
+                    struct SocketAddrVisitor;
+
+                    impl<'de> Visitor<'de> for SocketAddrVisitor {
+                        type Value = $ty;
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str($expecting)
+                        }
+
+                        fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                        where
+                            E: Error,
+                        {
+                            s.parse().map_err(Error::custom)
+                        }
+                    }
+
+                    deserializer.deserialize_str(SocketAddrVisitor)
                 } else {
                     <(_, u16)>::deserialize(deserializer).map(|(ip, port)| $new(ip, port))
                 }
             }
         }
     };
 }
 
 #[cfg(feature = "std")]
 impl<'de> Deserialize<'de> for net::SocketAddr {
     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
     where
         D: Deserializer<'de>,
     {
         if deserializer.is_human_readable() {
-            let s = try!(String::deserialize(deserializer));
-            s.parse().map_err(Error::custom)
+            struct SocketAddrVisitor;
+
+            impl<'de> Visitor<'de> for SocketAddrVisitor {
+                type Value = net::SocketAddr;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("socket address")
+                }
+
+                fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    s.parse().map_err(Error::custom)
+                }
+            }
+
+            deserializer.deserialize_str(SocketAddrVisitor)
         } else {
             use lib::net::SocketAddr;
             deserialize_enum!{
                 SocketAddr SocketAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
                 "`V4` or `V6`",
                 deserializer
             }
         }
     }
 }
 
 #[cfg(feature = "std")]
-parse_socket_impl!(net::SocketAddrV4, net::SocketAddrV4::new);
+parse_socket_impl!("IPv4 socket address" net::SocketAddrV4, net::SocketAddrV4::new);
 
 #[cfg(feature = "std")]
-parse_socket_impl!(net::SocketAddrV6, |ip, port| net::SocketAddrV6::new(
+parse_socket_impl!("IPv6 socket address" net::SocketAddrV6, |ip, port| net::SocketAddrV6::new(
     ip, port, 0, 0
 ));
 
 ////////////////////////////////////////////////////////////////////////////////
 
 #[cfg(feature = "std")]
 struct PathVisitor;
 
@@ -1406,17 +1566,18 @@ impl<'de> Visitor<'de> for OsStringVisit
     #[cfg(windows)]
     fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
     where
         A: EnumAccess<'de>,
     {
         use std::os::windows::ffi::OsStringExt;
 
         match try!(data.variant()) {
-            (OsStringKind::Windows, v) => v.newtype_variant::<Vec<u16>>()
+            (OsStringKind::Windows, v) => v
+                .newtype_variant::<Vec<u16>>()
                 .map(|vec| OsString::from_wide(&vec)),
             (OsStringKind::Unix, _) => Err(Error::custom(
                 "cannot deserialize Unix OS string on Windows",
             )),
         }
     }
 }
 
@@ -1436,29 +1597,29 @@ impl<'de> Deserialize<'de> for OsString 
 forwarded_impl!((T), Box<T>, Box::new);
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 forwarded_impl!((T), Box<[T]>, Vec::into_boxed_slice);
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 forwarded_impl!((), Box<str>, String::into_boxed_str);
 
-#[cfg(all(not(feature = "unstable"), feature = "rc", any(feature = "std", feature = "alloc")))]
+#[cfg(all(not(de_rc_dst), feature = "rc", any(feature = "std", feature = "alloc")))]
 forwarded_impl! {
     /// This impl requires the [`"rc"`] Cargo feature of Serde.
     ///
     /// Deserializing a data structure containing `Arc` will not attempt to
     /// deduplicate `Arc` references to the same data. Every deserialized `Arc`
     /// will end up with a strong count of 1.
     ///
     /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
     (T), Arc<T>, Arc::new
 }
 
-#[cfg(all(not(feature = "unstable"), feature = "rc", any(feature = "std", feature = "alloc")))]
+#[cfg(all(not(de_rc_dst), feature = "rc", any(feature = "std", feature = "alloc")))]
 forwarded_impl! {
     /// This impl requires the [`"rc"`] Cargo feature of Serde.
     ///
     /// Deserializing a data structure containing `Rc` will not attempt to
     /// deduplicate `Rc` references to the same data. Every deserialized `Rc`
     /// will end up with a strong count of 1.
     ///
     /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
@@ -1515,17 +1676,17 @@ where
     {
         try!(Option::<T>::deserialize(deserializer));
         Ok(ArcWeak::new())
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
-#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))]
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
 macro_rules! box_forwarded_impl {
     (
         $(#[doc = $doc:tt])*
         $t:ident
     ) => {
         $(#[doc = $doc])*
         impl<'de, T: ?Sized> Deserialize<'de> for $t<T>
         where
@@ -1536,29 +1697,29 @@ macro_rules! box_forwarded_impl {
                 D: Deserializer<'de>,
             {
                 Box::deserialize(deserializer).map(Into::into)
             }
         }
     };
 }
 
-#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))]
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
 box_forwarded_impl! {
     /// This impl requires the [`"rc"`] Cargo feature of Serde.
     ///
     /// Deserializing a data structure containing `Rc` will not attempt to
     /// deduplicate `Rc` references to the same data. Every deserialized `Rc`
     /// will end up with a strong count of 1.
     ///
     /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
     Rc
 }
 
-#[cfg(all(feature = "unstable", feature = "rc", any(feature = "std", feature = "alloc")))]
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
 box_forwarded_impl! {
     /// This impl requires the [`"rc"`] Cargo feature of Serde.
     ///
     /// Deserializing a data structure containing `Arc` will not attempt to
     /// deduplicate `Arc` references to the same data. Every deserialized `Arc`
     /// will end up with a strong count of 1.
     ///
     /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
@@ -1592,17 +1753,17 @@ forwarded_impl!((T), RwLock<T>, RwLock::
 // This is a cleaned-up version of the impl generated by:
 //
 //     #[derive(Deserialize)]
 //     #[serde(deny_unknown_fields)]
 //     struct Duration {
 //         secs: u64,
 //         nanos: u32,
 //     }
-#[cfg(feature = "std")]
+#[cfg(any(core_duration, feature = "std"))]
 impl<'de> Deserialize<'de> for Duration {
     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
     where
         D: Deserializer<'de>,
     {
         // If this were outside of the serde crate, it would just use:
         //
         //    #[derive(Deserialize)]
@@ -1640,17 +1801,17 @@ impl<'de> Deserialize<'de> for Duration 
                     fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
                     where
                         E: Error,
                     {
                         match value {
                             b"secs" => Ok(Field::Secs),
                             b"nanos" => Ok(Field::Nanos),
                             _ => {
-                                let value = String::from_utf8_lossy(value);
+                                let value = ::export::from_utf8_lossy(value);
                                 Err(Error::unknown_field(&value, FIELDS))
                             }
                         }
                     }
                 }
 
                 deserializer.deserialize_identifier(FieldVisitor)
             }
@@ -2001,26 +2162,26 @@ where
             },
         )
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 macro_rules! nonzero_integers {
-    ( $( $T: ty, )+ ) => {
+    ( $( $T: ident, )+ ) => {
         $(
-            #[cfg(feature = "unstable")]
-            impl<'de> Deserialize<'de> for $T {
+            #[cfg(num_nonzero)]
+            impl<'de> Deserialize<'de> for num::$T {
                 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
                 where
                     D: Deserializer<'de>,
                 {
                     let value = try!(Deserialize::deserialize(deserializer));
-                    match <$T>::new(value) {
+                    match <num::$T>::new(value) {
                         Some(nonzero) => Ok(nonzero),
                         None => Err(Error::custom("expected a non-zero value")),
                     }
                 }
             }
         )+
     };
 }
--- a/third_party/rust/serde/src/de/mod.rs
+++ b/third_party/rust/serde/src/de/mod.rs
@@ -47,31 +47,31 @@
 //! # Implementations of Deserialize provided by Serde
 //!
 //! This is a slightly different set of types than what is supported for
 //! serialization. Some types can be serialized by Serde but not deserialized.
 //! One example is `OsStr`.
 //!
 //!  - **Primitive types**:
 //!    - bool
-//!    - i8, i16, i32, i64, isize
-//!    - u8, u16, u32, u64, usize
+//!    - i8, i16, i32, i64, i128, isize
+//!    - u8, u16, u32, u64, u128, usize
 //!    - f32, f64
 //!    - char
 //!  - **Compound types**:
-//!    - [T; 0] through [T; 32]
+//!    - \[T; 0\] through \[T; 32\]
 //!    - tuples up to size 16
 //!  - **Common standard library types**:
 //!    - String
 //!    - Option\<T\>
 //!    - Result\<T, E\>
 //!    - PhantomData\<T\>
 //!  - **Wrapper types**:
 //!    - Box\<T\>
-//!    - Box\<[T]\>
+//!    - Box\<\[T\]\>
 //!    - Box\<str\>
 //!    - Rc\<T\>
 //!    - Arc\<T\>
 //!    - Cow\<'a, T\>
 //!    - Cell\<T\>
 //!    - RefCell\<T\>
 //!    - Mutex\<T\>
 //!    - RwLock\<T\>
@@ -81,28 +81,29 @@
 //!    - BinaryHeap\<T\>
 //!    - HashMap\<K, V, H\>
 //!    - HashSet\<T, H\>
 //!    - LinkedList\<T\>
 //!    - VecDeque\<T\>
 //!    - Vec\<T\>
 //!  - **Zero-copy types**:
 //!    - &str
-//!    - &[u8]
+//!    - &\[u8\]
 //!  - **FFI types**:
 //!    - CString
 //!    - Box\<CStr\>
 //!    - OsString
 //!  - **Miscellaneous standard library types**:
 //!    - Duration
 //!    - SystemTime
 //!    - Path
 //!    - PathBuf
 //!    - Range\<T\>
-//!    - num::NonZero* (unstable)
+//!    - num::NonZero*
+//!    - `!` *(unstable)*
 //!  - **Net types**:
 //!    - IpAddr
 //!    - Ipv4Addr
 //!    - Ipv6Addr
 //!    - SocketAddr
 //!    - SocketAddrV4
 //!    - SocketAddrV6
 //!
@@ -143,16 +144,23 @@ macro_rules! declare_error_trait {
         /// general-purpose deserialization errors as well as errors specific to the
         /// particular deserialization format. For example the `Error` type of
         /// `serde_json` can represent errors like an invalid JSON escape sequence or an
         /// unterminated string literal, in addition to the error cases that are part of
         /// this trait.
         ///
         /// Most deserializers should only need to provide the `Error::custom` method
         /// and inherit the default behavior for the other methods.
+        ///
+        /// # Example implementation
+        ///
+        /// The [example data format] presented on the website shows an error
+        /// type appropriate for a basic JSON data format.
+        ///
+        /// [example data format]: https://serde.rs/data-format.html
         pub trait Error: Sized $(+ $($supertrait)::+)* {
             /// Raised when there is general error when deserializing a type.
             ///
             /// The message should not be capitalized and should not end with a period.
             ///
             /// ```rust
             /// # use std::str::FromStr;
             /// #
@@ -499,16 +507,24 @@ impl<'a> Display for Expected + 'a {
 /// Third-party crates may provide `Deserialize` implementations for types that
 /// they expose. For example the `linked-hash-map` crate provides a
 /// `LinkedHashMap<K, V>` type that is deserializable by Serde because the crate
 /// provides an implementation of `Deserialize` for it.
 ///
 /// [de]: https://docs.serde.rs/serde/de/index.html
 /// [codegen]: https://serde.rs/codegen.html
 /// [impl-deserialize]: https://serde.rs/impl-deserialize.html
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by `Self` when deserialized. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
 pub trait Deserialize<'de>: Sized {
     /// Deserialize this value from the given Serde deserializer.
     ///
     /// See the [Implementing `Deserialize`][impl-deserialize] section of the
     /// manual for more information about how to implement this method.
     ///
     /// [impl-deserialize]: https://serde.rs/impl-deserialize.html
     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
@@ -563,16 +579,24 @@ pub trait Deserialize<'de>: Sized {
 ///     T: Deserialize<'a>;
 ///
 /// fn from_reader<R, T>(rdr: R) -> Result<T>
 /// where
 ///     R: Read,
 ///     T: DeserializeOwned;
 /// # }
 /// ```
+///
+/// # Lifetime
+///
+/// The relationship between `Deserialize` and `DeserializeOwned` in trait
+/// bounds is explained in more detail on the page [Understanding deserializer
+/// lifetimes].
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
 pub trait DeserializeOwned: for<'de> Deserialize<'de> {}
 impl<T> DeserializeOwned for T
 where
     T: for<'de> Deserialize<'de>,
 {
 }
 
 /// `DeserializeSeed` is the stateful form of the `Deserialize` trait. If you
@@ -613,16 +637,24 @@ where
 /// #     unimplemented!()
 /// # }
 /// ```
 ///
 /// In practice the majority of deserialization is stateless. An API expecting a
 /// seed can be appeased by passing `std::marker::PhantomData` as a seed in the
 /// case of stateless deserialization.
 ///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by `Self::Value` when deserialized. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
 /// # Example
 ///
 /// Suppose we have JSON that looks like `[[1, 2], [3, 4, 5], [6]]` and we need
 /// to deserialize it into a flat representation like `vec![1, 2, 3, 4, 5, 6]`.
 /// Allocating a brand new `Vec<T>` for each subarray would be slow. Instead we
 /// would like to allocate a single `Vec<T>` and then deserialize each subarray
 /// into it. This requires stateful deserialization using the `DeserializeSeed`
 /// trait.
@@ -751,38 +783,38 @@ where
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A **data format** that can deserialize any data structure supported by
 /// Serde.
 ///
-/// The role of this trait is to define the deserialization half of the Serde
-/// data model, which is a way to categorize every Rust data type into one of 27
-/// possible types. Each method of the `Serializer` trait corresponds to one of
-/// the types of the data model.
+/// The role of this trait is to define the deserialization half of the [Serde
+/// data model], which is a way to categorize every Rust data type into one of
+/// 29 possible types. Each method of the `Serializer` trait corresponds to one
+/// of the types of the data model.
 ///
 /// Implementations of `Deserialize` map themselves into this data model by
 /// passing to the `Deserializer` a `Visitor` implementation that can receive
 /// these various types.
 ///
 /// The types that make up the Serde data model are:
 ///
-///  - **12 primitive types**
+///  - **14 primitive types**
 ///    - bool
-///    - i8, i16, i32, i64
-///    - u8, u16, u32, u64
+///    - i8, i16, i32, i64, i128
+///    - u8, u16, u32, u64, u128
 ///    - f32, f64
 ///    - char
 ///  - **string**
 ///    - UTF-8 bytes with a length and no null terminator.
 ///    - When serializing, all strings are handled equally. When deserializing,
 ///      there are three flavors of strings: transient, owned, and borrowed.
-///  - **byte array** - [u8]
+///  - **byte array** - \[u8\]
 ///    - Similar to strings, during deserialization byte arrays can be transient,
 ///      owned, or borrowed.
 ///  - **option**
 ///    - Either none or some value.
 ///  - **unit**
 ///    - The type of `()` in Rust. It represents an anonymous value containing no
 ///      data.
 ///  - **unit_struct**
@@ -836,16 +868,33 @@ where
 ///    able to deserialize something like `serde_json::Value` which relies on
 ///    `Deserializer::deserialize_any`.
 ///
 /// When implementing `Deserialize`, you should avoid relying on
 /// `Deserializer::deserialize_any` unless you need to be told by the Deserializer
 /// what type is in the input. Know that relying on `Deserializer::deserialize_any`
 /// means your data type will be able to deserialize from self-describing
 /// formats only, ruling out Bincode and many others.
+///
+/// [Serde data model]: https://serde.rs/data-model.html
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed from the input when deserializing. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website contains example code for
+/// a basic JSON `Deserializer`.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait Deserializer<'de>: Sized {
     /// The error type that can be returned if some error occurs during
     /// deserialization.
     type Error: Error;
 
     /// Require the `Deserializer` to figure out how to drive the visitor based
     /// on what data type is in the input.
     ///
@@ -879,16 +928,30 @@ pub trait Deserializer<'de>: Sized {
     where
         V: Visitor<'de>;
 
     /// Hint that the `Deserialize` type is expecting an `i64` value.
     fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>;
 
+    serde_if_integer128! {
+        /// Hint that the `Deserialize` type is expecting an `i128` value.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>
+        {
+            let _ = visitor;
+            Err(Error::custom("i128 is not supported"))
+        }
+    }
+
     /// Hint that the `Deserialize` type is expecting a `u8` value.
     fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>;
 
     /// Hint that the `Deserialize` type is expecting a `u16` value.
     fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
@@ -899,16 +962,30 @@ pub trait Deserializer<'de>: Sized {
     where
         V: Visitor<'de>;
 
     /// Hint that the `Deserialize` type is expecting a `u64` value.
     fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>;
 
+    serde_if_integer128! {
+        /// Hint that the `Deserialize` type is expecting an `u128` value.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>
+        {
+            let _ = visitor;
+            Err(Error::custom("u128 is not supported"))
+        }
+    }
+
     /// Hint that the `Deserialize` type is expecting a `f32` value.
     fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>;
 
     /// Hint that the `Deserialize` type is expecting a `f64` value.
     fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
@@ -1131,16 +1208,26 @@ pub trait Deserializer<'de>: Sized {
         true
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// This trait represents a visitor that walks through a deserializer.
 ///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the requirement for lifetime of data
+/// that may be borrowed by `Self::Value`. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example
+///
 /// ```rust
 /// # use std::fmt;
 /// #
 /// # use serde::de::{self, Unexpected, Visitor};
 /// #
 /// /// A visitor that deserializes a long string - a string containing at least
 /// /// some minimum number of bytes.
 /// struct LongString {
@@ -1245,16 +1332,30 @@ pub trait Visitor<'de>: Sized {
     /// The default implementation fails with a type error.
     fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
     where
         E: Error,
     {
         Err(Error::invalid_type(Unexpected::Signed(v), &self))
     }
 
+    serde_if_integer128! {
+        /// The input contains a `i128`.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default implementation fails with a type error.
+        fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            let _ = v;
+            Err(Error::invalid_type(Unexpected::Other("i128"), &self))
+        }
+    }
+
     /// The input contains a `u8`.
     ///
     /// The default implementation forwards to [`visit_u64`].
     ///
     /// [`visit_u64`]: #method.visit_u64
     fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>
     where
         E: Error,
@@ -1291,16 +1392,30 @@ pub trait Visitor<'de>: Sized {
     /// The default implementation fails with a type error.
     fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
     where
         E: Error,
     {
         Err(Error::invalid_type(Unexpected::Unsigned(v), &self))
     }
 
+    serde_if_integer128! {
+        /// The input contains a `u128`.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default implementation fails with a type error.
+        fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            let _ = v;
+            Err(Error::invalid_type(Unexpected::Other("u128"), &self))
+        }
+    }
+
     /// The input contains an `f32`.
     ///
     /// The default implementation forwards to [`visit_f64`].
     ///
     /// [`visit_f64`]: #method.visit_f64
     fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E>
     where
         E: Error,
@@ -1539,16 +1654,31 @@ pub trait Visitor<'de>: Sized {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// Provides a `Visitor` access to each element of a sequence in the input.
 ///
 /// This is a trait that a `Deserializer` passes to a `Visitor` implementation,
 /// which deserializes each item in a sequence.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by deserialized sequence elements. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SeqAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SeqAccess<'de> {
     /// The error type that can be returned if some error occurs during
     /// deserialization.
     type Error: Error;
 
     /// This returns `Ok(Some(value))` for the next value in the sequence, or
     /// `Ok(None)` if there are no more remaining items.
     ///
@@ -1606,16 +1736,31 @@ where
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// Provides a `Visitor` access to each entry of a map in the input.
 ///
 /// This is a trait that a `Deserializer` passes to a `Visitor` implementation.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by deserialized map entries. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `MapAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait MapAccess<'de> {
     /// The error type that can be returned if some error occurs during
     /// deserialization.
     type Error: Error;
 
     /// This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)`
     /// if there are no more remaining entries.
     ///
@@ -1783,16 +1928,31 @@ where
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// Provides a `Visitor` access to the data of an enum in the input.
 ///
 /// `EnumAccess` is created by the `Deserializer` and passed to the
 /// `Visitor` in order to identify which variant of an enum to deserialize.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by the deserialized enum variant. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `EnumAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait EnumAccess<'de>: Sized {
     /// The error type that can be returned if some error occurs during
     /// deserialization.
     type Error: Error;
     /// The `Visitor` that will be used to deserialize the content of the enum
     /// variant.
     type Variant: VariantAccess<'de, Error = Self::Error>;
 
@@ -1815,16 +1975,31 @@ pub trait EnumAccess<'de>: Sized {
     {
         self.variant_seed(PhantomData)
     }
 }
 
 /// `VariantAccess` is a visitor that is created by the `Deserializer` and
 /// passed to the `Deserialize` to deserialize the content of a particular enum
 /// variant.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by the deserialized enum variant. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `VariantAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait VariantAccess<'de>: Sized {
     /// The error type that can be returned if some error occurs during
     /// deserialization. Must match the error type of our `EnumAccess`.
     type Error: Error;
 
     /// Called when deserializing a variant with no values.
     ///
     /// If the data contains a different type of variant, the following
@@ -2018,16 +2193,26 @@ pub trait VariantAccess<'de>: Sized {
         V: Visitor<'de>;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// Converts an existing value into a `Deserializer` from which other values can
 /// be deserialized.
 ///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed from the resulting `Deserializer`. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example
+///
 /// ```rust
 /// #[macro_use]
 /// extern crate serde_derive;
 ///
 /// extern crate serde;
 ///
 /// use std::str::FromStr;
 /// use serde::de::{value, Deserialize, IntoDeserializer};
--- a/third_party/rust/serde/src/de/value.rs
+++ b/third_party/rust/serde/src/de/value.rs
@@ -39,16 +39,32 @@ use lib::*;
 
 use self::private::{First, Second};
 use de::{self, Expected, IntoDeserializer, SeqAccess};
 use private::de::size_hint;
 use ser;
 
 ////////////////////////////////////////////////////////////////////////////////
 
+// For structs that contain a PhantomData. We do not want the trait
+// bound `E: Clone` inferred by derive(Clone).
+macro_rules! impl_copy_clone {
+    ($ty:ident $(<$lifetime:tt>)*) => {
+        impl<$($lifetime,)* E> Copy for $ty<$($lifetime,)* E> {}
+
+        impl<$($lifetime,)* E> Clone for $ty<$($lifetime,)* E> {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
 /// A minimal representation of all possible errors that can occur using the
 /// `IntoDeserializer` trait.
 #[derive(Clone, Debug, PartialEq)]
 pub struct Error {
     err: ErrorImpl,
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
@@ -119,31 +135,33 @@ where
     fn into_deserializer(self) -> UnitDeserializer<E> {
         UnitDeserializer {
             marker: PhantomData,
         }
     }
 }
 
 /// A deserializer holding a `()`.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct UnitDeserializer<E> {
     marker: PhantomData<E>,
 }
 
+impl_copy_clone!(UnitDeserializer);
+
 impl<'de, E> de::Deserializer<'de> for UnitDeserializer<E>
 where
     E: de::Error,
 {
     type Error = E;
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf unit unit_struct newtype_struct seq tuple tuple_struct map
-        struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf unit unit_struct newtype_struct seq tuple tuple_struct
+        map struct enum identifier ignored_any
     }
 
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         visitor.visit_unit()
     }
@@ -153,26 +171,70 @@ where
         V: de::Visitor<'de>,
     {
         visitor.visit_none()
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
+/// A deserializer that cannot be instantiated.
+#[cfg(feature = "unstable")]
+pub struct NeverDeserializer<E> {
+    never: !,
+    marker: PhantomData<E>,
+}
+
+#[cfg(feature = "unstable")]
+impl<'de, E> IntoDeserializer<'de, E> for !
+where
+    E: de::Error,
+{
+    type Deserializer = NeverDeserializer<E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        self
+    }
+}
+
+#[cfg(feature = "unstable")]
+impl<'de, E> de::Deserializer<'de> for NeverDeserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, _visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        self.never
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
 macro_rules! primitive_deserializer {
     ($ty:ty, $doc:tt, $name:ident, $method:ident $($cast:tt)*) => {
         #[doc = "A deserializer holding"]
         #[doc = $doc]
-        #[derive(Clone, Debug)]
+        #[derive(Debug)]
         pub struct $name<E> {
             value: $ty,
             marker: PhantomData<E>
         }
 
+        impl_copy_clone!($name);
+
         impl<'de, E> IntoDeserializer<'de, E> for $ty
         where
             E: de::Error,
         {
             type Deserializer = $name<E>;
 
             fn into_deserializer(self) -> $name<E> {
                 $name {
@@ -184,19 +246,19 @@ macro_rules! primitive_deserializer {
 
         impl<'de, E> de::Deserializer<'de> for $name<E>
         where
             E: de::Error,
         {
             type Error = E;
 
             forward_to_deserialize_any! {
-                bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-                byte_buf option unit unit_struct newtype_struct seq tuple
-                tuple_struct map struct enum identifier ignored_any
+                bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str
+                string bytes byte_buf option unit unit_struct newtype_struct seq
+                tuple tuple_struct map struct enum identifier ignored_any
             }
 
             fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
             where
                 V: de::Visitor<'de>,
             {
                 visitor.$method(self.value $($cast)*)
             }
@@ -213,23 +275,30 @@ primitive_deserializer!(isize, "an `isiz
 primitive_deserializer!(u8, "a `u8`.", U8Deserializer, visit_u8);
 primitive_deserializer!(u16, "a `u16`.", U16Deserializer, visit_u16);
 primitive_deserializer!(u64, "a `u64`.", U64Deserializer, visit_u64);
 primitive_deserializer!(usize, "a `usize`.", UsizeDeserializer, visit_u64 as u64);
 primitive_deserializer!(f32, "an `f32`.", F32Deserializer, visit_f32);
 primitive_deserializer!(f64, "an `f64`.", F64Deserializer, visit_f64);
 primitive_deserializer!(char, "a `char`.", CharDeserializer, visit_char);
 
+serde_if_integer128! {
+    primitive_deserializer!(i128, "an `i128`.", I128Deserializer, visit_i128);
+    primitive_deserializer!(u128, "a `u128`.", U128Deserializer, visit_u128);
+}
+
 /// A deserializer holding a `u32`.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct U32Deserializer<E> {
     value: u32,
     marker: PhantomData<E>,
 }
 
+impl_copy_clone!(U32Deserializer);
+
 impl<'de, E> IntoDeserializer<'de, E> for u32
 where
     E: de::Error,
 {
     type Deserializer = U32Deserializer<E>;
 
     fn into_deserializer(self) -> U32Deserializer<E> {
         U32Deserializer {
@@ -241,19 +310,19 @@ where
 
 impl<'de, E> de::Deserializer<'de> for U32Deserializer<E>
 where
     E: de::Error,
 {
     type Error = E;
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
     }
 
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         visitor.visit_u32(self.value)
     }
@@ -286,22 +355,24 @@ where
     {
         seed.deserialize(self).map(private::unit_only)
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `&str`.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct StrDeserializer<'a, E> {
     value: &'a str,
     marker: PhantomData<E>,
 }
 
+impl_copy_clone!(StrDeserializer<'de>);
+
 impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str
 where
     E: de::Error,
 {
     type Deserializer = StrDeserializer<'a, E>;
 
     fn into_deserializer(self) -> StrDeserializer<'a, E> {
         StrDeserializer {
@@ -334,19 +405,19 @@ where
         V: de::Visitor<'de>,
     {
         let _ = name;
         let _ = variants;
         visitor.visit_enum(self)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
     }
 }
 
 impl<'de, 'a, E> de::EnumAccess<'de> for StrDeserializer<'a, E>
 where
     E: de::Error,
 {
     type Error = E;
@@ -359,22 +430,24 @@ where
         seed.deserialize(self).map(private::unit_only)
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `&str` with a lifetime tied to another
 /// deserializer.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct BorrowedStrDeserializer<'de, E> {
     value: &'de str,
     marker: PhantomData<E>,
 }
 
+impl_copy_clone!(BorrowedStrDeserializer<'de>);
+
 impl<'de, E> BorrowedStrDeserializer<'de, E> {
     /// Create a new borrowed deserializer from the given string.
     pub fn new(value: &'de str) -> BorrowedStrDeserializer<'de, E> {
         BorrowedStrDeserializer {
             value: value,
             marker: PhantomData,
         }
     }
@@ -403,19 +476,19 @@ where
         V: de::Visitor<'de>,
     {
         let _ = name;
         let _ = variants;
         visitor.visit_enum(self)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
     }
 }
 
 impl<'de, E> de::EnumAccess<'de> for BorrowedStrDeserializer<'de, E>
 where
     E: de::Error,
 {
     type Error = E;
@@ -428,23 +501,33 @@ where
         seed.deserialize(self).map(private::unit_only)
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `String`.
 #[cfg(any(feature = "std", feature = "alloc"))]
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct StringDeserializer<E> {
     value: String,
     marker: PhantomData<E>,
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
+impl<E> Clone for StringDeserializer<E> {
+    fn clone(&self) -> Self {
+        StringDeserializer {
+            value: self.value.clone(),
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
 impl<'de, E> IntoDeserializer<'de, E> for String
 where
     E: de::Error,
 {
     type Deserializer = StringDeserializer<E>;
 
     fn into_deserializer(self) -> StringDeserializer<E> {
         StringDeserializer {
@@ -478,19 +561,19 @@ where
         V: de::Visitor<'de>,
     {
         let _ = name;
         let _ = variants;
         visitor.visit_enum(self)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
     }
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer<E>
 where
     E: de::Error,
 {
@@ -504,23 +587,33 @@ where
         seed.deserialize(self).map(private::unit_only)
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `Cow<str>`.
 #[cfg(any(feature = "std", feature = "alloc"))]
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct CowStrDeserializer<'a, E> {
     value: Cow<'a, str>,
     marker: PhantomData<E>,
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, E> Clone for CowStrDeserializer<'a, E> {
+    fn clone(&self) -> Self {
+        CowStrDeserializer {
+            value: self.value.clone(),
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
 impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str>
 where
     E: de::Error,
 {
     type Deserializer = CowStrDeserializer<'a, E>;
 
     fn into_deserializer(self) -> CowStrDeserializer<'a, E> {
         CowStrDeserializer {
@@ -557,19 +650,19 @@ where
         V: de::Visitor<'de>,
     {
         let _ = name;
         let _ = variants;
         visitor.visit_enum(self)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
     }
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 impl<'de, 'a, E> de::EnumAccess<'de> for CowStrDeserializer<'a, E>
 where
     E: de::Error,
 {
@@ -583,22 +676,24 @@ where
         seed.deserialize(self).map(private::unit_only)
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `&[u8]` with a lifetime tied to another
 /// deserializer.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 pub struct BorrowedBytesDeserializer<'de, E> {
     value: &'de [u8],
     marker: PhantomData<E>,
 }
 
+impl_copy_clone!(BorrowedBytesDeserializer<'de>);
+
 impl<'de, E> BorrowedBytesDeserializer<'de, E> {
     /// Create a new borrowed deserializer from the given byte slice.
     pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E> {
         BorrowedBytesDeserializer {
             value: value,
             marker: PhantomData,
         }
     }
@@ -613,19 +708,19 @@ where
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         visitor.visit_borrowed_bytes(self.value)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct identifier ignored_any enum
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any enum
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer that iterates over a sequence.
 #[derive(Clone, Debug)]
 pub struct SeqDeserializer<I, E> {
@@ -683,19 +778,19 @@ where
         V: de::Visitor<'de>,
     {
         let v = try!(visitor.visit_seq(&mut self));
         try!(self.end());
         Ok(v)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
     }
 }
 
 impl<'de, I, T, E> de::SeqAccess<'de> for SeqDeserializer<I, E>
 where
     I: Iterator<Item = T>,
     T: IntoDeserializer<'de, E>,
     E: de::Error,
@@ -798,19 +893,19 @@ where
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         visitor.visit_seq(self.seq)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer that iterates over a map.
 pub struct MapDeserializer<'de, I, E>
 where
@@ -912,19 +1007,19 @@ where
     where
         V: de::Visitor<'de>,
     {
         let _ = len;
         self.deserialize_seq(visitor)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct tuple_struct map struct
-        enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct tuple_struct map
+        struct enum identifier ignored_any
     }
 }
 
 impl<'de, I, E> de::MapAccess<'de> for MapDeserializer<'de, I, E>
 where
     I: Iterator,
     I::Item: private::Pair,
     First<I::Item>: IntoDeserializer<'de, E>,
@@ -1054,19 +1149,19 @@ impl<'de, A, B, E> de::Deserializer<'de>
 where
     A: IntoDeserializer<'de, E>,
     B: IntoDeserializer<'de, E>,
     E: de::Error,
 {
     type Error = E;
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct tuple_struct map struct
-        enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct tuple_struct map
+        struct enum identifier ignored_any
     }
 
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         self.deserialize_seq(visitor)
     }
@@ -1202,19 +1297,19 @@ where
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: de::Visitor<'de>,
     {
         visitor.visit_map(self.map)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 mod private {
     use lib::*;
 
new file mode 100644
--- /dev/null
+++ b/third_party/rust/serde/src/integer128.rs
@@ -0,0 +1,86 @@
+/// Conditional compilation depending on whether Serde is built with support for
+/// 128-bit integers.
+///
+/// Data formats that wish to support Rust compiler versions older than 1.26 may
+/// place the i128 / u128 methods of their Serializer and Deserializer behind
+/// this macro.
+///
+/// Data formats that require a minimum Rust compiler version of at least 1.26
+/// do not need to bother with this macro and may assume support for 128-bit
+/// integers.
+///
+/// ```rust
+/// #[macro_use]
+/// extern crate serde;
+///
+/// use serde::Serializer;
+/// # use serde::private::ser::Error;
+/// #
+/// # struct MySerializer;
+///
+/// impl Serializer for MySerializer {
+///     type Ok = ();
+///     type Error = Error;
+///
+///     fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error> {
+///         /* ... */
+/// #         unimplemented!()
+///     }
+///
+///     /* ... */
+///
+///     serde_if_integer128! {
+///         fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
+///             /* ... */
+/// #             unimplemented!()
+///         }
+///
+///         fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> {
+///             /* ... */
+/// #             unimplemented!()
+///         }
+///     }
+/// #
+/// #     __serialize_unimplemented! {
+/// #         bool i8 i16 i32 u8 u16 u32 u64 f32 f64 char str bytes none some
+/// #         unit unit_struct unit_variant newtype_struct newtype_variant seq
+/// #         tuple tuple_struct tuple_variant map struct struct_variant
+/// #     }
+/// }
+/// #
+/// # fn main() {}
+/// ```
+///
+/// When Serde is built with support for 128-bit integers, this macro expands
+/// transparently into just the input tokens.
+///
+/// ```rust
+/// macro_rules! serde_if_integer128 {
+///     ($($tt:tt)*) => {
+///         $($tt)*
+///     };
+/// }
+/// ```
+///
+/// When built without support for 128-bit integers, this macro expands to
+/// nothing.
+///
+/// ```rust
+/// macro_rules! serde_if_integer128 {
+///     ($($tt:tt)*) => {};
+/// }
+/// ```
+#[cfg(integer128)]
+#[macro_export]
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {
+        $($tt)*
+    };
+}
+
+#[cfg(not(integer128))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {};
+}
--- a/third_party/rust/serde/src/lib.rs
+++ b/third_party/rust/serde/src/lib.rs
@@ -47,16 +47,18 @@
 //!   size without the need for version negotiation.
 //! - [YAML], a popular human-friendly configuration language that ain't markup
 //!   language.
 //! - [MessagePack], an efficient binary format that resembles a compact JSON.
 //! - [TOML], a minimal configuration format used by [Cargo].
 //! - [Pickle], a format common in the Python world.
 //! - [Hjson], a variant of JSON designed to be readable and writable by humans.
 //! - [BSON], the data storage and network transfer format used by MongoDB.
+//! - [Avro], a binary format used within Apache Hadoop, with support for schema
+//!   definition.
 //! - [URL], the x-www-form-urlencoded format.
 //! - [XML], the flexible machine-friendly W3C standard.
 //!   *(deserialization only)*
 //! - [Envy], a way to deserialize environment variables into Rust structs.
 //!   *(deserialization only)*
 //! - [Redis], deserialize values from Redis when using [redis-rs].
 //!   *(deserialization only)*
 //!
@@ -64,34 +66,35 @@
 //! [Bincode]: https://github.com/TyOverby/bincode
 //! [CBOR]: https://github.com/pyfisch/cbor
 //! [YAML]: https://github.com/dtolnay/serde-yaml
 //! [MessagePack]: https://github.com/3Hren/msgpack-rust
 //! [TOML]: https://github.com/alexcrichton/toml-rs
 //! [Pickle]: https://github.com/birkenfeld/serde-pickle
 //! [Hjson]: https://github.com/laktak/hjson-rust
 //! [BSON]: https://github.com/zonyitoo/bson-rs
+//! [Avro]: https://github.com/flavray/avro-rs
 //! [URL]: https://github.com/nox/serde_urlencoded
 //! [XML]: https://github.com/RReverser/serde-xml-rs
 //! [Envy]: https://github.com/softprops/envy
 //! [Redis]: https://github.com/OneSignal/serde-redis
 //! [Cargo]: http://doc.crates.io/manifest.html
 //! [redis-rs]: https://crates.io/crates/redis
 
 ////////////////////////////////////////////////////////////////////////////////
 
 // Serde types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/serde/1.0.58")]
+#![doc(html_root_url = "https://docs.rs/serde/1.0.66")]
 // Support using Serde without the standard library!
 #![cfg_attr(not(feature = "std"), no_std)]
 // Unstable functionality only if the user asks for it. For tracking and
 // discussion of these features please refer to this issue:
 //
 //    https://github.com/serde-rs/serde/issues/812
-#![cfg_attr(feature = "unstable", feature(specialization))]
+#![cfg_attr(feature = "unstable", feature(specialization, never_type))]
 #![cfg_attr(feature = "alloc", feature(alloc))]
 #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
 // Whitelisted clippy lints
 #![cfg_attr(
     feature = "cargo-clippy",
     allow(
         cast_lossless, const_static_lifetime, doc_markdown, linkedlist, needless_pass_by_value,
         redundant_field_names, type_complexity, unreadable_literal, zero_prefixed_literal
@@ -125,31 +128,28 @@
 // Blacklisted Rust lints.
 #![deny(missing_docs, unused_imports)]
 
 ////////////////////////////////////////////////////////////////////////////////
 
 #[cfg(feature = "alloc")]
 extern crate alloc;
 
-#[cfg(all(feature = "unstable", feature = "std"))]
-extern crate core;
-
 /// A facade around all the types we need from the `std`, `core`, and `alloc`
 /// crates. This avoids elaborate import wrangling having to happen in every
 /// module.
 mod lib {
     mod core {
         #[cfg(not(feature = "std"))]
         pub use core::*;
         #[cfg(feature = "std")]
         pub use std::*;
     }
 
-    pub use self::core::{cmp, iter, mem, ops, slice, str};
+    pub use self::core::{cmp, iter, mem, num, ops, slice, str};
     pub use self::core::{f32, f64};
     pub use self::core::{i16, i32, i64, i8, isize};
     pub use self::core::{u16, u32, u64, u8, usize};
 
     pub use self::core::cell::{Cell, RefCell};
     pub use self::core::clone::{self, Clone};
     pub use self::core::convert::{self, From, Into};
     pub use self::core::default::{self, Default};
@@ -206,27 +206,30 @@ mod lib {
     pub use std::io::Write;
     #[cfg(feature = "std")]
     pub use std::num::Wrapping;
     #[cfg(feature = "std")]
     pub use std::path::{Path, PathBuf};
     #[cfg(feature = "std")]
     pub use std::sync::{Mutex, RwLock};
     #[cfg(feature = "std")]
-    pub use std::time::{Duration, SystemTime, UNIX_EPOCH};
+    pub use std::time::{SystemTime, UNIX_EPOCH};
 
-    #[cfg(feature = "unstable")]
-    pub use core::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
+    #[cfg(any(core_duration, feature = "std"))]
+    pub use self::core::time::Duration;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 #[macro_use]
 mod macros;
 
+#[macro_use]
+mod integer128;
+
 pub mod de;
 pub mod ser;
 
 #[doc(inline)]
 pub use de::{Deserialize, Deserializer};
 #[doc(inline)]
 pub use ser::{Serialize, Serializer};
 
--- a/third_party/rust/serde/src/macros.rs
+++ b/third_party/rust/serde/src/macros.rs
@@ -41,18 +41,18 @@
 /// fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
 /// where
 ///     V: Visitor<'de>,
 /// {
 ///     self.deserialize_any(visitor)
 /// }
 /// #
 /// #     forward_to_deserialize_any! {
-/// #         i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-/// #         byte_buf option unit unit_struct newtype_struct seq tuple
+/// #         i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+/// #         bytes byte_buf option unit unit_struct newtype_struct seq tuple
 /// #         tuple_struct map struct enum identifier ignored_any
 /// #     }
 /// # }
 /// #
 /// # fn main() {}
 /// ```
 ///
 /// The `forward_to_deserialize_any!` macro implements these simple forwarding
@@ -75,18 +75,18 @@
 ///         V: Visitor<'de>,
 ///     {
 ///         /* ... */
 /// #       let _ = visitor;
 /// #       unimplemented!()
 ///     }
 ///
 ///     forward_to_deserialize_any! {
-///         bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-///         byte_buf option unit unit_struct newtype_struct seq tuple
+///         bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+///         bytes byte_buf option unit unit_struct newtype_struct seq tuple
 ///         tuple_struct map struct enum identifier ignored_any
 ///     }
 /// }
 /// #
 /// # fn main() {}
 /// ```
 ///
 /// The macro assumes the convention that your `Deserializer` lifetime parameter
@@ -111,19 +111,19 @@
 /// #     where
 /// #         W: Visitor<'q>,
 /// #     {
 /// #         unimplemented!()
 /// #     }
 /// #
 /// forward_to_deserialize_any! {
 ///     <W: Visitor<'q>>
-///     bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-///     byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-///     map struct enum identifier ignored_any
+///     bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+///     bytes byte_buf option unit unit_struct newtype_struct seq tuple
+///     tuple_struct map struct enum identifier ignored_any
 /// }
 /// # }
 /// #
 /// # fn main() {}
 /// ```
 ///
 /// [`Deserializer`]: trait.Deserializer.html
 /// [`Visitor`]: de/trait.Visitor.html
@@ -169,28 +169,38 @@ macro_rules! forward_to_deserialize_any_
         forward_to_deserialize_any_method!{deserialize_i16<$l, $v>()}
     };
     (i32<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_i32<$l, $v>()}
     };
     (i64<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_i64<$l, $v>()}
     };
+    (i128<$l:tt, $v:ident>) => {
+        serde_if_integer128! {
+            forward_to_deserialize_any_method!{deserialize_i128<$l, $v>()}
+        }
+    };
     (u8<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()}
     };
     (u16<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()}
     };
     (u32<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()}
     };
     (u64<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()}
     };
+    (u128<$l:tt, $v:ident>) => {
+        serde_if_integer128! {
+            forward_to_deserialize_any_method!{deserialize_u128<$l, $v>()}
+        }
+    };
     (f32<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_f32<$l, $v>()}
     };
     (f64<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_f64<$l, $v>()}
     };
     (char<$l:tt, $v:ident>) => {
         forward_to_deserialize_any_method!{deserialize_char<$l, $v>()}
--- a/third_party/rust/serde/src/private/de.rs
+++ b/third_party/rust/serde/src/private/de.rs
@@ -45,19 +45,19 @@ where
         fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, E>
         where
             V: Visitor<'de>,
         {
             visitor.visit_none()
         }
 
         forward_to_deserialize_any! {
-            bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-            byte_buf unit unit_struct newtype_struct seq tuple tuple_struct map
-            struct enum identifier ignored_any
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
         }
     }
 
     let deserializer = MissingFieldDeserializer(field, PhantomData);
     Deserialize::deserialize(deserializer)
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
@@ -1613,18 +1613,18 @@ mod content {
                     Ok(ret)
                 } else {
                     Err(de::Error::invalid_length(len, &"fewer elements in array"))
                 }
             }
         }
 
         forward_to_deserialize_any! {
-            bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-            byte_buf option unit unit_struct newtype_struct seq tuple
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
             tuple_struct map struct enum identifier ignored_any
         }
     }
 
     impl<'de, E> de::SeqAccess<'de> for SeqDeserializer<'de, E>
     where
         E: de::Error,
     {
@@ -1711,18 +1711,18 @@ mod content {
         fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
         where
             V: de::Visitor<'de>,
         {
             visitor.visit_map(self)
         }
 
         forward_to_deserialize_any! {
-            bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-            byte_buf option unit unit_struct newtype_struct seq tuple
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
             tuple_struct map struct enum identifier ignored_any
         }
     }
 
     /// Not public API.
     pub struct ContentRefDeserializer<'a, 'de: 'a, E> {
         content: &'a Content<'de>,
         err: PhantomData<E>,
@@ -2301,34 +2301,35 @@ mod content {
                     Ok(ret)
                 } else {
                     Err(de::Error::invalid_length(len, &"fewer elements in array"))
                 }
             }
         }
 
         forward_to_deserialize_any! {
-            bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-            byte_buf option unit unit_struct newtype_struct seq tuple
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
             tuple_struct map struct enum identifier ignored_any
         }
     }
 
     impl<'de, 'a, E> de::SeqAccess<'de> for SeqRefDeserializer<'a, 'de, E>
     where
         E: de::Error,
     {
         type Error = E;
 
         fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
         where
             T: de::DeserializeSeed<'de>,
         {
             match self.iter.next() {
-                Some(value) => seed.deserialize(ContentRefDeserializer::new(value))
+                Some(value) => seed
+                    .deserialize(ContentRefDeserializer::new(value))
                     .map(Some),
                 None => Ok(None),
             }
         }
 
         fn size_hint(&self) -> Option<usize> {
             size_hint::from_bounds(&self.iter)
         }
@@ -2400,18 +2401,18 @@ mod content {
         fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
         where
             V: de::Visitor<'de>,
         {
             visitor.visit_map(self)
         }
 
         forward_to_deserialize_any! {
-            bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-            byte_buf option unit unit_struct newtype_struct seq tuple
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
             tuple_struct map struct enum identifier ignored_any
         }
     }
 
     impl<'de, E> de::IntoDeserializer<'de, E> for ContentDeserializer<'de, E>
     where
         E: de::Error,
     {
@@ -2572,19 +2573,19 @@ where
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>,
     {
         visitor.visit_str(self.value)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
     }
 }
 
 pub struct BytesDeserializer<'a, E> {
     value: &'a [u8],
     marker: PhantomData<E>,
 }
 
@@ -2611,19 +2612,19 @@ where
     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>,
     {
         visitor.visit_bytes(self.value)
     }
 
     forward_to_deserialize_any! {
-        bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes
-        byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct
-        map struct enum identifier ignored_any
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
     }
 }
 
 /// A DeserializeSeed helper for implementing deserialize_in_place Visitors.
 ///
 /// Wraps a mutable reference and calls deserialize_in_place on it.
 pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T);
 
@@ -2717,29 +2718,29 @@ where
             name
         )))
     }
 
     fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>,
     {
-        visitor.visit_map(FlatMapAccess::new(self.0.iter_mut(), None))
+        visitor.visit_map(FlatMapAccess::new(self.0.iter()))
     }
 
     fn deserialize_struct<V>(
         self,
         _: &'static str,
         fields: &'static [&'static str],
         visitor: V,
     ) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>,
     {
-        visitor.visit_map(FlatMapAccess::new(self.0.iter_mut(), Some(fields)))
+        visitor.visit_map(FlatStructAccess::new(self.0.iter_mut(), fields))
     }
 
     fn deserialize_newtype_struct<V>(self, _name: &str, visitor: V) -> Result<V::Value, Self::Error>
     where
         V: Visitor<'de>,
     {
         visitor.visit_newtype_struct(self)
     }
@@ -2778,32 +2779,29 @@ where
         deserialize_tuple_struct(&'static str, usize)
         deserialize_identifier()
         deserialize_ignored_any()
     }
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 pub struct FlatMapAccess<'a, 'de: 'a, E> {
-    iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
-    pending_content: Option<Content<'de>>,
-    fields: Option<&'static [&'static str]>,
+    iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>,
+    pending_content: Option<&'a Content<'de>>,
     _marker: PhantomData<E>,
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 impl<'a, 'de, E> FlatMapAccess<'a, 'de, E> {
     fn new(
-        iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
-        fields: Option<&'static [&'static str]>,
+        iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>,
     ) -> FlatMapAccess<'a, 'de, E> {
         FlatMapAccess {
             iter: iter,
             pending_content: None,
-            fields: fields,
             _marker: PhantomData,
         }
     }
 }
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 impl<'a, 'de, E> MapAccess<'de> for FlatMapAccess<'a, 'de, E>
 where
@@ -2811,29 +2809,77 @@ where
 {
     type Error = E;
 
     fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
     where
         T: DeserializeSeed<'de>,
     {
         while let Some(item) = self.iter.next() {
+            // Items in the vector are nulled out when used by a struct.
+            if let Some((ref key, ref content)) = *item {
+                self.pending_content = Some(content);
+                return seed.deserialize(ContentRefDeserializer::new(key)).map(Some);
+            }
+        }
+        Ok(None)
+    }
+
+    fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        match self.pending_content.take() {
+            Some(value) => seed.deserialize(ContentRefDeserializer::new(value)),
+            None => Err(Error::custom("value is missing")),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatStructAccess<'a, 'de: 'a, E> {
+    iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
+    pending_content: Option<Content<'de>>,
+    fields: &'static [&'static str],
+    _marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> FlatStructAccess<'a, 'de, E> {
+    fn new(
+        iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
+        fields: &'static [&'static str],
+    ) -> FlatStructAccess<'a, 'de, E> {
+        FlatStructAccess {
+            iter: iter,
+            pending_content: None,
+            fields: fields,
+            _marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> MapAccess<'de> for FlatStructAccess<'a, 'de, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        while let Some(item) = self.iter.next() {
             // items in the vector are nulled out when used.  So we can only use
             // an item if it's still filled in and if the field is one we care
             // about.  In case we do not know which fields we want, we take them all.
             let use_item = match *item {
                 None => false,
-                Some((ref c, _)) => {
-                    c.as_str()
-                        .map_or(self.fields.is_none(), |key| match self.fields {
-                            None => true,
-                            Some(fields) if fields.contains(&key) => true,
-                            _ => false,
-                        })
-                }
+                Some((ref c, _)) => c.as_str().map_or(false, |key| self.fields.contains(&key)),
             };
 
             if use_item {
                 let (key, content) = item.take().unwrap();
                 self.pending_content = Some(content);
                 return seed.deserialize(ContentDeserializer::new(key)).map(Some);
             }
         }
--- a/third_party/rust/serde/src/private/ser.rs
+++ b/third_party/rust/serde/src/private/ser.rs
@@ -942,17 +942,18 @@ mod content {
             self.key = Some(key);
             Ok(())
         }
 
         fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
         where
             T: Serialize,
         {
-            let key = self.key
+            let key = self
+                .key
                 .take()
                 .expect("serialize_value called before serialize_key");
             let value = try!(value.serialize(ContentSerializer::<E>::new()));
             self.entries.push((key, value));
             Ok(())
         }
 
         fn end(self) -> Result<Content, E> {
--- a/third_party/rust/serde/src/ser/impls.rs
+++ b/third_party/rust/serde/src/ser/impls.rs
@@ -3,20 +3,17 @@
 // 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.
 
 use lib::*;
 
-use ser::{Serialize, SerializeTuple, Serializer};
-
-#[cfg(feature = "std")]
-use ser::Error;
+use ser::{Error, Serialize, SerializeTuple, Serializer};
 
 ////////////////////////////////////////////////////////////////////////////////
 
 macro_rules! primitive_impl {
     ($ty:ident, $method:ident $($cast:tt)*) => {
         impl Serialize for $ty {
             #[inline]
             fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
@@ -39,16 +36,21 @@ primitive_impl!(usize, serialize_u64 as 
 primitive_impl!(u8, serialize_u8);
 primitive_impl!(u16, serialize_u16);
 primitive_impl!(u32, serialize_u32);
 primitive_impl!(u64, serialize_u64);
 primitive_impl!(f32, serialize_f32);
 primitive_impl!(f64, serialize_f64);
 primitive_impl!(char, serialize_char);
 
+serde_if_integer128! {
+    primitive_impl!(i128, serialize_i128);
+    primitive_impl!(u128, serialize_u128);
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 impl Serialize for str {
     #[inline]
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
     {
@@ -240,16 +242,26 @@ impl Serialize for () {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
     {
         serializer.serialize_unit()
     }
 }
 
+#[cfg(feature = "unstable")]
+impl Serialize for ! {
+    fn serialize<S>(&self, _serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        *self
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 macro_rules! tuple_impls {
     ($($len:expr => ($($n:tt $name:ident)+))+) => {
         $(
             impl<$($name),+> Serialize for ($($name,)+)
             where
                 $($name: Serialize,)+
@@ -406,18 +418,18 @@ where
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 macro_rules! nonzero_integers {
     ( $( $T: ident, )+ ) => {
         $(
-            #[cfg(feature = "unstable")]
-            impl Serialize for $T {
+            #[cfg(num_nonzero)]
+            impl Serialize for num::$T {
                 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
                 where
                     S: Serializer,
                 {
                     self.get().serialize(serializer)
                 }
             }
         )+
@@ -449,17 +461,20 @@ where
 impl<T> Serialize for RefCell<T>
 where
     T: Serialize,
 {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
     {
-        self.borrow().serialize(serializer)
+        match self.try_borrow() {
+            Ok(value) => value.serialize(serializer),
+            Err(_) => Err(S::Error::custom("already mutably borrowed")),
+        }
     }
 }
 
 #[cfg(feature = "std")]
 impl<T> Serialize for Mutex<T>
 where
     T: Serialize,
 {
@@ -507,17 +522,17 @@ where
                 serializer.serialize_newtype_variant("Result", 1, "Err", value)
             }
         }
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
-#[cfg(feature = "std")]
+#[cfg(any(core_duration, feature = "std"))]
 impl Serialize for Duration {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
     {
         use super::SerializeStruct;
         let mut state = try!(serializer.serialize_struct("Duration", 2));
         try!(state.serialize_field("secs", &self.as_secs()));
@@ -530,17 +545,18 @@ impl Serialize for Duration {
 
 #[cfg(feature = "std")]
 impl Serialize for SystemTime {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
     {
         use super::SerializeStruct;
-        let duration_since_epoch = self.duration_since(UNIX_EPOCH)
+        let duration_since_epoch = self
+            .duration_since(UNIX_EPOCH)
             .expect("SystemTime must be later than UNIX_EPOCH");
         let mut state = try!(serializer.serialize_struct("SystemTime", 2));
         try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs()));
         try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos()));
         state.end()
     }
 }
 
--- a/third_party/rust/serde/src/ser/mod.rs
+++ b/third_party/rust/serde/src/ser/mod.rs
@@ -43,25 +43,25 @@
 //!
 //! A partial list of well-maintained formats is given on the [Serde
 //! website][data formats].
 //!
 //! # Implementations of Serialize provided by Serde
 //!
 //!  - **Primitive types**:
 //!    - bool
-//!    - i8, i16, i32, i64, isize
-//!    - u8, u16, u32, u64, usize
+//!    - i8, i16, i32, i64, i128, isize
+//!    - u8, u16, u32, u64, u128, usize
 //!    - f32, f64
 //!    - char
 //!    - str
 //!    - &T and &mut T
 //!  - **Compound types**:
-//!    - [T]
-//!    - [T; 0] through [T; 32]
+//!    - \[T\]
+//!    - \[T; 0\] through \[T; 32\]
 //!    - tuples up to size 16
 //!  - **Common standard library types**:
 //!    - String
 //!    - Option\<T\>
 //!    - Result\<T, E\>
 //!    - PhantomData\<T\>
 //!  - **Wrapper types**:
 //!    - Box\<T\>
@@ -87,17 +87,18 @@
 //!    - OsStr
 //!    - OsString
 //!  - **Miscellaneous standard library types**:
 //!    - Duration
 //!    - SystemTime
 //!    - Path
 //!    - PathBuf
 //!    - Range\<T\>
-//!    - num::NonZero* (unstable)
+//!    - num::NonZero*
+//!    - `!` *(unstable)*
 //!  - **Net types**:
 //!    - IpAddr
 //!    - Ipv4Addr
 //!    - Ipv6Addr
 //!    - SocketAddr
 //!    - SocketAddrV4
 //!    - SocketAddrV6
 //!
@@ -122,16 +123,23 @@ pub use self::impossible::Impossible;
 
 ////////////////////////////////////////////////////////////////////////////////
 
 macro_rules! declare_error_trait {
     (Error: Sized $(+ $($supertrait:ident)::+)*) => {
         /// Trait used by `Serialize` implementations to generically construct
         /// errors belonging to the `Serializer` against which they are
         /// currently running.
+        ///
+        /// # Example implementation
+        ///
+        /// The [example data format] presented on the website shows an error
+        /// type appropriate for a basic JSON data format.
+        ///
+        /// [example data format]: https://serde.rs/data-format.html
         pub trait Error: Sized $(+ $($supertrait)::+)* {
             /// Used when a [`Serialize`] implementation encounters any error
             /// while serializing a type.
             ///
             /// The message should not be capitalized and should not end with a
             /// period.
             ///
             /// For example, a filesystem [`Path`] may refuse to serialize
@@ -239,37 +247,37 @@ pub trait Serialize {
     where
         S: Serializer;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A **data format** that can serialize any data structure supported by Serde.
 ///
-/// The role of this trait is to define the serialization half of the Serde data
-/// model, which is a way to categorize every Rust data structure into one of 27
-/// possible types. Each method of the `Serializer` trait corresponds to one of
-/// the types of the data model.
+/// The role of this trait is to define the serialization half of the [Serde
+/// data model], which is a way to categorize every Rust data structure into one
+/// of 29 possible types. Each method of the `Serializer` trait corresponds to
+/// one of the types of the data model.
 ///
 /// Implementations of `Serialize` map themselves into this data model by
 /// invoking exactly one of the `Serializer` methods.
 ///
 /// The types that make up the Serde data model are:
 ///
-///  - **12 primitive types**
+///  - **14 primitive types**
 ///    - bool
-///    - i8, i16, i32, i64
-///    - u8, u16, u32, u64
+///    - i8, i16, i32, i64, i128
+///    - u8, u16, u32, u64, u128
 ///    - f32, f64
 ///    - char
 ///  - **string**
 ///    - UTF-8 bytes with a length and no null terminator.
 ///    - When serializing, all strings are handled equally. When deserializing,
 ///      there are three flavors of strings: transient, owned, and borrowed.
-///  - **byte array** - [u8]
+///  - **byte array** - \[u8\]
 ///    - Similar to strings, during deserialization byte arrays can be transient,
 ///      owned, or borrowed.
 ///  - **option**
 ///    - Either none or some value.
 ///  - **unit**
 ///    - The type of `()` in Rust. It represents an anonymous value containing no
 ///      data.
 ///  - **unit_struct**
@@ -304,16 +312,25 @@ pub trait Serialize {
 ///    - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`.
 ///
 /// Many Serde serializers produce text or binary data as output, for example
 /// JSON or Bincode. This is not a requirement of the `Serializer` trait, and
 /// there are serializers that do not produce text or binary output. One example
 /// is the `serde_json::value::Serializer` (distinct from the main `serde_json`
 /// serializer) that produces a `serde_json::Value` data structure in memory as
 /// output.
+///
+/// [Serde data model]: https://serde.rs/data-model.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website contains example code for
+/// a basic JSON `Serializer`.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait Serializer: Sized {
     /// The output type produced by this `Serializer` during successful
     /// serialization. Most serializers that produce text or binary output
     /// should set `Ok = ()` and serialize into an [`io::Write`] or buffer
     /// contained within the `Serializer` instance. Serializers that build
     /// in-memory data structures may be simplified by using `Ok` to propagate
     /// the data structure around.
     ///
@@ -487,16 +504,47 @@ pub trait Serializer: Sized {
     ///         serializer.serialize_i64(*self)
     ///     }
     /// }
     /// #
     /// # fn main() {}
     /// ```
     fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>;
 
+    serde_if_integer128! {
+        /// Serialize an `i128` value.
+        ///
+        /// ```rust
+        /// # #[macro_use]
+        /// # extern crate serde;
+        /// #
+        /// # use serde::Serializer;
+        /// #
+        /// # __private_serialize!();
+        /// #
+        /// impl Serialize for i128 {
+        ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        ///     where
+        ///         S: Serializer,
+        ///     {
+        ///         serializer.serialize_i128(*self)
+        ///     }
+        /// }
+        /// #
+        /// # fn main() {}
+        /// ```
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
+            let _ = v;
+            Err(Error::custom("i128 is not supported"))
+        }
+    }
+
     /// Serialize a `u8` value.
     ///
     /// If the format does not differentiate between `u8` and `u64`, a
     /// reasonable implementation would be to cast the value to `u64` and
     /// forward to `serialize_u64`.
     ///
     /// ```rust
     /// # #[macro_use]
@@ -591,16 +639,47 @@ pub trait Serializer: Sized {
     ///         serializer.serialize_u64(*self)
     ///     }
     /// }
     /// #
     /// # fn main() {}
     /// ```
     fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>;
 
+    serde_if_integer128! {
+        /// Serialize a `u128` value.
+        ///
+        /// ```rust
+        /// # #[macro_use]
+        /// # extern crate serde;
+        /// #
+        /// # use serde::Serializer;
+        /// #
+        /// # __private_serialize!();
+        /// #
+        /// impl Serialize for u128 {
+        ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        ///     where
+        ///         S: Serializer,
+        ///     {
+        ///         serializer.serialize_u128(*self)
+        ///     }
+        /// }
+        /// #
+        /// # fn main() {}
+        /// ```
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> {
+            let _ = v;
+            Err(Error::custom("u128 is not supported"))
+        }
+    }
+
     /// Serialize an `f32` value.
     ///
     /// If the format does not differentiate between `f32` and `f64`, a
     /// reasonable implementation would be to cast the value to `f64` and
     /// forward to `serialize_f64`.
     ///
     /// ```rust
     /// # #[macro_use]
@@ -1453,16 +1532,18 @@ pub trait Serializer: Sized {
     #[inline]
     fn is_human_readable(&self) -> bool {
         true
     }
 }
 
 /// Returned from `Serializer::serialize_seq`.
 ///
+/// # Example use
+///
 /// ```rust
 /// # use std::marker::PhantomData;
 /// #
 /// # struct Vec<T>(PhantomData<T>);
 /// #
 /// # impl<T> Vec<T> {
 /// #     fn len(&self) -> usize {
 /// #         unimplemented!()
@@ -1490,16 +1571,23 @@ pub trait Serializer: Sized {
 ///         let mut seq = serializer.serialize_seq(Some(self.len()))?;
 ///         for element in self {
 ///             seq.serialize_element(element)?;
 ///         }
 ///         seq.end()
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeSeq` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeSeq {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a sequence element.
@@ -1508,16 +1596,18 @@ pub trait SerializeSeq {
         T: Serialize;
 
     /// Finish serializing a sequence.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_tuple`.
 ///
+/// # Example use
+///
 /// ```rust
 /// use serde::ser::{Serialize, Serializer, SerializeTuple};
 ///
 /// # mod fool {
 /// #     trait Serialize {}
 /// impl<A, B, C> Serialize for (A, B, C)
 /// #     {}
 /// # }
@@ -1581,16 +1671,23 @@ pub trait SerializeSeq {
 ///         let mut seq = serializer.serialize_tuple(16)?;
 ///         for element in self {
 ///             seq.serialize_element(element)?;
 ///         }
 ///         seq.end()
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTuple` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeTuple {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a tuple element.
@@ -1599,16 +1696,18 @@ pub trait SerializeTuple {
         T: Serialize;
 
     /// Finish serializing a tuple.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_tuple_struct`.
 ///
+/// # Example use
+///
 /// ```rust
 /// use serde::ser::{Serialize, Serializer, SerializeTupleStruct};
 ///
 /// struct Rgb(u8, u8, u8);
 ///
 /// impl Serialize for Rgb {
 ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
 ///     where
@@ -1617,16 +1716,23 @@ pub trait SerializeTuple {
 ///         let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
 ///         ts.serialize_field(&self.0)?;
 ///         ts.serialize_field(&self.1)?;
 ///         ts.serialize_field(&self.2)?;
 ///         ts.end()
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTupleStruct` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeTupleStruct {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a tuple struct field.
@@ -1635,16 +1741,18 @@ pub trait SerializeTupleStruct {
         T: Serialize;
 
     /// Finish serializing a tuple struct.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_tuple_variant`.
 ///
+/// # Example use
+///
 /// ```rust
 /// use serde::ser::{Serialize, Serializer, SerializeTupleVariant};
 ///
 /// enum E {
 ///     T(u8, u8),
 ///     U(String, u32, u32),
 /// }
 ///
@@ -1666,16 +1774,23 @@ pub trait SerializeTupleStruct {
 ///                 tv.serialize_field(b)?;
 ///                 tv.serialize_field(c)?;
 ///                 tv.end()
 ///             }
 ///         }
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTupleVariant` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeTupleVariant {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a tuple variant field.
@@ -1684,16 +1799,18 @@ pub trait SerializeTupleVariant {
         T: Serialize;
 
     /// Finish serializing a tuple variant.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_map`.
 ///
+/// # Example use
+///
 /// ```rust
 /// # use std::marker::PhantomData;
 /// #
 /// # struct HashMap<K, V>(PhantomData<K>, PhantomData<V>);
 /// #
 /// # impl<K, V> HashMap<K, V> {
 /// #     fn len(&self) -> usize {
 /// #         unimplemented!()
@@ -1723,16 +1840,23 @@ pub trait SerializeTupleVariant {
 ///         let mut map = serializer.serialize_map(Some(self.len()))?;
 ///         for (k, v) in self {
 ///             map.serialize_entry(k, v)?;
 ///         }
 ///         map.end()
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeMap` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeMap {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a map key.
@@ -1786,16 +1910,18 @@ pub trait SerializeMap {
     }
 
     /// Finish serializing a map.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_struct`.
 ///
+/// # Example use
+///
 /// ```rust
 /// use serde::ser::{Serialize, Serializer, SerializeStruct};
 ///
 /// struct Rgb {
 ///     r: u8,
 ///     g: u8,
 ///     b: u8,
 /// }
@@ -1808,16 +1934,23 @@ pub trait SerializeMap {
 ///         let mut rgb = serializer.serialize_struct("Rgb", 3)?;
 ///         rgb.serialize_field("r", &self.r)?;
 ///         rgb.serialize_field("g", &self.g)?;
 ///         rgb.serialize_field("b", &self.b)?;
 ///         rgb.end()
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeStruct` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeStruct {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a struct field.
@@ -1837,16 +1970,18 @@ pub trait SerializeStruct {
     }
 
     /// Finish serializing a struct.
     fn end(self) -> Result<Self::Ok, Self::Error>;
 }
 
 /// Returned from `Serializer::serialize_struct_variant`.
 ///
+/// # Example use
+///
 /// ```rust
 /// use serde::ser::{Serialize, Serializer, SerializeStructVariant};
 ///
 /// enum E {
 ///     S { r: u8, g: u8, b: u8 }
 /// }
 ///
 /// impl Serialize for E {
@@ -1861,16 +1996,23 @@ pub trait SerializeStruct {
 ///                 sv.serialize_field("g", g)?;
 ///                 sv.serialize_field("b", b)?;
 ///                 sv.end()
 ///             }
 ///         }
 ///     }
 /// }
 /// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeStructVariant` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
 pub trait SerializeStructVariant {
     /// Must match the `Ok` type of our `Serializer`.
     type Ok;
 
     /// Must match the `Error` type of our `Serializer`.
     type Error: Error;
 
     /// Serialize a struct variant field.
--- a/third_party/rust/serde_derive/.cargo-checksum.json
+++ b/third_party/rust/serde_derive/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"c89d9663763b180430561da049809839332300df1fb69d544fded497f06eaab3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"16de77b2d10fac8c70219ba183ad083ae12d4553c6f3213dec39d9936622b371","src/bound.rs":"4f8453ecfa0b6231abd35985bc0bfe64d42df613102ff6c8357425666392572b","src/de.rs":"2651f6cb8851b5fc7c1cd8d5d1ab9806064775bd33d31d4d2f056000ef561b93","src/fragment.rs":"4e34eca12e6ac4bd89f55e85786cfb677e98182f21ce1f51c0573bca5a8bcd27","src/internals/ast.rs":"2aea7bead7503c799320ad03ab03f1460e08445bc8234fbb9def99fdbebadfa5","src/internals/attr.rs":"ab3b80b8374b98d44a2fe363cbd967d94064d38ac4802d13a70ba4ab61aac4a2","src/internals/case.rs":"a07abcf7e2b7e4d72eaa1b3ce97d82b17c94533ed0ea88ea5d13d3cbf4394520","src/internals/check.rs":"72c3e01ba8adabcc9530235d0d317c54392a7fae156763022c8fd812aea86791","src/internals/ctxt.rs":"f541083477396a13cf7abd3dab448907112f900a6395ddd42ed0a6717ada1016","src/internals/mod.rs":"853f91744e77cb54222092225bc61a02b42b83ee25cb99079f7c55fbc868d481","src/lib.rs":"5ec1c796b697c55f285080db930ddaad852097763dddf11ddb05ad12eaabd32a","src/pretend.rs":"18cbafe2c936e831fe41b03562c0e8f49abfd27d29d6d31cb54e5adff39ec606","src/ser.rs":"b2c58b05fcb5aba689af722121a5db40b1d247b0d875f390769a6d98413af22f","src/try.rs":"93d3d832168f1df37852bca5e8ebfd8b77982379ecd68bb361669cae413491f8"},"package":null}
\ No newline at end of file
+{"files":{"Cargo.toml":"13802d367c4f23465fb93d2579c1bea247cd7f8310fdd90b2d0f817ad93f17a0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"fe0d3aa328d0e26c76f646c45197bc8c518257d31f3640baed096915b9bdf642","crates-io.md":"4de7b932987feadedd392855d166d0346e8f405190e8085a2e2f84c936a68959","src/bound.rs":"c85f8a617dcc90e5a9269305665d1610364fbb414c22cb5cadcedbe45f0c86e7","src/de.rs":"3e05e5b898f31c3ef96ed51f4e0a9b529ef6ff3240a980c450f6e4ed637c1ee3","src/fragment.rs":"9a8539d2bda80c62e4fdaf42816f371a2add62f9cf27b4646d90b636de40f56f","src/internals/ast.rs":"47b94e6b3ec03725c2c25e5764dca10286be02e975b11e5fe8e0879a1cbde424","src/internals/attr.rs":"5fc779f293fb33d2977dc0f7e86020acd9ce36fcbc90b199ba579d7a5542281b","src/internals/case.rs":"a07abcf7e2b7e4d72eaa1b3ce97d82b17c94533ed0ea88ea5d13d3cbf4394520","src/internals/check.rs":"ce47c103ec0683bdba07288834008977645b5f2e23382cabc27f6de927b724dc","src/internals/ctxt.rs":"f541083477396a13cf7abd3dab448907112f900a6395ddd42ed0a6717ada1016","src/internals/mod.rs":"414477f6fb187268ec87f917c0db9d328f4e6d188dfde93ab7479763e93e2aca","src/lib.rs":"b35a93042a3c4dec7d7871eb901e514ae28bc88183c49157a3ca4f7732aa7785","src/pretend.rs":"ea5aa1b338038ce1791cef34fd20091abb062cd61c0384ac931d0069413a5302","src/ser.rs":"6ac0b5ab9cd5a93486d7c1ca974afc95abadb11a4b923b33d04f44d1b42ffa5d","src/try.rs":"b9a10c8690d442a57fc7097d42c9a4f13034c7b4a30b7eb02d538fdbf8ae0a8d"},"package":null}
\ No newline at end of file
--- a/third_party/rust/serde_derive/Cargo.toml
+++ b/third_party/rust/serde_derive/Cargo.toml
@@ -1,31 +1,31 @@
 [package]
 name = "serde_derive"
-version = "1.0.58" # remember to update html_root_url
+version = "1.0.66" # remember to update html_root_url
 authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
 license = "MIT/Apache-2.0"
 description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
 homepage = "https://serde.rs"
 repository = "https://github.com/serde-rs/serde"
 documentation = "https://serde.rs/codegen.html"
 keywords = ["serde", "serialization", "no_std"]
-readme = "README.md"
-include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
+readme = "crates-io.md"
+include = ["Cargo.toml", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
 
 [badges]
 travis-ci = { repository = "serde-rs/serde" }
 
 [features]
 default = []
 deserialize_in_place = []
 
 [lib]
 name = "serde_derive"
 proc-macro = true
 
 [dependencies]
-proc-macro2 = "0.3"
-quote = "0.5.2"
-syn = { version = "0.13", features = ["visit", "extra-traits"] }
+proc-macro2 = "0.4"
+quote = "0.6"
+syn = { version = "0.14", features = ["visit", "extra-traits"] }
 
 [dev-dependencies]
 serde = { version = "1.0", path = "../serde" }
--- a/third_party/rust/serde_derive/README.md
+++ b/third_party/rust/serde_derive/README.md
@@ -20,17 +20,17 @@ You may be looking for:
 - [API documentation](https://docs.serde.rs/serde/)
 - [Release notes](https://github.com/serde-rs/serde/releases)
 
 ## Serde in action
 
 <details>
 <summary>
 Click to show Cargo.toml.
-<a href="http://play.integer32.com/?gist=9003c5b88c1f4989941925d7190c6eec" target="_blank">Run this code in the playground.</a>
+<a href="https://play.rust-lang.org/?gist=9003c5b88c1f4989941925d7190c6eec" target="_blank">Run this code in the playground.</a>
 </summary>
 
 ```toml
 [dependencies]
 
 # The core APIs, including the Serialize and Deserialize traits. Always
 # required when using Serde.
 serde = "1.0"
new file mode 100644
--- /dev/null
+++ b/third_party/rust/serde_derive/crates-io.md
@@ -0,0 +1,55 @@
+<!-- Serde readme rendered on crates.io -->
+
+**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**
+
+---
+
+You may be looking for:
+
+- [An overview of Serde](https://serde.rs/)
+- [Data formats supported by Serde](https://serde.rs/#data-formats)
+- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/codegen.html)
+- [Examples](https://serde.rs/examples.html)
+- [API documentation](https://docs.serde.rs/serde/)
+- [Release notes](https://github.com/serde-rs/serde/releases)
+
+## Serde in action
+
+```rust
+#[macro_use]
+extern crate serde_derive;
+
+extern crate serde;
+extern crate serde_json;
+
+#[derive(Serialize, Deserialize, Debug)]
+struct Point {
+    x: i32,
+    y: i32,
+}
+
+fn main() {
+    let point = Point { x: 1, y: 2 };
+
+    // Convert the Point to a JSON string.
+    let serialized = serde_json::to_string(&point).unwrap();
+
+    // Prints serialized = {"x":1,"y":2}
+    println!("serialized = {}", serialized);
+
+    // Convert the JSON string back to a Point.
+    let deserialized: Point = serde_json::from_str(&serialized).unwrap();
+
+    // Prints deserialized = Point { x: 1, y: 2 }
+    println!("deserialized = {:?}", deserialized);
+}
+```
+
+## Getting help
+
+Serde developers live in the #serde channel on
+[`irc.mozilla.org`](https://wiki.mozilla.org/IRC). The #rust channel is also a
+good resource with generally faster response time but less specific knowledge
+about Serde. If IRC is not your thing or you don't get a good response, we are
+happy to respond to [GitHub issues](https://github.com/serde-rs/serde/issues/new)
+as well.
--- a/third_party/rust/serde_derive/src/bound.rs
+++ b/third_party/rust/serde_derive/src/bound.rs
@@ -50,17 +50,18 @@ pub fn with_where_predicates(
     generics
 }
 
 pub fn with_where_predicates_from_fields(
     cont: &Container,
     generics: &syn::Generics,
     from_field: fn(&attr::Field) -> Option<&[syn::WherePredicate]>,
 ) -> syn::Generics {
-    let predicates = cont.data
+    let predicates = cont
+        .data
         .all_fields()
         .flat_map(|field| from_field(&field.attrs))
         .flat_map(|predicates| predicates.to_vec());
 
     let mut generics = generics.clone();
     generics.make_where_clause().predicates.extend(predicates);
     generics
 }
@@ -134,34 +135,37 @@ pub fn with_bound(
             if let Some(seg) = path.segments.last() {
                 if seg.into_value().ident == "PhantomData" {
                     // Hardcoded exception, because PhantomData<T> implements
                     // Serialize and Deserialize whether or not T implements it.
                     return;
                 }
             }
             if path.leading_colon.is_none() && path.segments.len() == 1 {
-                let id = path.segments[0].ident;
-                if self.all_type_params.contains(&id) {
-                    self.relevant_type_params.insert(id);
+                let id = &path.segments[0].ident;
+                if self.all_type_params.contains(id) {
+                    self.relevant_type_params.insert(id.clone());
                 }
             }
             visit::visit_path(self, path);
         }
 
         // Type parameter should not be considered used by a macro path.
         //
         //     struct TypeMacro<T> {
         //         mac: T!(),
         //         marker: PhantomData<T>,
         //     }
         fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
     }
 
-    let all_type_params = generics.type_params().map(|param| param.ident).collect();
+    let all_type_params = generics
+        .type_params()
+        .map(|param| param.ident.clone())
+        .collect();
 
     let mut visitor = FindTyParams {
         all_type_params: all_type_params,
         relevant_type_params: HashSet::new(),
         associated_type_usage: Vec::new(),
     };
     match cont.data {
         Data::Enum(_, ref variants) => for variant in variants.iter() {
@@ -179,17 +183,17 @@ pub fn with_bound(
             }
         }
     }
 
     let relevant_type_params = visitor.relevant_type_params;
     let associated_type_usage = visitor.associated_type_usage;
     let new_predicates = generics
         .type_params()
-        .map(|param| param.ident)
+        .map(|param| param.ident.clone())
         .filter(|id| relevant_type_params.contains(id))
         .map(|id| syn::TypePath {
             qself: None,
             path: id.into(),
         })
         .chain(associated_type_usage.into_iter().cloned())
         .map(|bounded_ty| {
             syn::WherePredicate::Type(syn::PredicateType {
@@ -241,30 +245,32 @@ pub fn with_self_bound(
         }));
     generics
 }
 
 pub fn with_lifetime_bound(generics: &syn::Generics, lifetime: &str) -> syn::Generics {
     let bound = syn::Lifetime::new(lifetime, Span::call_site());
     let def = syn::LifetimeDef {
         attrs: Vec::new(),
-        lifetime: bound,
+        lifetime: bound.clone(),
         colon_token: None,
         bounds: Punctuated::new(),
     };
 
     let params = Some(syn::GenericParam::Lifetime(def))
         .into_iter()
         .chain(generics.params.iter().cloned().map(|mut param| {
             match param {
                 syn::GenericParam::Lifetime(ref mut param) => {
-                    param.bounds.push(bound);
+                    param.bounds.push(bound.clone());
                 }
                 syn::GenericParam::Type(ref mut param) => {
-                    param.bounds.push(syn::TypeParamBound::Lifetime(bound));
+                    param
+                        .bounds
+                        .push(syn::TypeParamBound::Lifetime(bound.clone()));
                 }
                 syn::GenericParam::Const(_) => {}
             }
             param
         }))
         .collect();
 
     syn::Generics {
@@ -274,33 +280,34 @@ pub fn with_lifetime_bound(generics: &sy
 }
 
 fn type_of_item(cont: &Container) -> syn::Type {
     syn::Type::Path(syn::TypePath {
         qself: None,
         path: syn::Path {
             leading_colon: None,
             segments: vec![syn::PathSegment {
-                ident: cont.ident,
+                ident: cont.ident.clone(),
                 arguments: syn::PathArguments::AngleBracketed(
                     syn::AngleBracketedGenericArguments {
                         colon2_token: None,
                         lt_token: Default::default(),
-                        args: cont.generics
+                        args: cont
+                            .generics
                             .params
                             .iter()
                             .map(|param| match *param {
                                 syn::GenericParam::Type(ref param) => {
                                     syn::GenericArgument::Type(syn::Type::Path(syn::TypePath {
                                         qself: None,
-                                        path: param.ident.into(),
+                                        path: param.ident.clone().into(),
                                     }))
                                 }
                                 syn::GenericParam::Lifetime(ref param) => {
-                                    syn::GenericArgument::Lifetime(param.lifetime)
+                                    syn::GenericArgument::Lifetime(param.lifetime.clone())
                                 }
                                 syn::GenericParam::Const(_) => {
                                     panic!("Serde does not support const generics yet");
                                 }
                             })
                             .collect(),
                         gt_token: Default::default(),
                     },
--- a/third_party/rust/serde_derive/src/de.rs
+++ b/third_party/rust/serde_derive/src/de.rs
@@ -1,42 +1,42 @@
 // Copyright 2017 Serde Developers
 //
 // 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.
 
-use proc_macro2::{Literal, Span};
-use quote::{ToTokens, Tokens};
+use proc_macro2::{Literal, Span, TokenStream};
+use quote::ToTokens;
 use syn::punctuated::Punctuated;
 use syn::spanned::Spanned;
 use syn::{self, Ident, Index, Member};
 
 use bound;
 use fragment::{Expr, Fragment, Match, Stmts};
 use internals::ast::{Container, Data, Field, Style, Variant};
-use internals::{attr, Ctxt};
+use internals::{attr, Ctxt, Derive};
 use pretend;
 use try;
 
 #[cfg(feature = "deserialize_in_place")]
 use internals::ast::Repr;
 
 
 use std::collections::BTreeSet;
 
-pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<Tokens, String> {
+pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream, String> {
     let ctxt = Ctxt::new();
-    let cont = Container::from_ast(&ctxt, input);
+    let cont = Container::from_ast(&ctxt, input, Derive::Deserialize);
     precondition(&ctxt, &cont);
     try!(ctxt.check());
 
-    let ident = cont.ident;
+    let ident = &cont.ident;
     let params = Parameters::new(&cont);
     let (de_impl_generics, _, ty_generics, where_clause) = split_with_de_lifetime(&params);
     let dummy_const = Ident::new(
         &format!("_IMPL_DESERIALIZE_FOR_{}", ident),
         Span::call_site(),
     );
     let body = Stmts(deserialize_body(&cont, &params));
     let delife = params.borrowed.de_lifetime();
@@ -130,38 +130,38 @@ struct Parameters {
 
     /// At least one field has a serde(getter) attribute, implying that the
     /// remote type has a private field.
     has_getter: bool,
 }
 
 impl Parameters {
     fn new(cont: &Container) -> Self {
-        let local = cont.ident;
+        let local = cont.ident.clone();
         let this = match cont.attrs.remote() {
             Some(remote) => remote.clone(),
-            None => cont.ident.into(),
+            None => cont.ident.clone().into(),
         };
         let borrowed = borrowed_lifetimes(cont);
         let generics = build_generics(cont, &borrowed);
         let has_getter = cont.data.has_getter();
 
         Parameters {
             local: local,
             this: this,
             generics: generics,
             borrowed: borrowed,
             has_getter: has_getter,
         }
     }
 
     /// Type name to use in error messages and `&'static str` arguments to
     /// various Deserializer methods.
-    fn type_name(&self) -> &str {
-        self.this.segments.last().unwrap().value().ident.as_ref()
+    fn type_name(&self) -> String {
+        self.this.segments.last().unwrap().value().ident.to_string()
     }
 }
 
 // All the generics in the input, plus a bound `T: Deserialize` for each generic
 // field type that will be deserialized by us, plus a bound `T: Default` for
 // each generic field type that will be set to a default value.
 fn build_generics(cont: &Container, borrowed: &BorrowedLifetimes) -> syn::Generics {
     let generics = bound::without_defaults(cont.generics);
@@ -203,17 +203,18 @@ fn build_generics(cont: &Container, borr
 // belong to a variant with a `skip_deserializing` or `deserialize_with`
 // attribute, are not deserialized by us so we do not generate a bound. Fields
 // with a `bound` attribute specify their own bound so we do not generate one.
 // All other fields may need a `T: Deserialize` bound where T is the type of the
 // field.
 fn needs_deserialize_bound(field: &attr::Field, variant: Option<&attr::Variant>) -> bool {
     !field.skip_deserializing() && field.deserialize_with().is_none() && field.de_bound().is_none()
         && variant.map_or(true, |variant| {
-            !variant.skip_deserializing() && variant.deserialize_with().is_none()
+            !variant.skip_deserializing()
+                && variant.deserialize_with().is_none()
                 && variant.de_bound().is_none()
         })
 }
 
 // Fields with a `default` attribute (not `default=...`), and fields with a
 // `skip_deserializing` attribute that do not also have `default=...`.
 fn requires_default(field: &attr::Field, _variant: Option<&attr::Variant>) -> bool {
     if let attr::Default::Default = *field.default() {
@@ -269,31 +270,27 @@ fn borrowed_lifetimes(cont: &Container) 
     if lifetimes.iter().any(|b| b.to_string() == "'static") {
         BorrowedLifetimes::Static
     } else {
         BorrowedLifetimes::Borrowed(lifetimes)
     }
 }
 
 fn deserialize_body(cont: &Container, params: &Parameters) -> Fragment {
-    if let Some(type_from) = cont.attrs.type_from() {
+    if cont.attrs.transparent() {
+        deserialize_transparent(cont, params)
+    } else if let Some(type_from) = cont.attrs.type_from() {
         deserialize_from(type_from)
     } else if let attr::Identifier::No = cont.attrs.identifier() {
         match cont.data {
             Data::Enum(_, ref variants) => deserialize_enum(params, variants, &cont.attrs),
             Data::Struct(Style::Struct, ref fields) => {
-                if fields.iter().any(|field| field.ident.is_none()) {
-                    panic!("struct has unnamed fields");
-                }
                 deserialize_struct(None, params, fields, &cont.attrs, None, &Untagged::No)
             }
             Data::Struct(Style::Tuple, ref fields) | Data::Struct(Style::Newtype, ref fields) => {
-                if fields.iter().any(|field| field.ident.is_some()) {
-                    panic!("tuple struct has named fields");
-                }
                 deserialize_tuple(None, params, fields, &cont.attrs, None)
             }
             Data::Struct(Style::Unit, _) => deserialize_unit_struct(params, &cont.attrs),
         }
     } else {
         match cont.data {
             Data::Enum(_, ref variants) => {
                 deserialize_custom_identifier(params, variants, &cont.attrs)
@@ -304,18 +301,21 @@ fn deserialize_body(cont: &Container, pa
 }
 
 #[cfg(feature = "deserialize_in_place")]
 fn deserialize_in_place_body(cont: &Container, params: &Parameters) -> Option<Stmts> {
     // Only remote derives have getters, and we do not generate
     // deserialize_in_place for remote derives.
     assert!(!params.has_getter);
 
-    if cont.attrs.type_from().is_some() || cont.attrs.identifier().is_some()
-        || cont.data
+    if cont.attrs.transparent()
+        || cont.attrs.type_from().is_some()
+        || cont.attrs.identifier().is_some()
+        || cont
+            .data
             .all_fields()
             .all(|f| f.attrs.deserialize_with().is_some())
     {
         return None;
     }
 
     let code = match cont.data {
         Data::Struct(Style::Struct, ref fields) => {
@@ -356,16 +356,51 @@ fn deserialize_in_place_body(cont: &Cont
     Some(Stmts(fn_deserialize_in_place))
 }
 
 #[cfg(not(feature = "deserialize_in_place"))]
 fn deserialize_in_place_body(_cont: &Container, _params: &Parameters) -> Option<Stmts> {
     None
 }
 
+fn deserialize_transparent(cont: &Container, params: &Parameters) -> Fragment {
+    let fields = match cont.data {
+        Data::Struct(_, ref fields) => fields,
+        Data::Enum(_, _) => unreachable!(),
+    };
+
+    let this = &params.this;
+    let transparent_field = fields.iter().find(|f| f.attrs.transparent()).unwrap();
+
+    let path = match transparent_field.attrs.deserialize_with() {
+        Some(path) => quote!(#path),
+        None => quote!(_serde::Deserialize::deserialize),
+    };
+
+    let assign = fields.iter().map(|field| {
+        let member = &field.member;
+        if field as *const Field == transparent_field as *const Field {
+            quote!(#member: __transparent)
+        } else {
+            let value = match *field.attrs.default() {
+                attr::Default::Default => quote!(_serde::export::Default::default()),
+                attr::Default::Path(ref path) => quote!(#path()),
+                attr::Default::None => quote!(_serde::export::PhantomData),
+            };
+            quote!(#member: #value)
+        }
+    });
+
+    quote_block! {
+        _serde::export::Result::map(
+            #path(__deserializer),
+            |__transparent| #this { #(#assign),* })
+    }
+}
+
 fn deserialize_from(type_from: &syn::Type) -> Fragment {
     quote_block! {
         _serde::export::Result::map(
             <#type_from as _serde::Deserialize>::deserialize(__deserializer),
             _serde::export::From::from)
     }
 }
 
@@ -394,42 +429,42 @@ fn deserialize_unit_struct(params: &Para
             }
         }
 
         _serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor)
     }
 }
 
 fn deserialize_tuple(
-    variant_ident: Option<syn::Ident>,
+    variant_ident: Option<&syn::Ident>,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
-    deserializer: Option<Tokens>,
+    deserializer: Option<TokenStream>,
 ) -> Fragment {
     let this = &params.this;
     let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
         split_with_de_lifetime(params);
     let delife = params.borrowed.de_lifetime();
 
     assert!(!cattrs.has_flatten());
 
     // If there are getters (implying private fields), construct the local type
     // and use an `Into` conversion to get the remote type. If there are no
     // getters then construct the target type directly.
     let construct = if params.has_getter {
-        let local = params.local;
+        let local = &params.local;
         quote!(#local)
     } else {
         quote!(#this)
     };
 
     let is_enum = variant_ident.is_some();
     let type_path = match variant_ident {
-        Some(variant_ident) => quote!(#construct::#variant_ident),
+        Some(ref variant_ident) => quote!(#construct::#variant_ident),
         None => construct,
     };
     let expecting = match variant_ident {
         Some(variant_ident) => format!("tuple variant {}::{}", params.type_name(), variant_ident),
         None => format!("tuple struct {}", params.type_name()),
     };
 
     let nfields = fields.len();
@@ -498,17 +533,17 @@ fn deserialize_tuple(
 }
 
 #[cfg(feature = "deserialize_in_place")]
 fn deserialize_tuple_in_place(
     variant_ident: Option<syn::Ident>,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
-    deserializer: Option<Tokens>,
+    deserializer: Option<TokenStream>,
 ) -> Fragment {
     let this = &params.this;
     let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
         split_with_de_lifetime(params);
     let delife = params.borrowed.de_lifetime();
 
     assert!(!cattrs.has_flatten());
 
@@ -591,27 +626,25 @@ fn deserialize_tuple_in_place(
             }
         }
 
         #dispatch
     }
 }
 
 fn deserialize_seq(
-    type_path: &Tokens,
+    type_path: &TokenStream,
     params: &Parameters,
     fields: &[Field],
     is_struct: bool,
     cattrs: &attr::Container,
     expecting: &str,
 ) -> Fragment {
     let vars = (0..fields.len()).map(field_i as fn(_) -> _);
 
-    // XXX: do we need an error for flattening here?
-
     let deserialized_count = fields
         .iter()
         .filter(|field| !field.attrs.skip_deserializing())
         .count();
     let expecting = if deserialized_count == 1 {
         format!("{} with 1 element", expecting)
     } else {
         format!("{} with {} elements", expecting, deserialized_count)
@@ -652,17 +685,17 @@ fn deserialize_seq(
                 };
             };
             index_in_seq += 1;
             assign
         }
     });
 
     let mut result = if is_struct {
-        let names = fields.iter().map(|f| &f.ident);
+        let names = fields.iter().map(|f| &f.member);
         quote! {
             #type_path { #( #names: #vars ),* }
         }
     } else {
         quote! {
             #type_path ( #(#vars),* )
         }
     };
@@ -694,93 +727,73 @@ fn deserialize_seq(
         _serde::export::Ok(#result)
     }
 }
 
 #[cfg(feature = "deserialize_in_place")]
 fn deserialize_seq_in_place(
     params: &Parameters,
     fields: &[Field],
-    increment_fields: bool,
+    _increment_fields: bool,  // FIXME: Not needed anymore?
     cattrs: &attr::Container,
     expecting: &str,
 ) -> Fragment {
     // For enums there's a secret `tag` field at the start which we shouldn't touch,
-    // so we need to bump all the indices up by 1.
-    let index_names = if increment_fields {
-        (0..fields.len())
-    } else {
-        (1..fields.len() + 1)
-    };
-    let vars = index_names.map(field_i as fn(_) -> _);
-
-    // XXX: do we need an error for flattening here?
-
     let deserialized_count = fields
         .iter()
         .filter(|field| !field.attrs.skip_deserializing())
         .count();
     let expecting = if deserialized_count == 1 {
         format!("{} with 1 element", expecting)
     } else {
         format!("{} with {} elements", expecting, deserialized_count)
     };
 
     let mut index_in_seq = 0usize;
-    let write_values = vars.clone()
-        .zip(fields)
-        .enumerate()
-        .map(|(field_index, (_, field))| {
-            // If there's no field name, assume we're a tuple-struct and use a numeric index
-            let field_name = field.ident.map(Member::Named).unwrap_or_else(|| {
-                Member::Unnamed(Index {
-                    index: field_index as u32,
-                    span: Span::call_site(),
-                })
-            });
-
-            if field.attrs.skip_deserializing() {
-                let default = Expr(expr_is_missing(field, cattrs));
-                quote! {
-                    self.place.#field_name = #default;
-                }
-            } else {
-                let return_invalid_length = quote! {
-                    return _serde::export::Err(_serde::de::Error::invalid_length(#index_in_seq, &#expecting));
-                };
-                let write = match field.attrs.deserialize_with() {
-                    None => {
-                        quote! {
-                            if let _serde::export::None = try!(_serde::de::SeqAccess::next_element_seed(&mut __seq,
-                                _serde::private::de::InPlaceSeed(&mut self.place.#field_name)))
-                            {
-                                #return_invalid_length
-                            }
+    let write_values = fields.iter().map(|field| {
+        let member = &field.member;
+
+        if field.attrs.skip_deserializing() {
+            let default = Expr(expr_is_missing(field, cattrs));
+            quote! {
+                self.place.#member = #default;
+            }
+        } else {
+            let return_invalid_length = quote! {
+                return _serde::export::Err(_serde::de::Error::invalid_length(#index_in_seq, &#expecting));
+            };
+            let write = match field.attrs.deserialize_with() {
+                None => {
+                    quote! {
+                        if let _serde::export::None = try!(_serde::de::SeqAccess::next_element_seed(&mut __seq,
+                            _serde::private::de::InPlaceSeed(&mut self.place.#member)))
+                        {
+                            #return_invalid_length
                         }
                     }
-                    Some(path) => {
-                        let (wrapper, wrapper_ty) =
-                            wrap_deserialize_field_with(params, field.ty, path);
-                        quote!({
+                }
+                Some(path) => {
+                    let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+                    quote!({
                             #wrapper
                             match try!(_serde::de::SeqAccess::next_element::<#wrapper_ty>(&mut __seq)) {
                                 _serde::export::Some(__wrap) => {
-                                    self.place.#field_name = __wrap.value;
+                                    self.place.#member = __wrap.value;
                                 }
                                 _serde::export::None => {
                                     #return_invalid_length
                                 }
                             }
                         })
-                    }
-                };
-                index_in_seq += 1;
-                write
-            }
-        });
+                }
+            };
+            index_in_seq += 1;
+            write
+        }
+    });
 
     let this = &params.this;
     let (_, ty_generics, _) = params.generics.split_for_impl();
     let let_default = match *cattrs.default() {
         attr::Default::Default => Some(quote!(
             let __default: #this #ty_generics  = _serde::export::Default::default();
         )),
         attr::Default::Path(ref path) => Some(quote!(
@@ -795,17 +808,21 @@ fn deserialize_seq_in_place(
 
     quote_block! {
         #let_default
         #(#write_values)*
         _serde::export::Ok(())
     }
 }
 
-fn deserialize_newtype_struct(type_path: &Tokens, params: &Parameters, field: &Field) -> Tokens {
+fn deserialize_newtype_struct(
+    type_path: &TokenStream,
+    params: &Parameters,
+    field: &Field,
+) -> TokenStream {
     let delife = params.borrowed.de_lifetime();
     let field_ty = field.ty;
 
     let value = match field.attrs.deserialize_with() {
         None => {
             quote! {
                 try!(<#field_ty as _serde::Deserialize>::deserialize(__e))
             }
@@ -833,17 +850,17 @@ fn deserialize_newtype_struct(type_path:
         {
             let __field0: #field_ty = #value;
             _serde::export::Ok(#result)
         }
     }
 }
 
 #[cfg(feature = "deserialize_in_place")]
-fn deserialize_newtype_struct_in_place(params: &Parameters, field: &Field) -> Tokens {
+fn deserialize_newtype_struct_in_place(params: &Parameters, field: &Field) -> TokenStream {
     // We do not generate deserialize_in_place if every field has a deserialize_with.
     assert!(field.attrs.deserialize_with().is_none());
 
     let delife = params.borrowed.de_lifetime();
 
     quote! {
         #[inline]
         fn visit_newtype_struct<__E>(self, __e: __E) -> _serde::export::Result<Self::Value, __E::Error>
@@ -856,42 +873,42 @@ fn deserialize_newtype_struct_in_place(p
 }
 
 enum Untagged {
     Yes,
     No,
 }
 
 fn deserialize_struct(
-    variant_ident: Option<syn::Ident>,
+    variant_ident: Option<&syn::Ident>,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
-    deserializer: Option<Tokens>,
+    deserializer: Option<TokenStream>,
     untagged: &Untagged,
 ) -> Fragment {
     let is_enum = variant_ident.is_some();
 
     let this = &params.this;
     let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
         split_with_de_lifetime(params);
     let delife = params.borrowed.de_lifetime();
 
     // If there are getters (implying private fields), construct the local type
     // and use an `Into` conversion to get the remote type. If there are no
     // getters then construct the target type directly.
     let construct = if params.has_getter {
-        let local = params.local;
+        let local = &params.local;
         quote!(#local)
     } else {
         quote!(#this)
     };
 
     let type_path = match variant_ident {
-        Some(variant_ident) => quote!(#construct::#variant_ident),
+        Some(ref variant_ident) => quote!(#construct::#variant_ident),
         None => construct,
     };
     let expecting = match variant_ident {
         Some(variant_ident) => format!("struct variant {}::{}", params.type_name(), variant_ident),
         None => format!("struct {}", params.type_name()),
     };
 
     let visit_seq = Stmts(deserialize_seq(
@@ -1010,17 +1027,17 @@ fn deserialize_struct(
 }
 
 #[cfg(feature = "deserialize_in_place")]
 fn deserialize_struct_in_place(
     variant_ident: Option<syn::Ident>,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
-    deserializer: Option<Tokens>,
+    deserializer: Option<TokenStream>,
 ) -> Option<Fragment> {
     let is_enum = variant_ident.is_some();
 
     // for now we do not support in_place deserialization for structs that
     // are represented as map.
     if cattrs.has_flatten() {
         return None;
     }
@@ -1258,17 +1275,17 @@ fn deserialize_externally_tagged_enum(
 #[cfg(feature = "deserialize_in_place")]
 fn deserialize_externally_tagged_enum_in_place(
     params: &Parameters,
     repr: &Repr,
     variants: &[Variant],
     cattrs: &attr::Container,
 ) -> Option<Fragment> {
     let int_repr = repr.get_stable_rust_enum_layout().map(|int_repr| {
-        let int_repr = Ident::from(int_repr);
+        let int_repr = Ident::new(int_repr, Span::call_site());
         quote!(#[repr(#int_repr)])
     });
 
     let unit_variant = variants.iter().position(|variant| is_unit(variant));
     let non_unit_variant = variants.iter().enumerate().find(|&(_, variant)| !is_unit(variant));
 
     // We need an int_repr, unit variant, and a non-unit variant to proceed
     if int_repr.is_none() || unit_variant.is_none() || non_unit_variant.is_none() {
@@ -1648,17 +1665,17 @@ fn deserialize_adjacently_tagged_enum(
             })
         };
         let arms = variants
             .iter()
             .enumerate()
             .filter(|&(_, variant)| !variant.attrs.skip_deserializing() && is_unit(variant))
             .map(|(i, variant)| {
                 let variant_index = field_i(i);
-                let variant_ident = variant.ident;
+                let variant_ident = &variant.ident;
                 quote! {
                     __Field::#variant_index => _serde::export::Ok(#this::#variant_ident),
                 }
             });
         missing_content = quote! {
             match __field {
                 #(#arms)*
                 #fallthrough
@@ -1912,17 +1929,17 @@ fn deserialize_externally_tagged_variant
         let (wrapper, wrapper_ty, unwrap_fn) = wrap_deserialize_variant_with(params, variant, path);
         return quote_block! {
             #wrapper
             _serde::export::Result::map(
                 _serde::de::VariantAccess::newtype_variant::<#wrapper_ty>(__variant), #unwrap_fn)
         };
     }
 
-    let variant_ident = variant.ident;
+    let variant_ident = &variant.ident;
 
     match variant.style {
         Style::Unit => {
             let this = &params.this;
             quote_block! {
                 try!(_serde::de::VariantAccess::unit_variant(__variant));
                 _serde::export::Ok(#this::#variant_ident)
             }
@@ -1970,42 +1987,42 @@ fn deserialize_externally_tagged_variant
             quote_block! {
                 try!(_serde::de::VariantAccess::unit_variant(__variant));
             }
         }
         Style::Newtype => {
             deserialize_externally_tagged_newtype_variant_in_place(variant_ident, params, &variant.fields[0])
         }
         Style::Tuple => {
-            deserialize_tuple_in_place(Some(*variant_ident), params, &variant.fields, cattrs, None)
+            deserialize_tuple_in_place(Some(variant_ident.clone()), params, &variant.fields, cattrs, None)
         }
         Style::Struct => {
             unimplemented!()
             // deserialize_struct(None, params, &variant.fields, cattrs, None, Untagged::No).0
         }
     }
 }
 
 fn deserialize_internally_tagged_variant(
     params: &Parameters,
     variant: &Variant,
     cattrs: &attr::Container,
-    deserializer: Tokens,
+    deserializer: TokenStream,
 ) -> Fragment {
     if variant.attrs.deserialize_with().is_some() {
         return deserialize_untagged_variant(params, variant, cattrs, deserializer);
     }
 
-    let variant_ident = variant.ident;
+    let variant_ident = &variant.ident;
 
     match variant.style {
         Style::Unit => {
             let this = &params.this;
             let type_name = params.type_name();
-            let variant_name = variant.ident.as_ref();
+            let variant_name = variant.ident.to_string();
             quote_block! {
                 try!(_serde::Deserializer::deserialize_any(#deserializer, _serde::private::de::InternallyTaggedUnitVisitor::new(#type_name, #variant_name)));
                 _serde::export::Ok(#this::#variant_ident)
             }
         }
         Style::Newtype => deserialize_untagged_newtype_variant(
             variant_ident,
             params,
@@ -2023,34 +2040,34 @@ fn deserialize_internally_tagged_variant
         Style::Tuple => unreachable!("checked in serde_derive_internals"),
     }
 }
 
 fn deserialize_untagged_variant(
     params: &Parameters,
     variant: &Variant,
     cattrs: &attr::Container,
-    deserializer: Tokens,
+    deserializer: TokenStream,
 ) -> Fragment {
     if let Some(path) = variant.attrs.deserialize_with() {
         let (wrapper, wrapper_ty, unwrap_fn) = wrap_deserialize_variant_with(params, variant, path);
         return quote_block! {
             #wrapper
             _serde::export::Result::map(
                 <#wrapper_ty as _serde::Deserialize>::deserialize(#deserializer), #unwrap_fn)
         };
     }
 
-    let variant_ident = variant.ident;
+    let variant_ident = &variant.ident;
 
     match variant.style {
         Style::Unit => {
             let this = &params.this;
             let type_name = params.type_name();
-            let variant_name = variant.ident.as_ref();
+            let variant_name = variant.ident.to_string();
             quote_expr! {
                 match _serde::Deserializer::deserialize_any(
                     #deserializer,
                     _serde::private::de::UntaggedUnitVisitor::new(#type_name, #variant_name)
                 ) {
                     _serde::export::Ok(()) => _serde::export::Ok(#this::#variant_ident),
                     _serde::export::Err(__err) => _serde::export::Err(__err),
                 }
@@ -2076,17 +2093,17 @@ fn deserialize_untagged_variant(
             cattrs,
             Some(deserializer),
             &Untagged::Yes,
         ),
     }
 }
 
 fn deserialize_externally_tagged_newtype_variant(
-    variant_ident: syn::Ident,
+    variant_ident: &syn::Ident,
     params: &Parameters,
     field: &Field,
 ) -> Fragment {
     let this = &params.this;
     match field.attrs.deserialize_with() {
         None => {
             let field_ty = field.ty;
             quote_expr! {
@@ -2131,20 +2148,20 @@ fn deserialize_externally_tagged_newtype
                     |__wrapper| #this::#variant_ident(__wrapper.value))
             }
             */
         }
     }
 }
 
 fn deserialize_untagged_newtype_variant(
-    variant_ident: syn::Ident,
+    variant_ident: &syn::Ident,
     params: &Parameters,
     field: &Field,
-    deserializer: &Tokens,
+    deserializer: &TokenStream,
 ) -> Fragment {
     let this = &params.this;
     let field_ty = field.ty;
     match field.attrs.deserialize_with() {
         None => {
             quote_expr! {
                 _serde::export::Result::map(
                     <#field_ty as _serde::Deserialize>::deserialize(#deserializer),
@@ -2231,17 +2248,17 @@ fn deserialize_custom_identifier(
         attr::Identifier::Field => false,
         attr::Identifier::No => unreachable!(),
     };
 
     let this = &params.this;
     let this = quote!(#this);
 
     let (ordinary, fallthrough) = if let Some(last) = variants.last() {
-        let last_ident = last.ident;
+        let last_ident = &last.ident;
         if last.attrs.other() {
             let ordinary = &variants[..variants.len() - 1];
             let fallthrough = quote!(_serde::export::Ok(#this::#last_ident));
             (ordinary, Some(fallthrough))
         } else if let Style::Newtype = last.style {
             let ordinary = &variants[..variants.len() - 1];
             let deserializer = quote!(_serde::private::de::IdentifierDeserializer::from(__value));
             let fallthrough = quote! {
@@ -2254,17 +2271,22 @@ fn deserialize_custom_identifier(
             (variants, None)
         }
     } else {
         (variants, None)
     };
 
     let names_idents: Vec<_> = ordinary
         .iter()
-        .map(|variant| (variant.attrs.name().deserialize_name(), variant.ident))
+        .map(|variant| {
+            (
+                variant.attrs.name().deserialize_name(),
+                variant.ident.clone(),
+            )
+        })
         .collect();
 
     let names = names_idents.iter().map(|&(ref name, _)| name);
 
     let names_const = if fallthrough.is_some() {
         None
     } else if is_variant {
         let variants = quote! {
@@ -2307,20 +2329,20 @@ fn deserialize_custom_identifier(
             marker: _serde::export::PhantomData::<#this #ty_generics>,
             lifetime: _serde::export::PhantomData,
         };
         _serde::Deserializer::deserialize_identifier(__deserializer, __visitor)
     }
 }
 
 fn deserialize_identifier(
-    this: &Tokens,
+    this: &TokenStream,
     fields: &[(String, Ident)],
     is_variant: bool,
-    fallthrough: Option<Tokens>,
+    fallthrough: Option<TokenStream>,
     collect_other_fields: bool,
 ) -> Fragment {
     let field_strs = fields.iter().map(|&(ref name, _)| name);
     let field_borrowed_strs = fields.iter().map(|&(ref name, _)| name);
     let field_bytes = fields
         .iter()
         .map(|&(ref name, _)| Literal::byte_string(name.as_bytes()));
     let field_borrowed_bytes = fields
@@ -2564,17 +2586,17 @@ fn deserialize_identifier(
                     #fallthrough_arm
                 }
             }
         }
     }
 }
 
 fn deserialize_struct_as_struct_visitor(
-    struct_path: &Tokens,
+    struct_path: &TokenStream,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
 ) -> (Fragment, Option<Fragment>, Fragment) {
     assert!(!cattrs.has_flatten());
 
     let field_names_idents: Vec<_> = fields
         .iter()
@@ -2593,17 +2615,17 @@ fn deserialize_struct_as_struct_visitor(
     let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false);
 
     let visit_map = deserialize_map(struct_path, params, fields, cattrs);
 
     (field_visitor, Some(fields_stmt), visit_map)
 }
 
 fn deserialize_struct_as_map_visitor(
-    struct_path: &Tokens,
+    struct_path: &TokenStream,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
 ) -> (Fragment, Option<Fragment>, Fragment) {
     let field_names_idents: Vec<_> = fields
         .iter()
         .enumerate()
         .filter(|&(_, field)| !field.attrs.skip_deserializing() && !field.attrs.flatten())
@@ -2613,17 +2635,17 @@ fn deserialize_struct_as_map_visitor(
     let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false);
 
     let visit_map = deserialize_map(struct_path, params, fields, cattrs);
 
     (field_visitor, None, visit_map)
 }
 
 fn deserialize_map(
-    struct_path: &Tokens,
+    struct_path: &TokenStream,
     params: &Parameters,
     fields: &[Field],
     cattrs: &attr::Container,
 ) -> Fragment {
     // Create the field names for the fields.
     let fields_names: Vec<_> = fields
         .iter()
         .enumerate()
@@ -2768,22 +2790,22 @@ fn deserialize_map(
                 }
             }
         })
     } else {
         None
     };
 
     let result = fields_names.iter().map(|&(field, ref name)| {
-        let ident = field.ident.expect("struct contains unnamed fields");
+        let member = &field.member;
         if field.attrs.skip_deserializing() {
             let value = Expr(expr_is_missing(field, cattrs));
-            quote!(#ident: #value)
+            quote!(#member: #value)
         } else {
-            quote!(#ident: #name)
+            quote!(#member: #name)
         }
     });
 
     let let_default = match *cattrs.default() {
         attr::Default::Default => Some(quote!(
             let __default: Self::Value = _serde::export::Default::default();
         )),
         attr::Default::Path(ref path) => Some(quote!(
@@ -2878,29 +2900,29 @@ fn deserialize_map_in_place(
         });
 
     // Match arms to extract a value for a field.
     let value_arms_from = fields_names
         .iter()
         .filter(|&&(field, _)| !field.attrs.skip_deserializing())
         .map(|&(field, ref name)| {
             let deser_name = field.attrs.name().deserialize_name();
-            let field_name = field.ident;
+            let member = &field.member;
 
             let visit = match field.attrs.deserialize_with() {
                 None => {
                     quote! {
-                        try!(_serde::de::MapAccess::next_value_seed(&mut __map, _serde::private::de::InPlaceSeed(&mut self.place.#field_name)))
+                        try!(_serde::de::MapAccess::next_value_seed(&mut __map, _serde::private::de::InPlaceSeed(&mut self.place.#member)))
                     }
                 }
                 Some(path) => {
                     let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
                     quote!({
                         #wrapper
-                        self.place.#field_name = try!(_serde::de::MapAccess::next_value::<#wrapper_ty>(&mut __map)).value
+                        self.place.#member = try!(_serde::de::MapAccess::next_value::<#wrapper_ty>(&mut __map)).value
                     })
                 }
             };
             quote! {
                 __Field::#name => {
                     if #name {
                         return _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#deser_name));
                     }
@@ -2942,31 +2964,32 @@ fn deserialize_map_in_place(
 
     let check_flags = fields_names
         .iter()
         .filter(|&&(field, _)| !field.attrs.skip_deserializing())
         .map(|&(field, ref name)| {
             let missing_expr = expr_is_missing(field, cattrs);
             // If missing_expr unconditionally returns an error, don't try
             // to assign its value to self.place.
-            if field.attrs.default().is_none() && cattrs.default().is_none()
+            if field.attrs.default().is_none()
+                && cattrs.default().is_none()
                 && field.attrs.deserialize_with().is_some()
             {
                 let missing_expr = Stmts(missing_expr);
                 quote! {
                     if !#name {
                         #missing_expr;
                     }
                 }
             } else {
-                let field_name = field.ident;
+                let member = &field.member;
                 let missing_expr = Expr(missing_expr);
                 quote! {
                     if !#name {
-                        self.place.#field_name = #missing_expr;
+                        self.place.#member = #missing_expr;
                     };
                 }
             }
         });