Bug 1500849 - Revendor Rust dependencies.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 22 Oct 2018 09:43:49 +0200
changeset 490639 7f6a6fc2b1522e0aada38ba6e4bca0f211ef8937
parent 490638 d7efad4d19cba5feed6abd7627e51cf27a0062ac
child 490640 dedd03c893c8cfa5a721b0a04cf5b26cee98db4b
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
bugs1500849
milestone64.0a1
Bug 1500849 - Revendor Rust dependencies.
third_party/rust/bindgen/.cargo-checksum.json
third_party/rust/bindgen/.cargo_vcs_info.json
third_party/rust/bindgen/Cargo.toml
third_party/rust/bindgen/src/clang.rs
third_party/rust/bindgen/src/codegen/helpers.rs
third_party/rust/bindgen/src/codegen/impl_debug.rs
third_party/rust/bindgen/src/codegen/impl_partialeq.rs
third_party/rust/bindgen/src/codegen/mod.rs
third_party/rust/bindgen/src/codegen/struct_layout.rs
third_party/rust/bindgen/src/features.rs
third_party/rust/bindgen/src/ir/analysis/derive_copy.rs
third_party/rust/bindgen/src/ir/analysis/derive_debug.rs
third_party/rust/bindgen/src/ir/analysis/derive_default.rs
third_party/rust/bindgen/src/ir/analysis/derive_hash.rs
third_party/rust/bindgen/src/ir/analysis/derive_partialeq_or_partialord.rs
third_party/rust/bindgen/src/ir/analysis/has_float.rs
third_party/rust/bindgen/src/ir/analysis/has_type_param_in_array.rs
third_party/rust/bindgen/src/ir/analysis/sizedness.rs
third_party/rust/bindgen/src/ir/comment.rs
third_party/rust/bindgen/src/ir/context.rs
third_party/rust/bindgen/src/ir/derive.rs
third_party/rust/bindgen/src/ir/enum_ty.rs
third_party/rust/bindgen/src/ir/function.rs
third_party/rust/bindgen/src/ir/item.rs
third_party/rust/bindgen/src/ir/layout.rs
third_party/rust/bindgen/src/ir/ty.rs
third_party/rust/bindgen/src/ir/var.rs
third_party/rust/bindgen/src/lib.rs
third_party/rust/bindgen/src/options.rs
third_party/rust/cexpr/.cargo-checksum.json
third_party/rust/cexpr/Cargo.toml
third_party/rust/cexpr/src/expr.rs
third_party/rust/cexpr/src/lib.rs
third_party/rust/cexpr/src/literal.rs
third_party/rust/cexpr/tests/clang.rs
third_party/rust/cexpr/tests/input/int_unsigned.h
third_party/rust/clang-sys/.cargo-checksum.json
third_party/rust/clang-sys/.travis.yml
third_party/rust/clang-sys/CHANGELOG.md
third_party/rust/clang-sys/Cargo.toml
third_party/rust/clang-sys/LICENSE.txt
third_party/rust/clang-sys/README.md
third_party/rust/clang-sys/appveyor.yml
third_party/rust/clang-sys/build.rs
third_party/rust/clang-sys/build/common.rs
third_party/rust/clang-sys/build/dynamic.rs
third_party/rust/clang-sys/build/static.rs
third_party/rust/clang-sys/ci/before_install.sh
third_party/rust/clang-sys/ci/install.bat
third_party/rust/clang-sys/ci/script.sh
third_party/rust/clang-sys/ci/test_script.bat
third_party/rust/clang-sys/clippy.toml
third_party/rust/clang-sys/src/lib.rs
third_party/rust/clang-sys/src/link.rs
third_party/rust/clang-sys/src/support.rs
third_party/rust/clang-sys/tests/header.h
third_party/rust/clang-sys/tests/lib.rs
third_party/rust/nom-3.2.1/.cargo-checksum.json
third_party/rust/nom-3.2.1/CHANGELOG.md
third_party/rust/nom-3.2.1/Cargo.toml
third_party/rust/nom-3.2.1/LICENSE
third_party/rust/nom-3.2.1/src/bits.rs
third_party/rust/nom-3.2.1/src/branch.rs
third_party/rust/nom-3.2.1/src/bytes.rs
third_party/rust/nom-3.2.1/src/character.rs
third_party/rust/nom-3.2.1/src/internal.rs
third_party/rust/nom-3.2.1/src/lib.rs
third_party/rust/nom-3.2.1/src/macros.rs
third_party/rust/nom-3.2.1/src/methods.rs
third_party/rust/nom-3.2.1/src/multi.rs
third_party/rust/nom-3.2.1/src/nom.rs
third_party/rust/nom-3.2.1/src/regexp.rs
third_party/rust/nom-3.2.1/src/sequence.rs
third_party/rust/nom-3.2.1/src/simple_errors.rs
third_party/rust/nom-3.2.1/src/str.rs
third_party/rust/nom-3.2.1/src/stream.rs
third_party/rust/nom-3.2.1/src/traits.rs
third_party/rust/nom-3.2.1/src/util.rs
third_party/rust/nom-3.2.1/src/verbose_errors.rs
third_party/rust/nom-3.2.1/src/whitespace.rs
third_party/rust/nom-3.2.1/tests/arithmetic.rs
third_party/rust/nom-3.2.1/tests/arithmetic_ast.rs
third_party/rust/nom-3.2.1/tests/blockbuf-arithmetic.rs
third_party/rust/nom-3.2.1/tests/cross_function_backtracking.rs
third_party/rust/nom-3.2.1/tests/float.rs
third_party/rust/nom-3.2.1/tests/ini.rs
third_party/rust/nom-3.2.1/tests/ini_str.rs
third_party/rust/nom-3.2.1/tests/issues.rs
third_party/rust/nom-3.2.1/tests/json.rs
third_party/rust/nom-3.2.1/tests/mp4.rs
third_party/rust/nom-3.2.1/tests/multiline.rs
third_party/rust/nom-3.2.1/tests/named_args.rs
third_party/rust/nom-3.2.1/tests/omnom.rs
third_party/rust/nom-3.2.1/tests/overflow.rs
third_party/rust/nom-3.2.1/tests/reborrow_fold.rs
third_party/rust/nom-3.2.1/tests/test1.rs
third_party/rust/nom/.cargo-checksum.json
third_party/rust/nom/.cargo_vcs_info.json
third_party/rust/nom/CHANGELOG.md
third_party/rust/nom/Cargo.toml
third_party/rust/nom/src/bits.rs
third_party/rust/nom/src/branch.rs
third_party/rust/nom/src/bytes.rs
third_party/rust/nom/src/character.rs
third_party/rust/nom/src/internal.rs
third_party/rust/nom/src/lib.rs
third_party/rust/nom/src/macros.rs
third_party/rust/nom/src/methods.rs
third_party/rust/nom/src/multi.rs
third_party/rust/nom/src/nom.rs
third_party/rust/nom/src/regexp.rs
third_party/rust/nom/src/sequence.rs
third_party/rust/nom/src/simple_errors.rs
third_party/rust/nom/src/str.rs
third_party/rust/nom/src/stream.rs
third_party/rust/nom/src/traits.rs
third_party/rust/nom/src/types.rs
third_party/rust/nom/src/util.rs
third_party/rust/nom/src/verbose_errors.rs
third_party/rust/nom/src/whitespace.rs
third_party/rust/nom/tests/arithmetic.rs
third_party/rust/nom/tests/arithmetic_ast.rs
third_party/rust/nom/tests/blockbuf-arithmetic.rs
third_party/rust/nom/tests/complete_arithmetic.rs
third_party/rust/nom/tests/complete_float.rs
third_party/rust/nom/tests/cross_function_backtracking.rs
third_party/rust/nom/tests/css.rs
third_party/rust/nom/tests/custom_errors.rs
third_party/rust/nom/tests/float.rs
third_party/rust/nom/tests/inference.rs
third_party/rust/nom/tests/ini.rs
third_party/rust/nom/tests/ini_str.rs
third_party/rust/nom/tests/issues.rs
third_party/rust/nom/tests/json.rs
third_party/rust/nom/tests/mp4.rs
third_party/rust/nom/tests/multiline.rs
third_party/rust/nom/tests/named_args.rs
third_party/rust/nom/tests/omnom.rs
third_party/rust/nom/tests/overflow.rs
third_party/rust/nom/tests/reborrow_fold.rs
third_party/rust/nom/tests/test1.rs
--- a/third_party/rust/bindgen/.cargo-checksum.json
+++ b/third_party/rust/bindgen/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"b4b52379175634c9d1f97f7fffefb3092e7bb6bd70e6f98000e55f949e4af424","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"630d1a1d123c131bad0fec23173e263ba8ecc064b5cd8446d4cab7ffd197db45","build.rs":"032a1c51963894a421b0535f9227796d88768ac5f665a81d2edced69dc6d106a","src/callbacks.rs":"9d41b7848cea37e8741fa7bc947ba58a83647824b1a0bbe7ff75012c412eab13","src/clang.rs":"ca3bc42a3d6a8057d105348d604e01d37fc88a8088701c062ee138a9a6b49a85","src/codegen/bitfield_unit.rs":"88b0604322dc449fc9284850eadc1f5d14b42fa747d4258bae0b6b9535f52dfd","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"f37a75b1fb40633c35e2b9231d8f4e244cd3deef0dfd5e48f074fdcc760f7c94","src/codegen/impl_debug.rs":"71b3b9c1bcb71b5705945e2d4b7457ec57127153031c533ae3ef76f8e0fc460e","src/codegen/impl_partialeq.rs":"cd972c60e7dcb700c6f01185c055933d800b3b5d4959d00b2232e17dfa2d097c","src/codegen/mod.rs":"b3ea487f50e920563ef20f2ab3829bb6eae0cf0f0f08d98d8c52ec6fb4db8bad","src/codegen/struct_layout.rs":"9bd0e3455e55e2a1faa4f332a327c2529a21bdfdd0fcb3a45bc5cdd7801d288f","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/features.rs":"57a44c77fa87d0a5113f600c6bc70e2b98cf029bf41f1205cd45f453666afb73","src/ir/analysis/derive_copy.rs":"b4ff30eea031b9d41715e63114f76dbcce580d9be1b7146ff47d51ab2c108423","src/ir/analysis/derive_debug.rs":"9266e72a255f9ee8536785f33f80c1486b5dd4bc6827fa3c88201e01a22adc96","src/ir/analysis/derive_default.rs":"de59bd34a0cff1f9cd9e182c6bfd0bfbaa76551fe55929ab940fc83af9383ef7","src/ir/analysis/derive_hash.rs":"849b23c9c72e69f9e00bf7b4d99373e01603f45f2fddce21a53bd7f176daa687","src/ir/analysis/derive_partialeq_or_partialord.rs":"512d4503242171280ee8c94b094d090c3456b84d202f46fbee61e2c52c789082","src/ir/analysis/has_destructor.rs":"d9aaaceba580b48eb0df4e5537b34b417c51ccdfeb8f6b72484f3bf4992317fe","src/ir/analysis/has_float.rs":"b2c0fa08d9f20c513266cc200b75af3ff785c6d05cf8d7f3a9710975a41c13f9","src/ir/analysis/has_type_param_in_array.rs":"8ac853669c8957b125376def466eed9a5d733f6bfd3e83b2c16e0f2ed67541f9","src/ir/analysis/has_vtable.rs":"37765e954ef792e369a58ccfe1d827a00fe9bce680466da1d6523671b94b6c92","src/ir/analysis/mod.rs":"ea5ace45c77e855674bb565ba0fef556f60e3293b0ddcf11d3a5a6ec15ab0648","src/ir/analysis/sizedness.rs":"c9e53740e6c8850cabc719d09700ee490fda0f866d6a6574761c95a0fcf7ebd3","src/ir/analysis/template_params.rs":"6554dd1240142ec0e7299e678b696725f5cba99243d1c3d1cbf58d4764082fd6","src/ir/annotations.rs":"ef106afcbe6084c18bd13a37ee3c1cdc9596bfb055db8c773d81f8f15fec3208","src/ir/comment.rs":"000481754e5433d7c0886b9ce8b93b64c7ab1ae52867d211c73c7c4b336649a2","src/ir/comp.rs":"7b22f3ff19ca45a6fbfe7ea015109d43f4ddf65b33b47b1c37829fcb87cdff9b","src/ir/context.rs":"b255306e5ffd85a223395f96ebdfe82c4630d072cabe44f106610c45ae6f7823","src/ir/derive.rs":"9550d01731ca66be28124c91fd0211a618743a065bec7b00e27c934afff82a84","src/ir/dot.rs":"d01f1621ab67e368d854a82bd6bb0b8dd52f3c2c733de8eaf81aece9543818cb","src/ir/enum_ty.rs":"3611100df8ddf01b010d2eae1d26a67df022e47b6236b0ed9d1b9b42340ebafd","src/ir/function.rs":"b86e665c6659c32bce39194240e7da6221c5a2ec51b362ad9f6e34f1bc396a6f","src/ir/int.rs":"07e0c7dbd2dd977177fae3acd2a14adf271c6cf9ff4b57cddc11d50734fd4801","src/ir/item.rs":"f1bd45f3a0cc32a132fee775e8269d5f2faac8d8e0ed1beeb553d2c9795708e9","src/ir/item_kind.rs":"dbeae8c4fd0e5c9485d325aea040e056a1f2cd6d43fc927dee8fe1c0c59a7197","src/ir/layout.rs":"91ecbf3a250eae63f29b508b0fb0418623523c9d3e0df96dd1f98d04d81b95ad","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"828a890acdc8b10c44e69e2ed4a4f5d8c0e734606d3a8cc71658dcf43a49acf4","src/ir/template.rs":"c0f8570b927dfd6a421fc4ce3094ec837a3ed936445225dbfac961e8e0842ae5","src/ir/traversal.rs":"ea751379a5aec02f93f8d2c61e18232776b1f000dbeae64b9a7195ba21a19dd6","src/ir/ty.rs":"10d767c64dff6040e0a1e71d2b69e8341d4cfa18385e5f6321220ea7114f519a","src/ir/var.rs":"57c8aa9f834c6f06418f7d471b1771bbb915821ef0d194b383be60092edca5f7","src/lib.rs":"f54a4f4622633c28ae3b130a15d7da1f07e1220012935bf6844cce1c658377ff","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"86bac5dd54eb5c2df71fdece02c72b6c95b9b7a818710ac20d457fdddca30dd9","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"c417889726b5e3325f9375551bf23fd54c9b40020151c364741ea6126ede386b","src/time.rs":"3b763e6fee51d0eb01228dfe28bc28a9f692aff73b2a7b90a030902e0238fca6"},"package":"eac4ed5f2de9efc3c87cb722468fa49d0763e98f999d539bfc5e452c13d85c91"}
\ No newline at end of file
+{"files":{".cargo_vcs_info.json":"1eb83f46382fa835038c7ee9f7bf386b67ec313d8a9bda6b86b8ee534270ea7d","Cargo.toml":"d6ee9689e1d4ece0423949f53cfd91c6c1f53e9246e559e3c6e9093d691a4229","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"630d1a1d123c131bad0fec23173e263ba8ecc064b5cd8446d4cab7ffd197db45","build.rs":"032a1c51963894a421b0535f9227796d88768ac5f665a81d2edced69dc6d106a","src/callbacks.rs":"9d41b7848cea37e8741fa7bc947ba58a83647824b1a0bbe7ff75012c412eab13","src/clang.rs":"b25f8d455e3cd89d416a4c5e55d828db9691f4def82109c1dd12457e5ca2c13c","src/codegen/bitfield_unit.rs":"88b0604322dc449fc9284850eadc1f5d14b42fa747d4258bae0b6b9535f52dfd","src/codegen/bitfield_unit_tests.rs":"2073ac6a36e0bc9afaef5b1207966817c8fb7a1a9f6368c3b1b8f79822efbfba","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"2c890c96a1a6b72ada63593cb544f005476fb176d7181553713e83710dc8eefd","src/codegen/impl_debug.rs":"43b977b8d16073d021977ce57f3c22eb5b1083493905ae19a171e2271939f574","src/codegen/impl_partialeq.rs":"671dd0eac712bf8281e11a7b3e545a443c6e9e2c8ee7fbebeb03c76667ca206b","src/codegen/mod.rs":"a1bfb972bed101b735d3ac19fa1080bd3a8d4e38e11b4adf34ca413982e2fe5e","src/codegen/struct_layout.rs":"b77f03dfbbed408a5fa6e693560aea8dc902fe7d10d847ce39122e6961078515","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/features.rs":"be74e03d4f00582fa8970439da52057b04204b450193833953ed84772933bd46","src/ir/analysis/derive_copy.rs":"b7e12cdc74937909529e4cefe9f43b3ee0a5590f07392b73481811ac9fddedd2","src/ir/analysis/derive_debug.rs":"cf9346ecb3afd4e94094a2723e4d76c76c55f42a13dc1d5ec6564d25d3a46cf4","src/ir/analysis/derive_default.rs":"87332eccd5accbfbf7fad2e1511be4f8945b0538ae3e0628c8af17d16068691f","src/ir/analysis/derive_hash.rs":"521ea1dbe221755042a95e8e8dcb594e427e54be2eb869c61ebbdb27fec5aa77","src/ir/analysis/derive_partialeq_or_partialord.rs":"3c5d051f69401fe50b56143143eca3e71674d6a87d0013c31745b75d0f3d584f","src/ir/analysis/has_destructor.rs":"d9aaaceba580b48eb0df4e5537b34b417c51ccdfeb8f6b72484f3bf4992317fe","src/ir/analysis/has_float.rs":"5f7ee1b834978817041d884fee4648b31ecb66c62aafb8e7a9a17e5ac434bfe5","src/ir/analysis/has_type_param_in_array.rs":"abf74468b923c015aaf67599e50857267516010472819a79ca494fe02dd6ac93","src/ir/analysis/has_vtable.rs":"37765e954ef792e369a58ccfe1d827a00fe9bce680466da1d6523671b94b6c92","src/ir/analysis/mod.rs":"ea5ace45c77e855674bb565ba0fef556f60e3293b0ddcf11d3a5a6ec15ab0648","src/ir/analysis/sizedness.rs":"4f788bff0ceb0e008d70145510340ab636e5203787316f0be41f789ce9b2f73d","src/ir/analysis/template_params.rs":"6554dd1240142ec0e7299e678b696725f5cba99243d1c3d1cbf58d4764082fd6","src/ir/annotations.rs":"ef106afcbe6084c18bd13a37ee3c1cdc9596bfb055db8c773d81f8f15fec3208","src/ir/comment.rs":"1b068d5834da7360aec4cb80d9c55219cedbb2ae8b9727a39ec7d156c88fe0b5","src/ir/comp.rs":"7b22f3ff19ca45a6fbfe7ea015109d43f4ddf65b33b47b1c37829fcb87cdff9b","src/ir/context.rs":"7fde495a0b97f332a2018a6ee7b1cbac46e8dee68f2a3956a2a95e26e970c266","src/ir/derive.rs":"19601e76528d6cce8e04a66572e75da4e9efdecc4d60a983fc68c11958e9f3ec","src/ir/dot.rs":"d01f1621ab67e368d854a82bd6bb0b8dd52f3c2c733de8eaf81aece9543818cb","src/ir/enum_ty.rs":"9cc242d6b3c1866665594e8b306860ee39c0ea42d22198d46b7fded473fe3e84","src/ir/function.rs":"44603a952b5f5f3074f4f9b4995e88b28906e22830865533469f42071af61aa9","src/ir/int.rs":"07e0c7dbd2dd977177fae3acd2a14adf271c6cf9ff4b57cddc11d50734fd4801","src/ir/item.rs":"0ec5cec91551e01069451265fcf755cb54608bc2dfa770e770769eef0f2ba080","src/ir/item_kind.rs":"dbeae8c4fd0e5c9485d325aea040e056a1f2cd6d43fc927dee8fe1c0c59a7197","src/ir/layout.rs":"e722edffcd34914b534813da5af6fe8ba69927a54e0ec88ae1733f5ddf0e50b1","src/ir/mod.rs":"2eae90f207fad2e45957ec9287064992a419e3fc916aba84faff2ea25cbeb5ee","src/ir/module.rs":"c4d90bf38fe3672e01923734ccbdb7951ea929949d5f413a9c2aee12395a5094","src/ir/objc.rs":"828a890acdc8b10c44e69e2ed4a4f5d8c0e734606d3a8cc71658dcf43a49acf4","src/ir/template.rs":"c0f8570b927dfd6a421fc4ce3094ec837a3ed936445225dbfac961e8e0842ae5","src/ir/traversal.rs":"ea751379a5aec02f93f8d2c61e18232776b1f000dbeae64b9a7195ba21a19dd6","src/ir/ty.rs":"a7e72e4fb85a1328f17a5428c7bc7f1c51326299833f82252770bebf99d1a9a1","src/ir/var.rs":"5c0caaa505faef18e334c6198b3634b6f390d14cf9da629226cd78617fd3594b","src/lib.rs":"b94a374ef78f6b6cd2b0676efcd67a16800730b28374155b54387a55774aed6e","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"e519053bcdde6bc88f60f955246a02d53b3db1cc5ccd1612e6675b790b7460b0","src/options.rs":"a4b4028542d6292363fc97621c704bf1b4e7eb149e9cb86b52e30aad0be13b99","src/parse.rs":"be7d13cc84fae79ec7b3aa9e77063fa475a48d74a854423e2c72d75006a25202","src/regex_set.rs":"c417889726b5e3325f9375551bf23fd54c9b40020151c364741ea6126ede386b","src/time.rs":"3b763e6fee51d0eb01228dfe28bc28a9f692aff73b2a7b90a030902e0238fca6"},"package":"b41df015ccbc22b038641bd84d0aeeff01e0a4c0714ed35ed0e9a3dd8ad8d732"}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/third_party/rust/bindgen/.cargo_vcs_info.json
@@ -0,0 +1,5 @@
+{
+  "git": {
+    "sha1": "a242c51e6ff0d4cc27940a3927e713e8dff82c5f"
+  }
+}
--- a/third_party/rust/bindgen/Cargo.toml
+++ b/third_party/rust/bindgen/Cargo.toml
@@ -7,17 +7,17 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "bindgen"
-version = "0.39.0"
+version = "0.43.0"
 authors = ["Jyun-Yan You <jyyou.tw@gmail.com>", "Emilio Cobos Álvarez <emilio@crisal.io>", "Nick Fitzgerald <fitzgen@gmail.com>", "The Servo project developers"]
 build = "build.rs"
 include = ["LICENSE", "README.md", "Cargo.toml", "build.rs", "src/*.rs", "src/**/*.rs"]
 description = "Automatically generates Rust FFI bindings to C and C++ libraries."
 homepage = "https://rust-lang-nursery.github.io/rust-bindgen/"
 documentation = "https://docs.rs/bindgen"
 readme = "README.md"
 keywords = ["bindings", "ffi", "code-generation"]
@@ -31,23 +31,23 @@ path = "src/lib.rs"
 [[bin]]
 name = "bindgen"
 path = "src/main.rs"
 doc = false
 [dependencies.bitflags]
 version = "1.0.3"
 
 [dependencies.cexpr]
-version = "0.2"
+version = "0.3.3"
 
 [dependencies.cfg-if]
 version = "0.1.0"
 
 [dependencies.clang-sys]
-version = "0.23"
+version = "0.26"
 features = ["runtime", "clang_6_0"]
 
 [dependencies.clap]
 version = "2"
 
 [dependencies.env_logger]
 version = "0.5"
 optional = true
--- a/third_party/rust/bindgen/src/clang.rs
+++ b/third_party/rust/bindgen/src/clang.rs
@@ -7,17 +7,17 @@
 use cexpr;
 use clang_sys::*;
 use regex;
 use std::{mem, ptr, slice};
 use std::ffi::{CStr, CString};
 use std::fmt;
 use std::hash::Hash;
 use std::hash::Hasher;
-use std::os::raw::{c_char, c_int, c_uint, c_ulong};
+use std::os::raw::{c_char, c_int, c_uint, c_ulong, c_longlong, c_ulonglong};
 
 /// A cursor into the Clang AST, pointing to an AST node.
 ///
 /// We call the AST node pointed to by the cursor the cursor's "referent".
 #[derive(Copy, Clone)]
 pub struct Cursor {
     x: CXCursor,
 }
@@ -935,16 +935,17 @@ impl Type {
     /// Given that this type is a pointer type, return the type that it points
     /// to.
     pub fn pointee_type(&self) -> Option<Type> {
         match self.kind() {
             CXType_Pointer |
             CXType_RValueReference |
             CXType_LValueReference |
             CXType_MemberPointer |
+            CXType_BlockPointer |
             CXType_ObjCObjectPointer => {
                 let ret = Type {
                     x: unsafe { clang_getPointeeType(self.x) },
                 };
                 debug_assert!(ret.is_valid());
                 Some(ret)
             }
             _ => None,
@@ -1781,23 +1782,44 @@ impl EvalResult {
             CXEval_Float => {
                 Some(unsafe { clang_EvalResult_getAsDouble(self.x) } as f64)
             }
             _ => None,
         }
     }
 
     /// Try to get back the result as an integer.
-    pub fn as_int(&self) -> Option<i32> {
-        match self.kind() {
-            CXEval_Int => {
-                Some(unsafe { clang_EvalResult_getAsInt(self.x) } as i32)
+    pub fn as_int(&self) -> Option<i64> {
+        if self.kind() != CXEval_Int {
+            return None;
+        }
+
+        if !clang_EvalResult_isUnsignedInt::is_loaded() {
+            // FIXME(emilio): There's no way to detect underflow here, and clang
+            // will just happily give us a value.
+            return Some(unsafe { clang_EvalResult_getAsInt(self.x) } as i64)
+        }
+
+        if unsafe { clang_EvalResult_isUnsignedInt(self.x) } != 0 {
+            let value = unsafe { clang_EvalResult_getAsUnsigned(self.x) };
+            if value > i64::max_value() as c_ulonglong {
+                return None;
             }
-            _ => None,
+
+            return Some(value as i64)
         }
+
+        let value = unsafe { clang_EvalResult_getAsLongLong(self.x) };
+        if value > i64::max_value() as c_longlong {
+            return None;
+        }
+        if value < i64::min_value() as c_longlong {
+            return None;
+        }
+        Some(value as i64)
     }
 
     /// Evaluates the expression as a literal string, that may or may not be
     /// valid utf-8.
     pub fn as_literal_string(&self) -> Option<Vec<u8>> {
         match self.kind() {
             CXEval_StrLiteral => {
                 let ret = unsafe {
--- a/third_party/rust/bindgen/src/codegen/helpers.rs
+++ b/third_party/rust/bindgen/src/codegen/helpers.rs
@@ -54,49 +54,49 @@ pub mod attributes {
         quote! {
             #[link_name = #name]
         }
     }
 }
 
 /// Generates a proper type for a field or type with a given `Layout`, that is,
 /// a type with the correct size and alignment restrictions.
-pub fn blob(layout: Layout) -> quote::Tokens {
+pub fn blob(ctx: &BindgenContext, layout: Layout) -> quote::Tokens {
     let opaque = layout.opaque();
 
     // FIXME(emilio, #412): We fall back to byte alignment, but there are
     // some things that legitimately are more than 8-byte aligned.
     //
     // Eventually we should be able to `unwrap` here, but...
-    let ty_name = match opaque.known_rust_type_for_array() {
+    let ty_name = match opaque.known_rust_type_for_array(ctx) {
         Some(ty) => ty,
         None => {
             warn!("Found unknown alignment on code generation!");
             "u8"
         }
     };
 
     let ty_name = Term::new(ty_name, Span::call_site());
 
-    let data_len = opaque.array_size().unwrap_or(layout.size);
+    let data_len = opaque.array_size(ctx).unwrap_or(layout.size);
 
     if data_len == 1 {
         quote! {
             #ty_name
         }
     } else {
         quote! {
             [ #ty_name ; #data_len ]
         }
     }
 }
 
 /// Integer type of the same size as the given `Layout`.
-pub fn integer_type(layout: Layout) -> Option<quote::Tokens> {
-    let name = Layout::known_type_for_size(layout.size)?;
+pub fn integer_type(ctx: &BindgenContext, layout: Layout) -> Option<quote::Tokens> {
+    let name = Layout::known_type_for_size(ctx, layout.size)?;
     let name = Term::new(name, Span::call_site());
     Some(quote! { #name })
 }
 
 /// Generates a bitfield allocation unit type for a type with the given `Layout`.
 pub fn bitfield_unit(ctx: &BindgenContext, layout: Layout) -> quote::Tokens {
     let mut tokens = quote! {};
 
@@ -117,16 +117,17 @@ pub fn bitfield_unit(ctx: &BindgenContex
     });
 
     tokens
 }
 
 pub mod ast_ty {
     use ir::context::BindgenContext;
     use ir::function::FunctionSig;
+    use ir::layout::Layout;
     use ir::ty::FloatKind;
     use quote;
     use proc_macro2;
 
     pub fn raw_type(ctx: &BindgenContext, name: &str) -> quote::Tokens {
         let ident = ctx.rust_ident_raw(name);
         match ctx.options().ctypes_prefix {
             Some(ref prefix) => {
@@ -139,32 +140,54 @@ pub mod ast_ty {
                 ::std::os::raw::#ident
             },
         }
     }
 
     pub fn float_kind_rust_type(
         ctx: &BindgenContext,
         fk: FloatKind,
+        layout: Option<Layout>,
     ) -> quote::Tokens {
-        // TODO: we probably should just take the type layout into
-        // account?
+        // TODO: we probably should take the type layout into account more
+        // often?
         //
         // Also, maybe this one shouldn't be the default?
-        //
-        // FIXME: `c_longdouble` doesn't seem to be defined in some
-        // systems, so we use `c_double` directly.
         match (fk, ctx.options().convert_floats) {
             (FloatKind::Float, true) => quote! { f32 },
-            (FloatKind::Double, true) |
-            (FloatKind::LongDouble, true) => quote! { f64 },
+            (FloatKind::Double, true) => quote! { f64 },
             (FloatKind::Float, false) => raw_type(ctx, "c_float"),
-            (FloatKind::Double, false) |
-            (FloatKind::LongDouble, false) => raw_type(ctx, "c_double"),
-            (FloatKind::Float128, _) => quote! { [u8; 16] },
+            (FloatKind::Double, false) => raw_type(ctx, "c_double"),
+            (FloatKind::LongDouble, _) => {
+                match layout {
+                    Some(layout) => {
+                        match layout.size {
+                            4 => quote! { f32 },
+                            8 => quote! { f64 },
+                            // TODO(emilio): If rust ever gains f128 we should
+                            // use it here and below.
+                            _ => super::integer_type(ctx, layout).unwrap_or(quote! { f64 }),
+                        }
+                    }
+                    None => {
+                        debug_assert!(
+                            false,
+                            "How didn't we know the layout for a primitive type?"
+                        );
+                        quote! { f64 }
+                    }
+                }
+            }
+            (FloatKind::Float128, _) => {
+                if ctx.options().rust_features.i128_and_u128 {
+                    quote! { u128 }
+                } else {
+                    quote! { [u64; 2] }
+                }
+            }
         }
     }
 
     pub fn int_expr(val: i64) -> quote::Tokens {
         // Don't use quote! { #val } because that adds the type suffix.
         let val = proc_macro2::Literal::i64_unsuffixed(val);
         quote!(#val)
     }
--- a/third_party/rust/bindgen/src/codegen/impl_debug.rs
+++ b/third_party/rust/bindgen/src/codegen/impl_debug.rs
@@ -37,18 +37,20 @@ pub fn gen_debug_impl(
                 }
             }
         }
     }
 
     format_string.push_str(" }}");
     tokens.insert(0, quote! { #format_string });
 
+    let prefix = ctx.trait_prefix();
+
     quote! {
-        fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        fn fmt(&self, f: &mut ::#prefix::fmt::Formatter<'_>) -> ::#prefix ::fmt::Result {
             write!(f, #( #tokens ),*)
         }
     }
 }
 
 /// A trait for the things which we can codegen tokens that contribute towards a
 /// generated `impl Debug`.
 pub trait ImplDebug<'a> {
@@ -149,17 +151,16 @@ impl<'a> ImplDebug<'a> for Item {
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
-            TypeKind::BlockPointer |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::Comp(..) |
             TypeKind::ObjCSel => debug_print(name, quote! { #name_ident }),
 
             TypeKind::TemplateInstantiation(ref inst) => {
                 if inst.is_opaque(ctx, self) {
@@ -179,51 +180,68 @@ impl<'a> ImplDebug<'a> for Item {
                 if self.has_type_param_in_array(ctx) {
                     Some(
                         (format!("{}: Array with length {}", name, len), vec![]),
                     )
                 } else if len < RUST_DERIVE_IN_ARRAY_LIMIT {
                     // The simple case
                     debug_print(name, quote! { #name_ident })
                 } else {
-                    // Let's implement our own print function
-                    Some((
-                        format!("{}: [{{}}]", name),
-                        vec![quote! {
-                            self.#name_ident
-                                .iter()
-                                .enumerate()
-                                .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v))
-                                .collect::<String>()
-                        }],
-                    ))
+                    if ctx.options().use_core {
+                        // There is no String in core; reducing field visibility to avoid breaking
+                        // no_std setups.
+                        Some((
+                            format!("{}: [...]", name), vec![]
+                        ))
+                    } else {
+                        // Let's implement our own print function
+                        Some((
+                            format!("{}: [{{}}]", name),
+                            vec![quote! {
+                                self.#name_ident
+                                    .iter()
+                                    .enumerate()
+                                    .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v))
+                                    .collect::<String>()
+                            }],
+                        ))
+                    }
                 }
             }
             TypeKind::Vector(_, len) => {
-                let self_ids = 0..len;
-                Some((
-                    format!("{}({{}})", name),
-                    vec![quote! {
-                        #(format!("{:?}", self.#self_ids)),*
-                    }]
-                ))
+                if ctx.options().use_core {
+                    // There is no format! in core; reducing field visibility to avoid breaking
+                    // no_std setups.
+                    Some((
+                        format!("{}(...)", name), vec![]
+                    ))
+                } else {
+                    let self_ids = 0..len;
+                    Some((
+                        format!("{}({{}})", name),
+                        vec![quote! {
+                            #(format!("{:?}", self.#self_ids)),*
+                        }]
+                    ))
+                }
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 // We follow the aliases
                 ctx.resolve_item(t).impl_debug(ctx, name)
             }
 
             TypeKind::Pointer(inner) => {
                 let inner_type = ctx.resolve_type(inner).canonical_type(ctx);
                 match *inner_type.kind() {
                     TypeKind::Function(ref sig)
-                        if !sig.can_trivially_derive_debug() => {
+                        if !sig.can_trivially_derive_debug(ctx) => {
                             Some((format!("{}: FunctionPointer", name), vec![]))
                     }
                     _ => debug_print(name, quote! { #name_ident }),
                 }
             }
 
             TypeKind::Opaque => None,
         }
--- a/third_party/rust/bindgen/src/codegen/impl_partialeq.rs
+++ b/third_party/rust/bindgen/src/codegen/impl_partialeq.rs
@@ -83,17 +83,16 @@ fn gen_field(ctx: &BindgenContext, ty_it
         TypeKind::Void |
         TypeKind::NullPtr |
         TypeKind::Int(..) |
         TypeKind::Complex(..) |
         TypeKind::Float(..) |
         TypeKind::Enum(..) |
         TypeKind::TypeParam |
         TypeKind::UnresolvedTypeRef(..) |
-        TypeKind::BlockPointer |
         TypeKind::Reference(..) |
         TypeKind::ObjCInterface(..) |
         TypeKind::ObjCId |
         TypeKind::ObjCSel |
         TypeKind::Comp(..) |
         TypeKind::Pointer(_) |
         TypeKind::Function(..) |
         TypeKind::Opaque => quote_equals(name_ident),
@@ -120,14 +119,15 @@ fn gen_field(ctx: &BindgenContext, ty_it
             let other_ids = 0..len;
             quote! {
                 #(self.#self_ids == other.#other_ids &&)* true
             }
         },
 
         TypeKind::ResolvedTypeRef(t) |
         TypeKind::TemplateAlias(t, _) |
-        TypeKind::Alias(t) => {
+        TypeKind::Alias(t) |
+        TypeKind::BlockPointer(t) => {
             let inner_item = ctx.resolve_item(t);
             gen_field(ctx, inner_item, name)
         }
     }
 }
--- a/third_party/rust/bindgen/src/codegen/mod.rs
+++ b/third_party/rust/bindgen/src/codegen/mod.rs
@@ -2,17 +2,17 @@ mod impl_debug;
 mod impl_partialeq;
 mod error;
 mod helpers;
 pub mod struct_layout;
 
 #[cfg(test)]
 #[allow(warnings)]
 pub(crate) mod bitfield_unit;
-#[cfg(test)]
+#[cfg(all(test, target_endian = "little"))]
 mod bitfield_unit_tests;
 
 use self::helpers::attributes;
 use self::struct_layout::StructLayoutTracker;
 
 use super::BindgenOptions;
 
 use ir::analysis::{HasVtable, Sizedness};
@@ -98,16 +98,19 @@ struct CodegenResult<'a> {
     saw_union: bool,
 
     /// Whether an incomplete array has been generated at least once.
     saw_incomplete_array: bool,
 
     /// Whether Objective C types have been seen at least once.
     saw_objc: bool,
 
+    /// Whether Apple block types have been seen at least once.
+    saw_block: bool,
+
     /// Whether a bitfield allocation unit has been seen at least once.
     saw_bitfield_unit: bool,
 
     items_seen: HashSet<ItemId>,
     /// The set of generated function/var names, needed because in C/C++ is
     /// legal to do something like:
     ///
     /// ```c++
@@ -135,16 +138,17 @@ struct CodegenResult<'a> {
 impl<'a> CodegenResult<'a> {
     fn new(codegen_id: &'a Cell<usize>) -> Self {
         CodegenResult {
             items: vec![],
             saw_union: false,
             saw_bindgen_union: false,
             saw_incomplete_array: false,
             saw_objc: false,
+            saw_block: false,
             saw_bitfield_unit: false,
             codegen_id: codegen_id,
             items_seen: Default::default(),
             functions_seen: Default::default(),
             vars_seen: Default::default(),
             overload_counters: Default::default(),
         }
     }
@@ -161,16 +165,20 @@ impl<'a> CodegenResult<'a> {
     fn saw_incomplete_array(&mut self) {
         self.saw_incomplete_array = true;
     }
 
     fn saw_objc(&mut self) {
         self.saw_objc = true;
     }
 
+    fn saw_block(&mut self) {
+        self.saw_block = true;
+    }
+
     fn saw_bitfield_unit(&mut self) {
         self.saw_bitfield_unit = true;
     }
 
     fn seen<Id: Into<ItemId>>(&self, item: Id) -> bool {
         self.items_seen.contains(&item.into())
     }
 
@@ -210,16 +218,17 @@ impl<'a> CodegenResult<'a> {
     {
         let mut new = Self::new(self.codegen_id);
 
         cb(&mut new);
 
         self.saw_union |= new.saw_union;
         self.saw_incomplete_array |= new.saw_incomplete_array;
         self.saw_objc |= new.saw_objc;
+        self.saw_block |= new.saw_block;
         self.saw_bitfield_unit |= new.saw_bitfield_unit;
 
         new.items
     }
 }
 
 impl<'a> ops::Deref for CodegenResult<'a> {
     type Target = Vec<quote::Tokens>;
@@ -288,17 +297,16 @@ impl AppendImplicitTemplateParams for qu
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Array(..) |
             TypeKind::TypeParam |
             TypeKind::Opaque |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
-            TypeKind::BlockPointer |
             TypeKind::ObjCId |
             TypeKind::ObjCSel |
             TypeKind::TemplateInstantiation(..) => return,
             _ => {},
         }
 
         let params: Vec<_> = item.used_template_params(ctx).iter().map(|p| {
             p.try_to_rust_ty(ctx, &())
@@ -389,16 +397,19 @@ impl CodeGenerator for Module {
             for child in self.children() {
                 if ctx.codegen_items().contains(child) {
                     *found_any = true;
                     ctx.resolve_item(*child).codegen(ctx, result, &());
                 }
             }
 
             if item.id() == ctx.root_module() {
+                if result.saw_block {
+                    utils::prepend_block_header(ctx, &mut *result);
+                }
                 if result.saw_bindgen_union {
                     utils::prepend_union_types(ctx, &mut *result);
                 }
                 if result.saw_incomplete_array {
                     utils::prepend_incomplete_array_types(ctx, &mut *result);
                 }
                 if ctx.need_bindgen_complex_type() {
                     utils::prepend_complex_type(&mut *result);
@@ -559,20 +570,26 @@ impl CodeGenerator for Var {
         } else {
             let mut attrs = vec![];
             if let Some(mangled) = self.mangled_name() {
                 attrs.push(attributes::link_name(mangled));
             } else if canonical_name != self.name() {
                 attrs.push(attributes::link_name(self.name()));
             }
 
+            let maybe_mut = if self.is_const() {
+                quote! { }
+            } else {
+                quote! { mut }
+            };
+
             let mut tokens = quote!(
                 extern "C" {
                     #(#attrs)*
-                    pub static mut #canonical_ident: #ty;
+                    pub static #maybe_mut #canonical_ident: #ty;
                 }
             );
 
             result.push(tokens);
         }
     }
 }
 
@@ -592,29 +609,61 @@ impl CodeGenerator for Type {
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Array(..) |
             TypeKind::Vector(..) |
             TypeKind::Pointer(..) |
-            TypeKind::BlockPointer |
             TypeKind::Reference(..) |
             TypeKind::Function(..) |
             TypeKind::ResolvedTypeRef(..) |
             TypeKind::Opaque |
             TypeKind::TypeParam => {
                 // These items don't need code generation, they only need to be
                 // converted to rust types in fields, arguments, and such.
                 return;
             }
             TypeKind::TemplateInstantiation(ref inst) => {
                 inst.codegen(ctx, result, item)
             }
+            TypeKind::BlockPointer(inner) => {
+                if !ctx.options().generate_block {
+                    return;
+                }
+
+                let inner_item = inner.into_resolver()
+                    .through_type_refs()
+                    .resolve(ctx);
+                let name = item.canonical_name(ctx);
+
+                let inner_rust_type = {
+                    if let TypeKind::Function(fnsig) = inner_item.kind().expect_type().kind() {
+                        utils::fnsig_block(ctx, fnsig)
+                    } else {
+                        panic!("invalid block typedef: {:?}", inner_item)
+                    }
+                };
+
+                let rust_name = ctx.rust_ident(&name);
+
+                let mut tokens = if let Some(comment) = item.comment(ctx) {
+                    attributes::doc(comment)
+                } else {
+                    quote! {}
+                };
+
+                tokens.append_all(quote! {
+                    pub type #rust_name = #inner_rust_type ;
+                });
+
+                result.push(tokens);
+                result.saw_block();
+            }
             TypeKind::Comp(ref ci) => ci.codegen(ctx, result, item),
             TypeKind::TemplateAlias(inner, _) |
             TypeKind::Alias(inner) => {
                 let inner_item = inner.into_resolver()
                     .through_type_refs()
                     .resolve(ctx);
                 let name = item.canonical_name(ctx);
 
@@ -1141,17 +1190,17 @@ impl Bitfield {
         ctx: &BindgenContext,
         param_name: quote::Tokens,
         mut ctor_impl: quote::Tokens,
     ) -> quote::Tokens {
         let bitfield_ty = ctx.resolve_type(self.ty());
         let bitfield_ty_layout = bitfield_ty.layout(ctx).expect(
             "Bitfield without layout? Gah!",
         );
-        let bitfield_int_ty = helpers::blob(bitfield_ty_layout);
+        let bitfield_int_ty = helpers::blob(ctx, bitfield_ty_layout);
 
         let offset = self.offset_into_unit();
         let width = self.width() as u8;
         let prefix = ctx.trait_prefix();
 
         ctor_impl.append_all(quote! {
             __bindgen_bitfield_unit.set(
                 #offset,
@@ -1323,17 +1372,17 @@ impl<'a> FieldCodegen<'a> for Bitfield {
         let unit_field_ident = Term::new(unit_field_name, Span::call_site());
 
         let bitfield_ty_item = ctx.resolve_item(self.ty());
         let bitfield_ty = bitfield_ty_item.expect_type();
 
         let bitfield_ty_layout = bitfield_ty.layout(ctx).expect(
             "Bitfield without layout? Gah!",
         );
-        let bitfield_int_ty = match helpers::integer_type(bitfield_ty_layout) {
+        let bitfield_int_ty = match helpers::integer_type(ctx, bitfield_ty_layout) {
             Some(int_ty) => {
                 *bitfield_representable_as_int = true;
                 int_ty
             }
             None => {
                 *bitfield_representable_as_int = false;
                 return;
             }
@@ -1496,49 +1545,28 @@ impl CodeGenerator for CompInfo {
                     &mut methods,
                     (),
                 );
             }
         }
 
         let is_union = self.kind() == CompKind::Union;
         let layout = item.kind().expect_type().layout(ctx);
-        if is_union && !is_opaque && !self.is_forward_declaration() {
-            result.saw_union();
-            if !self.can_be_rust_union(ctx) {
-                result.saw_bindgen_union();
-            }
-
-            let layout = layout.expect("Unable to get layout information?");
-            let ty = helpers::blob(layout);
-
-            fields.push(if self.can_be_rust_union(ctx) {
-                quote! {
-                    _bindgen_union_align: #ty ,
-                }
-            } else {
-                struct_layout.saw_union(layout);
-
-                quote! {
-                    pub bindgen_union_field: #ty ,
-                }
-            });
-        }
 
         let mut explicit_align = None;
         if is_opaque {
             // Opaque item should not have generated methods, fields.
             debug_assert!(fields.is_empty());
             debug_assert!(methods.is_empty());
 
             match layout {
                 Some(l) => {
                     explicit_align = Some(l.align);
 
-                    let ty = helpers::blob(l);
+                    let ty = helpers::blob(ctx, l);
                     fields.push(quote! {
                         pub _bindgen_opaque_blob: #ty ,
                     });
                 }
                 None => {
                     warn!("Opaque type without layout! Expect dragons!");
                 }
             }
@@ -1551,24 +1579,50 @@ impl CodeGenerator for CompInfo {
 
             if let Some(layout) = layout {
                 if struct_layout.requires_explicit_align(layout) {
                     if layout.align == 1 {
                         packed = true;
                     } else {
                         explicit_align = Some(layout.align);
                         if !ctx.options().rust_features.repr_align {
-                            let ty = helpers::blob(Layout::new(0, layout.align));
+                            let ty = helpers::blob(ctx, Layout::new(0, layout.align));
                             fields.push(quote! {
                                 pub __bindgen_align: #ty ,
                             });
                         }
                     }
                 }
             }
+        } else if is_union && !self.is_forward_declaration() {
+            result.saw_union();
+            if !self.can_be_rust_union(ctx) {
+                result.saw_bindgen_union();
+            }
+
+            // TODO(emilio): It'd be nice to unify this with the struct path
+            // above somehow.
+            let layout = layout.expect("Unable to get layout information?");
+
+            if struct_layout.requires_explicit_align(layout) {
+                explicit_align = Some(layout.align);
+            }
+
+            let ty = helpers::blob(ctx, layout);
+            fields.push(if self.can_be_rust_union(ctx) {
+                quote! {
+                    _bindgen_union_align: #ty ,
+                }
+            } else {
+                struct_layout.saw_union(layout);
+
+                quote! {
+                    pub bindgen_union_field: #ty ,
+                }
+            });
         }
 
         // C++ requires every struct to be addressable, so what C++ compilers do
         // is making the struct 1-byte sized.
         //
         // This is apparently not the case for C, see:
         // https://github.com/rust-lang-nursery/rust-bindgen/issues/551
         //
@@ -1585,17 +1639,17 @@ impl CodeGenerator for CompInfo {
                 // Generate the address field if it's an opaque type and
                 // couldn't determine the layout of the blob.
                 layout.is_none()
             } else {
                 layout.map_or(true, |l| l.size != 0)
             };
 
             if has_address {
-                let ty = helpers::blob(Layout::new(1, 1));
+                let ty = helpers::blob(ctx, Layout::new(1, 1));
                 fields.push(quote! {
                     pub _address: #ty,
                 });
             }
         }
 
         let mut generic_param_names = vec![];
 
@@ -1742,17 +1796,17 @@ impl CodeGenerator for CompInfo {
             child_item.codegen(ctx, result, &());
         }
 
         // NOTE: Some unexposed attributes (like alignment attributes) may
         // affect layout, so we're bad and pray to the gods for avoid sending
         // all the tests to shit when parsing things like max_align_t.
         if self.found_unknown_attr() {
             warn!(
-                "Type {} has an unkown attribute that may affect layout",
+                "Type {} has an unknown attribute that may affect layout",
                 canonical_ident.as_str()
             );
         }
 
         if all_template_params.is_empty() {
             if !is_opaque {
                 for var in self.inner_vars() {
                     ctx.resolve_item(*var).codegen(ctx, result, &());
@@ -1915,18 +1969,20 @@ impl CodeGenerator for CompInfo {
         if needs_debug_impl {
             let impl_ = impl_debug::gen_debug_impl(
                 ctx,
                 self.fields(),
                 item,
                 self.kind(),
             );
 
+            let prefix = ctx.trait_prefix();
+
             result.push(quote! {
-                impl #generics ::std::fmt::Debug for #ty_for_impl {
+                impl #generics ::#prefix::fmt::Debug for #ty_for_impl {
                     #impl_
                 }
             });
         }
 
         if needs_partialeq_impl {
             if let Some(impl_) = impl_partialeq::gen_partialeq_impl(ctx, self, item, &ty_for_impl) {
 
@@ -2511,47 +2567,43 @@ impl CodeGenerator for Enum {
             (true, 8) => "i64",
             (false, 8) => "u64",
             _ => {
                 warn!("invalid enum decl: signed: {}, size: {}", signed, size);
                 "i32"
             }
         };
 
-        // ModuleConsts has higher precedence before Rust in order to avoid problems with
-        // overlapping match patterns
-        let variation = if self.is_constified_enum_module(ctx, item) {
-            EnumVariation::ModuleConsts
-        } else if self.is_bitfield(ctx, item) {
-            EnumVariation::Bitfield
-        } else if self.is_rustified_enum(ctx, item) {
-            EnumVariation::Rust
-        } else if self.is_constified_enum(ctx, item) {
-            EnumVariation::Consts
-        } else {
-            ctx.options().default_enum_style
-        };
-
         let mut attrs = vec![];
 
+        let variation = self.computed_enum_variation(ctx, item);
+
         // TODO(emilio): Delegate this to the builders?
         if variation.is_rust() {
             attrs.push(attributes::repr(repr_name));
         } else if variation.is_bitfield() {
             attrs.push(attributes::repr("C"));
         }
 
         if let Some(comment) = item.comment(ctx) {
             attrs.push(attributes::doc(comment));
         }
 
         if !variation.is_const() {
-            attrs.push(attributes::derives(
-                &["Debug", "Copy", "Clone", "PartialEq", "Eq", "Hash"],
-            ));
+            let mut derives = vec!["Debug", "Copy", "Clone", "PartialEq", "Eq", "Hash"];
+
+            if item.can_derive_partialord(ctx) {
+                derives.push("PartialOrd");
+            }
+
+            if item.can_derive_ord(ctx) {
+                derives.push("Ord");
+            }
+
+            attrs.push(attributes::derives(&derives));
         }
 
         fn add_constant<'a>(
             ctx: &BindgenContext,
             enum_: &Type,
             // Only to avoid recomputing every time.
             enum_canonical_name: &Term,
             // May be the same as "variant" if it's because the
@@ -2754,17 +2806,17 @@ trait TryToOpaque {
 
     /// Do not override this provided trait method.
     fn try_to_opaque(
         &self,
         ctx: &BindgenContext,
         extra: &Self::Extra,
     ) -> error::Result<quote::Tokens> {
         self.try_get_layout(ctx, extra).map(|layout| {
-            helpers::blob(layout)
+            helpers::blob(ctx, layout)
         })
     }
 }
 
 /// Infallible conversion of an IR thing to an opaque blob.
 ///
 /// The resulting layout is best effort, and is unfortunately not guaranteed to
 /// be correct. When all else fails, we fall back to a single byte layout as a
@@ -2781,17 +2833,17 @@ trait ToOpaque: TryToOpaque {
     }
 
     fn to_opaque(
         &self,
         ctx: &BindgenContext,
         extra: &Self::Extra,
     ) -> quote::Tokens {
         let layout = self.get_layout(ctx, extra);
-        helpers::blob(layout)
+        helpers::blob(ctx, layout)
     }
 }
 
 impl<T> ToOpaque for T
 where
     T: TryToOpaque,
 {
 }
@@ -2839,17 +2891,17 @@ where
         &self,
         ctx: &BindgenContext,
         extra: &E,
     ) -> error::Result<quote::Tokens> {
         self.try_to_rust_ty(ctx, extra).or_else(
             |_| if let Ok(layout) =
                 self.try_get_layout(ctx, extra)
             {
-                Ok(helpers::blob(layout))
+                Ok(helpers::blob(ctx, layout))
             } else {
                 Err(error::Error::NoLayoutForOpaqueBlob)
             },
         )
     }
 }
 
 /// Infallible conversion to a Rust type, or an opaque blob with a best effort
@@ -2991,17 +3043,17 @@ impl TryToRustTy for Type {
                     IntKind::UShort => Ok(raw_type(ctx, "c_ushort")),
                     IntKind::Int => Ok(raw_type(ctx, "c_int")),
                     IntKind::UInt => Ok(raw_type(ctx, "c_uint")),
                     IntKind::Long => Ok(raw_type(ctx, "c_long")),
                     IntKind::ULong => Ok(raw_type(ctx, "c_ulong")),
                     IntKind::LongLong => Ok(raw_type(ctx, "c_longlong")),
                     IntKind::ULongLong => Ok(raw_type(ctx, "c_ulonglong")),
                     IntKind::WChar { size } => {
-                        let ty = Layout::known_type_for_size(size)
+                        let ty = Layout::known_type_for_size(ctx, size)
                             .expect("Non-representable wchar_t?");
                         let ident = ctx.rust_ident_raw(ty);
                         Ok(quote! { #ident })
                     },
 
                     IntKind::I8 => Ok(quote! { i8 }),
                     IntKind::U8 => Ok(quote! { u8 }),
                     IntKind::I16 => Ok(quote! { i16 }),
@@ -3013,27 +3065,37 @@ impl TryToRustTy for Type {
                     IntKind::Custom {
                         name, ..
                     } => {
                         let ident = ctx.rust_ident_raw(name);
                         Ok(quote! {
                             #ident
                         })
                     }
-                    // FIXME: This doesn't generate the proper alignment, but we
-                    // can't do better right now. We should be able to use
-                    // i128/u128 when they're available.
-                    IntKind::U128 | IntKind::I128 => {
-                        Ok(quote! { [u64; 2] })
+                    IntKind::U128 => {
+                        Ok(if ctx.options().rust_features.i128_and_u128 {
+                            quote! { u128 }
+                        } else {
+                            // Best effort thing, but wrong alignment
+                            // unfortunately.
+                            quote! { [u64; 2] }
+                        })
+                    }
+                    IntKind::I128 => {
+                        Ok(if ctx.options().rust_features.i128_and_u128 {
+                            quote! { i128 }
+                        } else {
+                            quote! { [u64; 2] }
+                        })
                     }
                 }
             }
-            TypeKind::Float(fk) => Ok(float_kind_rust_type(ctx, fk)),
+            TypeKind::Float(fk) => Ok(float_kind_rust_type(ctx, fk, self.layout(ctx))),
             TypeKind::Complex(fk) => {
-                let float_path = float_kind_rust_type(ctx, fk);
+                let float_path = float_kind_rust_type(ctx, fk, self.layout(ctx));
 
                 ctx.generated_bindgen_complex();
                 Ok(if ctx.options().enable_cxx_namespaces {
                     quote! {
                         root::__BindgenComplex<#float_path>
                     }
                 } else {
                     quote! {
@@ -3064,53 +3126,46 @@ impl TryToRustTy for Type {
                 let path = Term::new(&path.join("::"), Span::call_site());
                 Ok(quote!(#path))
             }
             TypeKind::TemplateInstantiation(ref inst) => {
                 inst.try_to_rust_ty(ctx, item)
             }
             TypeKind::ResolvedTypeRef(inner) => inner.try_to_rust_ty(ctx, &()),
             TypeKind::TemplateAlias(..) |
-            TypeKind::Alias(..) => {
+            TypeKind::Alias(..) |
+            TypeKind::BlockPointer(..) => {
+                if self.is_block_pointer() && !ctx.options().generate_block {
+                    let void = raw_type(ctx, "c_void");
+                    return Ok(void.to_ptr(/* is_const = */ false));
+                }
                 let template_params = item.used_template_params(ctx)
                     .into_iter()
                     .filter(|param| param.is_template_param(ctx, &()))
                     .collect::<Vec<_>>();
 
-                let spelling = self.name().expect("Unnamed alias?");
                 if item.is_opaque(ctx, &()) && !template_params.is_empty() {
                     self.try_to_opaque(ctx, item)
-                } else if let Some(ty) = utils::type_from_named(
-                    ctx,
-                    spelling,
-                )
-                {
+                } else if let Some(ty) = self.name().and_then(|name| utils::type_from_named(ctx, name)) {
                     Ok(ty)
                 } else {
                     utils::build_path(item, ctx)
                 }
             }
             TypeKind::Comp(ref info) => {
                 let template_params = item.all_template_params(ctx);
                 if info.has_non_type_template_params() ||
                     (item.is_opaque(ctx, &()) && !template_params.is_empty())
                 {
                     return self.try_to_opaque(ctx, item);
                 }
 
                 utils::build_path(item, ctx)
             }
             TypeKind::Opaque => self.try_to_opaque(ctx, item),
-            TypeKind::BlockPointer => {
-                let void = raw_type(ctx, "c_void");
-                Ok(void.to_ptr(
-                    /* is_const = */
-                    false
-                ))
-            }
             TypeKind::Pointer(inner) |
             TypeKind::Reference(inner) => {
                 let is_const = ctx.resolve_type(inner).is_const();
 
                 let inner = inner.into_resolver().through_type_refs().resolve(ctx);
                 let inner_ty = inner.expect_type();
 
                 // Regardless if we can properly represent the inner type, we
@@ -3553,16 +3608,35 @@ mod utils {
             pub type id = *mut objc::runtime::Object;
         };
 
         let items = vec![use_objc, id_type];
         let old_items = mem::replace(result, items);
         result.extend(old_items.into_iter());
     }
 
+    pub fn prepend_block_header(
+        ctx: &BindgenContext,
+        result: &mut Vec<quote::Tokens>,
+    ) {
+        let use_block = if ctx.options().block_extern_crate {
+            quote! {
+                extern crate block;
+            }
+        } else {
+            quote! {
+                use block;
+            }
+        };
+
+        let items = vec![use_block];
+        let old_items = mem::replace(result, items);
+        result.extend(old_items.into_iter());
+    }
+
     pub fn prepend_union_types(
         ctx: &BindgenContext,
         result: &mut Vec<quote::Tokens>,
     ) {
         let prefix = ctx.trait_prefix();
 
         // TODO(emilio): The fmt::Debug impl could be way nicer with
         // std::intrinsics::type_name, but...
@@ -3609,17 +3683,17 @@ mod utils {
         };
 
         let union_field_copy_impl = quote! {
             impl<T> ::#prefix::marker::Copy for __BindgenUnionField<T> {}
         };
 
         let union_field_debug_impl = quote! {
             impl<T> ::#prefix::fmt::Debug for __BindgenUnionField<T> {
-                fn fmt(&self, fmt: &mut ::#prefix::fmt::Formatter)
+                fn fmt(&self, fmt: &mut ::#prefix::fmt::Formatter<'_>)
                        -> ::#prefix::fmt::Result {
                     fmt.write_str("__BindgenUnionField")
                 }
             }
         };
 
         // The actual memory of the filed will be hashed, so that's why these
         // field doesn't do anything with the hash.
@@ -3696,17 +3770,17 @@ mod utils {
                 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
                     ::#prefix::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
                 }
             }
         };
 
         let incomplete_array_debug_impl = quote! {
             impl<T> ::#prefix::fmt::Debug for __IncompleteArrayField<T> {
-                fn fmt(&self, fmt: &mut ::#prefix::fmt::Formatter)
+                fn fmt(&self, fmt: &mut ::#prefix::fmt::Formatter<'_>)
                        -> ::#prefix::fmt::Result {
                     fmt.write_str("__IncompleteArrayField")
                 }
             }
         };
 
         let incomplete_array_clone_impl = quote! {
             impl<T> ::#prefix::clone::Clone for __IncompleteArrayField<T> {
@@ -3864,9 +3938,31 @@ mod utils {
         }).collect::<Vec<_>>();
 
         if sig.is_variadic() {
             args.push(quote! { ... })
         }
 
         args
     }
+
+    pub fn fnsig_block(
+        ctx: &BindgenContext,
+        sig: &FunctionSig,
+    ) -> quote::Tokens {
+        let args = sig.argument_types().iter().map(|&(_, ty)| {
+            let arg_item = ctx.resolve_item(ty);
+
+            arg_item.to_rust_ty_or_opaque(ctx, &())
+        });
+
+        let return_item = ctx.resolve_item(sig.return_type());
+        let ret_ty = if let TypeKind::Void = *return_item.kind().expect_type().kind() {
+            quote! { () }
+        } else {
+            return_item.to_rust_ty_or_opaque(ctx, &())
+        };
+
+        quote! {
+            *const ::block::Block<(#(#args),*), #ret_ty>
+        }
+    }
 }
--- a/third_party/rust/bindgen/src/codegen/struct_layout.rs
+++ b/third_party/rust/bindgen/src/codegen/struct_layout.rs
@@ -282,36 +282,41 @@ impl<'a> StructLayoutTracker<'a> {
 
             Some(self.padding_field(layout))
         } else {
             None
         }
     }
 
     pub fn requires_explicit_align(&self, layout: Layout) -> bool {
+        let repr_align = self.ctx.options().rust_features().repr_align;
+
+        // Always force explicit repr(align) for stuff more than 16-byte aligned
+        // to work-around https://github.com/rust-lang/rust/issues/54341.
+        //
+        // Worst-case this just generates redundant alignment attributes.
+        if repr_align && self.max_field_align >= 16 {
+            return true;
+        }
+
         if self.max_field_align >= layout.align {
             return false;
         }
-        // At this point we require explicit alignment, but we may not be able
-        // to generate the right bits, let's double check.
-        if self.ctx.options().rust_features().repr_align {
-            return true;
-        }
 
         // We can only generate up-to a word of alignment unless we support
         // repr(align).
-        layout.align <= self.ctx.target_pointer_size()
+        repr_align || layout.align <= self.ctx.target_pointer_size()
     }
 
     fn padding_bytes(&self, layout: Layout) -> usize {
         align_to(self.latest_offset, layout.align) - self.latest_offset
     }
 
     fn padding_field(&mut self, layout: Layout) -> quote::Tokens {
-        let ty = helpers::blob(layout);
+        let ty = helpers::blob(self.ctx, layout);
         let padding_count = self.padding_count;
 
         self.padding_count += 1;
 
         let padding_field_name = Term::new(&format!("__bindgen_padding_{}", padding_count), Span::call_site());
 
         self.max_field_align = cmp::max(self.max_field_align, layout.align);
 
--- a/third_party/rust/bindgen/src/features.rs
+++ b/third_party/rust/bindgen/src/features.rs
@@ -91,16 +91,18 @@ macro_rules! rust_target_base {
             /// Rust stable 1.19
             => Stable_1_19 => 1.19;
             /// Rust stable 1.20
             => Stable_1_20 => 1.20;
             /// Rust stable 1.21
             => Stable_1_21 => 1.21;
             /// Rust stable 1.25
             => Stable_1_25 => 1.25;
+            /// Rust stable 1.26
+            => Stable_1_26 => 1.26;
             /// Nightly rust
             => Nightly => nightly;
         );
     }
 }
 
 rust_target_base!(rust_target_def);
 rust_target_base!(rust_target_values_def);
@@ -167,16 +169,20 @@ rust_feature_def!(
     Stable_1_21 {
         /// builtin impls for `Clone` ([PR](https://github.com/rust-lang/rust/pull/43690))
         => builtin_clone_impls;
     }
     Stable_1_25 {
         /// repr(align) ([PR](https://github.com/rust-lang/rust/pull/47006))
         => repr_align;
     }
+    Stable_1_26 {
+        /// [i128 / u128 support](https://doc.rust-lang.org/std/primitive.i128.html)
+        => i128_and_u128;
+    }
     Nightly {
         /// `thiscall` calling convention ([Tracking issue](https://github.com/rust-lang/rust/issues/42202))
         => thiscall_abi;
     }
 );
 
 impl Default for RustFeatures {
     fn default() -> Self {
--- a/third_party/rust/bindgen/src/ir/analysis/derive_copy.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/derive_copy.rs
@@ -144,17 +144,17 @@ impl<'ctx> MonotoneFramework for CannotD
         };
 
         if self.ctx.no_copy_by_name(&item) {
             return self.insert(id);
         }
 
         if item.is_opaque(self.ctx, &()) {
             let layout_can_derive = ty.layout(self.ctx).map_or(true, |l| {
-                l.opaque().can_trivially_derive_copy()
+                l.opaque().can_trivially_derive_copy(self.ctx)
             });
             return if layout_can_derive {
                 trace!("    we can trivially derive Copy for the layout");
                 ConstrainResult::Same
             } else {
                 trace!("    we cannot derive Copy for the layout");
                 self.insert(id)
             };
@@ -168,17 +168,16 @@ impl<'ctx> MonotoneFramework for CannotD
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Vector(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
             TypeKind::TypeParam |
-            TypeKind::BlockPointer |
             TypeKind::Pointer(..) |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!("    simple type that can always derive Copy");
                 ConstrainResult::Same
             }
@@ -199,17 +198,18 @@ impl<'ctx> MonotoneFramework for CannotD
                 } else {
                     trace!("    array cannot derive Copy with 0 length");
                     self.insert(id)
                 }
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 let cant_derive_copy = self.is_not_copy(t);
                 if cant_derive_copy {
                     trace!(
                         "    arrays of T for which we cannot derive Copy \
                             also cannot derive Copy"
                     );
                     return self.insert(id);
                 }
--- a/third_party/rust/bindgen/src/ir/analysis/derive_debug.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/derive_debug.rs
@@ -141,17 +141,17 @@ impl<'ctx> MonotoneFramework for CannotD
             None => {
                 trace!("    not a type; ignoring");
                 return ConstrainResult::Same;
             }
         };
 
         if item.is_opaque(self.ctx, &()) {
             let layout_can_derive = ty.layout(self.ctx).map_or(true, |l| {
-                l.opaque().can_trivially_derive_debug()
+                l.opaque().can_trivially_derive_debug(self.ctx)
             });
             return if layout_can_derive &&
                       !(ty.is_union() &&
                         self.ctx.options().rust_features().untagged_union) {
                 trace!("    we can trivially derive Debug for the layout");
                 ConstrainResult::Same
             } else {
                 trace!("    we cannot derive Debug for the layout");
@@ -178,17 +178,16 @@ impl<'ctx> MonotoneFramework for CannotD
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
             TypeKind::Vector(..) |
-            TypeKind::BlockPointer |
             TypeKind::TypeParam |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!("    simple type that can always derive Debug");
                 ConstrainResult::Same
             }
@@ -208,17 +207,18 @@ impl<'ctx> MonotoneFramework for CannotD
                 } else {
                     trace!("    array is too large to derive Debug");
                     self.insert(id)
                 }
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 if self.is_not_debug(t) {
                     trace!(
                         "    aliases and type refs to T which cannot derive \
                             Debug also cannot derive Debug"
                     );
                     self.insert(id)
                 } else {
                     trace!(
@@ -237,17 +237,17 @@ impl<'ctx> MonotoneFramework for CannotD
 
                 if info.kind() == CompKind::Union {
                     if self.ctx.options().rust_features().untagged_union {
                         trace!("    cannot derive Debug for Rust unions");
                         return self.insert(id);
                     }
 
                     if ty.layout(self.ctx).map_or(true, |l| {
-                        l.opaque().can_trivially_derive_debug()
+                        l.opaque().can_trivially_derive_debug(self.ctx)
                     })
                     {
                         trace!("    union layout can trivially derive Debug");
                         return ConstrainResult::Same;
                     } else {
                         trace!("    union layout cannot derive Debug");
                         return self.insert(id);
                     }
@@ -294,17 +294,17 @@ impl<'ctx> MonotoneFramework for CannotD
                 trace!("    comp can derive Debug");
                 ConstrainResult::Same
             }
 
             TypeKind::Pointer(inner) => {
                 let inner_type =
                     self.ctx.resolve_type(inner).canonical_type(self.ctx);
                 if let TypeKind::Function(ref sig) = *inner_type.kind() {
-                    if !sig.can_trivially_derive_debug() {
+                    if !sig.can_trivially_derive_debug(self.ctx) {
                         trace!(
                             "    function pointer that can't trivially derive Debug"
                         );
                         return self.insert(id);
                     }
                 }
                 trace!("    pointers can derive Debug");
                 ConstrainResult::Same
--- a/third_party/rust/bindgen/src/ir/analysis/derive_default.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/derive_default.rs
@@ -168,17 +168,17 @@ impl<'ctx> MonotoneFramework for CannotD
             None => {
                 trace!("    not a type; ignoring");
                 return ConstrainResult::Same;
             }
         };
 
         if item.is_opaque(self.ctx, &()) {
             let layout_can_derive = ty.layout(self.ctx).map_or(true, |l| {
-                l.opaque().can_trivially_derive_default()
+                l.opaque().can_trivially_derive_default(self.ctx)
             });
             return if layout_can_derive &&
                       !(ty.is_union() &&
                         self.ctx.options().rust_features().untagged_union) {
                 trace!("    we can trivially derive Default for the layout");
                 ConstrainResult::Same
             } else {
                 trace!("    we cannot derive Default for the layout");
@@ -210,17 +210,16 @@ impl<'ctx> MonotoneFramework for CannotD
                 ConstrainResult::Same
             }
 
             TypeKind::Void |
             TypeKind::TypeParam |
             TypeKind::Reference(..) |
             TypeKind::NullPtr |
             TypeKind::Pointer(..) |
-            TypeKind::BlockPointer |
             TypeKind::ObjCId |
             TypeKind::ObjCSel |
             TypeKind::ObjCInterface(..) |
             TypeKind::Enum(..) => {
                 trace!("    types that always cannot derive Default");
                 self.insert(id)
             }
 
@@ -239,17 +238,18 @@ impl<'ctx> MonotoneFramework for CannotD
                 } else {
                     trace!("    array is too large to derive Default");
                     self.insert(id)
                 }
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 if self.is_not_default(t) {
                     trace!(
                         "    aliases and type refs to T which cannot derive \
                             Default also cannot derive Default"
                     );
                     self.insert(id)
                 } else {
                     trace!(
@@ -273,17 +273,17 @@ impl<'ctx> MonotoneFramework for CannotD
 
                 if info.kind() == CompKind::Union {
                     if self.ctx.options().rust_features().untagged_union {
                         trace!("    cannot derive Default for Rust unions");
                         return self.insert(id);
                     }
 
                     if ty.layout(self.ctx).map_or(true, |l| {
-                        l.opaque().can_trivially_derive_default()
+                        l.opaque().can_trivially_derive_default(self.ctx)
                     })
                     {
                         trace!("    union layout can trivially derive Default");
                         return ConstrainResult::Same;
                     } else {
                         trace!("    union layout cannot derive Default");
                         return self.insert(id);
                     }
--- a/third_party/rust/bindgen/src/ir/analysis/derive_hash.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/derive_hash.rs
@@ -128,17 +128,17 @@ impl<'ctx> MonotoneFramework for CannotD
         };
 
         if self.ctx.no_hash_by_name(&item) {
             return self.insert(id)
         }
 
         if item.is_opaque(self.ctx, &()) {
             let layout_can_derive = ty.layout(self.ctx).map_or(true, |l| {
-                l.opaque().can_trivially_derive_hash()
+                l.opaque().can_trivially_derive_hash(self.ctx)
             });
             return if layout_can_derive &&
                 !(ty.is_union() &&
                   self.ctx.options().rust_features().untagged_union) {
                 trace!("    we can trivially derive Hash for the layout");
                 ConstrainResult::Same
             } else {
                 trace!("    we cannot derive Hash for the layout");
@@ -162,17 +162,16 @@ impl<'ctx> MonotoneFramework for CannotD
             // Handle the simple cases. These can derive hash without further
             // information.
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Enum(..) |
             TypeKind::TypeParam |
             TypeKind::UnresolvedTypeRef(..) |
-            TypeKind::BlockPointer |
             TypeKind::Reference(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!("    simple type that can always derive Hash");
                 ConstrainResult::Same
             }
 
@@ -214,39 +213,40 @@ impl<'ctx> MonotoneFramework for CannotD
                 trace!("    vector can derive Hash");
                 ConstrainResult::Same
             }
 
             TypeKind::Pointer(inner) => {
                 let inner_type =
                     self.ctx.resolve_type(inner).canonical_type(self.ctx);
                 if let TypeKind::Function(ref sig) = *inner_type.kind() {
-                    if !sig.can_trivially_derive_hash() {
+                    if !sig.can_trivially_derive_hash(self.ctx) {
                         trace!(
                             "    function pointer that can't trivially derive Hash"
                         );
                         return self.insert(id);
                     }
                 }
                 trace!("    pointers can derive Hash");
                 ConstrainResult::Same
             }
 
             TypeKind::Function(ref sig) => {
-                if !sig.can_trivially_derive_hash() {
+                if !sig.can_trivially_derive_hash(self.ctx) {
                     trace!("    function that can't trivially derive Hash");
                     return self.insert(id);
                 }
                 trace!("    function can derive Hash");
                 ConstrainResult::Same
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 if self.cannot_derive_hash.contains(&t.into()) {
                     trace!(
                         "    aliases and type refs to T which cannot derive \
                             Hash also cannot derive Hash"
                     );
                     self.insert(id)
                 } else {
                     trace!(
@@ -270,17 +270,17 @@ impl<'ctx> MonotoneFramework for CannotD
 
                 if info.kind() == CompKind::Union {
                     if self.ctx.options().rust_features().untagged_union {
                         trace!("    cannot derive Hash for Rust unions");
                         return self.insert(id);
                     }
 
                     if ty.layout(self.ctx).map_or(true, |l| {
-                        l.opaque().can_trivially_derive_hash()
+                        l.opaque().can_trivially_derive_hash(self.ctx)
                     })
                     {
                         trace!("    union layout can trivially derive Hash");
                         return ConstrainResult::Same;
                     } else {
                         trace!("    union layout cannot derive Hash");
                         return self.insert(id);
                     }
--- a/third_party/rust/bindgen/src/ir/analysis/derive_partialeq_or_partialord.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/derive_partialeq_or_partialord.rs
@@ -38,17 +38,17 @@ use std::collections::hash_map::Entry;
 ///
 /// * If T is an instantiation of an abstract template definition, T cannot be
 ///   derived `PartialEq`/`PartialOrd` if any of the template arguments or
 ///   template definition cannot derive `PartialEq`/`PartialOrd`.
 #[derive(Debug, Clone)]
 pub struct CannotDerivePartialEqOrPartialOrd<'ctx> {
     ctx: &'ctx BindgenContext,
 
-    // The incremental result of this analysis's computation. 
+    // The incremental result of this analysis's computation.
     // Contains information whether particular item can derive `PartialEq`/`PartialOrd`.
     can_derive_partialeq_or_partialord: HashMap<ItemId, CanDerive>,
 
     // Dependencies saying that if a key ItemId has been inserted into the
     // `cannot_derive_partialeq_or_partialord` set, then each of the ids
     // in Vec<ItemId> need to be considered again.
     //
     // This is a subset of the natural IR graph with reversed edges, where we
@@ -124,17 +124,17 @@ impl<'ctx> CannotDerivePartialEqOrPartia
                 trace!(
                     "    cannot derive `PartialEq`/`PartialOrd` for Rust unions"
                 );
                 return CanDerive::No;
             }
 
             let layout_can_derive = ty.layout(self.ctx)
                 .map_or(CanDerive::Yes, |l| {
-                    l.opaque().can_trivially_derive_partialeq_or_partialord()
+                    l.opaque().can_trivially_derive_partialeq_or_partialord(self.ctx)
                 });
 
             match layout_can_derive {
                 CanDerive::Yes => {
                     trace!(
                         "    we can trivially derive `PartialEq`/`PartialOrd` for the layout"
                     );
                 }
@@ -153,17 +153,16 @@ impl<'ctx> CannotDerivePartialEqOrPartia
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Complex(..) |
             TypeKind::Float(..) |
             TypeKind::Enum(..) |
             TypeKind::TypeParam |
             TypeKind::UnresolvedTypeRef(..) |
-            TypeKind::BlockPointer |
             TypeKind::Reference(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!(
                     "    simple type that can always derive `PartialEq`/`PartialOrd`"
                 );
                 return CanDerive::Yes;
@@ -206,31 +205,31 @@ impl<'ctx> CannotDerivePartialEqOrPartia
                 trace!("    vectors cannot derive `PartialEq`/`PartialOrd`");
                 return CanDerive::No;
             }
 
             TypeKind::Pointer(inner) => {
                 let inner_type =
                     self.ctx.resolve_type(inner).canonical_type(self.ctx);
                 if let TypeKind::Function(ref sig) = *inner_type.kind() {
-                    if sig.can_trivially_derive_partialeq_or_partialord()
+                    if sig.can_trivially_derive_partialeq_or_partialord(self.ctx)
                         != CanDerive::Yes
                     {
                         trace!(
                             "    function pointer that can't trivially derive `PartialEq`/`PartialOrd`"
                         );
                         return CanDerive::No;
                     }
                 }
                 trace!("    pointers can derive `PartialEq`/`PartialOrd`");
                 return CanDerive::Yes;
             }
 
             TypeKind::Function(ref sig) => {
-                if sig.can_trivially_derive_partialeq_or_partialord()
+                if sig.can_trivially_derive_partialeq_or_partialord(self.ctx)
                     != CanDerive::Yes
                 {
                     trace!(
                         "    function that can't trivially derive `PartialEq`/`PartialOrd`"
                     );
                     return CanDerive::No;
                 }
                 trace!("    function can derive `PartialEq`/`PartialOrd`");
@@ -254,17 +253,17 @@ impl<'ctx> CannotDerivePartialEqOrPartia
                             "    cannot derive `PartialEq`/`PartialOrd` for Rust unions"
                         );
                         return CanDerive::No;
                     }
 
                     let layout_can_derive =
                         ty.layout(self.ctx).map_or(CanDerive::Yes, |l| {
                             l.opaque()
-                                .can_trivially_derive_partialeq_or_partialord()
+                                .can_trivially_derive_partialeq_or_partialord(self.ctx)
                         });
                     match layout_can_derive {
                         CanDerive::Yes => {
                             trace!(
                                 "    union layout can trivially derive `PartialEq`/`PartialOrd`"
                             );
                         }
                         _ => {
@@ -276,16 +275,17 @@ impl<'ctx> CannotDerivePartialEqOrPartia
                     return layout_can_derive;
                 }
                 return self.constrain_join(item);
             }
 
             TypeKind::ResolvedTypeRef(..) |
             TypeKind::TemplateAlias(..) |
             TypeKind::Alias(..) |
+            TypeKind::BlockPointer(..) |
             TypeKind::TemplateInstantiation(..) => {
                 return self.constrain_join(item);
             }
 
             TypeKind::Opaque => unreachable!(
                 "The early ty.is_opaque check should have handled this case"
             ),
         }
--- a/third_party/rust/bindgen/src/ir/analysis/has_float.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/has_float.rs
@@ -117,17 +117,16 @@ impl<'ctx> MonotoneFramework for HasFloa
 
         match *ty.kind() {
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
-            TypeKind::BlockPointer |
             TypeKind::TypeParam |
             TypeKind::Opaque |
             TypeKind::Pointer(..) |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!("    simple type that do not have float");
@@ -154,17 +153,18 @@ impl<'ctx> MonotoneFramework for HasFloa
                     return self.insert(id)
                 }
                 trace!("    Vector with type T that do not have float also do not have float");
                 ConstrainResult::Same
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 if self.has_float.contains(&t.into()) {
                     trace!("    aliases and type refs to T which have float \
                             also have float");
                     self.insert(id)
                 } else {
                     trace!("    aliases and type refs to T which do not have float \
                             also do not have floaarrayt");
                     ConstrainResult::Same
--- a/third_party/rust/bindgen/src/ir/analysis/has_type_param_in_array.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/has_type_param_in_array.rs
@@ -130,17 +130,16 @@ impl<'ctx> MonotoneFramework for HasType
             TypeKind::NullPtr |
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Vector(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
-            TypeKind::BlockPointer |
             TypeKind::TypeParam |
             TypeKind::Opaque |
             TypeKind::Pointer(..) |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::ObjCInterface(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel => {
                 trace!("    simple type that do not have array");
@@ -161,17 +160,18 @@ impl<'ctx> MonotoneFramework for HasType
                         );
                         ConstrainResult::Same
                     }
                 }
             }
 
             TypeKind::ResolvedTypeRef(t) |
             TypeKind::TemplateAlias(t, _) |
-            TypeKind::Alias(t) => {
+            TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) => {
                 if self.has_type_parameter_in_array.contains(&t.into()) {
                     trace!(
                         "    aliases and type refs to T which have array \
                             also have array"
                     );
                     self.insert(id)
                 } else {
                     trace!(
--- a/third_party/rust/bindgen/src/ir/analysis/sizedness.rs
+++ b/third_party/rust/bindgen/src/ir/analysis/sizedness.rs
@@ -256,31 +256,31 @@ impl<'ctx> MonotoneFramework for Sizedne
 
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
             TypeKind::NullPtr |
-            TypeKind::BlockPointer |
             TypeKind::ObjCId |
             TypeKind::ObjCSel |
             TypeKind::Pointer(..) => {
                 trace!("    {:?} is known not to be zero-sized", ty.kind());
                 self.insert(id, SizednessResult::NonZeroSized)
             }
 
             TypeKind::ObjCInterface(..) => {
                 trace!("    obj-c interfaces always have at least the `isa` pointer");
                 self.insert(id, SizednessResult::NonZeroSized)
             }
 
             TypeKind::TemplateAlias(t, _) |
             TypeKind::Alias(t) |
+            TypeKind::BlockPointer(t) |
             TypeKind::ResolvedTypeRef(t) => {
                 trace!("    aliases and type refs forward to their inner type");
                 self.forward(t, id)
             }
 
             TypeKind::TemplateInstantiation(ref inst) => {
                 trace!("    template instantiations are zero-sized if their \
                         definition is zero-sized");
--- a/third_party/rust/bindgen/src/ir/comment.rs
+++ b/third_party/rust/bindgen/src/ir/comment.rs
@@ -30,68 +30,60 @@ fn kind(comment: &str) -> Option<Kind> {
         Some(Kind::SingleLines)
     } else {
         None
     }
 }
 
 fn make_indent(indent: usize) -> String {
     const RUST_INDENTATION: usize = 4;
-
     iter::repeat(' ').take(indent * RUST_INDENTATION).collect()
 }
 
 /// Preprocesses multiple single line comments.
 ///
 /// Handles lines starting with both `//` and `///`.
 fn preprocess_single_lines(comment: &str, indent: usize) -> String {
     debug_assert!(comment.starts_with("//"), "comment is not single line");
 
     let indent = make_indent(indent);
     let mut is_first = true;
     let lines: Vec<_> = comment
         .lines()
-        .map(|l| l.trim_left_matches('/').trim())
+        .map(|l| l.trim().trim_left_matches('/'))
         .map(|l| {
             let indent = if is_first { "" } else { &*indent };
             is_first = false;
-            let maybe_space = if l.is_empty() { "" } else { " " };
-            format!("{}///{}{}", indent, maybe_space, l)
+            format!("{}///{}", indent, l)
         })
         .collect();
     lines.join("\n")
 }
 
 fn preprocess_multi_line(comment: &str, indent: usize) -> String {
     let comment = comment
         .trim_left_matches('/')
-        .trim_left_matches('*')
-        .trim_left_matches('!')
         .trim_right_matches('/')
-        .trim_right_matches('*')
-        .trim();
+        .trim_right_matches('*');
 
     let indent = make_indent(indent);
     // Strip any potential `*` characters preceding each line.
     let mut is_first = true;
     let mut lines: Vec<_> = comment.lines()
-        .map(|line| line.trim().trim_left_matches('*').trim())
-        .skip_while(|line| line.is_empty()) // Skip the first empty lines.
+        .map(|line| line.trim().trim_left_matches('*').trim_left_matches('!'))
+        .skip_while(|line| line.trim().is_empty()) // Skip the first empty lines.
         .map(|line| {
             let indent = if is_first { "" } else { &*indent };
             is_first = false;
-            let maybe_space = if line.is_empty() { "" } else { " " };
-            format!("{}///{}{}", indent, maybe_space, line)
+            format!("{}///{}", indent, line)
         })
         .collect();
 
     // Remove the trailing line corresponding to the `*/`.
-    let last_line_is_empty = lines.last().map_or(false, |l| l.is_empty());
-
-    if last_line_is_empty {
+    if lines.last().map_or(false, |l| l.trim().is_empty() || l.trim() == "///") {
         lines.pop();
     }
 
     lines.join("\n")
 }
 
 #[cfg(test)]
 mod test {
@@ -102,23 +94,24 @@ mod test {
         assert_eq!(kind("/// hello"), Some(Kind::SingleLines));
         assert_eq!(kind("/** world */"), Some(Kind::MultiLine));
     }
 
     #[test]
     fn processes_single_lines_correctly() {
         assert_eq!(preprocess("/// hello", 0), "/// hello");
         assert_eq!(preprocess("// hello", 0), "/// hello");
+        assert_eq!(preprocess("//    hello", 0), "///    hello");
     }
 
     #[test]
     fn processes_multi_lines_correctly() {
         assert_eq!(
             preprocess("/** hello \n * world \n * foo \n */", 0),
             "/// hello\n/// world\n/// foo"
         );
 
         assert_eq!(
             preprocess("/**\nhello\n*world\n*foo\n*/", 0),
-            "/// hello\n/// world\n/// foo"
+            "///hello\n///world\n///foo"
         );
     }
 }
--- a/third_party/rust/bindgen/src/ir/context.rs
+++ b/third_party/rust/bindgen/src/ir/context.rs
@@ -221,17 +221,17 @@ impl<T> CanDeriveDefault for T
 where
     T: Copy + Into<ItemId>
 {
     fn can_derive_default(&self, ctx: &BindgenContext) -> bool {
         ctx.options().derive_default && ctx.lookup_can_derive_default(*self)
     }
 }
 
-impl<'a, T> CanDeriveCopy<'a> for T
+impl<T> CanDeriveCopy for T
 where
     T: Copy + Into<ItemId>
 {
     fn can_derive_copy(&self, ctx: &BindgenContext) -> bool {
         ctx.options().derive_copy && ctx.lookup_can_derive_copy(*self)
     }
 }
 
@@ -509,22 +509,29 @@ impl<'ctx> WhitelistedItemsTraversal<'ct
 const HOST_TARGET: &'static str =
     include_str!(concat!(env!("OUT_DIR"), "/host-target.txt"));
 
 /// Returns the effective target, and whether it was explicitly specified on the
 /// clang flags.
 fn find_effective_target(clang_args: &[String]) -> (String, bool) {
     use std::env;
 
-    for opt in clang_args {
+    let mut args = clang_args.iter();
+    while let Some(opt) = args.next() {
         if opt.starts_with("--target=") {
             let mut split = opt.split('=');
             split.next();
             return (split.next().unwrap().to_owned(), true);
         }
+
+        if opt == "-target" {
+            if let Some(target) = args.next() {
+                return (target.clone(), true);
+            }
+        }
     }
 
     // If we're running from a build script, try to find the cargo target.
     if let Ok(t) = env::var("TARGET") {
         return (t, false)
     }
 
     (HOST_TARGET.to_owned(), false)
@@ -571,17 +578,20 @@ If you encounter an error missing from t
         };
 
         let target_info = clang::TargetInfo::new(&translation_unit);
 
         #[cfg(debug_assertions)]
         {
             if let Some(ref ti) = target_info {
                 if effective_target == HOST_TARGET {
-                    assert_eq!(ti.pointer_width / 8, mem::size_of::<*mut ()>());
+                    assert_eq!(
+                        ti.pointer_width / 8, mem::size_of::<*mut ()>(),
+                        "{:?} {:?}", effective_target, HOST_TARGET
+                    );
                 }
             }
         }
 
         let root_module = Self::build_root_module(ItemId(0));
         let root_module_id = root_module.id().as_module_id_unchecked();
 
         let mut me = BindgenContext {
@@ -839,67 +849,68 @@ If you encounter an error missing from t
 
     /// Mangles a name so it doesn't conflict with any keyword.
     pub fn rust_mangle<'a>(&self, name: &'a str) -> Cow<'a, str> {
         if name.contains("@") ||
             name.contains("?") ||
             name.contains("$") ||
             match name {
                 "abstract" |
- 	            "alignof" |
- 	            "as" |
- 	            "become" |
- 	            "box" |
+                "alignof" |
+                "as" |
+                "async" |
+                "become" |
+                "box" |
                 "break" |
- 	            "const" |
- 	            "continue" |
- 	            "crate" |
- 	            "do" |
+                "const" |
+                "continue" |
+                "crate" |
+                "do" |
                 "else" |
- 	            "enum" |
- 	            "extern" |
- 	            "false" |
- 	            "final" |
+                "enum" |
+                "extern" |
+                "false" |
+                "final" |
                 "fn" |
- 	            "for" |
- 	            "if" |
- 	            "impl" |
- 	            "in" |
+                "for" |
+                "if" |
+                "impl" |
+                "in" |
                 "let" |
- 	            "loop" |
- 	            "macro" |
- 	            "match" |
- 	            "mod" |
+                "loop" |
+                "macro" |
+                "match" |
+                "mod" |
                 "move" |
- 	            "mut" |
- 	            "offsetof" |
- 	            "override" |
- 	            "priv" |
+                "mut" |
+                "offsetof" |
+                "override" |
+                "priv" |
                 "proc" |
- 	            "pub" |
- 	            "pure" |
- 	            "ref" |
- 	            "return" |
+                "pub" |
+                "pure" |
+                "ref" |
+                "return" |
                 "Self" |
- 	            "self" |
- 	            "sizeof" |
- 	            "static" |
- 	            "struct" |
+                "self" |
+                "sizeof" |
+                "static" |
+                "struct" |
                 "super" |
- 	            "trait" |
- 	            "true" |
- 	            "type" |
- 	            "typeof" |
+                "trait" |
+                "true" |
+                "type" |
+                "typeof" |
                 "unsafe" |
- 	            "unsized" |
- 	            "use" |
- 	            "virtual" |
- 	            "where" |
+                "unsized" |
+                "use" |
+                "virtual" |
+                "where" |
                 "while" |
- 	            "yield" |
+                "yield" |
                 "bool" |
                 "_" => true,
                 _ => false,
             }
         {
             let mut s = name.to_owned();
             s = s.replace("@", "_");
             s = s.replace("?", "_");
--- a/third_party/rust/bindgen/src/ir/derive.rs
+++ b/third_party/rust/bindgen/src/ir/derive.rs
@@ -25,51 +25,51 @@ pub trait CanDeriveDebug {
 }
 
 /// A trait that encapsulates the logic for whether or not we can trivially
 /// derive `Debug` without looking at any other types or the results of a fix
 /// point analysis. This is a helper trait for the fix point analysis.
 pub trait CanTriviallyDeriveDebug {
     /// Return `true` if `Debug` can trivially be derived for this thing,
     /// `false` otherwise.
-    fn can_trivially_derive_debug(&self) -> bool;
+    fn can_trivially_derive_debug(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can derive `Copy`
 /// for a given thing.
-pub trait CanDeriveCopy<'a> {
+pub trait CanDeriveCopy {
     /// Return `true` if `Copy` can be derived for this thing, `false`
     /// otherwise.
-    fn can_derive_copy(&'a self, ctx: &'a BindgenContext) -> bool;
+    fn can_derive_copy(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can trivially
 /// derive `Copy` without looking at any other types or results of fix point
 /// analyses. This is a helper trait for fix point analysis.
 pub trait CanTriviallyDeriveCopy {
     /// Return `true` if `Copy` can be trivially derived for this thing, `false`
     /// otherwise.
-    fn can_trivially_derive_copy(&self) -> bool;
+    fn can_trivially_derive_copy(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can derive
 /// `Default` for a given thing.
 pub trait CanDeriveDefault {
     /// Return `true` if `Default` can be derived for this thing, `false`
     /// otherwise.
     fn can_derive_default(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can trivially
 /// derive `Default` without looking at any other types or results of fix point
 /// analyses. This is a helper trait for the fix point analysis.
 pub trait CanTriviallyDeriveDefault {
     /// Return `true` if `Default` can trivially derived for this thing, `false`
     /// otherwise.
-    fn can_trivially_derive_default(&self) -> bool;
+    fn can_trivially_derive_default(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can derive `Hash`
 /// for a given thing.
 pub trait CanDeriveHash {
     /// Return `true` if `Hash` can be derived for this thing, `false`
     /// otherwise.
     fn can_derive_hash(&self, ctx: &BindgenContext) -> bool;
@@ -106,50 +106,50 @@ pub trait CanDeriveOrd {
 }
 
 /// A trait that encapsulates the logic for whether or not we can derive `Hash`
 /// without looking at any other types or the results of any fix point
 /// analyses. This is a helper trait for the fix point analysis.
 pub trait CanTriviallyDeriveHash {
     /// Return `true` if `Hash` can trivially be derived for this thing, `false`
     /// otherwise.
-    fn can_trivially_derive_hash(&self) -> bool;
+    fn can_trivially_derive_hash(&self, ctx: &BindgenContext) -> bool;
 }
 
 /// A trait that encapsulates the logic for whether or not we can trivially
 /// derive `PartialEq` or `PartialOrd` without looking at any other types or
 /// results of fix point analyses. This is a helper for the fix point analysis.
 pub trait CanTriviallyDerivePartialEqOrPartialOrd {
     /// Return `Yes` if `PartialEq` or `PartialOrd` can trivially be derived
     /// for this thing.
-    fn can_trivially_derive_partialeq_or_partialord(&self) -> CanDerive;
+    fn can_trivially_derive_partialeq_or_partialord(&self, ctx: &BindgenContext) -> CanDerive;
 }
 
 /// Whether it is possible or not to automatically derive trait for an item.
-/// 
+///
 /// ```ignore
 ///         No
 ///          ^
 ///          |
 ///    ArrayTooLarge
 ///          ^
 ///          |
 ///         Yes
 /// ```
-/// 
+///
 /// Initially we assume that we can derive trait for all types and then
 /// update our understanding as we learn more about each type.
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Ord)]
 pub enum CanDerive {
     /// No, we cannot.
     No,
 
     /// The only thing that stops us from automatically deriving is that
     /// array with more than maximum number of elements is used.
-    /// 
+    ///
     /// This means we probably can "manually" implement such trait.
     ArrayTooLarge,
 
     /// Yes, we can derive automatically.
     Yes,
 }
 
 impl Default for CanDerive {
--- a/third_party/rust/bindgen/src/ir/enum_ty.rs
+++ b/third_party/rust/bindgen/src/ir/enum_ty.rs
@@ -1,12 +1,13 @@
 //! Intermediate representation for C/C++ enumerations.
 
 use super::context::{BindgenContext, TypeId};
 use super::item::Item;
+use super::super::codegen::EnumVariation;
 use super::ty::TypeKind;
 use clang;
 use ir::annotations::Annotations;
 use ir::item::ItemCanonicalPath;
 use parse::{ClangItemParser, ParseError};
 use regex_set::RegexSet;
 
 /// An enum representing custom handling that can be given to a variant.
@@ -137,42 +138,43 @@ impl Enum {
         });
         Ok(Enum::new(repr, variants))
     }
 
     fn is_matching_enum(&self, ctx: &BindgenContext, enums: &RegexSet, item: &Item) -> bool {
         let path = item.canonical_path(ctx);
         let enum_ty = item.expect_type();
 
-        let path_matches = enums.matches(&path[1..].join("::"));
-        let enum_is_anon = enum_ty.name().is_none();
-        let a_variant_matches = self.variants().iter().any(|v| {
-            enums.matches(&v.name())
-        });
-        path_matches || (enum_is_anon && a_variant_matches)
-    }
+        if enums.matches(&path[1..].join("::")) {
+            return true;
+        }
 
-    /// Whether the enum should be a bitfield
-    pub fn is_bitfield(&self, ctx: &BindgenContext, item: &Item) -> bool {
-        self.is_matching_enum(ctx, &ctx.options().bitfield_enums, item)
+        // Test the variants if the enum is anonymous.
+        if enum_ty.name().is_some() {
+            return false;
+        }
+
+        self.variants().iter().any(|v| enums.matches(&v.name()))
     }
 
-    /// Whether the enum should be an constified enum module
-    pub fn is_constified_enum_module(&self, ctx: &BindgenContext, item: &Item) -> bool {
-        self.is_matching_enum(ctx, &ctx.options().constified_enum_modules, item)
-    }
-
-    /// Whether the enum should be an set of constants
-    pub fn is_constified_enum(&self, ctx: &BindgenContext, item: &Item) -> bool {
-        self.is_matching_enum(ctx, &ctx.options().constified_enums, item)
-    }
-
-    /// Whether the enum should be a Rust enum
-    pub fn is_rustified_enum(&self, ctx: &BindgenContext, item: &Item) -> bool {
-        self.is_matching_enum(ctx, &ctx.options().rustified_enums, item)
+    /// Returns the final representation of the enum.
+    pub fn computed_enum_variation(&self, ctx: &BindgenContext, item: &Item) -> EnumVariation {
+        // ModuleConsts has higher precedence before Rust in order to avoid
+        // problems with overlapping match patterns.
+        if self.is_matching_enum(ctx, &ctx.options().constified_enum_modules, item) {
+            EnumVariation::ModuleConsts
+        } else if self.is_matching_enum(ctx, &ctx.options().bitfield_enums, item) {
+            EnumVariation::Bitfield
+        } else if self.is_matching_enum(ctx, &ctx.options().rustified_enums, item) {
+            EnumVariation::Rust
+        } else if self.is_matching_enum(ctx, &ctx.options().constified_enums, item) {
+            EnumVariation::Consts
+        } else {
+            ctx.options().default_enum_style
+        }
     }
 }
 
 /// A single enum variant, to be contained only in an enum.
 #[derive(Debug)]
 pub struct EnumVariant {
     /// The name of the variant.
     name: String,
--- a/third_party/rust/bindgen/src/ir/function.rs
+++ b/third_party/rust/bindgen/src/ir/function.rs
@@ -437,17 +437,26 @@ impl FunctionSig {
         {
             ty.ret_type().or_else(|| cursor.ret_type()).ok_or(
                 ParseError::Continue,
             )?
         } else {
             ty.ret_type().ok_or(ParseError::Continue)?
         };
         let ret = Item::from_ty_or_ref(ty_ret_type, cursor, None, ctx);
-        let call_conv = ty.call_conv();
+
+        // Clang plays with us at "find the calling convention", see #549 and
+        // co. This seems to be a better fix than that commit.
+        let mut call_conv = ty.call_conv();
+        if let Some(ty) = cursor.cur_type().canonical_type().pointee_type() {
+            let cursor_call_conv = ty.call_conv();
+            if cursor_call_conv != CXCallingConv_Invalid {
+                call_conv = cursor_call_conv;
+            }
+        }
         let abi = get_abi(call_conv);
 
         if abi.is_unknown() {
             warn!("Unknown calling convention: {:?}", call_conv);
         }
 
         Ok(Self::new(ret.into(), args, ty.is_variadic(), abi))
     }
@@ -576,31 +585,28 @@ impl Trace for FunctionSig {
 
         for &(_, ty) in self.argument_types() {
             tracer.visit_kind(ty.into(), EdgeKind::FunctionParameter);
         }
     }
 }
 
 impl CanTriviallyDeriveDebug for FunctionSig {
-    fn can_trivially_derive_debug(&self) -> bool {
+    fn can_trivially_derive_debug(&self, _: &BindgenContext) -> bool {
         self.function_pointers_can_derive()
     }
 }
 
 impl CanTriviallyDeriveHash for FunctionSig {
-    fn can_trivially_derive_hash(&self) -> bool {
+    fn can_trivially_derive_hash(&self, _: &BindgenContext) -> bool {
         self.function_pointers_can_derive()
     }
 }
 
 impl CanTriviallyDerivePartialEqOrPartialOrd for FunctionSig {
-    fn can_trivially_derive_partialeq_or_partialord(&self) -> CanDerive {
-        if self.argument_types.len() > RUST_DERIVE_FUNPTR_LIMIT {
-            return CanDerive::No;
-        }
-
-        match self.abi {
-            Abi::C | Abi::Unknown(..) => CanDerive::Yes,
-            _ => CanDerive::No,
+    fn can_trivially_derive_partialeq_or_partialord(&self, _: &BindgenContext) -> CanDerive {
+        if self.function_pointers_can_derive() {
+            CanDerive::Yes
+        } else {
+            CanDerive::No
         }
     }
 }
--- a/third_party/rust/bindgen/src/ir/item.rs
+++ b/third_party/rust/bindgen/src/ir/item.rs
@@ -8,17 +8,17 @@ use super::context::{BindgenContext, Ite
 use super::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault,
                     CanDeriveHash, CanDerivePartialOrd, CanDeriveOrd,
                     CanDerivePartialEq, CanDeriveEq};
 use super::dot::DotAttributes;
 use super::function::{Function, FunctionKind};
 use super::item_kind::ItemKind;
 use super::layout::Opaque;
 use super::module::Module;
-use super::super::codegen::CONSTIFIED_ENUM_MODULE_REPR_NAME;
+use super::super::codegen::{CONSTIFIED_ENUM_MODULE_REPR_NAME, EnumVariation};
 use super::template::{AsTemplateParam, TemplateParameters};
 use super::traversal::{EdgeKind, Trace, Tracer};
 use super::ty::{Type, TypeKind};
 use clang;
 use clang_sys;
 use parse::{ClangItemParser, ClangSubItemParser, ParseError, ParseResult};
 use regex;
 use std::cell::{Cell, RefCell};
@@ -324,17 +324,17 @@ impl CanDeriveDebug for Item {
 }
 
 impl CanDeriveDefault for Item {
     fn can_derive_default(&self, ctx: &BindgenContext) -> bool {
         self.id().can_derive_default(ctx)
     }
 }
 
-impl<'a> CanDeriveCopy<'a> for Item {
+impl CanDeriveCopy for Item {
     fn can_derive_copy(&self, ctx: &BindgenContext) -> bool {
         self.id().can_derive_copy(ctx)
     }
 }
 
 impl CanDeriveHash for Item {
     fn can_derive_hash(&self, ctx: &BindgenContext) -> bool {
         self.id().can_derive_hash(ctx)
@@ -632,16 +632,17 @@ impl Item {
             "You're not supposed to call this yet"
         );
         if self.annotations.hide() {
             return true;
         }
 
         let path = self.canonical_path(ctx);
         let name = path[1..].join("::");
+        ctx.options().blacklisted_items.matches(&name) ||
         match self.kind {
             ItemKind::Type(..) => {
                 ctx.options().blacklisted_types.matches(&name) ||
                     ctx.is_replaced_type(&path, self.id)
             }
             ItemKind::Function(..) => {
                 ctx.options().blacklisted_functions.matches(&name)
             }
@@ -923,17 +924,17 @@ impl Item {
         let item = self.id.into_resolver().through_type_refs().resolve(ctx);
         let type_ = match *item.kind() {
             ItemKind::Type(ref type_) => type_,
             _ => return false,
         };
 
         match *type_.kind() {
             TypeKind::Enum(ref enum_) => {
-                enum_.is_constified_enum_module(ctx, self)
+                enum_.computed_enum_variation(ctx, self) == EnumVariation::ModuleConsts
             }
             TypeKind::Alias(inner_id) => {
                 // TODO(emilio): Make this "hop through type aliases that aren't
                 // really generated" an option in `ItemResolver`?
                 let inner_item = ctx.resolve_item(inner_id);
                 let name = item.canonical_name(ctx);
 
                 if inner_item.canonical_name(ctx) == name {
--- a/third_party/rust/bindgen/src/ir/layout.rs
+++ b/third_party/rust/bindgen/src/ir/layout.rs
@@ -31,18 +31,22 @@ fn test_layout_for_size() {
     assert_eq!(
         Layout::for_size_internal(ptr_size, 3 * ptr_size),
         Layout::new(3 * ptr_size, ptr_size)
     );
 }
 
 impl Layout {
     /// Gets the integer type name for a given known size.
-    pub fn known_type_for_size(size: usize) -> Option<&'static str> {
+    pub fn known_type_for_size(
+        ctx: &BindgenContext,
+        size: usize,
+    ) -> Option<&'static str> {
         Some(match size {
+            16 if ctx.options().rust_features.i128_and_u128 => "u128",
             8 => "u64",
             4 => "u32",
             2 => "u16",
             1 => "u8",
             _ => return None,
         })
     }
 
@@ -100,67 +104,67 @@ impl Opaque {
         let layout = Layout::new(ty.size(), ty.align());
         let ty_kind = TypeKind::Opaque;
         let is_const = ty.is_const();
         Type::new(None, Some(layout), ty_kind, is_const)
     }
 
     /// Return the known rust type we should use to create a correctly-aligned
     /// field with this layout.
-    pub fn known_rust_type_for_array(&self) -> Option<&'static str> {
-        Layout::known_type_for_size(self.0.align)
+    pub fn known_rust_type_for_array(&self,ctx: &BindgenContext) -> Option<&'static str> {
+        Layout::known_type_for_size(ctx, self.0.align)
     }
 
     /// Return the array size that an opaque type for this layout should have if
     /// we know the correct type for it, or `None` otherwise.
-    pub fn array_size(&self) -> Option<usize> {
-        if self.known_rust_type_for_array().is_some() {
+    pub fn array_size(&self, ctx: &BindgenContext) -> Option<usize> {
+        if self.known_rust_type_for_array(ctx).is_some() {
             Some(self.0.size / cmp::max(self.0.align, 1))
         } else {
             None
         }
     }
 
     /// Return `true` if this opaque layout's array size will fit within the
     /// maximum number of array elements that Rust allows deriving traits
     /// with. Return `false` otherwise.
-    pub fn array_size_within_derive_limit(&self) -> bool {
-        self.array_size().map_or(false, |size| {
+    pub fn array_size_within_derive_limit(&self, ctx: &BindgenContext) -> bool {
+        self.array_size(ctx).map_or(false, |size| {
             size <= RUST_DERIVE_IN_ARRAY_LIMIT
         })
     }
 }
 
 impl CanTriviallyDeriveDebug for Opaque {
-    fn can_trivially_derive_debug(&self) -> bool {
-        self.array_size_within_derive_limit()
+    fn can_trivially_derive_debug(&self, ctx: &BindgenContext) -> bool {
+        self.array_size_within_derive_limit(ctx)
     }
 }
 
 impl CanTriviallyDeriveDefault for Opaque {
-    fn can_trivially_derive_default(&self) -> bool {
-        self.array_size_within_derive_limit()
+    fn can_trivially_derive_default(&self, ctx: &BindgenContext) -> bool {
+        self.array_size_within_derive_limit(ctx)
     }
 }
 
 impl CanTriviallyDeriveCopy for Opaque {
-    fn can_trivially_derive_copy(&self) -> bool {
-        self.array_size_within_derive_limit()
+    fn can_trivially_derive_copy(&self, ctx: &BindgenContext) -> bool {
+        self.array_size_within_derive_limit(ctx)
     }
 }
 
 impl CanTriviallyDeriveHash for Opaque {
-    fn can_trivially_derive_hash(&self) -> bool {
-        self.array_size_within_derive_limit()
+    fn can_trivially_derive_hash(&self, ctx: &BindgenContext) -> bool {
+        self.array_size_within_derive_limit(ctx)
     }
 }
 
 impl CanTriviallyDerivePartialEqOrPartialOrd for Opaque {
-    fn can_trivially_derive_partialeq_or_partialord(&self) -> CanDerive {
-        self.array_size().map_or(CanDerive::No, |size| {
-            if size <= RUST_DERIVE_IN_ARRAY_LIMIT {
-                CanDerive::Yes
-            } else {
-                CanDerive::ArrayTooLarge
-            }
-        })
+    fn can_trivially_derive_partialeq_or_partialord(&self, ctx: &BindgenContext) -> CanDerive {
+        // TODO(emilio): This is inconsistent with the rest of the
+        // CanTriviallyDerive* traits.
+        if self.array_size_within_derive_limit(ctx) {
+            CanDerive::Yes
+        } else {
+            CanDerive::ArrayTooLarge
+        }
     }
 }
--- a/third_party/rust/bindgen/src/ir/ty.rs
+++ b/third_party/rust/bindgen/src/ir/ty.rs
@@ -85,16 +85,24 @@ impl Type {
         &mut self.kind
     }
 
     /// Get this type's name.
     pub fn name(&self) -> Option<&str> {
         self.name.as_ref().map(|name| &**name)
     }
 
+    /// Whether this is a block pointer type.
+    pub fn is_block_pointer(&self) -> bool {
+        match self.kind {
+            TypeKind::BlockPointer(..) => true,
+            _ => false,
+        }
+    }
+
     /// Is this a compound type?
     pub fn is_comp(&self) -> bool {
         match self.kind {
             TypeKind::Comp(..) => true,
             _ => false,
         }
     }
 
@@ -150,17 +158,16 @@ impl Type {
     pub fn is_builtin_or_type_param(&self) -> bool {
         match self.kind {
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Function(..) |
             TypeKind::Array(..) |
             TypeKind::Reference(..) |
             TypeKind::Pointer(..) |
-            TypeKind::BlockPointer |
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::TypeParam => true,
             _ => false,
         }
     }
 
     /// Creates a new named type, with name `name`.
@@ -239,18 +246,17 @@ impl Type {
 
     /// What is the layout of this type?
     pub fn layout(&self, ctx: &BindgenContext) -> Option<Layout> {
         self.layout.or_else(|| {
             match self.kind {
                 TypeKind::Comp(ref ci) => ci.layout(ctx),
                 // FIXME(emilio): This is a hack for anonymous union templates.
                 // Use the actual pointer size!
-                TypeKind::Pointer(..) |
-                TypeKind::BlockPointer => {
+                TypeKind::Pointer(..) => {
                     Some(Layout::new(
                         ctx.target_pointer_size(),
                         ctx.target_pointer_size(),
                     ))
                 }
                 TypeKind::ResolvedTypeRef(inner) => {
                     ctx.resolve_type(inner).layout(ctx)
                 }
@@ -334,24 +340,24 @@ impl Type {
             TypeKind::Int(..) |
             TypeKind::Float(..) |
             TypeKind::Complex(..) |
             TypeKind::Function(..) |
             TypeKind::Enum(..) |
             TypeKind::Reference(..) |
             TypeKind::Void |
             TypeKind::NullPtr |
-            TypeKind::BlockPointer |
             TypeKind::Pointer(..) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel |
             TypeKind::ObjCInterface(..) => Some(self),
 
             TypeKind::ResolvedTypeRef(inner) |
             TypeKind::Alias(inner) |
+            TypeKind::BlockPointer(inner) |
             TypeKind::TemplateAlias(inner, _) => {
                 ctx.resolve_type(inner).safe_canonical_type(ctx)
             }
             TypeKind::TemplateInstantiation(ref inst) => {
                 ctx.resolve_type(inst.template_definition())
                     .safe_canonical_type(ctx)
             }
 
@@ -480,17 +486,17 @@ impl TypeKind {
             TypeKind::Complex(..) => "Complex",
             TypeKind::Alias(..) => "Alias",
             TypeKind::TemplateAlias(..) => "TemplateAlias",
             TypeKind::Array(..) => "Array",
             TypeKind::Vector(..) => "Vector",
             TypeKind::Function(..) => "Function",
             TypeKind::Enum(..) => "Enum",
             TypeKind::Pointer(..) => "Pointer",
-            TypeKind::BlockPointer => "BlockPointer",
+            TypeKind::BlockPointer(..) => "BlockPointer",
             TypeKind::Reference(..) => "Reference",
             TypeKind::TemplateInstantiation(..) => "TemplateInstantiation",
             TypeKind::UnresolvedTypeRef(..) => "UnresolvedTypeRef",
             TypeKind::ResolvedTypeRef(..) => "ResolvedTypeRef",
             TypeKind::TypeParam => "TypeParam",
             TypeKind::ObjCInterface(..) => "ObjCInterface",
             TypeKind::ObjCId => "ObjCId",
             TypeKind::ObjCSel => "ObjCSel",
@@ -574,17 +580,17 @@ impl TemplateParameters for TypeKind {
             TypeKind::Int(_) |
             TypeKind::Float(_) |
             TypeKind::Complex(_) |
             TypeKind::Array(..) |
             TypeKind::Vector(..) |
             TypeKind::Function(_) |
             TypeKind::Enum(_) |
             TypeKind::Pointer(_) |
-            TypeKind::BlockPointer |
+            TypeKind::BlockPointer(_) |
             TypeKind::Reference(_) |
             TypeKind::UnresolvedTypeRef(..) |
             TypeKind::TypeParam |
             TypeKind::Alias(_) |
             TypeKind::ObjCId |
             TypeKind::ObjCSel |
             TypeKind::ObjCInterface(_) => vec![],
         }
@@ -650,17 +656,17 @@ pub enum TypeKind {
     /// An `enum` type.
     Enum(Enum),
 
     /// A pointer to a type. The bool field represents whether it's const or
     /// not.
     Pointer(TypeId),
 
     /// A pointer to an Apple block.
-    BlockPointer,
+    BlockPointer(TypeId),
 
     /// A reference to a type, as in: int& foo().
     Reference(TypeId),
 
     /// An instantiation of an abstract template definition with a set of
     /// concrete template arguments.
     TemplateInstantiation(TemplateInstantiation),
 
@@ -1051,47 +1057,27 @@ impl Type {
                 // something else we might get confused, see the comment inside
                 // TypeRef.
                 //
                 // We might need to, though, if the context is already in the
                 // process of resolving them.
                 CXType_ObjCObjectPointer |
                 CXType_MemberPointer |
                 CXType_Pointer => {
-                    // Fun fact: the canonical type of a pointer type may sometimes
-                    // contain information we need but isn't present in the concrete
-                    // type (yeah, I'm equally wat'd).
-                    //
-                    // Yet we still have trouble if we unconditionally trust the
-                    // canonical type, like too-much desugaring (sigh).
-                    //
-                    // See tests/headers/call-conv-field.h for an example.
-                    //
-                    // Since for now the only identifier cause of breakage is the
-                    // ABI for function pointers, and different ABI mixed with
-                    // problematic stuff like that one is _extremely_ unlikely and
-                    // can be bypassed via blacklisting, we do the check explicitly
-                    // (as hacky as it is).
-                    //
-                    // Yet we should probably (somehow) get the best of both worlds,
-                    // presumably special-casing function pointers as a whole, yet
-                    // someone is going to need to care about typedef'd function
-                    // pointers, etc, which isn't trivial given function pointers
-                    // are mostly unexposed. I don't have the time for it right now.
-                    let mut pointee = ty.pointee_type().unwrap();
-                    let canonical_pointee =
-                        canonical_ty.pointee_type().unwrap();
-                    if pointee.call_conv() != canonical_pointee.call_conv() {
-                        pointee = canonical_pointee;
-                    }
+                    let pointee = ty.pointee_type().unwrap();
                     let inner =
                         Item::from_ty_or_ref(pointee, location, None, ctx);
                     TypeKind::Pointer(inner)
                 }
-                CXType_BlockPointer => TypeKind::BlockPointer,
+                CXType_BlockPointer => {
+                    let pointee = ty.pointee_type().expect("Not valid Type?");
+                    let inner =
+                        Item::from_ty_or_ref(pointee, location, None, ctx);
+                    TypeKind::BlockPointer(inner)
+                },
                 // XXX: RValueReference is most likely wrong, but I don't think we
                 // can even add bindings for that, so huh.
                 CXType_RValueReference |
                 CXType_LValueReference => {
                     let inner = Item::from_ty_or_ref(
                         ty.pointee_type().unwrap(),
                         location,
                         None,
@@ -1227,16 +1213,17 @@ impl Trace for Type {
     where
         T: Tracer,
     {
         match *self.kind() {
             TypeKind::Pointer(inner) |
             TypeKind::Reference(inner) |
             TypeKind::Array(inner, _) |
             TypeKind::Vector(inner, _) |
+            TypeKind::BlockPointer(inner) |
             TypeKind::Alias(inner) |
             TypeKind::ResolvedTypeRef(inner) => {
                 tracer.visit_kind(inner.into(), EdgeKind::TypeReference);
             }
             TypeKind::TemplateAlias(inner, ref template_params) => {
                 tracer.visit_kind(inner.into(), EdgeKind::TypeReference);
                 for param in template_params {
                     tracer.visit_kind(
@@ -1268,13 +1255,12 @@ impl Trace for Type {
             TypeKind::UnresolvedTypeRef(_, _, None) |
             TypeKind::TypeParam |
             TypeKind::Void |
             TypeKind::NullPtr |
             TypeKind::Int(_) |
             TypeKind::Float(_) |
             TypeKind::Complex(_) |
             TypeKind::ObjCId |
-            TypeKind::ObjCSel |
-            TypeKind::BlockPointer => {}
+            TypeKind::ObjCSel => {}
         }
     }
 }
--- a/third_party/rust/bindgen/src/ir/var.rs
+++ b/third_party/rust/bindgen/src/ir/var.rs
@@ -260,18 +260,17 @@ impl ClangSubItemParser for Var {
                 let value = if is_integer {
                     let kind = match *canonical_ty.unwrap().kind() {
                         TypeKind::Int(kind) => kind,
                         _ => unreachable!(),
                     };
 
                     let mut val = cursor
                         .evaluate()
-                        .and_then(|v| v.as_int())
-                        .map(|val| val as i64);
+                        .and_then(|v| v.as_int());
                     if val.is_none() || !kind.signedness_matches(val.unwrap()) {
                         let tu = ctx.translation_unit();
                         val = get_integer_literal_from_cursor(&cursor, tu);
                     }
 
                     val.map(|val| if kind == IntKind::Bool {
                         VarType::Bool(val != 0)
                     } else {
@@ -300,52 +299,52 @@ impl ClangSubItemParser for Var {
     }
 }
 
 /// Try and parse a macro using all the macros parsed until now.
 fn parse_macro(
     ctx: &BindgenContext,
     cursor: &clang::Cursor,
 ) -> Option<(Vec<u8>, cexpr::expr::EvalResult)> {
-    use cexpr::{expr, nom};
+    use cexpr::expr;
 
     let mut cexpr_tokens = cursor.cexpr_tokens()?;
 
     let parser = expr::IdentifierParser::new(ctx.parsed_macros());
 
     match parser.macro_definition(&cexpr_tokens) {
-        nom::IResult::Done(_, (id, val)) => {
+        Ok((_, (id, val))) => {
             return Some((id.into(), val));
         }
         _ => {}
     }
 
     // Try without the last token, to workaround a libclang bug in versions
     // previous to 4.0.
     //
     // See:
     //   https://bugs.llvm.org//show_bug.cgi?id=9069
     //   https://reviews.llvm.org/D26446
     cexpr_tokens.pop()?;
 
     match parser.macro_definition(&cexpr_tokens) {
-        nom::IResult::Done(_, (id, val)) => Some((id.into(), val)),
+        Ok((_, (id, val))) => Some((id.into(), val)),
         _ => None,
     }
 }
 
 fn parse_int_literal_tokens(cursor: &clang::Cursor) -> Option<i64> {
-    use cexpr::{expr, nom};
+    use cexpr::expr;
     use cexpr::expr::EvalResult;
 
     let cexpr_tokens = cursor.cexpr_tokens()?;
 
     // TODO(emilio): We can try to parse other kinds of literals.
     match expr::expr(&cexpr_tokens) {
-        nom::IResult::Done(_, EvalResult::Int(Wrapping(val))) => Some(val),
+        Ok((_, EvalResult::Int(Wrapping(val)))) => Some(val),
         _ => None,
     }
 }
 
 fn get_integer_literal_from_cursor(
     cursor: &clang::Cursor,
     unit: &clang::TranslationUnit,
 ) -> Option<i64> {
--- a/third_party/rust/bindgen/src/lib.rs
+++ b/third_party/rust/bindgen/src/lib.rs
@@ -94,17 +94,17 @@ use std::io::{self, Write};
 use std::iter;
 use std::path::{Path, PathBuf};
 use std::process::{Command, Stdio};
 use std::sync::Arc;
 
 fn args_are_cpp(clang_args: &[String]) -> bool {
     return clang_args
         .windows(2)
-        .any(|w| w[0] == "-x=c++" || w[1] == "-x=c++" || w == &["-x", "c++"]);
+        .any(|w| w[0] == "-xc++" || w[1] == "-xc++" || w == &["-x", "c++"]);
 }
 
 bitflags! {
     /// A type used to indicate which kind of items we have to generate.
     pub struct CodegenConfig: u32 {
         /// Whether to generate functions.
         const FUNCTIONS = 1 << 0;
         /// Whether to generate types.
@@ -306,16 +306,30 @@ impl Builder {
                 output_vector.push(
                     item.trim_left_matches("^")
                         .trim_right_matches("$")
                         .into(),
                 );
             })
             .count();
 
+        self.options
+            .blacklisted_items
+            .get_items()
+            .iter()
+            .map(|item| {
+                output_vector.push("--blacklist-item".into());
+                output_vector.push(
+                    item.trim_left_matches("^")
+                        .trim_right_matches("$")
+                        .into(),
+                );
+            })
+            .count();
+
         if !self.options.layout_tests {
             output_vector.push("--no-layout-tests".into());
         }
 
         if self.options.impl_debug {
             output_vector.push("--impl-debug".into());
         }
 
@@ -368,16 +382,24 @@ impl Builder {
         if !self.options.whitelist_recursively {
             output_vector.push("--no-recursive-whitelist".into());
         }
 
         if self.options.objc_extern_crate {
             output_vector.push("--objc-extern-crate".into());
         }
 
+        if self.options.generate_block {
+            output_vector.push("--generate-block".into());
+        }
+
+        if self.options.block_extern_crate {
+            output_vector.push("--block-extern-crate".into());
+        }
+
         if self.options.builtins {
             output_vector.push("--builtins".into());
         }
 
         if let Some(ref prefix) = self.options.ctypes_prefix {
             output_vector.push("--ctypes-prefix".into());
             output_vector.push(prefix.clone());
         }
@@ -695,16 +717,29 @@ impl Builder {
 
     /// Generate `#[macro_use] extern crate objc;` instead of `use objc;`
     /// in the prologue of the files generated from objective-c files
     pub fn objc_extern_crate(mut self, doit: bool) -> Self {
         self.options.objc_extern_crate = doit;
         self
     }
 
+    /// Generate proper block signatures instead of void pointers.
+    pub fn generate_block(mut self, doit: bool) -> Self {
+        self.options.generate_block = doit;
+        self
+    }
+
+    /// Generate `#[macro_use] extern crate block;` instead of `use block;`
+    /// in the prologue of the files generated from apple block files
+    pub fn block_extern_crate(mut self, doit: bool) -> Self {
+        self.options.block_extern_crate = doit;
+        self
+    }
+
     /// Whether to use the clang-provided name mangling. This is true by default
     /// and probably needed for C++ features.
     ///
     /// However, some old libclang versions seem to return incorrect results in
     /// some cases for non-mangled functions, see [1], so we allow disabling it.
     ///
     /// [1]: https://github.com/rust-lang-nursery/rust-bindgen/issues/528
     pub fn trust_clang_mangling(mut self, doit: bool) -> Self {
@@ -728,16 +763,24 @@ impl Builder {
 
     /// Hide the given function from the generated bindings. Regular expressions
     /// are supported.
     pub fn blacklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
         self.options.blacklisted_functions.insert(arg);
         self
     }
 
+    /// Hide the given item from the generated bindings, regardless of
+    /// whether it's a type, function, module, etc. Regular
+    /// expressions are supported.
+    pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
+        self.options.blacklisted_items.insert(arg);
+        self
+    }
+
     /// Treat the given type as opaque in the generated bindings. Regular
     /// expressions are supported.
     pub fn opaque_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
         self.options.opaque_types.insert(arg);
         self
     }
 
     /// Whitelist the given type so that it (and all types that it transitively
@@ -1287,16 +1330,20 @@ struct BindgenOptions {
     /// The set of types that have been blacklisted and should not appear
     /// anywhere in the generated code.
     blacklisted_types: RegexSet,
 
     /// The set of functions that have been blacklisted and should not appear
     /// in the generated code.
     blacklisted_functions: RegexSet,
 
+    /// The set of items, regardless of item-type, that have been
+    /// blacklisted and should not appear in the generated code.
+    blacklisted_items: RegexSet,
+
     /// The set of types that should be treated as opaque structures in the
     /// generated code.
     opaque_types: RegexSet,
 
     /// The explicit rustfmt path.
     rustfmt_path: Option<PathBuf>,
 
     /// The set of types that we should have bindings for in the generated
@@ -1449,16 +1496,24 @@ struct BindgenOptions {
 
     /// Whether to whitelist types recursively. Defaults to true.
     whitelist_recursively: bool,
 
     /// Instead of emitting 'use objc;' to files generated from objective c files,
     /// generate '#[macro_use] extern crate objc;'
     objc_extern_crate: bool,
 
+    /// Instead of emitting 'use block;' to files generated from objective c files,
+    /// generate '#[macro_use] extern crate block;'
+    generate_block: bool,
+
+    /// Instead of emitting 'use block;' to files generated from objective c files,
+    /// generate '#[macro_use] extern crate block;'
+    block_extern_crate: bool,
+
     /// Whether to use the clang-provided name mangling. This is true and
     /// probably needed for C++ features.
     ///
     /// However, some old libclang versions seem to return incorrect results in
     /// some cases for non-mangled functions, see [1], so we allow disabling it.
     ///
     /// [1]: https://github.com/rust-lang-nursery/rust-bindgen/issues/528
     enable_mangling: bool,
@@ -1497,16 +1552,17 @@ impl ::std::panic::UnwindSafe for Bindge
 
 impl BindgenOptions {
     fn build(&mut self) {
         self.whitelisted_vars.build();
         self.whitelisted_types.build();
         self.whitelisted_functions.build();
         self.blacklisted_types.build();
         self.blacklisted_functions.build();
+        self.blacklisted_items.build();
         self.opaque_types.build();
         self.bitfield_enums.build();
         self.constified_enums.build();
         self.constified_enum_modules.build();
         self.rustified_enums.build();
         self.no_partialeq_types.build();
         self.no_copy_types.build();
         self.no_hash_types.build();
@@ -1530,16 +1586,17 @@ impl Default for BindgenOptions {
     fn default() -> BindgenOptions {
         let rust_target = RustTarget::default();
 
         BindgenOptions {
             rust_target,
             rust_features: rust_target.into(),
             blacklisted_types: Default::default(),
             blacklisted_functions: Default::default(),
+            blacklisted_items: Default::default(),
             opaque_types: Default::default(),
             rustfmt_path: Default::default(),
             whitelisted_types: Default::default(),
             whitelisted_functions: Default::default(),
             whitelisted_vars: Default::default(),
             default_enum_style: Default::default(),
             bitfield_enums: Default::default(),
             rustified_enums: Default::default(),
@@ -1573,17 +1630,19 @@ impl Default for BindgenOptions {
             input_header: None,
             input_unsaved_files: vec![],
             parse_callbacks: None,
             codegen_config: CodegenConfig::all(),
             conservative_inline_namespaces: false,
             generate_comments: true,
             generate_inline_functions: false,
             whitelist_recursively: true,
+            generate_block: false,
             objc_extern_crate: false,
+            block_extern_crate: false,
             enable_mangling: true,
             prepend_enum_name: true,
             time_phases: false,
             rustfmt_bindings: true,
             rustfmt_configuration_file: None,
             no_partialeq_types: Default::default(),
             no_copy_types: Default::default(),
             no_hash_types: Default::default(),
--- a/third_party/rust/bindgen/src/options.rs
+++ b/third_party/rust/bindgen/src/options.rs
@@ -73,16 +73,23 @@ where
                 .number_of_values(1),
             Arg::with_name("blacklist-function")
                 .long("blacklist-function")
                 .help("Mark <function> as hidden.")
                 .value_name("function")
                 .takes_value(true)
                 .multiple(true)
                 .number_of_values(1),
+            Arg::with_name("blacklist-item")
+                .long("blacklist-item")
+                .help("Mark <item> as hidden.")
+                .value_name("item")
+                .takes_value(true)
+                .multiple(true)
+                .number_of_values(1),
             Arg::with_name("no-layout-tests")
                 .long("no-layout-tests")
                 .help("Avoid generating layout tests for any type."),
             Arg::with_name("no-derive-copy")
                 .long("no-derive-copy")
                 .help("Avoid deriving Copy on any type."),
             Arg::with_name("no-derive-debug")
                 .long("no-derive-debug")
@@ -127,16 +134,22 @@ where
                 .long("no-recursive-whitelist")
                 .help("Disable whitelisting types recursively. This will cause \
                        bindgen to emit Rust code that won't compile! See the \
                        `bindgen::Builder::whitelist_recursively` method's \
                        documentation for details."),
             Arg::with_name("objc-extern-crate")
                 .long("objc-extern-crate")
                 .help("Use extern crate instead of use for objc."),
+            Arg::with_name("generate-block")
+                .long("generate-block")
+                .help("Generate block signatures instead of void pointers."),
+            Arg::with_name("block-extern-crate")
+                .long("block-extern-crate")
+                .help("Use extern crate instead of use for block."),
             Arg::with_name("distrust-clang-mangling")
                 .long("distrust-clang-mangling")
                 .help("Do not trust the libclang-provided mangling"),
             Arg::with_name("builtins")
                 .long("builtins")
                 .help("Output bindings for builtin definitions, e.g. \
                        __builtin_va_list."),
             Arg::with_name("ctypes-prefix")
@@ -145,16 +158,17 @@ where
                       ::std::os::raw.")
                 .value_name("prefix")
                 .takes_value(true),
             Arg::with_name("time-phases")
                 .long("time-phases")
                 .help("Time the different bindgen phases and print to stderr"),
             // All positional arguments after the end of options marker, `--`
             Arg::with_name("clang-args")
+                .last(true)
                 .multiple(true),
             Arg::with_name("emit-clang-ast")
                 .long("emit-clang-ast")
                 .help("Output the Clang AST for debugging purposes."),
             Arg::with_name("emit-ir")
                 .long("emit-ir")
                 .help("Output our internal IR for debugging purposes."),
             Arg::with_name("emit-ir-graphviz")
@@ -358,16 +372,22 @@ where
     }
 
     if let Some(hidden_functions) = matches.values_of("blacklist-function") {
         for fun in hidden_functions {
             builder = builder.blacklist_function(fun);
         }
     }
 
+    if let Some(hidden_identifiers) = matches.values_of("blacklist-item") {
+        for id in hidden_identifiers {
+            builder = builder.blacklist_item(id);
+        }
+    }
+
     if matches.is_present("builtins") {
         builder = builder.emit_builtins();
     }
 
     if matches.is_present("no-layout-tests") {
         builder = builder.layout_tests(false);
     }
 
@@ -487,16 +507,24 @@ where
     if matches.is_present("no-recursive-whitelist") {
         builder = builder.whitelist_recursively(false);
     }
 
     if matches.is_present("objc-extern-crate") {
         builder = builder.objc_extern_crate(true);
     }
 
+    if matches.is_present("generate-block") {
+        builder = builder.generate_block(true);
+    }
+
+    if matches.is_present("block-extern-crate") {
+        builder = builder.block_extern_crate(true);
+    }
+
     if let Some(opaque_types) = matches.values_of("opaque-type") {
         for ty in opaque_types {
             builder = builder.opaque_type(ty);
         }
     }
 
     if let Some(lines) = matches.values_of("raw-line") {
         for line in lines {
--- a/third_party/rust/cexpr/.cargo-checksum.json
+++ b/third_party/rust/cexpr/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"22914a43154e0b38bbe265a67024c1f98af9087ca561448ac0f13ed57c9311ae","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"d9771b8c6cf4426d3846de54c1febe20907f1eeadf7adfb5ade89a83bd9ea77f","src/expr.rs":"b888963ab9eb344c93c0654286231b4204809a971682155fade5c69a4493636f","src/lib.rs":"78bbde89e803cf931216e38bdd992e13894cd898868478a258eac5155bdf4de9","src/literal.rs":"fb80a7b43d96bedfd47bc2d39eaf588c5cef6a2374132fbdfe5146dd56a1894c","src/token.rs":"52d42deb2a2575bb8631e2e821593d8288fed16e21bab3ceeacb6a7b06c40087","tests/clang.rs":"a650cde69ab2e801f994f15e4cb32c538e53abefcdd862865ce277ce9a055242","tests/input/chars.h":"69c8141870872b795b5174bad125b748732c2b01d0e98ffcfc37b19f3f791f69","tests/input/fail.h":"b0b6cffd2dd17410b5eb02ee79ab75754820480b960db8a9866cc9983bd36b65","tests/input/floats.h":"28ec664e793c494e1a31f3bc5b790014e9921fc741bf475a86319b9a9eee5915","tests/input/int_signed.h":"934199eded85dd7820ca08c0beb1381ee6d9339970d2720a69c23025571707ce","tests/input/int_unsigned.h":"f47c1ccb6c69856162639277d7552090055420155df55f65581e57217cccce76","tests/input/strings.h":"75c60527068172b97983d2b8361938e856ea394002d5bef05de1adc6a0f5fc01","tests/input/test_llvm_bug_9069.h":"8d9ae1d1eadc8f6d5c14296f984547fe894d0f2ce5cd6d7aa8caad40a56bc5e1"},"package":"42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c"}
\ No newline at end of file
+{"files":{"Cargo.toml":"32b00f47d6888b44ac5fb30e9693437dd95c98f000b5abb9a85880edc746dcb4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"d9771b8c6cf4426d3846de54c1febe20907f1eeadf7adfb5ade89a83bd9ea77f","src/expr.rs":"b2c80d3125ff2fd66d0f889dfa2d6476b8e68cc9513e508ba862470182a3f7cc","src/lib.rs":"689f19cb8a8e88c2489e0d8f59ed75b03cb19f0e789e5a0d3447f695b2ef2259","src/literal.rs":"22aec22c7bdd374afd06c16c19f09b2763c5ffc37ecb0bbd60a5d9102f57ebc3","src/token.rs":"52d42deb2a2575bb8631e2e821593d8288fed16e21bab3ceeacb6a7b06c40087","tests/clang.rs":"0f820e2003e34c2ab69cd759314cebf755fd1b1929974976d3776968f687be7e","tests/input/chars.h":"69c8141870872b795b5174bad125b748732c2b01d0e98ffcfc37b19f3f791f69","tests/input/fail.h":"b0b6cffd2dd17410b5eb02ee79ab75754820480b960db8a9866cc9983bd36b65","tests/input/floats.h":"28ec664e793c494e1a31f3bc5b790014e9921fc741bf475a86319b9a9eee5915","tests/input/int_signed.h":"934199eded85dd7820ca08c0beb1381ee6d9339970d2720a69c23025571707ce","tests/input/int_unsigned.h":"d6b82716669aecbec4cfff2d1bf8c5af926f80ba01fe89de3b439264f3080ccb","tests/input/strings.h":"75c60527068172b97983d2b8361938e856ea394002d5bef05de1adc6a0f5fc01","tests/input/test_llvm_bug_9069.h":"8d9ae1d1eadc8f6d5c14296f984547fe894d0f2ce5cd6d7aa8caad40a56bc5e1"},"package":"8fc0086be9ca82f7fc89fc873435531cb898b86e850005850de1f820e2db6e9b"}
\ No newline at end of file
--- a/third_party/rust/cexpr/Cargo.toml
+++ b/third_party/rust/cexpr/Cargo.toml
@@ -7,20 +7,20 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "cexpr"
-version = "0.2.3"
+version = "0.3.3"
 authors = ["Jethro Beekman <jethro@jbeekman.nl>"]
 description = "A C expression parser and evaluator"
 documentation = "https://docs.rs/cexpr/"
 keywords = ["C", "expression", "parser"]
 license = "Apache-2.0/MIT"
 repository = "https://github.com/jethrogb/rust-cexpr"
 [dependencies.nom]
-version = "^3"
+version = "^4"
 features = ["verbose-errors"]
 [dev-dependencies.clang-sys]
-version = "0.11.0"
+version = ">= 0.13.0, < 0.27.0"
--- a/third_party/rust/cexpr/src/expr.rs
+++ b/third_party/rust/cexpr/src/expr.rs
@@ -30,17 +30,17 @@ use nom_crate::*;
 /// Expression parser/evaluator that supports identifiers.
 #[derive(Debug)]
 pub struct IdentifierParser<'ident> {
 	identifiers: &'ident HashMap<Vec<u8>,EvalResult>,
 }
 #[derive(Copy,Clone)]
 struct PRef<'a>(&'a IdentifierParser<'a>);
 
-pub type CResult<'a,R:'a> = IResult<&'a [Token],R,::Error>;
+pub type CResult<'a,R> = IResult<&'a [Token],R,::Error>;
 
 /// The result of parsing a literal or evaluating an expression.
 #[derive(Debug,Clone,PartialEq)]
 pub enum EvalResult {
 	Int(Wrapping<i64>),
 	Float(f64),
 	Char(CChar),
 	Str(Vec<u8>),
@@ -82,76 +82,98 @@ impl From<Vec<u8>> for EvalResult {
 
 // ===========================================
 // ============= Clang tokens ================
 // ===========================================
 
 macro_rules! exact_token (
 	($i:expr, $k:ident, $c:expr) => ({
 		if $i.is_empty() {
-			let res: CResult<&[u8]> = IResult::Incomplete(Needed::Size($c.len()));
+			let res: CResult<&[u8]> = Err(::nom_crate::Err::Incomplete(Needed::Size($c.len())));
 			res
 		} else {
 			if $i[0].kind==TokenKind::$k && &$i[0].raw[..]==$c {
-				IResult::Done(&$i[1..], &$i[0].raw[..])
+				Ok((&$i[1..], &$i[0].raw[..]))
 			} else {
-				IResult::Error(Err::Position(ErrorKind::Custom(::Error::ExactToken(TokenKind::$k,$c)), $i))
+				Err(::nom_crate::Err::Error(error_position!($i, ErrorKind::Custom(::Error::ExactToken(TokenKind::$k,$c)))))
 			}
 		}
 	});
 );
 
 macro_rules! typed_token (
 	($i:expr, $k:ident) => ({
 		if $i.is_empty() {
-			let res: CResult<&[u8]> = IResult::Incomplete(Needed::Size(1));
+			let res: CResult<&[u8]> = Err(::nom_crate::Err::Incomplete(Needed::Size(1)));
 			res
 		} else {
 			if $i[0].kind==TokenKind::$k {
-				IResult::Done(&$i[1..], &$i[0].raw[..])
+				Ok((&$i[1..], &$i[0].raw[..]))
 			} else {
-				IResult::Error(Err::Position(ErrorKind::Custom(::Error::TypedToken(TokenKind::$k)), $i))
+				Err(Err::Error(error_position!($i, ErrorKind::Custom(::Error::TypedToken(TokenKind::$k)))))
 			}
 		}
 	});
 );
 
 #[allow(unused_macros)]
 macro_rules! any_token (
 	($i:expr,) => ({
 		if $i.is_empty() {
-			let res: CResult<&Token> = IResult::Incomplete(Needed::Size(1));
+			let res: CResult<&Token> = Err(::nom_crate::Err::Incomplete(Needed::Size(1)));
 			res
 		} else {
-			IResult::Done(&$i[1..], &$i[0])
+			Ok((&$i[1..], &$i[0]))
 		}
 	});
 );
 
 macro_rules! p (
 	($i:expr, $c:expr) => (exact_token!($i,Punctuation,$c.as_bytes()))
 );
 
 macro_rules! one_of_punctuation (
 	($i:expr, $c:expr) => ({
 		if $i.is_empty() {
 			let min = $c.iter().map(|opt|opt.len()).min().expect("at least one option");
-			let res: CResult<&[u8]> = IResult::Incomplete(Needed::Size(min));
+			let res: CResult<&[u8]> = Err(::nom_crate::Err::Incomplete(Needed::Size(min)));
 			res
 		} else {
 			if $i[0].kind==TokenKind::Punctuation && $c.iter().any(|opt|opt.as_bytes()==&$i[0].raw[..]) {
-				IResult::Done(&$i[1..], &$i[0].raw[..])
+				Ok((&$i[1..], &$i[0].raw[..]))
 			} else {
-				const VAILD_VALUES: &'static [&'static str] = &$c;
-				IResult::Error(Err::Position(ErrorKind::Custom(::Error::ExactTokens(TokenKind::Punctuation,VAILD_VALUES)), $i))
+				const VALID_VALUES: &'static [&'static str] = &$c;
+				Err(Err::Error(error_position!($i, ErrorKind::Custom(::Error::ExactTokens(TokenKind::Punctuation,VALID_VALUES)))))
 			}
 		}
 	});
 );
 
+/// equivalent to nom's complete! macro, but adds the custom error type
+#[macro_export]
+macro_rules! comp (
+	($i:expr, $submac:ident!( $($args:tt)* )) => (
+		{
+			use ::nom_crate::lib::std::result::Result::*;
+			use ::nom_crate::{Err,ErrorKind};
+
+			let i_ = $i.clone();
+			match $submac!(i_, $($args)*) {
+				Err(Err::Incomplete(_)) =>  {
+					Err(Err::Error(error_position!($i, ErrorKind::Complete::<::Error>)))
+				},
+				rest => rest
+			}
+		}
+	);
+	($i:expr, $f:expr) => (
+		comp!($i, call!($f));
+	);
+);
+
 // ==================================================
 // ============= Numeric expressions ================
 // ==================================================
 
 impl<'a> AddAssign<&'a EvalResult> for EvalResult {
     fn add_assign(&mut self, rhs: &'a EvalResult) {
 		use self::EvalResult::*;
 		*self=match (&*self,rhs) {
@@ -285,17 +307,17 @@ impl<'a> PRef<'a> {
 			map_opt!(pair!(one_of_punctuation!(["+", "-", "~"]),call_m!(self.unary)),unary_op)
 		)
 	);
 
 	method!(mul_div_rem<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		do_parse!(
 			acc: call_m!(self.unary) >>
 			res: fold_many0!(
-				pair!(one_of_punctuation!(["*", "/", "%"]), call_m!(self.unary)),
+				pair!(comp!(one_of_punctuation!(["*", "/", "%"])), call_m!(self.unary)),
 				acc,
 				|mut acc, (op, val): (&[u8], EvalResult)| {
 					 match op[0] as char {
 						'*' => acc *= &val,
 						'/' => acc /= &val,
 						'%' => acc %= &val,
 						_   => unreachable!()
 					};
@@ -304,17 +326,17 @@ impl<'a> PRef<'a> {
 			) >> (res)
 		)
 	);
 
 	method!(add_sub<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		do_parse!(
 			acc: call_m!(self.mul_div_rem) >>
 			res: fold_many0!(
-				pair!(one_of_punctuation!(["+", "-"]), call_m!(self.mul_div_rem)),
+				pair!(comp!(one_of_punctuation!(["+", "-"])), call_m!(self.mul_div_rem)),
 				acc,
 				|mut acc, (op, val): (&[u8], EvalResult)| {
 					match op[0] as char {
 						'+' => acc += &val,
 						'-' => acc -= &val,
 						_   => unreachable!()
 					};
 					acc
@@ -322,17 +344,17 @@ impl<'a> PRef<'a> {
 			) >> (res)
 		)
 	);
 
 	method!(shl_shr<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		numeric!(do_parse!(
 			acc: call_m!(self.add_sub) >>
 			res: fold_many0!(
-				pair!(one_of_punctuation!(["<<", ">>"]), call_m!(self.add_sub)),
+				pair!(comp!(one_of_punctuation!(["<<", ">>"])), call_m!(self.add_sub)),
 				acc,
 				|mut acc, (op, val): (&[u8], EvalResult)| {
 					match op {
 						b"<<" => acc <<= &val,
 						b">>" => acc >>= &val,
 						_     => unreachable!()
 					};
 					acc
@@ -340,45 +362,45 @@ impl<'a> PRef<'a> {
 			) >> (res)
 		))
 	);
 
 	method!(and<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		numeric!(do_parse!(
 			acc: call_m!(self.shl_shr) >>
 			res: fold_many0!(
-				preceded!(p!("&"), call_m!(self.shl_shr)),
+				preceded!(comp!(p!("&")), call_m!(self.shl_shr)),
 				acc,
 				|mut acc, val: EvalResult| {
 					acc &= &val;
 					acc
 				}
 			) >> (res)
 		))
 	);
 
 	method!(xor<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		numeric!(do_parse!(
 			acc: call_m!(self.and) >>
 			res: fold_many0!(
-				preceded!(p!("^"), call_m!(self.and)),
+				preceded!(comp!(p!("^")), call_m!(self.and)),
 				acc,
 				|mut acc, val: EvalResult| {
 					acc ^= &val;
 					acc
 				}
 			) >> (res)
 		))
 	);
 
 	method!(or<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		numeric!(do_parse!(
 			acc: call_m!(self.xor) >>
 			res: fold_many0!(
-				preceded!(p!("|"), call_m!(self.xor)),
+				preceded!(comp!(p!("|")), call_m!(self.xor)),
 				acc,
 				|mut acc, val: EvalResult| {
 					acc |= &val;
 					acc
 				}
 			) >> (res)
 		))
 	);
@@ -392,54 +414,56 @@ impl<'a> PRef<'a> {
 // =======================================================
 // ============= Literals and identifiers ================
 // =======================================================
 
 impl<'a> PRef<'a> {
 	fn identifier(self, input: &[Token]) -> (Self,CResult<EvalResult>) {
 		(self,match input.split_first() {
 			None =>
-				IResult::Incomplete(Needed::Size(1)),
+				Err(Err::Incomplete(Needed::Size(1))),
 			Some((&Token{kind:TokenKind::Identifier,ref raw},rest)) => {
 				if let Some(r) = self.identifiers.get(&raw[..]) {
-					IResult::Done(rest, r.clone())
+					Ok((rest, r.clone()))
 				} else {
-					IResult::Error(Err::Position(ErrorKind::Custom(::Error::UnknownIdentifier), input))
+					Err(Err::Error(error_position!(input, ErrorKind::Custom(::Error::UnknownIdentifier))))
 				}
 			},
 			Some(_) =>
-				IResult::Error(Err::Position(ErrorKind::Custom(::Error::TypedToken(TokenKind::Identifier)), input)),
+				Err(Err::Error(error_position!(input, ErrorKind::Custom(::Error::TypedToken(TokenKind::Identifier))))),
 		})
 	}
 
 	fn literal(self, input: &[Token]) -> (Self,CResult<EvalResult>) {
 		(self,match input.split_first() {
 			None =>
-				IResult::Incomplete(Needed::Size(1)),
+				Err(Err::Incomplete(Needed::Size(1))),
 			Some((&Token{kind:TokenKind::Literal,ref raw},rest)) =>
 				match literal::parse(raw) {
-					IResult::Done(_,result) => IResult::Done(rest, result),
-					_ => IResult::Error(Err::Position(ErrorKind::Custom(::Error::InvalidLiteral), input))
+					Ok((_,result)) => Ok((rest, result)),
+					_ => {
+            Err(Err::Error(error_position!(input, ErrorKind::Custom(::Error::InvalidLiteral))))
+          },
 				},
 			Some(_) =>
-				IResult::Error(Err::Position(ErrorKind::Custom(::Error::TypedToken(TokenKind::Literal)), input)),
+				Err(Err::Error(error_position!(input, ErrorKind::Custom(::Error::TypedToken(TokenKind::Literal))))),
 		})
 	}
 
 	method!(string<PRef<'a>,&[Token],Vec<u8>,::Error>, mut self,
 		alt!(
 			map_opt!(call_m!(self.literal),EvalResult::as_str) |
 			map_opt!(call_m!(self.identifier),EvalResult::as_str)
 		)
 	);
 
 	// "string1" "string2" etc...
 	method!(concat_str<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		map!(
-			pair!(call_m!(self.string),many0!(call_m!(self.string))),
+			pair!(call_m!(self.string),many0!(comp!(call_m!(self.string)))),
 			|(first,v)| Vec::into_iter(v).fold(first,|mut s,elem|{Vec::extend_from_slice(&mut s,Vec::<u8>::as_slice(&elem));s}).into()
 		)
 	);
 
 	method!(expr<PRef<'a>,&[Token],EvalResult,::Error>, mut self,
 		alt!(
 			call_m!(self.numeric_expr) |
 			delimited!(p!("("),call_m!(self.expr),p!(")")) |
@@ -490,17 +514,17 @@ impl<'ident> IdentifierParser<'ident> {
 	/// on most function-like macros, or if the token stream contains comments,
 	/// keywords or unknown identifiers.
 	///
 	/// N.B. This is intended to fail on function-like macros, but if it the
 	/// macro takes a single argument, the argument name is defined as an
 	/// identifier, and the macro otherwise parses as an expression, it will
 	/// return a result even on function-like macros.
 	///
-	/// ```ignore
+	/// ```c
 	/// // will evaluate into IDENTIFIER
 	/// #define DELETE(IDENTIFIER)
 	/// // will evaluate into IDENTIFIER-3
 	/// #define NEGATIVE_THREE(IDENTIFIER)  -3
 	/// ```
 	pub fn macro_definition<'a>(&self,input: &'a [Token]) -> CResult<'a,(&'a [u8],EvalResult)> {
 		::assert_full_parse(self.as_ref().macro_definition(input).1)
 	}
--- a/third_party/rust/cexpr/src/lib.rs
+++ b/third_party/rust/cexpr/src/lib.rs
@@ -34,24 +34,31 @@ pub enum Error {
     ///
     /// When encountered, this generally means a bug exists in the data that
     /// was passed in or the parsing logic.
 	InvalidLiteral,
     /// A full parse was requested, but data was left over after parsing finished.
     Partial,
 }
 
+impl From<u32> for Error {
+	fn from(_: u32) -> Self {
+		Error::InvalidLiteral
+	}
+}
+
 macro_rules! identity (
     ($i:expr,$e:expr) => ($e);
 );
 
 /// If the input result indicates a succesful parse, but there is data left,
 /// return an `Error::Partial` instead.
-pub fn assert_full_parse<I,O,E>(result: IResult<&[I],O,E>) -> IResult<&[I],O,::Error> {
+pub fn assert_full_parse<I,O,E>(result: IResult<&[I],O,E>) -> IResult<&[I],O,::Error>
+  where Error: From<E> {
 	match fix_error!((),::Error,identity!(result)) {
-		IResult::Done(rem,output) => if rem.len()==0 {
-			IResult::Done(rem, output)
+		Ok((rem,output)) => if rem.len()==0 {
+			Ok((rem, output))
 		} else {
-			IResult::Error(Err::Position(ErrorKind::Custom(::Error::Partial), rem))
+			Err(Err::Error(error_position!(rem, ErrorKind::Custom(::Error::Partial))))
 		},
 		r => r,
 	}
 }
--- a/third_party/rust/cexpr/src/literal.rs
+++ b/third_party/rust/cexpr/src/literal.rs
@@ -74,35 +74,57 @@ impl Into<Vec<u8>> for CChar {
 				let mut v=Vec::with_capacity(1);
 				v.push(i as u8);
 				v
 			}
 		}
 	}
 }
 
+/// ensures the child parser consumes the whole input
+#[macro_export]
+macro_rules! full (
+	($i: expr, $submac:ident!( $($args:tt)* )) => (
+		{
+			use ::nom_crate::lib::std::result::Result::*;
+			let res =  $submac!($i, $($args)*);
+			match res {
+				Ok((i, o)) => if i.len() == 0 {
+					Ok((i, o))
+				} else {
+					Err(::nom_crate::Err::Error(error_position!(i, ::nom_crate::ErrorKind::Custom(42))))
+				},
+				r => r,
+			}
+		}
+	);
+	($i:expr, $f:ident) => (
+		full!($i, call!($f));
+	);
+);
+
 // ====================================================
 // ======== macros that shouldn't be necessary ========
 // ====================================================
 
 macro_rules! force_type (
-	($input:expr,IResult<$i:ty,$o:ty,$e:ty>) => (IResult::Error::<$i,$o,$e>(Err::Position(ErrorKind::Fix,$input)))
+	($input:expr,IResult<$i:ty,$o:ty,$e:ty>) => (Err::<($i,$o),Err<$i,$e>>(::nom_crate::Err::Error(error_position!($input, ErrorKind::Fix))))
 );
 
 
 // =================================
 // ======== matching digits ========
 // =================================
 
 macro_rules! byte (
 	($i:expr, $($p: pat)|* ) => ({
 		match $i.split_first() {
-			$(Some((&c @ $p,rest)))|* => IResult::Done::<&[_],u8,u32>(rest,c),
-			Some(_) => IResult::Error(Err::Position(ErrorKind::OneOf,$i)),
-			None => IResult::Incomplete(Needed::Size(1)),
+			$(Some((&c @ $p,rest)))|* => Ok::<(&[_],u8),::nom_crate::Err<&[_],u32>>((rest,c)),
+			Some(_) => Err(::nom_crate::Err::Error(error_position!($i, ErrorKind::OneOf))),
+			None => Err(::nom_crate::Err::Incomplete(Needed::Size(1))),
 		}
 	})
 );
 
 named!(binary<u8>,byte!(b'0' ... b'1'));
 named!(octal<u8>,byte!(b'0' ... b'7'));
 named!(decimal<u8>,byte!(b'0' ... b'9'));
 named!(hexadecimal<u8>,byte!(b'0' ... b'9' | b'a' ... b'f' | b'A' ... b'F'));
@@ -137,17 +159,17 @@ fn c_raw_escape(n: Vec<u8>, radix: u32) 
 fn c_unicode_escape(n: Vec<u8>) -> Option<CChar> {
 	str::from_utf8(&n).ok()
 		.and_then(|i|u32::from_str_radix(i,16).ok())
 		.and_then(char::from_u32)
 		.map(CChar::Char)
 }
 
 named!(escaped_char<CChar>,
-	preceded!(char!('\\'),alt!(
+	preceded!(complete!(char!('\\')),alt_complete!(
 		map!(one_of!(r#"'"?\"#),CChar::Char) |
 		map!(one_of!("abfnrtv"),escape2char) |
 		map_opt!(many_m_n!(1,3,octal),|v|c_raw_escape(v,8)) |
 		map_opt!(preceded!(char!('x'),many1!(hexadecimal)),|v|c_raw_escape(v,16)) |
 		map_opt!(preceded!(char!('u'),many_m_n!(4,4,hexadecimal)),c_unicode_escape) |
 		map_opt!(preceded!(char!('U'),many_m_n!(8,8,hexadecimal)),c_unicode_escape)
 	))
 );
@@ -168,70 +190,80 @@ named!(c_char<CChar>,
 		char!('\'')
 	)
 );
 
 named!(c_string<Vec<u8> >,
 	delimited!(
 		alt!( preceded!(c_width_prefix,char!('"')) | char!('"') ),
 		fold_many0!(
-			alt!(map!(escaped_char, |c:CChar| c.into()) | map!(is_not!("\""), |c: &[u8]| c.into())),
+			alt!(map!(escaped_char, |c:CChar| c.into()) | map!(complete!(is_not!("\"")), |c: &[u8]| c.into())),
 			Vec::new(),
 			|mut v: Vec<u8>, res:Vec<u8>| { v.extend_from_slice(&res); v }
 		),
 		char!('"')
 	)
 );
 
 // ================================
 // ======== parse integers ========
 // ================================
 
 fn c_int_radix(n: Vec<u8>, radix: u32) -> Option<u64> {
 	str::from_utf8(&n).ok()
 		.and_then(|i|u64::from_str_radix(i,radix).ok())
 }
 
+fn take_ul(input: &[u8]) -> IResult<&[u8], &[u8]> {
+	use ::nom_crate::InputTakeAtPosition;
+
+	let r = input.split_at_position(|c| c != b'u' && c != b'U' && c != b'l' && c != b'L');
+	match r {
+		Err(Err::Incomplete(_)) => Ok((&input[input.len()..], input)),
+		res => res,
+	}
+}
+
 named!(c_int<i64>,
 	map!(terminated!(alt_complete!(
-		map_opt!(preceded!(tag!("0x"),many1!(hexadecimal)),|v|c_int_radix(v,16)) |
-		map_opt!(preceded!(tag!("0b"),many1!(binary)),|v|c_int_radix(v,2)) |
-		map_opt!(preceded!(char!('0'),many1!(octal)),|v|c_int_radix(v,8)) |
-		map_opt!(many1!(decimal),|v|c_int_radix(v,10)) |
+		map_opt!(preceded!(tag!("0x"),many1!(complete!(hexadecimal))),|v|c_int_radix(v,16)) |
+		map_opt!(preceded!(tag!("0b"),many1!(complete!(binary))),|v|c_int_radix(v,2)) |
+		map_opt!(preceded!(char!('0'),many1!(complete!(octal))),|v|c_int_radix(v,8)) |
+		map_opt!(many1!(complete!(decimal)),|v|c_int_radix(v,10)) |
 		force_type!(IResult<_,_,u32>)
-	),is_a!("ulUL")),|i|i as i64)
+	),opt!(take_ul)),|i|i as i64)
 );
 
 // ==============================
 // ======== parse floats ========
 // ==============================
 
 named!(float_width<u8>,complete!(byte!(b'f' | b'l' | b'F' | b'L')));
-named!(float_exp<(Option<u8>,Vec<u8>)>,preceded!(byte!(b'e'|b'E'),pair!(opt!(byte!(b'-'|b'+')),many1!(decimal))));
+named!(float_exp<(Option<u8>,Vec<u8>)>,preceded!(byte!(b'e'|b'E'),pair!(opt!(byte!(b'-'|b'+')),many1!(complete!(decimal)))));
 
 named!(c_float<f64>,
 	map_opt!(alt!(
-		terminated!(recognize!(tuple!(many1!(decimal),byte!(b'.'),many0!(decimal))),opt!(float_width)) |
-		terminated!(recognize!(tuple!(many0!(decimal),byte!(b'.'),many1!(decimal))),opt!(float_width)) |
-		terminated!(recognize!(tuple!(many0!(decimal),opt!(byte!(b'.')),many1!(decimal),float_exp)),opt!(float_width)) |
-		terminated!(recognize!(tuple!(many1!(decimal),opt!(byte!(b'.')),many0!(decimal),float_exp)),opt!(float_width)) |
-		terminated!(recognize!(many1!(decimal)),float_width)
+		terminated!(recognize!(tuple!(many1!(complete!(decimal)),byte!(b'.'),many0!(complete!(decimal)))),opt!(float_width)) |
+		terminated!(recognize!(tuple!(many0!(complete!(decimal)),byte!(b'.'),many1!(complete!(decimal)))),opt!(float_width)) |
+		terminated!(recognize!(tuple!(many0!(complete!(decimal)),opt!(byte!(b'.')),many1!(complete!(decimal)),float_exp)),opt!(float_width)) |
+		terminated!(recognize!(tuple!(many1!(complete!(decimal)),opt!(byte!(b'.')),many0!(complete!(decimal)),float_exp)),opt!(float_width)) |
+		terminated!(recognize!(many1!(complete!(decimal))),float_width)
 	),|v|str::from_utf8(v).ok().and_then(|i|f64::from_str(i).ok()))
 );
 
 // ================================
 // ======== main interface ========
 // ================================
 
 named!(one_literal<&[u8],EvalResult,::Error>,
 	fix_error!(::Error,alt_complete!(
-		map!(c_char,EvalResult::Char) |
-		map!(c_int,|i|EvalResult::Int(::std::num::Wrapping(i))) |
-		map!(c_float,EvalResult::Float) |
-		map!(c_string,EvalResult::Str)
+		map!(full!(c_char),EvalResult::Char) |
+		map!(full!(c_int),|i|EvalResult::Int(::std::num::Wrapping(i))) |
+		map!(full!(c_float),EvalResult::Float) |
+		map!(full!(c_string),EvalResult::Str)
 	))
 );
 
 /// Parse a C literal.
 ///
 /// The input must contain exactly the representation of a single literal
 /// token, and in particular no whitespace or sign prefixes.
 pub fn parse(input: &[u8]) -> IResult<&[u8],EvalResult,::Error> {
--- a/third_party/rust/cexpr/tests/clang.rs
+++ b/third_party/rust/cexpr/tests/clang.rs
@@ -63,17 +63,17 @@ fn test_definition(ident: Vec<u8>, token
 			Some(Invalid)
 		}.expect(&format!("Invalid definition in testcase: {}",display_name))
 	};
 
 	let result = if functional {
 		let mut fnidents;
 		let expr_tokens;
 		match fn_macro_declaration(&tokens) {
-			cexpr::nom::IResult::Done(rest,(_,args)) => {
+			Ok((rest,(_,args))) => {
 				fnidents=idents.clone();
 				expr_tokens=rest;
 				for arg in args {
 					let val = match test {
 						Int(_) => bytes_to_int(&arg),
 						Str(_) => Some(Str(arg.to_owned())),
 						_ => unimplemented!()
 					}.expect(&format!("Invalid argument in functional macro testcase: {}",display_name));
@@ -82,21 +82,21 @@ fn test_definition(ident: Vec<u8>, token
 			},
 			e => {
 				println!("Failed test for {}, unable to parse functional macro declaration: {:?}",display_name,e);
 				return false;
 			}
 		}
 		assert_full_parse(IdentifierParser::new(&fnidents).expr(&expr_tokens))
 	} else {
-		IdentifierParser::new(idents).macro_definition(&tokens).map(|(_,val)|val)
+		IdentifierParser::new(idents).macro_definition(&tokens).map(|(i, (_,val))|(i, val))
 	};
 
 	match result {
-		cexpr::nom::IResult::Done(_,val) => {
+		Ok((_,val)) => {
 			if val==test {
 				if let Some(_)=idents.insert(ident,val) {
 					panic!("Duplicate definition for testcase: {}",display_name);
 				}
 				true
 			} else {
 				println!("Failed test for {}, expected {:?}, got {:?}",display_name,test,val);
 				false
@@ -144,21 +144,21 @@ extern "C" fn visit_children_thunk<F>(cu
 unsafe fn visit_children<F>(cursor: CXCursor, mut f: F)
 	where F: FnMut(CXCursor,CXCursor) -> CXChildVisitResult
 {
 	clang_visitChildren(cursor, visit_children_thunk::<F> as _, &mut f as *mut F as CXClientData);
 }
 
 unsafe fn location_in_scope(r: CXSourceRange) -> bool {
 	let start=clang_getRangeStart(r);
-	let mut file=CXFile(ptr::null_mut());
+	let mut file=ptr::null_mut();
 	clang_getSpellingLocation(start,&mut file,ptr::null_mut(),ptr::null_mut(),ptr::null_mut());
 	clang_Location_isFromMainFile(start)!=0
 		&& clang_Location_isInSystemHeader(start)==0
-		&& file.0!=ptr::null_mut()
+		&& file!=ptr::null_mut()
 }
 
 /// tokenize_range_adjust can be used to work around LLVM bug 9069
 /// https://bugs.llvm.org//show_bug.cgi?id=9069
 fn file_visit_macros<F: FnMut(Vec<u8>, Vec<Token>)>(file: &str, tokenize_range_adjust: bool, mut visitor: F) {
 	unsafe {
 		let tu={
 			let index=clang_createIndex(true as _, false as _);
--- a/third_party/rust/cexpr/tests/input/int_unsigned.h
+++ b/third_party/rust/cexpr/tests/input/int_unsigned.h
@@ -1,12 +1,13 @@
 #define Int_456 456
 #define Int_0 0
 #define Int_1 0b1
 #define Int_2 0x2
+#define Int_3 3L
 #define Int_63 077
 #define Int_123 123
 #define Int_124 124u
 #define Int_125 125uL
 #define Int_126 126LuL
 #define Int_16 (((1)<<4ULL))/*comment*/ 
 #define Int_13 1|8^6&2<<1
 
--- a/third_party/rust/clang-sys/.cargo-checksum.json
+++ b/third_party/rust/clang-sys/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".travis.yml":"d5c89494c836e00ec8c3c02c9e228bf5dc34aabff203c37662a248e2da4bda05","CHANGELOG.md":"62fd8ba43afbc4da3dba40d448a5af482794aaaa99071d40dc7abf8fc1a2195b","Cargo.toml":"1ada60cd29713d4386050d2b61a9eed430827885520816b0412ed0380fa3fa8f","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"dff1b472fe1edbc6059ff5a96e595fa8dab9e9e133d10fd761cf5dfdcc80f4c6","appveyor.yml":"c9ab8ab1ab028b27d2be176e994a0d6a255cf8bcc36e15868472b6b8abf33fac","build.rs":"50be9c247e528ab0a354a7652fa9516906f79bbb4d128d54db7f5a9ee1ed2a86","ci/before_install.sh":"711c9d0539fa0372980c3a288d9482a0e46d3ba0fb8f7c7c110d6488a8ec4de5","ci/install.bat":"fb636c3511ba038ccf805755ef6542237cc595e905edcd61d56abd7163321f76","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"73462f51aaa9a1c14ce9f55c41dc3672df64faa9789725384ae4f28d8ba3c90b","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"d0a11284694f4f77448e72480addca613572d19c07fa92157e0fa717ed504abd","src/link.rs":"a0208e6b8e4840f1162b3b799b5e12dd559cc6f31a330b0eb1ba4ebe2385296d","src/support.rs":"70e77ea4337f740b13c394034c5705e962af6ee7ac4843fc7c9c7fe22ec2d074","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"e5e8a60bcaec3b5d043fde4a993d397adb56454d0b2a6adaa15df0535246f909"},"package":"d7f7c04e52c35222fffcc3a115b5daf5f7e2bfb71c13c4e2321afe1fc71859c2"}
\ No newline at end of file
+{"files":{".travis.yml":"01d03daeb78fddd8fcd3dcf1ae9c30ffda023db214a1a89a1d5be768ea03277c","CHANGELOG.md":"ed5eb852120b184fda36d06a920080e5bd377b018548f2d37eb575dee32a20b1","Cargo.toml":"ae115d5ba8ac3e9074f6f8e64a89ec88579b388db75bbbd655d010610661b19a","LICENSE.txt":"3ddf9be5c28fe27dad143a5dc76eea25222ad1dd68934a047064e56ed2fa40c5","README.md":"21ff1488c29d612cee0d10fc48dab7efbd0a8a24158ee709b88e312e939008a0","appveyor.yml":"1a5d6953fb6e373dc760d50659628f04d48f68bd3f3f8e434800b31e74ef1497","build.rs":"06ef3732108d09118f50294fbca2b90857085fc3364777fca77eb022866399ac","build/common.rs":"4532706a124c0ff40332d5a72cd1e465bee72cd118f8071fbb6e70dde00c68f8","build/dynamic.rs":"544e5cb9fe364165a641192fc3f1ab916cb1d632a92536b8ce77a941fbb3082b","build/static.rs":"ff8de756b33efff75770a5552ff4573fe1bbb68ec8bd40d57854a05adb7e9d5c","ci/before_install.sh":"efb85403bedbfc6db19a8c41c61be98eac9f6e09ac6a33c0bdaf2828b5ea73ba","ci/install.bat":"bb02414d81dd23c8597f82f390769b084c2d32129ed197475a769a25ee97249a","ci/script.sh":"52db533df970f1b44c0b2663f3bfac4476f2150e94fc392b2bab4145325f418b","ci/test_script.bat":"901609adc59dab2730e16dd374d0351d6406e7559fe4d86ddd9a857ad9c84d2a","clippy.toml":"fcf54943ba571514b244cc098ce08671b4117167733e8107e799d533a12a2195","src/lib.rs":"d9952a832909e5490fca27b08d349a0d36c4004cd04fdb024ddf246cb81503d1","src/link.rs":"625ac2a7c5d0b85122e4a68542f235f09a069e7743f67f94c433f0f4313c09db","src/support.rs":"3eae21722287a462921825929c48802642d28ca194d1bc43aee47739350ecd17","tests/header.h":"1b15a686d1c06561960045a26c25a34d840f26c8246f2f5e630f993b69c7492c","tests/lib.rs":"d5d39e3ffbdc7303c2f1b9ae09f60ebf546b7c2c3599ec5d0c99d23332456908"},"package":"481e42017c1416b1c0856ece45658ecbb7c93d8a93455f7e5fa77f3b35455557"}
\ No newline at end of file
--- a/third_party/rust/clang-sys/.travis.yml
+++ b/third_party/rust/clang-sys/.travis.yml
@@ -1,26 +1,26 @@
-language: rust
-
-addons:
-  apt:
-    sources:
-      - ubuntu-toolchain-r-test
-    packages:
-      - gcc-5
-
-os:
-  - linux
-
-rust: stable
-
-env:
-  - LLVM_VERSION=3.5 CLANG_VERSION=clang_3_5
-  - LLVM_VERSION=5.0 CLANG_VERSION=clang_5_0
-
-cache:
-  directories:
-    - $HOME/.cargo
-    - $HOME/.llvm
-
-before_install: . ./ci/before_install.sh
-
-script: . ./ci/script.sh
+language: rust
+
+addons:
+  apt:
+    sources:
+      - ubuntu-toolchain-r-test
+    packages:
+      - gcc-5
+
+os:
+  - linux
+
+rust: stable
+
+env:
+  - LLVM_VERSION=3.5 CLANG_VERSION=clang_3_5
+  - LLVM_VERSION=5.0 CLANG_VERSION=clang_5_0
+
+cache:
+  directories:
+    - $HOME/.cargo
+    - $HOME/.llvm
+
+before_install: . ./ci/before_install.sh
+
+script: . ./ci/script.sh
--- a/third_party/rust/clang-sys/CHANGELOG.md
+++ b/third_party/rust/clang-sys/CHANGELOG.md
@@ -1,272 +1,295 @@
-## [0.23.0] - 2018-06-16
-
-### Changed
-- Changed `Clang::find` to skip dynamic libraries for an incorrect architecture on Windows
-
-## [0.22.0] - 2018-03-11
-
-### Added
-- Added support for `clang` 6.0.x
-- Bumped `libc` version to `0.2.39`
-- Bumped `libloading` version to `0.5.0`
-
-## [0.21.2] - 2018-02-17
-
-### Changed
-- Added original errors to error messages
-- Added support for searching for libraries in `LD_LIBRARY_PATH` directories
-
-## [0.21.1] - 2017-11-24
-
-### Changed
-- Improved finding of versioned libraries (e.g., `libclang-3.9.so`)
-
-### Fixed
-* Fixed compilation failures on the beta and nightly channels caused by a [compiler bug](https://github.com/KyleMayes/clang-sys/pull/69)
-
-## [0.21.0] - 2017-10-11
-
-### Changed
-* Replaced `bitflags` usage with constants which avoids crashes on 32-bit Linux platforms
-
-## [0.20.1] - 2017-09-16
-
-### Fixed
-- Fixed static linking
-
-## [0.20.0] - 2017-09-14
-
-### Added
-- Added support for `clang` 5.0.x
-- Added `clang` as a link target of this package
-- Added dummy implementations of `is_loaded` for builds with the `static` Cargo feature enabled
-
-## [0.19.0] - 2017-07-02
-
-### Changed
-- Bumped `bitflags` version to `0.9.1`
-- Added `args` parameter to `Clang::new` function which passes arguments to the Clang executable
-
-## [0.18.0] - 2017-05-16
-
-### Changed
-- Improved finding of versioned libraries (e.g., `libclang.so.3.9`)
-
-## [0.17.0] - 2017-05-08
-
-### Changed
-- Changed storage type of include search paths from `Vec<PathBuf>` to `Option<Vec<PathBuf>>`
-
-## [0.16.0] - 2017-05-02
-
-### Changed
-- Bumped `libloading` version to `0.4.0`
-
-## [0.15.2] - 2017-04-28
-
-### Fixed
-- Fixed finding of `libclang.so.1` on Linux
-
-## [0.15.1] - 2017-03-29
-
-### Fixed
-- Fixed static linking when libraries are in [different directories](https://github.com/KyleMayes/clang-sys/issues/50)
-
-## [0.15.0] - 2017-03-13
-
-### Added
-- Added support for `clang` 4.0.x
-
-### Changed
-- Changed functions in the `Functions` struct to be `unsafe` (`runtime` feature only)
-- Changed `Clang::find` method to ignore directories and non-executable files
-- Changed `Clang::find` to skip dynamic libraries for an incorrect architecture on FreeBSD and Linux
-- Bumped `bitflags` version to `0.7.0`
-
-## [0.14.0] - 2017-01-30
-
-### Changed
-- Changed all enum types from tuple structs to raw integers to avoid
-  [segmentation faults](https://github.com/rust-lang/rust/issues/39394) on some platforms
-
-## [0.13.0] - 2017-01-29
-
-### Changed
-- Changed all opaque pointers types from tuple structs to raw pointers to avoid
-  [segmentation faults](https://github.com/rust-lang/rust/issues/39394) on some platforms
-
-## [0.12.0] - 2016-12-13
-
-### Changed
-- Altered the runtime linking API to allow for testing the presence of functions
-
-## [0.11.1] - 2016-12-07
-
-### Added
-- Added support for linking to Clang on Windows from unofficial LLVM sources such as MSYS and MinGW
-
-## [0.11.0] - 2016-10-07
-
-### Changed
-- Changed all enums from Rust enums to typed constants to avoid
-  [undefined behavior](https://github.com/KyleMayes/clang-sys/issues/42)
-
-## [0.10.1] - 2016-08-21
-
-### Changed
-- Changed static linking on FreeBSD and OS X to link against `libc++` instead of `libstd++`
-
-## [0.10.0] - 2016-08-01
-
-### Changed
-- Added `runtime` Cargo feature that links to `libclang` shared library at runtime
-- Added `from_raw` method to `CXTypeLayoutError` enum
-- Added implementations of `Deref` for opaque FFI structs
-- Changed `Default` implementations for structs to zero out the struct
-
-## [0.9.0] - 2016-07-21
-
-### Added
-- Added documentation bindings
-
-## [0.8.1] - 2016-07-20
-
-### Changed
-- Added `CLANG_PATH` environment variable for providing a path to `clang` executable
-- Added usage of `llvm-config` to search for `clang`
-- Added usage of `xcodebuild` to search for `clang` on OS X
-
-## [0.8.0] - 2016-07-18
-
-### Added
-- Added support for `clang` 3.9.x
-
-### Changed
-- Bumped `libc` version to `0.2.14`
-
-### Fixed
-- Fixed `LIBCLANG_PATH` usage on Windows to search both the `bin` and `lib` directories
-- Fixed search path parsing on OS X
-- Fixed search path parsing on Windows
-- Fixed default search path ordering on OS X
-
-## [0.7.2] - 2016-06-17
-
-### Fixed
-- Fixed finding of `clang` executables when system has executables matching `clang-*`
-  (e.g., `clang-format`)
-
-## [0.7.1] - 2016-06-10
-
-### Changed
-- Bumped `libc` version to `0.2.12`
-
-### Fixed
-- Fixed finding of `clang` executables suffixed by their version (e.g., `clang-3.5`)
-
-## [0.7.0] - 2016-05-31
-
-### Changed
-- Changed `Clang` struct `version` field type to `Option<CXVersion>`
-
-## [0.6.0] - 2016-05-26
-
-### Added
-- Added `support` module
-
-### Fixed
-- Fixed `libclang` linking on FreeBSD
-- Fixed `libclang` linking on Windows with the MSVC toolchain
-- Improved `libclang` static linking
-
-## [0.5.4] - 20160-5-19
-
-### Changed
-- Added implementations of `Default` for FFI structs
-
-## [0.5.3] - 2016-05-17
-
-### Changed
-- Bumped `bitflags` version to `0.7.0`
-
-## [0.5.2] - 2016-05-12
-
-### Fixed
-- Fixed `libclang` static linking
-
-## [0.5.1] - 2016-05-10
-
-### Fixed
-- Fixed `libclang` linking on OS X
-- Fixed `libclang` linking on Windows
-
-## [0.5.0] - 2016-05-10
-
-### Removed
-- Removed `rustc_version` dependency
-- Removed support for `LIBCLANG_STATIC` environment variable
-
-### Changed
-- Bumped `bitflags` version to `0.6.0`
-- Bumped `libc` version to `0.2.11`
-- Improved `libclang` search path
-- Improved `libclang` static linking
-
-## [0.4.2] - 2016-04-20
-
-### Changed
-- Bumped `libc` version to `0.2.10`
-
-## [0.4.1] - 2016-04-02
-
-### Changed
-- Bumped `libc` version to `0.2.9`
-- Bumped `rustc_version` version to `0.1.7`
-
-## [0.4.0] - 2016-03-28
-
-### Removed
-- Removed support for `clang` 3.4.x
-
-## [0.3.1] - 2016-03-21
-
-### Added
-- Added support for finding `libclang`
-
-## [0.3.0] - 2016-03-16
-
-### Removed
-- Removed build system types and functions
-
-### Added
-- Added support for `clang` 3.4.x
-
-### Changed
-- Bumped `bitflags` version to `0.5.0`
-- Bumped `libc` version to `0.2.8`
-
-## [0.2.1] - 2016-02-13
-
-### Changed
-- Simplified internal usage of conditional compilation
-- Bumped `bitflags` version to `0.4.0`
-- Bumped `libc` version to `0.2.7`
-- Bumped `rustc_version` version to `0.1.6`
-
-## [0.2.0] - 2016-02-12
-
-### Added
-- Added support for `clang` 3.8.x
-
-## [0.1.2] - 2015-12-29
-
-### Added
-- Added derivations of `Debug` for FFI structs
-
-## [0.1.1] - 2015-12-26
-
-### Added
-- Added derivations of `PartialOrd` and `Ord` for FFI enums
-
-## [0.1.0] - 2015-12-22
-- Initial release
+## [0.26.1] - 2018-10-10
+
+### Fixed
+- Fixed support for finding libraries in `bin` directories on Windows
+
+## [0.26.0] - 2018-10-07
+
+### Changed
+- Added support for finding libraries with version suffixes on Linux when using runtime linking (e.g., `libclang.so.1`)
+
+## [0.25.0] - 2018-10-06
+
+### Changed
+- Added support for versioned libraries on BSDs
+
+## [0.24.0] - 2018-09-15
+
+### Changed
+- Reworked finding of libraries (see `README.md` for details)
+
+### Added
+- Added support for `clang` 7.0.x
+
+## [0.23.0] - 2018-06-16
+
+### Changed
+- Changed `Clang::find` to skip dynamic libraries for an incorrect architecture on Windows
+
+## [0.22.0] - 2018-03-11
+
+### Added
+- Added support for `clang` 6.0.x
+- Bumped `libc` version to `0.2.39`
+- Bumped `libloading` version to `0.5.0`
+
+## [0.21.2] - 2018-02-17
+
+### Changed
+- Added original errors to error messages
+- Added support for searching for libraries in `LD_LIBRARY_PATH` directories
+
+## [0.21.1] - 2017-11-24
+
+### Changed
+- Improved finding of versioned libraries (e.g., `libclang-3.9.so`)
+
+### Fixed
+* Fixed compilation failures on the beta and nightly channels caused by a [compiler bug](https://github.com/KyleMayes/clang-sys/pull/69)
+
+## [0.21.0] - 2017-10-11
+
+### Changed
+* Replaced `bitflags` usage with constants which avoids crashes on 32-bit Linux platforms
+
+## [0.20.1] - 2017-09-16
+
+### Fixed
+- Fixed static linking
+
+## [0.20.0] - 2017-09-14
+
+### Added
+- Added support for `clang` 5.0.x
+- Added `clang` as a link target of this package
+- Added dummy implementations of `is_loaded` for builds with the `static` Cargo feature enabled
+
+## [0.19.0] - 2017-07-02
+
+### Changed
+- Bumped `bitflags` version to `0.9.1`
+- Added `args` parameter to `Clang::new` function which passes arguments to the Clang executable
+
+## [0.18.0] - 2017-05-16
+
+### Changed
+- Improved finding of versioned libraries (e.g., `libclang.so.3.9`)
+
+## [0.17.0] - 2017-05-08
+
+### Changed
+- Changed storage type of include search paths from `Vec<PathBuf>` to `Option<Vec<PathBuf>>`
+
+## [0.16.0] - 2017-05-02
+
+### Changed
+- Bumped `libloading` version to `0.4.0`
+
+## [0.15.2] - 2017-04-28
+
+### Fixed
+- Fixed finding of `libclang.so.1` on Linux
+
+## [0.15.1] - 2017-03-29
+
+### Fixed
+- Fixed static linking when libraries are in [different directories](https://github.com/KyleMayes/clang-sys/issues/50)
+
+## [0.15.0] - 2017-03-13
+
+### Added
+- Added support for `clang` 4.0.x
+
+### Changed
+- Changed functions in the `Functions` struct to be `unsafe` (`runtime` feature only)
+- Changed `Clang::find` method to ignore directories and non-executable files
+- Changed `Clang::find` to skip dynamic libraries for an incorrect architecture on FreeBSD and Linux
+- Bumped `bitflags` version to `0.7.0`
+
+## [0.14.0] - 2017-01-30
+
+### Changed
+- Changed all enum types from tuple structs to raw integers to avoid
+  [segmentation faults](https://github.com/rust-lang/rust/issues/39394) on some platforms
+
+## [0.13.0] - 2017-01-29
+
+### Changed
+- Changed all opaque pointers types from tuple structs to raw pointers to avoid
+  [segmentation faults](https://github.com/rust-lang/rust/issues/39394) on some platforms
+
+## [0.12.0] - 2016-12-13
+
+### Changed
+- Altered the runtime linking API to allow for testing the presence of functions
+
+## [0.11.1] - 2016-12-07
+
+### Added
+- Added support for linking to Clang on Windows from unofficial LLVM sources such as MSYS and MinGW
+
+## [0.11.0] - 2016-10-07
+
+### Changed
+- Changed all enums from Rust enums to typed constants to avoid
+  [undefined behavior](https://github.com/KyleMayes/clang-sys/issues/42)
+
+## [0.10.1] - 2016-08-21
+
+### Changed
+- Changed static linking on FreeBSD and OS X to link against `libc++` instead of `libstd++`
+
+## [0.10.0] - 2016-08-01
+
+### Changed
+- Added `runtime` Cargo feature that links to `libclang` shared library at runtime
+- Added `from_raw` method to `CXTypeLayoutError` enum
+- Added implementations of `Deref` for opaque FFI structs
+- Changed `Default` implementations for structs to zero out the struct
+
+## [0.9.0] - 2016-07-21
+
+### Added
+- Added documentation bindings
+
+## [0.8.1] - 2016-07-20
+
+### Changed
+- Added `CLANG_PATH` environment variable for providing a path to `clang` executable
+- Added usage of `llvm-config` to search for `clang`
+- Added usage of `xcodebuild` to search for `clang` on OS X
+
+## [0.8.0] - 2016-07-18
+
+### Added
+- Added support for `clang` 3.9.x
+
+### Changed
+- Bumped `libc` version to `0.2.14`
+
+### Fixed
+- Fixed `LIBCLANG_PATH` usage on Windows to search both the `bin` and `lib` directories
+- Fixed search path parsing on OS X
+- Fixed search path parsing on Windows
+- Fixed default search path ordering on OS X
+
+## [0.7.2] - 2016-06-17
+
+### Fixed
+- Fixed finding of `clang` executables when system has executables matching `clang-*`
+  (e.g., `clang-format`)
+
+## [0.7.1] - 2016-06-10
+
+### Changed
+- Bumped `libc` version to `0.2.12`
+
+### Fixed
+- Fixed finding of `clang` executables suffixed by their version (e.g., `clang-3.5`)
+
+## [0.7.0] - 2016-05-31
+
+### Changed
+- Changed `Clang` struct `version` field type to `Option<CXVersion>`
+
+## [0.6.0] - 2016-05-26
+
+### Added
+- Added `support` module
+
+### Fixed
+- Fixed `libclang` linking on FreeBSD
+- Fixed `libclang` linking on Windows with the MSVC toolchain
+- Improved `libclang` static linking
+
+## [0.5.4] - 20160-5-19
+
+### Changed
+- Added implementations of `Default` for FFI structs
+
+## [0.5.3] - 2016-05-17
+
+### Changed
+- Bumped `bitflags` version to `0.7.0`
+
+## [0.5.2] - 2016-05-12
+
+### Fixed
+- Fixed `libclang` static linking
+
+## [0.5.1] - 2016-05-10
+
+### Fixed
+- Fixed `libclang` linking on OS X
+- Fixed `libclang` linking on Windows
+
+## [0.5.0] - 2016-05-10
+
+### Removed
+- Removed `rustc_version` dependency
+- Removed support for `LIBCLANG_STATIC` environment variable
+
+### Changed
+- Bumped `bitflags` version to `0.6.0`
+- Bumped `libc` version to `0.2.11`
+- Improved `libclang` search path
+- Improved `libclang` static linking
+
+## [0.4.2] - 2016-04-20
+
+### Changed
+- Bumped `libc` version to `0.2.10`
+
+## [0.4.1] - 2016-04-02
+
+### Changed
+- Bumped `libc` version to `0.2.9`
+- Bumped `rustc_version` version to `0.1.7`
+
+## [0.4.0] - 2016-03-28
+
+### Removed
+- Removed support for `clang` 3.4.x
+
+## [0.3.1] - 2016-03-21
+
+### Added
+- Added support for finding `libclang`
+
+## [0.3.0] - 2016-03-16
+
+### Removed
+- Removed build system types and functions
+
+### Added
+- Added support for `clang` 3.4.x
+
+### Changed
+- Bumped `bitflags` version to `0.5.0`
+- Bumped `libc` version to `0.2.8`
+
+## [0.2.1] - 2016-02-13
+
+### Changed
+- Simplified internal usage of conditional compilation
+- Bumped `bitflags` version to `0.4.0`
+- Bumped `libc` version to `0.2.7`
+- Bumped `rustc_version` version to `0.1.6`
+
+## [0.2.0] - 2016-02-12
+
+### Added
+- Added support for `clang` 3.8.x
+
+## [0.1.2] - 2015-12-29
+
+### Added
+- Added derivations of `Debug` for FFI structs
+
+## [0.1.1] - 2015-12-26
+
+### Added
+- Added derivations of `PartialOrd` and `Ord` for FFI enums
+
+## [0.1.0] - 2015-12-22
+- Initial release
--- a/third_party/rust/clang-sys/Cargo.toml
+++ b/third_party/rust/clang-sys/Cargo.toml
@@ -7,17 +7,17 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "clang-sys"
-version = "0.23.0"
+version = "0.26.1"
 authors = ["Kyle Mayes <kyle@mayeses.com>"]
 build = "build.rs"
 links = "clang"
 description = "Rust bindings for libclang."
 documentation = "https://kylemayes.github.io/clang-sys/3_5/clang_sys"
 readme = "README.md"
 license = "Apache-2.0"
 repository = "https://github.com/KyleMayes/clang-sys"
@@ -37,17 +37,19 @@ version = "0.2.11"
 clang_3_5 = []
 clang_3_6 = ["gte_clang_3_6"]
 clang_3_7 = ["gte_clang_3_6", "gte_clang_3_7"]
 clang_3_8 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8"]
 clang_3_9 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9"]
 clang_4_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0"]
 clang_5_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0", "gte_clang_5_0"]
 clang_6_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0", "gte_clang_5_0", "gte_clang_6_0"]
+clang_7_0 = ["gte_clang_3_6", "gte_clang_3_7", "gte_clang_3_8", "gte_clang_3_9", "gte_clang_4_0", "gte_clang_5_0", "gte_clang_6_0", "gte_clang_7_0"]
 gte_clang_3_6 = []
 gte_clang_3_7 = []
 gte_clang_3_8 = []
 gte_clang_3_9 = []
 gte_clang_4_0 = []
 gte_clang_5_0 = []
 gte_clang_6_0 = []
+gte_clang_7_0 = []
 runtime = ["libloading"]
 static = []
--- a/third_party/rust/clang-sys/LICENSE.txt
+++ b/third_party/rust/clang-sys/LICENSE.txt
@@ -1,202 +1,202 @@
-
-                                 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.
+
+                                 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.
--- a/third_party/rust/clang-sys/README.md
+++ b/third_party/rust/clang-sys/README.md
@@ -1,113 +1,122 @@
-# clang-sys
-
-[![crates.io](https://img.shields.io/crates/v/clang-sys.svg)](https://crates.io/crates/clang-sys)
-[![Travis CI](https://travis-ci.org/KyleMayes/clang-sys.svg?branch=master)](https://travis-ci.org/KyleMayes/clang-sys)
-[![AppVeyor](https://ci.appveyor.com/api/projects/status/7tv5mjyg55rof356/branch/master?svg=true)](https://ci.appveyor.com/project/KyleMayes/clang-sys-vtvy5/branch/master)
-
-Rust bindings for `libclang`.
-
-If you are interested in a Rust wrapper for these bindings, see
-[clang-rs](https://github.com/KyleMayes/clang-rs).
-
-Supported on the stable, beta, and nightly Rust channels.
-
-Released under the Apache License 2.0.
-
-See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on contributing to this repository.
-
-## Supported Versions
-
-To target a version of `libclang`, enable one of the following Cargo features:
-
-* `clang_3_5` - requires `libclang` 3.5 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/3_5/clang_sys))
-* `clang_3_6` - requires `libclang` 3.6 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/3_6/clang_sys))
-* `clang_3_7` - requires `libclang` 3.7 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/3_7/clang_sys))
-* `clang_3_8` - requires `libclang` 3.8 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/3_8/clang_sys))
-* `clang_3_9` - requires `libclang` 3.9 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/3_9/clang_sys))
-* `clang_4_0` - requires `libclang` 4.0 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys))
-* `clang_5_0` - requires `libclang` 5.0 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys))
-* `clang_6_0` - requires `libclang` 6.0 or later
-  ([Documentation](https://kylemayes.github.io/clang-sys/6_0/clang_sys))
-
-If you do not enable one of these features, the API provided by `libclang` 3.5 will be available by
-default.
-
-## Dependencies
-
-By default, this crate will attempt to link to `libclang` dynamically. In this case, this crate
-depends on the `libclang` shared library (`libclang.so` on Linux, `libclang.dylib` on OS X,
-`libclang.dll` on Windows). If you want to link to `libclang` statically instead, enable the
-`static` Cargo feature. In this case, this crate depends on the LLVM and Clang static libraries. If
-you don't want to link to `libclang` at compiletime but instead want to load it at runtime, enable
-the `runtime` Cargo feature.
-
-These libraries can be either be installed as a part of Clang or downloaded
-[here](http://llvm.org/releases/download.html).
-
-**Note:** This crate supports finding versioned instances of `libclang.so` (e.g.,
-`libclang.so.3.9` or `libclang-3.9.so`). In the case where there are multiple instances to choose
-from, this crate will prefer an unversioned instance first, then the version with the shortest and
-highest version. For example, the following instances of `libclang.so` are listed in descending
-order of preference:
-
-1. `libclang.so`
-2. `libclang.so.4`
-3. `libclang.so.4.0`
-4. `libclang.so.3`
-5. `libclang.so.3.9`
-
-**Note:** The downloads for LLVM and Clang 3.8 and later do not include the `libclang.a` static
-library. This means you cannot link to any of these versions of `libclang` statically unless you
-build it from source.
-
-## Environment Variables
-
-The following environment variables, if set, are used by this crate to find the required libraries
-and executables:
-
-* `LLVM_CONFIG_PATH` **(compiletime)** - provides a path to an `llvm-config` executable
-* `LIBCLANG_PATH` **(compiletime)** - provides a path to a directory containing a `libclang` shared
-  library
-* `LIBCLANG_STATIC_PATH` **(compiletime)** - provides a path to a directory containing LLVM and
-  Clang static libraries
-* `CLANG_PATH` **(runtime)** - provides a path to a `clang` executable
-
-## Linking
-
-### Dynamic
-
-First, the `libclang` shared library will be searched for in the directory provided by the
-`LIBCLANG_PATH` environment variable if it was set. If this fails, the directory returned by
-`llvm-config --libdir` will be searched. Failing that, the directories in the `LD_LIBRARY_PATH`
-environment variable will be searched. If none of these approaches is successful, a list of likely
-directories will be searched (e.g., `/usr/local/lib` on Linux).
-
-On Linux, running an executable that has been dynamically linked to `libclang` may require you to
-add a path to `libclang.so` to the `LD_LIBRARY_PATH` environment variable. The same is true on OS
-X, except the `DYLD_LIBRARY_PATH` environment variable is used instead.
-
-On Windows, running an executable that has been dynamically linked to `libclang` requires that
-`libclang.dll` can be found by the executable at runtime. See
-[here](https://msdn.microsoft.com/en-us/library/7d83bc18.aspx) for more information.
-
-### Static
-
-The availability of `llvm-config` is not optional for static linking. Ensure that an instance of
-this executable can be found on your system's path or set the `LLVM_CONFIG_PATH` environment
-variable. The required LLVM and Clang static libraries will be searched for in the same way as the
-shared library is searched for, except the `LIBCLANG_STATIC_PATH` environment variable is used in
-place of the `LIBCLANG_PATH` environment variable.
-
-### Runtime
-
-The `clang_sys::load` function is used to load a `libclang` shared library for use in the thread in
-which it is called. The `clang_sys::unload` function will unload the `libclang` shared library.
-`clang_sys::load` searches for a `libclang` shared library in the same way one is searched for when
-linking to `libclang` dynamically at compiletime.
+# clang-sys
+
+[![crates.io](https://img.shields.io/crates/v/clang-sys.svg)](https://crates.io/crates/clang-sys)
+[![Travis CI](https://travis-ci.org/KyleMayes/clang-sys.svg?branch=master)](https://travis-ci.org/KyleMayes/clang-sys)
+[![AppVeyor](https://ci.appveyor.com/api/projects/status/7tv5mjyg55rof356/branch/master?svg=true)](https://ci.appveyor.com/project/KyleMayes/clang-sys-vtvy5/branch/master)
+
+Rust bindings for `libclang`.
+
+If you are interested in a Rust wrapper for these bindings, see
+[clang-rs](https://github.com/KyleMayes/clang-rs).
+
+Supported on the stable, beta, and nightly Rust channels.
+
+Released under the Apache License 2.0.
+
+## Supported Versions
+
+To target a version of `libclang`, enable one of the following Cargo features:
+
+* `clang_3_5` - requires `libclang` 3.5 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/3_5/clang_sys))
+* `clang_3_6` - requires `libclang` 3.6 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/3_6/clang_sys))
+* `clang_3_7` - requires `libclang` 3.7 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/3_7/clang_sys))
+* `clang_3_8` - requires `libclang` 3.8 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/3_8/clang_sys))
+* `clang_3_9` - requires `libclang` 3.9 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/3_9/clang_sys))
+* `clang_4_0` - requires `libclang` 4.0 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys))
+* `clang_5_0` - requires `libclang` 5.0 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys))
+* `clang_6_0` - requires `libclang` 6.0 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/6_0/clang_sys))
+* `clang_7_0` - requires `libclang` 7.0 or later
+  ([Documentation](https://kylemayes.github.io/clang-sys/7_0/clang_sys))
+
+If you do not enable one of these features, the API provided by `libclang` 3.5 will be available by
+default.
+
+## Dependencies
+
+By default, this crate will attempt to link to `libclang` dynamically. In this case, this crate
+depends on the `libclang` shared library (`libclang.so` on Linux, `libclang.dylib` on OS X,
+`libclang.dll` on Windows). If you want to link to `libclang` statically instead, enable the
+`static` Cargo feature. In this case, this crate depends on the LLVM and Clang static libraries. If
+you don't want to link to `libclang` at compiletime but instead want to load it at runtime, enable
+the `runtime` Cargo feature.
+
+These libraries can be either be installed as a part of Clang or downloaded
+[here](http://llvm.org/releases/download.html).
+
+**Note:** The downloads for LLVM and Clang 3.8 and later do not include the `libclang.a` static
+library. This means you cannot link to any of these versions of `libclang` statically unless you
+build it from source.
+
+### Versioned Dependencies
+
+This crate supports finding versioned instances of `libclang.so` (e.g.,`libclang-3.9.so`).
+In the case where there are multiple instances to choose from, this crate will prefer instances with
+higher versions. For example, the following instances of `libclang.so` are listed in descending
+order of preference:
+
+1. `libclang-4.0.so`
+2. `libclang-4.so`
+3. `libclang-3.9.so`
+4. `libclang-3.so`
+5. `libclang.so`
+
+**Note:** On BSD distributions, versioned instances of `libclang.so` matching the pattern
+`libclang.so.*` (e.g., `libclang.so.7.0`) are also included.
+
+**Note:** On Linux distributions when the `runtime` features is enabled, versioned instances of
+`libclang.so` matching the pattern `libclang.so.*` (e.g., `libclang.so.1`) are also included.
+
+## Environment Variables
+
+The following environment variables, if set, are used by this crate to find the required libraries
+and executables:
+
+* `LLVM_CONFIG_PATH` **(compiletime)** - provides a path to an `llvm-config` executable
+* `LIBCLANG_PATH` **(compiletime)** - provides a path to a directory containing a `libclang` shared
+  library
+* `LIBCLANG_STATIC_PATH` **(compiletime)** - provides a path to a directory containing LLVM and
+  Clang static libraries
+* `CLANG_PATH` **(runtime)** - provides a path to a `clang` executable
+
+## Linking
+
+### Dynamic
+
+`libclang` shared libraries will be searched for in the following directories:
+
+* the directory provided by the `LIBCLANG_PATH` environment variable
+* the `bin` and `lib` directories in the directory provided by `llvm-config --libdir`
+* the directories provided by `LD_LIBRARY_PATH` environment variable
+* a list of likely directories for the target platform (e.g., `/usr/local/lib` on Linux)
+* **macOS only:** the toolchain directory in the directory provided by `xcode-select --print-path`
+
+On Linux, running an executable that has been dynamically linked to `libclang` may require you to
+add a path to `libclang.so` to the `LD_LIBRARY_PATH` environment variable. The same is true on OS
+X, except the `DYLD_LIBRARY_PATH` environment variable is used instead.
+
+On Windows, running an executable that has been dynamically linked to `libclang` requires that
+`libclang.dll` can be found by the executable at runtime. See
+[here](https://msdn.microsoft.com/en-us/library/7d83bc18.aspx) for more information.
+
+### Static
+
+The availability of `llvm-config` is not optional for static linking. Ensure that an instance of
+this executable can be found on your system's path or set the `LLVM_CONFIG_PATH` environment
+variable. The required LLVM and Clang static libraries will be searched for in the same way as
+shared libraries are searched for, except the `LIBCLANG_STATIC_PATH` environment variable is used in
+place of the `LIBCLANG_PATH` environment variable.
+
+### Runtime
+
+The `clang_sys::load` function is used to load a `libclang` shared library for use in the thread in
+which it is called. The `clang_sys::unload` function will unload the `libclang` shared library.
+`clang_sys::load` searches for a `libclang` shared library in the same way one is searched for when
+linking to `libclang` dynamically at compiletime.
--- a/third_party/rust/clang-sys/appveyor.yml
+++ b/third_party/rust/clang-sys/appveyor.yml
@@ -1,12 +1,12 @@
-environment:
-  matrix:
-    - LLVM_VERSION: 5.0.0
-      CLANG_VERSION: clang_5_0
-
-install:
-  - .\ci\install.bat
-
-build: false
-
-test_script:
-  - .\ci\test_script.bat
+environment:
+  matrix:
+    - LLVM_VERSION: 7.0.0
+      CLANG_VERSION: clang_7_0
+
+install:
+  - .\ci\install.bat
+
+build: false
+
+test_script:
+  - .\ci\test_script.bat
--- a/third_party/rust/clang-sys/build.rs
+++ b/third_party/rust/clang-sys/build.rs
@@ -1,451 +1,77 @@
-// Copyright 2016 Kyle Mayes
-//
-// 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.
-
-//! Finds the required `libclang` libraries and links to them.
-//!
-//! # Environment Variables
-//!
-//! This build script can make use of several environment variables to help it find the required
-//! static or dynamic libraries.
-//!
-//! * `LLVM_CONFIG_PATH` - provides a path to an `llvm-config` executable
-//! * `LIBCLANG_PATH` - provides a path to a directory containing a `libclang` shared library
-//! * `LIBCLANG_STATIC_PATH` - provides a path to a directory containing LLVM and Clang static libraries
-
-#![allow(unused_attributes)]
-
-extern crate glob;
-
-use std::env;
-use std::fs::{self, File};
-use std::io::{Read, Seek, SeekFrom};
-use std::path::{Path, PathBuf};
-use std::process::{Command};
-
-use glob::{MatchOptions};
-
-/// Returns the version in the supplied file if one can be found.
-fn find_version(file: &str) -> Option<&str> {
-    if file.starts_with("libclang.so.") {
-        Some(&file[12..])
-    } else if file.starts_with("libclang-") {
-        Some(&file[9..])
-    } else {
-        None
-    }
-}
-
-/// Returns the components of the version appended to the supplied file.
-fn parse_version(file: &Path) -> Vec<u32> {
-    let file = file.file_name().and_then(|f| f.to_str()).unwrap_or("");
-    let version = find_version(file).unwrap_or("");
-    version.split('.').map(|s| s.parse::<u32>().unwrap_or(0)).collect()
-}
-
-/// Returns a path to one of the supplied files if such a file can be found in the supplied directory.
-fn contains(directory: &Path, files: &[String]) -> Option<PathBuf> {
-    // Join the directory to the files to obtain our glob patterns.
-    let patterns = files.iter().filter_map(|f| directory.join(f).to_str().map(ToOwned::to_owned));
-
-    // Prevent wildcards from matching path separators.
-    let mut options = MatchOptions::new();
-    options.require_literal_separator = true;
-
-    // Collect any files that match the glob patterns.
-    let mut matches = patterns.flat_map(|p| {
-        if let Ok(paths) = glob::glob_with(&p, &options) {
-            paths.filter_map(Result::ok).collect()
-        } else {
-            vec![]
-        }
-    }).collect::<Vec<_>>();
-
-    // Sort the matches by their version, preferring shorter and higher versions.
-    matches.sort_by_key(|m| parse_version(m));
-    matches.pop()
-}
-
-/// Runs a console command, returning the output if the command was successfully executed.
-fn run(command: &str, arguments: &[&str]) -> Option<String> {
-    Command::new(command).args(arguments).output().map(|o| {
-        String::from_utf8_lossy(&o.stdout).into_owned()
-    }).ok()
-}
-
-/// Runs `llvm-config`, returning the output if the command was successfully executed.
-fn run_llvm_config(arguments: &[&str]) -> Result<String, String> {
-    match run(&env::var("LLVM_CONFIG_PATH").unwrap_or_else(|_| "llvm-config".into()), arguments) {
-        Some(output) => Ok(output),
-        None => {
-            let message = format!(
-                "couldn't execute `llvm-config {}`, set the LLVM_CONFIG_PATH environment variable \
-                to a path to a valid `llvm-config` executable",
-                arguments.join(" "),
-            );
-            Err(message)
-        },
-    }
-}
-
-/// Backup search directory globs for FreeBSD and Linux.
-const SEARCH_LINUX: &[&str] = &[
-    "/usr/lib*",
-    "/usr/lib*/*",
-    "/usr/lib*/*/*",
-    "/usr/local/lib*",
-    "/usr/local/lib*/*",
-    "/usr/local/lib*/*/*",
-    "/usr/local/llvm*/lib",
-];
-
-/// Backup search directory globs for OS X.
-const SEARCH_OSX: &[&str] = &[
-    "/usr/local/opt/llvm*/lib",
-    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib",
-    "/Library/Developer/CommandLineTools/usr/lib",
-    "/usr/local/opt/llvm*/lib/llvm*/lib",
-];
-
-/// Backup search directory globs for Windows.
-const SEARCH_WINDOWS: &[&str] = &[
-    "C:\\LLVM\\lib",
-    "C:\\Program Files*\\LLVM\\lib",
-    "C:\\MSYS*\\MinGW*\\lib",
-];
-
-/// Returns the ELF class from the ELF header in the supplied file.
-fn parse_elf_header(file: &PathBuf) -> Result<u8, String> {
-    let mut file = try!(File::open(file).map_err(|e| e.to_string()));
-    let mut elf = [0; 5];
-    try!(file.read_exact(&mut elf).map_err(|e| e.to_string()));
-    if elf[..4] == [127, 69, 76, 70] {
-        Ok(elf[4])
-    } else {
-        Err("invalid ELF header".into())
-    }
-}
-
-/// Returns the magic number from the PE header in the supplied file.
-fn parse_pe_header(file: &PathBuf) -> Result<u16, String> {
-    let mut file = try!(File::open(file).map_err(|e| e.to_string()));
-    let mut pe = [0; 4];
-
-    // Determine the header offset.
-    try!(file.seek(SeekFrom::Start(0x3C)).map_err(|e| e.to_string()));
-    try!(file.read_exact(&mut pe).map_err(|e| e.to_string()));
-    let offset = i32::from(pe[0]) + (i32::from(pe[1]) << 8) + (i32::from(pe[2]) << 16) + (i32::from(pe[3]) << 24);
-
-    // Determine the validity of the header.
-    try!(file.seek(SeekFrom::Start(offset as u64)).map_err(|e| e.to_string()));
-    try!(file.read_exact(&mut pe).map_err(|e| e.to_string()));
-    if pe != [80, 69, 0, 0] {
-        return Err("invalid PE header".into());
-    }
-
-    // Find the magic number.
-    try!(file.seek(SeekFrom::Current(20)).map_err(|e| e.to_string()));
-    try!(file.read_exact(&mut pe).map_err(|e| e.to_string()));
-    Ok(u16::from(pe[0]) + (u16::from(pe[1]) << 8))
-}
-
-/// Indicates the type of library being searched for.
-#[derive(Copy, Clone, Debug, PartialEq, Eq)]
-enum Library {
-    Dynamic,
-    Static,
-}
-
-impl Library {
-    /// Checks whether the supplied file is a valid library for the architecture.
-    fn check(&self, file: &PathBuf) -> Result<(), String> {
-        if cfg!(any(target_os="freebsd", target_os="linux")) {
-            if *self == Library::Static {
-                return Ok(());
-            }
-            let class = try!(parse_elf_header(file));
-            if cfg!(target_pointer_width="32") && class != 1 {
-                return Err("invalid ELF class (64-bit)".into());
-            }
-            if cfg!(target_pointer_width="64") && class != 2 {
-                return Err("invalid ELF class (32-bit)".into());
-            }
-            Ok(())
-        } else if cfg!(target_os="windows") {
-            if *self == Library::Static {
-                return Ok(());
-            }
-            let magic = try!(parse_pe_header(file));
-            if cfg!(target_pointer_width="32") && magic != 267 {
-                return Err("invalid DLL (64-bit)".into());
-            }
-            if cfg!(target_pointer_width="64") && magic != 523 {
-                return Err("invalid DLL (32-bit)".into());
-            }
-            Ok(())
-        } else {
-            Ok(())
-        }
-    }
-}
-
-/// Searches for a library, returning the directory it can be found in if the search was successful.
-fn find(library: Library, files: &[String], env: &str) -> Result<PathBuf, String> {
-    let mut skipped = vec![];
-
-    /// Attempts to return the supplied file.
-    macro_rules! try_file {
-        ($file:expr) => ({
-            match library.check(&$file) {
-                Ok(_) => return Ok($file),
-                Err(message) => skipped.push(format!("({}: {})", $file.display(), message)),
-            }
-        });
-    }
-
-    /// Searches the supplied directory and, on Windows, any relevant sibling directories.
-    macro_rules! search_directory {
-        ($directory:ident) => {
-            if let Some(file) = contains(&$directory, files) {
-                try_file!(file);
-            }
-
-            // On Windows, `libclang.dll` is usually found in the LLVM `bin` directory while
-            // `libclang.lib` is usually found in the LLVM `lib` directory. To keep things
-            // consistent with other platforms, only LLVM `lib` directories are included in the
-            // backup search directory globs so we need to search the LLVM `bin` directory here.
-            if cfg!(target_os="windows") && $directory.ends_with("lib") {
-                let sibling = $directory.parent().unwrap().join("bin");
-                if let Some(file) = contains(&sibling, files) {
-                    try_file!(file);
-                }
-            }
-        }
-    }
-
-    // Search the directory provided by the relevant environment variable if it is set.
-    if let Ok(directory) = env::var(env).map(|d| Path::new(&d).to_path_buf()) {
-        search_directory!(directory);
-    }
-
-    // Search the `bin` and `lib` subdirectories in the directory returned by
-    // `llvm-config --prefix` if `llvm-config` is available.
-    if let Ok(output) = run_llvm_config(&["--prefix"]) {
-        let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
-        let bin = directory.join("bin");
-        if let Some(file) = contains(&bin, files) {
-            try_file!(file);
-        }
-        let lib = directory.join("lib");
-        if let Some(file) = contains(&lib, files) {
-            try_file!(file);
-        }
-    }
-
-    // Search the `LD_LIBRARY_PATH` directories.
-    if let Ok(path) = env::var("LD_LIBRARY_PATH") {
-        for directory in path.split(':').map(Path::new) {
-            search_directory!(directory);
-        }
-    }
-
-    // Search the backup directories.
-    let search = if cfg!(any(target_os="freebsd", target_os="linux")) {
-        SEARCH_LINUX
-    } else if cfg!(target_os="macos") {
-        SEARCH_OSX
-    } else if cfg!(target_os="windows") {
-        SEARCH_WINDOWS
-    } else {
-        &[]
-    };
-    for pattern in search {
-        let mut options = MatchOptions::new();
-        options.case_sensitive = false;
-        options.require_literal_separator = true;
-        if let Ok(paths) = glob::glob_with(pattern, &options) {
-            for path in paths.filter_map(Result::ok).filter(|p| p.is_dir()) {
-                search_directory!(path);
-            }
-        }
-    }
-
-    let message = format!(
-        "couldn't find any of [{}], set the {} environment variable to a path where one of these \
-         files can be found (skipped: [{}])",
-        files.iter().map(|f| format!("'{}'", f)).collect::<Vec<_>>().join(", "),
-        env,
-        skipped.join(", "),
-    );
-    Err(message)
-}
-
-/// Searches for a `libclang` shared library, returning the path to such a shared library if the
-/// search was successful.
-pub fn find_shared_library() -> Result<PathBuf, String> {
-    let mut files = vec![format!("{}clang{}", env::consts::DLL_PREFIX, env::consts::DLL_SUFFIX)];
-    if cfg!(any(target_os="freebsd", target_os="linux", target_os="openbsd")) {
-        // Some BSDs and Linux distributions don't create a `libclang.so` symlink, so we need to
-        // look for any versioned files (e.g., `libclang.so.3.9` or `libclang-3.9.so`).
-        files.push("libclang.so.*".into());
-        files.push("libclang-*.so".into());
-    }
-    if cfg!(target_os="windows") {
-        // The official LLVM build uses `libclang.dll` on Windows instead of `clang.dll`. However,
-        // unofficial builds such as MinGW use `clang.dll`.
-        files.push("libclang.dll".into());
-    }
-    find(Library::Dynamic, &files, "LIBCLANG_PATH")
-}
-
-/// Returns the name of an LLVM or Clang library from a path to such a library.
-fn get_library_name(path: &Path) -> Option<String> {
-    path.file_stem().map(|p| {
-        let string = p.to_string_lossy();
-        if string.starts_with("lib") {
-            string[3..].to_owned()
-        } else {
-            string.to_string()
-        }
-    })
-}
-
-/// Returns the LLVM libraries required to link to `libclang` statically.
-fn get_llvm_libraries() -> Vec<String> {
-    run_llvm_config(&["--libs"]).unwrap().split_whitespace().filter_map(|p| {
-        // Depending on the version of `llvm-config` in use, listed libraries may be in one of two
-        // forms, a full path to the library or simply prefixed with `-l`.
-        if p.starts_with("-l") {
-            Some(p[2..].into())
-        } else {
-            get_library_name(Path::new(p))
-        }
-    }).collect()
-}
-
-/// Clang libraries required to link to `libclang` 3.5 and later statically.
-const CLANG_LIBRARIES: &[&str] = &[
-    "clang",
-    "clangAST",
-    "clangAnalysis",
-    "clangBasic",
-    "clangDriver",
-    "clangEdit",
-    "clangFrontend",
-    "clangIndex",
-    "clangLex",
-    "clangParse",
-    "clangRewrite",
-    "clangSema",
-    "clangSerialization",
-];
-
-/// Returns the Clang libraries required to link to `libclang` statically.
-fn get_clang_libraries<P: AsRef<Path>>(directory: P) -> Vec<String> {
-    let pattern = directory.as_ref().join("libclang*.a").to_string_lossy().to_string();
-    if let Ok(libraries) = glob::glob(&pattern) {
-        libraries.filter_map(|l| l.ok().and_then(|l| get_library_name(&l))).collect()
-    } else {
-        CLANG_LIBRARIES.iter().map(|l| l.to_string()).collect()
-    }
-}
-
-/// Find and link to `libclang` statically.
-#[cfg_attr(feature="runtime", allow(dead_code))]
-fn link_static() {
-    let name = if cfg!(target_os="windows") { "libclang.lib" } else { "libclang.a" };
-    let file = find(Library::Static, &[name.into()], "LIBCLANG_STATIC_PATH").unwrap();
-    let directory = file.parent().unwrap();
-
-    // Specify required Clang static libraries.
-    println!("cargo:rustc-link-search=native={}", directory.display());
-    for library in get_clang_libraries(directory) {
-        println!("cargo:rustc-link-lib=static={}", library);
-    }
-
-    // Determine the shared mode used by LLVM.
-    let mode = run_llvm_config(&["--shared-mode"]).map(|m| m.trim().to_owned());
-    let prefix = if mode.ok().map_or(false, |m| m == "static") { "static=" } else { "" };
-
-    // Specify required LLVM static libraries.
-    println!("cargo:rustc-link-search=native={}", run_llvm_config(&["--libdir"]).unwrap().trim_right());
-    for library in get_llvm_libraries() {
-        println!("cargo:rustc-link-lib={}{}", prefix, library);
-    }
-
-    // Specify required system libraries.
-    // MSVC doesn't need this, as it tracks dependencies inside `.lib` files.
-    if cfg!(target_os="freebsd") {
-        println!("cargo:rustc-flags=-l ffi -l ncursesw -l c++ -l z");
-    } else if cfg!(target_os="linux") {
-        println!("cargo:rustc-flags=-l ffi -l ncursesw -l stdc++ -l z");
-    } else if cfg!(target_os="macos") {
-        println!("cargo:rustc-flags=-l ffi -l ncurses -l c++ -l z");
-    }
-}
-
-/// Find and link to `libclang` dynamically.
-#[cfg_attr(feature="runtime", allow(dead_code))]
-fn link_dynamic() {
-    let file = find_shared_library().unwrap();
-    let directory = file.parent().unwrap();
-    println!("cargo:rustc-link-search={}", directory.display());
-
-    if cfg!(all(target_os="windows", target_env="msvc")) {
-        // Find the `libclang` stub static library required for the MSVC toolchain.
-        let libdir = if !directory.ends_with("bin") {
-            directory.to_owned()
-        } else {
-            directory.parent().unwrap().join("lib")
-        };
-        if libdir.join("libclang.lib").exists() {
-            println!("cargo:rustc-link-search={}", libdir.display());
-        } else if libdir.join("libclang.dll.a").exists() {
-            // MSYS and MinGW use `libclang.dll.a` instead of `libclang.lib`. It is linkable with
-            // the MSVC linker, but Rust doesn't recognize the `.a` suffix, so we need to copy it
-            // with a different name.
-            //
-            // FIXME: Maybe we can just hardlink or symlink it?
-            let out = env::var("OUT_DIR").unwrap();
-            fs::copy(libdir.join("libclang.dll.a"), Path::new(&out).join("libclang.lib")).unwrap();
-            println!("cargo:rustc-link-search=native={}", out);
-        } else {
-            panic!(
-                "using '{}', so 'libclang.lib' or 'libclang.dll.a' must be available in {}",
-                file.display(),
-                libdir.display(),
-            );
-        }
-        println!("cargo:rustc-link-lib=dylib=libclang");
-    } else {
-        println!("cargo:rustc-link-lib=dylib=clang");
-    }
-}
-
-#[cfg_attr(feature="runtime", allow(dead_code))]
-fn main() {
-    if cfg!(feature="runtime") {
-        if cfg!(feature="static") {
-            panic!("`runtime` and `static` features can't be combined");
-        }
-    } else if cfg!(feature="static") {
-        link_static();
-    } else {
-        link_dynamic();
-    }
-
-    if let Ok(output) = run_llvm_config(&["--includedir"]) {
-        let directory = Path::new(output.trim_right());
-        println!("cargo:include={}", directory.display());
-    }
-}
+// Copyright 2016 Kyle Mayes
+//
+// 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.
+
+//! Finds `libclang` static or dynamic libraries and links to them.
+//!
+//! # Environment Variables
+//!
+//! This build script can make use of several environment variables to help it find the required
+//! static or dynamic libraries.
+//!
+//! * `LLVM_CONFIG_PATH` - provides a path to an `llvm-config` executable
+//! * `LIBCLANG_PATH` - provides a path to a directory containing a `libclang` shared library
+//! * `LIBCLANG_STATIC_PATH` - provides a path to a directory containing LLVM and Clang static libraries
+
+#![allow(unused_attributes)]
+
+extern crate glob;
+
+use std::path::{Path};
+
+#[path="build/common.rs"]
+pub mod common;
+#[path="build/dynamic.rs"]
+pub mod dynamic;
+#[path="build/static.rs"]
+pub mod static_;
+
+/// Copy the file from the supplied source to the supplied destination.
+#[cfg(feature="runtime")]
+fn copy(source: &str, destination: &Path) {
+    use std::fs::{File};
+    use std::io::{Read, Write};
+
+    let mut string = String::new();
+    File::open(source).unwrap().read_to_string(&mut string).unwrap();
+    File::create(destination).unwrap().write_all(string.as_bytes()).unwrap();
+}
+
+/// Generates the finding and linking code so that it may be used at runtime.
+#[cfg(feature="runtime")]
+fn main() {
+    use std::env;
+
+    if cfg!(feature="static") {
+        panic!("`runtime` and `static` features can't be combined");
+    }
+
+    let out = env::var("OUT_DIR").unwrap();
+    copy("build/common.rs", &Path::new(&out).join("common.rs"));
+    copy("build/dynamic.rs", &Path::new(&out).join("dynamic.rs"));
+}
+
+/// Finds and links to the required libraries.
+#[cfg(not(feature="runtime"))]
+fn main() {
+    if cfg!(feature="static") {
+        static_::link();
+    } else {
+        dynamic::link();
+    }
+
+    if let Ok(output) = common::run_llvm_config(&["--includedir"]) {
+        let directory = Path::new(output.trim_right());
+        println!("cargo:include={}", directory.display());
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/clang-sys/build/common.rs
@@ -0,0 +1,165 @@
+// Copyright 2018 Kyle Mayes
+//
+// 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.
+
+extern crate glob;
+
+use std::env;
+use std::path::{Path, PathBuf};
+use std::process::{Command};
+
+use glob::{MatchOptions};
+
+/// `libclang` directory patterns for FreeBSD and Linux.
+const DIRECTORIES_LINUX: &[&str] = &[
+    "/usr/lib*",
+    "/usr/lib*/*",
+    "/usr/lib*/*/*",
+    "/usr/local/lib*",
+    "/usr/local/lib*/*",
+    "/usr/local/lib*/*/*",
+    "/usr/local/llvm*/lib",
+];
+
+/// `libclang` directory patterns for OS X.
+const DIRECTORIES_OSX: &[&str] = &[
+    "/usr/local/opt/llvm*/lib",
+    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib",
+    "/Library/Developer/CommandLineTools/usr/lib",
+    "/usr/local/opt/llvm*/lib/llvm*/lib",
+];
+
+/// `libclang` directory patterns for Windows.
+const DIRECTORIES_WINDOWS: &[&str] = &[
+    "C:\\LLVM\\lib",
+    "C:\\Program Files*\\LLVM\\lib",
+    "C:\\MSYS*\\MinGW*\\lib",
+];
+
+/// Executes the supplied console command, returning the `stdout` output if the command was
+/// successfully executed.
+fn run_command(command: &str, arguments: &[&str]) -> Option<String> {
+    let output = Command::new(command).args(arguments).output().ok()?;
+    Some(String::from_utf8_lossy(&output.stdout).into_owned())
+}
+
+/// Executes `llvm-config`, returning the `stdout` output if the command was successfully executed.
+pub fn run_llvm_config(arguments: &[&str]) -> Result<String, String> {
+    let command = env::var("LLVM_CONFIG_PATH").unwrap_or_else(|_| "llvm-config".into());
+    match run_command(&command, arguments) {
+        Some(output) => Ok(output),
+        None => Err(format!(
+            "couldn't execute `llvm-config {}`, set the LLVM_CONFIG_PATH environment variable to a \
+            path to a valid `llvm-config` executable",
+            arguments.join(" "),
+        )),
+    }
+}
+
+/// Returns the paths to and the filenames of the files matching the supplied filename patterns in
+/// the supplied directory.
+fn search_directory(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
+    // Join the directory to the filename patterns to obtain the path patterns.
+    let paths = filenames.iter().filter_map(|f| directory.join(f).to_str().map(ToOwned::to_owned));
+
+    // Prevent wildcards from matching path separators.
+    let mut options = MatchOptions::new();
+    options.require_literal_separator = true;
+
+    paths.flat_map(|p| {
+        if let Ok(paths) = glob::glob_with(&p, &options) {
+            paths.filter_map(Result::ok).collect()
+        } else {
+            vec![]
+        }
+    }).filter_map(|p| {
+        let filename = p.file_name().and_then(|f| f.to_str())?;
+        Some((directory.to_owned(), filename.into()))
+    }).collect::<Vec<_>>()
+}
+
+/// Returns the paths to and the filenames of the files matching the supplied filename patterns in
+/// the supplied directory, checking any relevant sibling directories.
+fn search_directories(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
+    let mut results = search_directory(directory, filenames);
+
+    // On Windows, `libclang.dll` is usually found in the LLVM `bin` directory while
+    // `libclang.lib` is usually found in the LLVM `lib` directory. To keep things
+    // consistent with other platforms, only LLVM `lib` directories are included in the
+    // backup search directory globs so we need to search the LLVM `bin` directory here.
+    if cfg!(target_os="windows") && directory.ends_with("lib") {
+        let sibling = directory.parent().unwrap().join("bin");
+        results.extend(search_directory(&sibling, filenames).into_iter());
+    }
+
+    results
+}
+
+/// Returns the paths to and the filenames of the `libclang` static or dynamic libraries matching
+/// the supplied filename patterns.
+pub fn search_libclang_directories(files: &[String], variable: &str) -> Vec<(PathBuf, String)> {
+    // Search the directory provided by the relevant environment variable.
+    if let Ok(directory) = env::var(variable).map(|d| Path::new(&d).to_path_buf()) {
+        return search_directories(&directory, files);
+    }
+
+    let mut found = vec![];
+
+    // Search the toolchain directory in the directory provided by `xcode-select --print-path`.
+    if cfg!(target_os="macos") {
+        if let Some(output) = run_command("xcode-select", &["--print-path"]) {
+            let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
+            let directory = directory.join("Toolchains/XcodeDefault.xctoolchain/usr/lib");
+            found.extend(search_directories(&directory, files));
+        }
+    }
+
+    // Search the `bin` and `lib` directories in directory provided by `llvm-config --prefix`.
+    if let Ok(output) = run_llvm_config(&["--prefix"]) {
+        let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
+        found.extend(search_directories(&directory.join("bin"), files));
+        found.extend(search_directories(&directory.join("lib"), files));
+    }
+
+    // Search the directories provided by the `LD_LIBRARY_PATH` environment variable.
+    if let Ok(path) = env::var("LD_LIBRARY_PATH") {
+        for directory in path.split(':').map(Path::new) {
+            found.extend(search_directories(&directory, files));
+        }
+    }
+
+    // Determine the `libclang` directory patterns.
+    let directories = if cfg!(any(target_os="freebsd", target_os="linux")) {
+        DIRECTORIES_LINUX
+    } else if cfg!(target_os="macos") {
+        DIRECTORIES_OSX
+    } else if cfg!(target_os="windows") {
+        DIRECTORIES_WINDOWS
+    } else {
+        &[]
+    };
+
+    // Search the directories provided by the `libclang` directory patterns.
+    let mut options = MatchOptions::new();
+    options.case_sensitive = false;
+    options.require_literal_separator = true;
+    for directory in directories.iter().rev() {
+        if let Ok(directories) = glob::glob_with(directory, &options) {
+            for directory in directories.filter_map(Result::ok).filter(|p| p.is_dir()) {
+                found.extend(search_directories(&directory, files));
+            }
+        }
+    }
+
+    found
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/clang-sys/build/dynamic.rs
@@ -0,0 +1,213 @@
+// Copyright 2018 Kyle Mayes
+//
+// 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.
+
+use std::env;
+use std::fs::{File};
+use std::io::{Read, Seek, SeekFrom};
+use std::path::{Path, PathBuf};
+
+use super::common;
+
+/// Returns the ELF class from the ELF header in the supplied file.
+fn parse_elf_header(path: &Path) -> Result<u8, String> {
+    let mut file = File::open(path).map_err(|e| e.to_string())?;
+    let mut elf = [0; 5];
+    file.read_exact(&mut elf).map_err(|e| e.to_string())?;
+    if elf[..4] == [127, 69, 76, 70] {
+        Ok(elf[4])
+    } else {
+        Err("invalid ELF header".into())
+    }
+}
+
+/// Returns the magic number from the PE header in the supplied file.
+fn parse_pe_header(path: &Path) -> Result<u16, String> {
+    let mut file = File::open(path).map_err(|e| e.to_string())?;
+    let mut pe = [0; 4];
+
+    // Determine the header offset.
+    file.seek(SeekFrom::Start(0x3C)).map_err(|e| e.to_string())?;
+    file.read_exact(&mut pe).map_err(|e| e.to_string())?;
+    let offset =
+        i32::from(pe[0]) +
+        (i32::from(pe[1]) << 8) +
+        (i32::from(pe[2]) << 16) +
+        (i32::from(pe[3]) << 24);
+
+    // Determine the validity of the header.
+    file.seek(SeekFrom::Start(offset as u64)).map_err(|e| e.to_string())?;
+    file.read_exact(&mut pe).map_err(|e| e.to_string())?;
+    if pe != [80, 69, 0, 0] {
+        return Err("invalid PE header".into());
+    }
+
+    // Find the magic number.
+    file.seek(SeekFrom::Current(20)).map_err(|e| e.to_string())?;
+    file.read_exact(&mut pe).map_err(|e| e.to_string())?;
+    Ok(u16::from(pe[0]) + (u16::from(pe[1]) << 8))
+}
+
+/// Validates the header for the supplied `libclang` shared library.
+fn validate_header(path: &Path) -> Result<(), String> {
+    if cfg!(any(target_os="freebsd", target_os="linux")) {
+        let class = parse_elf_header(path)?;
+        if cfg!(target_pointer_width="32") && class != 1 {
+            return Err("invalid ELF class (64-bit)".into());
+        }
+        if cfg!(target_pointer_width="64") && class != 2 {
+            return Err("invalid ELF class (32-bit)".into());
+        }
+        Ok(())
+    } else if cfg!(target_os="windows") {
+        let magic = parse_pe_header(path)?;
+        if cfg!(target_pointer_width="32") && magic != 267 {
+            return Err("invalid DLL (64-bit)".into());
+        }
+        if cfg!(target_pointer_width="64") && magic != 523 {
+            return Err("invalid DLL (32-bit)".into());
+        }
+        Ok(())
+    } else {
+        Ok(())
+    }
+}
+
+/// Returns the components of the version in the supplied `libclang` shared library filename.
+fn parse_version(filename: &str) -> Vec<u32> {
+    let version = if filename.starts_with("libclang.so.") {
+        &filename[12..]
+    } else if filename.starts_with("libclang-") {
+        &filename[9..filename.len() - 3]
+    } else {
+        return vec![];
+    };
+
+    version.split('.').map(|s| s.parse().unwrap_or(0)).collect()
+}
+
+/// Returns the paths to, the filenames, and the versions of the `libclang` shared libraries.
+fn search_libclang_directories(runtime: bool) -> Result<Vec<(PathBuf, String, Vec<u32>)>, String> {
+    let mut files = vec![format!("{}clang{}", env::consts::DLL_PREFIX, env::consts::DLL_SUFFIX)];
+
+    if cfg!(target_os="linux") {
+        // Some Linux distributions don't create a `libclang.so` symlink, so we need to
+        // look for versioned files (e.g., `libclang-3.9.so`).
+        files.push("libclang-*.so".into());
+
+        // Some Linux distributions don't create a `libclang.so` symlink and don't have
+        // versioned files as described above, so we need to look for suffix versioned
+        // files (e.g., `libclang.so.1`). However, `ld` cannot link to these files, so
+        // this will only be included when linking at runtime.
+        if runtime {
+            files.push("libclang.so.*".into());
+        }
+    }
+
+    if cfg!(any(target_os="openbsd", target_os="freebsd", target_os="netbsd")) {
+        // Some BSD distributions don't create a `libclang.so` symlink either, but use
+        // a different naming scheme for versioned files (e.g., `libclang.so.7.0`).
+        files.push("libclang.so.*".into());
+    }
+
+    if cfg!(target_os="windows") {
+        // The official LLVM build uses `libclang.dll` on Windows instead of `clang.dll`. However,
+        // unofficial builds such as MinGW use `clang.dll`.
+        files.push("libclang.dll".into());
+    }
+
+    // Validate the `libclang` shared libraries and collect the versions.
+    let mut valid = vec![];
+    let mut invalid = vec![];
+    for (directory, filename) in common::search_libclang_directories(&files, "LIBCLANG_PATH") {
+        let path = directory.join(&filename);
+        match validate_header(&path) {
+            Ok(()) => {
+                let version = parse_version(&filename);
+                valid.push((directory, filename, version))
+            },
+            Err(message) => invalid.push(format!("({}: {})", path.display(), message)),
+        }
+    }
+
+    if !valid.is_empty() {
+        return Ok(valid);
+    }
+
+    let message = format!(
+        "couldn't find any valid shared libraries matching: [{}], set the `LIBCLANG_PATH` \
+        environment variable to a path where one of these files can be found (invalid: [{}])",
+        files.iter().map(|f| format!("'{}'", f)).collect::<Vec<_>>().join(", "),
+        invalid.join(", "),
+    );
+
+    Err(message)
+}
+
+/// Returns the directory and filename of the "best" available `libclang` shared library.
+pub fn find(runtime: bool) -> Result<(PathBuf, String), String> {
+    search_libclang_directories(runtime)?.iter()
+        .max_by_key(|f| &f.2)
+        .cloned()
+        .map(|(path, filename, _)| (path, filename))
+        .ok_or_else(|| "unreachable".into())
+}
+
+/// Find and link to `libclang` dynamically.
+#[cfg(not(feature="runtime"))]
+pub fn link() {
+    use std::fs;
+
+    let (directory, filename) = find(false).unwrap();
+    println!("cargo:rustc-link-search={}", directory.display());
+
+    if cfg!(all(target_os="windows", target_env="msvc")) {
+        // Find the `libclang` stub static library required for the MSVC toolchain.
+        let lib = if !directory.ends_with("bin") {
+            directory.to_owned()
+        } else {
+            directory.parent().unwrap().join("lib")
+        };
+
+        if lib.join("libclang.lib").exists() {
+            println!("cargo:rustc-link-search={}", lib.display());
+        } else if lib.join("libclang.dll.a").exists() {
+            // MSYS and MinGW use `libclang.dll.a` instead of `libclang.lib`. It is linkable with
+            // the MSVC linker, but Rust doesn't recognize the `.a` suffix, so we need to copy it
+            // with a different name.
+            //
+            // FIXME: Maybe we can just hardlink or symlink it?
+            let out = env::var("OUT_DIR").unwrap();
+            fs::copy(lib.join("libclang.dll.a"), Path::new(&out).join("libclang.lib")).unwrap();
+            println!("cargo:rustc-link-search=native={}", out);
+        } else {
+            panic!(
+                "using '{}', so 'libclang.lib' or 'libclang.dll.a' must be available in {}",
+                filename,
+                lib.display(),
+            );
+        }
+
+        println!("cargo:rustc-link-lib=dylib=libclang");
+    } else {
+        let name = filename.replace("lib", "");
+
+        // Strip trailing version numbers (e.g., the `.7.0` in `libclang.so.7.0`).
+        let name = match name.find(".so") {
+            None => &name,
+            Some(index) => &name[0..index],
+        };
+
+        println!("cargo:rustc-link-lib=dylib={}", name);
+    }
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/clang-sys/build/static.rs
@@ -0,0 +1,113 @@
+// Copyright 2018 Kyle Mayes
+//
+// 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.
+
+extern crate glob;
+
+use std::path::{Path, PathBuf};
+
+use common;
+
+/// Returns the name of an LLVM or Clang library from a path to such a library.
+fn get_library_name(path: &Path) -> Option<String> {
+    path.file_stem().map(|p| {
+        let string = p.to_string_lossy();
+        if string.starts_with("lib") {
+            string[3..].to_owned()
+        } else {
+            string.to_string()
+        }
+    })
+}
+
+/// Returns the LLVM libraries required to link to `libclang` statically.
+fn get_llvm_libraries() -> Vec<String> {
+    common::run_llvm_config(&["--libs"]).unwrap().split_whitespace().filter_map(|p| {
+        // Depending on the version of `llvm-config` in use, listed libraries may be in one of two
+        // forms, a full path to the library or simply prefixed with `-l`.
+        if p.starts_with("-l") {
+            Some(p[2..].into())
+        } else {
+            get_library_name(Path::new(p))
+        }
+    }).collect()
+}
+
+/// Clang libraries required to link to `libclang` 3.5 and later statically.
+const CLANG_LIBRARIES: &[&str] = &[
+    "clang",
+    "clangAST",
+    "clangAnalysis",
+    "clangBasic",
+    "clangDriver",
+    "clangEdit",
+    "clangFrontend",
+    "clangIndex",
+    "clangLex",
+    "clangParse",
+    "clangRewrite",
+    "clangSema",
+    "clangSerialization",
+];
+
+/// Returns the Clang libraries required to link to `libclang` statically.
+fn get_clang_libraries<P: AsRef<Path>>(directory: P) -> Vec<String> {
+    let pattern = directory.as_ref().join("libclang*.a").to_string_lossy().to_string();
+    if let Ok(libraries) = glob::glob(&pattern) {
+        libraries.filter_map(|l| l.ok().and_then(|l| get_library_name(&l))).collect()
+    } else {
+        CLANG_LIBRARIES.iter().map(|l| l.to_string()).collect()
+    }
+}
+
+/// Returns a directory containing `libclang` static libraries.
+fn find() -> PathBuf {
+    let name = if cfg!(target_os="windows") { "libclang.lib" } else { "libclang.a" };
+    let files = common::search_libclang_directories(&[name.into()], "LIBCLANG_STATIC_PATH");
+    if let Some((directory, _)) = files.into_iter().nth(0) {
+        directory
+    } else {
+        panic!("could not find any static libraries");
+    }
+}
+
+/// Find and link to `libclang` statically.
+pub fn link() {
+    let directory = find();
+
+    // Specify required Clang static libraries.
+    println!("cargo:rustc-link-search=native={}", directory.display());
+    for library in get_clang_libraries(directory) {
+        println!("cargo:rustc-link-lib=static={}", library);
+    }
+
+    // Determine the shared mode used by LLVM.
+    let mode = common::run_llvm_config(&["--shared-mode"]).map(|m| m.trim().to_owned());
+    let prefix = if mode.ok().map_or(false, |m| m == "static") { "static=" } else { "" };
+
+    // Specify required LLVM static libraries.
+    println!("cargo:rustc-link-search=native={}", common::run_llvm_config(&["--libdir"]).unwrap().trim_right());
+    for library in get_llvm_libraries() {
+        println!("cargo:rustc-link-lib={}{}", prefix, library);
+    }
+
+    // Specify required system libraries.
+    // MSVC doesn't need this, as it tracks dependencies inside `.lib` files.
+    if cfg!(target_os="freebsd") {
+        println!("cargo:rustc-flags=-l ffi -l ncursesw -l c++ -l z");
+    } else if cfg!(target_os="linux") {
+        println!("cargo:rustc-flags=-l ffi -l ncursesw -l stdc++ -l z");
+    } else if cfg!(target_os="macos") {
+        println!("cargo:rustc-flags=-l ffi -l ncurses -l c++ -l z");
+    }
+}
old mode 100755
new mode 100644
--- a/third_party/rust/clang-sys/ci/before_install.sh
+++ b/third_party/rust/clang-sys/ci/before_install.sh
@@ -1,61 +1,61 @@
-set -e
-pushd ~
-
-# Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307)
-if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
-    rvm get head || true
-fi
-
-function llvm_linux_target_triple() {
-    if [ "$1" == "5.0" ]; then
-        echo "linux-x86_64-ubuntu14.04"
-    else
-        echo "x86_64-linux-gnu-ubuntu-14.04"
-    fi
-}
-
-function llvm_version_triple() {
-    if [ "$1" == "3.5" ]; then
-        echo "3.5.2"
-    elif [ "$1" == "3.6" ]; then
-        echo "3.6.2"
-    elif [ "$1" == "3.7" ]; then
-        echo "3.7.1"
-    elif [ "$1" == "3.8" ]; then
-        echo "3.8.1"
-    elif [ "$1" == "3.9" ]; then
-        echo "3.9.0"
-    elif [ "$1" == "4.0" ]; then
-        echo "4.0.1"
-    elif [ "$1" == "5.0" ]; then
-        echo "5.0.0"
-    fi
-}
-
-function llvm_download() {
-    export LLVM_VERSION_TRIPLE=`llvm_version_triple ${LLVM_VERSION}`
-    export LLVM=clang+llvm-${LLVM_VERSION_TRIPLE}-$1
-    export LLVM_DIRECTORY="$HOME/.llvm/${LLVM}"
-
-    if [ -d "${LLVM_DIRECTORY}" ]; then
-        echo "Using cached LLVM download for ${LLVM}..."
-    else
-        wget http://releases.llvm.org/${LLVM_VERSION_TRIPLE}/${LLVM}.tar.xz
-        mkdir -p "${LLVM_DIRECTORY}"
-        tar xf ${LLVM}.tar.xz -C "${LLVM_DIRECTORY}" --strip-components=1
-    fi
-
-    export LLVM_CONFIG_PATH="${LLVM_DIRECTORY}/bin/llvm-config"
-}
-
-if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
-    llvm_download `llvm_linux_target_triple ${LLVM_VERSION}`
-    export LD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$LD_LIBRARY_PATH
-else
-    llvm_download x86_64-apple-darwin
-    cp "${LLVM_DIRECTORY}/lib/libclang.dylib" /usr/local/lib/libclang.dylib
-    export DYLD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$DYLD_LIBRARY_PATH
-fi
-
-popd
-set +e
+set -e
+pushd ~
+
+# Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307)
+if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
+    rvm get head || true
+fi
+
+function llvm_linux_target_triple() {
+    if [ "$1" == "5.0" ]; then
+        echo "linux-x86_64-ubuntu14.04"
+    else
+        echo "x86_64-linux-gnu-ubuntu-14.04"
+    fi
+}
+
+function llvm_version_triple() {
+    if [ "$1" == "3.5" ]; then
+        echo "3.5.2"
+    elif [ "$1" == "3.6" ]; then
+        echo "3.6.2"
+    elif [ "$1" == "3.7" ]; then
+        echo "3.7.1"
+    elif [ "$1" == "3.8" ]; then
+        echo "3.8.1"
+    elif [ "$1" == "3.9" ]; then
+        echo "3.9.0"
+    elif [ "$1" == "4.0" ]; then
+        echo "4.0.1"
+    elif [ "$1" == "5.0" ]; then
+        echo "5.0.0"
+    fi
+}
+
+function llvm_download() {
+    export LLVM_VERSION_TRIPLE=`llvm_version_triple ${LLVM_VERSION}`
+    export LLVM=clang+llvm-${LLVM_VERSION_TRIPLE}-$1
+    export LLVM_DIRECTORY="$HOME/.llvm/${LLVM}"
+
+    if [ -d "${LLVM_DIRECTORY}" ]; then
+        echo "Using cached LLVM download for ${LLVM}..."
+    else
+        wget http://releases.llvm.org/${LLVM_VERSION_TRIPLE}/${LLVM}.tar.xz
+        mkdir -p "${LLVM_DIRECTORY}"
+        tar xf ${LLVM}.tar.xz -C "${LLVM_DIRECTORY}" --strip-components=1
+    fi
+
+    export LLVM_CONFIG_PATH="${LLVM_DIRECTORY}/bin/llvm-config"
+}
+
+if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
+    llvm_download `llvm_linux_target_triple ${LLVM_VERSION}`
+    export LD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$LD_LIBRARY_PATH
+else
+    llvm_download x86_64-apple-darwin
+    cp "${LLVM_DIRECTORY}/lib/libclang.dylib" /usr/local/lib/libclang.dylib
+    export DYLD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$DYLD_LIBRARY_PATH
+fi
+
+popd
+set +e
--- a/third_party/rust/clang-sys/ci/install.bat
+++ b/third_party/rust/clang-sys/ci/install.bat
@@ -1,8 +1,8 @@
-curl -sSf https://static.rust-lang.org/dist/rust-1.24.0-i686-pc-windows-msvc.exe -o rust.exe
-rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
-set PATH=%PATH%;C:\Rust\bin
-
-curl -sSf http://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
-7z x LLVM.exe -oC:\LLVM
-set PATH=%PATH%;C:\LLVM\bin
-set LIBCLANG_PATH=C:\LLVM\bin
+curl -sSf https://static.rust-lang.org/dist/rust-1.24.0-i686-pc-windows-msvc.exe -o rust.exe
+rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
+set PATH=%PATH%;C:\Rust\bin
+
+curl -sSf http://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
+7z x LLVM.exe -oC:\LLVM
+set PATH=%PATH%;C:\LLVM\bin
+set LIBCLANG_PATH=C:\LLVM\bin
old mode 100755
new mode 100644
--- a/third_party/rust/clang-sys/ci/script.sh
+++ b/third_party/rust/clang-sys/ci/script.sh
@@ -1,13 +1,13 @@
-if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
-    rvm get head || true
-fi
-
-set -e
-
-RUST_BACKTRACE=1 cargo test --verbose --features $CLANG_VERSION -- --nocapture
-
-if [ "${CLANG_VERSION}" \< "clang_3_7" ]; then
-    RUST_BACKTRACE=1 cargo test --verbose --features "$CLANG_VERSION static" -- --nocapture
-fi
-
-RUST_BACKTRACE=1 cargo test --verbose --features "$CLANG_VERSION runtime" -- --nocapture
+if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
+    rvm get head || true
+fi
+
+set -e
+
+RUST_BACKTRACE=1 cargo test --verbose --features $CLANG_VERSION -- --nocapture
+
+if [ "${CLANG_VERSION}" \< "clang_3_7" ]; then
+    RUST_BACKTRACE=1 cargo test --verbose --features "$CLANG_VERSION static" -- --nocapture
+fi
+
+RUST_BACKTRACE=1 cargo test --verbose --features "$CLANG_VERSION runtime" -- --nocapture
--- a/third_party/rust/clang-sys/ci/test_script.bat
+++ b/third_party/rust/clang-sys/ci/test_script.bat
@@ -1,2 +1,2 @@
-set RUST_BACKTRACE=1
-cargo test --verbose --features %CLANG_VERSION% -- --nocapture
+set RUST_BACKTRACE=1
+cargo test --verbose --features %CLANG_VERSION% -- --nocapture
--- a/third_party/rust/clang-sys/clippy.toml
+++ b/third_party/rust/clang-sys/clippy.toml
@@ -1,1 +1,1 @@
-doc-valid-idents = ["FreeBSD"]
+doc-valid-idents = ["FreeBSD"]
--- a/third_party/rust/clang-sys/src/lib.rs
+++ b/third_party/rust/clang-sys/src/lib.rs
@@ -1,1875 +1,1964 @@
-// Copyright 2016 Kyle Mayes
-//
-// 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.
-
-//! Rust bindings for `libclang`.
-//!
-//! ## Supported Versions
-//!
-//! * 3.5 - [Documentation](https://kylemayes.github.io/clang-sys/3_5/clang_sys)
-//! * 3.6 - [Documentation](https://kylemayes.github.io/clang-sys/3_6/clang_sys)
-//! * 3.7 - [Documentation](https://kylemayes.github.io/clang-sys/3_7/clang_sys)
-//! * 3.8 - [Documentation](https://kylemayes.github.io/clang-sys/3_8/clang_sys)
-//! * 3.9 - [Documentation](https://kylemayes.github.io/clang-sys/3_9/clang_sys)
-//! * 4.0 - [Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys)
-//! * 5.0 - [Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys)
-//! * 6.0 - [Documentation](https://kylemayes.github.io/clang-sys/6_0/clang_sys)
-
-#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
-
-#![cfg_attr(feature="cargo-clippy", allow(unreadable_literal))]
-
-extern crate glob;
-extern crate libc;
-#[cfg(feature="runtime")]
-extern crate libloading;
-
-pub mod support;
-
-#[macro_use]
-mod link;
-
-use std::mem;
-
-use libc::{c_char, c_int, c_longlong, c_uint, c_ulong, c_ulonglong, c_void, time_t};
-#[cfg(feature="gte_clang_6_0")]
-use libc::{size_t};
-
-pub type CXClientData = *mut c_void;
-pub type CXCursorVisitor = extern fn(CXCursor, CXCursor, CXClientData) -> CXChildVisitResult;
-#[cfg(feature="gte_clang_3_7")]
-pub type CXFieldVisitor = extern fn(CXCursor, CXClientData) -> CXVisitorResult;
-pub type CXInclusionVisitor = extern fn(CXFile, *mut CXSourceLocation, c_uint, CXClientData);
-
-//================================================
-// Macros
-//================================================
-
-// cenum! ________________________________________
-
-/// Defines a C enum as a series of constants.
-macro_rules! cenum {
-    ($(#[$meta:meta])* enum $name:ident {
-        $($(#[$vmeta:meta])* const $variant:ident = $value:expr), +,
-    }) => (
-        pub type $name = c_int;
-
-        $($(#[$vmeta])* pub const $variant: $name = $value;)+
-    );
-    ($(#[$meta:meta])* enum $name:ident {
-        $($(#[$vmeta:meta])* const $variant:ident = $value:expr); +;
-    }) => (
-        pub type $name = c_int;
-
-        $($(#[$vmeta])* pub const $variant: $name = $value;)+
-    );
-}
-
-// default! ______________________________________
-
-/// Implements a zeroing implementation of `Default` for the supplied type.
-macro_rules! default {
-    (#[$meta:meta] $ty:ty) => {
-        #[$meta]
-        impl Default for $ty {
-            fn default() -> $ty {
-                unsafe { mem::zeroed() }
-            }
-        }
-    };
-
-    ($ty:ty) => {
-        impl Default for $ty {
-            fn default() -> $ty {
-                unsafe { mem::zeroed() }
-            }
-        }
-    };
-}
-
-//================================================
-// Enums
-//================================================
-
-cenum! {
-    enum CXAvailabilityKind {
-        const CXAvailability_Available = 0,
-        const CXAvailability_Deprecated = 1,
-        const CXAvailability_NotAvailable = 2,
-        const CXAvailability_NotAccessible = 3,
-    }
-}
-
-cenum! {
-    enum CXCallingConv {
-        const CXCallingConv_Default = 0,
-        const CXCallingConv_C = 1,
-        const CXCallingConv_X86StdCall = 2,
-        const CXCallingConv_X86FastCall = 3,
-        const CXCallingConv_X86ThisCall = 4,
-        const CXCallingConv_X86Pascal = 5,
-        const CXCallingConv_AAPCS = 6,
-        const CXCallingConv_AAPCS_VFP = 7,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCallingConv_X86RegCall = 8,
-        const CXCallingConv_IntelOclBicc = 9,
-        const CXCallingConv_Win64 = 10,
-        const CXCallingConv_X86_64Win64 = 10,
-        const CXCallingConv_X86_64SysV = 11,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCallingConv_X86VectorCall = 12,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCallingConv_Swift = 13,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCallingConv_PreserveMost = 14,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCallingConv_PreserveAll = 15,
-        const CXCallingConv_Invalid = 100,
-        const CXCallingConv_Unexposed = 200,
-    }
-}
-
-cenum! {
-    enum CXChildVisitResult {
-        const CXChildVisit_Break = 0,
-        const CXChildVisit_Continue = 1,
-        const CXChildVisit_Recurse = 2,
-    }
-}
-
-cenum! {
-    enum CXCommentInlineCommandRenderKind {
-        const CXCommentInlineCommandRenderKind_Normal = 0,
-        const CXCommentInlineCommandRenderKind_Bold = 1,
-        const CXCommentInlineCommandRenderKind_Monospaced = 2,
-        const CXCommentInlineCommandRenderKind_Emphasized = 3,
-    }
-}
-
-cenum! {
-    enum CXCommentKind {
-        const CXComment_Null = 0,
-        const CXComment_Text = 1,
-        const CXComment_InlineCommand = 2,
-        const CXComment_HTMLStartTag = 3,
-        const CXComment_HTMLEndTag = 4,
-        const CXComment_Paragraph = 5,
-        const CXComment_BlockCommand = 6,
-        const CXComment_ParamCommand = 7,
-        const CXComment_TParamCommand = 8,
-        const CXComment_VerbatimBlockCommand = 9,
-        const CXComment_VerbatimBlockLine = 10,
-        const CXComment_VerbatimLine = 11,
-        const CXComment_FullComment = 12,
-    }
-}
-
-cenum! {
-    enum CXCommentParamPassDirection {
-        const CXCommentParamPassDirection_In = 0,
-        const CXCommentParamPassDirection_Out = 1,
-        const CXCommentParamPassDirection_InOut = 2,
-    }
-}
-
-cenum! {
-    enum CXCompilationDatabase_Error {
-        const CXCompilationDatabase_NoError = 0,
-        const CXCompilationDatabase_CanNotLoadDatabase = 1,
-    }
-}
-
-cenum! {
-    enum CXCompletionChunkKind {
-        const CXCompletionChunk_Optional = 0,
-        const CXCompletionChunk_TypedText = 1,
-        const CXCompletionChunk_Text = 2,
-        const CXCompletionChunk_Placeholder = 3,
-        const CXCompletionChunk_Informative = 4,
-        const CXCompletionChunk_CurrentParameter = 5,
-        const CXCompletionChunk_LeftParen = 6,
-        const CXCompletionChunk_RightParen = 7,
-        const CXCompletionChunk_LeftBracket = 8,
-        const CXCompletionChunk_RightBracket = 9,
-        const CXCompletionChunk_LeftBrace = 10,
-        const CXCompletionChunk_RightBrace = 11,
-        const CXCompletionChunk_LeftAngle = 12,
-        const CXCompletionChunk_RightAngle = 13,
-        const CXCompletionChunk_Comma = 14,
-        const CXCompletionChunk_ResultType = 15,
-        const CXCompletionChunk_Colon = 16,
-        const CXCompletionChunk_SemiColon = 17,
-        const CXCompletionChunk_Equal = 18,
-        const CXCompletionChunk_HorizontalSpace = 19,
-        const CXCompletionChunk_VerticalSpace = 20,
-    }
-}
-
-cenum! {
-    enum CXCursorKind {
-        const CXCursor_UnexposedDecl = 1,
-        const CXCursor_StructDecl = 2,
-        const CXCursor_UnionDecl = 3,
-        const CXCursor_ClassDecl = 4,
-        const CXCursor_EnumDecl = 5,
-        const CXCursor_FieldDecl = 6,
-        const CXCursor_EnumConstantDecl = 7,
-        const CXCursor_FunctionDecl = 8,
-        const CXCursor_VarDecl = 9,
-        const CXCursor_ParmDecl = 10,
-        const CXCursor_ObjCInterfaceDecl = 11,
-        const CXCursor_ObjCCategoryDecl = 12,
-        const CXCursor_ObjCProtocolDecl = 13,
-        const CXCursor_ObjCPropertyDecl = 14,
-        const CXCursor_ObjCIvarDecl = 15,
-        const CXCursor_ObjCInstanceMethodDecl = 16,
-        const CXCursor_ObjCClassMethodDecl = 17,
-        const CXCursor_ObjCImplementationDecl = 18,
-        const CXCursor_ObjCCategoryImplDecl = 19,
-        const CXCursor_TypedefDecl = 20,
-        const CXCursor_CXXMethod = 21,
-        const CXCursor_Namespace = 22,
-        const CXCursor_LinkageSpec = 23,
-        const CXCursor_Constructor = 24,
-        const CXCursor_Destructor = 25,
-        const CXCursor_ConversionFunction = 26,
-        const CXCursor_TemplateTypeParameter = 27,
-        const CXCursor_NonTypeTemplateParameter = 28,
-        const CXCursor_TemplateTemplateParameter = 29,
-        const CXCursor_FunctionTemplate = 30,
-        const CXCursor_ClassTemplate = 31,
-        const CXCursor_ClassTemplatePartialSpecialization = 32,
-        const CXCursor_NamespaceAlias = 33,
-        const CXCursor_UsingDirective = 34,
-        const CXCursor_UsingDeclaration = 35,
-        const CXCursor_TypeAliasDecl = 36,
-        const CXCursor_ObjCSynthesizeDecl = 37,
-        const CXCursor_ObjCDynamicDecl = 38,
-        const CXCursor_CXXAccessSpecifier = 39,
-        const CXCursor_ObjCSuperClassRef = 40,
-        const CXCursor_ObjCProtocolRef = 41,
-        const CXCursor_ObjCClassRef = 42,
-        const CXCursor_TypeRef = 43,
-        const CXCursor_CXXBaseSpecifier = 44,
-        const CXCursor_TemplateRef = 45,
-        const CXCursor_NamespaceRef = 46,
-        const CXCursor_MemberRef = 47,
-        const CXCursor_LabelRef = 48,
-        const CXCursor_OverloadedDeclRef = 49,
-        const CXCursor_VariableRef = 50,
-        const CXCursor_InvalidFile = 70,
-        const CXCursor_NoDeclFound = 71,
-        const CXCursor_NotImplemented = 72,
-        const CXCursor_InvalidCode = 73,
-        const CXCursor_UnexposedExpr = 100,
-        const CXCursor_DeclRefExpr = 101,
-        const CXCursor_MemberRefExpr = 102,
-        const CXCursor_CallExpr = 103,
-        const CXCursor_ObjCMessageExpr = 104,
-        const CXCursor_BlockExpr = 105,
-        const CXCursor_IntegerLiteral = 106,
-        const CXCursor_FloatingLiteral = 107,
-        const CXCursor_ImaginaryLiteral = 108,
-        const CXCursor_StringLiteral = 109,
-        const CXCursor_CharacterLiteral = 110,
-        const CXCursor_ParenExpr = 111,
-        const CXCursor_UnaryOperator = 112,
-        const CXCursor_ArraySubscriptExpr = 113,
-        const CXCursor_BinaryOperator = 114,
-        const CXCursor_CompoundAssignOperator = 115,
-        const CXCursor_ConditionalOperator = 116,
-        const CXCursor_CStyleCastExpr = 117,
-        const CXCursor_CompoundLiteralExpr = 118,
-        const CXCursor_InitListExpr = 119,
-        const CXCursor_AddrLabelExpr = 120,
-        const CXCursor_StmtExpr = 121,
-        const CXCursor_GenericSelectionExpr = 122,
-        const CXCursor_GNUNullExpr = 123,
-        const CXCursor_CXXStaticCastExpr = 124,
-        const CXCursor_CXXDynamicCastExpr = 125,
-        const CXCursor_CXXReinterpretCastExpr = 126,
-        const CXCursor_CXXConstCastExpr = 127,
-        const CXCursor_CXXFunctionalCastExpr = 128,
-        const CXCursor_CXXTypeidExpr = 129,
-        const CXCursor_CXXBoolLiteralExpr = 130,
-        const CXCursor_CXXNullPtrLiteralExpr = 131,
-        const CXCursor_CXXThisExpr = 132,
-        const CXCursor_CXXThrowExpr = 133,
-        const CXCursor_CXXNewExpr = 134,
-        const CXCursor_CXXDeleteExpr = 135,
-        const CXCursor_UnaryExpr = 136,
-        const CXCursor_ObjCStringLiteral = 137,
-        const CXCursor_ObjCEncodeExpr = 138,
-        const CXCursor_ObjCSelectorExpr = 139,
-        const CXCursor_ObjCProtocolExpr = 140,
-        const CXCursor_ObjCBridgedCastExpr = 141,
-        const CXCursor_PackExpansionExpr = 142,
-        const CXCursor_SizeOfPackExpr = 143,
-        const CXCursor_LambdaExpr = 144,
-        const CXCursor_ObjCBoolLiteralExpr = 145,
-        const CXCursor_ObjCSelfExpr = 146,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_OMPArraySectionExpr = 147,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_ObjCAvailabilityCheckExpr = 148,
-        const CXCursor_UnexposedStmt = 200,
-        const CXCursor_LabelStmt = 201,
-        const CXCursor_CompoundStmt = 202,
-        const CXCursor_CaseStmt = 203,
-        const CXCursor_DefaultStmt = 204,
-        const CXCursor_IfStmt = 205,
-        const CXCursor_SwitchStmt = 206,
-        const CXCursor_WhileStmt = 207,
-        const CXCursor_DoStmt = 208,
-        const CXCursor_ForStmt = 209,
-        const CXCursor_GotoStmt = 210,
-        const CXCursor_IndirectGotoStmt = 211,
-        const CXCursor_ContinueStmt = 212,
-        const CXCursor_BreakStmt = 213,
-        const CXCursor_ReturnStmt = 214,
-        /// Duplicate of `CXCursor_GccAsmStmt`.
-        const CXCursor_AsmStmt = 215,
-        const CXCursor_ObjCAtTryStmt = 216,
-        const CXCursor_ObjCAtCatchStmt = 217,
-        const CXCursor_ObjCAtFinallyStmt = 218,
-        const CXCursor_ObjCAtThrowStmt = 219,
-        const CXCursor_ObjCAtSynchronizedStmt = 220,
-        const CXCursor_ObjCAutoreleasePoolStmt = 221,
-        const CXCursor_ObjCForCollectionStmt = 222,
-        const CXCursor_CXXCatchStmt = 223,
-        const CXCursor_CXXTryStmt = 224,
-        const CXCursor_CXXForRangeStmt = 225,
-        const CXCursor_SEHTryStmt = 226,
-        const CXCursor_SEHExceptStmt = 227,
-        const CXCursor_SEHFinallyStmt = 228,
-        const CXCursor_MSAsmStmt = 229,
-        const CXCursor_NullStmt = 230,
-        const CXCursor_DeclStmt = 231,
-        const CXCursor_OMPParallelDirective = 232,
-        const CXCursor_OMPSimdDirective = 233,
-        const CXCursor_OMPForDirective = 234,
-        const CXCursor_OMPSectionsDirective = 235,
-        const CXCursor_OMPSectionDirective = 236,
-        const CXCursor_OMPSingleDirective = 237,
-        const CXCursor_OMPParallelForDirective = 238,
-        const CXCursor_OMPParallelSectionsDirective = 239,
-        const CXCursor_OMPTaskDirective = 240,
-        const CXCursor_OMPMasterDirective = 241,
-        const CXCursor_OMPCriticalDirective = 242,
-        const CXCursor_OMPTaskyieldDirective = 243,
-        const CXCursor_OMPBarrierDirective = 244,
-        const CXCursor_OMPTaskwaitDirective = 245,
-        const CXCursor_OMPFlushDirective = 246,
-        const CXCursor_SEHLeaveStmt = 247,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPOrderedDirective = 248,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPAtomicDirective = 249,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPForSimdDirective = 250,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPParallelForSimdDirective = 251,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPTargetDirective = 252,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_OMPTeamsDirective = 253,
-        /// Only produced by `libclang` 3.7 and later.
-        const CXCursor_OMPTaskgroupDirective = 254,
-        /// Only produced by `libclang` 3.7 and later.
-        const CXCursor_OMPCancellationPointDirective = 255,
-        /// Only produced by `libclang` 3.7 and later.
-        const CXCursor_OMPCancelDirective = 256,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_OMPTargetDataDirective = 257,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_OMPTaskLoopDirective = 258,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_OMPTaskLoopSimdDirective = 259,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_OMPDistributeDirective = 260,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetEnterDataDirective = 261,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetExitDataDirective = 262,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetParallelDirective = 263,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetParallelForDirective = 264,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetUpdateDirective = 265,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPDistributeParallelForDirective = 266,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPDistributeParallelForSimdDirective = 267,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPDistributeSimdDirective = 268,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_OMPTargetParallelForSimdDirective = 269,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetSimdDirective = 270,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTeamsDistributeDirective = 271,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTeamsDistributeSimdDirective = 272,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTeamsDistributeParallelForDirective = 274,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetTeamsDirective = 275,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetTeamsDistributeDirective = 276,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278,
-        /// Only producer by `libclang` 4.0 and later.
-        const CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
-        const CXCursor_TranslationUnit = 300,
-        const CXCursor_UnexposedAttr = 400,
-        const CXCursor_IBActionAttr = 401,
-        const CXCursor_IBOutletAttr = 402,
-        const CXCursor_IBOutletCollectionAttr = 403,
-        const CXCursor_CXXFinalAttr = 404,
-        const CXCursor_CXXOverrideAttr = 405,
-        const CXCursor_AnnotateAttr = 406,
-        const CXCursor_AsmLabelAttr = 407,
-        const CXCursor_PackedAttr = 408,
-        const CXCursor_PureAttr = 409,
-        const CXCursor_ConstAttr = 410,
-        const CXCursor_NoDuplicateAttr = 411,
-        const CXCursor_CUDAConstantAttr = 412,
-        const CXCursor_CUDADeviceAttr = 413,
-        const CXCursor_CUDAGlobalAttr = 414,
-        const CXCursor_CUDAHostAttr = 415,
-        /// Only produced by `libclang` 3.6 and later.
-        const CXCursor_CUDASharedAttr = 416,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_VisibilityAttr = 417,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_DLLExport = 418,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_DLLImport = 419,
-        const CXCursor_PreprocessingDirective = 500,
-        const CXCursor_MacroDefinition = 501,
-        /// Duplicate of `CXCursor_MacroInstantiation`.
-        const CXCursor_MacroExpansion = 502,
-        const CXCursor_InclusionDirective = 503,
-        const CXCursor_ModuleImportDecl = 600,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXCursor_TypeAliasTemplateDecl = 601,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXCursor_StaticAssert = 602,
-        /// Only produced by `libclang` 4.0 and later.
-        const CXCursor_FriendDecl = 603,
-        /// Only produced by `libclang` 3.7 and later.
-        const CXCursor_OverloadCandidate = 700,
-    }
-}
-
-cenum! {
-    #[cfg(feature="gte_clang_5_0")]
-    enum CXCursor_ExceptionSpecificationKind {
-        const CXCursor_ExceptionSpecificationKind_None = 0,
-        const CXCursor_ExceptionSpecificationKind_DynamicNone = 1,
-        const CXCursor_ExceptionSpecificationKind_Dynamic = 2,
-        const CXCursor_ExceptionSpecificationKind_MSAny = 3,
-        const CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4,
-        const CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5,
-        const CXCursor_ExceptionSpecificationKind_Unevaluated = 6,
-        const CXCursor_ExceptionSpecificationKind_Uninstantiated = 7,
-        const CXCursor_ExceptionSpecificationKind_Unparsed = 8,
-    }
-}
-
-cenum! {
-    enum CXDiagnosticSeverity {
-        const CXDiagnostic_Ignored = 0,
-        const CXDiagnostic_Note = 1,
-        const CXDiagnostic_Warning = 2,
-        const CXDiagnostic_Error = 3,
-        const CXDiagnostic_Fatal = 4,
-    }
-}
-
-cenum! {
-    enum CXErrorCode {
-        const CXError_Success = 0,
-        const CXError_Failure = 1,
-        const CXError_Crashed = 2,
-        const CXError_InvalidArguments = 3,
-        const CXError_ASTReadError = 4,
-    }
-}
-
-cenum! {
-    enum CXEvalResultKind {
-        const CXEval_UnExposed = 0,
-        const CXEval_Int = 1 ,
-        const CXEval_Float = 2,
-        const CXEval_ObjCStrLiteral = 3,
-        const CXEval_StrLiteral = 4,
-        const CXEval_CFStr = 5,
-        const CXEval_Other = 6,
-    }
-}
-
-cenum! {
-    enum CXIdxAttrKind {
-        const CXIdxAttr_Unexposed = 0,
-        const CXIdxAttr_IBAction = 1,
-        const CXIdxAttr_IBOutlet = 2,
-        const CXIdxAttr_IBOutletCollection = 3,
-    }
-}
-
-cenum! {
-    enum CXIdxEntityCXXTemplateKind {
-        const CXIdxEntity_NonTemplate = 0,
-        const CXIdxEntity_Template = 1,
-        const CXIdxEntity_TemplatePartialSpecialization = 2,
-        const CXIdxEntity_TemplateSpecialization = 3,
-    }
-}
-
-cenum! {
-    enum CXIdxEntityKind {
-        const CXIdxEntity_Unexposed = 0,
-        const CXIdxEntity_Typedef = 1,
-        const CXIdxEntity_Function = 2,
-        const CXIdxEntity_Variable = 3,
-        const CXIdxEntity_Field = 4,
-        const CXIdxEntity_EnumConstant = 5,
-        const CXIdxEntity_ObjCClass = 6,
-        const CXIdxEntity_ObjCProtocol = 7,
-        const CXIdxEntity_ObjCCategory = 8,
-        const CXIdxEntity_ObjCInstanceMethod = 9,
-        const CXIdxEntity_ObjCClassMethod = 10,
-        const CXIdxEntity_ObjCProperty = 11,
-        const CXIdxEntity_ObjCIvar = 12,
-        const CXIdxEntity_Enum = 13,
-        const CXIdxEntity_Struct = 14,
-        const CXIdxEntity_Union = 15,
-        const CXIdxEntity_CXXClass = 16,
-        const CXIdxEntity_CXXNamespace = 17,
-        const CXIdxEntity_CXXNamespaceAlias = 18,
-        const CXIdxEntity_CXXStaticVariable = 19,
-        const CXIdxEntity_CXXStaticMethod = 20,
-        const CXIdxEntity_CXXInstanceMethod = 21,
-        const CXIdxEntity_CXXConstructor = 22,
-        const CXIdxEntity_CXXDestructor = 23,
-        const CXIdxEntity_CXXConversionFunction = 24,
-        const CXIdxEntity_CXXTypeAlias = 25,
-        const CXIdxEntity_CXXInterface = 26,
-    }
-}
-
-cenum! {
-    enum CXIdxEntityLanguage {
-        const CXIdxEntityLang_None = 0,
-        const CXIdxEntityLang_C = 1,
-        const CXIdxEntityLang_ObjC = 2,
-        const CXIdxEntityLang_CXX = 3,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXIdxEntityLang_Swift = 4,
-    }
-}
-
-cenum! {
-    enum CXIdxEntityRefKind {
-        const CXIdxEntityRef_Direct = 1,
-        const CXIdxEntityRef_Implicit = 2,
-    }
-}
-
-cenum! {
-    enum CXIdxObjCContainerKind {
-        const CXIdxObjCContainer_ForwardRef = 0,
-        const CXIdxObjCContainer_Interface = 1,
-        const CXIdxObjCContainer_Implementation = 2,
-    }
-}
-
-cenum! {
-    enum CXLanguageKind {
-        const CXLanguage_Invalid = 0,
-        const CXLanguage_C = 1,
-        const CXLanguage_ObjC = 2,
-        const CXLanguage_CPlusPlus = 3,
-    }
-}
-
-cenum! {
-    enum CXLinkageKind {
-        const CXLinkage_Invalid = 0,
-        const CXLinkage_NoLinkage = 1,
-        const CXLinkage_Internal = 2,
-        const CXLinkage_UniqueExternal = 3,
-        const CXLinkage_External = 4,
-    }
-}
-
-cenum! {
-    enum CXLoadDiag_Error {
-        const CXLoadDiag_None = 0,
-        const CXLoadDiag_Unknown = 1,
-        const CXLoadDiag_CannotLoad = 2,
-        const CXLoadDiag_InvalidFile = 3,
-    }
-}
-
-cenum! {
-    enum CXRefQualifierKind {
-        const CXRefQualifier_None = 0,
-        const CXRefQualifier_LValue = 1,
-        const CXRefQualifier_RValue = 2,
-    }
-}
-
-cenum! {
-    enum CXResult {
-        const CXResult_Success = 0,
-        const CXResult_Invalid = 1,
-        const CXResult_VisitBreak = 2,
-    }
-}
-
-cenum! {
-    enum CXSaveError {
-        const CXSaveError_None = 0,
-        const CXSaveError_Unknown = 1,
-        const CXSaveError_TranslationErrors = 2,
-        const CXSaveError_InvalidTU = 3,
-    }
-}
-
-cenum! {
-    #[cfg(feature="gte_clang_6_0")]
-    enum CXTLSKind {
-        const CXTLS_None = 0,
-        const CXTLS_Dynamic = 1,
-        const CXTLS_Static = 2,
-    }
-}
-
-cenum! {
-    enum CXTUResourceUsageKind {
-        const CXTUResourceUsage_AST = 1,
-        const CXTUResourceUsage_Identifiers = 2,
-        const CXTUResourceUsage_Selectors = 3,
-        const CXTUResourceUsage_GlobalCompletionResults = 4,
-        const CXTUResourceUsage_SourceManagerContentCache = 5,
-        const CXTUResourceUsage_AST_SideTables = 6,
-        const CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
-        const CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
-        const CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
-        const CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
-        const CXTUResourceUsage_Preprocessor = 11,
-        const CXTUResourceUsage_PreprocessingRecord = 12,
-        const CXTUResourceUsage_SourceManager_DataStructures = 13,
-        const CXTUResourceUsage_Preprocessor_HeaderSearch = 14,
-    }
-}
-
-cenum! {
-    #[cfg(feature="gte_clang_3_6")]
-    enum CXTemplateArgumentKind {
-        const CXTemplateArgumentKind_Null = 0,
-        const CXTemplateArgumentKind_Type = 1,
-        const CXTemplateArgumentKind_Declaration = 2,
-        const CXTemplateArgumentKind_NullPtr = 3,
-        const CXTemplateArgumentKind_Integral = 4,
-        const CXTemplateArgumentKind_Template = 5,
-        const CXTemplateArgumentKind_TemplateExpansion = 6,
-        const CXTemplateArgumentKind_Expression = 7,
-        const CXTemplateArgumentKind_Pack = 8,
-        const CXTemplateArgumentKind_Invalid = 9,
-    }
-}
-
-cenum! {
-    enum CXTokenKind {
-        const CXToken_Punctuation = 0,
-        const CXToken_Keyword = 1,
-        const CXToken_Identifier = 2,
-        const CXToken_Literal = 3,
-        const CXToken_Comment = 4,
-    }
-}
-
-cenum! {
-    enum CXTypeKind {
-        const CXType_Invalid = 0,
-        const CXType_Unexposed = 1,
-        const CXType_Void = 2,
-        const CXType_Bool = 3,
-        const CXType_Char_U = 4,
-        const CXType_UChar = 5,
-        const CXType_Char16 = 6,
-        const CXType_Char32 = 7,
-        const CXType_UShort = 8,
-        const CXType_UInt = 9,
-        const CXType_ULong = 10,
-        const CXType_ULongLong = 11,
-        const CXType_UInt128 = 12,
-        const CXType_Char_S = 13,
-        const CXType_SChar = 14,
-        const CXType_WChar = 15,
-        const CXType_Short = 16,
-        const CXType_Int = 17,
-        const CXType_Long = 18,
-        const CXType_LongLong = 19,
-        const CXType_Int128 = 20,
-        const CXType_Float = 21,
-        const CXType_Double = 22,
-        const CXType_LongDouble = 23,
-        const CXType_NullPtr = 24,
-        const CXType_Overload = 25,
-        const CXType_Dependent = 26,
-        const CXType_ObjCId = 27,
-        const CXType_ObjCClass = 28,
-        const CXType_ObjCSel = 29,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXType_Float128 = 30,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_Half = 31,
-        /// Only produced by `libclang` 6.0 and later.
-        const CXType_Float16 = 32,
-        const CXType_Complex = 100,
-        const CXType_Pointer = 101,
-        const CXType_BlockPointer = 102,
-        const CXType_LValueReference = 103,
-        const CXType_RValueReference = 104,
-        const CXType_Record = 105,
-        const CXType_Enum = 106,
-        const CXType_Typedef = 107,
-        const CXType_ObjCInterface = 108,
-        const CXType_ObjCObjectPointer = 109,
-        const CXType_FunctionNoProto = 110,
-        const CXType_FunctionProto = 111,
-        const CXType_ConstantArray = 112,
-        const CXType_Vector = 113,
-        const CXType_IncompleteArray = 114,
-        const CXType_VariableArray = 115,
-        const CXType_DependentSizedArray = 116,
-        const CXType_MemberPointer = 117,
-        /// Only produced by `libclang` 3.8 and later.
-        const CXType_Auto = 118,
-        /// Only produced by `libclang` 3.9 and later.
-        const CXType_Elaborated = 119,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_Pipe = 120,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dRO = 121,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dArrayRO = 122,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dBufferRO = 123,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dRO = 124,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayRO = 125,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dDepthRO = 126,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayDepthRO = 127,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAARO = 128,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAARO = 129,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAADepthRO = 130,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAADepthRO = 131,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage3dRO = 132,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dWO = 133,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dArrayWO = 134,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dBufferWO = 135,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dWO = 136,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayWO = 137,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dDepthWO = 138,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayDepthWO = 139,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAAWO = 140,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAAWO = 141,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAADepthWO = 142,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAADepthWO = 143,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage3dWO = 144,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dRW = 145,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dArrayRW = 146,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage1dBufferRW = 147,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dRW = 148,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayRW = 149,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dDepthRW = 150,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayDepthRW = 151,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAARW = 152,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAARW = 153,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dMSAADepthRW = 154,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage2dArrayMSAADepthRW = 155,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLImage3dRW = 156,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLSampler = 157,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLEvent = 158,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLQueue = 159,
-        /// Only produced by `libclang` 5.0 and later.
-        const CXType_OCLReserveID = 160,
-    }
-}
-
-cenum! {
-    enum CXTypeLayoutError {
-        const CXTypeLayoutError_Invalid = -1,
-        const CXTypeLayoutError_Incomplete = -2,
-        const CXTypeLayoutError_Dependent = -3,
-        const CXTypeLayoutError_NotConstantSize = -4,
-        const CXTypeLayoutError_InvalidFieldName = -5,
-    }
-}
-
-cenum! {
-    #[cfg(feature="gte_clang_3_8")]
-    enum CXVisibilityKind {
-        const CXVisibility_Invalid = 0,
-        const CXVisibility_Hidden = 1,
-        const CXVisibility_Protected = 2,
-        const CXVisibility_Default = 3,
-    }
-}
-
-cenum! {
-    enum CXVisitorResult {
-        const CXVisit_Break = 0,
-        const CXVisit_Continue = 1,
-    }
-}
-
-cenum! {
-    enum CX_CXXAccessSpecifier {
-        const CX_CXXInvalidAccessSpecifier = 0,
-        const CX_CXXPublic = 1,
-        const CX_CXXProtected = 2,
-        const CX_CXXPrivate = 3,
-    }
-}
-
-cenum! {
-    #[cfg(feature="gte_clang_3_6")]
-    enum CX_StorageClass {
-        const CX_SC_Invalid = 0,
-        const CX_SC_None = 1,
-        const CX_SC_Extern = 2,
-        const CX_SC_Static = 3,
-        const CX_SC_PrivateExtern = 4,
-        const CX_SC_OpenCLWorkGroupLocal = 5,
-        const CX_SC_Auto = 6,
-        const CX_SC_Register = 7,
-    }
-}
-
-//================================================
-// Flags
-//================================================
-
-cenum! {
-    enum CXCodeComplete_Flags {
-        const CXCodeComplete_IncludeMacros = 1;
-        const CXCodeComplete_IncludeCodePatterns = 2;
-        const CXCodeComplete_IncludeBriefComments = 4;
-    }
-}
-
-cenum! {
-    enum CXCompletionContext {
-        const CXCompletionContext_Unexposed = 0;
-        const CXCompletionContext_AnyType = 1;
-        const CXCompletionContext_AnyValue = 2;
-        const CXCompletionContext_ObjCObjectValue = 4;
-        const CXCompletionContext_ObjCSelectorValue = 8;
-        const CXCompletionContext_CXXClassTypeValue = 16;
-        const CXCompletionContext_DotMemberAccess = 32;
-        const CXCompletionContext_ArrowMemberAccess = 64;
-        const CXCompletionContext_ObjCPropertyAccess = 128;
-        const CXCompletionContext_EnumTag = 256;
-        const CXCompletionContext_UnionTag = 512;
-        const CXCompletionContext_StructTag = 1024;
-        const CXCompletionContext_ClassTag = 2048;
-        const CXCompletionContext_Namespace = 4096;
-        const CXCompletionContext_NestedNameSpecifier = 8192;
-        const CXCompletionContext_ObjCInterface = 16384;
-        const CXCompletionContext_ObjCProtocol = 32768;
-        const CXCompletionContext_ObjCCategory = 65536;
-        const CXCompletionContext_ObjCInstanceMessage = 131072;
-        const CXCompletionContext_ObjCClassMessage = 262144;
-        const CXCompletionContext_ObjCSelectorName = 524288;
-        const CXCompletionContext_MacroName = 1048576;
-        const CXCompletionContext_NaturalLanguage = 2097152;
-        const CXCompletionContext_Unknown = 4194303;
-    }
-}
-
-cenum! {
-    enum CXDiagnosticDisplayOptions {
-        const CXDiagnostic_DisplaySourceLocation = 1;
-        const CXDiagnostic_DisplayColumn = 2;
-        const CXDiagnostic_DisplaySourceRanges = 4;
-        const CXDiagnostic_DisplayOption = 8;
-        const CXDiagnostic_DisplayCategoryId = 16;
-        const CXDiagnostic_DisplayCategoryName = 32;
-    }
-}
-
-cenum! {
-    enum CXGlobalOptFlags {
-        const CXGlobalOpt_None = 0;
-        const CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1;
-        const CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2;
-        const CXGlobalOpt_ThreadBackgroundPriorityForAll = 3;
-    }
-}
-
-cenum! {
-    enum CXIdxDeclInfoFlags {
-        const CXIdxDeclFlag_Skipped = 1;
-    }
-}
-
-cenum! {
-    enum CXIndexOptFlags {
-        const CXIndexOptNone = 0;
-        const CXIndexOptSuppressRedundantRefs = 1;
-        const CXIndexOptIndexFunctionLocalSymbols = 2;
-        const CXIndexOptIndexImplicitTemplateInstantiations = 4;
-        const CXIndexOptSuppressWarnings = 8;
-        const CXIndexOptSkipParsedBodiesInSession = 16;
-    }
-}
-
-cenum! {
-    enum CXNameRefFlags {
-        const CXNameRange_WantQualifier = 1;
-        const CXNameRange_WantTemplateArgs = 2;
-        const CXNameRange_WantSinglePiece = 4;
-    }
-}
-
-cenum! {
-    enum CXObjCDeclQualifierKind {
-        const CXObjCDeclQualifier_None = 0;
-        const CXObjCDeclQualifier_In = 1;
-        const CXObjCDeclQualifier_Inout = 2;
-        const CXObjCDeclQualifier_Out = 4;
-        const CXObjCDeclQualifier_Bycopy = 8;
-        const CXObjCDeclQualifier_Byref = 16;
-        const CXObjCDeclQualifier_Oneway = 32;
-    }
-}
-
-cenum! {
-    enum CXObjCPropertyAttrKind {
-        const CXObjCPropertyAttr_noattr = 0;
-        const CXObjCPropertyAttr_readonly = 1;
-        const CXObjCPropertyAttr_getter = 2;
-        const CXObjCPropertyAttr_assign = 4;
-        const CXObjCPropertyAttr_readwrite = 8;
-        const CXObjCPropertyAttr_retain = 16;
-        const CXObjCPropertyAttr_copy = 32;
-        const CXObjCPropertyAttr_nonatomic = 64;
-        const CXObjCPropertyAttr_setter = 128;
-        const CXObjCPropertyAttr_atomic = 256;
-        const CXObjCPropertyAttr_weak = 512;
-        const CXObjCPropertyAttr_strong = 1024;
-        const CXObjCPropertyAttr_unsafe_unretained = 2048;
-        #[cfg(feature="gte_clang_3_9")]
-        const CXObjCPropertyAttr_class = 4096;
-    }
-}
-
-cenum! {
-    enum CXReparse_Flags {
-        const CXReparse_None = 0;
-    }
-}
-
-cenum! {
-    enum CXSaveTranslationUnit_Flags {
-        const CXSaveTranslationUnit_None = 0;
-    }
-}
-
-cenum! {
-    enum CXTranslationUnit_Flags {
-        const CXTranslationUnit_None = 0;
-        const CXTranslationUnit_DetailedPreprocessingRecord = 1;
-        const CXTranslationUnit_Incomplete = 2;
-        const CXTranslationUnit_PrecompiledPreamble = 4;
-        const CXTranslationUnit_CacheCompletionResults = 8;
-        const CXTranslationUnit_ForSerialization = 16;
-        const CXTranslationUnit_CXXChainedPCH = 32;
-        const CXTranslationUnit_SkipFunctionBodies = 64;
-        const CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128;
-        #[cfg(feature="gte_clang_3_8")]
-        const CXTranslationUnit_CreatePreambleOnFirstParse = 256;
-        #[cfg(feature="gte_clang_3_9")]
-        const CXTranslationUnit_KeepGoing = 512;
-        #[cfg(feature="gte_clang_5_0")]
-        const CXTranslationUnit_SingleFileParse = 1024;
-    }
-}
-
-//================================================
-// Structs
-//================================================
-
-// Opaque ________________________________________
-
-macro_rules! opaque { ($name:ident) => (pub type $name = *mut c_void;); }
-
-opaque!(CXCompilationDatabase);
-opaque!(CXCompileCommand);
-opaque!(CXCompileCommands);
-opaque!(CXCompletionString);
-opaque!(CXCursorSet);
-opaque!(CXDiagnostic);
-opaque!(CXDiagnosticSet);
-#[cfg(feature="gte_clang_3_9")]
-opaque!(CXEvalResult);
-opaque!(CXFile);
-opaque!(CXIdxClientASTFile);
-opaque!(CXIdxClientContainer);
-opaque!(CXIdxClientEntity);
-opaque!(CXIdxClientFile);
-opaque!(CXIndex);
-opaque!(CXIndexAction);
-opaque!(CXModule);
-opaque!(CXRemapping);
-#[cfg(feature="gte_clang_5_0")]
-opaque!(CXTargetInfo);
-opaque!(CXTranslationUnit);
-
-// Transparent ___________________________________
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXCodeCompleteResults {
-    pub Results: *mut CXCompletionResult,
-    pub NumResults: c_uint,
-}
-
-default!(CXCodeCompleteResults);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXComment {
-    pub ASTNode: *const c_void,
-    pub TranslationUnit: CXTranslationUnit,
-}
-
-default!(CXComment);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXCompletionResult {
-    pub CursorKind: CXCursorKind,
-    pub CompletionString: CXCompletionString,
-}
-
-default!(CXCompletionResult);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXCursor {
-    pub kind: CXCursorKind,
-    pub xdata: c_int,
-    pub data: [*const c_void; 3],
-}
-
-default!(CXCursor);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXCursorAndRangeVisitor {
-    pub context: *mut c_void,
-    pub visit: extern fn(*mut c_void, CXCursor, CXSourceRange) -> CXVisitorResult,
-}
-
-default!(CXCursorAndRangeVisitor);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXFileUniqueID {
-    pub data: [c_ulonglong; 3],
-}
-
-default!(CXFileUniqueID);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxAttrInfo {
-    pub kind: CXIdxAttrKind,
-    pub cursor: CXCursor,
-    pub loc: CXIdxLoc,
-}
-
-default!(CXIdxAttrInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxBaseClassInfo {
-    pub base: *const CXIdxEntityInfo,
-    pub cursor: CXCursor,
-    pub loc: CXIdxLoc,
-}
-
-default!(CXIdxBaseClassInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxCXXClassDeclInfo {
-    pub declInfo: *const CXIdxDeclInfo,
-    pub bases: *const *const CXIdxBaseClassInfo,
-    pub numBases: c_uint,
-}
-
-default!(CXIdxCXXClassDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxContainerInfo {
-    pub cursor: CXCursor,
-}
-
-default!(CXIdxContainerInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxDeclInfo {
-    pub entityInfo: *const CXIdxEntityInfo,
-    pub cursor: CXCursor,
-    pub loc: CXIdxLoc,
-    pub semanticContainer: *const CXIdxContainerInfo,
-    pub lexicalContainer: *const CXIdxContainerInfo,
-    pub isRedeclaration: c_int,
-    pub isDefinition: c_int,
-    pub isContainer: c_int,
-    pub declAsContainer: *const CXIdxContainerInfo,
-    pub isImplicit: c_int,
-    pub attributes: *const *const CXIdxAttrInfo,
-    pub numAttributes: c_uint,
-    pub flags: c_uint,
-}
-
-default!(CXIdxDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxEntityInfo {
-    pub kind: CXIdxEntityKind,
-    pub templateKind: CXIdxEntityCXXTemplateKind,
-    pub lang: CXIdxEntityLanguage,
-    pub name: *const c_char,
-    pub USR: *const c_char,
-    pub cursor: CXCursor,
-    pub attributes: *const *const CXIdxAttrInfo,
-    pub numAttributes: c_uint,
-}
-
-default!(CXIdxEntityInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxEntityRefInfo {
-    pub kind: CXIdxEntityRefKind,
-    pub cursor: CXCursor,
-    pub loc: CXIdxLoc,
-    pub referencedEntity: *const CXIdxEntityInfo,
-    pub parentEntity: *const CXIdxEntityInfo,
-    pub container: *const CXIdxContainerInfo,
-}
-
-default!(CXIdxEntityRefInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxIBOutletCollectionAttrInfo {
-    pub attrInfo: *const CXIdxAttrInfo,
-    pub objcClass: *const CXIdxEntityInfo,
-    pub classCursor: CXCursor,
-    pub classLoc: CXIdxLoc,
-}
-
-default!(CXIdxIBOutletCollectionAttrInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxImportedASTFileInfo {
-    pub file: CXFile,
-    pub module: CXModule,
-    pub loc: CXIdxLoc,
-    pub isImplicit: c_int,
-}
-
-default!(CXIdxImportedASTFileInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxIncludedFileInfo {
-    pub hashLoc: CXIdxLoc,
-    pub filename: *const c_char,
-    pub file: CXFile,
-    pub isImport: c_int,
-    pub isAngled: c_int,
-    pub isModuleImport: c_int,
-}
-
-default!(CXIdxIncludedFileInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxLoc {
-    pub ptr_data: [*mut c_void; 2],
-    pub int_data: c_uint,
-}
-
-default!(CXIdxLoc);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCCategoryDeclInfo {
-    pub containerInfo: *const CXIdxObjCContainerDeclInfo,
-    pub objcClass: *const CXIdxEntityInfo,
-    pub classCursor: CXCursor,
-    pub classLoc: CXIdxLoc,
-    pub protocols: *const CXIdxObjCProtocolRefListInfo,
-}
-
-default!(CXIdxObjCCategoryDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCContainerDeclInfo {
-    pub declInfo: *const CXIdxDeclInfo,
-    pub kind: CXIdxObjCContainerKind,
-}
-
-default!(CXIdxObjCContainerDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCInterfaceDeclInfo {
-    pub containerInfo: *const CXIdxObjCContainerDeclInfo,
-    pub superInfo: *const CXIdxBaseClassInfo,
-    pub protocols: *const CXIdxObjCProtocolRefListInfo,
-}
-
-default!(CXIdxObjCInterfaceDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCPropertyDeclInfo {
-    pub declInfo: *const CXIdxDeclInfo,
-    pub getter: *const CXIdxEntityInfo,
-    pub setter: *const CXIdxEntityInfo,
-}
-
-default!(CXIdxObjCPropertyDeclInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCProtocolRefInfo {
-    pub protocol: *const CXIdxEntityInfo,
-    pub cursor: CXCursor,
-    pub loc: CXIdxLoc,
-}
-
-default!(CXIdxObjCProtocolRefInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXIdxObjCProtocolRefListInfo {
-    pub protocols: *const *const CXIdxObjCProtocolRefInfo,
-    pub numProtocols: c_uint,
-}
-
-default!(CXIdxObjCProtocolRefListInfo);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXPlatformAvailability {
-    pub Platform: CXString,
-    pub Introduced: CXVersion,
-    pub Deprecated: CXVersion,
-    pub Obsoleted: CXVersion,
-    pub Unavailable: c_int,
-    pub Message: CXString,
-}
-
-default!(CXPlatformAvailability);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXSourceLocation {
-    pub ptr_data: [*const c_void; 2],
-    pub int_data: c_uint,
-}
-
-default!(CXSourceLocation);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXSourceRange {
-    pub ptr_data: [*const c_void; 2],
-    pub begin_int_data: c_uint,
-    pub end_int_data: c_uint,
-}
-
-default!(CXSourceRange);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXSourceRangeList {
-    pub count: c_uint,
-    pub ranges: *mut CXSourceRange,
-}
-
-default!(CXSourceRangeList);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXString {
-    pub data: *const c_void,
-    pub private_flags: c_uint,
-}
-
-default!(CXString);
-
-#[cfg(feature="gte_clang_3_8")]
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXStringSet {
-    pub Strings: *mut CXString,
-    pub Count: c_uint,
-}
-
-default!(#[cfg(feature="gte_clang_3_8")] CXStringSet);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXTUResourceUsage {
-    pub data: *mut c_void,
-    pub numEntries: c_uint,
-    pub entries: *mut CXTUResourceUsageEntry,
-}
-
-default!(CXTUResourceUsage);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXTUResourceUsageEntry {
-    pub kind: CXTUResourceUsageKind,
-    pub amount: c_ulong,
-}
-
-default!(CXTUResourceUsageEntry);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXToken {
-    pub int_data: [c_uint; 4],
-    pub ptr_data: *mut c_void,
-}
-
-default!(CXToken);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXType {
-    pub kind: CXTypeKind,
-    pub data: [*mut c_void; 2],
-}
-
-default!(CXType);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXUnsavedFile {
-    pub Filename: *const c_char,
-    pub Contents: *const c_char,
-    pub Length: c_ulong,
-}
-
-default!(CXUnsavedFile);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct CXVersion {
-    pub Major: c_int,
-    pub Minor: c_int,
-    pub Subminor: c_int,
-}
-
-default!(CXVersion);
-
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub struct IndexerCallbacks {
-    pub abortQuery: extern fn(CXClientData, *mut c_void) -> c_int,
-    pub diagnostic: extern fn(CXClientData, CXDiagnosticSet, *mut c_void),
-    pub enteredMainFile: extern fn(CXClientData, CXFile, *mut c_void) -> CXIdxClientFile,
-    pub ppIncludedFile: extern fn(CXClientData, *const CXIdxIncludedFileInfo) -> CXIdxClientFile,
-    pub importedASTFile: extern fn(CXClientData, *const CXIdxImportedASTFileInfo) -> CXIdxClientASTFile,
-    pub startedTranslationUnit: extern fn(CXClientData, *mut c_void) -> CXIdxClientContainer,
-    pub indexDeclaration: extern fn(CXClientData, *const CXIdxDeclInfo),
-    pub indexEntityReference: extern fn(CXClientData, *const CXIdxEntityRefInfo),
-}
-
-default!(IndexerCallbacks);
-
-//================================================
-// Functions
-//================================================
-
-link! {
-    pub fn clang_CXCursorSet_contains(set: CXCursorSet, cursor: CXCursor) -> c_uint;
-    pub fn clang_CXCursorSet_insert(set: CXCursorSet, cursor: CXCursor) -> c_uint;
-    pub fn clang_CXIndex_getGlobalOptions(index: CXIndex) -> CXGlobalOptFlags;
-    pub fn clang_CXIndex_setGlobalOptions(index: CXIndex, flags: CXGlobalOptFlags);
-    #[cfg(feature="gte_clang_6_0")]
-    pub fn clang_CXIndex_setInvocationEmissionPathOption(index: CXIndex, path: *const c_char);
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_CXXConstructor_isConvertingConstructor(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_CXXConstructor_isCopyConstructor(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_CXXConstructor_isDefaultConstructor(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_CXXConstructor_isMoveConstructor(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_CXXField_isMutable(cursor: CXCursor) -> c_uint;
-    pub fn clang_CXXMethod_isConst(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_CXXMethod_isDefaulted(cursor: CXCursor) -> c_uint;
-    pub fn clang_CXXMethod_isPureVirtual(cursor: CXCursor) -> c_uint;
-    pub fn clang_CXXMethod_isStatic(cursor: CXCursor) -> c_uint;
-    pub fn clang_CXXMethod_isVirtual(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_6_0")]
-    pub fn clang_CXXRecord_isAbstract(cursor: CXCursor) -> c_uint;
-    pub fn clang_CompilationDatabase_dispose(database: CXCompilationDatabase);
-    pub fn clang_CompilationDatabase_fromDirectory(directory: *const c_char, error: *mut CXCompilationDatabase_Error) -> CXCompilationDatabase;
-    pub fn clang_CompilationDatabase_getAllCompileCommands(database: CXCompilationDatabase) -> CXCompileCommands;
-    pub fn clang_CompilationDatabase_getCompileCommands(database: CXCompilationDatabase, filename: *const c_char) -> CXCompileCommands;
-    pub fn clang_CompileCommand_getArg(command: CXCompileCommand, index: c_uint) -> CXString;
-    pub fn clang_CompileCommand_getDirectory(command: CXCompileCommand) -> CXString;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_CompileCommand_getFilename(command: CXCompileCommand) -> CXString;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_CompileCommand_getMappedSourceContent(command: CXCompileCommand, index: c_uint) -> CXString;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_CompileCommand_getMappedSourcePath(command: CXCompileCommand, index: c_uint) -> CXString;
-    pub fn clang_CompileCommand_getNumArgs(command: CXCompileCommand) -> c_uint;
-    pub fn clang_CompileCommands_dispose(command: CXCompileCommands);
-    pub fn clang_CompileCommands_getCommand(command: CXCompileCommands, index: c_uint) -> CXCompileCommand;
-    pub fn clang_CompileCommands_getSize(command: CXCompileCommands) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Cursor_Evaluate(cursor: CXCursor) -> CXEvalResult;
-    pub fn clang_Cursor_getArgument(cursor: CXCursor, index: c_uint) -> CXCursor;
-    pub fn clang_Cursor_getBriefCommentText(cursor: CXCursor) -> CXString;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_Cursor_getCXXManglings(cursor: CXCursor) -> *mut CXStringSet;
-    pub fn clang_Cursor_getCommentRange(cursor: CXCursor) -> CXSourceRange;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getMangling(cursor: CXCursor) -> CXString;
-    pub fn clang_Cursor_getModule(cursor: CXCursor) -> CXModule;
-    pub fn clang_Cursor_getNumArguments(cursor: CXCursor) -> c_int;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getNumTemplateArguments(cursor: CXCursor) -> c_int;
-    pub fn clang_Cursor_getObjCDeclQualifiers(cursor: CXCursor) -> CXObjCDeclQualifierKind;
-    #[cfg(feature="gte_clang_6_0")]
-    pub fn clang_Cursor_getObjCManglings(cursor: CXCursor) -> *mut CXStringSet;
-    pub fn clang_Cursor_getObjCPropertyAttributes(cursor: CXCursor, reserved: c_uint) -> CXObjCPropertyAttrKind;
-    pub fn clang_Cursor_getObjCSelectorIndex(cursor: CXCursor) -> c_int;
-    #[cfg(feature="gte_clang_3_7")]
-    pub fn clang_Cursor_getOffsetOfField(cursor: CXCursor) -> c_longlong;
-    pub fn clang_Cursor_getRawCommentText(cursor: CXCursor) -> CXString;
-    pub fn clang_Cursor_getReceiverType(cursor: CXCursor) -> CXType;
-    pub fn clang_Cursor_getSpellingNameRange(cursor: CXCursor, index: c_uint, reserved: c_uint) -> CXSourceRange;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getStorageClass(cursor: CXCursor) -> CX_StorageClass;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getTemplateArgumentKind(cursor: CXCursor, index: c_uint) -> CXTemplateArgumentKind;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getTemplateArgumentType(cursor: CXCursor, index: c_uint) -> CXType;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getTemplateArgumentUnsignedValue(cursor: CXCursor, index: c_uint) -> c_ulonglong;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_Cursor_getTemplateArgumentValue(cursor: CXCursor, index: c_uint) -> c_longlong;
-    pub fn clang_Cursor_getTranslationUnit(cursor: CXCursor) -> CXTranslationUnit;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Cursor_hasAttrs(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_7")]
-    pub fn clang_Cursor_isAnonymous(cursor: CXCursor) -> c_uint;
-    pub fn clang_Cursor_isBitField(cursor: CXCursor) -> c_uint;
-    pub fn clang_Cursor_isDynamicCall(cursor: CXCursor) -> c_int;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_Cursor_isExternalSymbol(cursor: CXCursor, language: *mut CXString, from: *mut CXString, generated: *mut c_uint) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Cursor_isFunctionInlined(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Cursor_isMacroBuiltin(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Cursor_isMacroFunctionLike(cursor: CXCursor) -> c_uint;
-    pub fn clang_Cursor_isNull(cursor: CXCursor) -> c_int;
-    pub fn clang_Cursor_isObjCOptional(cursor: CXCursor) -> c_uint;
-    pub fn clang_Cursor_isVariadic(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_EnumDecl_isScoped(cursor: CXCursor) -> c_uint;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_EvalResult_dispose(result: CXEvalResult);
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_EvalResult_getAsDouble(result: CXEvalResult) -> libc::c_double;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_EvalResult_getAsInt(result: CXEvalResult) -> c_int;
-    #[cfg(feature="gte_clang_4_0")]
-    pub fn clang_EvalResult_getAsLongLong(result: CXEvalResult) -> c_longlong;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_EvalResult_getAsStr(result: CXEvalResult) -> *const c_char;
-    #[cfg(feature="gte_clang_4_0")]
-    pub fn clang_EvalResult_getAsUnsigned(result: CXEvalResult) -> c_ulonglong;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_EvalResult_getKind(result: CXEvalResult) -> CXEvalResultKind;
-    #[cfg(feature="gte_clang_4_0")]
-    pub fn clang_EvalResult_isUnsignedInt(result: CXEvalResult) -> c_uint;
-    #[cfg(feature="gte_clang_3_6")]
-    pub fn clang_File_isEqual(left: CXFile, right: CXFile) -> c_int;
-    pub fn clang_IndexAction_create(index: CXIndex) -> CXIndexAction;
-    pub fn clang_IndexAction_dispose(index: CXIndexAction);
-    pub fn clang_Location_isFromMainFile(location: CXSourceLocation) -> c_int;
-    pub fn clang_Location_isInSystemHeader(location: CXSourceLocation) -> c_int;
-    pub fn clang_Module_getASTFile(module: CXModule) -> CXFile;
-    pub fn clang_Module_getFullName(module: CXModule) -> CXString;
-    pub fn clang_Module_getName(module: CXModule) -> CXString;
-    pub fn clang_Module_getNumTopLevelHeaders(tu: CXTranslationUnit, module: CXModule) -> c_uint;
-    pub fn clang_Module_getParent(module: CXModule) -> CXModule;
-    pub fn clang_Module_getTopLevelHeader(tu: CXTranslationUnit, module: CXModule, index: c_uint) -> CXFile;
-    pub fn clang_Module_isSystem(module: CXModule) -> c_int;
-    pub fn clang_Range_isNull(range: CXSourceRange) -> c_int;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_TargetInfo_dispose(info: CXTargetInfo);
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_TargetInfo_getPointerWidth(info: CXTargetInfo) -> c_int;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_TargetInfo_getTriple(info: CXTargetInfo) -> CXString;
-    pub fn clang_Type_getAlignOf(type_: CXType) -> c_longlong;
-    pub fn clang_Type_getCXXRefQualifier(type_: CXType) -> CXRefQualifierKind;
-    pub fn clang_Type_getClassType(type_: CXType) -> CXType;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Type_getNamedType(type_: CXType) -> CXType;
-    pub fn clang_Type_getNumTemplateArguments(type_: CXType) -> c_int;
-    #[cfg(feature="gte_clang_3_9")]
-    pub fn clang_Type_getObjCEncoding(type_: CXType) -> CXString;
-    pub fn clang_Type_getOffsetOf(type_: CXType, field: *const c_char) -> c_longlong;
-    pub fn clang_Type_getSizeOf(type_: CXType) -> c_longlong;
-    pub fn clang_Type_getTemplateArgumentAsType(type_: CXType, index: c_uint) -> CXType;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_Type_isTransparentTagTypedef(type_: CXType) -> c_uint;
-    #[cfg(feature="gte_clang_3_7")]
-    pub fn clang_Type_visitFields(type_: CXType, visitor: CXFieldVisitor, data: CXClientData) -> CXVisitorResult;
-    pub fn clang_annotateTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint, cursors: *mut CXCursor);
-    pub fn clang_codeCompleteAt(tu: CXTranslationUnit, file: *const c_char, line: c_uint, column: c_uint, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXCodeComplete_Flags) -> *mut CXCodeCompleteResults;
-    pub fn clang_codeCompleteGetContainerKind(results: *mut CXCodeCompleteResults, incomplete: *mut c_uint) -> CXCursorKind;
-    pub fn clang_codeCompleteGetContainerUSR(results: *mut CXCodeCompleteResults) -> CXString;
-    pub fn clang_codeCompleteGetContexts(results: *mut CXCodeCompleteResults) -> c_ulonglong;
-    pub fn clang_codeCompleteGetDiagnostic(results: *mut CXCodeCompleteResults, index: c_uint) -> CXDiagnostic;
-    pub fn clang_codeCompleteGetNumDiagnostics(results: *mut CXCodeCompleteResults) -> c_uint;
-    pub fn clang_codeCompleteGetObjCSelector(results: *mut CXCodeCompleteResults) -> CXString;
-    pub fn clang_constructUSR_ObjCCategory(class: *const c_char, category: *const c_char) -> CXString;
-    pub fn clang_constructUSR_ObjCClass(class: *const c_char) -> CXString;
-    pub fn clang_constructUSR_ObjCIvar(name: *const c_char, usr: CXString) -> CXString;
-    pub fn clang_constructUSR_ObjCMethod(name: *const c_char, instance: c_uint, usr: CXString) -> CXString;
-    pub fn clang_constructUSR_ObjCProperty(property: *const c_char, usr: CXString) -> CXString;
-    pub fn clang_constructUSR_ObjCProtocol(protocol: *const c_char) -> CXString;
-    pub fn clang_createCXCursorSet() -> CXCursorSet;
-    pub fn clang_createIndex(exclude: c_int, display: c_int) -> CXIndex;
-    pub fn clang_createTranslationUnit(index: CXIndex, file: *const c_char) -> CXTranslationUnit;
-    pub fn clang_createTranslationUnit2(index: CXIndex, file: *const c_char, tu: *mut CXTranslationUnit) -> CXErrorCode;
-    pub fn clang_createTranslationUnitFromSourceFile(index: CXIndex, file: *const c_char, n_arguments: c_int, arguments: *const *const c_char, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile) -> CXTranslationUnit;
-    pub fn clang_defaultCodeCompleteOptions() -> CXCodeComplete_Flags;
-    pub fn clang_defaultDiagnosticDisplayOptions() -> CXDiagnosticDisplayOptions;
-    pub fn clang_defaultEditingTranslationUnitOptions() -> CXTranslationUnit_Flags;
-    pub fn clang_defaultReparseOptions(tu: CXTranslationUnit) -> CXReparse_Flags;
-    pub fn clang_defaultSaveOptions(tu: CXTranslationUnit) -> CXSaveTranslationUnit_Flags;
-    pub fn clang_disposeCXCursorSet(set: CXCursorSet);
-    pub fn clang_disposeCXPlatformAvailability(availability: *mut CXPlatformAvailability);
-    pub fn clang_disposeCXTUResourceUsage(usage: CXTUResourceUsage);
-    pub fn clang_disposeCodeCompleteResults(results: *mut CXCodeCompleteResults);
-    pub fn clang_disposeDiagnostic(diagnostic: CXDiagnostic);
-    pub fn clang_disposeDiagnosticSet(diagnostic: CXDiagnosticSet);
-    pub fn clang_disposeIndex(index: CXIndex);
-    pub fn clang_disposeOverriddenCursors(cursors: *mut CXCursor);
-    pub fn clang_disposeSourceRangeList(list: *mut CXSourceRangeList);
-    pub fn clang_disposeString(string: CXString);
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_disposeStringSet(set: *mut CXStringSet);
-    pub fn clang_disposeTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint);
-    pub fn clang_disposeTranslationUnit(tu: CXTranslationUnit);
-    pub fn clang_enableStackTraces();
-    pub fn clang_equalCursors(left: CXCursor, right: CXCursor) -> c_uint;
-    pub fn clang_equalLocations(left: CXSourceLocation, right: CXSourceLocation) -> c_uint;
-    pub fn clang_equalRanges(left: CXSourceRange, right: CXSourceRange) -> c_uint;
-    pub fn clang_equalTypes(left: CXType, right: CXType) -> c_uint;
-    pub fn clang_executeOnThread(function: extern fn(*mut c_void), data: *mut c_void, stack: c_uint);
-    pub fn clang_findIncludesInFile(tu: CXTranslationUnit, file: CXFile, cursor: CXCursorAndRangeVisitor) -> CXResult;
-    pub fn clang_findReferencesInFile(cursor: CXCursor, file: CXFile, visitor: CXCursorAndRangeVisitor) -> CXResult;
-    pub fn clang_formatDiagnostic(diagnostic: CXDiagnostic, flags: CXDiagnosticDisplayOptions) -> CXString;
-    #[cfg(feature="gte_clang_3_7")]
-    pub fn clang_free(buffer: *mut c_void);
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_getAddressSpace(type_: CXType) -> c_uint;
-    #[cfg(feature="gte_clang_4_0")]
-    pub fn clang_getAllSkippedRanges(tu: CXTranslationUnit) -> *mut CXSourceRangeList;
-    pub fn clang_getArgType(type_: CXType, index: c_uint) -> CXType;
-    pub fn clang_getArrayElementType(type_: CXType) -> CXType;
-    pub fn clang_getArraySize(type_: CXType) -> c_longlong;
-    pub fn clang_getCString(string: CXString) -> *const c_char;
-    pub fn clang_getCXTUResourceUsage(tu: CXTranslationUnit) -> CXTUResourceUsage;
-    pub fn clang_getCXXAccessSpecifier(cursor: CXCursor) -> CX_CXXAccessSpecifier;
-    pub fn clang_getCanonicalCursor(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getCanonicalType(type_: CXType) -> CXType;
-    pub fn clang_getChildDiagnostics(diagnostic: CXDiagnostic) -> CXDiagnosticSet;
-    pub fn clang_getClangVersion() -> CXString;
-    pub fn clang_getCompletionAnnotation(string: CXCompletionString, index: c_uint) -> CXString;
-    pub fn clang_getCompletionAvailability(string: CXCompletionString) -> CXAvailabilityKind;
-    pub fn clang_getCompletionBriefComment(string: CXCompletionString) -> CXString;
-    pub fn clang_getCompletionChunkCompletionString(string: CXCompletionString, index: c_uint) -> CXCompletionString;
-    pub fn clang_getCompletionChunkKind(string: CXCompletionString, index: c_uint) -> CXCompletionChunkKind;
-    pub fn clang_getCompletionChunkText(string: CXCompletionString, index: c_uint) -> CXString;
-    pub fn clang_getCompletionNumAnnotations(string: CXCompletionString) -> c_uint;
-    pub fn clang_getCompletionParent(string: CXCompletionString, kind: *mut CXCursorKind) -> CXString;
-    pub fn clang_getCompletionPriority(string: CXCompletionString) -> c_uint;
-    pub fn clang_getCursor(tu: CXTranslationUnit, location: CXSourceLocation) -> CXCursor;
-    pub fn clang_getCursorAvailability(cursor: CXCursor) -> CXAvailabilityKind;
-    pub fn clang_getCursorCompletionString(cursor: CXCursor) -> CXCompletionString;
-    pub fn clang_getCursorDefinition(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getCursorDisplayName(cursor: CXCursor) -> CXString;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_getCursorExceptionSpecificationType(cursor: CXCursor) -> CXCursor_ExceptionSpecificationKind;
-    pub fn clang_getCursorExtent(cursor: CXCursor) -> CXSourceRange;
-    pub fn clang_getCursorKind(cursor: CXCursor) -> CXCursorKind;
-    pub fn clang_getCursorKindSpelling(kind: CXCursorKind) -> CXString;
-    pub fn clang_getCursorLanguage(cursor: CXCursor) -> CXLanguageKind;
-    pub fn clang_getCursorLexicalParent(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getCursorLinkage(cursor: CXCursor) -> CXLinkageKind;
-    pub fn clang_getCursorLocation(cursor: CXCursor) -> CXSourceLocation;
-    pub fn clang_getCursorPlatformAvailability(cursor: CXCursor, deprecated: *mut c_int, deprecated_message: *mut CXString, unavailable: *mut c_int, unavailable_message: *mut CXString, availability: *mut CXPlatformAvailability, n_availability: c_int) -> c_int;
-    pub fn clang_getCursorReferenceNameRange(cursor: CXCursor, flags: CXNameRefFlags, index: c_uint) -> CXSourceRange;
-    pub fn clang_getCursorReferenced(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getCursorResultType(cursor: CXCursor) -> CXType;
-    pub fn clang_getCursorSemanticParent(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getCursorSpelling(cursor: CXCursor) -> CXString;
-    #[cfg(feature="gte_clang_6_0")]
-    pub fn clang_getCursorTLSKind(cursor: CXCursor) -> CXTLSKind;
-    pub fn clang_getCursorType(cursor: CXCursor) -> CXType;
-    pub fn clang_getCursorUSR(cursor: CXCursor) -> CXString;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_getCursorVisibility(cursor: CXCursor) -> CXVisibilityKind;
-    pub fn clang_getDeclObjCTypeEncoding(cursor: CXCursor) -> CXString;
-    pub fn clang_getDefinitionSpellingAndExtent(cursor: CXCursor, start: *mut *const c_char, end: *mut *const c_char, start_line: *mut c_uint, start_column: *mut c_uint, end_line: *mut c_uint, end_column: *mut c_uint);
-    pub fn clang_getDiagnostic(tu: CXTranslationUnit, index: c_uint) -> CXDiagnostic;
-    pub fn clang_getDiagnosticCategory(diagnostic: CXDiagnostic) -> c_uint;
-    pub fn clang_getDiagnosticCategoryName(category: c_uint) -> CXString;
-    pub fn clang_getDiagnosticCategoryText(diagnostic: CXDiagnostic) -> CXString;
-    pub fn clang_getDiagnosticFixIt(diagnostic: CXDiagnostic, index: c_uint, range: *mut CXSourceRange) -> CXString;
-    pub fn clang_getDiagnosticInSet(diagnostic: CXDiagnosticSet, index: c_uint) -> CXDiagnostic;
-    pub fn clang_getDiagnosticLocation(diagnostic: CXDiagnostic) -> CXSourceLocation;
-    pub fn clang_getDiagnosticNumFixIts(diagnostic: CXDiagnostic) -> c_uint;
-    pub fn clang_getDiagnosticNumRanges(diagnostic: CXDiagnostic) -> c_uint;
-    pub fn clang_getDiagnosticOption(diagnostic: CXDiagnostic, option: *mut CXString) -> CXString;
-    pub fn clang_getDiagnosticRange(diagnostic: CXDiagnostic, index: c_uint) -> CXSourceRange;
-    pub fn clang_getDiagnosticSetFromTU(tu: CXTranslationUnit) -> CXDiagnosticSet;
-    pub fn clang_getDiagnosticSeverity(diagnostic: CXDiagnostic) -> CXDiagnosticSeverity;
-    pub fn clang_getDiagnosticSpelling(diagnostic: CXDiagnostic) -> CXString;
-    pub fn clang_getElementType(type_: CXType) -> CXType;
-    pub fn clang_getEnumConstantDeclUnsignedValue(cursor: CXCursor) -> c_ulonglong;
-    pub fn clang_getEnumConstantDeclValue(cursor: CXCursor) -> c_longlong;
-    pub fn clang_getEnumDeclIntegerType(cursor: CXCursor) -> CXType;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_getExceptionSpecificationType(type_: CXType) -> CXCursor_ExceptionSpecificationKind;
-    pub fn clang_getExpansionLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
-    pub fn clang_getFieldDeclBitWidth(cursor: CXCursor) -> c_int;
-    pub fn clang_getFile(tu: CXTranslationUnit, file: *const c_char) -> CXFile;
-    #[cfg(feature="gte_clang_6_0")]
-    pub fn clang_getFileContents(tu: CXTranslationUnit, file: CXFile, size: *mut size_t) -> *const c_char;
-    pub fn clang_getFileLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
-    pub fn clang_getFileName(file: CXFile) -> CXString;
-    pub fn clang_getFileTime(file: CXFile) -> time_t;
-    pub fn clang_getFileUniqueID(file: CXFile, id: *mut CXFileUniqueID) -> c_int;
-    pub fn clang_getFunctionTypeCallingConv(type_: CXType) -> CXCallingConv;
-    pub fn clang_getIBOutletCollectionType(cursor: CXCursor) -> CXType;
-    pub fn clang_getIncludedFile(cursor: CXCursor) -> CXFile;
-    pub fn clang_getInclusions(tu: CXTranslationUnit, visitor: CXInclusionVisitor, data: CXClientData);
-    pub fn clang_getInstantiationLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
-    pub fn clang_getLocation(tu: CXTranslationUnit, file: CXFile, line: c_uint, column: c_uint) -> CXSourceLocation;
-    pub fn clang_getLocationForOffset(tu: CXTranslationUnit, file: CXFile, offset: c_uint) -> CXSourceLocation;
-    pub fn clang_getModuleForFile(tu: CXTranslationUnit, file: CXFile) -> CXModule;
-    pub fn clang_getNullCursor() -> CXCursor;
-    pub fn clang_getNullLocation() -> CXSourceLocation;
-    pub fn clang_getNullRange() -> CXSourceRange;
-    pub fn clang_getNumArgTypes(type_: CXType) -> c_int;
-    pub fn clang_getNumCompletionChunks(string: CXCompletionString) -> c_uint;
-    pub fn clang_getNumDiagnostics(tu: CXTranslationUnit) -> c_uint;
-    pub fn clang_getNumDiagnosticsInSet(diagnostic: CXDiagnosticSet) -> c_uint;
-    pub fn clang_getNumElements(type_: CXType) -> c_longlong;
-    pub fn clang_getNumOverloadedDecls(cursor: CXCursor) -> c_uint;
-    pub fn clang_getOverloadedDecl(cursor: CXCursor, index: c_uint) -> CXCursor;
-    pub fn clang_getOverriddenCursors(cursor: CXCursor, cursors: *mut *mut CXCursor, n_cursors: *mut c_uint);
-    pub fn clang_getPointeeType(type_: CXType) -> CXType;
-    pub fn clang_getPresumedLocation(location: CXSourceLocation, file: *mut CXString, line: *mut c_uint, column: *mut c_uint);
-    pub fn clang_getRange(start: CXSourceLocation, end: CXSourceLocation) -> CXSourceRange;
-    pub fn clang_getRangeEnd(range: CXSourceRange) -> CXSourceLocation;
-    pub fn clang_getRangeStart(range: CXSourceRange) -> CXSourceLocation;
-    pub fn clang_getRemappings(file: *const c_char) -> CXRemapping;
-    pub fn clang_getRemappingsFromFileList(files: *mut *const c_char, n_files: c_uint) -> CXRemapping;
-    pub fn clang_getResultType(type_: CXType) -> CXType;
-    pub fn clang_getSkippedRanges(tu: CXTranslationUnit, file: CXFile) -> *mut CXSourceRangeList;
-    pub fn clang_getSpecializedCursorTemplate(cursor: CXCursor) -> CXCursor;
-    pub fn clang_getSpellingLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
-    pub fn clang_getTUResourceUsageName(kind: CXTUResourceUsageKind) -> *const c_char;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_getTranslationUnitTargetInfo(tu: CXTranslationUnit) -> CXTargetInfo;
-    pub fn clang_getTemplateCursorKind(cursor: CXCursor) -> CXCursorKind;
-    pub fn clang_getTokenExtent(tu: CXTranslationUnit, token: CXToken) -> CXSourceRange;
-    pub fn clang_getTokenKind(token: CXToken) -> CXTokenKind;
-    pub fn clang_getTokenLocation(tu: CXTranslationUnit, token: CXToken) -> CXSourceLocation;
-    pub fn clang_getTokenSpelling(tu: CXTranslationUnit, token: CXToken) -> CXString;
-    pub fn clang_getTranslationUnitCursor(tu: CXTranslationUnit) -> CXCursor;
-    pub fn clang_getTranslationUnitSpelling(tu: CXTranslationUnit) -> CXString;
-    pub fn clang_getTypeDeclaration(type_: CXType) -> CXCursor;
-    pub fn clang_getTypeKindSpelling(type_: CXTypeKind) -> CXString;
-    pub fn clang_getTypeSpelling(type_: CXType) -> CXString;
-    pub fn clang_getTypedefDeclUnderlyingType(cursor: CXCursor) -> CXType;
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_getTypedefName(type_: CXType) -> CXString;
-    pub fn clang_hashCursor(cursor: CXCursor) -> c_uint;
-    pub fn clang_indexLoc_getCXSourceLocation(location: CXIdxLoc) -> CXSourceLocation;
-    pub fn clang_indexLoc_getFileLocation(location: CXIdxLoc, index_file: *mut CXIdxClientFile, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
-    pub fn clang_indexSourceFile(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, index_flags: CXIndexOptFlags, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, tu: *mut CXTranslationUnit, tu_flags: CXTranslationUnit_Flags) -> CXErrorCode;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_indexSourceFileFullArgv(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, index_flags: CXIndexOptFlags, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, tu: *mut CXTranslationUnit, tu_flags: CXTranslationUnit_Flags) -> CXErrorCode;
-    pub fn clang_indexTranslationUnit(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, flags: CXIndexOptFlags, tu: CXTranslationUnit) -> c_int;
-    pub fn clang_index_getCXXClassDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxCXXClassDeclInfo;
-    pub fn clang_index_getClientContainer(info: *const CXIdxContainerInfo) -> CXIdxClientContainer;
-    pub fn clang_index_getClientEntity(info: *const CXIdxEntityInfo) -> CXIdxClientEntity;
-    pub fn clang_index_getIBOutletCollectionAttrInfo(info: *const CXIdxAttrInfo) -> *const CXIdxIBOutletCollectionAttrInfo;
-    pub fn clang_index_getObjCCategoryDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCCategoryDeclInfo;
-    pub fn clang_index_getObjCContainerDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCContainerDeclInfo;
-    pub fn clang_index_getObjCInterfaceDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCInterfaceDeclInfo;
-    pub fn clang_index_getObjCPropertyDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCPropertyDeclInfo;
-    pub fn clang_index_getObjCProtocolRefListInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCProtocolRefListInfo;
-    pub fn clang_index_isEntityObjCContainerKind(info: CXIdxEntityKind) -> c_int;
-    pub fn clang_index_setClientContainer(info: *const CXIdxContainerInfo, container: CXIdxClientContainer);
-    pub fn clang_index_setClientEntity(info: *const CXIdxEntityInfo, entity: CXIdxClientEntity);
-    pub fn clang_isAttribute(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isConstQualifiedType(type_: CXType) -> c_uint;
-    pub fn clang_isCursorDefinition(cursor: CXCursor) -> c_uint;
-    pub fn clang_isDeclaration(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isExpression(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isFileMultipleIncludeGuarded(tu: CXTranslationUnit, file: CXFile) -> c_uint;
-    pub fn clang_isFunctionTypeVariadic(type_: CXType) -> c_uint;
-    pub fn clang_isInvalid(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isPODType(type_: CXType) -> c_uint;
-    pub fn clang_isPreprocessing(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isReference(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isRestrictQualifiedType(type_: CXType) -> c_uint;
-    pub fn clang_isStatement(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isTranslationUnit(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isUnexposed(kind: CXCursorKind) -> c_uint;
-    pub fn clang_isVirtualBase(cursor: CXCursor) -> c_uint;
-    pub fn clang_isVolatileQualifiedType(type_: CXType) -> c_uint;
-    pub fn clang_loadDiagnostics(file: *const c_char, error: *mut CXLoadDiag_Error, message: *mut CXString) -> CXDiagnosticSet;
-    pub fn clang_parseTranslationUnit(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags) -> CXTranslationUnit;
-    pub fn clang_parseTranslationUnit2(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags, tu: *mut CXTranslationUnit) -> CXErrorCode;
-    #[cfg(feature="gte_clang_3_8")]
-    pub fn clang_parseTranslationUnit2FullArgv(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags, tu: *mut CXTranslationUnit) -> CXErrorCode;
-    pub fn clang_remap_dispose(remapping: CXRemapping);
-    pub fn clang_remap_getFilenames(remapping: CXRemapping, index: c_uint, original: *mut CXString, transformed: *mut CXString);
-    pub fn clang_remap_getNumFiles(remapping: CXRemapping) -> c_uint;
-    pub fn clang_reparseTranslationUnit(tu: CXTranslationUnit, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile, flags: CXReparse_Flags) -> CXErrorCode;
-    pub fn clang_saveTranslationUnit(tu: CXTranslationUnit, file: *const c_char, options: CXSaveTranslationUnit_Flags) -> CXSaveError;
-    pub fn clang_sortCodeCompletionResults(results: *mut CXCompletionResult, n_results: c_uint);
-    #[cfg(feature="gte_clang_5_0")]
-    pub fn clang_suspendTranslationUnit(tu: CXTranslationUnit) -> c_uint;
-    pub fn clang_toggleCrashRecovery(recovery: c_uint);
-    pub fn clang_tokenize(tu: CXTranslationUnit, range: CXSourceRange, tokens: *mut *mut CXToken, n_tokens: *mut c_uint);
-    pub fn clang_visitChildren(cursor: CXCursor, visitor: CXCursorVisitor, data: CXClientData) -> c_uint;
-
-    // Documentation
-    pub fn clang_BlockCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
-    pub fn clang_BlockCommandComment_getCommandName(comment: CXComment) -> CXString;
-    pub fn clang_BlockCommandComment_getNumArgs(comment: CXComment) -> c_uint;
-    pub fn clang_BlockCommandComment_getParagraph(comment: CXComment) -> CXComment;
-    pub fn clang_Comment_getChild(comment: CXComment, index: c_uint) -> CXComment;
-    pub fn clang_Comment_getKind(comment: CXComment) -> CXCommentKind;
-    pub fn clang_Comment_getNumChildren(comment: CXComment) -> c_uint;
-    pub fn clang_Comment_isWhitespace(comment: CXComment) -> c_uint;
-    pub fn clang_Cursor_getParsedComment(C: CXCursor) -> CXComment;
-    pub fn clang_FullComment_getAsHTML(comment: CXComment) -> CXString;
-    pub fn clang_FullComment_getAsXML(comment: CXComment) -> CXString;
-    pub fn clang_HTMLStartTagComment_isSelfClosing(comment: CXComment) -> c_uint;
-    pub fn clang_HTMLStartTag_getAttrName(comment: CXComment, index: c_uint) -> CXString;
-    pub fn clang_HTMLStartTag_getAttrValue(comment: CXComment, index: c_uint) -> CXString;
-    pub fn clang_HTMLStartTag_getNumAttrs(comment: CXComment) -> c_uint;
-    pub fn clang_HTMLTagComment_getAsString(comment: CXComment) -> CXString;
-    pub fn clang_HTMLTagComment_getTagName(comment: CXComment) -> CXString;
-    pub fn clang_InlineCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
-    pub fn clang_InlineCommandComment_getCommandName(comment: CXComment) -> CXString;
-    pub fn clang_InlineCommandComment_getNumArgs(comment: CXComment) -> c_uint;
-    pub fn clang_InlineCommandComment_getRenderKind(comment: CXComment) -> CXCommentInlineCommandRenderKind;
-    pub fn clang_InlineContentComment_hasTrailingNewline(comment: CXComment) -> c_uint;
-    pub fn clang_ParamCommandComment_getDirection(comment: CXComment) -> CXCommentParamPassDirection;
-    pub fn clang_ParamCommandComment_getParamIndex(comment: CXComment) -> c_uint;
-    pub fn clang_ParamCommandComment_getParamName(comment: CXComment) -> CXString;
-    pub fn clang_ParamCommandComment_isDirectionExplicit(comment: CXComment) -> c_uint;
-    pub fn clang_ParamCommandComment_isParamIndexValid(comment: CXComment) -> c_uint;
-    pub fn clang_TParamCommandComment_getDepth(comment: CXComment) -> c_uint;
-    pub fn clang_TParamCommandComment_getIndex(comment: CXComment, depth: c_uint) -> c_uint;
-    pub fn clang_TParamCommandComment_getParamName(comment: CXComment) -> CXString;
-    pub fn clang_TParamCommandComment_isParamPositionValid(comment: CXComment) -> c_uint;
-    pub fn clang_TextComment_getText(comment: CXComment) -> CXString;
-    pub fn clang_VerbatimBlockLineComment_getText(comment: CXComment) -> CXString;
-    pub fn clang_VerbatimLineComment_getText(comment: CXComment) -> CXString;
-}
+// Copyright 2016 Kyle Mayes
+//
+// 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