From 9fa9d2b11ce7a26553bd077f1d8106f5d6a015dc Mon Sep 17 00:00:00 2001 From: Ryan Hunt Date: Mon, 15 Oct 2018 18:02:24 -0500 Subject: [PATCH 1/3] Remove serde_derive dependency, inlining expanded impls into source code This commit removes the dependency on `serde_derive` so that cbindgen doesn't depend on a stale package for OS's like debian. A new file, README.serde_derive is added with instructions on how to regenerate the impls with changes. --- Cargo.lock | 188 +- Cargo.toml | 13 +- README.serde_derive | 25 + src/bindgen/cargo/cargo_lock.rs | 627 +++- src/bindgen/cargo/cargo_metadata.rs | 2110 ++++++++++++- src/bindgen/cargo/cargo_toml.rs | 429 ++- src/bindgen/config.rs | 4328 ++++++++++++++++++++++++++- src/lib.rs | 1 - src/main.rs | 1 - 9 files changed, 7557 insertions(+), 165 deletions(-) create mode 100644 README.serde_derive diff --git a/Cargo.lock b/Cargo.lock index ecd99fd0c..1bae0315d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,53 +3,52 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "atty" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cbindgen" version = "0.6.4" dependencies = [ - "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cfg-if" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clap" -version = "2.31.2" +version = "2.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -59,20 +58,15 @@ name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "dtoa" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -83,33 +77,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "itoa" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.41" +version = "0.2.43" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.4.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "proc-macro2" -version = "0.4.4" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -117,35 +103,35 @@ dependencies = [ [[package]] name = "quote" -version = "0.5.2" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "quote" -version = "0.6.3" +name = "rand" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "rand" -version = "0.5.5" +name = "rand_core" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -166,35 +152,27 @@ name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "serde" -version = "1.0.64" +name = "ryu" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "serde_derive" -version = "1.0.58" +name = "serde" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "serde_json" -version = "1.0.19" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -204,34 +182,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.13.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.14.1" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tempfile" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -239,14 +208,14 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -254,10 +223,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -277,7 +246,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -296,39 +265,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" -"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" -"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" -"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" +"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" +"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682" -"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" -"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" -"checksum proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1fa93823f53cfd0f5ac117b189aed6cfdfb2cfc0a9d82e956dd7927595ed7d46" -"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" -"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" +"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" +"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" -"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" +"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "fba5be06346c5200249c8c8ca4ccba4a09e8747c71c16e420bd359a0db4d8f91" -"checksum serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ac38f51a52a556cd17545798e29536885fb1a3fa63d6399f5ef650f4a7d35901" -"checksum serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "93aee34bb692dde91e602871bc792dd319e489c7308cdbbe5f27cf27c64280f5" +"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" +"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" -"checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101" -"checksum tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b103c6d08d323b92ff42c8ce62abcd83ca8efa7fd5bf7927efefec75f58c76" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" +"checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" -"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" -"checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" +"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" +"checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" +"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index b5fb37b72..52a29bd96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,16 +17,13 @@ travis-ci = { repository = "eqrion/cbindgen" } [dependencies] clap = "2" log = "0.4" -serde = {version = "1.0", features = ["derive"]} +# See issue #203 and README.serde_derive +# serde = {version = "1.0", features = ["derive"]} +serde = {version = "1.0"} serde_json = "1.0" tempfile = "3.0" toml = "0.4" -# Workaround for #203 -- use a version that depends on different syn, quote, and -# proc-macro2 than we do, so their use of proc-macro doesn't infect our binary. -[dependencies.serde_derive] -version = "=1.0.58" - [dependencies.syn] version = "0.14.0" default-features = false @@ -40,3 +37,7 @@ doc = false [lib] name = "cbindgen" path = "src/lib.rs" + +# See issue #203 and README.serde_derive +[features] +serde_derive = [] diff --git a/README.serde_derive b/README.serde_derive new file mode 100644 index 000000000..84a138573 --- /dev/null +++ b/README.serde_derive @@ -0,0 +1,25 @@ +See issue #203 for background on why this exists. + +To update the `impl`s for (1) changes to data structures or (2) updates to `serde` you'll need to do this manual process. + +1. Uncomment the `serde` dependency with `features = ["derive"]` +2. Comment out the `serde` dependency without `features = ["derive"]` +3. Run `cbindgen` through `cargo expand` + +```bash +cargo +nightly rustc --lib --features serde_derive -p cbindgen -- -Z unstable-options --pretty=expanded > expanded.rs +``` + +Note the `--features serde_derive`. This activates `#[serde]` configuration attributes so that `serde_derive` generates correct impls. These attributes cannot be left enabled by default as the rust compiler will complain. + +4. Open `expanded.rs` +5. Find the appropriate `impl`s and copy and paste them into the appropriate `mod`s. + 1. Keep the `impl`s in source file order + 2. Unindent the `impl`s to be aligned properly +6. Update the comments with the version of `serde_derive` used to generate the `impl`s + 1. You can find this in `Cargo.lock` +7. Revert the changes to `Cargo.toml` +8. Delete `expanded.rs` +9. Test your changes + +This is very unfortunate, but it's better than keeping a stale dependency on `serde_derive`. diff --git a/src/bindgen/cargo/cargo_lock.rs b/src/bindgen/cargo/cargo_lock.rs index bc5907117..f7a6259a9 100644 --- a/src/bindgen/cargo/cargo_lock.rs +++ b/src/bindgen/cargo/cargo_lock.rs @@ -29,13 +29,17 @@ impl From for Error { } } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] pub struct Lock { pub root: Option, pub package: Option>, } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] pub struct Package { pub name: String, pub version: String, @@ -51,3 +55,622 @@ pub fn lock(manifest_path: &Path) -> Result { toml::from_str::(&s).map_err(|x| x.into()) } + +// Warning: The following code is autogenerated by serde_derive, don't touch +// unless you know what you're doing. See issue #203 and README.serde_derive +// for more information. + +// Generated from `serde_derive 1.80.0` + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Lock: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Lock { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { __field0, __field1, __ignore, } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 2")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "root" => + _serde::export::Ok(__Field::__field0), + "package" => + _serde::export::Ok(__Field::__field1), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"root" => + _serde::export::Ok(__Field::__field0), + b"package" => + _serde::export::Ok(__Field::__field1), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Lock; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Lock") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Lock with 2 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Lock with 2 elements")); + } + }; + _serde::export::Ok(Lock{root: __field0, + package: + __field1,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option>> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("root")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("package")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("root") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("package") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Lock{root: __field0, + package: + __field1,}) + } + } + const FIELDS: &'static [&'static str] = + &["root", "package"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Lock", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Package: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Package { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __ignore, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 3")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "name" => + _serde::export::Ok(__Field::__field0), + "version" => + _serde::export::Ok(__Field::__field1), + "dependencies" => + _serde::export::Ok(__Field::__field2), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"name" => + _serde::export::Ok(__Field::__field0), + b"version" => + _serde::export::Ok(__Field::__field1), + b"dependencies" => + _serde::export::Ok(__Field::__field2), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Package; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Package") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Package with 3 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Package with 3 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Package with 3 elements")); + } + }; + _serde::export::Ok(Package{name: __field0, + version: + __field1, + dependencies: + __field2,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option>> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("name")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("version")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("dependencies")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("name") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("version") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + match _serde::private::de::missing_field("dependencies") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Package{name: __field0, + version: + __field1, + dependencies: + __field2,}) + } + } + const FIELDS: &'static [&'static str] = + &["name", "version", "dependencies"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Package", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; + diff --git a/src/bindgen/cargo/cargo_metadata.rs b/src/bindgen/cargo/cargo_metadata.rs index 0705a74cf..0e1588594 100644 --- a/src/bindgen/cargo/cargo_metadata.rs +++ b/src/bindgen/cargo/cargo_metadata.rs @@ -18,7 +18,9 @@ use std::str::{from_utf8, Utf8Error}; use serde_json; -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] /// Starting point for metadata returned by `cargo metadata` pub struct Metadata { /// A list of all crates referenced by this crate (and the crate itself) @@ -28,7 +30,9 @@ pub struct Metadata { pub workspace_root: String, } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] /// A crate pub struct Package { /// Name as given in the `Cargo.toml` @@ -46,7 +50,9 @@ pub struct Package { pub manifest_path: String, } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] /// A dependency of the main crate pub struct Dependency { /// Name as given in the `Cargo.toml` @@ -61,7 +67,9 @@ pub struct Dependency { target: Option, } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] /// A single target (lib, bin, example, ...) provided by a crate pub struct Target { /// Name as given in the `Cargo.toml` or generated from the file name @@ -70,7 +78,7 @@ pub struct Target { pub kind: Vec, /// Almost the same as `kind`, except when an example is a library instad of an executable. /// In that case `crate_types` contains things like `rlib` and `dylib` while `kind` is `example` - #[serde(default)] + #[cfg_attr(serde_derive, serde(default))] pub crate_types: Vec, /// Path to the main source file of the target pub src_path: String, @@ -117,3 +125,2095 @@ pub fn metadata(manifest_path: &Path) -> Result { let meta: Metadata = serde_json::from_str(stdout)?; Ok(meta) } + +// Warning: The following code is autogenerated by serde_derive, don't touch +// unless you know what you're doing. See issue #203 and README.serde_derive +// for more information. + +// Generated from `serde_derive 1.80.0` + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Metadata: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Metadata { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __ignore, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 3")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "packages" => + _serde::export::Ok(__Field::__field0), + "version" => + _serde::export::Ok(__Field::__field1), + "workspace_root" => + _serde::export::Ok(__Field::__field2), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"packages" => + _serde::export::Ok(__Field::__field0), + b"version" => + _serde::export::Ok(__Field::__field1), + b"workspace_root" => + _serde::export::Ok(__Field::__field2), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Metadata; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Metadata") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Metadata with 3 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Metadata with 3 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Metadata with 3 elements")); + } + }; + _serde::export::Ok(Metadata{packages: + __field0, + version: + __field1, + workspace_root: + __field2,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("packages")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("version")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("workspace_root")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("packages") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("version") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + match _serde::private::de::missing_field("workspace_root") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Metadata{packages: + __field0, + version: + __field1, + workspace_root: + __field2,}) + } + } + const FIELDS: &'static [&'static str] = + &["packages", "version", "workspace_root"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Metadata", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Package: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Package { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + __field5, + __field6, + __field7, + __ignore, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + 5u64 => + _serde::export::Ok(__Field::__field5), + 6u64 => + _serde::export::Ok(__Field::__field6), + 7u64 => + _serde::export::Ok(__Field::__field7), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 8")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "name" => + _serde::export::Ok(__Field::__field0), + "version" => + _serde::export::Ok(__Field::__field1), + "id" => + _serde::export::Ok(__Field::__field2), + "source" => + _serde::export::Ok(__Field::__field3), + "dependencies" => + _serde::export::Ok(__Field::__field4), + "targets" => + _serde::export::Ok(__Field::__field5), + "features" => + _serde::export::Ok(__Field::__field6), + "manifest_path" => + _serde::export::Ok(__Field::__field7), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"name" => + _serde::export::Ok(__Field::__field0), + b"version" => + _serde::export::Ok(__Field::__field1), + b"id" => + _serde::export::Ok(__Field::__field2), + b"source" => + _serde::export::Ok(__Field::__field3), + b"dependencies" => + _serde::export::Ok(__Field::__field4), + b"targets" => + _serde::export::Ok(__Field::__field5), + b"features" => + _serde::export::Ok(__Field::__field6), + b"manifest_path" => + _serde::export::Ok(__Field::__field7), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Package; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Package") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Package with 8 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Package with 8 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Package with 8 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct Package with 8 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct Package with 8 elements")); + } + }; + let __field5 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(5usize, + &"struct Package with 8 elements")); + } + }; + let __field6 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(6usize, + &"struct Package with 8 elements")); + } + }; + let __field7 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(7usize, + &"struct Package with 8 elements")); + } + }; + _serde::export::Ok(Package{name: __field0, + version: + __field1, + id: __field2, + source: + __field3, + dependencies: + __field4, + targets: + __field5, + features: + __field6, + manifest_path: + __field7,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option> = + _serde::export::None; + let mut __field4: + _serde::export::Option> = + _serde::export::None; + let mut __field5: + _serde::export::Option> = + _serde::export::None; + let mut __field6: + _serde::export::Option>> = + _serde::export::None; + let mut __field7: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("name")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("version")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("id")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("source")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field4 => { + if _serde::export::Option::is_some(&__field4) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("dependencies")); + } + __field4 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field5 => { + if _serde::export::Option::is_some(&__field5) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("targets")); + } + __field5 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field6 => { + if _serde::export::Option::is_some(&__field6) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("features")); + } + __field6 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field7 => { + if _serde::export::Option::is_some(&__field7) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("manifest_path")); + } + __field7 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("name") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("version") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + match _serde::private::de::missing_field("id") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + match _serde::private::de::missing_field("source") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field4 = + match __field4 { + _serde::export::Some(__field4) => + __field4, + _serde::export::None => + match _serde::private::de::missing_field("dependencies") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field5 = + match __field5 { + _serde::export::Some(__field5) => + __field5, + _serde::export::None => + match _serde::private::de::missing_field("targets") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field6 = + match __field6 { + _serde::export::Some(__field6) => + __field6, + _serde::export::None => + match _serde::private::de::missing_field("features") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field7 = + match __field7 { + _serde::export::Some(__field7) => + __field7, + _serde::export::None => + match _serde::private::de::missing_field("manifest_path") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Package{name: __field0, + version: + __field1, + id: __field2, + source: + __field3, + dependencies: + __field4, + targets: + __field5, + features: + __field6, + manifest_path: + __field7,}) + } + } + const FIELDS: &'static [&'static str] = + &["name", "version", "id", "source", + "dependencies", "targets", "features", + "manifest_path"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Package", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Dependency: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Dependency { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + __field5, + __field6, + __field7, + __ignore, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + 5u64 => + _serde::export::Ok(__Field::__field5), + 6u64 => + _serde::export::Ok(__Field::__field6), + 7u64 => + _serde::export::Ok(__Field::__field7), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 8")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "name" => + _serde::export::Ok(__Field::__field0), + "source" => + _serde::export::Ok(__Field::__field1), + "req" => + _serde::export::Ok(__Field::__field2), + "kind" => + _serde::export::Ok(__Field::__field3), + "optional" => + _serde::export::Ok(__Field::__field4), + "uses_default_features" => + _serde::export::Ok(__Field::__field5), + "features" => + _serde::export::Ok(__Field::__field6), + "target" => + _serde::export::Ok(__Field::__field7), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"name" => + _serde::export::Ok(__Field::__field0), + b"source" => + _serde::export::Ok(__Field::__field1), + b"req" => + _serde::export::Ok(__Field::__field2), + b"kind" => + _serde::export::Ok(__Field::__field3), + b"optional" => + _serde::export::Ok(__Field::__field4), + b"uses_default_features" => + _serde::export::Ok(__Field::__field5), + b"features" => + _serde::export::Ok(__Field::__field6), + b"target" => + _serde::export::Ok(__Field::__field7), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Dependency; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Dependency") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Dependency with 8 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Dependency with 8 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Dependency with 8 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct Dependency with 8 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct Dependency with 8 elements")); + } + }; + let __field5 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(5usize, + &"struct Dependency with 8 elements")); + } + }; + let __field6 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(6usize, + &"struct Dependency with 8 elements")); + } + }; + let __field7 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(7usize, + &"struct Dependency with 8 elements")); + } + }; + _serde::export::Ok(Dependency{name: + __field0, + source: + __field1, + req: + __field2, + kind: + __field3, + optional: + __field4, + uses_default_features: + __field5, + features: + __field6, + target: + __field7,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + let mut __field1: + _serde::export::Option> = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option> = + _serde::export::None; + let mut __field4: + _serde::export::Option = + _serde::export::None; + let mut __field5: + _serde::export::Option = + _serde::export::None; + let mut __field6: + _serde::export::Option> = + _serde::export::None; + let mut __field7: + _serde::export::Option> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("name")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("source")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("req")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("kind")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field4 => { + if _serde::export::Option::is_some(&__field4) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("optional")); + } + __field4 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field5 => { + if _serde::export::Option::is_some(&__field5) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("uses_default_features")); + } + __field5 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field6 => { + if _serde::export::Option::is_some(&__field6) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("features")); + } + __field6 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field7 => { + if _serde::export::Option::is_some(&__field7) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("target")); + } + __field7 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("name") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("source") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + match _serde::private::de::missing_field("req") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + match _serde::private::de::missing_field("kind") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field4 = + match __field4 { + _serde::export::Some(__field4) => + __field4, + _serde::export::None => + match _serde::private::de::missing_field("optional") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field5 = + match __field5 { + _serde::export::Some(__field5) => + __field5, + _serde::export::None => + match _serde::private::de::missing_field("uses_default_features") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field6 = + match __field6 { + _serde::export::Some(__field6) => + __field6, + _serde::export::None => + match _serde::private::de::missing_field("features") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field7 = + match __field7 { + _serde::export::Some(__field7) => + __field7, + _serde::export::None => + match _serde::private::de::missing_field("target") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Dependency{name: + __field0, + source: + __field1, + req: + __field2, + kind: + __field3, + optional: + __field4, + uses_default_features: + __field5, + features: + __field6, + target: + __field7,}) + } + } + const FIELDS: &'static [&'static str] = + &["name", "source", "req", "kind", "optional", + "uses_default_features", "features", + "target"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Dependency", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Target: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Target { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __ignore, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 4")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "name" => + _serde::export::Ok(__Field::__field0), + "kind" => + _serde::export::Ok(__Field::__field1), + "crate_types" => + _serde::export::Ok(__Field::__field2), + "src_path" => + _serde::export::Ok(__Field::__field3), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"name" => + _serde::export::Ok(__Field::__field0), + b"kind" => + _serde::export::Ok(__Field::__field1), + b"crate_types" => + _serde::export::Ok(__Field::__field2), + b"src_path" => + _serde::export::Ok(__Field::__field3), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Target; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Target") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Target with 4 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Target with 4 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Target with 4 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct Target with 4 elements")); + } + }; + _serde::export::Ok(Target{name: __field0, + kind: __field1, + crate_types: + __field2, + src_path: + __field3,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + let mut __field1: + _serde::export::Option> = + _serde::export::None; + let mut __field2: + _serde::export::Option> = + _serde::export::None; + let mut __field3: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("name")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("kind")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("crate_types")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("src_path")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("name") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + match _serde::private::de::missing_field("kind") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + _serde::export::Default::default(), + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + match _serde::private::de::missing_field("src_path") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Target{name: __field0, + kind: __field1, + crate_types: + __field2, + src_path: + __field3,}) + } + } + const FIELDS: &'static [&'static str] = + &["name", "kind", "crate_types", "src_path"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Target", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; diff --git a/src/bindgen/cargo/cargo_toml.rs b/src/bindgen/cargo/cargo_toml.rs index cab806320..21927937b 100644 --- a/src/bindgen/cargo/cargo_toml.rs +++ b/src/bindgen/cargo/cargo_toml.rs @@ -29,12 +29,16 @@ impl From for Error { } } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] pub struct Manifest { pub package: Package, } -#[derive(Clone, Deserialize, Debug)] +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +#[derive(Clone, Debug)] pub struct Package { pub name: String, } @@ -47,3 +51,424 @@ pub fn manifest(manifest_path: &Path) -> Result { toml::from_str::(&s).map_err(|x| x.into()) } + +// Warning: The following code is autogenerated by serde_derive, don't touch +// unless you know what you're doing. See issue #203 and README.serde_derive +// for more information. + +// Generated from `serde_derive 1.80.0` + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Manifest: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Manifest { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { __field0, __ignore, } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 1")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "package" => + _serde::export::Ok(__Field::__field0), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"package" => + _serde::export::Ok(__Field::__field0), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Manifest; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Manifest") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Manifest with 1 element")); + } + }; + _serde::export::Ok(Manifest{package: + __field0,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("package")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("package") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Manifest{package: + __field0,}) + } + } + const FIELDS: &'static [&'static str] = + &["package"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Manifest", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Package: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val + , _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) + ; } } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Package { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { __field0, __ignore, } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for + __FieldVisitor { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 1")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + "name" => + _serde::export::Ok(__Field::__field0), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result + where __E: _serde::de::Error { + match __value { + b"name" => + _serde::export::Ok(__Field::__field0), + _ => { + _serde::export::Ok(__Field::__ignore) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result + where __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for + __Visitor<'de> { + type + Value + = + Package; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Package") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Package with 1 element")); + } + }; + _serde::export::Ok(Package{name: + __field0,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("name")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }); + } + _ => { + let _ = + match _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map) + { + _serde::export::Ok(__val) + => __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }; + } + } + } + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + match _serde::private::de::missing_field("name") + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => + { + return _serde::export::Err(__err); + } + }, + }; + _serde::export::Ok(Package{name: + __field0,}) + } + } + const FIELDS: &'static [&'static str] = &["name"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "Package", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; diff --git a/src/bindgen/config.rs b/src/bindgen/config.rs index 41679f194..c462f7bfe 100644 --- a/src/bindgen/config.rs +++ b/src/bindgen/config.rs @@ -177,11 +177,14 @@ impl FromStr for ItemType { deserialize_enum_str!(ItemType); +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply when exporting items. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct ExportConfig { /// A list of additional items not used by exported functions to include in /// the generated bindings @@ -223,11 +226,14 @@ impl ExportConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply to generated functions. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct FunctionConfig { /// Optional text to output before each function declaration pub prefix: Option, @@ -266,11 +272,14 @@ impl FunctionConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply to generated structs. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct StructConfig { /// The rename rule to apply to the name of struct fields pub rename_fields: Option, @@ -351,11 +360,14 @@ impl StructConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply to generated enums. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct EnumConfig { /// The rename rule to apply to the name of enum variants pub rename_variants: Option, @@ -395,11 +407,14 @@ impl EnumConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply to generated constants. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct ConstantConfig { /// Whether a generated constant can be a static const in C++ mode. pub allow_static_const: bool, @@ -413,11 +428,14 @@ impl Default for ConstantConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply when running `rustc --pretty=expanded` -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct ParseExpandConfig { /// The names of crates to parse with `rustc --pretty=expanded` pub crates: Vec, @@ -479,11 +497,14 @@ fn retrocomp_parse_expand_config_deserialize<'de, D: Deserializer<'de>>( deserializer.deserialize_any(ParseExpandVisitor) } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// Settings to apply when parsing. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct ParseConfig { /// Whether to parse dependencies when generating bindings. When this is true, /// each dependent crate is found using a combination of `cargo metadata` and @@ -499,7 +520,7 @@ pub struct ParseConfig { /// The names of crates to not parse pub exclude: Vec, /// The configuration options for `rustc --pretty=expanded` - #[serde(deserialize_with = "retrocomp_parse_expand_config_deserialize")] + #[cfg_attr(serde_derive, serde(deserialize_with = "retrocomp_parse_expand_config_deserialize"))] pub expand: ParseExpandConfig, /// Whether to use a new temporary target directory when running `rustc --pretty=expanded`. /// This may be required for some build processes. @@ -518,11 +539,14 @@ impl Default for ParseConfig { } } +// Warning: Do not change this without regenerating serde_derive impls. +// See issue #203 and README.serde_derive for more information. +// /// A collection of settings to customize the generated bindings. -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(deny_unknown_fields)] -#[serde(default)] +#[derive(Debug, Clone)] +#[cfg_attr(serde_derive, serde(rename_all = "snake_case"))] +#[cfg_attr(serde_derive, serde(deny_unknown_fields))] +#[cfg_attr(serde_derive, serde(default))] pub struct Config { /// Optional text to output at the beginning of the file pub header: Option, @@ -562,16 +586,16 @@ pub struct Config { /// The configuration options for exporting pub export: ExportConfig, /// The configuration options for functions - #[serde(rename = "fn")] + #[cfg_attr(serde_derive, serde(rename = "fn"))] pub function: FunctionConfig, /// The configuration options for structs - #[serde(rename = "struct")] + #[cfg_attr(serde_derive, serde(rename = "struct"))] pub structure: StructConfig, /// The configuration options for enums - #[serde(rename = "enum")] + #[cfg_attr(serde_derive, serde(rename = "enum"))] pub enumeration: EnumConfig, /// The configuration options for constants - #[serde(rename = "const")] + #[cfg_attr(serde_derive, serde(rename = "const"))] pub constant: ConstantConfig, /// Preprocessor defines to use when generating #ifdef's for #[cfg] pub defines: HashMap, @@ -637,3 +661,4233 @@ impl Config { } } } + +// Warning: The following code is autogenerated by serde_derive, don't touch +// unless you know what you're doing. See issue #203 and README.serde_derive +// for more information. + +// Generated from `serde_derive 1.80.0` + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_ExportConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for ExportConfig where + ExportConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 5")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "include" => + _serde::export::Ok(__Field::__field0), + "exclude" => + _serde::export::Ok(__Field::__field1), + "rename" => + _serde::export::Ok(__Field::__field2), + "prefix" => + _serde::export::Ok(__Field::__field3), + "item_types" => + _serde::export::Ok(__Field::__field4), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"include" => + _serde::export::Ok(__Field::__field0), + b"exclude" => + _serde::export::Ok(__Field::__field1), + b"rename" => + _serde::export::Ok(__Field::__field2), + b"prefix" => + _serde::export::Ok(__Field::__field3), + b"item_types" => + _serde::export::Ok(__Field::__field4), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + ExportConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where ExportConfig<>: _serde::export::Default { + type + Value + = + ExportConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct ExportConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct ExportConfig with 5 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct ExportConfig with 5 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct ExportConfig with 5 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct ExportConfig with 5 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct ExportConfig with 5 elements")); + } + }; + _serde::export::Ok(ExportConfig{include: + __field0, + exclude: + __field1, + rename: + __field2, + prefix: + __field3, + item_types: + __field4,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option> = + _serde::export::None; + let mut __field2: + _serde::export::Option> = + _serde::export::None; + let mut __field3: + _serde::export::Option> = + _serde::export::None; + let mut __field4: + _serde::export::Option> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("include")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("exclude")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("rename")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("prefix")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field4 => { + if _serde::export::Option::is_some(&__field4) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("item_types")); + } + __field4 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.include, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.exclude, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.rename, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.prefix, + }; + let __field4 = + match __field4 { + _serde::export::Some(__field4) => + __field4, + _serde::export::None => + __default.item_types, + }; + _serde::export::Ok(ExportConfig{include: + __field0, + exclude: + __field1, + rename: + __field2, + prefix: + __field3, + item_types: + __field4,}) + } + } + const FIELDS: &'static [&'static str] = + &["include", "exclude", "rename", "prefix", + "item_types"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "ExportConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; + +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_FunctionConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for FunctionConfig where + FunctionConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 4")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "prefix" => + _serde::export::Ok(__Field::__field0), + "postfix" => + _serde::export::Ok(__Field::__field1), + "args" => + _serde::export::Ok(__Field::__field2), + "rename_args" => + _serde::export::Ok(__Field::__field3), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"prefix" => + _serde::export::Ok(__Field::__field0), + b"postfix" => + _serde::export::Ok(__Field::__field1), + b"args" => + _serde::export::Ok(__Field::__field2), + b"rename_args" => + _serde::export::Ok(__Field::__field3), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + FunctionConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where FunctionConfig<>: _serde::export::Default { + type + Value + = + FunctionConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct FunctionConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct FunctionConfig with 4 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct FunctionConfig with 4 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct FunctionConfig with 4 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct FunctionConfig with 4 elements")); + } + }; + _serde::export::Ok(FunctionConfig{prefix: + __field0, + postfix: + __field1, + args: + __field2, + rename_args: + __field3,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option> = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("prefix")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("postfix")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("args")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("rename_args")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.prefix, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.postfix, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.args, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.rename_args, + }; + _serde::export::Ok(FunctionConfig{prefix: + __field0, + postfix: + __field1, + args: + __field2, + rename_args: + __field3,}) + } + } + const FIELDS: &'static [&'static str] = + &["prefix", "postfix", "args", "rename_args"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "FunctionConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_StructConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for StructConfig where + StructConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + __field5, + __field6, + __field7, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + 5u64 => + _serde::export::Ok(__Field::__field5), + 6u64 => + _serde::export::Ok(__Field::__field6), + 7u64 => + _serde::export::Ok(__Field::__field7), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 8")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "rename_fields" => + _serde::export::Ok(__Field::__field0), + "derive_constructor" => + _serde::export::Ok(__Field::__field1), + "derive_eq" => + _serde::export::Ok(__Field::__field2), + "derive_neq" => + _serde::export::Ok(__Field::__field3), + "derive_lt" => + _serde::export::Ok(__Field::__field4), + "derive_lte" => + _serde::export::Ok(__Field::__field5), + "derive_gt" => + _serde::export::Ok(__Field::__field6), + "derive_gte" => + _serde::export::Ok(__Field::__field7), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"rename_fields" => + _serde::export::Ok(__Field::__field0), + b"derive_constructor" => + _serde::export::Ok(__Field::__field1), + b"derive_eq" => + _serde::export::Ok(__Field::__field2), + b"derive_neq" => + _serde::export::Ok(__Field::__field3), + b"derive_lt" => + _serde::export::Ok(__Field::__field4), + b"derive_lte" => + _serde::export::Ok(__Field::__field5), + b"derive_gt" => + _serde::export::Ok(__Field::__field6), + b"derive_gte" => + _serde::export::Ok(__Field::__field7), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + StructConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where StructConfig<>: _serde::export::Default { + type + Value + = + StructConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct StructConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field5 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(5usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field6 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(6usize, + &"struct StructConfig with 8 elements")); + } + }; + let __field7 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(7usize, + &"struct StructConfig with 8 elements")); + } + }; + _serde::export::Ok(StructConfig{rename_fields: + __field0, + derive_constructor: + __field1, + derive_eq: + __field2, + derive_neq: + __field3, + derive_lt: + __field4, + derive_lte: + __field5, + derive_gt: + __field6, + derive_gte: + __field7,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option = + _serde::export::None; + let mut __field4: + _serde::export::Option = + _serde::export::None; + let mut __field5: + _serde::export::Option = + _serde::export::None; + let mut __field6: + _serde::export::Option = + _serde::export::None; + let mut __field7: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("rename_fields")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_constructor")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_eq")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_neq")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field4 => { + if _serde::export::Option::is_some(&__field4) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_lt")); + } + __field4 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field5 => { + if _serde::export::Option::is_some(&__field5) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_lte")); + } + __field5 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field6 => { + if _serde::export::Option::is_some(&__field6) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_gt")); + } + __field6 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field7 => { + if _serde::export::Option::is_some(&__field7) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_gte")); + } + __field7 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.rename_fields, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.derive_constructor, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.derive_eq, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.derive_neq, + }; + let __field4 = + match __field4 { + _serde::export::Some(__field4) => + __field4, + _serde::export::None => + __default.derive_lt, + }; + let __field5 = + match __field5 { + _serde::export::Some(__field5) => + __field5, + _serde::export::None => + __default.derive_lte, + }; + let __field6 = + match __field6 { + _serde::export::Some(__field6) => + __field6, + _serde::export::None => + __default.derive_gt, + }; + let __field7 = + match __field7 { + _serde::export::Some(__field7) => + __field7, + _serde::export::None => + __default.derive_gte, + }; + _serde::export::Ok(StructConfig{rename_fields: + __field0, + derive_constructor: + __field1, + derive_eq: + __field2, + derive_neq: + __field3, + derive_lt: + __field4, + derive_lte: + __field5, + derive_gt: + __field6, + derive_gte: + __field7,}) + } + } + const FIELDS: &'static [&'static str] = + &["rename_fields", "derive_constructor", + "derive_eq", "derive_neq", "derive_lt", + "derive_lte", "derive_gt", "derive_gte"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "StructConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_EnumConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for EnumConfig where + EnumConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 4")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "rename_variants" => + _serde::export::Ok(__Field::__field0), + "add_sentinel" => + _serde::export::Ok(__Field::__field1), + "prefix_with_name" => + _serde::export::Ok(__Field::__field2), + "derive_helper_methods" => + _serde::export::Ok(__Field::__field3), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"rename_variants" => + _serde::export::Ok(__Field::__field0), + b"add_sentinel" => + _serde::export::Ok(__Field::__field1), + b"prefix_with_name" => + _serde::export::Ok(__Field::__field2), + b"derive_helper_methods" => + _serde::export::Ok(__Field::__field3), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + EnumConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where EnumConfig<>: _serde::export::Default { + type + Value + = + EnumConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct EnumConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct EnumConfig with 4 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct EnumConfig with 4 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct EnumConfig with 4 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct EnumConfig with 4 elements")); + } + }; + _serde::export::Ok(EnumConfig{rename_variants: + __field0, + add_sentinel: + __field1, + prefix_with_name: + __field2, + derive_helper_methods: + __field3,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("rename_variants")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("add_sentinel")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("prefix_with_name")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("derive_helper_methods")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.rename_variants, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.add_sentinel, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.prefix_with_name, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.derive_helper_methods, + }; + _serde::export::Ok(EnumConfig{rename_variants: + __field0, + add_sentinel: + __field1, + prefix_with_name: + __field2, + derive_helper_methods: + __field3,}) + } + } + const FIELDS: &'static [&'static str] = + &["rename_variants", "add_sentinel", + "prefix_with_name", "derive_helper_methods"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "EnumConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_ConstantConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for ConstantConfig where + ConstantConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { __field0, } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 1")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "allow_static_const" => + _serde::export::Ok(__Field::__field0), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"allow_static_const" => + _serde::export::Ok(__Field::__field0), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + ConstantConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where ConstantConfig<>: _serde::export::Default { + type + Value + = + ConstantConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct ConstantConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct ConstantConfig with 1 element")); + } + }; + _serde::export::Ok(ConstantConfig{allow_static_const: + __field0,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("allow_static_const")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.allow_static_const, + }; + _serde::export::Ok(ConstantConfig{allow_static_const: + __field0,}) + } + } + const FIELDS: &'static [&'static str] = + &["allow_static_const"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "ConstantConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_ParseExpandConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for ParseExpandConfig + where ParseExpandConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 4")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "crates" => + _serde::export::Ok(__Field::__field0), + "all_features" => + _serde::export::Ok(__Field::__field1), + "default_features" => + _serde::export::Ok(__Field::__field2), + "features" => + _serde::export::Ok(__Field::__field3), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"crates" => + _serde::export::Ok(__Field::__field0), + b"all_features" => + _serde::export::Ok(__Field::__field1), + b"default_features" => + _serde::export::Ok(__Field::__field2), + b"features" => + _serde::export::Ok(__Field::__field3), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + ParseExpandConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where ParseExpandConfig<>: _serde::export::Default { + type + Value + = + ParseExpandConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct ParseExpandConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct ParseExpandConfig with 4 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct ParseExpandConfig with 4 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct ParseExpandConfig with 4 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct ParseExpandConfig with 4 elements")); + } + }; + _serde::export::Ok(ParseExpandConfig{crates: + __field0, + all_features: + __field1, + default_features: + __field2, + features: + __field3,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option> = + _serde::export::None; + let mut __field1: + _serde::export::Option = + _serde::export::None; + let mut __field2: + _serde::export::Option = + _serde::export::None; + let mut __field3: + _serde::export::Option>> = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("crates")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("all_features")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("default_features")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("features")); + } + __field3 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.crates, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.all_features, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.default_features, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.features, + }; + _serde::export::Ok(ParseExpandConfig{crates: + __field0, + all_features: + __field1, + default_features: + __field2, + features: + __field3,}) + } + } + const FIELDS: &'static [&'static str] = + &["crates", "all_features", "default_features", + "features"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "ParseExpandConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_ParseConfig: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for ParseConfig where + ParseConfig<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 5")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "parse_deps" => + _serde::export::Ok(__Field::__field0), + "include" => + _serde::export::Ok(__Field::__field1), + "exclude" => + _serde::export::Ok(__Field::__field2), + "expand" => + _serde::export::Ok(__Field::__field3), + "clean" => + _serde::export::Ok(__Field::__field4), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"parse_deps" => + _serde::export::Ok(__Field::__field0), + b"include" => + _serde::export::Ok(__Field::__field1), + b"exclude" => + _serde::export::Ok(__Field::__field2), + b"expand" => + _serde::export::Ok(__Field::__field3), + b"clean" => + _serde::export::Ok(__Field::__field4), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + ParseConfig<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where ParseConfig<>: _serde::export::Default { + type + Value + = + ParseConfig; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct ParseConfig") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct ParseConfig with 5 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct ParseConfig with 5 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct ParseConfig with 5 elements")); + } + }; + let __field3 = + match { + struct __DeserializeWith<'de> + where + ParseConfig<>: _serde::export::Default { + value: ParseExpandConfig, + phantom: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> + _serde::Deserialize<'de> for + __DeserializeWith<'de> where + ParseConfig<>: _serde::export::Default + { + fn deserialize<__D>(__deserializer: + __D) + -> + _serde::export::Result + where + __D: _serde::Deserializer<'de> { + _serde::export::Ok(__DeserializeWith{value: + match retrocomp_parse_expand_config_deserialize(__deserializer) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }, + phantom: + _serde::export::PhantomData, + lifetime: + _serde::export::PhantomData,}) + } + } + _serde::export::Option::map(match _serde::de::SeqAccess::next_element::<__DeserializeWith<'de>>(&mut __seq) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }, + |__wrap| + __wrap.value) + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct ParseConfig with 5 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct ParseConfig with 5 elements")); + } + }; + _serde::export::Ok(ParseConfig{parse_deps: + __field0, + include: + __field1, + exclude: + __field2, + expand: + __field3, + clean: + __field4,}) + } + #[inline] + fn visit_map<__A>(self, mut __map: __A) + -> + _serde::export::Result where + __A: _serde::de::MapAccess<'de> { + let mut __field0: + _serde::export::Option = + _serde::export::None; + let mut __field1: + _serde::export::Option>> = + _serde::export::None; + let mut __field2: + _serde::export::Option> = + _serde::export::None; + let mut __field3: + _serde::export::Option = + _serde::export::None; + let mut __field4: + _serde::export::Option = + _serde::export::None; + while let _serde::export::Some(__key) = + match _serde::de::MapAccess::next_key::<__Field>(&mut __map) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("parse_deps")); + } + __field0 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("include")); + } + __field1 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field2 => { + if _serde::export::Option::is_some(&__field2) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("exclude")); + } + __field2 = + _serde::export::Some(match _serde::de::MapAccess::next_value::>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + __Field::__field3 => { + if _serde::export::Option::is_some(&__field3) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("expand")); + } + __field3 = + _serde::export::Some({ + struct __DeserializeWith<'de> + where + ParseConfig<>: _serde::export::Default { + value: ParseExpandConfig, + phantom: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> + _serde::Deserialize<'de> + for + __DeserializeWith<'de> + where + ParseConfig<>: _serde::export::Default + { + fn deserialize<__D>(__deserializer: + __D) + -> + _serde::export::Result + where + __D: _serde::Deserializer<'de> { + _serde::export::Ok(__DeserializeWith{value: + match retrocomp_parse_expand_config_deserialize(__deserializer) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }, + phantom: + _serde::export::PhantomData, + lifetime: + _serde::export::PhantomData,}) + } + } + match _serde::de::MapAccess::next_value::<__DeserializeWith<'de>>(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => + { + return _serde::export::Err(__err); + } + }.value + }); + } + __Field::__field4 => { + if _serde::export::Option::is_some(&__field4) + { + return _serde::export::Err(<__A::Error + as + _serde::de::Error>::duplicate_field("clean")); + } + __field4 = + _serde::export::Some(match _serde::de::MapAccess::next_value::(&mut __map) + { + _serde::export::Ok(__val) + => + __val, + _serde::export::Err(__err) + => { + return _serde::export::Err(__err); + } + }); + } + } + } + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match __field0 { + _serde::export::Some(__field0) => + __field0, + _serde::export::None => + __default.parse_deps, + }; + let __field1 = + match __field1 { + _serde::export::Some(__field1) => + __field1, + _serde::export::None => + __default.include, + }; + let __field2 = + match __field2 { + _serde::export::Some(__field2) => + __field2, + _serde::export::None => + __default.exclude, + }; + let __field3 = + match __field3 { + _serde::export::Some(__field3) => + __field3, + _serde::export::None => + __default.expand, + }; + let __field4 = + match __field4 { + _serde::export::Some(__field4) => + __field4, + _serde::export::None => + __default.clean, + }; + _serde::export::Ok(ParseConfig{parse_deps: + __field0, + include: + __field1, + exclude: + __field2, + expand: + __field3, + clean: + __field4,}) + } + } + const FIELDS: &'static [&'static str] = + &["parse_deps", "include", "exclude", "expand", + "clean"]; + _serde::Deserializer::deserialize_struct(__deserializer, + "ParseConfig", + FIELDS, + __Visitor{marker: + _serde::export::PhantomData::, + lifetime: + _serde::export::PhantomData,}) + } + } + }; +#[allow(non_upper_case_globals, + unused_attributes, + unused_qualifications)] +const _IMPL_DESERIALIZE_FOR_Config: () = + { + #[allow(unknown_lints)] + #[allow(rust_2018_idioms)] + extern crate serde as _serde; + #[allow(unused_macros)] + macro_rules! try(( $ __expr : expr ) => { + match $ __expr { + _serde :: export :: Ok ( __val ) => __val , + _serde :: export :: Err ( __err ) => { + return _serde :: export :: Err ( __err ) ; } + } }); + #[automatically_derived] + impl <'de> _serde::Deserialize<'de> for Config where + Config<>: _serde::export::Default { + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __field2, + __field3, + __field4, + __field5, + __field6, + __field7, + __field8, + __field9, + __field10, + __field11, + __field12, + __field13, + __field14, + __field15, + __field16, + __field17, + __field18, + __field19, + __field20, + __field21, + __field22, + } + struct __FieldVisitor; + impl <'de> _serde::de::Visitor<'de> for __FieldVisitor + { + type + Value + = + __Field; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "field identifier") + } + fn visit_u64<__E>(self, __value: u64) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + 0u64 => + _serde::export::Ok(__Field::__field0), + 1u64 => + _serde::export::Ok(__Field::__field1), + 2u64 => + _serde::export::Ok(__Field::__field2), + 3u64 => + _serde::export::Ok(__Field::__field3), + 4u64 => + _serde::export::Ok(__Field::__field4), + 5u64 => + _serde::export::Ok(__Field::__field5), + 6u64 => + _serde::export::Ok(__Field::__field6), + 7u64 => + _serde::export::Ok(__Field::__field7), + 8u64 => + _serde::export::Ok(__Field::__field8), + 9u64 => + _serde::export::Ok(__Field::__field9), + 10u64 => + _serde::export::Ok(__Field::__field10), + 11u64 => + _serde::export::Ok(__Field::__field11), + 12u64 => + _serde::export::Ok(__Field::__field12), + 13u64 => + _serde::export::Ok(__Field::__field13), + 14u64 => + _serde::export::Ok(__Field::__field14), + 15u64 => + _serde::export::Ok(__Field::__field15), + 16u64 => + _serde::export::Ok(__Field::__field16), + 17u64 => + _serde::export::Ok(__Field::__field17), + 18u64 => + _serde::export::Ok(__Field::__field18), + 19u64 => + _serde::export::Ok(__Field::__field19), + 20u64 => + _serde::export::Ok(__Field::__field20), + 21u64 => + _serde::export::Ok(__Field::__field21), + 22u64 => + _serde::export::Ok(__Field::__field22), + _ => + _serde::export::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 23")), + } + } + fn visit_str<__E>(self, __value: &str) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + "header" => + _serde::export::Ok(__Field::__field0), + "includes" => + _serde::export::Ok(__Field::__field1), + "sys_includes" => + _serde::export::Ok(__Field::__field2), + "trailer" => + _serde::export::Ok(__Field::__field3), + "include_guard" => + _serde::export::Ok(__Field::__field4), + "no_includes" => + _serde::export::Ok(__Field::__field5), + "autogen_warning" => + _serde::export::Ok(__Field::__field6), + "include_version" => + _serde::export::Ok(__Field::__field7), + "namespace" => + _serde::export::Ok(__Field::__field8), + "namespaces" => + _serde::export::Ok(__Field::__field9), + "braces" => + _serde::export::Ok(__Field::__field10), + "line_length" => + _serde::export::Ok(__Field::__field11), + "tab_width" => + _serde::export::Ok(__Field::__field12), + "language" => + _serde::export::Ok(__Field::__field13), + "style" => + _serde::export::Ok(__Field::__field14), + "parse" => + _serde::export::Ok(__Field::__field15), + "export" => + _serde::export::Ok(__Field::__field16), + "fn" => + _serde::export::Ok(__Field::__field17), + "struct" => + _serde::export::Ok(__Field::__field18), + "enum" => + _serde::export::Ok(__Field::__field19), + "const" => + _serde::export::Ok(__Field::__field20), + "defines" => + _serde::export::Ok(__Field::__field21), + "documentation" => + _serde::export::Ok(__Field::__field22), + _ => { + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + fn visit_bytes<__E>(self, __value: &[u8]) + -> _serde::export::Result where + __E: _serde::de::Error { + match __value { + b"header" => + _serde::export::Ok(__Field::__field0), + b"includes" => + _serde::export::Ok(__Field::__field1), + b"sys_includes" => + _serde::export::Ok(__Field::__field2), + b"trailer" => + _serde::export::Ok(__Field::__field3), + b"include_guard" => + _serde::export::Ok(__Field::__field4), + b"no_includes" => + _serde::export::Ok(__Field::__field5), + b"autogen_warning" => + _serde::export::Ok(__Field::__field6), + b"include_version" => + _serde::export::Ok(__Field::__field7), + b"namespace" => + _serde::export::Ok(__Field::__field8), + b"namespaces" => + _serde::export::Ok(__Field::__field9), + b"braces" => + _serde::export::Ok(__Field::__field10), + b"line_length" => + _serde::export::Ok(__Field::__field11), + b"tab_width" => + _serde::export::Ok(__Field::__field12), + b"language" => + _serde::export::Ok(__Field::__field13), + b"style" => + _serde::export::Ok(__Field::__field14), + b"parse" => + _serde::export::Ok(__Field::__field15), + b"export" => + _serde::export::Ok(__Field::__field16), + b"fn" => + _serde::export::Ok(__Field::__field17), + b"struct" => + _serde::export::Ok(__Field::__field18), + b"enum" => + _serde::export::Ok(__Field::__field19), + b"const" => + _serde::export::Ok(__Field::__field20), + b"defines" => + _serde::export::Ok(__Field::__field21), + b"documentation" => + _serde::export::Ok(__Field::__field22), + _ => { + let __value = + &_serde::export::from_utf8_lossy(__value); + _serde::export::Err(_serde::de::Error::unknown_field(__value, + FIELDS)) + } + } + } + } + impl <'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) + -> _serde::export::Result where + __D: _serde::Deserializer<'de> { + _serde::Deserializer::deserialize_identifier(__deserializer, + __FieldVisitor) + } + } + struct __Visitor<'de> where + Config<>: _serde::export::Default { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl <'de> _serde::de::Visitor<'de> for __Visitor<'de> + where Config<>: _serde::export::Default { + type + Value + = + Config; + fn expecting(&self, + __formatter: + &mut _serde::export::Formatter) + -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, + "struct Config") + } + #[inline] + fn visit_seq<__A>(self, mut __seq: __A) + -> + _serde::export::Result where + __A: _serde::de::SeqAccess<'de> { + let __default: Self::Value = + _serde::export::Default::default(); + let __field0 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(0usize, + &"struct Config with 23 elements")); + } + }; + let __field1 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(1usize, + &"struct Config with 23 elements")); + } + }; + let __field2 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(2usize, + &"struct Config with 23 elements")); + } + }; + let __field3 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(3usize, + &"struct Config with 23 elements")); + } + }; + let __field4 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(4usize, + &"struct Config with 23 elements")); + } + }; + let __field5 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(5usize, + &"struct Config with 23 elements")); + } + }; + let __field6 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(6usize, + &"struct Config with 23 elements")); + } + }; + let __field7 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(7usize, + &"struct Config with 23 elements")); + } + }; + let __field8 = + match match _serde::de::SeqAccess::next_element::>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(8usize, + &"struct Config with 23 elements")); + } + }; + let __field9 = + match match _serde::de::SeqAccess::next_element::>>(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(9usize, + &"struct Config with 23 elements")); + } + }; + let __field10 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(10usize, + &"struct Config with 23 elements")); + } + }; + let __field11 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(11usize, + &"struct Config with 23 elements")); + } + }; + let __field12 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(12usize, + &"struct Config with 23 elements")); + } + }; + let __field13 = + match match _serde::de::SeqAccess::next_element::(&mut __seq) + { + _serde::export::Ok(__val) => + __val, + _serde::export::Err(__err) => { + return _serde::export::Err(__err); + } + } { + _serde::export::Some(__value) => + __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length(13usize, + &"struct Config with 23 elements")); + } + }; + let __field14 = + match match _serde::de::SeqAccess::next_element::