Bug 1335799 - Update vendored rust libraries for webrender update. r=kats
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 14 Feb 2017 13:34:15 -0500
changeset 392939 47611a305c4407c98064008592d0df04400acc3b
parent 392938 9cbd7126db64c03749c553c2a0707c3b8c91dc82
child 392940 ca2b6dc909b31499974dc17041ce96181579206f
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1335799
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1335799 - Update vendored rust libraries for webrender update. r=kats MozReview-Commit-ID: 8e4euhlfkwR
third_party/rust/byteorder-0.5.3/.cargo-checksum.json
third_party/rust/byteorder-0.5.3/.cargo-ok
third_party/rust/byteorder-0.5.3/.gitignore
third_party/rust/byteorder-0.5.3/.travis.yml
third_party/rust/byteorder-0.5.3/COPYING
third_party/rust/byteorder-0.5.3/Cargo.toml
third_party/rust/byteorder-0.5.3/LICENSE-MIT
third_party/rust/byteorder-0.5.3/Makefile
third_party/rust/byteorder-0.5.3/README.md
third_party/rust/byteorder-0.5.3/UNLICENSE
third_party/rust/byteorder-0.5.3/benches/bench.rs
third_party/rust/byteorder-0.5.3/session.vim
third_party/rust/byteorder-0.5.3/src/lib.rs
third_party/rust/byteorder-0.5.3/src/new.rs
third_party/rust/clang-sys/.cargo-checksum.json
third_party/rust/clang-sys/.gitattributes
third_party/rust/core-foundation-0.2.3/.cargo-checksum.json
third_party/rust/core-foundation-0.2.3/.cargo-ok
third_party/rust/core-foundation-0.2.3/Cargo.toml
third_party/rust/core-foundation-0.2.3/src/array.rs
third_party/rust/core-foundation-0.2.3/src/base.rs
third_party/rust/core-foundation-0.2.3/src/boolean.rs
third_party/rust/core-foundation-0.2.3/src/bundle.rs
third_party/rust/core-foundation-0.2.3/src/data.rs
third_party/rust/core-foundation-0.2.3/src/dictionary.rs
third_party/rust/core-foundation-0.2.3/src/error.rs
third_party/rust/core-foundation-0.2.3/src/lib.rs
third_party/rust/core-foundation-0.2.3/src/number.rs
third_party/rust/core-foundation-0.2.3/src/propertylist.rs
third_party/rust/core-foundation-0.2.3/src/runloop.rs
third_party/rust/core-foundation-0.2.3/src/set.rs
third_party/rust/core-foundation-0.2.3/src/string.rs
third_party/rust/core-foundation-0.2.3/src/url.rs
third_party/rust/core-foundation-sys-0.2.3/.cargo-checksum.json
third_party/rust/core-foundation-sys-0.2.3/.cargo-ok
third_party/rust/core-foundation-sys-0.2.3/Cargo.toml
third_party/rust/core-foundation-sys-0.2.3/build.rs
third_party/rust/core-foundation-sys-0.2.3/src/array.rs
third_party/rust/core-foundation-sys-0.2.3/src/base.rs
third_party/rust/core-foundation-sys-0.2.3/src/bundle.rs
third_party/rust/core-foundation-sys-0.2.3/src/data.rs
third_party/rust/core-foundation-sys-0.2.3/src/date.rs
third_party/rust/core-foundation-sys-0.2.3/src/dictionary.rs
third_party/rust/core-foundation-sys-0.2.3/src/error.rs
third_party/rust/core-foundation-sys-0.2.3/src/lib.rs
third_party/rust/core-foundation-sys-0.2.3/src/messageport.rs
third_party/rust/core-foundation-sys-0.2.3/src/number.rs
third_party/rust/core-foundation-sys-0.2.3/src/propertylist.rs
third_party/rust/core-foundation-sys-0.2.3/src/runloop.rs
third_party/rust/core-foundation-sys-0.2.3/src/set.rs
third_party/rust/core-foundation-sys-0.2.3/src/string.rs
third_party/rust/core-foundation-sys-0.2.3/src/url.rs
third_party/rust/core-foundation-sys/.cargo-checksum.json
third_party/rust/core-foundation-sys/Cargo.toml
third_party/rust/core-foundation-sys/src/base.rs
third_party/rust/core-foundation-sys/src/url.rs
third_party/rust/core-foundation/.cargo-checksum.json
third_party/rust/core-foundation/Cargo.toml
third_party/rust/core-graphics/.cargo-checksum.json
third_party/rust/core-graphics/Cargo.toml
third_party/rust/core-text/.cargo-checksum.json
third_party/rust/core-text/Cargo.toml
third_party/rust/dwrote/.cargo-checksum.json
third_party/rust/dwrote/Cargo.toml
third_party/rust/dwrote/src/font_face.rs
third_party/rust/dwrote/src/lib.rs
third_party/rust/error-chain/.cargo-checksum.json
third_party/rust/error-chain/.gitattributes
third_party/rust/euclid/.cargo-checksum.json
third_party/rust/euclid/Cargo.toml
third_party/rust/euclid/src/length.rs
third_party/rust/euclid/src/size.rs
third_party/rust/gamma-lut/.cargo-checksum.json
third_party/rust/gamma-lut/.cargo-ok
third_party/rust/gamma-lut/.gitignore
third_party/rust/gamma-lut/Cargo.toml
third_party/rust/gamma-lut/LICENSE
third_party/rust/gamma-lut/src/lib.rs
third_party/rust/gamma-lut/src/main.rs
third_party/rust/gleam/.cargo-checksum.json
third_party/rust/gleam/Cargo.toml
third_party/rust/gleam/src/gl.rs
third_party/rust/offscreen_gl_context/.cargo-checksum.json
third_party/rust/offscreen_gl_context/Cargo.toml
third_party/rust/strsim/.cargo-checksum.json
third_party/rust/strsim/.gitattributes
third_party/rust/syn/.cargo-checksum.json
third_party/rust/syn/Cargo.toml
third_party/rust/syn/src/expr.rs
third_party/rust/syn/src/item.rs
third_party/rust/syn/src/lib.rs
third_party/rust/syn/src/mac.rs
third_party/rust/syn/src/nom.rs
third_party/rust/syn/src/ty.rs
third_party/rust/syn/src/visit.rs
third_party/rust/term/.cargo-checksum.json
third_party/rust/term/Cargo.toml
third_party/rust/term/src/lib.rs
third_party/rust/term/src/terminfo/mod.rs
third_party/rust/term/src/terminfo/parm.rs
third_party/rust/term/src/terminfo/parser/compiled.rs
third_party/rust/term/src/terminfo/parser/names.rs
third_party/rust/term/src/terminfo/searcher.rs
third_party/rust/thread_profiler/.cargo-checksum.json
third_party/rust/thread_profiler/.cargo-ok
third_party/rust/thread_profiler/.gitignore
third_party/rust/thread_profiler/Cargo.toml
third_party/rust/thread_profiler/src/lib.rs
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/rust/Cargo.lock
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/.cargo-checksum.json
+++ /dev/null
@@ -1,1 +0,0 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"2879af3c0512f976015d532e2d768f04ff22fdcf8745b69b955b78fda321c3fb",".travis.yml":"81545ce3c6c72111a68434464c3f9fa8df9cbe39759a081fac527628ab21ae0c","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"a7282931b50dff2e463f82baaed95a9d76636bc0fef3e921acd8ca69eab32b83","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","Makefile":"a45a128685a2ae7d4fa39d310786674417ee113055ef290a11f88002285865fc","README.md":"fbcc46b6d0a585096737f50922818b59016b69d959b05f1b29863b2af8e4da43","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"f583692d829c8dfe19b1d5b9e968ccf5c74d6733367ca183edff74041a6afedd","session.vim":"95cb1d7caf0ff7fbe76ec911988d908ddd883381c925ba64b537695bc9f021c4","src/lib.rs":"ef9e7a218fa3a4912c47f6840d32b975940d98277b6c9be85e8d7d045552eb87","src/new.rs":"161c21b7ebb5668c7cc70b46b0eb37709e06bb9c854f2fdfc6ce3d3babcbf3de"},"package":"0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.*.swp
-doc
-tags
-build
-target
-Cargo.lock
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: rust
-matrix:
-  include:
-    - rust: "nightly"
-      env: TEST_SUITE=suite_nightly
-    - rust: "beta"
-      env: TEST_SUITE=suite_beta
-    - rust: "stable"
-      env: TEST_SUITE=suite_stable
-script:
-  - cargo build --verbose
-  - cargo test --verbose
-  - if [ "$TEST_SUITE" = "suite_nightly" ]; then
-      cargo bench --verbose;
-    fi
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/COPYING
+++ /dev/null
@@ -1,3 +0,0 @@
-This project is dual-licensed under the Unlicense and MIT licenses.
-
-You may use this code under the terms of either license.
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/Cargo.toml
+++ /dev/null
@@ -1,25 +0,0 @@
-[package]
-name = "byteorder"
-version = "0.5.3"  #:version
-authors = ["Andrew Gallant <jamslam@gmail.com>"]
-description = "Library for reading/writing numbers in big-endian and little-endian."
-documentation = "http://burntsushi.net/rustdoc/byteorder/"
-homepage = "https://github.com/BurntSushi/byteorder"
-repository = "https://github.com/BurntSushi/byteorder"
-readme = "README.md"
-keywords = ["byte", "endian", "big-endian", "little-endian", "binary"]
-license = "Unlicense/MIT"
-
-[lib]
-name = "byteorder"
-
-[dev-dependencies]
-quickcheck = "0.2"
-rand = "0.3"
-
-[features]
-default = ["std"]
-std = []
-
-[profile.bench]
-opt-level = 3
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/LICENSE-MIT
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Andrew Gallant
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-all:
-	echo Nothing to do...
-
-ctags:
-	ctags --recurse --options=ctags.rust --languages=Rust
-
-docs:
-	cargo doc
-	in-dir ./target/doc fix-perms
-	rscp ./target/doc/* gopher:~/www/burntsushi.net/rustdoc/
-
-push:
-	git push origin master
-	git push github master
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-This crate provides convenience methods for encoding and decoding numbers in
-either big-endian or little-endian order. This is meant to replace the old
-methods defined on the standard library `Reader` and `Writer` traits.
-
-[![Build status](https://api.travis-ci.org/BurntSushi/byteorder.png)](https://travis-ci.org/BurntSushi/byteorder)
-[![](http://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder)
-
-Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
-
-
-### Documentation
-
-[http://burntsushi.net/rustdoc/byteorder/](http://burntsushi.net/rustdoc/byteorder/).
-
-The documentation includes examples.
-
-
-### Installation
-
-This crate works with Cargo and is on
-[crates.io](https://crates.io/crates/byteorder). The package is regularly
-updated.  Add it to your `Cargo.toml` like so:
-
-```toml
-[dependencies]
-byteorder = "0.5"
-```
-
-If you want to augment existing `Read` and `Write` traits, then import the
-extension methods like so:
-
-```rust
-extern crate byteorder;
-
-use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian};
-```
-
-For example:
-
-```rust
-use std::io::Cursor;
-use byteorder::{BigEndian, ReadBytesExt};
-
-let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
-// Note that we use type parameters to indicate which kind of byte order
-// we want!
-assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
-assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
-```
-
-### `no_std` crates
-
-This crate has a feature, `std`, that is enabled by default. To use this crate
-in a `no_std` context, add the following to your `Cargo.toml`:
-
-```toml
-[dependencies]
-byteorder = { version = "0.5", default-features = false }
-```
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/UNLICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/benches/bench.rs
+++ /dev/null
@@ -1,148 +0,0 @@
-#![feature(test)]
-
-extern crate byteorder;
-extern crate test;
-
-macro_rules! bench_num {
-    ($name:ident, $read:ident, $bytes:expr, $data:expr) => (
-        mod $name {
-            use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian};
-            use super::test::Bencher;
-            use super::test::black_box as bb;
-
-            const NITER: usize = 100_000;
-
-            #[bench]
-            fn read_big_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(BigEndian::$read(&buf, $bytes));
-                    }
-                });
-            }
-
-            #[bench]
-            fn read_little_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(LittleEndian::$read(&buf, $bytes));
-                    }
-                });
-            }
-
-            #[bench]
-            fn read_native_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(NativeEndian::$read(&buf, $bytes));
-                    }
-                });
-            }
-        }
-    );
-    ($ty:ident, $max:ident,
-     $read:ident, $write:ident, $size:expr, $data:expr) => (
-        mod $ty {
-            use std::$ty;
-            use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian};
-            use super::test::Bencher;
-            use super::test::black_box as bb;
-
-            const NITER: usize = 100_000;
-
-            #[bench]
-            fn read_big_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(BigEndian::$read(&buf));
-                    }
-                });
-            }
-
-            #[bench]
-            fn read_little_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(LittleEndian::$read(&buf));
-                    }
-                });
-            }
-
-            #[bench]
-            fn read_native_endian(b: &mut Bencher) {
-                let buf = $data;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(NativeEndian::$read(&buf));
-                    }
-                });
-            }
-
-            #[bench]
-            fn write_big_endian(b: &mut Bencher) {
-                let mut buf = $data;
-                let n = $ty::$max;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(BigEndian::$write(&mut buf, n));
-                    }
-                });
-            }
-
-            #[bench]
-            fn write_little_endian(b: &mut Bencher) {
-                let mut buf = $data;
-                let n = $ty::$max;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(LittleEndian::$write(&mut buf, n));
-                    }
-                });
-            }
-
-            #[bench]
-            fn write_native_endian(b: &mut Bencher) {
-                let mut buf = $data;
-                let n = $ty::$max;
-                b.iter(|| {
-                    for _ in 0..NITER {
-                        bb(NativeEndian::$write(&mut buf, n));
-                    }
-                });
-            }
-        }
-    );
-}
-
-bench_num!(u16, MAX, read_u16, write_u16, 2, [1, 2]);
-bench_num!(i16, MAX, read_i16, write_i16, 2, [1, 2]);
-bench_num!(u32, MAX, read_u32, write_u32, 4, [1, 2, 3, 4]);
-bench_num!(i32, MAX, read_i32, write_i32, 4, [1, 2, 3, 4]);
-bench_num!(u64, MAX, read_u64, write_u64, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
-bench_num!(i64, MAX, read_i64, write_i64, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
-bench_num!(f32, MAX, read_f32, write_f32, 4, [1, 2, 3, 4]);
-bench_num!(f64, MAX, read_f64, write_f64, 8,
-           [1, 2, 3, 4, 5, 6, 7, 8]);
-
-bench_num!(uint_1, read_uint, 1, [1]);
-bench_num!(uint_2, read_uint, 2, [1, 2]);
-bench_num!(uint_3, read_uint, 3, [1, 2, 3]);
-bench_num!(uint_4, read_uint, 4, [1, 2, 3, 4]);
-bench_num!(uint_5, read_uint, 5, [1, 2, 3, 4, 5]);
-bench_num!(uint_6, read_uint, 6, [1, 2, 3, 4, 5, 6]);
-bench_num!(uint_7, read_uint, 7, [1, 2, 3, 4, 5, 6, 7]);
-bench_num!(uint_8, read_uint, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
-
-bench_num!(int_1, read_int, 1, [1]);
-bench_num!(int_2, read_int, 2, [1, 2]);
-bench_num!(int_3, read_int, 3, [1, 2, 3]);
-bench_num!(int_4, read_int, 4, [1, 2, 3, 4]);
-bench_num!(int_5, read_int, 5, [1, 2, 3, 4, 5]);
-bench_num!(int_6, read_int, 6, [1, 2, 3, 4, 5, 6]);
-bench_num!(int_7, read_int, 7, [1, 2, 3, 4, 5, 6, 7]);
-bench_num!(int_8, read_int, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/session.vim
+++ /dev/null
@@ -1,1 +0,0 @@
-au BufWritePost *.rs silent!make ctags > /dev/null 2>&1
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/src/lib.rs
+++ /dev/null
@@ -1,802 +0,0 @@
-/*!
-This crate provides convenience methods for encoding and decoding numbers
-in either big-endian or little-endian order.
-
-The organization of the crate is pretty simple. A trait, `ByteOrder`, specifies
-byte conversion methods for each type of number in Rust (sans numbers that have
-a platform dependent size like `usize` and `isize`). Two types, `BigEndian`
-and `LittleEndian` implement these methods. Finally, `ReadBytesExt` and
-`WriteBytesExt` provide convenience methods available to all types that
-implement `Read` and `Write`.
-
-# Examples
-
-Read unsigned 16 bit big-endian integers from a `Read` type:
-
-```rust
-use std::io::Cursor;
-use byteorder::{BigEndian, ReadBytesExt};
-
-let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
-// Note that we use type parameters to indicate which kind of byte order
-// we want!
-assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
-assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
-```
-
-Write unsigned 16 bit little-endian integers to a `Write` type:
-
-```rust
-use byteorder::{LittleEndian, WriteBytesExt};
-
-let mut wtr = vec![];
-wtr.write_u16::<LittleEndian>(517).unwrap();
-wtr.write_u16::<LittleEndian>(768).unwrap();
-assert_eq!(wtr, vec![5, 2, 0, 3]);
-```
-*/
-
-#![crate_name = "byteorder"]
-#![doc(html_root_url = "http://burntsushi.net/rustdoc/byteorder")]
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-#![deny(missing_docs)]
-
-#[cfg(feature = "std")]
-extern crate core;
-
-use core::mem::transmute;
-use core::ptr::copy_nonoverlapping;
-
-#[cfg(feature = "std")]
-pub use new::{ReadBytesExt, WriteBytesExt};
-
-#[cfg(feature = "std")]
-mod new;
-
-#[inline]
-fn extend_sign(val: u64, nbytes: usize) -> i64 {
-    let shift = (8 - nbytes) * 8;
-    (val << shift) as i64 >> shift
-}
-
-#[inline]
-fn unextend_sign(val: i64, nbytes: usize) -> u64 {
-    let shift = (8 - nbytes) * 8;
-    (val << shift) as u64 >> shift
-}
-
-#[inline]
-fn pack_size(n: u64) -> usize {
-    if n < 1 << 8 {
-        1
-    } else if n < 1 << 16 {
-        2
-    } else if n < 1 << 24 {
-        3
-    } else if n < 1 << 32 {
-        4
-    } else if n < 1 << 40 {
-        5
-    } else if n < 1 << 48 {
-        6
-    } else if n < 1 << 56 {
-        7
-    } else {
-        8
-    }
-}
-
-/// ByteOrder describes types that can serialize integers as bytes.
-///
-/// Note that `Self` does not appear anywhere in this trait's definition!
-/// Therefore, in order to use it, you'll need to use syntax like
-/// `T::read_u16(&[0, 1])` where `T` implements `ByteOrder`.
-///
-/// This crate provides two types that implement `ByteOrder`: `BigEndian`
-/// and `LittleEndian`.
-///
-/// # Examples
-///
-/// Write and read `u32` numbers in little endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, LittleEndian};
-///
-/// let mut buf = [0; 4];
-/// LittleEndian::write_u32(&mut buf, 1_000_000);
-/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-/// ```
-///
-/// Write and read `i16` numbers in big endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, BigEndian};
-///
-/// let mut buf = [0; 2];
-/// BigEndian::write_i16(&mut buf, -50_000);
-/// assert_eq!(-50_000, BigEndian::read_i16(&buf));
-/// ```
-pub trait ByteOrder {
-    /// Reads an unsigned 16 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 2`.
-    fn read_u16(buf: &[u8]) -> u16;
-
-    /// Reads an unsigned 32 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 4`.
-    fn read_u32(buf: &[u8]) -> u32;
-
-    /// Reads an unsigned 64 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 8`.
-    fn read_u64(buf: &[u8]) -> u64;
-
-    /// Reads an unsigned n-bytes integer from `buf`.
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 8` or
-    /// `buf.len() < nbytes`
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64;
-
-    /// Writes an unsigned 16 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 2`.
-    fn write_u16(buf: &mut [u8], n: u16);
-
-    /// Writes an unsigned 32 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 4`.
-    fn write_u32(buf: &mut [u8], n: u32);
-
-    /// Writes an unsigned 64 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 8`.
-    fn write_u64(buf: &mut [u8], n: u64);
-
-    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
-    /// this method panics.
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize);
-
-    /// Reads a signed 16 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 2`.
-    #[inline]
-    fn read_i16(buf: &[u8]) -> i16 {
-        Self::read_u16(buf) as i16
-    }
-
-    /// Reads a signed 32 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 4`.
-    #[inline]
-    fn read_i32(buf: &[u8]) -> i32 {
-        Self::read_u32(buf) as i32
-    }
-
-    /// Reads a signed 64 bit integer from `buf`.
-    ///
-    /// Panics when `buf.len() < 8`.
-    #[inline]
-    fn read_i64(buf: &[u8]) -> i64 {
-        Self::read_u64(buf) as i64
-    }
-
-    /// Reads a signed n-bytes integer from `buf`.
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 8` or
-    /// `buf.len() < nbytes`
-    #[inline]
-    fn read_int(buf: &[u8], nbytes: usize) -> i64 {
-        extend_sign(Self::read_uint(buf, nbytes), nbytes)
-    }
-
-    /// Reads a IEEE754 single-precision (4 bytes) floating point number.
-    ///
-    /// Panics when `buf.len() < 4`.
-    #[inline]
-    fn read_f32(buf: &[u8]) -> f32 {
-        unsafe { transmute(Self::read_u32(buf)) }
-    }
-
-    /// Reads a IEEE754 double-precision (8 bytes) floating point number.
-    ///
-    /// Panics when `buf.len() < 8`.
-    #[inline]
-    fn read_f64(buf: &[u8]) -> f64 {
-        unsafe { transmute(Self::read_u64(buf)) }
-    }
-
-    /// Writes a signed 16 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 2`.
-    #[inline]
-    fn write_i16(buf: &mut [u8], n: i16) {
-        Self::write_u16(buf, n as u16)
-    }
-
-    /// Writes a signed 32 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 4`.
-    #[inline]
-    fn write_i32(buf: &mut [u8], n: i32) {
-        Self::write_u32(buf, n as u32)
-    }
-
-    /// Writes a signed 64 bit integer `n` to `buf`.
-    ///
-    /// Panics when `buf.len() < 8`.
-    #[inline]
-    fn write_i64(buf: &mut [u8], n: i64) {
-        Self::write_u64(buf, n as u64)
-    }
-
-    /// Writes a signed integer `n` to `buf` using only `nbytes`.
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
-    /// this method panics.
-    #[inline]
-    fn write_int(buf: &mut [u8], n: i64, nbytes: usize) {
-        Self::write_uint(buf, unextend_sign(n, nbytes), nbytes)
-    }
-
-    /// Writes a IEEE754 single-precision (4 bytes) floating point number.
-    ///
-    /// Panics when `buf.len() < 4`.
-    #[inline]
-    fn write_f32(buf: &mut [u8], n: f32) {
-        Self::write_u32(buf, unsafe { transmute(n) })
-    }
-
-    /// Writes a IEEE754 double-precision (8 bytes) floating point number.
-    ///
-    /// Panics when `buf.len() < 8`.
-    #[inline]
-    fn write_f64(buf: &mut [u8], n: f64) {
-        Self::write_u64(buf, unsafe { transmute(n) })
-    }
-}
-
-/// Defines big-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-#[allow(missing_copy_implementations)] pub enum BigEndian {}
-
-/// Defines little-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-#[allow(missing_copy_implementations)] pub enum LittleEndian {}
-
-/// Defines network byte order serialization.
-///
-/// Network byte order is defined by [RFC 1700][1] to be big-endian, and is
-/// referred to in several protocol specifications.  This type is an alias of
-/// BigEndian.
-///
-/// [1]: https://tools.ietf.org/html/rfc1700
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-pub type NetworkEndian = BigEndian;
-
-/// Defines system native-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-#[cfg(target_endian = "little")]
-pub type NativeEndian = LittleEndian;
-
-/// Defines system native-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-#[cfg(target_endian = "big")]
-pub type NativeEndian = BigEndian;
-
-macro_rules! read_num_bytes {
-    ($ty:ty, $size:expr, $src:expr, $which:ident) => ({
-        assert!($size == ::core::mem::size_of::<$ty>());
-        assert!($size <= $src.len());
-        let mut data: $ty = 0;
-        unsafe {
-            copy_nonoverlapping(
-                $src.as_ptr(),
-                &mut data as *mut $ty as *mut u8,
-                $size);
-        }
-        data.$which()
-    });
-}
-
-macro_rules! write_num_bytes {
-    ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => ({
-        assert!($size <= $dst.len());
-        unsafe {
-            // N.B. https://github.com/rust-lang/rust/issues/22776
-            let bytes = transmute::<_, [u8; $size]>($n.$which());
-            copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size);
-        }
-    });
-}
-
-impl ByteOrder for BigEndian {
-    #[inline]
-    fn read_u16(buf: &[u8]) -> u16 {
-        read_num_bytes!(u16, 2, buf, to_be)
-    }
-
-    #[inline]
-    fn read_u32(buf: &[u8]) -> u32 {
-        read_num_bytes!(u32, 4, buf, to_be)
-    }
-
-    #[inline]
-    fn read_u64(buf: &[u8]) -> u64 {
-        read_num_bytes!(u64, 8, buf, to_be)
-    }
-
-    #[inline]
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
-        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
-        let mut out = [0u8; 8];
-        let ptr_out = out.as_mut_ptr();
-        unsafe {
-            copy_nonoverlapping(
-                buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes);
-            (*(ptr_out as *const u64)).to_be()
-        }
-    }
-
-    #[inline]
-    fn write_u16(buf: &mut [u8], n: u16) {
-        write_num_bytes!(u16, 2, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_u32(buf: &mut [u8], n: u32) {
-        write_num_bytes!(u32, 4, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_u64(buf: &mut [u8], n: u64) {
-        write_num_bytes!(u64, 8, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
-        assert!(pack_size(n) <= nbytes && nbytes <= 8);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes: [u8; 8] = transmute(n.to_be());
-            copy_nonoverlapping(
-                bytes.as_ptr().offset((8 - nbytes) as isize),
-                buf.as_mut_ptr(),
-                nbytes);
-        }
-    }
-}
-
-impl ByteOrder for LittleEndian {
-    #[inline]
-    fn read_u16(buf: &[u8]) -> u16 {
-        read_num_bytes!(u16, 2, buf, to_le)
-    }
-
-    #[inline]
-    fn read_u32(buf: &[u8]) -> u32 {
-        read_num_bytes!(u32, 4, buf, to_le)
-    }
-
-    #[inline]
-    fn read_u64(buf: &[u8]) -> u64 {
-        read_num_bytes!(u64, 8, buf, to_le)
-    }
-
-    #[inline]
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
-        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
-        let mut out = [0u8; 8];
-        let ptr_out = out.as_mut_ptr();
-        unsafe {
-            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
-            (*(ptr_out as *const u64)).to_le()
-        }
-    }
-
-    #[inline]
-    fn write_u16(buf: &mut [u8], n: u16) {
-        write_num_bytes!(u16, 2, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_u32(buf: &mut [u8], n: u32) {
-        write_num_bytes!(u32, 4, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_u64(buf: &mut [u8], n: u64) {
-        write_num_bytes!(u64, 8, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
-        assert!(pack_size(n as u64) <= nbytes && nbytes <= 8);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes: [u8; 8] = transmute(n.to_le());
-            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
-        }
-    }
-}
-
-#[cfg(test)]
-mod test {
-    extern crate quickcheck;
-    extern crate rand;
-
-    use test::rand::thread_rng;
-    use test::quickcheck::{QuickCheck, StdGen, Testable};
-
-    const U64_MAX: u64 = ::std::u64::MAX;
-    const I64_MAX: u64 = ::std::i64::MAX as u64;
-
-    fn qc_sized<A: Testable>(f: A, size: u64) {
-        QuickCheck::new()
-            .gen(StdGen::new(thread_rng(), size as usize))
-            .tests(1_00)
-            .max_tests(10_000)
-            .quickcheck(f);
-    }
-
-    macro_rules! qc_byte_order {
-        ($name:ident, $ty_int:ident, $max:expr,
-         $bytes:expr, $read:ident, $write:ident) => (
-            mod $name {
-                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
-                use super::qc_sized;
-
-                #[test]
-                fn big_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 8];
-                        BigEndian::$write(&mut buf, n, $bytes);
-                        n == BigEndian::$read(&mut buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-
-                #[test]
-                fn little_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 8];
-                        LittleEndian::$write(&mut buf, n, $bytes);
-                        n == LittleEndian::$read(&mut buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-
-                #[test]
-                fn native_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 8];
-                        NativeEndian::$write(&mut buf, n, $bytes);
-                        n == NativeEndian::$read(&mut buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-            }
-        );
-        ($name:ident, $ty_int:ident, $max:expr,
-         $read:ident, $write:ident) => (
-            mod $name {
-                use std::mem::size_of;
-                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
-                use super::qc_sized;
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 8];
-                        BigEndian::$write(&mut buf[8 - bytes..], n);
-                        n == BigEndian::$read(&mut buf[8 - bytes..])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 8];
-                        LittleEndian::$write(&mut buf[..bytes], n);
-                        n == LittleEndian::$read(&mut buf[..bytes])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 8];
-                        NativeEndian::$write(&mut buf[..bytes], n);
-                        n == NativeEndian::$read(&mut buf[..bytes])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-            }
-        );
-    }
-
-    qc_byte_order!(prop_u16, u16, ::std::u16::MAX as u64, read_u16, write_u16);
-    qc_byte_order!(prop_i16, i16, ::std::i16::MAX as u64, read_i16, write_i16);
-    qc_byte_order!(prop_u32, u32, ::std::u32::MAX as u64, read_u32, write_u32);
-    qc_byte_order!(prop_i32, i32, ::std::i32::MAX as u64, read_i32, write_i32);
-    qc_byte_order!(prop_u64, u64, ::std::u64::MAX as u64, read_u64, write_u64);
-    qc_byte_order!(prop_i64, i64, ::std::i64::MAX as u64, read_i64, write_i64);
-    qc_byte_order!(prop_f32, f32, ::std::u64::MAX as u64, read_f32, write_f32);
-    qc_byte_order!(prop_f64, f64, ::std::i64::MAX as u64, read_f64, write_f64);
-
-    qc_byte_order!(prop_uint_1, u64, super::U64_MAX, 1, read_uint, write_uint);
-    qc_byte_order!(prop_uint_2, u64, super::U64_MAX, 2, read_uint, write_uint);
-    qc_byte_order!(prop_uint_3, u64, super::U64_MAX, 3, read_uint, write_uint);
-    qc_byte_order!(prop_uint_4, u64, super::U64_MAX, 4, read_uint, write_uint);
-    qc_byte_order!(prop_uint_5, u64, super::U64_MAX, 5, read_uint, write_uint);
-    qc_byte_order!(prop_uint_6, u64, super::U64_MAX, 6, read_uint, write_uint);
-    qc_byte_order!(prop_uint_7, u64, super::U64_MAX, 7, read_uint, write_uint);
-    qc_byte_order!(prop_uint_8, u64, super::U64_MAX, 8, read_uint, write_uint);
-
-    qc_byte_order!(prop_int_1, i64, super::I64_MAX, 1, read_int, write_int);
-    qc_byte_order!(prop_int_2, i64, super::I64_MAX, 2, read_int, write_int);
-    qc_byte_order!(prop_int_3, i64, super::I64_MAX, 3, read_int, write_int);
-    qc_byte_order!(prop_int_4, i64, super::I64_MAX, 4, read_int, write_int);
-    qc_byte_order!(prop_int_5, i64, super::I64_MAX, 5, read_int, write_int);
-    qc_byte_order!(prop_int_6, i64, super::I64_MAX, 6, read_int, write_int);
-    qc_byte_order!(prop_int_7, i64, super::I64_MAX, 7, read_int, write_int);
-    qc_byte_order!(prop_int_8, i64, super::I64_MAX, 8, read_int, write_int);
-
-    macro_rules! qc_bytes_ext {
-        ($name:ident, $ty_int:ident, $max:expr,
-         $bytes:expr, $read:ident, $write:ident) => (
-            mod $name {
-                use std::io::Cursor;
-                use {
-                    ReadBytesExt, WriteBytesExt,
-                    BigEndian, NativeEndian, LittleEndian,
-                };
-                use super::qc_sized;
-
-                #[test]
-                fn big_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<BigEndian>(n).unwrap();
-                        let mut rdr = Vec::new();
-                        rdr.extend(wtr[8 - $bytes..].iter().map(|&x|x));
-                        let mut rdr = Cursor::new(rdr);
-                        n == rdr.$read::<BigEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-
-                #[test]
-                fn little_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<LittleEndian>(n).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<LittleEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-
-                #[test]
-                fn native_endian() {
-                    let max = ($max - 1) >> (8 * (8 - $bytes));
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<NativeEndian>(n).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<NativeEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, max);
-                }
-            }
-        );
-        ($name:ident, $ty_int:ident, $max:expr, $read:ident, $write:ident) => (
-            mod $name {
-                use std::io::Cursor;
-                use {
-                    ReadBytesExt, WriteBytesExt,
-                    BigEndian, NativeEndian, LittleEndian,
-                };
-                use super::qc_sized;
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<BigEndian>(n).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<BigEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<LittleEndian>(n).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<LittleEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<NativeEndian>(n).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<NativeEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-            }
-        );
-    }
-
-    qc_bytes_ext!(prop_ext_u16, u16, ::std::u16::MAX as u64, read_u16, write_u16);
-    qc_bytes_ext!(prop_ext_i16, i16, ::std::i16::MAX as u64, read_i16, write_i16);
-    qc_bytes_ext!(prop_ext_u32, u32, ::std::u32::MAX as u64, read_u32, write_u32);
-    qc_bytes_ext!(prop_ext_i32, i32, ::std::i32::MAX as u64, read_i32, write_i32);
-    qc_bytes_ext!(prop_ext_u64, u64, ::std::u64::MAX as u64, read_u64, write_u64);
-    qc_bytes_ext!(prop_ext_i64, i64, ::std::i64::MAX as u64, read_i64, write_i64);
-    qc_bytes_ext!(prop_ext_f32, f32, ::std::u64::MAX as u64, read_f32, write_f32);
-    qc_bytes_ext!(prop_ext_f64, f64, ::std::i64::MAX as u64, read_f64, write_f64);
-
-    qc_bytes_ext!(prop_ext_uint_1, u64, super::U64_MAX, 1, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_2, u64, super::U64_MAX, 2, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_3, u64, super::U64_MAX, 3, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_4, u64, super::U64_MAX, 4, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_5, u64, super::U64_MAX, 5, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_6, u64, super::U64_MAX, 6, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_7, u64, super::U64_MAX, 7, read_uint, write_u64);
-    qc_bytes_ext!(prop_ext_uint_8, u64, super::U64_MAX, 8, read_uint, write_u64);
-
-    qc_bytes_ext!(prop_ext_int_1, i64, super::I64_MAX, 1, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_2, i64, super::I64_MAX, 2, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_3, i64, super::I64_MAX, 3, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_4, i64, super::I64_MAX, 4, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_5, i64, super::I64_MAX, 5, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_6, i64, super::I64_MAX, 6, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_7, i64, super::I64_MAX, 7, read_int, write_i64);
-    qc_bytes_ext!(prop_ext_int_8, i64, super::I64_MAX, 8, read_int, write_i64);
-
-    // Test that all of the byte conversion functions panic when given a
-    // buffer that is too small.
-    //
-    // These tests are critical to ensure safety, otherwise we might end up
-    // with a buffer overflow.
-    macro_rules! too_small {
-        ($name:ident, $maximally_small:expr, $zero:expr,
-         $read:ident, $write:ident) => (
-            mod $name {
-                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
-
-                #[test]
-                #[should_panic]
-                fn read_big_endian() {
-                    let buf = [0; $maximally_small];
-                    BigEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_little_endian() {
-                    let buf = [0; $maximally_small];
-                    LittleEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_native_endian() {
-                    let buf = [0; $maximally_small];
-                    NativeEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_big_endian() {
-                    let mut buf = [0; $maximally_small];
-                    BigEndian::$write(&mut buf, $zero);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_little_endian() {
-                    let mut buf = [0; $maximally_small];
-                    LittleEndian::$write(&mut buf, $zero);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_native_endian() {
-                    let mut buf = [0; $maximally_small];
-                    NativeEndian::$write(&mut buf, $zero);
-                }
-            }
-        );
-        ($name:ident, $maximally_small:expr, $read:ident) => (
-            mod $name {
-                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
-
-                #[test]
-                #[should_panic]
-                fn read_big_endian() {
-                    let buf = [0; $maximally_small];
-                    BigEndian::$read(&buf, $maximally_small + 1);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_little_endian() {
-                    let buf = [0; $maximally_small];
-                    LittleEndian::$read(&buf, $maximally_small + 1);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_native_endian() {
-                    let buf = [0; $maximally_small];
-                    NativeEndian::$read(&buf, $maximally_small + 1);
-                }
-            }
-        );
-    }
-
-    too_small!(small_u16, 1, 0, read_u16, write_u16);
-    too_small!(small_i16, 1, 0, read_i16, write_i16);
-    too_small!(small_u32, 3, 0, read_u32, write_u32);
-    too_small!(small_i32, 3, 0, read_i32, write_i32);
-    too_small!(small_u64, 7, 0, read_u64, write_u64);
-    too_small!(small_i64, 7, 0, read_i64, write_i64);
-    too_small!(small_f32, 3, 0.0, read_f32, write_f32);
-    too_small!(small_f64, 7, 0.0, read_f64, write_f64);
-
-    too_small!(small_uint_1, 1, read_uint);
-    too_small!(small_uint_2, 2, read_uint);
-    too_small!(small_uint_3, 3, read_uint);
-    too_small!(small_uint_4, 4, read_uint);
-    too_small!(small_uint_5, 5, read_uint);
-    too_small!(small_uint_6, 6, read_uint);
-    too_small!(small_uint_7, 7, read_uint);
-
-    too_small!(small_int_1, 1, read_int);
-    too_small!(small_int_2, 2, read_int);
-    too_small!(small_int_3, 3, read_int);
-    too_small!(small_int_4, 4, read_int);
-    too_small!(small_int_5, 5, read_int);
-    too_small!(small_int_6, 6, read_int);
-    too_small!(small_int_7, 7, read_int);
-
-    #[test]
-    fn uint_bigger_buffer() {
-        use {ByteOrder, LittleEndian};
-        let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5);
-        assert_eq!(n, 0x0504030201);
-    }
-}
deleted file mode 100644
--- a/third_party/rust/byteorder-0.5.3/src/new.rs
+++ /dev/null
@@ -1,269 +0,0 @@
-use std::io::{self, Result};
-
-use ByteOrder;
-
-/// Extends `Read` with methods for reading numbers. (For `std::io`.)
-///
-/// Most of the methods defined here have an unconstrained type parameter that
-/// must be explicitly instantiated. Typically, it is instantiated with either
-/// the `BigEndian` or `LittleEndian` types defined in this crate.
-///
-/// # Examples
-///
-/// Read unsigned 16 bit big-endian integers from a `Read`:
-///
-/// ```rust
-/// use std::io::Cursor;
-/// use byteorder::{BigEndian, ReadBytesExt};
-///
-/// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
-/// assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
-/// assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
-/// ```
-pub trait ReadBytesExt: io::Read {
-    /// Reads an unsigned 8 bit integer from the underlying reader.
-    ///
-    /// Note that since this reads a single byte, no byte order conversions
-    /// are used. It is included for completeness.
-    #[inline]
-    fn read_u8(&mut self) -> Result<u8> {
-        let mut buf = [0; 1];
-        try!(self.read_exact(&mut buf));
-        Ok(buf[0])
-    }
-
-    /// Reads a signed 8 bit integer from the underlying reader.
-    ///
-    /// Note that since this reads a single byte, no byte order conversions
-    /// are used. It is included for completeness.
-    #[inline]
-    fn read_i8(&mut self) -> Result<i8> {
-        let mut buf = [0; 1];
-        try!(self.read_exact(&mut buf));
-        Ok(buf[0] as i8)
-    }
-
-    /// Reads an unsigned 16 bit integer from the underlying reader.
-    #[inline]
-    fn read_u16<T: ByteOrder>(&mut self) -> Result<u16> {
-        let mut buf = [0; 2];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_u16(&buf))
-    }
-
-    /// Reads a signed 16 bit integer from the underlying reader.
-    #[inline]
-    fn read_i16<T: ByteOrder>(&mut self) -> Result<i16> {
-        let mut buf = [0; 2];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_i16(&buf))
-    }
-
-    /// Reads an unsigned 32 bit integer from the underlying reader.
-    #[inline]
-    fn read_u32<T: ByteOrder>(&mut self) -> Result<u32> {
-        let mut buf = [0; 4];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_u32(&buf))
-    }
-
-    /// Reads a signed 32 bit integer from the underlying reader.
-    #[inline]
-    fn read_i32<T: ByteOrder>(&mut self) -> Result<i32> {
-        let mut buf = [0; 4];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_i32(&buf))
-    }
-
-    /// Reads an unsigned 64 bit integer from the underlying reader.
-    #[inline]
-    fn read_u64<T: ByteOrder>(&mut self) -> Result<u64> {
-        let mut buf = [0; 8];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_u64(&buf))
-    }
-
-    /// Reads a signed 64 bit integer from the underlying reader.
-    #[inline]
-    fn read_i64<T: ByteOrder>(&mut self) -> Result<i64> {
-        let mut buf = [0; 8];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_i64(&buf))
-    }
-
-    /// Reads an unsigned n-bytes integer from the underlying reader.
-    #[inline]
-    fn read_uint<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u64> {
-        let mut buf = [0; 8];
-        try!(self.read_exact(&mut buf[..nbytes]));
-        Ok(T::read_uint(&buf[..nbytes], nbytes))
-    }
-
-    /// Reads a signed n-bytes integer from the underlying reader.
-    #[inline]
-    fn read_int<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i64> {
-        let mut buf = [0; 8];
-        try!(self.read_exact(&mut buf[..nbytes]));
-        Ok(T::read_int(&buf[..nbytes], nbytes))
-    }
-
-    /// Reads a IEEE754 single-precision (4 bytes) floating point number from
-    /// the underlying reader.
-    #[inline]
-    fn read_f32<T: ByteOrder>(&mut self) -> Result<f32> {
-        let mut buf = [0; 4];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_f32(&buf))
-    }
-
-    /// Reads a IEEE754 double-precision (8 bytes) floating point number from
-    /// the underlying reader.
-    #[inline]
-    fn read_f64<T: ByteOrder>(&mut self) -> Result<f64> {
-        let mut buf = [0; 8];
-        try!(self.read_exact(&mut buf));
-        Ok(T::read_f64(&buf))
-    }
-}
-
-/// All types that implement `Read` get methods defined in `ReadBytesExt`
-/// for free.
-impl<R: io::Read + ?Sized> ReadBytesExt for R {}
-
-/// Extends `Write` with methods for writing numbers. (For `std::io`.)
-///
-/// Most of the methods defined here have an unconstrained type parameter that
-/// must be explicitly instantiated. Typically, it is instantiated with either
-/// the `BigEndian` or `LittleEndian` types defined in this crate.
-///
-/// # Examples
-///
-/// Write unsigned 16 bit big-endian integers to a `Write`:
-///
-/// ```rust
-/// use byteorder::{BigEndian, WriteBytesExt};
-///
-/// let mut wtr = vec![];
-/// wtr.write_u16::<BigEndian>(517).unwrap();
-/// wtr.write_u16::<BigEndian>(768).unwrap();
-/// assert_eq!(wtr, vec![2, 5, 3, 0]);
-/// ```
-pub trait WriteBytesExt: io::Write {
-    /// Writes an unsigned 8 bit integer to the underlying writer.
-    ///
-    /// Note that since this writes a single byte, no byte order conversions
-    /// are used. It is included for completeness.
-    #[inline]
-    fn write_u8(&mut self, n: u8) -> Result<()> {
-        self.write_all(&[n])
-    }
-
-    /// Writes a signed 8 bit integer to the underlying writer.
-    ///
-    /// Note that since this writes a single byte, no byte order conversions
-    /// are used. It is included for completeness.
-    #[inline]
-    fn write_i8(&mut self, n: i8) -> Result<()> {
-        self.write_all(&[n as u8])
-    }
-
-    /// Writes an unsigned 16 bit integer to the underlying writer.
-    #[inline]
-    fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()> {
-        let mut buf = [0; 2];
-        T::write_u16(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes a signed 16 bit integer to the underlying writer.
-    #[inline]
-    fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()> {
-        let mut buf = [0; 2];
-        T::write_i16(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes an unsigned 32 bit integer to the underlying writer.
-    #[inline]
-    fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()> {
-        let mut buf = [0; 4];
-        T::write_u32(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes a signed 32 bit integer to the underlying writer.
-    #[inline]
-    fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()> {
-        let mut buf = [0; 4];
-        T::write_i32(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes an unsigned 64 bit integer to the underlying writer.
-    #[inline]
-    fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> {
-        let mut buf = [0; 8];
-        T::write_u64(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes a signed 64 bit integer to the underlying writer.
-    #[inline]
-    fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> {
-        let mut buf = [0; 8];
-        T::write_i64(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes an unsigned n-bytes integer to the underlying writer.
-    ///
-    /// If the given integer is not representable in the given number of bytes,
-    /// this method panics. If `nbytes > 8`, this method panics.
-    #[inline]
-    fn write_uint<T: ByteOrder>(
-        &mut self,
-        n: u64,
-        nbytes: usize,
-    ) -> Result<()> {
-        let mut buf = [0; 8];
-        T::write_uint(&mut buf, n, nbytes);
-        self.write_all(&buf[0..nbytes])
-    }
-
-    /// Writes a signed n-bytes integer to the underlying writer.
-    ///
-    /// If the given integer is not representable in the given number of bytes,
-    /// this method panics. If `nbytes > 8`, this method panics.
-    #[inline]
-    fn write_int<T: ByteOrder>(
-        &mut self,
-        n: i64,
-        nbytes: usize,
-    ) -> Result<()> {
-        let mut buf = [0; 8];
-        T::write_int(&mut buf, n, nbytes);
-        self.write_all(&buf[0..nbytes])
-    }
-
-    /// Writes a IEEE754 single-precision (4 bytes) floating point number to
-    /// the underlying writer.
-    #[inline]
-    fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()> {
-        let mut buf = [0; 4];
-        T::write_f32(&mut buf, n);
-        self.write_all(&buf)
-    }
-
-    /// Writes a IEEE754 double-precision (8 bytes) floating point number to
-    /// the underlying writer.
-    #[inline]
-    fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()> {
-        let mut buf = [0; 8];
-        T::write_f64(&mut buf, n);
-        self.write_all(&buf)
-    }
-}
-
-/// All types that implement `Write` get methods defined in `WriteBytesExt`
-/// for free.
-impl<W: io::Write + ?Sized> WriteBytesExt for W {}
--- a/third_party/rust/clang-sys/.cargo-checksum.json
+++ b/third_party/rust/clang-sys/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitattributes":"e753774a5c6c845d5b43db5e4e133c8b7308c233f036517be1e2ae01cb068790",".gitignore":"09cd366a44271073e57584376fd326da166664cd8ff303c2839b63a330557c73",".travis.yml":"0e15437c62f94132e2126b56341c415464f7dc02a35cc0794d8abcc24a2e9585","CHANGELOG.md":"37b2280e140dde6b05ba6e9d40485c6f895681b5c8ccdbee806965901e004673","CONTRIBUTING.md":"51b266af19f050c21549e2ae17445397d9d81eec30bc82490c01a69e288883e6","Cargo.toml":"c6cc9d08f5fdb7681a30704c6a9e0e33f4e4fc48f54775d283afb92fba1fd5fe","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"2a21a5fcc9bde7e34984f7d2c65e3fa7c49dcb064944418a58fc77d0ef1f311f","appveyor.yml":"612ad2e0be15a8d339fb8be2fc6ac317d5e6da84886f0f322af399bb1bc28591","build.rs":"804982dacd98f85c0b64d85cb4e96e4f4789a1522e6443674447a1359d6f3e9a","ci/before_install.sh":"025b6b7ac157ea43ab602bf770740929ee45aa6bf6832674c06356c380640230","ci/install.bat":"a81cc40ad9f75fd8448f0f15536c426352ad8ad6809eaf564925b709c458aade","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"6240fb92d8d70126deedcf38cab49a31e5fc5364a3b13e7d4bb3e4654b352446","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"67783882b446e3d732fb23e7e5d18986b9546abf8fefbfcec99da12f9b1279cd","src/link.rs":"2f4b9fadc4d565702aa3ef9bc4a9945cd6b68a1e7bd7d0daf74067a4cc624b60","src/support.rs":"c44373478c7ad699740ada941735f9bc49d3e17e5bf3c553683d0143d97171b0","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"9225ffcaa892a3901c0dce9f8190421db8fb17651499b4de765b87f08daaf5b2"},"package":"822ea22bbbef9f5934e9477860545fb0311a1759e43a276de42e2856c605aa2b"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"09cd366a44271073e57584376fd326da166664cd8ff303c2839b63a330557c73",".travis.yml":"0e15437c62f94132e2126b56341c415464f7dc02a35cc0794d8abcc24a2e9585","CHANGELOG.md":"37b2280e140dde6b05ba6e9d40485c6f895681b5c8ccdbee806965901e004673","CONTRIBUTING.md":"51b266af19f050c21549e2ae17445397d9d81eec30bc82490c01a69e288883e6","Cargo.toml":"c6cc9d08f5fdb7681a30704c6a9e0e33f4e4fc48f54775d283afb92fba1fd5fe","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"2a21a5fcc9bde7e34984f7d2c65e3fa7c49dcb064944418a58fc77d0ef1f311f","appveyor.yml":"612ad2e0be15a8d339fb8be2fc6ac317d5e6da84886f0f322af399bb1bc28591","build.rs":"804982dacd98f85c0b64d85cb4e96e4f4789a1522e6443674447a1359d6f3e9a","ci/before_install.sh":"025b6b7ac157ea43ab602bf770740929ee45aa6bf6832674c06356c380640230","ci/install.bat":"a81cc40ad9f75fd8448f0f15536c426352ad8ad6809eaf564925b709c458aade","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"6240fb92d8d70126deedcf38cab49a31e5fc5364a3b13e7d4bb3e4654b352446","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"67783882b446e3d732fb23e7e5d18986b9546abf8fefbfcec99da12f9b1279cd","src/link.rs":"2f4b9fadc4d565702aa3ef9bc4a9945cd6b68a1e7bd7d0daf74067a4cc624b60","src/support.rs":"c44373478c7ad699740ada941735f9bc49d3e17e5bf3c553683d0143d97171b0","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"9225ffcaa892a3901c0dce9f8190421db8fb17651499b4de765b87f08daaf5b2"},"package":"822ea22bbbef9f5934e9477860545fb0311a1759e43a276de42e2856c605aa2b"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/clang-sys/.gitattributes
+++ /dev/null
@@ -1,1 +0,0 @@
-* text=auto
copy from third_party/rust/core-foundation/.cargo-checksum.json
copy to third_party/rust/core-foundation-0.2.3/.cargo-checksum.json
rename from third_party/rust/byteorder-0.5.3/.cargo-ok
rename to third_party/rust/core-foundation-0.2.3/.cargo-ok
copy from third_party/rust/core-foundation/Cargo.toml
copy to third_party/rust/core-foundation-0.2.3/Cargo.toml
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/array.rs
@@ -0,0 +1,160 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Heterogeneous immutable arrays.
+
+pub use core_foundation_sys::array::*;
+pub use core_foundation_sys::base::{CFIndex, CFRelease};
+use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
+use libc::c_void;
+use std::mem;
+
+use base::{CFIndexConvertible, TCFType, CFRange};
+
+/// A heterogeneous immutable array.
+pub struct CFArray(CFArrayRef);
+
+impl Drop for CFArray {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+pub struct CFArrayIterator<'a> {
+    array: &'a CFArray,
+    index: CFIndex,
+}
+
+impl<'a> Iterator for CFArrayIterator<'a> {
+    type Item = *const c_void;
+
+    fn next(&mut self) -> Option<*const c_void> {
+        if self.index >= self.array.len() {
+            None
+        } else {
+            let value = self.array.get(self.index);
+            self.index += 1;
+            Some(value)
+        }
+    }
+}
+
+impl_TCFType!(CFArray, CFArrayRef, CFArrayGetTypeID);
+
+impl CFArray {
+    /// Creates a new `CFArray` with the given elements, which must be `CFType` objects.
+    pub fn from_CFTypes<R, T>(elems: &[T]) -> CFArray where T: TCFType<R> {
+        unsafe {
+            let elems: Vec<CFTypeRef> = elems.iter().map(|elem| elem.as_CFTypeRef()).collect();
+            let array_ref = CFArrayCreate(kCFAllocatorDefault,
+                                          mem::transmute(elems.as_ptr()),
+                                          elems.len().to_CFIndex(),
+                                          &kCFTypeArrayCallBacks);
+            TCFType::wrap_under_create_rule(array_ref)
+        }
+    }
+
+    /// Iterates over the elements of this `CFArray`.
+    ///
+    /// Careful; the loop body must wrap the reference properly. Generally, when array elements are
+    /// Core Foundation objects (not always true), they need to be wrapped with
+    /// `TCFType::wrap_under_get_rule()`.
+    #[inline]
+    pub fn iter<'a>(&'a self) -> CFArrayIterator<'a> {
+        CFArrayIterator {
+            array: self,
+            index: 0
+        }
+    }
+
+    #[inline]
+    pub fn len(&self) -> CFIndex {
+        unsafe {
+            CFArrayGetCount(self.0)
+        }
+    }
+
+    #[inline]
+    pub fn get(&self, index: CFIndex) -> *const c_void {
+        assert!(index < self.len());
+        unsafe {
+            CFArrayGetValueAtIndex(self.0, index)
+        }
+    }
+
+    pub fn get_values(&self, range: CFRange) -> Vec<*const c_void> {
+        let mut vec = Vec::with_capacity(range.length as usize);
+        unsafe {
+            CFArrayGetValues(self.0, range, vec.as_mut_ptr());
+            vec.set_len(range.length as usize);
+            vec
+        }
+    }
+
+    pub fn get_all_values(&self) -> Vec<*const c_void> {
+        self.get_values(CFRange {
+            location: 0,
+            length: self.len()
+        })
+    }
+}
+
+impl<'a> IntoIterator for &'a CFArray {
+    type Item = *const c_void;
+    type IntoIter = CFArrayIterator<'a>;
+
+    fn into_iter(self) -> CFArrayIterator<'a> {
+        self.iter()
+    }
+}
+
+#[test]
+fn should_box_and_unbox() {
+    use number::{CFNumber, number};
+
+    let n1 = number(1);
+    let n2 = number(2);
+    let n3 = number(3);
+    let n4 = number(4);
+    let n5 = number(5);
+
+    let arr = CFArray::from_CFTypes(&[
+        n1.as_CFType(),
+        n2.as_CFType(),
+        n3.as_CFType(),
+        n4.as_CFType(),
+        n5.as_CFType(),
+    ]);
+
+    assert!(arr.get_all_values() == &[n1.as_CFTypeRef(),
+                                      n2.as_CFTypeRef(),
+                                      n3.as_CFTypeRef(),
+                                      n4.as_CFTypeRef(),
+                                      n5.as_CFTypeRef()]);
+
+    unsafe {
+        let mut sum = 0;
+
+        for elem in arr.iter() {
+            let number: CFNumber = TCFType::wrap_under_get_rule(mem::transmute(elem));
+            sum += number.to_i64().unwrap()
+        }
+
+        assert!(sum == 15);
+
+        for elem in arr.iter() {
+            let number: CFNumber = TCFType::wrap_under_get_rule(mem::transmute(elem));
+            sum += number.to_i64().unwrap()
+        }
+
+        assert!(sum == 30);
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/base.rs
@@ -0,0 +1,142 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub use core_foundation_sys::base::*;
+
+pub trait CFIndexConvertible {
+    /// Always use this method to construct a `CFIndex` value. It performs bounds checking to
+    /// ensure the value is in range.
+    fn to_CFIndex(self) -> CFIndex;
+}
+
+impl CFIndexConvertible for usize {
+    #[inline]
+    fn to_CFIndex(self) -> CFIndex {
+        let max_CFIndex = CFIndex::max_value();
+        if self > (max_CFIndex as usize) {
+            panic!("value out of range")
+        }
+        self as CFIndex
+    }
+}
+
+/// Superclass of all Core Foundation objects.
+pub struct CFType(CFTypeRef);
+
+impl Clone for CFType {
+    #[inline]
+    fn clone(&self) -> CFType {
+        unsafe {
+            TCFType::wrap_under_get_rule(self.0)
+        }
+    }
+}
+
+impl Drop for CFType {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.0)
+        }
+    }
+}
+
+/// All Core Foundation types implement this trait. The type parameter `TypeRef` specifies the
+/// associated Core Foundation type: e.g. for `CFType` this is `CFTypeRef`; for `CFArray` this is
+/// `CFArrayRef`.
+pub trait TCFType<ConcreteTypeRef> {
+    /// Returns the object as its concrete TypeRef.
+    fn as_concrete_TypeRef(&self) -> ConcreteTypeRef;
+
+    /// Returns an instance of the object, wrapping the underlying `CFTypeRef` subclass. Use this
+    /// when following Core Foundation's "Create Rule". The reference count is *not* bumped.
+    unsafe fn wrap_under_create_rule(obj: ConcreteTypeRef) -> Self;
+
+    /// Returns the type ID for this class.
+    fn type_id() -> CFTypeID;
+
+    /// Returns the object as a wrapped `CFType`. The reference count is incremented by one.
+    #[inline]
+    fn as_CFType(&self) -> CFType {
+        unsafe {
+            TCFType::wrap_under_get_rule(self.as_CFTypeRef())
+        }
+    }
+
+    /// Returns the object as a raw `CFTypeRef`. The reference count is not adjusted.
+    fn as_CFTypeRef(&self) -> CFTypeRef;
+
+    /// Returns an instance of the object, wrapping the underlying `CFTypeRef` subclass. Use this
+    /// when following Core Foundation's "Get Rule". The reference count *is* bumped.
+    unsafe fn wrap_under_get_rule(reference: ConcreteTypeRef) -> Self;
+
+    /// Returns the reference count of the object. It is unwise to do anything other than test
+    /// whether the return value of this method is greater than zero.
+    #[inline]
+    fn retain_count(&self) -> CFIndex {
+        unsafe {
+            CFGetRetainCount(self.as_CFTypeRef())
+        }
+    }
+
+    /// Returns the type ID of this object.
+    #[inline]
+    fn type_of(&self) -> CFTypeID {
+        unsafe {
+            CFGetTypeID(self.as_CFTypeRef())
+        }
+    }
+
+    /// Writes a debugging version of this object on standard error.
+    fn show(&self) {
+        unsafe {
+            CFShow(self.as_CFTypeRef())
+        }
+    }
+
+    /// Returns true if this value is an instance of another type.
+    #[inline]
+    fn instance_of<OtherConcreteTypeRef,OtherCFType:TCFType<OtherConcreteTypeRef>>(&self) -> bool {
+        self.type_of() == <OtherCFType as TCFType<_>>::type_id()
+    }
+}
+
+impl TCFType<CFTypeRef> for CFType {
+    #[inline]
+    fn as_concrete_TypeRef(&self) -> CFTypeRef {
+        self.0
+    }
+
+    #[inline]
+    unsafe fn wrap_under_get_rule(reference: CFTypeRef) -> CFType {
+        let reference: CFTypeRef = CFRetain(reference);
+        TCFType::wrap_under_create_rule(reference)
+    }
+
+    #[inline]
+    fn as_CFTypeRef(&self) -> CFTypeRef {
+        self.as_concrete_TypeRef()
+    }
+
+    #[inline]
+    unsafe fn wrap_under_create_rule(obj: CFTypeRef) -> CFType {
+        CFType(obj)
+    }
+
+    #[inline]
+    fn type_id() -> CFTypeID {
+        // FIXME(pcwalton): Is this right?
+        0
+    }
+
+    #[inline]
+    fn instance_of<OtherConcreteTypeRef,OtherCFType:TCFType<OtherConcreteTypeRef>>(&self) -> bool {
+        // Since this is the root of the type hierarchy, we always answer yes.
+        true
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/boolean.rs
@@ -0,0 +1,44 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! A Boolean type.
+
+use core_foundation_sys::base::{CFRelease};
+pub use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
+
+use base::TCFType;
+
+/// A Boolean type.
+///
+/// FIXME(pcwalton): Should be a newtype struct, but that fails due to a Rust compiler bug.
+pub struct CFBoolean(CFBooleanRef);
+
+impl Drop for CFBoolean {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFBoolean, CFBooleanRef, CFBooleanGetTypeID);
+
+impl CFBoolean {
+    pub fn true_value() -> CFBoolean {
+        unsafe {
+            TCFType::wrap_under_get_rule(kCFBooleanTrue)
+        }
+    }
+
+    pub fn false_value() -> CFBoolean {
+        unsafe {
+            TCFType::wrap_under_get_rule(kCFBooleanFalse)
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/bundle.rs
@@ -0,0 +1,46 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Core Foundation Bundle Type
+
+pub use core_foundation_sys::bundle::*;
+use core_foundation_sys::base::CFRelease;
+
+use base::{TCFType};
+use dictionary::CFDictionary;
+
+/// A Bundle type.
+pub struct CFBundle(CFBundleRef);
+
+impl Drop for CFBundle {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl CFBundle {
+    pub fn main_bundle() -> CFBundle {
+        unsafe {
+            let bundle_ref = CFBundleGetMainBundle();
+            TCFType::wrap_under_get_rule(bundle_ref)
+        }
+    }
+
+    pub fn info_dictionary(&self) -> CFDictionary {
+        unsafe {
+            let info_dictionary = CFBundleGetInfoDictionary(self.0);
+            TCFType::wrap_under_get_rule(info_dictionary)
+        }
+    }
+}
+
+impl_TCFType!(CFBundle, CFBundleRef, CFBundleGetTypeID);
+
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/data.rs
@@ -0,0 +1,68 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Core Foundation byte buffers.
+
+pub use core_foundation_sys::data::*;
+use core_foundation_sys::base::{CFIndex, CFRelease};
+use core_foundation_sys::base::{kCFAllocatorDefault};
+use std::ops::Deref;
+use std::slice;
+
+use base::{CFIndexConvertible, TCFType};
+
+/// A byte buffer.
+pub struct CFData(CFDataRef);
+
+impl Drop for CFData {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFData, CFDataRef, CFDataGetTypeID);
+
+impl CFData {
+    pub fn from_buffer(buffer: &[u8]) -> CFData {
+        unsafe {
+            let data_ref = CFDataCreate(kCFAllocatorDefault,
+                                        buffer.as_ptr(),
+                                        buffer.len().to_CFIndex());
+            TCFType::wrap_under_create_rule(data_ref)
+        }
+    }
+
+    /// Returns a pointer to the underlying bytes in this data. Note that this byte buffer is
+    /// read-only.
+    #[inline]
+    pub fn bytes<'a>(&'a self) -> &'a [u8] {
+        unsafe {
+            slice::from_raw_parts(CFDataGetBytePtr(self.0), self.len() as usize)
+        }
+    }
+
+    /// Returns the length of this byte buffer.
+    #[inline]
+    pub fn len(&self) -> CFIndex {
+        unsafe {
+            CFDataGetLength(self.0)
+        }
+    }
+}
+
+impl Deref for CFData {
+    type Target = [u8];
+
+    #[inline]
+    fn deref(&self) -> &[u8] {
+        self.bytes()
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/dictionary.rs
@@ -0,0 +1,118 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Dictionaries of key-value pairs.
+
+pub use core_foundation_sys::dictionary::*;
+use core_foundation_sys::base::CFRelease;
+use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
+use libc::c_void;
+use std::mem;
+use std::ptr;
+
+use base::{CFType, CFIndexConvertible, TCFType};
+
+/// An immutable dictionary of key-value pairs.
+pub struct CFDictionary(CFDictionaryRef);
+
+impl Drop for CFDictionary {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFDictionary, CFDictionaryRef, CFDictionaryGetTypeID);
+
+impl CFDictionary {
+    pub fn from_CFType_pairs<R1, R2, K, V>(pairs: &[(K, V)]) -> CFDictionary
+            where K: TCFType<R1>, V: TCFType<R2> {
+        let (keys, values): (Vec<CFTypeRef>,Vec<CFTypeRef>) =
+            pairs.iter()
+            .map(|&(ref key, ref value)| (key.as_CFTypeRef(), value.as_CFTypeRef()))
+            .unzip();
+
+        unsafe {
+            let dictionary_ref = CFDictionaryCreate(kCFAllocatorDefault,
+                                                    mem::transmute(keys.as_ptr()),
+                                                    mem::transmute(values.as_ptr()),
+                                                    keys.len().to_CFIndex(),
+                                                    &kCFTypeDictionaryKeyCallBacks,
+                                                    &kCFTypeDictionaryValueCallBacks);
+            TCFType::wrap_under_create_rule(dictionary_ref)
+        }
+    }
+
+    #[inline]
+    pub fn len(&self) -> usize {
+        unsafe {
+            CFDictionaryGetCount(self.0) as usize
+        }
+    }
+
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    #[inline]
+    pub fn contains_key(&self, key: *const c_void) -> bool {
+        unsafe {
+            CFDictionaryContainsKey(self.0, key) != 0
+        }
+    }
+
+    #[inline]
+    pub fn find(&self, key: *const c_void) -> Option<*const c_void> {
+        unsafe {
+            let mut value: *const c_void = ptr::null();
+            if CFDictionaryGetValueIfPresent(self.0, key, &mut value) != 0 {
+                Some(value)
+            } else {
+                None
+            }
+        }
+    }
+
+    #[inline]
+    pub fn get(&self, key: *const c_void) -> *const c_void {
+        let value = self.find(key);
+        if value.is_none() {
+            panic!("No entry found for key {:p}", key);
+        }
+        value.unwrap()
+    }
+
+    /// A convenience function to retrieve `CFType` instances.
+    #[inline]
+    pub unsafe fn get_CFType(&self, key: *const c_void) -> CFType {
+        let value: CFTypeRef = mem::transmute(self.get(key));
+        TCFType::wrap_under_get_rule(value)
+    }
+
+    #[inline]
+    pub unsafe fn set_value(&self, key: *const c_void, value: *const c_void) {
+        CFDictionarySetValue(self.0, key, value)
+    }
+
+    pub fn get_keys_and_values(&self) -> (Vec<*const c_void>, Vec<*const c_void>) {
+        let length = self.len();
+        let mut keys = Vec::with_capacity(length);
+        let mut values = Vec::with_capacity(length);
+
+        unsafe {
+            CFDictionaryGetKeysAndValues(self.0, keys.as_mut_ptr(), values.as_mut_ptr());
+            keys.set_len(length);
+            values.set_len(length);
+        }
+
+        (keys, values)
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/error.rs
@@ -0,0 +1,77 @@
+// Copyright 2016 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Core Foundation errors.
+
+use core_foundation_sys::error::*;
+use core_foundation_sys::base::CFRelease;
+use std::error::Error;
+use std::fmt;
+
+use base::{CFIndex, TCFType};
+use string::CFString;
+
+/// An error value.
+pub struct CFError(CFErrorRef);
+
+impl Drop for CFError {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFError, CFErrorRef, CFErrorGetTypeID);
+
+impl fmt::Debug for CFError {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.debug_struct("CFError")
+           .field("domain", &self.domain())
+           .field("code", &self.code())
+           .field("description", &self.description())
+           .finish()
+    }
+}
+
+impl fmt::Display for CFError {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        write!(fmt, "{}", self.description())
+    }
+}
+
+impl Error for CFError {
+    fn description(&self) -> &str {
+        "a Core Foundation error"
+    }
+}
+
+impl CFError {
+    /// Returns a string identifying the domain with which this error is
+    /// associated.
+    pub fn domain(&self) -> CFString {
+        unsafe {
+            let s = CFErrorGetDomain(self.0);
+            CFString::wrap_under_get_rule(s)
+        }
+    }
+
+    /// Returns the code identifying this type of error.
+    pub fn code(&self) -> CFIndex {
+        unsafe { CFErrorGetCode(self.0) }
+    }
+
+    /// Returns a human-presentable description of the error.
+    pub fn description(&self) -> CFString {
+        unsafe {
+            let s = CFErrorCopyDescription(self.0);
+            CFString::wrap_under_create_rule(s)
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/lib.rs
@@ -0,0 +1,98 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![allow(non_snake_case)]
+
+extern crate core_foundation_sys;
+extern crate libc;
+
+#[macro_export]
+macro_rules! impl_TCFType {
+    ($ty:ident, $raw:ident, $ty_id:ident) => {
+        impl $crate::base::TCFType<$raw> for $ty {
+            #[inline]
+            fn as_concrete_TypeRef(&self) -> $raw {
+                self.0
+            }
+
+            #[inline]
+            unsafe fn wrap_under_get_rule(reference: $raw) -> $ty {
+                let reference = ::std::mem::transmute(::core_foundation_sys::base::CFRetain(::std::mem::transmute(reference)));
+                $crate::base::TCFType::wrap_under_create_rule(reference)
+            }
+
+            #[inline]
+            fn as_CFTypeRef(&self) -> ::core_foundation_sys::base::CFTypeRef {
+                unsafe {
+                    ::std::mem::transmute(self.as_concrete_TypeRef())
+                }
+            }
+
+            #[inline]
+            unsafe fn wrap_under_create_rule(obj: $raw) -> $ty {
+                $ty(obj)
+            }
+
+            #[inline]
+            fn type_id() -> ::core_foundation_sys::base::CFTypeID {
+                unsafe {
+                    $ty_id()
+                }
+            }
+        }
+    }
+}
+
+pub mod array;
+pub mod base;
+pub mod boolean;
+pub mod data;
+pub use core_foundation_sys::date; // back compat
+pub mod dictionary;
+pub mod error;
+pub mod number;
+pub mod set;
+pub mod string;
+pub mod url;
+pub mod bundle;
+pub mod propertylist;
+pub mod runloop;
+
+#[cfg(test)]
+pub mod test {
+    #[test]
+    fn test_stuff() {
+        use base::TCFType;
+        use boolean::CFBoolean;
+        use number::number;
+        use dictionary::CFDictionary;
+        use string::CFString;
+
+        /*let n = CFNumber::new_number(42 as i32);
+        io::println(format!("%d", (&n).retain_count() as int));
+        (&n).show();*/
+
+        let bar = CFString::from_static_string("Bar");
+        let baz = CFString::from_static_string("Baz");
+        let boo = CFString::from_static_string("Boo");
+        let foo = CFString::from_static_string("Foo");
+        let tru = CFBoolean::true_value();
+        let n42 = number(42);
+
+        let d = CFDictionary::from_CFType_pairs(&[
+            (bar.as_CFType(), boo.as_CFType()),
+            (baz.as_CFType(), tru.as_CFType()),
+            (foo.as_CFType(), n42.as_CFType()),
+        ]);
+
+        let (v1, v2) = d.get_keys_and_values();
+
+        assert!(v1 == &[bar.as_CFTypeRef(), baz.as_CFTypeRef(), foo.as_CFTypeRef()]);
+        assert!(v2 == &[boo.as_CFTypeRef(), tru.as_CFTypeRef(), n42.as_CFTypeRef()]);
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/number.rs
@@ -0,0 +1,85 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Immutable numbers.
+
+use core_foundation_sys::base::{CFRelease, kCFAllocatorDefault};
+pub use core_foundation_sys::number::*;
+use std::mem;
+
+use base::{TCFType};
+
+/// An immutable numeric value.
+pub struct CFNumber(CFNumberRef);
+
+impl Drop for CFNumber {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFNumber, CFNumberRef, CFNumberGetTypeID);
+
+// TODO(pcwalton): Floating point.
+impl CFNumber {
+    #[inline]
+    pub fn from_i32(value: i32) -> CFNumber {
+        unsafe {
+            let number_ref = CFNumberCreate(kCFAllocatorDefault,
+                                            kCFNumberSInt32Type,
+                                            mem::transmute(&value));
+            TCFType::wrap_under_create_rule(number_ref)
+        }
+    }
+
+    #[inline]
+    pub fn to_i64(&self) -> Option<i64> {
+        unsafe {
+            let mut value: i64 = 0;
+            let ok = CFNumberGetValue(self.0, kCFNumberSInt64Type, mem::transmute(&mut value));
+            if ok { Some(value) } else { None }
+        }
+    }
+
+    #[inline]
+    pub fn to_f64(&self) -> Option<f64> {
+        unsafe {
+            let mut value: f64 = 0.0;
+            let ok = CFNumberGetValue(self.0, kCFNumberFloat64Type, mem::transmute(&mut value));
+            if ok { Some(value) } else { None }
+        }
+    }
+
+    #[inline]
+    pub fn from_i64(value: i64) -> CFNumber {
+        unsafe {
+            let number_ref = CFNumberCreate(kCFAllocatorDefault,
+                                            kCFNumberSInt64Type,
+                                            mem::transmute(&value));
+            TCFType::wrap_under_create_rule(number_ref)
+        }
+    }
+
+    #[inline]
+    pub fn from_f64(value: f64) -> CFNumber {
+        unsafe {
+            let number_ref = CFNumberCreate(kCFAllocatorDefault,
+                                            kCFNumberFloat64Type,
+                                            mem::transmute(&value));
+            TCFType::wrap_under_create_rule(number_ref)
+        }
+    }
+}
+
+/// A convenience function to create CFNumbers.
+pub fn number(value: i64) -> CFNumber {
+    CFNumber::from_i64(value)
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/propertylist.rs
@@ -0,0 +1,87 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Core Foundation property lists
+
+use std::ptr;
+
+use libc::c_void;
+
+use error::CFError;
+use data::CFData;
+use base::{TCFType};
+
+pub use core_foundation_sys::propertylist::*;
+use core_foundation_sys::error::CFErrorRef;
+use core_foundation_sys::base::{kCFAllocatorDefault};
+
+pub fn create_with_data(data: CFData,
+                        options: CFPropertyListMutabilityOptions)
+                        -> Result<(*const c_void, CFPropertyListFormat), CFError> {
+    unsafe {
+        let mut error: CFErrorRef = ptr::null_mut();
+        let mut format: CFPropertyListFormat = 0;
+        let property_list = CFPropertyListCreateWithData(kCFAllocatorDefault,
+                                                         data.as_concrete_TypeRef(),
+                                                         options,
+                                                         &mut format,
+                                                         &mut error);
+        if property_list.is_null() {
+            Err(TCFType::wrap_under_create_rule(error))
+        } else {
+            Ok((property_list, format))
+        }
+    }
+}
+
+pub fn create_data(property_list: *const c_void, format: CFPropertyListFormat) -> Result<CFData, CFError> {
+    unsafe {
+        let mut error: CFErrorRef = ptr::null_mut();
+        let data_ref = CFPropertyListCreateData(kCFAllocatorDefault,
+                                                property_list,
+                                                format,
+                                                0,
+                                                &mut error);
+        if data_ref.is_null() {
+            Err(TCFType::wrap_under_create_rule(error))
+        } else {
+            Ok(TCFType::wrap_under_create_rule(data_ref))
+        }
+    }
+}
+
+#[cfg(test)]
+pub mod test {
+    #[test]
+    fn test_property_list_serialization() {
+        use base::{TCFType, CFEqual};
+        use boolean::CFBoolean;
+        use number::number;
+        use dictionary::CFDictionary;
+        use string::CFString;
+        use super::*;
+
+        let bar = CFString::from_static_string("Bar");
+        let baz = CFString::from_static_string("Baz");
+        let boo = CFString::from_static_string("Boo");
+        let foo = CFString::from_static_string("Foo");
+        let tru = CFBoolean::true_value();
+        let n42 = number(42);
+
+        let dict1 = CFDictionary::from_CFType_pairs(&[(bar.as_CFType(), boo.as_CFType()),
+                                                      (baz.as_CFType(), tru.as_CFType()),
+                                                      (foo.as_CFType(), n42.as_CFType())]);
+
+        let data = create_data(dict1.as_CFTypeRef(), kCFPropertyListXMLFormat_v1_0).unwrap();
+        let (dict2, _) = create_with_data(data, kCFPropertyListImmutable).unwrap();
+        unsafe {
+            assert!(CFEqual(dict1.as_CFTypeRef(), dict2) == 1);
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/runloop.rs
@@ -0,0 +1,140 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(non_upper_case_globals)]
+
+pub use core_foundation_sys::runloop::*;
+use core_foundation_sys::base::{CFIndex, CFRelease};
+use core_foundation_sys::base::{kCFAllocatorDefault, CFOptionFlags};
+use core_foundation_sys::string::CFStringRef;
+use core_foundation_sys::date::{CFAbsoluteTime, CFTimeInterval};
+
+use base::{TCFType};
+use string::{CFString};
+
+pub struct CFRunLoop(CFRunLoopRef);
+
+impl Drop for CFRunLoop {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFRunLoop, CFRunLoopRef, CFRunLoopGetTypeID);
+
+impl CFRunLoop {
+    pub fn get_current() -> CFRunLoop {
+        unsafe {
+            let run_loop_ref = CFRunLoopGetCurrent();
+            TCFType::wrap_under_get_rule(run_loop_ref)
+        }
+    }
+
+    pub fn get_main() -> CFRunLoop {
+        unsafe {
+            let run_loop_ref = CFRunLoopGetMain();
+            TCFType::wrap_under_get_rule(run_loop_ref)
+        }
+    }
+
+    pub fn run_current() {
+        unsafe {
+            CFRunLoopRun();
+        }
+    }
+
+    pub fn stop(&self) {
+        unsafe {
+            CFRunLoopStop(self.0);
+        }
+    }
+
+    pub fn current_mode(&self) -> Option<String> {
+        unsafe {
+            let string_ref = CFRunLoopCopyCurrentMode(self.0);
+            if string_ref.is_null() {
+                return None;
+            }
+
+            let cf_string: CFString = TCFType::wrap_under_create_rule(string_ref);
+            Some(cf_string.to_string())
+        }
+    }
+
+    pub fn contains_timer(&self, timer: &CFRunLoopTimer, mode: CFStringRef) -> bool {
+        unsafe {
+            CFRunLoopContainsTimer(self.0, timer.0, mode) != 0
+        }
+    }
+
+    pub fn add_timer(&self, timer: &CFRunLoopTimer, mode: CFStringRef) {
+        unsafe {
+            CFRunLoopAddTimer(self.0, timer.0, mode);
+        }
+    }
+
+}
+
+pub struct CFRunLoopTimer(CFRunLoopTimerRef);
+
+impl Drop for CFRunLoopTimer {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFRunLoopTimer, CFRunLoopTimerRef, CFRunLoopTimerGetTypeID);
+
+impl CFRunLoopTimer {
+    pub fn new(fireDate: CFAbsoluteTime, interval: CFTimeInterval, flags: CFOptionFlags, order: CFIndex, callout: CFRunLoopTimerCallBack, context: *mut CFRunLoopTimerContext) -> CFRunLoopTimer {
+        unsafe {
+            let timer_ref = CFRunLoopTimerCreate(kCFAllocatorDefault, fireDate, interval, flags, order, callout, context);
+            TCFType::wrap_under_create_rule(timer_ref)
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use core_foundation_sys::date::{CFAbsoluteTime, CFAbsoluteTimeGetCurrent};
+    use std::mem;
+    use libc::c_void;
+
+    #[test]
+    fn wait_200_milliseconds() {
+        let run_loop = CFRunLoop::get_current();
+        let mut now = unsafe { CFAbsoluteTimeGetCurrent() };
+        let mut context = unsafe { CFRunLoopTimerContext {
+            version: 0,
+            info: mem::transmute(&mut now),
+            retain: mem::zeroed(),
+            release: mem::zeroed(),
+            copyDescription: mem::zeroed(),
+        } };
+
+
+        let run_loop_timer = CFRunLoopTimer::new(now + 0.20f64, 0f64, 0, 0, timer_popped, &mut context);
+        run_loop.add_timer(&run_loop_timer, kCFRunLoopDefaultMode);
+
+        CFRunLoop::run_current();
+    }
+
+    extern "C" fn timer_popped(_timer: CFRunLoopTimerRef, _info: *mut c_void) {
+        let previous_now_ptr: *const CFAbsoluteTime = unsafe { mem::transmute(_info) };
+        let previous_now = unsafe { *previous_now_ptr };
+        let now = unsafe { CFAbsoluteTimeGetCurrent() };
+        assert!(now - previous_now > 0.19 && now - previous_now < 0.21);
+        CFRunLoop::get_current().stop();
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/set.rs
@@ -0,0 +1,45 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! An immutable bag of elements.
+
+pub use core_foundation_sys::set::*;
+use core_foundation_sys::base::CFRelease;
+use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
+
+use base::{CFIndexConvertible, TCFType};
+
+use std::mem;
+
+/// An immutable bag of elements.
+pub struct CFSet(CFSetRef);
+
+impl Drop for CFSet {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFSet, CFSetRef, CFSetGetTypeID);
+
+impl CFSet {
+    /// Creates a new set from a list of `CFType` instances.
+    pub fn from_slice<R, T>(elems: &[T]) -> CFSet where T: TCFType<R> {
+        unsafe {
+            let elems: Vec<CFTypeRef> = elems.iter().map(|elem| elem.as_CFTypeRef()).collect();
+            let set_ref = CFSetCreate(kCFAllocatorDefault,
+                                      mem::transmute(elems.as_ptr()),
+                                      elems.len().to_CFIndex(),
+                                      &kCFTypeSetCallBacks);
+            TCFType::wrap_under_create_rule(set_ref)
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/string.rs
@@ -0,0 +1,152 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Immutable strings.
+
+pub use core_foundation_sys::string::*;
+
+use base::{CFIndexConvertible, TCFType};
+
+use core_foundation_sys::base::{Boolean, CFIndex, CFRange, CFRelease};
+use core_foundation_sys::base::{kCFAllocatorDefault, kCFAllocatorNull};
+use std::fmt;
+use std::str::{self, FromStr};
+use std::ptr;
+use std::ffi::CStr;
+
+/// An immutable string in one of a variety of encodings.
+pub struct CFString(CFStringRef);
+
+impl Clone for CFString {
+    #[inline]
+    fn clone(&self) -> CFString {
+        unsafe {
+            TCFType::wrap_under_get_rule(self.0)
+        }
+    }
+}
+
+impl Drop for CFString {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFString, CFStringRef, CFStringGetTypeID);
+
+impl FromStr for CFString {
+    type Err = ();
+
+    /// See also CFString::new for a variant of this which does not return a Result
+    #[inline]
+    fn from_str(string: &str) -> Result<CFString, ()> {
+        Ok(CFString::new(string))
+    }
+}
+
+impl fmt::Display for CFString {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        unsafe {
+            // Do this without allocating if we can get away with it
+            let c_string = CFStringGetCStringPtr(self.0, kCFStringEncodingUTF8);
+            if c_string != ptr::null() {
+                let c_str = CStr::from_ptr(c_string);
+                fmt.write_str(str::from_utf8_unchecked(c_str.to_bytes()))
+            } else {
+                let char_len = self.char_len();
+
+                // First, ask how big the buffer ought to be.
+                let mut bytes_required: CFIndex = 0;
+                CFStringGetBytes(self.0,
+                                 CFRange { location: 0, length: char_len },
+                                 kCFStringEncodingUTF8,
+                                 0,
+                                 false as Boolean,
+                                 ptr::null_mut(),
+                                 0,
+                                 &mut bytes_required);
+
+                // Then, allocate the buffer and actually copy.
+                let mut buffer = vec![b'\x00'; bytes_required as usize];
+
+                let mut bytes_used: CFIndex = 0;
+                let chars_written = CFStringGetBytes(self.0,
+                                                     CFRange { location: 0, length: char_len },
+                                                     kCFStringEncodingUTF8,
+                                                     0,
+                                                     false as Boolean,
+                                                     buffer.as_mut_ptr(),
+                                                     buffer.len().to_CFIndex(),
+                                                     &mut bytes_used) as usize;
+                assert!(chars_written.to_CFIndex() == char_len);
+
+                // This is dangerous; we over-allocate and null-terminate the string (during
+                // initialization).
+                assert!(bytes_used == buffer.len().to_CFIndex());
+                fmt.write_str(str::from_utf8_unchecked(&buffer))
+            }
+        }
+    }
+}
+
+impl fmt::Debug for CFString {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "\"{}\"", self)
+    }
+}
+
+
+impl CFString {
+    /// Creates a new `CFString` instance from a Rust string.
+    #[inline]
+    pub fn new(string: &str) -> CFString {
+        unsafe {
+            let string_ref = CFStringCreateWithBytes(kCFAllocatorDefault,
+                                                     string.as_ptr(),
+                                                     string.len().to_CFIndex(),
+                                                     kCFStringEncodingUTF8,
+                                                     false as Boolean,
+                                                     kCFAllocatorNull);
+            CFString::wrap_under_create_rule(string_ref)
+        }
+    }
+
+    /// Like `CFString::new`, but references a string that can be used as a backing store
+    /// by virtue of being statically allocated.
+    #[inline]
+    pub fn from_static_string(string: &'static str) -> CFString {
+        unsafe {
+            let string_ref = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault,
+                                                           string.as_ptr(),
+                                                           string.len().to_CFIndex(),
+                                                           kCFStringEncodingUTF8,
+                                                           false as Boolean,
+                                                           kCFAllocatorNull);
+            TCFType::wrap_under_create_rule(string_ref)
+        }
+    }
+
+    /// Returns the number of characters in the string.
+    #[inline]
+    pub fn char_len(&self) -> CFIndex {
+        unsafe {
+            CFStringGetLength(self.0)
+        }
+    }
+}
+
+#[test]
+fn string_and_back() {
+    let original = "The quick brown fox jumped over the slow lazy dog.";
+    let cfstr = CFString::from_static_string(original);
+    let converted = cfstr.to_string();
+    assert!(converted == original);
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-0.2.3/src/url.rs
@@ -0,0 +1,63 @@
+// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! A URL type for Core Foundation.
+
+pub use core_foundation_sys::url::*;
+
+use base::{TCFType};
+use string::{CFString};
+
+use core_foundation_sys::base::{kCFAllocatorDefault, CFRelease};
+use std::fmt;
+
+pub struct CFURL(CFURLRef);
+
+impl Drop for CFURL {
+    fn drop(&mut self) {
+        unsafe {
+            CFRelease(self.as_CFTypeRef())
+        }
+    }
+}
+
+impl_TCFType!(CFURL, CFURLRef, CFURLGetTypeID);
+
+impl fmt::Debug for CFURL {
+    #[inline]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        unsafe {
+            let string: CFString = TCFType::wrap_under_get_rule(CFURLGetString(self.0));
+            write!(f, "{}", string.to_string())
+        }
+    }
+}
+
+impl CFURL {
+    pub fn from_file_system_path(filePath: CFString, pathStyle: CFURLPathStyle, isDirectory: bool) -> CFURL {
+        unsafe {
+            let url_ref = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, filePath.as_concrete_TypeRef(), pathStyle, isDirectory as u8);
+            TCFType::wrap_under_create_rule(url_ref)
+        }
+    }
+
+    pub fn get_string(&self) -> CFString {
+        unsafe {
+            TCFType::wrap_under_get_rule(CFURLGetString(self.0))
+        }
+    }
+}
+
+#[test]
+fn file_url_from_path() {
+    let path = "/usr/local/foo/";
+    let cfstr_path = CFString::from_static_string(path);
+    let cfurl = CFURL::from_file_system_path(cfstr_path, kCFURLPOSIXPathStyle, true);
+    assert!(cfurl.get_string().to_string() == "file:///usr/local/foo/");
+}
copy from third_party/rust/core-foundation-sys/.cargo-checksum.json
copy to third_party/rust/core-foundation-sys-0.2.3/.cargo-checksum.json
copy from third_party/rust/byteorder-0.5.3/.cargo-ok
copy to third_party/rust/core-foundation-sys-0.2.3/.cargo-ok
copy from third_party/rust/core-foundation-sys/Cargo.toml
copy to third_party/rust/core-foundation-sys-0.2.3/Cargo.toml
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/build.rs
@@ -0,0 +1,12 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    println!("cargo:rustc-link-lib=framework=CoreFoundation");
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/array.rs
@@ -0,0 +1,61 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID};
+
+/// FIXME(pcwalton): This is wrong.
+pub type CFArrayRetainCallBack = *const u8;
+
+/// FIXME(pcwalton): This is wrong.
+pub type CFArrayReleaseCallBack = *const u8;
+
+/// FIXME(pcwalton): This is wrong.
+pub type CFArrayCopyDescriptionCallBack = *const u8;
+
+/// FIXME(pcwalton): This is wrong.
+pub type CFArrayEqualCallBack = *const u8;
+
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct CFArrayCallBacks {
+    pub version: CFIndex,
+    pub retain: CFArrayRetainCallBack,
+    pub release: CFArrayReleaseCallBack,
+    pub copyDescription: CFArrayCopyDescriptionCallBack,
+    pub equal: CFArrayEqualCallBack,
+}
+
+#[repr(C)]
+pub struct __CFArray(c_void);
+
+pub type CFArrayRef = *const __CFArray;
+
+extern {
+    /*
+     * CFArray.h
+     */
+    pub static kCFTypeArrayCallBacks: CFArrayCallBacks;
+
+    pub fn CFArrayCreate(allocator: CFAllocatorRef, values: *const *const c_void,
+                     numValues: CFIndex, callBacks: *const CFArrayCallBacks) -> CFArrayRef;
+    pub fn CFArrayCreateCopy(allocator: CFAllocatorRef , theArray: CFArrayRef) -> CFArrayRef;
+    
+    // CFArrayBSearchValues
+    // CFArrayContainsValue
+    pub fn CFArrayGetCount(theArray: CFArrayRef) -> CFIndex;
+    // CFArrayGetCountOfValue
+    // CFArrayGetFirstIndexOfValue
+    // CFArrayGetLastIndexOfValue
+    pub fn CFArrayGetValues(theArray: CFArrayRef, range: CFRange, values: *mut *const c_void);
+    pub fn CFArrayGetValueAtIndex(theArray: CFArrayRef, idx: CFIndex) -> *const c_void;
+    // CFArrayApplyFunction
+    pub fn CFArrayGetTypeID() -> CFTypeID;
+}
copy from third_party/rust/core-foundation-sys/src/base.rs
copy to third_party/rust/core-foundation-sys-0.2.3/src/base.rs
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/bundle.rs
@@ -0,0 +1,31 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::CFTypeID;
+use dictionary::CFDictionaryRef;
+use string::CFStringRef;
+
+#[repr(C)]
+pub struct __CFBundle(c_void);
+
+pub type CFBundleRef = *const __CFBundle;
+
+extern {
+    /*
+     * CFBundle.h
+     */
+    pub fn CFBundleGetBundleWithIdentifier(bundleID: CFStringRef) -> CFBundleRef;
+    pub fn CFBundleGetFunctionPointerForName(bundle: CFBundleRef, function_name: CFStringRef) -> *const c_void;
+    pub fn CFBundleGetMainBundle() -> CFBundleRef;
+    pub fn CFBundleGetInfoDictionary(bundle: CFBundleRef) -> CFDictionaryRef;
+
+    pub fn CFBundleGetTypeID() -> CFTypeID;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/data.rs
@@ -0,0 +1,22 @@
+use libc::c_void;
+
+use base::{CFAllocatorRef, CFTypeID, CFIndex};
+
+#[repr(C)]
+pub struct __CFData(c_void);
+
+pub type CFDataRef = *const __CFData;
+
+extern {
+    /*
+     * CFData.h
+     */
+
+    pub fn CFDataCreate(allocator: CFAllocatorRef,
+                        bytes: *const u8, length: CFIndex) -> CFDataRef;
+    //fn CFDataFind
+    pub fn CFDataGetBytePtr(theData: CFDataRef) -> *const u8;
+    pub fn CFDataGetLength(theData: CFDataRef) -> CFIndex;
+
+    pub fn CFDataGetTypeID() -> CFTypeID;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/date.rs
@@ -0,0 +1,15 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub type CFTimeInterval = f64;
+pub type CFAbsoluteTime = CFTimeInterval;
+
+extern {
+    pub fn CFAbsoluteTimeGetCurrent() -> CFAbsoluteTime;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/dictionary.rs
@@ -0,0 +1,79 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::{c_void};
+
+use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean};
+
+pub type CFDictionaryApplierFunction = extern "C" fn (key: *const c_void,
+                                                      value: *const c_void,
+                                                      context: *mut c_void);
+pub type CFDictionaryCopyDescriptionCallBack = *const u8;
+pub type CFDictionaryEqualCallBack = *const u8;
+pub type CFDictionaryHashCallBack = *const u8;
+pub type CFDictionaryReleaseCallBack = *const u8;
+pub type CFDictionaryRetainCallBack = *const u8;
+
+#[allow(dead_code)]
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct CFDictionaryKeyCallBacks {
+    pub version: CFIndex,
+    pub retain: CFDictionaryRetainCallBack,
+    pub release: CFDictionaryReleaseCallBack,
+    pub copyDescription: CFDictionaryCopyDescriptionCallBack,
+    pub equal: CFDictionaryEqualCallBack,
+    pub hash: CFDictionaryHashCallBack
+}
+
+#[allow(dead_code)]
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct CFDictionaryValueCallBacks {
+    pub version: CFIndex,
+    pub retain: CFDictionaryRetainCallBack,
+    pub release: CFDictionaryReleaseCallBack,
+    pub copyDescription: CFDictionaryCopyDescriptionCallBack,
+    pub equal: CFDictionaryEqualCallBack
+}
+
+#[repr(C)]
+pub struct __CFDictionary(c_void);
+
+pub type CFDictionaryRef = *const __CFDictionary;
+pub type CFMutableDictionaryRef = *const __CFDictionary;
+
+extern {
+    /*
+     * CFDictionary.h
+     */
+
+    pub static kCFTypeDictionaryKeyCallBacks: CFDictionaryKeyCallBacks;
+    pub static kCFTypeDictionaryValueCallBacks: CFDictionaryValueCallBacks;
+
+    pub fn CFDictionaryContainsKey(theDict: CFDictionaryRef, key: *const c_void) -> Boolean;
+    pub fn CFDictionaryCreate(allocator: CFAllocatorRef, keys: *const *const c_void, values: *const *const c_void,
+                              numValues: CFIndex, keyCallBacks: *const CFDictionaryKeyCallBacks,
+                              valueCallBacks: *const CFDictionaryValueCallBacks)
+                              -> CFDictionaryRef;
+    pub fn CFDictionaryGetCount(theDict: CFDictionaryRef) -> CFIndex;
+    pub fn CFDictionaryGetTypeID() -> CFTypeID;
+    pub fn CFDictionaryGetValueIfPresent(theDict: CFDictionaryRef, key: *const c_void, value: *mut *const c_void)
+                                         -> Boolean;
+    pub fn CFDictionaryApplyFunction(theDict: CFDictionaryRef,
+                                     applier: CFDictionaryApplierFunction,
+                                     context: *mut c_void);
+    pub fn CFDictionarySetValue(theDict: CFMutableDictionaryRef,
+                                key: *const c_void,
+                                value: *const c_void);
+    pub fn CFDictionaryGetKeysAndValues(theDict: CFDictionaryRef,
+                                        keys: *mut *const c_void,
+                                        values: *mut *const c_void);
+
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/error.rs
@@ -0,0 +1,32 @@
+// Copyright 2016 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::{CFTypeID, CFIndex};
+use string::CFStringRef;
+
+#[repr(C)]
+pub struct __CFError(c_void);
+
+pub type CFErrorRef = *mut __CFError;
+
+extern "C" {
+    pub fn CFErrorGetTypeID() -> CFTypeID;
+
+    pub static kCFErrorDomainPOSIX: CFStringRef;
+    pub static kCFErrorDomainOSStatus: CFStringRef;
+    pub static kCFErrorDomainMach: CFStringRef;
+    pub static kCFErrorDomainCocoa: CFStringRef;
+
+    pub fn CFErrorGetDomain(err: CFErrorRef) -> CFStringRef;
+    pub fn CFErrorGetCode(err: CFErrorRef) -> CFIndex;
+
+    pub fn CFErrorCopyDescription(err: CFErrorRef) -> CFStringRef;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/lib.rs
@@ -0,0 +1,26 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, improper_ctypes)]
+
+extern crate libc;
+
+pub mod array;
+pub mod base;
+pub mod bundle;
+pub mod data;
+pub mod date;
+pub mod dictionary;
+pub mod error;
+pub mod messageport;
+pub mod number;
+pub mod propertylist;
+pub mod runloop;
+pub mod set;
+pub mod string;
+pub mod url;
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/messageport.rs
@@ -0,0 +1,79 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean};
+use data::CFDataRef;
+use date::CFTimeInterval;
+use runloop::CFRunLoopSourceRef;
+use string::CFStringRef;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+#[derive(Debug)]
+pub struct CFMessagePortContext {
+    pub version: CFIndex,
+    pub info: *mut c_void,
+    pub retain: Option<unsafe extern fn(info: *const c_void) -> *const c_void>,
+    pub release: Option<unsafe extern fn(info: *const c_void)>,
+    pub copyDescription: Option<unsafe extern fn(info: *const c_void)
+        -> CFStringRef>,
+}
+
+pub type CFMessagePortCallBack = Option<
+    unsafe extern fn(local: CFMessagePortRef,
+                     msgid: i32,
+                     data: CFDataRef,
+                     info: *mut c_void) -> CFDataRef>;
+
+pub type CFMessagePortInvalidationCallBack = Option<
+    unsafe extern "C" fn(ms: CFMessagePortRef, info: *mut c_void)>;
+
+#[repr(C)]
+pub struct __CFMessagePort(c_void);
+pub type CFMessagePortRef = *const __CFMessagePort;
+
+extern {
+    /*
+     * CFMessagePort.h
+     */
+    pub fn CFMessagePortGetTypeID() -> CFTypeID;
+    pub fn CFMessagePortCreateLocal(allocator: CFAllocatorRef,
+                                    name: CFStringRef,
+                                    callout: CFMessagePortCallBack,
+                                    context: *const CFMessagePortContext,
+                                    shouldFreeInfo: *mut Boolean)
+        -> CFMessagePortRef;
+    pub fn CFMessagePortCreateRemote(allocator: CFAllocatorRef,
+                                     name: CFStringRef) -> CFMessagePortRef;
+    pub fn CFMessagePortIsRemote(ms: CFMessagePortRef) -> Boolean;
+    pub fn CFMessagePortGetName(ms: CFMessagePortRef) -> CFStringRef;
+    pub fn CFMessagePortSetName(ms: CFMessagePortRef, newName: CFStringRef)
+        -> Boolean;
+    pub fn CFMessagePortGetContext(ms: CFMessagePortRef,
+                                   context: *mut CFMessagePortContext);
+    pub fn CFMessagePortInvalidate(ms: CFMessagePortRef);
+    pub fn CFMessagePortIsValid(ms: CFMessagePortRef) -> Boolean;
+    pub fn CFMessagePortGetInvalidationCallBack(ms: CFMessagePortRef)
+        -> CFMessagePortInvalidationCallBack;
+    pub fn CFMessagePortSetInvalidationCallBack(ms: CFMessagePortRef,
+                                                callout: CFMessagePortInvalidationCallBack);
+    pub fn CFMessagePortSendRequest(remote: CFMessagePortRef, msgid: i32,
+                                    data: CFDataRef,
+                                    sendTimeout: CFTimeInterval,
+                                    rcvTimeout: CFTimeInterval,
+                                    replyMode: CFStringRef,
+                                    returnData: *mut CFDataRef) -> i32;
+    pub fn CFMessagePortCreateRunLoopSource(allocator: CFAllocatorRef,
+                                            local: CFMessagePortRef,
+                                            order: CFIndex)
+        -> CFRunLoopSourceRef;
+    // CFMessagePortSetDispatchQueue
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/number.rs
@@ -0,0 +1,59 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::{CFAllocatorRef, CFTypeID};
+
+#[repr(C)]
+pub struct __CFBoolean(c_void);
+
+pub type CFBooleanRef = *const __CFBoolean;
+
+pub type CFNumberType = u32;
+
+// members of enum CFNumberType
+// static kCFNumberSInt8Type:     CFNumberType = 1;
+// static kCFNumberSInt16Type:    CFNumberType = 2;
+pub static kCFNumberSInt32Type:    CFNumberType = 3;
+pub static kCFNumberSInt64Type:    CFNumberType = 4;
+// static kCFNumberFloat32Type:   CFNumberType = 5;
+pub static kCFNumberFloat64Type:   CFNumberType = 6;
+// static kCFNumberCharType:      CFNumberType = 7;
+// static kCFNumberShortType:     CFNumberType = 8;
+// static kCFNumberIntType:       CFNumberType = 9;
+// static kCFNumberLongType:      CFNumberType = 10;
+// static kCFNumberLongLongType:  CFNumberType = 11;
+// static kCFNumberFloatType:     CFNumberType = 12;
+// static kCFNumberDoubleType:    CFNumberType = 13;
+// static kCFNumberCFIndexType:   CFNumberType = 14;
+// static kCFNumberNSIntegerType: CFNumberType = 15;
+// static kCFNumberCGFloatType:   CFNumberType = 16;
+// static kCFNumberMaxType:       CFNumberType = 16;
+
+#[repr(C)]
+pub struct __CFNumber;
+
+pub type CFNumberRef = *const __CFNumber;
+
+extern {
+    /*
+     * CFNumber.h
+     */
+    pub static kCFBooleanTrue: CFBooleanRef;
+    pub static kCFBooleanFalse: CFBooleanRef;
+
+    pub fn CFBooleanGetTypeID() -> CFTypeID;
+    pub fn CFNumberCreate(allocator: CFAllocatorRef, theType: CFNumberType, valuePtr: *const c_void)
+                          -> CFNumberRef;
+    //fn CFNumberGetByteSize
+    pub fn CFNumberGetValue(number: CFNumberRef, theType: CFNumberType, valuePtr: *mut c_void) -> bool;
+    //fn CFNumberCompare
+    pub fn CFNumberGetTypeID() -> CFTypeID;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/propertylist.rs
@@ -0,0 +1,37 @@
+use base::{CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeRef};
+use data::CFDataRef;
+use error::CFErrorRef;
+
+pub type CFPropertyListRef = CFTypeRef;
+
+pub type CFPropertyListFormat = CFIndex;
+pub const kCFPropertyListOpenStepFormat: CFPropertyListFormat = 1;
+pub const kCFPropertyListXMLFormat_v1_0: CFPropertyListFormat = 100;
+pub const kCFPropertyListBinaryFormat_v1_0: CFPropertyListFormat = 200;
+
+pub type CFPropertyListMutabilityOptions = CFOptionFlags;
+pub const kCFPropertyListImmutable: CFPropertyListMutabilityOptions = 0;
+pub const kCFPropertyListMutableContainers: CFPropertyListMutabilityOptions = 1;
+pub const kCFPropertyListMutableContainersAndLeaves: CFPropertyListMutabilityOptions = 2;
+
+extern "C" {
+    // CFPropertyList.h
+    //
+
+    // fn CFPropertyListCreateDeepCopy
+    // fn CFPropertyListIsValid
+    pub fn CFPropertyListCreateWithData(allocator: CFAllocatorRef,
+                                        data: CFDataRef,
+                                        options: CFPropertyListMutabilityOptions,
+                                        format: *mut CFPropertyListFormat,
+                                        error: *mut CFErrorRef)
+                                        -> CFPropertyListRef;
+    // fn CFPropertyListCreateWithStream
+    // fn CFPropertyListWrite
+    pub fn CFPropertyListCreateData(allocator: CFAllocatorRef,
+                                    propertyList: CFPropertyListRef,
+                                    format: CFPropertyListFormat,
+                                    options: CFOptionFlags,
+                                    error: *mut CFErrorRef)
+                                    -> CFDataRef;
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/runloop.rs
@@ -0,0 +1,164 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use array::CFArrayRef;
+use base::{Boolean, CFIndex, CFTypeID, CFAllocatorRef, CFOptionFlags, CFHashCode, mach_port_t};
+use date::{CFAbsoluteTime, CFTimeInterval};
+use string::CFStringRef;
+
+#[repr(C)]
+pub struct __CFRunLoop(c_void);
+
+pub type CFRunLoopRef = *const __CFRunLoop;
+
+#[repr(C)]
+pub struct __CFRunLoopSource(c_void);
+
+pub type CFRunLoopSourceRef = *const __CFRunLoopSource;
+
+#[repr(C)]
+pub struct __CFRunLoopObserver(c_void);
+
+pub type CFRunLoopObserverRef = *const __CFRunLoopObserver;
+
+// Reasons for CFRunLoopRunInMode() to Return
+pub const kCFRunLoopRunFinished: i32      = 1;
+pub const kCFRunLoopRunStopped: i32       = 2;
+pub const kCFRunLoopRunTimedOut: i32      = 3;
+pub const kCFRunLoopRunHandledSource: i32 = 4;
+
+// Run Loop Observer Activities
+//typedef CF_OPTIONS(CFOptionFlags, CFRunLoopActivity) {
+pub type CFRunLoopActivity = CFOptionFlags;
+pub const kCFRunLoopEntry: CFOptionFlags         = 1 << 0;
+pub const kCFRunLoopBeforeTimers: CFOptionFlags  = 1 << 1;
+pub const kCFRunLoopBeforeSources: CFOptionFlags = 1 << 2;
+pub const kCFRunLoopBeforeWaiting: CFOptionFlags = 1 << 5;
+pub const kCFRunLoopAfterWaiting: CFOptionFlags  = 1 << 6;
+pub const kCFRunLoopExit: CFOptionFlags          = 1 << 7;
+pub const kCFRunLoopAllActivities: CFOptionFlags = 0x0FFFFFFF;
+
+#[repr(C)]
+pub struct CFRunLoopSourceContext {
+    pub version: CFIndex,
+    pub info: *mut c_void,
+    pub retain: extern "C" fn (info: *const c_void) -> *const c_void,
+    pub release: extern "C" fn (info: *const c_void),
+    pub copyDescription: extern "C" fn (info: *const c_void) -> CFStringRef,
+    pub equal: extern "C" fn (info1: *const c_void, info2: *const c_void) -> Boolean,
+    pub hash: extern "C" fn (info: *const c_void) -> CFHashCode,
+    pub schedule: extern "C" fn (info: *const c_void, rl: CFRunLoopRef, mode: CFStringRef),
+    pub cancel: extern "C" fn (info: *const c_void, rl: CFRunLoopRef, mode: CFStringRef),
+    pub perform: extern "C" fn (info: *const c_void),
+}
+
+#[repr(C)]
+pub struct CFRunLoopSourceContext1 {
+    pub version: CFIndex,
+    pub info: *mut c_void,
+    pub retain: extern "C" fn (info: *const c_void) -> *const c_void,
+    pub release: extern "C" fn (info: *const c_void),
+    pub copyDescription: extern "C" fn (info: *const c_void) -> CFStringRef,
+    pub equal: extern "C" fn (info1: *const c_void, info2: *const c_void) -> Boolean,
+    pub hash: extern "C" fn (info: *const c_void) -> CFHashCode,
+    // note that the following two fields are platform dependent in the C header, the ones here are for OS X
+    pub getPort: extern "C" fn (info: *mut c_void) -> mach_port_t,
+    pub perform: extern "C" fn (msg: *mut c_void, size: CFIndex, allocator: CFAllocatorRef, info: *mut c_void) -> *mut c_void,
+}
+
+#[repr(C)]
+pub struct CFRunLoopObserverContext {
+    pub version: CFIndex,
+    pub info: *mut c_void,
+    pub retain: extern "C" fn (info: *const c_void) -> *const c_void,
+    pub release: extern "C" fn (info: *const c_void),
+    pub copyDescription: extern "C" fn (info: *const c_void) -> CFStringRef,
+}
+
+pub type CFRunLoopObserverCallBack = extern "C" fn (observer: CFRunLoopObserverRef, activity: CFRunLoopActivity, info: *mut c_void);
+
+#[repr(C)]
+pub struct CFRunLoopTimerContext {
+    pub version: CFIndex,
+    pub info: *mut c_void,
+    pub retain: extern "C" fn (info: *const c_void) -> *const c_void,
+    pub release: extern "C" fn (info: *const c_void),
+    pub copyDescription: extern "C" fn (info: *const c_void) -> CFStringRef,
+}
+
+pub type CFRunLoopTimerCallBack = extern "C" fn (timer: CFRunLoopTimerRef, info: *mut c_void);
+
+#[repr(C)]
+pub struct __CFRunLoopTimer;
+
+pub type CFRunLoopTimerRef = *const __CFRunLoopTimer;
+
+extern {
+    /*
+     * CFRunLoop.h
+     */
+    pub static kCFRunLoopDefaultMode: CFStringRef;
+    pub static kCFRunLoopCommonModes: CFStringRef;
+    pub fn CFRunLoopGetTypeID() -> CFTypeID;
+    pub fn CFRunLoopGetCurrent() -> CFRunLoopRef;
+    pub fn CFRunLoopGetMain() -> CFRunLoopRef;
+    pub fn CFRunLoopCopyCurrentMode(rl: CFRunLoopRef) -> CFStringRef;
+    pub fn CFRunLoopCopyAllModes(rl: CFRunLoopRef) -> CFArrayRef;
+    pub fn CFRunLoopAddCommonMode(rl: CFRunLoopRef, mode: CFStringRef);
+    pub fn CFRunLoopGetNextTimerFireDate(rl: CFRunLoopRef, mode: CFStringRef) -> CFAbsoluteTime;
+    pub fn CFRunLoopRun();
+    pub fn CFRunLoopRunInMode(mode: CFStringRef, seconds: CFTimeInterval, returnAfterSourceHandled: Boolean) -> i32;
+    pub fn CFRunLoopIsWaiting(rl: CFRunLoopRef) -> Boolean;
+    pub fn CFRunLoopWakeUp(rl: CFRunLoopRef);
+    pub fn CFRunLoopStop(rl: CFRunLoopRef);
+    // fn CFRunLoopPerformBlock(rl: CFRunLoopRef, mode: CFTypeRef, block: void (^)(void));
+    pub fn CFRunLoopContainsSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef) -> Boolean;
+    pub fn CFRunLoopAddSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef);
+    pub fn CFRunLoopRemoveSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef);
+    pub fn CFRunLoopContainsObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef) -> Boolean;
+    pub fn CFRunLoopAddObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef);
+    pub fn CFRunLoopRemoveObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef);
+    pub fn CFRunLoopContainsTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef) -> Boolean;
+    pub fn CFRunLoopAddTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef);
+    pub fn CFRunLoopRemoveTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef);
+
+    pub fn CFRunLoopSourceGetTypeID() -> CFTypeID;
+    pub fn CFRunLoopSourceCreate(allocator: CFAllocatorRef, order: CFIndex, context: *mut CFRunLoopSourceContext) -> CFRunLoopSourceRef;
+    pub fn CFRunLoopSourceGetOrder(source: CFRunLoopSourceRef) -> CFIndex;
+    pub fn CFRunLoopSourceInvalidate(source: CFRunLoopSourceRef);
+    pub fn CFRunLoopSourceIsValid(source: CFRunLoopSourceRef) -> Boolean;
+    pub fn CFRunLoopSourceGetContext(source: CFRunLoopSourceRef, context: *mut CFRunLoopSourceContext);
+    pub fn CFRunLoopSourceSignal(source: CFRunLoopSourceRef);
+
+    pub fn CFRunLoopObserverGetTypeID() -> CFTypeID;
+    pub fn CFRunLoopObserverCreate(allocator: CFAllocatorRef, activities: CFOptionFlags, repeats: Boolean, order: CFIndex, callout: CFRunLoopObserverCallBack, context: *mut CFRunLoopObserverContext) -> CFRunLoopObserverRef;
+    // fn CFRunLoopObserverCreateWithHandler(allocator: CFAllocatorRef, activities: CFOptionFlags, repeats: Boolean, order: CFIndex, block: void (^) (CFRunLoopObserverRef observer, CFRunLoopActivity activity)) -> CFRunLoopObserverRef;
+    pub fn CFRunLoopObserverGetActivities(observer: CFRunLoopObserverRef) -> CFOptionFlags;
+    pub fn CFRunLoopObserverDoesRepeat(observer: CFRunLoopObserverRef) -> Boolean;
+    pub fn CFRunLoopObserverGetOrder(observer: CFRunLoopObserverRef) -> CFIndex;
+    pub fn CFRunLoopObserverInvalidate(observer: CFRunLoopObserverRef);
+    pub fn CFRunLoopObserverIsValid(observer: CFRunLoopObserverRef) -> Boolean;
+    pub fn CFRunLoopObserverGetContext(observer: CFRunLoopObserverRef, context: *mut CFRunLoopObserverContext);
+
+    pub fn CFRunLoopTimerGetTypeID() -> CFTypeID;
+    pub fn CFRunLoopTimerCreate(allocator: CFAllocatorRef, fireDate: CFAbsoluteTime, interval: CFTimeInterval, flags: CFOptionFlags, order: CFIndex, callout: CFRunLoopTimerCallBack, context: *mut CFRunLoopTimerContext) -> CFRunLoopTimerRef;
+    // fn CFRunLoopTimerCreateWithHandler(allocator: CFAllocatorRef, fireDate: CFAbsoluteTime, interval: CFTimeInterval, flags: CFOptionFlags, order: CFIndex, block: void (^) (CFRunLoopTimerRef timer)) -> CFRunLoopTimerRef;
+    pub fn CFRunLoopTimerGetNextFireDate(timer: CFRunLoopTimerRef) -> CFAbsoluteTime;
+    pub fn CFRunLoopTimerSetNextFireDate(timer: CFRunLoopTimerRef, fireDate: CFAbsoluteTime);
+    pub fn CFRunLoopTimerGetInterval(timer: CFRunLoopTimerRef) -> CFTimeInterval;
+    pub fn CFRunLoopTimerDoesRepeat(timer: CFRunLoopTimerRef) -> Boolean;
+    pub fn CFRunLoopTimerGetOrder(timer: CFRunLoopTimerRef) -> CFIndex;
+    pub fn CFRunLoopTimerInvalidate(timer: CFRunLoopTimerRef);
+    pub fn CFRunLoopTimerIsValid(timer: CFRunLoopTimerRef) -> Boolean;
+    pub fn CFRunLoopTimerGetContext(timer: CFRunLoopTimerRef, context: *mut CFRunLoopTimerContext);
+    pub fn CFRunLoopTimerGetTolerance(timer: CFRunLoopTimerRef) -> CFTimeInterval;
+    pub fn CFRunLoopTimerSetTolerance(timer: CFRunLoopTimerRef, tolerance: CFTimeInterval);
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/set.rs
@@ -0,0 +1,52 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::c_void;
+
+use base::{CFAllocatorRef, CFIndex, CFTypeID};
+
+pub type CFSetRetainCallBack = *const u8;
+pub type CFSetReleaseCallBack = *const u8;
+pub type CFSetCopyDescriptionCallBack = *const u8;
+pub type CFSetEqualCallBack = *const u8;
+pub type CFSetHashCallBack = *const u8;
+
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct CFSetCallBacks {
+    pub version: CFIndex,
+    pub retain: CFSetRetainCallBack,
+    pub release: CFSetReleaseCallBack,
+    pub copyDescription: CFSetCopyDescriptionCallBack,
+    pub equal: CFSetEqualCallBack,
+    pub hash: CFSetHashCallBack,
+}
+
+#[repr(C)]
+pub struct __CFSet(c_void);
+
+pub type CFSetRef = *const __CFSet;
+
+extern {
+    /*
+     * CFSet.h
+     */
+
+    pub static kCFTypeSetCallBacks: CFSetCallBacks;
+
+    /* Creating Sets */
+    pub fn CFSetCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex,
+                       callBacks: *const CFSetCallBacks) -> CFSetRef;
+
+    /* Applying a Function to Set Members */
+    //fn CFSetApplyFunction
+
+    pub fn CFSetGetTypeID() -> CFTypeID;
+}
+
new file mode 100644
--- /dev/null
+++ b/third_party/rust/core-foundation-sys-0.2.3/src/string.rs
@@ -0,0 +1,320 @@
+// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use libc::{c_char, c_ushort, c_void};
+
+use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, CFRange, CFTypeID};
+
+pub type UniChar = c_ushort;
+
+// CFString.h
+
+pub type CFStringCompareFlags = CFOptionFlags;
+//static kCFCompareCaseInsensitive: CFStringCompareFlags = 1;
+//static kCFCompareBackwards: CFStringCompareFlags = 4;
+//static kCFCompareAnchored: CFStringCompareFlags = 8;
+//static kCFCompareNonliteral: CFStringCompareFlags = 16;
+//static kCFCompareLocalized: CFStringCompareFlags = 32;
+//static kCFCompareNumerically: CFStringCompareFlags = 64;
+//static kCFCompareDiacriticInsensitive: CFStringCompareFlags = 128;
+//static kCFCompareWidthInsensitive: CFStringCompareFlags = 256;
+//static kCFCompareForcedOrdering: CFStringCompareFlags = 512;
+
+pub type CFStringEncoding = u32;
+
+// OS X built-in encodings.
+
+//static kCFStringEncodingMacRoman: CFStringEncoding = 0;
+//static kCFStringEncodingWindowsLatin1: CFStringEncoding = 0x0500;
+//static kCFStringEncodingISOLatin1: CFStringEncoding = 0x0201;
+//static kCFStringEncodingNextStepLatin: CFStringEncoding = 0x0B01;
+//static kCFStringEncodingASCII: CFStringEncoding = 0x0600;
+//static kCFStringEncodingUnicode: CFStringEncoding = 0x0100;
+pub static kCFStringEncodingUTF8: CFStringEncoding = 0x08000100;
+//static kCFStringEncodingNonLossyASCII: CFStringEncoding = 0x0BFF;
+
+//static kCFStringEncodingUTF16: CFStringEncoding = 0x0100;
+//static kCFStringEncodingUTF16BE: CFStringEncoding = 0x10000100;
+//static kCFStringEncodingUTF16LE: CFStringEncoding = 0x14000100;
+//static kCFStringEncodingUTF32: CFStringEncoding = 0x0c000100;
+//static kCFStringEncodingUTF32BE: CFStringEncoding = 0x18000100;
+//static kCFStringEncodingUTF32LE: CFStringEncoding = 0x1c000100;
+
+
+// CFStringEncodingExt.h
+
+pub type CFStringEncodings = CFIndex;
+
+// External encodings, except those defined above.
+// Defined above: kCFStringEncodingMacRoman = 0
+//static kCFStringEncodingMacJapanese: CFStringEncoding = 1;
+//static kCFStringEncodingMacChineseTrad: CFStringEncoding = 2;
+//static kCFStringEncodingMacKorean: CFStringEncoding = 3;
+//static kCFStringEncodingMacArabic: CFStringEncoding = 4;
+//static kCFStringEncodingMacHebrew: CFStringEncoding = 5;
+//static kCFStringEncodingMacGreek: CFStringEncoding = 6;
+//static kCFStringEncodingMacCyrillic: CFStringEncoding = 7;
+//static kCFStringEncodingMacDevanagari: CFStringEncoding = 9;
+//static kCFStringEncodingMacGurmukhi: CFStringEncoding = 10;
+//static kCFStringEncodingMacGujarati: CFStringEncoding = 11;
+//static kCFStringEncodingMacOriya: CFStringEncoding = 12;
+//static kCFStringEncodingMacBengali: CFStringEncoding = 13;
+//static kCFStringEncodingMacTamil: CFStringEncoding = 14;
+//static kCFStringEncodingMacTelugu: CFStringEncoding = 15;
+//static kCFStringEncodingMacKannada: CFStringEncoding = 16;
+//static kCFStringEncodingMacMalayalam: CFStringEncoding = 17;
+//static kCFStringEncodingMacSinhalese: CFStringEncoding = 18;
+//static kCFStringEncodingMacBurmese: CFStringEncoding = 19;
+//static kCFStringEncodingMacKhmer: CFStringEncoding = 20;
+//static kCFStringEncodingMacThai: CFStringEncoding = 21;
+//static kCFStringEncodingMacLaotian: CFStringEncoding = 22;
+//static kCFStringEncodingMacGeorgian: CFStringEncoding = 23;
+//static kCFStringEncodingMacArmenian: CFStringEncoding = 24;
+//static kCFStringEncodingMacChineseSimp: CFStringEncoding = 25;
+//static kCFStringEncodingMacTibetan: CFStringEncoding = 26;
+//static kCFStringEncodingMacMongolian: CFStringEncoding = 27;
+//static kCFStringEncodingMacEthiopic: CFStringEncoding = 28;
+//static kCFStringEncodingMacCentralEurRoman: CFStringEncoding = 29;
+//static kCFStringEncodingMacVietnamese: CFStringEncoding = 30;
+//static kCFStringEncodingMacExtArabic: CFStringEncoding = 31;
+//static kCFStringEncodingMacSymbol: CFStringEncoding = 33;
+//static kCFStringEncodingMacDingbats: CFStringEncoding = 34;
+//static kCFStringEncodingMacTurkish: CFStringEncoding = 35;
+//static kCFStringEncodingMacCroatian: CFStringEncoding = 36;
+//static kCFStringEncodingMacIcelandic: CFStringEncoding = 37;
+//static kCFStringEncodingMacRomanian: CFStringEncoding = 38;
+//static kCFStringEncodingMacCeltic: CFStringEncoding = 39;
+//static kCFStringEncodingMacGaelic: CFStringEncoding = 40;
+//static kCFStringEncodingMacFarsi: CFStringEncoding = 0x8C;
+//static kCFStringEncodingMacUkrainian: CFStringEncoding = 0x98;
+//static kCFStringEncodingMacInuit: CFStringEncoding = 0xEC;
+//static kCFStringEncodingMacVT100: CFStringEncoding = 0xFC;
+//static kCFStringEncodingMacHFS: CFStringEncoding = 0xFF;
+// Defined above: kCFStringEncodingISOLatin1 = 0x0201
+//static kCFStringEncodingISOLatin2: CFStringEncoding = 0x0202;
+//static kCFStringEncodingISOLatin3: CFStringEncoding = 0x0203;
+//static kCFStringEncodingISOLatin4: CFStringEncoding = 0x0204;
+//static kCFStringEncodingISOLatinCyrillic: CFStringEncoding = 0x0205;
+//static kCFStringEncodingISOLatinArabic: CFStringEncoding = 0x0206;
+//static kCFStringEncodingISOLatinGreek: CFStringEncoding = 0x0207;
+//static kCFStringEncodingISOLatinHebrew: CFStringEncoding = 0x0208;
+//static kCFStringEncodingISOLatin5: CFStringEncoding = 0x0209;
+//static kCFStringEncodingISOLatin6: CFStringEncoding = 0x020A;
+//static kCFStringEncodingISOLatinThai: CFStringEncoding = 0x020B;
+//static kCFStringEncodingISOLatin7: CFStringEncoding = 0x020D;
+//static kCFStringEncodingISOLatin8: CFStringEncoding = 0x020E;
+//static kCFStringEncodingISOLatin9: CFStringEncoding = 0x020F;
+//static kCFStringEncodingISOLatin10: CFStringEncoding = 0x0210;
+//static kCFStringEncodingDOSLatinUS: CFStringEncoding = 0x0400;
+//static kCFStringEncodingDOSGreek: CFStringEncoding = 0x0405;
+//static kCFStringEncodingDOSBalticRim: CFStringEncoding = 0x0406;
+//static kCFStringEncodingDOSLatin1: CFStringEncoding = 0x0410;
+//static kCFStringEncodingDOSGreek1: CFStringEncoding = 0x0411;
+//static kCFStringEncodingDOSLatin2: CFStringEncoding = 0x0412;
+//static kCFStringEncodingDOSCyrillic: CFStringEncoding = 0x0413;
+//static kCFStringEncodingDOSTurkish: CFStringEncoding = 0x0414;
+//static kCFStringEncodingDOSPortuguese: CFStringEncoding = 0x0415;
+//static kCFStringEncodingDOSIcelandic: CFStringEncoding = 0x0416;
+//static kCFStringEncodingDOSHebrew: CFStringEncoding = 0x0417;
+//static kCFStringEncodingDOSCanadianFrench: CFStringEncoding = 0x0418;
+//static kCFStringEncodingDOSArabic: CFStringEncoding = 0x0419;
+//static kCFStringEncodingDOSNordic: CFStringEncoding = 0x041A;
+//static kCFStringEncodingDOSRussian: CFStringEncoding = 0x041B;
+//static kCFStringEncodingDOSGreek2: CFStringEncoding = 0x041C;
+//static kCFStringEncodingDOSThai: CFStringEncoding = 0x041D;
+//static kCFStringEncodingDOSJapanese: CFStringEncoding = 0x0420;
+//static kCFStringEncodingDOSChineseSimplif: CFStringEncoding = 0x0421;
+//static kCFStringEncodingDOSKorean: CFStringEncoding = 0x0422;
+//static kCFStringEncodingDOSChineseTrad: CFStringEncoding = 0x0423;
+// Defined above: kCFStringEncodingWindowsLatin1 = 0x0500
+//static kCFStringEncodingWindowsLatin2: CFStringEncoding = 0x0501;
+//static kCFStringEncodingWindowsCyrillic: CFStringEncoding = 0x0502;
+//static kCFStringEncodingWindowsGreek: CFStringEncoding = 0x0503;
+//static kCFStringEncodingWindowsLatin5: CFStringEncoding = 0x0504;
+//static kCFStringEncodingWindowsHebrew: CFStringEncoding = 0x0505;
+//static kCFStringEncodingWindowsArabic: CFStringEncoding = 0x0506;
+//static kCFStringEncodingWindowsBalticRim: CFStringEncoding = 0x0507;
+//static kCFStringEncodingWindowsVietnamese: CFStringEncoding = 0x0508;
+//static kCFStringEncodingWindowsKoreanJohab: CFStringEncoding = 0x0510;
+// Defined above: kCFStringEncodingASCII = 0x0600
+//static kCFStringEncodingANSEL: CFStringEncoding = 0x0601;
+//static kCFStringEncodingJIS_X0201_76: CFStringEncoding = 0x0620;
+//static kCFStringEncodingJIS_X0208_83: CFStringEncoding = 0x0621;
+//static kCFStringEncodingJIS_X0208_90: CFStringEncoding = 0x0622;
+//static kCFStringEncodingJIS_X0212_90: CFStringEncoding = 0x0623;
+//static kCFStringEncodingJIS_C6226_78: CFStringEncoding = 0x0624;
+//static kCFStringEncodingShiftJIS_X0213: CFStringEncoding = 0x0628;
+//static kCFStringEncodingShiftJIS_X0213_MenKuTen: CFStringEncoding = 0x0629;
+//static kCFStringEncodingGB_2312_80: CFStringEncoding = 0x0630;
+//static kCFStringEncodingGBK_95: CFStringEncoding = 0x0631;
+//static kCFStringEncodingGB_18030_2000: CFStringEncoding = 0x0632;
+//static kCFStringEncodingKSC_5601_87: CFStringEncoding = 0x0640;
+//static kCFStringEncodingKSC_5601_92_Johab: CFStringEncoding = 0x0641;
+//static kCFStringEncodingCNS_11643_92_P1: CFStringEncoding = 0x0651;
+//static kCFStringEncodingCNS_11643_92_P2: CFStringEncoding = 0x0652;
+//static kCFStringEncodingCNS_11643_92_P3: CFStringEncoding = 0x0653;
+//static kCFStringEncodingISO_2022_JP: CFStringEncoding = 0x0820;
+//static kCFStringEncodingISO_2022_JP_2: CFStringEncoding = 0x0821;
+//static kCFStringEncodingISO_2022_JP_1: CFStringEncoding = 0x0822;
+//static kCFStringEncodingISO_2022_JP_3: CFStringEncoding = 0x0823;
+//static kCFStringEncodingISO_2022_CN: CFStringEncoding = 0x0830;
+//static kCFStringEncodingISO_2022_CN_EXT: CFStringEncoding = 0x0831;
+//static kCFStringEncodingISO_2022_KR: CFStringEncoding = 0x0840;
+//static kCFStringEncodingEUC_JP: CFStringEncoding = 0x0920;
+//static kCFStringEncodingEUC_CN: CFStringEncoding = 0x0930;
+//static kCFStringEncodingEUC_TW: CFStringEncoding = 0x0931;
+//static kCFStringEncodingEUC_KR: CFStringEncoding = 0x0940;
+//static kCFStringEncodingShiftJIS: CFStringEncoding = 0x0A01;
+//static kCFStringEncodingKOI8_R: CFStringEncoding = 0x0A02;
+//static kCFStringEncodingBig5: CFStringEncoding = 0x0A03;
+//static kCFStringEncodingMacRomanLatin1: CFStringEncoding = 0x0A04;
+//static kCFStringEncodingHZ_GB_2312: CFStringEncoding = 0x0A05;
+//static kCFStringEncodingBig5_HKSCS_1999: CFStringEncoding = 0x0A06;
+//static kCFStringEncodingVISCII: CFStringEncoding = 0x0A07;
+//static kCFStringEncodingKOI8_U: CFStringEncoding = 0x0A08;
+//static kCFStringEncodingBig5_E: CFStringEncoding = 0x0A09;
+// Defined above: kCFStringEncodingNextStepLatin = 0x0B01
+//static kCFStringEncodingNextStepJapanese: CFStringEncoding = 0x0B02;
+//static kCFStringEncodingEBCDIC_US: CFStringEncoding = 0x0C01;
+//static kCFStringEncodingEBCDIC_CP037: CFStringEncoding = 0x0C02;
+//static kCFStringEncodingUTF7: CFStringEncoding = 0x04000100;
+//static kCFStringEncodingUTF7_IMAP: CFStringEncoding = 0x0A10;
+//static kCFStringEncodingShiftJIS_X0213_00: CFStringEncoding = 0x0628; /* Deprecated */
+
+#[repr(C)]
+pub struct __CFString(c_void);
+
+pub type CFStringRef = *const __CFString;
+
+extern {
+    /*
+     * CFString.h
+     */
+
+    // N.B. organized according to "Functions by task" in docs
+
+    /* Creating a CFString */
+    //fn CFSTR
+    //fn CFStringCreateArrayBySeparatingStrings
+    //fn CFStringCreateByCombiningStrings
+    //fn CFStringCreateCopy
+    //fn CFStringCreateFromExternalRepresentation
+    pub fn CFStringCreateWithBytes(alloc: CFAllocatorRef,
+                                   bytes: *const u8,
+                                   numBytes: CFIndex,
+                                   encoding: CFStringEncoding,
+                                   isExternalRepresentation: Boolean,
+                                   contentsDeallocator: CFAllocatorRef)
+                                   -> CFStringRef;
+    pub fn CFStringCreateWithBytesNoCopy(alloc: CFAllocatorRef,
+                                         bytes: *const u8,
+                                         numBytes: CFIndex,
+                                         encoding: CFStringEncoding,
+                                         isExternalRepresentation: Boolean,
+                                         contentsDeallocator: CFAllocatorRef)
+                                         -> CFStringRef;
+    //fn CFStringCreateWithCharacters
+    //fn CFStringCreateWithCharactersNoCopy
+    pub fn CFStringCreateWithCString(alloc: CFAllocatorRef,
+                                     cStr: *const c_char,
+                                     encoding: CFStringEncoding)
+                                     -> CFStringRef;
+    //fn CFStringCreateWithCStringNoCopy
+    //fn CFStringCreateWithFormat
+    //fn CFStringCreateWithFormatAndArguments
+    //fn CFStringCreateWithPascalString
+    //fn CFStringCreateWithPascalStringNoCopy
+    //fn CFStringCreateWithSubstring
+
+    /* Searching Strings */
+    //fn CFStringCreateArrayWithFindResults
+    //fn CFStringFind
+    //fn CFStringFindCharacterFromSet
+    //fn CFStringFindWithOptions
+    //fn CFStringFindWithOptionsAndLocale
+    //fn CFStringGetLineBounds
+
+    /* Comparing Strings */
+    //fn CFStringCompare
+    //fn CFStringCompareWithOptions
+    //fn CFStringCompareWithOptionsAndLocale
+    //fn CFStringHasPrefix
+    //fn CFStringHasSuffix
+
+    /* Accessing Characters */
+    //fn CFStringCreateExternalRepresentation
+    pub fn CFStringGetBytes(theString: CFStringRef,
+                            range: CFRange,
+                            encoding: CFStringEncoding,
+                            lossByte: u8,
+                            isExternalRepresentation: Boolean,
+                            buffer: *mut u8,
+                            maxBufLen: CFIndex,
+                            usedBufLen: *mut CFIndex)
+                            -> CFIndex;
+    //fn CFStringGetCharacterAtIndex
+    //fn CFStringGetCharacters
+    //fn CFStringGetCharactersPtr
+    //fn CFStringGetCharacterFromInlineBuffer
+    pub fn CFStringGetCString(theString: CFStringRef,
+                              buffer: *mut c_char,
+                              bufferSize: CFIndex,
+                              encoding: CFStringEncoding)
+                              -> Boolean;
+    pub fn CFStringGetCStringPtr(theString: CFStringRef,
+                                 encoding: CFStringEncoding)
+                                 -> *const c_char;
+    pub fn CFStringGetLength(theString: CFStringRef) -> CFIndex;
+    //fn CFStringGetPascalString
+    //fn CFStringGetPascalStringPtr
+    //fn CFStringGetRangeOfComposedCharactersAtIndex
+    //fn CFStringInitInlineBuffer
+
+    /* Working With Hyphenation */
+    //fn CFStringGetHyphenationLocationBeforeIndex
+    //fn CFStringIsHyphenationAvailableForLocale
+
+    /* Working With Encodings */
+    //fn CFStringConvertEncodingToIANACharSetName
+    //fn CFStringConvertEncodingToNSStringEncoding
+    //fn CFStringConvertEncodingToWindowsCodepage
+    //fn CFStringConvertIANACharSetNameToEncoding
+    //fn CFStringConvertNSStringEncodingToEncoding
+    //fn CFStringConvertWindowsCodepageToEncoding
+    //fn CFStringGetFastestEncoding
+    //fn CFStringGetListOfAvailableEncodings
+    //fn CFStringGetMaximumSizeForEncoding
+    //fn CFStringGetMostCompatibleMacStringEncoding
+    //fn CFStringGetNameOfEncoding
+    //fn CFStringGetSmallestEncoding
+    //fn CFStringGetSystemEncoding
+    //fn CFStringIsEncodingAvailable
+
+    /* Getting Numeric Values */
+    //fn CFStringGetDoubleValue
+    //fn CFStringGetIntValue
+
+    /* Getting String Properties */
+    //fn CFShowStr
+    pub fn CFStringGetTypeID() -> CFTypeID;
+
+    /* String File System Representations */
+    //fn CFStringCreateWithFileSystemRepresentation
+    //fn CFStringGetFileSystemRepresentation
+    //fn CFStringGetMaximumSizeOfFileSystemRepresentation
+
+    /* Getting Paragraph Bounds */
+    //fn CFStringGetParagraphBounds
+
+    /* Managing Surrogates */
+    //fn CFStringGetLongCharacterForSurrogatePair
+    //fn CFStringGetSurrogatePairForLongCharacter
+    //fn CFStringIsSurrogateHighCharacter
+    //fn CFStringIsSurrogateLowCharacter
+}
copy from third_party/rust/core-foundation-sys/src/url.rs
copy to third_party/rust/core-foundation-sys-0.2.3/src/url.rs
--- a/third_party/rust/core-foundation-sys/.cargo-checksum.json
+++ b/third_party/rust/core-foundation-sys/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"f99593f6c99ed02fd0bd95592e27fd84e0e7508f5ad4c27a185d0c29c1bc38e2","build.rs":"4dbf3e5a423e5eba48fc7f11e4f7638c054e53a3750c888059a96d96f8923ef2","src/array.rs":"d648ed8cf0ccb72c3ca0d9e018a3db804edad9685739eba13f8f515e04f3708b","src/base.rs":"36e8ba1ef798331679972e532a61447a327c2af7697631cb25040b581839410c","src/bundle.rs":"ff5f5253f331b7fa054414a3f256d74760e3ce805b720cdb735a2e46cc66dce6","src/data.rs":"21e968951fe56e080d33474f4438de2dfb7e0c8af426a6dfb100efdd6c530eec","src/date.rs":"f6cdcb94658fafc5bacb83cfbd20ad97502b8ddf6bd1c0c0d6a2545a4f7b7420","src/dictionary.rs":"97c40c1afc719b970968179112ad76c3c89b6b4eb4ea18f7ac3f059d98cce736","src/error.rs":"61bc31a401ec6c8495668175eade9284e257da056fc666af74a5555af5daf33f","src/lib.rs":"8bdbc6ed8fcbbc5b69d7634031ff44d50b9ac789279eb89b80c280ea156c98b3","src/messageport.rs":"59ba92ca90bb9b3162b6df44188fac18cd979250f33a52361144c902e86529bd","src/number.rs":"8881c7cd1b510c654c445485de898f83abda91557fd3e6f9daccf2d1b9c4c57e","src/propertylist.rs":"cc2b27f8f8ebc80c03871b7b1ad50ee348539b016078ce721c86b8cd5f9d75bd","src/runloop.rs":"7feab3bbb9913c3b40285bc37b920f9fe4d937d1db08d8ae69a2ec9597713598","src/set.rs":"51e978fc81d4c55013dfc6df4e76c58daaf5deedf9aafda0f6a9e04e7575272c","src/string.rs":"27b92e8e5d3fc95a521dc6447ccfefd9eb28ec5f42bd8571defd124d950b133f","src/url.rs":"bd9f162e2e3e316267b0d36c4d0551dbf2435a40bd1e69bbe0efafd72d232432"},"package":"065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"4516face4b018e46fc36cfe24eff335671684032a75435305d62fd5f280f05a7","build.rs":"4dbf3e5a423e5eba48fc7f11e4f7638c054e53a3750c888059a96d96f8923ef2","src/array.rs":"d648ed8cf0ccb72c3ca0d9e018a3db804edad9685739eba13f8f515e04f3708b","src/base.rs":"c995d91c9e5aed99ea28fc75561cfd573f5e8ff806ef512194e7b616c35c308f","src/bundle.rs":"ff5f5253f331b7fa054414a3f256d74760e3ce805b720cdb735a2e46cc66dce6","src/data.rs":"21e968951fe56e080d33474f4438de2dfb7e0c8af426a6dfb100efdd6c530eec","src/date.rs":"f6cdcb94658fafc5bacb83cfbd20ad97502b8ddf6bd1c0c0d6a2545a4f7b7420","src/dictionary.rs":"97c40c1afc719b970968179112ad76c3c89b6b4eb4ea18f7ac3f059d98cce736","src/error.rs":"61bc31a401ec6c8495668175eade9284e257da056fc666af74a5555af5daf33f","src/lib.rs":"8bdbc6ed8fcbbc5b69d7634031ff44d50b9ac789279eb89b80c280ea156c98b3","src/messageport.rs":"59ba92ca90bb9b3162b6df44188fac18cd979250f33a52361144c902e86529bd","src/number.rs":"8881c7cd1b510c654c445485de898f83abda91557fd3e6f9daccf2d1b9c4c57e","src/propertylist.rs":"cc2b27f8f8ebc80c03871b7b1ad50ee348539b016078ce721c86b8cd5f9d75bd","src/runloop.rs":"7feab3bbb9913c3b40285bc37b920f9fe4d937d1db08d8ae69a2ec9597713598","src/set.rs":"51e978fc81d4c55013dfc6df4e76c58daaf5deedf9aafda0f6a9e04e7575272c","src/string.rs":"27b92e8e5d3fc95a521dc6447ccfefd9eb28ec5f42bd8571defd124d950b133f","src/url.rs":"8a3f4137ca26e379a24666b4caa7a08f9726f838e53e9dbb92ba474036309669"},"package":"41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624"}
\ No newline at end of file
--- a/third_party/rust/core-foundation-sys/Cargo.toml
+++ b/third_party/rust/core-foundation-sys/Cargo.toml
@@ -1,13 +1,12 @@
 [package]
 name = "core-foundation-sys"
 description = "Bindings to Core Foundation for OS X"
 homepage = "https://github.com/servo/core-foundation-rs"
 repository = "https://github.com/servo/core-foundation-rs"
-version = "0.2.3"
+version = "0.3.1"
 authors = ["The Servo Project Developers"]
 license = "MIT / Apache-2.0"
 build = "build.rs"
-links = "CoreFoundation.framework"
 
 [dependencies]
 libc = "0.2"
--- a/third_party/rust/core-foundation-sys/src/base.rs
+++ b/third_party/rust/core-foundation-sys/src/base.rs
@@ -2,28 +2,29 @@
 // file at the top-level directory of this distribution.
 //
 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use libc::{c_uint, c_long, c_ulong, c_void};
+use libc::{c_uint, c_long, c_ulong, c_void, c_int};
 
 pub type Boolean = u8;
 pub type CFIndex = c_long;
 pub type mach_port_t = c_uint;
 pub type CFAllocatorRef = *const c_void;
 pub type CFNullRef = *const c_void;
 pub type CFHashCode = c_ulong;
 pub type CFTypeID = c_ulong;
 pub type CFTypeRef = *const c_void;
 pub type CFOptionFlags = u32;
 pub type OSStatus = i32;
+pub type SInt32 = c_int;
 
 #[repr(C)]
 #[derive(Clone, Copy)]
 pub struct CFRange {
     pub location: CFIndex,
     pub length: CFIndex
 }
 
--- a/third_party/rust/core-foundation-sys/src/url.rs
+++ b/third_party/rust/core-foundation-sys/src/url.rs
@@ -3,17 +3,17 @@
 //
 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 use libc::c_void;
 
-use base::{CFOptionFlags, CFIndex, CFAllocatorRef, Boolean, CFTypeID};
+use base::{CFOptionFlags, CFIndex, CFAllocatorRef, Boolean, CFTypeID, SInt32};
 use string::CFStringRef;
 
 #[repr(C)]
 pub struct __CFURL(c_void);
 
 pub type CFURLRef = *const __CFURL;
 
 pub type CFURLBookmarkCreationOptions = CFOptionFlags;
@@ -95,33 +95,33 @@ extern {
     //fn CFURLCreateWithBytes
     //fn CFURLCreateWithFileSystemPath
     pub fn CFURLCreateWithFileSystemPath(allocator: CFAllocatorRef, filePath: CFStringRef, pathStyle: CFURLPathStyle, isDirectory: Boolean) -> CFURLRef;
     //fn CFURLCreateWithFileSystemPathRelativeToBase
     //fn CFURLCreateWithString(allocator: CFAllocatorRef, urlString: CFStringRef,
     //                         baseURL: CFURLRef) -> CFURLRef;
 
     /* Accessing the Parts of a URL */
-    //fn CFURLCanBeDecomposed
-    //fn CFURLCopyFileSystemPath
-    //fn CFURLCopyFragment
-    //fn CFURLCopyHostName
-    //fn CFURLCopyLastPathComponent
-    //fn CFURLCopyNetLocation
-    //fn CFURLCopyParameterString
-    //fn CFURLCopyPassword
-    //fn CFURLCopyPath
-    //fn CFURLCopyPathExtension
-    //fn CFURLCopyQueryString
-    //fn CFURLCopyResourceSpecifier
-    //fn CFURLCopyScheme
-    //fn CFURLCopyStrictPath
-    //fn CFURLCopyUserName
-    //fn CFURLGetPortNumber
-    //fn CFURLHasDirectoryPath
+    pub fn CFURLCanBeDecomposed(anURL: CFURLRef) -> Boolean;
+    pub fn CFURLCopyFileSystemPath(anURL: CFURLRef, pathStyle: CFURLPathStyle) -> CFStringRef;
+    pub fn CFURLCopyFragment(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef;
+    pub fn CFURLCopyHostName(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyLastPathComponent(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyNetLocation(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyParameterString(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef;
+    pub fn CFURLCopyPassword(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyPath(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyPathExtension(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyQueryString(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef;
+    pub fn CFURLCopyResourceSpecifier(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyScheme(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLCopyStrictPath(anURL: CFURLRef, isAbsolute: *mut Boolean) -> CFStringRef;
+    pub fn CFURLCopyUserName(anURL: CFURLRef) -> CFStringRef;
+    pub fn CFURLGetPortNumber(anURL: CFURLRef) -> SInt32;
+    pub fn CFURLHasDirectoryPath(anURL: CFURLRef) -> Boolean;
 
     /* Converting URLs to Other Representations */
     //fn CFURLCreateData(allocator: CFAllocatorRef, url: CFURLRef,
     //                   encoding: CFStringEncoding, escapeWhitespace: bool) -> CFDataRef;
     //fn CFURLCreateStringByAddingPercentEscapes
     //fn CFURLCreateStringByReplacingPercentEscapes
     //fn CFURLCreateStringByReplacingPercentEscapesUsingEncoding
     //fn CFURLGetFileSystemRepresentation
--- a/third_party/rust/core-foundation/.cargo-checksum.json
+++ b/third_party/rust/core-foundation/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"35ac94f7615ebe24f1285927f03712dde336117e666cfa7cf595d0524bc47b8d","src/array.rs":"ceeb3298fb939ead81914a0e6a555098e59f97c47e62adb625273bde2bb299a4","src/base.rs":"540c85a6600503e2bdf34087e7e921615b094f7493099c7e319c76f34ab97a02","src/boolean.rs":"112adb640ded232cba59eb27edafcf4a3c045cca6f4b0ecb53bb48b741c2139a","src/bundle.rs":"bd172a5e0cc1dffc80edf17da59b90120d0a110181f50f212589b0334fcba72c","src/data.rs":"fc44b08e644b66ae471bb7c8141ec6be7cf5f35eb985dbca5924668a67f0efe5","src/dictionary.rs":"0f3129629db02ea233d08fd937e8290c40f401d644f6a8afc13717094a767559","src/error.rs":"0edbf66bcaa8a68f1de77b9056696b6be4f2dc773f4561f4279e6494cc38453a","src/lib.rs":"71ee7a83a7012138b5a86897f5617d2742c668ccc69664a8c5b4cf080486ddd8","src/number.rs":"262db248c88ac08a3d28d0940ef25fe796fd4ebcf1eeea7bb8a6caa3abdc97f9","src/propertylist.rs":"ec814aa190bc6cf8c2bb3f2d5c65e1a706a770701c8589d29fc01bddad6a11c6","src/runloop.rs":"10e35be9104db16c064dfcb3454a71d00c498fda6145eba53f6e43cb37ee9c15","src/set.rs":"f98fbd31b107f27680727676ab7a3725d6b4370f428e58759ca680eb339a5ea3","src/string.rs":"ec5420a3916e5ebd2cc487ffc605d8fe8de7d09cae8c9fecbf20aa21595f4bee","src/url.rs":"2bdc580d8fa4556c9466923aeccc845257fee9fb5e960b8ff84d6bfead994335"},"package":"25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"7b2f3fe208482ac4c1cf309681e202f3b6e10b512f13a7717e6b298809cd8e03","src/array.rs":"ceeb3298fb939ead81914a0e6a555098e59f97c47e62adb625273bde2bb299a4","src/base.rs":"540c85a6600503e2bdf34087e7e921615b094f7493099c7e319c76f34ab97a02","src/boolean.rs":"112adb640ded232cba59eb27edafcf4a3c045cca6f4b0ecb53bb48b741c2139a","src/bundle.rs":"bd172a5e0cc1dffc80edf17da59b90120d0a110181f50f212589b0334fcba72c","src/data.rs":"fc44b08e644b66ae471bb7c8141ec6be7cf5f35eb985dbca5924668a67f0efe5","src/dictionary.rs":"0f3129629db02ea233d08fd937e8290c40f401d644f6a8afc13717094a767559","src/error.rs":"0edbf66bcaa8a68f1de77b9056696b6be4f2dc773f4561f4279e6494cc38453a","src/lib.rs":"71ee7a83a7012138b5a86897f5617d2742c668ccc69664a8c5b4cf080486ddd8","src/number.rs":"262db248c88ac08a3d28d0940ef25fe796fd4ebcf1eeea7bb8a6caa3abdc97f9","src/propertylist.rs":"ec814aa190bc6cf8c2bb3f2d5c65e1a706a770701c8589d29fc01bddad6a11c6","src/runloop.rs":"10e35be9104db16c064dfcb3454a71d00c498fda6145eba53f6e43cb37ee9c15","src/set.rs":"f98fbd31b107f27680727676ab7a3725d6b4370f428e58759ca680eb339a5ea3","src/string.rs":"ec5420a3916e5ebd2cc487ffc605d8fe8de7d09cae8c9fecbf20aa21595f4bee","src/url.rs":"2bdc580d8fa4556c9466923aeccc845257fee9fb5e960b8ff84d6bfead994335"},"package":"f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3"}
\ No newline at end of file
--- a/third_party/rust/core-foundation/Cargo.toml
+++ b/third_party/rust/core-foundation/Cargo.toml
@@ -1,15 +1,15 @@
 [package]
 name = "core-foundation"
 description = "Bindings to Core Foundation for OS X"
 homepage = "https://github.com/servo/core-foundation-rs"
 repository = "https://github.com/servo/core-foundation-rs"
-version = "0.2.3"
+version = "0.3.0"
 authors = ["The Servo Project Developers"]
 license = "MIT / Apache-2.0"
 
 [dependencies.core-foundation-sys]
 path = "../core-foundation-sys"
-version = "0.2.3"
+version = "0.3.0"
 
 [dependencies]
 libc = "0.2"
--- a/third_party/rust/core-graphics/.cargo-checksum.json
+++ b/third_party/rust/core-graphics/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"d0114f648b7f61e473b61c6d682fefaa4e3fadf2101aff056e2ffc52e9229d87",".travis.yml":"b71b9a6f84b9263b2b89be6ec90dff5920ee68cf9e5768d73ed71957de2d0670","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"369e564eec78780281f752fa17783b729951c2d703e1dce0f234f8c81ab79d24","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"4a45abeb1e684e30bb361dfa7db59189423348e18d310cbae694b7c8c57cd86a","src/base.rs":"3f3d5d69bd79b146cc3c0402de6260f7531c04e6a44b080f4ec7c8cedebd1337","src/color_space.rs":"7d447e774e85cc33de574637a93c9a8550b681c8d4b94e99f95261ea9740e288","src/context.rs":"7c764ffde2e0ebaecd30ced31ece29f82ddea2f3c8145f4ea59882df38fec0d2","src/data_provider.rs":"899a5762ea472b828e1726e1cefc8d2dbd237772ce171cf6b31a79f144ce8df1","src/display.rs":"906cbcb13f8214308a6afcfb3abdd04e409f48ce62673574d40087486f38b36d","src/event.rs":"7f25a98207f200f10717c2765179ece8ba02600767b7c194c49854e7bfaa470c","src/event_source.rs":"6d1c1378dab8988c46dd3bf20639913716418980b9b490a37a0d5120c60ad580","src/font.rs":"635ee3d1039c807e00fe93b974c9e375c532f09c99322dd93b9496783a662c0a","src/geometry.rs":"9f59dcf55f393a3fa001afe8aea68a85a3c9a06239aeafe6da5d2823ed37b271","src/lib.rs":"efed3638b05e6a806a6fa0c544893afeec931f6c6889bd4a69d8fd2f9838967f","src/private.rs":"87c96ed2002bd567bf02535b4c6e8e3f22827afb2dd92ee17d91cfb45bc6072c"},"package":"8bd94d0f0b2bbcbfeeb670fc48654afde7a13c2c551ca9d2b9a6cfafdafe1a64"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"d0114f648b7f61e473b61c6d682fefaa4e3fadf2101aff056e2ffc52e9229d87",".travis.yml":"b71b9a6f84b9263b2b89be6ec90dff5920ee68cf9e5768d73ed71957de2d0670","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"101ff1c674aad746f5a9cc0aec36b7bb7da61df7b621ade9f3c4052ab0901ec6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"4a45abeb1e684e30bb361dfa7db59189423348e18d310cbae694b7c8c57cd86a","src/base.rs":"3f3d5d69bd79b146cc3c0402de6260f7531c04e6a44b080f4ec7c8cedebd1337","src/color_space.rs":"7d447e774e85cc33de574637a93c9a8550b681c8d4b94e99f95261ea9740e288","src/context.rs":"7c764ffde2e0ebaecd30ced31ece29f82ddea2f3c8145f4ea59882df38fec0d2","src/data_provider.rs":"899a5762ea472b828e1726e1cefc8d2dbd237772ce171cf6b31a79f144ce8df1","src/display.rs":"906cbcb13f8214308a6afcfb3abdd04e409f48ce62673574d40087486f38b36d","src/event.rs":"7f25a98207f200f10717c2765179ece8ba02600767b7c194c49854e7bfaa470c","src/event_source.rs":"6d1c1378dab8988c46dd3bf20639913716418980b9b490a37a0d5120c60ad580","src/font.rs":"635ee3d1039c807e00fe93b974c9e375c532f09c99322dd93b9496783a662c0a","src/geometry.rs":"9f59dcf55f393a3fa001afe8aea68a85a3c9a06239aeafe6da5d2823ed37b271","src/lib.rs":"efed3638b05e6a806a6fa0c544893afeec931f6c6889bd4a69d8fd2f9838967f","src/private.rs":"87c96ed2002bd567bf02535b4c6e8e3f22827afb2dd92ee17d91cfb45bc6072c"},"package":"7b205856aba54bfd36e69a1058f45fbe0d3c37be7375309dcff4a22a2a631fea"}
\ No newline at end of file
--- a/third_party/rust/core-graphics/Cargo.toml
+++ b/third_party/rust/core-graphics/Cargo.toml
@@ -1,17 +1,17 @@
 [package]
 name = "core-graphics"
 description = "Bindings to Core Graphics for OS X"
 homepage = "https://github.com/servo/core-graphics-rs"
 repository = "https://github.com/servo/core-graphics-rs"
-version = "0.5.0"
+version = "0.6.0"
 authors = ["The Servo Project Developers"]
 license = "MIT / Apache-2.0"
 
 [features]
 default = []
 elcapitan = []
 
 [dependencies]
 libc = "0.2"
-core-foundation = "0.2"
+core-foundation = "0.3"
 serde = "0.8"
--- a/third_party/rust/core-text/.cargo-checksum.json
+++ b/third_party/rust/core-text/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"d0114f648b7f61e473b61c6d682fefaa4e3fadf2101aff056e2ffc52e9229d87",".travis.yml":"6aad961651169d31d79c0595624d1777b5c4cbb4cf2bed9a126c7e72d29411fd","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"e185b9d848cdb6eda1bafc616b76c2452f80861f098610c5568ea68aa06f8877","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"0c82015d302c9937e6376debd961350afeaeb6dde228aac95e3a3115c5813613","src/font.rs":"d9df5c37cb98436dbf8162af9c3449fea1eab41511d326840759d46d514bcada","src/font_collection.rs":"d4ca7f741fd54b4b22b823833dfa1f1ccd78a26cf112119ae992572835e48df6","src/font_descriptor.rs":"cedc4bd303abd4519c7c95201672ce5652f7396cd34383c059f945eefb64623b","src/font_manager.rs":"de5e22620528322d6811d01f03975c53b676ec743297590de5e17a45393df0f1","src/lib.rs":"b1fc720a9ab7ae4f054f0767e05ba5640b2d9fc8c34d05ae04f25b9dd44f6b81"},"package":"642fa40165b6c53bbd3f636951ffc3e1a3fd3c47e7d00598523c3e8c9321ed0c"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"d0114f648b7f61e473b61c6d682fefaa4e3fadf2101aff056e2ffc52e9229d87",".travis.yml":"6aad961651169d31d79c0595624d1777b5c4cbb4cf2bed9a126c7e72d29411fd","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"fd225e94253c22c5a1ad569e5e2db7e0219ed9b0bc30d8a2d4f3a5e55fa2d533","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"0c82015d302c9937e6376debd961350afeaeb6dde228aac95e3a3115c5813613","src/font.rs":"d9df5c37cb98436dbf8162af9c3449fea1eab41511d326840759d46d514bcada","src/font_collection.rs":"d4ca7f741fd54b4b22b823833dfa1f1ccd78a26cf112119ae992572835e48df6","src/font_descriptor.rs":"cedc4bd303abd4519c7c95201672ce5652f7396cd34383c059f945eefb64623b","src/font_manager.rs":"de5e22620528322d6811d01f03975c53b676ec743297590de5e17a45393df0f1","src/lib.rs":"b1fc720a9ab7ae4f054f0767e05ba5640b2d9fc8c34d05ae04f25b9dd44f6b81"},"package":"9703f459a41e622b15ca612dbc5fa4b30b6545a32864a83e0fdc538cfa08969c"}
\ No newline at end of file
--- a/third_party/rust/core-text/Cargo.toml
+++ b/third_party/rust/core-text/Cargo.toml
@@ -1,14 +1,14 @@
 [package]
 name = "core-text"
-version = "2.0.1"
+version = "3.0.0"
 authors = ["The Servo Project Developers"]
 description = "Bindings to the Core Text framework."
 license = "MIT/Apache-2.0"
 repository = "https://github.com/servo/core-text-rs"
 
 [dependencies]
 libc = "0.2"
 
 [target.x86_64-apple-darwin.dependencies]
-core-foundation = "0.2"
-core-graphics = "0.5"
+core-foundation = "0.3"
+core-graphics = "0.6"
--- a/third_party/rust/dwrote/.cargo-checksum.json
+++ b/third_party/rust/dwrote/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"172610b244a5ee8a8e2f1f045058b8abf9291d84bb76bf8779d2fd420419c2d6","Cargo.toml":"abcd85b16e3dd0a0b5213e74b9b23c0ac8e9e484d187588d4f64de717904bc88","README.md":"d69d75705e2582721cbfb2d3b4b2af052c71679057a0b2ac53a22c03f1755bba","build.rs":"b40ce243f62825724b4a45092a8e658d71fa952a6840b83f3bee58e719a56d3b","src/bitmap_render_target.rs":"d3b229f85a9804ac52976431657727b410e7d5253283df046e46d98c196f0a3a","src/com_helpers.rs":"fccb4b36379ae3454a88aa32a8e5c09e46ef5f5626266dde1fe5f40a992de39c","src/comptr.rs":"218435689f505769686e07cfc5428852dda90b849a0d48e670f632307f5edc7c","src/font.rs":"9bdf3134c6ad3639eab3da4419c9b43aad2673797f6fdc65841da2c82e1f3af4","src/font_collection.rs":"969fa3abf141dc3504774886f4783fda4a74cd5a198c643f8a77fc1af4e75258","src/font_face.rs":"47fe777fec8102ef665f5c02f57992e3a36c856fc9647ec69d04b7a39828e83b","src/font_family.rs":"403da9f8f9903cbe7f9f79636497b273f9885e200f53af99f9d4e483f11d6889","src/font_file.rs":"60ad02fc25765a2c113175ea372e98a2be0d84aa65fef9246b6a0192e63ff708","src/font_file_loader_impl.rs":"0d304ad99ff1e6874510a1498223329d798ff75b417e3db7e823a695003dfe92","src/gdi_interop.rs":"98922996afc5b8c8304cb65e7c965419003825dfa172a3e11fe69bf3d768551c","src/glyph_run_analysis.rs":"d30d8b41b047815ab5770c730b7a6d09939f2347b4a4257b87bebec08a5794fe","src/helpers.rs":"5d6f164468234ca8806dc1cea117b42dbfae80cc4c9ae965cb0556efdb364682","src/lib.rs":"6f6cc21f3cbe3403beb1d620c59284463a06b588f7344302310b7723b0eafcc2","src/rendering_params.rs":"be1d1c433f76926c285d8ecdb747c5d9cc6a6c10c1a1890c0760cd99755ed471","src/test.rs":"d77e45f8866abeea070cbbafd4cbde62d875292e8d191310a04c70091978547c","src/types.rs":"784235c15d61fb0d001373575169aa473c92af18dcbc1709a5b2bbaa3a7ceb22"},"package":"b5c3d72c5042f43ee02587b5f3256efc6252c2194fbbb0dfa0bd0b6da2491501"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"172610b244a5ee8a8e2f1f045058b8abf9291d84bb76bf8779d2fd420419c2d6","Cargo.toml":"81966f2284a9e3d1a08d4dd846ae4a0e65a97c90d11d4d859ad13b00e56108f4","README.md":"d69d75705e2582721cbfb2d3b4b2af052c71679057a0b2ac53a22c03f1755bba","build.rs":"b40ce243f62825724b4a45092a8e658d71fa952a6840b83f3bee58e719a56d3b","src/bitmap_render_target.rs":"d3b229f85a9804ac52976431657727b410e7d5253283df046e46d98c196f0a3a","src/com_helpers.rs":"fccb4b36379ae3454a88aa32a8e5c09e46ef5f5626266dde1fe5f40a992de39c","src/comptr.rs":"218435689f505769686e07cfc5428852dda90b849a0d48e670f632307f5edc7c","src/font.rs":"9bdf3134c6ad3639eab3da4419c9b43aad2673797f6fdc65841da2c82e1f3af4","src/font_collection.rs":"969fa3abf141dc3504774886f4783fda4a74cd5a198c643f8a77fc1af4e75258","src/font_face.rs":"9506ca579345ab2b6b5615fc75f8f431e2bb0dbd93123d1d2a21a73c851a5427","src/font_family.rs":"403da9f8f9903cbe7f9f79636497b273f9885e200f53af99f9d4e483f11d6889","src/font_file.rs":"60ad02fc25765a2c113175ea372e98a2be0d84aa65fef9246b6a0192e63ff708","src/font_file_loader_impl.rs":"0d304ad99ff1e6874510a1498223329d798ff75b417e3db7e823a695003dfe92","src/gdi_interop.rs":"98922996afc5b8c8304cb65e7c965419003825dfa172a3e11fe69bf3d768551c","src/glyph_run_analysis.rs":"d30d8b41b047815ab5770c730b7a6d09939f2347b4a4257b87bebec08a5794fe","src/helpers.rs":"5d6f164468234ca8806dc1cea117b42dbfae80cc4c9ae965cb0556efdb364682","src/lib.rs":"77255bb083c75139180c7ba775e2d2b4d73a0d07b342aad3e8fff56b7927e1ca","src/rendering_params.rs":"be1d1c433f76926c285d8ecdb747c5d9cc6a6c10c1a1890c0760cd99755ed471","src/test.rs":"d77e45f8866abeea070cbbafd4cbde62d875292e8d191310a04c70091978547c","src/types.rs":"784235c15d61fb0d001373575169aa473c92af18dcbc1709a5b2bbaa3a7ceb22"},"package":"5998238340a4625b5e1cf52341bd330c5ad91a39a41527ed8af20f95a258a96c"}
\ No newline at end of file
--- a/third_party/rust/dwrote/Cargo.toml
+++ b/third_party/rust/dwrote/Cargo.toml
@@ -1,14 +1,14 @@
 [package]
 name = "dwrote"
 description = "Lightweight binding to DirectWrite."
 repository = "https://github.com/vvuk/dwrote-rs"
 license = "MPL-2.0"
-version = "0.1.6"
+version = "0.1.7"
 authors = ["Vladimir Vukicevic <vladimir@pobox.com>"]
 build = "build.rs"
 
 [lib]
 name = "dwrote"
 
 [features]
 default = ["codegen"]
--- a/third_party/rust/dwrote/src/font_face.rs
+++ b/third_party/rust/dwrote/src/font_face.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use std::slice;
 use std::ptr;
 use std::cell::UnsafeCell;
 use std::mem::zeroed;
 
 use comptr::ComPtr;
-use super::{FontMetrics, FontFile};
+use super::{FontMetrics, FontFile, DefaultDWriteRenderParams};
 
 use winapi;
 
 #[derive(Debug)]
 pub struct FontFace {
     native: UnsafeCell<ComPtr<winapi::IDWriteFontFace>>,
     metrics: FontMetrics,
 }
@@ -129,9 +129,42 @@ impl FontFace {
 
             let table_bytes = slice::from_raw_parts(table_data_ptr, table_size as usize).to_vec();
 
             (*self.native.get()).ReleaseFontTable(table_context);
 
             Some(table_bytes)
         }
     }
+
+    pub fn get_recommended_rendering_mode(&self,
+                                          em_size: f32,
+                                          pixels_per_dip: f32,
+                                          measure_mode: winapi::DWRITE_MEASURING_MODE,
+                                          rendering_params: *mut winapi::IDWriteRenderingParams) ->
+                                          winapi::DWRITE_RENDERING_MODE {
+      unsafe {
+        let mut render_mode : winapi::DWRITE_RENDERING_MODE = winapi::DWRITE_RENDERING_MODE_DEFAULT;
+        let hr = (*self.native.get()).GetRecommendedRenderingMode(em_size,
+                                                                  pixels_per_dip,
+                                                                  measure_mode,
+                                                                  rendering_params,
+                                                                  &mut render_mode);
+
+        if !(hr != 0) {
+          return winapi::DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC;
+        }
+
+        render_mode
+      }
+    }
+
+    pub fn get_recommended_rendering_mode_default_params(&self,
+                                                        em_size: f32,
+                                                        pixels_per_dip: f32,
+                                                        measure_mode: winapi::DWRITE_MEASURING_MODE) ->
+                                                        winapi::DWRITE_RENDERING_MODE {
+      self.get_recommended_rendering_mode(em_size,
+                                          pixels_per_dip,
+                                          measure_mode,
+                                          DefaultDWriteRenderParams())
+    }
 }
--- a/third_party/rust/dwrote/src/lib.rs
+++ b/third_party/rust/dwrote/src/lib.rs
@@ -21,16 +21,17 @@ extern crate serde;
 #[cfg(feature = "serde_codegen")]
 include!(concat!(env!("OUT_DIR"), "/types.rs"));
 
 #[cfg(feature = "serde_derive")]
 include!("types.rs");
 
 use winapi::DWRITE_FACTORY_TYPE_SHARED;
 use winapi::IDWriteFactory;
+use winapi::IDWriteRenderingParams;
 use std::ffi::CString;
 
 use comptr::ComPtr;
 use winapi::S_OK;
 
 mod comptr;
 mod helpers;
 use helpers::ToWide;
@@ -81,16 +82,17 @@ mod glyph_run_analysis; pub use glyph_ru
 // This is an internal implementation of FontFileLoader, for our utility
 // functions.  We don't wrap the DWriteFontFileLoader interface and
 // related things.
 mod font_file_loader_impl;
 
 DEFINE_GUID!{UuidOfIDWriteFactory, 0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48}
 
 unsafe impl Sync for ComPtr<IDWriteFactory> { }
+unsafe impl Sync for ComPtr<IDWriteRenderingParams> {}
 
 lazy_static! {
     static ref DWRITE_FACTORY_RAW_PTR: usize = {
         unsafe {
             type DWriteCreateFactoryType = extern "system" fn(winapi::DWRITE_FACTORY_TYPE, winapi::REFIID, *mut *mut winapi::IUnknown) -> winapi::HRESULT;
 
             let dwrite_dll = kernel32::LoadLibraryW("dwrite.dll".to_wide_null().as_ptr());
             assert!(!dwrite_dll.is_null());
@@ -106,18 +108,34 @@ lazy_static! {
             let hr = dwrite_create_factory(
                 DWRITE_FACTORY_TYPE_SHARED,
                 &UuidOfIDWriteFactory,
                 factory.getter_addrefs());
             assert!(hr == S_OK);
             factory.forget() as usize
         }
     };
-}
+
+  static ref DEFAULT_DWRITE_RENDERING_PARAMS_RAW_PTR: usize = {
+    unsafe {
+      let mut default_rendering_params: ComPtr<IDWriteRenderingParams> = ComPtr::new();
+      let hr = (*DWriteFactory()).CreateRenderingParams(default_rendering_params.getter_addrefs());
+      assert!(hr == S_OK);
+
+      default_rendering_params.forget() as usize
+    }
+  };
+
+} // end lazy static
 
 // FIXME vlad would be nice to return, say, FactoryPtr<IDWriteFactory>
 // that has a DerefMut impl, so that we can write
 // DWriteFactory().SomeOperation() as opposed to
 // (*DWriteFactory()).SomeOperation()
 #[allow(non_snake_case)]
 fn DWriteFactory() -> *mut IDWriteFactory {
     (*DWRITE_FACTORY_RAW_PTR) as *mut IDWriteFactory
 }
+
+#[allow(non_snake_case)]
+fn DefaultDWriteRenderParams() -> *mut IDWriteRenderingParams {
+  (*DEFAULT_DWRITE_RENDERING_PARAMS_RAW_PTR) as *mut IDWriteRenderingParams
+}
--- a/third_party/rust/error-chain/.cargo-checksum.json
+++ b/third_party/rust/error-chain/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitattributes":"7e18693dd440d30e646b599e2088919e50f6955ea6191bed27d852e92d38d08e",".gitignore":"ed8bb3864902ddf6322e6b1d6358bcaec9b51382a5216b9526ad0987ae430b0d",".travis.yml":"d56246d6c8796c638b5012c2d7a91d9b6ec101b6a47128e2d4bfa957c1c784e8","CHANGELOG.md":"8eb613d4a417752d4d1c81e065853e5ba0a21530e0881886c2ae4ffbf0ce57cd","Cargo.toml":"9e551bbef17e031db548e1a81f52d249c94db73a194daf0fe2906bc9404b9805","README.md":"6771ca940645b2f7e7a018c8cd25b25f8bf35786e229b54fa2fded1f2d0ae411","examples/all.rs":"2e6d530e95907bde1e49bda7fde7167568d08a370ade44a153612e2d1cb899d7","examples/doc.rs":"574948eb776c3d363f5cff9a48015bab6c17828c7306dc3eb8818afa90a31a83","examples/quickstart.rs":"0cd227741ed3559c0ead90dcc643cef30b73255d9c9f15c2ee20c4a1085d6f5c","examples/size.rs":"7922acd891dfd06f1d36308a3ccdf03def2646b2f39bfd1b15cf2896247bad8f","src/error_chain.rs":"236c4feead97661b33541434ae71f32c279738a81d0d4b7ce9c50550d5d6a662","src/example_generated.rs":"edaead3c4911afd0a0870cfcab11f8835eb17447031d227bbb5d17210379f778","src/lib.rs":"14ce5d1e76185e762db2414b51411095ddd38207a6f4d9dd50d4a041e7b77d88","src/quick_error.rs":"1889b9ca1f7a5e9124275fd5da81e709d0d6bd3b06915bf320c23d4c4f083301","src/quick_main.rs":"755028c2b4305482a1ab86f8b1b68a95eac22b331c94e14d29777dc69dad1bf4","tests/quick_main.rs":"1d6a726856b954d4cffddab00602583921972ceeeb2bf7ba9ebbac6a51584b53","tests/tests.rs":"2f7ceee2f9808d0985c848d99fe967e8f0b549cf144d4d692a5c5d1c2ba7d660"},"package":"318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"ed8bb3864902ddf6322e6b1d6358bcaec9b51382a5216b9526ad0987ae430b0d",".travis.yml":"d56246d6c8796c638b5012c2d7a91d9b6ec101b6a47128e2d4bfa957c1c784e8","CHANGELOG.md":"8eb613d4a417752d4d1c81e065853e5ba0a21530e0881886c2ae4ffbf0ce57cd","Cargo.toml":"9e551bbef17e031db548e1a81f52d249c94db73a194daf0fe2906bc9404b9805","README.md":"6771ca940645b2f7e7a018c8cd25b25f8bf35786e229b54fa2fded1f2d0ae411","examples/all.rs":"2e6d530e95907bde1e49bda7fde7167568d08a370ade44a153612e2d1cb899d7","examples/doc.rs":"574948eb776c3d363f5cff9a48015bab6c17828c7306dc3eb8818afa90a31a83","examples/quickstart.rs":"0cd227741ed3559c0ead90dcc643cef30b73255d9c9f15c2ee20c4a1085d6f5c","examples/size.rs":"7922acd891dfd06f1d36308a3ccdf03def2646b2f39bfd1b15cf2896247bad8f","src/error_chain.rs":"236c4feead97661b33541434ae71f32c279738a81d0d4b7ce9c50550d5d6a662","src/example_generated.rs":"edaead3c4911afd0a0870cfcab11f8835eb17447031d227bbb5d17210379f778","src/lib.rs":"14ce5d1e76185e762db2414b51411095ddd38207a6f4d9dd50d4a041e7b77d88","src/quick_error.rs":"1889b9ca1f7a5e9124275fd5da81e709d0d6bd3b06915bf320c23d4c4f083301","src/quick_main.rs":"755028c2b4305482a1ab86f8b1b68a95eac22b331c94e14d29777dc69dad1bf4","tests/quick_main.rs":"1d6a726856b954d4cffddab00602583921972ceeeb2bf7ba9ebbac6a51584b53","tests/tests.rs":"2f7ceee2f9808d0985c848d99fe967e8f0b549cf144d4d692a5c5d1c2ba7d660"},"package":"318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/error-chain/.gitattributes
+++ /dev/null
@@ -1,4 +0,0 @@
-*.rs text eol=lf
-*.lock text eol=lf
-*.txt text eol=lf
-*.toml text eol=lf
\ No newline at end of file
--- a/third_party/rust/euclid/.cargo-checksum.json
+++ b/third_party/rust/euclid/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"118514fd9c4958df0d25584cda4917186c46011569f55ef350530c1ad3fbdb48",".travis.yml":"13d3e5a7bf83b04c8e8cfa14f0297bd8366d68391d977dd547f64707dffc275a","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"9484a5c54400981285d2c2389d07a6638334dd2b64caab8b18b4009111932e8b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"7a5648f52b09d3213348177860171d4f19b0fdda55e8fed7c04dafcb0ed9c215","src/approxeq.rs":"2987e046c90d948b6c7d7ddba52d10c8b7520d71dc0a50dbe7665de128d7410e","src/length.rs":"27e6f997c2eafdb22d1eab8054e49e77a61c31ea491b50b2c4569d3e847f3e70","src/lib.rs":"3ad04d3c1a18f697c8d28a1fbe871a4c75e0e957008745c6a4990e8fb07663d1","src/macros.rs":"1e999b322c2093c9c945386d15c3e95bd657c06b02e78235556db0bdbd162318","src/matrix2d.rs":"78d3b44e46be2b9c0ed1d98473cbbed78941cbf8cc76266be9f420966f1c1607","src/matrix4d.rs":"c3325f30a7a35575104a6b02fd0740d5be22e032881808550f28d22ea8eef625","src/num.rs":"62286aa642ce3afa7ebd950f50bf2197d8722907f2e23a2e2ea6690484d8b250","src/point.rs":"a585ad405a69505792efb624f0c0e6345b92b27a2c77e9a4366d6192ac914ef0","src/rect.rs":"d9bc96b8a3bc52ab2d49b53c4687e13230ab5d2920ea60e4070dea153489a633","src/scale_factor.rs":"3cffe0e88f035b8b5c9b27b105fb2825db5f317d7e067c88ee5d51cac4e6e583","src/side_offsets.rs":"f85526a421ffda63ff01a3478d4162c8717eef68e942acfa2fd9a1adee02ebb2","src/size.rs":"48fbec0b24056bed77e5a776338b277a2a5ad6ad836cac5c4b9c8c784753c82f","src/trig.rs":"6b207980052d13c625272f2a70a22f7741b59513c2a4882385926f497c763a63"},"package":"0c274f13773ec277a48408d0c7a8dc935ad4bfe190f4cfccd0126d203afc3c83"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"118514fd9c4958df0d25584cda4917186c46011569f55ef350530c1ad3fbdb48",".travis.yml":"13d3e5a7bf83b04c8e8cfa14f0297bd8366d68391d977dd547f64707dffc275a","COPYRIGHT":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"34d79e1ddea3e2169c03b1f8ad4c3d863d2029b59423030112b2853fced70498","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"7a5648f52b09d3213348177860171d4f19b0fdda55e8fed7c04dafcb0ed9c215","src/approxeq.rs":"2987e046c90d948b6c7d7ddba52d10c8b7520d71dc0a50dbe7665de128d7410e","src/length.rs":"6e30abd125304985a7ae95dfb7dd92631053152a589b89df6e5c1879e91ecafa","src/lib.rs":"3ad04d3c1a18f697c8d28a1fbe871a4c75e0e957008745c6a4990e8fb07663d1","src/macros.rs":"1e999b322c2093c9c945386d15c3e95bd657c06b02e78235556db0bdbd162318","src/matrix2d.rs":"78d3b44e46be2b9c0ed1d98473cbbed78941cbf8cc76266be9f420966f1c1607","src/matrix4d.rs":"c3325f30a7a35575104a6b02fd0740d5be22e032881808550f28d22ea8eef625","src/num.rs":"62286aa642ce3afa7ebd950f50bf2197d8722907f2e23a2e2ea6690484d8b250","src/point.rs":"a585ad405a69505792efb624f0c0e6345b92b27a2c77e9a4366d6192ac914ef0","src/rect.rs":"d9bc96b8a3bc52ab2d49b53c4687e13230ab5d2920ea60e4070dea153489a633","src/scale_factor.rs":"3cffe0e88f035b8b5c9b27b105fb2825db5f317d7e067c88ee5d51cac4e6e583","src/side_offsets.rs":"f85526a421ffda63ff01a3478d4162c8717eef68e942acfa2fd9a1adee02ebb2","src/size.rs":"ef95a114f389a357ef940f42789e2cdbdbbdf4ae6993a80a74cc2c9d10c891c9","src/trig.rs":"6b207980052d13c625272f2a70a22f7741b59513c2a4882385926f497c763a63"},"package":"f93a556290e09f379cbfaa4f75ac52a72a3d2deb7d04076f312cdb2e6acba28e"}
\ No newline at end of file
--- a/third_party/rust/euclid/Cargo.toml
+++ b/third_party/rust/euclid/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
 name = "euclid"
-version = "0.10.3"
+version = "0.10.5"
 authors = ["The Servo Project Developers"]
 description = "Geometry primitives"
 documentation = "http://doc.servo.org/euclid/"
 repository = "https://github.com/servo/euclid"
 license = "MIT / Apache-2.0"
 
 [features]
 unstable = []
@@ -14,8 +14,9 @@ unstable = []
 heapsize = "0.3"
 rustc-serialize = "0.3.2"
 num-traits = {version = "0.1.32", default-features = false}
 log = "0.3.1"
 serde = "0.8"
 
 [dev-dependencies]
 rand = "0.3.7"
+serde_test = "0.8"
--- a/third_party/rust/euclid/src/length.rs
+++ b/third_party/rust/euclid/src/length.rs
@@ -191,80 +191,146 @@ impl<Unit, T: Zero> Zero for Length<T, U
     fn zero() -> Length<T, Unit> {
         Length::new(Zero::zero())
     }
 }
 
 #[cfg(test)]
 mod tests {
     use super::Length;
+    use num::Zero;
+
+    use heapsize::HeapSizeOf;
     use num_traits::Saturating;
     use scale_factor::ScaleFactor;
+    use std::f32::INFINITY;
+
+    extern crate serde_test;
+    use self::serde_test::Token;
+    use self::serde_test::assert_tokens;
 
     enum Inch {}
     enum Mm {}
+    enum Cm {}
+    enum Second {}
 
     #[test]
-    fn test_length() {
-        let mm_per_inch: ScaleFactor<f32, Inch, Mm> = ScaleFactor::new(25.4);
+    fn test_clone() {
+        // A cloned Length is a separate length with the state matching the
+        // original Length at the point it was cloned.
+        let mut variable_length: Length<f32, Inch> = Length::new(12.0);
 
-        let one_foot: Length<f32, Inch> = Length::new(12.0);
-        let two_feet = one_foot.clone() + one_foot.clone();
-        let zero_feet = one_foot.clone() - one_foot.clone();
+        let one_foot = variable_length.clone();
+        variable_length.0 = 24.0;
 
         assert_eq!(one_foot.get(), 12.0);
-        assert_eq!(two_feet.get(), 24.0);
-        assert_eq!(zero_feet.get(), 0.0);
+        assert_eq!(variable_length.get(), 24.0);
+    }
 
-        assert!(one_foot == one_foot);
-        assert!(two_feet != one_foot);
+    #[test]
+    fn test_heapsizeof_builtins() {
+        // Heap size of built-ins is zero by default.
+        let one_foot: Length<f32, Inch> = Length::new(12.0);
+
+        let heap_size_length_f32 = one_foot.heap_size_of_children();
+
+        assert_eq!(heap_size_length_f32, 0);
+    }
 
-        assert!(zero_feet <  one_foot);
-        assert!(zero_feet <= one_foot);
-        assert!(two_feet  >  one_foot);
-        assert!(two_feet  >= one_foot);
+    #[test]
+    fn test_heapsizeof_length_vector() {
+        // Heap size of any Length is just the heap size of the length value.
+        for n in 0..5 {
+            let length: Length<Vec<f32>, Inch> = Length::new(Vec::with_capacity(n));
 
-        assert!(  two_feet <= two_feet);
-        assert!(  two_feet >= two_feet);
-        assert!(!(two_feet >  two_feet));
-        assert!(!(two_feet <  two_feet));
+            assert_eq!(length.heap_size_of_children(), length.0.heap_size_of_children());
+        }
+    }
 
-        let one_foot_in_mm: Length<f32, Mm> = one_foot * mm_per_inch;
+    #[test]
+    fn test_length_serde() {
+        let one_cm: Length<f32, Mm> = Length::new(10.0);
+
+        assert_tokens(&one_cm, &[Token::F32(10.0)]);
+    }
 
-        assert_eq!(one_foot_in_mm, Length::new(304.8));
-        assert_eq!(one_foot_in_mm / one_foot, mm_per_inch);
+    #[test]
+    fn test_get_clones_length_value() {
+        // Calling get returns a clone of the Length's value.
+        // To test this, we need something clone-able - hence a vector.
+        let mut length: Length<Vec<i32>, Inch> = Length::new(vec![1, 2, 3]);
 
-        let back_to_inches: Length<f32, Inch> = one_foot_in_mm / mm_per_inch;
-        assert_eq!(one_foot, back_to_inches);
+        let value = length.get();
+        length.0.push(4);
 
-        let int_foot: Length<isize, Inch> = one_foot.cast().unwrap();
-        assert_eq!(int_foot.get(), 12);
+        assert_eq!(value, vec![1, 2, 3]);
+        assert_eq!(length.get(), vec![1, 2, 3, 4]);
+    }
 
-        let negative_one_foot = -one_foot;
-        assert_eq!(negative_one_foot.get(), -12.0);
+    #[test]
+    fn test_fmt_debug() {
+        // Debug and display format the value only.
+        let one_cm: Length<f32, Mm> = Length::new(10.0);
+
+        let result = format!("{:?}", one_cm);
 
-        let negative_two_feet = -two_feet;
-        assert_eq!(negative_two_feet.get(), -24.0);
+        assert_eq!(result, "10");
+    }
 
-        let zero_feet: Length<f32, Inch> = Length::new(0.0);
-        let negative_zero_feet = -zero_feet;
-        assert_eq!(negative_zero_feet.get(), 0.0);
+    #[test]
+    fn test_fmt_display() {
+        // Debug and display format the value only.
+        let one_cm: Length<f32, Mm> = Length::new(10.0);
+
+        let result = format!("{}", one_cm);
+
+        assert_eq!(result, "10");
     }
 
     #[test]
     fn test_add() {
         let length1: Length<u8, Mm> = Length::new(250);
         let length2: Length<u8, Mm> = Length::new(5);
 
         let result = length1 + length2;
 
         assert_eq!(result.get(), 255);
     }
 
     #[test]
+    fn test_addassign() {
+        let one_cm: Length<f32, Mm> = Length::new(10.0);
+        let mut measurement: Length<f32, Mm> = Length::new(5.0);
+
+        measurement += one_cm;
+
+        assert_eq!(measurement.get(), 15.0);
+    }
+
+    #[test]
+    fn test_sub() {
+        let length1: Length<u8, Mm> = Length::new(250);
+        let length2: Length<u8, Mm> = Length::new(5);
+
+        let result = length1 - length2;
+
+        assert_eq!(result.get(), 245);
+    }
+
+    #[test]
+    fn test_subassign() {
+        let one_cm: Length<f32, Mm> = Length::new(10.0);
+        let mut measurement: Length<f32, Mm> = Length::new(5.0);
+
+        measurement -= one_cm;
+
+        assert_eq!(measurement.get(), -5.0);
+    }
+
+    #[test]
     fn test_saturating_add() {
         let length1: Length<u8, Mm> = Length::new(250);
         let length2: Length<u8, Mm> = Length::new(6);
 
         let result = length1.saturating_add(length2);
 
         assert_eq!(result.get(), 255);
     }
@@ -275,27 +341,108 @@ mod tests {
         let length2: Length<u8, Mm> = Length::new(10);
 
         let result = length1.saturating_sub(length2);
 
         assert_eq!(result.get(), 0);
     }
 
     #[test]
-    fn test_addassign() {
-        let one_cm: Length<f32, Mm> = Length::new(10.0);
-        let mut measurement: Length<f32, Mm> = Length::new(5.0);
+    fn test_division_by_length() {
+        // Division results in a ScaleFactor from denominator units
+        // to numerator units.
+        let length: Length<f32, Cm> = Length::new(5.0);
+        let duration: Length<f32, Second> = Length::new(10.0);
+
+        let result = length / duration;
+
+        let expected: ScaleFactor<f32, Second, Cm> = ScaleFactor::new(0.5);
+        assert_eq!(result, expected);
+    }
+
+    #[test]
+    fn test_multiplication() {
+        let length_mm: Length<f32, Mm> = Length::new(10.0);
+        let cm_per_mm: ScaleFactor<f32, Mm, Cm> = ScaleFactor::new(0.1);
+
+        let result = length_mm * cm_per_mm;
 
-        measurement += one_cm;
+        let expected: Length<f32, Cm> = Length::new(1.0);
+        assert_eq!(result, expected);
+    }
+
+    #[test]
+    fn test_division_by_scalefactor() {
+        let length: Length<f32, Cm> = Length::new(5.0);
+        let cm_per_second: ScaleFactor<f32, Second, Cm> = ScaleFactor::new(10.0);
+
+        let result = length / cm_per_second;
 
-        assert_eq!(measurement.get(), 15.0);
+        let expected: Length<f32, Second> = Length::new(0.5);
+        assert_eq!(result, expected);
+    }
+
+    #[test]
+    fn test_negation() {
+        let length: Length<f32, Cm> = Length::new(5.0);
+
+        let result = -length;
+
+        let expected: Length<f32, Cm> = Length::new(-5.0);
+        assert_eq!(result, expected);
     }
 
     #[test]
-    fn test_subassign() {
-        let one_cm: Length<f32, Mm> = Length::new(10.0);
-        let mut measurement: Length<f32, Mm> = Length::new(5.0);
+    fn test_cast() {
+        let length_as_i32: Length<i32, Cm> = Length::new(5);
+
+        let result: Length<f32, Cm> = length_as_i32.cast().unwrap();
+
+        let length_as_f32: Length<f32, Cm> = Length::new(5.0);
+        assert_eq!(result, length_as_f32);
+    }
+
+    #[test]
+    fn test_equality() {
+        let length_5_point_0: Length<f32, Cm> = Length::new(5.0);
+        let length_5_point_1: Length<f32, Cm> = Length::new(5.1);
+        let length_0_point_1: Length<f32, Cm> = Length::new(0.1);
+
+        assert!(length_5_point_0 == length_5_point_1 - length_0_point_1);
+        assert!(length_5_point_0 != length_5_point_1);
+    }
+
+    #[test]
+    fn test_order() {
+        let length_5_point_0: Length<f32, Cm> = Length::new(5.0);
+        let length_5_point_1: Length<f32, Cm> = Length::new(5.1);
+        let length_0_point_1: Length<f32, Cm> = Length::new(0.1);
 
-        measurement -= one_cm;
+        assert!(length_5_point_0 < length_5_point_1);
+        assert!(length_5_point_0 <= length_5_point_1);
+        assert!(length_5_point_0 <= length_5_point_1 - length_0_point_1);
+        assert!(length_5_point_1 > length_5_point_0);
+        assert!(length_5_point_1 >= length_5_point_0);
+        assert!(length_5_point_0 >= length_5_point_1 - length_0_point_1);
+    }
+
+    #[test]
+    fn test_zero_add() {
+        type LengthCm = Length<f32, Cm>;
+        let length: LengthCm = Length::new(5.0);
 
-        assert_eq!(measurement.get(), -5.0);
+        let result = length - LengthCm::zero();
+
+        assert_eq!(result, length);
+    }
+
+    #[test]
+    fn test_zero_division() {
+        type LengthCm = Length<f32, Cm>;
+        let length: LengthCm = Length::new(5.0);
+        let length_zero: LengthCm = Length::zero();
+
+        let result = length / length_zero;
+
+        let expected: ScaleFactor<f32, Cm, Cm> = ScaleFactor::new(INFINITY);
+        assert_eq!(result, expected);
     }
 }
--- a/third_party/rust/euclid/src/size.rs
+++ b/third_party/rust/euclid/src/size.rs
@@ -70,17 +70,17 @@ impl<T: Round, U> TypedSize2D<T, U> {
     }
 }
 
 impl<T: Ceil, U> TypedSize2D<T, U> {
     /// Rounds each component to the smallest integer equal or greater than the orginal value.
     ///
     /// This behavior is preserved for negative values (unlike the basic cast).
     pub fn ceil(&self) -> Self {
-        TypedSize2D::new(self.height.ceil(), self.width.ceil())
+        TypedSize2D::new(self.width.ceil(), self.height.ceil())
     }
 }
 
 impl<T: Floor, U> TypedSize2D<T, U> {
     /// Rounds each component to the biggest integer equal or lower than the orginal value.
     ///
     /// This behavior is preserved for negative values (unlike the basic cast).
     pub fn floor(&self) -> Self {
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/.cargo-checksum.json
@@ -0,0 +1,1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805","Cargo.toml":"e8868bcf7f120c0ad8a75490e70b200afc1112506ca5d56e0f484d77d3e3b807","LICENSE":"1f04103e3a61b91343b3f9d2ed2cc8543062917e2cc7d52a739ffe6429ccaf61","src/lib.rs":"2d90c309ade5ea2bd981c2ce3d15685b999b5710401b1a4e6a37f73809a3f082","src/main.rs":"afa12e489b290cbe1f255fff7afe2a3d5d4efb08547841d36ff98fe4c6d1eb5e"},"package":"cd8728df930776135895cbb25cbdd17791cde7d4285d53cf58fe6ee2e6412455"}
\ No newline at end of file
copy from third_party/rust/byteorder-0.5.3/.cargo-ok
copy to third_party/rust/gamma-lut/.cargo-ok
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/.gitignore
@@ -0,0 +1,2 @@
+target
+Cargo.lock
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/Cargo.toml
@@ -0,0 +1,19 @@
+[package]
+name = "gamma-lut"
+version = "0.1.6"
+authors = ["Mason Chang <mchang@mozilla.com>"]
+description = "Rust port of Skia gamma correcting tables"
+keywords = ["gamma"]
+license_file = "LICENSE"
+repository = "https://github.com/changm/gamma-lut-rs"
+
+[lib]
+name = "gamma_lut"
+path = "src/lib.rs"
+
+[[bin]]
+name = "gamma_lut_bin"
+path = "src/main.rs"
+
+[dependencies]
+lazy_static = "0.2"
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/LICENSE
@@ -0,0 +1,245 @@
+// Copyright (c) 2011 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+third_party/etc1 is under the following license:
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+--------------------------------------------------------------------------------
+Some files under resources are under the following license:
+
+Unlimited Commercial Use
+We try to make it clear that you may use all clipart from Openclipart even for unlimited commercial use. We believe that giving away our images is a great way to share with the world our talents and that will come back around in a better form.
+
+May I Use Openclipart for?
+We put together a small chart of as many possibilities and questions we have heard from people asking how they may use Openclipart. If you have an additional question, please email love@openclipart.org.
+
+All Clipart are Released into the Public Domain.
+Each artist at Openclipart releases all rights to the images they share at Openclipart. The reason is so that there is no friction in using and sharing images authors make available at this website so that each artist might also receive the same benefit in using other artists clipart totally for any possible reason.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/src/lib.rs
@@ -0,0 +1,404 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+extern crate lazy_static;
+
+pub trait ColorSpaceLuminance {
+	fn to_luma(&self, gamma: f32, luminance: f32) -> f32;
+	fn from_luma(&self, gamma: f32, luma: f32) -> f32;
+}
+
+pub struct SRGBColorSpaceLuminance
+{
+}
+
+pub struct LinearColorSpaceLuminance
+{
+}
+
+pub struct GammaColorSpaceLuminance
+{}
+
+impl ColorSpaceLuminance for LinearColorSpaceLuminance {
+	fn to_luma(&self, gamma: f32, luminance: f32) -> f32 {
+        assert!(gamma == 1.);
+		luminance
+	}
+	fn from_luma(&self, gamma: f32, luma: f32) -> f32 {
+        assert!(gamma == 1.);
+		luma
+	}
+}
+
+impl ColorSpaceLuminance for GammaColorSpaceLuminance {
+	fn to_luma(&self, gamma: f32, luminance: f32) -> f32 {
+		luminance.powf(gamma)
+	}
+	fn from_luma(&self, gamma: f32, luma: f32) -> f32 {
+		luma.powf(1./gamma)
+	}
+}
+
+impl ColorSpaceLuminance for SRGBColorSpaceLuminance {
+	fn to_luma(&self, gamma: f32, luminance: f32) -> f32 {
+        assert!(gamma == 0.);
+        //The magic numbers are derived from the sRGB specification.
+        //See http://www.color.org/chardata/rgb/srgb.xalter .
+		if luminance <= 0.04045 {
+			return luminance / 12.92;
+		}
+		return ((luminance + 0.055) / 1.055).powf(2.4);
+	}
+	fn from_luma(&self, gamma: f32, luma: f32) -> f32 {
+        assert!(gamma == 0.);
+        //The magic numbers are derived from the sRGB specification.
+        //See http://www.color.org/chardata/rgb/srgb.xalter .
+        if luma <= 0.0031308 {
+            return luma * 12.92;
+        }
+        return 1.055 * luma.powf(1./2.4)
+               - 0.055;
+	}
+}
+
+fn round_to_u8(x : f32) -> u8 {
+    assert!((x + 0.5).floor() < 256.0);
+    (x + 0.5).floor() as u8
+}
+
+/*
+ * Scales base <= 2^N-1 to 2^8-1
+ * @param N [1, 8] the number of bits used by base.
+ * @param base the number to be scaled to [0, 255].
+ */
+fn scale255(n: u8, mut base : u8) -> u8 {
+    base <<= 8 - n;
+    let mut lum = base;
+    let mut i = n;
+
+    while i < 8 {
+        lum |= base >> i;
+        i += n;
+    }
+
+    return lum;
+}
+
+#[derive(Copy, Clone)]
+#[allow(dead_code)]
+pub struct Color {
+    r: u8,
+    g: u8,
+    b: u8,
+    a: u8,
+}
+
+impl Color {
+    pub fn new(r: u8, g: u8, b: u8, a: u8) -> Color {
+        Color {
+            r: r,
+            g: g,
+            b: b,
+            a: a,
+        }
+    }
+}
+
+// This will invert the gamma applied by CoreGraphics,
+// so we can get linear values.
+// CoreGraphics obscurely defaults to 2.0 as the smoothing gamma value.
+// The color space used does not appear to affect this choice.
+fn get_inverse_gamma_table_coregraphics_smoothing() -> [u8; 256] {
+	let mut table : [u8; 256] = [0; 256];
+
+	for i in 0..256 {
+		let x = i as f32 / 255.0;
+		let value = round_to_u8(x * x * 255.0);
+		table[i] = value;
+	}
+
+	table
+}
+
+// A value of 0.5 for SK_GAMMA_CONTRAST appears to be a good compromise.
+// With lower values small text appears washed out (though correctly so).
+// With higher values lcd fringing is worse and the smoothing effect of
+// partial coverage is diminished.
+fn apply_contrast(srca: f32, contrast: f32) -> f32 {
+    srca + ((1.0 - srca) * contrast * srca)
+}
+
+// The approach here is not necessarily the one with the lowest error
+// See https://bel.fi/alankila/lcd/alpcor.html for a similar kind of thing
+// that just search for the adjusted alpha value
+pub fn build_gamma_correcting_lut(table: &mut [u8; 256], src: u8, contrast: f32,
+                                  src_space: &ColorSpaceLuminance, src_gamma: f32,
+                                  dst_convert: &ColorSpaceLuminance, dst_gamma: f32) {
+
+    let src = src as f32 / 255.0;
+    let lin_src = src_space.to_luma(src_gamma, src);
+    // Guess at the dst. The perceptual inverse provides smaller visual
+    // discontinuities when slight changes to desaturated colors cause a channel
+    // to map to a different correcting lut with neighboring srcI.
+    // See https://code.google.com/p/chromium/issues/detail?id=141425#c59 .
+    let dst = 1.0 - src;
+    let lin_dst = dst_convert.to_luma(dst_gamma, dst);
+
+    // Contrast value tapers off to 0 as the src luminance becomes white
+    let adjusted_contrast = contrast * lin_dst;
+
+    // Remove discontinuity and instability when src is close to dst.
+    // The value 1/256 is arbitrary and appears to contain the instability.
+    if (src - dst).abs() < (1.0 / 256.0) {
+        let mut ii : f32 = 0.0;
+        for i in 0..256 {
+            let raw_srca = ii / 255.0;
+            let srca = apply_contrast(raw_srca, adjusted_contrast);
+
+            table[i] = round_to_u8(255.0 * srca);
+            ii += 1.0;
+        }
+    } else {
+        // Avoid slow int to float conversion.
+        let mut ii : f32 = 0.0;
+        for i in 0..256 {
+            // 'raw_srca += 1.0f / 255.0f' and even
+            // 'raw_srca = i * (1.0f / 255.0f)' can add up to more than 1.0f.
+            // When this happens the table[255] == 0x0 instead of 0xff.
+            // See http://code.google.com/p/chromium/issues/detail?id=146466
+            let raw_srca = ii / 255.0;
+            let srca = apply_contrast(raw_srca, adjusted_contrast);
+            assert!(srca <= 1.0);
+            let dsta = 1.0 - srca;
+
+            // Calculate the output we want.
+            let lin_out = lin_src * srca + dsta * lin_dst;
+            assert!(lin_out <= 1.0);
+            let out = dst_convert.from_luma(dst_gamma, lin_out);
+
+            // Undo what the blit blend will do.
+            // i.e. given the formula for OVER: out = src * result + (1 - result) * dst
+            // solving for result gives:
+            let result = (out - dst) / (src - dst);
+
+            //println!("Setting {:?} to {:?}", i, round_to_u8(255.0 * result));
+            table[i] = round_to_u8(255.0 * result);
+
+            ii += 1.0;
+        }
+    }
+}
+
+fn fetch_color_space(gamma: f32) -> Box<ColorSpaceLuminance> {
+    if 0.0 == gamma {
+        return Box::new( SRGBColorSpaceLuminance{} );
+    } else if 1.0 == gamma {
+        return Box::new( LinearColorSpaceLuminance{} );
+    } else {
+        return Box::new( GammaColorSpaceLuminance{} );
+    }
+}
+
+// Computes the luminance from the given r, g, and b in accordance with
+// SK_LUM_COEFF_X. For correct results, r, g, and b should be in linear space.
+fn compute_luminance(r: u8, g: u8, b: u8) -> u8 {
+	// The following is
+	// r * SK_LUM_COEFF_R + g * SK_LUM_COEFF_G + b * SK_LUM_COEFF_B
+	// with SK_LUM_COEFF_X in 1.8 fixed point (rounding adjusted to sum to 256).
+	let val : u32 = r as u32 * 54 + g as u32 * 183 + b as u32 * 19;
+	return (val >> 8) as u8;
+}
+
+// Skia uses 3 bits per channel for luminance.
+pub const LUM_BITS :u8 = 3;
+#[allow(dead_code)]
+pub struct GammaLut {
+    tables: [[u8; 256 ]; 1 << LUM_BITS],
+    cg_inverse_gamma: [u8; 256],
+}
+
+impl GammaLut {
+    // Skia actually makes 9 gamma tables, then based on the luminance color,
+    // fetches the RGB gamma table for that color.
+    fn generate_tables(&mut self, contrast: f32, paint_gamma: f32, device_gamma: f32) {
+        let paint_color_space = fetch_color_space(paint_gamma);
+        let device_color_space = fetch_color_space(device_gamma);
+
+        for i in 0..(1 << LUM_BITS) {
+            let luminance = scale255(LUM_BITS, i);
+            build_gamma_correcting_lut(&mut self.tables[i as usize],
+                                       luminance,
+                                       contrast,
+                                       &*paint_color_space,
+                                       paint_gamma,
+                                       &*device_color_space,
+                                       device_gamma);
+        }
+    }
+
+    #[allow(dead_code)]
+    fn table_count() -> usize {
+        return 1 << LUM_BITS;
+    }
+
+    pub fn print_values(&self, table: usize) {
+        for x in 0..256 {
+            println!("[{:?}] = {:?}", x, self.tables[table][x])
+        }
+    }
+
+    pub fn get_table(&self, color: u8) -> [u8; 256] {
+        return self.tables[(color >> (8 - LUM_BITS)) as usize];
+    }
+
+    pub fn new(contrast: f32, paint_gamma: f32, device_gamma: f32) -> GammaLut {
+        let mut table = GammaLut {
+            tables: [[0; 256]; 1 << LUM_BITS],
+            cg_inverse_gamma: get_inverse_gamma_table_coregraphics_smoothing(),
+        };
+
+        table.generate_tables(contrast, paint_gamma, device_gamma);
+
+        table
+    }
+
+    // Skia normally preblends based on what the text color is.
+    // If we can't do that, use Skia default colors.
+    pub fn preblend_default_colors_bgra(&self, pixels: &mut Vec<u8>, width: usize, height: usize) {
+        let preblend_color = Color {
+            r: 0x7f,
+            g: 0x80,
+            b: 0x7f,
+            a: 0xff,
+        };
+        self.preblend_bgra(pixels, width, height, preblend_color);
+    }
+
+    fn replace_pixels_bgra(&self, pixels: &mut Vec<u8>, width: usize, height: usize,
+                           table_r: [u8; 256], table_g: [u8; 256], table_b: [u8; 256]) {
+         for y in 0..height {
+            let current_height = y * width * 4;
+
+            for pixel in pixels[current_height..current_height + (width * 4)].chunks_mut(4) {
+                pixel[0] = table_b[pixel[0] as usize];
+                pixel[1] = table_g[pixel[1] as usize];
+                pixel[2] = table_r[pixel[2] as usize];
+                // Don't touch alpha
+            }
+        }
+    }
+
+    // Mostly used by windows and GlyphRunAnalysis::GetAlphaTexture
+    fn replace_pixels_rgb(&self, pixels: &mut Vec<u8>, width: usize, height: usize,
+                          table_r: [u8; 256], table_g: [u8; 256], table_b: [u8; 256]) {
+         for y in 0..height {
+            let current_height = y * width * 3;
+
+            for pixel in pixels[current_height..current_height + (width * 3)].chunks_mut(3) {
+                pixel[0] = table_r[pixel[0] as usize];
+                pixel[1] = table_g[pixel[1] as usize];
+                pixel[2] = table_b[pixel[2] as usize];
+            }
+        }
+    }
+
+    // Assumes pixels are in BGRA format. Assumes pixel values are in linear space already.
+    pub fn preblend_bgra(&self, pixels: &mut Vec<u8>, width: usize, height: usize, color: Color) {
+        let table_r = self.get_table(color.r);
+        let table_g = self.get_table(color.g);
+        let table_b = self.get_table(color.b);
+
+        self.replace_pixels_bgra(pixels, width, height, table_r, table_g, table_b);
+    }
+
+    // Assumes pixels are in RGB format. Assumes pixel values are in linear space already. NOTE:
+    // there is no alpha here.
+    pub fn preblend_rgb(&self, pixels: &mut Vec<u8>, width: usize, height: usize, color: Color) {
+        let table_r = self.get_table(color.r);
+        let table_g = self.get_table(color.g);
+        let table_b = self.get_table(color.b);
+
+        self.replace_pixels_rgb(pixels, width, height, table_r, table_g, table_b);
+    }
+
+    #[cfg(target_os="macos")]
+    pub fn coregraphics_convert_to_linear_bgra(&self, pixels: &mut Vec<u8>, width: usize, height: usize) {
+        self.replace_pixels_bgra(pixels, width, height,
+                                 self.cg_inverse_gamma,
+                                 self.cg_inverse_gamma,
+                                 self.cg_inverse_gamma);
+    }
+
+    // Assumes pixels are in BGRA format. Assumes pixel values are in linear space already.
+    pub fn preblend_grayscale_bgra(&self, pixels: &mut Vec<u8>, width: usize, height: usize, color: Color) {
+        let table_g = self.get_table(color.g);
+
+         for y in 0..height {
+            let current_height = y * width * 4;
+
+            for pixel in pixels[current_height..current_height + (width * 4)].chunks_mut(4) {
+                let luminance = compute_luminance(pixel[0], pixel[1], pixel[2]);
+                pixel[0] = table_g[luminance as usize];
+                pixel[1] = table_g[luminance as usize];
+                pixel[2] = table_g[luminance as usize];
+                // Don't touch alpha
+            }
+		}
+    }
+
+} // end impl GammaLut
+
+#[cfg(test)]
+mod tests {
+    use std::cmp;
+    use std::mem;
+
+    fn over(dst: u32, src: u32, alpha: u32) -> u32 {
+        (src * alpha + dst * (255 - alpha))/255
+    }
+
+    fn overf(dst: f32, src: f32, alpha: f32) -> f32 {
+        ((src * alpha + dst * (255. - alpha))/255.) as f32
+    }
+
+
+    fn absdiff(a: u32, b: u32) -> u32 {
+        if a < b  { b - a } else { a - b }
+    }
+
+    #[test]
+    fn gamma() {
+        let mut table: [u8; 256] = unsafe{ mem::uninitialized() } ;
+        let space = ::GammaColorSpaceLuminance{};
+        let g : f32 = 2.;
+        let mut src : u32 = 131;
+        while src < 256 {
+            ::build_gamma_correcting_lut(&mut table, src as u8, 0., &space, g, &space, g);
+            let mut max_diff = 0;
+            let mut dst = 0;
+            while dst < 256 {
+                for alpha in 0u32..256 {
+                    let preblend = table[alpha as usize];
+                    let lin_dst = (dst as f32 / 255.).powf(g) * 255.;
+                    let lin_src = (src as f32 / 255.).powf(g) * 255.;
+
+                    let preblend_result = over(dst, src, preblend as u32);
+                    let true_result = ((overf(lin_dst, lin_src, alpha as f32) / 255.).powf(1. / g) * 255.) as u32;
+                    let diff = absdiff(preblend_result, true_result);
+                    //println!("{} -- {} {} = {}", alpha, preblend_result, true_result, diff);
+                    max_diff = cmp::max(max_diff, diff);
+                }
+
+                //println!("{} {} max {}", src, dst, max_diff);
+                assert!(max_diff <= 33);
+                dst += 1;
+
+            }
+            src += 1;
+        }
+    }
+} // end mod
new file mode 100644
--- /dev/null
+++ b/third_party/rust/gamma-lut/src/main.rs
@@ -0,0 +1,9 @@
+extern crate gamma_lut;
+
+fn main() {
+    let contrast = 0.0;
+    let gamma = 0.0;
+
+    let table = gamma_lut::GammaLut::new(contrast, gamma, gamma);
+    table.print_values(0);
+}
--- a/third_party/rust/gleam/.cargo-checksum.json
+++ b/third_party/rust/gleam/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c1e953ee360e77de57f7b02f1b7880bd6a3dc22d1a69e953c2ac2c52cc52d247",".travis.yml":"46f5e5da873985b56fc97643a27f610feec18724aad8e899379f3b8c84c329ae","COPYING":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"08c1304ddded710af219247d613a1f5ea16ded3641dfd70a3a8823e131e1e8d5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"2de24b7458d6b88f20324303a48acf64a4f2bbfb83d2ec4d6ff2b4f4a1fd2275","build.rs":"5b2abf3e2b85f4d0bdbbaa5778c8fd7480eb151db3bd699ec63b77fa3afdfd7b","src/gl.rs":"feb6da4fc27e8ed2661c5327875323cf129b6709eb7558dde03741af28d60802","src/lib.rs":"ad33ebcb3f4a0edc36e95c837cda6f01a0be8a6ab1bcf485565fb03f70831324"},"package":"7a3023edde169b7767a71d2e5dd8e8903ac3b1436ff659225310928db87d6a8a"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c1e953ee360e77de57f7b02f1b7880bd6a3dc22d1a69e953c2ac2c52cc52d247",".travis.yml":"46f5e5da873985b56fc97643a27f610feec18724aad8e899379f3b8c84c329ae","COPYING":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"a1d227749271af1ad64516277ee655b66bfcd53a13006bf94d41380c5dd345db","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"2de24b7458d6b88f20324303a48acf64a4f2bbfb83d2ec4d6ff2b4f4a1fd2275","build.rs":"5b2abf3e2b85f4d0bdbbaa5778c8fd7480eb151db3bd699ec63b77fa3afdfd7b","src/gl.rs":"f9acc199591d06018b75924fc1ad881e9deb67f4ad8f0213f028b4aacdffb5ca","src/lib.rs":"ad33ebcb3f4a0edc36e95c837cda6f01a0be8a6ab1bcf485565fb03f70831324"},"package":"9590e0e578d528a080c5abac678e7efbe349a73c7316faafd4073edf5f462d01"}
\ No newline at end of file
--- a/third_party/rust/gleam/Cargo.toml
+++ b/third_party/rust/gleam/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
 name = "gleam"
-version = "0.2.31"
+version = "0.2.32"
 license = "Apache-2.0/MIT"
 authors = ["The Servo Project Developers"]
 build = "build.rs"
 documentation = "http://doc.servo.org/gleam/"
 repository = "https://github.com/servo/gleam"
 description = "Generated OpenGL bindings and wrapper for Servo."
 
 [build-dependencies]
--- a/third_party/rust/gleam/src/gl.rs
+++ b/third_party/rust/gleam/src/gl.rs
@@ -14,16 +14,33 @@ use std::ptr;
 use std::str::{self};
 use std::iter::repeat;
 use std::ffi::{CString, CStr};
 use ffi;
 
 pub use ffi::types::*;
 pub use ffi::*;
 
+#[derive(Debug, Eq, PartialEq)]
+pub enum GlType {
+    Gl,
+    Gles,
+}
+
+impl Default for GlType {
+  #[cfg(target_os="android")]
+  fn default() -> GlType {
+    GlType::Gles
+  }
+  #[cfg(not(target_os="android"))]
+  fn default() -> GlType {
+    GlType::Gl
+  }
+}
+
 #[inline]
 pub fn buffer_data<T>(target: GLenum, data: &[T], usage: GLenum) {
     unsafe {
         ffi::BufferData(target,
                        (data.len() * size_of::<T>()) as GLsizeiptr,
                        data.as_ptr() as *const GLvoid,
                        usage);
     }
--- a/third_party/rust/offscreen_gl_context/.cargo-checksum.json
+++ b/third_party/rust/offscreen_gl_context/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"9b8376fc479996f32f8a690e6009fc2f7e9f6dc1b1224e0180a92ad65b0b2183","Cargo.toml":"a2aacf8d637addcb13f6f04e21c65ae4bde00bb589de00b8c97746224a97499c","Makefile":"85b6d903eecac170ac97f10d9d89b8366cd91f5ea2f7c6212704bc590b64cf50","README.md":"614cf0c6242be3e62e45a3d60ce9a2a1581bdc46b28b25d5f40caba558e4d615","build.rs":"86776b47fac1d9368e3c3c5d57c62731729ed859bb1c4e4db0fe219251812cab","src/draw_buffer.rs":"52bef86972f40e0dd13a6e81f3aa76d4d0c28ea0b63f5f9da9650a34d75488c0","src/gl_context.rs":"28953e3752ea7fd2b19327f98c06fe53f7618efc4d3f0cb2262eba403756df2a","src/gl_context_attributes.rs":"c76ef02996d0daac313b666d1991878bbf7812932a0f9feac9e62c89ba7bf669","src/gl_context_capabilities.rs":"9f665ad04d42d47d15ecbd430639d95da526ec5951f0b7abe2434adc1415c85d","src/gl_feature.rs":"b826884900c0e8d6317a41ebb6c30bdb468601bf1c030c376749bdb2ecd2f15a","src/gl_formats.rs":"99087345b4e9a12c86605c0d091bfaf1b4ed4b2475a3b6f91d2127a2bb85fe1b","src/gl_limits.rs":"02e41619518daae5895929db00d073b5ad0d9daf9319a61abb7012c2e59fb6c7","src/lib.rs":"daaf4e26504dbb97f3803de4337f601d616adf0633e5c4415c2c172fb257ebd6","src/platform/mod.rs":"f6ec310e5b8fb519607b8e4d5ca71a0c07c83737a83c3785b5b44e7902498c8a","src/platform/not_implemented/mod.rs":"d576e9fc3164f9e2a8ff9460a60eaa8ecada44c600de1a4d1bb5513ab93569af","src/platform/not_implemented/native_gl_context.rs":"fe018722b8bebbd59b6fae759dd78b0175d10bf110205b113ff155fd06d0f75d","src/platform/with_cgl/mod.rs":"b05dc146c9ba82d62410d9b0566a8aa70c77e7ec583ad4881c531d7118454543","src/platform/with_cgl/native_gl_context.rs":"c6271cfa96836d8f833f5efbc90352852557d582db41d2c513cc36c3f966ae88","src/platform/with_egl/mod.rs":"c52ac147eb051733070c36b2c62be8c57427f80999507f62a9ce801f4aac284c","src/platform/with_egl/native_gl_context.rs":"3a8342d53de9525a5478cc96b323dbad2b3628aa6655fe5f092834cc72256116","src/platform/with_egl/utils.rs":"508521e2bf3809ffe0dfea4fa4a358903f49c77a33aa42cc6c0e7458d992a2a7","src/platform/with_glx/mod.rs":"0e497f38b2071ed189995c91b27b0b199d31bfcc10836e2d26b55023d7aff503","src/platform/with_glx/native_gl_context.rs":"2c648ae18baac14290b2eca3581d474adfea00a29a7ad47a1100e564e74b9152","src/platform/with_glx/utils.rs":"eb81e0a4c62947fa5099c241cfe2e4dd075376d30b22864e042c0f536ac6be58","src/platform/with_osmesa/mod.rs":"9f6d69878125185f16740f52ba5cdd8a45e8812af1a3561482c9b43edaf4514a","src/platform/with_wgl/mod.rs":"38f9b44b54c8a1bd4d25ae77a4ea6a2e5454a00b816764d7d74152c1f3c1b126","src/platform/with_wgl/native_gl_context.rs":"4aecd40a811cf38607b17db9724f79bb934e056f85c90c987b2aa82d637b7bb4","src/platform/with_wgl/utils.rs":"d9640c000dcb513cf0a13c4a0d35c423366b7d0894deff299affe0202bdeb770","src/platform/with_wgl/wgl_attributes.rs":"73b75da18519e048011e9c303e402cf7961e3652aa8f4d4ebf507b4ab83d06a3","src/tests.rs":"780d4211a02c09abebb2b8be85a87ed98bee374999bd333c29efb3a8c7d2b281"},"package":"2092c6bb5550536a097c5b413a2c36e141bc63c85c0a40944a182c1912d69397"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"9b8376fc479996f32f8a690e6009fc2f7e9f6dc1b1224e0180a92ad65b0b2183","Cargo.toml":"50ad80c8c43d09fbf1360736cfb7a9ba122c9ab080facebc83788313dfefce72","Makefile":"85b6d903eecac170ac97f10d9d89b8366cd91f5ea2f7c6212704bc590b64cf50","README.md":"614cf0c6242be3e62e45a3d60ce9a2a1581bdc46b28b25d5f40caba558e4d615","build.rs":"86776b47fac1d9368e3c3c5d57c62731729ed859bb1c4e4db0fe219251812cab","src/draw_buffer.rs":"52bef86972f40e0dd13a6e81f3aa76d4d0c28ea0b63f5f9da9650a34d75488c0","src/gl_context.rs":"28953e3752ea7fd2b19327f98c06fe53f7618efc4d3f0cb2262eba403756df2a","src/gl_context_attributes.rs":"c76ef02996d0daac313b666d1991878bbf7812932a0f9feac9e62c89ba7bf669","src/gl_context_capabilities.rs":"9f665ad04d42d47d15ecbd430639d95da526ec5951f0b7abe2434adc1415c85d","src/gl_feature.rs":"b826884900c0e8d6317a41ebb6c30bdb468601bf1c030c376749bdb2ecd2f15a","src/gl_formats.rs":"99087345b4e9a12c86605c0d091bfaf1b4ed4b2475a3b6f91d2127a2bb85fe1b","src/gl_limits.rs":"02e41619518daae5895929db00d073b5ad0d9daf9319a61abb7012c2e59fb6c7","src/lib.rs":"daaf4e26504dbb97f3803de4337f601d616adf0633e5c4415c2c172fb257ebd6","src/platform/mod.rs":"f6ec310e5b8fb519607b8e4d5ca71a0c07c83737a83c3785b5b44e7902498c8a","src/platform/not_implemented/mod.rs":"d576e9fc3164f9e2a8ff9460a60eaa8ecada44c600de1a4d1bb5513ab93569af","src/platform/not_implemented/native_gl_context.rs":"fe018722b8bebbd59b6fae759dd78b0175d10bf110205b113ff155fd06d0f75d","src/platform/with_cgl/mod.rs":"b05dc146c9ba82d62410d9b0566a8aa70c77e7ec583ad4881c531d7118454543","src/platform/with_cgl/native_gl_context.rs":"c6271cfa96836d8f833f5efbc90352852557d582db41d2c513cc36c3f966ae88","src/platform/with_egl/mod.rs":"c52ac147eb051733070c36b2c62be8c57427f80999507f62a9ce801f4aac284c","src/platform/with_egl/native_gl_context.rs":"3a8342d53de9525a5478cc96b323dbad2b3628aa6655fe5f092834cc72256116","src/platform/with_egl/utils.rs":"508521e2bf3809ffe0dfea4fa4a358903f49c77a33aa42cc6c0e7458d992a2a7","src/platform/with_glx/mod.rs":"0e497f38b2071ed189995c91b27b0b199d31bfcc10836e2d26b55023d7aff503","src/platform/with_glx/native_gl_context.rs":"2c648ae18baac14290b2eca3581d474adfea00a29a7ad47a1100e564e74b9152","src/platform/with_glx/utils.rs":"eb81e0a4c62947fa5099c241cfe2e4dd075376d30b22864e042c0f536ac6be58","src/platform/with_osmesa/mod.rs":"9f6d69878125185f16740f52ba5cdd8a45e8812af1a3561482c9b43edaf4514a","src/platform/with_wgl/mod.rs":"38f9b44b54c8a1bd4d25ae77a4ea6a2e5454a00b816764d7d74152c1f3c1b126","src/platform/with_wgl/native_gl_context.rs":"4aecd40a811cf38607b17db9724f79bb934e056f85c90c987b2aa82d637b7bb4","src/platform/with_wgl/utils.rs":"d9640c000dcb513cf0a13c4a0d35c423366b7d0894deff299affe0202bdeb770","src/platform/with_wgl/wgl_attributes.rs":"73b75da18519e048011e9c303e402cf7961e3652aa8f4d4ebf507b4ab83d06a3","src/tests.rs":"780d4211a02c09abebb2b8be85a87ed98bee374999bd333c29efb3a8c7d2b281"},"package":"171f74d51d4c94dae19d13c502dbf09afab328a5517f8bfeee2f2a33ced3bca9"}
\ No newline at end of file
--- a/third_party/rust/offscreen_gl_context/Cargo.toml
+++ b/third_party/rust/offscreen_gl_context/Cargo.toml
@@ -1,13 +1,13 @@
 [package]
 name = "offscreen_gl_context"
 license = "MIT / Apache-2.0"
-version = "0.5.3"
-authors = ["Emilio Cobos Álvarez <ecoal95@gmail.com>", "The Servo Project Developers"]
+version = "0.5.5"
+authors = ["Emilio Cobos Álvarez <emilio@crisal.io>", "The Servo Project Developers"]
 description = "Creation and manipulation of HW accelerated offscreen rendering contexts in multiple platforms. Originally intended for the Servo project's WebGL implementation."
 repository = "https://github.com/emilio/rust-offscreen-rendering-context"
 build = "build.rs"
 
 [build-dependencies]
 gl_generator = "0.5"
 
 [features]
@@ -15,23 +15,23 @@ default = []
 osmesa = ["osmesa-sys"]
 serde_serialization = ["serde"]
 # NOTE: Just for testing use, there are no other changes
 test_egl_in_linux = []
 test_osmesa = []
 
 [dependencies]
 log  = "0.3"
-gleam = "0.2"
+gleam = "0.2.31"
 euclid = "0.10"
 serde = { version = "0.8", optional = true }
 osmesa-sys = { version = "0.1", optional = true }
 
 [target.x86_64-apple-darwin.dependencies]
-core-foundation = "0.2.0"
+core-foundation = "0.3.0"
 cgl = "0.1"
 
 [target.'cfg(target_os = "linux")'.dependencies.x11]
 version = "2.3.0"
 features = ["xlib"]
 
 [target.'cfg(target_os = "windows")'.dependencies]
 winapi = "0.2"
--- a/third_party/rust/strsim/.cargo-checksum.json
+++ b/third_party/rust/strsim/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".editorconfig":"d87dec5ba57378b3c32bbf67526e434f7ac4f44d8b1acc7f44b6d8e7ee6919ad",".gitattributes":"419ab766cbe7ae8669f841017daa5cff052f6c0f888390675a2a0087290ff60f",".gitignore":"9dcfe03b745ee568c6f99c23e582d317873c4dd2ef6fb7ff65175331381e1c93",".travis.yml":"10ee132e43d2a5e3c304a4970adfec8939014403c32d178728a56c8cb18046ee","CHANGELOG.md":"5f3e55f36768b2d2e40ee54702d6298175b7736e9b8918ca03592011f053c25f","Cargo.toml":"ff9b4b5bd80560ed36b14313261763d321cfb9e3f212896ec565fb872e26c3f0","LICENSE":"9b60c5838cbe7953b84bb2206835cb2bc898802da4c449e4442cf23e3ad4841e","README.md":"1778e287c6788197322a352721414f7ceab0c84ee0918513bb9f5382d3e40bc6","appveyor.yml":"b41eae9798a9bb250f6046509d9bbd6e63bac9ad2655d342b3d9c8975584f0c0","dev":"498932c7296d8abeb9e432e797a579787a85a052fa514325b873c4fe3200ec67","src/lib.rs":"a79164ec2334c477ca9d25e10c161e0e9bb8ae8670eb22976948c2a574b40985","tests/lib.rs":"43c707f9c9d35fafa07b34f61418ac877687daba5a0790d87e47b3d2c8bad274"},"package":"b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".editorconfig":"d87dec5ba57378b3c32bbf67526e434f7ac4f44d8b1acc7f44b6d8e7ee6919ad",".gitignore":"9dcfe03b745ee568c6f99c23e582d317873c4dd2ef6fb7ff65175331381e1c93",".travis.yml":"10ee132e43d2a5e3c304a4970adfec8939014403c32d178728a56c8cb18046ee","CHANGELOG.md":"5f3e55f36768b2d2e40ee54702d6298175b7736e9b8918ca03592011f053c25f","Cargo.toml":"ff9b4b5bd80560ed36b14313261763d321cfb9e3f212896ec565fb872e26c3f0","LICENSE":"9b60c5838cbe7953b84bb2206835cb2bc898802da4c449e4442cf23e3ad4841e","README.md":"1778e287c6788197322a352721414f7ceab0c84ee0918513bb9f5382d3e40bc6","appveyor.yml":"b41eae9798a9bb250f6046509d9bbd6e63bac9ad2655d342b3d9c8975584f0c0","dev":"498932c7296d8abeb9e432e797a579787a85a052fa514325b873c4fe3200ec67","src/lib.rs":"a79164ec2334c477ca9d25e10c161e0e9bb8ae8670eb22976948c2a574b40985","tests/lib.rs":"43c707f9c9d35fafa07b34f61418ac877687daba5a0790d87e47b3d2c8bad274"},"package":"b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/strsim/.gitattributes
+++ /dev/null
@@ -1,3 +0,0 @@
-# Override core.autocrlf settings to keep line endings consistent (LF)
-* text=auto
-
--- a/third_party/rust/syn/.cargo-checksum.json
+++ b/third_party/rust/syn/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"c1650ed29ad7cb01e5da2e0efd299062cd38272d0dc971f8f8f5979a0aaadd4c","src/aster/generics.rs":"77eb19443af0dff5debb18d064733cc8721a42ad7e993a33352cdeff2b5f9f85","src/aster/ident.rs":"e9d082664f008a56bd854011310b4258ab072740ba82e57495b6e8a868a5f36b","src/aster/invoke.rs":"2b1b993973ab4f5c8fa6d6a286576b2542edce21fe9904f5133c470c072e6d3f","src/aster/lifetime.rs":"d83f4c1a48e3580caa028cfabde6ace232efc95d70af6dc9cfcca48317db9ad7","src/aster/mod.rs":"12220f73b0021e72b4c50f6a513cff174b9c7267209aa23f183043d96ccc9ab7","src/aster/path.rs":"60865b0f952077307c1a66810a4b6dafde43e76a417a433a8343960e7de474e4","src/aster/qpath.rs":"885c94b29ab8ee45c72a682221e241d1f0dd09c659809fe77279b5dd8a4bc645","src/aster/ty.rs":"90649aad98617c09ffc43a38aeb823a3298c41bf5e10f0ef3500b71c81021c2f","src/aster/ty_param.rs":"7ced1e6ca0c98ef468d507d3f07bfcb1171395cd66ff5c3e1b091fe7e8b9a562","src/aster/where_predicate.rs":"5fb8ec3fcb67bcc1d9bb7b64cf2f5beb601aac6502d6db30c0cdf8641fa248d1","src/attr.rs":"2ba436bdd439511be10baf9ad45226ade678176a7fd45a087367e1ad2b43e07a","src/constant.rs":"90535a2320e0dc8ab623a9bffa770bdf697baef2884a7d9224b31daf422ea5a0","src/data.rs":"0119c67821f846e67d792bea638ae7f7f5d7e2f5e5a0c145d8ba8766d6ddb0f9","src/escape.rs":"e035b1f6ce3255e868fddb62ee90a95a2f3caf2db73786a2b179b92e9e337539","src/expr.rs":"1e8b194f213e3279c0cb414f450ebab78c657951b8c2abf97378e745467ca8f5","src/generics.rs":"a300acff4c6e61d2fe9344db23f5e176e7abb02529bc348d9180f41ad0a4caf6","src/helper.rs":"9693d5c78f2d627a90d689a5d4bee1061eddcb646ae6dff3b2e4fd7cfbb33845","src/ident.rs":"83142b0107baba3137aad3b7d5c7b468ab53bf837bd9544d117d6644080d2705","src/item.rs":"5f7ba91d7642612ddaba9e862695234f4fdda88009f83ad5dee8ac6180a4f08d","src/krate.rs":"324073a42389eb1c26a9d0f325b4f1cdd37d00a9bcaf07fdee77af54909a452d","src/lib.rs":"2e1c12a937ed5c0f80620f4166463fed8119f0620c2b984ccd484b30ed3ee71c","src/lit.rs":"2615fc6041f11b67a7cd62012f36eb215fd1fdf6649b6b64d728625148f53c7b","src/mac.rs":"b7f7f67f6e7830b9dc2fd7fb4996c6821937687c44d2fbdc34ecc89e43815eff","src/macro_input.rs":"93b999877879076e1f47502d96aa18aad82117d072044ca9de825c8a9bfa60b8","src/nom.rs":"e877f3492633186e6499775c9bfa58c2554c25d8a6467ee1567d13706386b4c3","src/op.rs":"232f84ba605ed50e70ee02169dd551548872135cf56f155637917ec3bf810ce1","src/registry.rs":"b709f2a0f372efd8dec8fd46d6d71fb3b56a0261789e6de048a41a5e70144421","src/space.rs":"de9cb71e831c1d66f0bf2f3f219c3455d1979ca89f89b198d3b324e0cd50faf8","src/ty.rs":"d5562321530c739d7b25324463a94f685837824333ec7d604aefbd782f9ec2fb","src/visit.rs":"d3133ff25aa9cc8e6ec15f579bfa753a264518b0a7de2f2be4586d49632a9aac"},"package":"e5aaf7e4a0f90d7285445c881dcc28f1a510e4962b4ffcdde17f5775b2960df6"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"f703ce140afaec1a35ce733f6bc3d0ce45a6256095572d0763c815fbf39f4f11","src/aster/generics.rs":"77eb19443af0dff5debb18d064733cc8721a42ad7e993a33352cdeff2b5f9f85","src/aster/ident.rs":"e9d082664f008a56bd854011310b4258ab072740ba82e57495b6e8a868a5f36b","src/aster/invoke.rs":"2b1b993973ab4f5c8fa6d6a286576b2542edce21fe9904f5133c470c072e6d3f","src/aster/lifetime.rs":"d83f4c1a48e3580caa028cfabde6ace232efc95d70af6dc9cfcca48317db9ad7","src/aster/mod.rs":"12220f73b0021e72b4c50f6a513cff174b9c7267209aa23f183043d96ccc9ab7","src/aster/path.rs":"60865b0f952077307c1a66810a4b6dafde43e76a417a433a8343960e7de474e4","src/aster/qpath.rs":"885c94b29ab8ee45c72a682221e241d1f0dd09c659809fe77279b5dd8a4bc645","src/aster/ty.rs":"90649aad98617c09ffc43a38aeb823a3298c41bf5e10f0ef3500b71c81021c2f","src/aster/ty_param.rs":"7ced1e6ca0c98ef468d507d3f07bfcb1171395cd66ff5c3e1b091fe7e8b9a562","src/aster/where_predicate.rs":"5fb8ec3fcb67bcc1d9bb7b64cf2f5beb601aac6502d6db30c0cdf8641fa248d1","src/attr.rs":"2ba436bdd439511be10baf9ad45226ade678176a7fd45a087367e1ad2b43e07a","src/constant.rs":"90535a2320e0dc8ab623a9bffa770bdf697baef2884a7d9224b31daf422ea5a0","src/data.rs":"0119c67821f846e67d792bea638ae7f7f5d7e2f5e5a0c145d8ba8766d6ddb0f9","src/escape.rs":"e035b1f6ce3255e868fddb62ee90a95a2f3caf2db73786a2b179b92e9e337539","src/expr.rs":"02e8d346bef099974d06d74945be92fe6391111b94154df4981d44f1594d5579","src/generics.rs":"a300acff4c6e61d2fe9344db23f5e176e7abb02529bc348d9180f41ad0a4caf6","src/helper.rs":"9693d5c78f2d627a90d689a5d4bee1061eddcb646ae6dff3b2e4fd7cfbb33845","src/ident.rs":"83142b0107baba3137aad3b7d5c7b468ab53bf837bd9544d117d6644080d2705","src/item.rs":"63f2cd9a01c279405196d90a7d1cc530896157352163fb44f6b2a713657058b8","src/krate.rs":"324073a42389eb1c26a9d0f325b4f1cdd37d00a9bcaf07fdee77af54909a452d","src/lib.rs":"ef584db9ac9b7308224798d3983cbf201df7f0da1735fe5ce408f20fb3df763e","src/lit.rs":"2615fc6041f11b67a7cd62012f36eb215fd1fdf6649b6b64d728625148f53c7b","src/mac.rs":"45c44bd7abcbdaea6572bb4721bdc57b02b967ea9865172fe10e029e51e51a42","src/macro_input.rs":"93b999877879076e1f47502d96aa18aad82117d072044ca9de825c8a9bfa60b8","src/nom.rs":"642149bf322b762e02183ac1fed641df7f03ac53334c869a64707de4e9c5e68c","src/op.rs":"232f84ba605ed50e70ee02169dd551548872135cf56f155637917ec3bf810ce1","src/registry.rs":"b709f2a0f372efd8dec8fd46d6d71fb3b56a0261789e6de048a41a5e70144421","src/space.rs":"de9cb71e831c1d66f0bf2f3f219c3455d1979ca89f89b198d3b324e0cd50faf8","src/ty.rs":"97cfcb904a5fd68a42ebd2e5f86466d92e0785b1491d80c2a8d396ccec1b742a","src/visit.rs":"d7dcf429cc1a05821a66a4b38e7856eec45a9b2215f625d95030c3688eda26ca"},"package":"58fd09df59565db3399efbba34ba8a2fec1307511ebd245d0061ff9d42691673"}
\ No newline at end of file
--- a/third_party/rust/syn/Cargo.toml
+++ b/third_party/rust/syn/Cargo.toml
@@ -1,33 +1,32 @@
 [package]
 name = "syn"
-version = "0.10.7" # don't forget to update version in readme for breaking changes
+version = "0.10.8" # don't forget to update version in readme for breaking changes
 authors = ["David Tolnay <dtolnay@gmail.com>"]
 license = "MIT/Apache-2.0"
 description = "Nom parser for Rust source code"
 repository = "https://github.com/dtolnay/syn"
 documentation = "https://dtolnay.github.io/syn/syn/"
 include = ["Cargo.toml", "src/**/*.rs"]
 
 [features]
 default = ["parsing", "printing"]
 aster = []
 expand = ["full", "parsing", "printing"]
-full = ["type-macros"]
+full = []
 parsing = ["unicode-xid"]
 pretty = ["syntex_syntax"]
 printing = ["quote"]
-type-macros = []
 visit = []
 
 [dependencies]
 clippy = { version = "0.*", optional = true }
 quote = { version = "0.3.0", optional = true }
-syntex_syntax = { version = "0.52.0", optional = true }
+syntex_syntax = { version = "0.50.0", optional = true }
 unicode-xid = { version = "0.0.4", optional = true }
 
 [dev-dependencies]
-syntex_pos = "0.52.0"
-syntex_syntax = "0.52.0"
+syntex_pos = "0.50.0"
+syntex_syntax = "0.50.0"
 tempdir = "0.3.5"
 time = "0.1.35"
 walkdir = "1.0.1"
--- a/third_party/rust/syn/src/expr.rs
+++ b/third_party/rust/syn/src/expr.rs
@@ -80,20 +80,20 @@ pub enum ExprKind {
     /// This is desugared to a combination of `loop` and `match` expressions.
     ForLoop(Box<Pat>, Box<Expr>, Block, Option<Ident>),
     /// Conditionless loop (can be exited with break, continue, or return)
     ///
     /// `'label: loop { block }`
     Loop(Block, Option<Ident>),
     /// A `match` block.
     Match(Box<Expr>, Vec<Arm>),
-    /// A closure (for example, `move |a, b, c| a + b + c`)
-    Closure(CaptureBy, Box<FnDecl>, Box<Expr>),
+    /// A closure (for example, `move |a, b, c| {a + b + c}`)
+    Closure(CaptureBy, Box<FnDecl>, Block),
     /// A block (`{ ... }` or `unsafe { ... }`)
-    Block(Unsafety, Block),
+    Block(BlockCheckMode, Block),
 
     /// An assignment (`a = foo()`)
     Assign(Box<Expr>, Box<Expr>),
     /// An assignment with an operator
     ///
     /// For example, `a += 1`.
     AssignOp(BinOp, Box<Expr>, Box<Expr>),
     /// Access of a named struct field (`obj.foo`)
@@ -111,18 +111,18 @@ pub enum ExprKind {
     /// parameters, e.g. foo::bar::<baz>.
     ///
     /// Optionally "qualified",
     /// E.g. `<Vec<T> as SomeTrait>::SomeType`.
     Path(Option<QSelf>, Path),
 
     /// A referencing operation (`&a` or `&mut a`)
     AddrOf(Mutability, Box<Expr>),
-    /// A `break`, with an optional label to break, and an optional expression
-    Break(Option<Ident>, Option<Box<Expr>>),
+    /// A `break`, with an optional label to break
+    Break(Option<Ident>),
     /// A `continue`, with an optional label
     Continue(Option<Ident>),
     /// A `return`, with an optional value to be returned
     Ret(Option<Box<Expr>>),
 
     /// A macro invocation; pre-expansion
     Mac(Mac),
 
@@ -156,16 +156,22 @@ pub struct FieldValue {
 ///
 /// E.g. `{ .. }` as in `fn foo() { .. }`
 #[derive(Debug, Clone, Eq, PartialEq, Hash)]
 pub struct Block {
     /// Statements in a block
     pub stmts: Vec<Stmt>,
 }
 
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
+pub enum BlockCheckMode {
+    Default,
+    Unsafe,
+}
+
 #[derive(Debug, Clone, Eq, PartialEq, Hash)]
 pub enum Stmt {
     /// A local (let) binding.
     Local(Box<Local>),
 
     /// An item definition.
     Item(Box<Item>),
 
@@ -301,26 +307,26 @@ pub enum BindingMode {
     ByRef(Mutability),
     ByValue(Mutability),
 }
 
 #[cfg(feature = "parsing")]
 pub mod parsing {
     use super::*;
     use {BinOp, Delimited, DelimToken, FnArg, FnDecl, FunctionRetTy, Ident, Lifetime, Mac,
-         TokenTree, Ty, UnOp, Unsafety};
+         TokenTree, Ty, UnOp};
     use attr::parsing::outer_attr;
     use generics::parsing::lifetime;
     use ident::parsing::{ident, wordlike};
     use item::parsing::item;
     use lit::parsing::{digits, lit};
     use mac::parsing::{mac, token_trees};
     use nom::IResult::{self, Error};
     use op::parsing::{assign_op, binop, unop};
-    use ty::parsing::{mutability, path, qpath, ty, unsafety};
+    use ty::parsing::{mutability, path, qpath, ty};
 
     // Struct literals are ambiguous in certain positions
     // https://github.com/rust-lang/rfcs/pull/92
     macro_rules! named_ambiguous_expr {
         ($name:ident -> $o:ty, $allow_struct:ident, $submac:ident!( $($args:tt)* )) => {
             fn $name(i: &str, $allow_struct: bool) -> $crate::nom::IResult<&str, $o> {
                 $submac!(i, $($args)*)
             }
@@ -344,17 +350,17 @@ pub mod parsing {
                 expr_lit // must be before expr_struct
                 |
                 cond_reduce!(allow_struct, expr_struct) // must be before expr_path
                 |
                 expr_paren // must be before expr_tup
                 |
                 expr_mac // must be before expr_path
                 |
-                call!(expr_break, allow_struct) // must be before expr_path
+                expr_break // must be before expr_path
                 |
                 expr_continue // must be before expr_path
                 |
                 call!(expr_ret, allow_struct) // must be before expr_path
                 |
                 call!(expr_box, allow_struct)
                 |
                 expr_in_place
@@ -463,17 +469,17 @@ pub mod parsing {
     named!(expr_in_place -> ExprKind, do_parse!(
         keyword!("in") >>
         place: expr_no_struct >>
         punct!("{") >>
         value: within_block >>
         punct!("}") >>
         (ExprKind::InPlace(
             Box::new(place),
-            Box::new(ExprKind::Block(Unsafety::Normal, Block {
+            Box::new(ExprKind::Block(BlockCheckMode::Default, Block {
                 stmts: value,
             }).into()),
         ))
     ));
 
     named!(expr_vec -> ExprKind, do_parse!(
         punct!("[") >>
         elems: terminated_list!(punct!(","), expr) >>
@@ -560,17 +566,17 @@ pub mod parsing {
             keyword!("else"),
             alt!(
                 expr_if
                 |
                 do_parse!(
                     punct!("{") >>
                     else_block: within_block >>
                     punct!("}") >>
-                    (ExprKind::Block(Unsafety::Normal, Block {
+                    (ExprKind::Block(BlockCheckMode::Default, Block {
                         stmts: else_block,
                     }).into())
                 )
             )
         )) >>
         (match cond {
             Cond::Let(pat, expr) => ExprKind::IfLet(
                 Box::new(pat),
@@ -621,30 +627,30 @@ pub mod parsing {
         punct!("}") >>
         (ExprKind::Match(Box::new(obj), {
             arms.extend(last_arm);
             arms
         }))
     ));
 
     fn arm_requires_comma(arm: &Arm) -> bool {
-        if let ExprKind::Block(Unsafety::Normal, _) = arm.body.node {
+        if let ExprKind::Block(BlockCheckMode::Default, _) = arm.body.node {
             false
         } else {
             true
         }
     }
 
     named!(match_arm -> Arm, do_parse!(
         attrs: many0!(outer_attr) >>
         pats: separated_nonempty_list!(punct!("|"), pat) >>
         guard: option!(preceded!(keyword!("if"), expr)) >>
         punct!("=>") >>
         body: alt!(
-            map!(block, |blk| ExprKind::Block(Unsafety::Normal, blk).into())
+            map!(block, |blk| ExprKind::Block(BlockCheckMode::Default, blk).into())
             |
             expr
         ) >>
         (Arm {
             attrs: attrs,
             pats: pats,
             guard: guard.map(Box::new),
             body: Box::new(body),
@@ -656,29 +662,34 @@ pub mod parsing {
         punct!("|") >>
         inputs: terminated_list!(punct!(","), closure_arg) >>
         punct!("|") >>
         ret_and_body: alt!(
             do_parse!(
                 punct!("->") >>
                 ty: ty >>
                 body: block >>
-                (FunctionRetTy::Ty(ty), ExprKind::Block(Unsafety::Normal, body).into())
+                ((FunctionRetTy::Ty(ty), body))
             )
             |
-            map!(ambiguous_expr!(allow_struct), |e| (FunctionRetTy::Default, e))
+            map!(ambiguous_expr!(allow_struct), |e| (
+                FunctionRetTy::Default,
+                Block {
+                    stmts: vec![Stmt::Expr(Box::new(e))],
+                },
+            ))
         ) >>
         (ExprKind::Closure(
             capture,
             Box::new(FnDecl {
                 inputs: inputs,
                 output: ret_and_body.0,
                 variadic: false,
             }),
-            Box::new(ret_and_body.1),
+            ret_and_body.1,
         ))
     ));
 
     named!(closure_arg -> FnArg, do_parse!(
         pat: pat >>
         ty: option!(preceded!(punct!(":"), ty)) >>
         (FnArg::Captured(pat, ty.unwrap_or(Ty::Infer)))
     ));
@@ -704,21 +715,20 @@ pub mod parsing {
     ));
 
     named!(expr_continue -> ExprKind, do_parse!(
         keyword!("continue") >>
         lbl: option!(label) >>
         (ExprKind::Continue(lbl))
     ));
 
-    named_ambiguous_expr!(expr_break -> ExprKind, allow_struct, do_parse!(
+    named!(expr_break -> ExprKind, do_parse!(
         keyword!("break") >>
         lbl: option!(label) >>
-        val: option!(call!(ambiguous_expr, allow_struct, false)) >>
-        (ExprKind::Break(lbl, val.map(Box::new)))
+        (ExprKind::Break(lbl))
     ));
 
     named_ambiguous_expr!(expr_ret -> ExprKind, allow_struct, do_parse!(
         keyword!("return") >>
         ret_value: option!(ambiguous_expr!(allow_struct)) >>
         (ExprKind::Ret(ret_value.map(Box::new)))
     ));
 
@@ -761,17 +771,17 @@ pub mod parsing {
         value: expr >>
         punct!(";") >>
         times: expr >>
         punct!("]") >>
         (ExprKind::Repeat(Box::new(value), Box::new(times)))
     ));
 
     named!(expr_block -> ExprKind, do_parse!(
-        rules: unsafety >>
+        rules: block_check_mode >>
         b: block >>
         (ExprKind::Block(rules, Block {
             stmts: b.stmts,
         }))
     ));
 
     named_ambiguous_expr!(expr_range -> ExprKind, allow_struct, do_parse!(
         limits: range_limits >>
@@ -819,16 +829,22 @@ pub mod parsing {
         punct!("{") >>
         stmts: within_block >>
         punct!("}") >>
         (Block {
             stmts: stmts,
         })
     ));
 
+    named!(block_check_mode -> BlockCheckMode, alt!(
+        keyword!("unsafe") => { |_| BlockCheckMode::Unsafe }
+        |
+        epsilon!() => { |_| BlockCheckMode::Default }
+    ));
+
     named!(pub within_block -> Vec<Stmt>, do_parse!(
         many0!(punct!(";")) >>
         mut standalone: many0!(terminated!(standalone_stmt, many0!(punct!(";")))) >>
         last: option!(expr) >>
         (match last {
             None => standalone,
             Some(last) => {
                 standalone.push(Stmt::Expr(Box::new(last)));
@@ -844,27 +860,27 @@ pub mod parsing {
         |
         stmt_item
         |
         stmt_expr
     ));
 
     named!(stmt_mac -> Stmt, do_parse!(
         attrs: many0!(outer_attr) >>
-        what: path >>
+        name: ident >>
         punct!("!") >>
     // Only parse braces here; paren and bracket will get parsed as
     // expression statements
         punct!("{") >>
         tts: token_trees >>
         punct!("}") >>
         semi: option!(punct!(";")) >>
         (Stmt::Mac(Box::new((
             Mac {
-                path: what,
+                path: name.into(),
                 tts: vec![TokenTree::Delimited(Delimited {
                     delim: DelimToken::Brace,
                     tts: tts,
                 })],
             },
             if semi.is_some() {
                 MacStmtStyle::Semicolon
             } else {
@@ -1138,17 +1154,17 @@ pub mod parsing {
     ));
 
     named!(label -> Ident, map!(lifetime, |lt: Lifetime| lt.ident));
 }
 
 #[cfg(feature = "printing")]
 mod printing {
     use super::*;
-    use {FnArg, FunctionRetTy, Mutability, Ty, Unsafety};
+    use {FnArg, FunctionRetTy, Mutability, Ty};
     use attr::FilterAttrs;
     use quote::{Tokens, ToTokens};
 
     impl ToTokens for Expr {
         fn to_tokens(&self, tokens: &mut Tokens) {
             tokens.append_all(self.attrs.outer());
             match self.node {
                 ExprKind::Box(ref inner) => {
@@ -1276,39 +1292,49 @@ mod printing {
                 }
                 ExprKind::Match(ref expr, ref arms) => {
                     tokens.append("match");
                     expr.to_tokens(tokens);
                     tokens.append("{");
                     tokens.append_all(arms);
                     tokens.append("}");
                 }
-                ExprKind::Closure(capture, ref decl, ref expr) => {
+                ExprKind::Closure(capture, ref decl, ref body) => {
                     capture.to_tokens(tokens);
                     tokens.append("|");
                     for (i, input) in decl.inputs.iter().enumerate() {
                         if i > 0 {
                             tokens.append(",");
                         }
                         match *input {
                             FnArg::Captured(ref pat, Ty::Infer) => {
                                 pat.to_tokens(tokens);
                             }
                             _ => input.to_tokens(tokens),
                         }
                     }
                     tokens.append("|");
                     match decl.output {
-                        FunctionRetTy::Default => { /* nothing */ }
+                        FunctionRetTy::Default => {
+                            if body.stmts.len() == 1 {
+                                if let Stmt::Expr(ref expr) = body.stmts[0] {
+                                    expr.to_tokens(tokens);
+                                } else {
+                                    body.to_tokens(tokens);
+                                }
+                            } else {
+                                body.to_tokens(tokens);
+                            }
+                        }
                         FunctionRetTy::Ty(ref ty) => {
                             tokens.append("->");
                             ty.to_tokens(tokens);
+                            body.to_tokens(tokens);
                         }
                     }
-                    expr.to_tokens(tokens);
                 }
                 ExprKind::Block(rules, ref block) => {
                     rules.to_tokens(tokens);
                     block.to_tokens(tokens);
                 }
                 ExprKind::Assign(ref var, ref expr) => {
                     var.to_tokens(tokens);
                     tokens.append("=");
@@ -1365,20 +1391,19 @@ mod printing {
                         segment.to_tokens(tokens);
                     }
                 }
                 ExprKind::AddrOf(mutability, ref expr) => {
                     tokens.append("&");
                     mutability.to_tokens(tokens);
                     expr.to_tokens(tokens);
                 }
-                ExprKind::Break(ref opt_label, ref opt_val) => {
+                ExprKind::Break(ref opt_label) => {
                     tokens.append("break");
                     opt_label.to_tokens(tokens);
-                    opt_val.to_tokens(tokens);
                 }
                 ExprKind::Continue(ref opt_label) => {
                     tokens.append("continue");
                     opt_label.to_tokens(tokens);
                 }
                 ExprKind::Ret(ref opt_expr) => {
                     tokens.append("return");
                     opt_expr.to_tokens(tokens);
@@ -1435,17 +1460,17 @@ mod printing {
             tokens.append_separated(&self.pats, "|");
             if let Some(ref guard) = self.guard {
                 tokens.append("if");
                 guard.to_tokens(tokens);
             }
             tokens.append("=>");
             self.body.to_tokens(tokens);
             match self.body.node {
-                ExprKind::Block(Unsafety::Normal, _) => {
+                ExprKind::Block(BlockCheckMode::Default, _) => {
                     // no comma
                 }
                 _ => tokens.append(","),
             }
         }
     }
 
     impl ToTokens for Pat {
@@ -1616,16 +1641,27 @@ mod printing {
     impl ToTokens for Block {
         fn to_tokens(&self, tokens: &mut Tokens) {
             tokens.append("{");
             tokens.append_all(&self.stmts);
             tokens.append("}");
         }
     }
 
+    impl ToTokens for BlockCheckMode {
+        fn to_tokens(&self, tokens: &mut Tokens) {
+            match *self {
+                BlockCheckMode::Default => {
+                    // nothing
+                }
+                BlockCheckMode::Unsafe => tokens.append("unsafe"),
+            }
+        }
+    }
+
     impl ToTokens for Stmt {
         fn to_tokens(&self, tokens: &mut Tokens) {
             match *self {
                 Stmt::Local(ref local) => local.to_tokens(tokens),
                 Stmt::Item(ref item) => item.to_tokens(tokens),
                 Stmt::Expr(ref expr) => expr.to_tokens(tokens),
                 Stmt::Semi(ref expr) => {
                     expr.to_tokens(tokens);
--- a/third_party/rust/syn/src/item.rs
+++ b/third_party/rust/syn/src/item.rs
@@ -275,30 +275,30 @@ pub mod parsing {
         |
         item_mac
     ));
 
     named!(pub items -> Vec<Item>, many0!(item));
 
     named!(item_mac -> Item, do_parse!(
         attrs: many0!(outer_attr) >>
-        what: path >>
+        path: ident >>
         punct!("!") >>
         name: option!(ident) >>
         body: delimited >>
         cond!(match body.delim {
             DelimToken::Paren | DelimToken::Bracket => true,
             DelimToken::Brace => false,
         }, punct!(";")) >>
         (Item {
             ident: name.unwrap_or_else(|| Ident::new("")),
             vis: Visibility::Inherited,
             attrs: attrs,
             node: ItemKind::Mac(Mac {
-                path: what,
+                path: path.into(),
                 tts: vec![TokenTree::Delimited(body)],
             }),
         })
     ));
 
     named!(item_extern_crate -> Item, do_parse!(
         attrs: many0!(outer_attr) >>
         vis: visibility >>
@@ -816,28 +816,28 @@ pub mod parsing {
             ident: id,
             attrs: attrs,
             node: TraitItemKind::Type(bounds, default),
         })
     ));
 
     named!(trait_item_mac -> TraitItem, do_parse!(
         attrs: many0!(outer_attr) >>
-        what: path >>
+        id: ident >>
         punct!("!") >>
         body: delimited >>
         cond!(match body.delim {
             DelimToken::Paren | DelimToken::Bracket => true,
             DelimToken::Brace => false,
         }, punct!(";")) >>
         (TraitItem {
-            ident: Ident::new(""),
+            ident: id.clone(),
             attrs: attrs,
             node: TraitItemKind::Macro(Mac {
-                path: what,
+                path: id.into(),
                 tts: vec![TokenTree::Delimited(body)],
             }),
         })
     ));
 
     named!(item_impl -> Item, do_parse!(
         attrs: many0!(outer_attr) >>
         unsafety: unsafety >>
@@ -971,30 +971,30 @@ pub mod parsing {
             defaultness: defaultness,
             attrs: attrs,
             node: ImplItemKind::Type(ty),
         })
     ));
 
     named!(impl_item_macro -> ImplItem, do_parse!(
         attrs: many0!(outer_attr) >>
-        what: path >>
+        id: ident >>
         punct!("!") >>
         body: delimited >>
         cond!(match body.delim {
             DelimToken::Paren | DelimToken::Bracket => true,
             DelimToken::Brace => false,
         }, punct!(";")) >>
         (ImplItem {
-            ident: Ident::new(""),
+            ident: id.clone(),
             vis: Visibility::Inherited,
             defaultness: Defaultness::Final,
             attrs: attrs,
             node: ImplItemKind::Macro(Mac {
-                path: what,
+                path: id.into(),
                 tts: vec![TokenTree::Delimited(body)],
             }),
         })
     ));
 
     named!(impl_polarity -> ImplPolarity, alt!(
         punct!("!") => { |_| ImplPolarity::Negative }
         |
--- a/third_party/rust/syn/src/lib.rs
+++ b/third_party/rust/syn/src/lib.rs
@@ -32,18 +32,18 @@ mod data;
 pub use data::{Field, Variant, VariantData, Visibility};
 
 #[cfg(feature = "parsing")]
 mod escape;
 
 #[cfg(feature = "full")]
 mod expr;
 #[cfg(feature = "full")]
-pub use expr::{Arm, BindingMode, Block, CaptureBy, Expr, ExprKind, FieldPat, FieldValue,
-               Local, MacStmtStyle, Pat, RangeLimits, Stmt};
+pub use expr::{Arm, BindingMode, Block, BlockCheckMode, CaptureBy, Expr, ExprKind, FieldPat,
+               FieldValue, Local, MacStmtStyle, Pat, RangeLimits, Stmt};
 
 mod generics;
 pub use generics::{Generics, Lifetime, LifetimeDef, TraitBoundModifier, TyParam, TyParamBound,
                    WhereBoundPredicate, WhereClause, WherePredicate, WhereRegionPredicate};
 #[cfg(feature = "printing")]
 pub use generics::{ImplGenerics, TyGenerics};
 
 mod ident;
@@ -59,19 +59,19 @@ pub use item::{Constness, Defaultness, F
 #[cfg(feature = "full")]
 mod krate;
 #[cfg(feature = "full")]
 pub use krate::Crate;
 
 mod lit;
 pub use lit::{FloatTy, IntTy, Lit, StrStyle};
 
-#[cfg(feature = "type-macros")]
+#[cfg(feature = "full")]
 mod mac;
-#[cfg(feature = "type-macros")]
+#[cfg(feature = "full")]
 pub use mac::{BinOpToken, DelimToken, Delimited, Mac, Token, TokenTree};
 
 mod macro_input;
 pub use macro_input::{Body, MacroInput};
 
 mod op;
 pub use op::{BinOp, UnOp};
 
--- a/third_party/rust/syn/src/mac.rs
+++ b/third_party/rust/syn/src/mac.rs
@@ -109,27 +109,26 @@ pub enum DelimToken {
     Brace,
 }
 
 #[cfg(feature = "parsing")]
 pub mod parsing {
     use super::*;
     use Lifetime;
     use generics::parsing::lifetime;
-    use ident::parsing::word;
+    use ident::parsing::{ident, word};
     use lit::parsing::lit;
     use space::{block_comment, whitespace};
-    use ty::parsing::path;
 
     named!(pub mac -> Mac, do_parse!(
-        what: path >>
+        name: ident >>
         punct!("!") >>
         body: delimited >>
         (Mac {
-            path: what,
+            path: name.into(),
             tts: vec![TokenTree::Delimited(body)],
         })
     ));
 
     named!(pub token_trees -> Vec<TokenTree>, many0!(token_tree));
 
     named!(pub delimited -> Delimited, alt!(
         delimited!(
--- a/third_party/rust/syn/src/nom.rs
+++ b/third_party/rust/syn/src/nom.rs
@@ -227,22 +227,32 @@ macro_rules! take_while1 {
         }
     }};
 
     ($input:expr, $f:expr) => {
         take_while1!($input, call!($f));
     };
 }
 
+pub fn str_chars(s: &str) -> Vec<char> {
+    // Can't do `s.chars().collect()` because it triggers a compiler bug in 1.12.0
+    // https://github.com/dtolnay/syn/issues/20
+    let mut result = Vec::new();
+    for ch in s.chars() {
+        result.push(ch);
+    }
+    result
+}
+
 macro_rules! take_until {
     ($input:expr, $substr:expr) => {{
         if $substr.len() > $input.len() {
             $crate::nom::IResult::Error
         } else {
-            let substr_vec: Vec<char> = $substr.chars().collect();
+            let substr_vec: Vec<char> = $crate::nom::str_chars($substr);
             let mut window: Vec<char> = vec![];
             let mut offset = $input.len();
             let mut parsed = false;
             for (o, c) in $input.char_indices() {
                 window.push(c);
                 if window.len() > substr_vec.len() {
                     window.remove(0);
                 }
--- a/third_party/rust/syn/src/ty.rs
+++ b/third_party/rust/syn/src/ty.rs
@@ -28,24 +28,16 @@ pub enum Ty {
     PolyTraitRef(Vec<TyParamBound>),
     /// An `impl TraitA+TraitB` type.
     ImplTrait(Vec<TyParamBound>),
     /// No-op; kept solely so that we can pretty-print faithfully
     Paren(Box<Ty>),
     /// TyKind::Infer means the type should be inferred instead of it having been
     /// specified. This can appear anywhere in a type.
     Infer,
-    /// A macro in the type position.
-    Mac(Mac),
-}
-
-#[cfg(not(feature = "type-macros"))]
-#[derive(Debug, Clone, Eq, PartialEq, Hash)]
-pub struct Mac {
-    _private: (),
 }
 
 #[derive(Debug, Clone, Eq, PartialEq, Hash)]
 pub struct MutTy {
     pub ty: Ty,
     pub mutability: Mutability,
 }
 
@@ -58,20 +50,17 @@ pub enum Mutability {
 /// A "Path" is essentially Rust's notion of a name.
 ///
 /// It's represented as a sequence of identifiers,
 /// along with a bunch of supporting information.
 ///
 /// E.g. `std::cmp::PartialEq`
 #[derive(Debug, Clone, Eq, PartialEq, Hash)]
 pub struct Path {
-    /// A `::foo` path, is relative to the crate root rather than current
-    /// module (like paths in an import).
     pub global: bool,
-    /// The segments in the path: the things separated by `::`.
     pub segments: Vec<PathSegment>,
 }
 
 impl<T> From<T> for Path
     where T: Into<PathSegment>
 {
     fn from(segment: T) -> Self {
         Path {
@@ -81,23 +70,17 @@ impl<T> From<T> for Path
     }
 }
 
 /// A segment of a path: an identifier, an optional lifetime, and a set of types.
 ///
 /// E.g. `std`, `String` or `Box<T>`
 #[derive(Debug, Clone, Eq, PartialEq, Hash)]
 pub struct PathSegment {
-    /// The identifier portion of this path segment.
     pub ident: Ident,
-    /// Type/lifetime parameters attached to this path. They come in
-    /// two flavors: `Path<A,B,C>` and `Path(A,B) -> C`. Note that
-    /// this is more than just simple syntactic sugar; the use of
-    /// parens affects the region binding rules, so we preserve the
-    /// distinction.
     pub parameters: PathParameters,
 }
 
 impl<T> From<T> for PathSegment
     where T: Into<Ident>
 {
     fn from(ident: T) -> Self {
         PathSegment {
@@ -240,27 +223,21 @@ pub mod parsing {
     #[cfg(feature = "full")]
     use ConstExpr;
     use constant::parsing::const_expr;
     #[cfg(feature = "full")]
     use expr::parsing::expr;
     use generics::parsing::{lifetime, lifetime_def, ty_param_bound, bound_lifetimes};
     use ident::parsing::ident;
     use lit::parsing::quoted_string;
-    #[cfg(feature = "type-macros")]
-    use mac::parsing::mac;
-    #[cfg(not(feature = "type-macros"))]
-    use nom::IResult;
     use std::str;
 
     named!(pub ty -> Ty, alt!(
         ty_paren // must be before ty_tup
         |
-        ty_mac // must be before ty_path
-        |
         ty_path // must be before ty_poly_trait_ref
         |
         ty_vec
         |
         ty_array
         |
         ty_ptr
         |
@@ -272,24 +249,16 @@ pub mod parsing {
         |
         ty_tup
         |
         ty_poly_trait_ref
         |
         ty_impl_trait
     ));
 
-    #[cfg(feature = "type-macros")]
-    named!(ty_mac -> Ty, map!(mac, Ty::Mac));
-
-    #[cfg(not(feature = "type-macros"))]
-    fn ty_mac(_: &str) -> IResult<&str, Ty> {
-        IResult::Error
-    }
-
     named!(ty_vec -> Ty, do_parse!(
         punct!("[") >>
         elem: ty >>
         punct!("]") >>
         (Ty::Slice(Box::new(elem)))
     ));
 
     #[cfg(not(feature = "full"))]
@@ -674,17 +643,16 @@ mod printing {
                 Ty::Paren(ref inner) => {
                     tokens.append("(");
                     inner.to_tokens(tokens);
                     tokens.append(")");
                 }
                 Ty::Infer => {
                     tokens.append("_");
                 }
-                Ty::Mac(ref mac) => mac.to_tokens(tokens),
             }
         }
     }
 
     impl ToTokens for Mutability {
         fn to_tokens(&self, tokens: &mut Tokens) {
             if let Mutability::Mutable = *self {
                 tokens.append("mut");
@@ -850,16 +818,9 @@ mod printing {
         fn to_tokens(&self, tokens: &mut Tokens) {
             tokens.append("extern");
             match *self {
                 Abi::Named(ref named) => named.to_tokens(tokens),
                 Abi::Rust => {}
             }
         }
     }
-
-    #[cfg(not(feature = "type-macros"))]
-    impl ToTokens for Mac {
-        fn to_tokens(&self, _tokens: &mut Tokens) {
-            unreachable!()
-        }
-    }
 }
--- a/third_party/rust/syn/src/visit.rs
+++ b/third_party/rust/syn/src/visit.rs
@@ -166,17 +166,16 @@ pub fn walk_ty<V: Visitor>(visitor: &mut
         Ty::Array(ref inner, ref len) => {
             visitor.visit_ty(inner);
             visitor.visit_const_expr(len);
         }
         Ty::PolyTraitRef(ref bounds) |
         Ty::ImplTrait(ref bounds) => {
             walk_list!(visitor, visit_ty_param_bound, bounds);
         }
-        Ty::Mac(_) => {}
     }
 }
 
 pub fn walk_path<V: Visitor>(visitor: &mut V, path: &Path) {
     for segment in &path.segments {
         visitor.visit_path_segment(segment);
     }
 }
--- a/third_party/rust/term/.cargo-checksum.json
+++ b/third_party/rust/term/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c1e953ee360e77de57f7b02f1b7880bd6a3dc22d1a69e953c2ac2c52cc52d247",".travis.yml":"8a98e02ce273cefe3e6bdc92966575a9a71957ec49dba52301f5bdea8c194f9f","Cargo.toml":"ee592b74d4510eed169f70b240c05986baf8eab1653d837b35ff0284bd35a051","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"f5d6df44431e0814368b2890d954ae2253efb7765925582de8be11eb16a505a6","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","rustfmt.toml":"be851a0fa92766755e54e163ccceedee0b28ea6d527888c48f1cbc766f23733c","scripts/id_rsa.enc":"210d1476adba1c08d77329d9f71dba828c0516d8ae659c6317c9bee4683e5d50","scripts/travis-doc-upload.cfg":"2609cb89644596a2ede3cd63b7a5fb6e84ee56c2b880ff67584e9655f4a2e777","src/lib.rs":"176542e147d55ffc1f781dc6dfbe88999d26b72d1c753d9fc3f624b970ec8571","src/terminfo/mod.rs":"fb42450c2450b37989803c5cf9cd7c66d14d594f9b51df7fdee28ebbaafdf165","src/terminfo/parm.rs":"d04a4097095c40ff63ae5829b06fcf5eeec9596b0787f7b91f658a97caa74e43","src/terminfo/parser/compiled.rs":"2be2304f76b15f96f79913bb14bdcd828dde198c1bf0840f648c36e334799570","src/terminfo/parser/names.rs":"6c437ef97f96f68aba85d200c7919cfe53753e0b90ac51dcd8cc748890f82c34","src/terminfo/searcher.rs":"4aa507f1c87312ba2f7e00cd4268b1213d8f509aa6e14d69f1631c8b63ffa75e","src/win.rs":"9efbdc4bb18b317e3d98fa58e441cc8903710ac0e6f315899329660cf6d10277","tests/data/dumb":"123c85a2812a517d967db5f31660db0e6aded4a0b95ed943c5ab435368e7a25c","tests/data/linux":"9dcec472e8ec612e84b46c2b8ae17a4f47b2ccfe93bc7b16970bbaaa20fab1e9","tests/data/linux-16color":"eb0b5684a42db662ebaa0043cc4bb5e082b09a7312796ec669e0159fce6af499","tests/data/linux-basic":"1373c033c6a891911a0a478e5f9654600e84dbfe2d16f649ba2fc08802335a0c","tests/data/linux-c":"50807ab8371b45bd80ca9d563de882b733b5db88cff7646e40c344e98ef755ed","tests/data/linux-c-nc":"d88eb59f749d91be3148ce39dec7c050d95feb516702ed7f9f6cec7a58b424a7","tests/data/linux-koi8":"4b7d942f03ce95d45802029db0c87879eb93be50b43026c63c18a3552dd37c93","tests/data/linux-koi8r":"7267d93deec24396a9955e95da621c054d8d677634b465d798f792141b24e1de","tests/data/linux-lat":"b72b2ec68fa445e2e0ae96cc7bb2149a1527e11ae475d1957c8a22d9ec2c0905","tests/data/linux-m":"4a92f6fef1eeb679ec4511579d3004cfe6fc1d4dd73fed5299cde568f6cf3fbf","tests/data/linux-nic":"eac886df04c80e6ba02687087ddc93635c0f433f4f28195447499a8963989f21","tests/data/linux-vt":"2ebd4c761a492190609f6d8bcdd8f9c8c81e281b0d5e8a51b87f4ba126370bb4","tests/data/linux2.2":"c3d6e1466e9fb4111f4bf243b87a3de290d85224f1a4241947a3f51bdff08b82","tests/data/linux2.6":"52c2930ab1cad8271c280fefb1f581b12b7b3be445348d047a39f5e3448b3614","tests/data/linux2.6.26":"88f5a62b78956a21015ac887c5189a9f72900a842c2f844a1a5e197151a078d2","tests/data/linux3.0":"29b2aad27b5c291adab85e4150883fa6dc0034671c67e889d722168735ba2504","tests/data/rxvt":"9411be0058e147fc7a1962cd35145446d3d439ac3be9b6ca9d3aa2aa0c28ef5e","tests/data/rxvt-16color":"d41e75a0bad0e7c6d957c727f68dc507898685f3bbd71f0721a0a4beb14daf08","tests/data/rxvt-256color":"e6415e230d7962133d1da913cfcf23a0e2d3ed75379164a921feb9462c475a8e","tests/data/rxvt-88color":"958a81509d2b1e2cfe5a7bcf7a15e81d12575e4ccaa1dd308eda8edf7905a36a","tests/data/rxvt-basic":"3989e1c659121cb8fd8f67b8bff7f304e52c1f401cd1d09e906e11a58e0bc587","tests/data/rxvt-color":"3d2b49d48aca7fad7a3bf26d06592207b3c3cbf7afc3a5223fd0613f50a2739b","tests/data/rxvt-cygwin":"d50e434af6b3ab85b26e4f6af21c9c612d271efacaff3e64ef3da8c350a91809","tests/data/rxvt-cygwin-native":"34ee4ef070d9c366f5aba8f72a29a0e45ab552ba43b3e32265dfbe9eef157994","tests/data/rxvt-xpm":"4e8e40313ef00f0572456724249a625c36f2c5338b5014b87f236e29f612212e","tests/data/screen":"57c2888ffb9d7632381dc6191657abda998ca5f0958ad5787f848ff2206198f9","tests/data/screen-256color":"13fd658c693283ffb495d7f473bf525422e312e199bff6e64abdb70db5b22f46","tests/data/xterm":"67a59e4f0807759546dbf45c0bc2dddb30944ef553990345b1d08d7d19ddc13a","tests/data/xterm-256color":"e2525d133091a1ac38b2ad4eecd8df48eee31789c8fafac0ed99bcd6b746d8ce","tests/terminfo.rs":"5338fa4feae9e0d7d2c5f6ae3e911e6b88f668a23a4313e89b329d84464ef904"},"package":"3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a"}
\ No newline at end of file
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c1e953ee360e77de57f7b02f1b7880bd6a3dc22d1a69e953c2ac2c52cc52d247",".travis.yml":"8a98e02ce273cefe3e6bdc92966575a9a71957ec49dba52301f5bdea8c194f9f","Cargo.toml":"419a08f81fb02036cf387d13af4ce9782d9096256f599c6b9316064efda9d57c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"f5d6df44431e0814368b2890d954ae2253efb7765925582de8be11eb16a505a6","appveyor.yml":"da991211b72fa6f231af7adb84c9fb72f5a9131d1c0a3d47b8ceffe5a82c8542","rustfmt.toml":"be851a0fa92766755e54e163ccceedee0b28ea6d527888c48f1cbc766f23733c","scripts/id_rsa.enc":"210d1476adba1c08d77329d9f71dba828c0516d8ae659c6317c9bee4683e5d50","scripts/travis-doc-upload.cfg":"2609cb89644596a2ede3cd63b7a5fb6e84ee56c2b880ff67584e9655f4a2e777","src/lib.rs":"89a6d51f00881c7f67484fb350fa072069d81770aefd9eb17aa504aa14835c81","src/terminfo/mod.rs":"511a7bccf196089daaea601e670d92c3d78a37ed6b7ac00220f18959dbfea73f","src/terminfo/parm.rs":"efde5f3ab1cb5a646f51f07bd90cd05154e7d080c96dc03ae33dc2a125c5aedd","src/terminfo/parser/compiled.rs":"2f353fa3f4cf01974407c4a6cd0e94fc2b02f123ed3d5887bd454ef91d1d4eba","src/terminfo/parser/names.rs":"dd32022a5f198abc40fa68566c0798725451345173a7d80c80e05a121c8cf0f8","src/terminfo/searcher.rs":"5602a32e555762e5171c1865c2c1b3b6bb092b8c233f413bc0933658bed40b67","src/win.rs":"9efbdc4bb18b317e3d98fa58e441cc8903710ac0e6f315899329660cf6d10277","tests/data/dumb":"123c85a2812a517d967db5f31660db0e6aded4a0b95ed943c5ab435368e7a25c","tests/data/linux":"9dcec472e8ec612e84b46c2b8ae17a4f47b2ccfe93bc7b16970bbaaa20fab1e9","tests/data/linux-16color":"eb0b5684a42db662ebaa0043cc4bb5e082b09a7312796ec669e0159fce6af499","tests/data/linux-basic":"1373c033c6a891911a0a478e5f9654600e84dbfe2d16f649ba2fc08802335a0c","tests/data/linux-c":"50807ab8371b45bd80ca9d563de882b733b5db88cff7646e40c344e98ef755ed","tests/data/linux-c-nc":"d88eb59f749d91be3148ce39dec7c050d95feb516702ed7f9f6cec7a58b424a7","tests/data/linux-koi8":"4b7d942f03ce95d45802029db0c87879eb93be50b43026c63c18a3552dd37c93","tests/data/linux-koi8r":"7267d93deec24396a9955e95da621c054d8d677634b465d798f792141b24e1de","tests/data/linux-lat":"b72b2ec68fa445e2e0ae96cc7bb2149a1527e11ae475d1957c8a22d9ec2c0905","tests/data/linux-m":"4a92f6fef1eeb679ec4511579d3004cfe6fc1d4dd73fed5299cde568f6cf3fbf","tests/data/linux-nic":"eac886df04c80e6ba02687087ddc93635c0f433f4f28195447499a8963989f21","tests/data/linux-vt":"2ebd4c761a492190609f6d8bcdd8f9c8c81e281b0d5e8a51b87f4ba126370bb4","tests/data/linux2.2":"c3d6e1466e9fb4111f4bf243b87a3de290d85224f1a4241947a3f51bdff08b82","tests/data/linux2.6":"52c2930ab1cad8271c280fefb1f581b12b7b3be445348d047a39f5e3448b3614","tests/data/linux2.6.26":"88f5a62b78956a21015ac887c5189a9f72900a842c2f844a1a5e197151a078d2","tests/data/linux3.0":"29b2aad27b5c291adab85e4150883fa6dc0034671c67e889d722168735ba2504","tests/data/rxvt":"9411be0058e147fc7a1962cd35145446d3d439ac3be9b6ca9d3aa2aa0c28ef5e","tests/data/rxvt-16color":"d41e75a0bad0e7c6d957c727f68dc507898685f3bbd71f0721a0a4beb14daf08","tests/data/rxvt-256color":"e6415e230d7962133d1da913cfcf23a0e2d3ed75379164a921feb9462c475a8e","tests/data/rxvt-88color":"958a81509d2b1e2cfe5a7bcf7a15e81d12575e4ccaa1dd308eda8edf7905a36a","tests/data/rxvt-basic":"3989e1c659121cb8fd8f67b8bff7f304e52c1f401cd1d09e906e11a58e0bc587","tests/data/rxvt-color":"3d2b49d48aca7fad7a3bf26d06592207b3c3cbf7afc3a5223fd0613f50a2739b","tests/data/rxvt-cygwin":"d50e434af6b3ab85b26e4f6af21c9c612d271efacaff3e64ef3da8c350a91809","tests/data/rxvt-cygwin-native":"34ee4ef070d9c366f5aba8f72a29a0e45ab552ba43b3e32265dfbe9eef157994","tests/data/rxvt-xpm":"4e8e40313ef00f0572456724249a625c36f2c5338b5014b87f236e29f612212e","tests/data/screen":"57c2888ffb9d7632381dc6191657abda998ca5f0958ad5787f848ff2206198f9","tests/data/screen-256color":"13fd658c693283ffb495d7f473bf525422e312e199bff6e64abdb70db5b22f46","tests/data/xterm":"67a59e4f0807759546dbf45c0bc2dddb30944ef553990345b1d08d7d19ddc13a","tests/data/xterm-256color":"e2525d133091a1ac38b2ad4eecd8df48eee31789c8fafac0ed99bcd6b746d8ce","tests/terminfo.rs":"5338fa4feae9e0d7d2c5f6ae3e911e6b88f668a23a4313e89b329d84464ef904"},"package":"d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989"}
\ No newline at end of file
--- a/third_party/rust/term/Cargo.toml
+++ b/third_party/rust/term/Cargo.toml
@@ -1,17 +1,21 @@
 [package]
 
 name = "term"
-version = "0.4.4"
+version = "0.4.5"
 authors = ["The Rust Project Developers", "Steven Allen"]
 license = "MIT/Apache-2.0"
 readme = "README.md"
 repository = "https://github.com/Stebalien/term"
 homepage = "https://github.com/Stebalien/term"
 documentation = "https://stebalien.github.io/doc/term/term/"
 description = """
 A terminal formatting library
 """
+categories = ["command-line-interface"]
 
-[dependencies]
+[target.'cfg(windows)'.dependencies]
 winapi = "0.2"
 kernel32-sys = "0.2"
+
+[features]
+default=[]
--- a/third_party/rust/term/src/lib.rs
+++ b/third_party/rust/term/src/lib.rs
@@ -139,17 +139,17 @@ pub mod color {
     pub const BRIGHT_WHITE: Color = 15;
 }
 
 /// Terminal attributes for use with term.attr().
 ///
 /// Most attributes can only be turned on and must be turned off with term.reset().
 /// The ones that can be turned off explicitly take a boolean value.
 /// Color is also represented as an attribute for convenience.
-#[derive(Debug, PartialEq, Eq, Copy, Clone)]
+#[derive(Debug, PartialEq, Hash, Eq, Copy, Clone)]
 pub enum Attr {
     /// Bold (or possibly bright) mode
     Bold,
     /// Dim mode, also called faint or half-bright. Often not supported
     Dim,
     /// Italics mode. Often not supported
     Italic(bool),
     /// Underline mode
@@ -195,115 +195,114 @@ pub enum Error {
     /// with a semver-compliant version bump.
     __Nonexhaustive,
 }
 
 // manually implemented because std::io::Error does not implement Eq/PartialEq
 impl std::cmp::PartialEq for Error {
     fn eq(&self, other: &Error) -> bool {
         use Error::*;
-        match self {
-            &Io(_) => false,
-            &TerminfoParsing(ref inner1) => {
-                match other {
-                    &TerminfoParsing(ref inner2) => inner1 == inner2,
+        match *self {
+            Io(_) => false,
+            TerminfoParsing(ref inner1) => {
+                match *other {
+                    TerminfoParsing(ref inner2) => inner1 == inner2,
                     _ => false,
                 }
             }
-            &ParameterizedExpansion(ref inner1) => {
-                match other {
-                    &ParameterizedExpansion(ref inner2) => inner1 == inner2,
+            ParameterizedExpansion(ref inner1) => {
+                match *other {
+                    ParameterizedExpansion(ref inner2) => inner1 == inner2,
                     _ => false,
                 }
             }
-            &NotSupported => {
-                match other {
-                    &NotSupported => true,
+            NotSupported => {
+                match *other {
+                    NotSupported => true,
                     _ => false,
                 }
             }
-            &TermUnset => {
-                match other {
-                    &TermUnset => true,
+            TermUnset => {
+                match *other {
+                    TermUnset => true,
                     _ => false,
                 }
             }
-            &TerminfoEntryNotFound => {
-                match other {
-                    &TerminfoEntryNotFound => true,
+            TerminfoEntryNotFound => {
+                match *other {
+                    TerminfoEntryNotFound => true,
                     _ => false,
                 }
             }
-            &CursorDestinationInvalid => {
-                match other {
-                    &CursorDestinationInvalid => true,
+            CursorDestinationInvalid => {
+                match *other {
+                    CursorDestinationInvalid => true,
                     _ => false,
                 }
             }
-            &ColorOutOfRange => {
-                match other {
-                    &ColorOutOfRange => true,
+            ColorOutOfRange => {
+                match *other {
+                    ColorOutOfRange => true,
                     _ => false,
                 }
             }
-            &__Nonexhaustive => {
-                match other {
-                    &__Nonexhaustive => true,
+            __Nonexhaustive => {
+                match *other {
+                    __Nonexhaustive => true,
                     _ => false,
                 }
             }
         }
     }
 }
 
 /// The canonical `Result` type using this crate's Error type.
 pub type Result<T> = std::result::Result<T, Error>;
 
 impl std::fmt::Display for Error {
     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         use std::error::Error;
-        if let &::Error::Io(ref e) = self {
+        if let ::Error::Io(ref e) = *self {
             write!(f, "{}", e)
         } else {
             f.write_str(self.description())
         }
     }
 }
 
 impl std::error::Error for Error {
     fn description(&self) -> &str {
         use Error::*;
-        use std::error::Error;
-        match self {
-            &Io(ref io) => io.description(),
-            &TerminfoParsing(ref e) => e.description(),
-            &ParameterizedExpansion(ref e) => e.description(),
-            &NotSupported => "operation not supported by the terminal",
-            &TermUnset => "TERM environment variable unset, unable to detect a terminal",
-            &TerminfoEntryNotFound => "could not find a terminfo entry for this terminal",
-            &CursorDestinationInvalid => "could not move cursor to requested position",
-            &ColorOutOfRange => "color not supported by the terminal",
-            &__Nonexhaustive => "placeholder variant that shouldn't be used",
+        match *self {
+            Io(ref io) => io.description(),
+            TerminfoParsing(ref e) => e.description(),
+            ParameterizedExpansion(ref e) => e.description(),
+            NotSupported => "operation not supported by the terminal",
+            TermUnset => "TERM environment variable unset, unable to detect a terminal",
+            TerminfoEntryNotFound => "could not find a terminfo entry for this terminal",
+            CursorDestinationInvalid => "could not move cursor to requested position",
+            ColorOutOfRange => "color not supported by the terminal",
+            __Nonexhaustive => "placeholder variant that shouldn't be used",
         }
     }
 
     fn cause(&self) -> Option<&std::error::Error> {
-        match self {
-            &Error::Io(ref io) => Some(io),
-            &Error::TerminfoParsing(ref e) => Some(e),
-            &Error::ParameterizedExpansion(ref e) => Some(e),
+        match *self {
+            Error::Io(ref io) => Some(io),
+            Error::TerminfoParsing(ref e) => Some(e),
+            Error::ParameterizedExpansion(ref e) => Some(e),
             _ => None,
         }
     }
 }
 
 impl From<Error> for io::Error {
     fn from(err: Error) -> io::Error {
-        let kind = match &err {
-            &Error::Io(ref e) => e.kind(),
+        let kind = match err {
+            Error::Io(ref e) => e.kind(),
             _ => io::ErrorKind::Other,
         };
         io::Error::new(kind, err)
     }
 }
 
 impl std::convert::From<io::Error> for Error {
     fn from(val: io::Error) -> Self {
@@ -387,16 +386,16 @@ pub trait Terminal: Write {
     fn delete_line(&mut self) -> Result<()>;
 
     /// Moves the cursor to the left edge of the current line.
     ///
     /// Returns `Ok(true)` if the deletion code was printed, or `Err(e)` if there was an error.
     fn carriage_return(&mut self) -> Result<()>;
 
     /// Gets an immutable reference to the stream inside
-    fn get_ref<'a>(&'a self) -> &'a Self::Output;
+    fn get_ref(&self) -> &Self::Output;
 
     /// Gets a mutable reference to the stream inside
-    fn get_mut<'a>(&'a mut self) -> &'a mut Self::Output;
+    fn get_mut(&mut self) -> &mut Self::Output;
 
     /// Returns the contained stream, destroying the `Terminal`
     fn into_inner(self) -> Self::Output where Self: Sized;
 }
--- a/third_party/rust/term/src/terminfo/mod.rs
+++ b/third_party/rust/term/src/terminfo/mod.rs
@@ -24,66 +24,105 @@ use Terminal;
 use Result;
 use self::searcher::get_dbpath_for_term;
 use self::parser::compiled::{parse, msys_terminfo};
 use self::parm::{expand, Variables, Param};
 use self::Error::*;
 
 
 /// A parsed terminfo database entry.
-#[derive(Debug)]
+#[derive(Debug, Clone)]
 pub struct TermInfo {
     /// Names for the terminal
     pub names: Vec<String>,
     /// Map of capability name to boolean value
-    pub bools: HashMap<String, bool>,
+    pub bools: HashMap<&'static str, bool>,
     /// Map of capability name to numeric value
-    pub numbers: HashMap<String, u16>,
+    pub numbers: HashMap<&'static str, u16>,
     /// Map of capability name to raw (unexpanded) string
-    pub strings: HashMap<String, Vec<u8>>,
+    pub strings: HashMap<&'static str, Vec<u8>>,
 }
 
 impl TermInfo {
-    /// Create a TermInfo based on current environment.
+    /// Create a `TermInfo` based on current environment.
     pub fn from_env() -> Result<TermInfo> {
         let term = match env::var("TERM") {
             Ok(name) => TermInfo::from_name(&name),
             Err(..) => return Err(::Error::TermUnset),
         };
 
         if term.is_err() && env::var("MSYSCON").ok().map_or(false, |s| "mintty.exe" == s) {
             // msys terminal
             Ok(msys_terminfo())
         } else {
             term
         }
     }
 
-    /// Create a TermInfo for the named terminal.
+    /// Create a `TermInfo` for the named terminal.
     pub fn from_name(name: &str) -> Result<TermInfo> {
         get_dbpath_for_term(name)
             .ok_or_else(|| ::Error::TerminfoEntryNotFound)
             .and_then(|p| TermInfo::from_path(&p))
     }
 
-    /// Parse the given TermInfo.
+    /// Parse the given `TermInfo`.
     pub fn from_path<P: AsRef<Path>>(path: P) -> Result<TermInfo> {
         Self::_from_path(path.as_ref())
     }
     // Keep the metadata small
     // (That is, this uses a &Path so that this function need not be instantiated
     // for every type
     // which implements AsRef<Path>. One day, if/when rustc is a bit smarter, it
     // might do this for
     // us. Alas. )
     fn _from_path(path: &Path) -> Result<TermInfo> {
-        let file = try!(File::open(path).map_err(|e| ::Error::Io(e)));
+        let file = try!(File::open(path).map_err(::Error::Io));
         let mut reader = BufReader::new(file);
         parse(&mut reader, false)
     }
+
+    /// Retrieve a capability `cmd` and expand it with `params`, writing result to `out`.
+    pub fn apply_cap(&self, cmd: &str, params: &[Param], out: &mut io::Write) -> Result<()> {
+        match self.strings.get(cmd) {
+            Some(cmd) => {
+                match expand(cmd, params, &mut Variables::new()) {
+                    Ok(s) => {
+                        try!(out.write_all(&s));
+                        Ok(())
+                    }
+                    Err(e) => Err(e.into()),
+                }
+            }
+            None => Err(::Error::NotSupported),
+        }
+    }
+
+    /// Write the reset string to `out`.
+    pub fn reset(&self, out: &mut io::Write) -> Result<()> {
+        // are there any terminals that have color/attrs and not sgr0?
+        // Try falling back to sgr, then op
+        let cmd = match [("sgr0", &[] as &[Param]), ("sgr", &[Param::Number(0)]), ("op", &[])]
+                            .iter()
+                            .filter_map(|&(cap, params)| {
+                                self.strings.get(cap).map(|c| (c, params))
+                            })
+                            .next() {
+            Some((op, params)) => {
+                match expand(op, params, &mut Variables::new()) {
+                    Ok(cmd) => cmd,
+                    Err(e) => return Err(e.into()),
+                }
+            }
+            None => return Err(::Error::NotSupported),
+        };
+        try!(out.write_all(&cmd));
+        Ok(())
+    }
+
 }
 
 #[derive(Debug, Eq, PartialEq)]
 /// An error from parsing a terminfo entry
 pub enum Error {
     /// The "magic" number at the start of the file was wrong.
     ///
     /// It should be `0x11A`
@@ -108,56 +147,56 @@ pub enum Error {
     NamesMissingNull,
     /// The strings table was missing a trailing null terminator.
     StringsMissingNull,
 }
 
 impl ::std::fmt::Display for Error {
     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         use std::error::Error;
-        match self {
-            &NotUtf8(e) => write!(f, "{}", e),
-            &BadMagic(v) => write!(f, "bad magic number {:x} in terminfo header", v),
+        match *self {
+            NotUtf8(e) => write!(f, "{}", e),
+            BadMagic(v) => write!(f, "bad magic number {:x} in terminfo header", v),
             _ => f.write_str(self.description()),
         }
     }
 }
 
 impl ::std::convert::From<::std::string::FromUtf8Error> for Error {
     fn from(v: ::std::string::FromUtf8Error) -> Self {
         NotUtf8(v.utf8_error())
     }
 }
 
 impl ::std::error::Error for Error {
     fn description(&self) -> &str {
-        match self {
-            &BadMagic(..) => "incorrect magic number at start of file",
-            &ShortNames => "no names exposed, need at least one",
-            &TooManyBools => "more boolean properties than libterm knows about",
-            &TooManyNumbers => "more number properties than libterm knows about",
-            &TooManyStrings => "more string properties than libterm knows about",
-            &InvalidLength => "invalid length field value, must be >= -1",
-            &NotUtf8(ref e) => e.description(),
-            &NamesMissingNull => "names table missing NUL terminator",
-            &StringsMissingNull => "string table missing NUL terminator",
+        match *self {
+            BadMagic(..) => "incorrect magic number at start of file",
+            ShortNames => "no names exposed, need at least one",
+            TooManyBools => "more boolean properties than libterm knows about",
+            TooManyNumbers => "more number properties than libterm knows about",
+            TooManyStrings => "more string properties than libterm knows about",
+            InvalidLength => "invalid length field value, must be >= -1",
+            NotUtf8(ref e) => e.description(),
+            NamesMissingNull => "names table missing NUL terminator",
+            StringsMissingNull => "string table missing NUL terminator",
         }
     }
 
     fn cause(&self) -> Option<&::std::error::Error> {
-        match self {
-            &NotUtf8(ref e) => Some(e),
+        match *self {
+            NotUtf8(ref e) => Some(e),
             _ => None,
         }
     }
 }
 
 pub mod searcher;
 
-/// TermInfo format parsing.
+/// `TermInfo` format parsing.
 pub mod parser {
     //! ncurses-compatible compiled terminfo format parsing (term(5))
     pub mod compiled;
     mod names;
 }
 pub mod parm;
 
 
@@ -176,115 +215,99 @@ fn cap_for_attr(attr: Attr) -> &'static 
         Attr::Secure => "invis",
         Attr::ForegroundColor(_) => "setaf",
         Attr::BackgroundColor(_) => "setab",
     }
 }
 
 /// A Terminal that knows how many colors it supports, with a reference to its
 /// parsed Terminfo database record.
+#[derive(Clone, Debug)]
 pub struct TerminfoTerminal<T> {
     num_colors: u16,
     out: T,
     ti: TermInfo,
 }
 
-impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
+impl<T: Write> Terminal for TerminfoTerminal<T> {
     type Output = T;
     fn fg(&mut self, color: color::Color) -> Result<()> {
         let color = self.dim_if_necessary(color);
         if self.num_colors > color {
-            return self.apply_cap("setaf", &[Param::Number(color as i32)]);
+            return self.ti.apply_cap("setaf", &[Param::Number(color as i32)], &mut self.out);
         }
         Err(::Error::ColorOutOfRange)
     }
 
     fn bg(&mut self, color: color::Color) -> Result<()> {
         let color = self.dim_if_necessary(color);
         if self.num_colors > color {
-            return self.apply_cap("setab", &[Param::Number(color as i32)]);
+            return self.ti.apply_cap("setab", &[Param::Number(color as i32)], &mut self.out);
         }
         Err(::Error::ColorOutOfRange)
     }
 
     fn attr(&mut self, attr: Attr) -> Result<()> {
         match attr {
             Attr::ForegroundColor(c) => self.fg(c),
             Attr::BackgroundColor(c) => self.bg(c),
-            _ => self.apply_cap(cap_for_attr(attr), &[]),
+            _ => self.ti.apply_cap(cap_for_attr(attr), &[], &mut self.out),
         }
     }
 
     fn supports_attr(&self, attr: Attr) -> bool {
         match attr {
             Attr::ForegroundColor(_) | Attr::BackgroundColor(_) => self.num_colors > 0,
             _ => {
                 let cap = cap_for_attr(attr);
                 self.ti.strings.get(cap).is_some()
             }
         }
     }
 
     fn reset(&mut self) -> Result<()> {
-        // are there any terminals that have color/attrs and not sgr0?
-        // Try falling back to sgr, then op
-        let cmd = match [("sgr0", &[] as &[Param]),
-                         ("sgr", &[Param::Number(0)]),
-                         ("op", &[])]
-                            .iter()
-                            .filter_map(|&(cap, params)| self.ti.strings.get(cap).map(|c| (c, params)))
-                            .next() {
-            Some((op, params)) => {
-                match expand(op, params, &mut Variables::new()) {
-                    Ok(cmd) => cmd,
-                    Err(e) => return Err(e.into()),
-                }
-            }
-            None => return Err(::Error::NotSupported),
-        };
-        try!(self.out.write_all(&cmd));
-        Ok(())
+        self.ti.reset(&mut self.out)
     }
 
     fn supports_reset(&self) -> bool {
         ["sgr0", "sgr", "op"].iter().any(|&cap| self.ti.strings.get(cap).is_some())
     }
 
     fn supports_color(&self) -> bool {
         self.num_colors > 0 && self.supports_reset()
     }
 
     fn cursor_up(&mut self) -> Result<()> {
-        self.apply_cap("cuu1", &[])
+        self.ti.apply_cap("cuu1", &[], &mut self.out)
     }
 
     fn delete_line(&mut self) -> Result<()> {
-        self.apply_cap("dl", &[])
+        self.ti.apply_cap("el", &[], &mut self.out)
     }
 
     fn carriage_return(&mut self) -> Result<()> {
-        self.apply_cap("cr", &[])
+        self.ti.apply_cap("cr", &[], &mut self.out)
     }
 
-    fn get_ref<'a>(&'a self) -> &'a T {
+    fn get_ref(&self) -> &T {
         &self.out
     }
 
-    fn get_mut<'a>(&'a mut self) -> &'a mut T {
+    fn get_mut(&mut self) -> &mut T {
         &mut self.out
     }
 
     fn into_inner(self) -> T
         where Self: Sized
     {
         self.out
     }
 }
 
-impl<T: Write + Send> TerminfoTerminal<T> {
+impl<T: Write> TerminfoTerminal<T> {
     /// Create a new TerminfoTerminal with the given TermInfo and Write.
     pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T> {
         let nc = if terminfo.strings.contains_key("setaf") &&
                     terminfo.strings.contains_key("setab") {
             terminfo.numbers.get("colors").map_or(0, |&n| n)
         } else {
             0
         };
@@ -305,31 +328,16 @@ impl<T: Write + Send> TerminfoTerminal<T
 
     fn dim_if_necessary(&self, color: color::Color) -> color::Color {
         if color >= self.num_colors && color >= 8 && color < 16 {
             color - 8
         } else {
             color
         }
     }
-
-    fn apply_cap(&mut self, cmd: &str, params: &[Param]) -> Result<()> {
-        match self.ti.strings.get(cmd) {
-            Some(cmd) => {
-                match expand(&cmd, params, &mut Variables::new()) {
-                    Ok(s) => {
-                        try!(self.out.write_all(&s));
-                        Ok(())
-                    }
-                    Err(e) => Err(e.into()),
-                }
-            }
-            None => Err(::Error::NotSupported),
-        }
-    }
 }
 
 
 impl<T: Write> Write for TerminfoTerminal<T> {
     fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
         self.out.write(buf)
     }
 
--- a/third_party/rust/term/src/terminfo/parm.rs
+++ b/third_party/rust/term/src/terminfo/parm.rs
@@ -7,18 +7,16 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
 //! Parameterized string expansion
 
 use self::Param::*;
 use self::States::*;
-use self::FormatState::*;
-use self::FormatOp::*;
 
 use std::iter::repeat;
 
 #[derive(Clone, Copy, PartialEq)]
 enum States {
     Nothing,
     Percent,
     SetVar,
@@ -31,27 +29,33 @@ enum States {
     SeekIfElse(usize),
     SeekIfElsePercent(usize),
     SeekIfEnd(usize),
     SeekIfEndPercent(usize),
 }
 
 #[derive(Copy, PartialEq, Clone)]
 enum FormatState {
-    FormatStateFlags,
-    FormatStateWidth,
-    FormatStatePrecision,
+    Flags,
+    Width,
+    Precision,
 }
 
 /// Types of parameters a capability can use
 #[allow(missing_docs)]
 #[derive(Clone)]
 pub enum Param {
+    Number(i32),
     Words(String),
-    Number(i32),
+}
+
+impl Default for Param {
+    fn default() -> Self {
+        Param::Number(0)
+    }
 }
 
 /// An error from interpreting a parameterized string.
 #[derive(Debug, Eq, PartialEq)]
 pub enum Error {
     /// Data was requested from the stack, but the stack didn't have enough elements.
     StackUnderflow,
     /// The type of the element(s) on top of the stack did not match the type that the operator
@@ -80,56 +84,48 @@ impl ::std::fmt::Display for Error {
         use std::error::Error;
         f.write_str(self.description())
     }
 }
 
 impl ::std::error::Error for Error {
     fn description(&self) -> &str {
         use self::Error::*;
-        match self {
-            &StackUnderflow => "not enough elements on the stack",
-            &TypeMismatch => "type mismatch",
-            &UnrecognizedFormatOption(_) => "unrecognized format option",
-            &InvalidVariableName(_) => "invalid variable name",
-            &InvalidParameterIndex(_) => "invalid parameter index",
-            &MalformedCharacterConstant => "malformed character constant",
-            &IntegerConstantOverflow => "integer constant computation overflowed",
-            &MalformedIntegerConstant => "malformed integer constant",
-            &FormatWidthOverflow => "format width constant computation overflowed",
-            &FormatPrecisionOverflow => "format precision constant computation overflowed",
+        match *self {
+            StackUnderflow => "not enough elements on the stack",
+            TypeMismatch => "type mismatch",
+            UnrecognizedFormatOption(_) => "unrecognized format option",
+            InvalidVariableName(_) => "invalid variable name",
+            InvalidParameterIndex(_) => "invalid parameter index",
+            MalformedCharacterConstant => "malformed character constant",
+            IntegerConstantOverflow => "integer constant computation overflowed",
+            MalformedIntegerConstant => "malformed integer constant",
+            FormatWidthOverflow => "format width constant computation overflowed",
+            FormatPrecisionOverflow => "format precision constant computation overflowed",
         }
     }
 
     fn cause(&self) -> Option<&::std::error::Error> {
         None
     }
 }
 
 /// Container for static and dynamic variable arrays
+#[derive(Default)]
 pub struct Variables {
     /// Static variables A-Z
     sta: [Param; 26],
     /// Dynamic variables a-z
     dyn: [Param; 26],
 }
 
 impl Variables {
     /// Return a new zero-initialized Variables
     pub fn new() -> Variables {
-        Variables {
-            sta: [Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0)],
-            dyn: [Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
-                  Number(0), Number(0), Number(0), Number(0), Number(0)],
-        }
+        Default::default()
     }
 }
 
 /// Expand a parameterized capability
 ///
 /// # Arguments
 /// * `cap`    - string to expand
 /// * `params` - vector of params for %p1 etc
@@ -252,52 +248,51 @@ pub fn expand(cap: &[u8], params: &[Para
                             }
                             (_, _) => return Err(Error::TypeMismatch),
                         }
                     }
 
                     // printf-style support for %doxXs
                     'd' | 'o' | 'x' | 'X' | 's' => {
                         if let Some(arg) = stack.pop() {
-                            let flags = Flags::new();
+                            let flags = Flags::default();
                             let res = try!(format(arg, FormatOp::from_char(cur), flags));
-                            output.extend(res.iter().map(|x| *x));
+                            output.extend(res);
                         } else {
                             return Err(Error::StackUnderflow);
                         }
                     }
                     ':' | '#' | ' ' | '.' | '0'...'9' => {
-                        let mut flags = Flags::new();
-                        let mut fstate = FormatStateFlags;
+                        let mut flags = Flags::default();
+                        let mut fstate = FormatState::Flags;
                         match cur {
                             ':' => (),
                             '#' => flags.alternate = true,
                             ' ' => flags.space = true,
-                            '.' => fstate = FormatStatePrecision,
+                            '.' => fstate = FormatState::Precision,
                             '0'...'9' => {
                                 flags.width = cur as usize - '0' as usize;
-                                fstate = FormatStateWidth;
+                                fstate = FormatState::Width;
                             }
                             _ => unreachable!("logic error"),
                         }
                         state = FormatPattern(flags, fstate);
                     }
 
                     // conditionals
-                    '?' => (),
+                    '?'|';' => (),
                     't' => {
                         match stack.pop() {
                             Some(Number(0)) => state = SeekIfElse(0),
                             Some(Number(_)) => (),
                             Some(_) => return Err(Error::TypeMismatch),
                             None => return Err(Error::StackUnderflow),
                         }
                     }
                     'e' => state = SeekIfEnd(0),
-                    ';' => (),
                     c => return Err(Error::UnrecognizedFormatOption(c)),
                 }
             }
             PushParam => {
                 // params are 1-indexed
                 stack.push(mparams[match cur.to_digit(10) {
                                Some(d) => d as usize - 1,
                                None => return Err(Error::InvalidParameterIndex(cur)),
@@ -360,54 +355,51 @@ pub fn expand(cap: &[u8], params: &[Para
                 }
             }
             FormatPattern(ref mut flags, ref mut fstate) => {
                 old_state = Nothing;
                 match (*fstate, cur) {
                     (_, 'd') | (_, 'o') | (_, 'x') | (_, 'X') | (_, 's') => {
                         if let Some(arg) = stack.pop() {
                             let res = try!(format(arg, FormatOp::from_char(cur), *flags));
-                            output.extend(res.iter().map(|x| *x));
+                            output.extend(res);
                             // will cause state to go to Nothing
                             old_state = FormatPattern(*flags, *fstate);
                         } else {
                             return Err(Error::StackUnderflow);
                         }
                     }
-                    (FormatStateFlags, '#') => {
+                    (FormatState::Flags, '#') => {
                         flags.alternate = true;
                     }
-                    (FormatStateFlags, '-') => {
+                    (FormatState::Flags, '-') => {
                         flags.left = true;
                     }
-                    (FormatStateFlags, '+') => {
+                    (FormatState::Flags, '+') => {
                         flags.sign = true;
                     }
-                    (FormatStateFlags, ' ') => {
+                    (FormatState::Flags, ' ') => {
                         flags.space = true;
                     }
-                    (FormatStateFlags, '0'...'9') => {
+                    (FormatState::Flags, '0'...'9') => {
                         flags.width = cur as usize - '0' as usize;
-                        *fstate = FormatStateWidth;
+                        *fstate = FormatState::Width;
                     }
-                    (FormatStateFlags, '.') => {
-                        *fstate = FormatStatePrecision;
-                    }
-                    (FormatStateWidth, '0'...'9') => {
+                    (FormatState::Width, '0'...'9') => {
                         flags.width = match flags.width.checked_mul(10).and_then(|w| {
                             w.checked_add(cur as usize - '0' as usize)
                         }) {
                             Some(width) => width,
                             None => return Err(Error::FormatWidthOverflow),
                         }
                     }
-                    (FormatStateWidth, '.') => {
-                        *fstate = FormatStatePrecision;
+                    (FormatState::Width, '.')|(FormatState::Flags, '.') => {
+                        *fstate = FormatState::Precision;
                     }
-                    (FormatStatePrecision, '0'...'9') => {
+                    (FormatState::Precision, '0'...'9') => {
                         flags.precision = match flags.precision.checked_mul(10).and_then(|w| {
                             w.checked_add(cur as usize - '0' as usize)
                         }) {
                             Some(precision) => precision,
                             None => return Err(Error::FormatPrecisionOverflow),
                         }
                     }
                     _ => return Err(Error::UnrecognizedFormatOption(cur)),
@@ -456,106 +448,95 @@ pub fn expand(cap: &[u8], params: &[Para
         }
         if state == old_state {
             state = Nothing;
         }
     }
     Ok(output)
 }
 
-#[derive(Copy, PartialEq, Clone)]
+#[derive(Copy, PartialEq, Clone, Default)]
 struct Flags {
     width: usize,
     precision: usize,
     alternate: bool,
     left: bool,
     sign: bool,
     space: bool,
 }
 
-impl Flags {
-    fn new() -> Flags {
-        Flags {
-            width: 0,
-            precision: 0,
-            alternate: false,
-            left: false,
-            sign: false,
-            space: false,
-        }
-    }
-}
-
 #[derive(Copy, Clone)]
 enum FormatOp {
-    FormatDigit,
-    FormatOctal,
-    FormatHex,
-    FormatHEX,
-    FormatString,
+    Digit,
+    Octal,
+    Hex,
+    HEX,
+    String,
 }
 
 impl FormatOp {
     fn from_char(c: char) -> FormatOp {
+        use self::FormatOp::*;
         match c {
-            'd' => FormatDigit,
-            'o' => FormatOctal,
-            'x' => FormatHex,
-            'X' => FormatHEX,
-            's' => FormatString,
+            'd' => Digit,
+            'o' => Octal,
+            'x' => Hex,
+            'X' => HEX,
+            's' => String,
             _ => panic!("bad FormatOp char"),
         }
     }
 }
 
 fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8>, Error> {
+    use self::FormatOp::*;
     let mut s = match val {
         Number(d) => {
             match op {
-                FormatDigit => {
+                Digit => {
                     if flags.sign {
                         format!("{:+01$}", d, flags.precision)
                     } else if d < 0 {
                         // C doesn't take sign into account in precision calculation.
                         format!("{:01$}", d, flags.precision + 1)
                     } else if flags.space {
                         format!(" {:01$}", d, flags.precision)
                     } else {
                         format!("{:01$}", d, flags.precision)
                     }
                 }
-                FormatOctal => {
+                Octal => {
                     if flags.alternate {
                         // Leading octal zero counts against precision.
                         format!("0{:01$o}", d, flags.precision.saturating_sub(1))
                     } else {
                         format!("{:01$o}", d, flags.precision)
                     }
                 }
-                FormatHex => {
+                Hex => {
                     if flags.alternate && d != 0 {
                         format!("0x{:01$x}", d, flags.precision)
                     } else {
                         format!("{:01$x}", d, flags.precision)
                     }
                 }
-                FormatHEX => {
+                HEX => {
                     if flags.alternate && d != 0 {
                         format!("0X{:01$X}", d, flags.precision)
                     } else {
                         format!("{:01$X}", d, flags.precision)
                     }
                 }
-                FormatString => return Err(Error::TypeMismatch),
+                String => return Err(Error::TypeMismatch),
             }
             .into_bytes()
         }
         Words(s) => {
             match op {
-                FormatString => {
+                String => {
                     let mut s = s.into_bytes();
                     if flags.precision > 0 && flags.precision < s.len() {
                         s.truncate(flags.precision);
                     }
                     s
                 }
                 _ => return Err(Error::TypeMismatch),
             }
@@ -610,39 +591,39 @@ mod test {
         let mut varstruct = Variables::new();
         let vars = &mut varstruct;
         fn get_res(fmt: &str,
                    cap: &str,
                    params: &[Param],
                    vars: &mut Variables)
                    -> Result<Vec<u8>, super::Error> {
             let mut u8v: Vec<_> = fmt.bytes().collect();
-            u8v.extend(cap.as_bytes().iter().map(|&b| b));
+            u8v.extend(cap.as_bytes().iter().cloned());
             expand(&u8v, params, vars)
         }
 
         let caps = ["%d", "%c", "%s", "%Pa", "%l", "%!", "%~"];
-        for &cap in caps.iter() {
+        for &cap in &caps {
             let res = get_res("", cap, &[], vars);
             assert!(res.is_err(),
                     "Op {} succeeded incorrectly with 0 stack entries",
                     cap);
             let p = if cap == "%s" || cap == "%l" {
-                Words("foo".to_string())
+                Words("foo".to_owned())
             } else {
                 Number(97)
             };
             let res = get_res("%p1", cap, &[p], vars);
             assert!(res.is_ok(),
                     "Op {} failed with 1 stack entry: {}",
                     cap,
                     res.err().unwrap());
         }
         let caps = ["%+", "%-", "%*", "%/", "%m", "%&", "%|", "%A", "%O"];
-        for &cap in caps.iter() {
+        for &cap in &caps {
             let res = expand(cap.as_bytes(), &[], vars);
             assert!(res.is_err(),
                     "Binop {} succeeded incorrectly with 0 stack entries",
                     cap);
             let res = get_res("%{1}", cap, &[], vars);
             assert!(res.is_err(),
                     "Binop {} succeeded incorrectly with 1 stack entry",
                     cap);
@@ -657,17 +638,17 @@ mod test {
     #[test]
     fn test_push_bad_param() {
         assert!(expand(b"%pa", &[], &mut Variables::new()).is_err());
     }
 
     #[test]
     fn test_comparison_ops() {
         let v = [('<', [1u8, 0u8, 0u8]), ('=', [0u8, 1u8, 0u8]), ('>', [0u8, 0u8, 1u8])];
-        for &(op, bs) in v.iter() {
+        for &(op, bs) in &v {
             let s = format!("%{{1}}%{{2}}%{}%d", op);
             let res = expand(s.as_bytes(), &[], &mut Variables::new());
             assert!(res.is_ok(), res.err().unwrap());
             assert_eq!(res.unwrap(), vec![b'0' + bs[0]]);
             let s = format!("%{{1}}%{{1}}%{}%d", op);
             let res = expand(s.as_bytes(), &[], &mut Variables::new());
             assert!(res.is_ok(), res.err().unwrap());
             assert_eq!(res.unwrap(), vec![b'0' + bs[1]]);
@@ -693,23 +674,23 @@ mod test {
         assert_eq!(res.unwrap(), "\\E[38;5;42m".bytes().collect::<Vec<_>>());
     }
 
     #[test]
     fn test_format() {
         let mut varstruct = Variables::new();
         let vars = &mut varstruct;
         assert_eq!(expand(b"%p1%s%p2%2s%p3%2s%p4%.2s",
-                          &[Words("foo".to_string()),
-                            Words("foo".to_string()),
-                            Words("f".to_string()),
-                            Words("foo".to_string())],
+                          &[Words("foo".to_owned()),
+                            Words("foo".to_owned()),
+                            Words("f".to_owned()),
+                            Words("foo".to_owned())],
                           vars),
                    Ok("foofoo ffo".bytes().collect::<Vec<_>>()));
-        assert_eq!(expand(b"%p1%:-4.2s", &[Words("foo".to_string())], vars),
+        assert_eq!(expand(b"%p1%:-4.2s", &[Words("foo".to_owned())], vars),
                    Ok("fo  ".bytes().collect::<Vec<_>>()));
 
         assert_eq!(expand(b"%p1%d%p1%.3d%p1%5d%p1%:+d", &[Number(1)], vars),
                    Ok("1001    1+1".bytes().collect::<Vec<_>>()));
         assert_eq!(expand(b"%p1%o%p1%#o%p2%6.4x%p2%#6.4X",
                           &[Number(15), Number(27)],
                           vars),
                    Ok("17017  001b0X001B".bytes().collect::<Vec<_>>()));
--- a/third_party/rust/term/src/terminfo/parser/compiled.rs
+++ b/third_party/rust/term/src/terminfo/parser/compiled.rs
@@ -97,44 +97,44 @@ pub fn parse(file: &mut io::Read, longna
     let mut bytes = Vec::new();
     try!(file.take((names_bytes - 1) as u64).read_to_end(&mut bytes));
     let names_str = match String::from_utf8(bytes) {
         Ok(s) => s,
         Err(e) => return Err(NotUtf8(e.utf8_error()).into()),
     };
 
     let term_names: Vec<String> = names_str.split('|')
-                                           .map(|s| s.to_string())
+                                           .map(|s| s.to_owned())
                                            .collect();
     // consume NUL
     if try!(read_byte(file)) != b'\0' {
         return Err(NamesMissingNull.into());
     }
 
-    let bools_map: HashMap<String, bool> = try! {
+    let bools_map: HashMap<&str, bool> = try! {
         (0..bools_bytes).filter_map(|i| match read_byte(file) {
             Err(e) => Some(Err(e)),
-            Ok(1) => Some(Ok((bnames[i].to_string(), true))),
+            Ok(1) => Some(Ok((bnames[i], true))),
             Ok(_) => None
         }).collect()
     };
 
     if (bools_bytes + names_bytes) % 2 == 1 {
         try!(read_byte(file)); // compensate for padding
     }
 
-    let numbers_map: HashMap<String, u16> = try! {
+    let numbers_map: HashMap<&str, u16> = try! {
         (0..numbers_count).filter_map(|i| match read_le_u16(file) {
             Ok(0xFFFF) => None,
-            Ok(n) => Some(Ok((nnames[i].to_string(), n))),
+            Ok(n) => Some(Ok((nnames[i], n))),
             Err(e) => Some(Err(e))
         }).collect()
     };
 
-    let string_map: HashMap<String, Vec<u8>> = if string_offsets_count > 0 {
+    let string_map: HashMap<&str, Vec<u8>> = if string_offsets_count > 0 {
         let string_offsets: Vec<u16> = try!((0..string_offsets_count)
                                                 .map(|_| read_le_u16(file))
                                                 .collect());
 
         let mut string_table = Vec::new();
         try!(file.take(string_table_bytes as u64).read_to_end(&mut string_table));
 
         try!(string_offsets.into_iter()
@@ -151,26 +151,26 @@ pub fn parse(file: &mut io::Read, longna
                                } else {
                                    snames[i]
                                };
 
                                if offset == 0xFFFE {
                                    // undocumented: FFFE indicates cap@, which means the capability
                                    // is not present
                                    // unsure if the handling for this is correct
-                                   return Ok((name.to_string(), Vec::new()));
+                                   return Ok((name, Vec::new()));
                                }
 
                                // Find the offset of the NUL we want to go to
                                let nulpos = string_table[offset..string_table_bytes]
                                                 .iter()
                                                 .position(|&b| b == 0);
                                match nulpos {
                                    Some(len) => {
-                                       Ok((name.to_string(),
+                                       Ok((name,
                                            string_table[offset..offset + len].to_vec()))
                                    }
                                    None => return Err(::Error::TerminfoParsing(StringsMissingNull)),
                                }
                            })
                            .collect())
     } else {
         HashMap::new()
@@ -180,29 +180,29 @@ pub fn parse(file: &mut io::Read, longna
     Ok(TermInfo {
         names: term_names,
         bools: bools_map,
         numbers: numbers_map,
         strings: string_map,
     })
 }
 
-/// Create a dummy TermInfo struct for msys terminals
+/// Create a dummy `TermInfo` struct for msys terminals
 pub fn msys_terminfo() -> TermInfo {
     let mut strings = HashMap::new();
-    strings.insert("sgr0".to_string(), b"\x1B[0m".to_vec());
-    strings.insert("bold".to_string(), b"\x1B[1m".to_vec());
-    strings.insert("setaf".to_string(), b"\x1B[3%p1%dm".to_vec());
-    strings.insert("setab".to_string(), b"\x1B[4%p1%dm".to_vec());
+    strings.insert("sgr0", b"\x1B[0m".to_vec());
+    strings.insert("bold", b"\x1B[1m".to_vec());
+    strings.insert("setaf", b"\x1B[3%p1%dm".to_vec());
+    strings.insert("setab", b"\x1B[4%p1%dm".to_vec());
 
     let mut numbers = HashMap::new();
-    numbers.insert("colors".to_string(), 8u16);
+    numbers.insert("colors", 8u16);
 
     TermInfo {
-        names: vec!["cygwin".to_string()], // msys is a fork of an older cygwin version
+        names: vec!["cygwin".to_owned()], // msys is a fork of an older cygwin version
         bools: HashMap::new(),
         numbers: numbers,
         strings: strings,
     }
 }
 
 #[cfg(test)]
 mod test {
--- a/third_party/rust/term/src/terminfo/parser/names.rs
+++ b/third_party/rust/term/src/terminfo/parser/names.rs
@@ -1,154 +1,553 @@
 #![allow(non_upper_case_globals, missing_docs)]
 #![cfg_attr(rustfmt, rustfmt_skip)]
 
-pub static boolfnames: &'static [&'static str] = &[
-    "auto_left_margin", "auto_right_margin", "no_esc_ctlc", "ceol_standout_glitch",
-    "eat_newline_glitch", "erase_overstrike", "generic_type", "hard_copy", "has_meta_key",
-    "has_status_line", "insert_null_glitch", "memory_above", "memory_below", "move_insert_mode",
-    "move_standout_mode", "over_strike", "status_line_esc_ok", "dest_tabs_magic_smso",
-    "tilde_glitch", "transparent_underline", "xon_xoff", "needs_xon_xoff", "prtr_silent",
-    "hard_cursor", "non_rev_rmcup", "no_pad_char", "non_dest_scroll_region", "can_change",
-    "back_color_erase", "hue_lightness_saturation", "col_addr_glitch", "cr_cancels_micro_mode",
-    "has_print_wheel", "row_addr_glitch", "semi_auto_right_margin", "cpi_changes_res",
-    "lpi_changes_res", "backspaces_with_bs", "crt_no_scrolling", "no_correctly_working_cr",
-    "gnu_has_meta_key", "linefeed_is_newline", "has_hardware_tabs", "return_does_clr_eol"
-];
+pub static boolfnames: &'static [&'static str] = &["auto_left_margin",
+                                                   "auto_right_margin",
+                                                   "no_esc_ctlc",
+                                                   "ceol_standout_glitch",
+                                                   "eat_newline_glitch",
+                                                   "erase_overstrike",
+                                                   "generic_type",
+                                                   "hard_copy",
+                                                   "has_meta_key",
+                                                   "has_status_line",
+                                                   "insert_null_glitch",
+                                                   "memory_above",
+                                                   "memory_below",
+                                                   "move_insert_mode",
+                                                   "move_standout_mode",
+                                                   "over_strike",
+                                                   "status_line_esc_ok",
+                                                   "dest_tabs_magic_smso",
+                                                   "tilde_glitch",
+                                                   "transparent_underline",
+                                                   "xon_xoff",
+                                                   "needs_xon_xoff",
+                                                   "prtr_silent",
+                                                   "hard_cursor",
+                                                   "non_rev_rmcup",
+                                                   "no_pad_char",
+                                                   "non_dest_scroll_region",
+                                                   "can_change",
+                                                   "back_color_erase",
+                                                   "hue_lightness_saturation",
+                                                   "col_addr_glitch",
+                                                   "cr_cancels_micro_mode",
+                                                   "has_print_wheel",
+                                                   "row_addr_glitch",
+                                                   "semi_auto_right_margin",
+                                                   "cpi_changes_res",
+                                                   "lpi_changes_res",
+                                                   "backspaces_with_bs",
+                                                   "crt_no_scrolling",
+                                                   "no_correctly_working_cr",
+                                                   "gnu_has_meta_key",
+                                                   "linefeed_is_newline",
+                                                   "has_hardware_tabs",
+                                                   "return_does_clr_eol"];
 
-pub static boolnames: &'static [&'static str] = &[
-    "bw", "am", "xsb", "xhp", "xenl", "eo", "gn",
-    "hc", "km", "hs", "in", "db", "da", "mir",
-    "msgr", "os", "eslok", "xt", "hz", "ul", "xon",
-    "nxon", "mc5i", "chts", "nrrmc", "npc", "ndscr",
-    "ccc", "bce", "hls", "xhpa", "crxm", "daisy",
-    "xvpa", "sam", "cpix", "lpix", "OTbs", "OTns",
-    "OTnc", "OTMT", "OTNL", "OTpt", "OTxr"
-];
+pub static boolnames: &'static [&'static str] =
+    &["bw", "am", "xsb", "xhp", "xenl", "eo", "gn", "hc", "km", "hs", "in", "db", "da", "mir",
+      "msgr", "os", "eslok", "xt", "hz", "ul", "xon", "nxon", "mc5i", "chts", "nrrmc", "npc",
+      "ndscr", "ccc", "bce", "hls", "xhpa", "crxm", "daisy", "xvpa", "sam", "cpix", "lpix",
+      "OTbs", "OTns", "OTnc", "OTMT", "OTNL", "OTpt", "OTxr"];
 
-pub static numfnames: &'static [&'static str] = &[
-    "columns", "init_tabs", "lines", "lines_of_memory", "magic_cookie_glitch", "padding_baud_rate",
-    "virtual_terminal", "width_status_line", "num_labels", "label_height", "label_width",
-    "max_attributes", "maximum_windows", "max_colors", "max_pairs", "no_color_video",
-    "buffer_capacity", "dot_vert_spacing", "dot_horz_spacing", "max_micro_address",
-    "max_micro_jump", "micro_col_size", "micro_line_size", "number_of_pins", "output_res_char",
-    "output_res_line", "output_res_horz_inch", "output_res_vert_inch", "print_rate",
-    "wide_char_size", "buttons", "bit_image_entwining", "bit_image_type", "magic_cookie_glitch_ul",
-    "carriage_return_delay", "new_line_delay", "backspace_delay", "horizontal_tab_delay",
-    "number_of_function_keys"
-];
+pub static numfnames: &'static [&'static str] = &["columns",
+                                                  "init_tabs",
+                                                  "lines",
+                                                  "lines_of_memory",
+                                                  "magic_cookie_glitch",
+                                                  "padding_baud_rate",
+                                                  "virtual_terminal",
+                                                  "width_status_line",
+                                                  "num_labels",
+                                                  "label_height",
+                                                  "label_width",
+                                                  "max_attributes",
+                                                  "maximum_windows",
+                                                  "max_colors",
+                                                  "max_pairs",
+                                                  "no_color_video",
+                                                  "buffer_capacity",
+                                                  "dot_vert_spacing",
+                                                  "dot_horz_spacing",
+                                                  "max_micro_address",
+                                                  "max_micro_jump",
+                                                  "micro_col_size",
+                                                  "micro_line_size",
+                                                  "number_of_pins",
+                                                  "output_res_char",
+                                                  "output_res_line",
+                                                  "output_res_horz_inch",
+                                                  "output_res_vert_inch",
+                                                  "print_rate",
+                                                  "wide_char_size",
+                                                  "buttons",
+                                                  "bit_image_entwining",
+                                                  "bit_image_type",
+                                                  "magic_cookie_glitch_ul",
+                                                  "carriage_return_delay",
+                                                  "new_line_delay",
+                                                  "backspace_delay",
+                                                  "horizontal_tab_delay",
+                                                  "number_of_function_keys"];
 
-pub static numnames: &'static [&'static str] = &[
-    "cols", "it", "lines", "lm", "xmc", "pb", "vt", "wsl", "nlab", "lh", "lw", "ma", "wnum",
-    "colors", "pairs", "ncv", "bufsz", "spinv", "spinh", "maddr", "mjump", "mcs", "mls", "npins",
-    "orc", "orl", "orhi", "orvi", "cps", "widcs", "btns", "bitwin", "bitype", "UTug", "OTdC",
-    "OTdN", "OTdB", "OTdT", "OTkn"
-];
+pub static numnames: &'static [&'static str] =
+    &["cols", "it", "lines", "lm", "xmc", "pb", "vt", "wsl", "nlab", "lh", "lw", "ma", "wnum",
+      "colors", "pairs", "ncv", "bufsz", "spinv", "spinh", "maddr", "mjump", "mcs", "mls",
+      "npins", "orc", "orl", "orhi", "orvi", "cps", "widcs", "btns", "bitwin", "bitype", "UTug",
+      "OTdC", "OTdN", "OTdB", "OTdT", "OTkn"];
 
-pub static stringfnames: &'static [&'static str] = &[
-    "back_tab", "bell", "carriage_return", "change_scroll_region", "clear_all_tabs",
-    "clear_screen", "clr_eol", "clr_eos", "column_address", "command_character", "cursor_address",
-    "cursor_down", "cursor_home", "cursor_invisible", "cursor_left", "cursor_mem_address",
-    "cursor_normal", "cursor_right", "cursor_to_ll", "cursor_up", "cursor_visible",
-    "delete_character", "delete_line", "dis_status_line", "down_half_line",
-    "enter_alt_charset_mode", "enter_blink_mode", "enter_bold_mode", "enter_ca_mode",
-    "enter_delete_mode", "enter_dim_mode", "enter_insert_mode", "enter_secure_mode",
-    "enter_protected_mode", "enter_reverse_mode", "enter_standout_mode", "enter_underline_mode",
-    "erase_chars", "exit_alt_charset_mode", "exit_attribute_mode", "exit_ca_mode",
-    "exit_delete_mode", "exit_insert_mode", "exit_standout_mode", "exit_underline_mode",
-    "flash_screen", "form_feed", "from_status_line", "init_1string", "init_2string",
-    "init_3string", "init_file", "insert_character", "insert_line", "insert_padding",
-    "key_backspace", "key_catab", "key_clear", "key_ctab", "key_dc", "key_dl", "key_down",
-    "key_eic", "key_eol", "key_eos", "key_f0", "key_f1", "key_f10", "key_f2", "key_f3", "key_f4",
-    "key_f5", "key_f6", "key_f7", "key_f8", "key_f9", "key_home", "key_ic", "key_il", "key_left",
-    "key_ll", "key_npage", "key_ppage", "key_right", "key_sf", "key_sr", "key_stab", "key_up",
-    "keypad_local", "keypad_xmit", "lab_f0", "lab_f1", "lab_f10", "lab_f2", "lab_f3", "lab_f4",
-    "lab_f5", "lab_f6", "lab_f7", "lab_f8", "lab_f9", "meta_off", "meta_on", "newline", "pad_char",
-    "parm_dch", "parm_delete_line", "parm_down_cursor", "parm_ich", "parm_index",
-    "parm_insert_line", "parm_left_cursor", "parm_right_cursor", "parm_rindex", "parm_up_cursor",
-    "pkey_key", "pkey_local", "pkey_xmit", "print_screen", "prtr_off", "prtr_on", "repeat_char",
-    "reset_1string", "reset_2string", "reset_3string", "reset_file", "restore_cursor",
-    "row_address", "save_cursor", "scroll_forward", "scroll_reverse", "set_attributes", "set_tab",
-    "set_window", "tab", "to_status_line", "underline_char", "up_half_line", "init_prog", "key_a1",
-    "key_a3", "key_b2", "key_c1", "key_c3", "prtr_non", "char_padding", "acs_chars", "plab_norm",
-    "key_btab", "enter_xon_mode", "exit_xon_mode", "enter_am_mode", "exit_am_mode",
-    "xon_character", "xoff_character", "ena_acs", "label_on", "label_off", "key_beg", "key_cancel",
-    "key_close", "key_command", "key_copy", "key_create", "key_end", "key_enter", "key_exit",
-    "key_find", "key_help", "key_mark", "key_message", "key_move", "key_next", "key_open",
-    "key_options", "key_previous", "key_print", "key_redo", "key_reference", "key_refresh",
-    "key_replace", "key_restart", "key_resume", "key_save", "key_suspend", "key_undo", "key_sbeg",
-    "key_scancel", "key_scommand", "key_scopy", "key_screate", "key_sdc", "key_sdl", "key_select",
-    "key_send", "key_seol", "key_sexit", "key_sfind", "key_shelp", "key_shome", "key_sic",
-    "key_sleft", "key_smessage", "key_smove", "key_snext", "key_soptions", "key_sprevious",
-    "key_sprint", "key_sredo", "key_sreplace", "key_sright", "key_srsume", "key_ssave",
-    "key_ssuspend", "key_sundo", "req_for_input", "key_f11", "key_f12", "key_f13", "key_f14",
-    "key_f15", "key_f16", "key_f17", "key_f18", "key_f19", "key_f20", "key_f21", "key_f22",
-    "key_f23", "key_f24", "key_f25", "key_f26", "key_f27", "key_f28", "key_f29", "key_f30",
-    "key_f31", "key_f32", "key_f33", "key_f34", "key_f35", "key_f36", "key_f37", "key_f38",
-    "key_f39", "key_f40", "key_f41", "key_f42", "key_f43", "key_f44", "key_f45", "key_f46",
-    "key_f47", "key_f48", "key_f49", "key_f50", "key_f51", "key_f52", "key_f53", "key_f54",
-    "key_f55", "key_f56", "key_f57", "key_f58", "key_f59", "key_f60", "key_f61", "key_f62",
-    "key_f63", "clr_bol", "clear_margins", "set_left_margin", "set_right_margin", "label_format",
-    "set_clock", "display_clock", "remove_clock", "create_window", "goto_window", "hangup",
-    "dial_phone", "quick_dial", "tone", "pulse", "flash_hook", "fixed_pause", "wait_tone", "user0",
-    "user1", "user2", "user3", "user4", "user5", "user6", "user7", "user8", "user9", "orig_pair",
-    "orig_colors", "initialize_color", "initialize_pair", "set_color_pair", "set_foreground",
-    "set_background", "change_char_pitch", "change_line_pitch", "change_res_horz",
-    "change_res_vert", "define_char", "enter_doublewide_mode", "enter_draft_quality",
-    "enter_italics_mode", "enter_leftward_mode", "enter_micro_mode", "enter_near_letter_quality",
-    "enter_normal_quality", "enter_shadow_mode", "enter_subscript_mode", "enter_superscript_mode",
-    "enter_upward_mode", "exit_doublewide_mode", "exit_italics_mode", "exit_leftward_mode",
-    "exit_micro_mode", "exit_shadow_mode", "exit_subscript_mode", "exit_superscript_mode",
-    "exit_upward_mode", "micro_column_address", "micro_down", "micro_left", "micro_right",
-    "micro_row_address", "micro_up", "order_of_pins", "parm_down_micro", "parm_left_micro",
-    "parm_right_micro", "parm_up_micro", "select_char_set", "set_bottom_margin",
-    "set_bottom_margin_parm", "set_left_margin_parm", "set_right_margin_parm", "set_top_margin",
-    "set_top_margin_parm", "start_bit_image", "start_char_set_def", "stop_bit_image",
-    "stop_char_set_def", "subscript_characters", "superscript_characters", "these_cause_cr",
-    "zero_motion", "char_set_names", "key_mouse", "mouse_info", "req_mouse_pos", "get_mouse",
-    "set_a_foreground", "set_a_background", "pkey_plab", "device_type", "code_set_init",
-    "set0_des_seq", "set1_des_seq", "set2_des_seq", "set3_des_seq", "set_lr_margin",
-    "set_tb_margin", "bit_image_repeat", "bit_image_newline", "bit_image_carriage_return",
-    "color_names", "define_bit_image_region", "end_bit_image_region", "set_color_band",
-    "set_page_length", "display_pc_char", "enter_pc_charset_mode", "exit_pc_charset_mode",
-    "enter_scancode_mode", "exit_scancode_mode", "pc_term_options", "scancode_escape",
-    "alt_scancode_esc", "enter_horizontal_hl_mode", "enter_left_hl_mode", "enter_low_hl_mode",
-    "enter_right_hl_mode", "enter_top_hl_mode", "enter_vertical_hl_mode", "set_a_attributes",
-    "set_pglen_inch", "termcap_init2", "termcap_reset", "linefeed_if_not_lf",
-    "backspace_if_not_bs", "other_non_function_keys", "arrow_key_map", "acs_ulcorner",
-    "acs_llcorner", "acs_urcorner", "acs_lrcorner", "acs_ltee", "acs_rtee", "acs_btee", "acs_ttee",
-    "acs_hline", "acs_vline", "acs_plus", "memory_lock", "memory_unlock", "box_chars_1"
-];
+pub static stringfnames: &'static [&'static str] = &["back_tab",
+                                                     "bell",
+                                                     "carriage_return",
+                                                     "change_scroll_region",
+                                                     "clear_all_tabs",
+                                                     "clear_screen",
+                                                     "clr_eol",
+                                                     "clr_eos",
+                                                     "column_address",
+                                                     "command_character",
+                                                     "cursor_address",
+                                                     "cursor_down",
+                                                     "cursor_home",
+                                                     "cursor_invisible",
+                                                     "cursor_left",
+                                                     "cursor_mem_address",
+                                                     "cursor_normal",
+                                                     "cursor_right",
+                                                     "cursor_to_ll",
+                                                     "cursor_up",
+                                                     "cursor_visible",
+                                                     "delete_character",
+                                                     "delete_line",
+                                                     "dis_status_line",
+                                                     "down_half_line",
+                                                     "enter_alt_charset_mode",
+                                                     "enter_blink_mode",
+                                                     "enter_bold_mode",
+                                                     "enter_ca_mode",
+                                                     "enter_delete_mode",
+                                                     "enter_dim_mode",
+                                                     "enter_insert_mode",
+                                                     "enter_secure_mode",
+                                                     "enter_protected_mode",
+                                                     "enter_reverse_mode",
+                                                     "enter_standout_mode",
+                                                     "enter_underline_mode",
+                                                     "erase_chars",
+                                                     "exit_alt_charset_mode",
+                                                     "exit_attribute_mode",
+                                                     "exit_ca_mode",
+                                                     "exit_delete_mode",
+                                                     "exit_insert_mode",
+                                                     "exit_standout_mode",
+                                                     "exit_underline_mode",
+                                                     "flash_screen",
+                                                     "form_feed",
+                                                     "from_status_line",
+                                                     "init_1string",
+                                                     "init_2string",
+                                                     "init_3string",
+                                                     "init_file",
+                                                     "insert_character",
+                                                     "insert_line",
+                                                     "insert_padding",
+                                                     "key_backspace",
+                                                     "key_catab",
+                                                     "key_clear",
+                                                     "key_ctab",
+                                                     "key_dc",
+                                                     "key_dl",
+                                                     "key_down",
+                                                     "key_eic",
+                                                     "key_eol",
+                                                     "key_eos",
+                                                     "key_f0",
+                                                     "key_f1",
+                                                     "key_f10",
+                                                     "key_f2",
+                                                     "key_f3",
+                                                     "key_f4",
+                                                     "key_f5",
+                                                     "key_f6",
+                                                     "key_f7",
+                                                     "key_f8",
+                                                     "key_f9",
+                                                     "key_home",
+                                                     "key_ic",
+                                                     "key_il",
+                                                     "key_left",
+                                                     "key_ll",
+                                                     "key_npage",
+                                                     "key_ppage",
+                                                     "key_right",
+                                                     "key_sf",
+                                                     "key_sr",
+                                                     "key_stab",
+                                                     "key_up",
+                                                     "keypad_local",
+                                                     "keypad_xmit",
+                                                     "lab_f0",
+                                                     "lab_f1",
+                                                     "lab_f10",
+                                                     "lab_f2",
+                                                     "lab_f3",
+                                                     "lab_f4",
+                                                     "lab_f5",
+                                                     "lab_f6",
+                                                     "lab_f7",
+                                                     "lab_f8",
+                                                     "lab_f9",
+                                                     "meta_off",
+                                                     "meta_on",
+                                                     "newline",
+                                                     "pad_char",
+                                                     "parm_dch",
+                                                     "parm_delete_line",
+                                                     "parm_down_cursor",
+                                                     "parm_ich",
+                                                     "parm_index",
+                                                     "parm_insert_line",
+                                                     "parm_left_cursor",
+                                                     "parm_right_cursor",
+                                                     "parm_rindex",
+                                                     "parm_up_cursor",
+                                                     "pkey_key",
+                                                     "pkey_local",
+                                                     "pkey_xmit",
+                                                     "print_screen",
+                                                     "prtr_off",
+                                                     "prtr_on",
+                                                     "repeat_char",
+                                                     "reset_1string",
+                                                     "reset_2string",
+                                                     "reset_3string",
+                                                     "reset_file",
+                                                     "restore_cursor",
+                                                     "row_address",
+                                                     "save_cursor",
+                                                     "scroll_forward",
+                                                     "scroll_reverse",
+                                                     "set_attributes",
+                                                     "set_tab",
+                                                     "set_window",
+                                                     "tab",
+                                                     "to_status_line",
+                                                     "underline_char",
+                                                     "up_half_line",
+                                                     "init_prog",
+                                                     "key_a1",
+                                                     "key_a3",
+                                                     "key_b2",
+                                                     "key_c1",
+                                                     "key_c3",
+                                                     "prtr_non",
+                                                     "char_padding",
+                                                     "acs_chars",
+                                                     "plab_norm",
+                                                     "key_btab",
+                                                     "enter_xon_mode",
+                                                     "exit_xon_mode",
+                                                     "enter_am_mode",
+                                                     "exit_am_mode",
+                                                     "xon_character",
+                                                     "xoff_character",
+                                                     "ena_acs",
+                                                     "label_on",
+                                                     "label_off",
+                                                     "key_beg",
+                                                     "key_cancel",
+                                                     "key_close",
+                                                     "key_command",
+                                                     "key_copy",
+                                                     "key_create",
+                                                     "key_end",
+                                                     "key_enter",
+                                                     "key_exit",
+                                                     "key_find",
+                                                     "key_help",
+                                                     "key_mark",
+                                                     "key_message",
+                                                     "key_move",
+                                                     "key_next",
+                                                     "key_open",
+                                                     "key_options",
+                                                     "key_previous",
+                                                     "key_print",
+                                                     "key_redo",
+                                                     "key_reference",
+                                                     "key_refresh",
+                                                     "key_replace",
+                                                     "key_restart",
+                                                     "key_resume",
+                                                     "key_save",
+                                                     "key_suspend",
+                                                     "key_undo",
+                                                     "key_sbeg",
+                                                     "key_scancel",
+                                                     "key_scommand",
+                                                     "key_scopy",
+                                                     "key_screate",
+                                                     "key_sdc",
+                                                     "key_sdl",
+                                                     "key_select",
+                                                     "key_send",
+                                                     "key_seol",
+                                                     "key_sexit",
+                                                     "key_sfind",
+                                                     "key_shelp",
+                                                     "key_shome",
+                                                     "key_sic",
+                                                     "key_sleft",
+                                                     "key_smessage",
+                                                     "key_smove",
+                                                     "key_snext",
+                                                     "key_soptions",
+                                                     "key_sprevious",
+                                                     "key_sprint",
+                                                     "key_sredo",
+                                                     "key_sreplace",
+                                                     "key_sright",
+                                                     "key_srsume",
+                                                     "key_ssave",
+                                                     "key_ssuspend",
+                                                     "key_sundo",
+                                                     "req_for_input",
+                                                     "key_f11",
+                                                     "key_f12",
+                                                     "key_f13",
+                                                     "key_f14",
+                                                     "key_f15",
+                                                     "key_f16",
+                                                     "key_f17",
+                                                     "key_f18",
+                                                     "key_f19",
+                                                     "key_f20",
+                                                     "key_f21",
+                                                     "key_f22",
+                                                     "key_f23",
+                                                     "key_f24",
+                                                     "key_f25",
+                                                     "key_f26",
+                                                     "key_f27",
+                                                     "key_f28",
+                                                     "key_f29",
+                                                     "key_f30",
+                                                     "key_f31",
+                                                     "key_f32",
+                                                     "key_f33",
+                                                     "key_f34",
+                                                     "key_f35",
+                                                     "key_f36",
+                                                     "key_f37",
+                                                     "key_f38",
+                                                     "key_f39",
+                                                     "key_f40",
+                                                     "key_f41",
+                                                     "key_f42",
+                                                     "key_f43",
+                                                     "key_f44",
+                                                     "key_f45",
+                                                     "key_f46",
+                                                     "key_f47",
+                                                     "key_f48",
+                                                     "key_f49",
+                                                     "key_f50",
+                                                     "key_f51",
+                                                     "key_f52",
+                                                     "key_f53",
+                                                     "key_f54",
+                                                     "key_f55",
+                                                     "key_f56",
+                                                     "key_f57",
+                                                     "key_f58",
+                                                     "key_f59",
+                                                     "key_f60",
+                                                     "key_f61",
+                                                     "key_f62",
+                                                     "key_f63",
+                                                     "clr_bol",
+                                                     "clear_margins",
+                                                     "set_left_margin",
+                                                     "set_right_margin",
+                                                     "label_format",
+                                                     "set_clock",
+                                                     "display_clock",
+                                                     "remove_clock",
+                                                     "create_window",
+                                                     "goto_window",
+                                                     "hangup",
+                                                     "dial_phone",
+                                                     "quick_dial",
+                                                     "tone",
+                                                     "pulse",
+                                                     "flash_hook",
+                                                     "fixed_pause",
+                                                     "wait_tone",
+                                                     "user0",
+                                                     "user1",
+                                                     "user2",
+                                                     "user3",
+                                                     "user4",
+                                                     "user5",
+                                                     "user6",
+                                                     "user7",
+                                                     "user8",
+                                                     "user9",
+                                                     "orig_pair",
+                                                     "orig_colors",
+                                                     "initialize_color",
+                                                     "initialize_pair",
+                                                     "set_color_pair",
+                                                     "set_foreground",
+                                                     "set_background",
+                                                     "change_char_pitch",
+                                                     "change_line_pitch",
+                                                     "change_res_horz",
+                                                     "change_res_vert",
+                                                     "define_char",
+                                                     "enter_doublewide_mode",
+                                                     "enter_draft_quality",
+                                                     "enter_italics_mode",
+                                                     "enter_leftward_mode",
+                                                     "enter_micro_mode",
+                                                     "enter_near_letter_quality",
+                                                     "enter_normal_quality",
+                                                     "enter_shadow_mode",
+                                                     "enter_subscript_mode",
+                                                     "enter_superscript_mode",
+                                                     "enter_upward_mode",
+                                                     "exit_doublewide_mode",
+                                                     "exit_italics_mode",
+                                                     "exit_leftward_mode",
+                                                     "exit_micro_mode",
+                                                     "exit_shadow_mode",
+                                                     "exit_subscript_mode",
+                                                     "exit_superscript_mode",
+                                                     "exit_upward_mode",
+                                                     "micro_column_address",
+                                                     "micro_down",
+                                                     "micro_left",
+                                                     "micro_right",
+                                                     "micro_row_address",
+                                                     "micro_up",
+                                                     "order_of_pins",
+                                                     "parm_down_micro",
+                                                     "parm_left_micro",
+                                                     "parm_right_micro",
+                                                     "parm_up_micro",
+                                                     "select_char_set",
+                                                     "set_bottom_margin",
+                                                     "set_bottom_margin_parm",
+                                                     "set_left_margin_parm",
+                                                     "set_right_margin_parm",
+                                                     "set_top_margin",
+                                                     "set_top_margin_parm",
+                                                     "start_bit_image",
+                                                     "start_char_set_def",
+                                                     "stop_bit_image",
+                                                     "stop_char_set_def",
+                                                     "subscript_characters",
+                                                     "superscript_characters",
+                                                     "these_cause_cr",
+                                                     "zero_motion",
+                                                     "char_set_names",
+                                                     "key_mouse",
+                                                     "mouse_info",
+                                                     "req_mouse_pos",
+                                                     "get_mouse",
+                                                     "set_a_foreground",
+                                                     "set_a_background",
+                                                     "pkey_plab",
+                                                     "device_type",
+                                                     "code_set_init",
+                                                     "set0_des_seq",
+                                                     "set1_des_seq",
+                                                     "set2_des_seq",
+                                                     "set3_des_seq",
+                                                     "set_lr_margin",
+                                                     "set_tb_margin",
+                                                     "bit_image_repeat",
+                                                     "bit_image_newline",
+                                                     "bit_image_carriage_return",
+                                                     "color_names",
+                                                     "define_bit_image_region",
+                                                     "end_bit_image_region",
+                                                     "set_color_band",
+                                                     "set_page_length",
+                                                     "display_pc_char",
+                                                     "enter_pc_charset_mode",
+                                                     "exit_pc_charset_mode",
+                                                     "enter_scancode_mode",
+                                                     "exit_scancode_mode",
+                                                     "pc_term_options",
+                                                     "scancode_escape",
+                                                     "alt_scancode_esc",
+                                                     "enter_horizontal_hl_mode",
+