No bug - Revendor rust dependencies
authorServo VCS Sync <servo-vcs-sync@mozilla.com>
Tue, 13 Mar 2018 10:37:36 +0000
changeset 766978 2ba21bb0fdc90ec84f0bba4741d90ac3141f6497
parent 766977 1728fe9633089969d31d343ab9906348fdc34d59
child 766979 3429fca91c54e41c032c97bd8ed4449be308d21c
push id102471
push userwlachance@mozilla.com
push dateTue, 13 Mar 2018 19:02:54 +0000
milestone61.0a1
No bug - Revendor rust dependencies
Cargo.lock
third_party/rust/toml/.cargo-checksum.json
third_party/rust/toml/.travis.yml
third_party/rust/toml/Cargo.toml
third_party/rust/toml/README.md
third_party/rust/toml/examples/decode.rs
third_party/rust/toml/examples/toml2json.rs
third_party/rust/toml/src/datetime.rs
third_party/rust/toml/src/de.rs
third_party/rust/toml/src/decoder/mod.rs
third_party/rust/toml/src/decoder/rustc_serialize.rs
third_party/rust/toml/src/decoder/serde.rs
third_party/rust/toml/src/display.rs
third_party/rust/toml/src/encoder/mod.rs
third_party/rust/toml/src/encoder/rustc_serialize.rs
third_party/rust/toml/src/encoder/serde.rs
third_party/rust/toml/src/lib.rs
third_party/rust/toml/src/parser.rs
third_party/rust/toml/src/ser.rs
third_party/rust/toml/src/tokens.rs
third_party/rust/toml/src/value.rs
third_party/rust/toml/tests/backcompat.rs
third_party/rust/toml/tests/datetime.rs
third_party/rust/toml/tests/display-tricky.rs
third_party/rust/toml/tests/display.rs
third_party/rust/toml/tests/formatting.rs
third_party/rust/toml/tests/invalid-encoder-misc.rs
third_party/rust/toml/tests/invalid-misc.rs
third_party/rust/toml/tests/invalid.rs
third_party/rust/toml/tests/invalid/datetime-malformed-no-z.toml
third_party/rust/toml/tests/parser.rs
third_party/rust/toml/tests/pretty.rs
third_party/rust/toml/tests/serde.rs
third_party/rust/toml/tests/tables-last.rs
third_party/rust/toml/tests/valid.rs
third_party/rust/toml/tests/valid/datetime-truncate.json
third_party/rust/toml/tests/valid/datetime-truncate.toml
third_party/rust/toml/tests/valid/key-quote-newline.json
third_party/rust/toml/tests/valid/key-quote-newline.toml
third_party/rust/toml/tests/valid/table-array-nest-no-keys.json
third_party/rust/toml/tests/valid/table-array-nest-no-keys.toml
third_party/rust/toml/tests/valid/table-multi-empty.json
third_party/rust/toml/tests/valid/table-multi-empty.toml
third_party/rust/toml/tests/valid/unicode-escape.json
third_party/rust/toml/tests/valid/unicode-escape.toml
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1642,17 +1642,17 @@ dependencies = [
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.19.0",
  "servo_arc 0.1.1",
  "smallbitvec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "style_derive 0.0.1",
  "style_traits 0.0.1",
  "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "uluru 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1838,18 +1838,21 @@ dependencies = [
  "mio 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "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)",
 ]
 
 [[package]]
 name = "toml"
-version = "0.2.1"
+version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "serde 1.0.27 (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]]
 name = "typeable"
