aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2023-06-28 20:30:14 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-06-28 20:30:14 +0000
commita71a310610a778b0e939157316cae7b830e87d9f (patch)
tree558b7ea6c2d2282822360aadafd17afe2939a066
parent02f2edd19337315ec2d2885ffe7e0348814bec92 (diff)
parent3a72dd7a2420c39f5b7e0d1a8e7e2d2f0ee6721b (diff)
downloadbindgen-cli-a71a310610a778b0e939157316cae7b830e87d9f.tar.gz
Update to 0.65.1 am: b836d7a4f2 am: 3a72dd7a24
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/bindgen-cli/+/2623219 Change-Id: Ic3a7aa2fe837b166ff3b8b8e5a148a1e6b8d16fa Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp2
-rw-r--r--Cargo.lock350
-rw-r--r--Cargo.toml10
-rw-r--r--Cargo.toml.orig9
-rw-r--r--METADATA12
-rw-r--r--options.rs186
7 files changed, 369 insertions, 202 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index f8bde5b..1c73fbf 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
{
"git": {
- "sha1": "c51591941e18a75c312c7c237c4969dd22c40467"
+ "sha1": "7d243056d335fdc4537f7bca73c06d01aae24ddc"
},
"path_in_vcs": "bindgen-cli"
} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 42ade34..406570b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -22,7 +22,7 @@ rust_binary_host {
name: "bindgen",
crate_name: "bindgen",
cargo_env_compat: true,
- cargo_pkg_version: "0.64.0",
+ cargo_pkg_version: "0.65.1",
srcs: ["main.rs"],
edition: "2018",
features: [
diff --git a/Cargo.lock b/Cargo.lock
index c09ce78..cdff447 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12,22 +12,62 @@ dependencies = [
]
[[package]]
-name = "atty"
-version = "0.2.14"
+name = "annotate-snippets"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36"
dependencies = [
- "hermit-abi 0.1.19",
- "libc",
- "winapi",
+ "unicode-width",
+ "yansi-term",
+]
+
+[[package]]
+name = "anstream"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-wincon",
+ "concolor-override",
+ "concolor-query",
+ "is-terminal",
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2"
+
+[[package]]
+name = "anstyle-parse"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa"
+dependencies = [
+ "anstyle",
+ "windows-sys 0.45.0",
]
[[package]]
name = "bindgen"
-version = "0.64.0"
+version = "0.65.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
+checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
dependencies = [
+ "annotate-snippets",
"bitflags",
"cexpr",
"clang-sys",
@@ -35,6 +75,7 @@ dependencies = [
"lazycell",
"log",
"peeking_take_while",
+ "prettyplease",
"proc-macro2",
"quote",
"regex",
@@ -46,7 +87,7 @@ dependencies = [
[[package]]
name = "bindgen-cli"
-version = "0.64.0"
+version = "0.65.1"
dependencies = [
"bindgen",
"clap",
@@ -84,9 +125,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clang-sys"
-version = "1.4.0"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3"
+checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
dependencies = [
"glob",
"libc",
@@ -95,27 +136,35 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.1.4"
+version = "4.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76"
+checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3"
dependencies = [
- "bitflags",
+ "clap_builder",
"clap_derive",
- "clap_lex",
- "is-terminal",
"once_cell",
+]
+
+[[package]]
+name = "clap_builder"
+version = "4.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "bitflags",
+ "clap_lex",
"strsim",
- "termcolor",
]
[[package]]
name = "clap_derive"
-version = "4.1.0"
+version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"
+checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4"
dependencies = [
"heck",
- "proc-macro-error",
"proc-macro2",
"quote",
"syn",
@@ -123,11 +172,23 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.3.1"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade"
+checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
+
+[[package]]
+name = "concolor-override"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f"
+
+[[package]]
+name = "concolor-query"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf"
dependencies = [
- "os_str_bytes",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -138,12 +199,12 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "env_logger"
-version = "0.9.3"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
+checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
dependencies = [
- "atty",
"humantime",
+ "is-terminal",
"log",
"regex",
"termcolor",
@@ -151,13 +212,13 @@ dependencies = [
[[package]]
name = "errno"
-version = "0.2.8"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
+checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
dependencies = [
"errno-dragonfly",
"libc",
- "winapi",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -184,18 +245,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hermit-abi"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01"
+checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "humantime"
@@ -205,24 +257,25 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "io-lifetimes"
-version = "1.0.5"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
+checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
dependencies = [
+ "hermit-abi",
"libc",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
name = "is-terminal"
-version = "0.4.3"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef"
+checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"
dependencies = [
- "hermit-abi 0.3.0",
+ "hermit-abi",
"io-lifetimes",
"rustix",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -239,9 +292,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
-version = "0.2.139"
+version = "0.2.141"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
+checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
[[package]]
name = "libloading"
@@ -255,9 +308,9 @@ dependencies = [
[[package]]
name = "linux-raw-sys"
-version = "0.1.4"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
+checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f"
[[package]]
name = "log"
@@ -292,15 +345,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.17.0"
+version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
-
-[[package]]
-name = "os_str_bytes"
-version = "6.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "peeking_take_while"
@@ -309,52 +356,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
+name = "prettyplease"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058"
dependencies = [
- "proc-macro-error-attr",
"proc-macro2",
- "quote",
"syn",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2",
- "quote",
- "version_check",
]
[[package]]
name = "proc-macro2"
-version = "1.0.51"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
+checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.23"
+version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
+checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "regex"
-version = "1.7.1"
+version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
+checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [
"aho-corasick",
"memchr",
@@ -363,9 +396,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.6.28"
+version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
+checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "rustc-hash"
@@ -375,16 +408,16 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustix"
-version = "0.36.8"
+version = "0.37.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
+checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
- "windows-sys",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -401,9 +434,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
-version = "1.0.107"
+version = "2.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
+checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec"
dependencies = [
"proc-macro2",
"quote",
@@ -421,15 +454,21 @@ dependencies = [
[[package]]
name = "unicode-ident"
-version = "1.0.6"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
+checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
-name = "version_check"
-version = "0.9.4"
+name = "unicode-width"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
+
+[[package]]
+name = "utf8parse"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "which"
@@ -479,62 +518,137 @@ version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
- "windows-targets",
+ "windows-targets 0.42.2",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.0",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
+dependencies = [
+ "windows_aarch64_gnullvm 0.42.2",
+ "windows_aarch64_msvc 0.42.2",
+ "windows_i686_gnu 0.42.2",
+ "windows_i686_msvc 0.42.2",
+ "windows_x86_64_gnu 0.42.2",
+ "windows_x86_64_gnullvm 0.42.2",
+ "windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-targets"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
+checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
dependencies = [
- "windows_aarch64_gnullvm",
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_gnullvm",
- "windows_x86_64_msvc",
+ "windows_aarch64_gnullvm 0.48.0",
+ "windows_aarch64_msvc 0.48.0",
+ "windows_i686_gnu 0.48.0",
+ "windows_i686_msvc 0.48.0",
+ "windows_x86_64_gnu 0.48.0",
+ "windows_x86_64_gnullvm 0.48.0",
+ "windows_x86_64_msvc 0.48.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.42.1"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
+checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.1"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
+checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_gnu"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
+checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_msvc"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
+checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
+checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
+checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.42.1"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
+checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
+
+[[package]]
+name = "yansi-term"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
+dependencies = [
+ "winapi",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 19624ef..4b5f308 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,9 +11,9 @@
[package]
edition = "2018"
-rust-version = "1.60.0"
+rust-version = "1.64.0"
name = "bindgen-cli"
-version = "0.64.0"
+version = "0.65.1"
authors = ["The rust-bindgen project contributors"]
description = "Automatically generates Rust FFI bindings to C and C++ libraries."
homepage = "https://rust-lang.github.io/rust-bindgen/"
@@ -36,9 +36,9 @@ name = "bindgen"
path = "main.rs"
[dependencies.bindgen]
-version = "=0.64.0"
+version = "=0.65.1"
features = [
- "cli",
+ "__cli",
"experimental",
]
@@ -47,7 +47,7 @@ version = "4"
features = ["derive"]
[dependencies.env_logger]
-version = "0.9.0"
+version = "0.10.0"
optional = true
[dependencies.log]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 1399456..731f1be 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -11,20 +11,19 @@ readme = "../README.md"
repository = "https://github.com/rust-lang/rust-bindgen"
documentation = "https://docs.rs/bindgen"
homepage = "https://rust-lang.github.io/rust-bindgen/"
-version = "0.64.0"
+version = "0.65.1"
edition = "2018"
-# If you change this, also update README.md and msrv in .github/workflows/bindgen.yml
-rust-version = "1.60.0"
+rust-version = "1.64.0"
[[bin]]
path = "main.rs"
name = "bindgen"
[dependencies]
-bindgen = { path = "../bindgen", version = "=0.64.0", features = ["cli", "experimental"] }
+bindgen = { path = "../bindgen", version = "=0.65.1", features = ["__cli", "experimental"] }
shlex = "1"
clap = { version = "4", features = ["derive"] }
-env_logger = { version = "0.9.0", optional = true }
+env_logger = { version = "0.10.0", optional = true }
log = { version = "0.4", optional = true }
[features]
diff --git a/METADATA b/METADATA
index b07a3c8..87b6252 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/bindgen-cli
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
name: "bindgen-cli"
description: "Automatically generates Rust FFI bindings to C and C++ libraries."
third_party {
@@ -7,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/bindgen-cli/bindgen-cli-0.64.0.crate"
+ value: "https://static.crates.io/crates/bindgen-cli/bindgen-cli-0.65.1.crate"
}
- version: "0.64.0"
+ version: "0.65.1"
license_type: NOTICE
last_upgrade_date {
year: 2023
- month: 2
- day: 16
+ month: 6
+ day: 13
}
}
diff --git a/options.rs b/options.rs
index 458c7ba..1e592ce 100644
--- a/options.rs
+++ b/options.rs
@@ -1,8 +1,8 @@
use bindgen::callbacks::TypeKind;
use bindgen::{
builder, AliasVariation, Builder, CodegenConfig, EnumVariation,
- MacroTypeVariation, NonCopyUnionStyle, RegexSet, RustTarget,
- DEFAULT_ANON_FIELDS_PREFIX, RUST_TARGET_STRINGS,
+ FieldVisibilityKind, Formatter, MacroTypeVariation, NonCopyUnionStyle,
+ RegexSet, RustTarget, DEFAULT_ANON_FIELDS_PREFIX, RUST_TARGET_STRINGS,
};
use clap::Parser;
use std::fs::File;
@@ -54,22 +54,22 @@ struct BindgenCommand {
/// The default style of code used to generate enums.
#[arg(long, value_name = "VARIANT")]
default_enum_style: Option<EnumVariation>,
- /// Mark any enum whose name matches <REGEX> as a set of bitfield flags.
+ /// Mark any enum whose name matches REGEX as a set of bitfield flags.
#[arg(long, value_name = "REGEX")]
bitfield_enum: Vec<String>,
- /// Mark any enum whose name matches <REGEX> as a newtype.
+ /// Mark any enum whose name matches REGEX as a newtype.
#[arg(long, value_name = "REGEX")]
newtype_enum: Vec<String>,
- /// Mark any enum whose name matches <REGEX> as a global newtype.
+ /// Mark any enum whose name matches REGEX as a global newtype.
#[arg(long, value_name = "REGEX")]
newtype_global_enum: Vec<String>,
- /// Mark any enum whose name matches <REGEX> as a Rust enum.
+ /// Mark any enum whose name matches REGEX as a Rust enum.
#[arg(long, value_name = "REGEX")]
rustified_enum: Vec<String>,
- /// Mark any enum whose name matches <REGEX> as a series of constants.
+ /// Mark any enum whose name matches REGEX as a series of constants.
#[arg(long, value_name = "REGEX")]
constified_enum: Vec<String>,
- /// Mark any enum whose name matches <regex> as a module of constants.
+ /// Mark any enum whose name matches REGEX as a module of constants.
#[arg(long, value_name = "REGEX")]
constified_enum_module: Vec<String>,
/// The default signed/unsigned type for C macro constants.
@@ -78,34 +78,34 @@ struct BindgenCommand {
/// The default style of code used to generate typedefs.
#[arg(long, value_name = "VARIANT")]
default_alias_style: Option<AliasVariation>,
- /// Mark any typedef alias whose name matches <REGEX> to use normal type aliasing.
+ /// Mark any typedef alias whose name matches REGEX to use normal type aliasing.
#[arg(long, value_name = "REGEX")]
normal_alias: Vec<String>,
- /// Mark any typedef alias whose name matches <REGEX> to have a new type generated for it.
+ /// Mark any typedef alias whose name matches REGEX to have a new type generated for it.
#[arg(long, value_name = "REGEX")]
new_type_alias: Vec<String>,
- /// Mark any typedef alias whose name matches <REGEX> to have a new type with Deref and DerefMut to the inner type.
+ /// Mark any typedef alias whose name matches REGEX to have a new type with Deref and DerefMut to the inner type.
#[arg(long, value_name = "REGEX")]
new_type_alias_deref: Vec<String>,
/// The default style of code used to generate unions with non-Copy members. Note that ManuallyDrop was first stabilized in Rust 1.20.0.
#[arg(long, value_name = "STYLE")]
default_non_copy_union_style: Option<NonCopyUnionStyle>,
- /// Mark any union whose name matches <REGEX> and who has a non-Copy member to use a bindgen-generated wrapper for fields.
+ /// Mark any union whose name matches REGEX and who has a non-Copy member to use a bindgen-generated wrapper for fields.
#[arg(long, value_name = "REGEX")]
bindgen_wrapper_union: Vec<String>,
- /// Mark any union whose name matches <REGEX> and who has a non-Copy member to use ManuallyDrop (stabilized in Rust 1.20.0) for fields.
+ /// Mark any union whose name matches REGEX and who has a non-Copy member to use ManuallyDrop (stabilized in Rust 1.20.0) for fields.
#[arg(long, value_name = "REGEX")]
manually_drop_union: Vec<String>,
- /// Mark <TYPE> as hidden.
+ /// Mark TYPE as hidden.
#[arg(long, value_name = "TYPE")]
blocklist_type: Vec<String>,
- /// Mark <FUNCTION> as hidden.
+ /// Mark FUNCTION as hidden.
#[arg(long, value_name = "FUNCTION")]
blocklist_function: Vec<String>,
- /// Mark <ITEM> as hidden.
+ /// Mark ITEM as hidden.
#[arg(long, value_name = "ITEM")]
blocklist_item: Vec<String>,
- /// Mark <FILE> as hidden.
+ /// Mark FILE as hidden.
#[arg(long, value_name = "FILE")]
blocklist_file: Vec<String>,
/// Avoid generating layout tests for any type.
@@ -129,7 +129,7 @@ struct BindgenCommand {
/// Derive Default on any type.
#[arg(long)]
with_derive_default: bool,
- /// Derive Hash on any type.docstring
+ /// Derive Hash on any type.
#[arg(long)]
with_derive_hash: bool,
/// Derive PartialEq on any type.
@@ -144,7 +144,7 @@ struct BindgenCommand {
/// Derive Ord on any type.
#[arg(long)]
with_derive_ord: bool,
- /// Avoid including doc comments in the output, see: https://github.com/rust-lang/rust-bindgen/issues/426
+ /// Avoid including doc comments in the output, see: <https://github.com/rust-lang/rust-bindgen/issues/426>
#[arg(long)]
no_doc_comments: bool,
/// Disable allowlisting types recursively. This will cause bindgen to emit Rust code that won't compile! See the `bindgen::Builder::allowlist_recursively` method's documentation for details.
@@ -198,7 +198,7 @@ struct BindgenCommand {
/// Suppress insertion of bindgen's version identifier into generated bindings.
#[arg(long)]
disable_header_comment: bool,
- /// Do not generate bindings for functions or methods. This is useful when you only care about struct layouts.docstring
+ /// Do not generate bindings for functions or methods. This is useful when you only care about struct layouts.
#[arg(long)]
ignore_functions: bool,
/// Generate only given items, split by commas. Valid values are `functions`,`types`, `vars`, `methods`, `constructors` and `destructors`.
@@ -219,10 +219,10 @@ struct BindgenCommand {
/// Try to fit macro constants into types smaller than u32/i32
#[arg(long)]
fit_macro_constant_types: bool,
- /// Mark <TYPE> as opaque.
+ /// Mark TYPE as opaque.
#[arg(long, value_name = "TYPE")]
opaque_type: Vec<String>,
- /// Write Rust bindings to <OUTPUT>.
+ /// Write Rust bindings to OUTPUT.
#[arg(long, short, value_name = "OUTPUT")]
output: Option<String>,
/// Add a raw line of Rust code at the beginning of output.
@@ -239,22 +239,19 @@ struct BindgenCommand {
/// Conservatively generate inline namespaces to avoid name conflicts.
#[arg(long)]
conservative_inline_namespaces: bool,
- /// MSVC C++ ABI mangling. DEPRECATED: Has no effect.
- #[arg(long)]
- use_msvc_mangling: bool,
- /// Allowlist all the free-standing functions matching <REGEX>. Other non-allowlisted functions will not be generated.
+ /// Allowlist all the free-standing functions matching REGEX. Other non-allowlisted functions will not be generated.
#[arg(long, value_name = "REGEX")]
allowlist_function: Vec<String>,
/// Generate inline functions.
#[arg(long)]
generate_inline_functions: bool,
- /// Only generate types matching <REGEX>. Other non-allowlisted types will not be generated.
+ /// Only generate types matching REGEX. Other non-allowlisted types will not be generated.
#[arg(long, value_name = "REGEX")]
allowlist_type: Vec<String>,
- /// Allowlist all the free-standing variables matching <REGEX>. Other non-allowlisted variables will not be generated.
+ /// Allowlist all the free-standing variables matching REGEX. Other non-allowlisted variables will not be generated.
#[arg(long, value_name = "REGEX")]
allowlist_var: Vec<String>,
- /// Allowlist all contents of <PATH>.
+ /// Allowlist all contents of PATH.
#[arg(long, value_name = "PATH")]
allowlist_file: Vec<String>,
/// Print verbose error messages.
@@ -266,40 +263,42 @@ struct BindgenCommand {
/// Do not record matching items in the regex sets. This disables reporting of unused items.
#[arg(long)]
no_record_matches: bool,
- /// Ignored - this is enabled by default.
- #[arg(long = "size_t-is-usize")]
- size_t_is_usize: bool,
/// Do not bind size_t as usize (useful on platforms where those types are incompatible).
#[arg(long = "no-size_t-is-usize")]
no_size_t_is_usize: bool,
- /// Do not format the generated bindings with rustfmt.
+ /// Do not format the generated bindings with rustfmt. This option is deprecated, please use
+ /// `--formatter=none` instead.
#[arg(long)]
no_rustfmt_bindings: bool,
- /// Format the generated bindings with rustfmt. DEPRECATED: --rustfmt-bindings is now enabled by default. Disable with --no-rustfmt-bindings.
- #[arg(long)]
- rustfmt_bindings: bool,
- /// The absolute path to the rustfmt configuration file. The configuration file will be used for formatting the bindings. This parameter is incompatible with --no-rustfmt-bindings.
- #[arg(long, value_name = "PATH")]
+ /// Which tool should be used to format the bindings
+ #[arg(
+ long,
+ value_name = "FORMATTER",
+ conflicts_with = "no_rustfmt_bindings"
+ )]
+ formatter: Option<Formatter>,
+ /// The absolute path to the rustfmt configuration file. The configuration file will be used for formatting the bindings. This parameter sets `formatter` to `rustfmt`.
+ #[arg(long, value_name = "PATH", conflicts_with = "no_rustfmt_bindings")]
rustfmt_configuration_file: Option<String>,
- /// Avoid deriving PartialEq for types matching <REGEX>.
+ /// Avoid deriving PartialEq for types matching REGEX.
#[arg(long, value_name = "REGEX")]
no_partialeq: Vec<String>,
- /// Avoid deriving Copy for types matching <REGEX>.
+ /// Avoid deriving Copy and Clone for types matching REGEX.
#[arg(long, value_name = "REGEX")]
no_copy: Vec<String>,
- /// Avoid deriving Debug for types matching <REGEX>.
+ /// Avoid deriving Debug for types matching REGEX.
#[arg(long, value_name = "REGEX")]
no_debug: Vec<String>,
- /// Avoid deriving/implementing Default for types matching <REGEX>.
+ /// Avoid deriving/implementing Default for types matching REGEX.
#[arg(long, value_name = "REGEX")]
no_default: Vec<String>,
- /// Avoid deriving Hash for types matching <REGEX>.
+ /// Avoid deriving Hash for types matching REGEX.
#[arg(long, value_name = "REGEX")]
no_hash: Vec<String>,
- /// Add #[must_use] annotation to types matching <REGEX>.
+ /// Add `#[must_use]` annotation to types matching REGEX.
#[arg(long, value_name = "REGEX")]
must_use_type: Vec<String>,
- /// Enables detecting unexposed attributes in functions (slow). Used to generate #[must_use] annotations.
+ /// Enables detecting unexposed attributes in functions (slow). Used to generate `#[must_use]` annotations.
#[arg(long)]
enable_function_attribute_detection: bool,
/// Use `*const [T; size]` instead of `*const T` for C arrays
@@ -314,6 +313,9 @@ struct BindgenCommand {
/// Require successful linkage to all functions in the library.
#[arg(long)]
dynamic_link_require_all: bool,
+ /// Prefix the name of exported symbols.
+ #[arg(long)]
+ prefix_link_name: Option<String>,
/// Makes generated bindings `pub` only for items if the items are publically accessible in C++.
#[arg(long)]
respect_cxx_access_specs: bool,
@@ -335,22 +337,22 @@ struct BindgenCommand {
/// Deduplicates extern blocks.
#[arg(long)]
merge_extern_blocks: bool,
- /// Overrides the ABI of functions matching <regex>. The <OVERRIDE> value must be of the shape <REGEX>=<ABI> where <ABI> can be one of C, stdcall, fastcall, thiscall, aapcs, win64 or C-unwind.
+ /// Overrides the ABI of functions matching REGEX. The OVERRIDE value must be of the shape REGEX=ABI where ABI can be one of C, stdcall, efiapi, fastcall, thiscall, aapcs, win64 or C-unwind.
#[arg(long, value_name = "OVERRIDE")]
override_abi: Vec<String>,
/// Wrap unsafe operations in unsafe blocks.
#[arg(long)]
wrap_unsafe_ops: bool,
- /// Derive custom traits on any kind of type. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
+ /// Derive custom traits on any kind of type. The CUSTOM value must be of the shape REGEX=DERIVE where DERIVE is a coma-separated list of derive macros.
#[arg(long, value_name = "CUSTOM")]
with_derive_custom: Vec<String>,
- /// Derive custom traits on a `struct`. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
+ /// Derive custom traits on a `struct`. The CUSTOM value must be of the shape REGEX=DERIVE where DERIVE is a coma-separated list of derive macros.
#[arg(long, value_name = "CUSTOM")]
with_derive_custom_struct: Vec<String>,
- /// Derive custom traits on an `enum. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
+ /// Derive custom traits on an `enum. The CUSTOM value must be of the shape REGEX=DERIVE where DERIVE is a coma-separated list of derive macros.
#[arg(long, value_name = "CUSTOM")]
with_derive_custom_enum: Vec<String>,
- /// Derive custom traits on a `union`. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
+ /// Derive custom traits on a `union`. The CUSTOM value must be of the shape REGEX=DERIVE where DERIVE is a coma-separated list of derive macros.
#[arg(long, value_name = "CUSTOM")]
with_derive_custom_union: Vec<String>,
/// Generate wrappers for `static` and `static inline` functions.
@@ -364,6 +366,13 @@ struct BindgenCommand {
/// inline` functions.
#[arg(long, requires = "experimental", value_name = "SUFFIX")]
wrap_static_fns_suffix: Option<String>,
+ /// Set the default visibility of fields, including bitfields and accessor methods for
+ /// bitfields. This flag is ignored if the `--respect-cxx-access-specs` flag is used.
+ #[arg(long, value_name = "VISIBILITY")]
+ default_visibility: Option<FieldVisibilityKind>,
+ /// Whether to emit diagnostics or not.
+ #[arg(long, requires = "experimental")]
+ emit_diagnostics: bool,
/// Enables experimental features.
#[arg(long)]
experimental: bool,
@@ -449,7 +458,6 @@ where
rust_target,
use_core,
conservative_inline_namespaces,
- use_msvc_mangling: _,
allowlist_function,
generate_inline_functions,
allowlist_type,
@@ -458,10 +466,9 @@ where
verbose,
dump_preprocessed_input,
no_record_matches,
- size_t_is_usize: _,
no_size_t_is_usize,
no_rustfmt_bindings,
- rustfmt_bindings: _,
+ formatter,
rustfmt_configuration_file,
no_partialeq,
no_copy,
@@ -474,6 +481,7 @@ where
wasm_import_module_name,
dynamic_loading,
dynamic_link_require_all,
+ prefix_link_name,
respect_cxx_access_specs,
translate_enum_integer_types,
c_naming,
@@ -490,6 +498,8 @@ where
wrap_static_fns,
wrap_static_fns_path,
wrap_static_fns_suffix,
+ default_visibility,
+ emit_diagnostics,
experimental: _,
version,
clang_args,
@@ -498,7 +508,7 @@ where
if version {
println!(
"bindgen {}",
- option_env!("CARGO_PKG_VERSION").unwrap_or("unknown")
+ Some("0.65.1").unwrap_or("unknown")
);
if verbose {
println!("Clang: {}", bindgen::clang_version().full);
@@ -825,19 +835,16 @@ where
}
if no_rustfmt_bindings {
- builder = builder.rustfmt_bindings(false);
+ builder = builder.formatter(Formatter::None);
+ }
+
+ if let Some(formatter) = formatter {
+ builder = builder.formatter(formatter);
}
if let Some(path_str) = rustfmt_configuration_file {
let path = PathBuf::from(path_str);
- if no_rustfmt_bindings {
- return Err(Error::new(
- ErrorKind::Other,
- "Cannot supply both --rustfmt-configuration-file and --no-rustfmt-bindings",
- ));
- }
-
if !path.is_absolute() {
return Err(Error::new(
ErrorKind::Other,
@@ -887,6 +894,28 @@ where
builder = builder.dynamic_link_require_all(true);
}
+ if let Some(prefix_link_name) = prefix_link_name {
+ #[derive(Debug)]
+ struct PrefixLinkNameCallback {
+ prefix: String,
+ }
+
+ impl bindgen::callbacks::ParseCallbacks for PrefixLinkNameCallback {
+ fn generated_link_name_override(
+ &self,
+ item_info: bindgen::callbacks::ItemInfo<'_>,
+ ) -> Option<String> {
+ let mut prefix = self.prefix.clone();
+ prefix.push_str(item_info.name);
+ Some(prefix)
+ }
+ }
+
+ builder = builder.parse_callbacks(Box::new(PrefixLinkNameCallback {
+ prefix: prefix_link_name,
+ }))
+ }
+
if respect_cxx_access_specs {
builder = builder.respect_cxx_access_specs(true);
}
@@ -972,12 +1001,25 @@ where
}
}
- for (custom_derives, kind) in [
- (with_derive_custom, None),
- (with_derive_custom_struct, Some(TypeKind::Struct)),
- (with_derive_custom_enum, Some(TypeKind::Enum)),
- (with_derive_custom_union, Some(TypeKind::Union)),
+ for (custom_derives, kind, name) in [
+ (with_derive_custom, None, "--with-derive-custom"),
+ (
+ with_derive_custom_struct,
+ Some(TypeKind::Struct),
+ "--with-derive-custom-struct",
+ ),
+ (
+ with_derive_custom_enum,
+ Some(TypeKind::Enum),
+ "--with-derive-custom-enum",
+ ),
+ (
+ with_derive_custom_union,
+ Some(TypeKind::Union),
+ "--with-derive-custom-union",
+ ),
] {
+ let name = emit_diagnostics.then_some(name);
for custom_derive in custom_derives {
let (regex, derives) = custom_derive
.rsplit_once('=')
@@ -986,7 +1028,7 @@ where
let mut regex_set = RegexSet::new();
regex_set.insert(regex);
- regex_set.build(false);
+ regex_set.build_with_diagnostics(false, name);
builder = builder.parse_callbacks(Box::new(CustomDeriveCallback {
derives,
@@ -1008,5 +1050,13 @@ where
builder = builder.wrap_static_fns_suffix(suffix);
}
+ if let Some(visibility) = default_visibility {
+ builder = builder.default_visibility(visibility);
+ }
+
+ if emit_diagnostics {
+ builder = builder.emit_diagnostics();
+ }
+
Ok((builder, output, verbose))
}