@@ -2338,17 +2341,17 @@ dependencies = [
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
 "checksum thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df7875b676fddfadffd96deea3b1124e5ede707d4884248931077518cf1f773"
 "checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
 "checksum thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf947d192a9be60ef5131cc7a4648886ba89d712f16700ebbf80c8a69d05d48f"
 "checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
 "checksum tokio-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "febd81b3e2ef615c6c8077347b33f3f3deec3d708ecd08194c9707b7a1eccfc9"
 "checksum tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ab83e7adb5677e42e405fa4ceff75659d93c4d7d7dd22f52fcec59ee9f02af"
 "checksum tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9"
-"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
+"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"
 "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
 "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
 "checksum uluru 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "519130f0ea964ba540a9d8af1373738c2226f1d465eda07e61db29feb5479db9"
 "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33"
 "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
 "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f"
 "checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3"
 "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
--- a/third_party/rust/toml/.cargo-checksum.json
+++ b/third_party/rust/toml/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".travis.yml":"7d917e42244b1d0d0304a11e8ef45bbc34e2a859bf35a752ed6069920a7cc8c5","Cargo.toml":"996f64a3b649cb71b337b03882f63e487de78fbddb97734c67c6fca015976f2c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"a3505a33e4973ac97b3c7189f7b56b3a5f483218f1a23da5f625a718ad9adc16","examples/toml2json.rs":"d1980e1d53e712ea6f9d6b3a36ce156b075bf8c1dd7660c2947e7b81106ea41c","src/decoder/mod.rs":"23c4045e9131b26ea772797f4dc65a57fab4e4a59b340dcceb094db9dd5cc02e","src/decoder/rustc_serialize.rs":"e5fc97516f38a5997c514318c857173cc7ebfc9b06b0b0517127bdc02c18c625","src/decoder/serde.rs":"7cae3e1d2795d53c351f98b7d010dc4d579ac93f9e3e44dc307b9eca2186f2cc","src/display.rs":"2a9fea5f27328412dd3168571a94645711714261fef1f9348e4cab56138a640e","src/encoder/mod.rs":"b7af37d6cab330bb749717274d821cf34599cf210f19daa431fb0fdb0ef3c2b8","src/encoder/rustc_serialize.rs":"d444ea1995d4cba19ab6e17eabc9246070787a58d2b430997b55d6e1a88a5c30","src/encoder/serde.rs":"eb1d0237fa5d1d4367bcf3cff287cb10b9467d05ab817a696d7a6316350cdd11","src/lib.rs":"6c7e98f283e3263587c628c216ea2274375ab81286070937cec7cc79d82eed01","src/parser.rs":"6bb7694a3ad138b1ffafa6d9fc1dec342ea34af0219b2f560f3777014a21481b","tests/README.md":"3e7d07d64c34e117c3d862ee12e4947af8c133fb0b53f6f0de43cc3bfa5057b8","tests/formatting.rs":"bc672504cedbf956de645073baab876baf06c7f2bc120db20d27b1446c8b5f4b","tests/invalid-encoder/array-mixed-types-ints-and-floats.json":"206d2a353153efbcee74e7ee7b0f852e7a948cfb88417f74607b3ad6f020e373","tests/invalid.rs":"ef9b613246634673e43f95b8688f275d22726f41fb9ecb824504217e6f5d5c58","tests/invalid/array-mixed-types-arrays-and-ints.toml":"c1547b686357c7a865e333a7ce7eed1e30743ebc4daac8ea6148bdd84b7e4dc7","tests/invalid/array-mixed-types-ints-and-floats.toml":"baa235fc168869716680955fd5bdafab30b6fa9b3d09185086261a56ef12960e","tests/invalid/array-mixed-types-strings-and-ints.toml":"4440057ed90d4461db0be55cfd71299cad96b601d5faec2140666242f6fde147","tests/invalid/datetime-malformed-no-leads.toml":"1fa6bf72ea0b96be835ac031408f7acfd0b8d18d5f54b4c0fce8136aad27d22e","tests/invalid/datetime-malformed-no-secs.toml":"b9c30b7fa1847c80e381d68cc79834eefbb8813cd0eff465fb7cbe0733df429b","tests/invalid/datetime-malformed-no-t.toml":"490a46d2e707ef4f87987ec12a22afa5a71c97c5eaa0f4201a174c47846c6a4a","tests/invalid/datetime-malformed-no-z.toml":"6ca48b84c444b3ca51a480aa9688dd1044861010aff674a67e5cec34fd2eb489","tests/invalid/datetime-malformed-with-milli.toml":"62bfd0a6645bcb3f78211523e5673a3d1fa726d9e942c1643df243d6fba474c8","tests/invalid/duplicate-key-table.toml":"a896ea2180d16fcdd4f6c30aa27529b5b29e7e195a4e7a9944343028783602e9","tests/invalid/duplicate-keys.toml":"4bb0a65c22e7704893a2a51334eb2518af702850ef59aeecd5226e7b26bc07ec","tests/invalid/duplicate-tables.toml":"23b16ce26e1155ee6bf1fff559701dce86475c6a2878536b61f6b7e68be340de","tests/invalid/empty-implicit-table.toml":"d6026110dc0dee7babd69592218819328caa425f48cc879e895b29e48550c06c","tests/invalid/empty-table.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/float-no-leading-zero.toml":"159654461094c938574ba2d2d09baa3d3c387dd6ed024fd411530c0573a1ec42","tests/invalid/float-no-trailing-digits.toml":"64e4f336186cd096be2804532dbd694dd50ea551d292a9cdbf0bef2abf227101","tests/invalid/key-after-array.toml":"314af33770170b53bf2ec3be43ea1609d981c81d62c968052499b85ed54ccce8","tests/invalid/key-after-table.toml":"ed0dcf38f003d184dd18d1518702da0115cbfb05a5a28cbcf42de2f9bdee05fa","tests/invalid/key-empty.toml":"4303477abf4c0b920b42e96edd61caecf9c1f2d5d97f56af876854cd725aff3c","tests/invalid/key-hash.toml":"cd2a2eba6032d32c829633d3cd2778aeba81f5ff554e69f62af6557d1dc712f6","tests/invalid/key-newline.toml":"06a313a6bd70c2db6a1f5bda479d854d8f87e037e3cabf18fb5db822466ffcac","tests/invalid/key-open-bracket.toml":"52dea939022949290e3a19f1291d15605429344dce3cd1aa1f1568ecad8ca365","tests/invalid/key-single-open-bracket.toml":"245843abef9e72e7efac30138a994bf6301e7e1d7d7042a33d42e863d2638811","tests/invalid/key-space.toml":"b4e336d07c27fb3d0f0a6e50b733e1546202dfd58aaf2f7956f56fd6f075b0a1","tests/invalid/key-start-bracket.toml":"3bd3748a9df1d25ab2661330a3da187bd4da3958292bbf0e8b59d7963634dd87","tests/invalid/key-two-equals.toml":"3ac0c4e339d47c86e57564e43147b772ae83933b78083dc78d0ef77e231df3f1","tests/invalid/string-bad-byte-escape.toml":"c665dcec7c02f442c4fdc80423698eed2376ce65779cf855371772293bec2927","tests/invalid/string-bad-escape.toml":"eeca691fbba3d270f58ae2953d2d1369a773e619e39d8c11f38d6bf6f8472e82","tests/invalid/string-byte-escapes.toml":"4a4604b32971de3a252cd01d2997b450972c3ec9030cf22a070d49c57f050da4","tests/invalid/string-no-close.toml":"bb2eaf96eb9f83a52bd0772abb313060a06b94f650efeb45edce774622686882","tests/invalid/table-array-implicit.toml":"9b841ea64d68be4deb54f67fc807b05fd235452ee563ffa7de69dbca64b2f7dd","tests/invalid/table-array-malformed-bracket.toml":"164f641b2628bf04f8202d9746a360a4a243faca1408dc2ecd0c0fdd2d1c2c27","tests/invalid/table-array-malformed-empty.toml":"56ca2a15019cf5c3555041a191f983dc72b1678f0de0afd1a7b8f46ed7970420","tests/invalid/table-empty.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/table-nested-brackets-close.toml":"991e1210f81e24abcd735988f0d960d4ee94d2ec3b133c6fea6e24932d91c507","tests/invalid/table-nested-brackets-open.toml":"8fb569fc90fa606ae94708ee2bf205bff8db8a023624b3e52ef6b2c1a98ba1c6","tests/invalid/table-whitespace.toml":"2c2db1259adc641df0459e896d349d3db60965d5368d5c8ed50aedd3bc88f040","tests/invalid/table-with-pound.toml":"d8070437f07bd115ac8006c61e286401bd3be88728a62264796e757121750ecd","tests/invalid/text-after-array-entries.toml":"2530cace13292313983b90b01d63e4b8ac484809e7ef0ac79904923573eda7ec","tests/invalid/text-after-integer.toml":"6168ed823a135b8914956b04307aeec2347b10eb1aa79008406d7b547cbde682","tests/invalid/text-after-string.toml":"1771987dd679e1cc181cf53406ba313fdc3413a081d17a93da6041bf6ccccf5e","tests/invalid/text-after-table.toml":"f27ae56bb0b42d3af4c813392857afdfeb4bf8ab77ff896cd93ba32cf1a21b26","tests/invalid/text-before-array-separator.toml":"192d28699573abbdc521797576d4885adf756336c3e76971f10270603c957464","tests/invalid/text-in-array.toml":"50d7b16d7a03d470f1a907eebfeb156d0c696e6f9a8c734a5e4caa2365f54654","tests/valid.rs":"d2199e449a1f6b5aab1914f7b739ae0f496657ca249aa3b9bcdd85b89075e4e4","tests/valid/array-empty.json":"4ed46e8aa3586a7ddd9097cda38919699860052f188880de18e12d4acbee5307","tests/valid/array-empty.toml":"769faa42a690b02ad1b573277f0d793a4a38a7ecf30b9db67bf9836fe2b7778c","tests/valid/array-nospaces.json":"7c82b474797871488c2b522e9b852772a78c681a86900f780f7a0be4f901e1ec","tests/valid/array-nospaces.toml":"01fba63551b1051f7e117c9551c488b293bd3cd4745cbeec6b3709c32f2a3a64","tests/valid/arrays-hetergeneous.json":"dac4702412c90d5ddd6b898c3657c71d782d0aca46e5b9ca19cc694d3e226c0f","tests/valid/arrays-hetergeneous.toml":"361ae2e8470b47b12b336eb61eedd09abb20e216fbeb582b46d16a2831adda4d","tests/valid/arrays-nested.json":"34d6f8fd770f0728f38dbf0d686bed2c218bc16da978290c0208d3bf3704bdec","tests/valid/arrays-nested.toml":"a5941a01a2ba2fa179a3885039a5f81ca6c9876b2e8bea7b880563238be9f004","tests/valid/arrays.json":"315fff195a7d4c80e867e1f14c12a23e36dcc666e8de36138249b15e99bdd4dd","tests/valid/arrays.toml":"2d3c91b77d4f6a65a6a5a2c5ad521dbe86cc2f0ff389dfe58e8c34275cdc35c7","tests/valid/bool.json":"bb608b912fe4d89cb2186da957c10951780575bb34b2f43305335c745eff049c","tests/valid/bool.toml":"3c06ad4dce7430326f5f867105b2e9382def90cccb3ecb69f657c0b88974ab04","tests/valid/comments-everywhere.json":"800f8efd86d1bab4f91f0e367da52a2465e1480387df892561ed8948fd1a38c3","tests/valid/comments-everywhere.toml":"8636108c34f50d45244b142d342234b7535e01fba2db2d2ffed3430223009cea","tests/valid/datetime.json":"94f130c3b2a5f30c625a3a3168b9dfe52aa109b470c4e077f352b3dd79382a69","tests/valid/datetime.toml":"4e1b71ba31a1feef80a1e436225aa9c5d291bf780f558e7cfa76998fe2a29e08","tests/valid/empty.json":"ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356","tests/valid/empty.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","tests/valid/example-bom.toml":"50f3607be97de2f894ccd41a29d3a8a1b1f430982e5ab5bf43047874837f6a42","tests/valid/example-v0.3.0.json":"ec02332eb59dab93a50560771e4b01b972a29d93b6dca8954728c0631e1799a0","tests/valid/example-v0.3.0.toml":"aba9349588c1ba6af2a3ad0c1db2c3d311dca66b64f654480340a0823dfd4546","tests/valid/example-v0.4.0.json":"8b967b246ca2383172eaaecf790b2115a18020f63c70d0848d1dc25fc1fed5a9","tests/valid/example-v0.4.0.toml":"47ee4c4cd83637cd09aca6518f88c8ed56acc2b3022e5ea53d9121e5d35335ed","tests/valid/example.json":"c57fabb1be0ae7ed140fe7ae5082051571c85180204b8ae8d8da1e86133278c9","tests/valid/example.toml":"6f02b2a52ea63c70b629e41e06a8eb1eb4aab359ab966a7a397b248e13849c9c","tests/valid/example2.json":"de89432e78f0a074aae54650fedf151ceca3b0ccb148b8a66e18e2ed68024ba2","tests/valid/example2.toml":"c389eeb485fb7cb9445d617a9a0f8ba70049f08d66cf6b6f2a9a986574295de1","tests/valid/float.json":"9676c13fef00a01bc729456bfe27f1b24a1bd059c9a5913bb0b0401e976a0aab","tests/valid/float.toml":"b6784f554aa38bb210f0905c3bafdfae6db723a4f53288fb07febc66451bbc2d","tests/valid/hard_example.json":"8d170e73e156b8b6be559246880e9cb6a79b36f63d14bc97e3bdf2f2091e7a17","tests/valid/hard_example.toml":"cd3b89f8917a44f944b12fe47f69f86bb39f17db85d1a081bf0c134831eb90f9","tests/valid/implicit-and-explicit-after.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-after.toml":"0599b16822764cdb1c3d3cf53f71186b97afc9f60f8d58358a4a89fe4d9477c3","tests/valid/implicit-and-explicit-before.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-before.toml":"33435dddb68144b652ca5f5e0c4c53e4f7b3ca0166f9b944eda55f8d76ed2871","tests/valid/implicit-groups.json":"fc2bb43ec20c8c9148c8a70490b3a054506932c41687222ea11faae47eafb723","tests/valid/implicit-groups.toml":"248b3e8272ec43ce4af872981acde10628eeae73537ed6763a1f4245f5a9610c","tests/valid/integer.json":"0fc2d0cb1fb46d7805c1007b1fa4c46a65b273e56ae9d751df686e81d3a3354f","tests/valid/integer.toml":"74b964eb9561be6aa7266f6034cee1cd0657bdab8043a5ec9da33d9b184345da","tests/valid/key-equals-nospace.json":"b9878ee3585d1b48710a4bc09f2163b910ea71a2bfdaa8f1da68e599e8b30f47","tests/valid/key-equals-nospace.toml":"24cab0d01b67b184d0a737de3a5b5d47b8b69b36203273296d5ef763f7fdcf68","tests/valid/key-space.json":"30be539b01420be5cedc9078b88c3279bbef7c0bdde36ba8249ed8906112d5c7","tests/valid/key-space.toml":"9e9459b8cfebc404cf93d77c2d4082cadcd57165a2f9ce9cb35d1d12dc94a8c0","tests/valid/key-special-chars.json":"8bbebb20660d93efa73707bdb09e87a43c2b31c18f13df6388c701a1bc7cab8c","tests/valid/key-special-chars.toml":"c6cb0ba12d32f03cda4206097a1edb27cd154215d72e1c5791cc4f8dff2270b3","tests/valid/key-with-pound.json":"ea4dd79d0ad2a824bcce5c4c194d7fae82a7584a2ab7c0d83d6ddaae6130973e","tests/valid/key-with-pound.toml":"c334f676e19c01b96111277248654358cc8222fd0639aecaf429407e63b6a2dc","tests/valid/long-float.json":"7e103f56e490aa1b1fe5a762000ceb1f8c599f7d81aa215c90f5da41ab4ba6db","tests/valid/long-float.toml":"4d23f706f2a0d241840f6ea78657820c9c7b904c0c3c16828f8cc2574d7c8761","tests/valid/long-integer.json":"9ed7976639f0c2cd7f112584e2f5d272e92569be7135ea5bb9ba597abaff0767","tests/valid/long-integer.toml":"309f94be7ff5fd6f6dedbd257a1e6c171cb71aa74409ff3f8babda951f89d687","tests/valid/multiline-string.json":"3d67a8b992b85e9a2e58b77a1b76dc29745a9c2b4a362ad517786fed541948d7","tests/valid/multiline-string.toml":"7d6650009eb31a03d5b40b20712ef0157e9b787d9c966e66c38873a34e3b861c","tests/valid/raw-multiline-string.json":"4c95e34497433168cac25eb4132485c3bd13c35cad9d13d7becf7f90469dacca","tests/valid/raw-multiline-string.toml":"c724151024ccde432e0ec0d4ba60a5320d77841008116324c39516b8cbb94f4d","tests/valid/raw-string.json":"19268797aff8dfa28437d6ed8f9d813035f6eee50aade5fc774ba12b3290216b","tests/valid/raw-string.toml":"16510e05d477a0856ebaf38cacd0e9e18f02ab63ac7bd1a2eabbaa47a54d0e49","tests/valid/string-empty.json":"ece7d01326742a46e37d6404175118c0a91a2494f7ba2290bbc1d6f990ddb65b","tests/valid/string-empty.toml":"251e9e4052ede79f6b2462e71f73e0b7c9f5927484f6f77f0cd8b3c839b0c13b","tests/valid/string-escapes.json":"3d516f03cf94d5b5ee6b0887b8d37fdf21152752f049f5922a24adaacb5b8c35","tests/valid/string-escapes.toml":"86b1569e10fec91301709ad747012f0f42395050a2343b42aca450e001120f7a","tests/valid/string-simple.json":"622676e347676cce9f9733210acbd8056ce77a0588772ffd6efb05bb4e81b571","tests/valid/string-simple.toml":"ae74db09acea3be2ccae7f854f7b6f7c874ace9d4d87bf2f437b059a7d38a464","tests/valid/string-with-pound.json":"458a0add71536c1df5e1ed3ee5483c6eb48578abce0b0ebcdf75ea20d41ed6f4","tests/valid/string-with-pound.toml":"1aee397830d9ad2a93d41ee9c435acdbfef3758d1bb7c48bca7424fbbec89466","tests/valid/table-array-implicit.json":"3f7d3cdb468de67bc183162805d9c753ef5772f6f363ac2a26598387a5d991ea","tests/valid/table-array-implicit.toml":"66bcb030899a95e9a25ec44b7c9291b02f80ecbc324061cf1cd93223a2919f21","tests/valid/table-array-many.json":"3f21243eeb71ca3e5657a43559c806e12e3833e9f74c43c0c12aad9b0c853e4c","tests/valid/table-array-many.toml":"8d8ea546f954a81ca149a02147ae5f4bf075151cfcd530e62dcf05a04d843ffb","tests/valid/table-array-nest.json":"0a987d2bf1d5bc85f5c9433f23d389063600682a68538b6e57938a3c572959e4","tests/valid/table-array-nest.toml":"71b9c753bf773f232ac71cb2469a54ee0110ff137829045421edd7c5a64d6b6a","tests/valid/table-array-one.json":"7dc0ea3f7f843f7dc7443e68af43a1e5130a5fbae8a27fb02d8d92fa2487888e","tests/valid/table-array-one.toml":"4c478aea2dd7dfcfda682503b49e610f0fa4ce85a3b3cd0bc9041d4959e3626a","tests/valid/table-empty.json":"11e43e212d87b3b2547a5f2541f4091a3d2f6ba00b2a2004b07e02734e927ea7","tests/valid/table-empty.toml":"24d4941e67d5965d270eaebdb9816b994311e0f2f0e79ef6bb626f362c52842e","tests/valid/table-sub-empty.json":"85cca6d48a5993c4f207c21ed96652af4f50b6936b0807659c75317c1763b6db","tests/valid/table-sub-empty.toml":"ae92e90a806ffefcbf8cda83cb82acf7448f75efa50dcfb5e2384632d36471b3","tests/valid/table-whitespace.json":"ad84ac49a6d13f7c4a8af0e1e71fd7ff2a446aa16a34c21a809a0850dfa76e73","tests/valid/table-whitespace.toml":"2f15dafb263d2771671db299f6202b4b78d293aec1ded7641ec7eb1cb024b52c","tests/valid/table-with-pound.json":"151e76606efe77500cbb0aa8fcf8ccfadb124d533bb79a9caa62e937b826e676","tests/valid/table-with-pound.toml":"a1f86c2e3789cc89500ec1d5eac2ec0bdb94bf445fddc3cab558b5228f3aba56","tests/valid/unicode-escape.json":"ebbf81930fa92ea5822bb1ed808b798731abe5c97e64f6471e1e86878d79037c","tests/valid/unicode-escape.toml":"aa26e55e5526a0d00ad68eca774d5c43cbcdf24ae753e0219bf3ab31b9e628b8","tests/valid/unicode-literal.json":"1dd42756384b954955815dc3e906db64b4cd2c0c094f9b3c86633d1652d6d79d","tests/valid/unicode-literal.toml":"bffc6c3d4757de31d0cbfd7b8dc591edd2910fe8a4e1c46bbee422dddc841003"},"package":"736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"}
\ No newline at end of file
+{"files":{".travis.yml":"cd984c9fc4ae15cf9a1cbc8d0f3b0b41cb2ad240fc3b14e06917e0ffd824964d","Cargo.toml":"e3606897c2303508e3091468afb2afd22828bb2fa971d91b522c9ddf4832f100","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"cdb1e357027407997a4666c3cb7d4db6676ef151289dbc49b1ab6df744e06047","examples/decode.rs":"91f5c35b94257f184d85183036a6d6d7aafbc22672b99446105b3cffdf3e7ff4","examples/toml2json.rs":"eaa9ad85ec19714f6437048ae28b844966225a17055d1a37878f41bcbc2c5e47","src/datetime.rs":"770bf5947748c8d563174dd8b4e4dee35fbd3171ea81c445c554d642c524f302","src/de.rs":"47a8e1ecee22068dc9d381f8ec05a47c644af49dbbb160fd3cb7a7b86d664adf","src/lib.rs":"d618368aac8d3ee5873eab36a3672cd88d72a121e26b5fd537cd3548293a1ff6","src/ser.rs":"11d8b67e9f84583d48c1a561c3c8e080b71be0ff479243ddbae28d5da797d261","src/tokens.rs":"ccc58d254a4a5666573fe42cf21b88621292c59858067169f102f2533cea9372","src/value.rs":"87a745d1eeba0ce4dc79451d0640d9a6145dec50dded1748e9a167719217be2a","tests/README.md":"3e7d07d64c34e117c3d862ee12e4947af8c133fb0b53f6f0de43cc3bfa5057b8","tests/backcompat.rs":"1d40b13ed379832d31c5d1ae35b9a3c9d9f66ab0ec40e7c16f46139d2fb4c35e","tests/datetime.rs":"c76e7f60514a748c56e09c369d888ea22d8e600b0200275da62dc8ad47ce9761","tests/display-tricky.rs":"e0ffa4f992ac1b3f6c88cf2dc299b605c6352ca3dcf18a4253fdb9b98ef410fd","tests/display.rs":"4472cf88c0ccc58d47b109570f8b19a218ac274ab5293df9e67db2db4f6e5945","tests/formatting.rs":"8941f2fe843d5294ef3dc7ff8aaa3db325d4ec368f1d138f8c28ab4e18c8261b","tests/invalid-encoder-misc.rs":"7a29c89dd664276cae8869d2394b0e7cf29f7a6d298cd8566fa1fd087dd635f4","tests/invalid-encoder/array-mixed-types-ints-and-floats.json":"206d2a353153efbcee74e7ee7b0f852e7a948cfb88417f74607b3ad6f020e373","tests/invalid-misc.rs":"70e14c859e67ed7e03ec426e5cb25a306a893cf85042e0be4fdbbc423b076887","tests/invalid.rs":"f6798f22652c2c09c23b066af33b402319399f7106ef5c9fda1a5222af522856","tests/invalid/array-mixed-types-arrays-and-ints.toml":"c1547b686357c7a865e333a7ce7eed1e30743ebc4daac8ea6148bdd84b7e4dc7","tests/invalid/array-mixed-types-ints-and-floats.toml":"baa235fc168869716680955fd5bdafab30b6fa9b3d09185086261a56ef12960e","tests/invalid/array-mixed-types-strings-and-ints.toml":"4440057ed90d4461db0be55cfd71299cad96b601d5faec2140666242f6fde147","tests/invalid/datetime-malformed-no-leads.toml":"1fa6bf72ea0b96be835ac031408f7acfd0b8d18d5f54b4c0fce8136aad27d22e","tests/invalid/datetime-malformed-no-secs.toml":"b9c30b7fa1847c80e381d68cc79834eefbb8813cd0eff465fb7cbe0733df429b","tests/invalid/datetime-malformed-no-t.toml":"490a46d2e707ef4f87987ec12a22afa5a71c97c5eaa0f4201a174c47846c6a4a","tests/invalid/datetime-malformed-with-milli.toml":"62bfd0a6645bcb3f78211523e5673a3d1fa726d9e942c1643df243d6fba474c8","tests/invalid/duplicate-key-table.toml":"a896ea2180d16fcdd4f6c30aa27529b5b29e7e195a4e7a9944343028783602e9","tests/invalid/duplicate-keys.toml":"4bb0a65c22e7704893a2a51334eb2518af702850ef59aeecd5226e7b26bc07ec","tests/invalid/duplicate-tables.toml":"23b16ce26e1155ee6bf1fff559701dce86475c6a2878536b61f6b7e68be340de","tests/invalid/empty-implicit-table.toml":"d6026110dc0dee7babd69592218819328caa425f48cc879e895b29e48550c06c","tests/invalid/empty-table.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/float-no-leading-zero.toml":"159654461094c938574ba2d2d09baa3d3c387dd6ed024fd411530c0573a1ec42","tests/invalid/float-no-trailing-digits.toml":"64e4f336186cd096be2804532dbd694dd50ea551d292a9cdbf0bef2abf227101","tests/invalid/key-after-array.toml":"314af33770170b53bf2ec3be43ea1609d981c81d62c968052499b85ed54ccce8","tests/invalid/key-after-table.toml":"ed0dcf38f003d184dd18d1518702da0115cbfb05a5a28cbcf42de2f9bdee05fa","tests/invalid/key-empty.toml":"4303477abf4c0b920b42e96edd61caecf9c1f2d5d97f56af876854cd725aff3c","tests/invalid/key-hash.toml":"cd2a2eba6032d32c829633d3cd2778aeba81f5ff554e69f62af6557d1dc712f6","tests/invalid/key-newline.toml":"06a313a6bd70c2db6a1f5bda479d854d8f87e037e3cabf18fb5db822466ffcac","tests/invalid/key-open-bracket.toml":"52dea939022949290e3a19f1291d15605429344dce3cd1aa1f1568ecad8ca365","tests/invalid/key-single-open-bracket.toml":"245843abef9e72e7efac30138a994bf6301e7e1d7d7042a33d42e863d2638811","tests/invalid/key-space.toml":"b4e336d07c27fb3d0f0a6e50b733e1546202dfd58aaf2f7956f56fd6f075b0a1","tests/invalid/key-start-bracket.toml":"3bd3748a9df1d25ab2661330a3da187bd4da3958292bbf0e8b59d7963634dd87","tests/invalid/key-two-equals.toml":"3ac0c4e339d47c86e57564e43147b772ae83933b78083dc78d0ef77e231df3f1","tests/invalid/string-bad-byte-escape.toml":"c665dcec7c02f442c4fdc80423698eed2376ce65779cf855371772293bec2927","tests/invalid/string-bad-escape.toml":"eeca691fbba3d270f58ae2953d2d1369a773e619e39d8c11f38d6bf6f8472e82","tests/invalid/string-byte-escapes.toml":"4a4604b32971de3a252cd01d2997b450972c3ec9030cf22a070d49c57f050da4","tests/invalid/string-no-close.toml":"bb2eaf96eb9f83a52bd0772abb313060a06b94f650efeb45edce774622686882","tests/invalid/table-array-implicit.toml":"9b841ea64d68be4deb54f67fc807b05fd235452ee563ffa7de69dbca64b2f7dd","tests/invalid/table-array-malformed-bracket.toml":"164f641b2628bf04f8202d9746a360a4a243faca1408dc2ecd0c0fdd2d1c2c27","tests/invalid/table-array-malformed-empty.toml":"56ca2a15019cf5c3555041a191f983dc72b1678f0de0afd1a7b8f46ed7970420","tests/invalid/table-empty.toml":"37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570","tests/invalid/table-nested-brackets-close.toml":"991e1210f81e24abcd735988f0d960d4ee94d2ec3b133c6fea6e24932d91c507","tests/invalid/table-nested-brackets-open.toml":"8fb569fc90fa606ae94708ee2bf205bff8db8a023624b3e52ef6b2c1a98ba1c6","tests/invalid/table-whitespace.toml":"2c2db1259adc641df0459e896d349d3db60965d5368d5c8ed50aedd3bc88f040","tests/invalid/table-with-pound.toml":"d8070437f07bd115ac8006c61e286401bd3be88728a62264796e757121750ecd","tests/invalid/text-after-array-entries.toml":"2530cace13292313983b90b01d63e4b8ac484809e7ef0ac79904923573eda7ec","tests/invalid/text-after-integer.toml":"6168ed823a135b8914956b04307aeec2347b10eb1aa79008406d7b547cbde682","tests/invalid/text-after-string.toml":"1771987dd679e1cc181cf53406ba313fdc3413a081d17a93da6041bf6ccccf5e","tests/invalid/text-after-table.toml":"f27ae56bb0b42d3af4c813392857afdfeb4bf8ab77ff896cd93ba32cf1a21b26","tests/invalid/text-before-array-separator.toml":"192d28699573abbdc521797576d4885adf756336c3e76971f10270603c957464","tests/invalid/text-in-array.toml":"50d7b16d7a03d470f1a907eebfeb156d0c696e6f9a8c734a5e4caa2365f54654","tests/parser.rs":"6efa6a073adc041e1347fbaf30225359253a8f878ce328cdb74af3e83f60163e","tests/pretty.rs":"82b69142f0b438b0d76753d1a70ecb5c9d78df9f7c05a75e1be36eef11679960","tests/serde.rs":"94a119191110c4e57ef44f75022c0473fa1ffb9ed4242cd6320cbf96a7a3234a","tests/tables-last.rs":"593c60ea4727f08168a4a016ef876283d50f78888c5eab7d407092681712f912","tests/valid.rs":"ac398cac034eb7b6d320eb97b383a562e4924a22ef8d29fe43417ad95b17877d","tests/valid/array-empty.json":"4ed46e8aa3586a7ddd9097cda38919699860052f188880de18e12d4acbee5307","tests/valid/array-empty.toml":"769faa42a690b02ad1b573277f0d793a4a38a7ecf30b9db67bf9836fe2b7778c","tests/valid/array-nospaces.json":"7c82b474797871488c2b522e9b852772a78c681a86900f780f7a0be4f901e1ec","tests/valid/array-nospaces.toml":"01fba63551b1051f7e117c9551c488b293bd3cd4745cbeec6b3709c32f2a3a64","tests/valid/arrays-hetergeneous.json":"dac4702412c90d5ddd6b898c3657c71d782d0aca46e5b9ca19cc694d3e226c0f","tests/valid/arrays-hetergeneous.toml":"361ae2e8470b47b12b336eb61eedd09abb20e216fbeb582b46d16a2831adda4d","tests/valid/arrays-nested.json":"34d6f8fd770f0728f38dbf0d686bed2c218bc16da978290c0208d3bf3704bdec","tests/valid/arrays-nested.toml":"a5941a01a2ba2fa179a3885039a5f81ca6c9876b2e8bea7b880563238be9f004","tests/valid/arrays.json":"315fff195a7d4c80e867e1f14c12a23e36dcc666e8de36138249b15e99bdd4dd","tests/valid/arrays.toml":"2d3c91b77d4f6a65a6a5a2c5ad521dbe86cc2f0ff389dfe58e8c34275cdc35c7","tests/valid/bool.json":"bb608b912fe4d89cb2186da957c10951780575bb34b2f43305335c745eff049c","tests/valid/bool.toml":"3c06ad4dce7430326f5f867105b2e9382def90cccb3ecb69f657c0b88974ab04","tests/valid/comments-everywhere.json":"800f8efd86d1bab4f91f0e367da52a2465e1480387df892561ed8948fd1a38c3","tests/valid/comments-everywhere.toml":"8636108c34f50d45244b142d342234b7535e01fba2db2d2ffed3430223009cea","tests/valid/datetime-truncate.json":"5ca5dbb56bb00c4cfc4c10aeb5607160284593bad3bf6dc988425a4f1f53dfbc","tests/valid/datetime-truncate.toml":"55ee01485f3e537fb6b2d3977f656c11543e53adb4e79c6fa8f2a953183c0f7f","tests/valid/datetime.json":"94f130c3b2a5f30c625a3a3168b9dfe52aa109b470c4e077f352b3dd79382a69","tests/valid/datetime.toml":"4e1b71ba31a1feef80a1e436225aa9c5d291bf780f558e7cfa76998fe2a29e08","tests/valid/empty.json":"ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356","tests/valid/empty.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","tests/valid/example-bom.toml":"50f3607be97de2f894ccd41a29d3a8a1b1f430982e5ab5bf43047874837f6a42","tests/valid/example-v0.3.0.json":"ec02332eb59dab93a50560771e4b01b972a29d93b6dca8954728c0631e1799a0","tests/valid/example-v0.3.0.toml":"aba9349588c1ba6af2a3ad0c1db2c3d311dca66b64f654480340a0823dfd4546","tests/valid/example-v0.4.0.json":"8b967b246ca2383172eaaecf790b2115a18020f63c70d0848d1dc25fc1fed5a9","tests/valid/example-v0.4.0.toml":"47ee4c4cd83637cd09aca6518f88c8ed56acc2b3022e5ea53d9121e5d35335ed","tests/valid/example.json":"c57fabb1be0ae7ed140fe7ae5082051571c85180204b8ae8d8da1e86133278c9","tests/valid/example.toml":"6f02b2a52ea63c70b629e41e06a8eb1eb4aab359ab966a7a397b248e13849c9c","tests/valid/example2.json":"de89432e78f0a074aae54650fedf151ceca3b0ccb148b8a66e18e2ed68024ba2","tests/valid/example2.toml":"c389eeb485fb7cb9445d617a9a0f8ba70049f08d66cf6b6f2a9a986574295de1","tests/valid/float.json":"9676c13fef00a01bc729456bfe27f1b24a1bd059c9a5913bb0b0401e976a0aab","tests/valid/float.toml":"b6784f554aa38bb210f0905c3bafdfae6db723a4f53288fb07febc66451bbc2d","tests/valid/hard_example.json":"8d170e73e156b8b6be559246880e9cb6a79b36f63d14bc97e3bdf2f2091e7a17","tests/valid/hard_example.toml":"cd3b89f8917a44f944b12fe47f69f86bb39f17db85d1a081bf0c134831eb90f9","tests/valid/implicit-and-explicit-after.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-after.toml":"0599b16822764cdb1c3d3cf53f71186b97afc9f60f8d58358a4a89fe4d9477c3","tests/valid/implicit-and-explicit-before.json":"6dcaeaf8ee3479bf2cd5c14eb58970757175aaefab014bce9acb0b85e7bf9dd0","tests/valid/implicit-and-explicit-before.toml":"33435dddb68144b652ca5f5e0c4c53e4f7b3ca0166f9b944eda55f8d76ed2871","tests/valid/implicit-groups.json":"fc2bb43ec20c8c9148c8a70490b3a054506932c41687222ea11faae47eafb723","tests/valid/implicit-groups.toml":"248b3e8272ec43ce4af872981acde10628eeae73537ed6763a1f4245f5a9610c","tests/valid/integer.json":"0fc2d0cb1fb46d7805c1007b1fa4c46a65b273e56ae9d751df686e81d3a3354f","tests/valid/integer.toml":"74b964eb9561be6aa7266f6034cee1cd0657bdab8043a5ec9da33d9b184345da","tests/valid/key-equals-nospace.json":"b9878ee3585d1b48710a4bc09f2163b910ea71a2bfdaa8f1da68e599e8b30f47","tests/valid/key-equals-nospace.toml":"24cab0d01b67b184d0a737de3a5b5d47b8b69b36203273296d5ef763f7fdcf68","tests/valid/key-quote-newline.json":"dc077cc852761ffbab2cb23486c023dae2e07410c76fcb507a40d96ed8922e06","tests/valid/key-quote-newline.toml":"a224611bfce786f7d04a3a6abda62fdff79bc6fd2cb94263334d135d46e0143b","tests/valid/key-space.json":"30be539b01420be5cedc9078b88c3279bbef7c0bdde36ba8249ed8906112d5c7","tests/valid/key-space.toml":"9e9459b8cfebc404cf93d77c2d4082cadcd57165a2f9ce9cb35d1d12dc94a8c0","tests/valid/key-special-chars.json":"8bbebb20660d93efa73707bdb09e87a43c2b31c18f13df6388c701a1bc7cab8c","tests/valid/key-special-chars.toml":"c6cb0ba12d32f03cda4206097a1edb27cd154215d72e1c5791cc4f8dff2270b3","tests/valid/key-with-pound.json":"ea4dd79d0ad2a824bcce5c4c194d7fae82a7584a2ab7c0d83d6ddaae6130973e","tests/valid/key-with-pound.toml":"c334f676e19c01b96111277248654358cc8222fd0639aecaf429407e63b6a2dc","tests/valid/long-float.json":"7e103f56e490aa1b1fe5a762000ceb1f8c599f7d81aa215c90f5da41ab4ba6db","tests/valid/long-float.toml":"4d23f706f2a0d241840f6ea78657820c9c7b904c0c3c16828f8cc2574d7c8761","tests/valid/long-integer.json":"9ed7976639f0c2cd7f112584e2f5d272e92569be7135ea5bb9ba597abaff0767","tests/valid/long-integer.toml":"309f94be7ff5fd6f6dedbd257a1e6c171cb71aa74409ff3f8babda951f89d687","tests/valid/multiline-string.json":"3d67a8b992b85e9a2e58b77a1b76dc29745a9c2b4a362ad517786fed541948d7","tests/valid/multiline-string.toml":"7d6650009eb31a03d5b40b20712ef0157e9b787d9c966e66c38873a34e3b861c","tests/valid/raw-multiline-string.json":"4c95e34497433168cac25eb4132485c3bd13c35cad9d13d7becf7f90469dacca","tests/valid/raw-multiline-string.toml":"c724151024ccde432e0ec0d4ba60a5320d77841008116324c39516b8cbb94f4d","tests/valid/raw-string.json":"19268797aff8dfa28437d6ed8f9d813035f6eee50aade5fc774ba12b3290216b","tests/valid/raw-string.toml":"16510e05d477a0856ebaf38cacd0e9e18f02ab63ac7bd1a2eabbaa47a54d0e49","tests/valid/string-empty.json":"ece7d01326742a46e37d6404175118c0a91a2494f7ba2290bbc1d6f990ddb65b","tests/valid/string-empty.toml":"251e9e4052ede79f6b2462e71f73e0b7c9f5927484f6f77f0cd8b3c839b0c13b","tests/valid/string-escapes.json":"3d516f03cf94d5b5ee6b0887b8d37fdf21152752f049f5922a24adaacb5b8c35","tests/valid/string-escapes.toml":"86b1569e10fec91301709ad747012f0f42395050a2343b42aca450e001120f7a","tests/valid/string-simple.json":"622676e347676cce9f9733210acbd8056ce77a0588772ffd6efb05bb4e81b571","tests/valid/string-simple.toml":"ae74db09acea3be2ccae7f854f7b6f7c874ace9d4d87bf2f437b059a7d38a464","tests/valid/string-with-pound.json":"458a0add71536c1df5e1ed3ee5483c6eb48578abce0b0ebcdf75ea20d41ed6f4","tests/valid/string-with-pound.toml":"1aee397830d9ad2a93d41ee9c435acdbfef3758d1bb7c48bca7424fbbec89466","tests/valid/table-array-implicit.json":"3f7d3cdb468de67bc183162805d9c753ef5772f6f363ac2a26598387a5d991ea","tests/valid/table-array-implicit.toml":"66bcb030899a95e9a25ec44b7c9291b02f80ecbc324061cf1cd93223a2919f21","tests/valid/table-array-many.json":"3f21243eeb71ca3e5657a43559c806e12e3833e9f74c43c0c12aad9b0c853e4c","tests/valid/table-array-many.toml":"8d8ea546f954a81ca149a02147ae5f4bf075151cfcd530e62dcf05a04d843ffb","tests/valid/table-array-nest-no-keys.json":"a93ed1e96a8c52848e65a2f79c0e5c0627fbc62bd5f3e2557fdd0d42c303e7da","tests/valid/table-array-nest-no-keys.toml":"9cfcd72b7d166b4ae77a7be456017f749f375ad562475802e22dc1a57b503dc7","tests/valid/table-array-nest.json":"0a987d2bf1d5bc85f5c9433f23d389063600682a68538b6e57938a3c572959e4","tests/valid/table-array-nest.toml":"71b9c753bf773f232ac71cb2469a54ee0110ff137829045421edd7c5a64d6b6a","tests/valid/table-array-one.json":"7dc0ea3f7f843f7dc7443e68af43a1e5130a5fbae8a27fb02d8d92fa2487888e","tests/valid/table-array-one.toml":"4c478aea2dd7dfcfda682503b49e610f0fa4ce85a3b3cd0bc9041d4959e3626a","tests/valid/table-empty.json":"11e43e212d87b3b2547a5f2541f4091a3d2f6ba00b2a2004b07e02734e927ea7","tests/valid/table-empty.toml":"24d4941e67d5965d270eaebdb9816b994311e0f2f0e79ef6bb626f362c52842e","tests/valid/table-multi-empty.json":"3a2c82201a0447304afb23fb48ee961b4bd812fca3e1b061cc033e7e2bfb976c","tests/valid/table-multi-empty.toml":"886c9c4cc2d691816ed3fa404cb9d362b0511eb8c389a71419a858abb26f83df","tests/valid/table-sub-empty.json":"85cca6d48a5993c4f207c21ed96652af4f50b6936b0807659c75317c1763b6db","tests/valid/table-sub-empty.toml":"ae92e90a806ffefcbf8cda83cb82acf7448f75efa50dcfb5e2384632d36471b3","tests/valid/table-whitespace.json":"ad84ac49a6d13f7c4a8af0e1e71fd7ff2a446aa16a34c21a809a0850dfa76e73","tests/valid/table-whitespace.toml":"2f15dafb263d2771671db299f6202b4b78d293aec1ded7641ec7eb1cb024b52c","tests/valid/table-with-pound.json":"151e76606efe77500cbb0aa8fcf8ccfadb124d533bb79a9caa62e937b826e676","tests/valid/table-with-pound.toml":"a1f86c2e3789cc89500ec1d5eac2ec0bdb94bf445fddc3cab558b5228f3aba56","tests/valid/unicode-escape.json":"ddfc662f25712f1ebfc7b93b839405dfca56fc43dcde3276ad8b1ea9fdcdcc4d","tests/valid/unicode-escape.toml":"d12be96b9316b2092026be060e0008cb67a81472dccd9eab7914c7252a840608","tests/valid/unicode-literal.json":"1dd42756384b954955815dc3e906db64b4cd2c0c094f9b3c86633d1652d6d79d","tests/valid/unicode-literal.toml":"bffc6c3d4757de31d0cbfd7b8dc591edd2910fe8a4e1c46bbee422dddc841003"},"package":"a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"}
\ No newline at end of file
--- a/third_party/rust/toml/.travis.yml
+++ b/third_party/rust/toml/.travis.yml
@@ -1,30 +1,28 @@
 language: rust
 rust:
+  - 1.15.0
   - stable
   - beta
   - nightly
 sudo: false
 before_script:
   - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
 script:
-  - cargo build --verbose
-  - cargo build --verbose --no-default-features
-  - cargo build --verbose --features serde --no-default-features
-  - cargo test --verbose --features serde
-  - cargo test --verbose --manifest-path serde-tests/Cargo.toml
+  - cargo test
   - rustdoc --test README.md -L target
-  - cargo doc --no-deps
+  - test "$TRAVIS_RUST_VERSION" != "1.15.0" && cargo doc --no-deps || echo "skipping cargo doc"
 after_success:
   - travis-cargo --only nightly doc-upload
   - travis-cargo coveralls --no-sudo
 env:
   global:
-    secure: LZMkQQJT5LqLQQ8JyakjvHNqqMPy8lm/SyC+H5cKUVI/xk7xRuti4eKY937N8uSmbff2m9ZYlG6cNwIOfk/nWn8YsqxA8Wg/xugubWzqGuqu+NQ4IZVa7INT2Fiqyk5SPCh8B5fo2x7OBJ24SCkWb2p8bEWAuW8XdZZOdmi3H2I=
+    secure: "IDm3Oc3bmIL4/6zixovwkuTkbinqWnKdLfeuKTtHqT4ZbVy+rxTDQBgLGfVngymjciHWkJnvQ8/2nT3/KW4MPNY9Sqt3NfWvO7vj9cXypeNeJ4xFrVK49F7CMM4KTCeSMlDKR1C0TVYGgxFIViLtBw/imivl9fk6J489eKv36sA="
+
 notifications:
   email:
     on_success: never
 addons:
   apt:
     packages:
       - libcurl4-openssl-dev
       - libelf-dev
--- a/third_party/rust/toml/Cargo.toml
+++ b/third_party/rust/toml/Cargo.toml
@@ -1,26 +1,33 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g. crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
 [package]
-
 name = "toml"
-version = "0.2.1"
+version = "0.4.5"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
-license = "MIT/Apache-2.0"
+description = "A native Rust encoder and decoder of TOML-formatted files and streams. Provides\nimplementations of the standard Serialize/Deserialize traits for TOML data to\nfacilitate deserializing and serializing Rust structures.\n"
+homepage = "https://github.com/alexcrichton/toml-rs"
+documentation = "https://docs.rs/toml"
 readme = "README.md"
 keywords = ["encoding"]
+categories = ["config", "encoding", "parser-implementations"]
+license = "MIT/Apache-2.0"
 repository = "https://github.com/alexcrichton/toml-rs"
-homepage = "https://github.com/alexcrichton/toml-rs"
-documentation = "http://alexcrichton.com/toml-rs"
-description = """
-A native Rust encoder and decoder of TOML-formatted files and streams. Provides
-implementations of the standard Encodable/Decodable traits for TOML data to
-facilitate deserializing and serializing Rust structures.
-"""
+[dependencies.serde]
+version = "1.0"
+[dev-dependencies.serde_derive]
+version = "1.0"
 
-[dependencies]
-rustc-serialize = { optional = true, version = "0.3.0" }
-serde = { optional = true, version = "0.8" }
-
-[features]
-default = ["rustc-serialize"]
-
-[dev-dependencies]
-rustc-serialize = "0.3"
+[dev-dependencies.serde_json]
+version = "1.0"
+[badges.travis-ci]
+repository = "alexcrichton/toml-rs"
--- a/third_party/rust/toml/README.md
+++ b/third_party/rust/toml/README.md
@@ -1,26 +1,31 @@
 # toml-rs
 
 [![Build Status](https://travis-ci.org/alexcrichton/toml-rs.svg?branch=master)](https://travis-ci.org/alexcrichton/toml-rs)
 [![Coverage Status](https://coveralls.io/repos/alexcrichton/toml-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexcrichton/toml-rs?branch=master)
-
-[Documentation](http://alexcrichton.com/toml-rs)
+[![Latest Version](https://img.shields.io/crates/v/toml.svg)](https://crates.io/crates/toml)
+[![Documentation](https://docs.rs/toml/badge.svg)](https://docs.rs/toml)
 
-A [TOML][toml] decoder and encoder for Rust. This library is currently compliant with
-the v0.4.0 version of TOML. This library will also likely continue to stay up to
-date with the TOML specification as changes happen.
+A [TOML][toml] decoder and encoder for Rust. This library is currently compliant
+with the v0.4.0 version of TOML. This library will also likely continue to stay
+up to date with the TOML specification as changes happen.
 
 [toml]: https://github.com/toml-lang/toml
 
 ```toml
 # Cargo.toml
 [dependencies]
-toml = "0.2"
+toml = "0.4"
 ```
 
+This crate also supports serialization/deserialization through the
+[serde](https://serde.rs) crate on crates.io. Currently the older `rustc-serialize`
+crate is not supported in the 0.3+ series of the `toml` crate, but 0.2 can be
+used for that support.
+
 # License
 
 `toml-rs` is primarily distributed under the terms of both the MIT license and
 the Apache License (Version 2.0), with portions covered by various BSD-like
 licenses.
 
 See LICENSE-APACHE, and LICENSE-MIT for details.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/toml/examples/decode.rs
@@ -0,0 +1,56 @@
+//! An example showing off the usage of `Deserialize` to automatically decode
+//! TOML into a Rust `struct`
+
+#![deny(warnings)]
+
+extern crate toml;
+extern crate serde;
+#[macro_use]
+extern crate serde_derive;
+
+/// This is what we're going to decode into. Each field is optional, meaning
+/// that it doesn't have to be present in TOML.
+#[derive(Debug, Deserialize)]
+struct Config {
+    global_string: Option<String>,
+    global_integer: Option<u64>,
+    server: Option<ServerConfig>,
+    peers: Option<Vec<PeerConfig>>,
+}
+
+/// Sub-structs are decoded from tables, so this will decode from the `[server]`
+/// table.
+///
+/// Again, each field is optional, meaning they don't have to be present.
+#[derive(Debug, Deserialize)]
+struct ServerConfig {
+    ip: Option<String>,
+    port: Option<u64>,
+}
+
+#[derive(Debug, Deserialize)]
+struct PeerConfig {
+    ip: Option<String>,
+    port: Option<u64>,
+}
+
+fn main() {
+    let toml_str = r#"
+        global_string = "test"
+        global_integer = 5
+
+        [server]
+        ip = "127.0.0.1"
+        port = 80
+
+        [[peers]]
+        ip = "127.0.0.1"
+        port = 8080
+
+        [[peers]]
+        ip = "127.0.0.1"
+    "#;
+
+    let decoded: Config = toml::from_str(toml_str).unwrap();
+    println!("{:#?}", decoded);
+}
--- a/third_party/rust/toml/examples/toml2json.rs
+++ b/third_party/rust/toml/examples/toml2json.rs
@@ -1,57 +1,51 @@
 #![deny(warnings)]
 
 extern crate toml;
-extern crate rustc_serialize;
+extern crate serde_json;
 
 use std::fs::File;
 use std::env;
 use std::io;
 use std::io::prelude::*;
 
-use toml::Value;
-use rustc_serialize::json::Json;
+use toml::Value as Toml;
+use serde_json::Value as Json;
 
 fn main() {
     let mut args = env::args();
     let mut input = String::new();
-    let filename = if args.len() > 1 {
+    if args.len() > 1 {
         let name = args.nth(1).unwrap();
         File::open(&name).and_then(|mut f| {
             f.read_to_string(&mut input)
         }).unwrap();
-        name
     } else {
         io::stdin().read_to_string(&mut input).unwrap();
-        "<stdin>".to_string()
-    };
+    }
 
-    let mut parser = toml::Parser::new(&input);
-    let toml = match parser.parse() {
-        Some(toml) => toml,
-        None => {
-            for err in &parser.errors {
-                let (loline, locol) = parser.to_linecol(err.lo);
-                let (hiline, hicol) = parser.to_linecol(err.hi);
-                println!("{}:{}:{}-{}:{} error: {}",
-                         filename, loline, locol, hiline, hicol, err.desc);
-            }
-            return
+    match input.parse() {
+        Ok(toml) => {
+            let json = convert(toml);
+            println!("{}", serde_json::to_string_pretty(&json).unwrap());
         }
-    };
-    let json = convert(Value::Table(toml));
-    println!("{}", json.pretty());
+        Err(error) => println!("failed to parse TOML: {}", error),
+    }
 }
 
-fn convert(toml: Value) -> Json {
+fn convert(toml: Toml) -> Json {
     match toml {
-        Value::String(s) => Json::String(s),
-        Value::Integer(i) => Json::I64(i),
-        Value::Float(f) => Json::F64(f),
-        Value::Boolean(b) => Json::Boolean(b),
-        Value::Array(arr) => Json::Array(arr.into_iter().map(convert).collect()),
-        Value::Table(table) => Json::Object(table.into_iter().map(|(k, v)| {
+        Toml::String(s) => Json::String(s),
+        Toml::Integer(i) => Json::Number(i.into()),
+        Toml::Float(f) => {
+            let n = serde_json::Number::from_f64(f)
+                        .expect("float infinite and nan not allowed");
+            Json::Number(n)
+        }
+        Toml::Boolean(b) => Json::Bool(b),
+        Toml::Array(arr) => Json::Array(arr.into_iter().map(convert).collect()),
+        Toml::Table(table) => Json::Object(table.into_iter().map(|(k, v)| {
             (k, convert(v))
         }).collect()),
-        Value::Datetime(dt) => Json::String(dt),
+        Toml::Datetime(dt) => Json::String(dt.to_string()),
     }
 }
new file mode 100644
--- /dev/null
+++ b/third_party/rust/toml/src/datetime.rs
@@ -0,0 +1,425 @@
+use std::fmt;
+use std::str::{self, FromStr};
+use std::error;
+
+use serde::{de, ser};
+
+/// A parsed TOML datetime value
+///
+/// This structure is intended to represent the datetime primitive type that can
+/// be encoded into TOML documents. This type is a parsed version that contains
+/// all metadata internally.
+///
+/// Currently this type is intentionally conservative and only supports
+/// `to_string` as an accessor. Over time though it's intended that it'll grow
+/// more support!
+///
+/// Note that if you're using `Deserialize` to deserialize a TOML document, you
+/// can use this as a placeholder for where you're expecting a datetime to be
+/// specified.
+///
+/// Also note though that while this type implements `Serialize` and
+/// `Deserialize` it's only recommended to use this type with the TOML format,
+/// otherwise encoded in other formats it may look a little odd.
+#[derive(PartialEq, Clone)]
+pub struct Datetime {
+    date: Option<Date>,
+    time: Option<Time>,
+    offset: Option<Offset>,
+}
+
+/// Error returned from parsing a `Datetime` in the `FromStr` implementation.
+#[derive(Debug, Clone)]
+pub struct DatetimeParseError {
+    _private: (),
+}
+
+// Currently serde itself doesn't have a datetime type, so we map our `Datetime`
+// to a special valid in the serde data model. Namely one with thiese special
+// fields/struct names.
+//
+// In general the TOML encoder/decoder will catch this and not literally emit
+// these strings but rather emit datetimes as they're intended.
+pub const SERDE_STRUCT_FIELD_NAME: &'static str = "$__toml_private_datetime";
+pub const SERDE_STRUCT_NAME: &'static str = "$__toml_private_Datetime";
+
+#[derive(PartialEq, Clone)]
+struct Date {
+    year: u16,
+    month: u8,
+    day: u8,
+}
+
+#[derive(PartialEq, Clone)]
+struct Time {
+    hour: u8,
+    minute: u8,
+    second: u8,
+    nanosecond: u32,
+}
+
+#[derive(PartialEq, Clone)]
+enum Offset {
+    Z,
+    Custom { hours: i8, minutes: u8 },
+}
+
+impl fmt::Debug for Datetime {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Display::fmt(self, f)
+    }
+}
+
+impl fmt::Display for Datetime {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if let Some(ref date) = self.date {
+            write!(f, "{}", date)?;
+        }
+        if let Some(ref time) = self.time {
+            if self.date.is_some() {
+                write!(f, "T")?;
+            }
+            write!(f, "{}", time)?;
+        }
+        if let Some(ref offset) = self.offset {
+            write!(f, "{}", offset)?;
+        }
+        Ok(())
+    }
+}
+
+impl fmt::Display for Date {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{:04}-{:02}-{:02}", self.year, self.month, self.day)
+    }
+}
+
+impl fmt::Display for Time {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{:02}:{:02}:{:02}", self.hour, self.minute, self.second)?;
+        if self.nanosecond != 0 {
+            let s = format!("{:09}", self.nanosecond);
+            write!(f, ".{}", s.trim_right_matches('0'))?;
+        }
+        Ok(())
+    }
+}
+
+impl fmt::Display for Offset {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            Offset::Z => write!(f, "Z"),
+            Offset::Custom { hours, minutes } => {
+                write!(f, "{:+03}:{:02}", hours, minutes)
+            }
+        }
+    }
+}
+
+impl FromStr for Datetime {
+    type Err = DatetimeParseError;
+
+    fn from_str(date: &str) -> Result<Datetime, DatetimeParseError> {
+        // Accepted formats:
+        //
+        // 0000-00-00T00:00:00.00Z
+        // 0000-00-00T00:00:00.00
+        // 0000-00-00
+        // 00:00:00.00
+        if date.len() < 3 {
+            return Err(DatetimeParseError { _private: () })
+        }
+        let mut offset_allowed = true;
+        let mut chars = date.chars();
+
+        // First up, parse the full date if we can
+        let full_date = if chars.clone().nth(2) == Some(':') {
+            offset_allowed = false;
+            None
+        } else {
+            let y1 = digit(&mut chars)? as u16;
+            let y2 = digit(&mut chars)? as u16;
+            let y3 = digit(&mut chars)? as u16;
+            let y4 = digit(&mut chars)? as u16;
+
+            match chars.next() {
+                Some('-') => {}
+                _ => return Err(DatetimeParseError { _private: () }),
+            }
+
+            let m1 = digit(&mut chars)?;
+            let m2 = digit(&mut chars)?;
+
+            match chars.next() {
+                Some('-') => {}
+                _ => return Err(DatetimeParseError { _private: () }),
+            }
+
+            let d1 = digit(&mut chars)?;
+            let d2 = digit(&mut chars)?;
+
+            let date = Date {
+                year: y1 * 1000 + y2 * 100 + y3 * 10 + y4,
+                month: m1 * 10 + m2,
+                day: d1 * 10 + d2,
+            };
+
+            if date.month < 1 || date.month > 12 {
+                return Err(DatetimeParseError { _private: () })
+            }
+            if date.day < 1 || date.day > 31 {
+                return Err(DatetimeParseError { _private: () })
+            }
+
+            Some(date)
+        };
+
+        // Next parse the "partial-time" if available
+        let partial_time = if full_date.is_some() &&
+                              chars.clone().next() == Some('T') {
+            chars.next();
+            true
+        } else {
+            full_date.is_none()
+        };
+
+        let time = if partial_time {
+            let h1 = digit(&mut chars)?;
+            let h2 = digit(&mut chars)?;
+            match chars.next() {
+                Some(':') => {}
+                _ => return Err(DatetimeParseError { _private: () }),
+            }
+            let m1 = digit(&mut chars)?;
+            let m2 = digit(&mut chars)?;
+            match chars.next() {
+                Some(':') => {}
+                _ => return Err(DatetimeParseError { _private: () }),
+            }
+            let s1 = digit(&mut chars)?;
+            let s2 = digit(&mut chars)?;
+
+            let mut nanosecond = 0;
+            if chars.clone().next() == Some('.') {
+                chars.next();
+                let whole = chars.as_str();
+
+                let mut end = whole.len();
+                for (i, byte) in whole.bytes().enumerate() {
+                    match byte {
+                        b'0' ... b'9' => {
+                            if i < 9 {
+                                let p = 10_u32.pow(8 - i as u32);
+                                nanosecond += p * (byte - b'0') as u32;
+                            }
+                        }
+                        _ => {
+                            end = i;
+                            break;
+                        }
+                    }
+                }
+                if end == 0 {
+                    return Err(DatetimeParseError { _private: () })
+                }
+                chars = whole[end..].chars();
+            }
+
+            let time = Time {
+                hour: h1 * 10 + h2,
+                minute: m1 * 10 + m2,
+                second: s1 * 10 + s2,
+                nanosecond: nanosecond,
+            };
+
+            if time.hour > 24 {
+                return Err(DatetimeParseError { _private: () })
+            }
+            if time.minute > 59 {
+                return Err(DatetimeParseError { _private: () })
+            }
+            if time.second > 59 {
+                return Err(DatetimeParseError { _private: () })
+            }
+            if time.nanosecond > 999_999_999 {
+                return Err(DatetimeParseError { _private: () })
+            }
+
+            Some(time)
+        } else {
+            offset_allowed = false;
+            None
+        };
+
+        // And finally, parse the offset
+        let offset = if offset_allowed {
+            let next = chars.clone().next();
+            if next == Some('Z') {
+                chars.next();
+                Some(Offset::Z)
+            } else if next.is_none() {
+                None
+            } else {
+                let sign = match next {
+                    Some('+') => 1,
+                    Some('-') => -1,
+                    _ => return Err(DatetimeParseError { _private: () }),
+                };
+                chars.next();
+                let h1 = digit(&mut chars)? as i8;
+                let h2 = digit(&mut chars)? as i8;
+                match chars.next() {
+                    Some(':') => {}
+                    _ => return Err(DatetimeParseError { _private: () }),
+                }
+                let m1 = digit(&mut chars)?;
+                let m2 = digit(&mut chars)?;
+
+                Some(Offset::Custom {
+                    hours: sign * (h1 * 10 + h2),
+                    minutes: m1 * 10 + m2,
+                })
+            }
+        } else {
+            None
+        };
+
+        // Return an error if we didn't hit eof, otherwise return our parsed
+        // date
+        if chars.next().is_some() {
+            return Err(DatetimeParseError { _private: () })
+        }
+
+        Ok(Datetime {
+            date: full_date,
+            time: time,
+            offset: offset,
+        })
+    }
+}
+
+fn digit(chars: &mut str::Chars) -> Result<u8, DatetimeParseError> {
+    match chars.next() {
+        Some(c) if '0' <= c && c <= '9' => Ok(c as u8 - b'0'),
+        _ => Err(DatetimeParseError { _private: () }),
+    }
+}
+
+impl ser::Serialize for Datetime {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where S: ser::Serializer
+    {
+        use serde::ser::SerializeStruct;
+
+        let mut s = serializer.serialize_struct(SERDE_STRUCT_NAME, 1)?;
+        s.serialize_field(SERDE_STRUCT_FIELD_NAME, &self.to_string())?;
+        s.end()
+    }
+}
+
+impl<'de> de::Deserialize<'de> for Datetime {
+    fn deserialize<D>(deserializer: D) -> Result<Datetime, D::Error>
+        where D: de::Deserializer<'de>
+    {
+        struct DatetimeVisitor;
+
+        impl<'de> de::Visitor<'de> for DatetimeVisitor {
+            type Value = Datetime;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("a TOML datetime")
+            }
+
+            fn visit_map<V>(self, mut visitor: V) -> Result<Datetime, V::Error>
+                where V: de::MapAccess<'de>
+            {
+                let value = visitor.next_key::<DatetimeKey>()?;
+                if value.is_none() {
+                    return Err(de::Error::custom("datetime key not found"))
+                }
+                let v: DatetimeFromString = visitor.next_value()?;
+                Ok(v.value)
+
+            }
+        }
+
+        static FIELDS: [&'static str; 1] = [SERDE_STRUCT_FIELD_NAME];
+        deserializer.deserialize_struct(SERDE_STRUCT_NAME,
+                                        &FIELDS,
+                                        DatetimeVisitor)
+    }
+}
+
+struct DatetimeKey;
+
+impl<'de> de::Deserialize<'de> for DatetimeKey {
+    fn deserialize<D>(deserializer: D) -> Result<DatetimeKey, D::Error>
+        where D: de::Deserializer<'de>
+    {
+        struct FieldVisitor;
+
+        impl<'de> de::Visitor<'de> for FieldVisitor {
+            type Value = ();
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("a valid datetime field")
+            }
+
+            fn visit_str<E>(self, s: &str) -> Result<(), E>
+                where E: de::Error
+            {
+                if s == SERDE_STRUCT_FIELD_NAME {
+                    Ok(())
+                } else {
+                    Err(de::Error::custom("expected field with custom name"))
+                }
+            }
+        }
+
+        deserializer.deserialize_identifier(FieldVisitor)?;
+        Ok(DatetimeKey)
+    }
+}
+
+pub struct DatetimeFromString {
+    pub value: Datetime,
+}
+
+impl<'de> de::Deserialize<'de> for DatetimeFromString {
+    fn deserialize<D>(deserializer: D) -> Result<DatetimeFromString, D::Error>
+        where D: de::Deserializer<'de>
+    {
+        struct Visitor;
+
+        impl<'de> de::Visitor<'de> for Visitor {
+            type Value = DatetimeFromString;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("string containing a datetime")
+            }
+
+            fn visit_str<E>(self, s: &str) -> Result<DatetimeFromString, E>
+                where E: de::Error,
+            {
+                match s.parse() {
+                    Ok(date) => Ok(DatetimeFromString { value: date }),
+                    Err(e) => Err(de::Error::custom(e)),
+                }
+            }
+        }
+
+        deserializer.deserialize_str(Visitor)
+    }
+}
+
+impl fmt::Display for DatetimeParseError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        "failed to parse datetime".fmt(f)
+    }
+}
+
+impl error::Error for DatetimeParseError {
+    fn description(&self) -> &str {
+        "failed to parse datetime"
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/toml/src/de.rs
@@ -0,0 +1,1327 @@
+//! Deserializing TOML into Rust structures.
+//!
+//! This module contains all the Serde support for deserializing TOML documents
+//! into Rust structures. Note that some top-level functions here are also
+//! provided at the top of the crate.
+
+use std::borrow::Cow;
+use std::error;
+use std::fmt;
+use std::str;
+use std::vec;
+
+use serde::de;
+use serde::de::IntoDeserializer;
+
+use tokens::{Tokenizer, Token, Error as TokenError};
+use datetime::{SERDE_STRUCT_FIELD_NAME, SERDE_STRUCT_NAME};
+
+/// Deserializes a byte slice into a type.
+///
+/// This function will attempt to interpret `bytes` as UTF-8 data and then
+/// deserialize `T` from the TOML document provided.
+pub fn from_slice<'de, T>(bytes: &'de [u8]) -> Result<T, Error>
+    where T: de::Deserialize<'de>,
+{
+    match str::from_utf8(bytes) {
+        Ok(s) => from_str(s),
+        Err(e) => Err(Error::custom(e.to_string())),
+    }
+}
+
+/// Deserializes a string into a type.
+///
+/// This function will attempt to interpret `s` as a TOML document and
+/// deserialize `T` from the document.
+///
+/// # Examples
+///
+/// ```
+/// #[macro_use]
+/// extern crate serde_derive;
+/// extern crate toml;
+///
+/// #[derive(Deserialize)]
+/// struct Config {
+///     title: String,
+///     owner: Owner,
+/// }
+///
+/// #[derive(Deserialize)]
+/// struct Owner {
+///     name: String,
+/// }
+///
+/// fn main() {
+///     let config: Config = toml::from_str(r#"
+///         title = 'TOML Example'
+///
+///         [owner]
+///         name = 'Lisa'
+///     "#).unwrap();
+///
+///     assert_eq!(config.title, "TOML Example");
+///     assert_eq!(config.owner.name, "Lisa");
+/// }
+/// ```
+pub fn from_str<'de, T>(s: &'de str) -> Result<T, Error>
+    where T: de::Deserialize<'de>,
+{
+    let mut d = Deserializer::new(s);
+    let ret = T::deserialize(&mut d)?;
+    d.end()?;
+    Ok(ret)
+}
+
+/// Errors that can occur when deserializing a type.
+#[derive(Debug, Clone)]
+pub struct Error {
+    inner: Box<ErrorInner>,
+}
+
+#[derive(Debug, Clone)]
+struct ErrorInner {
+    kind: ErrorKind,
+    line: Option<usize>,
+    col: usize,
+    message: String,
+    key: Vec<String>,
+}
+
+/// Errors that can occur when deserializing a type.
+#[derive(Debug, Clone)]
+enum ErrorKind {
+    /// EOF was reached when looking for a value
+    UnexpectedEof,
+
+    /// An invalid character not allowed in a string was found
+    InvalidCharInString(char),
+
+    /// An invalid character was found as an escape
+    InvalidEscape(char),
+
+    /// An invalid character was found in a hex escape
+    InvalidHexEscape(char),
+
+    /// An invalid escape value was specified in a hex escape in a string.
+    ///
+    /// Valid values are in the plane of unicode codepoints.
+    InvalidEscapeValue(u32),
+
+    /// A newline in a string was encountered when one was not allowed.
+    NewlineInString,
+
+    /// An unexpected character was encountered, typically when looking for a
+    /// value.
+    Unexpected(char),
+
+    /// An unterminated string was found where EOF was found before the ending
+    /// EOF mark.
+    UnterminatedString,
+
+    /// A newline was found in a table key.
+    NewlineInTableKey,
+
+    /// A number failed to parse
+    NumberInvalid,
+
+    /// A date or datetime was invalid
+    DateInvalid,
+
+    /// Wanted one sort of token, but found another.
+    Wanted {
+        /// Expected token type
+        expected: &'static str,
+        /// Actually found token type
+        found: &'static str,
+    },
+
+    /// An array was decoded but the types inside of it were mixed, which is
+    /// disallowed by TOML.
+    MixedArrayType,
+
+    /// A duplicate table definition was found.
+    DuplicateTable(String),
+
+    /// A previously defined table was redefined as an array.
+    RedefineAsArray,
+
+    /// An empty table key was found.
+    EmptyTableKey,
+
+    /// A custom error which could be generated when deserializing a particular
+    /// type.
+    Custom,
+
+    /// A struct was expected but something else was found
+    ExpectedString,
+
+    #[doc(hidden)]
+    __Nonexhaustive,
+}
+
+/// Deserialization implementation for TOML.
+pub struct Deserializer<'a> {
+    require_newline_after_table: bool,
+    input: &'a str,
+    tokens: Tokenizer<'a>,
+}
+
+impl<'de, 'b> de::Deserializer<'de> for &'b mut Deserializer<'de> {
+    type Error = Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        let mut tables = Vec::new();
+        let mut cur_table = Table {
+            at: 0,
+            header: Vec::new(),
+            values: None,
+            array: false,
+        };
+
+        while let Some(line) = self.line()? {
+            match line {
+                Line::Table { at, mut header, array } => {
+                    if !cur_table.header.is_empty() || cur_table.values.is_some() {
+                        tables.push(cur_table);
+                    }
+                    cur_table = Table {
+                        at: at,
+                        header: Vec::new(),
+                        values: Some(Vec::new()),
+                        array: array,
+                    };
+                    loop {
+                        let part = header.next().map_err(|e| {
+                            self.token_error(e)
+                        });
+                        match part? {
+                            Some(part) => cur_table.header.push(part),
+                            None => break,
+                        }
+                    }
+                }
+                Line::KeyValue(key, value) => {
+                    if cur_table.values.is_none() {
+                        cur_table.values = Some(Vec::new());
+                    }
+                    cur_table.values.as_mut().unwrap().push((key, value));
+                }
+            }
+        }
+        if !cur_table.header.is_empty() || cur_table.values.is_some() {
+            tables.push(cur_table);
+        }
+
+        visitor.visit_map(MapVisitor {
+            values: Vec::new().into_iter(),
+            next_value: None,
+            depth: 0,
+            cur: 0,
+            cur_parent: 0,
+            max: tables.len(),
+            tables: &mut tables,
+            array: false,
+            de: self,
+        })
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        _name: &'static str,
+        _variants: &'static [&'static str],
+        visitor: V
+    ) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>
+    {
+        if let Some(next) = self.next()? {
+            match next {
+                Token::String { val, .. } => {
+                    visitor.visit_enum(val.into_deserializer())
+                },
+                _ => Err(Error::from_kind(ErrorKind::ExpectedString))
+            }
+        } else {
+            Err(Error::from_kind(ErrorKind::UnexpectedEof))
+        }
+    }
+
+    forward_to_deserialize_any! {
+        bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq
+        bytes byte_buf map struct unit newtype_struct
+        ignored_any unit_struct tuple_struct tuple option identifier
+    }
+}
+
+struct Table<'a> {
+    at: usize,
+    header: Vec<Cow<'a, str>>,
+    values: Option<Vec<(Cow<'a, str>, Value<'a>)>>,
+    array: bool,
+}
+
+#[doc(hidden)]
+pub struct MapVisitor<'de: 'b, 'b> {
+    values: vec::IntoIter<(Cow<'de, str>, Value<'de>)>,
+    next_value: Option<(Cow<'de, str>, Value<'de>)>,
+    depth: usize,
+    cur: usize,
+    cur_parent: usize,
+    max: usize,
+    tables: &'b mut [Table<'de>],
+    array: bool,
+    de: &'b mut Deserializer<'de>,
+}
+
+impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
+    type Error = Error;
+
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
+        where K: de::DeserializeSeed<'de>,
+    {
+        if self.cur_parent == self.max || self.cur == self.max {
+            return Ok(None)
+        }
+
+        loop {
+            assert!(self.next_value.is_none());
+            if let Some((key, value)) = self.values.next() {
+                let ret = seed.deserialize(StrDeserializer::new(key.clone()))?;
+                self.next_value = Some((key, value));
+                return Ok(Some(ret))
+            }
+
+            let next_table = {
+                let prefix = &self.tables[self.cur_parent].header[..self.depth];
+                self.tables[self.cur..self.max].iter().enumerate().find(|&(_, t)| {
+                    if t.values.is_none() {
+                        return false
+                    }
+                    match t.header.get(..self.depth) {
+                        Some(header) => header == prefix,
+                        None => false,
+                    }
+                }).map(|(i, _)| i + self.cur)
+            };
+
+            let pos = match next_table {
+                Some(pos) => pos,
+                None => return Ok(None),
+            };
+            self.cur = pos;
+
+            // Test to see if we're duplicating our parent's table, and if so
+            // then this is an error in the toml format
+            if self.cur_parent != pos &&
+               self.tables[self.cur_parent].header == self.tables[pos].header {
+                let at = self.tables[pos].at;
+                let name = self.tables[pos].header.join(".");
+                return Err(self.de.error(at, ErrorKind::DuplicateTable(name)))
+            }
+
+            let table = &mut self.tables[pos];
+
+            // If we're not yet at the appropriate depth for this table then we
+            // just next the next portion of its header and then continue
+            // decoding.
+            if self.depth != table.header.len() {
+                let key = &table.header[self.depth];
+                let key = seed.deserialize(StrDeserializer::new(key.clone()))?;
+                return Ok(Some(key))
+            }
+
+            // Rule out cases like:
+            //
+            //      [[foo.bar]]
+            //      [[foo]]
+            if table.array  {
+                let kind = ErrorKind::RedefineAsArray;
+                return Err(self.de.error(table.at, kind))
+            }
+
+            self.values = table.values.take().expect("Unable to read table values").into_iter();
+        }
+    }
+
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Error>
+        where V: de::DeserializeSeed<'de>,
+    {
+        if let Some((k, v)) = self.next_value.take() {
+            match seed.deserialize(ValueDeserializer::new(v)) {
+                Ok(v) => return Ok(v),
+                Err(mut e) => {
+                    e.add_key_context(&k);
+                    return Err(e)
+                }
+            }
+        }
+
+        let array = self.tables[self.cur].array &&
+                    self.depth == self.tables[self.cur].header.len() - 1;
+        self.cur += 1;
+        let res = seed.deserialize(MapVisitor {
+            values: Vec::new().into_iter(),
+            next_value: None,
+            depth: self.depth + if array {0} else {1},
+            cur_parent: self.cur - 1,
+            cur: 0,
+            max: self.max,
+            array: array,
+            tables: &mut *self.tables,
+            de: &mut *self.de,
+        });
+        res.map_err(|mut e| {
+            e.add_key_context(&self.tables[self.cur - 1].header[self.depth]);
+            e
+        })
+    }
+}
+
+impl<'de, 'b> de::SeqAccess<'de> for MapVisitor<'de, 'b> {
+    type Error = Error;
+
+    fn next_element_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
+        where K: de::DeserializeSeed<'de>,
+    {
+        assert!(self.next_value.is_none());
+        assert!(self.values.next().is_none());
+
+        if self.cur_parent == self.max {
+            return Ok(None)
+        }
+
+        let next = self.tables[..self.max]
+            .iter()
+            .enumerate()
+            .skip(self.cur_parent + 1)
+            .find(|&(_, table)| {
+                table.array && table.header == self.tables[self.cur_parent].header
+            }).map(|p| p.0)
+            .unwrap_or(self.max);
+
+        let ret = seed.deserialize(MapVisitor {
+            values: self.tables[self.cur_parent].values.take().expect("Unable to read table values").into_iter(),
+            next_value: None,
+            depth: self.depth + 1,
+            cur_parent: self.cur_parent,
+            max: next,
+            cur: 0,
+            array: false,
+            tables: &mut self.tables,
+            de: &mut self.de,
+        })?;
+        self.cur_parent = next;
+        Ok(Some(ret))
+    }
+}
+
+impl<'de, 'b> de::Deserializer<'de> for MapVisitor<'de, 'b> {
+    type Error = Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        if self.array  {
+            visitor.visit_seq(self)
+        } else {
+            visitor.visit_map(self)
+        }
+    }
+
+    // `None` is interpreted as a missing field so be sure to implement `Some`
+    // as a present field.
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        visitor.visit_some(self)
+    }
+
+    fn deserialize_newtype_struct<V>(
+        self,
+        _name: &'static str,
+        visitor: V
+    ) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>
+    {
+        visitor.visit_newtype_struct(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq
+        bytes byte_buf map struct unit identifier
+        ignored_any unit_struct tuple_struct tuple enum
+    }
+}
+
+struct StrDeserializer<'a> {
+    key: Cow<'a, str>,
+}
+
+impl<'a> StrDeserializer<'a> {
+    fn new(key: Cow<'a, str>) -> StrDeserializer<'a> {
+        StrDeserializer {
+            key: key,
+        }
+    }
+}
+
+impl<'de> de::Deserializer<'de> for StrDeserializer<'de> {
+    type Error = Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        match self.key {
+            Cow::Borrowed(s) => visitor.visit_borrowed_str(s),
+            Cow::Owned(s) => visitor.visit_string(s),
+        }
+    }
+
+    forward_to_deserialize_any! {
+        bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq
+        bytes byte_buf map struct option unit newtype_struct
+        ignored_any unit_struct tuple_struct tuple enum identifier
+    }
+}
+
+struct ValueDeserializer<'a> {
+    value: Value<'a>,
+}
+
+impl<'a> ValueDeserializer<'a> {
+    fn new(value: Value<'a>) -> ValueDeserializer<'a> {
+        ValueDeserializer {
+            value: value,
+        }
+    }
+}
+
+impl<'de> de::Deserializer<'de> for ValueDeserializer<'de> {
+    type Error = Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        match self.value {
+            Value::Integer(i) => visitor.visit_i64(i),
+            Value::Boolean(b) => visitor.visit_bool(b),
+            Value::Float(f) => visitor.visit_f64(f),
+            Value::String(Cow::Borrowed(s)) => visitor.visit_borrowed_str(s),
+            Value::String(Cow::Owned(s)) => visitor.visit_string(s),
+            Value::Datetime(s) => visitor.visit_map(DatetimeDeserializer {
+                date: s,
+                visited: false,
+            }),
+            Value::Array(values) => {
+                let mut s = de::value::SeqDeserializer::new(values.into_iter());
+                let ret = visitor.visit_seq(&mut s)?;
+                s.end()?;
+                Ok(ret)
+            }
+            Value::InlineTable(values) => {
+                visitor.visit_map(InlineTableDeserializer {
+                    values: values.into_iter(),
+                    next_value: None,
+                })
+            }
+        }
+    }
+
+    fn deserialize_struct<V>(self,
+                             name: &'static str,
+                             fields: &'static [&'static str],
+                             visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        if name == SERDE_STRUCT_NAME && fields == &[SERDE_STRUCT_FIELD_NAME] {
+            if let Value::Datetime(s) = self.value {
+                return visitor.visit_map(DatetimeDeserializer {
+                    date: s,
+                    visited: false,
+                })
+            }
+        }
+
+        self.deserialize_any(visitor)
+    }
+
+    // `None` is interpreted as a missing field so be sure to implement `Some`
+    // as a present field.
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        visitor.visit_some(self)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        _name: &'static str,
+        _variants: &'static [&'static str],
+        visitor: V
+    ) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>
+    {
+        match self.value {
+            Value::String(val) => visitor.visit_enum(val.into_deserializer()),
+            _ => Err(Error::from_kind(ErrorKind::ExpectedString))
+        }
+    }
+
+    fn deserialize_newtype_struct<V>(
+        self,
+        _name: &'static str,
+        visitor: V
+    ) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>
+    {
+        visitor.visit_newtype_struct(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq
+        bytes byte_buf map unit identifier
+        ignored_any unit_struct tuple_struct tuple
+    }
+}
+
+impl<'de> de::IntoDeserializer<'de, Error> for Value<'de> {
+    type Deserializer = ValueDeserializer<'de>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        ValueDeserializer::new(self)
+    }
+}
+
+struct DatetimeDeserializer<'a> {
+    visited: bool,
+    date: &'a str,
+}
+
+impl<'de> de::MapAccess<'de> for DatetimeDeserializer<'de> {
+    type Error = Error;
+
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
+        where K: de::DeserializeSeed<'de>,
+    {
+        if self.visited {
+            return Ok(None)
+        }
+        self.visited = true;
+        seed.deserialize(DatetimeFieldDeserializer).map(Some)
+    }
+
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Error>
+        where V: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(StrDeserializer::new(self.date.into()))
+    }
+}
+
+struct DatetimeFieldDeserializer;
+
+impl<'de> de::Deserializer<'de> for DatetimeFieldDeserializer {
+    type Error = Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
+        where V: de::Visitor<'de>,
+    {
+        visitor.visit_borrowed_str(SERDE_STRUCT_FIELD_NAME)
+    }
+
+    forward_to_deserialize_any! {
+        bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq
+        bytes byte_buf map struct option unit newtype_struct
+        ignored_any unit_struct tuple_struct tuple enum identifier
+    }
+}
+
+struct InlineTableDeserializer<'a> {
+    values: vec::IntoIter<(Cow<'a, str>, Value<'a>)>,
+    next_value: Option<Value<'a>>,
+}
+
+impl<'de> de::MapAccess<'de> for InlineTableDeserializer<'de> {
+    type Error = Error;
+
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Error>
+        where K: de::DeserializeSeed<'de>,
+    {
+        let (key, value) = match self.values.next() {
+            Some(pair) => pair,
+            None => return Ok(None),
+        };
+        self.next_value = Some(value);
+        seed.deserialize(StrDeserializer::new(key)).map(Some)
+    }
+
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Error>
+        where V: de::DeserializeSeed<'de>,
+    {
+        let value = self.next_value.take().expect("Unable to read table values");
+        seed.deserialize(ValueDeserializer::new(value))
+    }
+}
+
+
+impl<'a> Deserializer<'a> {
+    /// Creates a new deserializer which will be deserializing the string
+    /// provided.
+    pub fn new(input: &'a str) -> Deserializer<'a> {
+        Deserializer {
+            tokens: Tokenizer::new(input),
+            input: input,
+            require_newline_after_table: true,
+        }
+    }
+
+    /// The `Deserializer::end` method should be called after a value has been
+    /// fully deserialized.  This allows the `Deserializer` to validate that the
+    /// input stream is at the end or that it only has trailing
+    /// whitespace/comments.
+    pub fn end(&mut self) -> Result<(), Error> {
+        Ok(())
+    }
+
+    /// Historical versions of toml-rs accidentally allowed a newline after a
+    /// table definition, but the TOML spec requires a newline after a table
+    /// definition header.
+    ///
+    /// This option can be set to `false` (the default is `true`) to emulate
+    /// this behavior for backwards compatibility with older toml-rs versions.
+    pub fn set_require_newline_after_table(&mut self, require: bool) {
+        self.require_newline_after_table = require;
+    }
+
+    fn line(&mut self) -> Result<Option<Line<'a>>, Error> {
+        loop {
+            self.eat_whitespace()?;
+            if self.eat_comment()? {
+                continue
+            }
+            if self.eat(Token::Newline)? {
+                continue
+            }
+            break
+        }
+
+        match self.peek()? {
+            Some(Token::LeftBracket) => self.table_header().map(Some),
+            Some(_) => self.key_value().map(Some),
+            None => Ok(None),
+        }
+    }
+
+    fn table_header(&mut self) -> Result<Line<'a>, Error> {
+        let start = self.tokens.current();
+        self.expect(Token::LeftBracket)?;
+        let array = self.eat(Token::LeftBracket)?;
+        let ret = Header::new(self.tokens.clone(),
+                              array,
+                              self.require_newline_after_table);
+        if self.require_newline_after_table {
+            self.tokens.skip_to_newline();
+        } else {
+            loop {
+                match self.next()? {
+                    Some(Token::RightBracket) => {
+                        if array {
+                            self.eat(Token::RightBracket)?;
+                        }
+                        break
+                    }
+                    Some(Token::Newline) |
+                    None => break,
+                    _ => {}
+                }
+            }
+            self.eat_whitespace()?;
+        }
+        Ok(Line::Table { at: start, header: ret, array: array })
+    }
+
+    fn key_value(&mut self) -> Result<Line<'a>, Error> {
+        let key = self.table_key()?;
+        self.eat_whitespace()?;
+        self.expect(Token::Equals)?;
+        self.eat_whitespace()?;
+
+        let value = self.value()?;
+        self.eat_whitespace()?;
+        if !self.eat_comment()? {
+            self.eat_newline_or_eof()?;
+        }
+
+        Ok(Line::KeyValue(key, value))
+    }
+
+    fn value(&mut self) -> Result<Value<'a>, Error> {
+        let at = self.tokens.current();
+        let value = match self.next()? {
+            Some(Token::String { val, .. }) => Value::String(val),
+            Some(Token::Keylike("true")) => Value::Boolean(true),
+            Some(Token::Keylike("false")) => Value::Boolean(false),
+            Some(Token::Keylike(key)) => self.number_or_date(key)?,
+            Some(Token::Plus) => self.number_leading_plus()?,
+            Some(Token::LeftBrace) => self.inline_table().map(Value::InlineTable)?,
+            Some(Token::LeftBracket) => self.array().map(Value::Array)?,
+            Some(token) => {
+                return Err(self.error(at, ErrorKind::Wanted {
+                    expected: "a value",
+                    found: token.describe(),
+                }))
+            }
+            None => return Err(self.eof()),
+        };
+        Ok(value)
+    }
+
+    fn number_or_date(&mut self, s: &'a str) -> Result<Value<'a>, Error> {
+        if s.contains('T') || (s.len() > 1 && s[1..].contains('-')) &&
+           !s.contains("e-") {
+            self.datetime(s, false).map(Value::Datetime)
+        } else if self.eat(Token::Colon)? {
+            self.datetime(s, true).map(Value::Datetime)
+        } else {
+            self.number(s)
+        }
+    }
+
+    fn number(&mut self, s: &'a str) -> Result<Value<'a>, Error> {
+        if s.contains('e') || s.contains('E') {
+            self.float(s, None).map(Value::Float)
+        } else if self.eat(Token::Period)? {
+            let at = self.tokens.current();
+            match self.next()? {
+                Some(Token::Keylike(after)) => {
+                    self.float(s, Some(after)).map(Value::Float)
+                }
+                _ => Err(self.error(at, ErrorKind::NumberInvalid)),
+            }
+        } else {
+            self.integer(s).map(Value::Integer)
+        }
+    }
+
+    fn number_leading_plus(&mut self) -> Result<Value<'a>, Error> {
+        let start = self.tokens.current();
+        match self.next()? {
+            Some(Token::Keylike(s)) => self.number(s),
+            _ => Err(self.error(start, ErrorKind::NumberInvalid)),
+        }
+    }
+
+    fn integer(&self, s: &'a str) -> Result<i64, Error> {
+        let (prefix, suffix) = self.parse_integer(s, true, false)?;
+        let start = self.tokens.substr_offset(s);
+        if suffix != "" {
+            return Err(self.error(start, ErrorKind::NumberInvalid))
+        }
+        prefix.replace("_", "").trim_left_matches('+').parse().map_err(|_e| {
+            self.error(start, ErrorKind::NumberInvalid)
+        })
+    }
+
+    fn parse_integer(&self,
+                     s: &'a str,
+                     allow_sign: bool,
+                     allow_leading_zeros: bool)
+                     -> Result<(&'a str, &'a str), Error> {
+        let start = self.tokens.substr_offset(s);
+
+        let mut first = true;
+        let mut first_zero = false;
+        let mut underscore = false;
+        let mut end = s.len();
+        for (i, c) in s.char_indices() {
+            let at = i + start;
+            if i == 0 && (c == '+' || c == '-') && allow_sign {
+                continue
+            }
+
+            match c {
+                '0' if first => first_zero = true,
+                '0' ... '9' if !first && first_zero && !allow_leading_zeros => {
+                    return Err(self.error(at, ErrorKind::NumberInvalid))
+                }
+                '0' ... '9' => underscore = false,
+                '_' if first => {
+                    return Err(self.error(at, ErrorKind::NumberInvalid))
+                }
+                '_' if !underscore => underscore = true,
+                _ => {
+                    end = i;
+                    break
+                }
+
+            }
+            first = false;
+        }
+        if first || underscore {
+            return Err(self.error(start, ErrorKind::NumberInvalid))
+        }
+        Ok((&s[..end], &s[end..]))
+    }
+
+    fn float(&mut self, s: &'a str, after_decimal: Option<&'a str>)
+             -> Result<f64, Error> {
+        let (integral, mut suffix) = self.parse_integer(s, true, false)?;
+        let start = self.tokens.substr_offset(integral);
+
+        let mut fraction = None;
+        if let Some(after) = after_decimal {
+            if suffix != "" {
+                return Err(self.error(start, ErrorKind::NumberInvalid))
+            }
+            let (a, b) = self.parse_integer(after, false, true)?;
+            fraction = Some(a);
+            suffix = b;
+        }
+
+        let mut exponent = None;
+        if suffix.starts_with('e') || suffix.starts_with('E') {
+            let (a, b) = if suffix.len() == 1 {
+                self.eat(Token::Plus)?;
+                match self.next()? {
+                    Some(Token::Keylike(s)) => {
+                        self.parse_integer(s, false, false)?
+                    }
+                    _ => return Err(self.error(start, ErrorKind::NumberInvalid)),
+                }
+            } else {
+                self.parse_integer(&suffix[1..], true, false)?
+            };
+            if b != "" {
+                return Err(self.error(start, ErrorKind::NumberInvalid))
+            }
+            exponent = Some(a);
+        }
+
+        let mut number = integral.trim_left_matches('+')
+                                 .chars()
+                                 .filter(|c| *c != '_')
+                                 .collect::<String>();
+        if let Some(fraction) = fraction {
+            number.push_str(".");
+            number.extend(fraction.chars().filter(|c| *c != '_'));
+        }
+        if let Some(exponent) = exponent {
+            number.push_str("E");
+            number.extend(exponent.chars().filter(|c| *c != '_'));
+        }
+        number.parse().map_err(|_e| {
+            self.error(start, ErrorKind::NumberInvalid)
+        }).and_then(|n: f64| {
+            if n.is_finite() {
+                Ok(n)
+            } else {
+                Err(self.error(start, ErrorKind::NumberInvalid))
+            }
+        })
+    }
+
+    fn datetime(&mut self, date: &'a str, colon_eaten: bool)
+                -> Result<&'a str, Error> {
+        let start = self.tokens.substr_offset(date);
+        if colon_eaten || self.eat(Token::Colon)? {
+            // minutes
+            match self.next()? {
+                Some(Token::Keylike(_)) => {}
+                _ => return Err(self.error(start, ErrorKind::DateInvalid)),
+            }
+            // Seconds
+            self.expect(Token::Colon)?;
+            match self.next()? {
+                Some(Token::Keylike(_)) => {}
+                _ => return Err(self.error(start, ErrorKind::DateInvalid)),
+            }
+            // Fractional seconds
+            if self.eat(Token::Period)? {
+                match self.next()? {
+                    Some(Token::Keylike(_)) => {}
+                    _ => return Err(self.error(start, ErrorKind::DateInvalid)),
+                }
+            }
+
+            // offset
+            if self.eat(Token::Plus)? {
+                match self.next()? {
+                    Some(Token::Keylike(_)) => {}
+                    _ => return Err(self.error(start, ErrorKind::DateInvalid)),
+                }
+            }
+            if self.eat(Token::Colon)? {
+                match self.next()? {
+                    Some(Token::Keylike(_)) => {}
+                    _ => return Err(self.error(start, ErrorKind::DateInvalid)),
+                }
+            }
+        }
+        let end = self.tokens.current();
+        Ok(&self.tokens.input()[start..end])
+    }
+
+    // TODO(#140): shouldn't buffer up this entire table in memory, it'd be
+    // great to defer parsing everything until later.
+    fn inline_table(&mut self) -> Result<Vec<(Cow<'a, str>, Value<'a>)>, Error> {
+        let mut ret = Vec::new();
+        self.eat_whitespace()?;
+        if self.eat(Token::RightBrace)? {
+            return Ok(ret)
+        }
+        loop {
+            let key = self.table_key()?;
+            self.eat_whitespace()?;
+            self.expect(Token::Equals)?;
+            self.eat_whitespace()?;
+            ret.push((key, self.value()?));
+
+            self.eat_whitespace()?;
+            if self.eat(Token::RightBrace)? {
+                return Ok(ret)
+            }
+            self.expect(Token::Comma)?;
+            self.eat_whitespace()?;
+        }
+    }
+
+    // TODO(#140): shouldn't buffer up this entire array in memory, it'd be
+    // great to defer parsing everything until later.
+    fn array(&mut self) -> Result<Vec<Value<'a>>, Error> {
+        let mut ret = Vec::new();
+
+        let intermediate = |me: &mut Deserializer| {
+            loop {
+                me.eat_whitespace()?;
+                if !me.eat(Token::Newline)? && !me.eat_comment()? {
+                    break
+                }
+            }
+            Ok(())
+        };
+
+        loop {
+            intermediate(self)?;
+            if self.eat(Token::RightBracket)? {
+                return Ok(ret)
+            }
+            let at = self.tokens.current();
+            let value = self.value()?;
+            if let Some(last) = ret.last() {
+                if !value.same_type(last) {
+                    return Err(self.error(at, ErrorKind::MixedArrayType))
+                }
+            }
+            ret.push(value);
+            intermediate(self)?;
+            if !self.eat(Token::Comma)? {
+                break
+            }
+        }
+        intermediate(self)?;
+        self.expect(Token::RightBracket)?;
+        Ok(ret)
+    }
+
+    fn table_key(&mut self) -> Result<Cow<'a, str>, Error> {
+        self.tokens.table_key().map_err(|e| self.token_error(e))
+    }
+
+    fn eat_whitespace(&mut self) -> Result<(), Error> {
+        self.tokens.eat_whitespace().map_err(|e| self.token_error(e))
+    }
+
+    fn eat_comment(&mut self) -> Result<bool, Error> {
+        self.tokens.eat_comment().map_err(|e| self.token_error(e))
+    }
+
+    fn eat_newline_or_eof(&mut self) -> Result<(), Error> {
+        self.tokens.eat_newline_or_eof().map_err(|e| self.token_error(e))
+    }
+
+    fn eat(&mut self, expected: Token<'a>) -> Result<bool, Error> {
+        self.tokens.eat(expected).map_err(|e| self.token_error(e))
+    }
+
+    fn expect(&mut self, expected: Token<'a>) -> Result<(), Error> {
+        self.tokens.expect(expected).map_err(|e| self.token_error(e))
+    }
+
+    fn next(&mut self) -> Result<Option<Token<'a>>, Error> {
+        self.tokens.next().map_err(|e| self.token_error(e))
+    }
+
+    fn peek(&mut self) -> Result<Option<Token<'a>>, Error> {
+        self.tokens.peek().map_err(|e| self.token_error(e))
+    }
+
+    fn eof(&self) -> Error {
+        self.error(self.input.len(), ErrorKind::UnexpectedEof)
+    }
+
+    fn token_error(&self, error: TokenError) -> Error {
+        match error {
+            TokenError::InvalidCharInString(at, ch) => {
+                self.error(at, ErrorKind::InvalidCharInString(ch))
+            }
+            TokenError::InvalidEscape(at, ch) => {
+                self.error(at, ErrorKind::InvalidEscape(ch))
+            }
+            TokenError::InvalidEscapeValue(at, v) => {
+                self.error(at, ErrorKind::InvalidEscapeValue(v))
+            }
+            TokenError::InvalidHexEscape(at, ch) => {
+                self.error(at, ErrorKind::InvalidHexEscape(ch))
+            }
+            TokenError::NewlineInString(at) => {
+                self.error(at, ErrorKind::NewlineInString)
+            }
+            TokenError::Unexpected(at, ch) => {
+                self.error(at, ErrorKind::Unexpected(ch))
+            }
+            TokenError::UnterminatedString(at) => {
+                self.error(at, ErrorKind::UnterminatedString)
+            }
+            TokenError::NewlineInTableKey(at) => {
+                self.error(at, ErrorKind::NewlineInTableKey)
+            }
+            TokenError::Wanted { at, expected, found } => {
+                self.error(at, ErrorKind::Wanted { expected: expected, found: found })
+            }
+            TokenError::EmptyTableKey(at) => {
+                self.error(at, ErrorKind::EmptyTableKey)
+            }
+        }
+    }
+
+    fn error(&self, at: usize, kind: ErrorKind) -> Error {
+        let mut err = Error::from_kind(kind);
+        let (line, col) = self.to_linecol(at);
+        err.inner.line = Some(line);
+        err.inner.col = col;
+        err
+    }
+
+    /// Converts a byte offset from an error message to a (line, column) pair
+    ///
+    /// All indexes are 0-based.
+    fn to_linecol(&self, offset: usize) -> (usize, usize) {
+        let mut cur = 0;
+        for (i, line) in self.input.lines().enumerate() {
+            if cur + line.len() + 1 > offset {
+                return (i, offset - cur)
+            }
+            cur += line.len() + 1;
+        }
+        (self.input.lines().count(), 0)
+    }
+}
+
+impl Error {
+    /// Produces a (line, column) pair of the position of the error if available
+    ///
+    /// All indexes are 0-based.
+    pub fn line_col(&self) -> Option<(usize, usize)> {
+        self.inner.line.map(|line| (line, self.inner.col))
+    }
+
+    fn from_kind(kind: ErrorKind) -> Error {
+        Error {
+            inner: Box::new(ErrorInner {
+                kind: kind,
+                line: None,
+                col: 0,
+                message: String::new(),
+                key: Vec::new(),
+            }),
+        }
+    }
+
+    fn custom(s: String) -> Error {
+        Error {
+            inner: Box::new(ErrorInner {
+                kind: ErrorKind::Custom,
+                line: None,
+                col: 0,
+                message: s,
+                key: Vec::new(),
+            }),
+        }
+    }
+
+    /// Do not call this method, it may be removed at any time, it's just an
+    /// internal implementation detail.
+    #[doc(hidden)]
+    pub fn add_key_context(&mut self, key: &str) {
+        self.inner.key.insert(0, key.to_string());
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self.inner.kind {
+            ErrorKind::UnexpectedEof => "unexpected eof encountered".fmt(f)?,
+            ErrorKind::InvalidCharInString(c) => {
+                write!(f, "invalid character in string: `{}`",
+                       c.escape_default().collect::<String>())?
+            }
+            ErrorKind::InvalidEscape(c) => {
+                write!(f, "invalid escape character in string: `{}`",
+                       c.escape_default().collect::<String>())?
+            }
+            ErrorKind::InvalidHexEscape(c) => {
+                write!(f, "invalid hex escape character in string: `{}`",
+                       c.escape_default().collect::<String>())?
+            }
+            ErrorKind::InvalidEscapeValue(c) => {
+                write!(f, "invalid escape value: `{}`", c)?
+            }
+            ErrorKind::NewlineInString => "newline in string found".fmt(f)?,
+            ErrorKind::Unexpected(ch) => {
+                write!(f, "unexpected character found: `{}`",
+                       ch.escape_default().collect::<String>())?
+            }
+            ErrorKind::UnterminatedString => "unterminated string".fmt(f)?,
+            ErrorKind::NewlineInTableKey => "found newline in table key".fmt(f)?,
+            ErrorKind::Wanted { expected, found } => {
+                write!(f, "expected {}, found {}", expected, found)?
+            }
+            ErrorKind::NumberInvalid => "invalid number".fmt(f)?,
+            ErrorKind::DateInvalid => "invalid date".fmt(f)?,
+            ErrorKind::MixedArrayType => "mixed types in an array".fmt(f)?,
+            ErrorKind::DuplicateTable(ref s) => {
+                write!(f, "redefinition of table `{}`", s)?;
+            }
+            ErrorKind::RedefineAsArray => "table redefined as array".fmt(f)?,
+            ErrorKind::EmptyTableKey => "empty table key found".fmt(f)?,
+            ErrorKind::Custom => self.inner.message.fmt(f)?,
+            ErrorKind::ExpectedString => "expected string".fmt(f)?,
+            ErrorKind::__Nonexhaustive => panic!(),
+        }
+
+        if !self.inner.key.is_empty() {
+            write!(f, " for key `")?;
+            for (i, k) in self.inner.key.iter().enumerate() {
+                if i > 0 {
+                    write!(f, ".")?;
+                }
+                write!(f, "{}", k)?;
+            }
+            write!(f, "`")?;
+        }
+
+        if let Some(line) = self.inner.line {
+            write!(f, " at line {}", line + 1)?;
+        }
+
+        Ok(())
+    }
+}
+
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        match self.inner.kind {
+            ErrorKind::UnexpectedEof => "unexpected eof encountered",
+            ErrorKind::InvalidCharInString(_) => "invalid char in string",
+            ErrorKind::InvalidEscape(_) => "invalid escape in string",
+            ErrorKind::InvalidHexEscape(_) => "invalid hex escape in string",
+            ErrorKind::InvalidEscapeValue(_) => "invalid escape value in string",
+            ErrorKind::NewlineInString => "newline in string found",
+            ErrorKind::Unexpected(_) => "unexpected or invalid character",
+            ErrorKind::UnterminatedString => "unterminated string",
+            ErrorKind::NewlineInTableKey => "found newline in table key",
+            ErrorKind::Wanted { .. } => "expected a token but found another",
+            ErrorKind::NumberInvalid => "invalid number",
+            ErrorKind::DateInvalid => "invalid date",
+            ErrorKind::MixedArrayType => "mixed types in an array",
+            ErrorKind::DuplicateTable(_) => "duplicate table",
+            ErrorKind::RedefineAsArray => "table redefined as array",
+            ErrorKind::EmptyTableKey => "empty table key found",
+            ErrorKind::Custom => "a custom error",
+            ErrorKind::ExpectedString => "expected string",
+            ErrorKind::__Nonexhaustive => panic!(),
+        }
+    }
+}
+
+impl de::Error for Error {
+    fn custom<T: fmt::Display>(msg: T) -> Error {
+        Error::custom(msg.to_string())
+    }
+}
+
+enum Line<'a> {
+    Table { at: usize, header: Header<'a>, array: bool },
+    KeyValue(Cow<'a, str>, Value<'a>),
+}
+
+struct Header<'a> {
+    first: bool,
+    array: bool,
+    require_newline_after_table: bool,
+    tokens: Tokenizer<'a>,
+}
+
+impl<'a> Header<'a> {
+    fn new(tokens: Tokenizer<'a>,
+           array: bool,
+           require_newline_after_table: bool) -> Header<'a> {
+        Header {
+            first: true,
+            array: array,
+            tokens: tokens,
+            require_newline_after_table: require_newline_after_table,
+        }
+    }
+
+    fn next(&mut self) -> Result<Option<Cow<'a, str>>, TokenError> {
+        self.tokens.eat_whitespace()?;
+
+        if self.first || self.tokens.eat(Token::Period)? {
+            self.first = false;
+            self.tokens.eat_whitespace()?;
+            self.tokens.table_key().map(Some)
+        } else {
+            self.tokens.expect(Token::RightBracket)?;
+            if self.array {
+                self.tokens.expect(Token::RightBracket)?;
+            }
+
+            self.tokens.eat_whitespace()?;
+            if self.require_newline_after_table {
+                if !self.tokens.eat_comment()? {
+                    self.tokens.eat_newline_or_eof()?;
+                }
+            }
+            Ok(None)
+        }
+    }
+}
+
+#[derive(Debug)]
+enum Value<'a> {
+    Integer(i64),
+    Float(f64),
+    Boolean(bool),
+    String(Cow<'a, str>),
+    Datetime(&'a str),
+    Array(Vec<Value<'a>>),
+    InlineTable(Vec<(Cow<'a, str>, Value<'a>)>),
+}
+
+impl<'a> Value<'a> {
+    fn same_type(&self, other: &Value<'a>) -> bool {
+        match (self, other) {
+            (&Value::String(..), &Value::String(..)) |
+            (&Value::Integer(..), &Value::Integer(..)) |
+            (&Value::Float(..), &Value::Float(..)) |
+            (&Value::Boolean(..), &Value::Boolean(..)) |
+            (&Value::Datetime(..), &Value::Datetime(..)) |
+            (&Value::Array(..), &Value::Array(..)) |
+            (&Value::InlineTable(..), &Value::InlineTable(..)) => true,
+
+            _ => false,
+        }
+    }
+}
deleted file mode 100644
--- a/third_party/rust/toml/src/decoder/mod.rs
+++ /dev/null
@@ -1,240 +0,0 @@
-use std::error;
-use std::fmt;
-
-use std::collections::{btree_map, BTreeMap};
-use std::iter::Peekable;
-
-use Value;
-use self::DecodeErrorKind::*;
-
-#[cfg(feature = "rustc-serialize")] mod rustc_serialize;
-#[cfg(feature = "serde")] mod serde;
-
-/// A structure to transform TOML values into Rust values.
-///
-/// This decoder implements the serialization `Decoder` interface, allowing
-/// `Decodable` types to be generated by this decoder. The input is any
-/// arbitrary TOML value.
-pub struct Decoder {
-    /// The TOML value left over after decoding. This can be used to inspect
-    /// whether fields were decoded or not.
-    pub toml: Option<Value>,
-    cur_field: Option<String>,
-
-    // These aren't used if serde is in use
-    #[cfg_attr(feature = "serde", allow(dead_code))]
-    cur_map: Peekable<btree_map::IntoIter<String, Value>>,
-    #[cfg_attr(feature = "serde", allow(dead_code))]
-    leftover_map: ::Table,
-}
-
-/// Description for errors which can occur while decoding a type.
-#[derive(PartialEq, Debug)]
-pub struct DecodeError {
-    /// Field that this error applies to.
-    pub field: Option<String>,
-    /// The type of error which occurred while decoding,
-    pub kind: DecodeErrorKind,
-}
-
-/// Enumeration of possible errors which can occur while decoding a structure.
-#[derive(PartialEq, Debug)]
-pub enum DecodeErrorKind {
-    /// An error flagged by the application, e.g. value out of range
-    ApplicationError(String),
-    /// A field was expected, but none was found.
-    ExpectedField(/* type */ Option<&'static str>),
-    /// A field was found, but it was not an expected one.
-    UnknownField,
-    /// A field was found, but it had the wrong type.
-    ExpectedType(/* expected */ &'static str, /* found */ &'static str),
-    /// The nth map key was expected, but none was found.
-    ExpectedMapKey(usize),
-    /// The nth map element was expected, but none was found.
-    ExpectedMapElement(usize),
-    /// An enum decoding was requested, but no variants were supplied
-    NoEnumVariants,
-    /// The unit type was being decoded, but a non-zero length string was found
-    NilTooLong,
-    /// There was an error with the syntactical structure of the TOML.
-    SyntaxError,
-    /// A custom error was generated when decoding.
-    CustomError(String),
-    /// The end of the TOML input was reached too soon
-    EndOfStream,
-    /// Produced by serde ...
-    InvalidType(&'static str),
-}
-
-/// Decodes a TOML value into a decodable type.
-///
-/// This function will consume the given TOML value and attempt to decode it
-/// into the type specified. If decoding fails, `None` will be returned. If a
-/// finer-grained error is desired, then it is recommended to use `Decodable`
-/// directly.
-#[cfg(feature = "rustc-serialize")]
-pub fn decode<T: ::rustc_serialize::Decodable>(toml: Value) -> Option<T> {
-    ::rustc_serialize::Decodable::decode(&mut Decoder::new(toml)).ok()
-}
-
-/// Decodes a TOML value into a decodable type.
-///
-/// This function will consume the given TOML value and attempt to decode it
-/// into the type specified. If decoding fails, `None` will be returned. If a
-/// finer-grained error is desired, then it is recommended to use `Decodable`
-/// directly.
-#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
-pub fn decode<T: ::serde::Deserialize>(toml: Value) -> Option<T> {
-    ::serde::Deserialize::deserialize(&mut Decoder::new(toml)).ok()
-}
-
-/// Decodes a string into a toml-encoded value.
-///
-/// This function will parse the given string into a TOML value, and then parse
-/// the TOML value into the desired type. If any error occurs, `None` is
-/// returned.
-///
-/// If more fine-grained errors are desired, these steps should be driven
-/// manually.
-#[cfg(feature = "rustc-serialize")]
-pub fn decode_str<T: ::rustc_serialize::Decodable>(s: &str) -> Option<T> {
-    ::Parser::new(s).parse().and_then(|t| decode(Value::Table(t)))
-}
-
-/// Decodes a string into a toml-encoded value.
-///
-/// This function will parse the given string into a TOML value, and then parse
-/// the TOML value into the desired type. If any error occurs, `None` is
-/// returned.
-///
-/// If more fine-grained errors are desired, these steps should be driven
-/// manually.
-#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
-pub fn decode_str<T: ::serde::Deserialize>(s: &str) -> Option<T> {
-    ::Parser::new(s).parse().and_then(|t| decode(Value::Table(t)))
-}
-
-impl Decoder {
-    /// Creates a new decoder, consuming the TOML value to decode.
-    ///
-    /// This decoder can be passed to the `Decodable` methods or driven
-    /// manually.
-    pub fn new(toml: Value) -> Decoder {
-        Decoder::new_empty(Some(toml), None)
-    }
-
-    fn sub_decoder(&self, toml: Option<Value>, field: &str) -> Decoder {
-        let cur_field = if field.is_empty() {
-            self.cur_field.clone()
-        } else {
-            match self.cur_field {
-                None => Some(field.to_string()),
-                Some(ref s) => Some(format!("{}.{}", s, field))
-            }
-        };
-        Decoder::new_empty(toml, cur_field)
-    }
-
-    fn new_empty(toml: Option<Value>, cur_field: Option<String>) -> Decoder {
-        Decoder {
-            toml: toml,
-            cur_field: cur_field,
-            leftover_map: BTreeMap::new(),
-            cur_map: BTreeMap::new().into_iter().peekable(),
-        }
-    }
-
-    fn err(&self, kind: DecodeErrorKind) -> DecodeError {
-        DecodeError {
-            field: self.cur_field.clone(),
-            kind: kind,
-        }
-    }
-
-    fn mismatch(&self, expected: &'static str,
-                found: &Option<Value>) -> DecodeError{
-        match *found {
-            Some(ref val) => self.err(ExpectedType(expected, val.type_str())),
-            None => self.err(ExpectedField(Some(expected))),
-        }
-    }
-}
-
-impl fmt::Display for DecodeError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        try!(match self.kind {
-            ApplicationError(ref err) => {
-                write!(f, "{}", err)
-            }
-            ExpectedField(expected_type) => {
-                match expected_type {
-                    Some("table") => write!(f, "expected a section"),
-                    Some(e) => write!(f, "expected a value of type `{}`", e),
-                    None => write!(f, "expected a value"),
-                }
-            }
-            UnknownField => write!(f, "unknown field"),
-            ExpectedType(expected, found) => {
-                fn humanize(s: &str) -> String {
-                    if s == "section" {
-                        "a section".to_string()
-                    } else {
-                        format!("a value of type `{}`", s)
-                    }
-                }
-                write!(f, "expected {}, but found {}",
-                       humanize(expected),
-                       humanize(found))
-            }
-            ExpectedMapKey(idx) => {
-                write!(f, "expected at least {} keys", idx + 1)
-            }
-            ExpectedMapElement(idx) => {
-                write!(f, "expected at least {} elements", idx + 1)
-            }
-            NoEnumVariants => {
-                write!(f, "expected an enum variant to decode to")
-            }
-            NilTooLong => {
-                write!(f, "expected 0-length string")
-            }
-            SyntaxError => {
-                write!(f, "syntax error")
-            }
-            EndOfStream => {
-                write!(f, "end of stream")
-            }
-            InvalidType(s) => {
-                write!(f, "invalid type: {}", s)
-            }
-            CustomError(ref s) => {
-                write!(f, "custom error: {}", s)
-            }
-        });
-        match self.field {
-            Some(ref s) => {
-                write!(f, " for the key `{}`", s)
-            }
-            None => Ok(())
-        }
-    }
-}
-
-impl error::Error for DecodeError {
-    fn description(&self) -> &str {
-        match self.kind {
-            ApplicationError(ref s) => &**s,
-            ExpectedField(..) => "expected a field",
-            UnknownField => "found an unknown field",
-            ExpectedType(..) => "expected a type",
-            ExpectedMapKey(..) => "expected a map key",
-            ExpectedMapElement(..) => "expected a map element",
-            NoEnumVariants => "no enum variants to decode to",
-            NilTooLong => "nonzero length string representing nil",
-            SyntaxError => "syntax error",
-            EndOfStream => "end of stream",
-            InvalidType(..) => "invalid type",
-            CustomError(..) => "custom error",
-        }
-    }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/decoder/rustc_serialize.rs
+++ /dev/null
@@ -1,371 +0,0 @@
-use rustc_serialize;
-use std::mem;
-use std::collections::BTreeMap;
-
-use super::{Decoder, DecodeError};
-use super::DecodeErrorKind::*;
-use Value;
-
-impl rustc_serialize::Decoder for Decoder {
-    type Error = DecodeError;
-    fn read_nil(&mut self) -> Result<(), DecodeError> {
-        match self.toml {
-            Some(Value::String(ref s)) if s.is_empty() => {}
-            Some(Value::String(..)) => return Err(self.err(NilTooLong)),
-            ref found => return Err(self.mismatch("string", found)),
-        }
-        self.toml.take();
-        Ok(())
-    }
-    fn read_usize(&mut self) -> Result<usize, DecodeError> {
-        self.read_i64().map(|i| i as usize)
-    }
-    fn read_u64(&mut self) -> Result<u64, DecodeError> {
-        self.read_i64().map(|i| i as u64)
-    }
-    fn read_u32(&mut self) -> Result<u32, DecodeError> {
-        self.read_i64().map(|i| i as u32)
-    }
-    fn read_u16(&mut self) -> Result<u16, DecodeError> {
-        self.read_i64().map(|i| i as u16)
-    }
-    fn read_u8(&mut self) -> Result<u8, DecodeError> {
-        self.read_i64().map(|i| i as u8)
-    }
-    fn read_isize(&mut self) -> Result<isize, DecodeError> {
-        self.read_i64().map(|i| i as isize)
-    }
-    fn read_i64(&mut self) -> Result<i64, DecodeError> {
-        match self.toml {
-            Some(Value::Integer(i)) => { self.toml.take(); Ok(i) }
-            ref found => Err(self.mismatch("integer", found)),
-        }
-    }
-    fn read_i32(&mut self) -> Result<i32, DecodeError> {
-        self.read_i64().map(|i| i as i32)
-    }
-    fn read_i16(&mut self) -> Result<i16, DecodeError> {
-        self.read_i64().map(|i| i as i16)
-    }
-    fn read_i8(&mut self) -> Result<i8, DecodeError> {
-        self.read_i64().map(|i| i as i8)
-    }
-    fn read_bool(&mut self) -> Result<bool, DecodeError> {
-        match self.toml {
-            Some(Value::Boolean(b)) => { self.toml.take(); Ok(b) }
-            ref found => Err(self.mismatch("bool", found)),
-        }
-    }
-    fn read_f64(&mut self) -> Result<f64, DecodeError> {
-        match self.toml {
-            Some(Value::Float(f)) => { self.toml.take(); Ok(f) },
-            ref found => Err(self.mismatch("float", found)),
-        }
-    }
-    fn read_f32(&mut self) -> Result<f32, DecodeError> {
-        self.read_f64().map(|f| f as f32)
-    }
-    fn read_char(&mut self) -> Result<char, DecodeError> {
-        let ch = match self.toml {
-            Some(Value::String(ref s)) if s.chars().count() == 1 =>
-                s.chars().next().unwrap(),
-            ref found => return Err(self.mismatch("string", found)),
-        };
-        self.toml.take();
-        Ok(ch)
-    }
-    fn read_str(&mut self) -> Result<String, DecodeError> {
-        match self.toml.take() {
-            Some(Value::String(s)) => Ok(s),
-            found => {
-                let err = Err(self.mismatch("string", &found));
-                self.toml = found;
-                err
-            }
-        }
-    }
-
-    // Compound types:
-    fn read_enum<T, F>(&mut self, _name: &str, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        f(self)
-    }
-
-    fn read_enum_variant<T, F>(&mut self, names: &[&str], mut f: F)
-        -> Result<T, DecodeError>
-        where F: FnMut(&mut Decoder, usize) -> Result<T, DecodeError>
-    {
-        // When decoding enums, this crate takes the strategy of trying to
-        // decode the current TOML as all of the possible variants, returning
-        // success on the first one that succeeds.
-        //
-        // Note that fidelity of the errors returned here is a little nebulous,
-        // but we try to return the error that had the relevant field as the
-        // longest field. This way we hopefully match an error against what was
-        // most likely being written down without losing too much info.
-        let mut first_error = None::<DecodeError>;
-        for i in 0..names.len() {
-            let mut d = self.sub_decoder(self.toml.clone(), "");
-            match f(&mut d, i) {
-                Ok(t) => {
-                    self.toml = d.toml;
-                    return Ok(t)
-                }
-                Err(e) => {
-                    if let Some(ref first) = first_error {
-                        let my_len = e.field.as_ref().map(|s| s.len());
-                        let first_len = first.field.as_ref().map(|s| s.len());
-                        if my_len <= first_len {
-                            continue
-                        }
-                    }
-                    first_error = Some(e);
-                }
-            }
-        }
-        Err(first_error.unwrap_or_else(|| self.err(NoEnumVariants)))
-    }
-    fn read_enum_variant_arg<T, F>(&mut self, _a_idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        f(self)
-    }
-
-    fn read_enum_struct_variant<T, F>(&mut self, _names: &[&str], _f: F)
-        -> Result<T, DecodeError>
-        where F: FnMut(&mut Decoder, usize) -> Result<T, DecodeError>
-    {
-        panic!()
-    }
-    fn read_enum_struct_variant_field<T, F>(&mut self,
-                                            _f_name: &str,
-                                            _f_idx: usize,
-                                            _f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        panic!()
-    }
-
-    fn read_struct<T, F>(&mut self, _s_name: &str, _len: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        match self.toml {
-            Some(Value::Table(..)) => {
-                let ret = try!(f(self));
-                match self.toml {
-                    Some(Value::Table(ref t)) if t.is_empty() => {}
-                    _ => return Ok(ret)
-                }
-                self.toml.take();
-                Ok(ret)
-            }
-            ref found => Err(self.mismatch("table", found)),
-        }
-    }
-    fn read_struct_field<T, F>(&mut self, f_name: &str, _f_idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        let field = f_name.to_string();
-        let toml = match self.toml {
-            Some(Value::Table(ref mut table)) => {
-                table.remove(&field)
-                     .or_else(|| table.remove(&f_name.replace("_", "-")))
-            },
-            ref found => return Err(self.mismatch("table", found)),
-        };
-        let mut d = self.sub_decoder(toml, f_name);
-        let ret = try!(f(&mut d));
-        if let Some(value) = d.toml {
-            if let Some(Value::Table(ref mut table)) = self.toml {
-                table.insert(field, value);
-            }
-        }
-        Ok(ret)
-    }
-
-    fn read_tuple<T, F>(&mut self, tuple_len: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        self.read_seq(move |d, len| {
-            assert!(len == tuple_len,
-                    "expected tuple of length `{}`, found tuple \
-                         of length `{}`", tuple_len, len);
-            f(d)
-        })
-    }
-    fn read_tuple_arg<T, F>(&mut self, a_idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        self.read_seq_elt(a_idx, f)
-    }
-
-    fn read_tuple_struct<T, F>(&mut self, _s_name: &str, _len: usize, _f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        panic!()
-    }
-    fn read_tuple_struct_arg<T, F>(&mut self, _a_idx: usize, _f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        panic!()
-    }
-
-    // Specialized types:
-    fn read_option<T, F>(&mut self, mut f: F)
-        -> Result<T, DecodeError>
-        where F: FnMut(&mut Decoder, bool) -> Result<T, DecodeError>
-    {
-        match self.toml {
-            Some(..) => f(self, true),
-            None => f(self, false),
-        }
-    }
-
-    fn read_seq<T, F>(&mut self, f: F) -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder, usize) -> Result<T, DecodeError>
-    {
-        let len = match self.toml {
-            Some(Value::Array(ref arr)) => arr.len(),
-            None => 0,
-            ref found => return Err(self.mismatch("array", found)),
-        };
-        let ret = try!(f(self, len));
-        match self.toml {
-            Some(Value::Array(ref mut arr)) => {
-                arr.retain(|slot| slot.as_integer() != Some(0));
-                if !arr.is_empty() { return Ok(ret) }
-            }
-            _ => return Ok(ret)
-        }
-        self.toml.take();
-        Ok(ret)
-    }
-    fn read_seq_elt<T, F>(&mut self, idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        let toml = match self.toml {
-            Some(Value::Array(ref mut arr)) => {
-                mem::replace(&mut arr[idx], Value::Integer(0))
-            }
-            ref found => return Err(self.mismatch("array", found)),
-        };
-        let mut d = self.sub_decoder(Some(toml), "");
-        let ret = try!(f(&mut d));
-        if let Some(toml) = d.toml {
-            if let Some(Value::Array(ref mut arr)) = self.toml {
-                arr[idx] = toml;
-            }
-        }
-        Ok(ret)
-    }
-
-    fn read_map<T, F>(&mut self, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder, usize) -> Result<T, DecodeError>
-    {
-        let map = match self.toml.take() {
-            Some(Value::Table(table)) => table,
-            found => {
-                self.toml = found;
-                return Err(self.mismatch("table", &self.toml))
-            }
-        };
-        let amt = map.len();
-        let prev_iter = mem::replace(&mut self.cur_map,
-                                     map.into_iter().peekable());
-        let prev_map = mem::replace(&mut self.leftover_map, BTreeMap::new());
-        let ret = try!(f(self, amt));
-        let leftover = mem::replace(&mut self.leftover_map, prev_map);
-        self.cur_map = prev_iter;
-        if !leftover.is_empty() {
-            self.toml = Some(Value::Table(leftover));
-        }
-        Ok(ret)
-    }
-    fn read_map_elt_key<T, F>(&mut self, idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        let key = match self.cur_map.peek().map(|p| p.0.clone()) {
-            Some(k) => k,
-            None => return Err(self.err(ExpectedMapKey(idx))),
-        };
-        let val = Value::String(key.clone());
-        f(&mut self.sub_decoder(Some(val), &key))
-    }
-    fn read_map_elt_val<T, F>(&mut self, idx: usize, f: F)
-        -> Result<T, DecodeError>
-        where F: FnOnce(&mut Decoder) -> Result<T, DecodeError>
-    {
-        match self.cur_map.next() {
-            Some((key, value)) => {
-                let mut d = self.sub_decoder(Some(value), &key);
-                let ret = f(&mut d);
-                if let Some(toml) = d.toml.take() {
-                    self.leftover_map.insert(key, toml);
-                }
-                ret
-            }
-            None => Err(self.err(ExpectedMapElement(idx))),
-        }
-    }
-
-    fn error(&mut self, err: &str) -> DecodeError {
-        DecodeError {
-            field: self.cur_field.clone(),
-            kind: ApplicationError(err.to_string())
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use rustc_serialize::Decodable;
-    use std::collections::HashMap;
-
-    use {Parser, Decoder, Value};
-
-    #[test]
-    fn bad_enum_chooses_longest_error() {
-        #[derive(RustcDecodable)]
-        #[allow(dead_code)]
-        struct Foo {
-            wut: HashMap<String, Bar>,
-        }
-
-        #[derive(RustcDecodable)]
-        enum Bar {
-            Simple(String),
-            Detailed(Baz),
-        }
-
-        #[derive(RustcDecodable, Debug)]
-        struct Baz {
-            features: Vec<String>,
-        }
-
-        let s = r#"
-            [wut]
-            a = { features = "" }
-        "#;
-        let v = Parser::new(s).parse().unwrap();
-        let mut d = Decoder::new(Value::Table(v));
-        let err = match Foo::decode(&mut d) {
-            Ok(_) => panic!("expected error"),
-            Err(e) => e,
-        };
-        assert_eq!(err.field.as_ref().unwrap(), "wut.a.features");
-
-    }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/decoder/serde.rs
+++ /dev/null
@@ -1,773 +0,0 @@
-use serde::de;
-use Value;
-use super::{Decoder, DecodeError, DecodeErrorKind};
-use std::collections::BTreeMap;
-
-macro_rules! forward_to_deserialize {
-    ($(
-        $name:ident ( $( $arg:ident : $ty:ty ),* );
-    )*) => {
-        $(
-            forward_to_deserialize!{
-                func: $name ( $( $arg: $ty ),* );
-            }
-        )*
-    };
-
-    (func: deserialize_enum ( $( $arg:ident : $ty:ty ),* );) => {
-        fn deserialize_enum<V>(
-            &mut self,
-            $(_: $ty,)*
-            _visitor: V,
-        ) -> ::std::result::Result<V::Value, Self::Error>
-            where V: ::serde::de::EnumVisitor
-        {
-            Err(::serde::de::Error::invalid_type(::serde::de::Type::Enum))
-        }
-    };
-
-    (func: $name:ident ( $( $arg:ident : $ty:ty ),* );) => {
-        #[inline]
-        fn $name<V>(
-            &mut self,
-            $(_: $ty,)*
-            visitor: V,
-        ) -> ::std::result::Result<V::Value, Self::Error>
-            where V: ::serde::de::Visitor
-        {
-            self.deserialize(visitor)
-        }
-    };
-}
-
-impl de::Deserializer for Decoder {
-    type Error = DecodeError;
-
-    fn deserialize<V>(&mut self, mut visitor: V)
-                      -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        match self.toml.take() {
-            Some(Value::String(s)) => visitor.visit_string(s),
-            Some(Value::Integer(i)) => visitor.visit_i64(i),
-            Some(Value::Float(f)) => visitor.visit_f64(f),
-            Some(Value::Boolean(b)) => visitor.visit_bool(b),
-            Some(Value::Datetime(s)) => visitor.visit_string(s),
-            Some(Value::Array(a)) => {
-                let len = a.len();
-                let iter = a.into_iter();
-                visitor.visit_seq(SeqDeserializer::new(iter, len, &mut self.toml))
-            }
-            Some(Value::Table(t)) => {
-                visitor.visit_map(MapVisitor {
-                    iter: t.into_iter(),
-                    de: self,
-                    key: None,
-                    value: None,
-                })
-            }
-            None => Err(self.err(DecodeErrorKind::EndOfStream)),
-        }
-    }
-
-    fn deserialize_bool<V>(&mut self, mut visitor: V)
-                           -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        match self.toml.take() {
-            Some(Value::Boolean(b)) => visitor.visit_bool(b),
-            ref found => Err(self.mismatch("bool", found)),
-        }
-    }
-
-    fn deserialize_i8<V>(&mut self, visitor: V)
-                         -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_i16<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_i32<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_i64<V>(&mut self, mut visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        match self.toml.take() {
-            Some(Value::Integer(f)) => visitor.visit_i64(f),
-            ref found => Err(self.mismatch("integer", found)),
-        }
-    }
-
-    fn deserialize_isize<V>(&mut self, visitor: V)
-                            -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_u8<V>(&mut self, visitor: V)
-                         -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_u16<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_u32<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_u64<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_usize<V>(&mut self, visitor: V)
-                            -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_i64(visitor)
-    }
-
-    fn deserialize_f32<V>(&mut self, visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        self.deserialize_f64(visitor)
-    }
-
-    fn deserialize_f64<V>(&mut self, mut visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        match self.toml.take() {
-            Some(Value::Float(f)) => visitor.visit_f64(f),
-            ref found => Err(self.mismatch("float", found)),
-        }
-    }
-
-    fn deserialize_str<V>(&mut self, mut visitor: V)
-                          -> Result<V::Value, Self::Error>
-        where V: de::Visitor,
-    {
-        match self.toml.take() {
-            Some(Value::String(s)) => visitor.visit_string(s),
-            ref found => Err(self.mismatch("string", found)),
-        }
-    }
-
-    fn deserialize_string<V>(&mut self, visitor: V)
-                             -> Result<V::Value, Self::Error>
-        where V: de::Visitor,
-    {
-        self.deserialize_str(visitor)
-    }
-
-    fn deserialize_char<V>(&mut self, mut visitor: V)
-                           -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        match self.toml.take() {
-            Some(Value::String(ref s)) if s.chars().count() == 1 => {
-                visitor.visit_char(s.chars().next().unwrap())
-            }
-            ref found => return Err(self.mismatch("string", found)),
-        }
-    }
-
-    fn deserialize_option<V>(&mut self, mut visitor: V)
-                             -> Result<V::Value, DecodeError>
-        where V: de::Visitor
-    {
-        if self.toml.is_none() {
-            visitor.visit_none()
-        } else {
-            visitor.visit_some(self)
-        }
-    }
-
-    fn deserialize_seq<V>(&mut self, mut visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        if self.toml.is_none() {
-            let iter = None::<i32>.into_iter();
-            visitor.visit_seq(de::value::SeqDeserializer::new(iter, 0))
-        } else {
-            self.deserialize(visitor)
-        }
-    }
-
-    fn deserialize_map<V>(&mut self, mut visitor: V)
-                          -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        match self.toml.take() {
-            Some(Value::Table(t)) => {
-                visitor.visit_map(MapVisitor {
-                    iter: t.into_iter(),
-                    de: self,
-                    key: None,
-                    value: None,
-                })
-            }
-            ref found => Err(self.mismatch("table", found)),
-        }
-    }
-
-    fn deserialize_enum<V>(&mut self,
-                           _enum: &str,
-                           variants: &[&str],
-                           mut visitor: V) -> Result<V::Value, DecodeError>
-        where V: de::EnumVisitor,
-    {
-        // When decoding enums, this crate takes the strategy of trying to
-        // decode the current TOML as all of the possible variants, returning
-        // success on the first one that succeeds.
-        //
-        // Note that fidelity of the errors returned here is a little nebulous,
-        // but we try to return the error that had the relevant field as the
-        // longest field. This way we hopefully match an error against what was
-        // most likely being written down without losing too much info.
-        let mut first_error = None::<DecodeError>;
-
-        for variant in 0..variants.len() {
-            let mut de = VariantVisitor {
-                de: self.sub_decoder(self.toml.clone(), ""),
-                variant: variant,
-            };
-
-            match visitor.visit(&mut de) {
-                Ok(value) => {
-                    self.toml = de.de.toml;
-                    return Ok(value);
-                }
-                Err(e) => {
-                    if let Some(ref first) = first_error {
-                        let my_len = e.field.as_ref().map(|s| s.len());
-                        let first_len = first.field.as_ref().map(|s| s.len());
-                        if my_len <= first_len {
-                            continue
-                        }
-                    }
-                    first_error = Some(e);
-                }
-            }
-        }
-
-        Err(first_error.unwrap_or_else(|| self.err(DecodeErrorKind::NoEnumVariants)))
-    }
-
-    // When #[derive(Deserialize)] encounters an unknown struct field it will
-    // call this method (somehow), and we want to preserve all unknown struct
-    // fields to return them upwards (to warn about unused keys), so we override
-    // that here to not tamper with our own internal state.
-    fn deserialize_ignored_any<V>(&mut self, visitor: V)
-                                  -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        use serde::de::value::ValueDeserializer;
-        let mut d = <() as ValueDeserializer<Self::Error>>::into_deserializer(());
-        d.deserialize(visitor)
-    }
-
-    fn deserialize_bytes<V>(&mut self, visitor: V)
-                            -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_seq(visitor)
-    }
-
-    fn deserialize_seq_fixed_size<V>(&mut self, _len: usize, visitor: V)
-                                     -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_seq(visitor)
-    }
-
-    fn deserialize_newtype_struct<V>(&mut self, _name: &'static str, visitor: V)
-                                     -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_seq(visitor)
-    }
-
-    fn deserialize_tuple_struct<V>(&mut self,
-                                   _name: &'static str,
-                                   _len: usize,
-                                   visitor: V)
-                                   -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_seq(visitor)
-    }
-
-    fn deserialize_struct<V>(&mut self,
-                             _name: &'static str,
-                             _fields: &'static [&'static str],
-                             visitor: V)
-                             -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_map(visitor)
-    }
-
-    fn deserialize_tuple<V>(&mut self,
-                            _len: usize,
-                            visitor: V)
-                            -> Result<V::Value, Self::Error>
-        where V: de::Visitor
-    {
-        self.deserialize_seq(visitor)
-    }
-
-    forward_to_deserialize!{
-        deserialize_unit();
-        deserialize_unit_struct(name: &'static str);
-        deserialize_struct_field();
-    }
-}
-
-struct VariantVisitor {
-    de: Decoder,
-    variant: usize,
-}
-
-impl de::VariantVisitor for VariantVisitor {
-    type Error = DecodeError;
-
-    fn visit_variant<V>(&mut self) -> Result<V, DecodeError>
-        where V: de::Deserialize
-    {
-        use serde::de::value::ValueDeserializer;
-
-        let mut de = self.variant.into_deserializer();
-
-        de::Deserialize::deserialize(&mut de)
-    }
-
-    fn visit_unit(&mut self) -> Result<(), DecodeError> {
-        de::Deserialize::deserialize(&mut self.de)
-    }
-
-    fn visit_newtype<T>(&mut self) -> Result<T, DecodeError>
-        where T: de::Deserialize,
-    {
-        de::Deserialize::deserialize(&mut self.de)
-    }
-
-    fn visit_tuple<V>(&mut self,
-                      _len: usize,
-                      visitor: V) -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        de::Deserializer::deserialize(&mut self.de, visitor)
-    }
-
-    fn visit_struct<V>(&mut self,
-                       _fields: &'static [&'static str],
-                       visitor: V) -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        de::Deserializer::deserialize(&mut self.de, visitor)
-    }
-}
-
-struct SeqDeserializer<'a, I> {
-    iter: I,
-    len: usize,
-    toml: &'a mut Option<Value>,
-}
-
-impl<'a, I> SeqDeserializer<'a, I> where I: Iterator<Item=Value> {
-    fn new(iter: I, len: usize, toml: &'a mut Option<Value>) -> Self {
-        SeqDeserializer {
-            iter: iter,
-            len: len,
-            toml: toml,
-        }
-    }
-
-    fn put_value_back(&mut self, v: Value) {
-        *self.toml = self.toml.take().or(Some(Value::Array(Vec::new())));
-        match self.toml.as_mut().unwrap() {
-            &mut Value::Array(ref mut a) => {
-                a.push(v);
-            },
-            _ => unreachable!(),
-        }
-    }
-}
-
-impl<'a, I> de::Deserializer for SeqDeserializer<'a, I>
-    where I: Iterator<Item=Value>,
-{
-    type Error = DecodeError;
-
-    fn deserialize<V>(&mut self, mut visitor: V)
-                      -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        visitor.visit_seq(self)
-    }
-
-    forward_to_deserialize!{
-        deserialize_bool();
-        deserialize_usize();
-        deserialize_u8();
-        deserialize_u16();
-        deserialize_u32();
-        deserialize_u64();
-        deserialize_isize();
-        deserialize_i8();
-        deserialize_i16();
-        deserialize_i32();
-        deserialize_i64();
-        deserialize_f32();
-        deserialize_f64();
-        deserialize_char();
-        deserialize_str();
-        deserialize_string();
-        deserialize_unit();
-        deserialize_option();
-        deserialize_seq();
-        deserialize_seq_fixed_size(len: usize);
-        deserialize_bytes();
-        deserialize_map();
-        deserialize_unit_struct(name: &'static str);
-        deserialize_newtype_struct(name: &'static str);
-        deserialize_tuple_struct(name: &'static str, len: usize);
-        deserialize_struct(name: &'static str, fields: &'static [&'static str]);
-        deserialize_struct_field();
-        deserialize_tuple(len: usize);
-        deserialize_enum(name: &'static str, variants: &'static [&'static str]);
-        deserialize_ignored_any();
-    }
-}
-
-impl<'a, I> de::SeqVisitor for SeqDeserializer<'a, I>
-    where I: Iterator<Item=Value>
-{
-    type Error = DecodeError;
-
-    fn visit<V>(&mut self) -> Result<Option<V>, DecodeError>
-        where V: de::Deserialize
-    {
-        match self.iter.next() {
-            Some(value) => {
-                self.len -= 1;
-                let mut de = Decoder::new(value);
-                let v = try!(de::Deserialize::deserialize(&mut de));
-                if let Some(t) = de.toml {
-                    self.put_value_back(t);
-                }
-                Ok(Some(v))
-            }
-            None => Ok(None),
-        }
-    }
-
-    fn end(&mut self) -> Result<(), DecodeError> {
-        if self.len == 0 {
-            Ok(())
-        } else {
-            Err(de::Error::end_of_stream())
-        }
-    }
-
-    fn size_hint(&self) -> (usize, Option<usize>) {
-        (self.len, Some(self.len))
-    }
-}
-
-impl de::Error for DecodeError {
-    fn custom<T: Into<String>>(msg: T) -> DecodeError {
-        DecodeError {
-            field: None,
-            kind: DecodeErrorKind::CustomError(msg.into()),
-        }
-    }
-    fn end_of_stream() -> DecodeError {
-        DecodeError { field: None, kind: DecodeErrorKind::EndOfStream }
-    }
-    fn missing_field(name: &'static str) -> DecodeError {
-        DecodeError {
-            field: Some(name.to_string()),
-            kind: DecodeErrorKind::ExpectedField(None),
-        }
-    }
-    fn unknown_field(name: &str) -> DecodeError {
-        DecodeError {
-            field: Some(name.to_string()),
-            kind: DecodeErrorKind::UnknownField,
-        }
-    }
-    fn invalid_type(ty: de::Type) -> Self {
-        DecodeError {
-            field: None,
-            kind: DecodeErrorKind::InvalidType(match ty {
-                de::Type::Bool => "bool",
-                de::Type::Usize |
-                de::Type::U8 |
-                de::Type::U16 |
-                de::Type::U32 |
-                de::Type::U64 |
-                de::Type::Isize |
-                de::Type::I8 |
-                de::Type::I16 |
-                de::Type::I32 |
-                de::Type::I64 => "integer",
-                de::Type::F32 |
-                de::Type::F64 => "float",
-                de::Type::Char |
-                de::Type::Str |
-                de::Type::String => "string",
-                de::Type::Seq => "array",
-                de::Type::Struct |
-                de::Type::Map => "table",
-                de::Type::Unit => "Unit",
-                de::Type::Option => "Option",
-                de::Type::UnitStruct => "UnitStruct",
-                de::Type::NewtypeStruct => "NewtypeStruct",
-                de::Type::TupleStruct => "TupleStruct",
-                de::Type::FieldName => "FieldName",
-                de::Type::Tuple => "Tuple",
-                de::Type::Enum => "Enum",
-                de::Type::VariantName => "VariantName",
-                de::Type::StructVariant => "StructVariant",
-                de::Type::TupleVariant => "TupleVariant",
-                de::Type::UnitVariant => "UnitVariant",
-                de::Type::Bytes => "Bytes",
-            })
-        }
-    }
-}
-
-struct MapVisitor<'a, I> {
-    iter: I,
-    de: &'a mut Decoder,
-    key: Option<String>,
-    value: Option<Value>,
-}
-
-impl<'a, I> MapVisitor<'a, I> {
-    fn put_value_back(&mut self, v: Value) {
-        self.de.toml = self.de.toml.take().or_else(|| {
-            Some(Value::Table(BTreeMap::new()))
-        });
-
-        match self.de.toml.as_mut().unwrap() {
-            &mut Value::Table(ref mut t) => {
-                t.insert(self.key.take().unwrap(), v);
-            },
-            _ => unreachable!(),
-        }
-    }
-}
-
-impl<'a, I> de::MapVisitor for MapVisitor<'a, I>
-    where I: Iterator<Item=(String, Value)>
-{
-    type Error = DecodeError;
-
-    fn visit_key<K>(&mut self) -> Result<Option<K>, DecodeError>
-        where K: de::Deserialize
-    {
-        while let Some((k, v)) = self.iter.next() {
-            let mut dec = self.de.sub_decoder(Some(Value::String(k.clone())), &k);
-            self.key = Some(k);
-
-            match de::Deserialize::deserialize(&mut dec) {
-                Ok(val) => {
-                    self.value = Some(v);
-                    return Ok(Some(val))
-                }
-
-                // If this was an unknown field, then we put the toml value
-                // back into the map and keep going.
-                Err(DecodeError {kind: DecodeErrorKind::UnknownField, ..}) => {
-                    self.put_value_back(v);
-                }
-
-                Err(e) => return Err(e),
-            }
-        }
-        Ok(None)
-    }
-
-    fn visit_value<V>(&mut self) -> Result<V, DecodeError>
-        where V: de::Deserialize
-    {
-        match self.value.take() {
-            Some(t) => {
-                let mut dec = {
-                    // Borrowing the key here because Rust doesn't have
-                    // non-lexical borrows yet.
-                    let key = match self.key {
-                        Some(ref key) => &**key,
-                        None => ""
-                    };
-
-                    self.de.sub_decoder(Some(t), key)
-                };
-                let v = try!(de::Deserialize::deserialize(&mut dec));
-                if let Some(t) = dec.toml {
-                    self.put_value_back(t);
-                }
-                Ok(v)
-            },
-            None => Err(de::Error::end_of_stream())
-        }
-    }
-
-    fn end(&mut self) -> Result<(), DecodeError> {
-        if let Some(v) = self.value.take() {
-            self.put_value_back(v);
-        }
-        while let Some((k, v)) = self.iter.next() {
-            self.key = Some(k);
-            self.put_value_back(v);
-        }
-        Ok(())
-    }
-
-    fn missing_field<V>(&mut self, field_name: &'static str)
-                        -> Result<V, DecodeError> where V: de::Deserialize {
-        // See if the type can deserialize from a unit.
-        match de::Deserialize::deserialize(&mut UnitDeserializer) {
-            Err(DecodeError {
-                kind: DecodeErrorKind::InvalidType(..),
-                field,
-            }) => Err(DecodeError {
-                field: field.or(Some(field_name.to_string())),
-                kind: DecodeErrorKind::ExpectedField(None),
-            }),
-            v => v,
-        }
-    }
-}
-
-struct UnitDeserializer;
-
-impl de::Deserializer for UnitDeserializer {
-    type Error = DecodeError;
-
-    fn deserialize<V>(&mut self, mut visitor: V)
-                      -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        visitor.visit_unit()
-    }
-
-    fn deserialize_option<V>(&mut self, mut visitor: V)
-                             -> Result<V::Value, DecodeError>
-        where V: de::Visitor,
-    {
-        visitor.visit_none()
-    }
-
-    forward_to_deserialize!{
-        deserialize_bool();
-        deserialize_usize();
-        deserialize_u8();
-        deserialize_u16();
-        deserialize_u32();
-        deserialize_u64();
-        deserialize_isize();
-        deserialize_i8();
-        deserialize_i16();
-        deserialize_i32();
-        deserialize_i64();
-        deserialize_f32();
-        deserialize_f64();
-        deserialize_char();
-        deserialize_str();
-        deserialize_string();
-        deserialize_unit();
-        deserialize_seq();
-        deserialize_seq_fixed_size(len: usize);
-        deserialize_bytes();
-        deserialize_map();
-        deserialize_unit_struct(name: &'static str);
-        deserialize_newtype_struct(name: &'static str);
-        deserialize_tuple_struct(name: &'static str, len: usize);
-        deserialize_struct(name: &'static str, fields: &'static [&'static str]);
-        deserialize_struct_field();
-        deserialize_tuple(len: usize);
-        deserialize_enum(name: &'static str, variants: &'static [&'static str]);
-        deserialize_ignored_any();
-    }
-}
-
-impl de::Deserialize for Value {
-    fn deserialize<D>(deserializer: &mut D) -> Result<Value, D::Error>
-        where D: de::Deserializer
-    {
-        struct ValueVisitor;
-
-        impl de::Visitor for ValueVisitor {
-            type Value = Value;
-
-            fn visit_bool<E>(&mut self, value: bool) -> Result<Value, E> {
-                Ok(Value::Boolean(value))
-            }
-
-            fn visit_i64<E>(&mut self, value: i64) -> Result<Value, E> {
-                Ok(Value::Integer(value))
-            }
-
-            fn visit_f64<E>(&mut self, value: f64) -> Result<Value, E> {
-                Ok(Value::Float(value))
-            }
-
-            fn visit_str<E>(&mut self, value: &str) -> Result<Value, E> {
-                Ok(Value::String(value.into()))
-            }
-
-            fn visit_string<E>(&mut self, value: String) -> Result<Value, E> {
-                Ok(Value::String(value))
-            }
-
-            fn visit_seq<V>(&mut self, visitor: V) -> Result<Value, V::Error>
-                where V: de::SeqVisitor
-            {
-                let values = try!(de::impls::VecVisitor::new().visit_seq(visitor));
-                Ok(Value::Array(values))
-            }
-
-            fn visit_map<V>(&mut self, visitor: V) -> Result<Value, V::Error>
-                where V: de::MapVisitor
-            {
-                let mut v = de::impls::BTreeMapVisitor::new();
-                let values = try!(v.visit_map(visitor));
-                Ok(Value::Table(values))
-            }
-        }
-
-        deserializer.deserialize(ValueVisitor)
-    }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/display.rs
+++ /dev/null
@@ -1,209 +0,0 @@
-use std::fmt;
-
-use Table as TomlTable;
-use Value::{self, String, Integer, Float, Boolean, Datetime, Array, Table};
-
-struct Printer<'a, 'b:'a> {
-    output: &'a mut fmt::Formatter<'b>,
-    stack: Vec<&'a str>,
-}
-
-struct Key<'a>(&'a [&'a str]);
-
-impl fmt::Display for Value {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match *self {
-            String(ref s) => write_str(f, s),
-            Integer(i) => write!(f, "{}", i),
-            Float(fp) => {
-                try!(write!(f, "{}", fp));
-                if fp % 1.0 == 0.0 { try!(write!(f, ".0")) }
-                Ok(())
-            }
-            Boolean(b) => write!(f, "{}", b),
-            Datetime(ref s) => write!(f, "{}", s),
-            Table(ref t) => {
-                let mut p = Printer { output: f, stack: Vec::new() };
-                p.print(t)
-            }
-            Array(ref a) => {
-                try!(write!(f, "["));
-                for (i, v) in a.iter().enumerate() {
-                    if i != 0 { try!(write!(f, ", ")); }
-                    try!(write!(f, "{}", v));
-                }
-                write!(f, "]")
-            }
-        }
-    }
-}
-
-fn write_str(f: &mut fmt::Formatter, s: &str) -> fmt::Result {
-    try!(write!(f, "\""));
-    for ch in s.chars() {
-        match ch {
-            '\u{8}' => try!(write!(f, "\\b")),
-            '\u{9}' => try!(write!(f, "\\t")),
-            '\u{a}' => try!(write!(f, "\\n")),
-            '\u{c}' => try!(write!(f, "\\f")),
-            '\u{d}' => try!(write!(f, "\\r")),
-            '\u{22}' => try!(write!(f, "\\\"")),
-            '\u{5c}' => try!(write!(f, "\\\\")),
-            ch => try!(write!(f, "{}", ch)),
-        }
-    }
-    write!(f, "\"")
-}
-
-impl<'a, 'b> Printer<'a, 'b> {
-    fn print(&mut self, table: &'a TomlTable) -> fmt::Result {
-        let mut space_out_first = false;
-        for (k, v) in table.iter() {
-            match *v {
-                Table(..) => continue,
-                Array(ref a) => {
-                    if let Some(&Table(..)) = a.first() {
-                        continue;
-                    }
-                }
-                _ => {}
-            }
-            space_out_first = true;
-            try!(writeln!(self.output, "{} = {}", Key(&[k]), v));
-        }
-        for (i, (k, v)) in table.iter().enumerate() {
-            match *v {
-                Table(ref inner) => {
-                    self.stack.push(k);
-                    if space_out_first || i != 0 {
-                        try!(write!(self.output, "\n"));
-                    }
-                    try!(writeln!(self.output, "[{}]", Key(&self.stack)));
-                    try!(self.print(inner));
-                    self.stack.pop();
-                }
-                Array(ref inner) => {
-                    match inner.first() {
-                        Some(&Table(..)) => {}
-                        _ => continue
-                    }
-                    self.stack.push(k);
-                    for (j, inner) in inner.iter().enumerate() {
-                        if space_out_first || i != 0 || j != 0 {
-                            try!(write!(self.output, "\n"));
-                        }
-                        try!(writeln!(self.output, "[[{}]]", Key(&self.stack)));
-                        match *inner {
-                            Table(ref inner) => try!(self.print(inner)),
-                            _ => panic!("non-heterogeneous toml array"),
-                        }
-                    }
-                    self.stack.pop();
-                }
-                _ => {},
-            }
-        }
-        Ok(())
-    }
-}
-
-impl<'a> fmt::Display for Key<'a> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        for (i, part) in self.0.iter().enumerate() {
-            if i != 0 { try!(write!(f, ".")); }
-            let ok = part.chars().all(|c| {
-                match c {
-                    'a' ... 'z' |
-                    'A' ... 'Z' |
-                    '0' ... '9' |
-                    '-' | '_' => true,
-                    _ => false,
-                }
-            });
-            if ok {
-                try!(write!(f, "{}", part));
-            } else {
-                try!(write_str(f, part));
-            }
-        }
-        Ok(())
-    }
-}
-
-#[cfg(test)]
-#[allow(warnings)]
-mod tests {
-    use Value;
-    use Value::{String, Integer, Float, Boolean, Datetime, Array, Table};
-    use std::collections::BTreeMap;
-
-    macro_rules! map( ($($k:expr => $v:expr),*) => ({
-        let mut _m = BTreeMap::new();
-        $(_m.insert($k.to_string(), $v);)*
-        _m
-    }) );
-
-    #[test]
-    fn simple_show() {
-        assert_eq!(String("foo".to_string()).to_string(),
-                   "\"foo\"");
-        assert_eq!(Integer(10).to_string(),
-                   "10");
-        assert_eq!(Float(10.0).to_string(),
-                   "10.0");
-        assert_eq!(Float(2.4).to_string(),
-                   "2.4");
-        assert_eq!(Boolean(true).to_string(),
-                   "true");
-        assert_eq!(Datetime("test".to_string()).to_string(),
-                   "test");
-        assert_eq!(Array(vec![]).to_string(),
-                   "[]");
-        assert_eq!(Array(vec![Integer(1), Integer(2)]).to_string(),
-                   "[1, 2]");
-    }
-
-    #[test]
-    fn table() {
-        assert_eq!(Table(map! { }).to_string(),
-                   "");
-        assert_eq!(Table(map! { "test" => Integer(2) }).to_string(),
-                   "test = 2\n");
-        assert_eq!(Table(map! {
-                        "test" => Integer(2),
-                        "test2" => Table(map! {
-                            "test" => String("wut".to_string())
-                        })
-                   }).to_string(),
-                   "test = 2\n\
-                    \n\
-                    [test2]\n\
-                    test = \"wut\"\n");
-        assert_eq!(Table(map! {
-                        "test" => Integer(2),
-                        "test2" => Table(map! {
-                            "test" => String("wut".to_string())
-                        })
-                   }).to_string(),
-                   "test = 2\n\
-                    \n\
-                    [test2]\n\
-                    test = \"wut\"\n");
-        assert_eq!(Table(map! {
-                        "test" => Integer(2),
-                        "test2" => Array(vec![Table(map! {
-                            "test" => String("wut".to_string())
-                        })])
-                   }).to_string(),
-                   "test = 2\n\
-                    \n\
-                    [[test2]]\n\
-                    test = \"wut\"\n");
-        assert_eq!(Table(map! {
-                        "foo.bar" => Integer(2),
-                        "foo\"bar" => Integer(2)
-                   }).to_string(),
-                   "\"foo\\\"bar\" = 2\n\
-                    \"foo.bar\" = 2\n");
-    }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/encoder/mod.rs
+++ /dev/null
@@ -1,203 +0,0 @@
-use std::collections::BTreeMap;
-use std::error;
-use std::fmt;
-use std::mem;
-
-use {Value, Table};
-
-#[cfg(feature = "rustc-serialize")] mod rustc_serialize;
-#[cfg(feature = "serde")] mod serde;
-
-/// A structure to transform Rust values into TOML values.
-///
-/// This encoder implements the serialization `Encoder` interface, allowing
-/// `Encodable` rust types to be fed into the encoder. The output of this
-/// encoder is a TOML `Table` structure. The resulting TOML can be stringified
-/// if necessary.
-///
-/// # Example
-///
-/// ```
-/// extern crate rustc_serialize;
-/// extern crate toml;
-///
-/// # fn main() {
-/// use toml::{Encoder, Value};
-/// use rustc_serialize::Encodable;
-///
-/// #[derive(RustcEncodable)]
-/// struct MyStruct { foo: isize, bar: String }
-/// let my_struct = MyStruct { foo: 4, bar: "hello!".to_string() };
-///
-/// let mut e = Encoder::new();
-/// my_struct.encode(&mut e).unwrap();
-///
-/// assert_eq!(e.toml.get(&"foo".to_string()), Some(&Value::Integer(4)))
-/// # }
-/// ```
-#[derive(Default, Debug)]
-pub struct Encoder {
-    /// Output TOML that is emitted. The current version of this encoder forces
-    /// the top-level representation of a structure to be a table.
-    ///
-    /// This field can be used to extract the return value after feeding a value
-    /// into this `Encoder`.
-    pub toml: Table,
-    state: State,
-}
-
-/// Enumeration of errors which can occur while encoding a rust value into a
-/// TOML value.
-#[allow(missing_copy_implementations)]
-#[derive(Debug)]
-pub enum Error {
-    /// Indication that a key was needed when a value was emitted, but no key
-    /// was previously emitted.
-    NeedsKey,
-    /// Indication that a key was emitted, but no value was emitted.
-    NoValue,
-    /// Indicates that a map key was attempted to be emitted at an invalid
-    /// location.
-    InvalidMapKeyLocation,
-    /// Indicates that a type other than a string was attempted to be used as a
-    /// map key type.
-    InvalidMapKeyType,
-    /// A custom error type was generated
-    Custom(String),
-}
-
-/// Internal state of the encoder when encoding transitions
-#[derive(Debug)]
-pub struct EncoderState {
-    inner: State,
-}
-
-#[derive(PartialEq, Debug)]
-enum State {
-    Start,
-    NextKey(String),
-    NextArray(Vec<Value>),
-    NextMapKey,
-}
-
-impl Default for State {
-    fn default() -> State { State::Start }
-}
-
-impl Encoder {
-    /// Constructs a new encoder which will emit to the given output stream.
-    pub fn new() -> Encoder {
-        Encoder { state: State::Start, toml: BTreeMap::new() }
-    }
-
-    fn emit_value(&mut self, v: Value) -> Result<(), Error> {
-        match mem::replace(&mut self.state, State::Start) {
-            State::NextKey(key) => { self.toml.insert(key, v); Ok(()) }
-            State::NextArray(mut vec) => {
-                // TODO: validate types
-                vec.push(v);
-                self.state = State::NextArray(vec);
-                Ok(())
-            }
-            State::NextMapKey => {
-                match v {
-                    Value::String(s) => { self.state = State::NextKey(s); Ok(()) }
-                    _ => Err(Error::InvalidMapKeyType)
-                }
-            }
-            _ => Err(Error::NeedsKey)
-        }
-    }
-
-    fn emit_none(&mut self) -> Result<(), Error> {
-        match mem::replace(&mut self.state, State::Start) {
-            State::Start => unreachable!(),
-            State::NextKey(_) => Ok(()),
-            State::NextArray(..) => panic!("how to encode None in an array?"),
-            State::NextMapKey => Err(Error::InvalidMapKeyLocation),
-        }
-    }
-
-    fn seq_begin(&mut self) -> Result<State, Error> {
-        Ok(mem::replace(&mut self.state, State::NextArray(Vec::new())))
-    }
-
-    fn seq_end(&mut self, old: State) -> Result<(), Error> {
-        match mem::replace(&mut self.state, old) {
-            State::NextArray(v) => self.emit_value(Value::Array(v)),
-            _ => unreachable!(),
-        }
-    }
-
-    fn table_key<F>(&mut self, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        match mem::replace(&mut self.state, State::NextMapKey) {
-            State::Start => {}
-            _ => return Err(Error::InvalidMapKeyLocation),
-        }
-        try!(f(self));
-        match self.state {
-            State::NextKey(_) => Ok(()),
-            _ => Err(Error::InvalidMapKeyLocation),
-        }
-    }
-}
-
-/// Encodes an encodable value into a TOML value.
-///
-/// This function expects the type given to represent a TOML table in some form.
-/// If encoding encounters an error, then this function will fail the task.
-#[cfg(feature = "rustc-serialize")]
-pub fn encode<T: ::rustc_serialize::Encodable>(t: &T) -> Value {
-    let mut e = Encoder::new();
-    t.encode(&mut e).unwrap();
-    Value::Table(e.toml)
-}
-
-/// Encodes an encodable value into a TOML value.
-///
-/// This function expects the type given to represent a TOML table in some form.
-/// If encoding encounters an error, then this function will fail the task.
-#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
-pub fn encode<T: ::serde::Serialize>(t: &T) -> Value {
-    let mut e = Encoder::new();
-    t.serialize(&mut e).unwrap();
-    Value::Table(e.toml)
-}
-
-/// Encodes an encodable value into a TOML string.
-///
-/// This function expects the type given to represent a TOML table in some form.
-/// If encoding encounters an error, then this function will fail the task.
-#[cfg(feature = "rustc-serialize")]
-pub fn encode_str<T: ::rustc_serialize::Encodable>(t: &T) -> String {
-    encode(t).to_string()
-}
-
-/// Encodes an encodable value into a TOML string.
-///
-/// This function expects the type given to represent a TOML table in some form.
-/// If encoding encounters an error, then this function will fail the task.
-#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
-pub fn encode_str<T: ::serde::Serialize>(t: &T) -> String {
-    encode(t).to_string()
-}
-
-impl fmt::Display for Error {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match *self {
-            Error::NeedsKey => write!(f, "need a key to encode"),
-            Error::NoValue => write!(f, "no value to emit for a previous key"),
-            Error::InvalidMapKeyLocation => write!(f, "a map cannot be emitted \
-                                                       at this location"),
-            Error::InvalidMapKeyType => write!(f, "only strings can be used as \
-                                                   key types"),
-            Error::Custom(ref s) => write!(f, "custom error: {}", s),
-        }
-    }
-}
-
-impl error::Error for Error {
-    fn description(&self) -> &str { "TOML encoding error" }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/encoder/rustc_serialize.rs
+++ /dev/null
@@ -1,748 +0,0 @@
-use std::mem;
-
-use rustc_serialize;
-use Value;
-use super::{Encoder, Error, State};
-use super::Error::*;
-
-impl Encoder {
-    fn table<F>(&mut self, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        match mem::replace(&mut self.state, State::Start) {
-            State::NextKey(key) => {
-                let mut nested = Encoder::new();
-                try!(f(&mut nested));
-                self.toml.insert(key, Value::Table(nested.toml));
-                Ok(())
-            }
-            State::NextArray(mut arr) => {
-                let mut nested = Encoder::new();
-                try!(f(&mut nested));
-                arr.push(Value::Table(nested.toml));
-                self.state = State::NextArray(arr);
-                Ok(())
-            }
-            State::Start => f(self),
-            State::NextMapKey => Err(Error::InvalidMapKeyLocation),
-        }
-    }
-
-    fn seq<F>(&mut self, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        let old = try!(self.seq_begin());
-        try!(f(self));
-        self.seq_end(old)
-    }
-}
-
-impl rustc_serialize::Encoder for Encoder {
-    type Error = Error;
-
-    fn emit_nil(&mut self) -> Result<(), Error> { Ok(()) }
-    fn emit_usize(&mut self, v: usize) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_u8(&mut self, v: u8) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_u16(&mut self, v: u16) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_u32(&mut self, v: u32) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_u64(&mut self, v: u64) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_isize(&mut self, v: isize) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_i8(&mut self, v: i8) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_i16(&mut self, v: i16) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_i32(&mut self, v: i32) -> Result<(), Error> {
-        self.emit_i64(v as i64)
-    }
-    fn emit_i64(&mut self, v: i64) -> Result<(), Error> {
-        self.emit_value(Value::Integer(v))
-    }
-    fn emit_bool(&mut self, v: bool) -> Result<(), Error> {
-        self.emit_value(Value::Boolean(v))
-    }
-    fn emit_f32(&mut self, v: f32) -> Result<(), Error> { self.emit_f64(v as f64) }
-    fn emit_f64(&mut self, v: f64) -> Result<(), Error> {
-        self.emit_value(Value::Float(v))
-    }
-    fn emit_char(&mut self, v: char) -> Result<(), Error> {
-        self.emit_str(&v.to_string())
-    }
-    fn emit_str(&mut self, v: &str) -> Result<(), Error> {
-        self.emit_value(Value::String(v.to_string()))
-    }
-    fn emit_enum<F>(&mut self, _name: &str, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_enum_variant<F>(&mut self, _v_name: &str, _v_id: usize,
-                            _len: usize, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_enum_variant_arg<F>(&mut self, _a_idx: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_enum_struct_variant<F>(&mut self, _v_name: &str, _v_id: usize,
-                                   _len: usize,
-                                   _f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        panic!()
-    }
-    fn emit_enum_struct_variant_field<F>(&mut self,
-                                         _f_name: &str,
-                                         _f_idx: usize,
-                                         _f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        panic!()
-    }
-    fn emit_struct<F>(&mut self, _name: &str, _len: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.table(f)
-    }
-    fn emit_struct_field<F>(&mut self, f_name: &str, _f_idx: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        let old = mem::replace(&mut self.state,
-                               State::NextKey(f_name.to_string()));
-        try!(f(self));
-        if self.state != State::Start {
-            return Err(NoValue)
-        }
-        self.state = old;
-        Ok(())
-    }
-    fn emit_tuple<F>(&mut self, len: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.emit_seq(len, f)
-    }
-    fn emit_tuple_arg<F>(&mut self, idx: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.emit_seq_elt(idx, f)
-    }
-    fn emit_tuple_struct<F>(&mut self, _name: &str, _len: usize, _f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        unimplemented!()
-    }
-    fn emit_tuple_struct_arg<F>(&mut self, _f_idx: usize, _f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        unimplemented!()
-    }
-    fn emit_option<F>(&mut self, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_option_none(&mut self) -> Result<(), Error> {
-        self.emit_none()
-    }
-    fn emit_option_some<F>(&mut self, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_seq<F>(&mut self, _len: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.seq(f)
-    }
-    fn emit_seq_elt<F>(&mut self, _idx: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-    fn emit_map<F>(&mut self, len: usize, f: F)
-        -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.emit_struct("foo", len, f)
-    }
-    fn emit_map_elt_key<F>(&mut self, _idx: usize, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        self.table_key(f)
-    }
-    fn emit_map_elt_val<F>(&mut self, _idx: usize, f: F) -> Result<(), Error>
-        where F: FnOnce(&mut Encoder) -> Result<(), Error>
-    {
-        f(self)
-    }
-}
-
-impl rustc_serialize::Encodable for Value {
-    fn encode<E>(&self, e: &mut E) -> Result<(), E::Error>
-        where E: rustc_serialize::Encoder
-    {
-        match *self {
-            Value::String(ref s) => e.emit_str(s),
-            Value::Integer(i) => e.emit_i64(i),
-            Value::Float(f) => e.emit_f64(f),
-            Value::Boolean(b) => e.emit_bool(b),
-            Value::Datetime(ref s) => e.emit_str(s),
-            Value::Array(ref a) => {
-                e.emit_seq(a.len(), |e| {
-                    for item in a {
-                        try!(item.encode(e));
-                    }
-                    Ok(())
-                })
-            }
-            Value::Table(ref t) => {
-                e.emit_map(t.len(), |e| {
-                    for (i, (key, value)) in t.iter().enumerate() {
-                        try!(e.emit_map_elt_key(i, |e| e.emit_str(key)));
-                        try!(e.emit_map_elt_val(i, |e| value.encode(e)));
-                    }
-                    Ok(())
-                })
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use std::collections::{BTreeMap, HashSet};
-    use rustc_serialize::{self, Encodable, Decodable};
-
-    use {Encoder, Decoder, DecodeError};
-    use Value;
-    use Value::{Table, Integer, Array, Float};
-
-    macro_rules! encode( ($t:expr) => ({
-        let mut e = Encoder::new();
-        $t.encode(&mut e).unwrap();
-        e.toml
-    }) );
-
-    macro_rules! decode( ($t:expr) => ({
-        let mut d = Decoder::new($t);
-        Decodable::decode(&mut d).unwrap()
-    }) );
-
-    macro_rules! map( ($($k:ident, $v:expr),*) => ({
-        let mut _m = BTreeMap::new();
-        $(_m.insert(stringify!($k).to_string(), $v);)*
-        _m
-    }) );
-
-    #[test]
-    fn smoke() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: isize }
-
-        let v = Foo { a: 2 };
-        assert_eq!(encode!(v), map! { a, Integer(2) });
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn smoke_hyphen() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a_b: isize }
-
-        let v = Foo { a_b: 2 };
-        assert_eq!(encode!(v), map! { a_b, Integer(2) });
-        assert_eq!(v, decode!(Table(encode!(v))));
-
-        let mut m = BTreeMap::new();
-        m.insert("a-b".to_string(), Integer(2));
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn nested() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: isize, b: Bar }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: String }
-
-        let v = Foo { a: 2, b: Bar { a: "test".to_string() } };
-        assert_eq!(encode!(v),
-                   map! {
-                       a, Integer(2),
-                       b, Table(map! {
-                           a, Value::String("test".to_string())
-                       })
-                   });
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn application_decode_error() {
-        #[derive(PartialEq, Debug)]
-        struct Range10(usize);
-        impl Decodable for Range10 {
-             fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<Range10, D::Error> {
-                 let x: usize = try!(Decodable::decode(d));
-                 if x > 10 {
-                     Err(d.error("Value out of range!"))
-                 } else {
-                     Ok(Range10(x))
-                 }
-             }
-        }
-        let mut d_good = Decoder::new(Integer(5));
-        let mut d_bad1 = Decoder::new(Value::String("not an isize".to_string()));
-        let mut d_bad2 = Decoder::new(Integer(11));
-
-        assert_eq!(Ok(Range10(5)), Decodable::decode(&mut d_good));
-
-        let err1: Result<Range10, _> = Decodable::decode(&mut d_bad1);
-        assert!(err1.is_err());
-        let err2: Result<Range10, _> = Decodable::decode(&mut d_bad2);
-        assert!(err2.is_err());
-    }
-
-    #[test]
-    fn array() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Vec<isize> }
-
-        let v = Foo { a: vec![1, 2, 3, 4] };
-        assert_eq!(encode!(v),
-                   map! {
-                       a, Array(vec![
-                            Integer(1),
-                            Integer(2),
-                            Integer(3),
-                            Integer(4)
-                       ])
-                   });
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn tuple() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: (isize, isize, isize, isize) }
-
-        let v = Foo { a: (1, 2, 3, 4) };
-        assert_eq!(encode!(v),
-                   map! {
-                       a, Array(vec![
-                            Integer(1),
-                            Integer(2),
-                            Integer(3),
-                            Integer(4)
-                       ])
-                   });
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn inner_structs_with_options() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo {
-            a: Option<Box<Foo>>,
-            b: Bar,
-        }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar {
-            a: String,
-            b: f64,
-        }
-
-        let v = Foo {
-            a: Some(Box::new(Foo {
-                a: None,
-                b: Bar { a: "foo".to_string(), b: 4.5 },
-            })),
-            b: Bar { a: "bar".to_string(), b: 1.0 },
-        };
-        assert_eq!(encode!(v),
-                   map! {
-                       a, Table(map! {
-                           b, Table(map! {
-                               a, Value::String("foo".to_string()),
-                               b, Float(4.5)
-                           })
-                       }),
-                       b, Table(map! {
-                           a, Value::String("bar".to_string()),
-                           b, Float(1.0)
-                       })
-                   });
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn hashmap() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo {
-            map: BTreeMap<String, isize>,
-            set: HashSet<char>,
-        }
-
-        let v = Foo {
-            map: {
-                let mut m = BTreeMap::new();
-                m.insert("foo".to_string(), 10);
-                m.insert("bar".to_string(), 4);
-                m
-            },
-            set: {
-                let mut s = HashSet::new();
-                s.insert('a');
-                s
-            },
-        };
-        assert_eq!(encode!(v),
-            map! {
-                map, Table(map! {
-                    foo, Integer(10),
-                    bar, Integer(4)
-                }),
-                set, Array(vec![Value::String("a".to_string())])
-            }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn tuple_struct() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo(isize, String, f64);
-
-        let v = Foo(1, "foo".to_string(), 4.5);
-        assert_eq!(
-            encode!(v),
-            map! {
-                _field0, Integer(1),
-                _field1, Value::String("foo".to_string()),
-                _field2, Float(4.5)
-            }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn table_array() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Vec<Bar>, }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: isize }
-
-        let v = Foo { a: vec![Bar { a: 1 }, Bar { a: 2 }] };
-        assert_eq!(
-            encode!(v),
-            map! {
-                a, Array(vec![
-                    Table(map!{ a, Integer(1) }),
-                    Table(map!{ a, Integer(2) }),
-                ])
-            }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn type_errors() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { bar: isize }
-
-        let mut d = Decoder::new(Table(map! {
-            bar, Float(1.0)
-        }));
-        let a: Result<Foo, DecodeError> = Decodable::decode(&mut d);
-        match a {
-            Ok(..) => panic!("should not have decoded"),
-            Err(e) => {
-                assert_eq!(e.to_string(),
-                           "expected a value of type `integer`, but \
-                            found a value of type `float` for the key `bar`");
-            }
-        }
-    }
-
-    #[test]
-    fn missing_errors() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { bar: isize }
-
-        let mut d = Decoder::new(Table(map! {
-        }));
-        let a: Result<Foo, DecodeError> = Decodable::decode(&mut d);
-        match a {
-            Ok(..) => panic!("should not have decoded"),
-            Err(e) => {
-                assert_eq!(e.to_string(),
-                           "expected a value of type `integer` for the key `bar`");
-            }
-        }
-    }
-
-    #[test]
-    fn parse_enum() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: E }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        enum E {
-            Bar(isize),
-            Baz(f64),
-            Last(Foo2),
-        }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo2 {
-            test: String,
-        }
-
-        let v = Foo { a: E::Bar(10) };
-        assert_eq!(
-            encode!(v),
-            map! { a, Integer(10) }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-
-        let v = Foo { a: E::Baz(10.2) };
-        assert_eq!(
-            encode!(v),
-            map! { a, Float(10.2) }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-
-        let v = Foo { a: E::Last(Foo2 { test: "test".to_string() }) };
-        assert_eq!(
-            encode!(v),
-            map! { a, Table(map! { test, Value::String("test".to_string()) }) }
-        );
-        assert_eq!(v, decode!(Table(encode!(v))));
-    }
-
-    #[test]
-    fn unused_fields() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: isize }
-
-        let v = Foo { a: 2 };
-        let mut d = Decoder::new(Table(map! {
-            a, Integer(2),
-            b, Integer(5)
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, Some(Table(map! {
-            b, Integer(5)
-        })));
-    }
-
-    #[test]
-    fn unused_fields2() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Bar }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: isize }
-
-        let v = Foo { a: Bar { a: 2 } };
-        let mut d = Decoder::new(Table(map! {
-            a, Table(map! {
-                a, Integer(2),
-                b, Integer(5)
-            })
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, Some(Table(map! {
-            a, Table(map! {
-                b, Integer(5)
-            })
-        })));
-    }
-
-    #[test]
-    fn unused_fields3() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Bar }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: isize }
-
-        let v = Foo { a: Bar { a: 2 } };
-        let mut d = Decoder::new(Table(map! {
-            a, Table(map! {
-                a, Integer(2)
-            })
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, None);
-    }
-
-    #[test]
-    fn unused_fields4() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: BTreeMap<String, String> }
-
-        let v = Foo { a: map! { a, "foo".to_string() } };
-        let mut d = Decoder::new(Table(map! {
-            a, Table(map! {
-                a, Value::String("foo".to_string())
-            })
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, None);
-    }
-
-    #[test]
-    fn unused_fields5() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Vec<String> }
-
-        let v = Foo { a: vec!["a".to_string()] };
-        let mut d = Decoder::new(Table(map! {
-            a, Array(vec![Value::String("a".to_string())])
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, None);
-    }
-
-    #[test]
-    fn unused_fields6() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Option<Vec<String>> }
-
-        let v = Foo { a: Some(vec![]) };
-        let mut d = Decoder::new(Table(map! {
-            a, Array(vec![])
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, None);
-    }
-
-    #[test]
-    fn unused_fields7() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Vec<Bar> }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: isize }
-
-        let v = Foo { a: vec![Bar { a: 1 }] };
-        let mut d = Decoder::new(Table(map! {
-            a, Array(vec![Table(map! {
-                a, Integer(1),
-                b, Integer(2)
-            })])
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, Some(Table(map! {
-            a, Array(vec![Table(map! {
-                b, Integer(2)
-            })])
-        })));
-    }
-
-    #[test]
-    fn unused_fields8() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: BTreeMap<String, Bar> }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar { a: isize }
-
-        let v = Foo { a: map! { a, Bar { a: 2 } } };
-        let mut d = Decoder::new(Table(map! {
-            a, Table(map! {
-                a, Table(map! {
-                    a, Integer(2),
-                    b, Integer(2)
-                })
-            })
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        assert_eq!(d.toml, Some(Table(map! {
-            a, Table(map! {
-                a, Table(map! {
-                    b, Integer(2)
-                })
-            })
-        })));
-    }
-
-    #[test]
-    fn empty_arrays() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Vec<Bar> }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar;
-
-        let v = Foo { a: vec![] };
-        let mut d = Decoder::new(Table(map! {}));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-    }
-
-    #[test]
-    fn empty_arrays2() {
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Foo { a: Option<Vec<Bar>> }
-        #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)]
-        struct Bar;
-
-        let v = Foo { a: None };
-        let mut d = Decoder::new(Table(map! {}));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-
-        let v = Foo { a: Some(vec![]) };
-        let mut d = Decoder::new(Table(map! {
-            a, Array(vec![])
-        }));
-        assert_eq!(v, Decodable::decode(&mut d).unwrap());
-    }
-
-    #[test]
-    fn round_trip() {
-        let toml = r#"
-              [test]
-              foo = "bar"
-
-              [[values]]
-              foo = "baz"
-
-              [[values]]
-              foo = "qux"
-        "#;
-
-        let value: Value = toml.parse().unwrap();
-        let val2 = ::encode_str(&value).parse().unwrap();
-        assert_eq!(value, val2);
-    }
-}
deleted file mode 100644
--- a/third_party/rust/toml/src/encoder/serde.rs
+++ /dev/null
@@ -1,339 +0,0 @@
-use std::mem;
-
-use serde::ser;
-use Value;
-use super::{Encoder, Error, EncoderState, State};
-
-impl Encoder {
-    fn table_begin(&mut self) -> Result<Self, Error> {
-        match self.state {
-            State::NextMapKey => Err(Error::InvalidMapKeyLocation),
-            _ => Ok(mem::replace(self, Encoder::new()))
-        }
-    }
-
-    fn table_end(&mut self, mut state: Self) -> Result<(), Error> {
-        match state.state {
-            State::NextKey(key) => {
-                mem::swap(&mut self.toml, &mut state.toml);
-                self.toml.insert(key, Value::Table(state.toml));
-            },
-            State::NextArray(mut arr) => {
-                mem::swap(&mut self.toml, &mut state.toml);
-                arr.push(Value::Table(state.toml));
-                self.state = State::NextArray(arr);
-            },
-            State::Start => {},
-            State::NextMapKey => unreachable!(),
-        }
-        Ok(())
-    }
-}
-
-impl ser::Serializer for Encoder {
-    type Error = Error;
-    type MapState = Self;
-    type StructState = Self;
-    type StructVariantState = Self;
-    type SeqState = EncoderState;
-    type TupleState = EncoderState;
-    type TupleStructState = EncoderState;
-    type TupleVariantState = EncoderState;
-
-    fn serialize_bool(&mut self, v: bool) -> Result<(), Error> {
-        self.emit_value(Value::Boolean(v))
-    }
-
-    fn serialize_i64(&mut self, v: i64) -> Result<(), Error> {
-        self.emit_value(Value::Integer(v))
-    }
-
-    // TODO: checked casts
-
-    fn serialize_u64(&mut self, v: u64) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_isize(&mut self, v: isize) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_usize(&mut self, v: usize) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_i8(&mut self, v: i8) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_u8(&mut self, v: u8) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_i16(&mut self, v: i16) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_u16(&mut self, v: u16) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_i32(&mut self, v: i32) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_u32(&mut self, v: u32) -> Result<(), Error> {
-        self.serialize_i64(v as i64)
-    }
-
-    fn serialize_f32(&mut self, v: f32) -> Result<(), Error> {
-        self.serialize_f64(v as f64)
-    }
-
-    fn serialize_f64(&mut self, v: f64) -> Result<(), Error> {
-        self.emit_value(Value::Float(v))
-    }
-
-    fn serialize_str(&mut self, value: &str) -> Result<(), Error> {
-        self.emit_value(Value::String(value.to_string()))
-    }
-
-    fn serialize_unit_struct(&mut self, _name: &'static str) -> Result<(), Error> {
-        Ok(())
-    }
-
-    fn serialize_unit(&mut self) -> Result<(), Error> {
-        Ok(())
-    }
-
-    fn serialize_none(&mut self) -> Result<(), Error> {
-        self.emit_none()
-    }
-
-    fn serialize_char(&mut self, c: char) -> Result<(), Error> {
-        self.serialize_str(&c.to_string())
-    }
-
-    fn serialize_some<V>(&mut self, value: V) -> Result<(), Error>
-        where V: ser::Serialize
-    {
-        value.serialize(self)
-    }
-
-    fn serialize_bytes(&mut self, v: &[u8]) -> Result<(), Error> {
-        let mut state = try!(self.serialize_seq(Some(v.len())));
-        for c in v {
-            try!(self.serialize_seq_elt(&mut state, c));
-        }
-        self.serialize_seq_end(state)
-    }
-
-    fn serialize_seq_fixed_size(&mut self, len: usize)
-                                -> Result<EncoderState, Error> {
-        self.serialize_seq(Some(len))
-    }
-
-    fn serialize_seq(&mut self, _len: Option<usize>)
-                     -> Result<EncoderState, Error> {
-        self.seq_begin().map(|s| EncoderState { inner: s })
-    }
-
-    fn serialize_seq_elt<T>(&mut self,
-                            _state: &mut EncoderState,
-                            value: T) -> Result<(), Error>
-        where T: ser::Serialize
-    {
-        value.serialize(self)
-    }
-
-    fn serialize_seq_end(&mut self, state: EncoderState) -> Result<(), Error> {
-        self.seq_end(state.inner)
-    }
-
-    fn serialize_tuple(&mut self, len: usize)
-                       -> Result<EncoderState, Error> {
-        self.serialize_seq(Some(len))
-    }
-
-    fn serialize_tuple_elt<T>(&mut self,
-                              state: &mut EncoderState,
-                              value: T) -> Result<(), Error>
-        where T: ser::Serialize
-    {
-        self.serialize_seq_elt(state, value)
-    }
-
-    fn serialize_tuple_end(&mut self, state: EncoderState) -> Result<(), Error> {
-        self.serialize_seq_end(state)
-    }
-
-    fn serialize_tuple_struct(&mut self,
-                              _name: &'static str,
-                              len: usize) -> Result<EncoderState, Error> {
-        self.serialize_seq(Some(len))
-    }
-
-    fn serialize_tuple_struct_elt<T>(&mut self,
-                                     state: &mut EncoderState,
-                                     value: T) -> Result<(), Error>
-        where T: ser::Serialize
-    {
-        self.serialize_seq_elt(state, value)
-    }
-
-    fn serialize_tuple_struct_end(&mut self, state: EncoderState)
-                                  -> Result<(), Error> {
-        self.serialize_seq_end(state)
-    }
-
-    fn serialize_tuple_variant(&mut self,
-                               _name: &'static str,
-                               _id: usize,
-                               _variant: &'static str,
-                               len: usize) -> Result<EncoderState, Error> {
-        self.serialize_seq(Some(len))
-    }
-
-    fn serialize_tuple_variant_elt<T>(&mut self,
-                                      state: &mut EncoderState,
-                                      value: T) -> Result<(), Error>
-        where T: ser::Serialize
-    {
-        self.serialize_seq_elt(state, value)
-    }
-
-    fn serialize_tuple_variant_end(&mut self, state: EncoderState)
-                                   -> Result<(), Error> {
-        self.serialize_seq_end(state)
-    }
-
-    fn serialize_map(&mut self, _len: Option<usize>) -> Result<Self, Error> {
-        self.table_begin()
-    }
-
-    fn serialize_map_key<K>(&mut self,
-                            _state: &mut Encoder,
-                            key: K) -> Result<(), Error>
-        where K: ser::Serialize
-    {
-        self.table_key(|me| key.serialize(me))
-    }
-
-    fn serialize_map_value<V>(&mut self,
-                              _state: &mut Encoder,
-                              value: V) -> Result<(), Error>
-        where V: ser::Serialize
-    {
-        value.serialize(self)
-    }
-
-    fn serialize_map_end(&mut self, state: Self) -> Result<(), Error> {
-        self.table_end(state)
-    }
-
-    fn serialize_struct(&mut self,
-                        _name: &'static str,
-                        len: usize) -> Result<Self, Error> {
-        self.serialize_map(Some(len))
-    }
-
-    fn serialize_struct_elt<V>(&mut self,
-                               state: &mut Encoder,
-                               key: &'static str,
-                               value: V) -> Result<(), Error>
-        where V: ser::Serialize
-    {
-        try!(self.serialize_map_key(state, key));
-        self.serialize_map_value(state, value)
-    }
-
-    fn serialize_struct_end(&mut self, state: Self) -> Result<(), Error> {
-        self.serialize_map_end(state)
-    }
-
-    fn serialize_struct_variant(&mut self,
-                                _name: &'static str,
-                                _id: usize,
-                                _variant: &'static str,
-                                len: usize) -> Result<Self, Error> {
-        self.serialize_map(Some(len))
-    }
-
-    fn serialize_struct_variant_elt<V>(&mut self,
-                                       state: &mut Encoder,
-                                       key: &'static str,
-                                       value: V) -> Result<(), Error>
-        where V: ser::Serialize
-    {
-        try!(self.serialize_map_key(state, key));
-        self.serialize_map_value(state, value)
-    }
-
-    fn serialize_struct_variant_end(&mut self, state: Self) -> Result<(), Error> {
-        self.serialize_map_end(state)
-    }
-
-    fn serialize_newtype_struct<T>(&mut self,
-                                   _name: &'static str,
-                                   value: T) -> Result<(), Self::Error>
-        where T: ser::Serialize,
-    {
-        // Don't serialize the newtype struct in a tuple.
-        value.serialize(self)
-    }
-
-    fn serialize_newtype_variant<T>(&mut self,
-                                    _name: &'static str,
-                                    _variant_index: usize,
-                                    _variant: &'static str,
-                                    value: T) -> Result<(), Self::Error>
-        where T: ser::Serialize,
-    {
-        // Don't serialize the newtype struct variant in a tuple.
-        value.serialize(self)
-    }
-
-    fn serialize_unit_variant(&mut self,
-                               _name: &'static str,
-                               _variant_index: usize,
-                               _variant: &'static str,
-                               ) -> Result<(), Self::Error>
-    {
-        Ok(())
-    }
-}
-
-impl ser::Serialize for Value {
-    fn serialize<E>(&self, e: &mut E) -> Result<(), E::Error>
-        where E: ser::Serializer
-    {
-        match *self {
-            Value::String(ref s) => e.serialize_str(s),
-            Value::Integer(i) => e.serialize_i64(i),
-            Value::Float(f) => e.serialize_f64(f),
-            Value::Boolean(b) => e.serialize_bool(b),
-            Value::Datetime(ref s) => e.serialize_str(s),
-            Value::Array(ref a) => {
-                let mut state = try!(e.serialize_seq(Some(a.len())));
-                for el in a.iter() {
-                    try!(e.serialize_seq_elt(&mut state, el));
-                }
-                e.serialize_seq_end(state)
-            }
-            Value::Table(ref t) => {
-                let mut state = try!(e.serialize_map(Some(t.len())));
-                for (k, v) in t.iter() {
-                    try!(e.serialize_map_key(&mut state, k));
-                    try!(e.serialize_map_value(&mut state, v));
-                }
-                e.serialize_map_end(state)
-            }
-        }
-    }
-}
-
-impl ser::Error for Error {
-    fn custom<T: Into<String>>(msg: T) -> Error {
-        Error::Custom(msg.into())
-    }
-}
--- a/third_party/rust/toml/src/lib.rs
+++ b/third_party/rust/toml/src/lib.rs
@@ -1,492 +1,168 @@
-//! A TOML-parsing library
+//! A [TOML]-parsing library
+//!
+//! This library implements a [TOML] v0.4.0 compatible parser,
+//! primarily supporting the [`serde`] library for encoding/decoding
+//! various types in Rust.
+//!
+//! TOML itself is a simple, ergonomic, and readable configuration format:
 //!
-//! This library is an implementation in Rust of a parser for TOML configuration
-//! files [1]. It is focused around high quality errors including specific spans
-//! and detailed error messages when things go wrong.
+//! ```toml
+//! [package]
+//! name = "toml"
+//! version = "0.4.2"
+//! authors = ["Alex Crichton <alex@alexcrichton.com>"]
 //!
-//! This implementation currently passes the language agnostic [test suite][2].
+//! [dependencies]
+//! serde = "1.0"
+//! ```
+//!
+//! The TOML format tends to be relatively common throughout the Rust community
+//! for configuration, notably being used by [Cargo], Rust's package manager.
+//!
+//! ## TOML values
+//!
+//! A value in TOML is represented with the `Value` enum in this crate:
 //!
-//! # Example
-//!
+//! ```rust,ignore
+//! pub enum Value {
+//!     String(String),
+//!     Integer(i64),
+//!     Float(f64),
+//!     Boolean(bool),
+//!     Datetime(Datetime),
+//!     Array(Array),
+//!     Table(Table),
+//! }
 //! ```
-//! let toml = r#"
-//!     [test]
-//!     foo = "bar"
-//! "#;
+//!
+//! TOML is similar to JSON with the notable addition of a `Datetime`
+//! type. In general, TOML and JSON are interchangeable in terms of
+//! formats.
+//!
+//! ## Parsing TOML
 //!
-//! let value = toml::Parser::new(toml).parse().unwrap();
-//! println!("{:?}", value);
+//! The easiest way to parse a TOML document is via the `Value` type:
+//!
+//! ```rust
+//! use toml::Value;
+//!
+//! let value = "foo = 'bar'".parse::<Value>().unwrap();
+//!
+//! assert_eq!(value["foo"].as_str(), Some("bar"));
 //! ```
 //!
-//! # Conversions
+//! The `Value` type implements a number of convenience methods and
+//! traits; the example above uses `FromStr` to parse a `str` into a
+//! `Value`.
+//!
+//! ## Deserialization and Serialization
+//!
+//! This crate supports [`serde`] 1.0 with a number of
+//! implementations of the `Deserialize`, `Serialize`, `Deserializer`, and
+//! `Serializer` traits. Namely, you'll find:
 //!
-//! This library also supports using the standard `Encodable` and `Decodable`
-//! traits with TOML values. This library provides the following conversion
-//! capabilities:
+//! * `Deserialize for Value`
+//! * `Serialize for Value`
+//! * `Deserialize for Datetime`
+//! * `Serialize for Datetime`
+//! * `Deserializer for de::Deserializer`
+//! * `Serializer for ser::Serializer`
+//! * `Deserializer for Value`
+//!
+//! This means that you can use Serde to deserialize/serialize the
+//! `Value` type as well as the `Datetime` type in this crate. You can also
+//! use the `Deserializer`, `Serializer`, or `Value` type itself to act as
+//! a deserializer/serializer for arbitrary types.
 //!
-//! * `String` => `toml::Value` - via `Parser`
-//! * `toml::Value` => `String` - via `Display`
-//! * `toml::Value` => rust object - via `Decoder`
-//! * rust object => `toml::Value` - via `Encoder`
+//! An example of deserializing with TOML is:
+//!
+//! ```rust
+//! #[macro_use]
+//! extern crate serde_derive;
+//! extern crate toml;
 //!
-//! Convenience functions for performing multiple conversions at a time are also
-//! provided.
+//! #[derive(Deserialize)]
+//! struct Config {
+//!     ip: String,
+//!     port: Option<u16>,
+//!     keys: Keys,
+//! }
+//!
+//! #[derive(Deserialize)]
+//! struct Keys {
+//!     github: String,
+//!     travis: Option<String>,
+//! }
+//!
+//! fn main() {
+//!     let config: Config = toml::from_str(r#"
+//!         ip = '127.0.0.1'
 //!
-//! [1]: https://github.com/mojombo/toml
-//! [2]: https://github.com/BurntSushi/toml-test
-
-#![doc(html_root_url = "http://alexcrichton.com/toml-rs")]
-#![deny(missing_docs)]
-#![cfg_attr(test, deny(warnings))]
-
-#[cfg(feature = "rustc-serialize")] extern crate rustc_serialize;
-#[cfg(feature = "serde")] extern crate serde;
-
-use std::collections::BTreeMap;
-use std::str::FromStr;
-
-pub use parser::{Parser, ParserError};
-
-#[cfg(any(feature = "rustc-serialize", feature = "serde"))]
-pub use self::encoder::{Encoder, Error, EncoderState, encode, encode_str};
-#[cfg(any(feature = "rustc-serialize", feature = "serde"))]
-pub use self::decoder::{Decoder, DecodeError, DecodeErrorKind, decode, decode_str};
-
-mod parser;
-mod display;
-#[cfg(any(feature = "rustc-serialize", feature = "serde"))]
-mod encoder;
-#[cfg(any(feature = "rustc-serialize", feature = "serde"))]
-mod decoder;
-
-/// Representation of a TOML value.
-#[derive(PartialEq, Clone, Debug)]
-#[allow(missing_docs)]
-pub enum Value {
-    String(String),
-    Integer(i64),
-    Float(f64),
-    Boolean(bool),
-    Datetime(String),
-    Array(Array),
-    Table(Table),
-}
-
-/// Type representing a TOML array, payload of the `Value::Array` variant
-pub type Array = Vec<Value>;
-
-/// Type representing a TOML table, payload of the `Value::Table` variant
-pub type Table = BTreeMap<String, Value>;
-
-impl Value {
-    /// Tests whether this and another value have the same type.
-    pub fn same_type(&self, other: &Value) -> bool {
-        match (self, other) {
-            (&Value::String(..), &Value::String(..)) |
-            (&Value::Integer(..), &Value::Integer(..)) |
-            (&Value::Float(..), &Value::Float(..)) |
-            (&Value::Boolean(..), &Value::Boolean(..)) |
-            (&Value::Datetime(..), &Value::Datetime(..)) |
-            (&Value::Array(..), &Value::Array(..)) |
-            (&Value::Table(..), &Value::Table(..)) => true,
-
-            _ => false,
-        }
-    }
-
-    /// Returns a human-readable representation of the type of this value.
-    pub fn type_str(&self) -> &'static str {
-        match *self {
-            Value::String(..) => "string",
-            Value::Integer(..) => "integer",
-            Value::Float(..) => "float",
-            Value::Boolean(..) => "boolean",
-            Value::Datetime(..) => "datetime",
-            Value::Array(..) => "array",
-            Value::Table(..) => "table",
-        }
-    }
-
-    /// Extracts the string of this value if it is a string.
-    pub fn as_str(&self) -> Option<&str> {
-        match *self { Value::String(ref s) => Some(&**s), _ => None }
-    }
-
-    /// Extracts the integer value if it is an integer.
-    pub fn as_integer(&self) -> Option<i64> {
-        match *self { Value::Integer(i) => Some(i), _ => None }
-    }
-
-    /// Extracts the float value if it is a float.
-    pub fn as_float(&self) -> Option<f64> {
-        match *self { Value::Float(f) => Some(f), _ => None }
-    }
-
-    /// Extracts the boolean value if it is a boolean.
-    pub fn as_bool(&self) -> Option<bool> {
-        match *self { Value::Boolean(b) => Some(b), _ => None }
-    }
-
-    /// Extracts the datetime value if it is a datetime.
-    ///
-    /// Note that a parsed TOML value will only contain ISO 8601 dates. An
-    /// example date is:
-    ///
-    /// ```notrust
-    /// 1979-05-27T07:32:00Z
-    /// ```
-    pub fn as_datetime(&self) -> Option<&str> {
-        match *self { Value::Datetime(ref s) => Some(&**s), _ => None }
-    }
-
-    /// Extracts the array value if it is an array.
-    pub fn as_slice(&self) -> Option<&[Value]> {
-        match *self { Value::Array(ref s) => Some(&**s), _ => None }
-    }
-
-    /// Extracts the table value if it is a table.
-    pub fn as_table(&self) -> Option<&Table> {
-        match *self { Value::Table(ref s) => Some(s), _ => None }
-    }
-
-    /// Lookups for value at specified path.
-    ///
-    /// Uses '.' as a path separator.
-    ///
-    /// Note: arrays have zero-based indexes.
-    ///
-    /// Note: empty path returns self.
-    ///
-    /// ```
-    /// # #![allow(unstable)]
-    /// let toml = r#"
-    ///      [test]
-    ///      foo = "bar"
-    ///
-    ///      [[values]]
-    ///      foo = "baz"
-    ///
-    ///      [[values]]
-    ///      foo = "qux"
-    /// "#;
-    /// let value: toml::Value = toml.parse().unwrap();
-    ///
-    /// let foo = value.lookup("test.foo").unwrap();
-    /// assert_eq!(foo.as_str().unwrap(), "bar");
-    ///
-    /// let foo = value.lookup("values.1.foo").unwrap();
-    /// assert_eq!(foo.as_str().unwrap(), "qux");
-    ///
-    /// let no_bar = value.lookup("test.bar");
-    /// assert_eq!(no_bar.is_none(), true);
-    /// ```
-    pub fn lookup(&self, path: &str) -> Option<&Value> {
-        let ref path = match Parser::new(path).lookup() {
-            Some(path) => path,
-            None => return None,
-        };
-        let mut cur_value = self;
-        if path.is_empty() {
-            return Some(cur_value)
-        }
-
-        for key in path {
-            match *cur_value {
-                Value::Table(ref hm) => {
-                    match hm.get(key) {
-                        Some(v) => cur_value = v,
-                        None => return None
-                    }
-                },
-                Value::Array(ref v) => {
-                    match key.parse::<usize>().ok() {
-                        Some(idx) if idx < v.len() => cur_value = &v[idx],
-                        _ => return None
-                    }
-                },
-                _ => return None
-            }
-        };
-
-        Some(cur_value)
-
-    }
-    /// Lookups for mutable value at specified path.
-    ///
-    /// Uses '.' as a path separator.
-    ///
-    /// Note: arrays have zero-based indexes.
-    ///
-    /// Note: empty path returns self.
-    ///
-    /// ```
-    /// # #![allow(unstable)]
-    /// let toml = r#"
-    ///      [test]
-    ///      foo = "bar"
-    ///
-    ///      [[values]]
-    ///      foo = "baz"
-    ///
-    ///      [[values]]
-    ///      foo = "qux"
-    /// "#;
-    /// let mut value: toml::Value = toml.parse().unwrap();
-    /// {
-    ///    let string = value.lookup_mut("test.foo").unwrap();
-    ///    assert_eq!(string, &mut toml::Value::String(String::from("bar")));
-    ///    *string = toml::Value::String(String::from("foo"));
-    /// }
-    /// let result = value.lookup_mut("test.foo").unwrap();
-    /// assert_eq!(result.as_str().unwrap(), "foo");
-    /// ```
-    pub fn lookup_mut(&mut self, path: &str) -> Option<&mut Value> {
-       let ref path = match Parser::new(path).lookup() {
-            Some(path) => path,
-            None => return None,
-        };
-
-        let mut cur = self;
-        if path.is_empty() {
-            return Some(cur)
-        }
+//!         [keys]
+//!         github = 'xxxxxxxxxxxxxxxxx'
+//!         travis = 'yyyyyyyyyyyyyyyyy'
+//!     "#).unwrap();
+//!
+//!     assert_eq!(config.ip, "127.0.0.1");
+//!     assert_eq!(config.port, None);
+//!     assert_eq!(config.keys.github, "xxxxxxxxxxxxxxxxx");
+//!     assert_eq!(config.keys.travis.as_ref().unwrap(), "yyyyyyyyyyyyyyyyy");
+//! }
+//! ```
+//!
+//! You can serialize types in a similar fashion:
+//!
+//! ```rust
+//! #[macro_use]
+//! extern crate serde_derive;
+//! extern crate toml;
+//!
+//! #[derive(Serialize)]
+//! struct Config {
+//!     ip: String,
+//!     port: Option<u16>,
+//!     keys: Keys,
+//! }
+//!
+//! #[derive(Serialize)]
+//! struct Keys {
+//!     github: String,
+//!     travis: Option<String>,
+//! }
+//!
+//! fn main() {
+//!     let config = Config {
+//!         ip: "127.0.0.1".to_string(),
+//!         port: None,
+//!         keys: Keys {
+//!             github: "xxxxxxxxxxxxxxxxx".to_string(),
+//!             travis: Some("yyyyyyyyyyyyyyyyy".to_string()),
+//!         },
+//!     };
+//!
+//!     let toml = toml::to_string(&config).unwrap();
+//! }
+//! ```
+//!
+//! [TOML]: https://github.com/toml-lang/toml
+//! [Cargo]: https://crates.io/
+//! [`serde`]: https://serde.rs/
 
-        for key in path {
-            let tmp = cur;
-            match *tmp {
-                Value::Table(ref mut hm) => {
-                    match hm.get_mut(key) {
-                        Some(v) => cur = v,
-                        None => return None
-                    }
-                }
-                Value::Array(ref mut v) => {
-                    match key.parse::<usize>().ok() {
-                        Some(idx) if idx < v.len() => cur = &mut v[idx],
-                        _ => return None
-                    }
-                }
-                _ => return None
-           }
-        }
-        Some(cur)
-    }
-}
-
-impl FromStr for Value {
-    type Err = Vec<ParserError>;
-    fn from_str(s: &str) -> Result<Value, Vec<ParserError>> {
-        let mut p = Parser::new(s);
-        match p.parse().map(Value::Table) {
-            Some(n) => Ok(n),
-            None => Err(p.errors),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::Value;
-
-    #[test]
-    fn lookup_mut_change() {
-        let toml = r#"
-              [test]
-              foo = "bar"
-
-              [[values]]
-              foo = "baz"
-
-              [[values]]
-              foo = "qux"
-        "#;
+#![doc(html_root_url = "https://docs.rs/toml/0.4")]
+#![deny(missing_docs)]
 
-        let mut value: Value = toml.parse().unwrap();
-        {
-          let foo = value.lookup_mut("values.0.foo").unwrap();
-          *foo = Value::String(String::from("bar"));
-        }
-        let foo = value.lookup("values.0.foo").unwrap();
-        assert_eq!(foo.as_str().unwrap(), "bar");
-    }
-
-    #[test]
-    fn lookup_mut_valid() {
-        let toml = r#"
-              [test]
-              foo = "bar"
-
-              [[values]]
-              foo = "baz"
-
-              [[values]]
-              foo = "qux"
-        "#;
-
-        let mut value: Value = toml.parse().unwrap();
-
-        {
-            let test_foo = value.lookup_mut("test.foo").unwrap();
-            assert_eq!(test_foo.as_str().unwrap(), "bar");
-        }
-
-        {
-            let foo1 = value.lookup_mut("values.1.foo").unwrap();
-            assert_eq!(foo1.as_str().unwrap(), "qux");
-        }
-
-        assert!(value.lookup_mut("test.bar").is_none());
-        assert!(value.lookup_mut("test.foo.bar").is_none());
-    }
-
-    #[test]
-    fn lookup_mut_invalid_index() {
-        let toml = r#"
-            [[values]]
-            foo = "baz"
-        "#;
-
-        let mut value: Value = toml.parse().unwrap();
-
-        {
-            let foo = value.lookup_mut("test.foo");
-            assert!(foo.is_none());
-        }
-
-        {
-            let foo = value.lookup_mut("values.100.foo");
-            assert!(foo.is_none());
-        }
-
-        {
-            let foo = value.lookup_mut("values.str.foo");
-            assert!(foo.is_none());
-        }
-    }
-
-    #[test]
-    fn lookup_mut_self() {
-        let mut value: Value = r#"foo = "bar""#.parse().unwrap();
+#[macro_use]
+extern crate serde;
 
-        {
-            let foo = value.lookup_mut("foo").unwrap();
-            assert_eq!(foo.as_str().unwrap(), "bar");
-        }
-
-        let foo = value.lookup_mut("").unwrap();
-        assert!(foo.as_table().is_some());
-
-        let baz = foo.lookup_mut("foo").unwrap();
-        assert_eq!(baz.as_str().unwrap(), "bar");
-    }
-
-    #[test]
-    fn lookup_valid() {
-        let toml = r#"
-              [test]
-              foo = "bar"
-
-              [[values]]
-              foo = "baz"
-
-              [[values]]
-              foo = "qux"
-        "#;
-
-        let value: Value = toml.parse().unwrap();
-
-        let test_foo = value.lookup("test.foo").unwrap();
-        assert_eq!(test_foo.as_str().unwrap(), "bar");
-
-        let foo1 = value.lookup("values.1.foo").unwrap();
-        assert_eq!(foo1.as_str().unwrap(), "qux");
-
-        assert!(value.lookup("test.bar").is_none());
-        assert!(value.lookup("test.foo.bar").is_none());
-    }
-
-    #[test]
-    fn lookup_invalid_index() {
-        let toml = r#"
-            [[values]]
-            foo = "baz"
-        "#;
-
-        let value: Value = toml.parse().unwrap();
-
-        let foo = value.lookup("test.foo");
-        assert!(foo.is_none());
-
-        let foo = value.lookup("values.100.foo");
-        assert!(foo.is_none());
-
-        let foo = value.lookup("values.str.foo");
-        assert!(foo.is_none());
-    }
-
-    #[test]
-    fn lookup_self() {
-        let value: Value = r#"foo = "bar""#.parse().unwrap();
+pub mod value;
+#[doc(no_inline)]
+pub use value::Value;
+mod datetime;
 
-        let foo = value.lookup("foo").unwrap();
-        assert_eq!(foo.as_str().unwrap(), "bar");
-
-        let foo = value.lookup("").unwrap();
-        assert!(foo.as_table().is_some());
-
-        let baz = foo.lookup("foo").unwrap();
-        assert_eq!(baz.as_str().unwrap(), "bar");
-    }
-
-    #[test]
-    fn lookup_advanced() {
-        let value: Value = "[table]\n\"value\" = 0".parse().unwrap();
-        let looked = value.lookup("table.\"value\"").unwrap();
-        assert_eq!(*looked, Value::Integer(0));
-    }
-
-    #[test]
-    fn lookup_advanced_table() {
-        let value: Value = "[table.\"name.other\"]\nvalue = \"my value\"".parse().unwrap();
-        let looked = value.lookup(r#"table."name.other".value"#).unwrap();
-        assert_eq!(*looked, Value::String(String::from("my value")));
-    }
-
-    #[test]
-    fn lookup_mut_advanced() {
-        let mut value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        let looked = value.lookup_mut("table.\"value\".1").unwrap();
-        assert_eq!(*looked, Value::Integer(1));
-    }
-
-    #[test]
-    fn single_dot() {
-        let value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        assert_eq!(None, value.lookup("."));
-    }
-
-    #[test]
-    fn array_dot() {
-        let value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        assert_eq!(None, value.lookup("0."));
-    }
-
-    #[test]
-    fn dot_inside() {
-        let value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        assert_eq!(None, value.lookup("table.\"value.0\""));
-    }
-
-    #[test]
-    fn table_with_quotes() {
-        let value: Value = "[table.\"element\"]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        assert_eq!(None, value.lookup("\"table.element\".\"value\".0"));
-    }
-
-    #[test]
-    fn table_with_quotes_2() {
-        let value: Value = "[table.\"element\"]\n\"value\" = [0, 1, 2]".parse().unwrap();
-        assert_eq!(Value::Integer(0), *value.lookup("table.\"element\".\"value\".0").unwrap());
-    }
-
-}
+pub mod ser;
+#[doc(no_inline)]
+pub use ser::{to_string, to_string_pretty, to_vec, Serializer};
+pub mod de;
+#[doc(no_inline)]
+pub use de::{from_slice, from_str, Deserializer};
+mod tokens;
deleted file mode 100644
--- a/third_party/rust/toml/src/parser.rs
+++ /dev/null
@@ -1,1627 +0,0 @@
-use std::char;
-use std::collections::btree_map::{BTreeMap, Entry};
-use std::error::Error;
-use std::fmt;
-use std::str;
-
-macro_rules! try {
-    ($e:expr) => (match $e { Some(s) => s, None => return None })
-}
-
-// We redefine Value because we need to keep track of encountered table
-// definitions, eg when parsing:
-//
-//      [a]
-//      [a.b]
-//      [a]
-//
-// we have to error out on redefinition of [a]. This bit of data is difficult to
-// track in a side table so we just have a "stripped down" AST to work with
-// which has the relevant metadata fields in it.
-struct TomlTable {
-    values: BTreeMap<String, Value>,
-    defined: bool,
-}
-
-impl TomlTable {
-    fn convert(self) -> super::Table {
-        self.values.into_iter().map(|(k,v)| (k, v.convert())).collect()
-    }
-}
-
-enum Value {
-    String(String),
-    Integer(i64),
-    Float(f64),
-    Boolean(bool),
-    Datetime(String),
-    Array(Vec<Value>),
-    Table(TomlTable),
-}
-
-impl Value {
-    fn type_str(&self) -> &'static str {
-        match *self {
-            Value::String(..) => "string",
-            Value::Integer(..) => "integer",
-            Value::Float(..) => "float",
-            Value::Boolean(..) => "boolean",
-            Value::Datetime(..) => "datetime",
-            Value::Array(..) => "array",
-            Value::Table(..) => "table",
-        }
-    }
-
-    fn same_type(&self, other: &Value) -> bool {
-        match (self, other) {
-            (&Value::String(..), &Value::String(..)) |
-            (&Value::Integer(..), &Value::Integer(..)) |
-            (&Value::Float(..), &Value::Float(..)) |
-            (&Value::Boolean(..), &Value::Boolean(..)) |
-            (&Value::Datetime(..), &Value::Datetime(..)) |
-            (&Value::Array(..), &Value::Array(..)) |
-            (&Value::Table(..), &Value::Table(..)) => true,
-
-            _ => false,
-        }
-    }
-
-    fn convert(self) -> super::Value {
-        match self {
-            Value::String(x) => super::Value::String(x),
-            Value::Integer(x) => super::Value::Integer(x),
-            Value::Float(x) => super::Value::Float(x),
-            Value::Boolean(x) => super::Value::Boolean(x),
-            Value::Datetime(x) => super::Value::Datetime(x),
-            Value::Array(v) =>
-                super::Value::Array(
-                    v.into_iter().map(|x| x.convert()).collect()
-                ),
-            Value::Table(t) => super::Value::Table(t.convert())
-        }
-    }
-}
-
-/// Parser for converting a string to a TOML `Value` instance.
-///
-/// This parser contains the string slice that is being parsed, and exports the
-/// list of errors which have occurred during parsing.
-pub struct Parser<'a> {
-    input: &'a str,
-    cur: str::CharIndices<'a>,
-    require_newline_after_table: bool,
-
-    /// A list of all errors which have occurred during parsing.
-    ///
-    /// Not all parse errors are fatal, so this list is added to as much as
-    /// possible without aborting parsing. If `None` is returned by `parse`, it
-    /// is guaranteed that this list is not empty.
-    pub errors: Vec<ParserError>,
-}
-
-/// A structure representing a parse error.
-///
-/// The data in this structure can be used to trace back to the original cause
-/// of the error in order to provide diagnostics about parse errors.
-#[derive(Debug, Clone)]
-pub struct ParserError {
-    /// The low byte at which this error is pointing at.
-    pub lo: usize,
-    /// One byte beyond the last character at which this error is pointing at.
-    pub hi: usize,
-    /// A human-readable description explaining what the error is.
-    pub desc: String,
-}
-
-impl<'a> Parser<'a> {
-    /// Creates a new parser for a string.
-    ///
-    /// The parser can be executed by invoking the `parse` method.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// let toml = r#"
-    ///     [test]
-    ///     foo = "bar"
-    /// "#;
-    ///
-    /// let mut parser = toml::Parser::new(toml);
-    /// match parser.parse() {
-    ///     Some(value) => println!("found toml: {:?}", value),
-    ///     None => {
-    ///         println!("parse errors: {:?}", parser.errors);
-    ///     }
-    /// }
-    /// ```
-    pub fn new(s: &'a str) -> Parser<'a> {
-        Parser {
-            input: s,
-            cur: s.char_indices(),
-            errors: Vec::new(),
-            require_newline_after_table: true,
-        }
-    }
-
-    /// Converts a byte offset from an error message to a (line, column) pair
-    ///
-    /// All indexes are 0-based.
-    pub fn to_linecol(&self, offset: usize) -> (usize, usize) {
-        let mut cur = 0;
-        for (i, line) in self.input.lines().enumerate() {
-            if cur + line.len() + 1 > offset {
-                return (i, offset - cur)
-            }
-            cur += line.len() + 1;
-        }
-        (self.input.lines().count(), 0)
-    }
-
-    /// Historical versions of toml-rs accidentally allowed a newline after a
-    /// table definition, but the TOML spec requires a newline after a table
-    /// definition header.
-    ///
-    /// This option can be set to `false` (the default is `true`) to emulate
-    /// this behavior for backwards compatibility with older toml-rs versions.
-    pub fn set_require_newline_after_table(&mut self, require: bool) {
-        self.require_newline_after_table = require;
-    }
-
-    fn next_pos(&self) -> usize {
-        self.cur.clone().next().map(|p| p.0).unwrap_or(self.input.len())
-    }
-
-    // Returns true and consumes the next character if it matches `ch`,
-    // otherwise do nothing and return false
-    fn eat(&mut self, ch: char) -> bool {
-        match self.peek(0) {
-            Some((_, c)) if c == ch => { self.cur.next(); true }
-            Some(_) | None => false,
-        }
-    }
-
-    // Peeks ahead `n` characters
-    fn peek(&self, n: usize) -> Option<(usize, char)> {
-        self.cur.clone().skip(n).next()
-    }
-
-    fn expect(&mut self, ch: char) -> bool {
-        if self.eat(ch) { return true }
-        let mut it = self.cur.clone();
-        let lo = it.next().map(|p| p.0).unwrap_or(self.input.len());
-        let hi = it.next().map(|p| p.0).unwrap_or(self.input.len());
-        self.errors.push(ParserError {
-            lo: lo,
-            hi: hi,
-            desc: match self.cur.clone().next() {
-                Some((_, c)) => format!("expected `{}`, but found `{}`", ch, c),
-                None => format!("expected `{}`, but found eof", ch)
-            }
-        });
-        false
-    }
-
-    // Consumes a BOM (Byte Order Mark) if one is next
-    fn bom(&mut self) -> bool {
-        match self.peek(0) {
-            Some((_, '\u{feff}')) => { self.cur.next(); true }
-            _ => false
-        }
-    }
-
-    // Consumes whitespace ('\t' and ' ') until another character (or EOF) is
-    // reached. Returns if any whitespace was consumed
-    fn ws(&mut self) -> bool {
-        let mut ret = false;
-        loop {
-            match self.peek(0) {
-                Some((_, '\t')) |
-                Some((_, ' ')) => { self.cur.next(); ret = true; }
-                _ => break,
-            }
-        }
-        ret
-    }
-
-    // Consumes the rest of the line after a comment character
-    fn comment(&mut self) -> bool {
-        if !self.eat('#') { return false }
-        for (_, ch) in self.cur.by_ref() {
-            if ch == '\n' { break }
-        }
-        true
-    }
-
-    // Consumes a newline if one is next
-    fn newline(&mut self) -> bool {
-        match self.peek(0) {
-            Some((_, '\n')) => { self.cur.next(); true }
-            Some((_, '\r')) if self.peek(1).map(|c| c.1) == Some('\n') => {
-                self.cur.next(); self.cur.next(); true
-            }
-            _ => false
-        }
-    }
-
-    // Match EOF
-    fn eof(&self) -> bool {
-        self.peek(0).is_none()
-    }
-
-    /// Executes the parser, parsing the string contained within.
-    ///
-    /// This function will return the `TomlTable` instance if parsing is
-    /// successful, or it will return `None` if any parse error or invalid TOML
-    /// error occurs.
-    ///
-    /// If an error occurs, the `errors` field of this parser can be consulted
-    /// to determine the cause of the parse failure.
-    pub fn parse(&mut self) -> Option<super::Table> {
-        let mut ret = TomlTable { values: BTreeMap::new(), defined: false };
-        self.bom();
-        while self.peek(0).is_some() {
-            self.ws();
-            if self.newline() { continue }
-            if self.comment() { continue }
-            if self.eat('[') {
-                let array = self.eat('[');
-                let start = self.next_pos();
-
-                // Parse the name of the section
-                let mut keys = Vec::new();
-                loop {
-                    self.ws();
-                    if let Some(s) = self.key_name() {
-                        keys.push(s);
-                    }
-                    self.ws();
-                    if self.eat(']') {
-                        if array && !self.expect(']') { return None }
-                        break
-                    }
-                    if !self.expect('.') { return None }
-                }
-                if keys.is_empty() { return None }
-
-                // Build the section table
-                let mut table = TomlTable {
-                    values: BTreeMap::new(),
-                    defined: true,
-                };
-                if self.require_newline_after_table {
-                    self.ws();
-                    if !self.comment() && !self.newline() && !self.eof() {
-                        self.errors.push(ParserError {
-                            lo: start,
-                            hi: start,
-                            desc: "expected a newline after table definition".to_string(),
-                        });
-                        return None
-                    }
-                }
-                if !self.values(&mut table) { return None }
-                if array {
-                    self.insert_array(&mut ret, &keys, Value::Table(table),
-                                      start)
-                } else {
-                    self.insert_table(&mut ret, &keys, table, start)
-                }
-            } else if !self.values(&mut ret) {
-                return None
-            }
-        }
-        if !self.errors.is_empty() {
-            None
-        } else {
-            Some(ret.convert())
-        }
-    }
-
-    // Parse an array index as a natural number
-    fn array_index(&mut self) -> Option<String> {
-        self.integer(0, false, false)
-    }
-
-    /// Parse a path into a vector of paths
-    pub fn lookup(&mut self) -> Option<Vec<String>> {
-        if self.input.is_empty() {
-            return Some(vec![]);
-        }
-        let mut keys = Vec::new();
-        loop {
-            self.ws();
-            if let Some(s) = self.key_name() {
-                keys.push(s);
-            } else if let Some(s) = self.array_index() {
-                keys.push(s);
-            } else {
-                return None
-            }
-            self.ws();
-            if !self.expect('.') { return Some(keys) }
-        }
-    }
-
-    // Parse a single key name starting at `start`
-    fn key_name(&mut self) -> Option<String> {
-        let start = self.next_pos();
-        let key = if self.eat('"') {
-            self.finish_basic_string(start, false)
-        } else if self.eat('\'') {
-            self.finish_literal_string(start, false)
-        } else {
-            let mut ret = String::new();
-            while let Some((_, ch)) = self.cur.clone().next() {
-                match ch {
-                    'a' ... 'z' |
-                    'A' ... 'Z' |
-                    '0' ... '9' |
-                    '_' | '-' => { self.cur.next(); ret.push(ch) }
-                    _ => break,
-                }
-            }
-            Some(ret)
-        };
-        match key {
-            Some(ref name) if name.is_empty() => {
-                self.errors.push(ParserError {
-                    lo: start,
-                    hi: start,
-                    desc: "expected a key but found an empty string".to_string(),
-                });
-                None
-            }
-            Some(name) => Some(name),
-            None => None,
-        }
-    }
-
-    // Parses the values into the given TomlTable. Returns true in case of success
-    // and false in case of error.
-    fn values(&mut self, into: &mut TomlTable) -> bool {
-        loop {
-            self.ws();
-            if self.newline() { continue }
-            if self.comment() { continue }
-            match self.peek(0) {
-                Some((_, '[')) => break,
-                Some(..) => {}
-                None => break,
-            }
-            let key_lo = self.next_pos();
-            let key = match self.key_name() {
-                Some(s) => s,
-                None => return false
-            };
-            if !self.keyval_sep() { return false }
-            let value = match self.value() {
-                Some(value) => value,
-                None => return false,
-            };
-            let end = self.next_pos();
-            self.insert(into, key, value, key_lo);
-            self.ws();
-            if !self.comment() && !self.newline() {
-                if self.peek(0).is_none() {
-                    return true
-                }
-                self.errors.push(ParserError {
-                    lo: key_lo,
-                    hi: end,
-                    desc: "expected a newline after a key".to_string(),
-                });
-                return false
-            }
-        }
-        true
-    }
-
-    fn keyval_sep(&mut self) -> bool {
-        self.ws();
-        if !self.expect('=') { return false }
-        self.ws();
-        true
-    }
-
-    // Parses a value
-    fn value(&mut self) -> Option<Value> {
-        self.ws();
-        match self.cur.clone().next() {
-            Some((pos, '"')) => self.basic_string(pos),
-            Some((pos, '\'')) => self.literal_string(pos),
-            Some((pos, 't')) |
-            Some((pos, 'f')) => self.boolean(pos),
-            Some((pos, '[')) => self.array(pos),
-            Some((pos, '{')) => self.inline_table(pos),
-            Some((pos, '-')) |
-            Some((pos, '+')) => self.number_or_datetime(pos),
-            Some((pos, ch)) if is_digit(ch) => self.number_or_datetime(pos),
-            _ => {
-                let mut it = self.cur.clone();
-                let lo = it.next().map(|p| p.0).unwrap_or(self.input.len());
-                let hi = it.next().map(|p| p.0).unwrap_or(self.input.len());
-                self.errors.push(ParserError {
-                    lo: lo,
-                    hi: hi,
-                    desc: "expected a value".to_string(),
-                });
-                None
-            }
-        }
-    }
-
-    // Parses a single or multi-line string
-    fn basic_string(&mut self, start: usize) -> Option<Value> {
-        if !self.expect('"') { return None }
-        let mut multiline = false;
-
-        // detect multiline literals, but be careful about empty ""
-        // strings
-        if self.eat('"') {
-            if self.eat('"') {
-                multiline = true;
-                self.newline();
-            } else {
-                // empty
-                return Some(Value::String(String::new()))
-            }
-        }
-
-        self.finish_basic_string(start, multiline).map(Value::String)
-    }
-
-    // Finish parsing a basic string after the opening quote has been seen
-    fn finish_basic_string(&mut self,
-                           start: usize,
-                           multiline: bool) -> Option<String> {
-        let mut ret = String::new();
-        loop {
-            while multiline && self.newline() { ret.push('\n') }
-            match self.cur.next() {
-                Some((_, '"')) => {
-                    if multiline {
-                        if !self.eat('"') { ret.push_str("\""); continue }
-                        if !self.eat('"') { ret.push_str("\"\""); continue }
-                    }
-                    return Some(ret)
-                }
-                Some((pos, '\\')) => {
-                    if let Some(c) = escape(self, pos, multiline) {
-                        ret.push(c);
-                    }
-                }
-                Some((pos, ch)) if ch < '\u{1f}' => {
-                    self.errors.push(ParserError {
-                        lo: pos,
-                        hi: pos + 1,
-                        desc: format!("control character `{}` must be escaped",
-                                      ch.escape_default().collect::<String>())
-                    });
-                }
-                Some((_, ch)) => ret.push(ch),
-                None => {
-                    self.errors.push(ParserError {
-                        lo: start,
-                        hi: self.input.len(),
-                        desc: "unterminated string literal".to_string(),
-                    });
-                    return None
-                }
-            }
-        }
-
-        fn escape(me: &mut Parser, pos: usize, multiline: bool) -> Option<char> {
-            if multiline && me.newline() {
-                while me.ws() || me.newline() { /* ... */ }
-                return None
-            }
-            match me.cur.next() {
-                Some((_, 'b')) => Some('\u{8}'),
-                Some((_, 't')) => Some('\u{9}'),
-                Some((_, 'n')) => Some('\u{a}'),
-                Some((_, 'f')) => Some('\u{c}'),
-                Some((_, 'r')) => Some('\u{d}'),
-                Some((_, '"')) => Some('\u{22}'),
-                Some((_, '\\')) => Some('\u{5c}'),
-                Some((pos, c @ 'u')) |
-                Some((pos, c @ 'U')) => {
-                    let len = if c == 'u' {4} else {8};
-                    let num = &me.input[pos+1..];
-                    let num = if num.char_indices().nth(len).map(|(i, _)| i).unwrap_or(0) == len {
-                        &num[..len]
-                    } else {
-                        "invalid"
-                    };
-                    if let Some(n) = u32::from_str_radix(num, 16).ok() {
-                        if let Some(c) = char::from_u32(n) {
-                            me.cur.by_ref().skip(len - 1).next();
-                            return Some(c)
-                        } else {
-                            me.errors.push(ParserError {
-                                lo: pos + 1,
-                                hi: pos + 5,
-                                desc: format!("codepoint `{:x}` is \
-                                               not a valid unicode \
-                                               codepoint", n),
-                            })
-                        }
-                    } else {
-                        me.errors.push(ParserError {
-                            lo: pos,
-                            hi: pos + 1,
-                            desc: format!("expected {} hex digits \
-                                           after a `{}` escape", len, c),
-                        })
-                    }
-                    None
-                }
-                Some((pos, ch)) => {
-                    let next_pos = me.next_pos();
-                    me.errors.push(ParserError {
-                        lo: pos,
-                        hi: next_pos,
-                        desc: format!("unknown string escape: `{}`",
-                                      ch.escape_default().collect::<String>()),
-                    });
-                    None
-                }
-                None => {
-                    me.errors.push(ParserError {
-                        lo: pos,
-                        hi: pos + 1,
-                        desc: "unterminated escape sequence".to_string(),
-                    });
-                    None
-                }
-            }
-        }
-    }
-
-    fn literal_string(&mut self, start: usize) -> Option<Value> {
-        if !self.expect('\'') { return None }
-        let mut multiline = false;
-
-        // detect multiline literals
-        if self.eat('\'') {
-            if self.eat('\'') {
-                multiline = true;
-                self.newline();
-            } else {
-                return Some(Value::String(String::new())) // empty
-            }
-        }
-
-        self.finish_literal_string(start, multiline).map(Value::String)
-    }
-
-    fn finish_literal_string(&mut self, start: usize, multiline: bool)
-                             -> Option<String> {
-        let mut ret = String::new();
-        loop {
-            if !multiline && self.newline() {
-                let next = self.next_pos();
-                self.errors.push(ParserError {
-                    lo: start,
-                    hi: next,
-                    desc: "literal strings cannot contain newlines".to_string(),
-                });
-                return None
-            }
-            match self.cur.next() {
-                Some((_, '\'')) => {
-                    if multiline {
-                        if !self.eat('\'') { ret.push_str("'"); continue }
-                        if !self.eat('\'') { ret.push_str("''"); continue }
-                    }
-                    return Some(ret)
-                }
-                Some((_, ch)) => ret.push(ch),
-                None => {
-                    self.errors.push(ParserError {
-                        lo: start,
-                        hi: self.input.len(),
-                        desc: "unterminated string literal".to_string(),
-                    });
-                    return None
-                }
-            }
-        }
-    }
-
-    fn number_or_datetime(&mut self, start: usize) -> Option<Value> {
-        let mut is_float = false;
-        let prefix = try!(self.integer(start, false, true));
-        let decimal = if self.eat('.') {
-            is_float = true;
-            Some(try!(self.integer(start, true, false)))
-        } else {
-            None
-        };
-        let exponent = if self.eat('e') || self.eat('E') {
-            is_float = true;
-            Some(try!(self.integer(start, false, true)))
-        } else {
-            None
-        };
-        let end = self.next_pos();
-        let input = &self.input[start..end];
-        let ret = if decimal.is_none() &&
-                     exponent.is_none() &&
-                     !input.starts_with('+') &&
-                     !input.starts_with('-') &&
-                     start + 4 == end &&
-                     self.eat('-') {
-            self.datetime(start)
-        } else {
-            let input = match (decimal, exponent) {
-                (None, None) => prefix,
-                (Some(ref d), None) => prefix + "." + d,
-                (None, Some(ref e)) => prefix + "E" + e,
-                (Some(ref d), Some(ref e)) => prefix + "." + d + "E" + e,
-            };
-            let input = input.trim_left_matches('+');
-            if is_float {
-                input.parse().ok().map(Value::Float)
-            } else {
-                input.parse().ok().map(Value::Integer)
-            }
-        };
-        if ret.is_none() {
-            self.errors.push(ParserError {
-                lo: start,
-                hi: end,
-                desc: "invalid numeric literal".to_string(),
-            });
-        }
-        ret
-    }
-
-    fn integer(&mut self,
-               start: usize,
-               allow_leading_zeros: bool,
-               allow_sign: bool) -> Option<String> {
-        let mut s = String::new();
-        if allow_sign {
-            if self.eat('-') { s.push('-'); }
-            else if self.eat('+') { s.push('+'); }
-        }
-        match self.cur.next() {
-            Some((_, '0')) if !allow_leading_zeros => {
-                s.push('0');
-                match self.peek(0) {
-                    Some((pos, c)) if '0' <= c && c <= '9' => {
-                        self.errors.push(ParserError {
-                            lo: start,
-                            hi: pos,
-                            desc: "leading zeroes are not allowed".to_string(),
-                        });
-                        return None
-                    }
-                    _ => {}
-                }
-            }
-            Some((_, ch)) if '0' <= ch && ch <= '9' => {
-                s.push(ch);
-            }
-            _ => {
-                let pos = self.next_pos();
-                self.errors.push(ParserError {
-                    lo: pos,
-                    hi: pos,
-                    desc: "expected start of a numeric literal".to_string(),
-                });
-                return None;
-            }
-        }
-        let mut underscore = false;
-        loop {
-            match self.cur.clone().next() {
-                Some((_, ch)) if '0' <= ch && ch <= '9' => {
-                    s.push(ch);
-                    self.cur.next();
-                    underscore = false;
-                }
-                Some((_, '_')) if !underscore => {
-                    self.cur.next();
-                    underscore = true;
-                }
-                Some(_) | None => break,
-            }
-        }
-        if underscore {
-            let pos = self.next_pos();
-            self.errors.push(ParserError {
-                lo: pos,
-                hi: pos,
-                desc: "numeral cannot end with an underscore".to_string(),
-            });
-            None
-        } else {
-            Some(s)
-        }
-    }
-
-    fn boolean(&mut self, start: usize) -> Option<Value> {
-        let rest = &self.input[start..];
-        if rest.starts_with("true") {
-            for _ in 0..4 {
-                self.cur.next();
-            }
-            Some(Value::Boolean(true))
-        } else if rest.starts_with("false") {
-            for _ in 0..5 {
-                self.cur.next();
-            }
-            Some(Value::Boolean(false))
-        } else {
-            let next = self.next_pos();
-            self.errors.push(ParserError {
-                lo: start,
-                hi: next,
-                desc: format!("unexpected character: `{}`",
-                              rest.chars().next().unwrap()),
-            });
-            None
-        }
-    }
-
-    fn datetime(&mut self, start: usize) -> Option<Value> {
-        // Up to `start` already contains the year, and we've eaten the next
-        // `-`, so we just resume parsing from there.
-
-        let mut valid = true;
-
-        // month
-        valid = valid && digit(self.cur.next());
-        valid = valid && digit(self.cur.next());
-
-        // day
-        valid = valid && self.cur.next().map(|c| c.1) == Some('-');
-        valid = valid && digit(self.cur.next());
-        valid = valid && digit(self.cur.next());
-
-        valid = valid && self.cur.next().map(|c| c.1) == Some('T');
-
-        // hour
-        valid = valid && digit(self.cur.next());
-        valid = valid && digit(self.cur.next());
-
-        // minute
-        valid = valid && self.cur.next().map(|c| c.1) == Some(':');
-        valid = valid && digit(self.cur.next());
-        valid = valid && digit(self.cur.next());
-
-        // second
-        valid = valid && self.cur.next().map(|c| c.1) == Some(':');
-        valid = valid && digit(self.cur.next());
-        valid = valid && digit(self.cur.next());
-
-        // fractional seconds
-        if self.eat('.') {
-            valid = valid && digit(self.cur.next());
-            loop {
-                match self.cur.clone().next() {
-                    Some((_, c)) if is_digit(c) => {
-                        self.cur.next();
-                    }
-                    _ => break,
-                }
-            }
-        }
-
-        // time zone
-        if !self.eat('Z') {
-            valid = valid && (self.eat('+') || self.eat('-'));
-
-            // hour
-            valid = valid && digit(self.cur.next());
-            valid = valid && digit(self.cur.next());
-
-            // minute
-            valid = valid && self.cur.next().map(|c| c.1) == Some(':');
-            valid = valid && digit(self.cur.next());
-            valid = valid && digit(self.cur.next());
-        }
-
-        return if valid {
-            Some(Value::Datetime(self.input[start..self.next_pos()].to_string()))
-        } else {
-            let next = self.next_pos();
-            self.errors.push(ParserError {
-                lo: start,
-                hi: start + next,
-                desc: "malformed date literal".to_string(),
-            });
-            None
-        };
-
-        fn digit(val: Option<(usize, char)>) -> bool {
-            match val {
-                Some((_, c)) => is_digit(c),
-                None => false,
-            }
-        }
-    }
-
-    fn array(&mut self, _start: usize) -> Option<Value> {
-        if !self.expect('[') { return None }
-        let mut ret = Vec::new();
-        fn consume(me: &mut Parser) {
-            loop {
-                me.ws();
-                if !me.newline() && !me.comment() { break }
-            }
-        }
-        let mut type_str = None;
-        loop {
-            // Break out early if we see the closing bracket
-            consume(self);
-            if self.eat(']') { return Some(Value::Array(ret)) }
-
-            // Attempt to parse a value, triggering an error if it's the wrong
-            // type.
-            let start = self.next_pos();
-            let value = try!(self.value());
-            let end = self.next_pos();
-            let expected = type_str.unwrap_or(value.type_str());
-            if value.type_str() != expected {
-                self.errors.push(ParserError {
-                    lo: start,
-                    hi: end,
-                    desc: format!("expected type `{}`, found type `{}`",
-                                  expected, value.type_str()),
-                });
-            } else {
-                type_str = Some(expected);
-                ret.push(value);
-            }
-
-            // Look for a comma. If we don't find one we're done
-            consume(self);
-            if !self.eat(',') { break }
-        }
-        consume(self);
-        if !self.expect(']') { return None }
-        Some(Value::Array(ret))
-    }
-
-    fn inline_table(&mut self, _start: usize) -> Option<Value> {
-        if !self.expect('{') { return None }
-        self.ws();
-        let mut ret = TomlTable { values: BTreeMap::new(), defined: true };
-        if self.eat('}') { return Some(Value::Table(ret)) }
-        loop {
-            let lo = self.next_pos();
-            let key = try!(self.key_name());
-            if !self.keyval_sep() { return None }
-            let value = try!(self.value());
-            self.insert(&mut ret, key, value, lo);
-
-            self.ws();
-            if self.eat('}') { break }
-            if !self.expect(',') { return None }
-            self.ws();
-        }
-        Some(Value::Table(ret))
-    }
-
-    fn insert(&mut self, into: &mut TomlTable, key: String, value: Value,
-              key_lo: usize) {
-        if let Entry::Vacant(entry) = into.values.entry(key.clone()) {
-            entry.insert(value);
-        } else {
-            self.errors.push(ParserError {
-                lo: key_lo,
-                hi: key_lo + key.len(),
-                desc: format!("duplicate key: `{}`", key),
-            });
-        }
-    }
-
-    fn recurse<'b>(&mut self, mut cur: &'b mut TomlTable, keys: &'b [String],
-                   key_lo: usize) -> Option<(&'b mut TomlTable, &'b str)> {
-        let key_hi = keys.iter().fold(0, |a, b| a + b.len());
-        for part in keys[..keys.len() - 1].iter() {
-            let tmp = cur;
-
-            if tmp.values.contains_key(part) {
-                match *tmp.values.get_mut(part).unwrap() {
-                    Value::Table(ref mut table) => cur = table,
-                    Value::Array(ref mut array) => {
-                        match array.last_mut() {
-                            Some(&mut Value::Table(ref mut table)) => cur = table,
-                            _ => {
-                                self.errors.push(ParserError {
-                                    lo: key_lo,
-                                    hi: key_hi,
-                                    desc: format!("array `{}` does not contain \
-                                                   tables", part)
-                                });
-                                return None
-                            }
-                        }
-                    }
-                    _ => {
-                        self.errors.push(ParserError {
-                            lo: key_lo,
-                            hi: key_hi,
-                            desc: format!("key `{}` was not previously a table",
-                                          part)
-                        });
-                        return None
-                    }
-                }
-                continue
-            }
-
-            // Initialize an empty table as part of this sub-key
-            tmp.values.insert(part.clone(), Value::Table(TomlTable {
-                values: BTreeMap::new(),
-                defined: false,
-            }));
-            match *tmp.values.get_mut(part).unwrap() {
-                Value::Table(ref mut inner) => cur = inner,
-                _ => unreachable!(),
-            }
-        }
-        Some((cur, &**keys.last().unwrap()))
-    }
-
-    fn insert_table(&mut self, into: &mut TomlTable, keys: &[String],
-                    table: TomlTable, key_lo: usize) {
-        let (into, key) = match self.recurse(into, keys, key_lo) {
-            Some(pair) => pair,
-            None => return,
-        };
-        if !into.values.contains_key(key) {
-            into.values.insert(key.to_owned(), Value::Table(table));
-            return
-        }
-        if let Value::Table(ref mut into) = *into.values.get_mut(key).unwrap() {
-            if into.defined {
-                self.errors.push(ParserError {
-                    lo: key_lo,
-                    hi: key_lo + key.len(),
-                    desc: format!("redefinition of table `{}`", key),
-                });
-            }
-            for (k, v) in table.values {
-                if into.values.insert(k.clone(), v).is_some() {
-                    self.errors.push(ParserError {
-                        lo: key_lo,
-                        hi: key_lo + key.len(),
-                        desc: format!("duplicate key `{}` in table", k),
-                    });
-                }
-            }
-        } else {
-            self.errors.push(ParserError {
-                lo: key_lo,
-                hi: key_lo + key.len(),
-                desc: format!("duplicate key `{}` in table", key),
-            });
-        }
-    }
-
-    fn insert_array(&mut self, into: &mut TomlTable,
-                    keys: &[String], value: Value, key_lo: usize) {
-        let (into, key) = match self.recurse(into, keys, key_lo) {
-            Some(pair) => pair,
-            None => return,
-        };
-        if !into.values.contains_key(key) {
-            into.values.insert(key.to_owned(), Value::Array(Vec::new()));
-        }
-        match *into.values.get_mut(key).unwrap() {
-            Value::Array(ref mut vec) => {
-                match vec.first() {
-                    Some(ref v) if !v.same_type(&value) => {
-                        self.errors.push(ParserError {
-                            lo: key_lo,
-                            hi: key_lo + key.len(),
-                            desc: format!("expected type `{}`, found type `{}`",
-                                          v.type_str(), value.type_str()),
-                        })
-                    }
-                    Some(..) | None => {}
-                }
-                vec.push(value);
-            }
-            _ => {
-                self.errors.push(ParserError {
-                    lo: key_lo,
-                    hi: key_lo + key.len(),
-                    desc: format!("key `{}` was previously not an array", key),
-                });
-            }
-        }
-    }
-}
-
-impl Error for ParserError {
-    fn description(&self) -> &str { "TOML parse error" }
-}
-
-impl fmt::Display for ParserError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.desc.fmt(f)
-    }
-}
-
-fn is_digit(c: char) -> bool {
-    match c { '0' ... '9' => true, _ => false }
-}
-
-#[cfg(test)]
-mod tests {
-    use Value::Table;
-    use Parser;
-
-    macro_rules! bad {
-        ($s:expr, $msg:expr) => ({
-            let mut p = Parser::new($s);
-            assert!(p.parse().is_none());
-            assert!(p.errors.iter().any(|e| e.desc.contains($msg)),
-                    "errors: {:?}", p.errors);
-        })
-    }
-
-    #[test]
-    fn lookup_internal() {
-        let mut parser = Parser::new(r#"hello."world\t".a.0.'escaped'.value"#);
-        let result = vec![
-          String::from("hello"),
-          String::from("world\t"),
-          String::from("a"),
-          String::from("0"),
-          String::from("escaped"),
-          String::from("value")
-        ];
-
-        assert_eq!(parser.lookup().unwrap(), result);
-    }
-
-    #[test]
-    fn lookup_internal_void() {
-        let mut parser = Parser::new("");
-        assert_eq!(parser.lookup().unwrap(), Vec::<String>::new());
-    }
-
-    #[test]
-    fn lookup_internal_simple() {
-        let mut parser = Parser::new("value");
-        assert_eq!(parser.lookup().unwrap(), vec![String::from("value")]);
-    }
-
-    // This is due to key_name not parsing an empty "" correctly. Disabled for now.
-    #[test]
-    #[ignore]
-    fn lookup_internal_quoted_void() {
-        let mut parser = Parser::new("\"\"");
-        assert_eq!(parser.lookup().unwrap(), vec![String::from("")]);
-    }
-
-
-    #[test]
-    fn crlf() {
-        let mut p = Parser::new("\
-[project]\r\n\
-\r\n\
-name = \"splay\"\r\n\
-version = \"0.1.0\"\r\n\
-authors = [\"alex@crichton.co\"]\r\n\
-\r\n\
-[[lib]]\r\n\
-\r\n\
-path = \"lib.rs\"\r\n\
-name = \"splay\"\r\n\
-description = \"\"\"\
-A Rust implementation of a TAR file reader and writer. This library does not\r\n\
-currently handle compression, but it is abstract over all I/O readers and\r\n\
-writers. Additionally, great lengths are taken to ensure that the entire\r\n\
-contents are never required to be entirely resident in memory all at once.\r\n\
-\"\"\"\
-");
-        assert!(p.parse().is_some());
-    }
-
-    #[test]
-    fn linecol() {
-        let p = Parser::new("ab\ncde\nf");
-        assert_eq!(p.to_linecol(0), (0, 0));
-        assert_eq!(p.to_linecol(1), (0, 1));
-        assert_eq!(p.to_linecol(3), (1, 0));
-        assert_eq!(p.to_linecol(4), (1, 1));
-        assert_eq!(p.to_linecol(7), (2, 0));
-    }
-
-    #[test]
-    fn fun_with_strings() {
-        let mut p = Parser::new(r#"
-bar = "\U00000000"
-key1 = "One\nTwo"
-key2 = """One\nTwo"""
-key3 = """
-One
-Two"""
-
-key4 = "The quick brown fox jumps over the lazy dog."
-key5 = """
-The quick brown \
-
-
-  fox jumps over \
-    the lazy dog."""
-key6 = """\
-       The quick brown \
-       fox jumps over \
-       the lazy dog.\
-       """
-# What you see is what you get.
-winpath  = 'C:\Users\nodejs\templates'
-winpath2 = '\\ServerX\admin$\system32\'
-quoted   = 'Tom "Dubs" Preston-Werner'
-regex    = '<\i\c*\s*>'
-
-regex2 = '''I [dw]on't need \d{2} apples'''
-lines  = '''
-The first newline is
-trimmed in raw strings.
-   All other whitespace
-   is preserved.
-'''
-"#);
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("bar").and_then(|k| k.as_str()), Some("\0"));
-        assert_eq!(table.lookup("key1").and_then(|k| k.as_str()),
-                   Some("One\nTwo"));
-        assert_eq!(table.lookup("key2").and_then(|k| k.as_str()),
-                   Some("One\nTwo"));
-        assert_eq!(table.lookup("key3").and_then(|k| k.as_str()),
-                   Some("One\nTwo"));
-
-        let msg = "The quick brown fox jumps over the lazy dog.";
-        assert_eq!(table.lookup("key4").and_then(|k| k.as_str()), Some(msg));
-        assert_eq!(table.lookup("key5").and_then(|k| k.as_str()), Some(msg));
-        assert_eq!(table.lookup("key6").and_then(|k| k.as_str()), Some(msg));
-
-        assert_eq!(table.lookup("winpath").and_then(|k| k.as_str()),
-                   Some(r"C:\Users\nodejs\templates"));
-        assert_eq!(table.lookup("winpath2").and_then(|k| k.as_str()),
-                   Some(r"\\ServerX\admin$\system32\"));
-        assert_eq!(table.lookup("quoted").and_then(|k| k.as_str()),
-                   Some(r#"Tom "Dubs" Preston-Werner"#));
-        assert_eq!(table.lookup("regex").and_then(|k| k.as_str()),
-                   Some(r"<\i\c*\s*>"));
-        assert_eq!(table.lookup("regex2").and_then(|k| k.as_str()),
-                   Some(r"I [dw]on't need \d{2} apples"));
-        assert_eq!(table.lookup("lines").and_then(|k| k.as_str()),
-                   Some("The first newline is\n\
-                         trimmed in raw strings.\n   \
-                            All other whitespace\n   \
-                            is preserved.\n"));
-    }
-
-    #[test]
-    fn tables_in_arrays() {
-        let mut p = Parser::new(r#"
-[[foo]]
-  #…
-  [foo.bar]
-    #…
-
-[[foo]] # ...
-  #…
-  [foo.bar]
-    #...
-"#);
-        let table = Table(p.parse().unwrap());
-        table.lookup("foo.0.bar").unwrap().as_table().unwrap();
-        table.lookup("foo.1.bar").unwrap().as_table().unwrap();
-    }
-
-    #[test]
-    fn empty_table() {
-        let mut p = Parser::new(r#"
-[foo]"#);
-        let table = Table(p.parse().unwrap());
-        table.lookup("foo").unwrap().as_table().unwrap();
-    }
-
-    #[test]
-    fn fruit() {
-        let mut p = Parser::new(r#"
-[[fruit]]
-  name = "apple"
-
-  [fruit.physical]
-    color = "red"
-    shape = "round"
-
-  [[fruit.variety]]
-    name = "red delicious"
-
-  [[fruit.variety]]
-    name = "granny smith"
-
-[[fruit]]
-  name = "banana"
-
-  [[fruit.variety]]
-    name = "plantain"
-"#);
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("fruit.0.name").and_then(|k| k.as_str()),
-                   Some("apple"));
-        assert_eq!(table.lookup("fruit.0.physical.color").and_then(|k| k.as_str()),
-                   Some("red"));
-        assert_eq!(table.lookup("fruit.0.physical.shape").and_then(|k| k.as_str()),
-                   Some("round"));
-        assert_eq!(table.lookup("fruit.0.variety.0.name").and_then(|k| k.as_str()),
-                   Some("red delicious"));
-        assert_eq!(table.lookup("fruit.0.variety.1.name").and_then(|k| k.as_str()),
-                   Some("granny smith"));
-        assert_eq!(table.lookup("fruit.1.name").and_then(|k| k.as_str()),
-                   Some("banana"));
-        assert_eq!(table.lookup("fruit.1.variety.0.name").and_then(|k| k.as_str()),
-                   Some("plantain"));
-    }
-
-    #[test]
-    fn stray_cr() {
-        assert!(Parser::new("\r").parse().is_none());
-        assert!(Parser::new("a = [ \r ]").parse().is_none());
-        assert!(Parser::new("a = \"\"\"\r\"\"\"").parse().is_none());
-        assert!(Parser::new("a = \"\"\"\\  \r  \"\"\"").parse().is_none());
-
-        let mut p = Parser::new("foo = '''\r'''");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").and_then(|k| k.as_str()), Some("\r"));
-
-        let mut p = Parser::new("foo = '\r'");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").and_then(|k| k.as_str()), Some("\r"));
-    }
-
-    #[test]
-    fn blank_literal_string() {
-        let mut p = Parser::new("foo = ''");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").and_then(|k| k.as_str()), Some(""));
-    }
-
-    #[test]
-    fn many_blank() {
-        let mut p = Parser::new("foo = \"\"\"\n\n\n\"\"\"");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").and_then(|k| k.as_str()), Some("\n\n"));
-    }
-
-    #[test]
-    fn literal_eats_crlf() {
-        let mut p = Parser::new("
-            foo = \"\"\"\\\r\n\"\"\"
-            bar = \"\"\"\\\r\n   \r\n   \r\n   a\"\"\"
-        ");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").and_then(|k| k.as_str()), Some(""));
-        assert_eq!(table.lookup("bar").and_then(|k| k.as_str()), Some("a"));
-    }
-
-    #[test]
-    fn string_no_newline() {
-        assert!(Parser::new("a = \"\n\"").parse().is_none());
-        assert!(Parser::new("a = '\n'").parse().is_none());
-    }
-
-    #[test]
-    fn bad_leading_zeros() {
-        assert!(Parser::new("a = 00").parse().is_none());
-        assert!(Parser::new("a = -00").parse().is_none());
-        assert!(Parser::new("a = +00").parse().is_none());
-        assert!(Parser::new("a = 00.0").parse().is_none());
-        assert!(Parser::new("a = -00.0").parse().is_none());
-        assert!(Parser::new("a = +00.0").parse().is_none());
-        assert!(Parser::new("a = 9223372036854775808").parse().is_none());
-        assert!(Parser::new("a = -9223372036854775809").parse().is_none());
-    }
-
-    #[test]
-    fn bad_floats() {
-        assert!(Parser::new("a = 0.").parse().is_none());
-        assert!(Parser::new("a = 0.e").parse().is_none());
-        assert!(Parser::new("a = 0.E").parse().is_none());
-        assert!(Parser::new("a = 0.0E").parse().is_none());
-        assert!(Parser::new("a = 0.0e").parse().is_none());
-        assert!(Parser::new("a = 0.0e-").parse().is_none());
-        assert!(Parser::new("a = 0.0e+").parse().is_none());
-        assert!(Parser::new("a = 0.0e+00").parse().is_none());
-    }
-
-    #[test]
-    fn floats() {
-        macro_rules! t {
-            ($actual:expr, $expected:expr) => ({
-                let f = format!("foo = {}", $actual);
-                let mut p = Parser::new(&f);
-                let table = Table(p.parse().unwrap());
-                assert_eq!(table.lookup("foo").and_then(|k| k.as_float()),
-                           Some($expected));
-            })
-        }
-
-        t!("1.0", 1.0);
-        t!("1.0e0", 1.0);
-        t!("1.0e+0", 1.0);
-        t!("1.0e-0", 1.0);
-        t!("1.001e-0", 1.001);
-        t!("2e10", 2e10);
-        t!("2e+10", 2e10);
-        t!("2e-10", 2e-10);
-        t!("2_0.0", 20.0);
-        t!("2_0.0_0e0_0", 20.0);
-        t!("2_0.1_0e1_0", 20.1e10);
-    }
-
-    #[test]
-    fn bare_key_names() {
-        let mut p = Parser::new("
-            foo = 3
-            foo_3 = 3
-            foo_-2--3--r23f--4-f2-4 = 3
-            _ = 3
-            - = 3
-            8 = 8
-            \"a\" = 3
-            \"!\" = 3
-            \"a^b\" = 3
-            \"\\\"\" = 3
-            \"character encoding\" = \"value\"
-            'ʎǝʞ' = \"value\"
-        ");
-        let table = Table(p.parse().unwrap());
-        assert!(table.lookup("foo").is_some());
-        assert!(table.lookup("-").is_some());
-        assert!(table.lookup("_").is_some());
-        assert!(table.lookup("8").is_some());
-        assert!(table.lookup("foo_3").is_some());
-        assert!(table.lookup("foo_-2--3--r23f--4-f2-4").is_some());
-        assert!(table.lookup("a").is_some());
-        assert!(table.lookup("\"!\"").is_some());
-        assert!(table.lookup("\"\\\"\"").is_some());
-        assert!(table.lookup("\"character encoding\"").is_some());
-        assert!(table.lookup("'ʎǝʞ'").is_some());
-    }
-
-    #[test]
-    fn bad_keys() {
-        assert!(Parser::new("key\n=3").parse().is_none());
-        assert!(Parser::new("key=\n3").parse().is_none());
-        assert!(Parser::new("key|=3").parse().is_none());
-        assert!(Parser::new("\"\"=3").parse().is_none());
-        assert!(Parser::new("=3").parse().is_none());
-        assert!(Parser::new("\"\"|=3").parse().is_none());
-        assert!(Parser::new("\"\n\"|=3").parse().is_none());
-        assert!(Parser::new("\"\r\"|=3").parse().is_none());
-    }
-
-    #[test]
-    fn bad_table_names() {
-        assert!(Parser::new("[]").parse().is_none());
-        assert!(Parser::new("[.]").parse().is_none());
-        assert!(Parser::new("[\"\".\"\"]").parse().is_none());
-        assert!(Parser::new("[a.]").parse().is_none());
-        assert!(Parser::new("[\"\"]").parse().is_none());
-        assert!(Parser::new("[!]").parse().is_none());
-        assert!(Parser::new("[\"\n\"]").parse().is_none());
-        assert!(Parser::new("[a.b]\n[a.\"b\"]").parse().is_none());
-        assert!(Parser::new("[']").parse().is_none());
-        assert!(Parser::new("[''']").parse().is_none());
-        assert!(Parser::new("['''''']").parse().is_none());
-        assert!(Parser::new("['\n']").parse().is_none());
-        assert!(Parser::new("['\r\n']").parse().is_none());
-    }
-
-    #[test]
-    fn table_names() {
-        let mut p = Parser::new("
-            [a.\"b\"]
-            [\"f f\"]
-            [\"f.f\"]
-            [\"\\\"\"]
-            ['a.a']
-            ['\"\"']
-        ");
-        let table = Table(p.parse().unwrap());
-        assert!(table.lookup("a.b").is_some());
-        assert!(table.lookup("\"f f\"").is_some());
-        assert!(table.lookup("\"\\\"\"").is_some());
-        assert!(table.lookup("'\"\"'").is_some());
-    }
-
-    #[test]
-    fn invalid_bare_numeral() {
-        assert!(Parser::new("4").parse().is_none());
-    }
-
-    #[test]
-    fn inline_tables() {
-        assert!(Parser::new("a = {}").parse().is_some());
-        assert!(Parser::new("a = {b=1}").parse().is_some());
-        assert!(Parser::new("a = {   b   =   1    }").parse().is_some());
-        assert!(Parser::new("a = {a=1,b=2}").parse().is_some());
-        assert!(Parser::new("a = {a=1,b=2,c={}}").parse().is_some());
-        assert!(Parser::new("a = {a=1,}").parse().is_none());
-        assert!(Parser::new("a = {,}").parse().is_none());
-        assert!(Parser::new("a = {a=1,a=1}").parse().is_none());
-        assert!(Parser::new("a = {\n}").parse().is_none());
-        assert!(Parser::new("a = {").parse().is_none());
-        assert!(Parser::new("a = {a=[\n]}").parse().is_some());
-        assert!(Parser::new("a = {\"a\"=[\n]}").parse().is_some());
-        assert!(Parser::new("a = [\n{},\n{},\n]").parse().is_some());
-    }
-
-    #[test]
-    fn number_underscores() {
-        macro_rules! t {
-            ($actual:expr, $expected:expr) => ({
-                let f = format!("foo = {}", $actual);
-                let mut p = Parser::new(&f);
-                let table = Table(p.parse().unwrap());
-                assert_eq!(table.lookup("foo").and_then(|k| k.as_integer()),
-                           Some($expected));
-            })
-        }
-
-        t!("1_0", 10);
-        t!("1_0_0", 100);
-        t!("1_000", 1000);
-        t!("+1_000", 1000);
-        t!("-1_000", -1000);
-    }
-
-    #[test]
-    fn bad_underscores() {
-        assert!(Parser::new("foo = 0_").parse().is_none());
-        assert!(Parser::new("foo = 0__0").parse().is_none());
-        assert!(Parser::new("foo = __0").parse().is_none());
-        assert!(Parser::new("foo = 1_0_").parse().is_none());
-    }
-
-    #[test]
-    fn bad_unicode_codepoint() {
-        bad!("foo = \"\\uD800\"", "not a valid unicode codepoint");
-    }
-
-    #[test]
-    fn bad_strings() {
-        bad!("foo = \"\\uxx\"", "expected 4 hex digits");
-        bad!("foo = \"\\u\"", "expected 4 hex digits");
-        bad!("foo = \"\\", "unterminated");
-        bad!("foo = '", "unterminated");
-    }
-
-    #[test]
-    fn empty_string() {
-        let mut p = Parser::new("foo = \"\"");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").unwrap().as_str(), Some(""));
-    }
-
-    #[test]
-    fn booleans() {
-        let mut p = Parser::new("foo = true");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").unwrap().as_bool(), Some(true));
-
-        let mut p = Parser::new("foo = false");
-        let table = Table(p.parse().unwrap());
-        assert_eq!(table.lookup("foo").unwrap().as_bool(), Some(false));
-
-        assert!(Parser::new("foo = true2").parse().is_none());
-        assert!(Parser::new("foo = false2").parse().is_none());
-        assert!(Parser::new("foo = t1").parse().is_none());
-        assert!(Parser::new("foo = f2").parse().is_none());
-    }
-
-    #[test]
-    fn bad_nesting() {
-        bad!("
-            a = [2]
-            [[a]]
-            b = 5
-        ", "expected type `integer`, found type `table`");
-        bad!("
-            a = 1
-            [a.b]
-        ", "key `a` was not previously a table");
-        bad!("
-            a = []
-            [a.b]
-        ", "array `a` does not contain tables");
-        bad!("
-            a = []
-            [[a.b]]
-        ", "array `a` does not contain tables");
-        bad!("
-            [a]
-            b = { c = 2, d = {} }
-            [a.b]
-            c = 2
-        ", "duplicate key `c` in table");
-    }
-
-    #[test]
-    fn bad_table_redefine() {
-        bad!("
-            [a]
-            foo=\"bar\"
-            [a.b]
-            foo=\"bar\"
-            [a]
-        ", "redefinition of table `a`");
-        bad!("
-            [a]
-            foo=\"bar\"
-            b = { foo = \"bar\" }
-            [a]
-        ", "redefinition of table `a`");
-        bad!("
-            [a]
-            b = {}
-            [a.b]
-        ", "redefinition of table `b`");
-
-        bad!("
-            [a]
-            b = {}
-            [a]
-        ", "redefinition of table `a`");
-    }
-
-    #[test]
-    fn datetimes() {
-        macro_rules! t {
-            ($actual:expr) => ({
-                let f = format!("foo = {}", $actual);
-                let mut p = Parser::new(&f);
-                let table = Table(p.parse().unwrap());
-                assert_eq!(table.lookup("foo").and_then(|k| k.as_datetime()),
-                           Some($actual));
-            })
-        }
-
-        t!("2016-09-09T09:09:09Z");
-        t!("2016-09-09T09:09:09.0Z");
-        t!("2016-09-09T09:09:09.0+10:00");
-        t!("2016-09-09T09:09:09.01234567890-02:00");
-        bad!("foo = 2016-09-09T09:09:09.Z", "malformed date literal");
-        bad!("foo = 2016-9-09T09:09:09Z", "malformed date literal");
-        bad!("foo = 2016-09-09T09:09:09+2:00", "malformed date literal");
-        bad!("foo = 2016-09-09T09:09:09-2:00", "malformed date literal");
-        bad!("foo = 2016-09-09T09:09:09Z-2:00", "expected");
-    }
-
-    #[test]
-    fn require_newline_after_value() {
-        bad!("0=0r=false", "expected a newline");
-        bad!(r#"
-0=""o=""m=""r=""00="0"q="""0"""e="""0"""
-"#, "expected a newline");
-        bad!(r#"
-[[0000l0]]
-0="0"[[0000l0]]
-0="0"[[0000l0]]
-0="0"l="0"
-"#, "expected a newline");
-        bad!(r#"
-0=[0]00=[0,0,0]t=["0","0","0"]s=[1000-00-00T00:00:00Z,2000-00-00T00:00:00Z]
-"#, "expected a newline");
-        bad!(r#"
-0=0r0=0r=false
-"#, "expected a newline");
-        bad!(r#"
-0=0r0=0r=falsefal=false
-"#, "expected a newline");
-    }
-}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/toml/src/ser.rs
@@ -0,0 +1,1714 @@
+//! Serializing Rust structures into TOML.
+//!
+//! This module contains all the Serde support for serializing Rust structures
+//! into TOML documents (as strings). Note that some top-level functions here
+//! are also provided at the top of the crate.
+//!
+//! Note that the TOML format has a restriction that if a table itself contains
+//! tables, all keys with non-table values must be emitted first. This is
+//! typically easy to ensure happens when you're defining a `struct` as you can
+//! reorder the fields manually, but when working with maps (such as `BTreeMap`
+//! or `HashMap`) this can lead to serialization errors. In those situations you
+//! may use the `tables_last` function in this module like so:
+//!
+//! ```rust
+//! # #[macro_use] extern crate serde_derive;
+//! # extern crate toml;
+//! # use std::collections::HashMap;
+//! #[derive(Serialize)]
+//! struct Manifest {
+//!     package: Package,
+//!     #[serde(serialize_with = "toml::ser::tables_last")]
+//!     dependencies: HashMap<String, Dependency>,
+//! }
+//! # type Package = String;
+//! # type Dependency = String;
+//! # fn main() {}
+//! ```
+
+use std::cell::Cell;
+use std::error;
+use std::fmt::{self, Write};
+use std::marker;
+use std::rc::Rc;
+
+use serde::ser;
+use datetime::{SERDE_STRUCT_FIELD_NAME, SERDE_STRUCT_NAME};
+
+/// Serialize the given data structure as a TOML byte vector.
+///
+/// Serialization can fail if `T`'s implementation of `Serialize` decides to
+/// fail, if `T` contains a map with non-string keys, or if `T` attempts to
+/// serialize an unsupported datatype such as an enum, tuple, or tuple struct.
+pub fn to_vec<T: ?Sized>(value: &T) -> Result<Vec<u8>, Error>
+    where T: ser::Serialize,
+{
+    to_string(value).map(|e| e.into_bytes())
+}
+
+/// Serialize the given data structure as a String of TOML.
+///
+/// Serialization can fail if `T`'s implementation of `Serialize` decides to
+/// fail, if `T` contains a map with non-string keys, or if `T` attempts to
+/// serialize an unsupported datatype such as an enum, tuple, or tuple struct.
+///
+/// # Examples
+///
+/// ```
+/// #[macro_use]
+/// extern crate serde_derive;
+/// extern crate toml;
+///
+/// #[derive(Serialize)]
+/// struct Config {
+///     database: Database,
+/// }
+///
+/// #[derive(Serialize)]
+/// struct Database {
+///     ip: String,
+///     port: Vec<u16>,
+///     connection_max: u32,
+///     enabled: bool,
+/// }
+///
+/// fn main() {
+///     let config = Config {
+///         database: Database {
+///             ip: "192.168.1.1".to_string(),
+///             port: vec![8001, 8002, 8003],
+///             connection_max: 5000,
+///             enabled: false,
+///         },
+///     };
+///
+///     let toml = toml::to_string(&config).unwrap();
+///     println!("{}", toml)
+/// }
+/// ```
+pub fn to_string<T: ?Sized>(value: &T) -> Result<String, Error>
+    where T: ser::Serialize,
+{
+    let mut dst = String::with_capacity(128);
+    value.serialize(&mut Serializer::new(&mut dst))?;
+    Ok(dst)
+}
+
+/// Serialize the given data structure as a "pretty" String of TOML.
+///
+/// This is identical to `to_string` except the output string has a more
+/// "pretty" output. See `Serializer::pretty` for more details.
+pub fn to_string_pretty<T: ?Sized>(value: &T) -> Result<String, Error>
+    where T: ser::Serialize,
+{
+    let mut dst = String::with_capacity(128);
+    value.serialize(&mut Serializer::pretty(&mut dst))?;
+    Ok(dst)
+}
+
+/// Errors that can occur when serializing a type.
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub enum Error {
+    /// Indicates that a Rust type was requested to be serialized but it was not
+    /// supported.
+    ///
+    /// Currently the TOML format does not support serializing types such as
+    /// enums, tuples and tuple structs.
+    UnsupportedType,
+
+    /// The key of all TOML maps must be strings, but serialization was
+    /// attempted where the key of a map was not a string.
+    KeyNotString,
+
+    /// An error that we never omit but keep for backwards compatibility
+    #[doc(hidden)]
+    KeyNewline,
+
+    /// Arrays in TOML must have a homogenous type, but a heterogeneous array
+    /// was emitted.
+    ArrayMixedType,
+
+    /// All values in a TOML table must be emitted before further tables are
+    /// emitted. If a value is emitted *after* a table then this error is
+    /// generated.
+    ValueAfterTable,
+
+    /// A serialized date was invalid.
+    DateInvalid,
+
+    /// A serialized number was invalid.
+    NumberInvalid,
+
+    /// None was attempted to be serialized, but it's not supported.
+    UnsupportedNone,
+
+    /// A custom error which could be generated when serializing a particular
+    /// type.
+    Custom(String),
+
+    #[doc(hidden)]
+    __Nonexhaustive,
+}
+
+#[derive(Debug, Default, Clone)]
+#[doc(hidden)]
+/// Internal place for holding array setings
+struct ArraySettings {
+    indent: usize,
+    trailing_comma: bool,
+}
+
+impl ArraySettings {
+    fn pretty() -> ArraySettings {
+        ArraySettings {
+            indent: 4,
+            trailing_comma: true,
+        }
+    }
+}
+
+#[doc(hidden)]
+#[derive(Debug, Default, Clone)]
+/// String settings
+struct StringSettings {
+    /// Whether to use literal strings when possible
+    literal: bool,
+}
+
+impl StringSettings {
+    fn pretty() -> StringSettings {
+        StringSettings {
+            literal: true,
+        }
+    }
+}
+
+#[derive(Debug, Default, Clone)]
+#[doc(hidden)]
+/// Internal struct for holding serialization settings
+struct Settings {
+    array: Option<ArraySettings>,
+    string: Option<StringSettings>,
+}
+
+/// Serialization implementation for TOML.
+///
+/// This structure implements serialization support for TOML to serialize an
+/// arbitrary type to TOML. Note that the TOML format does not support all
+/// datatypes in Rust, such as enums, tuples, and tuple structs. These types
+/// will generate an error when serialized.
+///
+/// Currently a serializer always writes its output to an in-memory `String`,
+/// which is passed in when creating the serializer itself.
+pub struct Serializer<'a> {
+    dst: &'a mut String,
+    state: State<'a>,
+    settings: Rc<Settings>,
+}
+
+#[derive(Debug, Clone)]
+enum State<'a> {
+    Table {
+        key: &'a str,
+        parent: &'a State<'a>,
+        first: &'a Cell<bool>,
+        table_emitted: &'a Cell<bool>,
+    },
+    Array {
+        parent: &'a State<'a>,
+        first: &'a Cell<bool>,
+        type_: &'a Cell<Option<&'static str>>,
+        len: Option<usize>,
+    },
+    End,
+}
+
+#[doc(hidden)]
+pub struct SerializeSeq<'a: 'b, 'b> {
+    ser: &'b mut Serializer<'a>,
+    first: Cell<bool>,
+    type_: Cell<Option<&'static str>>,
+    len: Option<usize>,
+}
+
+#[doc(hidden)]
+pub enum SerializeTable<'a: 'b, 'b> {
+    Datetime(&'b mut Serializer<'a>),
+    Table {
+        ser: &'b mut Serializer<'a>,
+        key: String,
+        first: Cell<bool>,
+        table_emitted: Cell<bool>,
+    }
+}
+
+impl<'a> Serializer<'a> {
+    /// Creates a new serializer which will emit TOML into the buffer provided.
+    ///
+    /// The serializer can then be used to serialize a type after which the data
+    /// will be present in `dst`.
+    pub fn new(dst: &'a mut String) -> Serializer<'a> {
+        Serializer {
+            dst: dst,
+            state: State::End,
+            settings: Rc::new(Settings::default()),
+        }
+    }
+
+    /// Instantiate a "pretty" formatter
+    ///
+    /// By default this will use:
+    ///
+    /// - pretty strings: strings with newlines will use the `'''` syntax. See
+    ///   `Serializer::pretty_string`
+    /// - pretty arrays: each item in arrays will be on a newline, have an indentation of 4 and
+    ///   have a trailing comma. See `Serializer::pretty_array`
+    pub fn pretty(dst: &'a mut String) -> Serializer<'a> {
+        Serializer {
+            dst: dst,
+            state: State::End,
+            settings: Rc::new(Settings {
+                array: Some(ArraySettings::pretty()),
+                string: Some(StringSettings::pretty()),
+            }),
+        }
+    }
+
+    /// Enable or Disable pretty strings
+    ///
+    /// If enabled, literal strings will be used when possible and strings with
+    /// one or more newlines will use triple quotes (i.e.: `'''` or `"""`)
+    ///
+    /// # Examples
+    ///
+    /// Instead of:
+    ///
+    /// ```toml,ignore
+    /// single = "no newlines"
+    /// text = "\nfoo\nbar\n"
+    /// ```
+    ///
+    /// You will have:
+    ///
+    /// ```toml,ignore
+    /// single = 'no newlines'
+    /// text = '''
+    /// foo
+    /// bar
+    /// '''
+    /// ```
+    pub fn pretty_string(&mut self, value: bool) -> &mut Self {
+        Rc::get_mut(&mut self.settings).unwrap().string = if value {
+            Some(StringSettings::pretty())
+        } else {
+            None
+        };
+        self
+    }
+
+    /// Enable or Disable Literal strings for pretty strings 
+    ///
+    /// If enabled, literal strings will be used when possible and strings with
+    /// one or more newlines will use triple quotes (i.e.: `'''` or `"""`)
+    ///
+    /// If disabled, literal strings will NEVER be used and strings with one or
+    /// more newlines will use `"""`
+    ///
+    /// # Examples
+    ///
+    /// Instead of:
+    ///
+    /// ```toml,ignore
+    /// single = "no newlines"
+    /// text = "\nfoo\nbar\n"
+    /// ```
+    ///
+    /// You will have:
+    ///
+    /// ```toml,ignore
+    /// single = "no newlines"
+    /// text = """
+    /// foo
+    /// bar
+    /// """
+    /// ```
+    pub fn pretty_string_literal(&mut self, value: bool) -> &mut Self {
+        let use_default = if let &mut Some(ref mut s) = &mut Rc::get_mut(&mut self.settings)
+                .unwrap().string {
+            s.literal = value;
+            false
+        } else {
+            true
+        };
+
+        if use_default {
+            let mut string = StringSettings::pretty();
+            string.literal = value;
+            Rc::get_mut(&mut self.settings).unwrap().string = Some(string);
+        }
+        self
+    }
+
+    /// Enable or Disable pretty arrays
+    ///
+    /// If enabled, arrays will always have each item on their own line.
+    ///
+    /// Some specific features can be controlled via other builder methods:
+    ///
+    /// - `Serializer::pretty_array_indent`: set the indent to a value other
+    ///   than 4.
+    /// - `Serializer::pretty_array_trailing_comma`: enable/disable the trailing
+    ///   comma on the last item.
+    ///
+    /// # Examples
+    ///
+    /// Instead of:
+    ///
+    /// ```toml,ignore
+    /// array = ["foo", "bar"]
+    /// ```
+    ///
+    /// You will have:
+    ///
+    /// ```toml,ignore
+    /// array = [
+    ///     "foo",
+    ///     "bar",
+    /// ]
+    /// ```
+    pub fn pretty_array(&mut self, value: bool) -> &mut Self {
+        Rc::get_mut(&mut self.settings).unwrap().array = if value {
+            Some(ArraySettings::pretty())
+        } else {
+            None
+        };
+        self
+    }
+
+    /// Set the indent for pretty arrays
+    ///
+    /// See `Serializer::pretty_array` for more details.
+    pub fn pretty_array_indent(&mut self, value: usize) -> &mut Self {
+        let use_default = if let &mut Some(ref mut a) = &mut Rc::get_mut(&mut self.settings)
+                .unwrap().array {
+            a.indent = value;
+            false
+        } else {
+            true
+        };
+
+        if use_default {
+            let mut array = ArraySettings::pretty();
+            array.indent = value;
+            Rc::get_mut(&mut self.settings).unwrap().array = Some(array);
+        }
+        self
+    }
+
+    /// Specify whether to use a trailing comma when serializing pretty arrays
+    ///
+    /// See `Serializer::pretty_array` for more details.
+    pub fn pretty_array_trailing_comma(&mut self, value: bool) -> &mut Self {
+        let use_default = if let &mut Some(ref mut a) = &mut Rc::get_mut(&mut self.settings)
+                .unwrap().array {
+            a.trailing_comma = value;
+            false
+        } else {
+            true
+        };
+
+        if use_default {
+            let mut array = ArraySettings::pretty();
+            array.trailing_comma = value;
+            Rc::get_mut(&mut self.settings).unwrap().array = Some(array);
+        }
+        self
+    }
+
+    fn display<T: fmt::Display>(&mut self,
+                                t: T,
+                                type_: &'static str) -> Result<(), Error> {
+        self.emit_key(type_)?;
+        drop(write!(self.dst, "{}", t));
+        if let State::Table { .. } = self.state {
+            self.dst.push_str("\n");
+        }
+        Ok(())
+    }
+
+    fn emit_key(&mut self, type_: &'static str) -> Result<(), Error> {
+        self.array_type(type_)?;
+        let state = self.state.clone();
+        self._emit_key(&state)
+    }
+
+    // recursive implementation of `emit_key` above
+    fn _emit_key(&mut self, state: &State) -> Result<(), Error> {
+        match *state {
+            State::End => Ok(()),
+            State::Array { parent, first, type_, len } => {
+                assert!(type_.get().is_some());
+                if first.get() {
+                    self._emit_key(parent)?;
+                }
+                self.emit_array(first, len)
+            }
+            State::Table { parent, first, table_emitted, key } => {
+                if table_emitted.get() {
+                    return Err(Error::ValueAfterTable)
+                }
+                if first.get() {
+                    self.emit_table_header(parent)?;
+                    first.set(false);
+                }
+                self.escape_key(key)?;
+                self.dst.push_str(" = ");
+                Ok(())
+            }
+        }
+    }
+
+    fn emit_array(&mut self, first: &Cell<bool>, len: Option<usize>) -> Result<(), Error> {
+        match (len, &self.settings.array) {
+            (Some(0...1), _) | (_, &None) => {
+                if first.get() {
+                    self.dst.push_str("[")
+                } else {
+                    self.dst.push_str(", ")
+                }
+            },
+            (_, &Some(ref a)) => {
+                if first.get() {
+                    self.dst.push_str("[\n")
+                } else {
+                    self.dst.push_str(",\n")
+                }
+                for _ in 0..a.indent {
+                    self.dst.push_str(" ");
+                }
+            },
+        }
+        Ok(())
+    }
+
+    fn array_type(&mut self, type_: &'static str) -> Result<(), Error> {
+        let prev = match self.state {
+            State::Array { type_, .. } => type_,
+            _ => return Ok(()),
+        };
+        if let Some(prev) = prev.get() {
+            if prev != type_ {
+                return Err(Error::ArrayMixedType)
+            }
+        } else {
+            prev.set(Some(type_));
+        }
+        Ok(())
+    }
+
+    fn escape_key(&mut self, key: &str) -> Result<(), Error> {
+        let ok = key.chars().all(|c| {
+            match c {
+                'a' ... 'z' |
+                'A' ... 'Z' |
+                '0' ... '9' |
+                '-' | '_' => true,
+                _ => false,
+            }
+        });
+        if ok {
+            drop(write!(self.dst, "{}", key));
+        } else {
+            self.emit_str(key, true)?;
+        }
+        Ok(())
+    }
+
+    fn emit_str(&mut self, value: &str, is_key: bool) -> Result<(), Error> {
+        #[derive(PartialEq)]
+        enum Type {
+            NewlineTripple,
+            OnelineTripple,
+            OnelineSingle,
+        }
+
+        enum Repr {
+            /// represent as a literal string (using '')
+            Literal(String, Type),
+            /// represent the std way (using "")
+            Std(Type),
+        }
+
+        fn do_pretty(value: &str) -> Repr {
+            // For doing pretty prints we store in a new String
+            // because there are too many cases where pretty cannot
+            // work. We need to determine:
+            // - if we are a "multi-line" pretty (if there are \n)
+            // - if ['''] appears if multi or ['] if single
+            // - if there are any invalid control characters
+            //
+            // Doing it any other way would require multiple passes
+            // to determine if a pretty string works or not.
+            let mut out = String::with_capacity(value.len() * 2);
+            let mut ty = Type::OnelineSingle;
+            // found consecutive single quotes
+            let mut max_found_singles = 0;
+            let mut found_singles = 0;
+            let mut can_be_pretty = true;
+
+            for ch in value.chars() {
+                if can_be_pretty {
+                    if ch == '\'' {
+                        found_singles += 1;
+                        if found_singles >= 3 {
+                            can_be_pretty = false;
+                        }
+                    } else {
+                        if found_singles > max_found_singles {
+                            max_found_singles = found_singles;
+                        }
+                        found_singles = 0
+                    }
+                    match ch {
+                        '\t' => {},
+                        '\n' => ty = Type::NewlineTripple,
+                        // note that the following are invalid: \b \f \r
+                        c if c < '\u{1f}' => can_be_pretty = false, // Invalid control character
+                        _ => {}
+                    }
+                    out.push(ch);
+                } else {
+                    // the string cannot be represented as pretty,
+                    // still check if it should be multiline
+                    if ch == '\n' {
+                        ty = Type::NewlineTripple;
+                    }
+                }
+            }
+            if !can_be_pretty {
+                debug_assert!(ty != Type::OnelineTripple);
+                return Repr::Std(ty);
+            }
+            if found_singles > max_found_singles {
+                max_found_singles = found_singles;
+            }
+            debug_assert!(max_found_singles < 3);
+            if ty == Type::OnelineSingle && max_found_singles >= 1 {
+                // no newlines, but must use ''' because it has ' in it
+                ty = Type::OnelineTripple;
+            }
+            Repr::Literal(out, ty)
+        }
+
+        let repr = if !is_key && self.settings.string.is_some() {
+            match (&self.settings.string, do_pretty(value)) {
+                (&Some(StringSettings { literal: false, .. }), Repr::Literal(_, ty)) => 
+                    Repr::Std(ty),
+                (_, r @ _) => r,
+            }
+        } else {
+            Repr::Std(Type::OnelineSingle)
+        };
+        match repr {
+            Repr::Literal(literal, ty) => {
+                // A pretty string
+                match ty {
+                    Type::NewlineTripple => self.dst.push_str("'''\n"),
+                    Type::OnelineTripple => self.dst.push_str("'''"),
+                    Type::OnelineSingle => self.dst.push('\''),
+                }
+                self.dst.push_str(&literal);
+                match ty {
+                    Type::OnelineSingle => self.dst.push('\''),
+                    _ => self.dst.push_str("'''"),
+                }
+            },
+            Repr::Std(ty) => {
+                match ty {
+                    Type::NewlineTripple =>  self.dst.push_str("\"\"\"\n"),
+                    // note: OnelineTripple can happen if do_pretty wants to do
+                    // '''it's one line''' 
+                    // but settings.string.literal == false
+                    Type::OnelineSingle | 
+                        Type::OnelineTripple =>  self.dst.push('"'),
+                }
+                for ch in value.chars() {
+                    match ch {
+                        '\u{8}' => self.dst.push_str("\\b"),
+                        '\u{9}' => self.dst.push_str("\\t"),
+                        '\u{a}' => {
+                            match ty {
+                                Type::NewlineTripple =>  self.dst.push('\n'),
+                                Type::OnelineSingle =>  self.dst.push_str("\\n"),
+                                _ => unreachable!(),
+                            }
+                        },
+                        '\u{c}' => self.dst.push_str("\\f"),
+                        '\u{d}' => self.dst.push_str("\\r"),
+                        '\u{22}' => self.dst.push_str("\\\""),
+                        '\u{5c}' => self.dst.push_str("\\\\"),
+                        c if c < '\u{1f}' => drop(write!(self.dst, "\\u{:04X}", ch as u32)),
+                        ch => self.dst.push(ch),
+                    }
+                }
+                match ty {
+                    Type::NewlineTripple =>  self.dst.push_str("\"\"\""),
+                    Type::OnelineSingle | Type::OnelineTripple => self.dst.push('"'),
+                }
+            },
+        }
+        Ok(())
+    }
+
+    fn emit_table_header(&mut self, state: &State) -> Result<(), Error> {
+        let array_of_tables = match *state {
+            State::End => return Ok(()),
+            State::Array { .. } => true,
+            _ => false,
+        };
+
+        // Unlike [..]s, we can't omit [[..]] ancestors, so be sure to emit table
+        // headers for them.
+        let mut p = state;
+        if let State::Array { first, parent, .. } = *state {
+            if first.get() {
+                p = parent;
+            }
+        }
+        while let State::Table { first, parent, .. } = *p {
+            p = parent;
+            if !first.get() {
+                break;
+            }
+            if let State::Array { parent: &State::Table {..}, ..} = *parent {
+                self.emit_table_header(parent)?;
+                break;
+            }
+        }
+
+        match *state {
+            State::Table { first, .. } => {
+                if !first.get() {
+                    // Newline if we are a table that is not the first
+                    // table in the document.
+                    self.dst.push('\n');
+                }
+            },
+            State::Array { parent, first, .. } => {
+                if !first.get() {
+                    // Always newline if we are not the first item in the
+                    // table-array
+                    self.dst.push('\n');
+                } else if let State::Table { first, .. } = *parent {
+                    if !first.get() {
+                        // Newline if we are not the first item in the document 
+                        self.dst.push('\n');
+                    }
+                }
+            },
+            _ => {}
+        }
+        self.dst.push_str("[");
+        if array_of_tables {
+            self.dst.push_str("[");
+        }
+        self.emit_key_part(state)?;
+        if array_of_tables {
+            self.dst.push_str("]");
+        }
+        self.dst.push_str("]\n");
+        Ok(())
+    }
+
+    fn emit_key_part(&mut self, key: &State) -> Result<bool, Error> {
+        match *key {
+            State::Array { parent, .. } => self.emit_key_part(parent),
+            State::End => Ok(true),
+            State::Table { key, parent, table_emitted, .. } => {
+                table_emitted.set(true);
+                let first  = self.emit_key_part(parent)?;
+                if !first {
+                    self.dst.push_str(".");
+                }
+                self.escape_key(key)?;
+                Ok(false)
+            }
+        }
+    }
+}
+
+impl<'a, 'b> ser::Serializer for &'b mut Serializer<'a> {
+    type Ok = ();
+    type Error = Error;
+    type SerializeSeq = SerializeSeq<'a, 'b>;
+    type SerializeTuple = ser::Impossible<(), Error>;
+    type SerializeTupleStruct = ser::Impossible<(), Error>;
+    type SerializeTupleVariant = ser::Impossible<(), Error>;
+    type SerializeMap = SerializeTable<'a, 'b>;
+    type SerializeStruct = SerializeTable<'a, 'b>;
+    type SerializeStructVariant = ser::Impossible<(), Error>;
+
+    fn serialize_bool(self, v: bool) -> Result<(), Self::Error> {
+        self.display(v, "bool")
+    }
+
+    fn serialize_i8(self, v: i8) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_i16(self, v: i16) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_i32(self, v: i32) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_i64(self, v: i64) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_u8(self, v: u8) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_u16(self, v: u16) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_u32(self, v: u32) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_u64(self, v: u64) -> Result<(), Self::Error> {
+        self.display(v, "integer")
+    }
+
+    fn serialize_f32(mut self, v: f32) -> Result<(), Self::Error> {
+        if !v.is_finite() {
+            return Err(Error::NumberInvalid);
+        }
+
+        self.emit_key("float")?;
+        drop(write!(self.dst, "{}", v));
+        if v % 1.0 == 0.0 {
+            drop(write!(self.dst, ".0"));
+        }
+        if let State::Table { .. } = self.state {
+            self.dst.push_str("\n");
+        }
+        Ok(())
+    }
+
+    fn serialize_f64(mut self, v: f64) -> Result<(), Self::Error> {
+        if !v.is_finite() {
+            return Err(Error::NumberInvalid);
+        }
+
+        self.emit_key("float")?;
+        drop(write!(self.dst, "{}", v));
+        if v % 1.0 == 0.0 {
+            drop(write!(self.dst, ".0"));
+        }
+        if let State::Table { .. } = self.state {
+            self.dst.push_str("\n");
+        }
+        Ok(())
+    }
+
+    fn serialize_char(self, v: char) -> Result<(), Self::Error> {
+        let mut buf = [0; 4];
+        self.serialize_str(v.encode_utf8(&mut buf))
+    }
+
+    fn serialize_str(mut self, value: &str) -> Result<(), Self::Error> {
+        self.emit_key("string")?;
+        self.emit_str(value, false)?;
+        if let State::Table { .. } = self.state {
+            self.dst.push_str("\n");
+        }
+        Ok(())
+    }
+
+    fn serialize_bytes(self, value: &[u8]) -> Result<(), Self::Error> {
+        use serde::ser::Serialize;
+        value.serialize(self)
+    }
+
+    fn serialize_none(self) -> Result<(), Self::Error> {
+        Err(Error::UnsupportedNone)
+    }
+
+    fn serialize_some<T: ?Sized>(self, value: &T) -> Result<(), Self::Error>
+        where T: ser::Serialize
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_unit(self) -> Result<(), Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_unit_struct(self,
+                             _name: &'static str)
+                             -> Result<(), Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_unit_variant(self,
+                              _name: &'static str,
+                              _variant_index: u32,
+                              variant: &'static str)
+                              -> Result<(), Self::Error> {
+        self.serialize_str(variant)
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T)
+                                           -> Result<(), Self::Error>
+        where T: ser::Serialize,
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(self,
+                                            _name: &'static str,
+                                            _variant_index: u32,
+                                            _variant: &'static str,
+                                            _value: &T)
+                                            -> Result<(), Self::Error>
+        where T: ser::Serialize,
+    {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_seq(mut self, len: Option<usize>)
+                     -> Result<Self::SerializeSeq, Self::Error> {
+        self.array_type("array")?;
+        Ok(SerializeSeq {
+            ser: self,
+            first: Cell::new(true),
+            type_: Cell::new(None),
+            len: len,
+        })
+    }
+
+    fn serialize_tuple(self, _len: usize)
+                       -> Result<Self::SerializeTuple, Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_tuple_struct(self, _name: &'static str, _len: usize)
+                              -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_tuple_variant(self,
+                               _name: &'static str,
+                               _variant_index: u32,
+                               _variant: &'static str,
+                               _len: usize)
+                               -> Result<Self::SerializeTupleVariant, Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+
+    fn serialize_map(mut self, _len: Option<usize>)
+                     -> Result<Self::SerializeMap, Self::Error> {
+        self.array_type("table")?;
+        Ok(SerializeTable::Table {
+            ser: self,
+            key: String::new(),
+            first: Cell::new(true),
+            table_emitted: Cell::new(false),
+        })
+    }
+
+    fn serialize_struct(mut self, name: &'static str, _len: usize)
+                        -> Result<Self::SerializeStruct, Self::Error> {
+        if name == SERDE_STRUCT_NAME {
+            self.array_type("datetime")?;
+            Ok(SerializeTable::Datetime(self))
+        } else {
+            self.array_type("table")?;
+            Ok(SerializeTable::Table {
+                ser: self,
+                key: String::new(),
+                first: Cell::new(true),
+                table_emitted: Cell::new(false),
+            })
+        }
+    }
+
+    fn serialize_struct_variant(self,
+                                _name: &'static str,
+                                _variant_index: u32,
+                                _variant: &'static str,
+                                _len: usize)
+                                -> Result<Self::SerializeStructVariant, Self::Error> {
+        Err(Error::UnsupportedType)
+    }
+}
+
+impl<'a, 'b> ser::SerializeSeq for SerializeSeq<'a, 'b> {
+    type Ok = ();
+    type Error = Error;
+
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+        where T: ser::Serialize,
+    {
+        value.serialize(&mut Serializer {
+            dst: &mut *self.ser.dst,
+            state: State::Array {
+                parent: &self.ser.state,
+                first: &self.first,
+                type_: &self.type_,
+                len: self.len,
+            },
+            settings: self.ser.settings.clone(),
+        })?;
+        self.first.set(false);
+        Ok(())
+    }
+
+    fn end(self) -> Result<(), Error> {
+        match self.type_.get() {
+            Some("table") => return Ok(()),
+            Some(_) => {
+                match (self.len, &self.ser.settings.array) {
+                    (Some(0...1), _) | (_, &None) => {
+                        self.ser.dst.push_str("]");
+                    },
+                    (_, &Some(ref a)) => {
+                        if a.trailing_comma {
+                            self.ser.dst.push_str(",");
+                        }
+                        self.ser.dst.push_str("\n]");
+                    },
+                }
+            }
+            None => {
+                assert!(self.first.get());
+                self.ser.emit_key("array")?;
+                self.ser.dst.push_str("[]")
+            }
+        }
+        if let State::Table { .. } = self.ser.state {
+            self.ser.dst.push_str("\n");
+        }
+        Ok(())
+    }
+}
+
+impl<'a, 'b> ser::SerializeMap for SerializeTable<'a, 'b> {
+    type Ok = ();
+    type Error = Error;
+
+    fn serialize_key<T: ?Sized>(&mut self, input: &T) -> Result<(), Error>
+        where T: ser::Serialize,
+    {
+        match *self {
+            SerializeTable::Datetime(_) => panic!(), // shouldn't be possible
+            SerializeTable::Table { ref mut key, .. } => {
+                key.truncate(0);
+                *key = input.serialize(StringExtractor)?;
+            }
+        }
+        Ok(())
+    }
+
+    fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+        where T: ser::Serialize,
+    {
+        match *self {
+            SerializeTable::Datetime(_) => panic!(), // shouldn't be possible
+            SerializeTable::Table {
+                ref mut ser,
+                ref key,
+                ref first,
+                ref table_emitted,
+                ..
+            } => {
+                let res = value.serialize(&mut Serializer {
+                    dst: &mut *ser.dst,
+                    state: State::Table {
+                        key: key,
+                        parent: &ser.state,
+                        first: first,
+                        table_emitted: table_emitted,
+                    },
+                    settings: ser.settings.clone(),
+                });
+                match res {
+                    Ok(()) => first.set(false),
+                    Err(Error::UnsupportedNone) => {},
+                    Err(e) => return Err(e),
+                }
+            }
+        }
+        Ok(())
+    }
+
+    fn end(self) -> Result<(), Error> {
+        match self {
+            SerializeTable::Datetime(_) => panic!(), // shouldn't be possible
+            SerializeTable::Table { mut ser, first, ..  } => {
+                if first.get() {
+                    let state = ser.state.clone();
+                    ser.emit_table_header(&state)?;
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
+impl<'a, 'b> ser::SerializeStruct for SerializeTable<'a, 'b> {
+    type Ok = ();
+    type Error = Error;
+
+    fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T)
+                                  -> Result<(), Error>
+        where T: ser::Serialize,
+    {
+        match *self {
+            SerializeTable::Datetime(ref mut ser) => {
+                if key == SERDE_STRUCT_FIELD_NAME {
+                    value.serialize(DateStrEmitter(&mut *ser))?;
+                } else {
+                    return Err(Error::DateInvalid)
+                }
+            }
+            SerializeTable::Table {
+                ref mut ser,
+                ref first,
+                ref table_emitted,
+                ..
+            } => {
+                let res = value.serialize(&mut Serializer {
+                    dst: &mut *ser.dst,
+                    state: State::Table {
+                        key: key,
+                        parent: &ser.state,
+                        first: first,
+                        table_emitted: table_emitted,
+                    },
+                    settings: ser.settings.clone(),
+                });
+                match res {
+                    Ok(()) => first.set(false),
+                    Err(Error::UnsupportedNone) => {},
+                    Err(e) => return Err(e),
+                }
+            }
+        }
+        Ok(())
+    }
+
+    fn end(self) -> Result<(), Error> {
+        match self {
+            SerializeTable::Datetime(_) => {},
+            SerializeTable::Table { mut ser, first, ..  } => {
+                if first.get() {
+                    let state = ser.state.clone();
+                    ser.emit_table_header(&state)?;
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
+struct DateStrEmitter<'a: 'b, 'b>(&'b mut Serializer<'a>);
+
+impl<'a, 'b> ser::Serializer for DateStrEmitter<'a, 'b> {
+    type Ok = ();
+    type Error = Error;
+    type SerializeSeq = ser::Impossible<(), Error>;
+    type SerializeTuple = ser::Impossible<(), Error>;
+    type SerializeTupleStruct = ser::Impossible<(), Error>;
+    type SerializeTupleVariant = ser::Impossible<(), Error>;
+    type SerializeMap = ser::Impossible<(), Error>;
+    type SerializeStruct = ser::Impossible<(), Error>;
+    type SerializeStructVariant = ser::Impossible<(), Error>;
+
+    fn serialize_bool(self, _v: bool) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_i8(self, _v: i8) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_i16(self, _v: i16) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_i32(self, _v: i32) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_i64(self, _v: i64) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_u8(self, _v: u8) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_u16(self, _v: u16) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_u32(self, _v: u32) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_u64(self, _v: u64) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_f32(self, _v: f32) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_f64(self, _v: f64) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_char(self, _v: char) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_str(self, value: &str) -> Result<(), Self::Error> {
+        self.0.display(value, "datetime")?;
+        Ok(())
+    }
+
+    fn serialize_bytes(self, _value: &[u8]) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_none(self) -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_some<T: ?Sized>(self, _value: &T) -> Result<(), Self::Error>
+        where T: ser::Serialize
+    {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_unit(self) -> Result<(), Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_unit_struct(self,
+                             _name: &'static str)
+                             -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_unit_variant(self,
+                              _name: &'static str,
+                              _variant_index: u32,
+                              _variant: &'static str)
+                              -> Result<(), Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, _value: &T)
+                                           -> Result<(), Self::Error>
+        where T: ser::Serialize,
+    {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(self,
+                                            _name: &'static str,
+                                            _variant_index: u32,
+                                            _variant: &'static str,
+                                            _value: &T)
+                                            -> Result<(), Self::Error>
+        where T: ser::Serialize,
+    {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_seq(self, _len: Option<usize>)
+                     -> Result<Self::SerializeSeq, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_tuple(self, _len: usize)
+                       -> Result<Self::SerializeTuple, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_tuple_struct(self, _name: &'static str, _len: usize)
+                              -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_tuple_variant(self,
+                               _name: &'static str,
+                               _variant_index: u32,
+                               _variant: &'static str,
+                               _len: usize)
+                               -> Result<Self::SerializeTupleVariant, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_map(self, _len: Option<usize>)
+                     -> Result<Self::SerializeMap, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_struct(self, _name: &'static str, _len: usize)
+                        -> Result<Self::SerializeStruct, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+
+    fn serialize_struct_variant(self,
+                                _name: &'static str,
+                                _variant_index: u32,
+                                _variant: &'static str,
+                                _len: usize)
+                                -> Result<Self::SerializeStructVariant, Self::Error> {
+        Err(Error::DateInvalid)
+    }
+}
+
+struct StringExtractor;
+
+impl ser::Serializer for StringExtractor {
+    type Ok = String;
+    type Error = Error;
+    type SerializeSeq = ser::Impossible<String, Error>;
+    type SerializeTuple = ser::Impossible<String, Error>;
+    type SerializeTupleStruct = ser::Impossible<String, Error>;
+    type SerializeTupleVariant = ser::Impossible<String, Error>;
+    type SerializeMap = ser::Impossible<String, Error>;
+    type SerializeStruct = ser::Impossible<String, Error>;
+    type SerializeStructVariant = ser::Impossible<String, Error>;
+
+    fn serialize_bool(self, _v: bool) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_i8(self, _v: i8) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_i16(self, _v: i16) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_i32(self, _v: i32) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_i64(self, _v: i64) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_u8(self, _v: u8) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_u16(self, _v: u16) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_u32(self, _v: u32) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_u64(self, _v: u64) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_f32(self, _v: f32) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_f64(self, _v: f64) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_char(self, _v: char) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_str(self, value: &str) -> Result<String, Self::Error> {
+        Ok(value.to_string())
+    }
+
+    fn serialize_bytes(self, _value: &[u8]) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_none(self) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_some<T: ?Sized>(self, _value: &T) -> Result<String, Self::Error>
+        where T: ser::Serialize
+    {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_unit(self) -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_unit_struct(self,
+                             _name: &'static str)
+                             -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_unit_variant(self,
+                              _name: &'static str,
+                              _variant_index: u32,
+                              _variant: &'static str)
+                              -> Result<String, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, _value: &T)
+                                           -> Result<String, Self::Error>
+        where T: ser::Serialize,
+    {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(self,
+                                            _name: &'static str,
+                                            _variant_index: u32,
+                                            _variant: &'static str,
+                                            _value: &T)
+                                            -> Result<String, Self::Error>
+        where T: ser::Serialize,
+    {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_seq(self, _len: Option<usize>)
+                     -> Result<Self::SerializeSeq, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_tuple(self, _len: usize)
+                       -> Result<Self::SerializeTuple, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_tuple_struct(self, _name: &'static str, _len: usize)
+                              -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_tuple_variant(self,
+                               _name: &'static str,
+                               _variant_index: u32,
+                               _variant: &'static str,
+                               _len: usize)
+                               -> Result<Self::SerializeTupleVariant, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_map(self, _len: Option<usize>)
+                     -> Result<Self::SerializeMap, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_struct(self, _name: &'static str, _len: usize)
+                        -> Result<Self::SerializeStruct, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+
+    fn serialize_struct_variant(self,
+                                _name: &'static str,
+                                _variant_index: u32,
+                                _variant: &'static str,
+                                _len: usize)
+                                -> Result<Self::SerializeStructVariant, Self::Error> {
+        Err(Error::KeyNotString)
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            Error::UnsupportedType => "unsupported Rust type".fmt(f),
+            Error::KeyNotString => "map key was not a string".fmt(f),
+            Error::ArrayMixedType => "arrays cannot have mixed types".fmt(f),
+            Error::ValueAfterTable => "values must be emitted before tables".fmt(f),
+            Error::DateInvalid => "a serialized date was invalid".fmt(f),
+            Error::NumberInvalid => "a serialized number was invalid".fmt(f),
+            Error::UnsupportedNone => "unsupported None value".fmt(f),
+            Error::Custom(ref s) => s.fmt(f),
+            Error::KeyNewline => unreachable!(),
+            Error::__Nonexhaustive => panic!(),
+        }
+    }
+}
+
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        match *self {
+            Error::UnsupportedType => "unsupported Rust type",
+            Error::KeyNotString => "map key was not a string",
+            Error::ArrayMixedType => "arrays cannot have mixed types",
+            Error::ValueAfterTable => "values must be emitted before tables",
+            Error::DateInvalid => "a serialized date was invalid",
+            Error::NumberInvalid => "a serialized number was invalid",
+            Error::UnsupportedNone => "unsupported None value",
+            Error::Custom(_) => "custom error",
+            Error::KeyNewline => unreachable!(),
+            Error::__Nonexhaustive => panic!(),
+        }
+    }
+}
+
+impl ser::Error for Error {
+    fn custom<T: fmt::Display>(msg: T) -> Error {
+        Error::Custom(msg.to_string())
+    }
+}
+
+enum Category {
+    Primitive,
+    Array,
+    Table,
+}
+
+/// Convenience function to serialize items in a map in an order valid with
+/// TOML.
+///
+/// TOML carries the restriction that keys in a table must be serialized last if
+/// their value is a table itself. This isn't always easy to guarantee, so this
+/// helper can be used like so:
+///
+/// ```rust
+/// # #[macro_use] extern crate serde_derive;
+/// # extern crate toml;
+/// # use std::collections::HashMap;
+/// #[derive(Serialize)]
+/// struct Manifest {
+///     package: Package,
+///     #[serde(serialize_with = "toml::ser::tables_last")]
+///     dependencies: HashMap<String, Dependency>,
+/// }
+/// # type Package = String;
+/// # type Dependency = String;
+/// # fn main() {}
+/// ```
+pub fn tables_last<'a, I, K, V, S>(data: &'a I, serializer: S)
+                                   -> Result<S::Ok, S::Error>
+    where &'a I: IntoIterator<Item = (K, V)>,
+          K: ser::Serialize,
+          V: ser::Serialize,
+          S: ser::Serializer
+{
+    use serde::ser::SerializeMap;
+
+    let mut map = serializer.serialize_map(None)?;
+    for (k, v) in data {
+        if let Category::Primitive = v.serialize(Categorize::new())? {
+            map.serialize_entry(&k, &v)?;
+        }
+    }
+    for (k, v) in data {
+        if let Category::Array = v.serialize(Categorize::new())? {
+            map.serialize_entry(&k, &v)?;
+        }
+    }
+    for (k, v) in data {
+        if let Category::Table = v.serialize(Categorize::new())? {
+            map.serialize_entry(&k, &v)?;
+        }
+    }
+    map.end()
+}
+
+struct Categorize<E>(marker::PhantomData<E>);
+
+impl<E> Categorize<E> {
+    fn new() -> Self {
+        Categorize(marker::PhantomData)
+    }
+}
+
+impl<E: ser::Error> ser::Serializer for Categorize<E> {
+    type Ok = Category;
+    type Error = E;
+    type SerializeSeq = Self;
+    type SerializeTuple = ser::Impossible<Category, E>;
+    type SerializeTupleStruct = ser::Impossible<Category, E>;
+    type SerializeTupleVariant = ser::Impossible<Category, E>;
+    type SerializeMap = Self;
+    type SerializeStruct = Self;
+    type SerializeStructVariant = ser::Impossible<Category, E>;
+
+    fn serialize_bool(self, _: bool) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_i8(self, _: i8) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_i16(self, _: i16) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_i32(self, _: i32) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_i64(self, _: i64) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_u8(self, _: u8) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_u16(self, _: u16) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_u32(self, _: u32) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_u64(self, _: u64) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_f32(self, _: f32) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_f64(self, _: f64) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_char(self, _: char) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_str(self, _: &str) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Primitive)
+    }
+
+    fn serialize_bytes(self, _: &[u8]) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Array)
+    }
+
+    fn serialize_none(self) -> Result<Self::Ok, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_some<T: ?Sized + ser::Serialize>(self, v: &T) -> Result<Self::Ok, Self::Error> {
+        v.serialize(self)
+    }
+
+    fn serialize_unit(self) -> Result<Self::Ok, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_unit_struct(self, _: &'static str) -> Result<Self::Ok, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_unit_variant(self, _: &'static str, _: u32, _: &'static str) -> Result<Self::Ok, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_newtype_struct<T: ?Sized + ser::Serialize>(self, _: &'static str, v: &T) -> Result<Self::Ok, Self::Error> {
+        v.serialize(self)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized + ser::Serialize>(self, _: &'static str, _: u32, _: &'static str, _: &T) -> Result<Self::Ok, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_seq(self, _: Option<usize>) -> Result<Self, Self::Error> {
+        Ok(self)
+    }
+
+    fn serialize_tuple(self, _: usize) -> Result<Self::SerializeTuple, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_tuple_struct(self, _: &'static str, _: usize) -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_tuple_variant(self, _: &'static str, _: u32, _: &'static str, _: usize) -> Result<Self::SerializeTupleVariant, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+
+    fn serialize_map(self, _: Option<usize>) -> Result<Self, Self::Error> {
+        Ok(self)
+    }
+
+    fn serialize_struct(self, _: &'static str, _: usize) -> Result<Self, Self::Error> {
+        Ok(self)
+    }
+
+    fn serialize_struct_variant(self, _: &'static str, _: u32, _: &'static str, _: usize) -> Result<Self::SerializeStructVariant, Self::Error> {
+        Err(ser::Error::custom("unsupported"))
+    }
+}
+
+impl<E: ser::Error> ser::SerializeSeq for Categorize<E> {
+    type Ok = Category;
+    type Error = E;
+
+    fn serialize_element<T: ?Sized + ser::Serialize>(&mut self, _: &T)
+                                                     -> Result<(), Self::Error> {
+        Ok(())
+    }
+
+    fn end(self) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Array)
+    }
+}
+
+impl<E: ser::Error> ser::SerializeMap for Categorize<E> {
+    type Ok = Category;
+    type Error = E;
+
+    fn serialize_key<T: ?Sized + ser::Serialize>(&mut self, _: &T)
+                                                 -> Result<(), Self::Error> {
+        Ok(())
+    }
+
+    fn serialize_value<T: ?Sized + ser::Serialize>(&mut self, _: &T)
+                                                   -> Result<(), Self::Error> {
+        Ok(())
+    }
+
+    fn end(self) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Table)
+    }
+}
+
+impl<E: ser::Error> ser::SerializeStruct for Categorize<E> {
+    type Ok = Category;
+    type Error = E;
+
+    fn serialize_field<T: ?Sized>(&mut self,
+                                  _: &'static str,
+                                  _: &T) -> Result<(), Self::Error>
+        where T: ser::Serialize,
+    {
+        Ok(())
+    }
+
+    fn end(self) -> Result<Self::Ok, Self::Error> {
+        Ok(Category::Table)
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/toml/src/tokens.rs
@@ -0,0 +1,620 @@
+use std::borrow::Cow;
+use std::char;
+use std::str;
+use std::string;
+
+use self::Token::*;
+
+#[derive(Eq, PartialEq, Debug)]
+pub enum Token<'a> {
+    Whitespace(&'a str),
+    Newline,
+    Comment(&'a str),
+
+    Equals,
+    Period,
+    Comma,
+    Colon,
+    Plus,
+    LeftBrace,
+    RightBrace,
+    LeftBracket,
+    RightBracket,
+
+    Keylike(&'a str),
+    String { src: &'a str, val: Cow<'a, str> },
+}
+
+#[derive(Eq, PartialEq, Debug)]
+pub enum Error {
+    InvalidCharInString(usize, char),
+    InvalidEscape(usize, char),
+    InvalidHexEscape(usize, char),
+    InvalidEscapeValue(usize, u32),
+    NewlineInString(usize),
+    Unexpected(usize, char),
+    UnterminatedString(usize),
+    NewlineInTableKey(usize),
+    EmptyTableKey(usize),
+    Wanted { at: usize, expected: &'static str, found: &'static str },
+}
+
+#[derive(Clone)]
+pub struct Tokenizer<'a> {
+    input: &'a str,
+    chars: CrlfFold<'a>,
+}
+
+#[derive(Clone)]
+struct CrlfFold<'a> {
+    chars: str::CharIndices<'a>,
+}
+
+#[derive(Debug)]
+enum MaybeString {
+    NotEscaped(usize),
+    Owned(string::String),
+}
+
+impl<'a> Tokenizer<'a> {
+    pub fn new(input: &'a str) -> Tokenizer<'a> {
+        let mut t = Tokenizer {
+            input: input,
+            chars: CrlfFold {
+                chars: input.char_indices(),
+            },
+        };
+        // Eat utf-8 BOM
+        t.eatc('\u{feff}');
+        t
+    }
+
+    pub fn next(&mut self) -> Result<Option<Token<'a>>, Error> {
+        let token = match self.chars.next() {
+            Some((_, '\n')) => Newline,
+            Some((start, ' ')) => self.whitespace_token(start),
+            Some((start, '\t')) => self.whitespace_token(start),
+            Some((start, '#')) => self.comment_token(start),
+            Some((_, '=')) => Equals,
+            Some((_, '.')) => Period,
+            Some((_, ',')) => Comma,
+            Some((_, ':')) => Colon,
+            Some((_, '+')) => Plus,
+            Some((_, '{')) => LeftBrace,
+            Some((_, '}')) => RightBrace,
+            Some((_, '[')) => LeftBracket,
+            Some((_, ']')) => RightBracket,
+            Some((start, '\'')) => return self.literal_string(start).map(Some),
+            Some((start, '"')) => return self.basic_string(start).map(Some),
+            Some((start, ch)) if is_keylike(ch) => self.keylike(start),
+
+            Some((start, ch)) => return Err(Error::Unexpected(start, ch)),
+            None => return Ok(None),
+        };
+        Ok(Some(token))
+    }
+
+    pub fn peek(&mut self) -> Result<Option<Token<'a>>, Error> {
+        self.clone().next()
+    }
+
+    pub fn eat(&mut self, expected: Token<'a>) -> Result<bool, Error> {
+        match self.peek()? {
+            Some(ref found) if expected == *found => {}
+            Some(_) => return Ok(false),
+            None => return Ok(false),
+        }
+        drop(self.next());
+        Ok(true)
+    }
+
+    pub fn expect(&mut self, expected: Token<'a>) -> Result<(), Error> {
+        let current = self.current();
+        match self.next()? {
+            Some(found) => {
+                if expected == found {
+                    Ok(())
+                } else {
+                    Err(Error::Wanted {
+                        at: current,
+                        expected: expected.describe(),
+                        found: found.describe(),
+                    })
+                }
+            }
+            None => {
+                Err(Error::Wanted {
+                    at: self.input.len(),
+                    expected: expected.describe(),
+                    found: "eof",
+                })
+            }
+        }
+    }
+
+    pub fn table_key(&mut self) -> Result<Cow<'a, str>, Error> {
+        let current = self.current();
+        match self.next()? {
+            Some(Token::Keylike(k)) => Ok(k.into()),
+            Some(Token::String { src, val }) => {
+                let offset = self.substr_offset(src);
+                if val == "" {
+                    return Err(Error::EmptyTableKey(offset))
+                }
+                match src.find('\n') {
+                    None => Ok(val),
+                    Some(i) => Err(Error::NewlineInTableKey(offset + i)),
+                }
+            }
+            Some(other) => {
+                Err(Error::Wanted {
+                    at: current,
+                    expected: "a table key",
+                    found: other.describe(),
+                })
+            }
+            None => {
+                Err(Error::Wanted